From e7d757ade8be04a5f55e40f0d5ba019e71d4aa31 Mon Sep 17 00:00:00 2001 From: ShirosakiMio <852468399@qq.com> Date: Tue, 11 Jul 2023 17:52:02 +0800 Subject: [PATCH] lwjgl3 build --- lwjgl3-fcl/build.gradle | 27 + .../src/main/java/org/lwjgl/BufferUtils.java | 229 + .../src/main/java/org/lwjgl/CLongBuffer.java | 407 + .../main/java/org/lwjgl/PointerBuffer.java | 674 ++ .../src/main/java/org/lwjgl/Version.java | 55 + .../main/java/org/lwjgl/glfw/Callbacks.java | 60 + .../main/java/org/lwjgl/glfw/EventLoop.java | 97 + .../main/java/org/lwjgl/glfw/FCLInjector.java | 142 + .../src/main/java/org/lwjgl/glfw/GLFW.java | 4758 ++++++++ .../java/org/lwjgl/glfw/GLFWCharCallback.java | 86 + .../org/lwjgl/glfw/GLFWCharCallbackI.java | 50 + .../org/lwjgl/glfw/GLFWCharModsCallback.java | 89 + .../org/lwjgl/glfw/GLFWCharModsCallbackI.java | 55 + .../lwjgl/glfw/GLFWCursorEnterCallback.java | 86 + .../lwjgl/glfw/GLFWCursorEnterCallbackI.java | 50 + .../org/lwjgl/glfw/GLFWCursorPosCallback.java | 87 + .../lwjgl/glfw/GLFWCursorPosCallbackI.java | 56 + .../java/org/lwjgl/glfw/GLFWDropCallback.java | 101 + .../org/lwjgl/glfw/GLFWDropCallbackI.java | 53 + .../org/lwjgl/glfw/GLFWErrorCallback.java | 152 + .../org/lwjgl/glfw/GLFWErrorCallbackI.java | 50 + .../glfw/GLFWFramebufferSizeCallback.java | 87 + .../glfw/GLFWFramebufferSizeCallbackI.java | 53 + .../java/org/lwjgl/glfw/GLFWGamepadState.java | 359 + .../java/org/lwjgl/glfw/GLFWGammaRamp.java | 384 + .../main/java/org/lwjgl/glfw/GLFWImage.java | 406 + .../org/lwjgl/glfw/GLFWJoystickCallback.java | 86 + .../org/lwjgl/glfw/GLFWJoystickCallbackI.java | 50 + .../java/org/lwjgl/glfw/GLFWKeyCallback.java | 87 + .../java/org/lwjgl/glfw/GLFWKeyCallbackI.java | 57 + .../org/lwjgl/glfw/GLFWMonitorCallback.java | 86 + .../org/lwjgl/glfw/GLFWMonitorCallbackI.java | 50 + .../lwjgl/glfw/GLFWMouseButtonCallback.java | 86 + .../lwjgl/glfw/GLFWMouseButtonCallbackI.java | 54 + .../java/org/lwjgl/glfw/GLFWNativeCocoa.java | 77 + .../java/org/lwjgl/glfw/GLFWNativeEGL.java | 94 + .../java/org/lwjgl/glfw/GLFWNativeGLX.java | 77 + .../java/org/lwjgl/glfw/GLFWNativeNSGL.java | 54 + .../java/org/lwjgl/glfw/GLFWNativeWGL.java | 54 + .../org/lwjgl/glfw/GLFWNativeWayland.java | 91 + .../java/org/lwjgl/glfw/GLFWNativeWin32.java | 146 + .../java/org/lwjgl/glfw/GLFWNativeX11.java | 199 + .../org/lwjgl/glfw/GLFWScrollCallback.java | 87 + .../org/lwjgl/glfw/GLFWScrollCallbackI.java | 53 + .../main/java/org/lwjgl/glfw/GLFWVidMode.java | 204 + .../lwjgl/glfw/GLFWWindowCloseCallback.java | 85 + .../lwjgl/glfw/GLFWWindowCloseCallbackI.java | 47 + .../glfw/GLFWWindowContentScaleCallback.java | 87 + .../glfw/GLFWWindowContentScaleCallbackI.java | 53 + .../lwjgl/glfw/GLFWWindowFocusCallback.java | 86 + .../lwjgl/glfw/GLFWWindowFocusCallbackI.java | 50 + .../lwjgl/glfw/GLFWWindowIconifyCallback.java | 86 + .../glfw/GLFWWindowIconifyCallbackI.java | 50 + .../glfw/GLFWWindowMaximizeCallback.java | 86 + .../glfw/GLFWWindowMaximizeCallbackI.java | 50 + .../org/lwjgl/glfw/GLFWWindowPosCallback.java | 87 + .../lwjgl/glfw/GLFWWindowPosCallbackI.java | 53 + .../lwjgl/glfw/GLFWWindowRefreshCallback.java | 85 + .../glfw/GLFWWindowRefreshCallbackI.java | 48 + .../lwjgl/glfw/GLFWWindowSizeCallback.java | 85 + .../lwjgl/glfw/GLFWWindowSizeCallbackI.java | 51 + .../java/org/lwjgl/glfw/package-info.java | 20 + .../src/main/java/org/lwjgl/openal/AL.java | 264 + .../src/main/java/org/lwjgl/openal/AL10.java | 1878 +++ .../src/main/java/org/lwjgl/openal/AL11.java | 433 + .../src/main/java/org/lwjgl/openal/ALC.java | 234 + .../src/main/java/org/lwjgl/openal/ALC10.java | 505 + .../src/main/java/org/lwjgl/openal/ALC11.java | 259 + .../org/lwjgl/openal/ALCCapabilities.java | 144 + .../java/org/lwjgl/openal/ALCapabilities.java | 373 + .../main/java/org/lwjgl/openal/ALUtil.java | 53 + .../main/java/org/lwjgl/openal/EXTAlaw.java | 18 + .../java/org/lwjgl/openal/EXTBFormat.java | 36 + .../java/org/lwjgl/openal/EXTCapture.java | 205 + .../java/org/lwjgl/openal/EXTDedicated.java | 29 + .../lwjgl/openal/EXTDefaultFilterOrder.java | 23 + .../java/org/lwjgl/openal/EXTDisconnect.java | 66 + .../main/java/org/lwjgl/openal/EXTDouble.java | 18 + .../main/java/org/lwjgl/openal/EXTEfx.java | 1878 +++ .../org/lwjgl/openal/EXTExponentDistance.java | 23 + .../java/org/lwjgl/openal/EXTFloat32.java | 18 + .../main/java/org/lwjgl/openal/EXTIma4.java | 18 + .../org/lwjgl/openal/EXTLinearDistance.java | 23 + .../java/org/lwjgl/openal/EXTMCFormats.java | 31 + .../main/java/org/lwjgl/openal/EXTMulaw.java | 18 + .../org/lwjgl/openal/EXTMulawBFormat.java | 24 + .../org/lwjgl/openal/EXTMulawMCFormats.java | 23 + .../main/java/org/lwjgl/openal/EXTOffset.java | 24 + .../lwjgl/openal/EXTSourceDistanceModel.java | 22 + .../org/lwjgl/openal/EXTSourceRadius.java | 23 + .../org/lwjgl/openal/EXTStaticBuffer.java | 132 + .../org/lwjgl/openal/EXTStereoAngles.java | 25 + .../lwjgl/openal/EXTThreadLocalContext.java | 60 + .../main/java/org/lwjgl/openal/EXTVorbis.java | 16 + .../org/lwjgl/openal/EnumerateAllExt.java | 26 + .../org/lwjgl/openal/LOKIAudioChannel.java | 19 + .../java/org/lwjgl/openal/LOKIIMAADPCM.java | 18 + .../org/lwjgl/openal/LOKIQuadriphonic.java | 18 + .../java/org/lwjgl/openal/LOKIWAVEFormat.java | 16 + .../org/lwjgl/openal/SOFTBlockAlignment.java | 23 + .../org/lwjgl/openal/SOFTDeferredUpdates.java | 72 + .../org/lwjgl/openal/SOFTDeviceClock.java | 138 + .../org/lwjgl/openal/SOFTDirectChannels.java | 26 + .../org/lwjgl/openal/SOFTGainClampEx.java | 32 + .../main/java/org/lwjgl/openal/SOFTHRTF.java | 141 + .../java/org/lwjgl/openal/SOFTLoopPoints.java | 21 + .../java/org/lwjgl/openal/SOFTLoopback.java | 244 + .../java/org/lwjgl/openal/SOFTMSADPCM.java | 22 + .../org/lwjgl/openal/SOFTOutputLimiter.java | 21 + .../org/lwjgl/openal/SOFTPauseDevice.java | 75 + .../org/lwjgl/openal/SOFTSourceLatency.java | 497 + .../org/lwjgl/openal/SOFTSourceLength.java | 30 + .../org/lwjgl/openal/SOFTSourceResampler.java | 64 + .../lwjgl/openal/SOFTSourceSpatialize.java | 25 + .../java/org/lwjgl/openal/package-info.java | 21 + .../lwjgl/opengl/AMDBlendMinmaxFactor.java | 31 + .../java/org/lwjgl/opengl/AMDDebugOutput.java | 338 + .../lwjgl/opengl/AMDDepthClampSeparate.java | 29 + .../org/lwjgl/opengl/AMDDrawBuffersBlend.java | 53 + .../AMDFramebufferMultisampleAdvanced.java | 62 + .../lwjgl/opengl/AMDGPUShaderHalfFloat.java | 44 + .../opengl/AMDGPUShaderHalfFloatFetch.java | 52 + .../org/lwjgl/opengl/AMDGPUShaderInt64.java | 475 + .../lwjgl/opengl/AMDInterleavedElements.java | 56 + .../lwjgl/opengl/AMDOcclusionQueryEvent.java | 61 + .../lwjgl/opengl/AMDPerformanceMonitor.java | 292 + .../org/lwjgl/opengl/AMDPinnedMemory.java | 23 + .../lwjgl/opengl/AMDQueryBufferObject.java | 43 + .../org/lwjgl/opengl/AMDSamplePositions.java | 64 + .../opengl/AMDSeamlessCubemapPerTexture.java | 34 + .../org/lwjgl/opengl/AMDSparseTexture.java | 70 + .../opengl/AMDStencilOperationExtended.java | 52 + .../lwjgl/opengl/AMDTransformFeedback4.java | 23 + .../opengl/AMDVertexShaderTessellator.java | 108 + .../org/lwjgl/opengl/ARBBaseInstance.java | 213 + .../org/lwjgl/opengl/ARBBindlessTexture.java | 398 + .../lwjgl/opengl/ARBBlendFuncExtended.java | 114 + .../org/lwjgl/opengl/ARBBufferStorage.java | 748 ++ .../lwjgl/opengl/ARBClearBufferObject.java | 410 + .../org/lwjgl/opengl/ARBClearTexture.java | 352 + .../java/org/lwjgl/opengl/ARBClipControl.java | 67 + .../org/lwjgl/opengl/ARBColorBufferFloat.java | 70 + .../ARBCompressedTexturePixelStorage.java | 41 + .../org/lwjgl/opengl/ARBComputeShader.java | 129 + .../opengl/ARBComputeVariableGroupSize.java | 75 + .../opengl/ARBConditionalRenderInverted.java | 26 + .../java/org/lwjgl/opengl/ARBCopyBuffer.java | 67 + .../java/org/lwjgl/opengl/ARBCopyImage.java | 68 + .../org/lwjgl/opengl/ARBCullDistance.java | 26 + .../java/org/lwjgl/opengl/ARBDebugOutput.java | 399 + .../org/lwjgl/opengl/ARBDepthBufferFloat.java | 40 + .../java/org/lwjgl/opengl/ARBDepthClamp.java | 37 + .../org/lwjgl/opengl/ARBDepthTexture.java | 34 + .../lwjgl/opengl/ARBDirectStateAccess.java | 3569 ++++++ .../java/org/lwjgl/opengl/ARBDrawBuffers.java | 85 + .../org/lwjgl/opengl/ARBDrawBuffersBlend.java | 120 + .../opengl/ARBDrawElementsBaseVertex.java | 340 + .../org/lwjgl/opengl/ARBDrawIndirect.java | 279 + .../org/lwjgl/opengl/ARBDrawInstanced.java | 127 + .../org/lwjgl/opengl/ARBES2Compatibility.java | 156 + .../lwjgl/opengl/ARBES31Compatibility.java | 76 + .../lwjgl/opengl/ARBES32Compatibility.java | 71 + .../org/lwjgl/opengl/ARBES3Compatibility.java | 43 + .../org/lwjgl/opengl/ARBEnhancedLayouts.java | 35 + .../opengl/ARBExplicitUniformLocation.java | 24 + .../org/lwjgl/opengl/ARBFragmentProgram.java | 74 + .../org/lwjgl/opengl/ARBFragmentShader.java | 32 + .../opengl/ARBFramebufferNoAttachments.java | 185 + .../lwjgl/opengl/ARBFramebufferObject.java | 731 ++ .../org/lwjgl/opengl/ARBFramebufferSRGB.java | 39 + .../java/org/lwjgl/opengl/ARBGLSPIRV.java | 172 + .../java/org/lwjgl/opengl/ARBGPUShader5.java | 78 + .../org/lwjgl/opengl/ARBGPUShaderFP64.java | 957 ++ .../org/lwjgl/opengl/ARBGPUShaderInt64.java | 901 ++ .../org/lwjgl/opengl/ARBGeometryShader4.java | 172 + .../org/lwjgl/opengl/ARBGetProgramBinary.java | 121 + .../lwjgl/opengl/ARBGetTextureSubImage.java | 315 + .../org/lwjgl/opengl/ARBHalfFloatPixel.java | 33 + .../org/lwjgl/opengl/ARBHalfFloatVertex.java | 31 + .../java/org/lwjgl/opengl/ARBImaging.java | 1317 ++ .../lwjgl/opengl/ARBIndirectParameters.java | 196 + .../org/lwjgl/opengl/ARBInstancedArrays.java | 81 + .../lwjgl/opengl/ARBInternalformatQuery.java | 82 + .../lwjgl/opengl/ARBInternalformatQuery2.java | 227 + .../lwjgl/opengl/ARBInvalidateSubdata.java | 194 + .../lwjgl/opengl/ARBMapBufferAlignment.java | 23 + .../org/lwjgl/opengl/ARBMapBufferRange.java | 119 + .../org/lwjgl/opengl/ARBMatrixPalette.java | 206 + .../java/org/lwjgl/opengl/ARBMultiBind.java | 344 + .../lwjgl/opengl/ARBMultiDrawIndirect.java | 275 + .../java/org/lwjgl/opengl/ARBMultisample.java | 78 + .../org/lwjgl/opengl/ARBMultitexture.java | 736 ++ .../org/lwjgl/opengl/ARBOcclusionQuery.java | 335 + .../org/lwjgl/opengl/ARBOcclusionQuery2.java | 25 + .../opengl/ARBParallelShaderCompile.java | 57 + .../opengl/ARBPipelineStatisticsQuery.java | 45 + .../lwjgl/opengl/ARBPixelBufferObject.java | 65 + .../org/lwjgl/opengl/ARBPointParameters.java | 94 + .../java/org/lwjgl/opengl/ARBPointSprite.java | 40 + .../lwjgl/opengl/ARBPolygonOffsetClamp.java | 60 + .../opengl/ARBProgramInterfaceQuery.java | 328 + .../org/lwjgl/opengl/ARBProvokingVertex.java | 68 + .../lwjgl/opengl/ARBQueryBufferObject.java | 47 + .../java/org/lwjgl/opengl/ARBRobustness.java | 1100 ++ .../org/lwjgl/opengl/ARBSPIRVExtensions.java | 39 + .../org/lwjgl/opengl/ARBSampleLocations.java | 138 + .../org/lwjgl/opengl/ARBSampleShading.java | 63 + .../org/lwjgl/opengl/ARBSamplerObjects.java | 390 + .../org/lwjgl/opengl/ARBSeamlessCubeMap.java | 34 + .../opengl/ARBSeamlessCubemapPerTexture.java | 37 + .../opengl/ARBSeparateShaderObjects.java | 1618 +++ .../lwjgl/opengl/ARBShaderAtomicCounters.java | 144 + .../lwjgl/opengl/ARBShaderImageLoadStore.java | 166 + .../org/lwjgl/opengl/ARBShaderObjects.java | 1319 ++ .../opengl/ARBShaderStorageBufferObject.java | 96 + .../org/lwjgl/opengl/ARBShaderSubroutine.java | 371 + .../lwjgl/opengl/ARBShadingLanguage100.java | 22 + .../opengl/ARBShadingLanguageInclude.java | 446 + .../main/java/org/lwjgl/opengl/ARBShadow.java | 33 + .../org/lwjgl/opengl/ARBShadowAmbient.java | 24 + .../org/lwjgl/opengl/ARBSparseBuffer.java | 79 + .../org/lwjgl/opengl/ARBSparseTexture.java | 156 + .../org/lwjgl/opengl/ARBStencilTexturing.java | 24 + .../main/java/org/lwjgl/opengl/ARBSync.java | 253 + .../lwjgl/opengl/ARBTessellationShader.java | 159 + .../org/lwjgl/opengl/ARBTextureBarrier.java | 40 + .../lwjgl/opengl/ARBTextureBorderClamp.java | 31 + .../lwjgl/opengl/ARBTextureBufferObject.java | 94 + .../lwjgl/opengl/ARBTextureBufferRange.java | 73 + .../lwjgl/opengl/ARBTextureCompression.java | 352 + .../opengl/ARBTextureCompressionBPTC.java | 36 + .../opengl/ARBTextureCompressionRGTC.java | 39 + .../org/lwjgl/opengl/ARBTextureCubeMap.java | 68 + .../lwjgl/opengl/ARBTextureCubeMapArray.java | 48 + .../lwjgl/opengl/ARBTextureEnvCombine.java | 58 + .../org/lwjgl/opengl/ARBTextureEnvDot3.java | 24 + .../opengl/ARBTextureFilterAnisotropic.java | 46 + .../lwjgl/opengl/ARBTextureFilterMinmax.java | 38 + .../org/lwjgl/opengl/ARBTextureFloat.java | 49 + .../org/lwjgl/opengl/ARBTextureGather.java | 26 + .../opengl/ARBTextureMirrorClampToEdge.java | 30 + .../opengl/ARBTextureMirroredRepeat.java | 28 + .../lwjgl/opengl/ARBTextureMultisample.java | 173 + .../java/org/lwjgl/opengl/ARBTextureRG.java | 59 + .../lwjgl/opengl/ARBTextureRGB10_A2UI.java | 28 + .../org/lwjgl/opengl/ARBTextureRectangle.java | 61 + .../org/lwjgl/opengl/ARBTextureStorage.java | 136 + .../opengl/ARBTextureStorageMultisample.java | 108 + .../org/lwjgl/opengl/ARBTextureSwizzle.java | 39 + .../java/org/lwjgl/opengl/ARBTextureView.java | 77 + .../java/org/lwjgl/opengl/ARBTimerQuery.java | 134 + .../lwjgl/opengl/ARBTransformFeedback2.java | 185 + .../lwjgl/opengl/ARBTransformFeedback3.java | 141 + .../opengl/ARBTransformFeedbackInstanced.java | 65 + .../ARBTransformFeedbackOverflowQuery.java | 28 + .../org/lwjgl/opengl/ARBTransposeMatrix.java | 167 + .../lwjgl/opengl/ARBUniformBufferObject.java | 490 + .../org/lwjgl/opengl/ARBVertexArrayBGRA.java | 56 + .../lwjgl/opengl/ARBVertexArrayObject.java | 127 + .../lwjgl/opengl/ARBVertexAttrib64Bit.java | 309 + .../lwjgl/opengl/ARBVertexAttribBinding.java | 239 + .../java/org/lwjgl/opengl/ARBVertexBlend.java | 405 + .../lwjgl/opengl/ARBVertexBufferObject.java | 818 ++ .../org/lwjgl/opengl/ARBVertexProgram.java | 1574 +++ .../org/lwjgl/opengl/ARBVertexShader.java | 1283 ++ .../opengl/ARBVertexType2_10_10_10_REV.java | 720 ++ .../org/lwjgl/opengl/ARBViewportArray.java | 291 + .../java/org/lwjgl/opengl/ARBWindowPos.java | 347 + .../java/org/lwjgl/opengl/ATIMeminfo.java | 28 + .../opengl/ATITextureCompression3DC.java | 16 + .../src/main/java/org/lwjgl/opengl/CGL.java | 1650 +++ .../java/org/lwjgl/opengl/EXT422Pixels.java | 36 + .../main/java/org/lwjgl/opengl/EXTABGR.java | 21 + .../main/java/org/lwjgl/opengl/EXTBGRA.java | 25 + .../org/lwjgl/opengl/EXTBindableUniform.java | 65 + .../java/org/lwjgl/opengl/EXTBlendColor.java | 48 + .../opengl/EXTBlendEquationSeparate.java | 49 + .../lwjgl/opengl/EXTBlendFuncSeparate.java | 45 + .../java/org/lwjgl/opengl/EXTBlendMinmax.java | 50 + .../org/lwjgl/opengl/EXTBlendSubtract.java | 26 + .../org/lwjgl/opengl/EXTClipVolumeHint.java | 22 + .../lwjgl/opengl/EXTCompiledVertexArray.java | 51 + .../java/org/lwjgl/opengl/EXTDebugLabel.java | 105 + .../java/org/lwjgl/opengl/EXTDebugMarker.java | 83 + .../org/lwjgl/opengl/EXTDepthBoundsTest.java | 65 + .../lwjgl/opengl/EXTDirectStateAccess.java | 4144 +++++++ .../org/lwjgl/opengl/EXTDrawBuffers2.java | 116 + .../org/lwjgl/opengl/EXTDrawInstanced.java | 65 + .../org/lwjgl/opengl/EXTEGLImageStorage.java | 93 + .../org/lwjgl/opengl/EXTExternalBuffer.java | 75 + .../org/lwjgl/opengl/EXTFramebufferBlit.java | 52 + .../opengl/EXTFramebufferMultisample.java | 84 + .../EXTFramebufferMultisampleBlitScaled.java | 38 + .../lwjgl/opengl/EXTFramebufferObject.java | 384 + .../org/lwjgl/opengl/EXTFramebufferSRGB.java | 42 + .../lwjgl/opengl/EXTGPUProgramParameters.java | 74 + .../java/org/lwjgl/opengl/EXTGPUShader4.java | 874 ++ .../org/lwjgl/opengl/EXTGeometryShader4.java | 106 + .../org/lwjgl/opengl/EXTMemoryObject.java | 286 + .../org/lwjgl/opengl/EXTMemoryObjectFD.java | 41 + .../lwjgl/opengl/EXTMemoryObjectWin32.java | 83 + .../lwjgl/opengl/EXTPackedDepthStencil.java | 84 + .../java/org/lwjgl/opengl/EXTPackedFloat.java | 41 + .../lwjgl/opengl/EXTPixelBufferObject.java | 31 + .../org/lwjgl/opengl/EXTPointParameters.java | 106 + .../lwjgl/opengl/EXTPolygonOffsetClamp.java | 56 + .../org/lwjgl/opengl/EXTProvokingVertex.java | 61 + .../lwjgl/opengl/EXTRasterMultisample.java | 86 + .../org/lwjgl/opengl/EXTSecondaryColor.java | 434 + .../java/org/lwjgl/opengl/EXTSemaphore.java | 266 + .../java/org/lwjgl/opengl/EXTSemaphoreFD.java | 41 + .../org/lwjgl/opengl/EXTSemaphoreWin32.java | 80 + .../opengl/EXTSeparateShaderObjects.java | 102 + .../opengl/EXTShaderFramebufferFetch.java | 42 + .../EXTShaderFramebufferFetchNonCoherent.java | 45 + .../lwjgl/opengl/EXTShaderImageLoadStore.java | 130 + .../lwjgl/opengl/EXTSharedTexturePalette.java | 28 + .../org/lwjgl/opengl/EXTStencilClearTag.java | 71 + .../org/lwjgl/opengl/EXTStencilTwoSide.java | 46 + .../java/org/lwjgl/opengl/EXTStencilWrap.java | 33 + .../org/lwjgl/opengl/EXTTextureArray.java | 96 + .../lwjgl/opengl/EXTTextureBufferObject.java | 67 + .../opengl/EXTTextureCompressionLATC.java | 35 + .../opengl/EXTTextureCompressionRGTC.java | 39 + .../opengl/EXTTextureCompressionS3TC.java | 33 + .../opengl/EXTTextureFilterAnisotropic.java | 44 + .../lwjgl/opengl/EXTTextureFilterMinmax.java | 38 + .../org/lwjgl/opengl/EXTTextureInteger.java | 260 + .../lwjgl/opengl/EXTTextureMirrorClamp.java | 31 + .../java/org/lwjgl/opengl/EXTTextureSRGB.java | 50 + .../lwjgl/opengl/EXTTextureSRGBDecode.java | 50 + .../org/lwjgl/opengl/EXTTextureSRGBR8.java | 26 + .../opengl/EXTTextureSharedExponent.java | 42 + .../org/lwjgl/opengl/EXTTextureSnorm.java | 54 + .../org/lwjgl/opengl/EXTTextureSwizzle.java | 37 + .../java/org/lwjgl/opengl/EXTTimerQuery.java | 117 + .../lwjgl/opengl/EXTTransformFeedback.java | 237 + .../lwjgl/opengl/EXTVertexAttrib64bit.java | 230 + .../org/lwjgl/opengl/EXTWin32KeyedMutex.java | 58 + .../org/lwjgl/opengl/EXTWindowRectangles.java | 122 + .../org/lwjgl/opengl/EXTX11SyncObject.java | 61 + .../src/main/java/org/lwjgl/opengl/GL.java | 728 ++ .../src/main/java/org/lwjgl/opengl/GL11.java | 10003 ++++++++++++++++ .../src/main/java/org/lwjgl/opengl/GL11C.java | 2661 ++++ .../src/main/java/org/lwjgl/opengl/GL12.java | 742 ++ .../src/main/java/org/lwjgl/opengl/GL12C.java | 745 ++ .../src/main/java/org/lwjgl/opengl/GL13.java | 1501 +++ .../src/main/java/org/lwjgl/opengl/GL13C.java | 489 + .../src/main/java/org/lwjgl/opengl/GL14.java | 1307 ++ .../src/main/java/org/lwjgl/opengl/GL14C.java | 318 + .../src/main/java/org/lwjgl/opengl/GL15.java | 1200 ++ .../src/main/java/org/lwjgl/opengl/GL15C.java | 1311 ++ .../src/main/java/org/lwjgl/opengl/GL20.java | 2703 +++++ .../src/main/java/org/lwjgl/opengl/GL20C.java | 2962 +++++ .../src/main/java/org/lwjgl/opengl/GL21.java | 279 + .../src/main/java/org/lwjgl/opengl/GL21C.java | 277 + .../src/main/java/org/lwjgl/opengl/GL30.java | 2692 +++++ .../src/main/java/org/lwjgl/opengl/GL30C.java | 2907 +++++ .../src/main/java/org/lwjgl/opengl/GL31.java | 668 ++ .../src/main/java/org/lwjgl/opengl/GL31C.java | 739 ++ .../src/main/java/org/lwjgl/opengl/GL32.java | 907 ++ .../src/main/java/org/lwjgl/opengl/GL32C.java | 966 ++ .../src/main/java/org/lwjgl/opengl/GL33.java | 1598 +++ .../src/main/java/org/lwjgl/opengl/GL33C.java | 1023 ++ .../src/main/java/org/lwjgl/opengl/GL40.java | 1721 +++ .../src/main/java/org/lwjgl/opengl/GL40C.java | 1862 +++ .../src/main/java/org/lwjgl/opengl/GL41.java | 2653 ++++ .../src/main/java/org/lwjgl/opengl/GL41C.java | 2794 +++++ .../src/main/java/org/lwjgl/opengl/GL42.java | 620 + .../src/main/java/org/lwjgl/opengl/GL42C.java | 617 + .../src/main/java/org/lwjgl/opengl/GL43.java | 2223 ++++ .../src/main/java/org/lwjgl/opengl/GL43C.java | 2382 ++++ .../src/main/java/org/lwjgl/opengl/GL44.java | 1178 ++ .../src/main/java/org/lwjgl/opengl/GL44C.java | 1239 ++ .../src/main/java/org/lwjgl/opengl/GL45.java | 5712 +++++++++ .../src/main/java/org/lwjgl/opengl/GL45C.java | 5639 +++++++++ .../src/main/java/org/lwjgl/opengl/GL46.java | 379 + .../src/main/java/org/lwjgl/opengl/GL46C.java | 422 + .../java/org/lwjgl/opengl/GLCapabilities.java | 6844 +++++++++++ .../main/java/org/lwjgl/opengl/GLChecks.java | 109 + .../opengl/GLDebugMessageAMDCallback.java | 94 + .../opengl/GLDebugMessageAMDCallbackI.java | 60 + .../opengl/GLDebugMessageARBCallback.java | 95 + .../opengl/GLDebugMessageARBCallbackI.java | 63 + .../lwjgl/opengl/GLDebugMessageCallback.java | 95 + .../lwjgl/opengl/GLDebugMessageCallbackI.java | 63 + .../main/java/org/lwjgl/opengl/GLUtil.java | 256 + .../src/main/java/org/lwjgl/opengl/GLX.java | 483 + .../src/main/java/org/lwjgl/opengl/GLX11.java | 111 + .../src/main/java/org/lwjgl/opengl/GLX12.java | 38 + .../src/main/java/org/lwjgl/opengl/GLX13.java | 617 + .../src/main/java/org/lwjgl/opengl/GLX14.java | 108 + .../lwjgl/opengl/GLXAMDGPUAssociation.java | 207 + .../opengl/GLXARBContextFlushControl.java | 29 + .../org/lwjgl/opengl/GLXARBCreateContext.java | 113 + .../opengl/GLXARBCreateContextNoError.java | 23 + .../opengl/GLXARBCreateContextProfile.java | 30 + .../opengl/GLXARBCreateContextRobustness.java | 36 + .../org/lwjgl/opengl/GLXARBFBConfigFloat.java | 26 + .../lwjgl/opengl/GLXARBFramebufferSRGB.java | 20 + .../lwjgl/opengl/GLXARBGetProcAddress.java | 111 + .../org/lwjgl/opengl/GLXARBMultisample.java | 22 + .../GLXARBRobustnessApplicationIsolation.java | 34 + .../opengl/GLXARBVertexBufferObject.java | 27 + .../org/lwjgl/opengl/GLXCapabilities.java | 330 + .../org/lwjgl/opengl/GLXEXTBufferAge.java | 23 + .../lwjgl/opengl/GLXEXTContextPriority.java | 30 + .../opengl/GLXEXTCreateContextES2Profile.java | 22 + .../opengl/GLXEXTCreateContextESProfile.java | 22 + .../opengl/GLXEXTFBConfigPackedFloat.java | 37 + .../lwjgl/opengl/GLXEXTFramebufferSRGB.java | 20 + .../org/lwjgl/opengl/GLXEXTImportContext.java | 146 + .../org/lwjgl/opengl/GLXEXTStereoTree.java | 37 + .../org/lwjgl/opengl/GLXEXTSwapControl.java | 57 + .../lwjgl/opengl/GLXEXTSwapControlTear.java | 24 + .../lwjgl/opengl/GLXEXTTextureFromPixmap.java | 154 + .../org/lwjgl/opengl/GLXEXTVisualInfo.java | 53 + .../org/lwjgl/opengl/GLXEXTVisualRating.java | 35 + .../org/lwjgl/opengl/GLXINTELSwapEvent.java | 29 + .../org/lwjgl/opengl/GLXNVCopyBuffer.java | 58 + .../java/org/lwjgl/opengl/GLXNVCopyImage.java | 52 + .../lwjgl/opengl/GLXNVDelayBeforeSwap.java | 71 + .../org/lwjgl/opengl/GLXNVFloatBuffer.java | 20 + .../opengl/GLXNVMultisampleCoverage.java | 25 + .../GLXNVRobustnessVideoMemoryPurge.java | 20 + .../java/org/lwjgl/opengl/GLXNVSwapGroup.java | 185 + .../lwjgl/opengl/GLXSGIMakeCurrentRead.java | 64 + .../org/lwjgl/opengl/GLXSGISwapControl.java | 51 + .../org/lwjgl/opengl/GLXSGIVideoSync.java | 111 + .../org/lwjgl/opengl/GLXSGIXFBConfig.java | 272 + .../java/org/lwjgl/opengl/GLXSGIXPbuffer.java | 236 + .../org/lwjgl/opengl/GLXSGIXSwapBarrier.java | 94 + .../org/lwjgl/opengl/GLXSGIXSwapGroup.java | 54 + .../lwjgl/opengl/GLXStereoNotifyEventEXT.java | 233 + .../java/org/lwjgl/opengl/GPU_DEVICE.java | 339 + .../lwjgl/opengl/GREMEDYFrameTerminator.java | 51 + .../org/lwjgl/opengl/GREMEDYStringMarker.java | 83 + .../lwjgl/opengl/INTELBlackholeRender.java | 28 + .../INTELConservativeRasterization.java | 31 + .../lwjgl/opengl/INTELFramebufferCMAA.java | 51 + .../org/lwjgl/opengl/INTELMapTexture.java | 209 + .../lwjgl/opengl/INTELPerformanceQuery.java | 355 + .../opengl/KHRBlendEquationAdvanced.java | 97 + .../KHRBlendEquationAdvancedCoherent.java | 26 + .../lwjgl/opengl/KHRContextFlushControl.java | 37 + .../main/java/org/lwjgl/opengl/KHRDebug.java | 641 + .../java/org/lwjgl/opengl/KHRNoError.java | 25 + .../opengl/KHRParallelShaderCompile.java | 55 + .../java/org/lwjgl/opengl/KHRRobustness.java | 343 + .../org/lwjgl/opengl/KHRShaderSubgroup.java | 51 + .../opengl/KHRTextureCompressionASTCLDR.java | 80 + .../NVAlphaToCoverageDitherControl.java | 45 + .../opengl/NVBindlessMultiDrawIndirect.java | 175 + .../NVBindlessMultiDrawIndirectCount.java | 123 + .../org/lwjgl/opengl/NVBindlessTexture.java | 327 + .../lwjgl/opengl/NVBlendEquationAdvanced.java | 103 + .../NVBlendEquationAdvancedCoherent.java | 26 + .../org/lwjgl/opengl/NVBlendMinmaxFactor.java | 31 + .../org/lwjgl/opengl/NVClipSpaceWScaling.java | 84 + .../java/org/lwjgl/opengl/NVCommandList.java | 668 ++ .../org/lwjgl/opengl/NVConditionalRender.java | 59 + .../lwjgl/opengl/NVConservativeRaster.java | 65 + .../opengl/NVConservativeRasterDilate.java | 48 + .../opengl/NVConservativeRasterPreSnap.java | 24 + .../NVConservativeRasterPreSnapTriangles.java | 66 + .../org/lwjgl/opengl/NVCopyDepthToColor.java | 29 + .../java/org/lwjgl/opengl/NVCopyImage.java | 38 + .../org/lwjgl/opengl/NVDeepTexture3D.java | 24 + .../org/lwjgl/opengl/NVDepthBufferFloat.java | 73 + .../java/org/lwjgl/opengl/NVDepthClamp.java | 36 + .../java/org/lwjgl/opengl/NVDrawTexture.java | 42 + .../org/lwjgl/opengl/NVDrawVulkanImage.java | 132 + .../lwjgl/opengl/NVExplicitMultisample.java | 102 + .../main/java/org/lwjgl/opengl/NVFence.java | 165 + .../org/lwjgl/opengl/NVFillRectangle.java | 22 + .../java/org/lwjgl/opengl/NVFloatBuffer.java | 41 + .../java/org/lwjgl/opengl/NVFogDistance.java | 44 + .../opengl/NVFragmentCoverageToColor.java | 49 + .../opengl/NVFramebufferMixedSamples.java | 143 + .../NVFramebufferMultisampleCoverage.java | 56 + .../java/org/lwjgl/opengl/NVGPUMulticast.java | 315 + .../java/org/lwjgl/opengl/NVGPUShader5.java | 514 + .../java/org/lwjgl/opengl/NVHalfFloat.java | 655 + .../opengl/NVInternalformatSampleQuery.java | 82 + .../org/lwjgl/opengl/NVLightMaxExponent.java | 23 + .../org/lwjgl/opengl/NVMemoryAttachment.java | 106 + .../java/org/lwjgl/opengl/NVMeshShader.java | 130 + .../lwjgl/opengl/NVMultisampleCoverage.java | 33 + .../lwjgl/opengl/NVMultisampleFilterHint.java | 27 + .../lwjgl/opengl/NVPackedDepthStencil.java | 30 + .../org/lwjgl/opengl/NVPathRendering.java | 1713 +++ .../opengl/NVPathRenderingSharedEdge.java | 27 + .../org/lwjgl/opengl/NVPixelDataRange.java | 94 + .../java/org/lwjgl/opengl/NVPointSprite.java | 91 + .../org/lwjgl/opengl/NVPrimitiveRestart.java | 60 + .../org/lwjgl/opengl/NVQueryResource.java | 79 + .../org/lwjgl/opengl/NVQueryResourceTag.java | 118 + .../opengl/NVRepresentativeFragmentTest.java | 38 + .../opengl/NVRobustnessVideoMemoryPurge.java | 32 + .../org/lwjgl/opengl/NVSampleLocations.java | 135 + .../org/lwjgl/opengl/NVScissorExclusive.java | 79 + .../org/lwjgl/opengl/NVShaderBufferLoad.java | 316 + .../org/lwjgl/opengl/NVShaderBufferStore.java | 26 + .../opengl/NVShaderSubgroupPartitioned.java | 26 + .../org/lwjgl/opengl/NVShaderThreadGroup.java | 27 + .../org/lwjgl/opengl/NVShadingRateImage.java | 187 + .../org/lwjgl/opengl/NVTexgenReflection.java | 22 + .../org/lwjgl/opengl/NVTextureBarrier.java | 36 + .../lwjgl/opengl/NVTextureMultisample.java | 64 + .../org/lwjgl/opengl/NVTransformFeedback.java | 295 + .../lwjgl/opengl/NVTransformFeedback2.java | 140 + .../opengl/NVUniformBufferUnifiedMemory.java | 34 + .../org/lwjgl/opengl/NVVertexArrayRange.java | 59 + .../org/lwjgl/opengl/NVVertexArrayRange2.java | 27 + .../opengl/NVVertexAttribInteger64bit.java | 321 + .../opengl/NVVertexBufferUnifiedMemory.java | 156 + .../org/lwjgl/opengl/NVViewportSwizzle.java | 69 + .../lwjgl/opengl/NVXConditionalRender.java | 46 + .../org/lwjgl/opengl/NVXGPUMemoryInfo.java | 28 + .../org/lwjgl/opengl/NVXGpuMulticast2.java | 130 + .../org/lwjgl/opengl/NVXProgressFence.java | 114 + .../java/org/lwjgl/opengl/OVRMultiview.java | 128 + .../src/main/java/org/lwjgl/opengl/WGL.java | 253 + .../lwjgl/opengl/WGLAMDGPUAssociation.java | 332 + .../org/lwjgl/opengl/WGLARBBufferRegion.java | 129 + .../opengl/WGLARBContextFlushControl.java | 29 + .../org/lwjgl/opengl/WGLARBCreateContext.java | 96 + .../opengl/WGLARBCreateContextNoError.java | 23 + .../opengl/WGLARBCreateContextProfile.java | 30 + .../opengl/WGLARBCreateContextRobustness.java | 36 + .../lwjgl/opengl/WGLARBExtensionsString.java | 60 + .../lwjgl/opengl/WGLARBFramebufferSRGB.java | 25 + .../lwjgl/opengl/WGLARBMakeCurrentRead.java | 91 + .../org/lwjgl/opengl/WGLARBMultisample.java | 28 + .../java/org/lwjgl/opengl/WGLARBPbuffer.java | 212 + .../org/lwjgl/opengl/WGLARBPixelFormat.java | 284 + .../lwjgl/opengl/WGLARBPixelFormatFloat.java | 25 + .../org/lwjgl/opengl/WGLARBRenderTexture.java | 198 + .../WGLARBRobustnessApplicationIsolation.java | 34 + .../lwjgl/opengl/WGLATIPixelFormatFloat.java | 37 + .../opengl/WGLATIRenderTextureRectangle.java | 25 + .../org/lwjgl/opengl/WGLCapabilities.java | 289 + .../org/lwjgl/opengl/WGLEXTColorspace.java | 28 + .../opengl/WGLEXTCreateContextES2Profile.java | 22 + .../opengl/WGLEXTCreateContextESProfile.java | 22 + .../org/lwjgl/opengl/WGLEXTDepthFloat.java | 27 + .../lwjgl/opengl/WGLEXTExtensionsString.java | 52 + .../lwjgl/opengl/WGLEXTFramebufferSRGB.java | 25 + .../opengl/WGLEXTPixelFormatPackedFloat.java | 26 + .../org/lwjgl/opengl/WGLEXTSwapControl.java | 69 + .../java/org/lwjgl/opengl/WGLNVCopyImage.java | 68 + .../java/org/lwjgl/opengl/WGLNVDXInterop.java | 203 + .../lwjgl/opengl/WGLNVDelayBeforeSwap.java | 75 + .../org/lwjgl/opengl/WGLNVFloatBuffer.java | 38 + .../org/lwjgl/opengl/WGLNVGPUAffinity.java | 176 + .../lwjgl/opengl/WGLNVMultigpuContext.java | 43 + .../opengl/WGLNVMultisampleCoverage.java | 25 + .../lwjgl/opengl/WGLNVRenderDepthTexture.java | 40 + .../opengl/WGLNVRenderTextureRectangle.java | 33 + .../java/org/lwjgl/opengl/WGLNVSwapGroup.java | 172 + .../lwjgl/opengl/WGLNVVertexArrayRange.java | 61 + .../java/org/lwjgl/opengl/package-info.java | 41 + .../src/main/java/org/lwjgl/package-info.java | 22 + .../src/main/java/org/lwjgl/stb/LibSTB.java | 46 + .../src/main/java/org/lwjgl/stb/STBDXT.java | 96 + .../main/java/org/lwjgl/stb/STBEasyFont.java | 241 + .../java/org/lwjgl/stb/STBIEOFCallback.java | 75 + .../java/org/lwjgl/stb/STBIEOFCallbackI.java | 47 + .../java/org/lwjgl/stb/STBIIOCallbacks.java | 361 + .../java/org/lwjgl/stb/STBIReadCallback.java | 93 + .../java/org/lwjgl/stb/STBIReadCallbackI.java | 53 + .../java/org/lwjgl/stb/STBISkipCallback.java | 76 + .../java/org/lwjgl/stb/STBISkipCallbackI.java | 48 + .../java/org/lwjgl/stb/STBIWriteCallback.java | 93 + .../org/lwjgl/stb/STBIWriteCallbackI.java | 51 + .../java/org/lwjgl/stb/STBIZlibCompress.java | 78 + .../java/org/lwjgl/stb/STBIZlibCompressI.java | 58 + .../src/main/java/org/lwjgl/stb/STBImage.java | 1322 ++ .../java/org/lwjgl/stb/STBImageResize.java | 790 ++ .../java/org/lwjgl/stb/STBImageWrite.java | 611 + .../main/java/org/lwjgl/stb/STBPerlin.java | 108 + .../main/java/org/lwjgl/stb/STBRPContext.java | 364 + .../main/java/org/lwjgl/stb/STBRPNode.java | 285 + .../main/java/org/lwjgl/stb/STBRPRect.java | 398 + .../main/java/org/lwjgl/stb/STBRectPack.java | 147 + .../java/org/lwjgl/stb/STBTTAlignedQuad.java | 327 + .../java/org/lwjgl/stb/STBTTBakedChar.java | 325 + .../main/java/org/lwjgl/stb/STBTTBitmap.java | 382 + .../java/org/lwjgl/stb/STBTTFontinfo.java | 236 + .../java/org/lwjgl/stb/STBTTPackContext.java | 387 + .../java/org/lwjgl/stb/STBTTPackRange.java | 439 + .../java/org/lwjgl/stb/STBTTPackedchar.java | 439 + .../main/java/org/lwjgl/stb/STBTTVertex.java | 331 + .../main/java/org/lwjgl/stb/STBTruetype.java | 2157 ++++ .../main/java/org/lwjgl/stb/STBVorbis.java | 967 ++ .../java/org/lwjgl/stb/STBVorbisAlloc.java | 314 + .../java/org/lwjgl/stb/STBVorbisInfo.java | 315 + .../main/java/org/lwjgl/stb/package-info.java | 24 + .../main/java/org/lwjgl/system/APIUtil.java | 520 + .../main/java/org/lwjgl/system/Callback.java | 223 + .../main/java/org/lwjgl/system/CallbackI.java | 156 + .../org/lwjgl/system/CheckIntrinsics.java | 38 + .../main/java/org/lwjgl/system/Checks.java | 464 + .../java/org/lwjgl/system/Configuration.java | 526 + .../java/org/lwjgl/system/CustomBuffer.java | 433 + .../org/lwjgl/system/FunctionProvider.java | 31 + .../lwjgl/system/FunctionProviderLocal.java | 31 + .../src/main/java/org/lwjgl/system/JNI.java | 800 ++ .../main/java/org/lwjgl/system/Library.java | 578 + .../org/lwjgl/system/LibraryResource.java | 224 + .../main/java/org/lwjgl/system/MathUtil.java | 171 + .../org/lwjgl/system/MemoryAccessJNI.java | 322 + .../java/org/lwjgl/system/MemoryManage.java | 405 + .../java/org/lwjgl/system/MemoryStack.java | 1011 ++ .../java/org/lwjgl/system/MemoryUtil.java | 3013 +++++ .../org/lwjgl/system/MultiReleaseMemCopy.java | 30 + .../system/MultiReleaseTextDecoding.java | 73 + .../java/org/lwjgl/system/NativeResource.java | 23 + .../java/org/lwjgl/system/NativeType.java | 14 + .../java/org/lwjgl/system/NonnullDefault.java | 15 + .../main/java/org/lwjgl/system/Platform.java | 189 + .../main/java/org/lwjgl/system/Pointer.java | 157 + .../java/org/lwjgl/system/SharedLibrary.java | 76 + .../org/lwjgl/system/SharedLibraryLoader.java | 321 + .../java/org/lwjgl/system/StackWalkUtil.java | 104 + .../main/java/org/lwjgl/system/Struct.java | 283 + .../java/org/lwjgl/system/StructBuffer.java | 316 + .../org/lwjgl/system/ThreadLocalUtil.java | 228 + .../org/lwjgl/system/dyncall/DynCall.java | 789 ++ .../org/lwjgl/system/dyncall/DynCallback.java | 422 + .../org/lwjgl/system/dyncall/DynLoad.java | 290 + .../lwjgl/system/dyncall/package-info.java | 26 + .../lwjgl/system/fcl/DynamicLinkLoader.java | 168 + .../java/org/lwjgl/system/fcl/FCLLibrary.java | 47 + .../org/lwjgl/system/fcl/package-info.java | 10 + .../lwjgl/system/jemalloc/ExtentAlloc.java | 81 + .../lwjgl/system/jemalloc/ExtentAllocI.java | 65 + .../lwjgl/system/jemalloc/ExtentCommit.java | 80 + .../lwjgl/system/jemalloc/ExtentCommitI.java | 59 + .../lwjgl/system/jemalloc/ExtentDalloc.java | 79 + .../lwjgl/system/jemalloc/ExtentDallocI.java | 56 + .../lwjgl/system/jemalloc/ExtentDecommit.java | 80 + .../system/jemalloc/ExtentDecommitI.java | 58 + .../lwjgl/system/jemalloc/ExtentDestroy.java | 79 + .../lwjgl/system/jemalloc/ExtentDestroyI.java | 55 + .../lwjgl/system/jemalloc/ExtentHooks.java | 329 + .../lwjgl/system/jemalloc/ExtentMerge.java | 81 + .../lwjgl/system/jemalloc/ExtentMergeI.java | 60 + .../lwjgl/system/jemalloc/ExtentPurge.java | 80 + .../lwjgl/system/jemalloc/ExtentPurgeI.java | 59 + .../lwjgl/system/jemalloc/ExtentSplit.java | 81 + .../lwjgl/system/jemalloc/ExtentSplitI.java | 60 + .../org/lwjgl/system/jemalloc/JEmalloc.java | 882 ++ .../system/jemalloc/JEmallocAllocator.java | 68 + .../jemalloc/MallocMessageCallback.java | 89 + .../jemalloc/MallocMessageCallbackI.java | 48 + .../lwjgl/system/jemalloc/package-info.java | 33 + .../lwjgl/system/jni/JNINativeInterface.java | 1133 ++ .../org/lwjgl/system/jni/JNINativeMethod.java | 372 + .../org/lwjgl/system/jni/package-info.java | 10 + .../java/org/lwjgl/system/libc/LibCErrno.java | 134 + .../org/lwjgl/system/libc/LibCLocale.java | 128 + .../java/org/lwjgl/system/libc/LibCStdio.java | 156 + .../org/lwjgl/system/libc/LibCStdlib.java | 249 + .../org/lwjgl/system/libc/LibCString.java | 585 + .../org/lwjgl/system/libc/package-info.java | 10 + .../lwjgl/system/linux/DynamicLinkLoader.java | 168 + .../org/lwjgl/system/linux/LinuxLibrary.java | 47 + .../java/org/lwjgl/system/linux/Visual.java | 422 + .../main/java/org/lwjgl/system/linux/X11.java | 839 ++ .../org/lwjgl/system/linux/XAnyEvent.java | 398 + .../org/lwjgl/system/linux/XButtonEvent.java | 600 + .../lwjgl/system/linux/XCirculateEvent.java | 433 + .../system/linux/XCirculateRequestEvent.java | 433 + .../system/linux/XClientMessageEvent.java | 566 + .../lwjgl/system/linux/XColormapEvent.java | 453 + .../lwjgl/system/linux/XConfigureEvent.java | 527 + .../system/linux/XConfigureRequestEvent.java | 563 + .../system/linux/XCreateWindowEvent.java | 530 + .../lwjgl/system/linux/XCrossingEvent.java | 631 + .../system/linux/XDestroyWindowEvent.java | 414 + .../org/lwjgl/system/linux/XErrorEvent.java | 439 + .../java/org/lwjgl/system/linux/XEvent.java | 595 + .../org/lwjgl/system/linux/XExposeEvent.java | 486 + .../lwjgl/system/linux/XFocusChangeEvent.java | 434 + .../org/lwjgl/system/linux/XGenericEvent.java | 415 + .../system/linux/XGenericEventCookie.java | 464 + .../system/linux/XGraphicsExposeEvent.java | 523 + .../org/lwjgl/system/linux/XGravityEvent.java | 450 + .../org/lwjgl/system/linux/XKeyEvent.java | 600 + .../org/lwjgl/system/linux/XKeymapEvent.java | 438 + .../org/lwjgl/system/linux/XMapEvent.java | 433 + .../lwjgl/system/linux/XMapRequestEvent.java | 414 + .../org/lwjgl/system/linux/XMappingEvent.java | 452 + .../org/lwjgl/system/linux/XMotionEvent.java | 600 + .../lwjgl/system/linux/XNoExposeEvent.java | 432 + .../lwjgl/system/linux/XPropertyEvent.java | 456 + .../lwjgl/system/linux/XReparentEvent.java | 488 + .../system/linux/XResizeRequestEvent.java | 431 + .../system/linux/XSelectionClearEvent.java | 435 + .../lwjgl/system/linux/XSelectionEvent.java | 477 + .../system/linux/XSelectionRequestEvent.java | 496 + .../system/linux/XSetWindowAttributes.java | 558 + .../org/lwjgl/system/linux/XTimeCoord.java | 170 + .../org/lwjgl/system/linux/XUnmapEvent.java | 432 + .../lwjgl/system/linux/XVisibilityEvent.java | 414 + .../org/lwjgl/system/linux/XVisualInfo.java | 480 + .../org/lwjgl/system/linux/package-info.java | 10 + .../system/macosx/CGEventTapCallBack.java | 78 + .../system/macosx/CGEventTapCallBackI.java | 55 + .../system/macosx/CGEventTapInformation.java | 374 + .../java/org/lwjgl/system/macosx/CGPoint.java | 315 + .../lwjgl/system/macosx/CoreFoundation.java | 268 + .../org/lwjgl/system/macosx/CoreGraphics.java | 1001 ++ .../system/macosx/DynamicLinkLoader.java | 290 + .../macosx/EnumerationMutationHandler.java | 75 + .../macosx/EnumerationMutationHandlerI.java | 45 + .../java/org/lwjgl/system/macosx/LibC.java | 40 + .../org/lwjgl/system/macosx/LibSystem.java | 30 + .../lwjgl/system/macosx/MacOSXLibrary.java | 32 + .../system/macosx/MacOSXLibraryBundle.java | 90 + .../lwjgl/system/macosx/MacOSXLibraryDL.java | 47 + .../system/macosx/ObjCMethodDescription.java | 286 + .../system/macosx/ObjCPropertyAttribute.java | 361 + .../org/lwjgl/system/macosx/ObjCRuntime.java | 3393 ++++++ .../org/lwjgl/system/macosx/package-info.java | 10 + .../java/org/lwjgl/system/package-info.java | 33 + .../org/lwjgl/system/windows/DEVMODE.java | 828 ++ .../lwjgl/system/windows/DISPLAY_DEVICE.java | 386 + .../java/org/lwjgl/system/windows/GDI32.java | 286 + .../lwjgl/system/windows/HARDWAREINPUT.java | 336 + .../java/org/lwjgl/system/windows/INPUT.java | 358 + .../org/lwjgl/system/windows/KEYBDINPUT.java | 384 + .../lwjgl/system/windows/MONITORINFOEX.java | 351 + .../org/lwjgl/system/windows/MOUSEINPUT.java | 425 + .../java/org/lwjgl/system/windows/MSG.java | 401 + .../system/windows/PIXELFORMATDESCRIPTOR.java | 825 ++ .../java/org/lwjgl/system/windows/POINT.java | 315 + .../java/org/lwjgl/system/windows/POINTL.java | 315 + .../java/org/lwjgl/system/windows/RECT.java | 357 + .../system/windows/SECURITY_ATTRIBUTES.java | 364 + .../org/lwjgl/system/windows/TOUCHINPUT.java | 395 + .../java/org/lwjgl/system/windows/User32.java | 2842 +++++ .../lwjgl/system/windows/WINDOWPLACEMENT.java | 407 + .../org/lwjgl/system/windows/WNDCLASSEX.java | 579 + .../org/lwjgl/system/windows/WinBase.java | 222 + .../org/lwjgl/system/windows/WindowProc.java | 78 + .../org/lwjgl/system/windows/WindowProcI.java | 54 + .../lwjgl/system/windows/WindowsLibrary.java | 62 + .../org/lwjgl/system/windows/WindowsUtil.java | 18 + .../lwjgl/system/windows/package-info.java | 10 + .../lwjgl/util/tinyfd/TinyFileDialogs.java | 526 + .../org/lwjgl/util/tinyfd/package-info.java | 10 + settings.gradle | 1 + 754 files changed, 230112 insertions(+) create mode 100644 lwjgl3-fcl/build.gradle create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/BufferUtils.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/CLongBuffer.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/PointerBuffer.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/Version.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/Callbacks.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/EventLoop.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/FCLInjector.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFW.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCharCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCharCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCharModsCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCharModsCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCursorEnterCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCursorEnterCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCursorPosCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCursorPosCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWDropCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWDropCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWErrorCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWErrorCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWFramebufferSizeCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWFramebufferSizeCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWGamepadState.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWGammaRamp.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWImage.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWJoystickCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWJoystickCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWKeyCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWKeyCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWMonitorCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWMonitorCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWMouseButtonCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWMouseButtonCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeCocoa.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeEGL.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeGLX.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeNSGL.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeWGL.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeWayland.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeWin32.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeX11.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWScrollCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWScrollCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWVidMode.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowCloseCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowCloseCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowContentScaleCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowContentScaleCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowFocusCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowFocusCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowIconifyCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowIconifyCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowMaximizeCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowMaximizeCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowPosCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowPosCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowRefreshCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowRefreshCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowSizeCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowSizeCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/glfw/package-info.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/AL.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/AL10.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/AL11.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALC.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALC10.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALC11.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALCCapabilities.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALCapabilities.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALUtil.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTAlaw.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTBFormat.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTCapture.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTDedicated.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTDefaultFilterOrder.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTDisconnect.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTDouble.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTEfx.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTExponentDistance.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTFloat32.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTIma4.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTLinearDistance.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTMCFormats.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTMulaw.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTMulawBFormat.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTMulawMCFormats.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTOffset.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTSourceDistanceModel.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTSourceRadius.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTStaticBuffer.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTStereoAngles.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTThreadLocalContext.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTVorbis.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/EnumerateAllExt.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/LOKIAudioChannel.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/LOKIIMAADPCM.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/LOKIQuadriphonic.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/LOKIWAVEFormat.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTBlockAlignment.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTDeferredUpdates.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTDeviceClock.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTDirectChannels.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTGainClampEx.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTHRTF.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTLoopPoints.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTLoopback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTMSADPCM.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTOutputLimiter.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTPauseDevice.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTSourceLatency.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTSourceLength.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTSourceResampler.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTSourceSpatialize.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/openal/package-info.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDBlendMinmaxFactor.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDDebugOutput.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDDepthClampSeparate.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDDrawBuffersBlend.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDFramebufferMultisampleAdvanced.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDGPUShaderHalfFloat.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDGPUShaderHalfFloatFetch.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDGPUShaderInt64.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDInterleavedElements.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDOcclusionQueryEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDPerformanceMonitor.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDPinnedMemory.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDQueryBufferObject.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDSamplePositions.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDSeamlessCubemapPerTexture.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDSparseTexture.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDStencilOperationExtended.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDTransformFeedback4.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDVertexShaderTessellator.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBBaseInstance.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBBindlessTexture.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBBlendFuncExtended.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBBufferStorage.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBClearBufferObject.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBClearTexture.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBClipControl.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBColorBufferFloat.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBCompressedTexturePixelStorage.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBComputeShader.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBComputeVariableGroupSize.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBConditionalRenderInverted.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBCopyBuffer.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBCopyImage.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBCullDistance.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDebugOutput.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDepthBufferFloat.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDepthClamp.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDepthTexture.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDirectStateAccess.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDrawBuffers.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDrawBuffersBlend.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDrawElementsBaseVertex.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDrawIndirect.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDrawInstanced.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBES2Compatibility.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBES31Compatibility.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBES32Compatibility.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBES3Compatibility.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBEnhancedLayouts.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBExplicitUniformLocation.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBFragmentProgram.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBFragmentShader.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBFramebufferNoAttachments.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBFramebufferObject.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBFramebufferSRGB.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGLSPIRV.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGPUShader5.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGPUShaderFP64.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGPUShaderInt64.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGeometryShader4.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGetProgramBinary.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGetTextureSubImage.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBHalfFloatPixel.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBHalfFloatVertex.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBImaging.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBIndirectParameters.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBInstancedArrays.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBInternalformatQuery.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBInternalformatQuery2.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBInvalidateSubdata.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMapBufferAlignment.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMapBufferRange.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMatrixPalette.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMultiBind.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMultiDrawIndirect.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMultisample.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMultitexture.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBOcclusionQuery.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBOcclusionQuery2.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBParallelShaderCompile.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBPipelineStatisticsQuery.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBPixelBufferObject.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBPointParameters.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBPointSprite.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBPolygonOffsetClamp.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBProgramInterfaceQuery.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBProvokingVertex.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBQueryBufferObject.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBRobustness.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSPIRVExtensions.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSampleLocations.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSampleShading.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSamplerObjects.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSeamlessCubeMap.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSeamlessCubemapPerTexture.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSeparateShaderObjects.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShaderAtomicCounters.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShaderImageLoadStore.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShaderObjects.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShaderStorageBufferObject.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShaderSubroutine.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShadingLanguage100.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShadingLanguageInclude.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShadow.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShadowAmbient.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSparseBuffer.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSparseTexture.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBStencilTexturing.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSync.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTessellationShader.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureBarrier.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureBorderClamp.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureBufferObject.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureBufferRange.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureCompression.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureCompressionBPTC.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureCompressionRGTC.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureCubeMap.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureCubeMapArray.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureEnvCombine.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureEnvDot3.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureFilterAnisotropic.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureFilterMinmax.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureFloat.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureGather.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureMirrorClampToEdge.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureMirroredRepeat.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureMultisample.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureRG.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureRGB10_A2UI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureRectangle.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureStorage.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureStorageMultisample.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureSwizzle.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureView.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTimerQuery.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTransformFeedback2.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTransformFeedback3.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTransformFeedbackInstanced.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTransformFeedbackOverflowQuery.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTransposeMatrix.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBUniformBufferObject.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexArrayBGRA.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexArrayObject.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexAttrib64Bit.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexAttribBinding.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexBlend.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexBufferObject.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexProgram.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexShader.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexType2_10_10_10_REV.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBViewportArray.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBWindowPos.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ATIMeminfo.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ATITextureCompression3DC.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/CGL.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXT422Pixels.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTABGR.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBGRA.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBindableUniform.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBlendColor.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBlendEquationSeparate.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBlendFuncSeparate.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBlendMinmax.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBlendSubtract.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTClipVolumeHint.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTCompiledVertexArray.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDebugLabel.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDebugMarker.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDepthBoundsTest.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDirectStateAccess.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDrawBuffers2.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDrawInstanced.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTEGLImageStorage.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTExternalBuffer.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTFramebufferBlit.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTFramebufferMultisample.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTFramebufferMultisampleBlitScaled.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTFramebufferObject.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTFramebufferSRGB.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTGPUProgramParameters.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTGPUShader4.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTGeometryShader4.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTMemoryObject.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTMemoryObjectFD.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTMemoryObjectWin32.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTPackedDepthStencil.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTPackedFloat.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTPixelBufferObject.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTPointParameters.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTPolygonOffsetClamp.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTProvokingVertex.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTRasterMultisample.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSecondaryColor.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSemaphore.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSemaphoreFD.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSemaphoreWin32.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSeparateShaderObjects.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTShaderFramebufferFetch.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTShaderFramebufferFetchNonCoherent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTShaderImageLoadStore.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSharedTexturePalette.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTStencilClearTag.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTStencilTwoSide.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTStencilWrap.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureArray.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureBufferObject.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureCompressionLATC.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureCompressionRGTC.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureCompressionS3TC.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureFilterAnisotropic.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureFilterMinmax.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureInteger.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureMirrorClamp.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSRGB.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSRGBDecode.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSRGBR8.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSharedExponent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSnorm.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSwizzle.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTimerQuery.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTransformFeedback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTVertexAttrib64bit.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTWin32KeyedMutex.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTWindowRectangles.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTX11SyncObject.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL11.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL11C.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL12.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL12C.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL13.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL13C.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL14.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL14C.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL15.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL15C.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL20.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL20C.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL21.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL21C.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL30.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL30C.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL31.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL31C.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL32.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL32C.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL33.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL33C.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL40.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL40C.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL41.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL41C.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL42.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL42C.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL43.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL43C.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL44.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL44C.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL45.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL45C.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL46.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL46C.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLCapabilities.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLChecks.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageAMDCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageAMDCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageARBCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageARBCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLUtil.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLX.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLX11.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLX12.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLX13.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLX14.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXAMDGPUAssociation.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBContextFlushControl.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBCreateContext.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBCreateContextNoError.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBCreateContextProfile.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBCreateContextRobustness.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBFBConfigFloat.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBFramebufferSRGB.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBGetProcAddress.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBMultisample.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBRobustnessApplicationIsolation.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBVertexBufferObject.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXCapabilities.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTBufferAge.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTContextPriority.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTCreateContextES2Profile.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTCreateContextESProfile.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTFBConfigPackedFloat.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTFramebufferSRGB.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTImportContext.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTStereoTree.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTSwapControl.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTSwapControlTear.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTTextureFromPixmap.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTVisualInfo.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTVisualRating.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXINTELSwapEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVCopyBuffer.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVCopyImage.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVDelayBeforeSwap.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVFloatBuffer.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVMultisampleCoverage.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVRobustnessVideoMemoryPurge.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVSwapGroup.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIMakeCurrentRead.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGISwapControl.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIVideoSync.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIXFBConfig.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIXPbuffer.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIXSwapBarrier.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIXSwapGroup.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXStereoNotifyEventEXT.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GPU_DEVICE.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GREMEDYFrameTerminator.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GREMEDYStringMarker.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/INTELBlackholeRender.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/INTELConservativeRasterization.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/INTELFramebufferCMAA.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/INTELMapTexture.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/INTELPerformanceQuery.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRBlendEquationAdvanced.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRBlendEquationAdvancedCoherent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRContextFlushControl.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRDebug.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRNoError.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRParallelShaderCompile.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRRobustness.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRShaderSubgroup.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRTextureCompressionASTCLDR.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVAlphaToCoverageDitherControl.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBindlessMultiDrawIndirect.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBindlessMultiDrawIndirectCount.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBindlessTexture.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBlendEquationAdvanced.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBlendEquationAdvancedCoherent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBlendMinmaxFactor.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVClipSpaceWScaling.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVCommandList.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVConditionalRender.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVConservativeRaster.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVConservativeRasterDilate.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVConservativeRasterPreSnap.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVConservativeRasterPreSnapTriangles.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVCopyDepthToColor.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVCopyImage.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVDeepTexture3D.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVDepthBufferFloat.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVDepthClamp.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVDrawTexture.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVDrawVulkanImage.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVExplicitMultisample.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFence.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFillRectangle.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFloatBuffer.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFogDistance.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFragmentCoverageToColor.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFramebufferMixedSamples.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFramebufferMultisampleCoverage.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVGPUMulticast.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVGPUShader5.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVHalfFloat.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVInternalformatSampleQuery.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVLightMaxExponent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVMemoryAttachment.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVMeshShader.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVMultisampleCoverage.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVMultisampleFilterHint.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPackedDepthStencil.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPathRendering.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPathRenderingSharedEdge.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPixelDataRange.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPointSprite.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPrimitiveRestart.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVQueryResource.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVQueryResourceTag.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVRepresentativeFragmentTest.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVRobustnessVideoMemoryPurge.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVSampleLocations.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVScissorExclusive.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVShaderBufferLoad.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVShaderBufferStore.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVShaderSubgroupPartitioned.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVShaderThreadGroup.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVShadingRateImage.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVTexgenReflection.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVTextureBarrier.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVTextureMultisample.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVTransformFeedback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVTransformFeedback2.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVUniformBufferUnifiedMemory.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVVertexArrayRange.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVVertexArrayRange2.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVVertexAttribInteger64bit.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVVertexBufferUnifiedMemory.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVViewportSwizzle.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVXConditionalRender.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVXGPUMemoryInfo.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVXGpuMulticast2.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVXProgressFence.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/OVRMultiview.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGL.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLAMDGPUAssociation.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBBufferRegion.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBContextFlushControl.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBCreateContext.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBCreateContextNoError.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBCreateContextProfile.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBCreateContextRobustness.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBExtensionsString.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBFramebufferSRGB.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBMakeCurrentRead.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBMultisample.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBPbuffer.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBPixelFormat.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBPixelFormatFloat.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBRenderTexture.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBRobustnessApplicationIsolation.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLATIPixelFormatFloat.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLATIRenderTextureRectangle.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLCapabilities.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTColorspace.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTCreateContextES2Profile.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTCreateContextESProfile.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTDepthFloat.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTExtensionsString.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTFramebufferSRGB.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTPixelFormatPackedFloat.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTSwapControl.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVCopyImage.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVDXInterop.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVDelayBeforeSwap.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVFloatBuffer.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVGPUAffinity.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVMultigpuContext.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVMultisampleCoverage.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVRenderDepthTexture.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVRenderTextureRectangle.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVSwapGroup.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVVertexArrayRange.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/opengl/package-info.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/package-info.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/LibSTB.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBDXT.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBEasyFont.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIEOFCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIEOFCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIIOCallbacks.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIReadCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIReadCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBISkipCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBISkipCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIWriteCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIWriteCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIZlibCompress.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIZlibCompressI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBImage.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBImageResize.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBImageWrite.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBPerlin.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBRPContext.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBRPNode.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBRPRect.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBRectPack.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTAlignedQuad.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTBakedChar.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTBitmap.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTFontinfo.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTPackContext.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTPackRange.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTPackedchar.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTVertex.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTruetype.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBVorbis.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBVorbisAlloc.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBVorbisInfo.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/stb/package-info.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/APIUtil.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/Callback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/CallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/CheckIntrinsics.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/Checks.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/Configuration.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/CustomBuffer.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/FunctionProvider.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/FunctionProviderLocal.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/JNI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/Library.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/LibraryResource.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/MathUtil.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/MemoryAccessJNI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/MemoryManage.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/MemoryStack.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/MemoryUtil.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/MultiReleaseMemCopy.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/MultiReleaseTextDecoding.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/NativeResource.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/NativeType.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/NonnullDefault.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/Platform.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/Pointer.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/SharedLibrary.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/SharedLibraryLoader.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/StackWalkUtil.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/Struct.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/StructBuffer.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/ThreadLocalUtil.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/dyncall/DynCall.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/dyncall/DynCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/dyncall/DynLoad.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/dyncall/package-info.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/fcl/DynamicLinkLoader.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/fcl/FCLLibrary.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/fcl/package-info.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentAlloc.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentAllocI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentCommit.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentCommitI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDalloc.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDallocI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDecommit.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDecommitI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDestroy.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDestroyI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentHooks.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentMerge.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentMergeI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentPurge.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentPurgeI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentSplit.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentSplitI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/JEmalloc.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/JEmallocAllocator.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/MallocMessageCallback.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/MallocMessageCallbackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/package-info.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jni/JNINativeInterface.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jni/JNINativeMethod.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/jni/package-info.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/LibCErrno.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/LibCLocale.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/LibCStdio.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/LibCStdlib.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/LibCString.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/package-info.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/DynamicLinkLoader.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/LinuxLibrary.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/Visual.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/X11.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XAnyEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XButtonEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XCirculateEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XCirculateRequestEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XClientMessageEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XColormapEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XConfigureEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XConfigureRequestEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XCreateWindowEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XCrossingEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XDestroyWindowEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XErrorEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XExposeEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XFocusChangeEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XGenericEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XGenericEventCookie.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XGraphicsExposeEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XGravityEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XKeyEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XKeymapEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XMapEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XMapRequestEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XMappingEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XMotionEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XNoExposeEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XPropertyEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XReparentEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XResizeRequestEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XSelectionClearEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XSelectionEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XSelectionRequestEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XSetWindowAttributes.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XTimeCoord.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XUnmapEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XVisibilityEvent.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XVisualInfo.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/package-info.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CGEventTapCallBack.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CGEventTapCallBackI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CGEventTapInformation.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CGPoint.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CoreFoundation.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CoreGraphics.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/DynamicLinkLoader.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/EnumerationMutationHandler.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/EnumerationMutationHandlerI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/LibC.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/LibSystem.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/MacOSXLibrary.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/MacOSXLibraryBundle.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/MacOSXLibraryDL.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/ObjCMethodDescription.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/ObjCPropertyAttribute.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/ObjCRuntime.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/package-info.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/package-info.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/DEVMODE.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/DISPLAY_DEVICE.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/GDI32.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/HARDWAREINPUT.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/INPUT.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/KEYBDINPUT.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/MONITORINFOEX.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/MOUSEINPUT.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/MSG.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/PIXELFORMATDESCRIPTOR.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/POINT.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/POINTL.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/RECT.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/SECURITY_ATTRIBUTES.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/TOUCHINPUT.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/User32.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WINDOWPLACEMENT.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WNDCLASSEX.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WinBase.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WindowProc.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WindowProcI.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WindowsLibrary.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WindowsUtil.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/package-info.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/util/tinyfd/TinyFileDialogs.java create mode 100644 lwjgl3-fcl/src/main/java/org/lwjgl/util/tinyfd/package-info.java diff --git a/lwjgl3-fcl/build.gradle b/lwjgl3-fcl/build.gradle new file mode 100644 index 00000000..50628106 --- /dev/null +++ b/lwjgl3-fcl/build.gradle @@ -0,0 +1,27 @@ +plugins { + id 'java' +} + +group 'org.lwjgl' + +configurations.default.setCanBeResolved(true) + +jar { + archiveFileName = 'lwjgl.jar' + manifest { + attributes 'Manifest-Version': '3.2.3' + } + destinationDirectory.set(file("../FCL/src/main/assets/app_runtime/lwjgl3")) + File versionFile = file("../FCL/src/main/assets/app_runtime/lwjgl3/version") + versionFile.write(String.valueOf(new Date().getTime())) +} + +java { + toolchain { + languageVersion = JavaLanguageVersion.of(8) + } +} + +dependencies { + compileOnly 'com.google.code.findbugs:jsr305:1.3.9' +} diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/BufferUtils.java b/lwjgl3-fcl/src/main/java/org/lwjgl/BufferUtils.java new file mode 100644 index 00000000..f037da33 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/BufferUtils.java @@ -0,0 +1,229 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl; + +import org.lwjgl.system.*; + +import java.nio.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

This class makes it easy and safe to work with direct buffers. It is the recommended way to allocate memory to use with LWJGL.

+ * + *

Direct buffers

+ * + *

LWJGL requires that all NIO buffers passed to it are direct buffers. Direct buffers essentially wrap an address that points to off-heap memory, i.e. a + * native pointer. This is the only way LWJGL can safely pass data from Java code to native code, and vice-versa, without a performance penalty. It does not + * support on-heap Java arrays (or plain NIO buffers, which wrap them) because arrays may be moved around in memory by the JVM's garbage collector while native + * code is accessing them. In addition, Java arrays have an unspecified layout, i.e. they are not necessarily contiguous in memory.

+ * + *

Usage

+ * + *

When a direct buffer is passed as an argument to an LWJGL method, no data is copied. Instead, the current buffer position is added to the buffer's memory + * address and the resulting value is passed to native code. The native code interprets that value as a pointer and reads or copies from it as necessary. LWJGL + * will often also use the current buffer limit (via {@link Buffer#remaining()}) to automatically pass length/maxlength arguments. This means that, just like + * other APIs that use NIO buffers, the current {@link Buffer#position()} and {@link Buffer#limit()} at the time of the call is very important. Contrary to + * other APIs, LWJGL never modifies the current position, it will be the same value before and after the call.

+ * + *

Arrays of pointers

+ * + *

In addition to the standard NIO buffer classes, LWJGL provides a {@link PointerBuffer} class for storing pointer data in an architecture independent way. + * It is used in bindings for pointer-to-pointers arguments, usually to provide arrays of data (input parameter) or to store returned pointer values (output + * parameter). Also, there's the {@link CLongBuffer} class which is similar to {@code PointerBuffer}, but for C {@code long} data.

+ * + *

Memory management

+ * + *

Using NIO buffers for off-heap memory has some drawbacks:

+ * + * + *

An alternative API for allocating off-heap memory can be found in the {@link MemoryUtil} class. This has none of the above drawbacks, + * but requires allocated memory to be explictly freed when not used anymore.

+ * + *

Memory alignment

+ * + *

Allocations done via this class have a guaranteed alignment of 8 bytes. If higher alignment values are required, use the explicit memory management API + * or pad the requested memory with extra bytes and align manually.

+ * + *

Structs and arrays of structs

+ * + *

Java does not support struct value types, so LWJGL requires struct values that are backed by off-heap memory. Each struct type defined in a binding + * has a corresponding class in LWJGL that can be used to access its members. Each struct class also has a {@code Buffer} inner class that can be used to + * access (packed) arrays of struct values. Both struct and struct buffer classes may be backed by direct {@link ByteBuffer}s allocated from this class, but it + * is highly recommended to use explicit memory management for performance.

+ */ +public final class BufferUtils { + + private BufferUtils() {} + + /** + * Allocates a direct native-ordered {@code ByteBuffer} with the specified capacity. + * + * @param capacity the capacity, in bytes + * + * @return a {@code ByteBuffer} + */ + public static ByteBuffer createByteBuffer(int capacity) { + return ByteBuffer.allocateDirect(capacity).order(ByteOrder.nativeOrder()); + } + + static int getAllocationSize(int elements, int elementShift) { + apiCheckAllocation(elements, apiGetBytes(elements, elementShift), 0x7FFF_FFFFL); + return elements << elementShift; + } + + /** + * Allocates a direct native-order {@code ShortBuffer} with the specified number of elements. + * + * @param capacity the capacity, in shorts + * + * @return a {@code ShortBuffer} + */ + public static ShortBuffer createShortBuffer(int capacity) { + return createByteBuffer(getAllocationSize(capacity, 1)).asShortBuffer(); + } + + /** + * Allocates a direct native-order {@code CharBuffer} with the specified number of elements. + * + * @param capacity the capacity, in chars + * + * @return a {@code CharBuffer} + */ + public static CharBuffer createCharBuffer(int capacity) { + return createByteBuffer(getAllocationSize(capacity, 1)).asCharBuffer(); + } + + /** + * Allocates a direct native-order {@code IntBuffer} with the specified number of elements. + * + * @param capacity the capacity, in ints + * + * @return an {@code IntBuffer} + */ + public static IntBuffer createIntBuffer(int capacity) { + return createByteBuffer(getAllocationSize(capacity, 2)).asIntBuffer(); + } + + /** + * Allocates a direct native-order {@code LongBuffer} with the specified number of elements. + * + * @param capacity the capacity, in longs + * + * @return a {@code LongBuffer} + */ + public static LongBuffer createLongBuffer(int capacity) { + return createByteBuffer(getAllocationSize(capacity, 3)).asLongBuffer(); + } + + /** + * Allocates a {@code CLongBuffer} with the specified number of elements. + * + * @param capacity the capacity, in memory addresses + * + * @return a {@code CLongBuffer} + */ + public static CLongBuffer createCLongBuffer(int capacity) { + return CLongBuffer.allocateDirect(capacity); + } + + /** + * Allocates a direct native-order {@code FloatBuffer} with the specified number of elements. + * + * @param capacity the capacity, in floats + * + * @return a FloatBuffer + */ + public static FloatBuffer createFloatBuffer(int capacity) { + return createByteBuffer(getAllocationSize(capacity, 2)).asFloatBuffer(); + } + + /** + * Allocates a direct native-order {@code DoubleBuffer} with the specified number of elements. + * + * @param capacity the capacity, in doubles + * + * @return a {@code DoubleBuffer} + */ + public static DoubleBuffer createDoubleBuffer(int capacity) { + return createByteBuffer(getAllocationSize(capacity, 3)).asDoubleBuffer(); + } + + /** + * Allocates a {@code PointerBuffer} with the specified number of elements. + * + * @param capacity the capacity, in memory addresses + * + * @return a {@code PointerBuffer} + */ + public static PointerBuffer createPointerBuffer(int capacity) { + return PointerBuffer.allocateDirect(capacity); + } + + // memsets + + /** + * Fills the specified buffer with zeros from the current position to the current limit. + * + * @param buffer the buffer to fill with zeros + */ + public static void zeroBuffer(ByteBuffer buffer) { memSet(buffer, 0); } + + /** + * Fills the specified buffer with zeros from the current position to the current limit. + * + * @param buffer the buffer to fill with zeros + */ + public static void zeroBuffer(ShortBuffer buffer) { memSet(buffer, 0); } + + /** + * Fills the specified buffer with zeros from the current position to the current limit. + * + * @param buffer the buffer to fill with zeros + */ + public static void zeroBuffer(CharBuffer buffer) { memSet(buffer, 0); } + + /** + * Fills the specified buffer with zeros from the current position to the current limit. + * + * @param buffer the buffer to fill with zeros + */ + public static void zeroBuffer(IntBuffer buffer) { memSet(buffer, 0); } + + /** + * Fills the specified buffer with zeros from the current position to the current limit. + * + * @param buffer the buffer to fill with zeros + */ + public static void zeroBuffer(FloatBuffer buffer) { memSet(buffer, 0); } + + /** + * Fills the specified buffer with zeros from the current position to the current limit. + * + * @param buffer the buffer to fill with zeros + */ + public static void zeroBuffer(LongBuffer buffer) { memSet(buffer, 0); } + + /** + * Fills the specified buffer with zeros from the current position to the current limit. + * + * @param buffer the buffer to fill with zeros + */ + public static void zeroBuffer(DoubleBuffer buffer) { memSet(buffer, 0); } + + /** + * Fills the specified buffer with zeros from the current position to the current limit. + * + * @param buffer the buffer to fill with zeros + */ + public static > void zeroBuffer(T buffer) { memSet(buffer, 0); } + +} diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/CLongBuffer.java b/lwjgl3-fcl/src/main/java/org/lwjgl/CLongBuffer.java new file mode 100644 index 00000000..072a9d04 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/CLongBuffer.java @@ -0,0 +1,407 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl; + +import org.lwjgl.system.*; + +import javax.annotation.*; +import java.nio.*; + +import static org.lwjgl.system.CheckIntrinsics.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * This class is a container for C {@code long} data. Its interface mirrors the {@link LongBuffer} API for convenience. + * + *

The size of the C {@code long} type depends on the platform and CPU architecture. On Windows it is always 32-bit. On other platforms, it is 32-bit on + * 32-bit architectures and 64-bit on 64-bit architectures. Most APIs prefer portable sizes, so this class is rarely needed.

+ */ +public class CLongBuffer extends CustomBuffer implements Comparable { + + protected CLongBuffer(long address, @Nullable ByteBuffer container, int mark, int position, int limit, int capacity) { + super(address, container, mark, position, limit, capacity); + } + + /** + * Allocates a new long buffer. + * + *

The new buffer's position will be zero, its limit will be its capacity, and its mark will be undefined.

+ * + * @param capacity the new buffer's capacity, in longs + * + * @return the new long buffer + * + * @throws IllegalArgumentException If the {@code capacity} is a negative integer + */ + public static CLongBuffer allocateDirect(int capacity) { + ByteBuffer source = BufferUtils.createByteBuffer(BufferUtils.getAllocationSize(capacity, CLONG_SHIFT)); + return wrap(CLongBuffer.class, memAddress(source), capacity, source); + } + + /** + * Creates a new {@code CLongBuffer} that starts at the specified memory address and has the specified capacity. + * + * @param address the starting memory address + * @param capacity the buffer capacity, in number of longs + */ + public static CLongBuffer create(long address, int capacity) { + return wrap(CLongBuffer.class, address, capacity); + } + + /** + * Creates a new {@code CLongBuffer} using the specified ByteBuffer as its long data source. + * + * @param source the source buffer + */ + public static CLongBuffer create(ByteBuffer source) { + int capacity = source.remaining() >> CLONG_SHIFT; + return wrap(CLongBuffer.class, memAddress(source), capacity, source); + } + + @Override + protected CLongBuffer self() { + return this; + } + + @Override + public int sizeof() { + return CLONG_SIZE; + } + + /** + * Relative get method. Reads the long at this buffer's current position, and then increments the position. + * + * @return the long at the buffer's current position + * + * @throws BufferUnderflowException If the buffer's current position is not smaller than its limit + */ + public long get() { + return memGetCLong(address + Integer.toUnsignedLong(nextGetIndex()) * CLONG_SIZE); + } + + /** + * Convenience relative get from a source ByteBuffer. + * + * @param source the source ByteBuffer + */ + public static long get(ByteBuffer source) { + if (source.remaining() < CLONG_SIZE) { + throw new BufferUnderflowException(); + } + + try { + return memGetCLong(memAddress(source)); + } finally { + source.position(source.position() + CLONG_SIZE); + } + } + + /** + * Relative put method  (optional operation). + * + *

Writes the specified long into this buffer at the current position, and then increments the position.

+ * + * @param p the long to be written + * + * @return This buffer + * + * @throws BufferOverflowException If this buffer's current position is not smaller than its limit + */ + public CLongBuffer put(long p) { + memPutCLong(address + Integer.toUnsignedLong(nextPutIndex()) * CLONG_SIZE, p); + return this; + } + + /** + * Convenience relative put on a target ByteBuffer. + * + * @param target the target ByteBuffer + * @param p the long value to be written + */ + public static void put(ByteBuffer target, long p) { + if (target.remaining() < CLONG_SIZE) { + throw new BufferOverflowException(); + } + + try { + memPutCLong(memAddress(target), p); + } finally { + target.position(target.position() + CLONG_SIZE); + } + } + + /** + * Absolute get method. Reads the long at the specified {@code index}. + * + * @param index the index from which the long will be read + * + * @return the long at the specified {@code index} + * + * @throws IndexOutOfBoundsException If {@code index} is negative or not smaller than the buffer's limit + */ + public long get(int index) { + return memGetCLong(address + check(index, limit) * CLONG_SIZE); + } + + /** + * Convenience absolute get from a source ByteBuffer. + * + * @param source the source ByteBuffer + * @param index the index at which the long will be read + */ + public static long get(ByteBuffer source, int index) { + checkFromIndexSize(index, CLONG_SIZE, source.limit()); + return memGetCLong(memAddress0(source) + index); + } + + /** + * Absolute put method  (optional operation). + * + *

Writes the specified long into this buffer at the specified {@code index}.

+ * + * @param index the index at which the long will be written + * @param p the long value to be written + * + * @return This buffer + * + * @throws IndexOutOfBoundsException If {@code index} is negative or not smaller than the buffer's limit + */ + public CLongBuffer put(int index, long p) { + memPutCLong(address + check(index, limit) * CLONG_SIZE, p); + return this; + } + + /** + * Convenience absolute put on a target ByteBuffer. + * + * @param target the target ByteBuffer + * @param index the index at which the long will be written + * @param p the long value to be written + */ + public static void put(ByteBuffer target, int index, long p) { + checkFromIndexSize(index, CLONG_SIZE, target.limit()); + memPutCLong(memAddress0(target) + index, p); + } + + // -- Bulk get operations -- + + /** + * Relative bulk get method. + * + *

This method transfers longs from this buffer into the specified destination array. An invocation of this method of the form {@code src.get(a)} + * behaves in exactly the same way as the invocation + * + *

+     *     src.get(a, 0, a.length) 
+ * + * @return This buffer + * + * @throws BufferUnderflowException If there are fewer than {@code length} longs remaining in this buffer + */ + public CLongBuffer get(long[] dst) { + return get(dst, 0, dst.length); + } + + /** + * Relative bulk get method. + * + *

This method transfers longs from this buffer into the specified destination array. If there are fewer longs remaining in the buffer than are + * required to satisfy the request, that is, if {@code length} {@code >} {@code remaining()}, then no longs are transferred and a + * {@link BufferUnderflowException} is thrown. + * + *

Otherwise, this method copies {@code length} longs from this buffer into the specified array, starting at the current position of this buffer and + * at the specified offset in the array. The position of this buffer is then incremented by {@code length}. + * + *

In other words, an invocation of this method of the form {@code src.get(dst, off, len)} has exactly the same effect as the loop

+ * + *
+     *     for (int i = off; i < off + len; i++)
+     *         dst[i] = src.get(); 
+ * + *

except that it first checks that there are sufficient longs in this buffer and it is potentially much more efficient.

+ * + * @param dst the array into which longs are to be written + * @param offset the offset within the array of the first long to be written; must be non-negative and no larger than {@code dst.length} + * @param length the maximum number of longs to be written to the specified array; must be non-negative and no larger than {@code dst.length - offset} + * + * @return This buffer + * + * @throws BufferUnderflowException If there are fewer than {@code length} longs remaining in this buffer + * @throws IndexOutOfBoundsException If the preconditions on the {@code offset} and {@code length} parameters do not hold + */ + public CLongBuffer get(long[] dst, int offset, int length) { + if (CLONG_SIZE == 8) { + memLongBuffer(address(), remaining()).get(dst, offset, length); + position(position() + length); + } else { + get32(dst, offset, length); + } + + return this; + } + + private void get32(long[] dst, int offset, int length) { + checkFromIndexSize(offset, length, dst.length); + if (remaining() < length) { + throw new BufferUnderflowException(); + } + for (int i = offset, end = offset + length; i < end; i++) { + dst[i] = get(); + } + } + + /** + * Relative bulk put method  (optional operation). + * + *

This method transfers the entire content of the specified source long array into this buffer. An invocation of this method of the form + * {@code dst.put(a)} behaves in exactly the same way as the invocation

+ * + *
+     *     dst.put(a, 0, a.length) 
+ * + * @return This buffer + * + * @throws BufferOverflowException If there is insufficient space in this buffer + */ + public CLongBuffer put(long[] src) { + return put(src, 0, src.length); + } + + /** + * Relative bulk put method  (optional operation). + * + *

This method transfers longs into this buffer from the specified source array. If there are more longs to be copied from the array than remain + * in this buffer, that is, if {@code length} {@code >} {@code remaining()}, then no longs are transferred and a + * {@link BufferOverflowException} is thrown. + * + *

Otherwise, this method copies {@code length} longs from the specified array into this buffer, starting at the specified offset in the array and + * at the current position of this buffer. The position of this buffer is then incremented by {@code length}.

+ * + *

In other words, an invocation of this method of the form {@code dst.put(src, off, len)} has exactly the same effect as the loop

+ * + *
+     *     for (int i = off; i < off + len; i++)
+     *         dst.put(a[i]); 
+ * + *

except that it first checks that there is sufficient space in this buffer and it is potentially much more efficient.

+ * + * @param src the array from which longs are to be read + * @param offset the offset within the array of the first long to be read; must be non-negative and no larger than {@code array.length} + * @param length the number of longs to be read from the specified array; must be non-negative and no larger than {@code array.length - offset} + * + * @return This buffer + * + * @throws BufferOverflowException If there is insufficient space in this buffer + * @throws IndexOutOfBoundsException If the preconditions on the {@code offset} and {@code length} parameters do not hold + */ + public CLongBuffer put(long[] src, int offset, int length) { + if (CLONG_SIZE == 8) { + memLongBuffer(address(), remaining()).put(src, offset, length); + position(position() + length); + } else { + put32(src, offset, length); + } + + return this; + } + + private void put32(long[] src, int offset, int length) { + checkFromIndexSize(offset, length, src.length); + if (remaining() < length) { + throw new BufferOverflowException(); + } + int end = offset + length; + for (int i = offset; i < end; i++) { + put(src[i]); + } + } + + /** + * Returns the current hash code of this buffer. + * + *

The hash code of a long buffer depends only upon its remaining elements; that is, upon the elements from {@code position()} up to, and including, + * the element at {@code limit()} - {@code 1}.

+ * + *

Because buffer hash codes are content-dependent, it is inadvisable to use buffers as keys in hash maps or similar data structures unless it is known + * that their contents will not change.

+ * + * @return the current hash code of this buffer + */ + public int hashCode() { + int h = 1; + int p = position(); + for (int i = limit() - 1; i >= p; i--) { + h = 31 * h + (int)get(i); + } + return h; + } + + /** + * Tells whether or not this buffer is equal to another object. + * + *

Two long buffers are equal if, and only if,

+ * + *
    + *
  1. They have the same element type,
  2. + *
  3. They have the same number of remaining elements, and
  4. + *
  5. The two sequences of remaining elements, considered + * independently of their starting positions, are pointwise equal.
  6. + *
+ * + *

A long buffer is not equal to any other type of object.

+ * + * @param ob the object to which this buffer is to be compared + * + * @return {@code true} if, and only if, this buffer is equal to the + * given object + */ + public boolean equals(Object ob) { + if (!(ob instanceof CLongBuffer)) { + return false; + } + CLongBuffer that = (CLongBuffer)ob; + if (this.remaining() != that.remaining()) { + return false; + } + int p = this.position(); + for (int i = this.limit() - 1, j = that.limit() - 1; i >= p; i--, j--) { + long v1 = this.get(i); + long v2 = that.get(j); + if (v1 != v2) { + return false; + } + } + return true; + } + + /** + * Compares this buffer to another. + * + *

Two long buffers are compared by comparing their sequences of remaining elements lexicographically, without regard to the starting position of + * each sequence within its corresponding buffer.

+ * + *

A long buffer is not comparable to any other type of object.

+ * + * @return A negative integer, zero, or a positive integer as this buffer is less than, equal to, or greater than the specified buffer + */ + @Override + public int compareTo(CLongBuffer that) { + int n = this.position() + Math.min(this.remaining(), that.remaining()); + for (int i = this.position(), j = that.position(); i < n; i++, j++) { + long v1 = this.get(i); + long v2 = that.get(j); + if (v1 == v2) { + continue; + } + if (v1 < v2) { + return -1; + } + return +1; + } + return this.remaining() - that.remaining(); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/PointerBuffer.java b/lwjgl3-fcl/src/main/java/org/lwjgl/PointerBuffer.java new file mode 100644 index 00000000..be628e12 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/PointerBuffer.java @@ -0,0 +1,674 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl; + +import org.lwjgl.system.*; + +import javax.annotation.*; +import java.nio.*; + +import static org.lwjgl.system.CheckIntrinsics.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** This class is a container for architecture-independent pointer data. Its interface mirrors the {@link LongBuffer} API for convenience. */ +public class PointerBuffer extends CustomBuffer implements Comparable { + + protected PointerBuffer(long address, @Nullable ByteBuffer container, int mark, int position, int limit, int capacity) { + super(address, container, mark, position, limit, capacity); + } + + /** + * Allocates a new pointer buffer. + * + *

The new buffer's position will be zero, its limit will be its capacity, and its mark will be undefined.

+ * + * @param capacity the new buffer's capacity, in pointers + * + * @return the new pointer buffer + * + * @throws IllegalArgumentException If the {@code capacity} is a negative integer + */ + public static PointerBuffer allocateDirect(int capacity) { + ByteBuffer source = BufferUtils.createByteBuffer(BufferUtils.getAllocationSize(capacity, POINTER_SHIFT)); + return wrap(PointerBuffer.class, memAddress(source), capacity, source); + } + + /** + * Creates a new PointerBuffer that starts at the specified memory address and has the specified capacity. + * + * @param address the starting memory address + * @param capacity the buffer capacity, in number of pointers + */ + public static PointerBuffer create(long address, int capacity) { + return wrap(PointerBuffer.class, address, capacity); + } + + /** + * Creates a new PointerBuffer using the specified ByteBuffer as its pointer data source. + * + * @param source the source buffer + */ + public static PointerBuffer create(ByteBuffer source) { + int capacity = source.remaining() >> POINTER_SHIFT; + return wrap(PointerBuffer.class, memAddress(source), capacity, source); + } + + @Override + protected PointerBuffer self() { + return this; + } + + @Override + public int sizeof() { + return POINTER_SIZE; + } + + /** + * Relative get method. Reads the pointer at this buffer's current position, and then increments the position. + * + * @return the pointer at the buffer's current position + * + * @throws BufferUnderflowException If the buffer's current position is not smaller than its limit + */ + public long get() { + return memGetAddress(address + Integer.toUnsignedLong(nextGetIndex()) * POINTER_SIZE); + } + + /** + * Convenience relative get from a source ByteBuffer. + * + * @param source the source ByteBuffer + */ + public static long get(ByteBuffer source) { + if (source.remaining() < POINTER_SIZE) { + throw new BufferUnderflowException(); + } + + try { + return memGetAddress(memAddress(source)); + } finally { + source.position(source.position() + POINTER_SIZE); + } + } + + /** + * Relative put method  (optional operation). + * + *

Writes the specified pointer into this buffer at the current position, and then increments the position.

+ * + * @param p the pointer to be written + * + * @return This buffer + * + * @throws BufferOverflowException If this buffer's current position is not smaller than its limit + */ + public PointerBuffer put(long p) { + memPutAddress(address + Integer.toUnsignedLong(nextPutIndex()) * POINTER_SIZE, p); + return this; + } + + /** + * Convenience relative put on a target ByteBuffer. + * + * @param target the target ByteBuffer + * @param p the pointer value to be written + */ + public static void put(ByteBuffer target, long p) { + if (target.remaining() < POINTER_SIZE) { + throw new BufferOverflowException(); + } + + try { + memPutAddress(memAddress(target), p); + } finally { + target.position(target.position() + POINTER_SIZE); + } + } + + /** + * Absolute get method. Reads the pointer at the specified {@code index}. + * + * @param index the index from which the pointer will be read + * + * @return the pointer at the specified {@code index} + * + * @throws IndexOutOfBoundsException If {@code index} is negative or not smaller than the buffer's limit + */ + public long get(int index) { + return memGetAddress(address + check(index, limit) * POINTER_SIZE); + } + + /** + * Convenience absolute get from a source ByteBuffer. + * + * @param source the source ByteBuffer + * @param index the index at which the pointer will be read + */ + public static long get(ByteBuffer source, int index) { + checkFromIndexSize(index, POINTER_SIZE, source.limit()); + return memGetAddress(memAddress0(source) + index); + } + + /** + * Absolute put method  (optional operation). + * + *

Writes the specified pointer into this buffer at the specified {@code index}.

+ * + * @param index the index at which the pointer will be written + * @param p the pointer value to be written + * + * @return This buffer + * + * @throws IndexOutOfBoundsException If {@code index} is negative or not smaller than the buffer's limit + */ + public PointerBuffer put(int index, long p) { + memPutAddress(address + check(index, limit) * POINTER_SIZE, p); + return this; + } + + /** + * Convenience absolute put on a target ByteBuffer. + * + * @param target the target ByteBuffer + * @param index the index at which the pointer will be written + * @param p the pointer value to be written + */ + public static void put(ByteBuffer target, int index, long p) { + checkFromIndexSize(index, POINTER_SIZE, target.limit()); + memPutAddress(memAddress0(target) + index, p); + } + + // -- PointerWrapper operations -- + + /** Puts the pointer value of the specified {@link Pointer} at the current position and then increments the position. */ + public PointerBuffer put(Pointer pointer) { + put(pointer.address()); + return this; + } + + /** Puts the pointer value of the specified {@link Pointer} at the specified {@code index}. */ + public PointerBuffer put(int index, Pointer pointer) { + put(index, pointer.address()); + return this; + } + + // -- Buffer address operations -- + + /** + *

Writes the address of the specified {@code buffer} into this buffer at the current position, and then increments the position.

+ * + * @param buffer the pointer to be written + * + * @return this buffer + * + * @throws BufferOverflowException If this buffer's current position is not smaller than its limit + */ + public PointerBuffer put(ByteBuffer buffer) { + put(memAddress(buffer)); + return this; + } + + /** + *

Writes the address of the specified {@code buffer} into this buffer at the current position, and then increments the position.

+ * + * @param buffer the pointer to be written + * + * @return this buffer + * + * @throws BufferOverflowException If this buffer's current position is not smaller than its limit + */ + public PointerBuffer put(ShortBuffer buffer) { + put(memAddress(buffer)); + return this; + } + + /** + *

Writes the address of the specified {@code buffer} into this buffer at the current position, and then increments the position.

+ * + * @param buffer the pointer to be written + * + * @return this buffer + * + * @throws BufferOverflowException If this buffer's current position is not smaller than its limit + */ + public PointerBuffer put(IntBuffer buffer) { + put(memAddress(buffer)); + return this; + } + + /** + *

Writes the address of the specified {@code buffer} into this buffer at the current position, and then increments the position.

+ * + * @param buffer the pointer to be written + * + * @return this buffer + * + * @throws BufferOverflowException If this buffer's current position is not smaller than its limit + */ + public PointerBuffer put(LongBuffer buffer) { + put(memAddress(buffer)); + return this; + } + + /** + *

Writes the address of the specified {@code buffer} into this buffer at the current position, and then increments the position.

+ * + * @param buffer the pointer to be written + * + * @return this buffer + * + * @throws BufferOverflowException If this buffer's current position is not smaller than its limit + */ + public PointerBuffer put(FloatBuffer buffer) { + put(memAddress(buffer)); + return this; + } + + /** + *

Writes the address of the specified {@code buffer} into this buffer at the current position, and then increments the position.

+ * + * @param buffer the pointer to be written + * + * @return this buffer + * + * @throws BufferOverflowException If this buffer's current position is not smaller than its limit + */ + public PointerBuffer put(DoubleBuffer buffer) { + put(memAddress(buffer)); + return this; + } + + /** + *

Writes the address of the specified {@code buffer} into this buffer at the current position, and then increments the position.

+ * + * @param buffer the pointer to be written + * + * @return this buffer + * + * @throws BufferOverflowException If this buffer's current position is not smaller than its limit + */ + public PointerBuffer putAddressOf(CustomBuffer buffer) { + put(memAddress(buffer)); + return this; + } + + // --- + + /** Puts the address of the specified {@code buffer} at the specified {@code index}. */ + public PointerBuffer put(int index, ByteBuffer buffer) { + put(index, memAddress(buffer)); + return this; + } + + /** Puts the address of the specified {@code buffer} at the specified {@code index}. */ + public PointerBuffer put(int index, ShortBuffer buffer) { + put(index, memAddress(buffer)); + return this; + } + + /** Puts the address of the specified {@code buffer} at the specified {@code index}. */ + public PointerBuffer put(int index, IntBuffer buffer) { + put(index, memAddress(buffer)); + return this; + } + + /** Puts the address of the specified {@code buffer} at the specified {@code index}. */ + public PointerBuffer put(int index, LongBuffer buffer) { + put(index, memAddress(buffer)); + return this; + } + + /** Puts the address of the specified {@code buffer} at the specified {@code index}. */ + public PointerBuffer put(int index, FloatBuffer buffer) { + put(index, memAddress(buffer)); + return this; + } + + /** Puts the address of the specified {@code buffer} at the specified {@code index}. */ + public PointerBuffer put(int index, DoubleBuffer buffer) { + put(index, memAddress(buffer)); + return this; + } + + /** Puts the address of the specified {@code buffer} at the specified {@code index}. */ + public PointerBuffer putAddressOf(int index, CustomBuffer buffer) { + put(index, memAddress(buffer)); + return this; + } + + // --- + + /** + * Reads the pointer at this buffer's current position, and then increments the position. The pointer is returned as a {@link ByteBuffer} instance that + * starts at the pointer address and has capacity equal to the specified {@code size}. + * + * @throws BufferUnderflowException If the buffer's current position is not smaller than its limit + */ + public ByteBuffer getByteBuffer(int size) { return memByteBuffer(get(), size); } + + /** + * Reads the pointer at this buffer's current position, and then increments the position. The pointer is returned as a {@link ShortBuffer} instance that + * starts at the pointer address and has capacity equal to the specified {@code size}. + * + * @throws BufferUnderflowException If the buffer's current position is not smaller than its limit + */ + public ShortBuffer getShortBuffer(int size) { return memShortBuffer(get(), size); } + + /** + * Reads the pointer at this buffer's current position, and then increments the position. The pointer is returned as a {@link IntBuffer} instance that + * starts at the pointer address and has capacity equal to the specified {@code size}. + * + * @throws BufferUnderflowException If the buffer's current position is not smaller than its limit + */ + public IntBuffer getIntBuffer(int size) { return memIntBuffer(get(), size); } + + /** + * Reads the pointer at this buffer's current position, and then increments the position. The pointer is returned as a {@link LongBuffer} instance that + * starts at the pointer address and has capacity equal to the specified {@code size}. + * + * @throws BufferUnderflowException If the buffer's current position is not smaller than its limit + */ + public LongBuffer getLongBuffer(int size) { return memLongBuffer(get(), size); } + + /** + * Reads the pointer at this buffer's current position, and then increments the position. The pointer is returned as a {@link FloatBuffer} instance that + * starts at the pointer address and has capacity equal to the specified {@code size}. + * + * @throws BufferUnderflowException If the buffer's current position is not smaller than its limit + */ + public FloatBuffer getFloatBuffer(int size) { return memFloatBuffer(get(), size); } + + /** + * Reads the pointer at this buffer's current position, and then increments the position. The pointer is returned as a {@link DoubleBuffer} instance that + * starts at the pointer address and has capacity equal to the specified {@code size}. + * + * @throws BufferUnderflowException If the buffer's current position is not smaller than its limit + */ + public DoubleBuffer getDoubleBuffer(int size) { return memDoubleBuffer(get(), size); } + + /** + * Reads the pointer at this buffer's current position, and then increments the position. The pointer is returned as a {@code PointerBuffer} instance that + * starts at the pointer address and has capacity equal to the specified {@code size}. + * + * @throws BufferUnderflowException If the buffer's current position is not smaller than its limit + */ + public PointerBuffer getPointerBuffer(int size) { return memPointerBuffer(get(), size); } + + /** + * Reads the pointer at this buffer's current position, and then increments the position. The pointer is evaluated as a null-terminated ASCII string, which + * is decoded and returned as a {@link String} instance. + * + * @throws BufferUnderflowException If the buffer's current position is not smaller than its limit + */ + public String getStringASCII() { return memASCII(get()); } + + /** + * Reads the pointer at this buffer's current position, and then increments the position. The pointer is evaluated as a null-terminated UTF-8 string, which + * is decoded and returned as a {@link String} instance. + * + * @throws BufferUnderflowException If the buffer's current position is not smaller than its limit + */ + public String getStringUTF8() { return memUTF8(get()); } + + /** + * Reads the pointer at this buffer's current position, and then increments the position. The pointer is evaluated as a null-terminated UTF-16 string, + * which is decoded and returned as a {@link String} instance. + * + * @throws BufferUnderflowException If the buffer's current position is not smaller than its limit + */ + public String getStringUTF16() { return memUTF16(get()); } + + // --- + + /** Returns a {@link ByteBuffer} instance that starts at the address found at the specified {@code index} and has capacity equal to the specified size. */ + public ByteBuffer getByteBuffer(int index, int size) { return memByteBuffer(get(index), size); } + + /** Returns a {@link ShortBuffer} instance that starts at the address found at the specified {@code index} and has capacity equal to the specified size. */ + public ShortBuffer getShortBuffer(int index, int size) { return memShortBuffer(get(index), size); } + + /** Returns a {@link IntBuffer} instance that starts at the address found at the specified {@code index} and has capacity equal to the specified size. */ + public IntBuffer getIntBuffer(int index, int size) { return memIntBuffer(get(index), size); } + + /** Returns a {@link LongBuffer} instance that starts at the address found at the specified {@code index} and has capacity equal to the specified size. */ + public LongBuffer getLongBuffer(int index, int size) { return memLongBuffer(get(index), size); } + + /** Returns a {@link FloatBuffer} instance that starts at the address found at the specified {@code index} and has capacity equal to the specified size. */ + public FloatBuffer getFloatBuffer(int index, int size) { return memFloatBuffer(get(index), size); } + + /** Returns a {@link DoubleBuffer} instance that starts at the address found at the specified {@code index} and has capacity equal to the specified size. */ + public DoubleBuffer getDoubleBuffer(int index, int size) { return memDoubleBuffer(get(index), size); } + + /** Returns a {@code PointerBuffer} instance that starts at the address found at the specified {@code index} and has capacity equal to the specified size. */ + public PointerBuffer getPointerBuffer(int index, int size) { return memPointerBuffer(get(index), size); } + + /** Decodes the ASCII string that starts at the address found at the specified {@code index}. */ + public String getStringASCII(int index) { return memASCII(get(index)); } + + /** Decodes the UTF-8 string that starts at the address found at the specified {@code index}. */ + public String getStringUTF8(int index) { return memUTF8(get(index)); } + + /** Decodes the UTF-16 string that starts at the address found at the specified {@code index}. */ + public String getStringUTF16(int index) { return memUTF16(get(index)); } + + // -- Bulk get operations -- + + /** + * Relative bulk get method. + * + *

This method transfers pointers from this buffer into the specified destination array. An invocation of this method of the form {@code src.get(a)} + * behaves in exactly the same way as the invocation + * + *

+     *     src.get(a, 0, a.length) 
+ * + * @return This buffer + * + * @throws BufferUnderflowException If there are fewer than {@code length} pointers remaining in this buffer + */ + public PointerBuffer get(long[] dst) { + return get(dst, 0, dst.length); + } + + /** + * Relative bulk get method. + * + *

This method transfers pointers from this buffer into the specified destination array. If there are fewer pointers remaining in the buffer than are + * required to satisfy the request, that is, if {@code length} {@code >} {@code remaining()}, then no pointers are transferred and a + * {@link BufferUnderflowException} is thrown. + * + *

Otherwise, this method copies {@code length} pointers from this buffer into the specified array, starting at the current position of this buffer and + * at the specified offset in the array. The position of this buffer is then incremented by {@code length}. + * + *

In other words, an invocation of this method of the form {@code src.get(dst, off, len)} has exactly the same effect as the loop

+ * + *
+     *     for (int i = off; i < off + len; i++)
+     *         dst[i] = src.get(); 
+ * + *

except that it first checks that there are sufficient pointers in this buffer and it is potentially much more efficient.

+ * + * @param dst the array into which pointers are to be written + * @param offset the offset within the array of the first pointer to be written; must be non-negative and no larger than {@code dst.length} + * @param length the maximum number of pointers to be written to the specified array; must be non-negative and no larger than {@code dst.length - offset} + * + * @return This buffer + * + * @throws BufferUnderflowException If there are fewer than {@code length} pointers remaining in this buffer + * @throws IndexOutOfBoundsException If the preconditions on the {@code offset} and {@code length} parameters do not hold + */ + public PointerBuffer get(long[] dst, int offset, int length) { + if (BITS64) { + memLongBuffer(address(), remaining()).get(dst, offset, length); + position(position() + length); + } else { + get32(dst, offset, length); + } + + return this; + } + + private void get32(long[] dst, int offset, int length) { + checkFromIndexSize(offset, length, dst.length); + if (remaining() < length) { + throw new BufferUnderflowException(); + } + for (int i = offset, end = offset + length; i < end; i++) { + dst[i] = get(); + } + } + + /** + * Relative bulk put method  (optional operation). + * + *

This method transfers the entire content of the specified source pointer array into this buffer. An invocation of this method of the form + * {@code dst.put(a)} behaves in exactly the same way as the invocation

+ * + *
+     *     dst.put(a, 0, a.length) 
+ * + * @return This buffer + * + * @throws BufferOverflowException If there is insufficient space in this buffer + */ + public PointerBuffer put(long[] src) { + return put(src, 0, src.length); + } + + /** + * Relative bulk put method  (optional operation). + * + *

This method transfers pointers into this buffer from the specified source array. If there are more pointers to be copied from the array than remain + * in this buffer, that is, if {@code length} {@code >} {@code remaining()}, then no pointers are transferred and a + * {@link BufferOverflowException} is thrown. + * + *

Otherwise, this method copies {@code length} pointers from the specified array into this buffer, starting at the specified offset in the array and + * at the current position of this buffer. The position of this buffer is then incremented by {@code length}.

+ * + *

In other words, an invocation of this method of the form {@code dst.put(src, off, len)} has exactly the same effect as the loop

+ * + *
+     *     for (int i = off; i < off + len; i++)
+     *         dst.put(a[i]); 
+ * + *

except that it first checks that there is sufficient space in this buffer and it is potentially much more efficient.

+ * + * @param src the array from which pointers are to be read + * @param offset the offset within the array of the first pointer to be read; must be non-negative and no larger than {@code array.length} + * @param length the number of pointers to be read from the specified array; must be non-negative and no larger than {@code array.length - offset} + * + * @return This buffer + * + * @throws BufferOverflowException If there is insufficient space in this buffer + * @throws IndexOutOfBoundsException If the preconditions on the {@code offset} and {@code length} parameters do not hold + */ + public PointerBuffer put(long[] src, int offset, int length) { + if (BITS64) { + memLongBuffer(address(), remaining()).put(src, offset, length); + position(position() + length); + } else { + put32(src, offset, length); + } + + return this; + } + + private void put32(long[] src, int offset, int length) { + checkFromIndexSize(offset, length, src.length); + if (remaining() < length) { + throw new BufferOverflowException(); + } + int end = offset + length; + for (int i = offset; i < end; i++) { + put(src[i]); + } + } + + /** + * Returns the current hash code of this buffer. + * + *

The hash code of a pointer buffer depends only upon its remaining elements; that is, upon the elements from {@code position()} up to, and including, + * the element at {@code limit()} - {@code 1}.

+ * + *

Because buffer hash codes are content-dependent, it is inadvisable to use buffers as keys in hash maps or similar data structures unless it is known + * that their contents will not change.

+ * + * @return the current hash code of this buffer + */ + public int hashCode() { + int h = 1; + int p = position(); + for (int i = limit() - 1; i >= p; i--) { + h = 31 * h + (int)get(i); + } + return h; + } + + /** + * Tells whether or not this buffer is equal to another object. + * + *

Two pointer buffers are equal if, and only if,

+ * + *
    + *
  1. They have the same element type,
  2. + *
  3. They have the same number of remaining elements, and
  4. + *
  5. The two sequences of remaining elements, considered + * independently of their starting positions, are pointwise equal.
  6. + *
+ * + *

A pointer buffer is not equal to any other type of object.

+ * + * @param ob the object to which this buffer is to be compared + * + * @return {@code true} if, and only if, this buffer is equal to the + * given object + */ + public boolean equals(Object ob) { + if (!(ob instanceof PointerBuffer)) { + return false; + } + PointerBuffer that = (PointerBuffer)ob; + if (this.remaining() != that.remaining()) { + return false; + } + int p = this.position(); + for (int i = this.limit() - 1, j = that.limit() - 1; i >= p; i--, j--) { + long v1 = this.get(i); + long v2 = that.get(j); + if (v1 != v2) { + return false; + } + } + return true; + } + + /** + * Compares this buffer to another. + * + *

Two pointer buffers are compared by comparing their sequences of remaining elements lexicographically, without regard to the starting position of + * each sequence within its corresponding buffer.

+ * + *

A pointer buffer is not comparable to any other type of object.

+ * + * @return A negative integer, zero, or a positive integer as this buffer is less than, equal to, or greater than the specified buffer + */ + @Override + public int compareTo(PointerBuffer that) { + int n = this.position() + Math.min(this.remaining(), that.remaining()); + for (int i = this.position(), j = that.position(); i < n; i++, j++) { + long v1 = this.get(i); + long v2 = that.get(j); + if (v1 == v2) { + continue; + } + if (v1 < v2) { + return -1; + } + return +1; + } + return this.remaining() - that.remaining(); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/Version.java b/lwjgl3-fcl/src/main/java/org/lwjgl/Version.java new file mode 100644 index 00000000..c576dff7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/Version.java @@ -0,0 +1,55 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl; + +import static org.lwjgl.system.APIUtil.*; + +/** This class can be used to query the LWJGL version. */ +public final class Version { + + /** Current version of library. */ + public static final int + VERSION_MAJOR = 3, + VERSION_MINOR = 2, + VERSION_REVISION = 3; + + /** The development state of the current build. */ + public static final BuildType BUILD_TYPE = BuildType.STABLE; + + private static final String version = + String.valueOf(VERSION_MAJOR) + + '.' + VERSION_MINOR + + '.' + VERSION_REVISION + BUILD_TYPE.postfix + + ' ' + apiGetManifestValue("Implementation-Version").orElse("SNAPSHOT"); + + private Version() { + } + + public static void main(String[] args) { + System.out.println(getVersion()); + } + + /** Returns the LWJGL version. */ + public static String getVersion() { + return version; + } + + /** The development state of the current build. */ + public enum BuildType { + /** Work in progress, unstable. */ + ALPHA("a"), + /** Feature complete, unstable. */ + BETA("b"), + /** Feature complete, stable, official release. */ + STABLE(""); + + public final String postfix; + + BuildType(String postfix) { + this.postfix = postfix; + } + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/Callbacks.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/Callbacks.java new file mode 100644 index 00000000..375d896f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/Callbacks.java @@ -0,0 +1,60 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Utility class for GLFW callbacks. */ +public final class Callbacks { + + private Callbacks() {} + + /** + * Resets all callbacks for the specified GLFW window to {@code NULL} and {@link Callback#free frees} all previously set callbacks. + * + *

This method resets only callbacks registered with a GLFW window. Non-window callbacks (registered with + * {@link GLFW#glfwSetErrorCallback SetErrorCallback}, {@link GLFW#glfwSetMonitorCallback SetMonitorCallback}, etc.) must be reset and freed + * separately.

+ * + *

This method is not official GLFW API. It exists in LWJGL to simplify window callback cleanup.

+ * + * @param window the GLFW window + */ + public static void glfwFreeCallbacks(@NativeType("GLFWwindow *") long window) { + if (Checks.CHECKS) { + check(window); + } + + for (long callback : new long[] { + GLFW.Functions.SetWindowPosCallback, + GLFW.Functions.SetWindowSizeCallback, + GLFW.Functions.SetWindowCloseCallback, + GLFW.Functions.SetWindowRefreshCallback, + GLFW.Functions.SetWindowFocusCallback, + GLFW.Functions.SetWindowIconifyCallback, + GLFW.Functions.SetWindowMaximizeCallback, + GLFW.Functions.SetFramebufferSizeCallback, + GLFW.Functions.SetWindowContentScaleCallback, + GLFW.Functions.SetKeyCallback, + GLFW.Functions.SetCharCallback, + GLFW.Functions.SetCharModsCallback, + GLFW.Functions.SetMouseButtonCallback, + GLFW.Functions.SetCursorPosCallback, + GLFW.Functions.SetCursorEnterCallback, + GLFW.Functions.SetScrollCallback, + GLFW.Functions.SetDropCallback + }) { + long prevCB = invokePPP(window, NULL, callback); + if (prevCB != NULL) { + Callback.free(prevCB); + } + } + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/EventLoop.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/EventLoop.java new file mode 100644 index 00000000..b174c204 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/EventLoop.java @@ -0,0 +1,97 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; +import org.lwjgl.system.macosx.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.macosx.LibC.*; +import static org.lwjgl.system.macosx.ObjCRuntime.*; + +/** + * Contains checks for the event loop issues on OS X. + * + *

On-screen GLFW windows can only be used in the main thread and only if that thread is the first thread in the process. This requires running the JVM with + * {@code -XstartOnFirstThread}, which means that other window toolkits (AWT/Swing, JavaFX, etc.) cannot be used at the same time.

+ * + *

Another window toolkit can be used if GLFW windows are never shown (created with {@link GLFW#GLFW_VISIBLE GLFW_VISIBLE} equal to + * {@link GLFW#GLFW_FALSE GLFW_FALSE}) and only used as contexts for offscreen rendering. This is possible if the window toolkit has initialized and created + * the shared application (NSApp) before a GLFW window is created.

+ */ +final class EventLoop { + + static final class OffScreen { + static { + if (Platform.get() == Platform.MACOSX && !isMainThread()) { + // The only way to avoid a crash is if the shared application (NSApp) has been created by something else + SharedLibrary AppKit = MacOSXLibrary.getWithIdentifier("com.apple.AppKit"); + try { + long NSApp = AppKit.getFunctionAddress("NSApp"); // The NSApp global variable is an exported symbol + if (memGetAddress(NSApp) == NULL) { + throw new IllegalStateException( + isJavaStartedOnFirstThread() + ? "GLFW windows may only be created on the main thread." + : "GLFW windows may only be created on the main thread and that thread must be the first thread in the process. Please run " + + "the JVM with -XstartOnFirstThread. For offscreen rendering, make sure another window toolkit (e.g. AWT or JavaFX) is " + + "initialized before GLFW." + ); + } + + apiLog("GLFW can only be used for offscreen rendering."); + } finally { + AppKit.free(); + } + } + } + + private OffScreen() { + } + + static void check() { + // intentionally empty to trigger the static initializer + } + } + + static final class OnScreen { + static { + if (Platform.get() == Platform.MACOSX && !isMainThread()) { + throw new IllegalStateException( + "Please run the JVM with -XstartOnFirstThread and make sure a window toolkit other than GLFW (e.g. AWT or JavaFX) is not initialized." + ); + } + } + + private OnScreen() { + } + + static void check() { + // intentionally empty to trigger the static initializer + } + } + + private EventLoop() { + } + + private static boolean isMainThread() { + if (!Configuration.GLFW_CHECK_THREAD0.get(true)) { + return true; + } + + long objc_msgSend = ObjCRuntime.getLibrary().getFunctionAddress("objc_msgSend"); + + long NSThread = objc_getClass("NSThread"); + long currentThread = invokePPP(NSThread, sel_getUid("currentThread"), objc_msgSend); + + return invokePPZ(currentThread, sel_getUid("isMainThread"), objc_msgSend); + } + + private static boolean isJavaStartedOnFirstThread() { + return "1".equals(System.getenv().get("JAVA_STARTED_ON_FIRST_THREAD_" + getpid())); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/FCLInjector.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/FCLInjector.java new file mode 100644 index 00000000..40fea7dd --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/FCLInjector.java @@ -0,0 +1,142 @@ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import javax.annotation.Nullable; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; + +import static org.lwjgl.system.APIUtil.apiGetFunctionAddress; +import static org.lwjgl.system.APIUtil.apiLog; + +/** + * By Tungsten + * This class is for Fold Craft Launcher. + */ +public class FCLInjector { + + public static final long GetInjectorMode = apiGetFunctionAddress(GLFW.GLFW, "glfwGetInjectorMode"); + public static final long SetInjectorMode = apiGetFunctionAddress(GLFW.GLFW, "glfwSetInjectorMode"); + public static final long SetHitResultType = apiGetFunctionAddress(GLFW.GLFW, "glfwSetHitResultType"); + + private static boolean get = false; + private static ClassLoader classLoader; + + private static final String HIT_RESULT_TYPE_UNKNOWN = "UNKNOWN"; + private static final String HIT_RESULT_TYPE_MISS = "MISS"; + private static final String HIT_RESULT_TYPE_BLOCK = "BLOCK"; + private static final String HIT_RESULT_TYPE_ENTITY = "ENTITY"; + + private static final int INJECTOR_MODE_ENABLE = 1; + private static final int INJECTOR_MODE_DISABLE = 0; + + private static boolean highVersion = false; + @Nullable + private static String param0 = null; + @Nullable + private static String param1 = null; + @Nullable + private static String param2 = null; + @Nullable + private static String param3 = null; + + public static void setClassLoader(ClassLoader classLoader) { + String prop = System.getProperty("fcl.injector"); + if (!get && prop != null && !prop.isEmpty()) { + FCLInjector.classLoader = classLoader; + String[] props = prop.split(":"); + if (props.length == 5 && (props[0].equals("true") || props[0].equals("false"))) { + boolean highVersion = Boolean.parseBoolean(props[0]); + String param0 = props[1]; + String param1 = props[2]; + String param2 = props[3]; + String param3 = props[4]; + setup(highVersion, param0, param1, param2, param3); + } + } + } + + public static void setup(boolean highVersion, String param0, String param1, String param2, String param3) { + FCLInjector.highVersion = highVersion; + FCLInjector.param0 = param0; + FCLInjector.param1 = param1; + FCLInjector.param2 = param2; + FCLInjector.param3 = param3; + get = true; + new Thread(() -> { + while (true) { + if (nglfwGetInjectorMode() == INJECTOR_MODE_ENABLE) { + getHitResultType(); + nglfwSetInjectorMode(INJECTOR_MODE_DISABLE); + } + } + }).start(); + } + + public static int nglfwGetInjectorMode() { + return JNI.invokeI(GetInjectorMode); + } + + public static void nglfwSetInjectorMode(int mode) { + JNI.invokeV(mode, SetInjectorMode); + } + + public static void nglfwSetHitResultType(String type) { + int typeInt; + switch (type) { + case HIT_RESULT_TYPE_MISS: + typeInt = 1; + break; + case HIT_RESULT_TYPE_BLOCK: + typeInt = 2; + break; + case HIT_RESULT_TYPE_ENTITY: + typeInt = 3; + break; + default: + typeInt = 0; + break; + }; + JNI.invokeV(typeInt, FCLInjector.SetHitResultType); + } + + public static void getHitResultType() { + if (!get) { + nglfwSetHitResultType(HIT_RESULT_TYPE_UNKNOWN); + apiLog("FCL Injector not initialized!"); + return; + } + if (param0 != null && param1 != null && param2 != null && param3 != null) { + Object type = null; + try { + Class minecraftClass = Class.forName(param0, true, classLoader); + Method method = minecraftClass.getDeclaredMethod(param1); + method.setAccessible(true); + Object minecraft = method.invoke(null); + Field targetField = minecraftClass.getDeclaredField(param2); + targetField.setAccessible(true); + Object target = targetField.get(minecraft); + if (target != null) { + if (!highVersion) { + Field typeField = target.getClass().getDeclaredField(param3); + typeField.setAccessible(true); + type = typeField.get(target); + } else { + Method typeMethod = target.getClass().getDeclaredMethod(param3); + typeMethod.setAccessible(true); + type = typeMethod.invoke(target); + } + } + } catch (ClassNotFoundException | NoSuchFieldException | NoSuchMethodException | IllegalAccessException | InvocationTargetException e) { + apiLog(e.getMessage()); + } + if (type != null && (type.toString().equals(HIT_RESULT_TYPE_MISS) || type.toString().equals(HIT_RESULT_TYPE_BLOCK) || type.toString().equals(HIT_RESULT_TYPE_ENTITY))) { + nglfwSetHitResultType(type.toString()); + } else { + nglfwSetHitResultType(HIT_RESULT_TYPE_UNKNOWN); + } + } + } + +} diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFW.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFW.java new file mode 100644 index 00000000..6fd39c55 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFW.java @@ -0,0 +1,4758 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the GLFW library. + * + *

GLFW is a free, Open Source, multi-platform library for opening a window, creating an OpenGL context and managing input. It is easy to integrate into + * existing applications and does not lay claim to the main loop.

+ */ +public class GLFW { + + /** The major version number of the GLFW library. This is incremented when the API is changed in non-compatible ways. */ + public static final int GLFW_VERSION_MAJOR = 3; + + /** The minor version number of the GLFW library. This is incremented when features are added to the API but it remains backward-compatible. */ + public static final int GLFW_VERSION_MINOR = 4; + + /** The revision number of the GLFW library. This is incremented when a bug fix release is made that does not contain any API changes. */ + public static final int GLFW_VERSION_REVISION = 0; + + /** Boolean values. */ + public static final int + GLFW_TRUE = 1, + GLFW_FALSE = 0; + + /** The key or button was released. */ + public static final int GLFW_RELEASE = 0; + + /** The key or button was pressed. */ + public static final int GLFW_PRESS = 1; + + /** The key was held down until it repeated. */ + public static final int GLFW_REPEAT = 2; + + /** Joystick hat states. */ + public static final int + GLFW_HAT_CENTERED = 0, + GLFW_HAT_UP = 1, + GLFW_HAT_RIGHT = 2, + GLFW_HAT_DOWN = 4, + GLFW_HAT_LEFT = 8, + GLFW_HAT_RIGHT_UP = (GLFW_HAT_RIGHT | GLFW_HAT_UP), + GLFW_HAT_RIGHT_DOWN = (GLFW_HAT_RIGHT | GLFW_HAT_DOWN), + GLFW_HAT_LEFT_UP = (GLFW_HAT_LEFT | GLFW_HAT_UP), + GLFW_HAT_LEFT_DOWN = (GLFW_HAT_LEFT | GLFW_HAT_DOWN); + + /** The unknown key. */ + public static final int GLFW_KEY_UNKNOWN = -1; + + /** Printable keys. */ + public static final int + GLFW_KEY_SPACE = 32, + GLFW_KEY_APOSTROPHE = 39, + GLFW_KEY_COMMA = 44, + GLFW_KEY_MINUS = 45, + GLFW_KEY_PERIOD = 46, + GLFW_KEY_SLASH = 47, + GLFW_KEY_0 = 48, + GLFW_KEY_1 = 49, + GLFW_KEY_2 = 50, + GLFW_KEY_3 = 51, + GLFW_KEY_4 = 52, + GLFW_KEY_5 = 53, + GLFW_KEY_6 = 54, + GLFW_KEY_7 = 55, + GLFW_KEY_8 = 56, + GLFW_KEY_9 = 57, + GLFW_KEY_SEMICOLON = 59, + GLFW_KEY_EQUAL = 61, + GLFW_KEY_A = 65, + GLFW_KEY_B = 66, + GLFW_KEY_C = 67, + GLFW_KEY_D = 68, + GLFW_KEY_E = 69, + GLFW_KEY_F = 70, + GLFW_KEY_G = 71, + GLFW_KEY_H = 72, + GLFW_KEY_I = 73, + GLFW_KEY_J = 74, + GLFW_KEY_K = 75, + GLFW_KEY_L = 76, + GLFW_KEY_M = 77, + GLFW_KEY_N = 78, + GLFW_KEY_O = 79, + GLFW_KEY_P = 80, + GLFW_KEY_Q = 81, + GLFW_KEY_R = 82, + GLFW_KEY_S = 83, + GLFW_KEY_T = 84, + GLFW_KEY_U = 85, + GLFW_KEY_V = 86, + GLFW_KEY_W = 87, + GLFW_KEY_X = 88, + GLFW_KEY_Y = 89, + GLFW_KEY_Z = 90, + GLFW_KEY_LEFT_BRACKET = 91, + GLFW_KEY_BACKSLASH = 92, + GLFW_KEY_RIGHT_BRACKET = 93, + GLFW_KEY_GRAVE_ACCENT = 96, + GLFW_KEY_WORLD_1 = 161, + GLFW_KEY_WORLD_2 = 162; + + /** Function keys. */ + public static final int + GLFW_KEY_ESCAPE = 256, + GLFW_KEY_ENTER = 257, + GLFW_KEY_TAB = 258, + GLFW_KEY_BACKSPACE = 259, + GLFW_KEY_INSERT = 260, + GLFW_KEY_DELETE = 261, + GLFW_KEY_RIGHT = 262, + GLFW_KEY_LEFT = 263, + GLFW_KEY_DOWN = 264, + GLFW_KEY_UP = 265, + GLFW_KEY_PAGE_UP = 266, + GLFW_KEY_PAGE_DOWN = 267, + GLFW_KEY_HOME = 268, + GLFW_KEY_END = 269, + GLFW_KEY_CAPS_LOCK = 280, + GLFW_KEY_SCROLL_LOCK = 281, + GLFW_KEY_NUM_LOCK = 282, + GLFW_KEY_PRINT_SCREEN = 283, + GLFW_KEY_PAUSE = 284, + GLFW_KEY_F1 = 290, + GLFW_KEY_F2 = 291, + GLFW_KEY_F3 = 292, + GLFW_KEY_F4 = 293, + GLFW_KEY_F5 = 294, + GLFW_KEY_F6 = 295, + GLFW_KEY_F7 = 296, + GLFW_KEY_F8 = 297, + GLFW_KEY_F9 = 298, + GLFW_KEY_F10 = 299, + GLFW_KEY_F11 = 300, + GLFW_KEY_F12 = 301, + GLFW_KEY_F13 = 302, + GLFW_KEY_F14 = 303, + GLFW_KEY_F15 = 304, + GLFW_KEY_F16 = 305, + GLFW_KEY_F17 = 306, + GLFW_KEY_F18 = 307, + GLFW_KEY_F19 = 308, + GLFW_KEY_F20 = 309, + GLFW_KEY_F21 = 310, + GLFW_KEY_F22 = 311, + GLFW_KEY_F23 = 312, + GLFW_KEY_F24 = 313, + GLFW_KEY_F25 = 314, + GLFW_KEY_KP_0 = 320, + GLFW_KEY_KP_1 = 321, + GLFW_KEY_KP_2 = 322, + GLFW_KEY_KP_3 = 323, + GLFW_KEY_KP_4 = 324, + GLFW_KEY_KP_5 = 325, + GLFW_KEY_KP_6 = 326, + GLFW_KEY_KP_7 = 327, + GLFW_KEY_KP_8 = 328, + GLFW_KEY_KP_9 = 329, + GLFW_KEY_KP_DECIMAL = 330, + GLFW_KEY_KP_DIVIDE = 331, + GLFW_KEY_KP_MULTIPLY = 332, + GLFW_KEY_KP_SUBTRACT = 333, + GLFW_KEY_KP_ADD = 334, + GLFW_KEY_KP_ENTER = 335, + GLFW_KEY_KP_EQUAL = 336, + GLFW_KEY_LEFT_SHIFT = 340, + GLFW_KEY_LEFT_CONTROL = 341, + GLFW_KEY_LEFT_ALT = 342, + GLFW_KEY_LEFT_SUPER = 343, + GLFW_KEY_RIGHT_SHIFT = 344, + GLFW_KEY_RIGHT_CONTROL = 345, + GLFW_KEY_RIGHT_ALT = 346, + GLFW_KEY_RIGHT_SUPER = 347, + GLFW_KEY_MENU = 348, + GLFW_KEY_LAST = GLFW_KEY_MENU; + + /** If this bit is set one or more Shift keys were held down. */ + public static final int GLFW_MOD_SHIFT = 0x1; + + /** If this bit is set one or more Control keys were held down. */ + public static final int GLFW_MOD_CONTROL = 0x2; + + /** If this bit is set one or more Alt keys were held down. */ + public static final int GLFW_MOD_ALT = 0x4; + + /** If this bit is set one or more Super keys were held down. */ + public static final int GLFW_MOD_SUPER = 0x8; + + /** If this bit is set the Caps Lock key is enabled and the {@link #GLFW_LOCK_KEY_MODS LOCK_KEY_MODS} input mode is set. */ + public static final int GLFW_MOD_CAPS_LOCK = 0x10; + + /** If this bit is set the Num Lock key is enabled and the {@link #GLFW_LOCK_KEY_MODS LOCK_KEY_MODS} input mode is set. */ + public static final int GLFW_MOD_NUM_LOCK = 0x20; + + /** Mouse buttons. See mouse button input for how these are used. */ + public static final int + GLFW_MOUSE_BUTTON_1 = 0, + GLFW_MOUSE_BUTTON_2 = 1, + GLFW_MOUSE_BUTTON_3 = 2, + GLFW_MOUSE_BUTTON_4 = 3, + GLFW_MOUSE_BUTTON_5 = 4, + GLFW_MOUSE_BUTTON_6 = 5, + GLFW_MOUSE_BUTTON_7 = 6, + GLFW_MOUSE_BUTTON_8 = 7, + GLFW_MOUSE_BUTTON_LAST = GLFW_MOUSE_BUTTON_8, + GLFW_MOUSE_BUTTON_LEFT = GLFW_MOUSE_BUTTON_1, + GLFW_MOUSE_BUTTON_RIGHT = GLFW_MOUSE_BUTTON_2, + GLFW_MOUSE_BUTTON_MIDDLE = GLFW_MOUSE_BUTTON_3; + + /** Joysticks. See joystick input for how these are used. */ + public static final int + GLFW_JOYSTICK_1 = 0, + GLFW_JOYSTICK_2 = 1, + GLFW_JOYSTICK_3 = 2, + GLFW_JOYSTICK_4 = 3, + GLFW_JOYSTICK_5 = 4, + GLFW_JOYSTICK_6 = 5, + GLFW_JOYSTICK_7 = 6, + GLFW_JOYSTICK_8 = 7, + GLFW_JOYSTICK_9 = 8, + GLFW_JOYSTICK_10 = 9, + GLFW_JOYSTICK_11 = 10, + GLFW_JOYSTICK_12 = 11, + GLFW_JOYSTICK_13 = 12, + GLFW_JOYSTICK_14 = 13, + GLFW_JOYSTICK_15 = 14, + GLFW_JOYSTICK_16 = 15, + GLFW_JOYSTICK_LAST = GLFW_JOYSTICK_16; + + /** Gamepad buttons. See gamepad for how these are used. */ + public static final int + GLFW_GAMEPAD_BUTTON_A = 0, + GLFW_GAMEPAD_BUTTON_B = 1, + GLFW_GAMEPAD_BUTTON_X = 2, + GLFW_GAMEPAD_BUTTON_Y = 3, + GLFW_GAMEPAD_BUTTON_LEFT_BUMPER = 4, + GLFW_GAMEPAD_BUTTON_RIGHT_BUMPER = 5, + GLFW_GAMEPAD_BUTTON_BACK = 6, + GLFW_GAMEPAD_BUTTON_START = 7, + GLFW_GAMEPAD_BUTTON_GUIDE = 8, + GLFW_GAMEPAD_BUTTON_LEFT_THUMB = 9, + GLFW_GAMEPAD_BUTTON_RIGHT_THUMB = 10, + GLFW_GAMEPAD_BUTTON_DPAD_UP = 11, + GLFW_GAMEPAD_BUTTON_DPAD_RIGHT = 12, + GLFW_GAMEPAD_BUTTON_DPAD_DOWN = 13, + GLFW_GAMEPAD_BUTTON_DPAD_LEFT = 14, + GLFW_GAMEPAD_BUTTON_LAST = GLFW_GAMEPAD_BUTTON_DPAD_LEFT, + GLFW_GAMEPAD_BUTTON_CROSS = GLFW_GAMEPAD_BUTTON_A, + GLFW_GAMEPAD_BUTTON_CIRCLE = GLFW_GAMEPAD_BUTTON_B, + GLFW_GAMEPAD_BUTTON_SQUARE = GLFW_GAMEPAD_BUTTON_X, + GLFW_GAMEPAD_BUTTON_TRIANGLE = GLFW_GAMEPAD_BUTTON_Y; + + /** Gamepad axes. See gamepad for how these are used. */ + public static final int + GLFW_GAMEPAD_AXIS_LEFT_X = 0, + GLFW_GAMEPAD_AXIS_LEFT_Y = 1, + GLFW_GAMEPAD_AXIS_RIGHT_X = 2, + GLFW_GAMEPAD_AXIS_RIGHT_Y = 3, + GLFW_GAMEPAD_AXIS_LEFT_TRIGGER = 4, + GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER = 5, + GLFW_GAMEPAD_AXIS_LAST = GLFW_GAMEPAD_AXIS_RIGHT_TRIGGER; + + /** + * Error codes. + * + *
Enum values:
+ * + *
    + *
  • {@link #GLFW_NO_ERROR NO_ERROR} - No error has occurred.
  • + *
  • {@link #GLFW_NOT_INITIALIZED NOT_INITIALIZED} - + * GLFW has not been initialized. + * + *

    This occurs if a GLFW function was called that may not be called unless the library is initialized.

    + *
  • + *
  • {@link #GLFW_NO_CURRENT_CONTEXT NO_CURRENT_CONTEXT} - + * No context is current for this thread. + * + *

    This occurs if a GLFW function was called that needs and operates on the current OpenGL or OpenGL ES context but no context is current on the + * calling thread. One such function is {@link #glfwSwapInterval SwapInterval}.

    + *
  • + *
  • {@link #GLFW_INVALID_ENUM INVALID_ENUM} - + * One of the arguments to the function was an invalid enum value. + * + *

    One of the arguments to the function was an invalid enum value, for example requesting {@link #GLFW_RED_BITS RED_BITS} with {@link #glfwGetWindowAttrib GetWindowAttrib}.

    + *
  • + *
  • {@link #GLFW_INVALID_VALUE INVALID_VALUE} - + * One of the arguments to the function was an invalid value. + * + *

    One of the arguments to the function was an invalid value, for example requesting a non-existent OpenGL or OpenGL ES version like 2.7.

    + * + *

    Requesting a valid but unavailable OpenGL or OpenGL ES version will instead result in a {@link #GLFW_VERSION_UNAVAILABLE VERSION_UNAVAILABLE} error.

    + *
  • + *
  • {@link #GLFW_OUT_OF_MEMORY OUT_OF_MEMORY} - + * A memory allocation failed. + * + *

    A bug in GLFW or the underlying operating system. Report the bug to our issue tracker.

    + *
  • + *
  • {@link #GLFW_API_UNAVAILABLE API_UNAVAILABLE} - + * GLFW could not find support for the requested API on the system. + * + *

    The installed graphics driver does not support the requested API, or does not support it via the chosen context creation backend. Below are a few + * examples:

    + * + *

    Some pre-installed Windows graphics drivers do not support OpenGL. AMD only supports OpenGL ES via EGL, while Nvidia and Intel only support it via + * a WGL or GLX extension. macOS does not provide OpenGL ES at all. The Mesa EGL, OpenGL and OpenGL ES libraries do not interface with the Nvidia + * binary driver. Older graphics drivers do not support Vulkan.

    + *
  • + *
  • {@link #GLFW_VERSION_UNAVAILABLE VERSION_UNAVAILABLE} - + * The requested OpenGL or OpenGL ES version (including any requested context or framebuffer hints) is not available on this machine. + * + *

    The machine does not support your requirements. If your application is sufficiently flexible, downgrade your requirements and try again. Otherwise, + * inform the user that their machine does not match your requirements.

    + * + *

    Future invalid OpenGL and OpenGL ES versions, for example OpenGL 4.8 if 5.0 comes out before the 4.x series gets that far, also fail with this + * error and not {@link #GLFW_INVALID_VALUE INVALID_VALUE}, because GLFW cannot know what future versions will exist.

    + *
  • + *
  • {@link #GLFW_PLATFORM_ERROR PLATFORM_ERROR} - + * A platform-specific error occurred that does not match any of the more specific categories. + * + *

    A bug or configuration error in GLFW, the underlying operating system or its drivers, or a lack of required resources. Report the issue to our + * issue tracker.

    + *
  • + *
  • {@link #GLFW_FORMAT_UNAVAILABLE FORMAT_UNAVAILABLE} - + * The requested format is not supported or available. + * + *

    If emitted during window creation, one or more hard constraints did not match any of the available pixel formats. If your application is + * sufficiently flexible, downgrade your requirements and try again. Otherwise, inform the user that their machine does not match your requirements.

    + * + *

    If emitted when querying the clipboard, ignore the error or report it to the user, as appropriate.

    + *
  • + *
  • {@link #GLFW_NO_WINDOW_CONTEXT NO_WINDOW_CONTEXT} - + * The specified window does not have an OpenGL or OpenGL ES context. + * + *

    A window that does not have an OpenGL or OpenGL ES context was passed to a function that requires it to have one.

    + * + *

    Application programmer error. Fix the offending call.

    + *
  • + *
+ */ + public static final int + GLFW_NO_ERROR = 0, + GLFW_NOT_INITIALIZED = 0x10001, + GLFW_NO_CURRENT_CONTEXT = 0x10002, + GLFW_INVALID_ENUM = 0x10003, + GLFW_INVALID_VALUE = 0x10004, + GLFW_OUT_OF_MEMORY = 0x10005, + GLFW_API_UNAVAILABLE = 0x10006, + GLFW_VERSION_UNAVAILABLE = 0x10007, + GLFW_PLATFORM_ERROR = 0x10008, + GLFW_FORMAT_UNAVAILABLE = 0x10009, + GLFW_NO_WINDOW_CONTEXT = 0x1000A; + + /** + * Window attributes. + * + *
Enum values:
+ * + *
    + *
  • {@link #GLFW_FOCUSED FOCUSED} - + * {@code WindowHint}: Specifies whether the windowed mode window will be given input focus when created. This hint is ignored for full screen and + * initially hidden windows. + * + *

    {@code GetWindowAttrib}: Indicates whether the specified window has input focus.

    + *
  • + *
  • {@link #GLFW_ICONIFIED ICONIFIED} - {@code GetWindowAttrib}: Indicates whether the specified window is iconified, whether by the user or with {@link #glfwIconifyWindow IconifyWindow}.
  • + *
  • {@link #GLFW_RESIZABLE RESIZABLE} - + * {@code WindowHint}: Specifies whether the windowed mode window will be resizable by the user. The window will still be resizable using the + * {@link #glfwSetWindowSize SetWindowSize} function. This hint is ignored for full screen windows. + * + *

    {@code GetWindowAttrib}: Indicates whether the specified window is resizable by the user.

    + *
  • + *
  • {@link #GLFW_VISIBLE VISIBLE} - + * {@code WindowHint}: Specifies whether the windowed mode window will be initially visible. This hint is ignored for full screen windows. Windows created + * hidden are completely invisible to the user until shown. This can be useful if you need to set up your window further before showing it, for + * example moving it to a specific location. + * + *

    {@code GetWindowAttrib}: Indicates whether the specified window is visible. Window visibility can be controlled with {@link #glfwShowWindow ShowWindow} and {@link #glfwHideWindow HideWindow}.

    + *
  • + *
  • {@link #GLFW_DECORATED DECORATED} - + * {@code WindowHint}: Specifies whether the windowed mode window will have window decorations such as a border, a close widget, etc. An undecorated window + * may still allow the user to generate close events on some platforms. This hint is ignored for full screen windows. + * + *

    {@code GetWindowAttrib}: Indicates whether the specified window has decorations such as a border, a close widget, etc.

    + *
  • + *
  • {@link #GLFW_AUTO_ICONIFY AUTO_ICONIFY} - + * {@code WindowHint}: Specifies whether the full screen window will automatically iconify and restore the previous video mode on input focus loss. This + * hint is ignored for windowed mode windows. + *
  • + *
  • {@link #GLFW_FLOATING FLOATING} - + * {@code WindowHint}: Specifies whether the windowed mode window will be floating above other regular windows, also called topmost or always-on-top. This + * is intended primarily for debugging purposes and cannot be used to implement proper full screen windows. This hint is ignored for full screen + * windows. + * + *

    {@code GetWindowAttrib}: Indicates whether the specified window is floating, also called topmost or always-on-top.

    + *
  • + *
  • {@link #GLFW_MAXIMIZED MAXIMIZED} - + * {@code WindowHint}: Specifies whether the windowed mode window will be maximized when created. This hint is ignored for full screen windows. + * + *

    {@code GetWindowAttrib}: Indicates whether the specified window is maximized, whether by the user or {@link #glfwMaximizeWindow MaximizeWindow}.

    + *
  • + *
  • {@link #GLFW_CENTER_CURSOR CENTER_CURSOR} - + * {@code WindowHint}: Specifies whether the cursor should be centered over newly created full screen windows. This hint is ignored for windowed mode + * windows. + *
  • + *
  • {@link #GLFW_TRANSPARENT_FRAMEBUFFER TRANSPARENT_FRAMEBUFFER} - + * {@code WindowHint}: specifies whether the window framebuffer will be transparent. If enabled and supported by the system, the window framebuffer + * alpha channel will be used to combine the framebuffer with the background. This does not affect window decorations. + *
  • + *
  • {@link #GLFW_HOVERED HOVERED} - {@code GetWindowAttrib}: indicates whether the cursor is currently directly over the content area of the window, with no other windows between.
  • + *
  • {@link #GLFW_FOCUS_ON_SHOW FOCUS_ON_SHOW} - + * {@code WindowHint}: specifies whether input focuses on calling show window. + * + *

    {@code GetWindowAttrib}: Indicates whether input focuses on calling show window.

    + *
  • + *
+ */ + public static final int + GLFW_FOCUSED = 0x20001, + GLFW_ICONIFIED = 0x20002, + GLFW_RESIZABLE = 0x20003, + GLFW_VISIBLE = 0x20004, + GLFW_DECORATED = 0x20005, + GLFW_AUTO_ICONIFY = 0x20006, + GLFW_FLOATING = 0x20007, + GLFW_MAXIMIZED = 0x20008, + GLFW_CENTER_CURSOR = 0x20009, + GLFW_TRANSPARENT_FRAMEBUFFER = 0x2000A, + GLFW_HOVERED = 0x2000B, + GLFW_FOCUS_ON_SHOW = 0x2000C; + + /** Input options. */ + public static final int + GLFW_CURSOR = 0x33001, + GLFW_STICKY_KEYS = 0x33002, + GLFW_STICKY_MOUSE_BUTTONS = 0x33003, + GLFW_LOCK_KEY_MODS = 0x33004, + GLFW_RAW_MOUSE_MOTION = 0x33005; + + /** Cursor state. */ + public static final int + GLFW_CURSOR_NORMAL = 0x34001, + GLFW_CURSOR_HIDDEN = 0x34002, + GLFW_CURSOR_DISABLED = 0x34003; + + /** Standard cursor shapes. See standard cursor creation for how these are used. */ + public static final int + GLFW_ARROW_CURSOR = 0x36001, + GLFW_IBEAM_CURSOR = 0x36002, + GLFW_CROSSHAIR_CURSOR = 0x36003, + GLFW_HAND_CURSOR = 0x36004, + GLFW_HRESIZE_CURSOR = 0x36005, + GLFW_VRESIZE_CURSOR = 0x36006; + + /** Monitor events. */ + public static final int + GLFW_CONNECTED = 0x40001, + GLFW_DISCONNECTED = 0x40002; + + /** Init hints. */ + public static final int + GLFW_JOYSTICK_HAT_BUTTONS = 0x50001, + GLFW_COCOA_CHDIR_RESOURCES = 0x51001, + GLFW_COCOA_MENUBAR = 0x51002; + + /** Don't care value. */ + public static final int GLFW_DONT_CARE = -1; + + /** PixelFormat hints. */ + public static final int + GLFW_RED_BITS = 0x21001, + GLFW_GREEN_BITS = 0x21002, + GLFW_BLUE_BITS = 0x21003, + GLFW_ALPHA_BITS = 0x21004, + GLFW_DEPTH_BITS = 0x21005, + GLFW_STENCIL_BITS = 0x21006, + GLFW_ACCUM_RED_BITS = 0x21007, + GLFW_ACCUM_GREEN_BITS = 0x21008, + GLFW_ACCUM_BLUE_BITS = 0x21009, + GLFW_ACCUM_ALPHA_BITS = 0x2100A, + GLFW_AUX_BUFFERS = 0x2100B, + GLFW_STEREO = 0x2100C, + GLFW_SAMPLES = 0x2100D, + GLFW_SRGB_CAPABLE = 0x2100E, + GLFW_REFRESH_RATE = 0x2100F, + GLFW_DOUBLEBUFFER = 0x21010; + + /** + * Client API hints. + * + *
Enum values:
+ * + *
    + *
  • {@link #GLFW_CLIENT_API CLIENT_API} - + * {@code WindowHint}: Specifies which client API to create the context for. Possible values are {@link #GLFW_OPENGL_API OPENGL_API}, {@link #GLFW_OPENGL_ES_API OPENGL_ES_API} and {@link #GLFW_NO_API NO_API}. This is a hard + * constraint. + * + *

    {@code GetWindowAttrib}: Indicates the client API provided by the window's context; either {@link #GLFW_OPENGL_API OPENGL_API}, {@link #GLFW_OPENGL_ES_API OPENGL_ES_API} or {@link #GLFW_NO_API NO_API}.

    + *
  • + *
  • {@link #GLFW_CONTEXT_VERSION_MAJOR CONTEXT_VERSION_MAJOR} - + * {@code WindowHint}: Specifies the client API major version that the created context must be compatible with. The exact behavior of this hint depends on + * the requested client API. + * + *
    Note
    + * + *
      + *
    • While there is no way to ask the driver for a context of the highest supported version, GLFW will attempt to provide this when you ask for a + * version 1.0 context, which is the default for these hints.
    • + *
    • OpenGL: {@link #GLFW_CONTEXT_VERSION_MAJOR CONTEXT_VERSION_MAJOR} and {@link #GLFW_CONTEXT_VERSION_MINOR CONTEXT_VERSION_MINOR} are not hard constraints, but creation will fail if the OpenGL version of the + * created context is less than the one requested. It is therefore perfectly safe to use the default of version 1.0 for legacy code and you will + * still get backwards-compatible contexts of version 3.0 and above when available.
    • + *
    • OpenGL ES: {@link #GLFW_CONTEXT_VERSION_MAJOR CONTEXT_VERSION_MAJOR} and {@link #GLFW_CONTEXT_VERSION_MINOR CONTEXT_VERSION_MINOR} are not hard constraints, but creation will fail if the OpenGL ES version + * of the created context is less than the one requested. Additionally, OpenGL ES 1.x cannot be returned if 2.0 or later was requested, and vice + * versa. This is because OpenGL ES 3.x is backward compatible with 2.0, but OpenGL ES 2.0 is not backward compatible with 1.x.
    • + *
    + * + *

    {@code GetWindowAttrib}: Indicate the client API major version of the window's context.

    + *
  • + *
  • {@link #GLFW_CONTEXT_VERSION_MINOR CONTEXT_VERSION_MINOR} - + * {@code WindowHint}: Specifies the client API minor version that the created context must be compatible with. The exact behavior of this hint depends on + * the requested client API. + * + *

    {@code GetWindowAttrib}: Indicate the client API minor version of the window's context.

    + *
  • + *
  • {@link #GLFW_CONTEXT_REVISION CONTEXT_REVISION} - {@code GetWindowAttrib}: Indicates the client API version of the window's context.
  • + *
  • {@link #GLFW_CONTEXT_ROBUSTNESS CONTEXT_ROBUSTNESS} - + * {@code WindowHint}: Specifies the robustness strategy to be used by the context. This can be one of {@link #GLFW_NO_RESET_NOTIFICATION NO_RESET_NOTIFICATION} or {@link #GLFW_LOSE_CONTEXT_ON_RESET LOSE_CONTEXT_ON_RESET}, or + * {@link #GLFW_NO_ROBUSTNESS NO_ROBUSTNESS} to not request a robustness strategy. + * + *

    {@code GetWindowAttrib}: Indicates the robustness strategy used by the context. This is {@link #GLFW_LOSE_CONTEXT_ON_RESET LOSE_CONTEXT_ON_RESET} or {@link #GLFW_NO_RESET_NOTIFICATION NO_RESET_NOTIFICATION} if the window's + * context supports robustness, or {@link #GLFW_NO_ROBUSTNESS NO_ROBUSTNESS} otherwise.

    + *
  • + *
  • {@link #GLFW_OPENGL_FORWARD_COMPAT OPENGL_FORWARD_COMPAT} - + * {@code WindowHint}: Specifies whether the OpenGL context should be forward-compatible, i.e. one where all functionality deprecated in the requested + * version of OpenGL is removed. This must only be used if the requested OpenGL version is 3.0 or above. If OpenGL ES is requested, this hint is + * ignored. + * + *

    {@code GetWindowAttrib}: Indicates if the window's context is an OpenGL forward-compatible one.

    + *
  • + *
  • {@link #GLFW_OPENGL_DEBUG_CONTEXT OPENGL_DEBUG_CONTEXT} - + * {@code WindowHint}: Specifies whether to create a debug OpenGL context, which may have additional error and performance issue reporting functionality. + * If OpenGL ES is requested, this hint is ignored. + * + *

    {@code GetWindowAttrib}: Indicates if the window's context is an OpenGL debug context.

    + *
  • + *
  • {@link #GLFW_OPENGL_PROFILE OPENGL_PROFILE} - + * {@code WindowHint}: Specifies which OpenGL profile to create the context for. Possible values are one of {@link #GLFW_OPENGL_CORE_PROFILE OPENGL_CORE_PROFILE} or {@link #GLFW_OPENGL_COMPAT_PROFILE OPENGL_COMPAT_PROFILE}, + * or {@link #GLFW_OPENGL_ANY_PROFILE OPENGL_ANY_PROFILE} to not request a specific profile. If requesting an OpenGL version below 3.2, {@link #GLFW_OPENGL_ANY_PROFILE OPENGL_ANY_PROFILE} must be used. If OpenGL ES + * is requested, this hint is ignored. + * + *

    {@code GetWindowAttrib}: Indicates the OpenGL profile used by the context. This is {@link #GLFW_OPENGL_CORE_PROFILE OPENGL_CORE_PROFILE} or {@link #GLFW_OPENGL_COMPAT_PROFILE OPENGL_COMPAT_PROFILE} if the context uses a + * known profile, or {@link #GLFW_OPENGL_ANY_PROFILE OPENGL_ANY_PROFILE} if the OpenGL profile is unknown or the context is an OpenGL ES context. Note that the returned profile may + * not match the profile bits of the context flags, as GLFW will try other means of detecting the profile when no bits are set.

    + *
  • + *
  • {@link #GLFW_CONTEXT_RELEASE_BEHAVIOR CONTEXT_RELEASE_BEHAVIOR} - + * {@code WindowHint}: Specifies the release behavior to be used by the context. If the behavior is {@link #GLFW_ANY_RELEASE_BEHAVIOR ANY_RELEASE_BEHAVIOR}, the default behavior of the + * context creation API will be used. If the behavior is {@link #GLFW_RELEASE_BEHAVIOR_FLUSH RELEASE_BEHAVIOR_FLUSH}, the pipeline will be flushed whenever the context is released from + * being the current one. If the behavior is {@link #GLFW_RELEASE_BEHAVIOR_NONE RELEASE_BEHAVIOR_NONE}, the pipeline will not be flushed on release. + *
  • + *
  • {@link #GLFW_CONTEXT_NO_ERROR CONTEXT_NO_ERROR} - + * {@code WindowHint}: Specifies whether errors should be generated by the context. If enabled, situations that would have generated errors instead cause + * undefined behavior. + *
  • + *
  • {@link #GLFW_CONTEXT_CREATION_API CONTEXT_CREATION_API} - + * {@code WindowHint}: Specifies which context creation API to use to create the context. Possible values are {@link #GLFW_NATIVE_CONTEXT_API NATIVE_CONTEXT_API} and {@link #GLFW_EGL_CONTEXT_API EGL_CONTEXT_API}. + * This is a hard constraint. If no client API is requested, this hint is ignored. + * + *
    Note
    + * + *
      + *
    • macOS: The EGL API is not available on this platform and requests to use it will fail.
    • + *
    • Wayland, Mir: The EGL API is the native context creation API, so this hint will have no effect.
    • + *
    • An OpenGL extension loader library that assumes it knows which context creation API is used on a given platform may fail if you change this + * hint. This can be resolved by having it load via {@link #glfwGetProcAddress GetProcAddress}, which always uses the selected API.
    • + *
    + * + *

    {@code GetWindowAttrib}: Indicates the context creation API used to create the window's context; either {@link #GLFW_NATIVE_CONTEXT_API NATIVE_CONTEXT_API} or {@link #GLFW_EGL_CONTEXT_API EGL_CONTEXT_API}.

    + *
  • + *
  • {@link #GLFW_SCALE_TO_MONITOR SCALE_TO_MONITOR} - + * {@code WindowHint}: Specifies whether the window content area should be resized based on the monitor content scale of any monitor it is placed on. + * This includes the initial placement when the window is created. Possible values are {@link #GLFW_TRUE TRUE} and {@link #GLFW_FALSE FALSE}. + * + *

    This hint only has an effect on platforms where screen coordinates and pixels always map 1:1 such as Windows and X11. On platforms like macOS the + * resolution of the framebuffer is changed independently of the window size.

    + *
  • + *
+ */ + public static final int + GLFW_CLIENT_API = 0x22001, + GLFW_CONTEXT_VERSION_MAJOR = 0x22002, + GLFW_CONTEXT_VERSION_MINOR = 0x22003, + GLFW_CONTEXT_REVISION = 0x22004, + GLFW_CONTEXT_ROBUSTNESS = 0x22005, + GLFW_OPENGL_FORWARD_COMPAT = 0x22006, + GLFW_OPENGL_DEBUG_CONTEXT = 0x22007, + GLFW_OPENGL_PROFILE = 0x22008, + GLFW_CONTEXT_RELEASE_BEHAVIOR = 0x22009, + GLFW_CONTEXT_NO_ERROR = 0x2200A, + GLFW_CONTEXT_CREATION_API = 0x2200B, + GLFW_SCALE_TO_MONITOR = 0x2200C; + + /** Specifies whether to use full resolution framebuffers on Retina displays. This is ignored on other platforms. */ + public static final int GLFW_COCOA_RETINA_FRAMEBUFFER = 0x23001; + + /** + * Specifies the UTF-8 encoded name to use for autosaving the window frame, or if empty disables frame autosaving for the window. This is ignored on other + * platforms. This is set with {@link #glfwWindowHintString WindowHintString}. + */ + public static final int GLFW_COCOA_FRAME_NAME = 0x23002; + + /** + * Specifies whether to enable Automatic Graphics Switching, i.e. to allow the system to choose the integrated GPU for the OpenGL context and move it + * between GPUs if necessary or whether to force it to always run on the discrete GPU. This only affects systems with both integrated and discrete GPUs. + * This is ignored on other platforms. + */ + public static final int GLFW_COCOA_GRAPHICS_SWITCHING = 0x23003; + + /** The desired ASCII encoded class and instance parts of the ICCCM {@code WM_CLASS} window property. These are set with {@link #glfwWindowHintString WindowHintString}. */ + public static final int + GLFW_X11_CLASS_NAME = 0x24001, + GLFW_X11_INSTANCE_NAME = 0x24002; + + /** Values for the {@link #GLFW_CLIENT_API CLIENT_API} hint. */ + public static final int + GLFW_NO_API = 0, + GLFW_OPENGL_API = 0x30001, + GLFW_OPENGL_ES_API = 0x30002; + + /** Values for the {@link #GLFW_CONTEXT_ROBUSTNESS CONTEXT_ROBUSTNESS} hint. */ + public static final int + GLFW_NO_ROBUSTNESS = 0, + GLFW_NO_RESET_NOTIFICATION = 0x31001, + GLFW_LOSE_CONTEXT_ON_RESET = 0x31002; + + /** Values for the {@link #GLFW_OPENGL_PROFILE OPENGL_PROFILE} hint. */ + public static final int + GLFW_OPENGL_ANY_PROFILE = 0, + GLFW_OPENGL_CORE_PROFILE = 0x32001, + GLFW_OPENGL_COMPAT_PROFILE = 0x32002; + + /** Values for the {@link #GLFW_CONTEXT_RELEASE_BEHAVIOR CONTEXT_RELEASE_BEHAVIOR} hint. */ + public static final int + GLFW_ANY_RELEASE_BEHAVIOR = 0, + GLFW_RELEASE_BEHAVIOR_FLUSH = 0x35001, + GLFW_RELEASE_BEHAVIOR_NONE = 0x35002; + + /** Values for the {@link #GLFW_CONTEXT_CREATION_API CONTEXT_CREATION_API} hint. */ + public static final int + GLFW_NATIVE_CONTEXT_API = 0x36001, + GLFW_EGL_CONTEXT_API = 0x36002, + GLFW_OSMESA_CONTEXT_API = 0x36003; + + private static final GLFWVidMode glfwVidMode; + public static int glfwWindowWidth; + public static int glfwWindowHeight; + + protected GLFW() { + throw new UnsupportedOperationException(); + } + + public static final SharedLibrary GLFW = Library.loadNative(GLFW.class, "org.lwjgl.glfw", Configuration.GLFW_LIBRARY_NAME.get(Platform.mapLibraryNameBundled("glfw")), true); + static { + glfwWindowWidth = Integer.parseInt(System.getProperty("window.width")); + glfwWindowHeight = Integer.parseInt(System.getProperty("window.height")); + glfwVidMode = new GLFWVidMode(ByteBuffer.allocateDirect(GLFWVidMode.SIZEOF)); + memPutInt(glfwVidMode.address() + GLFWVidMode.WIDTH, glfwWindowWidth); + memPutInt(glfwVidMode.address() + GLFWVidMode.HEIGHT, glfwWindowHeight); + memPutInt(glfwVidMode.address() + GLFWVidMode.REDBITS, 8); + memPutInt(glfwVidMode.address() + GLFWVidMode.GREENBITS, 8); + memPutInt(glfwVidMode.address() + GLFWVidMode.BLUEBITS, 8); + memPutInt(glfwVidMode.address() + GLFWVidMode.REFRESHRATE, 60); + } + /** Contains the function pointers loaded from the glfw {@link SharedLibrary}. */ + public static final class Functions { + + private Functions() {} + + /** Function address. */ + public static final long + Init = apiGetFunctionAddress(GLFW, "glfwInit"), + Terminate = apiGetFunctionAddress(GLFW, "glfwTerminate"), + InitHint = apiGetFunctionAddress(GLFW, "glfwInitHint"), + GetVersion = apiGetFunctionAddress(GLFW, "glfwGetVersion"), + GetVersionString = apiGetFunctionAddress(GLFW, "glfwGetVersionString"), + GetError = apiGetFunctionAddress(GLFW, "glfwGetError"), + SetErrorCallback = apiGetFunctionAddress(GLFW, "glfwSetErrorCallback"), + GetMonitors = apiGetFunctionAddress(GLFW, "glfwGetMonitors"), + GetPrimaryMonitor = apiGetFunctionAddress(GLFW, "glfwGetPrimaryMonitor"), + GetMonitorPos = apiGetFunctionAddress(GLFW, "glfwGetMonitorPos"), + GetMonitorWorkarea = apiGetFunctionAddress(GLFW, "glfwGetMonitorWorkarea"), + GetMonitorPhysicalSize = apiGetFunctionAddress(GLFW, "glfwGetMonitorPhysicalSize"), + GetMonitorContentScale = apiGetFunctionAddress(GLFW, "glfwGetMonitorContentScale"), + GetMonitorName = apiGetFunctionAddress(GLFW, "glfwGetMonitorName"), + SetMonitorUserPointer = apiGetFunctionAddress(GLFW, "glfwSetMonitorUserPointer"), + GetMonitorUserPointer = apiGetFunctionAddress(GLFW, "glfwGetMonitorUserPointer"), + SetMonitorCallback = apiGetFunctionAddress(GLFW, "glfwSetMonitorCallback"), + GetVideoModes = apiGetFunctionAddress(GLFW, "glfwGetVideoModes"), + GetVideoMode = apiGetFunctionAddress(GLFW, "glfwGetVideoMode"), + SetGamma = apiGetFunctionAddress(GLFW, "glfwSetGamma"), + GetGammaRamp = apiGetFunctionAddress(GLFW, "glfwGetGammaRamp"), + SetGammaRamp = apiGetFunctionAddress(GLFW, "glfwSetGammaRamp"), + DefaultWindowHints = apiGetFunctionAddress(GLFW, "glfwDefaultWindowHints"), + WindowHint = apiGetFunctionAddress(GLFW, "glfwWindowHint"), + WindowHintString = apiGetFunctionAddress(GLFW, "glfwWindowHintString"), + CreateWindow = apiGetFunctionAddress(GLFW, "glfwCreateWindow"), + DestroyWindow = apiGetFunctionAddress(GLFW, "glfwDestroyWindow"), + WindowShouldClose = apiGetFunctionAddress(GLFW, "glfwWindowShouldClose"), + SetWindowShouldClose = apiGetFunctionAddress(GLFW, "glfwSetWindowShouldClose"), + SetWindowTitle = apiGetFunctionAddress(GLFW, "glfwSetWindowTitle"), + SetWindowIcon = apiGetFunctionAddress(GLFW, "glfwSetWindowIcon"), + GetWindowPos = apiGetFunctionAddress(GLFW, "glfwGetWindowPos"), + SetWindowPos = apiGetFunctionAddress(GLFW, "glfwSetWindowPos"), + GetWindowSize = apiGetFunctionAddress(GLFW, "glfwGetWindowSize"), + SetWindowSizeLimits = apiGetFunctionAddress(GLFW, "glfwSetWindowSizeLimits"), + SetWindowAspectRatio = apiGetFunctionAddress(GLFW, "glfwSetWindowAspectRatio"), + SetWindowSize = apiGetFunctionAddress(GLFW, "glfwSetWindowSize"), + GetFramebufferSize = apiGetFunctionAddress(GLFW, "glfwGetFramebufferSize"), + GetWindowFrameSize = apiGetFunctionAddress(GLFW, "glfwGetWindowFrameSize"), + GetWindowContentScale = apiGetFunctionAddress(GLFW, "glfwGetWindowContentScale"), + GetWindowOpacity = apiGetFunctionAddress(GLFW, "glfwGetWindowOpacity"), + SetWindowOpacity = apiGetFunctionAddress(GLFW, "glfwSetWindowOpacity"), + IconifyWindow = apiGetFunctionAddress(GLFW, "glfwIconifyWindow"), + RestoreWindow = apiGetFunctionAddress(GLFW, "glfwRestoreWindow"), + MaximizeWindow = apiGetFunctionAddress(GLFW, "glfwMaximizeWindow"), + ShowWindow = apiGetFunctionAddress(GLFW, "glfwShowWindow"), + HideWindow = apiGetFunctionAddress(GLFW, "glfwHideWindow"), + FocusWindow = apiGetFunctionAddress(GLFW, "glfwFocusWindow"), + RequestWindowAttention = apiGetFunctionAddress(GLFW, "glfwRequestWindowAttention"), + GetWindowMonitor = apiGetFunctionAddress(GLFW, "glfwGetWindowMonitor"), + SetWindowMonitor = apiGetFunctionAddress(GLFW, "glfwSetWindowMonitor"), + GetWindowAttrib = apiGetFunctionAddress(GLFW, "glfwGetWindowAttrib"), + SetWindowAttrib = apiGetFunctionAddress(GLFW, "glfwSetWindowAttrib"), + SetWindowUserPointer = apiGetFunctionAddress(GLFW, "glfwSetWindowUserPointer"), + GetWindowUserPointer = apiGetFunctionAddress(GLFW, "glfwGetWindowUserPointer"), + SetWindowPosCallback = apiGetFunctionAddress(GLFW, "glfwSetWindowPosCallback"), + SetWindowSizeCallback = apiGetFunctionAddress(GLFW, "glfwSetWindowSizeCallback"), + SetWindowCloseCallback = apiGetFunctionAddress(GLFW, "glfwSetWindowCloseCallback"), + SetWindowRefreshCallback = apiGetFunctionAddress(GLFW, "glfwSetWindowRefreshCallback"), + SetWindowFocusCallback = apiGetFunctionAddress(GLFW, "glfwSetWindowFocusCallback"), + SetWindowIconifyCallback = apiGetFunctionAddress(GLFW, "glfwSetWindowIconifyCallback"), + SetWindowMaximizeCallback = apiGetFunctionAddress(GLFW, "glfwSetWindowMaximizeCallback"), + SetFramebufferSizeCallback = apiGetFunctionAddress(GLFW, "glfwSetFramebufferSizeCallback"), + SetWindowContentScaleCallback = apiGetFunctionAddress(GLFW, "glfwSetWindowContentScaleCallback"), + PollEvents = apiGetFunctionAddress(GLFW, "glfwPollEvents"), + WaitEvents = apiGetFunctionAddress(GLFW, "glfwWaitEvents"), + WaitEventsTimeout = apiGetFunctionAddress(GLFW, "glfwWaitEventsTimeout"), + PostEmptyEvent = apiGetFunctionAddress(GLFW, "glfwPostEmptyEvent"), + GetInputMode = apiGetFunctionAddress(GLFW, "glfwGetInputMode"), + SetInputMode = apiGetFunctionAddress(GLFW, "glfwSetInputMode"), + RawMouseMotionSupported = apiGetFunctionAddress(GLFW, "glfwRawMouseMotionSupported"), + GetKeyName = apiGetFunctionAddress(GLFW, "glfwGetKeyName"), + GetKeyScancode = apiGetFunctionAddress(GLFW, "glfwGetKeyScancode"), + GetKey = apiGetFunctionAddress(GLFW, "glfwGetKey"), + GetMouseButton = apiGetFunctionAddress(GLFW, "glfwGetMouseButton"), + GetCursorPos = apiGetFunctionAddress(GLFW, "glfwGetCursorPos"), + SetCursorPos = apiGetFunctionAddress(GLFW, "glfwSetCursorPos"), + CreateCursor = apiGetFunctionAddress(GLFW, "glfwCreateCursor"), + CreateStandardCursor = apiGetFunctionAddress(GLFW, "glfwCreateStandardCursor"), + DestroyCursor = apiGetFunctionAddress(GLFW, "glfwDestroyCursor"), + SetCursor = apiGetFunctionAddress(GLFW, "glfwSetCursor"), + SetKeyCallback = apiGetFunctionAddress(GLFW, "glfwSetKeyCallback"), + SetCharCallback = apiGetFunctionAddress(GLFW, "glfwSetCharCallback"), + SetCharModsCallback = apiGetFunctionAddress(GLFW, "glfwSetCharModsCallback"), + SetMouseButtonCallback = apiGetFunctionAddress(GLFW, "glfwSetMouseButtonCallback"), + SetCursorPosCallback = apiGetFunctionAddress(GLFW, "glfwSetCursorPosCallback"), + SetCursorEnterCallback = apiGetFunctionAddress(GLFW, "glfwSetCursorEnterCallback"), + SetScrollCallback = apiGetFunctionAddress(GLFW, "glfwSetScrollCallback"), + SetDropCallback = apiGetFunctionAddress(GLFW, "glfwSetDropCallback"), + SetClipboardString = apiGetFunctionAddress(GLFW, "glfwSetClipboardString"), + GetClipboardString = apiGetFunctionAddress(GLFW, "glfwGetClipboardString"), + GetTime = apiGetFunctionAddress(GLFW, "glfwGetTime"), + SetTime = apiGetFunctionAddress(GLFW, "glfwSetTime"), + GetTimerValue = apiGetFunctionAddress(GLFW, "glfwGetTimerValue"), + GetTimerFrequency = apiGetFunctionAddress(GLFW, "glfwGetTimerFrequency"), + MakeContextCurrent = apiGetFunctionAddress(GLFW, "glfwMakeContextCurrent"), + GetCurrentContext = apiGetFunctionAddress(GLFW, "glfwGetCurrentContext"), + SwapBuffers = apiGetFunctionAddress(GLFW, "glfwSwapBuffers"), + SwapInterval = apiGetFunctionAddress(GLFW, "glfwSwapInterval"), + ExtensionSupported = apiGetFunctionAddress(GLFW, "glfwExtensionSupported"), + GetProcAddress = apiGetFunctionAddress(GLFW, "glfwGetProcAddress"); + + } + + /** Returns the glfw {@link SharedLibrary}. */ + public static SharedLibrary getLibrary() { + return GLFW; + } + + // --- [ glfwInit ] --- + + /** + * Initializes the GLFW library. Before most GLFW functions can be used, GLFW must be initialized, and before an application terminates GLFW should be + * terminated in order to free any resources allocated during or after initialization. + * + *

If this function fails, it calls {@link #glfwTerminate Terminate} before returning. If it succeeds, you should call {@link #glfwTerminate Terminate} before the application exits.

+ * + *

Additional calls to this function after successful initialization but before termination will return {@link #GLFW_TRUE TRUE} immediately.

+ * + *
Note
+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • macOS: This function will change the current directory of the application to the `Contents/Resources` subdirectory of the application's + * bundle, if present. This can be disabled with the {@link #GLFW_COCOA_CHDIR_RESOURCES COCOA_CHDIR_RESOURCES} init hint.
  • + *
+ * + * @return {@link #GLFW_TRUE TRUE} if successful, or {@link #GLFW_FALSE FALSE} if an error occurred. + * + * @since version 1.0 + */ + @NativeType("int") + public static boolean glfwInit() { + long __functionAddress = Functions.Init; + return invokeI(__functionAddress) != 0; + } + + // --- [ glfwTerminate ] --- + + /** + * Destroys all remaining windows and cursors, restores any modified gamma ramps and frees any other allocated resources. Once this function is called, you + * must again call {@link #glfwInit Init} successfully before you will be able to use most GLFW functions. + * + *

If GLFW has been successfully initialized, this function should be called before the application exits. If initialization fails, there is no need to + * call this function, as it is called by {@link #glfwInit Init} before it returns failure.

+ * + *
Note
+ * + *
    + *
  • This function may be called before {@link #glfwInit Init}.
  • + *
  • This function must only be called from the main thread.
  • + *
  • This function must not be called from a callback.
  • + *
  • No window's context may be current on another thread when this function is called.
  • + *
+ * + * @since version 1.0 + */ + public static void glfwTerminate() { + long __functionAddress = Functions.Terminate; + invokeV(__functionAddress); + } + + // --- [ glfwInitHint ] --- + + /** + * Sets hints for the next initialization of GLFW. + * + *

The values you set hints to are never reset by GLFW, but they only take effect during initialization. Once GLFW has been initialized, any values you + * set will be ignored until the library is terminated and initialized again.

+ * + *

Some hints are platform specific. These may be set on any platform but they will only affect their specific platform. Other platforms will simply + * ignore them. Setting these hints requires no platform specific headers or functions.

+ * + *
Note
+ * + *
    + *
  • This function may be called before {@link #glfwInit Init}.
  • + *
  • This function must only be called from the main thread.
  • + *
+ * + * @param hint the init hint to set. One of:
{@link #GLFW_JOYSTICK_HAT_BUTTONS JOYSTICK_HAT_BUTTONS}{@link #GLFW_COCOA_CHDIR_RESOURCES COCOA_CHDIR_RESOURCES}{@link #GLFW_COCOA_MENUBAR COCOA_MENUBAR}
+ * @param value the new value of the init hint + * + * @since version 3.3 + */ + public static void glfwInitHint(int hint, int value) { + long __functionAddress = Functions.InitHint; + invokeV(hint, value, __functionAddress); + } + + // --- [ glfwGetVersion ] --- + + /** Unsafe version of: {@link #glfwGetVersion GetVersion} */ + public static void nglfwGetVersion(long major, long minor, long rev) { + long __functionAddress = Functions.GetVersion; + invokePPPV(major, minor, rev, __functionAddress); + } + + /** + * Retrieves the major, minor and revision numbers of the GLFW library. It is intended for when you are using GLFW as a shared library and want to ensure + * that you are using the minimum required version. + * + *
Note
+ * + *
    + *
  • Any or all of the version arguments may be {@code NULL}.
  • + *
  • This function always succeeds.
  • + *
  • This function may be called before {@link #glfwInit Init}.
  • + *
  • This function may be called from any thread.
  • + *
+ * + * @param major where to store the major version number, or {@code NULL} + * @param minor where to store the minor version number, or {@code NULL} + * @param rev where to store the revision number, or {@code NULL} + * + * @since version 1.0 + */ + public static void glfwGetVersion(@Nullable @NativeType("int *") IntBuffer major, @Nullable @NativeType("int *") IntBuffer minor, @Nullable @NativeType("int *") IntBuffer rev) { + if (CHECKS) { + checkSafe(major, 1); + checkSafe(minor, 1); + checkSafe(rev, 1); + } + nglfwGetVersion(memAddressSafe(major), memAddressSafe(minor), memAddressSafe(rev)); + } + + // --- [ glfwGetVersionString ] --- + + /** Unsafe version of: {@link #glfwGetVersionString GetVersionString} */ + public static long nglfwGetVersionString() { + long __functionAddress = Functions.GetVersionString; + return invokeP(__functionAddress); + } + + /** + * Returns the compile-time generated version string of the GLFW library binary. It describes the version, platform, compiler and any platform-specific + * compile-time options. It should not be confused with the OpenGL or OpenGL ES version string, queried with {@code glGetString}. + * + *

Do not use the version string to parse the GLFW library version. The {@link #glfwGetVersion GetVersion} function already provides the version of the library binary + * in numerical format.

+ * + *
Note
+ * + *
    + *
  • This function always succeeds.
  • + *
  • This function may be called before {@link #glfwInit Init}.
  • + *
  • This function may be called from any thread.
  • + *
  • The returned string is static and compile-time generated.
  • + *
+ * + * @return the ASCII encoded GLFW version string + * + * @since version 3.0 + */ + @NativeType("char const *") + public static String glfwGetVersionString() { + long __result = nglfwGetVersionString(); + return memASCII(__result); + } + + // --- [ glfwGetError ] --- + + /** Unsafe version of: {@link #glfwGetError GetError} */ + public static int nglfwGetError(long description) { + long __functionAddress = Functions.GetError; + return invokePI(description, __functionAddress); + } + + /** + * Returns and clears the last error for the calling thread. + * + *

This function returns and clears the error code of the last error that occurred on the calling thread and optionally a UTF-8 encoded human-readable + * description of it. If no error has occurred since the last call, it returns {@link #GLFW_NO_ERROR NO_ERROR} (zero), and the description pointer is set to {@code NULL}.

+ * + *
Note
+ * + *
    + *
  • This function may be called before {@link #glfwInit Init}.
  • + *
  • This function may be called from any thread.
  • + *
  • The returned string is allocated and freed by GLFW. You should not free it yourself. It is guaranteed to be valid only until the next error occurs + * or the library is terminated.
  • + *
+ * + * @param description where to store the error description pointer, or {@code NULL} + * + * @return the last error code for the calling thread, or {@link #GLFW_NO_ERROR NO_ERROR} (zero) + * + * @since version 3.3 + */ + public static int glfwGetError(@Nullable @NativeType("char const **") PointerBuffer description) { + if (CHECKS) { + checkSafe(description, 1); + } + return nglfwGetError(memAddressSafe(description)); + } + + // --- [ glfwSetErrorCallback ] --- + + /** Unsafe version of: {@link #glfwSetErrorCallback SetErrorCallback} */ + public static long nglfwSetErrorCallback(long cbfun) { + long __functionAddress = Functions.SetErrorCallback; + return invokePP(cbfun, __functionAddress); + } + + /** + * Sets the error callback, which is called with an error code and a human-readable description each time a GLFW error occurs. + * + *

The error code is set before the callback is called. Calling {@link #glfwGetError GetError} from the error callback will return the same value as the error code argument.

+ * + *

The error callback is called on the thread where the error occurred. If you are using GLFW from multiple threads, your error callback needs to be + * written accordingly.

+ * + *

Because the description string may have been generated specifically for that error, it is not guaranteed to be valid after the callback has returned. If + * you wish to use it after the callback returns, you need to make a copy.

+ * + *

Once set, the error callback remains set even after the library has been terminated.

+ * + *
Note
+ * + *
    + *
  • This function may be called before {@link #glfwInit Init}.
  • + *
  • This function must only be called from the main thread.
  • + *
+ * + * @param cbfun the new callback or {@code NULL} to remove the currently set callback + * + * @return the previously set callback, or {@code NULL} if no callback was set + * + * @since version 3.0 + */ + @Nullable + @NativeType("GLFWerrorfun") + public static GLFWErrorCallback glfwSetErrorCallback(@Nullable @NativeType("GLFWerrorfun") GLFWErrorCallbackI cbfun) { + return GLFWErrorCallback.createSafe(nglfwSetErrorCallback(memAddressSafe(cbfun))); + } + + // --- [ glfwGetMonitors ] --- + + /** + * Unsafe version of: {@link #glfwGetMonitors GetMonitors} + * + * @param count where to store the number of monitors in the returned array. This is set to zero if an error occurred. + */ + public static long nglfwGetMonitors(long count) { + long __functionAddress = Functions.GetMonitors; + return invokePP(count, __functionAddress); + } + + /** + * Returns an array of handles for all currently connected monitors. The primary monitor is always first in the returned array. If no monitors were found, + * this function returns {@code NULL}. + * + *

The returned array is allocated and freed by GLFW. You should not free it yourself. It is guaranteed to be valid only until the monitor configuration + * changes or the library is terminated.

+ * + *

This function must only be called from the main thread.

+ * + * @return an array of monitor handlers, or {@code NULL} if no monitors were found or if an error occurred + * + * @since version 3.0 + */ + @Nullable + @NativeType("GLFWmonitor **") + public static PointerBuffer glfwGetMonitors() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + IntBuffer count = stack.callocInt(1); + try { + long __result = nglfwGetMonitors(memAddress(count)); + return memPointerBufferSafe(__result, count.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glfwGetPrimaryMonitor ] --- + + /** + * Returns the primary monitor. This is usually the monitor where elements like the task bar or global menu bar are located. + * + *

This function must only be called from the main thread.

+ * + *

The primary monitor is always first in the array returned by {@link #glfwGetMonitors GetMonitors}.

+ * + * @return the primary monitor, or {@code NULL} if no monitors were found or if an error occurred + * + * @since version 3.0 + */ + @NativeType("GLFWmonitor *") + public static long glfwGetPrimaryMonitor() { + long __functionAddress = Functions.GetPrimaryMonitor; + return invokeP(__functionAddress); + } + + // --- [ glfwGetMonitorPos ] --- + + /** Unsafe version of: {@link #glfwGetMonitorPos GetMonitorPos} */ + public static void nglfwGetMonitorPos(long monitor, long xpos, long ypos) { + long __functionAddress = Functions.GetMonitorPos; + if (CHECKS) { + check(monitor); + } + invokePPPV(monitor, xpos, ypos, __functionAddress); + } + + /** + * Returns the position, in screen coordinates, of the upper-left corner of the specified monitor. + * + *

Any or all of the position arguments may be {@code NULL}. If an error occurs, all non-{@code NULL} position arguments will be set to zero.

+ * + *

This function must only be called from the main thread.

+ * + * @param monitor the monitor to query + * @param xpos where to store the monitor x-coordinate, or {@code NULL} + * @param ypos where to store the monitor y-coordinate, or {@code NULL} + * + * @since version 3.0 + */ + public static void glfwGetMonitorPos(@NativeType("GLFWmonitor *") long monitor, @Nullable @NativeType("int *") IntBuffer xpos, @Nullable @NativeType("int *") IntBuffer ypos) { + if (CHECKS) { + checkSafe(xpos, 1); + checkSafe(ypos, 1); + } + nglfwGetMonitorPos(monitor, memAddressSafe(xpos), memAddressSafe(ypos)); + } + + // --- [ glfwGetMonitorWorkarea ] --- + + /** Unsafe version of: {@link #glfwGetMonitorWorkarea GetMonitorWorkarea} */ + public static void nglfwGetMonitorWorkarea(long monitor, long xpos, long ypos, long width, long height) { + long __functionAddress = Functions.GetMonitorWorkarea; + if (CHECKS) { + check(monitor); + } + invokePPPPPV(monitor, xpos, ypos, width, height, __functionAddress); + } + + /** + * Retrieves the work area of the monitor. + * + *

This function returns the position, in screen coordinates, of the upper-left corner of the work area of the specified monitor along with the work area + * size in screen coordinates. The work area is defined as the area of the monitor not occluded by the operating system task bar where present. If no task + * bar exists then the work area is the monitor resolution in screen coordinates.

+ * + *

Any or all of the position and size arguments may be {@code NULL}. If an error occurs, all non-{@code NULL} position and size arguments will be set to zero.

+ * + *

This function must only be called from the main thread.

+ * + * @param monitor the monitor to query + * @param xpos where to store the working area x-coordinate, or {@code NULL} + * @param ypos where to store the working area y-coordinate, or {@code NULL} + * @param width where to store the working area width, or {@code NULL} + * @param height where to store the working area height, or {@code NULL} + * + * @since version 3.3 + */ + public static void glfwGetMonitorWorkarea(@NativeType("GLFWmonitor *") long monitor, @Nullable @NativeType("int *") IntBuffer xpos, @Nullable @NativeType("int *") IntBuffer ypos, @Nullable @NativeType("int *") IntBuffer width, @Nullable @NativeType("int *") IntBuffer height) { + if (CHECKS) { + checkSafe(xpos, 1); + checkSafe(ypos, 1); + checkSafe(width, 1); + checkSafe(height, 1); + } + nglfwGetMonitorWorkarea(monitor, memAddressSafe(xpos), memAddressSafe(ypos), memAddressSafe(width), memAddressSafe(height)); + } + + // --- [ glfwGetMonitorPhysicalSize ] --- + + /** Unsafe version of: {@link #glfwGetMonitorPhysicalSize GetMonitorPhysicalSize} */ + public static void nglfwGetMonitorPhysicalSize(long monitor, long widthMM, long heightMM) { + long __functionAddress = Functions.GetMonitorPhysicalSize; + if (CHECKS) { + check(monitor); + } + invokePPPV(monitor, widthMM, heightMM, __functionAddress); + } + + /** + * Returns the size, in millimetres, of the display area of the specified monitor. + * + *

Some systems do not provide accurate monitor size information, either because the monitor + * EDID data is incorrect or because the driver does not report it + * accurately.

+ * + *

Any or all of the size arguments may be {@code NULL}. If an error occurs, all non-{@code NULL} size arguments will be set to zero.

+ * + *
Note
+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • Windows: The OS calculates the returned physical size from the current resolution and system DPI instead of querying the monitor EDID data.
  • + *
+ * + * @param monitor the monitor to query + * @param widthMM where to store the width, in millimetres, of the monitor's display area, or {@code NULL} + * @param heightMM where to store the height, in millimetres, of the monitor's display area, or {@code NULL} + * + * @since version 3.0 + */ + public static void glfwGetMonitorPhysicalSize(@NativeType("GLFWmonitor *") long monitor, @Nullable @NativeType("int *") IntBuffer widthMM, @Nullable @NativeType("int *") IntBuffer heightMM) { + if (CHECKS) { + checkSafe(widthMM, 1); + checkSafe(heightMM, 1); + } + nglfwGetMonitorPhysicalSize(monitor, memAddressSafe(widthMM), memAddressSafe(heightMM)); + } + + // --- [ glfwGetMonitorContentScale ] --- + + /** Unsafe version of: {@link #glfwGetMonitorContentScale GetMonitorContentScale} */ + public static void nglfwGetMonitorContentScale(long monitor, long xscale, long yscale) { + long __functionAddress = Functions.GetMonitorContentScale; + if (CHECKS) { + check(monitor); + } + invokePPPV(monitor, xscale, yscale, __functionAddress); + } + + /** + * Retrieves the content scale for the specified monitor. + * + *

This function retrieves the content scale for the specified monitor. The content scale is the ratio between the current DPI and the platform's default + * DPI. This is especially important for text and any UI elements. If the pixel dimensions of your UI scaled by this look appropriate on your machine then + * it should appear at a reasonable size on other machines regardless of their DPI and scaling settings. This relies on the system DPI and scaling + * settings being somewhat correct.

+ * + *

The content scale may depend on both the monitor resolution and pixel density and on user settings. It may be very different from the raw DPI + * calculated from the physical size and current resolution.

+ * + *

This function must only be called from the main thread.

+ * + * @param monitor the monitor to query + * @param xscale where to store the x-axis content scale, or {@code NULL} + * @param yscale where to store the y-axis content scale, or {@code NULL} + * + * @since version 3.3 + */ + public static void glfwGetMonitorContentScale(@NativeType("GLFWmonitor *") long monitor, @Nullable @NativeType("float *") FloatBuffer xscale, @Nullable @NativeType("float *") FloatBuffer yscale) { + if (CHECKS) { + checkSafe(xscale, 1); + checkSafe(yscale, 1); + } + nglfwGetMonitorContentScale(monitor, memAddressSafe(xscale), memAddressSafe(yscale)); + } + + // --- [ glfwGetMonitorName ] --- + + /** Unsafe version of: {@link #glfwGetMonitorName GetMonitorName} */ + public static long nglfwGetMonitorName(long monitor) { + long __functionAddress = Functions.GetMonitorName; + if (CHECKS) { + check(monitor); + } + return invokePP(monitor, __functionAddress); + } + + /** + * Returns a human-readable name, encoded as UTF-8, of the specified monitor. The name typically reflects the make and model of the monitor and is not + * guaranteed to be unique among the connected monitors. + * + *

The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified monitor is disconnected or the + * library is terminated.

+ * + *

This function must only be called from the main thread.

+ * + * @param monitor the monitor to query + * + * @return the UTF-8 encoded name of the monitor, or {@code NULL} if an error occurred + * + * @since version 3.0 + */ + @Nullable + @NativeType("char const *") + public static String glfwGetMonitorName(@NativeType("GLFWmonitor *") long monitor) { + long __result = nglfwGetMonitorName(monitor); + return memUTF8Safe(__result); + } + + // --- [ glfwSetMonitorUserPointer ] --- + + /** + * Sets the user pointer of the specified monitor. + * + *

This function sets the user-defined pointer of the specified monitor. The current value is retained until the monitor is disconnected. The initial + * value is {@code NULL}.

+ * + *

This function may be called from the monitor callback, even for a monitor that is being disconnected.

+ * + *

This function may be called from any thread. Access is not synchronized.

+ * + * @param monitor the monitor whose pointer to set + * @param pointer the new value + * + * @since version 3.3 + */ + public static void glfwSetMonitorUserPointer(@NativeType("GLFWmonitor *") long monitor, @NativeType("void *") long pointer) { + long __functionAddress = Functions.SetMonitorUserPointer; + if (CHECKS) { + check(monitor); + check(pointer); + } + invokePPV(monitor, pointer, __functionAddress); + } + + // --- [ glfwGetMonitorUserPointer ] --- + + /** + * Returns the user pointer of the specified monitor. + * + *

This function returns the current value of the user-defined pointer of the specified monitor. The initial value is {@code NULL}.

+ * + *

This function may be called from the monitor callback, even for a monitor that is being disconnected.

+ * + *

This function may be called from any thread. Access is not synchronized.

+ * + * @param monitor the monitor whose pointer to return + * + * @since version 3.3 + */ + @NativeType("void *") + public static long glfwGetMonitorUserPointer(@NativeType("GLFWmonitor *") long monitor) { + long __functionAddress = Functions.GetMonitorUserPointer; + if (CHECKS) { + check(monitor); + } + return invokePP(monitor, __functionAddress); + } + + // --- [ glfwSetMonitorCallback ] --- + + /** Unsafe version of: {@link #glfwSetMonitorCallback SetMonitorCallback} */ + public static long nglfwSetMonitorCallback(long cbfun) { + long __functionAddress = Functions.SetMonitorCallback; + return invokePP(cbfun, __functionAddress); + } + + /** + * Sets the monitor configuration callback, or removes the currently set callback. This is called when a monitor is connected to or disconnected from the + * system. + * + *

This function must only be called from the main thread.

+ * + * @param cbfun the new callback, or {@code NULL} to remove the currently set callback + * + * @return the previously set callback, or {@code NULL} if no callback was set or the library had not been initialized + * + * @since version 3.0 + */ + @Nullable + @NativeType("GLFWmonitorfun") + public static GLFWMonitorCallback glfwSetMonitorCallback(@Nullable @NativeType("GLFWmonitorfun") GLFWMonitorCallbackI cbfun) { + return GLFWMonitorCallback.createSafe(nglfwSetMonitorCallback(memAddressSafe(cbfun))); + } + + // --- [ glfwGetVideoModes ] --- + + /** + * Unsafe version of: {@link #glfwGetVideoModes GetVideoModes} + * + * @param count where to store the number of video modes in the returned array. This is set to zero if an error occurred. + */ + public static long nglfwGetVideoModes(long monitor, long count) { + long __functionAddress = Functions.GetVideoModes; + if (CHECKS) { + check(monitor); + } + return invokePPP(monitor, count, __functionAddress); + } + + /** + * Returns an array of all video modes supported by the specified monitor. The returned array is sorted in ascending order, first by color bit depth (the + * sum of all channel depths) and then by resolution area (the product of width and height). + * + *

The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified monitor is disconnected, this + * function is called again for that monitor or the library is terminated.

+ * + *

This function must only be called from the main thread.

+ * + * @param monitor the monitor to query + * + * @return an array of video modes, or {@code NULL} if an error occurred + * + * @since version 1.0 + */ + @Nullable + @NativeType("GLFWvidmode const *") + public static GLFWVidMode.Buffer glfwGetVideoModes(@NativeType("GLFWmonitor *") long monitor) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + IntBuffer count = stack.callocInt(1); + try { + long __result = nglfwGetVideoModes(monitor, memAddress(count)); + return GLFWVidMode.createSafe(__result, count.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glfwGetVideoMode ] --- + + /** Unsafe version of: {@link #glfwGetVideoMode GetVideoMode} */ + public static long nglfwGetVideoMode(long monitor) { + long __functionAddress = Functions.GetVideoMode; + if (CHECKS) { + check(monitor); + } + return invokePP(monitor, __functionAddress); + } + + /** + * Returns the current video mode of the specified monitor. If you have created a full screen window for that monitor, the return value will depend on + * whether that window is iconified. + * + *

The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified monitor is disconnected or the + * library is terminated.

+ * + *

This function must only be called from the main thread.

+ * + * @param monitor the monitor to query + * + * @return the current mode of the monitor, or {@code NULL} if an error occurred + * + * @since version 3.0 + */ + @Nullable + @NativeType("GLFWvidmode const *") + public static GLFWVidMode glfwGetVideoMode(@NativeType("GLFWmonitor *") long monitor) { +// long __result = nglfwGetVideoMode(monitor); + return glfwVidMode; + } + + // --- [ glfwSetGamma ] --- + + /** + * Generates a gamma ramp and sets it for the specified monitor. + * + *

This function generates an appropriately sized gamma ramp from the specified exponent and then calls {@link #glfwSetGammaRamp SetGammaRamp} with it. The value must be a + * finite number greater than zero.

+ * + *

The software controlled gamma ramp is applied in addition to the hardware gamma correction, which today is usually an approximation of sRGB + * gamma. This means that setting a perfectly linear ramp, or gamma 1.0, will produce the default (usually sRGB-like) behavior.

+ * + *

For gamma correct rendering with OpenGL or OpenGL ES, see the {@link #GLFW_SRGB_CAPABLE SRGB_CAPABLE} hint.

+ * + *

Notes:

+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • Wayland: Gamma handling is a privileged protocol, this function will thus never be implemented and emits {@link #GLFW_PLATFORM_ERROR PLATFORM_ERROR}.
  • + *
+ * + * @param monitor the monitor whose gamma ramp to set + * @param gamma the desired exponent + * + * @since version 3.0 + */ + public static void glfwSetGamma(@NativeType("GLFWmonitor *") long monitor, float gamma) { + long __functionAddress = Functions.SetGamma; + if (CHECKS) { + check(monitor); + } + invokePV(monitor, gamma, __functionAddress); + } + + // --- [ glfwGetGammaRamp ] --- + + /** Unsafe version of: {@link #glfwGetGammaRamp GetGammaRamp} */ + public static long nglfwGetGammaRamp(long monitor) { + long __functionAddress = Functions.GetGammaRamp; + if (CHECKS) { + check(monitor); + } + return invokePP(monitor, __functionAddress); + } + + /** + * Returns the current gamma ramp of the specified monitor. + * + *

The returned structure and its arrays are allocated and freed by GLFW. You should not free them yourself. They are valid until the specified monitor is + * disconnected, this function is called again for that monitor or the library is terminated.

+ * + *

Notes:

+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • Wayland: Gamma handling is a privileged protocol, this function will thus never be implemented and emits {@link #GLFW_PLATFORM_ERROR PLATFORM_ERROR} while returning + * {@code NULL}.
  • + *
+ * + * @param monitor the monitor to query + * + * @return the current gamma ramp, or {@code NULL} if an error occurred + * + * @since version 3.0 + */ + @Nullable + @NativeType("GLFWgammaramp const *") + public static GLFWGammaRamp glfwGetGammaRamp(@NativeType("GLFWmonitor *") long monitor) { + long __result = nglfwGetGammaRamp(monitor); + return GLFWGammaRamp.createSafe(__result); + } + + // --- [ glfwSetGammaRamp ] --- + + /** Unsafe version of: {@link #glfwSetGammaRamp SetGammaRamp} */ + public static void nglfwSetGammaRamp(long monitor, long ramp) { + long __functionAddress = Functions.SetGammaRamp; + if (CHECKS) { + check(monitor); + GLFWGammaRamp.validate(ramp); + } + invokePPV(monitor, ramp, __functionAddress); + } + + /** + * Sets the current gamma ramp for the specified monitor. + * + *

This function sets the current gamma ramp for the specified monitor. The original gamma ramp for that monitor is saved by GLFW the first time this + * function is called and is restored by {@link #glfwTerminate Terminate}.

+ * + *

The software controlled gamma ramp is applied in addition to the hardware gamma correction, which today is usually an approximation of sRGB + * gamma. This means that setting a perfectly linear ramp, or gamma 1.0, will produce the default (usually sRGB-like) behavior.

+ * + *

For gamma correct rendering with OpenGL or OpenGL ES, see the {@link #GLFW_SRGB_CAPABLE SRGB_CAPABLE} hint.

+ * + *
Note
+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • The size of the specified gamma ramp should match the size of the current ramp for that monitor.
  • + *
  • Windows: The gamma ramp size must be 256.
  • + *
  • Wayland: Gamma handling is a privileged protocol, this function will thus never be implemented and emits {@link #GLFW_PLATFORM_ERROR PLATFORM_ERROR}.
  • + *
  • The specified gamma ramp is copied before this function returns.
  • + *
+ * + * @param monitor the monitor whose gamma ramp to set + * @param ramp the gamma ramp to use + * + * @since version 3.0 + */ + public static void glfwSetGammaRamp(@NativeType("GLFWmonitor *") long monitor, @NativeType("GLFWgammaramp const *") GLFWGammaRamp ramp) { + nglfwSetGammaRamp(monitor, ramp.address()); + } + + // --- [ glfwDefaultWindowHints ] --- + + /** + * Resets all window hints to their default values. See {@link #glfwWindowHint WindowHint} for details. + * + *

This function must only be called from the main thread.

+ * + * @since version 3.0 + */ + public static void glfwDefaultWindowHints() { + long __functionAddress = Functions.DefaultWindowHints; + invokeV(__functionAddress); + } + + // --- [ glfwWindowHint ] --- + + /** + * Sets hints for the next call to {@link #glfwCreateWindow CreateWindow}. The hints, once set, retain their values until changed by a call to this function or + * {@link #glfwDefaultWindowHints DefaultWindowHints}, or until the library is terminated. + * + *

Only integer value hints can be set with this function. String value hints are set with {@link #glfwWindowHintString WindowHintString}.

+ * + *

This function does not check whether the specified hint values are valid. If you set hints to invalid values this will instead be reported by the next + * call to {@link #glfwCreateWindow CreateWindow}.

+ * + *

Some hints are platform specific. These may be set on any platform but they will only affect their specific platform. Other platforms will ignore them. + * Setting these hints requires no platform specific headers or functions.

+ * + *
Supported and default values
+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
NameDefault valueSupported values
{@link #GLFW_RESIZABLE RESIZABLE}{@link #GLFW_TRUE TRUE}{@link #GLFW_TRUE TRUE} or {@link #GLFW_FALSE FALSE}
{@link #GLFW_VISIBLE VISIBLE}{@link #GLFW_TRUE TRUE}{@link #GLFW_TRUE TRUE} or {@link #GLFW_FALSE FALSE}
{@link #GLFW_DECORATED DECORATED}{@link #GLFW_TRUE TRUE}{@link #GLFW_TRUE TRUE} or {@link #GLFW_FALSE FALSE}
{@link #GLFW_FOCUSED FOCUSED}{@link #GLFW_TRUE TRUE}{@link #GLFW_TRUE TRUE} or {@link #GLFW_FALSE FALSE}
{@link #GLFW_AUTO_ICONIFY AUTO_ICONIFY}{@link #GLFW_TRUE TRUE}{@link #GLFW_TRUE TRUE} or {@link #GLFW_FALSE FALSE}
{@link #GLFW_FLOATING FLOATING}{@link #GLFW_FALSE FALSE}{@link #GLFW_TRUE TRUE} or {@link #GLFW_FALSE FALSE}
{@link #GLFW_MAXIMIZED MAXIMIZED}{@link #GLFW_FALSE FALSE}{@link #GLFW_TRUE TRUE} or {@link #GLFW_FALSE FALSE}
{@link #GLFW_CENTER_CURSOR CENTER_CURSOR}{@link #GLFW_TRUE TRUE}{@link #GLFW_TRUE TRUE} or {@link #GLFW_FALSE FALSE}
{@link #GLFW_TRANSPARENT_FRAMEBUFFER TRANSPARENT_FRAMEBUFFER}{@link #GLFW_FALSE FALSE}{@link #GLFW_TRUE TRUE} or {@link #GLFW_FALSE FALSE}
{@link #GLFW_FOCUS_ON_SHOW FOCUS_ON_SHOW}{@link #GLFW_TRUE TRUE}{@link #GLFW_TRUE TRUE} or {@link #GLFW_FALSE FALSE}
{@link #GLFW_SCALE_TO_MONITOR SCALE_TO_MONITOR}{@link #GLFW_FALSE FALSE}{@link #GLFW_TRUE TRUE} or {@link #GLFW_FALSE FALSE}
{@link #GLFW_RED_BITS RED_BITS}80 to {@link Integer#MAX_VALUE} or {@link #GLFW_DONT_CARE DONT_CARE}
{@link #GLFW_GREEN_BITS GREEN_BITS}80 to {@link Integer#MAX_VALUE} or {@link #GLFW_DONT_CARE DONT_CARE}
{@link #GLFW_BLUE_BITS BLUE_BITS}80 to {@link Integer#MAX_VALUE} or {@link #GLFW_DONT_CARE DONT_CARE}
{@link #GLFW_ALPHA_BITS ALPHA_BITS}80 to {@link Integer#MAX_VALUE} or {@link #GLFW_DONT_CARE DONT_CARE}
{@link #GLFW_DEPTH_BITS DEPTH_BITS}240 to {@link Integer#MAX_VALUE} or {@link #GLFW_DONT_CARE DONT_CARE}
{@link #GLFW_STENCIL_BITS STENCIL_BITS}80 to {@link Integer#MAX_VALUE} or {@link #GLFW_DONT_CARE DONT_CARE}
{@link #GLFW_ACCUM_RED_BITS ACCUM_RED_BITS}00 to {@link Integer#MAX_VALUE} or {@link #GLFW_DONT_CARE DONT_CARE}
{@link #GLFW_ACCUM_GREEN_BITS ACCUM_GREEN_BITS}00 to {@link Integer#MAX_VALUE} or {@link #GLFW_DONT_CARE DONT_CARE}
{@link #GLFW_ACCUM_BLUE_BITS ACCUM_BLUE_BITS}00 to {@link Integer#MAX_VALUE} or {@link #GLFW_DONT_CARE DONT_CARE}
{@link #GLFW_ACCUM_ALPHA_BITS ACCUM_ALPHA_BITS}00 to {@link Integer#MAX_VALUE} or {@link #GLFW_DONT_CARE DONT_CARE}
{@link #GLFW_AUX_BUFFERS AUX_BUFFERS}00 to {@link Integer#MAX_VALUE}
{@link #GLFW_SAMPLES SAMPLES}00 to {@link Integer#MAX_VALUE}
{@link #GLFW_REFRESH_RATE REFRESH_RATE}{@link #GLFW_DONT_CARE DONT_CARE}0 to {@link Integer#MAX_VALUE} or {@link #GLFW_DONT_CARE DONT_CARE}
{@link #GLFW_STEREO STEREO}{@link #GLFW_FALSE FALSE}{@link #GLFW_TRUE TRUE} or {@link #GLFW_FALSE FALSE}
{@link #GLFW_SRGB_CAPABLE SRGB_CAPABLE}{@link #GLFW_FALSE FALSE}{@link #GLFW_TRUE TRUE} or {@link #GLFW_FALSE FALSE}
{@link #GLFW_DOUBLEBUFFER DOUBLEBUFFER}{@link #GLFW_TRUE TRUE}{@link #GLFW_TRUE TRUE} or {@link #GLFW_FALSE FALSE}
{@link #GLFW_CLIENT_API CLIENT_API}{@link #GLFW_OPENGL_API OPENGL_API}{@link #GLFW_NO_API NO_API} {@link #GLFW_OPENGL_API OPENGL_API} {@link #GLFW_OPENGL_ES_API OPENGL_ES_API}
{@link #GLFW_CONTEXT_CREATION_API CONTEXT_CREATION_API}{@link #GLFW_NATIVE_CONTEXT_API NATIVE_CONTEXT_API}{@link #GLFW_NATIVE_CONTEXT_API NATIVE_CONTEXT_API} {@link #GLFW_EGL_CONTEXT_API EGL_CONTEXT_API} {@link #GLFW_OSMESA_CONTEXT_API OSMESA_CONTEXT_API}
{@link #GLFW_CONTEXT_VERSION_MAJOR CONTEXT_VERSION_MAJOR}1Any valid major version number of the chosen client API
{@link #GLFW_CONTEXT_VERSION_MINOR CONTEXT_VERSION_MINOR}0Any valid minor version number of the chosen client API
{@link #GLFW_CONTEXT_ROBUSTNESS CONTEXT_ROBUSTNESS}{@link #GLFW_NO_ROBUSTNESS NO_ROBUSTNESS}{@link #GLFW_NO_ROBUSTNESS NO_ROBUSTNESS} {@link #GLFW_NO_RESET_NOTIFICATION NO_RESET_NOTIFICATION} {@link #GLFW_LOSE_CONTEXT_ON_RESET LOSE_CONTEXT_ON_RESET}
{@link #GLFW_CONTEXT_RELEASE_BEHAVIOR CONTEXT_RELEASE_BEHAVIOR}{@link #GLFW_ANY_RELEASE_BEHAVIOR ANY_RELEASE_BEHAVIOR}{@link #GLFW_ANY_RELEASE_BEHAVIOR ANY_RELEASE_BEHAVIOR} {@link #GLFW_RELEASE_BEHAVIOR_FLUSH RELEASE_BEHAVIOR_FLUSH} {@link #GLFW_RELEASE_BEHAVIOR_NONE RELEASE_BEHAVIOR_NONE}
{@link #GLFW_CONTEXT_NO_ERROR CONTEXT_NO_ERROR}{@link #GLFW_FALSE FALSE}{@link #GLFW_TRUE TRUE} or {@link #GLFW_FALSE FALSE}
{@link #GLFW_OPENGL_FORWARD_COMPAT OPENGL_FORWARD_COMPAT}{@link #GLFW_FALSE FALSE}{@link #GLFW_TRUE TRUE} or {@link #GLFW_FALSE FALSE}
{@link #GLFW_OPENGL_DEBUG_CONTEXT OPENGL_DEBUG_CONTEXT}{@link #GLFW_FALSE FALSE}{@link #GLFW_TRUE TRUE} or {@link #GLFW_FALSE FALSE}
{@link #GLFW_OPENGL_PROFILE OPENGL_PROFILE}{@link #GLFW_OPENGL_ANY_PROFILE OPENGL_ANY_PROFILE}{@link #GLFW_OPENGL_ANY_PROFILE OPENGL_ANY_PROFILE} {@link #GLFW_OPENGL_CORE_PROFILE OPENGL_CORE_PROFILE} {@link #GLFW_OPENGL_COMPAT_PROFILE OPENGL_COMPAT_PROFILE}
{@link #GLFW_COCOA_RETINA_FRAMEBUFFER COCOA_RETINA_FRAMEBUFFER}{@link #GLFW_TRUE TRUE}{@link #GLFW_TRUE TRUE} or {@link #GLFW_FALSE FALSE}
{@link #GLFW_COCOA_GRAPHICS_SWITCHING COCOA_GRAPHICS_SWITCHING}{@link #GLFW_FALSE FALSE}{@link #GLFW_TRUE TRUE} or {@link #GLFW_FALSE FALSE}
+ * + *

This function must only be called from the main thread.

+ * + * @param hint the window hint to set. One of:
{@link #GLFW_FOCUSED FOCUSED}{@link #GLFW_RESIZABLE RESIZABLE}{@link #GLFW_VISIBLE VISIBLE}{@link #GLFW_DECORATED DECORATED}{@link #GLFW_AUTO_ICONIFY AUTO_ICONIFY}
{@link #GLFW_FLOATING FLOATING}{@link #GLFW_MAXIMIZED MAXIMIZED}{@link #GLFW_CENTER_CURSOR CENTER_CURSOR}{@link #GLFW_TRANSPARENT_FRAMEBUFFER TRANSPARENT_FRAMEBUFFER}{@link #GLFW_FOCUS_ON_SHOW FOCUS_ON_SHOW}
{@link #GLFW_CLIENT_API CLIENT_API}{@link #GLFW_CONTEXT_VERSION_MAJOR CONTEXT_VERSION_MAJOR}{@link #GLFW_CONTEXT_VERSION_MINOR CONTEXT_VERSION_MINOR}{@link #GLFW_CONTEXT_ROBUSTNESS CONTEXT_ROBUSTNESS}{@link #GLFW_OPENGL_FORWARD_COMPAT OPENGL_FORWARD_COMPAT}
{@link #GLFW_OPENGL_DEBUG_CONTEXT OPENGL_DEBUG_CONTEXT}{@link #GLFW_OPENGL_PROFILE OPENGL_PROFILE}{@link #GLFW_CONTEXT_RELEASE_BEHAVIOR CONTEXT_RELEASE_BEHAVIOR}{@link #GLFW_CONTEXT_NO_ERROR CONTEXT_NO_ERROR}{@link #GLFW_CONTEXT_CREATION_API CONTEXT_CREATION_API}
{@link #GLFW_SCALE_TO_MONITOR SCALE_TO_MONITOR}{@link #GLFW_RED_BITS RED_BITS}{@link #GLFW_GREEN_BITS GREEN_BITS}{@link #GLFW_BLUE_BITS BLUE_BITS}{@link #GLFW_ALPHA_BITS ALPHA_BITS}
{@link #GLFW_DEPTH_BITS DEPTH_BITS}{@link #GLFW_STENCIL_BITS STENCIL_BITS}{@link #GLFW_ACCUM_RED_BITS ACCUM_RED_BITS}{@link #GLFW_ACCUM_GREEN_BITS ACCUM_GREEN_BITS}{@link #GLFW_ACCUM_BLUE_BITS ACCUM_BLUE_BITS}
{@link #GLFW_ACCUM_ALPHA_BITS ACCUM_ALPHA_BITS}{@link #GLFW_AUX_BUFFERS AUX_BUFFERS}{@link #GLFW_STEREO STEREO}{@link #GLFW_SAMPLES SAMPLES}{@link #GLFW_SRGB_CAPABLE SRGB_CAPABLE}
{@link #GLFW_REFRESH_RATE REFRESH_RATE}{@link #GLFW_DOUBLEBUFFER DOUBLEBUFFER}{@link #GLFW_COCOA_RETINA_FRAMEBUFFER COCOA_RETINA_FRAMEBUFFER}{@link #GLFW_COCOA_GRAPHICS_SWITCHING COCOA_GRAPHICS_SWITCHING}
+ * @param value the new value of the window hint + * + * @since version 2.2 + */ + public static void glfwWindowHint(int hint, int value) { + long __functionAddress = Functions.WindowHint; + invokeV(hint, value, __functionAddress); + } + + // --- [ glfwWindowHintString ] --- + + /** Unsafe version of: {@link #glfwWindowHintString WindowHintString} */ + public static void nglfwWindowHintString(int hint, long value) { + long __functionAddress = Functions.WindowHintString; + invokePV(hint, value, __functionAddress); + } + + /** + * Sets the specified window hint to the desired value. + * + *

This function sets hints for the next call to {@link #glfwCreateWindow CreateWindow}. The hints, once set, retain their values until changed by a call to this function or + * {@link #glfwDefaultWindowHints DefaultWindowHints}, or until the library is terminated.

+ * + *

Only string type hints can be set with this function. Integer value hints are set with {@link #glfwWindowHint WindowHint}.

+ * + *

This function does not check whether the specified hint values are valid. If you set hints to invalid values this will instead be reported by the next + * call to {@link #glfwCreateWindow CreateWindow}.

+ * + *

Some hints are platform specific. These may be set on any platform but they will only affect their specific platform. Other platforms will ignore them. + * Setting these hints requires no platform specific headers or functions.

+ * + *
Supported and default values
+ * + * + * + * + * + * + *
NameDefault valueSupported values
{@link #GLFW_COCOA_FRAME_NAME COCOA_FRAME_NAME}""A UTF-8 encoded frame autosave name
{@link #GLFW_X11_CLASS_NAME X11_CLASS_NAME}""An ASCII encoded {@code WM_CLASS} class name
{@link #GLFW_X11_INSTANCE_NAME X11_INSTANCE_NAME}""An ASCII encoded {@code WM_CLASS} instance name
+ * + *

This function must only be called from the main thread.

+ * + * @param hint the window hint to set. One of:
{@link #GLFW_COCOA_FRAME_NAME COCOA_FRAME_NAME}{@link #GLFW_X11_CLASS_NAME X11_CLASS_NAME}{@link #GLFW_X11_INSTANCE_NAME X11_INSTANCE_NAME}
+ * @param value the new value of the window hint. The specified string is copied before this function returns. + * + * @since version 3.3 + */ + public static void glfwWindowHintString(int hint, @NativeType("char const *") ByteBuffer value) { + if (CHECKS) { + checkNT1(value); + } + nglfwWindowHintString(hint, memAddress(value)); + } + + /** + * Sets the specified window hint to the desired value. + * + *

This function sets hints for the next call to {@link #glfwCreateWindow CreateWindow}. The hints, once set, retain their values until changed by a call to this function or + * {@link #glfwDefaultWindowHints DefaultWindowHints}, or until the library is terminated.

+ * + *

Only string type hints can be set with this function. Integer value hints are set with {@link #glfwWindowHint WindowHint}.

+ * + *

This function does not check whether the specified hint values are valid. If you set hints to invalid values this will instead be reported by the next + * call to {@link #glfwCreateWindow CreateWindow}.

+ * + *

Some hints are platform specific. These may be set on any platform but they will only affect their specific platform. Other platforms will ignore them. + * Setting these hints requires no platform specific headers or functions.

+ * + *
Supported and default values
+ * + * + * + * + * + * + *
NameDefault valueSupported values
{@link #GLFW_COCOA_FRAME_NAME COCOA_FRAME_NAME}""A UTF-8 encoded frame autosave name
{@link #GLFW_X11_CLASS_NAME X11_CLASS_NAME}""An ASCII encoded {@code WM_CLASS} class name
{@link #GLFW_X11_INSTANCE_NAME X11_INSTANCE_NAME}""An ASCII encoded {@code WM_CLASS} instance name
+ * + *

This function must only be called from the main thread.

+ * + * @param hint the window hint to set. One of:
{@link #GLFW_COCOA_FRAME_NAME COCOA_FRAME_NAME}{@link #GLFW_X11_CLASS_NAME X11_CLASS_NAME}{@link #GLFW_X11_INSTANCE_NAME X11_INSTANCE_NAME}
+ * @param value the new value of the window hint. The specified string is copied before this function returns. + * + * @since version 3.3 + */ + public static void glfwWindowHintString(int hint, @NativeType("char const *") CharSequence value) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(value, true); + long valueEncoded = stack.getPointerAddress(); + nglfwWindowHintString(hint, valueEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glfwCreateWindow ] --- + + /** Unsafe version of: {@link #glfwCreateWindow CreateWindow} */ + public static long nglfwCreateWindow(int width, int height, long title, long monitor, long share) { + long __functionAddress = Functions.CreateWindow; + return invokePPPP(width, height, title, monitor, share, __functionAddress); + } + + /** + * Creates a window and its associated OpenGL or OpenGL ES context. Most of the options controlling how the window and its context should be created are + * specified with window hints. + * + *

Successful creation does not change which context is current. Before you can use the newly created context, you need to make it current. For information + * about the {@code share} parameter, see context sharing.

+ * + *

The created window, framebuffer and context may differ from what you requested, as not all parameters and hints are hard constraints. This includes the + * size of the window, especially for full screen windows. To query the actual attributes of the created window, framebuffer and context, use queries like + * {@link #glfwGetWindowAttrib GetWindowAttrib} and {@link #glfwGetWindowSize GetWindowSize} and {@link #glfwGetFramebufferSize GetFramebufferSize}.

+ * + *

To create a full screen window, you need to specify the monitor the window will cover. If no monitor is specified, the window will be windowed mode. + * Unless you have a way for the user to choose a specific monitor, it is recommended that you pick the primary monitor. For more information on how to + * query connected monitors, see monitors.

+ * + *

For full screen windows, the specified size becomes the resolution of the window's desired video mode. As long as a full screen window is not + * iconified, the supported video mode most closely matching the desired video mode is set for the specified monitor. For more information about full + * screen windows, including the creation of so called windowed full screen or borderless full screen windows, see + * full screen.

+ * + *

Once you have created the window, you can switch it between windowed and full screen mode with {@link #glfwSetWindowMonitor SetWindowMonitor}. If the window has an OpenGL or + * OpenGL ES context, it will be unaffected.

+ * + *

By default, newly created windows use the placement recommended by the window system. To create the window at a specific position, make it initially + * invisible using the {@link #GLFW_VISIBLE VISIBLE} window hint, set its position and then + * show it.

+ * + *

As long as at least one full screen window is not iconified, the screensaver is prohibited from starting.

+ * + *

Window systems put limits on window sizes. Very large or very small window dimensions may be overridden by the window system on creation. Check the + * actual size after creation.

+ * + *

The swap interval is not set during window creation and the initial value may vary + * depending on driver settings and defaults.

+ * + *
Note
+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • Windows: Window creation will fail if the Microsoft GDI software OpenGL implementation is the only one available.
  • + *
  • Windows: If the executable has an icon resource named {@code GLFW_ICON}, it will be set as the initial icon for the window. If no such icon + * is present, the {@code IDI_APPLICATION} icon will be used instead. To set a different icon, see {@link #glfwSetWindowIcon SetWindowIcon}.
  • + *
  • Windows: The context to share resources with may not be current on any other thread.
  • + *
  • The OS only supports forward-compatible core profile contexts for OpenGL versions 3.2 and later. Before creating an OpenGL context of version 3.2 + * or later you must set the {@link #GLFW_OPENGL_FORWARD_COMPAT OPENGL_FORWARD_COMPAT} and {@link #GLFW_OPENGL_PROFILE OPENGL_PROFILE} hints accordingly. OpenGL 3.0 and 3.1 contexts are not supported at all on + * macOS.
  • + *
  • macOS: The GLFW window has no icon, as it is not a document window, but the dock icon will be the same as the application bundle's icon. For + * more information on bundles, see the + * Bundle Programming Guide in the Mac + * Developer Library.
  • + *
  • macOS: The first time a window is created the menu bar is created. If GLFW finds a {@code `MainMenu.nib`} it is loaded and assumed to + * contain a menu bar. Otherwise a minimal menu bar is created manually with common commands like Hide, Quit and About. The About entry opens a + * minimal about dialog with information from the application's bundle. Menu bar creation can be disabled entirely with the {@link #GLFW_COCOA_MENUBAR COCOA_MENUBAR} init hint.
  • + *
  • macOS: On macOS 10.10 and later the window frame will not be rendered at full resolution on Retina displays unless the + * {@link #GLFW_COCOA_RETINA_FRAMEBUFFER COCOA_RETINA_FRAMEBUFFER} hint is {@link #GLFW_TRUE TRUE} and the {@code NSHighResolutionCapable} key is enabled in the application bundle's {@code Info.plist}. For + * more information, see High Resolution Guidelines for macOS in the Mac Developer Library.
  • + *
  • macOS: When activating frame autosaving with {@link #GLFW_COCOA_FRAME_NAME COCOA_FRAME_NAME}, the specified window size and position may be overridden by previously saved + * values.
  • + *
  • X11: Some window managers will not respect the placement of initially hidden windows.
  • + *
  • X11: Due to the asynchronous nature of X11, it may take a moment for a window to reach its requested state. This means you may not be able + * to query the final size, position or other attributes directly after window creation.
  • + *
  • X11: The class part of the {@code WM_CLASS} window property will by default be set to the window title passed to this function. The instance + * part will use the contents of the {@code RESOURCE_NAME} environment variable, if present and not empty, or fall back to the window title. Set the + * {@link #GLFW_X11_CLASS_NAME X11_CLASS_NAME} and {@link #GLFW_X11_INSTANCE_NAME X11_INSTANCE_NAME} window hints to override this.
  • + *
  • Wayland: Compositors should implement the xdg-decoration protocol for GLFW to decorate the window properly. If this protocol isn't + * supported, or if the compositor prefers client-side decorations, a very simple fallback frame will be drawn using the {@code wp_viewporter} + * protocol. A compositor can still emit close, maximize or fullscreen events, using for instance a keybind mechanism. If neither of these protocols + * is supported, the window won't be decorated.
  • + *
  • Wayland: A full screen window will not attempt to change the mode, no matter what the requested size or refresh rate.
  • + *
  • Wayland: Screensaver inhibition requires the idle-inhibit protocol to be implemented in the user's compositor.
  • + *
+ * + * @param width the desired width, in screen coordinates, of the window + * @param height the desired height, in screen coordinates, of the window + * @param title initial, UTF-8 encoded window title + * @param monitor the monitor to use for fullscreen mode, or {@code NULL} for windowed mode + * @param share the window whose context to share resources with, or {@code NULL} to not share resources + * + * @return the handle of the created window, or {@code NULL} if an error occurred + * + * @since version 1.0 + */ + @NativeType("GLFWwindow *") + public static long glfwCreateWindow(int width, int height, @NativeType("char const *") ByteBuffer title, @NativeType("GLFWmonitor *") long monitor, @NativeType("GLFWwindow *") long share) { + EventLoop.OffScreen.check(); + if (CHECKS) { + checkNT1(title); + } + return nglfwCreateWindow(width, height, memAddress(title), monitor, share); + } + + /** + * Creates a window and its associated OpenGL or OpenGL ES context. Most of the options controlling how the window and its context should be created are + * specified with window hints. + * + *

Successful creation does not change which context is current. Before you can use the newly created context, you need to make it current. For information + * about the {@code share} parameter, see context sharing.

+ * + *

The created window, framebuffer and context may differ from what you requested, as not all parameters and hints are hard constraints. This includes the + * size of the window, especially for full screen windows. To query the actual attributes of the created window, framebuffer and context, use queries like + * {@link #glfwGetWindowAttrib GetWindowAttrib} and {@link #glfwGetWindowSize GetWindowSize} and {@link #glfwGetFramebufferSize GetFramebufferSize}.

+ * + *

To create a full screen window, you need to specify the monitor the window will cover. If no monitor is specified, the window will be windowed mode. + * Unless you have a way for the user to choose a specific monitor, it is recommended that you pick the primary monitor. For more information on how to + * query connected monitors, see monitors.

+ * + *

For full screen windows, the specified size becomes the resolution of the window's desired video mode. As long as a full screen window is not + * iconified, the supported video mode most closely matching the desired video mode is set for the specified monitor. For more information about full + * screen windows, including the creation of so called windowed full screen or borderless full screen windows, see + * full screen.

+ * + *

Once you have created the window, you can switch it between windowed and full screen mode with {@link #glfwSetWindowMonitor SetWindowMonitor}. If the window has an OpenGL or + * OpenGL ES context, it will be unaffected.

+ * + *

By default, newly created windows use the placement recommended by the window system. To create the window at a specific position, make it initially + * invisible using the {@link #GLFW_VISIBLE VISIBLE} window hint, set its position and then + * show it.

+ * + *

As long as at least one full screen window is not iconified, the screensaver is prohibited from starting.

+ * + *

Window systems put limits on window sizes. Very large or very small window dimensions may be overridden by the window system on creation. Check the + * actual size after creation.

+ * + *

The swap interval is not set during window creation and the initial value may vary + * depending on driver settings and defaults.

+ * + *
Note
+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • Windows: Window creation will fail if the Microsoft GDI software OpenGL implementation is the only one available.
  • + *
  • Windows: If the executable has an icon resource named {@code GLFW_ICON}, it will be set as the initial icon for the window. If no such icon + * is present, the {@code IDI_APPLICATION} icon will be used instead. To set a different icon, see {@link #glfwSetWindowIcon SetWindowIcon}.
  • + *
  • Windows: The context to share resources with may not be current on any other thread.
  • + *
  • The OS only supports forward-compatible core profile contexts for OpenGL versions 3.2 and later. Before creating an OpenGL context of version 3.2 + * or later you must set the {@link #GLFW_OPENGL_FORWARD_COMPAT OPENGL_FORWARD_COMPAT} and {@link #GLFW_OPENGL_PROFILE OPENGL_PROFILE} hints accordingly. OpenGL 3.0 and 3.1 contexts are not supported at all on + * macOS.
  • + *
  • macOS: The GLFW window has no icon, as it is not a document window, but the dock icon will be the same as the application bundle's icon. For + * more information on bundles, see the + * Bundle Programming Guide in the Mac + * Developer Library.
  • + *
  • macOS: The first time a window is created the menu bar is created. If GLFW finds a {@code `MainMenu.nib`} it is loaded and assumed to + * contain a menu bar. Otherwise a minimal menu bar is created manually with common commands like Hide, Quit and About. The About entry opens a + * minimal about dialog with information from the application's bundle. Menu bar creation can be disabled entirely with the {@link #GLFW_COCOA_MENUBAR COCOA_MENUBAR} init hint.
  • + *
  • macOS: On macOS 10.10 and later the window frame will not be rendered at full resolution on Retina displays unless the + * {@link #GLFW_COCOA_RETINA_FRAMEBUFFER COCOA_RETINA_FRAMEBUFFER} hint is {@link #GLFW_TRUE TRUE} and the {@code NSHighResolutionCapable} key is enabled in the application bundle's {@code Info.plist}. For + * more information, see High Resolution Guidelines for macOS in the Mac Developer Library.
  • + *
  • macOS: When activating frame autosaving with {@link #GLFW_COCOA_FRAME_NAME COCOA_FRAME_NAME}, the specified window size and position may be overridden by previously saved + * values.
  • + *
  • X11: Some window managers will not respect the placement of initially hidden windows.
  • + *
  • X11: Due to the asynchronous nature of X11, it may take a moment for a window to reach its requested state. This means you may not be able + * to query the final size, position or other attributes directly after window creation.
  • + *
  • X11: The class part of the {@code WM_CLASS} window property will by default be set to the window title passed to this function. The instance + * part will use the contents of the {@code RESOURCE_NAME} environment variable, if present and not empty, or fall back to the window title. Set the + * {@link #GLFW_X11_CLASS_NAME X11_CLASS_NAME} and {@link #GLFW_X11_INSTANCE_NAME X11_INSTANCE_NAME} window hints to override this.
  • + *
  • Wayland: Compositors should implement the xdg-decoration protocol for GLFW to decorate the window properly. If this protocol isn't + * supported, or if the compositor prefers client-side decorations, a very simple fallback frame will be drawn using the {@code wp_viewporter} + * protocol. A compositor can still emit close, maximize or fullscreen events, using for instance a keybind mechanism. If neither of these protocols + * is supported, the window won't be decorated.
  • + *
  • Wayland: A full screen window will not attempt to change the mode, no matter what the requested size or refresh rate.
  • + *
  • Wayland: Screensaver inhibition requires the idle-inhibit protocol to be implemented in the user's compositor.
  • + *
+ * + * @param width the desired width, in screen coordinates, of the window + * @param height the desired height, in screen coordinates, of the window + * @param title initial, UTF-8 encoded window title + * @param monitor the monitor to use for fullscreen mode, or {@code NULL} for windowed mode + * @param share the window whose context to share resources with, or {@code NULL} to not share resources + * + * @return the handle of the created window, or {@code NULL} if an error occurred + * + * @since version 1.0 + */ + @NativeType("GLFWwindow *") + public static long glfwCreateWindow(int width, int height, @NativeType("char const *") CharSequence title, @NativeType("GLFWmonitor *") long monitor, @NativeType("GLFWwindow *") long share) { + EventLoop.OffScreen.check(); + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(title, true); + long titleEncoded = stack.getPointerAddress(); + return nglfwCreateWindow(width, height, titleEncoded, monitor, share); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glfwDestroyWindow ] --- + + /** + * Destroys the specified window and its context. On calling this function, no further callbacks will be called for that window. + * + *

If the context of the specified window is current on the main thread, it is detached before being destroyed.

+ * + *
Note
+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • This function must not be called from a callback.
  • + *
  • The context of the specified window must not be current on any other thread when this function is called.
  • + *
+ * + * @param window the window to destroy + * + * @since version 1.0 + */ + public static void glfwDestroyWindow(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.DestroyWindow; + invokePV(window, __functionAddress); + } + + // --- [ glfwWindowShouldClose ] --- + + /** + * Returns the value of the close flag of the specified window. + * + *

This function may be called from any thread.

+ * + * @param window the window to query + * + * @return the value of the close flag + * + * @since version 3.0 + */ + @NativeType("int") + public static boolean glfwWindowShouldClose(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.WindowShouldClose; + if (CHECKS) { + check(window); + } + return invokePI(window, __functionAddress) != 0; + } + + // --- [ glfwSetWindowShouldClose ] --- + + /** + * Sets the value of the close flag of the specified window. This can be used to override the user's attempt to close the window, or to signal that it + * should be closed. + * + *

This function may be called from any thread. Access is not synchronized.

+ * + * @param window the window whose flag to change + * @param value the new value + * + * @since version 3.0 + */ + public static void glfwSetWindowShouldClose(@NativeType("GLFWwindow *") long window, @NativeType("int") boolean value) { + long __functionAddress = Functions.SetWindowShouldClose; + if (CHECKS) { + check(window); + } + invokePV(window, value ? 1 : 0, __functionAddress); + } + + // --- [ glfwSetWindowTitle ] --- + + /** Unsafe version of: {@link #glfwSetWindowTitle SetWindowTitle} */ + public static void nglfwSetWindowTitle(long window, long title) { + long __functionAddress = Functions.SetWindowTitle; + if (CHECKS) { + check(window); + } + invokePPV(window, title, __functionAddress); + } + + /** + * Sets the window title, encoded as UTF-8, of the specified window. + * + *

This function must only be called from the main thread.

+ * + *

macOS: The window title will not be updated until the next time you process events.

+ * + * @param window the window whose title to change + * @param title the UTF-8 encoded window title + * + * @since version 1.0 + */ + public static void glfwSetWindowTitle(@NativeType("GLFWwindow *") long window, @NativeType("char const *") ByteBuffer title) { + if (CHECKS) { + checkNT1(title); + } + nglfwSetWindowTitle(window, memAddress(title)); + } + + /** + * Sets the window title, encoded as UTF-8, of the specified window. + * + *

This function must only be called from the main thread.

+ * + *

macOS: The window title will not be updated until the next time you process events.

+ * + * @param window the window whose title to change + * @param title the UTF-8 encoded window title + * + * @since version 1.0 + */ + public static void glfwSetWindowTitle(@NativeType("GLFWwindow *") long window, @NativeType("char const *") CharSequence title) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(title, true); + long titleEncoded = stack.getPointerAddress(); + nglfwSetWindowTitle(window, titleEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glfwSetWindowIcon ] --- + + /** + * Unsafe version of: {@link #glfwSetWindowIcon SetWindowIcon} + * + * @param count the number of images in the specified array, or zero to revert to the default window icon + */ + public static void nglfwSetWindowIcon(long window, int count, long images) { + long __functionAddress = Functions.SetWindowIcon; + if (CHECKS) { + check(window); + if (images != NULL) { GLFWImage.validate(images, count); } + } + invokePPV(window, count, images, __functionAddress); + } + + /** + * Sets the icon for the specified window. + * + *

This function sets the icon of the specified window. If passed an array of candidate images, those of or closest to the sizes desired by the system are + * selected. If no images are specified, the window reverts to its default icon.

+ * + *

The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight bits per channel with the red channel first. They are arranged canonically as + * packed sequential rows, starting from the top-left corner.

+ * + *

The desired image sizes varies depending on platform and system settings. The selected images will be rescaled as needed. Good sizes include 16x16, + * 32x32 and 48x48.

+ * + *

Notes:

+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • The specified image data is copied before this function returns.
  • + *
  • macOS: The GLFW window has no icon, as it is not a document window, so this function does nothing. The dock icon will be the same as the + * application bundle's icon. For more information on bundles, see the Bundle Programming Guide in the Mac Developer Library.
  • + *
  • Wayland: There is no existing protocol to change an icon, the window will thus inherit the one defined in the application's desktop file. + * This function always emits {@link #GLFW_PLATFORM_ERROR PLATFORM_ERROR}.
  • + *
+ * + * @param window the window whose icon to set + * @param images the images to create the icon from. This is ignored if count is zero. + * + * @since version 3.2 + */ + public static void glfwSetWindowIcon(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWimage const *") GLFWImage.Buffer images) { + nglfwSetWindowIcon(window, remainingSafe(images), memAddressSafe(images)); + } + + // --- [ glfwGetWindowPos ] --- + + /** Unsafe version of: {@link #glfwGetWindowPos GetWindowPos} */ + public static void nglfwGetWindowPos(long window, long xpos, long ypos) { + long __functionAddress = Functions.GetWindowPos; + if (CHECKS) { + check(window); + } + invokePPPV(window, xpos, ypos, __functionAddress); + } + + /** + * Retrieves the position, in screen coordinates, of the upper-left corner of the content area of the specified window. + * + *

Any or all of the position arguments may be {@code NULL}. If an error occurs, all non-{@code NULL} position arguments will be set to zero.

+ * + *

Notes:

+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • Wayland: There is no way for an application to retrieve the global position of its windows, this function will always emit {@link #GLFW_PLATFORM_ERROR PLATFORM_ERROR}.
  • + *
+ * + * @param window the window to query + * @param xpos where to store the x-coordinate of the upper-left corner of the content area, or {@code NULL} + * @param ypos where to store the y-coordinate of the upper-left corner of the content area, or {@code NULL} + * + * @since version 3.0 + */ + public static void glfwGetWindowPos(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("int *") IntBuffer xpos, @Nullable @NativeType("int *") IntBuffer ypos) { + if (CHECKS) { + checkSafe(xpos, 1); + checkSafe(ypos, 1); + } + nglfwGetWindowPos(window, memAddressSafe(xpos), memAddressSafe(ypos)); + } + + // --- [ glfwSetWindowPos ] --- + + /** + * Sets the position, in screen coordinates, of the upper-left corner of the content area of the specified windowed mode window. If the window is a full + * screen window, this function does nothing. + * + *

Do not use this function to move an already visible window unless you have very good reasons for doing so, as it will confuse and annoy the + * user.

+ * + *

The window manager may put limits on what positions are allowed. GLFW cannot and should not override these limits.

+ * + *

Notes:

+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • Wayland: There is no way for an application to set the global position of its windows, this function will always emit {@link #GLFW_PLATFORM_ERROR PLATFORM_ERROR}.
  • + *
+ * + * @param window the window to query + * @param xpos the x-coordinate of the upper-left corner of the content area + * @param ypos the y-coordinate of the upper-left corner of the content area + * + * @since version 1.0 + */ + public static void glfwSetWindowPos(@NativeType("GLFWwindow *") long window, int xpos, int ypos) { + long __functionAddress = Functions.SetWindowPos; + if (CHECKS) { + check(window); + } + invokePV(window, xpos, ypos, __functionAddress); + } + + // --- [ glfwGetWindowSize ] --- + + /** Unsafe version of: {@link #glfwGetWindowSize GetWindowSize} */ + public static void nglfwGetWindowSize(long window, long width, long height) { + long __functionAddress = Functions.GetWindowSize; + if (CHECKS) { + check(window); + } + invokePPPV(window, width, height, __functionAddress); + } + + /** + * Retrieves the size, in screen coordinates, of the content area of the specified window. If you wish to retrieve the size of the framebuffer of the + * window in pixels, see {@link #glfwGetFramebufferSize GetFramebufferSize}. + * + *

Any or all of the size arguments may be {@code NULL}. If an error occurs, all non-{@code NULL} size arguments will be set to zero.

+ * + *

This function must only be called from the main thread.

+ * + * @param window the window whose size to retrieve + * @param width where to store the width, in screen coordinates, of the content area, or {@code NULL} + * @param height where to store the height, in screen coordinates, of the content area, or {@code NULL} + * + * @since version 1.0 + */ + public static void glfwGetWindowSize(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("int *") IntBuffer width, @Nullable @NativeType("int *") IntBuffer height) { + if (CHECKS) { + checkSafe(width, 1); + checkSafe(height, 1); + } + nglfwGetWindowSize(window, memAddressSafe(width), memAddressSafe(height)); + } + + // --- [ glfwSetWindowSizeLimits ] --- + + /** + * Sets the size limits of the content area of the specified window. If the window is full screen, the size limits only take effect if once it is made + * windowed. If the window is not resizable, this function does nothing. + * + *

The size limits are applied immediately to a windowed mode window and may cause it to be resized.

+ * + *

The maximum dimensions must be greater than or equal to the minimum dimensions and all must be greater than or equal to zero.

+ * + *

Notes:

+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • Wayland: The size limits will not be applied until the window is actually resized, either by the user or by the compositor.
  • + *
+ * + * @param window the window to set limits for + * @param minwidth the minimum width, in screen coordinates, of the content area, or {@link #GLFW_DONT_CARE DONT_CARE} + * @param minheight the minimum height, in screen coordinates, of the content area, or {@link #GLFW_DONT_CARE DONT_CARE} + * @param maxwidth the maximum width, in screen coordinates, of the content area, or {@link #GLFW_DONT_CARE DONT_CARE} + * @param maxheight the maximum height, in screen coordinates, of the content area, or {@link #GLFW_DONT_CARE DONT_CARE} + * + * @since version 3.2 + */ + public static void glfwSetWindowSizeLimits(@NativeType("GLFWwindow *") long window, int minwidth, int minheight, int maxwidth, int maxheight) { + long __functionAddress = Functions.SetWindowSizeLimits; + if (CHECKS) { + check(window); + } + invokePV(window, minwidth, minheight, maxwidth, maxheight, __functionAddress); + } + + // --- [ glfwSetWindowAspectRatio ] --- + + /** + * Sets the required aspect ratio of the content area of the specified window. If the window is full screen, the aspect ratio only takes effect once it is + * made windowed. If the window is not resizable, this function does nothing. + * + *

The aspect ratio is specified as a numerator and a denominator and both values must be greater than zero. For example, the common 16:9 aspect ratio is + * specified as 16 and 9, respectively.

+ * + *

If the numerator and denominator is set to {@link #GLFW_DONT_CARE DONT_CARE} then the aspect ratio limit is disabled.

+ * + *

The aspect ratio is applied immediately to a windowed mode window and may cause it to be resized.

+ * + *

Notes:

+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • Wayland: The aspect ratio will not be applied until the window is actually resized, either by the user or by the compositor.
  • + *
+ * + * @param window the window to set limits for + * @param numer the numerator of the desired aspect ratio, or {@link #GLFW_DONT_CARE DONT_CARE} + * @param denom the denominator of the desired aspect ratio, or {@link #GLFW_DONT_CARE DONT_CARE} + * + * @since version 3.2 + */ + public static void glfwSetWindowAspectRatio(@NativeType("GLFWwindow *") long window, int numer, int denom) { + long __functionAddress = Functions.SetWindowAspectRatio; + if (CHECKS) { + check(window); + } + invokePV(window, numer, denom, __functionAddress); + } + + // --- [ glfwSetWindowSize ] --- + + /** + * Sets the size, in pixels, of the content area of the specified window. + * + *

For full screen windows, this function updates the resolution of its desired video mode and switches to the video mode closest to it, without affecting + * the window's context. As the context is unaffected, the bit depths of the framebuffer remain unchanged.

+ * + *

If you wish to update the refresh rate of the desired video mode in addition to its resolution, see {@link #glfwSetWindowMonitor SetWindowMonitor}.

+ * + *

The window manager may put limits on what sizes are allowed. GLFW cannot and should not override these limits.

+ * + *

Notes:

+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • Wayland: A full screen window will not attempt to change the mode, no matter what the requested size.
  • + *
+ * + * @param window the window to resize + * @param width the desired width, in screen coordinates, of the window content area + * @param height the desired height, in screen coordinates, of the window content area + * + * @since version 1.0 + */ + public static void glfwSetWindowSize(@NativeType("GLFWwindow *") long window, int width, int height) { + long __functionAddress = Functions.SetWindowSize; + if (CHECKS) { + check(window); + } + invokePV(window, width, height, __functionAddress); + } + + // --- [ glfwGetFramebufferSize ] --- + + /** Unsafe version of: {@link #glfwGetFramebufferSize GetFramebufferSize} */ + public static void nglfwGetFramebufferSize(long window, long width, long height) { + long __functionAddress = Functions.GetFramebufferSize; + if (CHECKS) { + check(window); + } + invokePPPV(window, width, height, __functionAddress); + } + + /** + * Retrieves the size, in pixels, of the framebuffer of the specified window. If you wish to retrieve the size of the window in screen coordinates, see + * {@link #glfwGetWindowSize GetWindowSize}. + * + *

Any or all of the size arguments may be {@code NULL}. If an error occurs, all non-{@code NULL} size arguments will be set to zero.

+ * + *

This function must only be called from the main thread.

+ * + * @param window the window whose framebuffer to query + * @param width where to store the width, in pixels, of the framebuffer, or {@code NULL} + * @param height where to store the height, in pixels, of the framebuffer, or {@code NULL} + * + * @since version 3.0 + */ + public static void glfwGetFramebufferSize(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("int *") IntBuffer width, @Nullable @NativeType("int *") IntBuffer height) { + if (CHECKS) { + checkSafe(width, 1); + checkSafe(height, 1); + } + nglfwGetFramebufferSize(window, memAddressSafe(width), memAddressSafe(height)); + } + + // --- [ glfwGetWindowFrameSize ] --- + + /** Unsafe version of: {@link #glfwGetWindowFrameSize GetWindowFrameSize} */ + public static void nglfwGetWindowFrameSize(long window, long left, long top, long right, long bottom) { + long __functionAddress = Functions.GetWindowFrameSize; + if (CHECKS) { + check(window); + } + invokePPPPPV(window, left, top, right, bottom, __functionAddress); + } + + /** + * Retrieves the size, in screen coordinates, of each edge of the frame of the specified window. This size includes the title bar, if the window has one. + * The size of the frame may vary depending on the window-related hints used to + * create it. + * + *

Because this function retrieves the size of each window frame edge and not the offset along a particular coordinate axis, the retrieved values will + * always be zero or positive.

+ * + *

Any or all of the size arguments may be {@code NULL}. If an error occurs, all non-{@code NULL} size arguments will be set to zero.

+ * + *

This function must only be called from the main thread.

+ * + * @param window the window whose frame size to query + * @param left where to store the size, in screen coordinates, of the left edge of the window frame, or {@code NULL} + * @param top where to store the size, in screen coordinates, of the top edge of the window frame, or {@code NULL} + * @param right where to store the size, in screen coordinates, of the right edge of the window frame, or {@code NULL} + * @param bottom where to store the size, in screen coordinates, of the bottom edge of the window frame, or {@code NULL} + * + * @since version 3.1 + */ + public static void glfwGetWindowFrameSize(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("int *") IntBuffer left, @Nullable @NativeType("int *") IntBuffer top, @Nullable @NativeType("int *") IntBuffer right, @Nullable @NativeType("int *") IntBuffer bottom) { + if (CHECKS) { + checkSafe(left, 1); + checkSafe(top, 1); + checkSafe(right, 1); + checkSafe(bottom, 1); + } + nglfwGetWindowFrameSize(window, memAddressSafe(left), memAddressSafe(top), memAddressSafe(right), memAddressSafe(bottom)); + } + + // --- [ glfwGetWindowContentScale ] --- + + /** Unsafe version of: {@link #glfwGetWindowContentScale GetWindowContentScale} */ + public static void nglfwGetWindowContentScale(long window, long xscale, long yscale) { + long __functionAddress = Functions.GetWindowContentScale; + if (CHECKS) { + check(window); + } + invokePPPV(window, xscale, yscale, __functionAddress); + } + + /** + * Retrieves the content scale for the specified window. + * + *

This function retrieves the content scale for the specified window. The content scale is the ratio between the current DPI and the platform's default + * DPI. This is especially important for text and any UI elements. If the pixel dimensions of your UI scaled by this look appropriate on your machine then + * it should appear at a reasonable size on other machines regardless of their DPI and scaling settings. This relies on the system DPI and scaling + * settings being somewhat correct.

+ * + *

On systems where each monitor can have its own content scale, the window content scale will depend on which monitor the system considers the window to + * be on.

+ * + * @param window the window to query + * @param xscale where to store the x-axis content scale, or {@code NULL} + * @param yscale where to store the y-axis content scale, or {@code NULL} + * + * @since version 3.3 + */ + public static void glfwGetWindowContentScale(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("float *") FloatBuffer xscale, @Nullable @NativeType("float *") FloatBuffer yscale) { + if (CHECKS) { + checkSafe(xscale, 1); + checkSafe(yscale, 1); + } + nglfwGetWindowContentScale(window, memAddressSafe(xscale), memAddressSafe(yscale)); + } + + // --- [ glfwGetWindowOpacity ] --- + + /** + * Returns the opacity of the whole window. + * + *

This function returns the opacity of the window, including any decorations.

+ * + *

The opacity (or alpha) value is a positive finite number between zero and one, where zero is fully transparent and one is fully opaque. If the system + * does not support whole window transparency, this function always returns one.

+ * + *

The initial opacity value for newly created windows is one.

+ * + *

This function must only be called from the main thread.

+ * + * @param window the window to query + * + * @return the opacity value of the specified window + * + * @since version 3.3 + */ + public static float glfwGetWindowOpacity(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.GetWindowOpacity; + if (CHECKS) { + check(window); + } + return invokePF(window, __functionAddress); + } + + // --- [ glfwSetWindowOpacity ] --- + + /** + * Sets the opacity of the whole window. + * + *

This function sets the opacity of the window, including any decorations.

+ * + *

The opacity (or alpha) value is a positive finite number between zero and one, where zero is fully transparent and one is fully opaque.

+ * + *

The initial opacity value for newly created windows is one.

+ * + *

A window created with framebuffer transparency may not use whole window transparency. The results of doing this are undefined.

+ * + *

This function must only be called from the main thread.

+ * + * @param window the window to set the opacity for + * @param opacity the desired opacity of the specified window + * + * @since version 3.3 + */ + public static void glfwSetWindowOpacity(@NativeType("GLFWwindow *") long window, float opacity) { + long __functionAddress = Functions.SetWindowOpacity; + if (CHECKS) { + check(window); + } + invokePV(window, opacity, __functionAddress); + } + + // --- [ glfwIconifyWindow ] --- + + /** + * Iconifies (minimizes) the specified window if it was previously restored. If the window is already iconified, this function does nothing. + * + *

If the specified window is a full screen window, the original monitor resolution is restored until the window is restored.

+ * + *

Notes:

+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • Wayland: Once a window is iconified, {@link #glfwRestoreWindow RestoreWindow} won’t be able to restore it. This is a design decision of the {@code xdg-shell}.
  • + *
+ * + * @param window the window to iconify + * + * @since version 2.1 + */ + public static void glfwIconifyWindow(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.IconifyWindow; + if (CHECKS) { + check(window); + } + invokePV(window, __functionAddress); + } + + // --- [ glfwRestoreWindow ] --- + + /** + * Restores the specified window if it was previously iconified (minimized) or maximized. If the window is already restored, this function does nothing. + * + *

If the specified window is a full screen window, the resolution chosen for the window is restored on the selected monitor.

+ * + *

This function must only be called from the main thread.

+ * + * @param window the window to restore + * + * @since version 2.1 + */ + public static void glfwRestoreWindow(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.RestoreWindow; + if (CHECKS) { + check(window); + } + invokePV(window, __functionAddress); + } + + // --- [ glfwMaximizeWindow ] --- + + /** + * Maximizes the specified window if it was previously not maximized. If the window is already maximized, this function does nothing. + * + *

If the specified window is a full screen window, this function does nothing.

+ * + *

This function may only be called from the main thread.

+ * + * @param window the window to maximize + * + * @since version 3.2 + */ + public static void glfwMaximizeWindow(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.MaximizeWindow; + if (CHECKS) { + check(window); + } + invokePV(window, __functionAddress); + } + + // --- [ glfwShowWindow ] --- + + /** + * Makes the specified window visible if it was previously hidden. If the window is already visible or is in full screen mode, this function does nothing. + * + *

By default, windowed mode windows are focused when shown. Set the {@link #GLFW_FOCUS_ON_SHOW FOCUS_ON_SHOW} window hint to change this behavior for all newly created windows, or + * change the behavior for an existing window with {@link #glfwSetWindowAttrib SetWindowAttrib}.

+ * + *

This function must only be called from the main thread.

+ * + * @param window the window to make visible + * + * @since version 3.0 + */ + public static void glfwShowWindow(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.ShowWindow; + EventLoop.OnScreen.check(); + if (CHECKS) { + check(window); + } + invokePV(window, __functionAddress); + } + + // --- [ glfwHideWindow ] --- + + /** + * Hides the specified window, if it was previously visible. If the window is already hidden or is in full screen mode, this function does nothing. + * + *

This function must only be called from the main thread.

+ * + * @param window the window to hide + * + * @since version 3.0 + */ + public static void glfwHideWindow(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.HideWindow; + if (CHECKS) { + check(window); + } + invokePV(window, __functionAddress); + } + + // --- [ glfwFocusWindow ] --- + + /** + * Brings the specified window to front and sets input focus. The window should already be visible and not iconified. + * + *

By default, both windowed and full screen mode windows are focused when initially created. Set the {@link #GLFW_FOCUSED FOCUSED} hint to disable this behavior.

+ * + *

Also by default, windowed mode windows are focused when shown with {@link #glfwShowWindow ShowWindow}. Set the {@link #GLFW_FOCUS_ON_SHOW FOCUS_ON_SHOW} window hint to disable this behavior.

+ * + *

Do not use this function to steal focus from other applications unless you are certain that is what the user wants. Focus stealing can be + * extremely disruptive.

+ * + *

For a less disruptive way of getting the user's attention, see {@link #glfwRequestWindowAttention RequestWindowAttention}.

+ * + *

Notes:

+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • Wayland: It is not possible for an application to bring its windows to front, this function will always emit {@link #GLFW_PLATFORM_ERROR PLATFORM_ERROR}.
  • + *
+ * + * @param window the window to give input focus + * + * @since version 3.2 + */ + public static void glfwFocusWindow(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.FocusWindow; + if (CHECKS) { + check(window); + } + invokePV(window, __functionAddress); + } + + // --- [ glfwRequestWindowAttention ] --- + + /** + * Requests user attention to the specified window. + * + *

This function requests user attention to the specified window. On platforms where this is not supported, attention is requested to the application as + * a whole.

+ * + *

Once the user has given attention, usually by focusing the window or application, the system will end the request automatically.

+ * + *
Note
+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • macOS: Attention is requested to the application as a whole, not the specific window.
  • + *
+ * + * @param window the window to request attention to + * + * @since version 3.3 + */ + public static void glfwRequestWindowAttention(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.RequestWindowAttention; + if (CHECKS) { + check(window); + } + invokePV(window, __functionAddress); + } + + // --- [ glfwGetWindowMonitor ] --- + + /** + * Returns the handle of the monitor that the specified window is in full screen on. + * + *

This function must only be called from the main thread.

+ * + * @param window the window to query + * + * @return the monitor, or {@code NULL} if the window is in windowed mode or an error occurred + * + * @since version 3.0 + */ + @NativeType("GLFWmonitor *") + public static long glfwGetWindowMonitor(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.GetWindowMonitor; + if (CHECKS) { + check(window); + } + return invokePP(window, __functionAddress); + } + + // --- [ glfwSetWindowMonitor ] --- + + /** + * Sets the mode, monitor, video mode and placement of a window. + * + *

This function sets the monitor that the window uses for full screen mode or, if the monitor is {@code NULL}, makes it windowed mode.

+ * + *

When setting a monitor, this function updates the width, height and refresh rate of the desired video mode and switches to the video mode closest to + * it. The window position is ignored when setting a monitor.

+ * + *

When the monitor is {@code NULL}, the position, width and height are used to place the window content area. The refresh rate is ignored when no monitor is + * specified.

+ * + *

If you only wish to update the resolution of a full screen window or the size of a windowed mode window, see {@link #glfwSetWindowSize SetWindowSize}.

+ * + *

When a window transitions from full screen to windowed mode, this function restores any previous window settings such as whether it is decorated, + * floating, resizable, has size or aspect ratio limits, etc.

+ * + *

Notes:

+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • Wayland: The desired window position is ignored, as there is no way for an application to set this property.
  • + *
  • Wayland: Setting the window to full screen will not attempt to change the mode, no matter what the requested size or refresh rate.
  • + *
+ * + * @param window the window whose monitor, size or video mode to set + * @param monitor the desired monitor, or {@code NULL} to set windowed mode + * @param xpos the desired x-coordinate of the upper-left corner of the content area + * @param ypos the desired y-coordinate of the upper-left corner of the content area + * @param width the desired with, in screen coordinates, of the content area or video mode + * @param height the desired height, in screen coordinates, of the content area or video mode + * @param refreshRate the desired refresh rate, in Hz, of the video mode, or {@link #GLFW_DONT_CARE DONT_CARE} + * + * @since version 3.2 + */ + public static void glfwSetWindowMonitor(@NativeType("GLFWwindow *") long window, @NativeType("GLFWmonitor *") long monitor, int xpos, int ypos, int width, int height, int refreshRate) { + long __functionAddress = Functions.SetWindowMonitor; + if (CHECKS) { + check(window); + } + invokePPV(window, monitor, xpos, ypos, width, height, refreshRate, __functionAddress); + } + + // --- [ glfwGetWindowAttrib ] --- + + /** + * Returns the value of an attribute of the specified window or its OpenGL or OpenGL ES context. + * + *

This function must only be called from the main thread.

+ * + *

Framebuffer related hints are not window attributes.

+ * + *

Zero is a valid value for many window and context related attributes so you cannot use a return value of zero as an indication of errors. However, this + * function should not fail as long as it is passed valid arguments and the library has been initialized.

+ * + * @param window the window to query + * @param attrib the window attribute whose value to return. One of:
{@link #GLFW_FOCUSED FOCUSED}{@link #GLFW_ICONIFIED ICONIFIED}{@link #GLFW_RESIZABLE RESIZABLE}{@link #GLFW_VISIBLE VISIBLE}{@link #GLFW_DECORATED DECORATED}
{@link #GLFW_FLOATING FLOATING}{@link #GLFW_MAXIMIZED MAXIMIZED}{@link #GLFW_CENTER_CURSOR CENTER_CURSOR}{@link #GLFW_TRANSPARENT_FRAMEBUFFER TRANSPARENT_FRAMEBUFFER}{@link #GLFW_HOVERED HOVERED}
{@link #GLFW_FOCUS_ON_SHOW FOCUS_ON_SHOW}{@link #GLFW_CLIENT_API CLIENT_API}{@link #GLFW_CONTEXT_VERSION_MAJOR CONTEXT_VERSION_MAJOR}{@link #GLFW_CONTEXT_VERSION_MINOR CONTEXT_VERSION_MINOR}{@link #GLFW_CONTEXT_REVISION CONTEXT_REVISION}
{@link #GLFW_CONTEXT_ROBUSTNESS CONTEXT_ROBUSTNESS}{@link #GLFW_OPENGL_FORWARD_COMPAT OPENGL_FORWARD_COMPAT}{@link #GLFW_OPENGL_DEBUG_CONTEXT OPENGL_DEBUG_CONTEXT}{@link #GLFW_OPENGL_PROFILE OPENGL_PROFILE}{@link #GLFW_CONTEXT_RELEASE_BEHAVIOR CONTEXT_RELEASE_BEHAVIOR}
{@link #GLFW_CONTEXT_NO_ERROR CONTEXT_NO_ERROR}{@link #GLFW_CONTEXT_CREATION_API CONTEXT_CREATION_API}{@link #GLFW_SCALE_TO_MONITOR SCALE_TO_MONITOR}
+ * + * @return the value of the attribute, or zero if an error occurred + * + * @since version 3.0 + */ + public static int glfwGetWindowAttrib(@NativeType("GLFWwindow *") long window, int attrib) { + long __functionAddress = Functions.GetWindowAttrib; + if (CHECKS) { + check(window); + } + return invokePI(window, attrib, __functionAddress); + } + + // --- [ glfwSetWindowAttrib ] --- + + /** + * Sets an attribute of the specified window. + * + *

This function must only be called from the main thread.

+ * + * @param window the window to set the attribute for + * @param attrib the attribute to set. + * + *

Some of these attributes are ignored for full screen windows. The new value will take effect if the window is later made windowed.

+ * + *

Some of these attributes are ignored for windowed mode windows. The new value will take effect if the window is later made full screen.

+ * + *

Calling {@link #glfwGetWindowAttrib GetWindowAttrib} will always return the latest value, even if that value is ignored by the current mode of the window. One of:

{@link #GLFW_DECORATED DECORATED}{@link #GLFW_RESIZABLE RESIZABLE}{@link #GLFW_FLOATING FLOATING}{@link #GLFW_AUTO_ICONIFY AUTO_ICONIFY}{@link #GLFW_FOCUS_ON_SHOW FOCUS_ON_SHOW}
+ * @param value the value to set + * + * @since version 3.3 + */ + public static void glfwSetWindowAttrib(@NativeType("GLFWwindow *") long window, int attrib, int value) { + long __functionAddress = Functions.SetWindowAttrib; + if (CHECKS) { + check(window); + } + invokePV(window, attrib, value, __functionAddress); + } + + // --- [ glfwSetWindowUserPointer ] --- + + /** + * Sets the user-defined pointer of the specified window. The current value is retained until the window is destroyed. The initial value is {@code NULL}. + * + *

This function may be called from any thread. Access is not synchronized.

+ * + * @param window the window whose pointer to set + * @param pointer the new value + * + * @since version 3.0 + */ + public static void glfwSetWindowUserPointer(@NativeType("GLFWwindow *") long window, @NativeType("void *") long pointer) { + long __functionAddress = Functions.SetWindowUserPointer; + if (CHECKS) { + check(window); + } + invokePPV(window, pointer, __functionAddress); + } + + // --- [ glfwGetWindowUserPointer ] --- + + /** + * Returns the current value of the user-defined pointer of the specified window. The initial value is {@code NULL}. + * + *

This function may be called from any thread. Access is not synchronized.

+ * + * @param window the window whose pointer to return + * + * @since version 3.0 + */ + @NativeType("void *") + public static long glfwGetWindowUserPointer(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.GetWindowUserPointer; + if (CHECKS) { + check(window); + } + return invokePP(window, __functionAddress); + } + + // --- [ glfwSetWindowPosCallback ] --- + + /** Unsafe version of: {@link #glfwSetWindowPosCallback SetWindowPosCallback} */ + public static long nglfwSetWindowPosCallback(long window, long cbfun) { + long __functionAddress = Functions.SetWindowPosCallback; + if (CHECKS) { + check(window); + } + return invokePPP(window, cbfun, __functionAddress); + } + + /** + * Sets the position callback of the specified window, which is called when the window is moved. The callback is provided with the position, in screen + * coordinates, of the upper-left corner of the content area of the window. + * + *

Notes:

+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • Wayland: This callback will never be called, as there is no way for an application to know its global position.
  • + *
+ * + * @param window the window whose callback to set + * @param cbfun the new callback or {@code NULL} to remove the currently set callback + * + * @return the previously set callback, or {@code NULL} if no callback was set or the library had not been + * initialized + * + * @since version 1.0 + */ + @Nullable + @NativeType("GLFWwindowposfun") + public static GLFWWindowPosCallback glfwSetWindowPosCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWwindowposfun") GLFWWindowPosCallbackI cbfun) { + return GLFWWindowPosCallback.createSafe(nglfwSetWindowPosCallback(window, memAddressSafe(cbfun))); + } + + // --- [ glfwSetWindowSizeCallback ] --- + + /** Unsafe version of: {@link #glfwSetWindowSizeCallback SetWindowSizeCallback} */ + public static long nglfwSetWindowSizeCallback(long window, long cbfun) { + long __functionAddress = Functions.SetWindowSizeCallback; + if (CHECKS) { + check(window); + } + return invokePPP(window, cbfun, __functionAddress); + } + + /** + * Sets the size callback of the specified window, which is called when the window is resized. The callback is provided with the size, in screen + * coordinates, of the content area of the window. + * + *

This function must only be called from the main thread.

+ * + * @param window the window whose callback to set + * @param cbfun the new callback or {@code NULL} to remove the currently set callback + * + * @return the previously set callback, or {@code NULL} if no callback was set or the library had not been + * initialized + * + * @since version 1.0 + */ + @Nullable + @NativeType("GLFWwindowsizefun") + public static GLFWWindowSizeCallback glfwSetWindowSizeCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWwindowsizefun") GLFWWindowSizeCallbackI cbfun) { + return GLFWWindowSizeCallback.createSafe(nglfwSetWindowSizeCallback(window, memAddressSafe(cbfun))); + } + + // --- [ glfwSetWindowCloseCallback ] --- + + /** Unsafe version of: {@link #glfwSetWindowCloseCallback SetWindowCloseCallback} */ + public static long nglfwSetWindowCloseCallback(long window, long cbfun) { + long __functionAddress = Functions.SetWindowCloseCallback; + if (CHECKS) { + check(window); + } + return invokePPP(window, cbfun, __functionAddress); + } + + /** + * Sets the close callback of the specified window, which is called when the user attempts to close the window, for example by clicking the close widget in + * the title bar. + * + *

The close flag is set before this callback is called, but you can modify it at any time with {@link #glfwSetWindowShouldClose SetWindowShouldClose}.

+ * + *

The close callback is not triggered by {@link #glfwDestroyWindow DestroyWindow}.

+ * + *
Note
+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • macOS: Selecting Quit from the application menu will trigger the close callback for all windows.
  • + *
+ * + * @param window the window whose callback to set + * @param cbfun the new callback or {@code NULL} to remove the currently set callback + * + * @return the previously set callback, or {@code NULL} if no callback was set or the library had not been + * initialized + * + * @since version 2.5 + */ + @Nullable + @NativeType("GLFWwindowclosefun") + public static GLFWWindowCloseCallback glfwSetWindowCloseCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWwindowclosefun") GLFWWindowCloseCallbackI cbfun) { + return GLFWWindowCloseCallback.createSafe(nglfwSetWindowCloseCallback(window, memAddressSafe(cbfun))); + } + + // --- [ glfwSetWindowRefreshCallback ] --- + + /** Unsafe version of: {@link #glfwSetWindowRefreshCallback SetWindowRefreshCallback} */ + public static long nglfwSetWindowRefreshCallback(long window, long cbfun) { + long __functionAddress = Functions.SetWindowRefreshCallback; + if (CHECKS) { + check(window); + } + return invokePPP(window, cbfun, __functionAddress); + } + + /** + * Sets the refresh callback of the specified window, which is called when the content area of the window needs to be redrawn, for example if the window has + * been exposed after having been covered by another window. + * + *

On compositing window systems such as Aero, Compiz or Aqua, where the window contents are saved off-screen, this callback may be called only very + * infrequently or never at all.

+ * + *

This function must only be called from the main thread.

+ * + * @param window the window whose callback to set + * @param cbfun the new callback or {@code NULL} to remove the currently set callback + * + * @return the previously set callback, or {@code NULL} if no callback was set or the library had not been + * initialized + * + * @since version 2.5 + */ + @Nullable + @NativeType("GLFWwindowrefreshfun") + public static GLFWWindowRefreshCallback glfwSetWindowRefreshCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWwindowrefreshfun") GLFWWindowRefreshCallbackI cbfun) { + return GLFWWindowRefreshCallback.createSafe(nglfwSetWindowRefreshCallback(window, memAddressSafe(cbfun))); + } + + // --- [ glfwSetWindowFocusCallback ] --- + + /** Unsafe version of: {@link #glfwSetWindowFocusCallback SetWindowFocusCallback} */ + public static long nglfwSetWindowFocusCallback(long window, long cbfun) { + long __functionAddress = Functions.SetWindowFocusCallback; + if (CHECKS) { + check(window); + } + return invokePPP(window, cbfun, __functionAddress); + } + + /** + * Sets the focus callback of the specified window, which is called when the window gains or loses input focus. + * + *

After the focus callback is called for a window that lost input focus, synthetic key and mouse button release events will be generated for all such + * that had been pressed. For more information, see {@link #glfwSetKeyCallback SetKeyCallback} and {@link #glfwSetMouseButtonCallback SetMouseButtonCallback}.

+ * + *

This function must only be called from the main thread.

+ * + * @param window the window whose callback to set + * @param cbfun the new callback or {@code NULL} to remove the currently set callback + * + * @return the previously set callback, or {@code NULL} if no callback was set or the library had not been + * initialized + * + * @since version 3.0 + */ + @Nullable + @NativeType("GLFWwindowfocusfun") + public static GLFWWindowFocusCallback glfwSetWindowFocusCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWwindowfocusfun") GLFWWindowFocusCallbackI cbfun) { + return GLFWWindowFocusCallback.createSafe(nglfwSetWindowFocusCallback(window, memAddressSafe(cbfun))); + } + + // --- [ glfwSetWindowIconifyCallback ] --- + + /** Unsafe version of: {@link #glfwSetWindowIconifyCallback SetWindowIconifyCallback} */ + public static long nglfwSetWindowIconifyCallback(long window, long cbfun) { + long __functionAddress = Functions.SetWindowIconifyCallback; + if (CHECKS) { + check(window); + } + return invokePPP(window, cbfun, __functionAddress); + } + + /** + * Sets the iconification callback of the specified window, which is called when the window is iconified or restored. + * + *

This function must only be called from the main thread.

+ * + * @param window the window whose callback to set + * @param cbfun the new callback or {@code NULL} to remove the currently set callback + * + * @return the previously set callback, or {@code NULL} if no callback was set or the library had not been + * initialized + * + * @since version 3.0 + */ + @Nullable + @NativeType("GLFWwindowiconifyfun") + public static GLFWWindowIconifyCallback glfwSetWindowIconifyCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWwindowiconifyfun") GLFWWindowIconifyCallbackI cbfun) { + return GLFWWindowIconifyCallback.createSafe(nglfwSetWindowIconifyCallback(window, memAddressSafe(cbfun))); + } + + // --- [ glfwSetWindowMaximizeCallback ] --- + + /** Unsafe version of: {@link #glfwSetWindowMaximizeCallback SetWindowMaximizeCallback} */ + public static long nglfwSetWindowMaximizeCallback(long window, long cbfun) { + long __functionAddress = Functions.SetWindowMaximizeCallback; + if (CHECKS) { + check(window); + } + return invokePPP(window, cbfun, __functionAddress); + } + + /** + * Sets the maximization callback of the specified window, which is called when the window is maximized or restored. + * + *

This function must only be called from the main thread.

+ * + * @param window the window whose callback to set + * @param cbfun the new callback or {@code NULL} to remove the currently set callback + * + * @return the previously set callback, or {@code NULL} if no callback was set or the library had not been + * initialized + * + * @since version 3.3 + */ + @Nullable + @NativeType("GLFWwindowmaximizefun") + public static GLFWWindowMaximizeCallback glfwSetWindowMaximizeCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWwindowmaximizefun") GLFWWindowMaximizeCallbackI cbfun) { + return GLFWWindowMaximizeCallback.createSafe(nglfwSetWindowMaximizeCallback(window, memAddressSafe(cbfun))); + } + + // --- [ glfwSetFramebufferSizeCallback ] --- + + /** Unsafe version of: {@link #glfwSetFramebufferSizeCallback SetFramebufferSizeCallback} */ + public static long nglfwSetFramebufferSizeCallback(long window, long cbfun) { + long __functionAddress = Functions.SetFramebufferSizeCallback; + if (CHECKS) { + check(window); + } + return invokePPP(window, cbfun, __functionAddress); + } + + /** + * Sets the framebuffer resize callback of the specified window, which is called when the framebuffer of the specified window is resized. + * + *

This function must only be called from the main thread.

+ * + * @param window the window whose callback to set + * @param cbfun the new callback or {@code NULL} to remove the currently set callback + * + * @return the previously set callback, or {@code NULL} if no callback was set or the library had not been + * initialized + * + * @since version 3.0 + */ + @Nullable + @NativeType("GLFWframebuffersizefun") + public static GLFWFramebufferSizeCallback glfwSetFramebufferSizeCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWframebuffersizefun") GLFWFramebufferSizeCallbackI cbfun) { + return GLFWFramebufferSizeCallback.createSafe(nglfwSetFramebufferSizeCallback(window, memAddressSafe(cbfun))); + } + + // --- [ glfwSetWindowContentScaleCallback ] --- + + /** Unsafe version of: {@link #glfwSetWindowContentScaleCallback SetWindowContentScaleCallback} */ + public static long nglfwSetWindowContentScaleCallback(long window, long cbfun) { + long __functionAddress = Functions.SetWindowContentScaleCallback; + if (CHECKS) { + check(window); + } + return invokePPP(window, cbfun, __functionAddress); + } + + /** + * Sets the window content scale callback for the specified window, which is called when the content scale of the specified window changes. + * + *

This function must only be called from the main thread.

+ * + * @param window the window whose callback to set + * @param cbfun the new callback or {@code NULL} to remove the currently set callback + * + * @return the previously set callback, or {@code NULL} if no callback was set or the library had not been + * initialized + * + * @since version 3.3 + */ + @Nullable + @NativeType("GLFWwindowcontentscalefun") + public static GLFWWindowContentScaleCallback glfwSetWindowContentScaleCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWwindowcontentscalefun") GLFWWindowContentScaleCallbackI cbfun) { + return GLFWWindowContentScaleCallback.createSafe(nglfwSetWindowContentScaleCallback(window, memAddressSafe(cbfun))); + } + + // --- [ glfwPollEvents ] --- + + /** + * Processes all pending events. + * + *

This function processes only those events that are already in the event queue and then returns immediately. Processing events will cause the window and + * input callbacks associated with those events to be called.

+ * + *

On some platforms, a window move, resize or menu operation will cause event processing to block. This is due to how event processing is designed on + * those platforms. You can use the window refresh callback to redraw the + * contents of your window when necessary during such operations.

+ * + *

On some platforms, certain events are sent directly to the application without going through the event queue, causing callbacks to be called outside of + * a call to one of the event processing functions.

+ * + *

Event processing is not required for joystick input to work.

+ * + *
Note
+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • This function must not be called from a callback.
  • + *
+ * + * @since version 1.0 + */ + public static void glfwPollEvents() { + long __functionAddress = Functions.PollEvents; + EventLoop.OnScreen.check(); + invokeV(__functionAddress); + } + + // --- [ glfwWaitEvents ] --- + + /** + * Waits until events are queued and processes them. + * + *

This function puts the calling thread to sleep until at least one event is available in the event queue. Once one or more events are available, it + * behaves exactly like {@link #glfwPollEvents PollEvents}, i.e. the events in the queue are processed and the function then returns immediately. Processing events will cause + * the window and input callbacks associated with those events to be called.

+ * + *

Since not all events are associated with callbacks, this function may return without a callback having been called even if you are monitoring all + * callbacks.

+ * + *

On some platforms, a window move, resize or menu operation will cause event processing to block. This is due to how event processing is designed on + * those platforms. You can use the window refresh callback to redraw the + * contents of your window when necessary during such operations.

+ * + *

On some platforms, certain callbacks may be called outside of a call to one of the event processing functions.

+ * + *

Event processing is not required for joystick input to work.

+ * + *
Note
+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • This function must not be called from a callback.
  • + *
+ * + * @since version 2.5 + */ + public static void glfwWaitEvents() { + long __functionAddress = Functions.WaitEvents; + EventLoop.OnScreen.check(); + invokeV(__functionAddress); + } + + // --- [ glfwWaitEventsTimeout ] --- + + /** + * Waits with timeout until events are queued and processes them. + * + *

This function puts the calling thread to sleep until at least one event is available in the event queue, or until the specified timeout is reached. If + * one or more events are available, it behaves exactly like {@link #glfwPollEvents PollEvents}, i.e. the events in the queue are processed and the function then returns + * immediately. Processing events will cause the window and input callbacks associated with those events to be called.

+ * + *

The timeout value must be a positive finite number.

+ * + *

Since not all events are associated with callbacks, this function may return without a callback having been called even if you are monitoring all + * callbacks.

+ * + *

On some platforms, a window move, resize or menu operation will cause event processing to block. This is due to how event processing is designed on + * those platforms. You can use the window refresh callback to redraw the contents of your window when necessary during such operations.

+ * + *

On some platforms, certain callbacks may be called outside of a call to one of the event processing functions.

+ * + *

Event processing is not required for joystick input to work.

+ * + *
Note
+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • This function must not be called from a callback.
  • + *
+ * + * @param timeout the maximum amount of time, in seconds, to wait + * + * @since version 3.2 + */ + public static void glfwWaitEventsTimeout(double timeout) { + long __functionAddress = Functions.WaitEventsTimeout; + EventLoop.OnScreen.check(); + invokeV(timeout, __functionAddress); + } + + // --- [ glfwPostEmptyEvent ] --- + + /** + * Posts an empty event from the current thread to the main thread event queue, causing {@link #glfwWaitEvents WaitEvents} or {@link #glfwWaitEventsTimeout WaitEventsTimeout} to return. + * + *

This function may be called from any thread.

+ * + * @since version 3.1 + */ + public static void glfwPostEmptyEvent() { + long __functionAddress = Functions.PostEmptyEvent; + invokeV(__functionAddress); + } + + // --- [ glfwGetInputMode ] --- + + /** + * Returns the value of an input option for the specified window. + * + *

This function must only be called from the main thread.

+ * + * @param window the window to query + * @param mode the input mode whose value to return. One of:
{@link #GLFW_CURSOR CURSOR}{@link #GLFW_STICKY_KEYS STICKY_KEYS}{@link #GLFW_STICKY_MOUSE_BUTTONS STICKY_MOUSE_BUTTONS}{@link #GLFW_LOCK_KEY_MODS LOCK_KEY_MODS}{@link #GLFW_RAW_MOUSE_MOTION RAW_MOUSE_MOTION}
+ * + * @return the input mode value + * + * @since version 3.0 + */ + public static int glfwGetInputMode(@NativeType("GLFWwindow *") long window, int mode) { + long __functionAddress = Functions.GetInputMode; + if (CHECKS) { + check(window); + } + return invokePI(window, mode, __functionAddress); + } + + // --- [ glfwSetInputMode ] --- + + /** + * Sets an input option for the specified window. + * + *

If {@code mode} is {@link #GLFW_CURSOR CURSOR}, the value must be one of the following cursor modes:

+ * + *
    + *
  • {@link #GLFW_CURSOR_NORMAL CURSOR_NORMAL} makes the cursor visible and behaving normally.
  • + *
  • {@link #GLFW_CURSOR_HIDDEN CURSOR_HIDDEN} makes the cursor invisible when it is over the content area of the window but does not restrict the cursor from leaving.
  • + *
  • {@link #GLFW_CURSOR_DISABLED CURSOR_DISABLED} hides and grabs the cursor, providing virtual and unlimited cursor movement. This is useful for implementing for example 3D camera + * controls.
  • + *
+ * + *

If the {@code mode} is {@link #GLFW_STICKY_KEYS STICKY_KEYS}, the value must be either {@link #GLFW_TRUE TRUE} to enable sticky keys, or {@link #GLFW_FALSE FALSE} to disable it. If sticky keys are enabled, a key + * press will ensure that {@link #glfwGetKey GetKey} returns {@link #GLFW_PRESS PRESS} the next time it is called even if the key had been released before the call. This is useful when you + * are only interested in whether keys have been pressed but not when or in which order.

+ * + *

If the {@code mode} is {@link #GLFW_STICKY_MOUSE_BUTTONS STICKY_MOUSE_BUTTONS}, the value must be either {@link #GLFW_TRUE TRUE} to enable sticky mouse buttons, or {@link #GLFW_FALSE FALSE} to disable it. If sticky mouse + * buttons are enabled, a mouse button press will ensure that {@link #glfwGetMouseButton GetMouseButton} returns {@link #GLFW_PRESS PRESS} the next time it is called even if the mouse button had + * been released before the call. This is useful when you are only interested in whether mouse buttons have been pressed but not when or in which order.

+ * + *

If the {@code mode} is {@link #GLFW_LOCK_KEY_MODS LOCK_KEY_MODS}, the value must be either {@link #GLFW_TRUE TRUE} to enable lock key modifier bits, or {@link #GLFW_FALSE FALSE} to disable them. If enabled, + * callbacks that receive modifier bits will also have the {@link #GLFW_MOD_CAPS_LOCK MOD_CAPS_LOCK} bit set when the event was generated with Caps Lock on, and the {@link #GLFW_MOD_NUM_LOCK MOD_NUM_LOCK} + * bit when Num Lock was on.

+ * + *

If the mode is {@link #GLFW_RAW_MOUSE_MOTION RAW_MOUSE_MOTION}, the value must be either {@link #GLFW_TRUE TRUE} to enable raw (unscaled and unaccelerated) mouse motion when the cursor is disabled, + * or {@link #GLFW_FALSE FALSE} to disable it. If raw motion is not supported, attempting to set this will emit {@link #GLFW_PLATFORM_ERROR PLATFORM_ERROR}. Call {@link #glfwRawMouseMotionSupported RawMouseMotionSupported} to check for + * support.

+ * + *

This function must only be called from the main thread.

+ * + * @param window the window whose input mode to set + * @param mode the input mode to set. One of:
{@link #GLFW_CURSOR CURSOR}{@link #GLFW_STICKY_KEYS STICKY_KEYS}{@link #GLFW_STICKY_MOUSE_BUTTONS STICKY_MOUSE_BUTTONS}
+ * @param value the new value of the specified input mode + * + * @since GFLW 3.0 + */ + public static void glfwSetInputMode(@NativeType("GLFWwindow *") long window, int mode, int value) { + long __functionAddress = Functions.SetInputMode; + if (CHECKS) { + check(window); + } + invokePV(window, mode, value, __functionAddress); + FCLInjector.setClassLoader(Thread.currentThread().getContextClassLoader()); + } + + // --- [ glfwRawMouseMotionSupported ] --- + + /** + * Returns whether raw mouse motion is supported. + * + *

This function returns whether raw mouse motion is supported on the current system. This status does not change after GLFW has been initialized so you + * only need to check this once. If you attempt to enable raw motion on a system that does not support it, {@link #GLFW_PLATFORM_ERROR PLATFORM_ERROR} will be emitted.

+ * + *

Raw mouse motion is closer to the actual motion of the mouse across a surface. It is not affected by the scaling and acceleration applied to the motion + * of the desktop cursor. That processing is suitable for a cursor while raw motion is better for controlling for example a 3D camera. Because of this, + * raw mouse motion is only provided when the cursor is disabled.

+ * + *

This function must only be called from the main thread.

+ * + * @return {@link #GLFW_TRUE TRUE} if raw mouse motion is supported on the current machine, or {@link #GLFW_FALSE FALSE} otherwise + * + * @since version 3.3 + */ + @NativeType("int") + public static boolean glfwRawMouseMotionSupported() { + long __functionAddress = Functions.RawMouseMotionSupported; + return invokeI(__functionAddress) != 0; + } + + // --- [ glfwGetKeyName ] --- + + /** Unsafe version of: {@link #glfwGetKeyName GetKeyName} */ + public static long nglfwGetKeyName(int key, int scancode) { + long __functionAddress = Functions.GetKeyName; + return invokeP(key, scancode, __functionAddress); + } + + /** + * Returns the layout-specific name of the specified printable key. + * + *

This function returns the name of the specified printable key, encoded as UTF-8. This is typically the character that key would produce without any + * modifier keys, intended for displaying key bindings to the user. For dead keys, it is typically the diacritic it would add to a character.

+ * + *

Do not use this function for text input. You will break text input for many languages even if it happens to work for yours.

+ * + *

If the key is {@link #GLFW_KEY_UNKNOWN KEY_UNKNOWN}, the scancode is used to identify the key, otherwise the scancode is ignored. If you specify a non-printable key, or + * {@link #GLFW_KEY_UNKNOWN KEY_UNKNOWN} and a scancode that maps to a non-printable key, this function returns {@code NULL} but does not emit an error.

+ * + *

This behavior allows you to always pass in the arguments in the key callback without modification.

+ * + *

The printable keys are:

+ * + *
    + *
  • {@link #GLFW_KEY_APOSTROPHE KEY_APOSTROPHE}
  • + *
  • {@link #GLFW_KEY_COMMA KEY_COMMA}
  • + *
  • {@link #GLFW_KEY_MINUS KEY_MINUS}
  • + *
  • {@link #GLFW_KEY_PERIOD KEY_PERIOD}
  • + *
  • {@link #GLFW_KEY_SLASH KEY_SLASH}
  • + *
  • {@link #GLFW_KEY_SEMICOLON KEY_SEMICOLON}
  • + *
  • {@link #GLFW_KEY_EQUAL KEY_EQUAL}
  • + *
  • {@link #GLFW_KEY_LEFT_BRACKET KEY_LEFT_BRACKET}
  • + *
  • {@link #GLFW_KEY_RIGHT_BRACKET KEY_RIGHT_BRACKET}
  • + *
  • {@link #GLFW_KEY_BACKSLASH KEY_BACKSLASH}
  • + *
  • {@link #GLFW_KEY_WORLD_1 KEY_WORLD_1}
  • + *
  • {@link #GLFW_KEY_WORLD_2 KEY_WORLD_2}
  • + *
  • {@link #GLFW_KEY_0 KEY_0} to {@link #GLFW_KEY_9 KEY_9}
  • + *
  • {@link #GLFW_KEY_A KEY_A} to {@link #GLFW_KEY_Z KEY_Z}
  • + *
  • {@link #GLFW_KEY_KP_0 KEY_KP_0} to {@link #GLFW_KEY_KP_9 KEY_KP_9}
  • + *
  • {@link #GLFW_KEY_KP_DECIMAL KEY_KP_DECIMAL}
  • + *
  • {@link #GLFW_KEY_KP_DIVIDE KEY_KP_DIVIDE}
  • + *
  • {@link #GLFW_KEY_KP_MULTIPLY KEY_KP_MULTIPLY}
  • + *
  • {@link #GLFW_KEY_KP_SUBTRACT KEY_KP_SUBTRACT}
  • + *
  • {@link #GLFW_KEY_KP_ADD KEY_KP_ADD}
  • + *
  • {@link #GLFW_KEY_KP_EQUAL KEY_KP_EQUAL}
  • + *
+ * + *

Names for printable keys depend on keyboard layout, while names for non-printable keys are the same across layouts but depend on the application + * language and should be localized along with other user interface text.

+ * + *

The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the next call to {@link #glfwGetKeyName GetKeyName}, or until the + * library is terminated.

+ * + *

This function must only be called from the main thread.

+ * + * @param key the key to query, or {@link #GLFW_KEY_UNKNOWN KEY_UNKNOWN} + * @param scancode the scancode of the key to query + * + * @return the UTF-8 encoded, layout-specific name of the key, or {@code NULL} + * + * @since version 3.2 + */ + @Nullable + @NativeType("char const *") + public static String glfwGetKeyName(int key, int scancode) { + long __result = nglfwGetKeyName(key, scancode); + return memUTF8Safe(__result); + } + + // --- [ glfwGetKeyScancode ] --- + + /** + * Returns the platform dependent scancode of the specified key. + * + *

This function returns the platform dependent scancode of the specified key. This is intended for platform specific default keybindings.

+ * + *

If the key is {@link #GLFW_KEY_UNKNOWN KEY_UNKNOWN} or does not exist on the keyboard this method will return {@code -1}.

+ * + *

This function may be called from any thread.

+ * + * @param key the key to query, or {@link #GLFW_KEY_UNKNOWN KEY_UNKNOWN} + * + * @return the platform dependent scancode for the key, or {@code -1} if an errror occurred + * + * @since version 3.3 + */ + public static int glfwGetKeyScancode(int key) { + long __functionAddress = Functions.GetKeyScancode; + return invokeI(key, __functionAddress); + } + + // --- [ glfwGetKey ] --- + + /** + * Returns the last state reported for the specified key to the specified window. The returned state is one of {@link #GLFW_PRESS PRESS} or {@link #GLFW_RELEASE RELEASE}. The higher-level action + * {@link #GLFW_REPEAT REPEAT} is only reported to the key callback. + * + *

If the {@link #GLFW_STICKY_KEYS STICKY_KEYS} input mode is enabled, this function returns {@link #GLFW_PRESS PRESS} the first time you call it for a key that was pressed, even if that + * key has already been released.

+ * + *

The key functions deal with physical keys, with key tokens named after their use on the standard US keyboard layout. If you want to input text, use the + * Unicode character callback instead.

+ * + *

The modifier key bit masks are not key tokens and cannot be used with this function.

+ * + *

Do not use this function to implement text input.

+ * + *
Note
+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • {@link #GLFW_KEY_UNKNOWN KEY_UNKNOWN} is not a valid key for this function.
  • + *
+ * + * @param window the desired window + * @param key the desired keyboard key + * + * @return one of {@link #GLFW_PRESS PRESS} or {@link #GLFW_RELEASE RELEASE} + * + * @since version 1.0 + */ + public static int glfwGetKey(@NativeType("GLFWwindow *") long window, int key) { + long __functionAddress = Functions.GetKey; + if (CHECKS) { + check(window); + } + return invokePI(window, key, __functionAddress); + } + + // --- [ glfwGetMouseButton ] --- + + /** + * Returns the last state reported for the specified mouse button to the specified window. The returned state is one of {@link #GLFW_PRESS PRESS} or {@link #GLFW_RELEASE RELEASE}. The + * higher-level action {@link #GLFW_REPEAT REPEAT} is only reported to the mouse button callback. + * + *

If the {@link #GLFW_STICKY_MOUSE_BUTTONS STICKY_MOUSE_BUTTONS} input mode is enabled, this function returns {@link #GLFW_PRESS PRESS} the first time you call it for a mouse button that was pressed, even + * if that mouse button has already been released.

+ * + *

This function must only be called from the main thread.

+ * + * @param window the desired window + * @param button the desired mouse button + * + * @return one of {@link #GLFW_PRESS PRESS} or {@link #GLFW_RELEASE RELEASE} + * + * @since version 1.0 + */ + public static int glfwGetMouseButton(@NativeType("GLFWwindow *") long window, int button) { + long __functionAddress = Functions.GetMouseButton; + if (CHECKS) { + check(window); + } + return invokePI(window, button, __functionAddress); + } + + // --- [ glfwGetCursorPos ] --- + + /** Unsafe version of: {@link #glfwGetCursorPos GetCursorPos} */ + public static void nglfwGetCursorPos(long window, long xpos, long ypos) { + long __functionAddress = Functions.GetCursorPos; + if (CHECKS) { + check(window); + } + invokePPPV(window, xpos, ypos, __functionAddress); + } + + /** + * Returns the position of the cursor, in screen coordinates, relative to the upper-left corner of the content area of the specified window. + * + *

If the cursor is disabled (with {@link #GLFW_CURSOR_DISABLED CURSOR_DISABLED}) then the cursor position is unbounded and limited only by the minimum and maximum values of a + * double.

+ * + *

The coordinates can be converted to their integer equivalents with the {@link Math#floor} function. Casting directly to an integer type works for positive + * coordinates, but fails for negative ones.

+ * + *

Any or all of the position arguments may be {@code NULL}. If an error occurs, all non-{@code NULL} position arguments will be set to zero.

+ * + *

This function must only be called from the main thread.

+ * + * @param window the desired window + * @param xpos where to store the cursor x-coordinate, relative to the left edge of the content area, or {@code NULL} + * @param ypos where to store the cursor y-coordinate, relative to the to top edge of the content area, or {@code NULL}. + * + * @since version 1.0 + */ + public static void glfwGetCursorPos(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("double *") DoubleBuffer xpos, @Nullable @NativeType("double *") DoubleBuffer ypos) { + if (CHECKS) { + checkSafe(xpos, 1); + checkSafe(ypos, 1); + } + nglfwGetCursorPos(window, memAddressSafe(xpos), memAddressSafe(ypos)); + } + + // --- [ glfwSetCursorPos ] --- + + /** + * Sets the position, in screen coordinates, of the cursor relative to the upper-left corner of the content area of the specified window. The window must + * have input focus. If the window does not have input focus when this function is called, it fails silently. + * + *

Do not use this function to implement things like camera controls. GLFW already provides the {@link #GLFW_CURSOR_DISABLED CURSOR_DISABLED} cursor mode that hides the cursor, + * transparently re-centers it and provides unconstrained cursor motion. See {@link #glfwSetInputMode SetInputMode} for more information.

+ * + *

If the cursor mode is {@link #GLFW_CURSOR_DISABLED CURSOR_DISABLED} then the cursor position is unconstrained and limited only by the minimum and maximum values of double.

+ * + *

Notes:

+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • Wayland: This function will only work when the cursor mode is {@link #GLFW_CURSOR_DISABLED CURSOR_DISABLED}, otherwise it will do nothing.
  • + *
+ * + * @param window the desired window + * @param xpos the desired x-coordinate, relative to the left edge of the content area + * @param ypos the desired y-coordinate, relative to the top edge of the content area + * + * @since version 1.0 + */ + public static void glfwSetCursorPos(@NativeType("GLFWwindow *") long window, double xpos, double ypos) { + long __functionAddress = Functions.SetCursorPos; + if (CHECKS) { + check(window); + } + invokePV(window, xpos, ypos, __functionAddress); + } + + // --- [ glfwCreateCursor ] --- + + /** Unsafe version of: {@link #glfwCreateCursor CreateCursor} */ + public static long nglfwCreateCursor(long image, int xhot, int yhot) { + long __functionAddress = Functions.CreateCursor; + if (CHECKS) { + GLFWImage.validate(image); + } + return invokePP(image, xhot, yhot, __functionAddress); + } + + /** + * Creates a new custom cursor image that can be set for a window with {@link #glfwSetCursor SetCursor}. The cursor can be destroyed with {@link #glfwDestroyCursor DestroyCursor}. Any remaining + * cursors are destroyed by {@link #glfwTerminate Terminate}. + * + *

The pixels are 32-bit, little-endian, non-premultiplied RGBA, i.e. eight bits per channel with the red channel first. They are arranged canonically as + * packed sequential rows, starting from the top-left corner.

+ * + *

The cursor hotspot is specified in pixels, relative to the upper-left corner of the cursor image. Like all other coordinate systems in GLFW, the X-axis + * points to the right and the Y-axis points down.

+ * + *
Note
+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • The specified image data is copied before this function returns.
  • + *
+ * + * @param image the desired cursor image + * @param xhot the desired x-coordinate, in pixels, of the cursor hotspot + * @param yhot the desired y-coordinate, in pixels, of the cursor hotspot + * + * @return the handle of the created cursor, or {@code NULL} if an error occurred + * + * @since version 3.1 + */ + @NativeType("GLFWcursor *") + public static long glfwCreateCursor(@NativeType("GLFWimage const *") GLFWImage image, int xhot, int yhot) { + return nglfwCreateCursor(image.address(), xhot, yhot); + } + + // --- [ glfwCreateStandardCursor ] --- + + /** + * Returns a cursor with a standard shape, that can be set for a window with {@link #glfwSetCursor SetCursor}. + * + *

This function must only be called from the main thread.

+ * + * @param shape one of the standard shapes. One of:
{@link #GLFW_ARROW_CURSOR ARROW_CURSOR}{@link #GLFW_IBEAM_CURSOR IBEAM_CURSOR}{@link #GLFW_CROSSHAIR_CURSOR CROSSHAIR_CURSOR}{@link #GLFW_HAND_CURSOR HAND_CURSOR}{@link #GLFW_HRESIZE_CURSOR HRESIZE_CURSOR}{@link #GLFW_VRESIZE_CURSOR VRESIZE_CURSOR}
+ * + * @return a new cursor ready to use or {@code NULL} if an error occurred + * + * @since version 3.1 + */ + @NativeType("GLFWcursor *") + public static long glfwCreateStandardCursor(int shape) { + long __functionAddress = Functions.CreateStandardCursor; + return invokeP(shape, __functionAddress); + } + + // --- [ glfwDestroyCursor ] --- + + /** + * Destroys a cursor previously created with {@link #glfwCreateCursor CreateCursor}. Any remaining cursors will be destroyed by {@link #glfwTerminate Terminate}. + * + *
Note
+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • This function must not be called from a callback.
  • + *
+ * + * @param cursor the cursor object to destroy + * + * @since version 3.1 + */ + public static void glfwDestroyCursor(@NativeType("GLFWcursor *") long cursor) { + long __functionAddress = Functions.DestroyCursor; + if (CHECKS) { + check(cursor); + } + invokePV(cursor, __functionAddress); + } + + // --- [ glfwSetCursor ] --- + + /** + * Sets the cursor image to be used when the cursor is over the content area of the specified window. The set cursor will only be visible when the + * cursor mode of the window is {@link #GLFW_CURSOR_NORMAL CURSOR_NORMAL}. + * + *

On some platforms, the set cursor may not be visible unless the window also has input focus.

+ * + *

This function must only be called from the main thread.

+ * + * @param window the window to set the system cursor for + * @param cursor the cursor to set, or {@code NULL} to switch back to the default arrow cursor + * + * @since version 3.1 + */ + public static void glfwSetCursor(@NativeType("GLFWwindow *") long window, @NativeType("GLFWcursor *") long cursor) { + long __functionAddress = Functions.SetCursor; + if (CHECKS) { + check(window); + } + invokePPV(window, cursor, __functionAddress); + } + + // --- [ glfwSetKeyCallback ] --- + + /** Unsafe version of: {@link #glfwSetKeyCallback SetKeyCallback} */ + public static long nglfwSetKeyCallback(long window, long cbfun) { + long __functionAddress = Functions.SetKeyCallback; + if (CHECKS) { + check(window); + } + return invokePPP(window, cbfun, __functionAddress); + } + + /** + * Sets the key callback of the specified window, which is called when a key is pressed, repeated or released. + * + *

The key functions deal with physical keys, with layout independent key tokens named after their values in the standard US keyboard layout. If you want + * to input text, use {@link #glfwSetCharCallback SetCharCallback} instead.

+ * + *

When a window loses input focus, it will generate synthetic key release events for all pressed keys. You can tell these events from user-generated + * events by the fact that the synthetic ones are generated after the focus loss event has been processed, i.e. after the window focus callback has been + * called.

+ * + *

The scancode of a key is specific to that platform or sometimes even to that machine. Scancodes are intended to allow users to bind keys that don't have + * a GLFW key token. Such keys have {@code key} set to {@link #GLFW_KEY_UNKNOWN KEY_UNKNOWN}, their state is not saved and so it cannot be queried with {@link #glfwGetKey GetKey}.

+ * + *

Sometimes GLFW needs to generate synthetic key events, in which case the scancode may be zero.

+ * + *

This function must only be called from the main thread.

+ * + * @param window the window whose callback to set + * @param cbfun the new callback or {@code NULL} to remove the currently set callback + * + * @return the previously set callback, or {@code NULL} if no callback was set + * + * @since version 1.0 + */ + @Nullable + @NativeType("GLFWkeyfun") + public static GLFWKeyCallback glfwSetKeyCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWkeyfun") GLFWKeyCallbackI cbfun) { + return GLFWKeyCallback.createSafe(nglfwSetKeyCallback(window, memAddressSafe(cbfun))); + } + + // --- [ glfwSetCharCallback ] --- + + /** Unsafe version of: {@link #glfwSetCharCallback SetCharCallback} */ + public static long nglfwSetCharCallback(long window, long cbfun) { + long __functionAddress = Functions.SetCharCallback; + if (CHECKS) { + check(window); + } + return invokePPP(window, cbfun, __functionAddress); + } + + /** + * Sets the character callback of the specified window, which is called when a Unicode character is input. + * + *

The character callback is intended for Unicode text input. As it deals with characters, it is keyboard layout dependent, whereas {@link #glfwSetKeyCallback SetKeyCallback} is + * not. Characters do not map 1:1 to physical keys, as a key may produce zero, one or more characters. If you want to know whether a specific physical key + * was pressed or released, see the key callback instead.

+ * + *

The character callback behaves as system text input normally does and will not be called if modifier keys are held down that would prevent normal text + * input on that platform, for example a Super (Command) key on macOS or Alt key on Windows.

+ * + *

This function must only be called from the main thread.

+ * + * @param window the window whose callback to set + * @param cbfun the new callback or {@code NULL} to remove the currently set callback + * + * @return the previously set callback, or {@code NULL} if no callback was set + * + * @since version 2.4 + */ + @Nullable + @NativeType("GLFWcharfun") + public static GLFWCharCallback glfwSetCharCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWcharfun") GLFWCharCallbackI cbfun) { + return GLFWCharCallback.createSafe(nglfwSetCharCallback(window, memAddressSafe(cbfun))); + } + + // --- [ glfwSetCharModsCallback ] --- + + /** Unsafe version of: {@link #glfwSetCharModsCallback SetCharModsCallback} */ + public static long nglfwSetCharModsCallback(long window, long cbfun) { + long __functionAddress = Functions.SetCharModsCallback; + if (CHECKS) { + check(window); + } + return invokePPP(window, cbfun, __functionAddress); + } + + /** + * Sets the character with modifiers callback of the specified window, which is called when a Unicode character is input regardless of what modifier keys + * are used. + * + *

The character with modifiers callback is intended for implementing custom Unicode character input. For regular Unicode text input, see + * {@link #glfwSetCharCallback SetCharCallback}. Like the character callback, the character with modifiers callback deals with characters and is keyboard layout dependent. + * Characters do not map 1:1 to physical keys, as a key may produce zero, one or more characters. If you want to know whether a specific physical key was + * pressed or released, see {@link #glfwSetKeyCallback SetKeyCallback} instead.

+ * + *

This function must only be called from the main thread.

+ * + *

Deprecated: scheduled for removal in version 4.0.

+ * + * @param window the window whose callback to set + * @param cbfun the new callback or {@code NULL} to remove the currently set callback + * + * @return the previously set callback, or {@code NULL} if no callback was set + * + * @since version 3.1 + */ + @Nullable + @NativeType("GLFWcharmodsfun") + public static GLFWCharModsCallback glfwSetCharModsCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWcharmodsfun") GLFWCharModsCallbackI cbfun) { + return GLFWCharModsCallback.createSafe(nglfwSetCharModsCallback(window, memAddressSafe(cbfun))); + } + + // --- [ glfwSetMouseButtonCallback ] --- + + /** Unsafe version of: {@link #glfwSetMouseButtonCallback SetMouseButtonCallback} */ + public static long nglfwSetMouseButtonCallback(long window, long cbfun) { + long __functionAddress = Functions.SetMouseButtonCallback; + if (CHECKS) { + check(window); + } + return invokePPP(window, cbfun, __functionAddress); + } + + /** + * Sets the mouse button callback of the specified window, which is called when a mouse button is pressed or released. + * + *

When a window loses input focus, it will generate synthetic mouse button release events for all pressed mouse buttons. You can tell these events from + * user-generated events by the fact that the synthetic ones are generated after the focus loss event has been processed, i.e. after the window focus + * callback has been called.

+ * + *

This function must only be called from the main thread.

+ * + * @param window the window whose callback to set + * @param cbfun the new callback or {@code NULL} to remove the currently set callback + * + * @return the previously set callback, or {@code NULL} if no callback was set + * + * @since version 1.0 + */ + @Nullable + @NativeType("GLFWmousebuttonfun") + public static GLFWMouseButtonCallback glfwSetMouseButtonCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWmousebuttonfun") GLFWMouseButtonCallbackI cbfun) { + return GLFWMouseButtonCallback.createSafe(nglfwSetMouseButtonCallback(window, memAddressSafe(cbfun))); + } + + // --- [ glfwSetCursorPosCallback ] --- + + /** Unsafe version of: {@link #glfwSetCursorPosCallback SetCursorPosCallback} */ + public static long nglfwSetCursorPosCallback(long window, long cbfun) { + long __functionAddress = Functions.SetCursorPosCallback; + if (CHECKS) { + check(window); + } + return invokePPP(window, cbfun, __functionAddress); + } + + /** + * Sets the cursor position callback of the specified window, which is called when the cursor is moved. The callback is provided with the position, in + * screen coordinates, relative to the upper-left corner of the content area of the window. + * + *

This function must only be called from the main thread.

+ * + * @param window the window whose callback to set + * @param cbfun the new callback or {@code NULL} to remove the currently set callback + * + * @return the previously set callback, or {@code NULL} if no callback was set + * + * @since version 1.0 + */ + @Nullable + @NativeType("GLFWcursorposfun") + public static GLFWCursorPosCallback glfwSetCursorPosCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWcursorposfun") GLFWCursorPosCallbackI cbfun) { + return GLFWCursorPosCallback.createSafe(nglfwSetCursorPosCallback(window, memAddressSafe(cbfun))); + } + + // --- [ glfwSetCursorEnterCallback ] --- + + /** Unsafe version of: {@link #glfwSetCursorEnterCallback SetCursorEnterCallback} */ + public static long nglfwSetCursorEnterCallback(long window, long cbfun) { + long __functionAddress = Functions.SetCursorEnterCallback; + if (CHECKS) { + check(window); + } + return invokePPP(window, cbfun, __functionAddress); + } + + /** + * Sets the cursor boundary crossing callback of the specified window, which is called when the cursor enters or leaves the content area of the window. + * + *

This function must only be called from the main thread.

+ * + * @param window the window whose callback to set + * @param cbfun the new callback or {@code NULL} to remove the currently set callback + * + * @return the previously set callback, or {@code NULL} if no callback was set + * + * @since version 3.0 + */ + @Nullable + @NativeType("GLFWcursorenterfun") + public static GLFWCursorEnterCallback glfwSetCursorEnterCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWcursorenterfun") GLFWCursorEnterCallbackI cbfun) { + return GLFWCursorEnterCallback.createSafe(nglfwSetCursorEnterCallback(window, memAddressSafe(cbfun))); + } + + // --- [ glfwSetScrollCallback ] --- + + /** Unsafe version of: {@link #glfwSetScrollCallback SetScrollCallback} */ + public static long nglfwSetScrollCallback(long window, long cbfun) { + long __functionAddress = Functions.SetScrollCallback; + if (CHECKS) { + check(window); + } + return invokePPP(window, cbfun, __functionAddress); + } + + /** + * Sets the scroll callback of the specified window, which is called when a scrolling device is used. + * + *

The scroll callback receives all scrolling input, like that from a mouse wheel or a touchpad scrolling area.

+ * + *

This function must only be called from the main thread.

+ * + * @param window the window whose callback to set + * @param cbfun the new callback or {@code NULL} to remove the currently set callback + * + * @return the previously set callback, or {@code NULL} if no callback was set + * + * @since version 2.1 + */ + @Nullable + @NativeType("GLFWscrollfun") + public static GLFWScrollCallback glfwSetScrollCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWscrollfun") GLFWScrollCallbackI cbfun) { + return GLFWScrollCallback.createSafe(nglfwSetScrollCallback(window, memAddressSafe(cbfun))); + } + + // --- [ glfwSetDropCallback ] --- + + /** Unsafe version of: {@link #glfwSetDropCallback SetDropCallback} */ + public static long nglfwSetDropCallback(long window, long cbfun) { + long __functionAddress = Functions.SetDropCallback; + if (CHECKS) { + check(window); + } + return invokePPP(window, cbfun, __functionAddress); + } + + /** + * Sets the file drop callback of the specified window, which is called when one or more dragged files are dropped on the window. + * + *

Because the path array and its strings may have been generated specifically for that event, they are not guaranteed to be valid after the callback has + * returned. If you wish to use them after the callback returns, you need to make a deep copy.

+ * + *

Notes:

+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • Wayland: File drop is currently unimplemented.
  • + *
+ * + * @param window the window whose callback to set + * @param cbfun the new callback or {@code NULL} to remove the currently set callback + * + * @return the previously set callback, or {@code NULL} if no callback was set + * + * @since version 3.1 + */ + @Nullable + @NativeType("GLFWdropfun") + public static GLFWDropCallback glfwSetDropCallback(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("GLFWdropfun") GLFWDropCallbackI cbfun) { + return GLFWDropCallback.createSafe(nglfwSetDropCallback(window, memAddressSafe(cbfun))); + } + + // --- [ glfwJoystickPresent ] --- + + /** + * Returns whether the specified joystick is present. + * + *

This function must only be called from the main thread.

+ * + * @param jid joystick to query + * + * @return {@link #GLFW_TRUE TRUE} if the joystick is present, or {@link #GLFW_FALSE FALSE} otherwise + * + * @since version 3.0 + */ + @NativeType("int") + public static boolean glfwJoystickPresent(int jid) { + return false; + } + + /** + * Returns the values of all axes of the specified joystick. Each element in the array is a value between -1.0 and 1.0. + * + *

If the specified joystick is not present this function will return {@code NULL} but will not generate an error. This can be used instead of first calling + * {@link #glfwJoystickPresent JoystickPresent}.

+ * + *

The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected, this + * function is called again for that joystick or the library is terminated.

+ * + *

This function must only be called from the main thread.

+ * + * @param jid the joystick to query + * + * @return an array of axis values, or {@code NULL} if the joystick is not present + * + * @since version 2.2 + */ + @Nullable + @NativeType("float const *") + public static FloatBuffer glfwGetJoystickAxes(int jid) { + return null; + } + + /** + * Returns the state of all buttons of the specified joystick. Each element in the array is either {@link #GLFW_PRESS PRESS} or {@link #GLFW_RELEASE RELEASE}. + * + *

For backward compatibility with earlier versions that did not have {@link #glfwGetJoystickHats GetJoystickHats}, the button array also includes all hats, each represented as four + * buttons. The hats are in the same order as returned by {@link #glfwGetJoystickHats GetJoystickHats} and are in the order up, right, down and left. To disable these extra + * buttons, set the {@link #GLFW_JOYSTICK_HAT_BUTTONS JOYSTICK_HAT_BUTTONS} init hint before initialization.

+ * + *

If the specified joystick is not present this function will return {@code NULL} but will not generate an error. This can be used instead of first calling + * {@link #glfwJoystickPresent JoystickPresent}.

+ * + *

The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected, this + * function is called again for that joystick or the library is terminated.

+ * + *

This function must only be called from the main thread.

+ * + * @param jid the joystick to query + * + * @return an array of button states, or {@code NULL} if the joystick is not present + * + * @since version 2.2 + */ + @Nullable + @NativeType("unsigned char const *") + public static ByteBuffer glfwGetJoystickButtons(int jid) { + return null; + } + + /** + * Returns the state of all hats of the specified joystick. + * + *

This function returns the state of all hats of the specified joystick. Each element in the array is one of the following values:

+ * + *

+     * Name                | Value
+     * ------------------- | ------------------------------
+     * GLFW_HAT_CENTERED   | 0
+     * GLFW_HAT_UP         | 1
+     * GLFW_HAT_RIGHT      | 2
+     * GLFW_HAT_DOWN       | 4
+     * GLFW_HAT_LEFT       | 8
+     * GLFW_HAT_RIGHT_UP   | GLFW_HAT_RIGHT | GLFW_HAT_UP
+     * GLFW_HAT_RIGHT_DOWN | GLFW_HAT_RIGHT | GLFW_HAT_DOWN
+     * GLFW_HAT_LEFT_UP    | GLFW_HAT_LEFT  | GLFW_HAT_UP
+     * GLFW_HAT_LEFT_DOWN  | GLFW_HAT_LEFT  | GLFW_HAT_DOWN
+ * + *

The diagonal directions are bitwise combinations of the primary (up, right, down and left) directions and you can test for these individually by ANDing + * it with the corresponding direction.

+ * + *

+     * if (hats[2] & GLFW_HAT_RIGHT)
+     * {
+     *     // State of hat 2 could be right-up, right or right-down
+     * }
+ * + *

If the specified joystick is not present this function will return {@code NULL} but will not generate an error. This can be used instead of first calling + * {@link #glfwJoystickPresent JoystickPresent}.

+ * + *
Note
+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • The returned array is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected, this + * function is called again for that joystick or the library is terminated.
  • + *
+ * + * @param jid the joystick to query + * + * @return an array of hat states, or {@code NULL} if the joystick is not present or an error occurred + * + * @since version 3.3 + */ + @Nullable + @NativeType("unsigned char const *") + public static ByteBuffer glfwGetJoystickHats(int jid) { + return null; + } + + /** + * Returns the name, encoded as UTF-8, of the specified joystick. + * + *

If the specified joystick is not present this function will return {@code NULL} but will not generate an error. This can be used instead of first calling + * {@link #glfwJoystickPresent JoystickPresent}.

+ * + *

The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected, this + * function is called again for that joystick or the library is terminated.

+ * + *

This function must only be called from the main thread.

+ * + * @param jid the joystick to query + * + * @return the UTF-8 encoded name of the joystick, or {@code NULL} if the joystick is not present + * + * @since version 3.0 + */ + @Nullable + @NativeType("char const *") + public static String glfwGetJoystickName(int jid) { + return null; + } + + /** + * Returns the SDL compatible GUID, as a UTF-8 encoded hexadecimal string, of the specified joystick. + * + *

The GUID is what connects a joystick to a gamepad mapping. A connected joystick will always have a GUID even if there is no gamepad mapping assigned to + * it.

+ * + *

The GUID uses the format introduced in SDL 2.0.5. This GUID tries to uniquely identify the make and model of a joystick but does not identify a + * specific unit, e.g. all wired Xbox 360 controllers will have the same GUID on that platform. The GUID for a unit may vary between platforms depending + * on what hardware information the platform specific APIs provide.

+ * + *

If the specified joystick is not present this function will return {@code NULL} but will not generate an error. This can be used instead of first calling + * {@link #glfwJoystickPresent JoystickPresent}.

+ * + *

The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected or the + * library is terminated.

+ * + *

This function must only be called from the main thread.

+ * + * @param jid the joystick to query + * + * @return the UTF-8 encoded GUID of the joystick, or {@code NULL} if the joystick is not present or an error occurred + * + * @since version 3.3 + */ + @Nullable + @NativeType("char const *") + public static String glfwGetJoystickGUID(int jid) { + return null; + } + + // --- [ glfwSetJoystickUserPointer ] --- + + /** + * Sets the user pointer of the specified joystick. + * + *

This function sets the user-defined pointer of the specified joystick. The current value is retained until the joystick is disconnected. The initial + * value is {@code NULL}.

+ * + *

This function may be called from the joystick callback, even for a joystick that is being disconnected.

+ * + *

This function may be called from any thread. Access is not synchronized.

+ * + * @param jid the joystick whose pointer to set + * @param pointer the new value + * + * @since version 3.3 + */ + public static void glfwSetJoystickUserPointer(int jid, @NativeType("void *") long pointer) { + + } + + // --- [ glfwGetJoystickUserPointer ] --- + + /** + * Returns the user pointer of the specified joystick. + * + *

This function returns the current value of the user-defined pointer of the specified joystick. The initial value is {@code NULL}.

+ * + *

This function may be called from the joystick callback, even for a joystick that is being disconnected.

+ * + *

This function may be called from any thread. Access is not synchronized.

+ * + * @param jid the joystick whose pointer to set + * + * @since version 3.3 + */ + @NativeType("void *") + public static long glfwGetJoystickUserPointer(int jid) { + return 0; + } + + // --- [ glfwJoystickIsGamepad ] --- + + /** + * Returns whether the specified joystick is both present and has a gamepad mapping. + * + *

If the specified joystick is present but does not have a gamepad mapping this function will return {@code false} but will not generate an error. Call + * {@link #glfwJoystickPresent JoystickPresent} to check if a joystick is present regardless of whether it has a mapping.

+ * + *

This function must only be called from the main thread.

+ * + * @param jid the joystick id to query + * + * @return {@code true} if a joystick is both present and has a gamepad mapping or {@code false} otherwise + * + * @since version 3.3 + */ + @NativeType("int") + public static boolean glfwJoystickIsGamepad(int jid) { + return false; + } + + /** + * Sets the joystick configuration callback, or removes the currently set callback. This is called when a joystick is connected to or disconnected from + * the system. + * + *

For joystick connection and disconnection events to be delivered on all platforms, you need to call one of the event processing functions. Joystick + * disconnection may also be detected and the callback called by joystick functions. The function will then return whatever it returns if the joystick is + * not present.

+ * + *

This function must only be called from the main thread.

+ * + * @param cbfun the new callback, or {@code NULL} to remove the currently set callback + * + * @return the previously set callback, or {@code NULL} if no callback was set or the library had not been initialized + * + * @since version 3.2 + */ + @Nullable + @NativeType("GLFWjoystickfun") + public static GLFWJoystickCallback glfwSetJoystickCallback(@Nullable @NativeType("GLFWjoystickfun") GLFWJoystickCallbackI cbfun) { + return null; + } + + + /** + * Adds the specified SDL_GameControllerDB gamepad mappings. + * + *

This function parses the specified ASCII encoded string and updates the internal list with any gamepad mappings it finds. This string may contain either + * a single gamepad mapping or many mappings separated by newlines. The parser supports the full format of the {@code gamecontrollerdb.txt} source file + * including empty lines and comments.

+ * + *

See gamepad_mapping for a description of the format.

+ * + *

If there is already a gamepad mapping for a given GUID in the internal list, it will be replaced by the one passed to this function. If the library is + * terminated and re-initialized the internal list will revert to the built-in default.

+ * + *

This function must only be called from the main thread.

+ * + * @param string the string containing the gamepad mappings + * + * @return {@code true}, or {@code false} if an error occurred + * + * @since version 3.3 + */ + @NativeType("int") + public static boolean glfwUpdateGamepadMappings(@NativeType("char const *") ByteBuffer string) { + return false; + } + + /** + * Returns the human-readable name of the gamepad from the gamepad mapping assigned to the specified joystick. + * + *

If the specified joystick is not present or does not have a gamepad mapping this function will return {@code NULL} but will not generate an error. Call + * {@link #glfwJoystickIsGamepad JoystickIsGamepad} to check if a joystick is present regardless of whether it has a mapping.

+ * + *

The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the specified joystick is disconnected, the + * gamepad mappings are updated or the library is terminated.

+ * + *

This function must only be called from the main thread.

+ * + * @param jid the joystick to query + * + * @return the UTF-8 encoded name of the gamepad, or {@code NULL} if the joystick is not present, does not have a mapping or an error occurred + * + * @since version 3.3 + */ + @Nullable + @NativeType("char const *") + public static String glfwGetGamepadName(int jid) { + return null; + } + + /** + * Retrieves the state of the specified joystick remapped to an Xbox-like gamepad. + * + *

If the specified joystick is not present or does not have a gamepad mapping this function will return {@link #GLFW_FALSE FALSE} but will not generate an error. Call + * {@link #glfwJoystickPresent JoystickPresent} to check whether it is present regardless of whether it has a mapping.

+ * + *

The Guide button may not be available for input as it is often hooked by the system or the Steam client.

+ * + *

Not all devices have all the buttons or axes provided by {@link GLFWGamepadState}. Unavailable buttons and axes will always report {@link #GLFW_RELEASE RELEASE} and 0.0 + * respectively.

+ * + *

This function must only be called from the main thread.

+ * + * @param jid the joystick to query + * @param state the gamepad input state of the joystick + * + * @return {@code true} if successful, or {@code false} if no joystick is connected, it has no gamepad mapping or an error occurred + * + * @since version 3.3 + */ + @NativeType("int") + public static boolean glfwGetGamepadState(int jid, @NativeType("GLFWgamepadstate *") GLFWGamepadState state) { + return false; + } + + // --- [ glfwSetClipboardString ] --- + + /** Unsafe version of: {@link #glfwSetClipboardString SetClipboardString} */ + public static void nglfwSetClipboardString(long window, long string) { + long __functionAddress = Functions.SetClipboardString; + invokePPV(window, string, __functionAddress); + } + + /** + * Sets the system clipboard to the specified, UTF-8 encoded string. + * + *

The specified string is copied before this function returns.

+ * + *

Notes:

+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
+ * + * @param window deprecated, any valid window or {@code NULL}. + * @param string a UTF-8 encoded string + * + * @since version 3.0 + */ + public static void glfwSetClipboardString(@NativeType("GLFWwindow *") long window, @NativeType("char const *") ByteBuffer string) { + if (CHECKS) { + checkNT1(string); + } + nglfwSetClipboardString(window, memAddress(string)); + } + + /** + * Sets the system clipboard to the specified, UTF-8 encoded string. + * + *

The specified string is copied before this function returns.

+ * + *

Notes:

+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
+ * + * @param window deprecated, any valid window or {@code NULL}. + * @param string a UTF-8 encoded string + * + * @since version 3.0 + */ + public static void glfwSetClipboardString(@NativeType("GLFWwindow *") long window, @NativeType("char const *") CharSequence string) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(string, true); + long stringEncoded = stack.getPointerAddress(); + nglfwSetClipboardString(window, stringEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glfwGetClipboardString ] --- + + /** Unsafe version of: {@link #glfwGetClipboardString GetClipboardString} */ + public static long nglfwGetClipboardString(long window) { + long __functionAddress = Functions.GetClipboardString; + return invokePP(window, __functionAddress); + } + + /** + * Returns the contents of the system clipboard, if it contains or is convertible to a UTF-8 encoded string. If the clipboard is empty or if its contents + * cannot be converted, {@code NULL} is returned and a {@link #GLFW_FORMAT_UNAVAILABLE FORMAT_UNAVAILABLE} error is generated. + * + *

The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the next call to {@link #glfwGetClipboardString GetClipboardString} or + * {@link #glfwSetClipboardString SetClipboardString}, or until the library is terminated.

+ * + *
Note
+ * + *
    + *
  • This function must only be called from the main thread.
  • + *
  • The returned string is allocated and freed by GLFW. You should not free it yourself.
  • + *
  • The returned string is valid only until the next call to {@link #glfwGetClipboardString GetClipboardString} or {@link #glfwSetClipboardString SetClipboardString}.
  • + *
+ * + * @param window deprecated, any valid window or {@code NULL}. + * + * @return the contents of the clipboard as a UTF-8 encoded string, or {@code NULL} if an error occurred + * + * @since version 3.0 + */ + @Nullable + @NativeType("char const *") + public static String glfwGetClipboardString(@NativeType("GLFWwindow *") long window) { + long __result = nglfwGetClipboardString(window); + return memUTF8Safe(__result); + } + + // --- [ glfwGetTime ] --- + + /** + * Returns the value of the GLFW timer. Unless the timer has been set using {@link #glfwSetTime SetTime}, the timer measures time elapsed since GLFW was initialized. + * + *

The resolution of the timer is system dependent, but is usually on the order of a few micro- or nanoseconds. It uses the highest-resolution monotonic + * time source on each supported platform.

+ * + *

This function may be called from any thread. Reading and writing of the internal timer offset is not atomic, so it needs to be externally synchronized + * with calls to {@link #glfwSetTime SetTime}.

+ * + * @return the current value, in seconds, or zero if an error occurred + * + * @since version 1.0 + */ + public static double glfwGetTime() { + long __functionAddress = Functions.GetTime; + return invokeD(__functionAddress); + } + + // --- [ glfwSetTime ] --- + + /** + * Sets the value of the GLFW timer. It then continues to count up from that value. The value must be a positive finite number less than or equal to + * 18446744073.0, which is approximately 584.5 years. + * + *

The upper limit of the timer is calculated as floor((264 - 1) / 109) and is due to implementations storing nanoseconds + * in 64 bits. The limit may be increased in the future.

+ * + *

This function may be called from any thread. Reading and writing of the internal timer offset is not atomic, so it needs to be externally synchronized + * with calls to {@link #glfwGetTime GetTime}.

+ * + * @param time the new value, in seconds + * + * @since version 2.2 + */ + public static void glfwSetTime(double time) { + long __functionAddress = Functions.SetTime; + invokeV(time, __functionAddress); + } + + // --- [ glfwGetTimerValue ] --- + + /** + * Returns the current value of the raw timer. + * + *

This function returns the current value of the raw timer, measured in {@code 1 / frequency} seconds. To get the frequency, call {@link #glfwGetTimerFrequency GetTimerFrequency}.

+ * + *

This function may be called from any thread.

+ * + * @return the value of the timer, or zero if an error occurred + * + * @since version 3.2 + */ + @NativeType("uint64_t") + public static long glfwGetTimerValue() { + long __functionAddress = Functions.GetTimerValue; + return invokeJ(__functionAddress); + } + + // --- [ glfwGetTimerFrequency ] --- + + /** + * Returns the frequency, in Hz, of the raw timer. + * + *

This function may be called from any thread.

+ * + * @return the frequency of the timer, in Hz, or zero if an error occurred + * + * @since version 3.2 + */ + @NativeType("uint64_t") + public static long glfwGetTimerFrequency() { + long __functionAddress = Functions.GetTimerFrequency; + return invokeJ(__functionAddress); + } + + // --- [ glfwMakeContextCurrent ] --- + + /** + * Makes the OpenGL or OpenGL ES context of the specified window current on the calling thread. A context must only be made current on a single thread at + * a time and each thread can have only a single current context at a time. + * + *

When moving a context between threads, you must make it non-current on the old thread before making it current on the new one.

+ * + *

By default, making a context non-current implicitly forces a pipeline flush. On machines that support + * GL_KHR_context_flush_control, you can control whether + * a context performs this flush by setting the {@link #GLFW_CONTEXT_RELEASE_BEHAVIOR CONTEXT_RELEASE_BEHAVIOR} + * window hint.

+ * + *

The specified window must have an OpenGL or OpenGL ES context. Specifying a window without a context will generate a {@link #GLFW_NO_WINDOW_CONTEXT NO_WINDOW_CONTEXT} error.

+ * + *

This function may be called from any thread.

+ * + * @param window the window whose context to make current, or {@code NULL} to detach the current context + * + * @since version 3.0 + */ + public static void glfwMakeContextCurrent(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.MakeContextCurrent; + invokePV(window, __functionAddress); + } + + // --- [ glfwGetCurrentContext ] --- + + /** + * Returns the window whose OpenGL or OpenGL ES context is current on the calling thread. + * + *

This function may be called from any thread.

+ * + * @return the window whose context is current, or {@code NULL} if no window's context is current + * + * @since version 3.0 + */ + @NativeType("GLFWwindow *") + public static long glfwGetCurrentContext() { + long __functionAddress = Functions.GetCurrentContext; + return invokeP(__functionAddress); + } + + // --- [ glfwSwapBuffers ] --- + + /** + * Swaps the front and back buffers of the specified window when rendering with OpenGL or OpenGL ES. If the swap interval is greater than zero, the GPU + * driver waits the specified number of screen updates before swapping the buffers. + * + *

The specified window must have an OpenGL or OpenGL ES context. Specifying a window without a context will generate a {@link #GLFW_NO_WINDOW_CONTEXT NO_WINDOW_CONTEXT} error.

+ * + *

This function does not apply to Vulkan. If you are rendering with Vulkan, {@code vkQueuePresentKHR} instead.

+ * + *

EGL: The context of the specified window must be current on the calling thread.

+ * + *

This function may be called from any thread.

+ * + * @param window the window whose buffers to swap + * + * @since version 1.0 + */ + public static void glfwSwapBuffers(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.SwapBuffers; + if (CHECKS) { + check(window); + } + invokePV(window, __functionAddress); + } + + // --- [ glfwSwapInterval ] --- + + /** + * Sets the swap interval for the current OpenGL or OpenGL ES context, i.e. the number of screen updates to wait from the time {@link #glfwSwapBuffers SwapBuffers} was called + * before swapping the buffers and returning. This is sometimes called vertical synchronization, vertical retrace synchronization or just + * vsync. + * + *

A context that supports either of the + * WGL_EXT_swap_control_tear and + * GLX_EXT_swap_control_tear extensions also accepts + * negative swap intervals, which allows the driver to swap immediately even if a frame arrives a little bit late. You can check for these + * extensions with {@link #glfwExtensionSupported ExtensionSupported}. For more information about swap tearing, see the extension specifications.

+ * + *

A context must be current on the calling thread. Calling this function without a current context will cause a {@link #GLFW_NO_CURRENT_CONTEXT NO_CURRENT_CONTEXT} error.

+ * + *

This function does not apply to Vulkan. If you are rendering with Vulkan, see the present mode of your swapchain instead.

+ * + *
Note
+ * + *
    + *
  • This function may be called from any thread.
  • + *
  • This function is not called during window creation, leaving the swap interval set to whatever is the default on that platform. This is done because + * some swap interval extensions used by GLFW do not allow the swap interval to be reset to zero once it has been set to a non-zero value.
  • + *
  • Some GPU drivers do not honor the requested swap interval, either because of a user setting that overrides the application's request or due to bugs + * in the driver.
  • + *
+ * + * @param interval the minimum number of screen updates to wait for until the buffers are swapped by {@link #glfwSwapBuffers SwapBuffers} + * + * @since version 1.0 + */ + public static void glfwSwapInterval(int interval) { + long __functionAddress = Functions.SwapInterval; + invokeV(interval, __functionAddress); + } + + // --- [ glfwExtensionSupported ] --- + + /** Unsafe version of: {@link #glfwExtensionSupported ExtensionSupported} */ + public static int nglfwExtensionSupported(long extension) { + long __functionAddress = Functions.ExtensionSupported; + return invokePI(extension, __functionAddress); + } + + /** + * Returns whether the specified API extension is supported by the current + * OpenGL or OpenGL ES context. It searches both for client API extension and context creation API extensions. + * + *

A context must be current on the calling thread. Calling this function without a current context will cause a {@link #GLFW_NO_CURRENT_CONTEXT NO_CURRENT_CONTEXT} error.

+ * + *

As this functions retrieves and searches one or more extension strings each call, it is recommended that you cache its results if it is going to be used + * frequently. The extension strings will not change during the lifetime of a context, so there is no danger in doing this.

+ * + *

This function does not apply to Vulkan. If you are using Vulkan, see {@code glfwGetRequiredInstanceExtensions}, + * {@code vkEnumerateInstanceExtensionProperties} and {@code vkEnumerateDeviceExtensionProperties} instead.

+ * + *

This function may be called from any thread.

+ * + * @param extension the ASCII encoded name of the extension + * + * @return {@link #GLFW_TRUE TRUE} if the extension is available, or {@link #GLFW_FALSE FALSE} otherwise + * + * @since version 1.0 + */ + @NativeType("int") + public static boolean glfwExtensionSupported(@NativeType("char const *") ByteBuffer extension) { + if (CHECKS) { + checkNT1(extension); + } + return nglfwExtensionSupported(memAddress(extension)) != 0; + } + + /** + * Returns whether the specified API extension is supported by the current + * OpenGL or OpenGL ES context. It searches both for client API extension and context creation API extensions. + * + *

A context must be current on the calling thread. Calling this function without a current context will cause a {@link #GLFW_NO_CURRENT_CONTEXT NO_CURRENT_CONTEXT} error.

+ * + *

As this functions retrieves and searches one or more extension strings each call, it is recommended that you cache its results if it is going to be used + * frequently. The extension strings will not change during the lifetime of a context, so there is no danger in doing this.

+ * + *

This function does not apply to Vulkan. If you are using Vulkan, see {@code glfwGetRequiredInstanceExtensions}, + * {@code vkEnumerateInstanceExtensionProperties} and {@code vkEnumerateDeviceExtensionProperties} instead.

+ * + *

This function may be called from any thread.

+ * + * @param extension the ASCII encoded name of the extension + * + * @return {@link #GLFW_TRUE TRUE} if the extension is available, or {@link #GLFW_FALSE FALSE} otherwise + * + * @since version 1.0 + */ + @NativeType("int") + public static boolean glfwExtensionSupported(@NativeType("char const *") CharSequence extension) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(extension, true); + long extensionEncoded = stack.getPointerAddress(); + return nglfwExtensionSupported(extensionEncoded) != 0; + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glfwGetProcAddress ] --- + + /** Unsafe version of: {@link #glfwGetProcAddress GetProcAddress} */ + public static long nglfwGetProcAddress(long procname) { + long __functionAddress = Functions.GetProcAddress; + return invokePP(procname, __functionAddress); + } + + /** + * Returns the address of the specified OpenGL or OpenGL ES core or extension function, if it is supported by the current context. + * + *

A context must be current on the calling thread. Calling this function without a current context will cause a {@link #GLFW_NO_CURRENT_CONTEXT NO_CURRENT_CONTEXT} error.

+ * + *

This function does not apply to Vulkan. If you are rendering with Vulkan, {@code glfwGetInstanceProcAddress}, {@code vkGetInstanceProcAddr} and + * {@code vkGetDeviceProcAddr} instead.

+ * + *
Note
+ * + *
    + *
  • The address of a given function is not guaranteed to be the same between contexts.
  • + *
  • This function may return a non-{@code NULL} address despite the associated version or extension not being available. Always check the context version or + * extension string first.
  • + *
  • The returned function pointer is valid until the context is destroyed or the library is terminated.
  • + *
  • This function may be called from any thread.
  • + *
+ * + * @param procname the ASCII encoded name of the function + * + * @return the address of the function, or {@code NULL} if an error occurred + * + * @since version 1.0 + */ + @NativeType("GLFWglproc") + public static long glfwGetProcAddress(@NativeType("char const *") ByteBuffer procname) { + if (CHECKS) { + checkNT1(procname); + } + return nglfwGetProcAddress(memAddress(procname)); + } + + /** + * Returns the address of the specified OpenGL or OpenGL ES core or extension function, if it is supported by the current context. + * + *

A context must be current on the calling thread. Calling this function without a current context will cause a {@link #GLFW_NO_CURRENT_CONTEXT NO_CURRENT_CONTEXT} error.

+ * + *

This function does not apply to Vulkan. If you are rendering with Vulkan, {@code glfwGetInstanceProcAddress}, {@code vkGetInstanceProcAddr} and + * {@code vkGetDeviceProcAddr} instead.

+ * + *
Note
+ * + *
    + *
  • The address of a given function is not guaranteed to be the same between contexts.
  • + *
  • This function may return a non-{@code NULL} address despite the associated version or extension not being available. Always check the context version or + * extension string first.
  • + *
  • The returned function pointer is valid until the context is destroyed or the library is terminated.
  • + *
  • This function may be called from any thread.
  • + *
+ * + * @param procname the ASCII encoded name of the function + * + * @return the address of the function, or {@code NULL} if an error occurred + * + * @since version 1.0 + */ + @NativeType("GLFWglproc") + public static long glfwGetProcAddress(@NativeType("char const *") CharSequence procname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(procname, true); + long procnameEncoded = stack.getPointerAddress(); + return nglfwGetProcAddress(procnameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #glfwGetVersion GetVersion} */ + public static void glfwGetVersion(@Nullable @NativeType("int *") int[] major, @Nullable @NativeType("int *") int[] minor, @Nullable @NativeType("int *") int[] rev) { + long __functionAddress = Functions.GetVersion; + if (CHECKS) { + checkSafe(major, 1); + checkSafe(minor, 1); + checkSafe(rev, 1); + } + invokePPPV(major, minor, rev, __functionAddress); + } + + /** Array version of: {@link #glfwGetMonitorPos GetMonitorPos} */ + public static void glfwGetMonitorPos(@NativeType("GLFWmonitor *") long monitor, @Nullable @NativeType("int *") int[] xpos, @Nullable @NativeType("int *") int[] ypos) { + long __functionAddress = Functions.GetMonitorPos; + if (CHECKS) { + check(monitor); + checkSafe(xpos, 1); + checkSafe(ypos, 1); + } + invokePPPV(monitor, xpos, ypos, __functionAddress); + } + + /** Array version of: {@link #glfwGetMonitorWorkarea GetMonitorWorkarea} */ + public static void glfwGetMonitorWorkarea(@NativeType("GLFWmonitor *") long monitor, @Nullable @NativeType("int *") int[] xpos, @Nullable @NativeType("int *") int[] ypos, @Nullable @NativeType("int *") int[] width, @Nullable @NativeType("int *") int[] height) { + long __functionAddress = Functions.GetMonitorWorkarea; + if (CHECKS) { + check(monitor); + checkSafe(xpos, 1); + checkSafe(ypos, 1); + checkSafe(width, 1); + checkSafe(height, 1); + } + invokePPPPPV(monitor, xpos, ypos, width, height, __functionAddress); + } + + /** Array version of: {@link #glfwGetMonitorPhysicalSize GetMonitorPhysicalSize} */ + public static void glfwGetMonitorPhysicalSize(@NativeType("GLFWmonitor *") long monitor, @Nullable @NativeType("int *") int[] widthMM, @Nullable @NativeType("int *") int[] heightMM) { + long __functionAddress = Functions.GetMonitorPhysicalSize; + if (CHECKS) { + check(monitor); + checkSafe(widthMM, 1); + checkSafe(heightMM, 1); + } + invokePPPV(monitor, widthMM, heightMM, __functionAddress); + } + + /** Array version of: {@link #glfwGetMonitorContentScale GetMonitorContentScale} */ + public static void glfwGetMonitorContentScale(@NativeType("GLFWmonitor *") long monitor, @Nullable @NativeType("float *") float[] xscale, @Nullable @NativeType("float *") float[] yscale) { + long __functionAddress = Functions.GetMonitorContentScale; + if (CHECKS) { + check(monitor); + checkSafe(xscale, 1); + checkSafe(yscale, 1); + } + invokePPPV(monitor, xscale, yscale, __functionAddress); + } + + /** Array version of: {@link #glfwGetWindowPos GetWindowPos} */ + public static void glfwGetWindowPos(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("int *") int[] xpos, @Nullable @NativeType("int *") int[] ypos) { + long __functionAddress = Functions.GetWindowPos; + if (CHECKS) { + check(window); + checkSafe(xpos, 1); + checkSafe(ypos, 1); + } + invokePPPV(window, xpos, ypos, __functionAddress); + } + + /** Array version of: {@link #glfwGetWindowSize GetWindowSize} */ + public static void glfwGetWindowSize(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("int *") int[] width, @Nullable @NativeType("int *") int[] height) { + long __functionAddress = Functions.GetWindowSize; + if (CHECKS) { + check(window); + checkSafe(width, 1); + checkSafe(height, 1); + } + invokePPPV(window, width, height, __functionAddress); + } + + /** Array version of: {@link #glfwGetFramebufferSize GetFramebufferSize} */ + public static void glfwGetFramebufferSize(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("int *") int[] width, @Nullable @NativeType("int *") int[] height) { + long __functionAddress = Functions.GetFramebufferSize; + if (CHECKS) { + check(window); + checkSafe(width, 1); + checkSafe(height, 1); + } + invokePPPV(window, width, height, __functionAddress); + } + + /** Array version of: {@link #glfwGetWindowFrameSize GetWindowFrameSize} */ + public static void glfwGetWindowFrameSize(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("int *") int[] left, @Nullable @NativeType("int *") int[] top, @Nullable @NativeType("int *") int[] right, @Nullable @NativeType("int *") int[] bottom) { + long __functionAddress = Functions.GetWindowFrameSize; + if (CHECKS) { + check(window); + checkSafe(left, 1); + checkSafe(top, 1); + checkSafe(right, 1); + checkSafe(bottom, 1); + } + invokePPPPPV(window, left, top, right, bottom, __functionAddress); + } + + /** Array version of: {@link #glfwGetWindowContentScale GetWindowContentScale} */ + public static void glfwGetWindowContentScale(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("float *") float[] xscale, @Nullable @NativeType("float *") float[] yscale) { + long __functionAddress = Functions.GetWindowContentScale; + if (CHECKS) { + check(window); + checkSafe(xscale, 1); + checkSafe(yscale, 1); + } + invokePPPV(window, xscale, yscale, __functionAddress); + } + + /** Array version of: {@link #glfwGetCursorPos GetCursorPos} */ + public static void glfwGetCursorPos(@NativeType("GLFWwindow *") long window, @Nullable @NativeType("double *") double[] xpos, @Nullable @NativeType("double *") double[] ypos) { + long __functionAddress = Functions.GetCursorPos; + if (CHECKS) { + check(window); + checkSafe(xpos, 1); + checkSafe(ypos, 1); + } + invokePPPV(window, xpos, ypos, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCharCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCharCallback.java new file mode 100644 index 00000000..a349d225 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCharCallback.java @@ -0,0 +1,86 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +import static org.lwjgl.glfw.GLFW.*; + +/** + * Instances of this class may be passed to the {@link GLFW#glfwSetCharCallback SetCharCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     unsigned int codepoint
+ * )
+ * + * @since version 2.4 + */ +public abstract class GLFWCharCallback extends Callback implements GLFWCharCallbackI { + + /** + * Creates a {@code GLFWCharCallback} instance from the specified function pointer. + * + * @return the new {@code GLFWCharCallback} + */ + public static GLFWCharCallback create(long functionPointer) { + GLFWCharCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLFWCharCallback + ? (GLFWCharCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLFWCharCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLFWCharCallback} instance that delegates to the specified {@code GLFWCharCallbackI} instance. */ + public static GLFWCharCallback create(GLFWCharCallbackI instance) { + return instance instanceof GLFWCharCallback + ? (GLFWCharCallback)instance + : new Container(instance.address(), instance); + } + + protected GLFWCharCallback() { + super(SIGNATURE); + } + + GLFWCharCallback(long functionPointer) { + super(functionPointer); + } + + /** See {@link GLFW#glfwSetCharCallback SetCharCallback}. */ + public GLFWCharCallback set(long window) { + glfwSetCharCallback(window, this); + return this; + } + + private static final class Container extends GLFWCharCallback { + + private final GLFWCharCallbackI delegate; + + Container(long functionPointer, GLFWCharCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long window, int codepoint) { + delegate.invoke(window, codepoint); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCharCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCharCallbackI.java new file mode 100644 index 00000000..338b05c5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCharCallbackI.java @@ -0,0 +1,50 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link GLFW#glfwSetCharCallback SetCharCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     unsigned int codepoint
+ * )
+ * + * @since version 2.4 + */ +@FunctionalInterface +@NativeType("GLFWcharfun") +public interface GLFWCharCallbackI extends CallbackI.V { + + String SIGNATURE = "(pi)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgPointer(args), + dcbArgInt(args) + ); + } + + /** + * Will be called when a Unicode character is input. + * + * @param window the window that received the event + * @param codepoint the Unicode code point of the character + */ + void invoke(@NativeType("GLFWwindow *") long window, @NativeType("unsigned int") int codepoint); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCharModsCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCharModsCallback.java new file mode 100644 index 00000000..c9edc08f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCharModsCallback.java @@ -0,0 +1,89 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +import static org.lwjgl.glfw.GLFW.*; + +/** + * Instances of this class may be passed to the {@link GLFW#glfwSetCharModsCallback SetCharModsCallback} method. + * + *

Deprecared: scheduled for removal in version 4.0.

+ * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     unsigned int codepoint,
+ *     int mods
+ * )
+ * + * @since version 3.1 + */ +public abstract class GLFWCharModsCallback extends Callback implements GLFWCharModsCallbackI { + + /** + * Creates a {@code GLFWCharModsCallback} instance from the specified function pointer. + * + * @return the new {@code GLFWCharModsCallback} + */ + public static GLFWCharModsCallback create(long functionPointer) { + GLFWCharModsCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLFWCharModsCallback + ? (GLFWCharModsCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLFWCharModsCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLFWCharModsCallback} instance that delegates to the specified {@code GLFWCharModsCallbackI} instance. */ + public static GLFWCharModsCallback create(GLFWCharModsCallbackI instance) { + return instance instanceof GLFWCharModsCallback + ? (GLFWCharModsCallback)instance + : new Container(instance.address(), instance); + } + + protected GLFWCharModsCallback() { + super(SIGNATURE); + } + + GLFWCharModsCallback(long functionPointer) { + super(functionPointer); + } + + /** See {@link GLFW#glfwSetCharModsCallback SetCharModsCallback}. */ + public GLFWCharModsCallback set(long window) { + glfwSetCharModsCallback(window, this); + return this; + } + + private static final class Container extends GLFWCharModsCallback { + + private final GLFWCharModsCallbackI delegate; + + Container(long functionPointer, GLFWCharModsCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long window, int codepoint, int mods) { + delegate.invoke(window, codepoint, mods); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCharModsCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCharModsCallbackI.java new file mode 100644 index 00000000..3008caad --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCharModsCallbackI.java @@ -0,0 +1,55 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link GLFW#glfwSetCharModsCallback SetCharModsCallback} method. + * + *

Deprecared: scheduled for removal in version 4.0.

+ * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     unsigned int codepoint,
+ *     int mods
+ * )
+ * + * @since version 3.1 + */ +@FunctionalInterface +@NativeType("GLFWcharmodsfun") +public interface GLFWCharModsCallbackI extends CallbackI.V { + + String SIGNATURE = "(pii)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgPointer(args), + dcbArgInt(args), + dcbArgInt(args) + ); + } + + /** + * Will be called when a Unicode character is input regardless of what modifier keys are used. + * + * @param window the window that received the event + * @param codepoint the Unicode code point of the character + * @param mods bitfield describing which modifier keys were held down + */ + void invoke(@NativeType("GLFWwindow *") long window, @NativeType("unsigned int") int codepoint, int mods); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCursorEnterCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCursorEnterCallback.java new file mode 100644 index 00000000..bd02ce77 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCursorEnterCallback.java @@ -0,0 +1,86 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +import static org.lwjgl.glfw.GLFW.*; + +/** + * Instances of this class may be passed to the {@link GLFW#glfwSetCursorEnterCallback SetCursorEnterCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     int entered
+ * )
+ * + * @since version 3.0 + */ +public abstract class GLFWCursorEnterCallback extends Callback implements GLFWCursorEnterCallbackI { + + /** + * Creates a {@code GLFWCursorEnterCallback} instance from the specified function pointer. + * + * @return the new {@code GLFWCursorEnterCallback} + */ + public static GLFWCursorEnterCallback create(long functionPointer) { + GLFWCursorEnterCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLFWCursorEnterCallback + ? (GLFWCursorEnterCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLFWCursorEnterCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLFWCursorEnterCallback} instance that delegates to the specified {@code GLFWCursorEnterCallbackI} instance. */ + public static GLFWCursorEnterCallback create(GLFWCursorEnterCallbackI instance) { + return instance instanceof GLFWCursorEnterCallback + ? (GLFWCursorEnterCallback)instance + : new Container(instance.address(), instance); + } + + protected GLFWCursorEnterCallback() { + super(SIGNATURE); + } + + GLFWCursorEnterCallback(long functionPointer) { + super(functionPointer); + } + + /** See {@link GLFW#glfwSetCursorEnterCallback SetCursorEnterCallback}. */ + public GLFWCursorEnterCallback set(long window) { + glfwSetCursorEnterCallback(window, this); + return this; + } + + private static final class Container extends GLFWCursorEnterCallback { + + private final GLFWCursorEnterCallbackI delegate; + + Container(long functionPointer, GLFWCursorEnterCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long window, boolean entered) { + delegate.invoke(window, entered); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCursorEnterCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCursorEnterCallbackI.java new file mode 100644 index 00000000..9be574b0 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCursorEnterCallbackI.java @@ -0,0 +1,50 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link GLFW#glfwSetCursorEnterCallback SetCursorEnterCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     int entered
+ * )
+ * + * @since version 3.0 + */ +@FunctionalInterface +@NativeType("GLFWcursorenterfun") +public interface GLFWCursorEnterCallbackI extends CallbackI.V { + + String SIGNATURE = "(pi)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgPointer(args), + dcbArgInt(args) != 0 + ); + } + + /** + * Will be called when the cursor enters or leaves the client area of the window. + * + * @param window the window that received the event + * @param entered {@link GLFW#GLFW_TRUE TRUE} if the cursor entered the window's content area, or {@link GLFW#GLFW_FALSE FALSE} if it left it + */ + void invoke(@NativeType("GLFWwindow *") long window, @NativeType("int") boolean entered); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCursorPosCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCursorPosCallback.java new file mode 100644 index 00000000..1a4fa68d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCursorPosCallback.java @@ -0,0 +1,87 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +import static org.lwjgl.glfw.GLFW.*; + +/** + * Instances of this class may be passed to the {@link GLFW#glfwSetCursorPosCallback SetCursorPosCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     double xpos,
+ *     double ypos
+ * )
+ * + * @since version 3.0 + */ +public abstract class GLFWCursorPosCallback extends Callback implements GLFWCursorPosCallbackI { + + /** + * Creates a {@code GLFWCursorPosCallback} instance from the specified function pointer. + * + * @return the new {@code GLFWCursorPosCallback} + */ + public static GLFWCursorPosCallback create(long functionPointer) { + GLFWCursorPosCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLFWCursorPosCallback + ? (GLFWCursorPosCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLFWCursorPosCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLFWCursorPosCallback} instance that delegates to the specified {@code GLFWCursorPosCallbackI} instance. */ + public static GLFWCursorPosCallback create(GLFWCursorPosCallbackI instance) { + return instance instanceof GLFWCursorPosCallback + ? (GLFWCursorPosCallback)instance + : new Container(instance.address(), instance); + } + + protected GLFWCursorPosCallback() { + super(SIGNATURE); + } + + GLFWCursorPosCallback(long functionPointer) { + super(functionPointer); + } + + /** See {@link GLFW#glfwSetCursorPosCallback SetCursorPosCallback}. */ + public GLFWCursorPosCallback set(long window) { + glfwSetCursorPosCallback(window, this); + return this; + } + + private static final class Container extends GLFWCursorPosCallback { + + private final GLFWCursorPosCallbackI delegate; + + Container(long functionPointer, GLFWCursorPosCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long window, double xpos, double ypos) { + delegate.invoke(window, xpos, ypos); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCursorPosCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCursorPosCallbackI.java new file mode 100644 index 00000000..8e4f717c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWCursorPosCallbackI.java @@ -0,0 +1,56 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link GLFW#glfwSetCursorPosCallback SetCursorPosCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     double xpos,
+ *     double ypos
+ * )
+ * + * @since version 3.0 + */ +@FunctionalInterface +@NativeType("GLFWcursorposfun") +public interface GLFWCursorPosCallbackI extends CallbackI.V { + + String SIGNATURE = "(pdd)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgPointer(args), + dcbArgDouble(args), + dcbArgDouble(args) + ); + } + + /** + * Will be called when the cursor is moved. + * + *

The callback function receives the cursor position, measured in screen coordinates but relative to the top-left corner of the window client area. On + * platforms that provide it, the full sub-pixel cursor position is passed on.

+ * + * @param window the window that received the event + * @param xpos the new cursor x-coordinate, relative to the left edge of the content area + * @param ypos the new cursor y-coordinate, relative to the top edge of the content area + */ + void invoke(@NativeType("GLFWwindow *") long window, double xpos, double ypos); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWDropCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWDropCallback.java new file mode 100644 index 00000000..eaf831c2 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWDropCallback.java @@ -0,0 +1,101 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +import static org.lwjgl.glfw.GLFW.*; + +/** + * Instances of this class may be passed to the {@link GLFW#glfwSetDropCallback SetDropCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     int count,
+ *     char const **names
+ * )
+ * + * @since version 3.1 + */ +public abstract class GLFWDropCallback extends Callback implements GLFWDropCallbackI { + + /** + * Creates a {@code GLFWDropCallback} instance from the specified function pointer. + * + * @return the new {@code GLFWDropCallback} + */ + public static GLFWDropCallback create(long functionPointer) { + GLFWDropCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLFWDropCallback + ? (GLFWDropCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLFWDropCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLFWDropCallback} instance that delegates to the specified {@code GLFWDropCallbackI} instance. */ + public static GLFWDropCallback create(GLFWDropCallbackI instance) { + return instance instanceof GLFWDropCallback + ? (GLFWDropCallback)instance + : new Container(instance.address(), instance); + } + + protected GLFWDropCallback() { + super(SIGNATURE); + } + + GLFWDropCallback(long functionPointer) { + super(functionPointer); + } + + /** + * Decodes the specified {@link GLFWDropCallback} arguments to a String. + * + *

This method may only be used inside a {@code GLFWDropCallback} invocation.

+ * + * @param names pointer to the array of UTF-8 encoded path names of the dropped files + * @param index the index to decode + * + * @return the name at the specified index as a String + */ + public static String getName(long names, int index) { + return memUTF8(memGetAddress(names + Pointer.POINTER_SIZE * index)); + } + + /** See {@link GLFW#glfwSetDropCallback SetDropCallback}. */ + public GLFWDropCallback set(long window) { + glfwSetDropCallback(window, this); + return this; + } + + private static final class Container extends GLFWDropCallback { + + private final GLFWDropCallbackI delegate; + + Container(long functionPointer, GLFWDropCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long window, int count, long names) { + delegate.invoke(window, count, names); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWDropCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWDropCallbackI.java new file mode 100644 index 00000000..7528629e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWDropCallbackI.java @@ -0,0 +1,53 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link GLFW#glfwSetDropCallback SetDropCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     int count,
+ *     char const **names
+ * )
+ * + * @since version 3.1 + */ +@FunctionalInterface +@NativeType("GLFWdropfun") +public interface GLFWDropCallbackI extends CallbackI.V { + + String SIGNATURE = "(pip)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgPointer(args), + dcbArgInt(args), + dcbArgPointer(args) + ); + } + + /** + * Will be called when one or more dragged files are dropped on the window. + * + * @param window the window that received the event + * @param count the number of dropped files + * @param names pointer to the array of UTF-8 encoded path names of the dropped files + */ + void invoke(@NativeType("GLFWwindow *") long window, int count, @NativeType("char const **") long names); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWErrorCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWErrorCallback.java new file mode 100644 index 00000000..40b569e9 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWErrorCallback.java @@ -0,0 +1,152 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +import java.io.PrintStream; +import java.util.Map; + +import static org.lwjgl.glfw.GLFW.*; + +/** + * Instances of this class may be passed to the {@link GLFW#glfwSetErrorCallback SetErrorCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     int error,
+ *     char *description
+ * )
+ * + * @since version 3.0 + */ +public abstract class GLFWErrorCallback extends Callback implements GLFWErrorCallbackI { + + /** + * Creates a {@code GLFWErrorCallback} instance from the specified function pointer. + * + * @return the new {@code GLFWErrorCallback} + */ + public static GLFWErrorCallback create(long functionPointer) { + GLFWErrorCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLFWErrorCallback + ? (GLFWErrorCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLFWErrorCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLFWErrorCallback} instance that delegates to the specified {@code GLFWErrorCallbackI} instance. */ + public static GLFWErrorCallback create(GLFWErrorCallbackI instance) { + return instance instanceof GLFWErrorCallback + ? (GLFWErrorCallback)instance + : new Container(instance.address(), instance); + } + + protected GLFWErrorCallback() { + super(SIGNATURE); + } + + GLFWErrorCallback(long functionPointer) { + super(functionPointer); + } + + /** + * Converts the specified {@link GLFWErrorCallback} argument to a String. + * + *

This method may only be used inside a GLFWErrorCallback invocation.

+ * + * @param description pointer to the UTF-8 encoded description string + * + * @return the description as a String + */ + public static String getDescription(long description) { + return memUTF8(description); + } + + /** + * Returns a {@link GLFWErrorCallback} instance that prints the error to the {@link APIUtil#DEBUG_STREAM}. + * + * @return the GLFWerrorCallback + */ + public static GLFWErrorCallback createPrint() { + return createPrint(APIUtil.DEBUG_STREAM); + } + + /** + * Returns a {@link GLFWErrorCallback} instance that prints the error in the specified {@link PrintStream}. + * + * @param stream the PrintStream to use + * + * @return the GLFWerrorCallback + */ + public static GLFWErrorCallback createPrint(PrintStream stream) { + return new GLFWErrorCallback() { + private Map ERROR_CODES = APIUtil.apiClassTokens((field, value) -> 0x10000 < value && value < 0x20000, null, GLFW.class); + + @Override + public void invoke(int error, long description) { + String msg = getDescription(description); + + stream.printf("[LWJGL] %s error\n", ERROR_CODES.get(error)); + stream.println("\tDescription : " + msg); + stream.println("\tStacktrace :"); + StackTraceElement[] stack = Thread.currentThread().getStackTrace(); + for ( int i = 4; i < stack.length; i++ ) { + stream.print("\t\t"); + stream.println(stack[i].toString()); + } + } + }; + } + + /** + * Returns a {@link GLFWErrorCallback} instance that throws an {@link IllegalStateException} when an error occurs. + * + * @return the GLFWerrorCallback + */ + public static GLFWErrorCallback createThrow() { + return new GLFWErrorCallback() { + @Override + public void invoke(int error, long description) { + throw new IllegalStateException(String.format("GLFW error [0x%X]: %s", error, getDescription(description))); + } + }; + } + + /** See {@link GLFW#glfwSetErrorCallback SetErrorCallback}. */ + public GLFWErrorCallback set() { + glfwSetErrorCallback(this); + return this; + } + + private static final class Container extends GLFWErrorCallback { + + private final GLFWErrorCallbackI delegate; + + Container(long functionPointer, GLFWErrorCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(int error, long description) { + delegate.invoke(error, description); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWErrorCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWErrorCallbackI.java new file mode 100644 index 00000000..db193abc --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWErrorCallbackI.java @@ -0,0 +1,50 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link GLFW#glfwSetErrorCallback SetErrorCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     int error,
+ *     char *description
+ * )
+ * + * @since version 3.0 + */ +@FunctionalInterface +@NativeType("GLFWerrorfun") +public interface GLFWErrorCallbackI extends CallbackI.V { + + String SIGNATURE = "(ip)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgInt(args), + dcbArgPointer(args) + ); + } + + /** + * Will be called with an error code and a human-readable description when a GLFW error occurs. + * + * @param error the error code + * @param description a pointer to a UTF-8 encoded string describing the error + */ + void invoke(int error, @NativeType("char *") long description); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWFramebufferSizeCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWFramebufferSizeCallback.java new file mode 100644 index 00000000..2e66f76f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWFramebufferSizeCallback.java @@ -0,0 +1,87 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +import static org.lwjgl.glfw.GLFW.*; + +/** + * Instances of this class may be passed to the {@link GLFW#glfwSetFramebufferSizeCallback SetFramebufferSizeCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     int width,
+ *     int height
+ * )
+ * + * @since version 3.0 + */ +public abstract class GLFWFramebufferSizeCallback extends Callback implements GLFWFramebufferSizeCallbackI { + + /** + * Creates a {@code GLFWFramebufferSizeCallback} instance from the specified function pointer. + * + * @return the new {@code GLFWFramebufferSizeCallback} + */ + public static GLFWFramebufferSizeCallback create(long functionPointer) { + GLFWFramebufferSizeCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLFWFramebufferSizeCallback + ? (GLFWFramebufferSizeCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLFWFramebufferSizeCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLFWFramebufferSizeCallback} instance that delegates to the specified {@code GLFWFramebufferSizeCallbackI} instance. */ + public static GLFWFramebufferSizeCallback create(GLFWFramebufferSizeCallbackI instance) { + return instance instanceof GLFWFramebufferSizeCallback + ? (GLFWFramebufferSizeCallback)instance + : new Container(instance.address(), instance); + } + + protected GLFWFramebufferSizeCallback() { + super(SIGNATURE); + } + + GLFWFramebufferSizeCallback(long functionPointer) { + super(functionPointer); + } + + /** See {@link GLFW#glfwSetFramebufferSizeCallback SetFramebufferSizeCallback}. */ + public GLFWFramebufferSizeCallback set(long window) { + glfwSetFramebufferSizeCallback(window, this); + return this; + } + + private static final class Container extends GLFWFramebufferSizeCallback { + + private final GLFWFramebufferSizeCallbackI delegate; + + Container(long functionPointer, GLFWFramebufferSizeCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long window, int width, int height) { + delegate.invoke(window, width, height); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWFramebufferSizeCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWFramebufferSizeCallbackI.java new file mode 100644 index 00000000..098e2b2c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWFramebufferSizeCallbackI.java @@ -0,0 +1,53 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link GLFW#glfwSetFramebufferSizeCallback SetFramebufferSizeCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     int width,
+ *     int height
+ * )
+ * + * @since version 3.0 + */ +@FunctionalInterface +@NativeType("GLFWframebuffersizefun") +public interface GLFWFramebufferSizeCallbackI extends CallbackI.V { + + String SIGNATURE = "(pii)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgPointer(args), + dcbArgInt(args), + dcbArgInt(args) + ); + } + + /** + * Will be called when the framebuffer of the specified window is resized. + * + * @param window the window whose framebuffer was resized + * @param width the new width, in pixels, of the framebuffer + * @param height the new height, in pixels, of the framebuffer + */ + void invoke(@NativeType("GLFWwindow *") long window, int width, int height); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWGamepadState.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWGamepadState.java new file mode 100644 index 00000000..639197dd --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWGamepadState.java @@ -0,0 +1,359 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Describes the input state of a gamepad. + * + *

Member documentation

+ * + *
    + *
  • {@code buttons[15]} – the states of each gamepad button, {@link GLFW#GLFW_PRESS PRESS} or {@link GLFW#GLFW_RELEASE RELEASE}
  • + *
  • {@code axes[6]} – the states of each gamepad axis, in the range -1.0 to 1.0 inclusive
  • + *
+ * + *

Layout

+ * + *

+ * struct GLFWgamepadstate {
+ *     unsigned char buttons[15];
+ *     float axes[6];
+ * }
+ * + * @since version 3.3 + */ +@NativeType("struct GLFWgamepadstate") +public class GLFWGamepadState extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + BUTTONS, + AXES; + + static { + Layout layout = __struct( + __array(1, 15), + __array(4, 6) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + BUTTONS = layout.offsetof(0); + AXES = layout.offsetof(1); + } + + /** + * Creates a {@code GLFWGamepadState} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public GLFWGamepadState(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns a {@link ByteBuffer} view of the {@code buttons} field. */ + @NativeType("unsigned char[15]") + public ByteBuffer buttons() { return nbuttons(address()); } + /** Returns the value at the specified index of the {@code buttons} field. */ + @NativeType("unsigned char") + public byte buttons(int index) { return nbuttons(address(), index); } + /** Returns a {@link FloatBuffer} view of the {@code axes} field. */ + @NativeType("float[6]") + public FloatBuffer axes() { return naxes(address()); } + /** Returns the value at the specified index of the {@code axes} field. */ + public float axes(int index) { return naxes(address(), index); } + + /** Copies the specified {@link ByteBuffer} to the {@code buttons} field. */ + public GLFWGamepadState buttons(@NativeType("unsigned char[15]") ByteBuffer value) { nbuttons(address(), value); return this; } + /** Sets the specified value at the specified index of the {@code buttons} field. */ + public GLFWGamepadState buttons(int index, @NativeType("unsigned char") byte value) { nbuttons(address(), index, value); return this; } + /** Copies the specified {@link FloatBuffer} to the {@code axes} field. */ + public GLFWGamepadState axes(@NativeType("float[6]") FloatBuffer value) { naxes(address(), value); return this; } + /** Sets the specified value at the specified index of the {@code axes} field. */ + public GLFWGamepadState axes(int index, float value) { naxes(address(), index, value); return this; } + + /** Initializes this struct with the specified values. */ + public GLFWGamepadState set( + ByteBuffer buttons, + FloatBuffer axes + ) { + buttons(buttons); + axes(axes); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public GLFWGamepadState set(GLFWGamepadState src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code GLFWGamepadState} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static GLFWGamepadState malloc() { + return wrap(GLFWGamepadState.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code GLFWGamepadState} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static GLFWGamepadState calloc() { + return wrap(GLFWGamepadState.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code GLFWGamepadState} instance allocated with {@link BufferUtils}. */ + public static GLFWGamepadState create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(GLFWGamepadState.class, memAddress(container), container); + } + + /** Returns a new {@code GLFWGamepadState} instance for the specified memory address. */ + public static GLFWGamepadState create(long address) { + return wrap(GLFWGamepadState.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static GLFWGamepadState createSafe(long address) { + return address == NULL ? null : wrap(GLFWGamepadState.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code GLFWGamepadState} instance allocated on the thread-local {@link MemoryStack}. */ + public static GLFWGamepadState mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code GLFWGamepadState} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static GLFWGamepadState callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code GLFWGamepadState} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static GLFWGamepadState mallocStack(MemoryStack stack) { + return wrap(GLFWGamepadState.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code GLFWGamepadState} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static GLFWGamepadState callocStack(MemoryStack stack) { + return wrap(GLFWGamepadState.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #buttons}. */ + public static ByteBuffer nbuttons(long struct) { return memByteBuffer(struct + GLFWGamepadState.BUTTONS, 15); } + /** Unsafe version of {@link #buttons(int) buttons}. */ + public static byte nbuttons(long struct, int index) { + return UNSAFE.getByte(null, struct + GLFWGamepadState.BUTTONS + check(index, 15) * 1); + } + /** Unsafe version of {@link #axes}. */ + public static FloatBuffer naxes(long struct) { return memFloatBuffer(struct + GLFWGamepadState.AXES, 6); } + /** Unsafe version of {@link #axes(int) axes}. */ + public static float naxes(long struct, int index) { + return UNSAFE.getFloat(null, struct + GLFWGamepadState.AXES + check(index, 6) * 4); + } + + /** Unsafe version of {@link #buttons(ByteBuffer) buttons}. */ + public static void nbuttons(long struct, ByteBuffer value) { + if (CHECKS) { checkGT(value, 15); } + memCopy(memAddress(value), struct + GLFWGamepadState.BUTTONS, value.remaining() * 1); + } + /** Unsafe version of {@link #buttons(int, byte) buttons}. */ + public static void nbuttons(long struct, int index, byte value) { + UNSAFE.putByte(null, struct + GLFWGamepadState.BUTTONS + check(index, 15) * 1, value); + } + /** Unsafe version of {@link #axes(FloatBuffer) axes}. */ + public static void naxes(long struct, FloatBuffer value) { + if (CHECKS) { checkGT(value, 6); } + memCopy(memAddress(value), struct + GLFWGamepadState.AXES, value.remaining() * 4); + } + /** Unsafe version of {@link #axes(int, float) axes}. */ + public static void naxes(long struct, int index, float value) { + UNSAFE.putFloat(null, struct + GLFWGamepadState.AXES + check(index, 6) * 4, value); + } + + // ----------------------------------- + + /** An array of {@link GLFWGamepadState} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final GLFWGamepadState ELEMENT_FACTORY = GLFWGamepadState.create(-1L); + + /** + * Creates a new {@code GLFWGamepadState.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link GLFWGamepadState#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected GLFWGamepadState getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns a {@link ByteBuffer} view of the {@code buttons} field. */ + @NativeType("unsigned char[15]") + public ByteBuffer buttons() { return GLFWGamepadState.nbuttons(address()); } + /** Returns the value at the specified index of the {@code buttons} field. */ + @NativeType("unsigned char") + public byte buttons(int index) { return GLFWGamepadState.nbuttons(address(), index); } + /** Returns a {@link FloatBuffer} view of the {@code axes} field. */ + @NativeType("float[6]") + public FloatBuffer axes() { return GLFWGamepadState.naxes(address()); } + /** Returns the value at the specified index of the {@code axes} field. */ + public float axes(int index) { return GLFWGamepadState.naxes(address(), index); } + + /** Copies the specified {@link ByteBuffer} to the {@code buttons} field. */ + public Buffer buttons(@NativeType("unsigned char[15]") ByteBuffer value) { GLFWGamepadState.nbuttons(address(), value); return this; } + /** Sets the specified value at the specified index of the {@code buttons} field. */ + public Buffer buttons(int index, @NativeType("unsigned char") byte value) { GLFWGamepadState.nbuttons(address(), index, value); return this; } + /** Copies the specified {@link FloatBuffer} to the {@code axes} field. */ + public Buffer axes(@NativeType("float[6]") FloatBuffer value) { GLFWGamepadState.naxes(address(), value); return this; } + /** Sets the specified value at the specified index of the {@code axes} field. */ + public Buffer axes(int index, float value) { GLFWGamepadState.naxes(address(), index, value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWGammaRamp.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWGammaRamp.java new file mode 100644 index 00000000..a3e4d808 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWGammaRamp.java @@ -0,0 +1,384 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Describes the gamma ramp for a monitor. + * + *

Member documentation

+ * + *
    + *
  • {@code red} – an array of values describing the response of the red channel
  • + *
  • {@code green} – an array of values describing the response of the green channel
  • + *
  • {@code blue} – an array of values describing the response of the blue channel
  • + *
  • {@code size} – the number of elements in each array
  • + *
+ * + *

Layout

+ * + *

+ * struct GLFWgammaramp {
+ *     unsigned short * red;
+ *     unsigned short * green;
+ *     unsigned short * blue;
+ *     unsigned int size;
+ * }
+ * + * @since version 3.0 + */ +@NativeType("struct GLFWgammaramp") +public class GLFWGammaRamp extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + RED, + GREEN, + BLUE, + SIZE; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + RED = layout.offsetof(0); + GREEN = layout.offsetof(1); + BLUE = layout.offsetof(2); + SIZE = layout.offsetof(3); + } + + /** + * Creates a {@code GLFWGammaRamp} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public GLFWGammaRamp(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns a {@link ShortBuffer} view of the data pointed to by the {@code red} field. */ + @NativeType("unsigned short *") + public ShortBuffer red() { return nred(address()); } + /** Returns a {@link ShortBuffer} view of the data pointed to by the {@code green} field. */ + @NativeType("unsigned short *") + public ShortBuffer green() { return ngreen(address()); } + /** Returns a {@link ShortBuffer} view of the data pointed to by the {@code blue} field. */ + @NativeType("unsigned short *") + public ShortBuffer blue() { return nblue(address()); } + /** Returns the value of the {@code size} field. */ + @NativeType("unsigned int") + public int size() { return nsize(address()); } + + /** Sets the address of the specified {@link ShortBuffer} to the {@code red} field. */ + public GLFWGammaRamp red(@NativeType("unsigned short *") ShortBuffer value) { nred(address(), value); return this; } + /** Sets the address of the specified {@link ShortBuffer} to the {@code green} field. */ + public GLFWGammaRamp green(@NativeType("unsigned short *") ShortBuffer value) { ngreen(address(), value); return this; } + /** Sets the address of the specified {@link ShortBuffer} to the {@code blue} field. */ + public GLFWGammaRamp blue(@NativeType("unsigned short *") ShortBuffer value) { nblue(address(), value); return this; } + /** Sets the specified value to the {@code size} field. */ + public GLFWGammaRamp size(@NativeType("unsigned int") int value) { nsize(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public GLFWGammaRamp set( + ShortBuffer red, + ShortBuffer green, + ShortBuffer blue, + int size + ) { + red(red); + green(green); + blue(blue); + size(size); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public GLFWGammaRamp set(GLFWGammaRamp src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code GLFWGammaRamp} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static GLFWGammaRamp malloc() { + return wrap(GLFWGammaRamp.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code GLFWGammaRamp} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static GLFWGammaRamp calloc() { + return wrap(GLFWGammaRamp.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code GLFWGammaRamp} instance allocated with {@link BufferUtils}. */ + public static GLFWGammaRamp create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(GLFWGammaRamp.class, memAddress(container), container); + } + + /** Returns a new {@code GLFWGammaRamp} instance for the specified memory address. */ + public static GLFWGammaRamp create(long address) { + return wrap(GLFWGammaRamp.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static GLFWGammaRamp createSafe(long address) { + return address == NULL ? null : wrap(GLFWGammaRamp.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code GLFWGammaRamp} instance allocated on the thread-local {@link MemoryStack}. */ + public static GLFWGammaRamp mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code GLFWGammaRamp} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static GLFWGammaRamp callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code GLFWGammaRamp} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static GLFWGammaRamp mallocStack(MemoryStack stack) { + return wrap(GLFWGammaRamp.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code GLFWGammaRamp} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static GLFWGammaRamp callocStack(MemoryStack stack) { + return wrap(GLFWGammaRamp.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #red() red}. */ + public static ShortBuffer nred(long struct) { return memShortBuffer(memGetAddress(struct + GLFWGammaRamp.RED), nsize(struct)); } + /** Unsafe version of {@link #green() green}. */ + public static ShortBuffer ngreen(long struct) { return memShortBuffer(memGetAddress(struct + GLFWGammaRamp.GREEN), nsize(struct)); } + /** Unsafe version of {@link #blue() blue}. */ + public static ShortBuffer nblue(long struct) { return memShortBuffer(memGetAddress(struct + GLFWGammaRamp.BLUE), nsize(struct)); } + /** Unsafe version of {@link #size}. */ + public static int nsize(long struct) { return UNSAFE.getInt(null, struct + GLFWGammaRamp.SIZE); } + + /** Unsafe version of {@link #red(ShortBuffer) red}. */ + public static void nred(long struct, ShortBuffer value) { memPutAddress(struct + GLFWGammaRamp.RED, memAddress(value)); } + /** Unsafe version of {@link #green(ShortBuffer) green}. */ + public static void ngreen(long struct, ShortBuffer value) { memPutAddress(struct + GLFWGammaRamp.GREEN, memAddress(value)); } + /** Unsafe version of {@link #blue(ShortBuffer) blue}. */ + public static void nblue(long struct, ShortBuffer value) { memPutAddress(struct + GLFWGammaRamp.BLUE, memAddress(value)); } + /** Sets the specified value to the {@code size} field of the specified {@code struct}. */ + public static void nsize(long struct, int value) { UNSAFE.putInt(null, struct + GLFWGammaRamp.SIZE, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + GLFWGammaRamp.RED)); + check(memGetAddress(struct + GLFWGammaRamp.GREEN)); + check(memGetAddress(struct + GLFWGammaRamp.BLUE)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link GLFWGammaRamp} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final GLFWGammaRamp ELEMENT_FACTORY = GLFWGammaRamp.create(-1L); + + /** + * Creates a new {@code GLFWGammaRamp.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link GLFWGammaRamp#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected GLFWGammaRamp getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns a {@link ShortBuffer} view of the data pointed to by the {@code red} field. */ + @NativeType("unsigned short *") + public ShortBuffer red() { return GLFWGammaRamp.nred(address()); } + /** Returns a {@link ShortBuffer} view of the data pointed to by the {@code green} field. */ + @NativeType("unsigned short *") + public ShortBuffer green() { return GLFWGammaRamp.ngreen(address()); } + /** Returns a {@link ShortBuffer} view of the data pointed to by the {@code blue} field. */ + @NativeType("unsigned short *") + public ShortBuffer blue() { return GLFWGammaRamp.nblue(address()); } + /** Returns the value of the {@code size} field. */ + @NativeType("unsigned int") + public int size() { return GLFWGammaRamp.nsize(address()); } + + /** Sets the address of the specified {@link ShortBuffer} to the {@code red} field. */ + public Buffer red(@NativeType("unsigned short *") ShortBuffer value) { GLFWGammaRamp.nred(address(), value); return this; } + /** Sets the address of the specified {@link ShortBuffer} to the {@code green} field. */ + public Buffer green(@NativeType("unsigned short *") ShortBuffer value) { GLFWGammaRamp.ngreen(address(), value); return this; } + /** Sets the address of the specified {@link ShortBuffer} to the {@code blue} field. */ + public Buffer blue(@NativeType("unsigned short *") ShortBuffer value) { GLFWGammaRamp.nblue(address(), value); return this; } + /** Sets the specified value to the {@code size} field. */ + public Buffer size(@NativeType("unsigned int") int value) { GLFWGammaRamp.nsize(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWImage.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWImage.java new file mode 100644 index 00000000..ca0f825e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWImage.java @@ -0,0 +1,406 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import java.nio.*; + + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Image data. + * + *

This describes a single 2D image. See the documentation for each related function to see what the expected pixel format is.

+ * + *

Member documentation

+ * + *
    + *
  • {@code width} – the width, in pixels, of this image
  • + *
  • {@code height} – the height, in pixels, of this image
  • + *
  • {@code pixels} – the pixel data of this image, arranged left-to-right, top-to-bottom
  • + *
+ * + *

Layout

+ * + *

+ * struct GLFWimage {
+ *     int width;
+ *     int height;
+ *     unsigned char * pixels;
+ * }
+ * + * @since version 2.1 + */ +@NativeType("struct GLFWimage") +public class GLFWImage extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + WIDTH, + HEIGHT, + PIXELS; + + static { + Layout layout = __struct( + __member(4), + __member(4), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + WIDTH = layout.offsetof(0); + HEIGHT = layout.offsetof(1); + PIXELS = layout.offsetof(2); + } + + /** + * Creates a {@code GLFWImage} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public GLFWImage(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code width} field. */ + public int width() { return nwidth(address()); } + /** Returns the value of the {@code height} field. */ + public int height() { return nheight(address()); } + /** + * Returns a {@link ByteBuffer} view of the data pointed to by the {@code pixels} field. + * + * @param capacity the number of elements in the returned buffer + */ + @NativeType("unsigned char *") + public ByteBuffer pixels(int capacity) { return npixels(address(), capacity); } + + /** Sets the specified value to the {@code width} field. */ + public GLFWImage width(int value) { nwidth(address(), value); return this; } + /** Sets the specified value to the {@code height} field. */ + public GLFWImage height(int value) { nheight(address(), value); return this; } + /** Sets the address of the specified {@link ByteBuffer} to the {@code pixels} field. */ + public GLFWImage pixels(@NativeType("unsigned char *") ByteBuffer value) { npixels(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public GLFWImage set( + int width, + int height, + ByteBuffer pixels + ) { + width(width); + height(height); + pixels(pixels); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public GLFWImage set(GLFWImage src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code GLFWImage} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static GLFWImage malloc() { + return wrap(GLFWImage.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code GLFWImage} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static GLFWImage calloc() { + return wrap(GLFWImage.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code GLFWImage} instance allocated with {@link BufferUtils}. */ + public static GLFWImage create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(GLFWImage.class, memAddress(container), container); + } + + /** Returns a new {@code GLFWImage} instance for the specified memory address. */ + public static GLFWImage create(long address) { + return wrap(GLFWImage.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static GLFWImage createSafe(long address) { + return address == NULL ? null : wrap(GLFWImage.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code GLFWImage} instance allocated on the thread-local {@link MemoryStack}. */ + public static GLFWImage mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code GLFWImage} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static GLFWImage callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code GLFWImage} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static GLFWImage mallocStack(MemoryStack stack) { + return malloc(stack); + } + + /** + * Returns a new {@code GLFWImage} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static GLFWImage callocStack(MemoryStack stack) { + return malloc(stack); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return malloc(capacity, stack); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return malloc(capacity, stack); + } + + // ----------------------------------- + + /** Unsafe version of {@link #width}. */ + public static int nwidth(long struct) { return UNSAFE.getInt(null, struct + GLFWImage.WIDTH); } + /** Unsafe version of {@link #height}. */ + public static int nheight(long struct) { return UNSAFE.getInt(null, struct + GLFWImage.HEIGHT); } + /** Unsafe version of {@link #pixels(int) pixels}. */ + public static ByteBuffer npixels(long struct, int capacity) { return memByteBuffer(memGetAddress(struct + GLFWImage.PIXELS), capacity); } + + /** Unsafe version of {@link #width(int) width}. */ + public static void nwidth(long struct, int value) { UNSAFE.putInt(null, struct + GLFWImage.WIDTH, value); } + /** Unsafe version of {@link #height(int) height}. */ + public static void nheight(long struct, int value) { UNSAFE.putInt(null, struct + GLFWImage.HEIGHT, value); } + /** Unsafe version of {@link #pixels(ByteBuffer) pixels}. */ + public static void npixels(long struct, ByteBuffer value) { memPutAddress(struct + GLFWImage.PIXELS, memAddress(value)); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + GLFWImage.PIXELS)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link GLFWImage} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final GLFWImage ELEMENT_FACTORY = GLFWImage.create(-1L); + + /** + * Creates a new {@code GLFWImage.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link GLFWImage#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected GLFWImage getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code width} field. */ + public int width() { return GLFWImage.nwidth(address()); } + /** Returns the value of the {@code height} field. */ + public int height() { return GLFWImage.nheight(address()); } + /** + * Returns a {@link ByteBuffer} view of the data pointed to by the {@code pixels} field. + * + * @param capacity the number of elements in the returned buffer + */ + @NativeType("unsigned char *") + public ByteBuffer pixels(int capacity) { return GLFWImage.npixels(address(), capacity); } + + /** Sets the specified value to the {@code width} field. */ + public Buffer width(int value) { GLFWImage.nwidth(address(), value); return this; } + /** Sets the specified value to the {@code height} field. */ + public Buffer height(int value) { GLFWImage.nheight(address(), value); return this; } + /** Sets the address of the specified {@link ByteBuffer} to the {@code pixels} field. */ + public Buffer pixels(@NativeType("unsigned char *") ByteBuffer value) { GLFWImage.npixels(address(), value); return this; } + + } + /** + * Returns a new {@code GLFWImage} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static GLFWImage malloc(MemoryStack stack) { + return wrap(GLFWImage.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + // ----------------------------------- + /** + * Returns a new {@code GLFWImage} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static GLFWImage calloc(MemoryStack stack) { + return wrap(GLFWImage.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWJoystickCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWJoystickCallback.java new file mode 100644 index 00000000..85efe06e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWJoystickCallback.java @@ -0,0 +1,86 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +import static org.lwjgl.glfw.GLFW.*; + +/** + * Instances of this class may be passed to the {@link GLFW#glfwSetJoystickCallback SetJoystickCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     int jid,
+ *     int event
+ * )
+ * + * @since version 3.2 + */ +public abstract class GLFWJoystickCallback extends Callback implements GLFWJoystickCallbackI { + + /** + * Creates a {@code GLFWJoystickCallback} instance from the specified function pointer. + * + * @return the new {@code GLFWJoystickCallback} + */ + public static GLFWJoystickCallback create(long functionPointer) { + GLFWJoystickCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLFWJoystickCallback + ? (GLFWJoystickCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLFWJoystickCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLFWJoystickCallback} instance that delegates to the specified {@code GLFWJoystickCallbackI} instance. */ + public static GLFWJoystickCallback create(GLFWJoystickCallbackI instance) { + return instance instanceof GLFWJoystickCallback + ? (GLFWJoystickCallback)instance + : new Container(instance.address(), instance); + } + + protected GLFWJoystickCallback() { + super(SIGNATURE); + } + + GLFWJoystickCallback(long functionPointer) { + super(functionPointer); + } + + /** See {@link GLFW#glfwSetJoystickCallback SetJoystickCallback}. */ + public GLFWJoystickCallback set() { + glfwSetJoystickCallback(this); + return this; + } + + private static final class Container extends GLFWJoystickCallback { + + private final GLFWJoystickCallbackI delegate; + + Container(long functionPointer, GLFWJoystickCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(int jid, int event) { + delegate.invoke(jid, event); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWJoystickCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWJoystickCallbackI.java new file mode 100644 index 00000000..2bea9c27 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWJoystickCallbackI.java @@ -0,0 +1,50 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link GLFW#glfwSetJoystickCallback SetJoystickCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     int jid,
+ *     int event
+ * )
+ * + * @since version 3.2 + */ +@FunctionalInterface +@NativeType("GLFWjoystickfun") +public interface GLFWJoystickCallbackI extends CallbackI.V { + + String SIGNATURE = "(ii)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgInt(args), + dcbArgInt(args) + ); + } + + /** + * Will be called when a joystick is connected to or disconnected from the system. + * + * @param jid the joystick that was connected or disconnected + * @param event one of {@link GLFW#GLFW_CONNECTED CONNECTED} or {@link GLFW#GLFW_DISCONNECTED DISCONNECTED}. Remaining values reserved for future use. + */ + void invoke(int jid, int event); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWKeyCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWKeyCallback.java new file mode 100644 index 00000000..eb770334 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWKeyCallback.java @@ -0,0 +1,87 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +import static org.lwjgl.glfw.GLFW.*; + +/** + * Instances of this class may be passed to the {@link GLFW#glfwSetKeyCallback SetKeyCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     int key,
+ *     int scancode,
+ *     int action,
+ *     int mods
+ * )
+ */ +public abstract class GLFWKeyCallback extends Callback implements GLFWKeyCallbackI { + + /** + * Creates a {@code GLFWKeyCallback} instance from the specified function pointer. + * + * @return the new {@code GLFWKeyCallback} + */ + public static GLFWKeyCallback create(long functionPointer) { + GLFWKeyCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLFWKeyCallback + ? (GLFWKeyCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLFWKeyCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLFWKeyCallback} instance that delegates to the specified {@code GLFWKeyCallbackI} instance. */ + public static GLFWKeyCallback create(GLFWKeyCallbackI instance) { + return instance instanceof GLFWKeyCallback + ? (GLFWKeyCallback)instance + : new Container(instance.address(), instance); + } + + protected GLFWKeyCallback() { + super(SIGNATURE); + } + + GLFWKeyCallback(long functionPointer) { + super(functionPointer); + } + + /** See {@link GLFW#glfwSetKeyCallback SetKeyCallback}. */ + public GLFWKeyCallback set(long window) { + glfwSetKeyCallback(window, this); + return this; + } + + private static final class Container extends GLFWKeyCallback { + + private final GLFWKeyCallbackI delegate; + + Container(long functionPointer, GLFWKeyCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long window, int key, int scancode, int action, int mods) { + delegate.invoke(window, key, scancode, action, mods); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWKeyCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWKeyCallbackI.java new file mode 100644 index 00000000..ed506cf3 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWKeyCallbackI.java @@ -0,0 +1,57 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link GLFW#glfwSetKeyCallback SetKeyCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     int key,
+ *     int scancode,
+ *     int action,
+ *     int mods
+ * )
+ */ +@FunctionalInterface +@NativeType("GLFWkeyfun") +public interface GLFWKeyCallbackI extends CallbackI.V { + + String SIGNATURE = "(piiii)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgPointer(args), + dcbArgInt(args), + dcbArgInt(args), + dcbArgInt(args), + dcbArgInt(args) + ); + } + + /** + * Will be called when a key is pressed, repeated or released. + * + * @param window the window that received the event + * @param key the keyboard key that was pressed or released + * @param scancode the system-specific scancode of the key + * @param action the key action. One of:
{@link GLFW#GLFW_PRESS PRESS}{@link GLFW#GLFW_RELEASE RELEASE}{@link GLFW#GLFW_REPEAT REPEAT}
+ * @param mods bitfield describing which modifiers keys were held down + */ + void invoke(@NativeType("GLFWwindow *") long window, int key, int scancode, int action, int mods); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWMonitorCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWMonitorCallback.java new file mode 100644 index 00000000..a67265e2 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWMonitorCallback.java @@ -0,0 +1,86 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +import static org.lwjgl.glfw.GLFW.*; + +/** + * Instances of this class may be passed to the {@link GLFW#glfwSetMonitorCallback SetMonitorCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWmonitor *monitor,
+ *     int event
+ * )
+ * + * @since version 3.0 + */ +public abstract class GLFWMonitorCallback extends Callback implements GLFWMonitorCallbackI { + + /** + * Creates a {@code GLFWMonitorCallback} instance from the specified function pointer. + * + * @return the new {@code GLFWMonitorCallback} + */ + public static GLFWMonitorCallback create(long functionPointer) { + GLFWMonitorCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLFWMonitorCallback + ? (GLFWMonitorCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLFWMonitorCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLFWMonitorCallback} instance that delegates to the specified {@code GLFWMonitorCallbackI} instance. */ + public static GLFWMonitorCallback create(GLFWMonitorCallbackI instance) { + return instance instanceof GLFWMonitorCallback + ? (GLFWMonitorCallback)instance + : new Container(instance.address(), instance); + } + + protected GLFWMonitorCallback() { + super(SIGNATURE); + } + + GLFWMonitorCallback(long functionPointer) { + super(functionPointer); + } + + /** See {@link GLFW#glfwSetMonitorCallback SetMonitorCallback}. */ + public GLFWMonitorCallback set() { + glfwSetMonitorCallback(this); + return this; + } + + private static final class Container extends GLFWMonitorCallback { + + private final GLFWMonitorCallbackI delegate; + + Container(long functionPointer, GLFWMonitorCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long monitor, int event) { + delegate.invoke(monitor, event); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWMonitorCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWMonitorCallbackI.java new file mode 100644 index 00000000..b0a215af --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWMonitorCallbackI.java @@ -0,0 +1,50 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link GLFW#glfwSetMonitorCallback SetMonitorCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWmonitor *monitor,
+ *     int event
+ * )
+ * + * @since version 3.0 + */ +@FunctionalInterface +@NativeType("GLFWmonitorfun") +public interface GLFWMonitorCallbackI extends CallbackI.V { + + String SIGNATURE = "(pi)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgPointer(args), + dcbArgInt(args) + ); + } + + /** + * Will be called when a monitor is connected to or disconnected from the system. + * + * @param monitor the monitor that was connected or disconnected + * @param event one of {@link GLFW#GLFW_CONNECTED CONNECTED} or {@link GLFW#GLFW_DISCONNECTED DISCONNECTED}. Remaining values reserved for future use. + */ + void invoke(@NativeType("GLFWmonitor *") long monitor, int event); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWMouseButtonCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWMouseButtonCallback.java new file mode 100644 index 00000000..0edc6ff3 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWMouseButtonCallback.java @@ -0,0 +1,86 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +import static org.lwjgl.glfw.GLFW.*; + +/** + * Instances of this class may be passed to the {@link GLFW#glfwSetMouseButtonCallback SetMouseButtonCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     int button,
+ *     int action,
+ *     int mods
+ * )
+ */ +public abstract class GLFWMouseButtonCallback extends Callback implements GLFWMouseButtonCallbackI { + + /** + * Creates a {@code GLFWMouseButtonCallback} instance from the specified function pointer. + * + * @return the new {@code GLFWMouseButtonCallback} + */ + public static GLFWMouseButtonCallback create(long functionPointer) { + GLFWMouseButtonCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLFWMouseButtonCallback + ? (GLFWMouseButtonCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLFWMouseButtonCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLFWMouseButtonCallback} instance that delegates to the specified {@code GLFWMouseButtonCallbackI} instance. */ + public static GLFWMouseButtonCallback create(GLFWMouseButtonCallbackI instance) { + return instance instanceof GLFWMouseButtonCallback + ? (GLFWMouseButtonCallback)instance + : new Container(instance.address(), instance); + } + + protected GLFWMouseButtonCallback() { + super(SIGNATURE); + } + + GLFWMouseButtonCallback(long functionPointer) { + super(functionPointer); + } + + /** See {@link GLFW#glfwSetMouseButtonCallback SetMouseButtonCallback}. */ + public GLFWMouseButtonCallback set(long window) { + glfwSetMouseButtonCallback(window, this); + return this; + } + + private static final class Container extends GLFWMouseButtonCallback { + + private final GLFWMouseButtonCallbackI delegate; + + Container(long functionPointer, GLFWMouseButtonCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long window, int button, int action, int mods) { + delegate.invoke(window, button, action, mods); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWMouseButtonCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWMouseButtonCallbackI.java new file mode 100644 index 00000000..e9664b00 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWMouseButtonCallbackI.java @@ -0,0 +1,54 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link GLFW#glfwSetMouseButtonCallback SetMouseButtonCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     int button,
+ *     int action,
+ *     int mods
+ * )
+ */ +@FunctionalInterface +@NativeType("GLFWmousebuttonfun") +public interface GLFWMouseButtonCallbackI extends CallbackI.V { + + String SIGNATURE = "(piii)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgPointer(args), + dcbArgInt(args), + dcbArgInt(args), + dcbArgInt(args) + ); + } + + /** + * Will be called when a mouse button is pressed or released. + * + * @param window the window that received the event + * @param button the mouse button that was pressed or released + * @param action the button action. One of:
{@link GLFW#GLFW_PRESS PRESS}{@link GLFW#GLFW_RELEASE RELEASE}{@link GLFW#GLFW_REPEAT REPEAT}
+ * @param mods bitfield describing which modifiers keys were held down + */ + void invoke(@NativeType("GLFWwindow *") long window, int button, int action, int mods); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeCocoa.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeCocoa.java new file mode 100644 index 00000000..d85aef89 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeCocoa.java @@ -0,0 +1,77 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; + +/** Native bindings to the GLFW library's Cocoa native access functions. */ +public class GLFWNativeCocoa { + + protected GLFWNativeCocoa() { + throw new UnsupportedOperationException(); + } + + /** Contains the function pointers loaded from {@code GLFW.getLibrary()}. */ + public static final class Functions { + + private Functions() {} + + /** Function address. */ + public static final long + GetCocoaMonitor = apiGetFunctionAddress(GLFW.getLibrary(), "glfwGetCocoaMonitor"), + GetCocoaWindow = apiGetFunctionAddress(GLFW.getLibrary(), "glfwGetCocoaWindow"); + + } + + // --- [ glfwGetCocoaMonitor ] --- + + /** + * Returns the {@code CGDirectDisplayID} of the specified monitor. + * + *

Note: This function may be called from any thread. Access is not synchronized.

+ * + * @param monitor the GLFW monitor + * + * @return The {@code CGDirectDisplayID} of the specified monitor, or {@code kCGNullDirectDisplay} if an error occurred. + * + * @since version 3.1 + */ + @NativeType("CGDirectDisplayID") + public static int glfwGetCocoaMonitor(@NativeType("GLFWmonitor *") long monitor) { + long __functionAddress = Functions.GetCocoaMonitor; + if (CHECKS) { + check(monitor); + } + return invokePI(monitor, __functionAddress); + } + + // --- [ glfwGetCocoaWindow ] --- + + /** + * Returns the {@code NSWindow} of the specified GLFW window. + * + *

Note: This function may be called from any thread. Access is not synchronized.

+ * + * @param window the GLFW window + * + * @return The {@code NSWindow} of the specified window, or nil if an error occurred. + * + * @since version 3.0 + */ + @NativeType("id") + public static long glfwGetCocoaWindow(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.GetCocoaWindow; + if (CHECKS) { + check(window); + } + return invokePP(window, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeEGL.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeEGL.java new file mode 100644 index 00000000..12ee07a5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeEGL.java @@ -0,0 +1,94 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; + + +/** Native bindings to the GLFW library's EGL native access functions. */ +public class GLFWNativeEGL { + + protected GLFWNativeEGL() { + throw new UnsupportedOperationException(); + } + + /** Contains the function pointers loaded from {@code GLFW.getLibrary()}. */ + public static final class Functions { + + private Functions() {} + + /** Function address. */ + public static final long + GetEGLDisplay = apiGetFunctionAddress(GLFW.getLibrary(), "glfwGetEGLDisplay"), + GetEGLContext = apiGetFunctionAddress(GLFW.getLibrary(), "glfwGetEGLContext"), + GetEGLSurface = apiGetFunctionAddress(GLFW.getLibrary(), "glfwGetEGLSurface"); + + } + + // --- [ glfwGetEGLDisplay ] --- + + /** + * Returns the {@code EGLDisplay} used by GLFW. + * + *

This function may be called from any thread. Access is not synchronized.

+ * + * @return the {@code EGLDisplay} used by GLFW, or {@link EGL10#EGL_NO_DISPLAY} if an error occured + * + * @since version 3.0 + */ + @NativeType("EGLDisplay") + public static long glfwGetEGLDisplay() { + long __functionAddress = Functions.GetEGLDisplay; + return invokeP(__functionAddress); + } + + // --- [ glfwGetEGLContext ] --- + + /** + * Returns the {@code EGLContext} of the specified window. + * + *

This function may be called from any thread. Access is not synchronized.

+ * + * @param window a GLFW window + * + * @return the {@code EGLContext} of the specified window, or {@link EGL10#EGL_NO_CONTEXT} if an error occurred + * + * @since version 3.0 + */ + @NativeType("EGLContext") + public static long glfwGetEGLContext(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.GetEGLContext; + if (CHECKS) { + check(window); + } + return invokePP(window, __functionAddress); + } + + // --- [ glfwGetEGLSurface ] --- + + /** + * Returns the {@code EGLSurface} of the specified window. + * + *

This function may be called from any thread. Access is not synchronized.

+ * + * @return the {@code EGLSurface} of the specified window, or {@link EGL10#EGL_NO_SURFACE} if an error occurred + * + * @since version 3.0 + */ + @NativeType("EGLSurface") + public static long glfwGetEGLSurface(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.GetEGLSurface; + if (CHECKS) { + check(window); + } + return invokePP(window, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeGLX.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeGLX.java new file mode 100644 index 00000000..eeef6728 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeGLX.java @@ -0,0 +1,77 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; + +/** Native bindings to the GLFW library's GLX native access functions. */ +public class GLFWNativeGLX { + + protected GLFWNativeGLX() { + throw new UnsupportedOperationException(); + } + + /** Contains the function pointers loaded from {@code GLFW.getLibrary()}. */ + public static final class Functions { + + private Functions() {} + + /** Function address. */ + public static final long + GetGLXContext = apiGetFunctionAddress(GLFW.getLibrary(), "glfwGetGLXContext"), + GetGLXWindow = apiGetFunctionAddress(GLFW.getLibrary(), "glfwGetGLXWindow"); + + } + + // --- [ glfwGetGLXContext ] --- + + /** + * Returns the {@code GLXContext} of the specified window. + * + *

This function may be called from any thread. Access is not synchronized.

+ * + * @param window a GLFW window + * + * @return the {@code GLXContext} of the specified window, or {@code NULL} if an error occurred. + * + * @since version 3.0 + */ + @NativeType("GLXContext") + public static long glfwGetGLXContext(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.GetGLXContext; + if (CHECKS) { + check(window); + } + return invokePP(window, __functionAddress); + } + + // --- [ glfwGetGLXWindow ] --- + + /** + * Returns the {@code GLXWindow} of the specified window. + * + *

This function may be called from any thread. Access is not synchronized.

+ * + * @param window a GLFW window + * + * @return the {@code GLXWindow} of the specified window, or {@code None} if an error occurred. + * + * @since version 3.2 + */ + @NativeType("GLXWindow") + public static long glfwGetGLXWindow(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.GetGLXWindow; + if (CHECKS) { + check(window); + } + return invokePP(window, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeNSGL.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeNSGL.java new file mode 100644 index 00000000..c025b9dc --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeNSGL.java @@ -0,0 +1,54 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; + +/** Native bindings to the GLFW library's NSGL native access functions. */ +public class GLFWNativeNSGL { + + protected GLFWNativeNSGL() { + throw new UnsupportedOperationException(); + } + + /** Contains the function pointers loaded from {@code GLFW.getLibrary()}. */ + public static final class Functions { + + private Functions() {} + + /** Function address. */ + public static final long + GetNSGLContext = apiGetFunctionAddress(GLFW.getLibrary(), "glfwGetNSGLContext"); + + } + + // --- [ glfwGetNSGLContext ] --- + + /** + * Returns the {@code NSOpenGLContext} of the specified GLFW window. + * + *

Note: This function may be called from any thread. Access is not synchronized.

+ * + * @param window the GLFW window + * + * @return The {@code NSOpenGLContext} of the specified window, or nil if an error occurred. + * + * @since version 3.0 + */ + @NativeType("id") + public static long glfwGetNSGLContext(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.GetNSGLContext; + if (CHECKS) { + check(window); + } + return invokePP(window, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeWGL.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeWGL.java new file mode 100644 index 00000000..69f2688b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeWGL.java @@ -0,0 +1,54 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; + +/** Native bindings to the GLFW library's WGL native access functions. */ +public class GLFWNativeWGL { + + protected GLFWNativeWGL() { + throw new UnsupportedOperationException(); + } + + /** Contains the function pointers loaded from {@code GLFW.getLibrary()}. */ + public static final class Functions { + + private Functions() {} + + /** Function address. */ + public static final long + GetWGLContext = apiGetFunctionAddress(GLFW.getLibrary(), "glfwGetWGLContext"); + + } + + // --- [ glfwGetWGLContext ] --- + + /** + * Returns the {@code HGLRC} of the specified window. + * + *

Note: This function may be called from any thread. Access is not synchronized.

+ * + * @param window the GLFW window + * + * @return The {@code HGLRC} of the specified window, or {@code NULL} if an error occurred. + * + * @since version 3.0 + */ + @NativeType("HGLRC") + public static long glfwGetWGLContext(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.GetWGLContext; + if (CHECKS) { + check(window); + } + return invokePP(window, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeWayland.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeWayland.java new file mode 100644 index 00000000..50fae437 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeWayland.java @@ -0,0 +1,91 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; + +/** Native bindings to the GLFW library's Wayland native access functions. */ +public class GLFWNativeWayland { + + protected GLFWNativeWayland() { + throw new UnsupportedOperationException(); + } + + /** Contains the function pointers loaded from {@code GLFW.getLibrary()}. */ + public static final class Functions { + + private Functions() {} + + /** Function address. */ + public static final long + GetWaylandDisplay = apiGetFunctionAddress(GLFW.getLibrary(), "glfwGetWaylandDisplay"), + GetWaylandMonitor = apiGetFunctionAddress(GLFW.getLibrary(), "glfwGetWaylandMonitor"), + GetWaylandWindow = apiGetFunctionAddress(GLFW.getLibrary(), "glfwGetWaylandWindow"); + + } + + // --- [ glfwGetWaylandDisplay ] --- + + /** + * Returns the {@code struct wl_display*} used by GLFW. + * + *

This function may be called from any thread. Access is not synchronized.

+ * + * @return the {@code struct wl_display*} used by GLFW, or {@code NULL} if an error occurred. + * + * @since version 3.2 + */ + @NativeType("struct wl_display *") + public static long glfwGetWaylandDisplay() { + long __functionAddress = Functions.GetWaylandDisplay; + return invokeP(__functionAddress); + } + + // --- [ glfwGetWaylandMonitor ] --- + + /** + * Returns the {@code struct wl_output*} of the specified monitor. + * + *

This function may be called from any thread. Access is not synchronized.

+ * + * @return the {@code struct wl_output*} of the specified monitor, or {@code NULL} if an error occurred. + * + * @since version 3.2 + */ + @NativeType("struct wl_output *") + public static long glfwGetWaylandMonitor(@NativeType("GLFWmonitor *") long monitor) { + long __functionAddress = Functions.GetWaylandMonitor; + if (CHECKS) { + check(monitor); + } + return invokePP(monitor, __functionAddress); + } + + // --- [ glfwGetWaylandWindow ] --- + + /** + * Returns the main {@code struct wl_surface*} of the specified window. + * + *

This function may be called from any thread. Access is not synchronized.

+ * + * @return the main {@code struct wl_surface*} of the specified window, or {@code NULL} if an error occurred. + * + * @since version 3.2 + */ + @NativeType("struct wl_surface *") + public static long glfwGetWaylandWindow(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.GetWaylandWindow; + if (CHECKS) { + check(window); + } + return invokePP(window, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeWin32.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeWin32.java new file mode 100644 index 00000000..d65d236a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeWin32.java @@ -0,0 +1,146 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to the GLFW library's Win32 native access functions. */ +public class GLFWNativeWin32 { + + protected GLFWNativeWin32() { + throw new UnsupportedOperationException(); + } + + /** Contains the function pointers loaded from {@code GLFW.getLibrary()}. */ + public static final class Functions { + + private Functions() {} + + /** Function address. */ + public static final long + GetWin32Adapter = apiGetFunctionAddress(GLFW.getLibrary(), "glfwGetWin32Adapter"), + GetWin32Monitor = apiGetFunctionAddress(GLFW.getLibrary(), "glfwGetWin32Monitor"), + GetWin32Window = apiGetFunctionAddress(GLFW.getLibrary(), "glfwGetWin32Window"), + AttachWin32Window = apiGetFunctionAddress(GLFW.getLibrary(), "glfwAttachWin32Window"); + + } + + // --- [ glfwGetWin32Adapter ] --- + + /** Unsafe version of: {@link #glfwGetWin32Adapter GetWin32Adapter} */ + public static long nglfwGetWin32Adapter(long monitor) { + long __functionAddress = Functions.GetWin32Adapter; + if (CHECKS) { + check(monitor); + } + return invokePP(monitor, __functionAddress); + } + + /** + * Returns the adapter device name of the specified monitor. + * + *

Note: This function may be called from any thread. Access is not synchronized.

+ * + * @param monitor the GLFW monitor + * + * @return the UTF-8 encoded adapter device name (for example `\\.\DISPLAY1`) of the specified monitor, or {@code NULL} if an error occurred + * + * @since version 3.1 + */ + @Nullable + @NativeType("char const *") + public static String glfwGetWin32Adapter(@NativeType("GLFWmonitor *") long monitor) { + long __result = nglfwGetWin32Adapter(monitor); + return memUTF8Safe(__result); + } + + // --- [ glfwGetWin32Monitor ] --- + + /** Unsafe version of: {@link #glfwGetWin32Monitor GetWin32Monitor} */ + public static long nglfwGetWin32Monitor(long monitor) { + long __functionAddress = Functions.GetWin32Monitor; + if (CHECKS) { + check(monitor); + } + return invokePP(monitor, __functionAddress); + } + + /** + * Returns the display device name of the specified monitor. + * + *

Note: This function may be called from any thread. Access is not synchronized.

+ * + * @param monitor the GLFW monitor + * + * @return the UTF-8 encoded display device name (for example `\\.\DISPLAY1\Monitor0`) of the specified monitor, or {@code NULL} if an error occurred + * + * @since version 3.1 + */ + @Nullable + @NativeType("char const *") + public static String glfwGetWin32Monitor(@NativeType("GLFWmonitor *") long monitor) { + long __result = nglfwGetWin32Monitor(monitor); + return memUTF8Safe(__result); + } + + // --- [ glfwGetWin32Window ] --- + + /** + * Returns the {@code HWND} of the specified window. + * + *

Note: This function may be called from any thread. Access is not synchronized.

+ * + * @param window the GLFW window + * + * @return the {@code HWND} of the specified window, or {@code NULL} if an error occurred + * + * @since version 3.0 + */ + @NativeType("HWND") + public static long glfwGetWin32Window(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.GetWin32Window; + if (CHECKS) { + check(window); + } + return invokePP(window, __functionAddress); + } + + // --- [ glfwAttachWin32Window ] --- + + /** + * Wraps an existing {@code HWND} in a new GLFW window object. + * + *

This function creates a GLFW window object and its associated OpenGL or OpenGL ES context for an existing {@code HWND}. The {@code HWND} is not + * destroyed by GLFW.

+ * + *

This function may be called from any thread.

+ * + *

LWJGL: This functionality is experimental and not officially supported by GLFW yet.

+ * + * @param handle the {@code HWND} to attach to the window object + * @param share the window whose context to share resources with, or {@code NULL} to not share resources + * + * @return the handle of the created window, or {@code NULL} if an error occurred + * + * @since version 3.3 + */ + @NativeType("GLFWwindow *") + public static long glfwAttachWin32Window(@NativeType("HWND") long handle, @NativeType("GLFWwindow *") long share) { + long __functionAddress = Functions.AttachWin32Window; + if (CHECKS) { + check(handle); + } + return invokePPP(handle, share, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeX11.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeX11.java new file mode 100644 index 00000000..57fe2114 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWNativeX11.java @@ -0,0 +1,199 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to the GLFW library's X11 native access functions. */ +public class GLFWNativeX11 { + + protected GLFWNativeX11() { + throw new UnsupportedOperationException(); + } + + /** Contains the function pointers loaded from {@code GLFW.getLibrary()}. */ + public static final class Functions { + + private Functions() {} + + /** Function address. */ + public static final long + GetX11Display = apiGetFunctionAddress(GLFW.getLibrary(), "glfwGetX11Display"), + GetX11Adapter = apiGetFunctionAddress(GLFW.getLibrary(), "glfwGetX11Adapter"), + GetX11Monitor = apiGetFunctionAddress(GLFW.getLibrary(), "glfwGetX11Monitor"), + GetX11Window = apiGetFunctionAddress(GLFW.getLibrary(), "glfwGetX11Window"), + SetX11SelectionString = apiGetFunctionAddress(GLFW.getLibrary(), "glfwSetX11SelectionString"), + GetX11SelectionString = apiGetFunctionAddress(GLFW.getLibrary(), "glfwGetX11SelectionString"); + + } + + // --- [ glfwGetX11Display ] --- + + /** + * Returns the {@code Display} used by GLFW. + * + *

Note: This function may be called from any thread. Access is not synchronized.

+ * + * @return The {@code Display} used by GLFW, or {@code NULL} if an error occurred. + * + * @since version 3.0 + */ + @NativeType("Display *") + public static long glfwGetX11Display() { + long __functionAddress = Functions.GetX11Display; + return invokeP(__functionAddress); + } + + // --- [ glfwGetX11Adapter ] --- + + /** + * Returns the {@code RRCrtc} of the specified monitor. + * + *

Note: This function may be called from any thread. Access is not synchronized.

+ * + * @param monitor the GLFW monitor + * + * @return The {@code RRCrtc} of the specified monitor, or {@code None} if an error occurred. + * + * @since version 3.1 + */ + @NativeType("RRCrtc") + public static long glfwGetX11Adapter(@NativeType("GLFWmonitor *") long monitor) { + long __functionAddress = Functions.GetX11Adapter; + if (CHECKS) { + check(monitor); + } + return invokePN(monitor, __functionAddress); + } + + // --- [ glfwGetX11Monitor ] --- + + /** + * Returns the {@code RROutput} of the specified monitor. + * + *

Note: This function may be called from any thread. Access is not synchronized.

+ * + * @param monitor the GLFW monitor + * + * @return The {@code RROutput} of the specified monitor, or {@code None} if an error occurred. + * + * @since version 3.1 + */ + @NativeType("RROutput") + public static long glfwGetX11Monitor(@NativeType("GLFWmonitor *") long monitor) { + long __functionAddress = Functions.GetX11Monitor; + if (CHECKS) { + check(monitor); + } + return invokePN(monitor, __functionAddress); + } + + // --- [ glfwGetX11Window ] --- + + /** + * Returns the {@code Window} of the specified window. + * + *

Note: This function may be called from any thread. Access is not synchronized.

+ * + * @param window a GLFW window + * + * @return The {@code Window} of the specified window, or {@code None} if an error occurred. + * + * @since version 3.0 + */ + @NativeType("Window") + public static long glfwGetX11Window(@NativeType("GLFWwindow *") long window) { + long __functionAddress = Functions.GetX11Window; + if (CHECKS) { + check(window); + } + return invokePN(window, __functionAddress); + } + + // --- [ glfwSetX11SelectionString ] --- + + /** Unsafe version of: {@link #glfwSetX11SelectionString SetX11SelectionString} */ + public static void nglfwSetX11SelectionString(long string) { + long __functionAddress = Functions.SetX11SelectionString; + invokePV(string, __functionAddress); + } + + /** + * Sets the current primary selection to the specified string. + * + *

This function must only be called from the main thread.

+ * + * @param string a UTF-8 encoded string. The specified string is copied before this function returns. + * + * @since version 3.3 + */ + public static void glfwSetX11SelectionString(@NativeType("char const *") ByteBuffer string) { + if (CHECKS) { + checkNT1(string); + } + nglfwSetX11SelectionString(memAddress(string)); + } + + /** + * Sets the current primary selection to the specified string. + * + *

This function must only be called from the main thread.

+ * + * @param string a UTF-8 encoded string. The specified string is copied before this function returns. + * + * @since version 3.3 + */ + public static void glfwSetX11SelectionString(@NativeType("char const *") CharSequence string) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(string, true); + long stringEncoded = stack.getPointerAddress(); + nglfwSetX11SelectionString(stringEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glfwGetX11SelectionString ] --- + + /** Unsafe version of: {@link #glfwGetX11SelectionString GetX11SelectionString} */ + public static long nglfwGetX11SelectionString() { + long __functionAddress = Functions.GetX11SelectionString; + return invokeP(__functionAddress); + } + + /** + * Returns the contents of the current primary selection as a string. + * + *

If the selection is empty or if its contents cannot be converted, {@code NULL} is returned and a {@link GLFW#GLFW_FORMAT_UNAVAILABLE FORMAT_UNAVAILABLE} error is generated.

+ * + *

The returned string is allocated and freed by GLFW. You should not free it yourself. It is valid until the next call to {@link #glfwGetX11SelectionString GetX11SelectionString} or + * {@link #glfwSetX11SelectionString SetX11SelectionString}, or until the library is terminated.

+ * + *

This function must only be called from the main thread.

+ * + * @return the contents of the selection as a UTF-8 encoded string, or {@code NULL} if an error occurred + * + * @since version 3.3 + */ + @Nullable + @NativeType("char const *") + public static String glfwGetX11SelectionString() { + long __result = nglfwGetX11SelectionString(); + return memUTF8Safe(__result); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWScrollCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWScrollCallback.java new file mode 100644 index 00000000..4a305a8b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWScrollCallback.java @@ -0,0 +1,87 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +import static org.lwjgl.glfw.GLFW.*; + +/** + * Instances of this class may be passed to the {@link GLFW#glfwSetScrollCallback SetScrollCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     double xoffset,
+ *     double yoffset
+ * )
+ * + * @since version 3.0 + */ +public abstract class GLFWScrollCallback extends Callback implements GLFWScrollCallbackI { + + /** + * Creates a {@code GLFWScrollCallback} instance from the specified function pointer. + * + * @return the new {@code GLFWScrollCallback} + */ + public static GLFWScrollCallback create(long functionPointer) { + GLFWScrollCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLFWScrollCallback + ? (GLFWScrollCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLFWScrollCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLFWScrollCallback} instance that delegates to the specified {@code GLFWScrollCallbackI} instance. */ + public static GLFWScrollCallback create(GLFWScrollCallbackI instance) { + return instance instanceof GLFWScrollCallback + ? (GLFWScrollCallback)instance + : new Container(instance.address(), instance); + } + + protected GLFWScrollCallback() { + super(SIGNATURE); + } + + GLFWScrollCallback(long functionPointer) { + super(functionPointer); + } + + /** See {@link GLFW#glfwSetScrollCallback SetScrollCallback}. */ + public GLFWScrollCallback set(long window) { + glfwSetScrollCallback(window, this); + return this; + } + + private static final class Container extends GLFWScrollCallback { + + private final GLFWScrollCallbackI delegate; + + Container(long functionPointer, GLFWScrollCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long window, double xoffset, double yoffset) { + delegate.invoke(window, xoffset, yoffset); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWScrollCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWScrollCallbackI.java new file mode 100644 index 00000000..b467832a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWScrollCallbackI.java @@ -0,0 +1,53 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link GLFW#glfwSetScrollCallback SetScrollCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     double xoffset,
+ *     double yoffset
+ * )
+ * + * @since version 3.0 + */ +@FunctionalInterface +@NativeType("GLFWscrollfun") +public interface GLFWScrollCallbackI extends CallbackI.V { + + String SIGNATURE = "(pdd)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgPointer(args), + dcbArgDouble(args), + dcbArgDouble(args) + ); + } + + /** + * Will be called when a scrolling device is used, such as a mouse wheel or scrolling area of a touchpad. + * + * @param window the window that received the event + * @param xoffset the scroll offset along the x-axis + * @param yoffset the scroll offset along the y-axis + */ + void invoke(@NativeType("GLFWwindow *") long window, double xoffset, double yoffset); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWVidMode.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWVidMode.java new file mode 100644 index 00000000..007fd20d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWVidMode.java @@ -0,0 +1,204 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Describes a single video mode. + * + *

Member documentation

+ * + *
    + *
  • {@code width} – the width, in screen coordinates, of the video mode
  • + *
  • {@code height} – the height, in screen coordinates, of the video mode
  • + *
  • {@code redBits} – the bit depth of the red channel of the video mode
  • + *
  • {@code greenBits} – the bit depth of the green channel of the video mode
  • + *
  • {@code blueBits} – the bit depth of the blue channel of the video mode
  • + *
  • {@code refreshRate} – the refresh rate, in Hz, of the video mode
  • + *
+ * + *

Layout

+ * + *

+ * struct GLFWvidmode {
+ *     int width;
+ *     int height;
+ *     int redBits;
+ *     int greenBits;
+ *     int blueBits;
+ *     int refreshRate;
+ * }
+ */ +@NativeType("struct GLFWvidmode") +public class GLFWVidMode extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + WIDTH, + HEIGHT, + REDBITS, + GREENBITS, + BLUEBITS, + REFRESHRATE; + + static { + Layout layout = __struct( + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + WIDTH = layout.offsetof(0); + HEIGHT = layout.offsetof(1); + REDBITS = layout.offsetof(2); + GREENBITS = layout.offsetof(3); + BLUEBITS = layout.offsetof(4); + REFRESHRATE = layout.offsetof(5); + } + + /** + * Creates a {@code GLFWVidMode} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public GLFWVidMode(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code width} field. */ + public int width() { return nwidth(address()); } + /** Returns the value of the {@code height} field. */ + public int height() { return nheight(address()); } + /** Returns the value of the {@code redBits} field. */ + public int redBits() { return nredBits(address()); } + /** Returns the value of the {@code greenBits} field. */ + public int greenBits() { return ngreenBits(address()); } + /** Returns the value of the {@code blueBits} field. */ + public int blueBits() { return nblueBits(address()); } + /** Returns the value of the {@code refreshRate} field. */ + public int refreshRate() { return nrefreshRate(address()); } + + // ----------------------------------- + + /** Returns a new {@code GLFWVidMode} instance for the specified memory address. */ + public static GLFWVidMode create(long address) { + return wrap(GLFWVidMode.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static GLFWVidMode createSafe(long address) { + return address == NULL ? null : wrap(GLFWVidMode.class, address); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #width}. */ + public static int nwidth(long struct) { return UNSAFE.getInt(null, struct + GLFWVidMode.WIDTH); } + /** Unsafe version of {@link #height}. */ + public static int nheight(long struct) { return UNSAFE.getInt(null, struct + GLFWVidMode.HEIGHT); } + /** Unsafe version of {@link #redBits}. */ + public static int nredBits(long struct) { return UNSAFE.getInt(null, struct + GLFWVidMode.REDBITS); } + /** Unsafe version of {@link #greenBits}. */ + public static int ngreenBits(long struct) { return UNSAFE.getInt(null, struct + GLFWVidMode.GREENBITS); } + /** Unsafe version of {@link #blueBits}. */ + public static int nblueBits(long struct) { return UNSAFE.getInt(null, struct + GLFWVidMode.BLUEBITS); } + /** Unsafe version of {@link #refreshRate}. */ + public static int nrefreshRate(long struct) { return UNSAFE.getInt(null, struct + GLFWVidMode.REFRESHRATE); } + + // ----------------------------------- + + /** An array of {@link GLFWVidMode} structs. */ + public static class Buffer extends StructBuffer { + + private static final GLFWVidMode ELEMENT_FACTORY = GLFWVidMode.create(-1L); + + /** + * Creates a new {@code GLFWVidMode.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link GLFWVidMode#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected GLFWVidMode getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code width} field. */ + public int width() { return GLFWVidMode.nwidth(address()); } + /** Returns the value of the {@code height} field. */ + public int height() { return GLFWVidMode.nheight(address()); } + /** Returns the value of the {@code redBits} field. */ + public int redBits() { return GLFWVidMode.nredBits(address()); } + /** Returns the value of the {@code greenBits} field. */ + public int greenBits() { return GLFWVidMode.ngreenBits(address()); } + /** Returns the value of the {@code blueBits} field. */ + public int blueBits() { return GLFWVidMode.nblueBits(address()); } + /** Returns the value of the {@code refreshRate} field. */ + public int refreshRate() { return GLFWVidMode.nrefreshRate(address()); } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowCloseCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowCloseCallback.java new file mode 100644 index 00000000..da74a99c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowCloseCallback.java @@ -0,0 +1,85 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +import static org.lwjgl.glfw.GLFW.*; + +/** + * Instances of this class may be passed to the {@link GLFW#glfwSetWindowCloseCallback SetWindowCloseCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window
+ * )
+ * + * @since version 2.5 + */ +public abstract class GLFWWindowCloseCallback extends Callback implements GLFWWindowCloseCallbackI { + + /** + * Creates a {@code GLFWWindowCloseCallback} instance from the specified function pointer. + * + * @return the new {@code GLFWWindowCloseCallback} + */ + public static GLFWWindowCloseCallback create(long functionPointer) { + GLFWWindowCloseCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLFWWindowCloseCallback + ? (GLFWWindowCloseCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLFWWindowCloseCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLFWWindowCloseCallback} instance that delegates to the specified {@code GLFWWindowCloseCallbackI} instance. */ + public static GLFWWindowCloseCallback create(GLFWWindowCloseCallbackI instance) { + return instance instanceof GLFWWindowCloseCallback + ? (GLFWWindowCloseCallback)instance + : new Container(instance.address(), instance); + } + + protected GLFWWindowCloseCallback() { + super(SIGNATURE); + } + + GLFWWindowCloseCallback(long functionPointer) { + super(functionPointer); + } + + /** See {@link GLFW#glfwSetWindowCloseCallback SetWindowCloseCallback}. */ + public GLFWWindowCloseCallback set(long window) { + glfwSetWindowCloseCallback(window, this); + return this; + } + + private static final class Container extends GLFWWindowCloseCallback { + + private final GLFWWindowCloseCallbackI delegate; + + Container(long functionPointer, GLFWWindowCloseCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long window) { + delegate.invoke(window); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowCloseCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowCloseCallbackI.java new file mode 100644 index 00000000..f4357e29 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowCloseCallbackI.java @@ -0,0 +1,47 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link GLFW#glfwSetWindowCloseCallback SetWindowCloseCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window
+ * )
+ * + * @since version 2.5 + */ +@FunctionalInterface +@NativeType("GLFWwindowclosefun") +public interface GLFWWindowCloseCallbackI extends CallbackI.V { + + String SIGNATURE = "(p)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgPointer(args) + ); + } + + /** + * Will be called when the user attempts to close the specified window, for example by clicking the close widget in the title bar. + * + * @param window the window that the user attempted to close + */ + void invoke(@NativeType("GLFWwindow *") long window); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowContentScaleCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowContentScaleCallback.java new file mode 100644 index 00000000..8b61d637 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowContentScaleCallback.java @@ -0,0 +1,87 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +import static org.lwjgl.glfw.GLFW.*; + +/** + * Instances of this class may be passed to the {@link GLFW#glfwSetWindowContentScaleCallback SetWindowContentScaleCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     float xscale,
+ *     float yscale
+ * )
+ * + * @since version 3.3 + */ +public abstract class GLFWWindowContentScaleCallback extends Callback implements GLFWWindowContentScaleCallbackI { + + /** + * Creates a {@code GLFWWindowContentScaleCallback} instance from the specified function pointer. + * + * @return the new {@code GLFWWindowContentScaleCallback} + */ + public static GLFWWindowContentScaleCallback create(long functionPointer) { + GLFWWindowContentScaleCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLFWWindowContentScaleCallback + ? (GLFWWindowContentScaleCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLFWWindowContentScaleCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLFWWindowContentScaleCallback} instance that delegates to the specified {@code GLFWWindowContentScaleCallbackI} instance. */ + public static GLFWWindowContentScaleCallback create(GLFWWindowContentScaleCallbackI instance) { + return instance instanceof GLFWWindowContentScaleCallback + ? (GLFWWindowContentScaleCallback)instance + : new Container(instance.address(), instance); + } + + protected GLFWWindowContentScaleCallback() { + super(SIGNATURE); + } + + GLFWWindowContentScaleCallback(long functionPointer) { + super(functionPointer); + } + + /** See {@link GLFW#glfwSetWindowContentScaleCallback SetWindowContentScaleCallback}. */ + public GLFWWindowContentScaleCallback set(long window) { + glfwSetWindowContentScaleCallback(window, this); + return this; + } + + private static final class Container extends GLFWWindowContentScaleCallback { + + private final GLFWWindowContentScaleCallbackI delegate; + + Container(long functionPointer, GLFWWindowContentScaleCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long window, float xscale, float yscale) { + delegate.invoke(window, xscale, yscale); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowContentScaleCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowContentScaleCallbackI.java new file mode 100644 index 00000000..d3c979f6 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowContentScaleCallbackI.java @@ -0,0 +1,53 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link GLFW#glfwSetWindowContentScaleCallback SetWindowContentScaleCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     float xscale,
+ *     float yscale
+ * )
+ * + * @since version 3.3 + */ +@FunctionalInterface +@NativeType("GLFWwindowcontentscalefun") +public interface GLFWWindowContentScaleCallbackI extends CallbackI.V { + + String SIGNATURE = "(pff)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgPointer(args), + dcbArgFloat(args), + dcbArgFloat(args) + ); + } + + /** + * Will be called when the window content scale changes. + * + * @param window the window whose content scale changed + * @param xscale the new x-axis content scale of the window + * @param yscale the new y-axis content scale of the window + */ + void invoke(@NativeType("GLFWwindow *") long window, float xscale, float yscale); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowFocusCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowFocusCallback.java new file mode 100644 index 00000000..74b46665 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowFocusCallback.java @@ -0,0 +1,86 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +import static org.lwjgl.glfw.GLFW.*; + +/** + * Instances of this class may be passed to the {@link GLFW#glfwSetWindowFocusCallback SetWindowFocusCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     int focused
+ * )
+ * + * @since version 3.0 + */ +public abstract class GLFWWindowFocusCallback extends Callback implements GLFWWindowFocusCallbackI { + + /** + * Creates a {@code GLFWWindowFocusCallback} instance from the specified function pointer. + * + * @return the new {@code GLFWWindowFocusCallback} + */ + public static GLFWWindowFocusCallback create(long functionPointer) { + GLFWWindowFocusCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLFWWindowFocusCallback + ? (GLFWWindowFocusCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLFWWindowFocusCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLFWWindowFocusCallback} instance that delegates to the specified {@code GLFWWindowFocusCallbackI} instance. */ + public static GLFWWindowFocusCallback create(GLFWWindowFocusCallbackI instance) { + return instance instanceof GLFWWindowFocusCallback + ? (GLFWWindowFocusCallback)instance + : new Container(instance.address(), instance); + } + + protected GLFWWindowFocusCallback() { + super(SIGNATURE); + } + + GLFWWindowFocusCallback(long functionPointer) { + super(functionPointer); + } + + /** See {@link GLFW#glfwSetWindowFocusCallback SetWindowFocusCallback}. */ + public GLFWWindowFocusCallback set(long window) { + glfwSetWindowFocusCallback(window, this); + return this; + } + + private static final class Container extends GLFWWindowFocusCallback { + + private final GLFWWindowFocusCallbackI delegate; + + Container(long functionPointer, GLFWWindowFocusCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long window, boolean focused) { + delegate.invoke(window, focused); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowFocusCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowFocusCallbackI.java new file mode 100644 index 00000000..6ea92b12 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowFocusCallbackI.java @@ -0,0 +1,50 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link GLFW#glfwSetWindowFocusCallback SetWindowFocusCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     int focused
+ * )
+ * + * @since version 3.0 + */ +@FunctionalInterface +@NativeType("GLFWwindowfocusfun") +public interface GLFWWindowFocusCallbackI extends CallbackI.V { + + String SIGNATURE = "(pi)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgPointer(args), + dcbArgInt(args) != 0 + ); + } + + /** + * Will be called when the specified window gains or loses focus. + * + * @param window the window that was focused or defocused + * @param focused {@link GLFW#GLFW_TRUE TRUE} if the window was focused, or {@link GLFW#GLFW_FALSE FALSE} if it was defocused + */ + void invoke(@NativeType("GLFWwindow *") long window, @NativeType("int") boolean focused); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowIconifyCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowIconifyCallback.java new file mode 100644 index 00000000..a9616a17 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowIconifyCallback.java @@ -0,0 +1,86 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +import static org.lwjgl.glfw.GLFW.*; + +/** + * Instances of this class may be passed to the {@link GLFW#glfwSetWindowIconifyCallback SetWindowIconifyCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     int iconified
+ * )
+ * + * @since version 3.0 + */ +public abstract class GLFWWindowIconifyCallback extends Callback implements GLFWWindowIconifyCallbackI { + + /** + * Creates a {@code GLFWWindowIconifyCallback} instance from the specified function pointer. + * + * @return the new {@code GLFWWindowIconifyCallback} + */ + public static GLFWWindowIconifyCallback create(long functionPointer) { + GLFWWindowIconifyCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLFWWindowIconifyCallback + ? (GLFWWindowIconifyCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLFWWindowIconifyCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLFWWindowIconifyCallback} instance that delegates to the specified {@code GLFWWindowIconifyCallbackI} instance. */ + public static GLFWWindowIconifyCallback create(GLFWWindowIconifyCallbackI instance) { + return instance instanceof GLFWWindowIconifyCallback + ? (GLFWWindowIconifyCallback)instance + : new Container(instance.address(), instance); + } + + protected GLFWWindowIconifyCallback() { + super(SIGNATURE); + } + + GLFWWindowIconifyCallback(long functionPointer) { + super(functionPointer); + } + + /** See {@link GLFW#glfwSetWindowIconifyCallback SetWindowIconifyCallback}. */ + public GLFWWindowIconifyCallback set(long window) { + glfwSetWindowIconifyCallback(window, this); + return this; + } + + private static final class Container extends GLFWWindowIconifyCallback { + + private final GLFWWindowIconifyCallbackI delegate; + + Container(long functionPointer, GLFWWindowIconifyCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long window, boolean iconified) { + delegate.invoke(window, iconified); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowIconifyCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowIconifyCallbackI.java new file mode 100644 index 00000000..b2115968 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowIconifyCallbackI.java @@ -0,0 +1,50 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link GLFW#glfwSetWindowIconifyCallback SetWindowIconifyCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     int iconified
+ * )
+ * + * @since version 3.0 + */ +@FunctionalInterface +@NativeType("GLFWwindowiconifyfun") +public interface GLFWWindowIconifyCallbackI extends CallbackI.V { + + String SIGNATURE = "(pi)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgPointer(args), + dcbArgInt(args) != 0 + ); + } + + /** + * Will be called when the specified window is iconified or restored. + * + * @param window the window that was iconified or restored. + * @param iconified {@link GLFW#GLFW_TRUE TRUE} if the window was iconified, or {@link GLFW#GLFW_FALSE FALSE} if it was restored + */ + void invoke(@NativeType("GLFWwindow *") long window, @NativeType("int") boolean iconified); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowMaximizeCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowMaximizeCallback.java new file mode 100644 index 00000000..b8e93649 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowMaximizeCallback.java @@ -0,0 +1,86 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +import static org.lwjgl.glfw.GLFW.*; + +/** + * Instances of this class may be passed to the {@link GLFW#glfwSetWindowMaximizeCallback SetWindowMaximizeCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     int maximized
+ * )
+ * + * @since version 3.3 + */ +public abstract class GLFWWindowMaximizeCallback extends Callback implements GLFWWindowMaximizeCallbackI { + + /** + * Creates a {@code GLFWWindowMaximizeCallback} instance from the specified function pointer. + * + * @return the new {@code GLFWWindowMaximizeCallback} + */ + public static GLFWWindowMaximizeCallback create(long functionPointer) { + GLFWWindowMaximizeCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLFWWindowMaximizeCallback + ? (GLFWWindowMaximizeCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLFWWindowMaximizeCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLFWWindowMaximizeCallback} instance that delegates to the specified {@code GLFWWindowMaximizeCallbackI} instance. */ + public static GLFWWindowMaximizeCallback create(GLFWWindowMaximizeCallbackI instance) { + return instance instanceof GLFWWindowMaximizeCallback + ? (GLFWWindowMaximizeCallback)instance + : new Container(instance.address(), instance); + } + + protected GLFWWindowMaximizeCallback() { + super(SIGNATURE); + } + + GLFWWindowMaximizeCallback(long functionPointer) { + super(functionPointer); + } + + /** See {@link GLFW#glfwSetWindowMaximizeCallback SetWindowMaximizeCallback}. */ + public GLFWWindowMaximizeCallback set(long window) { + glfwSetWindowMaximizeCallback(window, this); + return this; + } + + private static final class Container extends GLFWWindowMaximizeCallback { + + private final GLFWWindowMaximizeCallbackI delegate; + + Container(long functionPointer, GLFWWindowMaximizeCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long window, boolean maximized) { + delegate.invoke(window, maximized); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowMaximizeCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowMaximizeCallbackI.java new file mode 100644 index 00000000..a698aaf2 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowMaximizeCallbackI.java @@ -0,0 +1,50 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link GLFW#glfwSetWindowMaximizeCallback SetWindowMaximizeCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     int maximized
+ * )
+ * + * @since version 3.3 + */ +@FunctionalInterface +@NativeType("GLFWwindowmaximizefun") +public interface GLFWWindowMaximizeCallbackI extends CallbackI.V { + + String SIGNATURE = "(pi)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgPointer(args), + dcbArgInt(args) != 0 + ); + } + + /** + * Will be called when the specified window is maximized or restored. + * + * @param window the window that was maximized or restored. + * @param maximized {@link GLFW#GLFW_TRUE TRUE} if the window was maximized, or {@link GLFW#GLFW_FALSE FALSE} if it was restored + */ + void invoke(@NativeType("GLFWwindow *") long window, @NativeType("int") boolean maximized); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowPosCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowPosCallback.java new file mode 100644 index 00000000..e4e1ee3d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowPosCallback.java @@ -0,0 +1,87 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +import static org.lwjgl.glfw.GLFW.*; + +/** + * Instances of this class may be passed to the {@link GLFW#glfwSetWindowPosCallback SetWindowPosCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     int xpos,
+ *     int ypos
+ * )
+ * + * @since version 3.0 + */ +public abstract class GLFWWindowPosCallback extends Callback implements GLFWWindowPosCallbackI { + + /** + * Creates a {@code GLFWWindowPosCallback} instance from the specified function pointer. + * + * @return the new {@code GLFWWindowPosCallback} + */ + public static GLFWWindowPosCallback create(long functionPointer) { + GLFWWindowPosCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLFWWindowPosCallback + ? (GLFWWindowPosCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLFWWindowPosCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLFWWindowPosCallback} instance that delegates to the specified {@code GLFWWindowPosCallbackI} instance. */ + public static GLFWWindowPosCallback create(GLFWWindowPosCallbackI instance) { + return instance instanceof GLFWWindowPosCallback + ? (GLFWWindowPosCallback)instance + : new Container(instance.address(), instance); + } + + protected GLFWWindowPosCallback() { + super(SIGNATURE); + } + + GLFWWindowPosCallback(long functionPointer) { + super(functionPointer); + } + + /** See {@link GLFW#glfwSetWindowPosCallback SetWindowPosCallback}. */ + public GLFWWindowPosCallback set(long window) { + glfwSetWindowPosCallback(window, this); + return this; + } + + private static final class Container extends GLFWWindowPosCallback { + + private final GLFWWindowPosCallbackI delegate; + + Container(long functionPointer, GLFWWindowPosCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long window, int xpos, int ypos) { + delegate.invoke(window, xpos, ypos); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowPosCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowPosCallbackI.java new file mode 100644 index 00000000..a945a27d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowPosCallbackI.java @@ -0,0 +1,53 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link GLFW#glfwSetWindowPosCallback SetWindowPosCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     int xpos,
+ *     int ypos
+ * )
+ * + * @since version 3.0 + */ +@FunctionalInterface +@NativeType("GLFWwindowposfun") +public interface GLFWWindowPosCallbackI extends CallbackI.V { + + String SIGNATURE = "(pii)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgPointer(args), + dcbArgInt(args), + dcbArgInt(args) + ); + } + + /** + * Will be called when the specified window moves. + * + * @param window the window that was moved + * @param xpos the new x-coordinate, in screen coordinates, of the upper-left corner of the content area of the window + * @param ypos the new y-coordinate, in screen coordinates, of the upper-left corner of the content area of the window + */ + void invoke(@NativeType("GLFWwindow *") long window, int xpos, int ypos); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowRefreshCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowRefreshCallback.java new file mode 100644 index 00000000..11ea1ed9 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowRefreshCallback.java @@ -0,0 +1,85 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +import static org.lwjgl.glfw.GLFW.*; + +/** + * Instances of this class may be passed to the {@link GLFW#glfwSetWindowRefreshCallback SetWindowRefreshCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window
+ * )
+ * + * @since version 2.5 + */ +public abstract class GLFWWindowRefreshCallback extends Callback implements GLFWWindowRefreshCallbackI { + + /** + * Creates a {@code GLFWWindowRefreshCallback} instance from the specified function pointer. + * + * @return the new {@code GLFWWindowRefreshCallback} + */ + public static GLFWWindowRefreshCallback create(long functionPointer) { + GLFWWindowRefreshCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLFWWindowRefreshCallback + ? (GLFWWindowRefreshCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLFWWindowRefreshCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLFWWindowRefreshCallback} instance that delegates to the specified {@code GLFWWindowRefreshCallbackI} instance. */ + public static GLFWWindowRefreshCallback create(GLFWWindowRefreshCallbackI instance) { + return instance instanceof GLFWWindowRefreshCallback + ? (GLFWWindowRefreshCallback)instance + : new Container(instance.address(), instance); + } + + protected GLFWWindowRefreshCallback() { + super(SIGNATURE); + } + + GLFWWindowRefreshCallback(long functionPointer) { + super(functionPointer); + } + + /** See {@link GLFW#glfwSetWindowRefreshCallback SetWindowRefreshCallback}. */ + public GLFWWindowRefreshCallback set(long window) { + glfwSetWindowRefreshCallback(window, this); + return this; + } + + private static final class Container extends GLFWWindowRefreshCallback { + + private final GLFWWindowRefreshCallbackI delegate; + + Container(long functionPointer, GLFWWindowRefreshCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long window) { + delegate.invoke(window); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowRefreshCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowRefreshCallbackI.java new file mode 100644 index 00000000..0fae1826 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowRefreshCallbackI.java @@ -0,0 +1,48 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link GLFW#glfwSetWindowRefreshCallback SetWindowRefreshCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window
+ * )
+ * + * @since version 2.5 + */ +@FunctionalInterface +@NativeType("GLFWwindowrefreshfun") +public interface GLFWWindowRefreshCallbackI extends CallbackI.V { + + String SIGNATURE = "(p)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgPointer(args) + ); + } + + /** + * Will be called when the client area of the specified window needs to be redrawn, for example if the window has been exposed after having been covered by + * another window. + * + * @param window the window whose content needs to be refreshed + */ + void invoke(@NativeType("GLFWwindow *") long window); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowSizeCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowSizeCallback.java new file mode 100644 index 00000000..f630ab39 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowSizeCallback.java @@ -0,0 +1,85 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +import static org.lwjgl.glfw.GLFW.*; + +/** + * Instances of this class may be passed to the {@link GLFW#glfwSetWindowSizeCallback SetWindowSizeCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     int width,
+ *     int height
+ * )
+ */ +public abstract class GLFWWindowSizeCallback extends Callback implements GLFWWindowSizeCallbackI { + + /** + * Creates a {@code GLFWWindowSizeCallback} instance from the specified function pointer. + * + * @return the new {@code GLFWWindowSizeCallback} + */ + public static GLFWWindowSizeCallback create(long functionPointer) { + GLFWWindowSizeCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLFWWindowSizeCallback + ? (GLFWWindowSizeCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLFWWindowSizeCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLFWWindowSizeCallback} instance that delegates to the specified {@code GLFWWindowSizeCallbackI} instance. */ + public static GLFWWindowSizeCallback create(GLFWWindowSizeCallbackI instance) { + return instance instanceof GLFWWindowSizeCallback + ? (GLFWWindowSizeCallback)instance + : new Container(instance.address(), instance); + } + + protected GLFWWindowSizeCallback() { + super(SIGNATURE); + } + + GLFWWindowSizeCallback(long functionPointer) { + super(functionPointer); + } + + /** See {@link GLFW#glfwSetWindowSizeCallback SetWindowSizeCallback}. */ + public GLFWWindowSizeCallback set(long window) { + glfwSetWindowSizeCallback(window, this); + return this; + } + + private static final class Container extends GLFWWindowSizeCallback { + + private final GLFWWindowSizeCallbackI delegate; + + Container(long functionPointer, GLFWWindowSizeCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long window, int width, int height) { + delegate.invoke(window, width, height); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowSizeCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowSizeCallbackI.java new file mode 100644 index 00000000..9e1d4f02 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/GLFWWindowSizeCallbackI.java @@ -0,0 +1,51 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.glfw; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link GLFW#glfwSetWindowSizeCallback SetWindowSizeCallback} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLFWwindow *window,
+ *     int width,
+ *     int height
+ * )
+ */ +@FunctionalInterface +@NativeType("GLFWwindowsizefun") +public interface GLFWWindowSizeCallbackI extends CallbackI.V { + + String SIGNATURE = "(pii)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgPointer(args), + dcbArgInt(args), + dcbArgInt(args) + ); + } + + /** + * Will be called when the specified window is resized. + * + * @param window the window that was resized + * @param width the new width, in screen coordinates, of the window + * @param height the new height, in screen coordinates, of the window + */ + void invoke(@NativeType("GLFWwindow *") long window, int width, int height); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/package-info.java b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/package-info.java new file mode 100644 index 00000000..d3c70029 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/glfw/package-info.java @@ -0,0 +1,20 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ + +/** + * Contains bindings to the GLFW library. + * + *

GLFW comes with extensive documentation, which you can read online here. The + * Frequently Asked Questions are also useful.

+ * + *

On macOS the JVM must be started with the {@code -XstartOnFirstThread} argument for GLFW to work. This is necessary because most GLFW functions must be + * called on the main thread and the Cocoa API on macOS requires that thread to be the first thread in the process. For this reason, on-screen GLFW + * windows and the GLFW event loop are incompatible with other window toolkits (such as AWT/Swing or JavaFX) on macOS. Off-screen GLFW windows can be used + * with other window toolkits, but only if the window toolkit is initialized before GLFW.

+ */ +@org.lwjgl.system.NonnullDefault +package org.lwjgl.glfw; + diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/AL.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/AL.java new file mode 100644 index 00000000..67f9ddf6 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/AL.java @@ -0,0 +1,264 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.openal; + +import org.lwjgl.system.*; + +import javax.annotation.*; +import java.nio.*; +import java.util.*; + +import static org.lwjgl.openal.AL10.*; +import static org.lwjgl.openal.EXTThreadLocalContext.*; +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * This class must be used before any OpenAL function is called. It has the following responsibilities: + *
    + *
  • Creates instances of {@link ALCapabilities} classes. An {@code ALCapabilities} instance contains flags for functionality that is available in an OpenAL + * context. Internally, it also contains function pointers that are only valid in that specific OpenAL context.
  • + *
  • Maintains thread-local and global state for {@code ALCapabilities} instances, corresponding to OpenAL contexts that are current in those threads and the + * entire process, respectively.
  • + *
+ * + *

ALCapabilities creation

+ *

Instances of {@code ALCapabilities} can be created with the {@link #createCapabilities} method. An OpenAL context must be current in the current thread + * or process before it is called. Calling this method is expensive, so {@code ALCapabilities} instances should be cached in user code.

+ * + *

Thread-local state

+ *

Before a function for a given OpenAL context can be called, the corresponding {@code ALCapabilities} instance must be made current in the current + * thread or process. The user is also responsible for clearing the current {@code ALCapabilities} instance when the context is destroyed or made current in + * another thread.

+ * + *

Note that OpenAL contexts are made current process-wide by default. Current thread-local contexts are only available if the + * {@link EXTThreadLocalContext ALC_EXT_thread_local_context} extension is supported by the OpenAL implementation. OpenAL Soft, the implementation + * that LWJGL ships with, supports this extension and performs better when it is used.

+ * + * @see ALC + */ +public final class AL { + + @Nullable + private static FunctionProvider functionProvider; + + @Nullable + private static ALCapabilities processCaps; + + private static final ThreadLocal capabilitiesTLS = new ThreadLocal<>(); + + private static ICD icd = new ICDStatic(); + + private AL() {} + + static void init() { + functionProvider = new FunctionProvider() { + // We'll use alGetProcAddress for both core and extension entry points. + // To do that, we need to first grab the alGetProcAddress function from + // the OpenAL native library. + private final long alGetProcAddress = ALC.getFunctionProvider().getFunctionAddress("alGetProcAddress"); + + @Override + public long getFunctionAddress(ByteBuffer functionName) { + long address = invokePP(memAddress(functionName), alGetProcAddress); + if (address == NULL && Checks.DEBUG_FUNCTIONS) { + apiLog("Failed to locate address for AL function " + memASCII(functionName)); + } + return address; + } + }; + } + + static void destroy() { + if (functionProvider == null) { + return; + } + + setCurrentProcess(null); + + functionProvider = null; + } + + /** + * Sets the specified {@link ALCapabilities} for the current process-wide OpenAL context. + * + *

If the current thread had a context current (see {@link #setCurrentThread}), those {@code ALCapabilities} are cleared. Any OpenAL functions called in + * the current thread, or any threads that have no context current, will use the specified {@code ALCapabilities}.

+ * + * @param caps the {@link ALCapabilities} to make current, or null + */ + public static void setCurrentProcess(@Nullable ALCapabilities caps) { + processCaps = caps; + capabilitiesTLS.set(null); // See EXT_thread_local_context, second Q. + icd.set(caps); + } + + /** + * Sets the specified {@link ALCapabilities} for the current OpenAL context in the current thread. + * + *

Any OpenAL functions called in the current thread will use the specified {@code ALCapabilities}.

+ * + * @param caps the {@link ALCapabilities} to make current, or null + */ + public static void setCurrentThread(@Nullable ALCapabilities caps) { + capabilitiesTLS.set(caps); + icd.set(caps); + } + + /** + * Returns the {@link ALCapabilities} for the OpenAL context that is current in the current thread or process. + * + * @throws IllegalStateException if no OpenAL context is current in the current thread or process + */ + public static ALCapabilities getCapabilities() { + ALCapabilities caps = capabilitiesTLS.get(); + if (caps == null) { + caps = processCaps; + } + + return checkCapabilities(caps); + } + + private static ALCapabilities checkCapabilities(@Nullable ALCapabilities caps) { + if (caps == null) { + throw new IllegalStateException( + "No ALCapabilities instance set for the current thread or process. Possible solutions:\n" + + "\ta) Call AL.createCapabilities() after making a context current.\n" + + "\tb) Call AL.setCurrentProcess() or AL.setCurrentThread() if an ALCapabilities instance already exists." + ); + } + return caps; + } + + /** + * Creates a new {@link ALCapabilities} instance for the OpenAL context that is current in the current thread or process. + * + * @param alcCaps the {@link ALCCapabilities} of the device associated with the current context + * + * @return the ALCapabilities instance + */ + public static ALCapabilities createCapabilities(ALCCapabilities alcCaps) { + FunctionProvider functionProvider = ALC.check(AL.functionProvider); + + ALCapabilities caps = null; + + try { + long GetString = functionProvider.getFunctionAddress("alGetString"); + long GetError = functionProvider.getFunctionAddress("alGetError"); + long IsExtensionPresent = functionProvider.getFunctionAddress("alIsExtensionPresent"); + if (GetString == NULL || GetError == NULL || IsExtensionPresent == NULL) { + throw new IllegalStateException("Core OpenAL functions could not be found. Make sure that the OpenAL library has been loaded correctly."); + } + + String versionString = memASCIISafe(invokeP(AL_VERSION, GetString)); + if (versionString == null || invokeI(GetError) != AL_NO_ERROR) { + throw new IllegalStateException("There is no OpenAL context current in the current thread or process."); + } + + APIVersion apiVersion = apiParseVersion(versionString); + + int majorVersion = apiVersion.major; + int minorVersion = apiVersion.minor; + + int[][] AL_VERSIONS = { + {0, 1} // OpenAL 1 + }; + + Set supportedExtensions = new HashSet<>(32); + + for (int major = 1; major <= AL_VERSIONS.length; major++) { + int[] minors = AL_VERSIONS[major - 1]; + for (int minor : minors) { + if (major < majorVersion || (major == majorVersion && minor <= minorVersion)) { + supportedExtensions.add("OpenAL" + major + minor); + } + } + } + + // Parse EXTENSIONS string + String extensionsString = memASCIISafe(invokeP(AL_EXTENSIONS, GetString)); + if (extensionsString != null) { + MemoryStack stack = stackGet(); + + StringTokenizer tokenizer = new StringTokenizer(extensionsString); + while (tokenizer.hasMoreTokens()) { + String extName = tokenizer.nextToken(); + try (MemoryStack frame = stack.push()) { + if (invokePZ(memAddress(frame.ASCII(extName, true)), IsExtensionPresent)) { + supportedExtensions.add(extName); + } + } + } + } + + if (alcCaps.ALC_EXT_EFX) { + supportedExtensions.add("ALC_EXT_EFX"); + } + + return caps = new ALCapabilities(functionProvider, supportedExtensions); + } finally { + if (alcCaps.ALC_EXT_thread_local_context && alcGetThreadContext() != NULL) { + setCurrentThread(caps); + } else { + setCurrentProcess(caps); + } + } + } + + static ALCapabilities getICD() { + return ALC.check(icd.get()); + } + + /** Function pointer provider. */ + private interface ICD { + default void set(@Nullable ALCapabilities caps) {} + @Nullable ALCapabilities get(); + } + + /** + * Write-once {@link ICD}. + * + *

This is the default implementation that skips the thread/process lookup. When a new ALCapabilities is set, we compare it to the write-once + * capabilities. If different function pointers are found, we fall back to the expensive lookup. This will never happen with the OpenAL-Soft + * implementation.

+ */ + private static class ICDStatic implements ICD { + + @Nullable + private static ALCapabilities tempCaps; + + @Override + public void set(@Nullable ALCapabilities caps) { + if (tempCaps == null) { + tempCaps = caps; + } else if (caps != null && caps != tempCaps && ThreadLocalUtil.areCapabilitiesDifferent(tempCaps.addresses, caps.addresses)) { + apiLog("[WARNING] Incompatible context detected. Falling back to thread/process lookup for AL contexts."); + icd = AL::getCapabilities; // fall back to thread/process lookup + } + } + + @Override + @Nullable + public ALCapabilities get() { + return WriteOnce.caps; + } + + private static final class WriteOnce { + // This will be initialized the first time get() above is called + @Nullable + static final ALCapabilities caps = ICDStatic.tempCaps; + + static { + if (caps == null) { + throw new IllegalStateException("No ALCapabilities instance has been set"); + } + } + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/AL10.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/AL10.java new file mode 100644 index 00000000..2aed8341 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/AL10.java @@ -0,0 +1,1878 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to AL 1.0 functionality. */ +public class AL10 { + + /** General tokens. */ + public static final int + AL_INVALID = 0xFFFFFFFF, + AL_NONE = 0x0, + AL_FALSE = 0x0, + AL_TRUE = 0x1; + + /** Error conditions. */ + public static final int + AL_NO_ERROR = 0x0, + AL_INVALID_NAME = 0xA001, + AL_INVALID_ENUM = 0xA002, + AL_INVALID_VALUE = 0xA003, + AL_INVALID_OPERATION = 0xA004, + AL_OUT_OF_MEMORY = 0xA005; + + /** Numerical queries. */ + public static final int + AL_DOPPLER_FACTOR = 0xC000, + AL_DISTANCE_MODEL = 0xD000; + + /** String queries. */ + public static final int + AL_VENDOR = 0xB001, + AL_VERSION = 0xB002, + AL_RENDERER = 0xB003, + AL_EXTENSIONS = 0xB004; + + /** Distance attenuation models. */ + public static final int + AL_INVERSE_DISTANCE = 0xD001, + AL_INVERSE_DISTANCE_CLAMPED = 0xD002; + + /** Source types. */ + public static final int + AL_SOURCE_ABSOLUTE = 0x201, + AL_SOURCE_RELATIVE = 0x202; + + /** Listener and Source attributes. */ + public static final int + AL_POSITION = 0x1004, + AL_VELOCITY = 0x1006, + AL_GAIN = 0x100A; + + /** Source attributes. */ + public static final int + AL_CONE_INNER_ANGLE = 0x1001, + AL_CONE_OUTER_ANGLE = 0x1002, + AL_PITCH = 0x1003, + AL_DIRECTION = 0x1005, + AL_LOOPING = 0x1007, + AL_BUFFER = 0x1009, + AL_SOURCE_STATE = 0x1010, + AL_CONE_OUTER_GAIN = 0x1022, + AL_SOURCE_TYPE = 0x1027; + + /** Source state. */ + public static final int + AL_INITIAL = 0x1011, + AL_PLAYING = 0x1012, + AL_PAUSED = 0x1013, + AL_STOPPED = 0x1014; + + /** Listener attributes. */ + public static final int AL_ORIENTATION = 0x100F; + + /** Queue state. */ + public static final int + AL_BUFFERS_QUEUED = 0x1015, + AL_BUFFERS_PROCESSED = 0x1016; + + /** Gain bounds. */ + public static final int + AL_MIN_GAIN = 0x100D, + AL_MAX_GAIN = 0x100E; + + /** Distance model attributes, */ + public static final int + AL_REFERENCE_DISTANCE = 0x1020, + AL_ROLLOFF_FACTOR = 0x1021, + AL_MAX_DISTANCE = 0x1023; + + /** Buffer attributes, */ + public static final int + AL_FREQUENCY = 0x2001, + AL_BITS = 0x2002, + AL_CHANNELS = 0x2003, + AL_SIZE = 0x2004; + + /** Buffer formats. */ + public static final int + AL_FORMAT_MONO8 = 0x1100, + AL_FORMAT_MONO16 = 0x1101, + AL_FORMAT_STEREO8 = 0x1102, + AL_FORMAT_STEREO16 = 0x1103; + + /** Buffer state. */ + public static final int + AL_UNUSED = 0x2010, + AL_PENDING = 0x2011, + AL_PROCESSED = 0x2012; + + protected AL10() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(ALCapabilities caps) { + return checkFunctions( + caps.alGetError, caps.alEnable, caps.alDisable, caps.alIsEnabled, caps.alGetBoolean, caps.alGetInteger, caps.alGetFloat, caps.alGetDouble, + caps.alGetBooleanv, caps.alGetIntegerv, caps.alGetFloatv, caps.alGetDoublev, caps.alGetString, caps.alDistanceModel, caps.alDopplerFactor, + caps.alDopplerVelocity, caps.alListenerf, caps.alListeneri, caps.alListener3f, caps.alListenerfv, caps.alGetListenerf, caps.alGetListeneri, + caps.alGetListener3f, caps.alGetListenerfv, caps.alGenSources, caps.alDeleteSources, caps.alIsSource, caps.alSourcef, caps.alSource3f, + caps.alSourcefv, caps.alSourcei, caps.alGetSourcef, caps.alGetSource3f, caps.alGetSourcefv, caps.alGetSourcei, caps.alGetSourceiv, + caps.alSourceQueueBuffers, caps.alSourceUnqueueBuffers, caps.alSourcePlay, caps.alSourcePause, caps.alSourceStop, caps.alSourceRewind, + caps.alSourcePlayv, caps.alSourcePausev, caps.alSourceStopv, caps.alSourceRewindv, caps.alGenBuffers, caps.alDeleteBuffers, caps.alIsBuffer, + caps.alGetBufferf, caps.alGetBufferi, caps.alBufferData, caps.alGetEnumValue, caps.alGetProcAddress, caps.alIsExtensionPresent + ); + } + + // --- [ alGetError ] --- + + /** + * Obtains error information. + * + *

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 alGetError 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 alGetError returns AL_NO_ERROR then there has been no detectable error since the last call to alGetError (or since the AL + * was initialized).

+ * + *

Error codes can be mapped to strings. The alGetString 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.

+ */ + @NativeType("ALenum") + public static int alGetError() { + long __functionAddress = AL.getICD().alGetError; + return invokeI(__functionAddress); + } + + // --- [ alEnable ] --- + + /** + * Enables AL capabilities. + * + * @param target the capability to enable + */ + @NativeType("ALvoid") + public static void alEnable(@NativeType("ALenum") int target) { + long __functionAddress = AL.getICD().alEnable; + invokeV(target, __functionAddress); + } + + // --- [ alDisable ] --- + + /** + * Disables AL capabilities. + * + * @param target the capability to disable + */ + @NativeType("ALvoid") + public static void alDisable(@NativeType("ALenum") int target) { + long __functionAddress = AL.getICD().alDisable; + invokeV(target, __functionAddress); + } + + // --- [ alIsEnabled ] --- + + /** + * Queries whether a given capability is currently enabled or not. + * + * @param target the capability to query + */ + @NativeType("ALboolean") + public static boolean alIsEnabled(@NativeType("ALenum") int target) { + long __functionAddress = AL.getICD().alIsEnabled; + return invokeZ(target, __functionAddress); + } + + // --- [ alGetBoolean ] --- + + /** + * Returns the boolean value of the specified parameter. + * + * @param paramName the parameter to query + */ + @NativeType("ALboolean") + public static boolean alGetBoolean(@NativeType("ALenum") int paramName) { + long __functionAddress = AL.getICD().alGetBoolean; + return invokeZ(paramName, __functionAddress); + } + + // --- [ alGetInteger ] --- + + /** + * Returns the integer value of the specified parameter. + * + * @param paramName the parameter to query. One of:
{@link #AL_DOPPLER_FACTOR DOPPLER_FACTOR}{@link #AL_DISTANCE_MODEL DISTANCE_MODEL}{@link AL11#AL_SPEED_OF_SOUND SPEED_OF_SOUND}
+ */ + @NativeType("ALint") + public static int alGetInteger(@NativeType("ALenum") int paramName) { + long __functionAddress = AL.getICD().alGetInteger; + return invokeI(paramName, __functionAddress); + } + + // --- [ alGetFloat ] --- + + /** + * Returns the float value of the specified parameter. + * + * @param paramName the parameter to query. One of:
{@link #AL_DOPPLER_FACTOR DOPPLER_FACTOR}{@link #AL_DISTANCE_MODEL DISTANCE_MODEL}{@link AL11#AL_SPEED_OF_SOUND SPEED_OF_SOUND}
+ */ + @NativeType("ALfloat") + public static float alGetFloat(@NativeType("ALenum") int paramName) { + long __functionAddress = AL.getICD().alGetFloat; + return invokeF(paramName, __functionAddress); + } + + // --- [ alGetDouble ] --- + + /** + * Returns the double value of the specified parameter. + * + * @param paramName the parameter to query. One of:
{@link #AL_DOPPLER_FACTOR DOPPLER_FACTOR}{@link #AL_DISTANCE_MODEL DISTANCE_MODEL}{@link AL11#AL_SPEED_OF_SOUND SPEED_OF_SOUND}
+ */ + @NativeType("ALdouble") + public static double alGetDouble(@NativeType("ALenum") int paramName) { + long __functionAddress = AL.getICD().alGetDouble; + return invokeD(paramName, __functionAddress); + } + + // --- [ alGetBooleanv ] --- + + /** Unsafe version of: {@link #alGetBooleanv GetBooleanv} */ + public static void nalGetBooleanv(int paramName, long dest) { + long __functionAddress = AL.getICD().alGetBooleanv; + invokePV(paramName, dest, __functionAddress); + } + + /** + * Pointer version of {@link #alGetBoolean GetBoolean}. + * + * @param paramName the parameter to query + * @param dest a buffer that will receive the parameter values + */ + @NativeType("ALvoid") + public static void alGetBooleanv(@NativeType("ALenum") int paramName, @NativeType("ALboolean *") ByteBuffer dest) { + if (CHECKS) { + check(dest, 1); + } + nalGetBooleanv(paramName, memAddress(dest)); + } + + // --- [ alGetIntegerv ] --- + + /** Unsafe version of: {@link #alGetIntegerv GetIntegerv} */ + public static void nalGetIntegerv(int paramName, long dest) { + long __functionAddress = AL.getICD().alGetIntegerv; + invokePV(paramName, dest, __functionAddress); + } + + /** + * Pointer version of {@link #alGetInteger GetInteger}. + * + * @param paramName the parameter to query + * @param dest a buffer that will receive the parameter values + */ + @NativeType("ALvoid") + public static void alGetIntegerv(@NativeType("ALenum") int paramName, @NativeType("ALint *") IntBuffer dest) { + if (CHECKS) { + check(dest, 1); + } + nalGetIntegerv(paramName, memAddress(dest)); + } + + // --- [ alGetFloatv ] --- + + /** Unsafe version of: {@link #alGetFloatv GetFloatv} */ + public static void nalGetFloatv(int paramName, long dest) { + long __functionAddress = AL.getICD().alGetFloatv; + invokePV(paramName, dest, __functionAddress); + } + + /** + * Pointer version of {@link #alGetFloat GetFloat}. + * + * @param paramName the parameter to query + * @param dest a buffer that will receive the parameter values + */ + @NativeType("ALvoid") + public static void alGetFloatv(@NativeType("ALenum") int paramName, @NativeType("ALfloat *") FloatBuffer dest) { + if (CHECKS) { + check(dest, 1); + } + nalGetFloatv(paramName, memAddress(dest)); + } + + // --- [ alGetDoublev ] --- + + /** Unsafe version of: {@link #alGetDoublev GetDoublev} */ + public static void nalGetDoublev(int paramName, long dest) { + long __functionAddress = AL.getICD().alGetDoublev; + invokePV(paramName, dest, __functionAddress); + } + + /** + * Pointer version of {@link #alGetDouble GetDouble}. + * + * @param paramName the parameter to query + * @param dest a buffer that will receive the parameter values + */ + @NativeType("ALvoid") + public static void alGetDoublev(@NativeType("ALenum") int paramName, @NativeType("ALdouble *") DoubleBuffer dest) { + if (CHECKS) { + check(dest, 1); + } + nalGetDoublev(paramName, memAddress(dest)); + } + + // --- [ alGetString ] --- + + /** Unsafe version of: {@link #alGetString GetString} */ + public static long nalGetString(int paramName) { + long __functionAddress = AL.getICD().alGetString; + return invokeP(paramName, __functionAddress); + } + + /** + * Returns the string value of the specified parameter + * + * @param paramName the parameter to query. One of:
{@link #AL_VENDOR VENDOR}{@link #AL_VERSION VERSION}{@link #AL_RENDERER RENDERER}{@link #AL_EXTENSIONS EXTENSIONS}
+ */ + @Nullable + @NativeType("ALchar const *") + public static String alGetString(@NativeType("ALenum") int paramName) { + long __result = nalGetString(paramName); + return memUTF8Safe(__result); + } + + // --- [ alDistanceModel ] --- + + /** + * Sets the distance attenuation model. + * + *

Samples usually use the entire dynamic range of the chosen format/encoding, independent of their real world intensity. For example, a jet engine and a + * clockwork both will have samples with full amplitude. The application will then have to adjust source gain accordingly to account for relative differences.

+ * + *

Source gain is then attenuated by distance. The effective attenuation of a source depends on many factors, among which distance attenuation and source + * and listener gain are only some of the contributing factors. Even if the source and listener gain exceed 1.0 (amplification beyond the guaranteed + * dynamic range), distance and other attenuation might ultimately limit the overall gain to a value below 1.0.

+ * + *

OpenAL currently supports three modes of operation with respect to distance attenuation, including one that is similar to the IASIG I3DL2 model. The + * application can choose one of these models (or chooses to disable distance-dependent attenuation) on a per-context basis.

+ * + * @param modelName the distance attenuation model to set. One of:
{@link #AL_INVERSE_DISTANCE INVERSE_DISTANCE}{@link #AL_INVERSE_DISTANCE_CLAMPED INVERSE_DISTANCE_CLAMPED}{@link AL11#AL_LINEAR_DISTANCE LINEAR_DISTANCE}{@link AL11#AL_LINEAR_DISTANCE_CLAMPED LINEAR_DISTANCE_CLAMPED}
{@link AL11#AL_EXPONENT_DISTANCE EXPONENT_DISTANCE}{@link AL11#AL_EXPONENT_DISTANCE_CLAMPED EXPONENT_DISTANCE_CLAMPED}{@link #AL_NONE NONE}
+ */ + @NativeType("ALvoid") + public static void alDistanceModel(@NativeType("ALenum") int modelName) { + long __functionAddress = AL.getICD().alDistanceModel; + invokeV(modelName, __functionAddress); + } + + // --- [ alDopplerFactor ] --- + + /** + * Sets the doppler effect factor. + * + *

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 Doppler Effect as implemented by + * OpenAL is described by the formula below. Effects of the medium (air, water) moving with respect to listener and source are ignored.

+ * + *

+     * SS: AL_SPEED_OF_SOUND = speed of sound (default value 343.3)
+     * DF: AL_DOPPLER_FACTOR = Doppler factor (default 1.0)
+     * vls: Listener velocity scalar (scalar, projected on source-to-listener vector)
+     * vss: Source velocity scalar (scalar, projected on source-to-listener vector)
+     * f: Frequency of sample
+     * f': effective Doppler shifted frequency
+     * 
+     * 3D Mathematical representation of vls and vss:
+     * 
+     * Mag(vector) = sqrt(vector.x * vector.x + vector.y * vector.y + vector.z * vector.z)
+     * DotProduct(v1, v2) = (v1.x * v2.x + v1.y * v2.y + v1.z * v2.z)
+     * 
+     * SL = source to listener vector
+     * SV = Source velocity vector
+     * LV = Listener velocity vector
+     * 
+     * vls = DotProduct(SL, LV) / Mag(SL)
+     * vss = DotProduct(SL, SV) / Mag(SL)
+     * 
+     * Dopper Calculation:
+     * 
+     * vss = min(vss, SS / DF)
+     * vls = min(vls, SS / DF)
+     * 
+     * f' = f * (SS - DF * vls) / (SS - DF * vss)
+ * + *

The {@code dopplerFactor} is a simple scaling of source and listener velocities to exaggerate or deemphasize the Doppler (pitch) shift resulting from + * the calculation.

+ * + * @param dopplerFactor the doppler factor + */ + @NativeType("ALvoid") + public static void alDopplerFactor(@NativeType("ALfloat") float dopplerFactor) { + long __functionAddress = AL.getICD().alDopplerFactor; + invokeV(dopplerFactor, __functionAddress); + } + + // --- [ alDopplerVelocity ] --- + + /** + * Sets the doppler effect propagation velocity. + * + *

The OpenAL 1.1 Doppler implementation is different than that of OpenAL 1.0, because the older implementation was confusing and not implemented + * consistently. The new "speed of sound" property makes the 1.1 implementation more intuitive than the old implementation. If your implementation wants to + * support the AL_DOPPLER_VELOCITY parameter (the alDopplerVelocity call will remain as an entry point so that 1.0 applications can link with a 1.1 + * library), the above formula can be changed to the following:

+ * + *

+     * vss = min(vss, (SS * DV)/DF)
+     * vls = min(vls, (SS * DV)/DF)
+     * 
+     * f' = f * (SS * DV - DF*vls) / (SS * DV - DF * vss)
+ * + *

OpenAL 1.1 programmers would never use AL_DOPPLER_VELOCITY (which defaults to 1.0).

+ * + * @param dopplerVelocity the doppler velocity + */ + @NativeType("ALvoid") + public static void alDopplerVelocity(@NativeType("ALfloat") float dopplerVelocity) { + long __functionAddress = AL.getICD().alDopplerVelocity; + invokeV(dopplerVelocity, __functionAddress); + } + + // --- [ alListenerf ] --- + + /** + * Sets the float value of a listener parameter. + * + * @param paramName the parameter to modify. One of:
{@link #AL_ORIENTATION ORIENTATION}{@link #AL_POSITION POSITION}{@link #AL_VELOCITY VELOCITY}{@link #AL_GAIN GAIN}
+ * @param value the parameter value + */ + @NativeType("ALvoid") + public static void alListenerf(@NativeType("ALenum") int paramName, @NativeType("ALfloat") float value) { + long __functionAddress = AL.getICD().alListenerf; + invokeV(paramName, value, __functionAddress); + } + + // --- [ alListeneri ] --- + + /** + * Integer version of {@link #alListenerf Listenerf}. + * + * @param paramName the parameter to modify. One of:
{@link #AL_ORIENTATION ORIENTATION}{@link #AL_POSITION POSITION}{@link #AL_VELOCITY VELOCITY}{@link #AL_GAIN GAIN}
+ * @param values the parameter value + */ + @NativeType("ALvoid") + public static void alListeneri(@NativeType("ALenum") int paramName, @NativeType("ALint") int values) { + long __functionAddress = AL.getICD().alListeneri; + invokeV(paramName, values, __functionAddress); + } + + // --- [ alListener3f ] --- + + /** + * Sets the 3 dimensional float values of a listener parameter. + * + * @param paramName the parameter to modify. One of:
{@link #AL_ORIENTATION ORIENTATION}{@link #AL_POSITION POSITION}{@link #AL_VELOCITY VELOCITY}{@link #AL_GAIN GAIN}
+ * @param value1 the first value + * @param value2 the second value + * @param value3 the third value + */ + @NativeType("ALvoid") + public static void alListener3f(@NativeType("ALenum") int paramName, @NativeType("ALfloat") float value1, @NativeType("ALfloat") float value2, @NativeType("ALfloat") float value3) { + long __functionAddress = AL.getICD().alListener3f; + invokeV(paramName, value1, value2, value3, __functionAddress); + } + + // --- [ alListenerfv ] --- + + /** Unsafe version of: {@link #alListenerfv Listenerfv} */ + public static void nalListenerfv(int paramName, long values) { + long __functionAddress = AL.getICD().alListenerfv; + invokePV(paramName, values, __functionAddress); + } + + /** + * Pointer version of {@link #alListenerf Listenerf}. + * + * @param paramName the parameter to modify + * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alListenerfv(@NativeType("ALenum") int paramName, @NativeType("ALfloat const *") FloatBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalListenerfv(paramName, memAddress(values)); + } + + // --- [ alGetListenerf ] --- + + /** Unsafe version of: {@link #alGetListenerf GetListenerf} */ + public static void nalGetListenerf(int paramName, long value) { + long __functionAddress = AL.getICD().alGetListenerf; + invokePV(paramName, value, __functionAddress); + } + + /** + * Returns the float value of a listener parameter. + * + * @param paramName the parameter to query. One of:
{@link #AL_ORIENTATION ORIENTATION}{@link #AL_POSITION POSITION}{@link #AL_VELOCITY VELOCITY}{@link #AL_GAIN GAIN}
+ * @param value the parameter value + */ + @NativeType("ALvoid") + public static void alGetListenerf(@NativeType("ALenum") int paramName, @NativeType("ALfloat *") FloatBuffer value) { + if (CHECKS) { + check(value, 1); + } + nalGetListenerf(paramName, memAddress(value)); + } + + /** + * Returns the float value of a listener parameter. + * + * @param paramName the parameter to query. One of:
{@link #AL_ORIENTATION ORIENTATION}{@link #AL_POSITION POSITION}{@link #AL_VELOCITY VELOCITY}{@link #AL_GAIN GAIN}
+ */ + @NativeType("ALvoid") + public static float alGetListenerf(@NativeType("ALenum") int paramName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer value = stack.callocFloat(1); + nalGetListenerf(paramName, memAddress(value)); + return value.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alGetListeneri ] --- + + /** Unsafe version of: {@link #alGetListeneri GetListeneri} */ + public static void nalGetListeneri(int paramName, long value) { + long __functionAddress = AL.getICD().alGetListeneri; + invokePV(paramName, value, __functionAddress); + } + + /** + * Returns the integer value of a listener parameter. + * + * @param paramName the parameter to query. One of:
{@link #AL_ORIENTATION ORIENTATION}{@link #AL_POSITION POSITION}{@link #AL_VELOCITY VELOCITY}{@link #AL_GAIN GAIN}
+ * @param value the parameter value + */ + @NativeType("ALvoid") + public static void alGetListeneri(@NativeType("ALenum") int paramName, @NativeType("ALint *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nalGetListeneri(paramName, memAddress(value)); + } + + /** + * Returns the integer value of a listener parameter. + * + * @param paramName the parameter to query. One of:
{@link #AL_ORIENTATION ORIENTATION}{@link #AL_POSITION POSITION}{@link #AL_VELOCITY VELOCITY}{@link #AL_GAIN GAIN}
+ */ + @NativeType("ALvoid") + public static int alGetListeneri(@NativeType("ALenum") int paramName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer value = stack.callocInt(1); + nalGetListeneri(paramName, memAddress(value)); + return value.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alGetListener3f ] --- + + /** Unsafe version of: {@link #alGetListener3f GetListener3f} */ + public static void nalGetListener3f(int paramName, long value1, long value2, long value3) { + long __functionAddress = AL.getICD().alGetListener3f; + invokePPPV(paramName, value1, value2, value3, __functionAddress); + } + + /** + * Returns the 3 dimensional values of a listener parameter. + * + * @param paramName the parameter to query. One of:
{@link #AL_ORIENTATION ORIENTATION}{@link #AL_POSITION POSITION}{@link #AL_VELOCITY VELOCITY}{@link #AL_GAIN GAIN}
+ * @param value1 the first parameter value + * @param value2 the second parameter value + * @param value3 the third parameter value + */ + @NativeType("ALvoid") + public static void alGetListener3f(@NativeType("ALenum") int paramName, @NativeType("ALfloat *") FloatBuffer value1, @NativeType("ALfloat *") FloatBuffer value2, @NativeType("ALfloat *") FloatBuffer value3) { + if (CHECKS) { + check(value1, 1); + check(value2, 1); + check(value3, 1); + } + nalGetListener3f(paramName, memAddress(value1), memAddress(value2), memAddress(value3)); + } + + // --- [ alGetListenerfv ] --- + + /** Unsafe version of: {@link #alGetListenerfv GetListenerfv} */ + public static void nalGetListenerfv(int paramName, long values) { + long __functionAddress = AL.getICD().alGetListenerfv; + invokePV(paramName, values, __functionAddress); + } + + /** + * Returns float values of a listener parameter. + * + * @param paramName the parameter to query. One of:
{@link #AL_ORIENTATION ORIENTATION}{@link #AL_POSITION POSITION}{@link #AL_VELOCITY VELOCITY}{@link #AL_GAIN GAIN}
+ * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alGetListenerfv(@NativeType("ALenum") int paramName, @NativeType("ALfloat *") FloatBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalGetListenerfv(paramName, memAddress(values)); + } + + // --- [ alGenSources ] --- + + /** + * Unsafe version of: {@link #alGenSources GenSources} + * + * @param n the number of source names to generated + */ + public static void nalGenSources(int n, long srcNames) { + long __functionAddress = AL.getICD().alGenSources; + invokePV(n, srcNames, __functionAddress); + } + + /** + * Requests a number of source names. + * + * @param srcNames the buffer that will receive the source names + */ + @NativeType("ALvoid") + public static void alGenSources(@NativeType("ALuint *") IntBuffer srcNames) { + nalGenSources(srcNames.remaining(), memAddress(srcNames)); + } + + /** Requests a number of source names. */ + @NativeType("ALvoid") + public static int alGenSources() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer srcNames = stack.callocInt(1); + nalGenSources(1, memAddress(srcNames)); + return srcNames.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alDeleteSources ] --- + + /** + * Unsafe version of: {@link #alDeleteSources DeleteSources} + * + * @param n the number of sources to delete + */ + public static void nalDeleteSources(int n, long sources) { + long __functionAddress = AL.getICD().alDeleteSources; + invokePV(n, sources, __functionAddress); + } + + /** + * Requests the deletion of a number of sources. + * + * @param sources the sources to delete + */ + @NativeType("ALvoid") + public static void alDeleteSources(@NativeType("ALuint *") IntBuffer sources) { + nalDeleteSources(sources.remaining(), memAddress(sources)); + } + + /** Requests the deletion of a number of sources. */ + @NativeType("ALvoid") + public static void alDeleteSources(@NativeType("ALuint *") int source) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer sources = stack.ints(source); + nalDeleteSources(1, memAddress(sources)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alIsSource ] --- + + /** + * Verifies whether the specified object name is a source name. + * + * @param sourceName a value that may be a source name + */ + @NativeType("ALboolean") + public static boolean alIsSource(@NativeType("ALuint") int sourceName) { + long __functionAddress = AL.getICD().alIsSource; + return invokeZ(sourceName, __functionAddress); + } + + // --- [ alSourcef ] --- + + /** + * Sets the float value of a source parameter. + * + * @param source the source to modify + * @param param the parameter to modify. One of:
{@link #AL_CONE_INNER_ANGLE CONE_INNER_ANGLE}{@link #AL_CONE_OUTER_ANGLE CONE_OUTER_ANGLE}{@link #AL_PITCH PITCH}{@link #AL_DIRECTION DIRECTION}{@link #AL_LOOPING LOOPING}{@link #AL_BUFFER BUFFER}{@link #AL_SOURCE_STATE SOURCE_STATE}
{@link #AL_CONE_OUTER_GAIN CONE_OUTER_GAIN}{@link #AL_SOURCE_TYPE SOURCE_TYPE}{@link #AL_POSITION POSITION}{@link #AL_VELOCITY VELOCITY}{@link #AL_GAIN GAIN}{@link #AL_REFERENCE_DISTANCE REFERENCE_DISTANCE}{@link #AL_ROLLOFF_FACTOR ROLLOFF_FACTOR}
{@link #AL_MAX_DISTANCE MAX_DISTANCE}
+ * @param value the parameter value + */ + @NativeType("ALvoid") + public static void alSourcef(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALfloat") float value) { + long __functionAddress = AL.getICD().alSourcef; + invokeV(source, param, value, __functionAddress); + } + + // --- [ alSource3f ] --- + + /** + * Sets the 3 dimensional values of a source parameter. + * + * @param source the source to modify + * @param param the parameter to modify. One of:
{@link #AL_CONE_INNER_ANGLE CONE_INNER_ANGLE}{@link #AL_CONE_OUTER_ANGLE CONE_OUTER_ANGLE}{@link #AL_PITCH PITCH}{@link #AL_DIRECTION DIRECTION}{@link #AL_LOOPING LOOPING}{@link #AL_BUFFER BUFFER}{@link #AL_SOURCE_STATE SOURCE_STATE}
{@link #AL_CONE_OUTER_GAIN CONE_OUTER_GAIN}{@link #AL_SOURCE_TYPE SOURCE_TYPE}{@link #AL_POSITION POSITION}{@link #AL_VELOCITY VELOCITY}{@link #AL_GAIN GAIN}{@link #AL_REFERENCE_DISTANCE REFERENCE_DISTANCE}{@link #AL_ROLLOFF_FACTOR ROLLOFF_FACTOR}
{@link #AL_MAX_DISTANCE MAX_DISTANCE}
+ * @param v1 the first parameter value + * @param v2 the second parameter value + * @param v3 the third parameter value + */ + @NativeType("ALvoid") + public static void alSource3f(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALfloat") float v1, @NativeType("ALfloat") float v2, @NativeType("ALfloat") float v3) { + long __functionAddress = AL.getICD().alSource3f; + invokeV(source, param, v1, v2, v3, __functionAddress); + } + + // --- [ alSourcefv ] --- + + /** Unsafe version of: {@link #alSourcefv Sourcefv} */ + public static void nalSourcefv(int source, int param, long values) { + long __functionAddress = AL.getICD().alSourcefv; + invokePV(source, param, values, __functionAddress); + } + + /** + * Pointer version of {@link #alSourcef Sourcef}. + * + * @param source the source to modify + * @param param the parameter to modify + * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alSourcefv(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALfloat const *") FloatBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalSourcefv(source, param, memAddress(values)); + } + + // --- [ alSourcei ] --- + + /** + * Integer version of {@link #alSourcef Sourcef}. + * + * @param source the source to modify + * @param param the parameter to modify + * @param value the parameter value + */ + @NativeType("ALvoid") + public static void alSourcei(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALint") int value) { + long __functionAddress = AL.getICD().alSourcei; + invokeV(source, param, value, __functionAddress); + } + + // --- [ alGetSourcef ] --- + + /** Unsafe version of: {@link #alGetSourcef GetSourcef} */ + public static void nalGetSourcef(int source, int param, long value) { + long __functionAddress = AL.getICD().alGetSourcef; + invokePV(source, param, value, __functionAddress); + } + + /** + * Returns the float value of the specified source parameter. + * + * @param source the source to query + * @param param the parameter to query. One of:
{@link #AL_CONE_INNER_ANGLE CONE_INNER_ANGLE}{@link #AL_CONE_OUTER_ANGLE CONE_OUTER_ANGLE}{@link #AL_PITCH PITCH}{@link #AL_DIRECTION DIRECTION}{@link #AL_LOOPING LOOPING}{@link #AL_BUFFER BUFFER}{@link #AL_SOURCE_STATE SOURCE_STATE}
{@link #AL_CONE_OUTER_GAIN CONE_OUTER_GAIN}{@link #AL_SOURCE_TYPE SOURCE_TYPE}{@link #AL_POSITION POSITION}{@link #AL_VELOCITY VELOCITY}{@link #AL_GAIN GAIN}{@link #AL_REFERENCE_DISTANCE REFERENCE_DISTANCE}{@link #AL_ROLLOFF_FACTOR ROLLOFF_FACTOR}
{@link #AL_MAX_DISTANCE MAX_DISTANCE}
+ * @param value the parameter value + */ + @NativeType("ALvoid") + public static void alGetSourcef(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALfloat *") FloatBuffer value) { + if (CHECKS) { + check(value, 1); + } + nalGetSourcef(source, param, memAddress(value)); + } + + /** + * Returns the float value of the specified source parameter. + * + * @param source the source to query + * @param param the parameter to query. One of:
{@link #AL_CONE_INNER_ANGLE CONE_INNER_ANGLE}{@link #AL_CONE_OUTER_ANGLE CONE_OUTER_ANGLE}{@link #AL_PITCH PITCH}{@link #AL_DIRECTION DIRECTION}{@link #AL_LOOPING LOOPING}{@link #AL_BUFFER BUFFER}{@link #AL_SOURCE_STATE SOURCE_STATE}
{@link #AL_CONE_OUTER_GAIN CONE_OUTER_GAIN}{@link #AL_SOURCE_TYPE SOURCE_TYPE}{@link #AL_POSITION POSITION}{@link #AL_VELOCITY VELOCITY}{@link #AL_GAIN GAIN}{@link #AL_REFERENCE_DISTANCE REFERENCE_DISTANCE}{@link #AL_ROLLOFF_FACTOR ROLLOFF_FACTOR}
{@link #AL_MAX_DISTANCE MAX_DISTANCE}
+ */ + @NativeType("ALvoid") + public static float alGetSourcef(@NativeType("ALuint") int source, @NativeType("ALenum") int param) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer value = stack.callocFloat(1); + nalGetSourcef(source, param, memAddress(value)); + return value.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alGetSource3f ] --- + + /** Unsafe version of: {@link #alGetSource3f GetSource3f} */ + public static void nalGetSource3f(int source, int param, long v1, long v2, long v3) { + long __functionAddress = AL.getICD().alGetSource3f; + invokePPPV(source, param, v1, v2, v3, __functionAddress); + } + + /** + * Returns the 3 dimensional values of the specified source parameter. + * + * @param source the source to query + * @param param the parameter to query. One of:
{@link #AL_CONE_INNER_ANGLE CONE_INNER_ANGLE}{@link #AL_CONE_OUTER_ANGLE CONE_OUTER_ANGLE}{@link #AL_PITCH PITCH}{@link #AL_DIRECTION DIRECTION}{@link #AL_LOOPING LOOPING}{@link #AL_BUFFER BUFFER}{@link #AL_SOURCE_STATE SOURCE_STATE}
{@link #AL_CONE_OUTER_GAIN CONE_OUTER_GAIN}{@link #AL_SOURCE_TYPE SOURCE_TYPE}{@link #AL_POSITION POSITION}{@link #AL_VELOCITY VELOCITY}{@link #AL_GAIN GAIN}{@link #AL_REFERENCE_DISTANCE REFERENCE_DISTANCE}{@link #AL_ROLLOFF_FACTOR ROLLOFF_FACTOR}
{@link #AL_MAX_DISTANCE MAX_DISTANCE}
+ * @param v1 the first parameter value + * @param v2 the second parameter value + * @param v3 the third parameter value + */ + @NativeType("ALvoid") + public static void alGetSource3f(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALfloat *") FloatBuffer v1, @NativeType("ALfloat *") FloatBuffer v2, @NativeType("ALfloat *") FloatBuffer v3) { + if (CHECKS) { + check(v1, 1); + check(v2, 1); + check(v3, 1); + } + nalGetSource3f(source, param, memAddress(v1), memAddress(v2), memAddress(v3)); + } + + // --- [ alGetSourcefv ] --- + + /** Unsafe version of: {@link #alGetSourcefv GetSourcefv} */ + public static void nalGetSourcefv(int source, int param, long values) { + long __functionAddress = AL.getICD().alGetSourcefv; + invokePV(source, param, values, __functionAddress); + } + + /** + * Returns the float values of the specified source parameter. + * + * @param source the source to query + * @param param the parameter to query. One of:
{@link #AL_CONE_INNER_ANGLE CONE_INNER_ANGLE}{@link #AL_CONE_OUTER_ANGLE CONE_OUTER_ANGLE}{@link #AL_PITCH PITCH}{@link #AL_DIRECTION DIRECTION}{@link #AL_LOOPING LOOPING}{@link #AL_BUFFER BUFFER}{@link #AL_SOURCE_STATE SOURCE_STATE}
{@link #AL_CONE_OUTER_GAIN CONE_OUTER_GAIN}{@link #AL_SOURCE_TYPE SOURCE_TYPE}{@link #AL_POSITION POSITION}{@link #AL_VELOCITY VELOCITY}{@link #AL_GAIN GAIN}{@link #AL_REFERENCE_DISTANCE REFERENCE_DISTANCE}{@link #AL_ROLLOFF_FACTOR ROLLOFF_FACTOR}
{@link #AL_MAX_DISTANCE MAX_DISTANCE}
+ * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alGetSourcefv(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALfloat *") FloatBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalGetSourcefv(source, param, memAddress(values)); + } + + // --- [ alGetSourcei ] --- + + /** Unsafe version of: {@link #alGetSourcei GetSourcei} */ + public static void nalGetSourcei(int source, int param, long value) { + long __functionAddress = AL.getICD().alGetSourcei; + invokePV(source, param, value, __functionAddress); + } + + /** + * Returns the integer value of the specified source parameter. + * + * @param source the source to query + * @param param the parameter to query. One of:
{@link #AL_CONE_INNER_ANGLE CONE_INNER_ANGLE}{@link #AL_CONE_OUTER_ANGLE CONE_OUTER_ANGLE}{@link #AL_PITCH PITCH}{@link #AL_DIRECTION DIRECTION}{@link #AL_LOOPING LOOPING}{@link #AL_BUFFER BUFFER}{@link #AL_SOURCE_STATE SOURCE_STATE}
{@link #AL_CONE_OUTER_GAIN CONE_OUTER_GAIN}{@link #AL_SOURCE_TYPE SOURCE_TYPE}{@link #AL_POSITION POSITION}{@link #AL_VELOCITY VELOCITY}{@link #AL_GAIN GAIN}{@link #AL_REFERENCE_DISTANCE REFERENCE_DISTANCE}{@link #AL_ROLLOFF_FACTOR ROLLOFF_FACTOR}
{@link #AL_MAX_DISTANCE MAX_DISTANCE}
+ * @param value the parameter value + */ + @NativeType("ALvoid") + public static void alGetSourcei(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALint *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nalGetSourcei(source, param, memAddress(value)); + } + + /** + * Returns the integer value of the specified source parameter. + * + * @param source the source to query + * @param param the parameter to query. One of:
{@link #AL_CONE_INNER_ANGLE CONE_INNER_ANGLE}{@link #AL_CONE_OUTER_ANGLE CONE_OUTER_ANGLE}{@link #AL_PITCH PITCH}{@link #AL_DIRECTION DIRECTION}{@link #AL_LOOPING LOOPING}{@link #AL_BUFFER BUFFER}{@link #AL_SOURCE_STATE SOURCE_STATE}
{@link #AL_CONE_OUTER_GAIN CONE_OUTER_GAIN}{@link #AL_SOURCE_TYPE SOURCE_TYPE}{@link #AL_POSITION POSITION}{@link #AL_VELOCITY VELOCITY}{@link #AL_GAIN GAIN}{@link #AL_REFERENCE_DISTANCE REFERENCE_DISTANCE}{@link #AL_ROLLOFF_FACTOR ROLLOFF_FACTOR}
{@link #AL_MAX_DISTANCE MAX_DISTANCE}
+ */ + @NativeType("ALvoid") + public static int alGetSourcei(@NativeType("ALuint") int source, @NativeType("ALenum") int param) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer value = stack.callocInt(1); + nalGetSourcei(source, param, memAddress(value)); + return value.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alGetSourceiv ] --- + + /** Unsafe version of: {@link #alGetSourceiv GetSourceiv} */ + public static void nalGetSourceiv(int source, int param, long values) { + long __functionAddress = AL.getICD().alGetSourceiv; + invokePV(source, param, values, __functionAddress); + } + + /** + * Returns the integer values of the specified source parameter. + * + * @param source the source to query + * @param param the parameter to query. One of:
{@link #AL_CONE_INNER_ANGLE CONE_INNER_ANGLE}{@link #AL_CONE_OUTER_ANGLE CONE_OUTER_ANGLE}{@link #AL_PITCH PITCH}{@link #AL_DIRECTION DIRECTION}{@link #AL_LOOPING LOOPING}{@link #AL_BUFFER BUFFER}{@link #AL_SOURCE_STATE SOURCE_STATE}
{@link #AL_CONE_OUTER_GAIN CONE_OUTER_GAIN}{@link #AL_SOURCE_TYPE SOURCE_TYPE}{@link #AL_POSITION POSITION}{@link #AL_VELOCITY VELOCITY}{@link #AL_GAIN GAIN}{@link #AL_REFERENCE_DISTANCE REFERENCE_DISTANCE}{@link #AL_ROLLOFF_FACTOR ROLLOFF_FACTOR}
{@link #AL_MAX_DISTANCE MAX_DISTANCE}
+ * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alGetSourceiv(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALint *") IntBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalGetSourceiv(source, param, memAddress(values)); + } + + // --- [ alSourceQueueBuffers ] --- + + /** + * Unsafe version of: {@link #alSourceQueueBuffers SourceQueueBuffers} + * + * @param numBuffers the number of buffers to queue + */ + public static void nalSourceQueueBuffers(int sourceName, int numBuffers, long bufferNames) { + long __functionAddress = AL.getICD().alSourceQueueBuffers; + invokePV(sourceName, numBuffers, bufferNames, __functionAddress); + } + + /** + * Queues up one or multiple buffer names to the specified source. + * + *

The buffers will be queued in the sequence in which they appear in the array. This command is legal on a source in any playback state (to allow for + * streaming, queuing has to be possible on a AL_PLAYING source). All buffers in a queue must have the same format and attributes, with the exception of + * the {@code NULL} buffer (i.e., 0) which can always be queued.

+ * + * @param sourceName the target source + * @param bufferNames the buffer names + */ + @NativeType("ALvoid") + public static void alSourceQueueBuffers(@NativeType("ALuint") int sourceName, @NativeType("ALuint *") IntBuffer bufferNames) { + nalSourceQueueBuffers(sourceName, bufferNames.remaining(), memAddress(bufferNames)); + } + + /** + * Queues up one or multiple buffer names to the specified source. + * + *

The buffers will be queued in the sequence in which they appear in the array. This command is legal on a source in any playback state (to allow for + * streaming, queuing has to be possible on a AL_PLAYING source). All buffers in a queue must have the same format and attributes, with the exception of + * the {@code NULL} buffer (i.e., 0) which can always be queued.

+ * + * @param sourceName the target source + */ + @NativeType("ALvoid") + public static void alSourceQueueBuffers(@NativeType("ALuint") int sourceName, @NativeType("ALuint *") int bufferName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer bufferNames = stack.ints(bufferName); + nalSourceQueueBuffers(sourceName, 1, memAddress(bufferNames)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alSourceUnqueueBuffers ] --- + + /** + * Unsafe version of: {@link #alSourceUnqueueBuffers SourceUnqueueBuffers} + * + * @param numEntries the number of buffers to unqueue + */ + public static void nalSourceUnqueueBuffers(int sourceName, int numEntries, long bufferNames) { + long __functionAddress = AL.getICD().alSourceUnqueueBuffers; + invokePV(sourceName, numEntries, bufferNames, __functionAddress); + } + + /** + * Removes a number of buffer entries that have finished processing, in the order of apperance, from the queue of the specified source. + * + *

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 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). A playing source will enter the AL_STOPPED state if it completes playback of the last buffer in its queue (the same + * behavior as when a single buffer has been attached to a source and has finished playback).

+ * + * @param sourceName the target source + * @param bufferNames the buffer names + */ + @NativeType("ALvoid") + public static void alSourceUnqueueBuffers(@NativeType("ALuint") int sourceName, @NativeType("ALuint *") IntBuffer bufferNames) { + nalSourceUnqueueBuffers(sourceName, bufferNames.remaining(), memAddress(bufferNames)); + } + + /** + * Removes a number of buffer entries that have finished processing, in the order of apperance, from the queue of the specified source. + * + *

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 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). A playing source will enter the AL_STOPPED state if it completes playback of the last buffer in its queue (the same + * behavior as when a single buffer has been attached to a source and has finished playback).

+ * + * @param sourceName the target source + */ + @NativeType("ALvoid") + public static int alSourceUnqueueBuffers(@NativeType("ALuint") int sourceName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer bufferNames = stack.callocInt(1); + nalSourceUnqueueBuffers(sourceName, 1, memAddress(bufferNames)); + return bufferNames.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alSourcePlay ] --- + + /** + * Sets the source state to AL_PLAYING. + * + *

alSourcePlay 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. alSourcePlay 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. alSourcePlay applied to a AL_PAUSED source will resume + * processing using the source state as preserved at the alSourcePause operation. alSourcePlay applied to a AL_STOPPED source will propagate it to + * AL_INITIAL then to AL_PLAYING immediately.

+ * + * @param source the source to play + */ + @NativeType("ALvoid") + public static void alSourcePlay(@NativeType("ALuint") int source) { + long __functionAddress = AL.getICD().alSourcePlay; + invokeV(source, __functionAddress); + } + + // --- [ alSourcePause ] --- + + /** + * Sets the source state to AL_PAUSED. + * + *

alSourcePause applied to an AL_INITIAL source is a legal NOP. alSourcePause applied to a AL_PLAYING source will change its state to AL_PAUSED. The + * source is exempt from processing, its current state is preserved. alSourcePause applied to a AL_PAUSED source is a legal NOP. alSourcePause applied to a + * AL_STOPPED source is a legal NOP.

+ * + * @param source the source to pause + */ + @NativeType("ALvoid") + public static void alSourcePause(@NativeType("ALuint") int source) { + long __functionAddress = AL.getICD().alSourcePause; + invokeV(source, __functionAddress); + } + + // --- [ alSourceStop ] --- + + /** + * Sets the source state to AL_STOPPED. + * + *

alSourceStop applied to an AL_INITIAL source is a legal NOP. alSourceStop applied to a AL_PLAYING source will change its state to AL_STOPPED. The source + * is exempt from processing, its current state is preserved. alSourceStop applied to a AL_PAUSED source will change its state to AL_STOPPED, with the same + * consequences as on a AL_PLAYING source. alSourceStop applied to a AL_STOPPED source is a legal NOP.

+ * + * @param source the source to stop + */ + @NativeType("ALvoid") + public static void alSourceStop(@NativeType("ALuint") int source) { + long __functionAddress = AL.getICD().alSourceStop; + invokeV(source, __functionAddress); + } + + // --- [ alSourceRewind ] --- + + /** + * Sets the source state to AL_INITIAL. + * + *

alSourceRewind applied to an AL_INITIAL source is a legal NOP. alSourceRewind 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. alSourceRewind applied to a AL_PAUSED source will change its state to AL_INITIAL, with the same consequences as on a AL_PLAYING source. + * alSourceRewind applied to an AL_STOPPED source promotes the source to AL_INITIAL, resetting the sampling offset to the beginning.

+ * + * @param source the source to rewind + */ + @NativeType("ALvoid") + public static void alSourceRewind(@NativeType("ALuint") int source) { + long __functionAddress = AL.getICD().alSourceRewind; + invokeV(source, __functionAddress); + } + + // --- [ alSourcePlayv ] --- + + /** + * Unsafe version of: {@link #alSourcePlayv SourcePlayv} + * + * @param n the number of sources to play + */ + public static void nalSourcePlayv(int n, long sources) { + long __functionAddress = AL.getICD().alSourcePlayv; + invokePV(n, sources, __functionAddress); + } + + /** + * Pointer version of {@link #alSourcePlay SourcePlay}. + * + * @param sources the sources to play + */ + @NativeType("ALvoid") + public static void alSourcePlayv(@NativeType("ALuint const *") IntBuffer sources) { + nalSourcePlayv(sources.remaining(), memAddress(sources)); + } + + // --- [ alSourcePausev ] --- + + /** + * Unsafe version of: {@link #alSourcePausev SourcePausev} + * + * @param n the number of sources to pause + */ + public static void nalSourcePausev(int n, long sources) { + long __functionAddress = AL.getICD().alSourcePausev; + invokePV(n, sources, __functionAddress); + } + + /** + * Pointer version of {@link #alSourcePause SourcePause}. + * + * @param sources the sources to pause + */ + @NativeType("ALvoid") + public static void alSourcePausev(@NativeType("ALuint const *") IntBuffer sources) { + nalSourcePausev(sources.remaining(), memAddress(sources)); + } + + // --- [ alSourceStopv ] --- + + /** + * Unsafe version of: {@link #alSourceStopv SourceStopv} + * + * @param n the number of sources to stop + */ + public static void nalSourceStopv(int n, long sources) { + long __functionAddress = AL.getICD().alSourceStopv; + invokePV(n, sources, __functionAddress); + } + + /** + * Pointer version of {@link #alSourceStop SourceStop}. + * + * @param sources the sources to stop + */ + @NativeType("ALvoid") + public static void alSourceStopv(@NativeType("ALuint const *") IntBuffer sources) { + nalSourceStopv(sources.remaining(), memAddress(sources)); + } + + // --- [ alSourceRewindv ] --- + + /** + * Unsafe version of: {@link #alSourceRewindv SourceRewindv} + * + * @param n the number of sources to rewind + */ + public static void nalSourceRewindv(int n, long sources) { + long __functionAddress = AL.getICD().alSourceRewindv; + invokePV(n, sources, __functionAddress); + } + + /** + * Pointer version of {@link #alSourceRewind SourceRewind}. + * + * @param sources the sources to rewind + */ + @NativeType("ALvoid") + public static void alSourceRewindv(@NativeType("ALuint const *") IntBuffer sources) { + nalSourceRewindv(sources.remaining(), memAddress(sources)); + } + + // --- [ alGenBuffers ] --- + + /** + * Unsafe version of: {@link #alGenBuffers GenBuffers} + * + * @param n the number of buffer names to generate + */ + public static void nalGenBuffers(int n, long bufferNames) { + long __functionAddress = AL.getICD().alGenBuffers; + invokePV(n, bufferNames, __functionAddress); + } + + /** + * Requests a number of buffer names. + * + * @param bufferNames the buffer that will receive the buffer names + */ + @NativeType("ALvoid") + public static void alGenBuffers(@NativeType("ALuint *") IntBuffer bufferNames) { + nalGenBuffers(bufferNames.remaining(), memAddress(bufferNames)); + } + + /** Requests a number of buffer names. */ + @NativeType("ALvoid") + public static int alGenBuffers() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer bufferNames = stack.callocInt(1); + nalGenBuffers(1, memAddress(bufferNames)); + return bufferNames.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alDeleteBuffers ] --- + + /** + * Unsafe version of: {@link #alDeleteBuffers DeleteBuffers} + * + * @param n the number of buffers to delete + */ + public static void nalDeleteBuffers(int n, long bufferNames) { + long __functionAddress = AL.getICD().alDeleteBuffers; + invokePV(n, bufferNames, __functionAddress); + } + + /** + * Requests the deletion of a number of buffers. + * + * @param bufferNames the buffers to delete + */ + @NativeType("ALvoid") + public static void alDeleteBuffers(@NativeType("ALuint const *") IntBuffer bufferNames) { + nalDeleteBuffers(bufferNames.remaining(), memAddress(bufferNames)); + } + + /** Requests the deletion of a number of buffers. */ + @NativeType("ALvoid") + public static void alDeleteBuffers(@NativeType("ALuint const *") int bufferName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer bufferNames = stack.ints(bufferName); + nalDeleteBuffers(1, memAddress(bufferNames)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alIsBuffer ] --- + + /** + * Verifies whether the specified object name is a buffer name. + * + * @param bufferName a value that may be a buffer name + */ + @NativeType("ALboolean") + public static boolean alIsBuffer(@NativeType("ALuint") int bufferName) { + long __functionAddress = AL.getICD().alIsBuffer; + return invokeZ(bufferName, __functionAddress); + } + + // --- [ alGetBufferf ] --- + + /** Unsafe version of: {@link #alGetBufferf GetBufferf} */ + public static void nalGetBufferf(int bufferName, int paramName, long value) { + long __functionAddress = AL.getICD().alGetBufferf; + invokePV(bufferName, paramName, value, __functionAddress); + } + + /** + * Returns the float value of the specified buffer parameter. + * + * @param bufferName the buffer to query + * @param paramName the parameter to query. One of:
{@link #AL_FREQUENCY FREQUENCY}{@link #AL_BITS BITS}{@link #AL_CHANNELS CHANNELS}{@link #AL_SIZE SIZE}
+ * @param value the parameter value + */ + @NativeType("ALvoid") + public static void alGetBufferf(@NativeType("ALuint") int bufferName, @NativeType("ALenum") int paramName, @NativeType("ALfloat *") FloatBuffer value) { + if (CHECKS) { + check(value, 1); + } + nalGetBufferf(bufferName, paramName, memAddress(value)); + } + + /** + * Returns the float value of the specified buffer parameter. + * + * @param bufferName the buffer to query + * @param paramName the parameter to query. One of:
{@link #AL_FREQUENCY FREQUENCY}{@link #AL_BITS BITS}{@link #AL_CHANNELS CHANNELS}{@link #AL_SIZE SIZE}
+ */ + @NativeType("ALvoid") + public static float alGetBufferf(@NativeType("ALuint") int bufferName, @NativeType("ALenum") int paramName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer value = stack.callocFloat(1); + nalGetBufferf(bufferName, paramName, memAddress(value)); + return value.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alGetBufferi ] --- + + /** Unsafe version of: {@link #alGetBufferi GetBufferi} */ + public static void nalGetBufferi(int bufferName, int paramName, long value) { + long __functionAddress = AL.getICD().alGetBufferi; + invokePV(bufferName, paramName, value, __functionAddress); + } + + /** + * Returns the integer value of the specified buffer parameter. + * + * @param bufferName the buffer to query + * @param paramName the parameter to query. One of:
{@link #AL_FREQUENCY FREQUENCY}{@link #AL_BITS BITS}{@link #AL_CHANNELS CHANNELS}{@link #AL_SIZE SIZE}
+ * @param value the parameter value + */ + @NativeType("ALvoid") + public static void alGetBufferi(@NativeType("ALuint") int bufferName, @NativeType("ALenum") int paramName, @NativeType("ALint *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nalGetBufferi(bufferName, paramName, memAddress(value)); + } + + /** + * Returns the integer value of the specified buffer parameter. + * + * @param bufferName the buffer to query + * @param paramName the parameter to query. One of:
{@link #AL_FREQUENCY FREQUENCY}{@link #AL_BITS BITS}{@link #AL_CHANNELS CHANNELS}{@link #AL_SIZE SIZE}
+ */ + @NativeType("ALvoid") + public static int alGetBufferi(@NativeType("ALuint") int bufferName, @NativeType("ALenum") int paramName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer value = stack.callocInt(1); + nalGetBufferi(bufferName, paramName, memAddress(value)); + return value.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alBufferData ] --- + + /** + * Unsafe version of: {@link #alBufferData BufferData} + * + * @param size the data buffer size, in bytes + */ + public static void nalBufferData(int bufferName, int format, long data, int size, int frequency) { + long __functionAddress = AL.getICD().alBufferData; + invokePV(bufferName, format, data, size, frequency, __functionAddress); + } + + /** + * Sets the sample data of the specified buffer. + * + *

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.

+ * + *

8-bit data is expressed as an unsigned value over the range 0 to 255, 128 being an audio output level of zero.

+ * + *

16-bit data is expressed as a signed value over the range -32768 to 32767, 0 being an audio output level of zero. Byte order for 16-bit values is + * determined by the native format of the CPU.

+ * + *

Stereo data is expressed in an interleaved format, left channel sample followed by the right channel sample.

+ * + *

Buffers containing audio data with more than one channel will be played without 3D spatialization features – these formats are normally used for + * background music.

+ * + * @param bufferName the buffer to modify + * @param format the data format. One of:
{@link #AL_FORMAT_MONO8 FORMAT_MONO8}{@link #AL_FORMAT_MONO16 FORMAT_MONO16}{@link #AL_FORMAT_STEREO8 FORMAT_STEREO8}{@link #AL_FORMAT_STEREO16 FORMAT_STEREO16}
+ * @param data the sample data + * @param frequency the data frequency + */ + @NativeType("ALvoid") + public static void alBufferData(@NativeType("ALuint") int bufferName, @NativeType("ALenum") int format, @NativeType("ALvoid const *") ByteBuffer data, @NativeType("ALsizei") int frequency) { + nalBufferData(bufferName, format, memAddress(data), data.remaining(), frequency); + } + + /** + * Sets the sample data of the specified buffer. + * + *

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.

+ * + *

8-bit data is expressed as an unsigned value over the range 0 to 255, 128 being an audio output level of zero.

+ * + *

16-bit data is expressed as a signed value over the range -32768 to 32767, 0 being an audio output level of zero. Byte order for 16-bit values is + * determined by the native format of the CPU.

+ * + *

Stereo data is expressed in an interleaved format, left channel sample followed by the right channel sample.

+ * + *

Buffers containing audio data with more than one channel will be played without 3D spatialization features – these formats are normally used for + * background music.

+ * + * @param bufferName the buffer to modify + * @param format the data format. One of:
{@link #AL_FORMAT_MONO8 FORMAT_MONO8}{@link #AL_FORMAT_MONO16 FORMAT_MONO16}{@link #AL_FORMAT_STEREO8 FORMAT_STEREO8}{@link #AL_FORMAT_STEREO16 FORMAT_STEREO16}
+ * @param data the sample data + * @param frequency the data frequency + */ + @NativeType("ALvoid") + public static void alBufferData(@NativeType("ALuint") int bufferName, @NativeType("ALenum") int format, @NativeType("ALvoid const *") ShortBuffer data, @NativeType("ALsizei") int frequency) { + nalBufferData(bufferName, format, memAddress(data), data.remaining() << 1, frequency); + } + + /** + * Sets the sample data of the specified buffer. + * + *

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.

+ * + *

8-bit data is expressed as an unsigned value over the range 0 to 255, 128 being an audio output level of zero.

+ * + *

16-bit data is expressed as a signed value over the range -32768 to 32767, 0 being an audio output level of zero. Byte order for 16-bit values is + * determined by the native format of the CPU.

+ * + *

Stereo data is expressed in an interleaved format, left channel sample followed by the right channel sample.

+ * + *

Buffers containing audio data with more than one channel will be played without 3D spatialization features – these formats are normally used for + * background music.

+ * + * @param bufferName the buffer to modify + * @param format the data format. One of:
{@link #AL_FORMAT_MONO8 FORMAT_MONO8}{@link #AL_FORMAT_MONO16 FORMAT_MONO16}{@link #AL_FORMAT_STEREO8 FORMAT_STEREO8}{@link #AL_FORMAT_STEREO16 FORMAT_STEREO16}
+ * @param data the sample data + * @param frequency the data frequency + */ + @NativeType("ALvoid") + public static void alBufferData(@NativeType("ALuint") int bufferName, @NativeType("ALenum") int format, @NativeType("ALvoid const *") IntBuffer data, @NativeType("ALsizei") int frequency) { + nalBufferData(bufferName, format, memAddress(data), data.remaining() << 2, frequency); + } + + /** + * Sets the sample data of the specified buffer. + * + *

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.

+ * + *

8-bit data is expressed as an unsigned value over the range 0 to 255, 128 being an audio output level of zero.

+ * + *

16-bit data is expressed as a signed value over the range -32768 to 32767, 0 being an audio output level of zero. Byte order for 16-bit values is + * determined by the native format of the CPU.

+ * + *

Stereo data is expressed in an interleaved format, left channel sample followed by the right channel sample.

+ * + *

Buffers containing audio data with more than one channel will be played without 3D spatialization features – these formats are normally used for + * background music.

+ * + * @param bufferName the buffer to modify + * @param format the data format. One of:
{@link #AL_FORMAT_MONO8 FORMAT_MONO8}{@link #AL_FORMAT_MONO16 FORMAT_MONO16}{@link #AL_FORMAT_STEREO8 FORMAT_STEREO8}{@link #AL_FORMAT_STEREO16 FORMAT_STEREO16}
+ * @param data the sample data + * @param frequency the data frequency + */ + @NativeType("ALvoid") + public static void alBufferData(@NativeType("ALuint") int bufferName, @NativeType("ALenum") int format, @NativeType("ALvoid const *") FloatBuffer data, @NativeType("ALsizei") int frequency) { + nalBufferData(bufferName, format, memAddress(data), data.remaining() << 2, frequency); + } + + // --- [ alGetEnumValue ] --- + + /** Unsafe version of: {@link #alGetEnumValue GetEnumValue} */ + public static int nalGetEnumValue(long enumName) { + long __functionAddress = AL.getICD().alGetEnumValue; + return invokePI(enumName, __functionAddress); + } + + /** + * Returns the enumeration value of the specified enum. + * + * @param enumName the enum name + */ + @NativeType("ALuint") + public static int alGetEnumValue(@NativeType("ALchar const *") ByteBuffer enumName) { + if (CHECKS) { + checkNT1(enumName); + } + return nalGetEnumValue(memAddress(enumName)); + } + + /** + * Returns the enumeration value of the specified enum. + * + * @param enumName the enum name + */ + @NativeType("ALuint") + public static int alGetEnumValue(@NativeType("ALchar const *") CharSequence enumName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(enumName, true); + long enumNameEncoded = stack.getPointerAddress(); + return nalGetEnumValue(enumNameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alGetProcAddress ] --- + + /** Unsafe version of: {@link #alGetProcAddress GetProcAddress} */ + public static long nalGetProcAddress(long funcName) { + long __functionAddress = AL.getICD().alGetProcAddress; + return invokePP(funcName, __functionAddress); + } + + /** + * Retrieves extension entry points. + * + *

Returns {@code NULL} if no entry point with the name funcName can be found. Implementations are free to return {@code NULL} if an entry point is present, but not + * applicable for the current context. However the specification does not guarantee this behavior.

+ * + *

Applications can use alGetProcAddress to obtain core API entry points, not just extensions. This is the recommended way to dynamically load and unload + * OpenAL DLL's as sound drivers.

+ * + * @param funcName the function name + */ + @NativeType("void *") + public static long alGetProcAddress(@NativeType("ALchar const *") ByteBuffer funcName) { + if (CHECKS) { + checkNT1(funcName); + } + return nalGetProcAddress(memAddress(funcName)); + } + + /** + * Retrieves extension entry points. + * + *

Returns {@code NULL} if no entry point with the name funcName can be found. Implementations are free to return {@code NULL} if an entry point is present, but not + * applicable for the current context. However the specification does not guarantee this behavior.

+ * + *

Applications can use alGetProcAddress to obtain core API entry points, not just extensions. This is the recommended way to dynamically load and unload + * OpenAL DLL's as sound drivers.

+ * + * @param funcName the function name + */ + @NativeType("void *") + public static long alGetProcAddress(@NativeType("ALchar const *") CharSequence funcName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(funcName, true); + long funcNameEncoded = stack.getPointerAddress(); + return nalGetProcAddress(funcNameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alIsExtensionPresent ] --- + + /** Unsafe version of: {@link #alIsExtensionPresent IsExtensionPresent} */ + public static boolean nalIsExtensionPresent(long extName) { + long __functionAddress = AL.getICD().alIsExtensionPresent; + return invokePZ(extName, __functionAddress); + } + + /** + * Verifies that a given extension is available for the current context and the device it is associated with. + * + *

Invalid and unsupported string tokens return ALC_FALSE. {@code extName} is not case sensitive – the implementation will convert the name to all + * upper-case internally (and will express extension names in upper-case).

+ * + * @param extName the extension name + */ + @NativeType("ALCboolean") + public static boolean alIsExtensionPresent(@NativeType("ALchar const *") ByteBuffer extName) { + if (CHECKS) { + checkNT1(extName); + } + return nalIsExtensionPresent(memAddress(extName)); + } + + /** + * Verifies that a given extension is available for the current context and the device it is associated with. + * + *

Invalid and unsupported string tokens return ALC_FALSE. {@code extName} is not case sensitive – the implementation will convert the name to all + * upper-case internally (and will express extension names in upper-case).

+ * + * @param extName the extension name + */ + @NativeType("ALCboolean") + public static boolean alIsExtensionPresent(@NativeType("ALchar const *") CharSequence extName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(extName, true); + long extNameEncoded = stack.getPointerAddress(); + return nalIsExtensionPresent(extNameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #alGetIntegerv GetIntegerv} */ + @NativeType("ALvoid") + public static void alGetIntegerv(@NativeType("ALenum") int paramName, @NativeType("ALint *") int[] dest) { + long __functionAddress = AL.getICD().alGetIntegerv; + if (CHECKS) { + check(dest, 1); + } + invokePV(paramName, dest, __functionAddress); + } + + /** Array version of: {@link #alGetFloatv GetFloatv} */ + @NativeType("ALvoid") + public static void alGetFloatv(@NativeType("ALenum") int paramName, @NativeType("ALfloat *") float[] dest) { + long __functionAddress = AL.getICD().alGetFloatv; + if (CHECKS) { + check(dest, 1); + } + invokePV(paramName, dest, __functionAddress); + } + + /** Array version of: {@link #alGetDoublev GetDoublev} */ + @NativeType("ALvoid") + public static void alGetDoublev(@NativeType("ALenum") int paramName, @NativeType("ALdouble *") double[] dest) { + long __functionAddress = AL.getICD().alGetDoublev; + if (CHECKS) { + check(dest, 1); + } + invokePV(paramName, dest, __functionAddress); + } + + /** Array version of: {@link #alListenerfv Listenerfv} */ + @NativeType("ALvoid") + public static void alListenerfv(@NativeType("ALenum") int paramName, @NativeType("ALfloat const *") float[] values) { + long __functionAddress = AL.getICD().alListenerfv; + if (CHECKS) { + check(values, 1); + } + invokePV(paramName, values, __functionAddress); + } + + /** Array version of: {@link #alGetListenerf GetListenerf} */ + @NativeType("ALvoid") + public static void alGetListenerf(@NativeType("ALenum") int paramName, @NativeType("ALfloat *") float[] value) { + long __functionAddress = AL.getICD().alGetListenerf; + if (CHECKS) { + check(value, 1); + } + invokePV(paramName, value, __functionAddress); + } + + /** Array version of: {@link #alGetListeneri GetListeneri} */ + @NativeType("ALvoid") + public static void alGetListeneri(@NativeType("ALenum") int paramName, @NativeType("ALint *") int[] value) { + long __functionAddress = AL.getICD().alGetListeneri; + if (CHECKS) { + check(value, 1); + } + invokePV(paramName, value, __functionAddress); + } + + /** Array version of: {@link #alGetListener3f GetListener3f} */ + @NativeType("ALvoid") + public static void alGetListener3f(@NativeType("ALenum") int paramName, @NativeType("ALfloat *") float[] value1, @NativeType("ALfloat *") float[] value2, @NativeType("ALfloat *") float[] value3) { + long __functionAddress = AL.getICD().alGetListener3f; + if (CHECKS) { + check(value1, 1); + check(value2, 1); + check(value3, 1); + } + invokePPPV(paramName, value1, value2, value3, __functionAddress); + } + + /** Array version of: {@link #alGetListenerfv GetListenerfv} */ + @NativeType("ALvoid") + public static void alGetListenerfv(@NativeType("ALenum") int paramName, @NativeType("ALfloat *") float[] values) { + long __functionAddress = AL.getICD().alGetListenerfv; + if (CHECKS) { + check(values, 1); + } + invokePV(paramName, values, __functionAddress); + } + + /** Array version of: {@link #alGenSources GenSources} */ + @NativeType("ALvoid") + public static void alGenSources(@NativeType("ALuint *") int[] srcNames) { + long __functionAddress = AL.getICD().alGenSources; + invokePV(srcNames.length, srcNames, __functionAddress); + } + + /** Array version of: {@link #alDeleteSources DeleteSources} */ + @NativeType("ALvoid") + public static void alDeleteSources(@NativeType("ALuint *") int[] sources) { + long __functionAddress = AL.getICD().alDeleteSources; + invokePV(sources.length, sources, __functionAddress); + } + + /** Array version of: {@link #alSourcefv Sourcefv} */ + @NativeType("ALvoid") + public static void alSourcefv(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALfloat const *") float[] values) { + long __functionAddress = AL.getICD().alSourcefv; + if (CHECKS) { + check(values, 1); + } + invokePV(source, param, values, __functionAddress); + } + + /** Array version of: {@link #alGetSourcef GetSourcef} */ + @NativeType("ALvoid") + public static void alGetSourcef(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALfloat *") float[] value) { + long __functionAddress = AL.getICD().alGetSourcef; + if (CHECKS) { + check(value, 1); + } + invokePV(source, param, value, __functionAddress); + } + + /** Array version of: {@link #alGetSource3f GetSource3f} */ + @NativeType("ALvoid") + public static void alGetSource3f(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALfloat *") float[] v1, @NativeType("ALfloat *") float[] v2, @NativeType("ALfloat *") float[] v3) { + long __functionAddress = AL.getICD().alGetSource3f; + if (CHECKS) { + check(v1, 1); + check(v2, 1); + check(v3, 1); + } + invokePPPV(source, param, v1, v2, v3, __functionAddress); + } + + /** Array version of: {@link #alGetSourcefv GetSourcefv} */ + @NativeType("ALvoid") + public static void alGetSourcefv(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALfloat *") float[] values) { + long __functionAddress = AL.getICD().alGetSourcefv; + if (CHECKS) { + check(values, 1); + } + invokePV(source, param, values, __functionAddress); + } + + /** Array version of: {@link #alGetSourcei GetSourcei} */ + @NativeType("ALvoid") + public static void alGetSourcei(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALint *") int[] value) { + long __functionAddress = AL.getICD().alGetSourcei; + if (CHECKS) { + check(value, 1); + } + invokePV(source, param, value, __functionAddress); + } + + /** Array version of: {@link #alGetSourceiv GetSourceiv} */ + @NativeType("ALvoid") + public static void alGetSourceiv(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALint *") int[] values) { + long __functionAddress = AL.getICD().alGetSourceiv; + if (CHECKS) { + check(values, 1); + } + invokePV(source, param, values, __functionAddress); + } + + /** Array version of: {@link #alSourceQueueBuffers SourceQueueBuffers} */ + @NativeType("ALvoid") + public static void alSourceQueueBuffers(@NativeType("ALuint") int sourceName, @NativeType("ALuint *") int[] bufferNames) { + long __functionAddress = AL.getICD().alSourceQueueBuffers; + invokePV(sourceName, bufferNames.length, bufferNames, __functionAddress); + } + + /** Array version of: {@link #alSourceUnqueueBuffers SourceUnqueueBuffers} */ + @NativeType("ALvoid") + public static void alSourceUnqueueBuffers(@NativeType("ALuint") int sourceName, @NativeType("ALuint *") int[] bufferNames) { + long __functionAddress = AL.getICD().alSourceUnqueueBuffers; + invokePV(sourceName, bufferNames.length, bufferNames, __functionAddress); + } + + /** Array version of: {@link #alSourcePlayv SourcePlayv} */ + @NativeType("ALvoid") + public static void alSourcePlayv(@NativeType("ALuint const *") int[] sources) { + long __functionAddress = AL.getICD().alSourcePlayv; + invokePV(sources.length, sources, __functionAddress); + } + + /** Array version of: {@link #alSourcePausev SourcePausev} */ + @NativeType("ALvoid") + public static void alSourcePausev(@NativeType("ALuint const *") int[] sources) { + long __functionAddress = AL.getICD().alSourcePausev; + invokePV(sources.length, sources, __functionAddress); + } + + /** Array version of: {@link #alSourceStopv SourceStopv} */ + @NativeType("ALvoid") + public static void alSourceStopv(@NativeType("ALuint const *") int[] sources) { + long __functionAddress = AL.getICD().alSourceStopv; + invokePV(sources.length, sources, __functionAddress); + } + + /** Array version of: {@link #alSourceRewindv SourceRewindv} */ + @NativeType("ALvoid") + public static void alSourceRewindv(@NativeType("ALuint const *") int[] sources) { + long __functionAddress = AL.getICD().alSourceRewindv; + invokePV(sources.length, sources, __functionAddress); + } + + /** Array version of: {@link #alGenBuffers GenBuffers} */ + @NativeType("ALvoid") + public static void alGenBuffers(@NativeType("ALuint *") int[] bufferNames) { + long __functionAddress = AL.getICD().alGenBuffers; + invokePV(bufferNames.length, bufferNames, __functionAddress); + } + + /** Array version of: {@link #alDeleteBuffers DeleteBuffers} */ + @NativeType("ALvoid") + public static void alDeleteBuffers(@NativeType("ALuint const *") int[] bufferNames) { + long __functionAddress = AL.getICD().alDeleteBuffers; + invokePV(bufferNames.length, bufferNames, __functionAddress); + } + + /** Array version of: {@link #alGetBufferf GetBufferf} */ + @NativeType("ALvoid") + public static void alGetBufferf(@NativeType("ALuint") int bufferName, @NativeType("ALenum") int paramName, @NativeType("ALfloat *") float[] value) { + long __functionAddress = AL.getICD().alGetBufferf; + if (CHECKS) { + check(value, 1); + } + invokePV(bufferName, paramName, value, __functionAddress); + } + + /** Array version of: {@link #alGetBufferi GetBufferi} */ + @NativeType("ALvoid") + public static void alGetBufferi(@NativeType("ALuint") int bufferName, @NativeType("ALenum") int paramName, @NativeType("ALint *") int[] value) { + long __functionAddress = AL.getICD().alGetBufferi; + if (CHECKS) { + check(value, 1); + } + invokePV(bufferName, paramName, value, __functionAddress); + } + + /** Array version of: {@link #alBufferData BufferData} */ + @NativeType("ALvoid") + public static void alBufferData(@NativeType("ALuint") int bufferName, @NativeType("ALenum") int format, @NativeType("ALvoid const *") short[] data, @NativeType("ALsizei") int frequency) { + long __functionAddress = AL.getICD().alBufferData; + invokePV(bufferName, format, data, data.length << 1, frequency, __functionAddress); + } + + /** Array version of: {@link #alBufferData BufferData} */ + @NativeType("ALvoid") + public static void alBufferData(@NativeType("ALuint") int bufferName, @NativeType("ALenum") int format, @NativeType("ALvoid const *") int[] data, @NativeType("ALsizei") int frequency) { + long __functionAddress = AL.getICD().alBufferData; + invokePV(bufferName, format, data, data.length << 2, frequency, __functionAddress); + } + + /** Array version of: {@link #alBufferData BufferData} */ + @NativeType("ALvoid") + public static void alBufferData(@NativeType("ALuint") int bufferName, @NativeType("ALenum") int format, @NativeType("ALvoid const *") float[] data, @NativeType("ALsizei") int frequency) { + long __functionAddress = AL.getICD().alBufferData; + invokePV(bufferName, format, data, data.length << 2, frequency, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/AL11.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/AL11.java new file mode 100644 index 00000000..3e70cec6 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/AL11.java @@ -0,0 +1,433 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to AL 1.1 functionality. */ +public class AL11 extends AL10 { + + /** General tokens. */ + public static final int + AL_SEC_OFFSET = 0x1024, + AL_SAMPLE_OFFSET = 0x1025, + AL_BYTE_OFFSET = 0x1026, + AL_STATIC = 0x1028, + AL_STREAMING = 0x1029, + AL_UNDETERMINED = 0x1030, + AL_ILLEGAL_COMMAND = 0xA004, + AL_SPEED_OF_SOUND = 0xC003, + AL_LINEAR_DISTANCE = 0xD003, + AL_LINEAR_DISTANCE_CLAMPED = 0xD004, + AL_EXPONENT_DISTANCE = 0xD005, + AL_EXPONENT_DISTANCE_CLAMPED = 0xD006; + + protected AL11() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(ALCapabilities caps) { + return checkFunctions( + caps.alListener3i, caps.alGetListeneriv, caps.alSource3i, caps.alListeneriv, caps.alSourceiv, caps.alBufferf, caps.alBuffer3f, caps.alBufferfv, + caps.alBufferi, caps.alBuffer3i, caps.alBufferiv, caps.alGetBufferiv, caps.alGetBufferfv, caps.alSpeedOfSound + ); + } + + // --- [ alListener3i ] --- + + /** + * Sets the 3 dimensional integer values of a listener parameter. + * + * @param paramName the parameter to modify + * @param value1 the first value + * @param value2 the second value + * @param value3 the third value + */ + @NativeType("ALvoid") + public static void alListener3i(@NativeType("ALenum") int paramName, @NativeType("ALint") int value1, @NativeType("ALint") int value2, @NativeType("ALint") int value3) { + long __functionAddress = AL.getICD().alListener3i; + if (CHECKS) { + check(__functionAddress); + } + invokeV(paramName, value1, value2, value3, __functionAddress); + } + + // --- [ alGetListeneriv ] --- + + /** Unsafe version of: {@link #alGetListeneriv GetListeneriv} */ + public static void nalGetListeneriv(int param, long values) { + long __functionAddress = AL.getICD().alGetListeneriv; + if (CHECKS) { + check(__functionAddress); + } + invokePV(param, values, __functionAddress); + } + + /** + * Returns the integer values of the specified listener parameter. + * + * @param param the parameter to query + * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alGetListeneriv(@NativeType("ALenum") int param, @NativeType("ALint *") IntBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalGetListeneriv(param, memAddress(values)); + } + + // --- [ alSource3i ] --- + + /** + * Sets the 3 dimensional integer values of a source parameter. + * + * @param source the source to modify + * @param paramName the parameter to modify + * @param value1 the first value + * @param value2 the second value + * @param value3 the third value + */ + @NativeType("ALvoid") + public static void alSource3i(@NativeType("ALuint") int source, @NativeType("ALenum") int paramName, @NativeType("ALint") int value1, @NativeType("ALint") int value2, @NativeType("ALint") int value3) { + long __functionAddress = AL.getICD().alSource3i; + if (CHECKS) { + check(__functionAddress); + } + invokeV(source, paramName, value1, value2, value3, __functionAddress); + } + + // --- [ alListeneriv ] --- + + /** Unsafe version of: {@link #alListeneriv Listeneriv} */ + public static void nalListeneriv(int listener, long value) { + long __functionAddress = AL.getICD().alListeneriv; + if (CHECKS) { + check(__functionAddress); + } + invokePV(listener, value, __functionAddress); + } + + /** + * Pointer version. + * + * @param listener the parameter to modify + * @param value the parameter values + */ + @NativeType("ALvoid") + public static void alListeneriv(@NativeType("ALenum") int listener, @NativeType("ALint const *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nalListeneriv(listener, memAddress(value)); + } + + // --- [ alSourceiv ] --- + + /** Unsafe version of: {@link #alSourceiv Sourceiv} */ + public static void nalSourceiv(int source, int paramName, long value) { + long __functionAddress = AL.getICD().alSourceiv; + if (CHECKS) { + check(__functionAddress); + } + invokePV(source, paramName, value, __functionAddress); + } + + /** + * Pointer version. + * + * @param source the source to modify + * @param paramName the parameter to modify + * @param value the parameter values + */ + @NativeType("ALvoid") + public static void alSourceiv(@NativeType("ALuint") int source, @NativeType("ALenum") int paramName, @NativeType("ALint const *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nalSourceiv(source, paramName, memAddress(value)); + } + + // --- [ alBufferf ] --- + + /** + * Sets the float value of a buffer parameter. + * + * @param buffer the buffer to modify + * @param paramName the parameter to modify + * @param value the value + */ + @NativeType("ALvoid") + public static void alBufferf(@NativeType("ALuint") int buffer, @NativeType("ALenum") int paramName, @NativeType("ALfloat") float value) { + long __functionAddress = AL.getICD().alBufferf; + if (CHECKS) { + check(__functionAddress); + } + invokeV(buffer, paramName, value, __functionAddress); + } + + // --- [ alBuffer3f ] --- + + /** + * Sets the dimensional value of a buffer parameter. + * + * @param buffer the buffer to modify + * @param paramName the parameter to modify + * @param value1 the first value + * @param value2 the second value + * @param value3 the third value + */ + @NativeType("ALvoid") + public static void alBuffer3f(@NativeType("ALuint") int buffer, @NativeType("ALenum") int paramName, @NativeType("ALfloat") float value1, @NativeType("ALfloat") float value2, @NativeType("ALfloat") float value3) { + long __functionAddress = AL.getICD().alBuffer3f; + if (CHECKS) { + check(__functionAddress); + } + invokeV(buffer, paramName, value1, value2, value3, __functionAddress); + } + + // --- [ alBufferfv ] --- + + /** Unsafe version of: {@link #alBufferfv Bufferfv} */ + public static void nalBufferfv(int buffer, int paramName, long value) { + long __functionAddress = AL.getICD().alBufferfv; + if (CHECKS) { + check(__functionAddress); + } + invokePV(buffer, paramName, value, __functionAddress); + } + + /** + * the pointer version of {@link #alBufferf Bufferf} + * + * @param buffer the buffer to modify + * @param paramName the parameter to modify + * @param value the parameter values + */ + @NativeType("ALvoid") + public static void alBufferfv(@NativeType("ALuint") int buffer, @NativeType("ALenum") int paramName, @NativeType("ALfloat const *") FloatBuffer value) { + if (CHECKS) { + check(value, 1); + } + nalBufferfv(buffer, paramName, memAddress(value)); + } + + // --- [ alBufferi ] --- + + /** + * Sets the integer value of a buffer parameter. + * + * @param buffer the buffer to modify + * @param paramName the parameter to modify + * @param value the value + */ + @NativeType("ALvoid") + public static void alBufferi(@NativeType("ALuint") int buffer, @NativeType("ALenum") int paramName, @NativeType("ALint") int value) { + long __functionAddress = AL.getICD().alBufferi; + if (CHECKS) { + check(__functionAddress); + } + invokeV(buffer, paramName, value, __functionAddress); + } + + // --- [ alBuffer3i ] --- + + /** + * Sets the integer 3 dimensional value of a buffer parameter. + * + * @param buffer the buffer to modify + * @param paramName the parameter to modify + * @param value1 the first value + * @param value2 the second value + * @param value3 the third value + */ + @NativeType("ALvoid") + public static void alBuffer3i(@NativeType("ALuint") int buffer, @NativeType("ALenum") int paramName, @NativeType("ALint") int value1, @NativeType("ALint") int value2, @NativeType("ALint") int value3) { + long __functionAddress = AL.getICD().alBuffer3i; + if (CHECKS) { + check(__functionAddress); + } + invokeV(buffer, paramName, value1, value2, value3, __functionAddress); + } + + // --- [ alBufferiv ] --- + + /** Unsafe version of: {@link #alBufferiv Bufferiv} */ + public static void nalBufferiv(int buffer, int paramName, long value) { + long __functionAddress = AL.getICD().alBufferiv; + if (CHECKS) { + check(__functionAddress); + } + invokePV(buffer, paramName, value, __functionAddress); + } + + /** + * the pointer version of {@link #alBufferi Bufferi} + * + * @param buffer the buffer to modify + * @param paramName the parameter to modify + * @param value the parameter values + */ + @NativeType("ALvoid") + public static void alBufferiv(@NativeType("ALuint") int buffer, @NativeType("ALenum") int paramName, @NativeType("ALint const *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nalBufferiv(buffer, paramName, memAddress(value)); + } + + // --- [ alGetBufferiv ] --- + + /** Unsafe version of: {@link #alGetBufferiv GetBufferiv} */ + public static void nalGetBufferiv(int buffer, int param, long values) { + long __functionAddress = AL.getICD().alGetBufferiv; + if (CHECKS) { + check(__functionAddress); + } + invokePV(buffer, param, values, __functionAddress); + } + + /** + * Returns the integer values of the specified buffer parameter. + * + * @param buffer the buffer to query + * @param param the parameter to query + * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alGetBufferiv(@NativeType("ALuint") int buffer, @NativeType("ALenum") int param, @NativeType("ALint *") IntBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalGetBufferiv(buffer, param, memAddress(values)); + } + + // --- [ alGetBufferfv ] --- + + /** Unsafe version of: {@link #alGetBufferfv GetBufferfv} */ + public static void nalGetBufferfv(int buffer, int param, long values) { + long __functionAddress = AL.getICD().alGetBufferfv; + if (CHECKS) { + check(__functionAddress); + } + invokePV(buffer, param, values, __functionAddress); + } + + /** + * Returns the float values of the specified buffer parameter. + * + * @param buffer the buffer to query + * @param param the parameter to query + * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alGetBufferfv(@NativeType("ALuint") int buffer, @NativeType("ALenum") int param, @NativeType("ALfloat *") FloatBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalGetBufferfv(buffer, param, memAddress(values)); + } + + // --- [ alSpeedOfSound ] --- + + /** + * Sets the speed of sound. + * + * @param value the speed of sound + */ + @NativeType("ALvoid") + public static void alSpeedOfSound(@NativeType("ALfloat") float value) { + long __functionAddress = AL.getICD().alSpeedOfSound; + if (CHECKS) { + check(__functionAddress); + } + invokeV(value, __functionAddress); + } + + /** Array version of: {@link #alGetListeneriv GetListeneriv} */ + @NativeType("ALvoid") + public static void alGetListeneriv(@NativeType("ALenum") int param, @NativeType("ALint *") int[] values) { + long __functionAddress = AL.getICD().alGetListeneriv; + if (CHECKS) { + check(__functionAddress); + check(values, 1); + } + invokePV(param, values, __functionAddress); + } + + /** Array version of: {@link #alListeneriv Listeneriv} */ + @NativeType("ALvoid") + public static void alListeneriv(@NativeType("ALenum") int listener, @NativeType("ALint const *") int[] value) { + long __functionAddress = AL.getICD().alListeneriv; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + invokePV(listener, value, __functionAddress); + } + + /** Array version of: {@link #alSourceiv Sourceiv} */ + @NativeType("ALvoid") + public static void alSourceiv(@NativeType("ALuint") int source, @NativeType("ALenum") int paramName, @NativeType("ALint const *") int[] value) { + long __functionAddress = AL.getICD().alSourceiv; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + invokePV(source, paramName, value, __functionAddress); + } + + /** Array version of: {@link #alBufferfv Bufferfv} */ + @NativeType("ALvoid") + public static void alBufferfv(@NativeType("ALuint") int buffer, @NativeType("ALenum") int paramName, @NativeType("ALfloat const *") float[] value) { + long __functionAddress = AL.getICD().alBufferfv; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + invokePV(buffer, paramName, value, __functionAddress); + } + + /** Array version of: {@link #alBufferiv Bufferiv} */ + @NativeType("ALvoid") + public static void alBufferiv(@NativeType("ALuint") int buffer, @NativeType("ALenum") int paramName, @NativeType("ALint const *") int[] value) { + long __functionAddress = AL.getICD().alBufferiv; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + invokePV(buffer, paramName, value, __functionAddress); + } + + /** Array version of: {@link #alGetBufferiv GetBufferiv} */ + @NativeType("ALvoid") + public static void alGetBufferiv(@NativeType("ALuint") int buffer, @NativeType("ALenum") int param, @NativeType("ALint *") int[] values) { + long __functionAddress = AL.getICD().alGetBufferiv; + if (CHECKS) { + check(__functionAddress); + check(values, 1); + } + invokePV(buffer, param, values, __functionAddress); + } + + /** Array version of: {@link #alGetBufferfv GetBufferfv} */ + @NativeType("ALvoid") + public static void alGetBufferfv(@NativeType("ALuint") int buffer, @NativeType("ALenum") int param, @NativeType("ALfloat *") float[] values) { + long __functionAddress = AL.getICD().alGetBufferfv; + if (CHECKS) { + check(__functionAddress); + check(values, 1); + } + invokePV(buffer, param, values, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALC.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALC.java new file mode 100644 index 00000000..1a8f636e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALC.java @@ -0,0 +1,234 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.openal; + +import org.lwjgl.system.*; + +import javax.annotation.*; +import java.nio.*; +import java.util.*; + +import static org.lwjgl.openal.ALC10.*; +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * This class must be used before any OpenAL function is called. It has the following responsibilities: + *
    + *
  • Loads the OpenAL native library into the JVM process.
  • + *
  • Creates instances of {@link ALCCapabilities} classes. An {@code ALCCapabilities} instance contains flags for functionality that is available for an + * OpenAL device. Internally, it also contains function pointers that are only valid for that specific OpenAL device.
  • + *
+ * + *

Library lifecycle

+ *

The OpenAL library is loaded automatically when this class is initialized. Set the {@link Configuration#OPENAL_EXPLICIT_INIT} option to override this + * behavior. Manual loading/unloading can be achieved with the {@link #create} and {@link #destroy} functions. The name of the library loaded can be overridden + * with the {@link Configuration#OPENAL_LIBRARY_NAME} option.

+ * + *

ALCCapabilities creation

+ *

Instances of {@code ALCCapabilities} can be created with the {@link #createCapabilities} method. Calling this method is expensive, so + * {@code ALCCapabilities} instances should be cached in user code.

+ * + * @see AL + */ +public final class ALC { + + @Nullable + private static FunctionProviderLocal functionProvider; + + @Nullable + private static ALCCapabilities icd; + + static { + if (!Configuration.OPENAL_EXPLICIT_INIT.get(false)) { + create(); + } + } + + private ALC() {} + + /** Loads the OpenAL native library, using the default library name. */ + public static void create() { + String libName; + switch (Platform.get()) { + case FCL: + create("libopenal.so"); + return; + case LINUX: + case MACOSX: + libName = "openal"; + break; + case WINDOWS: + libName = "OpenAL"; + break; + default: + throw new IllegalStateException(); + } + + create(Configuration.OPENAL_LIBRARY_NAME.get(Platform.mapLibraryNameBundled(libName))); + } + + private static class SharedLibraryAL extends SharedLibrary.Delegate implements FunctionProviderLocal { + + private final long alcGetProcAddress = getFunctionAddress("alcGetProcAddress"); + + protected SharedLibraryAL(SharedLibrary library) { + super(library); + if (alcGetProcAddress == NULL) { + throw new RuntimeException("A core ALC function is missing. Make sure that the OpenAL library has been loaded correctly."); + } + } + + @Override + public long getFunctionAddress(ByteBuffer functionName) { + long address = library.getFunctionAddress(functionName); + if (address == NULL && Checks.DEBUG_FUNCTIONS) { + apiLog("Failed to locate address for ALC core function " + memASCII(functionName)); + } + return address; + } + + @Override + public long getFunctionAddress(long handle, ByteBuffer functionName) { + long address = invokePPP(handle, memAddress(functionName), alcGetProcAddress); + if (address == NULL && Checks.DEBUG_FUNCTIONS) { + apiLog("Failed to locate address for ALC extension function " + memASCII(functionName)); + } + return address; + } + + } + + /** + * Loads the OpenAL native library, using the specified library name. + * + * @param libName the native library name + */ + public static void create(String libName) { + SharedLibrary OPENAL = Library.loadNative(ALC.class, "org.lwjgl.openal", libName, true); + try { + create(new SharedLibraryAL(OPENAL)); + } catch (RuntimeException e) { + OPENAL.free(); + throw e; + } + } + + /** + * Initializes ALC with the specified {@link FunctionProviderLocal}. This method can be used to implement custom ALC library loading. + * + * @param functionProvider the provider of ALC function addresses + */ + public static void create(FunctionProviderLocal functionProvider) { + if (ALC.functionProvider != null) { + throw new IllegalStateException("ALC has already been created."); + } + + ALC.functionProvider = functionProvider; + + icd = new ALCCapabilities(functionProvider, NULL, Collections.emptySet()); + + AL.init(); + } + + /** Unloads the OpenAL native library. */ + public static void destroy() { + if (functionProvider == null) { + return; + } + + AL.destroy(); + + icd = null; + + if (functionProvider instanceof NativeResource) { + ((NativeResource)functionProvider).free(); + } + functionProvider = null; + } + + static T check(@Nullable T t) { + if (t == null) { + throw new IllegalStateException("OpenAL library has not been loaded."); + } + return t; + } + + /** Returns the {@link FunctionProviderLocal} for the OpenAL native library. */ + public static FunctionProviderLocal getFunctionProvider() { + return check(ALC.functionProvider); + } + + /** Returns the {@link ALCCapabilities} of the OpenAL implementation. */ + static ALCCapabilities getICD() { + return check(icd); + } + + /** + * Creates a new {@link ALCCapabilities} instance for the specified OpenAL device. + * + * @return the {@code ALCCapabilities} instance + */ + public static ALCCapabilities createCapabilities(long device) { + FunctionProviderLocal functionProvider = getFunctionProvider(); + + // We don't have an ALCCapabilities instance when this method is called + // so we have to use the native bindings directly. + long GetIntegerv = functionProvider.getFunctionAddress("alcGetIntegerv"); + long GetString = functionProvider.getFunctionAddress("alcGetString"); + long IsExtensionPresent = functionProvider.getFunctionAddress("alcIsExtensionPresent"); + + if (GetIntegerv == NULL || GetString == NULL || IsExtensionPresent == NULL) { + throw new IllegalStateException("Core ALC functions could not be found. Make sure that OpenAL has been loaded."); + } + + int majorVersion; + int minorVersion; + + try (MemoryStack stack = stackPush()) { + IntBuffer version = stack.mallocInt(1); + + invokePPV(device, ALC_MAJOR_VERSION, 1, memAddress(version), GetIntegerv); + majorVersion = version.get(0); + + invokePPV(device, ALC_MINOR_VERSION, 1, memAddress(version), GetIntegerv); + minorVersion = version.get(0); + } + + int[][] ALC_VERSIONS = { + {0, 1}, // ALC 1 + }; + + Set supportedExtensions = new HashSet<>(16); + + for (int major = 1; major <= ALC_VERSIONS.length; major++) { + int[] minors = ALC_VERSIONS[major - 1]; + for (int minor : minors) { + if (major < majorVersion || (major == majorVersion && minor <= minorVersion)) { + supportedExtensions.add("OpenALC" + major + minor); + } + } + } + + // Parse EXTENSIONS string + String extensionsString = memASCIISafe(invokePP(device, ALC_EXTENSIONS, GetString)); + if (extensionsString != null) { + StringTokenizer tokenizer = new StringTokenizer(extensionsString); + while (tokenizer.hasMoreTokens()) { + String extName = tokenizer.nextToken(); + try (MemoryStack stack = stackPush()) { + if (invokePPZ(device, memAddress(stack.ASCII(extName, true)), IsExtensionPresent)) { + supportedExtensions.add(extName); + } + } + } + } + + return new ALCCapabilities(functionProvider, device, supportedExtensions); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALC10.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALC10.java new file mode 100644 index 00000000..b39f2b84 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALC10.java @@ -0,0 +1,505 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to ALC 1.0 functionality. */ +public class ALC10 { + + /** General tokens. */ + public static final int + ALC_INVALID = 0xFFFFFFFF, + ALC_FALSE = 0x0, + ALC_TRUE = 0x1; + + /** Context creation attributes. */ + public static final int + ALC_FREQUENCY = 0x1007, + ALC_REFRESH = 0x1008, + ALC_SYNC = 0x1009; + + /** Error conditions. */ + public static final int + ALC_NO_ERROR = 0x0, + ALC_INVALID_DEVICE = 0xA001, + ALC_INVALID_CONTEXT = 0xA002, + ALC_INVALID_ENUM = 0xA003, + ALC_INVALID_VALUE = 0xA004, + ALC_OUT_OF_MEMORY = 0xA005; + + /** String queries. */ + public static final int + ALC_DEFAULT_DEVICE_SPECIFIER = 0x1004, + ALC_DEVICE_SPECIFIER = 0x1005, + ALC_EXTENSIONS = 0x1006; + + /** Integer queries. */ + public static final int + ALC_MAJOR_VERSION = 0x1000, + ALC_MINOR_VERSION = 0x1001, + ALC_ATTRIBUTES_SIZE = 0x1002, + ALC_ALL_ATTRIBUTES = 0x1003; + + protected ALC10() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(ALCCapabilities caps) { + return checkFunctions( + caps.alcOpenDevice, caps.alcCloseDevice, caps.alcCreateContext, caps.alcMakeContextCurrent, caps.alcProcessContext, caps.alcSuspendContext, + caps.alcDestroyContext, caps.alcGetCurrentContext, caps.alcGetContextsDevice, caps.alcIsExtensionPresent, caps.alcGetProcAddress, + caps.alcGetEnumValue, caps.alcGetError, caps.alcGetString, caps.alcGetIntegerv + ); + } + + // --- [ alcOpenDevice ] --- + + /** Unsafe version of: {@link #alcOpenDevice OpenDevice} */ + public static long nalcOpenDevice(long deviceSpecifier) { + long __functionAddress = ALC.getICD().alcOpenDevice; + return invokePP(deviceSpecifier, __functionAddress); + } + + /** + * Allows the application to connect to a device. + * + *

If the function returns {@code 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 {@code NULL} is specified, the implementation will provide an implementation specific default.

+ * + * @param deviceSpecifier the requested device or device configuration + */ + @NativeType("ALCdevice *") + public static long alcOpenDevice(@Nullable @NativeType("ALCchar const *") ByteBuffer deviceSpecifier) { + if (CHECKS) { + checkNT1Safe(deviceSpecifier); + } + return nalcOpenDevice(memAddressSafe(deviceSpecifier)); + } + + /** + * Allows the application to connect to a device. + * + *

If the function returns {@code 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 {@code NULL} is specified, the implementation will provide an implementation specific default.

+ * + * @param deviceSpecifier the requested device or device configuration + */ + @NativeType("ALCdevice *") + public static long alcOpenDevice(@Nullable @NativeType("ALCchar const *") CharSequence deviceSpecifier) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8Safe(deviceSpecifier, true); + long deviceSpecifierEncoded = deviceSpecifier == null ? NULL : stack.getPointerAddress(); + return nalcOpenDevice(deviceSpecifierEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alcCloseDevice ] --- + + /** + * Allows the application to disconnect from a device. + * + *

The return code will be ALC_TRUE or ALC_FALSE, indicating success or failure. Failure will occur if all the device's contexts and buffers have not been + * destroyed. Once closed, the {@code deviceHandle} is invalid.

+ * + * @param deviceHandle the device to close + */ + @NativeType("ALCboolean") + public static boolean alcCloseDevice(@NativeType("ALCdevice const *") long deviceHandle) { + long __functionAddress = ALC.getICD().alcCloseDevice; + if (CHECKS) { + check(deviceHandle); + } + return invokePZ(deviceHandle, __functionAddress); + } + + // --- [ alcCreateContext ] --- + + /** Unsafe version of: {@link #alcCreateContext CreateContext} */ + public static long nalcCreateContext(long deviceHandle, long attrList) { + long __functionAddress = ALC.getICD().alcCreateContext; + if (CHECKS) { + check(deviceHandle); + } + return invokePPP(deviceHandle, attrList, __functionAddress); + } + + /** + * Creates an AL context. + * + * @param deviceHandle a valid device + * @param attrList null or a zero terminated list of integer pairs composed of valid ALC attribute tokens and requested values. One of:
{@link #ALC_FREQUENCY FREQUENCY}{@link #ALC_REFRESH REFRESH}{@link #ALC_SYNC SYNC}{@link ALC11#ALC_MONO_SOURCES MONO_SOURCES}{@link ALC11#ALC_STEREO_SOURCES STEREO_SOURCES}
+ */ + @NativeType("ALCcontext *") + public static long alcCreateContext(@NativeType("ALCdevice const *") long deviceHandle, @Nullable @NativeType("ALCint const *") IntBuffer attrList) { + if (CHECKS) { + checkNTSafe(attrList); + } + return nalcCreateContext(deviceHandle, memAddressSafe(attrList)); + } + + // --- [ alcMakeContextCurrent ] --- + + /** + * Makes a context current with respect to OpenAL operation. + * + *

The context parameter can be {@code NULL} or a valid context pointer. Using {@code NULL} results in no context being current, which is useful when shutting OpenAL down. + * 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 the context to make current + */ + @NativeType("ALCboolean") + public static boolean alcMakeContextCurrent(@NativeType("ALCcontext *") long context) { + long __functionAddress = ALC.getICD().alcMakeContextCurrent; + return invokePZ(context, __functionAddress); + } + + // --- [ alcProcessContext ] --- + + /** + * 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 such as the + * offset increments are to be performed), the application uses {@code 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 processing.

+ * + * @param context the context to mark for processing + */ + @NativeType("ALCvoid") + public static void alcProcessContext(@NativeType("ALCcontext *") long context) { + long __functionAddress = ALC.getICD().alcProcessContext; + if (CHECKS) { + check(context); + } + invokePV(context, __functionAddress); + } + + // --- [ alcSuspendContext ] --- + + /** + * 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 such as offset increments are not to be changed), the application uses {@code alcSuspendContext}. + * + *

Repeated calls to alcSuspendContext are legal, and do not affect a context that is already marked as suspended.

+ * + * @param context the context to mark as suspended + */ + @NativeType("ALCvoid") + public static void alcSuspendContext(@NativeType("ALCcontext *") long context) { + long __functionAddress = ALC.getICD().alcSuspendContext; + if (CHECKS) { + check(context); + } + invokePV(context, __functionAddress); + } + + // --- [ alcDestroyContext ] --- + + /** + * Destroys a context. + * + *

The correct way to destroy a context is to first release it using alcMakeCurrent with a {@code NULL} context. Applications should not attempt to destroy a + * current context – doing so will not work and will result in an ALC_INVALID_OPERATION error. All sources within a context will automatically be deleted + * during context destruction.

+ * + * @param context the context to destroy + */ + @NativeType("ALCvoid") + public static void alcDestroyContext(@NativeType("ALCcontext *") long context) { + long __functionAddress = ALC.getICD().alcDestroyContext; + if (CHECKS) { + check(context); + } + invokePV(context, __functionAddress); + } + + // --- [ alcGetCurrentContext ] --- + + /** Queries for, and obtains a handle to, the current context for the application. If there is no current context, {@code NULL} is returned. */ + @NativeType("ALCcontext *") + public static long alcGetCurrentContext() { + long __functionAddress = ALC.getICD().alcGetCurrentContext; + return invokeP(__functionAddress); + } + + // --- [ alcGetContextsDevice ] --- + + /** + * Queries for, and obtains a handle to, the device of a given context. + * + * @param context the context to query + */ + @NativeType("ALCdevice *") + public static long alcGetContextsDevice(@NativeType("ALCcontext *") long context) { + long __functionAddress = ALC.getICD().alcGetContextsDevice; + if (CHECKS) { + check(context); + } + return invokePP(context, __functionAddress); + } + + // --- [ alcIsExtensionPresent ] --- + + /** Unsafe version of: {@link #alcIsExtensionPresent IsExtensionPresent} */ + public static boolean nalcIsExtensionPresent(long deviceHandle, long extName) { + long __functionAddress = ALC.getICD().alcIsExtensionPresent; + return invokePPZ(deviceHandle, extName, __functionAddress); + } + + /** + * Verifies that a given extension is available for the current context and the device it is associated with. + * + *

Invalid and unsupported string tokens return ALC_FALSE. A {@code NULL} deviceHandle is acceptable. {@code extName} is not case sensitive – the implementation + * will convert the name to all upper-case internally (and will express extension names in upper-case).

+ * + * @param deviceHandle the device to query + * @param extName the extension name + */ + @NativeType("ALCboolean") + public static boolean alcIsExtensionPresent(@NativeType("ALCdevice const *") long deviceHandle, @NativeType("ALCchar const *") ByteBuffer extName) { + if (CHECKS) { + checkNT1(extName); + } + return nalcIsExtensionPresent(deviceHandle, memAddress(extName)); + } + + /** + * Verifies that a given extension is available for the current context and the device it is associated with. + * + *

Invalid and unsupported string tokens return ALC_FALSE. A {@code NULL} deviceHandle is acceptable. {@code extName} is not case sensitive – the implementation + * will convert the name to all upper-case internally (and will express extension names in upper-case).

+ * + * @param deviceHandle the device to query + * @param extName the extension name + */ + @NativeType("ALCboolean") + public static boolean alcIsExtensionPresent(@NativeType("ALCdevice const *") long deviceHandle, @NativeType("ALCchar const *") CharSequence extName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(extName, true); + long extNameEncoded = stack.getPointerAddress(); + return nalcIsExtensionPresent(deviceHandle, extNameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alcGetProcAddress ] --- + + /** Unsafe version of: {@link #alcGetProcAddress GetProcAddress} */ + public static long nalcGetProcAddress(long deviceHandle, long funcName) { + long __functionAddress = ALC.getICD().alcGetProcAddress; + return invokePPP(deviceHandle, funcName, __functionAddress); + } + + /** + * Retrieves extension entry points. + * + *

The application is expected to verify the applicability of an extension or core function entry point before requesting it by name, by use of + * {@link #alcIsExtensionPresent IsExtensionPresent}.

+ * + *

Entry points can be device specific, but are not context specific. Using a {@code NULL} device handle does not guarantee that the entry point is returned, + * even if available for one of the available devices.

+ * + * @param deviceHandle the device to query + * @param funcName the function name + */ + @NativeType("void *") + public static long alcGetProcAddress(@NativeType("ALCdevice const *") long deviceHandle, @NativeType("ALchar const *") ByteBuffer funcName) { + if (CHECKS) { + checkNT1(funcName); + } + return nalcGetProcAddress(deviceHandle, memAddress(funcName)); + } + + /** + * Retrieves extension entry points. + * + *

The application is expected to verify the applicability of an extension or core function entry point before requesting it by name, by use of + * {@link #alcIsExtensionPresent IsExtensionPresent}.

+ * + *

Entry points can be device specific, but are not context specific. Using a {@code NULL} device handle does not guarantee that the entry point is returned, + * even if available for one of the available devices.

+ * + * @param deviceHandle the device to query + * @param funcName the function name + */ + @NativeType("void *") + public static long alcGetProcAddress(@NativeType("ALCdevice const *") long deviceHandle, @NativeType("ALchar const *") CharSequence funcName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(funcName, true); + long funcNameEncoded = stack.getPointerAddress(); + return nalcGetProcAddress(deviceHandle, funcNameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alcGetEnumValue ] --- + + /** Unsafe version of: {@link #alcGetEnumValue GetEnumValue} */ + public static int nalcGetEnumValue(long deviceHandle, long enumName) { + long __functionAddress = ALC.getICD().alcGetEnumValue; + return invokePPI(deviceHandle, enumName, __functionAddress); + } + + /** + * Returns extension enum values. + * + *

Enumeration/token values are device independent, but tokens defined for extensions might not be present for a given device. Using a {@code NULL} handle is + * legal, but only the tokens defined by the AL core are guaranteed. Availability of extension tokens depends on the ALC extension.

+ * + * @param deviceHandle the device to query + * @param enumName the enum name + */ + @NativeType("ALCenum") + public static int alcGetEnumValue(@NativeType("ALCdevice const *") long deviceHandle, @NativeType("ALCchar const *") ByteBuffer enumName) { + if (CHECKS) { + checkNT1(enumName); + } + return nalcGetEnumValue(deviceHandle, memAddress(enumName)); + } + + /** + * Returns extension enum values. + * + *

Enumeration/token values are device independent, but tokens defined for extensions might not be present for a given device. Using a {@code NULL} handle is + * legal, but only the tokens defined by the AL core are guaranteed. Availability of extension tokens depends on the ALC extension.

+ * + * @param deviceHandle the device to query + * @param enumName the enum name + */ + @NativeType("ALCenum") + public static int alcGetEnumValue(@NativeType("ALCdevice const *") long deviceHandle, @NativeType("ALCchar const *") CharSequence enumName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(enumName, true); + long enumNameEncoded = stack.getPointerAddress(); + return nalcGetEnumValue(deviceHandle, enumNameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alcGetError ] --- + + /** + * Queries ALC errors. + * + *

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

+ * + *

Error conditions are specific to the device, and (like AL) a call to alcGetError resets the error state.

+ * + * @param deviceHandle the device to query + */ + @NativeType("ALCenum") + public static int alcGetError(@NativeType("ALCdevice *") long deviceHandle) { + long __functionAddress = ALC.getICD().alcGetError; + return invokePI(deviceHandle, __functionAddress); + } + + // --- [ alcGetString ] --- + + /** Unsafe version of: {@link #alcGetString GetString} */ + public static long nalcGetString(long deviceHandle, int token) { + long __functionAddress = ALC.getICD().alcGetString; + return invokePP(deviceHandle, token, __functionAddress); + } + + /** + * Obtains string value(s) from ALC. + * + *

LWJGL note: Use {@link ALUtil#getStringList} for those tokens that return multiple values.

+ * + * @param deviceHandle the device to query + * @param token the information to query. One of:
{@link #ALC_DEFAULT_DEVICE_SPECIFIER DEFAULT_DEVICE_SPECIFIER}{@link #ALC_DEVICE_SPECIFIER DEVICE_SPECIFIER}{@link #ALC_EXTENSIONS EXTENSIONS}
{@link ALC11#ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER CAPTURE_DEFAULT_DEVICE_SPECIFIER}{@link ALC11#ALC_CAPTURE_DEVICE_SPECIFIER CAPTURE_DEVICE_SPECIFIER}
+ */ + @Nullable + @NativeType("ALCchar const *") + public static String alcGetString(@NativeType("ALCdevice *") long deviceHandle, @NativeType("ALCenum") int token) { + long __result = nalcGetString(deviceHandle, token); + return memUTF8Safe(__result); + } + + // --- [ alcGetIntegerv ] --- + + /** + * Unsafe version of: {@link #alcGetIntegerv GetIntegerv} + * + * @param size the size of the {@code dest} buffer + */ + public static void nalcGetIntegerv(long deviceHandle, int token, int size, long dest) { + long __functionAddress = ALC.getICD().alcGetIntegerv; + invokePPV(deviceHandle, token, size, dest, __functionAddress); + } + + /** + * Obtains integer value(s) from ALC. + * + * @param deviceHandle the device to query + * @param token the information to query. One of:
{@link #ALC_MAJOR_VERSION MAJOR_VERSION}{@link #ALC_MINOR_VERSION MINOR_VERSION}{@link #ALC_ATTRIBUTES_SIZE ATTRIBUTES_SIZE}{@link #ALC_ALL_ATTRIBUTES ALL_ATTRIBUTES}{@link ALC11#ALC_CAPTURE_SAMPLES CAPTURE_SAMPLES}
+ * @param dest the destination buffer + */ + @NativeType("ALCvoid") + public static void alcGetIntegerv(@NativeType("ALCdevice *") long deviceHandle, @NativeType("ALCenum") int token, @NativeType("ALCint *") IntBuffer dest) { + nalcGetIntegerv(deviceHandle, token, dest.remaining(), memAddress(dest)); + } + + /** + * Obtains integer value(s) from ALC. + * + * @param deviceHandle the device to query + * @param token the information to query. One of:
{@link #ALC_MAJOR_VERSION MAJOR_VERSION}{@link #ALC_MINOR_VERSION MINOR_VERSION}{@link #ALC_ATTRIBUTES_SIZE ATTRIBUTES_SIZE}{@link #ALC_ALL_ATTRIBUTES ALL_ATTRIBUTES}{@link ALC11#ALC_CAPTURE_SAMPLES CAPTURE_SAMPLES}
+ */ + @NativeType("ALCvoid") + public static int alcGetInteger(@NativeType("ALCdevice *") long deviceHandle, @NativeType("ALCenum") int token) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer dest = stack.callocInt(1); + nalcGetIntegerv(deviceHandle, token, 1, memAddress(dest)); + return dest.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #alcCreateContext CreateContext} */ + @NativeType("ALCcontext *") + public static long alcCreateContext(@NativeType("ALCdevice const *") long deviceHandle, @Nullable @NativeType("ALCint const *") int[] attrList) { + long __functionAddress = ALC.getICD().alcCreateContext; + if (CHECKS) { + check(deviceHandle); + checkNTSafe(attrList); + } + return invokePPP(deviceHandle, attrList, __functionAddress); + } + + /** Array version of: {@link #alcGetIntegerv GetIntegerv} */ + @NativeType("ALCvoid") + public static void alcGetIntegerv(@NativeType("ALCdevice *") long deviceHandle, @NativeType("ALCenum") int token, @NativeType("ALCint *") int[] dest) { + long __functionAddress = ALC.getICD().alcGetIntegerv; + invokePPV(deviceHandle, token, dest.length, dest, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALC11.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALC11.java new file mode 100644 index 00000000..0528c8ff --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALC11.java @@ -0,0 +1,259 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to ALC 1.1 functionality. */ +public class ALC11 extends ALC10 { + + /** Context creation attributes. */ + public static final int + ALC_MONO_SOURCES = 0x1010, + ALC_STEREO_SOURCES = 0x1011; + + /** String queries. */ + public static final int + ALC_DEFAULT_ALL_DEVICES_SPECIFIER = 0x1012, + ALC_ALL_DEVICES_SPECIFIER = 0x1013, + ALC_CAPTURE_DEVICE_SPECIFIER = 0x310, + ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER = 0x311; + + /** Integer queries. */ + public static final int ALC_CAPTURE_SAMPLES = 0x312; + + protected ALC11() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(ALCCapabilities caps) { + return checkFunctions( + caps.alcCaptureOpenDevice, caps.alcCaptureCloseDevice, caps.alcCaptureStart, caps.alcCaptureStop, caps.alcCaptureSamples + ); + } + + // --- [ alcCaptureOpenDevice ] --- + + /** Unsafe version of: {@link #alcCaptureOpenDevice CaptureOpenDevice} */ + public static long nalcCaptureOpenDevice(long deviceName, int frequency, int format, int samples) { + long __functionAddress = ALC.getICD().alcCaptureOpenDevice; + if (CHECKS) { + check(__functionAddress); + } + return invokePP(deviceName, frequency, format, samples, __functionAddress); + } + + /** + * Allows the application to connect to a capture device. + * + *

The {@code deviceName} argument is a null terminated string that requests a certain device or device configuration. If {@code NULL} is specified, the implementation + * will provide an implementation specific default.

+ * + * @param deviceName the device or device configuration + * @param frequency the audio frequency + * @param format the audio format + * @param samples the number of sample frames to buffer in the AL + */ + @NativeType("ALCdevice *") + public static long alcCaptureOpenDevice(@Nullable @NativeType("ALCchar const *") ByteBuffer deviceName, @NativeType("ALCuint") int frequency, @NativeType("ALCenum") int format, @NativeType("ALCsizei") int samples) { + if (CHECKS) { + checkNT1Safe(deviceName); + } + return nalcCaptureOpenDevice(memAddressSafe(deviceName), frequency, format, samples); + } + + /** + * Allows the application to connect to a capture device. + * + *

The {@code deviceName} argument is a null terminated string that requests a certain device or device configuration. If {@code NULL} is specified, the implementation + * will provide an implementation specific default.

+ * + * @param deviceName the device or device configuration + * @param frequency the audio frequency + * @param format the audio format + * @param samples the number of sample frames to buffer in the AL + */ + @NativeType("ALCdevice *") + public static long alcCaptureOpenDevice(@Nullable @NativeType("ALCchar const *") CharSequence deviceName, @NativeType("ALCuint") int frequency, @NativeType("ALCenum") int format, @NativeType("ALCsizei") int samples) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8Safe(deviceName, true); + long deviceNameEncoded = deviceName == null ? NULL : stack.getPointerAddress(); + return nalcCaptureOpenDevice(deviceNameEncoded, frequency, format, samples); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alcCaptureCloseDevice ] --- + + /** + * Allows the application to disconnect from a capture device. + * + * @param device the capture device to close + */ + @NativeType("ALCboolean") + public static boolean alcCaptureCloseDevice(@NativeType("ALCdevice *") long device) { + long __functionAddress = ALC.getICD().alcCaptureCloseDevice; + if (CHECKS) { + check(__functionAddress); + check(device); + } + return invokePZ(device, __functionAddress); + } + + // --- [ alcCaptureStart ] --- + + /** + * Starts recording audio on the specific capture device. + * + *

Once started, the device will record audio to an internal ring buffer, the size of which was specified when opening the device. The application may + * query the capture device to discover how much data is currently available via the alcGetInteger with the ALC_CAPTURE_SAMPLES token. This will report the + * number of sample frames currently available.

+ * + * @param device the capture device + */ + @NativeType("ALCvoid") + public static void alcCaptureStart(@NativeType("ALCdevice *") long device) { + long __functionAddress = ALC.getICD().alcCaptureStart; + if (CHECKS) { + check(__functionAddress); + check(device); + } + invokePV(device, __functionAddress); + } + + // --- [ alcCaptureStop ] --- + + /** + * Halts audio capturing without closing the capture device. + * + *

The implementation is encouraged to optimize for this case. The amount of audio samples available after restarting a stopped capture device is reset to + * zero. The application does not need to stop the capture device to read from it.

+ * + * @param device the capture device + */ + @NativeType("ALCvoid") + public static void alcCaptureStop(@NativeType("ALCdevice *") long device) { + long __functionAddress = ALC.getICD().alcCaptureStop; + if (CHECKS) { + check(__functionAddress); + check(device); + } + invokePV(device, __functionAddress); + } + + // --- [ alcCaptureSamples ] --- + + /** Unsafe version of: {@link #alcCaptureSamples CaptureSamples} */ + public static void nalcCaptureSamples(long device, long buffer, int samples) { + long __functionAddress = ALC.getICD().alcCaptureSamples; + if (CHECKS) { + check(__functionAddress); + check(device); + } + invokePPV(device, buffer, samples, __functionAddress); + } + + /** + * Obtains captured audio samples from the AL. + * + *

The implementation may defer conversion and resampling until this point. Requesting more sample frames than are currently available is an error.

+ * + * @param device the capture device + * @param buffer the buffer that will receive the samples. It must be big enough to contain at least {@code samples} sample frames. + * @param samples the number of sample frames to obtain + */ + @NativeType("ALCvoid") + public static void alcCaptureSamples(@NativeType("ALCdevice *") long device, @NativeType("ALCvoid *") ByteBuffer buffer, @NativeType("ALCsizei") int samples) { + nalcCaptureSamples(device, memAddress(buffer), samples); + } + + /** + * Obtains captured audio samples from the AL. + * + *

The implementation may defer conversion and resampling until this point. Requesting more sample frames than are currently available is an error.

+ * + * @param device the capture device + * @param buffer the buffer that will receive the samples. It must be big enough to contain at least {@code samples} sample frames. + * @param samples the number of sample frames to obtain + */ + @NativeType("ALCvoid") + public static void alcCaptureSamples(@NativeType("ALCdevice *") long device, @NativeType("ALCvoid *") ShortBuffer buffer, @NativeType("ALCsizei") int samples) { + nalcCaptureSamples(device, memAddress(buffer), samples); + } + + /** + * Obtains captured audio samples from the AL. + * + *

The implementation may defer conversion and resampling until this point. Requesting more sample frames than are currently available is an error.

+ * + * @param device the capture device + * @param buffer the buffer that will receive the samples. It must be big enough to contain at least {@code samples} sample frames. + * @param samples the number of sample frames to obtain + */ + @NativeType("ALCvoid") + public static void alcCaptureSamples(@NativeType("ALCdevice *") long device, @NativeType("ALCvoid *") IntBuffer buffer, @NativeType("ALCsizei") int samples) { + nalcCaptureSamples(device, memAddress(buffer), samples); + } + + /** + * Obtains captured audio samples from the AL. + * + *

The implementation may defer conversion and resampling until this point. Requesting more sample frames than are currently available is an error.

+ * + * @param device the capture device + * @param buffer the buffer that will receive the samples. It must be big enough to contain at least {@code samples} sample frames. + * @param samples the number of sample frames to obtain + */ + @NativeType("ALCvoid") + public static void alcCaptureSamples(@NativeType("ALCdevice *") long device, @NativeType("ALCvoid *") FloatBuffer buffer, @NativeType("ALCsizei") int samples) { + nalcCaptureSamples(device, memAddress(buffer), samples); + } + + /** Array version of: {@link #alcCaptureSamples CaptureSamples} */ + @NativeType("ALCvoid") + public static void alcCaptureSamples(@NativeType("ALCdevice *") long device, @NativeType("ALCvoid *") short[] buffer, @NativeType("ALCsizei") int samples) { + long __functionAddress = ALC.getICD().alcCaptureSamples; + if (CHECKS) { + check(__functionAddress); + check(device); + } + invokePPV(device, buffer, samples, __functionAddress); + } + + /** Array version of: {@link #alcCaptureSamples CaptureSamples} */ + @NativeType("ALCvoid") + public static void alcCaptureSamples(@NativeType("ALCdevice *") long device, @NativeType("ALCvoid *") int[] buffer, @NativeType("ALCsizei") int samples) { + long __functionAddress = ALC.getICD().alcCaptureSamples; + if (CHECKS) { + check(__functionAddress); + check(device); + } + invokePPV(device, buffer, samples, __functionAddress); + } + + /** Array version of: {@link #alcCaptureSamples CaptureSamples} */ + @NativeType("ALCvoid") + public static void alcCaptureSamples(@NativeType("ALCdevice *") long device, @NativeType("ALCvoid *") float[] buffer, @NativeType("ALCsizei") int samples) { + long __functionAddress = ALC.getICD().alcCaptureSamples; + if (CHECKS) { + check(__functionAddress); + check(device); + } + invokePPV(device, buffer, samples, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALCCapabilities.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALCCapabilities.java new file mode 100644 index 00000000..a07b8522 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALCCapabilities.java @@ -0,0 +1,144 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +import org.lwjgl.system.*; +import java.util.Set; + +import static org.lwjgl.system.APIUtil.*; + +/** Defines the capabilities of the OpenAL Context API. */ +public final class ALCCapabilities { + + public final long + alcOpenDevice, + alcCloseDevice, + alcCreateContext, + alcMakeContextCurrent, + alcProcessContext, + alcSuspendContext, + alcDestroyContext, + alcGetCurrentContext, + alcGetContextsDevice, + alcIsExtensionPresent, + alcGetProcAddress, + alcGetEnumValue, + alcGetError, + alcGetString, + alcGetIntegerv, + alcCaptureOpenDevice, + alcCaptureCloseDevice, + alcCaptureStart, + alcCaptureStop, + alcCaptureSamples, + alcSetThreadContext, + alcGetThreadContext, + alcGetInteger64vSOFT, + alcGetStringiSOFT, + alcResetDeviceSOFT, + alcLoopbackOpenDeviceSOFT, + alcIsRenderFormatSupportedSOFT, + alcRenderSamplesSOFT, + alcDevicePauseSOFT, + alcDeviceResumeSOFT; + + /** When true, {@link ALC10} is supported. */ + public final boolean OpenALC10; + /** When true, {@link ALC11} is supported. */ + public final boolean OpenALC11; + /** When true, {@link EnumerateAllExt} is supported. */ + public final boolean ALC_ENUMERATE_ALL_EXT; + /** + * An OpenAL 1.1 implementation will always support the {@code ALC_ENUMERATION_EXT} extension. This extension provides for enumeration of the available OpenAL devices + * through {@link ALC10#alcGetString GetString}. An {@link ALC10#alcGetString GetString} query of {@link ALC10#ALC_DEVICE_SPECIFIER DEVICE_SPECIFIER} with a {@code NULL} device passed in will return a list of devices. Each + * device name will be separated by a single {@code NULL} character and the list will be terminated with two {@code NULL} characters. + */ + public final boolean ALC_ENUMERATION_EXT; + /** When true, {@link EXTCapture} is supported. */ + public final boolean ALC_EXT_CAPTURE; + /** When true, {@link EXTDedicated} is supported. */ + public final boolean ALC_EXT_DEDICATED; + /** When true, {@link EXTDefaultFilterOrder} is supported. */ + public final boolean ALC_EXT_DEFAULT_FILTER_ORDER; + /** When true, {@link EXTDisconnect} is supported. */ + public final boolean ALC_EXT_disconnect; + /** When true, {@link EXTEfx} is supported. */ + public final boolean ALC_EXT_EFX; + /** When true, {@link EXTThreadLocalContext} is supported. */ + public final boolean ALC_EXT_thread_local_context; + /** When true, {@link LOKIAudioChannel} is supported. */ + public final boolean ALC_LOKI_audio_channel; + /** When true, {@link SOFTDeviceClock} is supported. */ + public final boolean ALC_SOFT_device_clock; + /** When true, {@link SOFTHRTF} is supported. */ + public final boolean ALC_SOFT_HRTF; + /** When true, {@link SOFTLoopback} is supported. */ + public final boolean ALC_SOFT_loopback; + /** When true, {@link SOFTOutputLimiter} is supported. */ + public final boolean ALC_SOFT_output_limiter; + /** When true, {@link SOFTPauseDevice} is supported. */ + public final boolean ALC_SOFT_pause_device; + + ALCCapabilities(FunctionProviderLocal provider, long device, Set ext) { + alcOpenDevice = provider.getFunctionAddress("alcOpenDevice"); + alcCloseDevice = provider.getFunctionAddress("alcCloseDevice"); + alcCreateContext = provider.getFunctionAddress("alcCreateContext"); + alcMakeContextCurrent = provider.getFunctionAddress("alcMakeContextCurrent"); + alcProcessContext = provider.getFunctionAddress("alcProcessContext"); + alcSuspendContext = provider.getFunctionAddress("alcSuspendContext"); + alcDestroyContext = provider.getFunctionAddress("alcDestroyContext"); + alcGetCurrentContext = provider.getFunctionAddress("alcGetCurrentContext"); + alcGetContextsDevice = provider.getFunctionAddress("alcGetContextsDevice"); + alcIsExtensionPresent = provider.getFunctionAddress("alcIsExtensionPresent"); + alcGetProcAddress = provider.getFunctionAddress("alcGetProcAddress"); + alcGetEnumValue = provider.getFunctionAddress("alcGetEnumValue"); + alcGetError = provider.getFunctionAddress("alcGetError"); + alcGetString = provider.getFunctionAddress("alcGetString"); + alcGetIntegerv = provider.getFunctionAddress("alcGetIntegerv"); + alcCaptureOpenDevice = provider.getFunctionAddress("alcCaptureOpenDevice"); + alcCaptureCloseDevice = provider.getFunctionAddress("alcCaptureCloseDevice"); + alcCaptureStart = provider.getFunctionAddress("alcCaptureStart"); + alcCaptureStop = provider.getFunctionAddress("alcCaptureStop"); + alcCaptureSamples = provider.getFunctionAddress("alcCaptureSamples"); + alcSetThreadContext = provider.getFunctionAddress(device, "alcSetThreadContext"); + alcGetThreadContext = provider.getFunctionAddress(device, "alcGetThreadContext"); + alcGetInteger64vSOFT = provider.getFunctionAddress(device, "alcGetInteger64vSOFT"); + alcGetStringiSOFT = provider.getFunctionAddress(device, "alcGetStringiSOFT"); + alcResetDeviceSOFT = provider.getFunctionAddress(device, "alcResetDeviceSOFT"); + alcLoopbackOpenDeviceSOFT = provider.getFunctionAddress(device, "alcLoopbackOpenDeviceSOFT"); + alcIsRenderFormatSupportedSOFT = provider.getFunctionAddress(device, "alcIsRenderFormatSupportedSOFT"); + alcRenderSamplesSOFT = provider.getFunctionAddress(device, "alcRenderSamplesSOFT"); + alcDevicePauseSOFT = provider.getFunctionAddress(device, "alcDevicePauseSOFT"); + alcDeviceResumeSOFT = provider.getFunctionAddress(device, "alcDeviceResumeSOFT"); + + OpenALC10 = ext.contains("OpenALC10") && checkExtension("OpenALC10", ALC10.isAvailable(this)); + OpenALC11 = ext.contains("OpenALC11") && checkExtension("OpenALC11", ALC11.isAvailable(this)); + ALC_ENUMERATE_ALL_EXT = ext.contains("ALC_ENUMERATE_ALL_EXT"); + ALC_ENUMERATION_EXT = ext.contains("ALC_ENUMERATION_EXT"); + ALC_EXT_CAPTURE = ext.contains("ALC_EXT_CAPTURE") && checkExtension("ALC_EXT_CAPTURE", EXTCapture.isAvailable(this)); + ALC_EXT_DEDICATED = ext.contains("ALC_EXT_DEDICATED"); + ALC_EXT_DEFAULT_FILTER_ORDER = ext.contains("ALC_EXT_DEFAULT_FILTER_ORDER"); + ALC_EXT_disconnect = ext.contains("ALC_EXT_disconnect"); + ALC_EXT_EFX = ext.contains("ALC_EXT_EFX"); + ALC_EXT_thread_local_context = ext.contains("ALC_EXT_thread_local_context") && checkExtension("ALC_EXT_thread_local_context", EXTThreadLocalContext.isAvailable(this)); + ALC_LOKI_audio_channel = ext.contains("ALC_LOKI_audio_channel"); + ALC_SOFT_device_clock = ext.contains("ALC_SOFT_device_clock") && checkExtension("ALC_SOFT_device_clock", SOFTDeviceClock.isAvailable(this)); + ALC_SOFT_HRTF = ext.contains("ALC_SOFT_HRTF") && checkExtension("ALC_SOFT_HRTF", SOFTHRTF.isAvailable(this)); + ALC_SOFT_loopback = ext.contains("ALC_SOFT_loopback") && checkExtension("ALC_SOFT_loopback", SOFTLoopback.isAvailable(this)); + ALC_SOFT_output_limiter = ext.contains("ALC_SOFT_output_limiter"); + ALC_SOFT_pause_device = ext.contains("ALC_SOFT_pause_device") && checkExtension("ALC_SOFT_pause_device", SOFTPauseDevice.isAvailable(this)); + } + + private static boolean checkExtension(String extension, boolean supported) { + if (supported) { + return true; + } + + apiLog("[ALC] " + extension + " was reported as available but an entry point is missing."); + return false; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALCapabilities.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALCapabilities.java new file mode 100644 index 00000000..0c1377d6 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALCapabilities.java @@ -0,0 +1,373 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +import org.lwjgl.system.*; +import java.util.Set; +import org.lwjgl.*; + +import static org.lwjgl.system.APIUtil.*; + +/** Defines the capabilities of an OpenAL context. */ +public final class ALCapabilities { + + public final long + alGetError, + alEnable, + alDisable, + alIsEnabled, + alGetBoolean, + alGetInteger, + alGetFloat, + alGetDouble, + alGetBooleanv, + alGetIntegerv, + alGetFloatv, + alGetDoublev, + alGetString, + alDistanceModel, + alDopplerFactor, + alDopplerVelocity, + alListenerf, + alListeneri, + alListener3f, + alListenerfv, + alGetListenerf, + alGetListeneri, + alGetListener3f, + alGetListenerfv, + alGenSources, + alDeleteSources, + alIsSource, + alSourcef, + alSource3f, + alSourcefv, + alSourcei, + alGetSourcef, + alGetSource3f, + alGetSourcefv, + alGetSourcei, + alGetSourceiv, + alSourceQueueBuffers, + alSourceUnqueueBuffers, + alSourcePlay, + alSourcePause, + alSourceStop, + alSourceRewind, + alSourcePlayv, + alSourcePausev, + alSourceStopv, + alSourceRewindv, + alGenBuffers, + alDeleteBuffers, + alIsBuffer, + alGetBufferf, + alGetBufferi, + alBufferData, + alGetEnumValue, + alGetProcAddress, + alIsExtensionPresent, + alListener3i, + alGetListeneriv, + alSource3i, + alListeneriv, + alSourceiv, + alBufferf, + alBuffer3f, + alBufferfv, + alBufferi, + alBuffer3i, + alBufferiv, + alGetBufferiv, + alGetBufferfv, + alSpeedOfSound, + alGenEffects, + alDeleteEffects, + alIsEffect, + alEffecti, + alEffectiv, + alEffectf, + alEffectfv, + alGetEffecti, + alGetEffectiv, + alGetEffectf, + alGetEffectfv, + alGenFilters, + alDeleteFilters, + alIsFilter, + alFilteri, + alFilteriv, + alFilterf, + alFilterfv, + alGetFilteri, + alGetFilteriv, + alGetFilterf, + alGetFilterfv, + alGenAuxiliaryEffectSlots, + alDeleteAuxiliaryEffectSlots, + alIsAuxiliaryEffectSlot, + alAuxiliaryEffectSloti, + alAuxiliaryEffectSlotiv, + alAuxiliaryEffectSlotf, + alAuxiliaryEffectSlotfv, + alGetAuxiliaryEffectSloti, + alGetAuxiliaryEffectSlotiv, + alGetAuxiliaryEffectSlotf, + alGetAuxiliaryEffectSlotfv, + alBufferDataStatic, + alDeferUpdatesSOFT, + alProcessUpdatesSOFT, + alSourcedSOFT, + alSource3dSOFT, + alSourcedvSOFT, + alGetSourcedSOFT, + alGetSource3dSOFT, + alGetSourcedvSOFT, + alSourcei64SOFT, + alSource3i64SOFT, + alSourcei64vSOFT, + alGetSourcei64SOFT, + alGetSource3i64SOFT, + alGetSourcei64vSOFT, + alGetStringiSOFT; + + /** When true, {@link AL10} is supported. */ + public final boolean OpenAL10; + /** When true, {@link AL11} is supported. */ + public final boolean OpenAL11; + /** When true, {@link EXTAlaw} is supported. */ + public final boolean AL_EXT_ALAW; + /** When true, {@link EXTBFormat} is supported. */ + public final boolean AL_EXT_BFORMAT; + /** When true, {@link EXTDouble} is supported. */ + public final boolean AL_EXT_DOUBLE; + /** When true, {@link EXTEfx} is supported. */ + public final boolean ALC_EXT_EFX; + /** When true, {@link EXTExponentDistance} is supported. */ + public final boolean AL_EXT_EXPONENT_DISTANCE; + /** When true, {@link EXTFloat32} is supported. */ + public final boolean AL_EXT_FLOAT32; + /** When true, {@link EXTIma4} is supported. */ + public final boolean AL_EXT_IMA4; + /** When true, {@link EXTLinearDistance} is supported. */ + public final boolean AL_EXT_LINEAR_DISTANCE; + /** When true, {@link EXTMCFormats} is supported. */ + public final boolean AL_EXT_MCFORMATS; + /** When true, {@link EXTMulaw} is supported. */ + public final boolean AL_EXT_MULAW; + /** When true, {@link EXTMulawBFormat} is supported. */ + public final boolean AL_EXT_MULAW_BFORMAT; + /** When true, {@link EXTMulawMCFormats} is supported. */ + public final boolean AL_EXT_MULAW_MCFORMATS; + /** When true, {@link EXTOffset} is supported. */ + public final boolean AL_EXT_OFFSET; + /** When true, {@link EXTSourceDistanceModel} is supported. */ + public final boolean AL_EXT_source_distance_model; + /** When true, {@link EXTSourceRadius} is supported. */ + public final boolean AL_EXT_SOURCE_RADIUS; + /** When true, {@link EXTStaticBuffer} is supported. */ + public final boolean AL_EXT_static_buffer; + /** When true, {@link EXTStereoAngles} is supported. */ + public final boolean AL_EXT_STEREO_ANGLES; + /** When true, {@link EXTVorbis} is supported. */ + public final boolean AL_EXT_vorbis; + /** When true, {@link LOKIIMAADPCM} is supported. */ + public final boolean AL_LOKI_IMA_ADPCM; + /** When true, {@link LOKIQuadriphonic} is supported. */ + public final boolean AL_LOKI_quadriphonic; + /** When true, {@link LOKIWAVEFormat} is supported. */ + public final boolean AL_LOKI_WAVE_format; + /** When true, {@link SOFTBlockAlignment} is supported. */ + public final boolean AL_SOFT_block_alignment; + /** When true, {@link SOFTDeferredUpdates} is supported. */ + public final boolean AL_SOFT_deferred_updates; + /** When true, {@link SOFTDirectChannels} is supported. */ + public final boolean AL_SOFT_direct_channels; + /** When true, {@link SOFTGainClampEx} is supported. */ + public final boolean AL_SOFT_gain_clamp_ex; + /** When true, {@link SOFTLoopPoints} is supported. */ + public final boolean AL_SOFT_loop_points; + /** When true, {@link SOFTMSADPCM} is supported. */ + public final boolean AL_SOFT_MSADPCM; + /** When true, {@link SOFTSourceLatency} is supported. */ + public final boolean AL_SOFT_source_latency; + /** When true, {@link SOFTSourceLength} is supported. */ + public final boolean AL_SOFT_source_length; + /** When true, {@link SOFTSourceResampler} is supported. */ + public final boolean AL_SOFT_source_resampler; + /** When true, {@link SOFTSourceSpatialize} is supported. */ + public final boolean AL_SOFT_source_spatialize; + + /** Off-heap array of the above function addresses. */ + final PointerBuffer addresses; + + ALCapabilities(FunctionProvider provider, Set ext) { + alGetError = provider.getFunctionAddress("alGetError"); + alEnable = provider.getFunctionAddress("alEnable"); + alDisable = provider.getFunctionAddress("alDisable"); + alIsEnabled = provider.getFunctionAddress("alIsEnabled"); + alGetBoolean = provider.getFunctionAddress("alGetBoolean"); + alGetInteger = provider.getFunctionAddress("alGetInteger"); + alGetFloat = provider.getFunctionAddress("alGetFloat"); + alGetDouble = provider.getFunctionAddress("alGetDouble"); + alGetBooleanv = provider.getFunctionAddress("alGetBooleanv"); + alGetIntegerv = provider.getFunctionAddress("alGetIntegerv"); + alGetFloatv = provider.getFunctionAddress("alGetFloatv"); + alGetDoublev = provider.getFunctionAddress("alGetDoublev"); + alGetString = provider.getFunctionAddress("alGetString"); + alDistanceModel = provider.getFunctionAddress("alDistanceModel"); + alDopplerFactor = provider.getFunctionAddress("alDopplerFactor"); + alDopplerVelocity = provider.getFunctionAddress("alDopplerVelocity"); + alListenerf = provider.getFunctionAddress("alListenerf"); + alListeneri = provider.getFunctionAddress("alListeneri"); + alListener3f = provider.getFunctionAddress("alListener3f"); + alListenerfv = provider.getFunctionAddress("alListenerfv"); + alGetListenerf = provider.getFunctionAddress("alGetListenerf"); + alGetListeneri = provider.getFunctionAddress("alGetListeneri"); + alGetListener3f = provider.getFunctionAddress("alGetListener3f"); + alGetListenerfv = provider.getFunctionAddress("alGetListenerfv"); + alGenSources = provider.getFunctionAddress("alGenSources"); + alDeleteSources = provider.getFunctionAddress("alDeleteSources"); + alIsSource = provider.getFunctionAddress("alIsSource"); + alSourcef = provider.getFunctionAddress("alSourcef"); + alSource3f = provider.getFunctionAddress("alSource3f"); + alSourcefv = provider.getFunctionAddress("alSourcefv"); + alSourcei = provider.getFunctionAddress("alSourcei"); + alGetSourcef = provider.getFunctionAddress("alGetSourcef"); + alGetSource3f = provider.getFunctionAddress("alGetSource3f"); + alGetSourcefv = provider.getFunctionAddress("alGetSourcefv"); + alGetSourcei = provider.getFunctionAddress("alGetSourcei"); + alGetSourceiv = provider.getFunctionAddress("alGetSourceiv"); + alSourceQueueBuffers = provider.getFunctionAddress("alSourceQueueBuffers"); + alSourceUnqueueBuffers = provider.getFunctionAddress("alSourceUnqueueBuffers"); + alSourcePlay = provider.getFunctionAddress("alSourcePlay"); + alSourcePause = provider.getFunctionAddress("alSourcePause"); + alSourceStop = provider.getFunctionAddress("alSourceStop"); + alSourceRewind = provider.getFunctionAddress("alSourceRewind"); + alSourcePlayv = provider.getFunctionAddress("alSourcePlayv"); + alSourcePausev = provider.getFunctionAddress("alSourcePausev"); + alSourceStopv = provider.getFunctionAddress("alSourceStopv"); + alSourceRewindv = provider.getFunctionAddress("alSourceRewindv"); + alGenBuffers = provider.getFunctionAddress("alGenBuffers"); + alDeleteBuffers = provider.getFunctionAddress("alDeleteBuffers"); + alIsBuffer = provider.getFunctionAddress("alIsBuffer"); + alGetBufferf = provider.getFunctionAddress("alGetBufferf"); + alGetBufferi = provider.getFunctionAddress("alGetBufferi"); + alBufferData = provider.getFunctionAddress("alBufferData"); + alGetEnumValue = provider.getFunctionAddress("alGetEnumValue"); + alGetProcAddress = provider.getFunctionAddress("alGetProcAddress"); + alIsExtensionPresent = provider.getFunctionAddress("alIsExtensionPresent"); + alListener3i = provider.getFunctionAddress("alListener3i"); + alGetListeneriv = provider.getFunctionAddress("alGetListeneriv"); + alSource3i = provider.getFunctionAddress("alSource3i"); + alListeneriv = provider.getFunctionAddress("alListeneriv"); + alSourceiv = provider.getFunctionAddress("alSourceiv"); + alBufferf = provider.getFunctionAddress("alBufferf"); + alBuffer3f = provider.getFunctionAddress("alBuffer3f"); + alBufferfv = provider.getFunctionAddress("alBufferfv"); + alBufferi = provider.getFunctionAddress("alBufferi"); + alBuffer3i = provider.getFunctionAddress("alBuffer3i"); + alBufferiv = provider.getFunctionAddress("alBufferiv"); + alGetBufferiv = provider.getFunctionAddress("alGetBufferiv"); + alGetBufferfv = provider.getFunctionAddress("alGetBufferfv"); + alSpeedOfSound = provider.getFunctionAddress("alSpeedOfSound"); + alGenEffects = provider.getFunctionAddress("alGenEffects"); + alDeleteEffects = provider.getFunctionAddress("alDeleteEffects"); + alIsEffect = provider.getFunctionAddress("alIsEffect"); + alEffecti = provider.getFunctionAddress("alEffecti"); + alEffectiv = provider.getFunctionAddress("alEffectiv"); + alEffectf = provider.getFunctionAddress("alEffectf"); + alEffectfv = provider.getFunctionAddress("alEffectfv"); + alGetEffecti = provider.getFunctionAddress("alGetEffecti"); + alGetEffectiv = provider.getFunctionAddress("alGetEffectiv"); + alGetEffectf = provider.getFunctionAddress("alGetEffectf"); + alGetEffectfv = provider.getFunctionAddress("alGetEffectfv"); + alGenFilters = provider.getFunctionAddress("alGenFilters"); + alDeleteFilters = provider.getFunctionAddress("alDeleteFilters"); + alIsFilter = provider.getFunctionAddress("alIsFilter"); + alFilteri = provider.getFunctionAddress("alFilteri"); + alFilteriv = provider.getFunctionAddress("alFilteriv"); + alFilterf = provider.getFunctionAddress("alFilterf"); + alFilterfv = provider.getFunctionAddress("alFilterfv"); + alGetFilteri = provider.getFunctionAddress("alGetFilteri"); + alGetFilteriv = provider.getFunctionAddress("alGetFilteriv"); + alGetFilterf = provider.getFunctionAddress("alGetFilterf"); + alGetFilterfv = provider.getFunctionAddress("alGetFilterfv"); + alGenAuxiliaryEffectSlots = provider.getFunctionAddress("alGenAuxiliaryEffectSlots"); + alDeleteAuxiliaryEffectSlots = provider.getFunctionAddress("alDeleteAuxiliaryEffectSlots"); + alIsAuxiliaryEffectSlot = provider.getFunctionAddress("alIsAuxiliaryEffectSlot"); + alAuxiliaryEffectSloti = provider.getFunctionAddress("alAuxiliaryEffectSloti"); + alAuxiliaryEffectSlotiv = provider.getFunctionAddress("alAuxiliaryEffectSlotiv"); + alAuxiliaryEffectSlotf = provider.getFunctionAddress("alAuxiliaryEffectSlotf"); + alAuxiliaryEffectSlotfv = provider.getFunctionAddress("alAuxiliaryEffectSlotfv"); + alGetAuxiliaryEffectSloti = provider.getFunctionAddress("alGetAuxiliaryEffectSloti"); + alGetAuxiliaryEffectSlotiv = provider.getFunctionAddress("alGetAuxiliaryEffectSlotiv"); + alGetAuxiliaryEffectSlotf = provider.getFunctionAddress("alGetAuxiliaryEffectSlotf"); + alGetAuxiliaryEffectSlotfv = provider.getFunctionAddress("alGetAuxiliaryEffectSlotfv"); + alBufferDataStatic = provider.getFunctionAddress("alBufferDataStatic"); + alDeferUpdatesSOFT = provider.getFunctionAddress("alDeferUpdatesSOFT"); + alProcessUpdatesSOFT = provider.getFunctionAddress("alProcessUpdatesSOFT"); + alSourcedSOFT = provider.getFunctionAddress("alSourcedSOFT"); + alSource3dSOFT = provider.getFunctionAddress("alSource3dSOFT"); + alSourcedvSOFT = provider.getFunctionAddress("alSourcedvSOFT"); + alGetSourcedSOFT = provider.getFunctionAddress("alGetSourcedSOFT"); + alGetSource3dSOFT = provider.getFunctionAddress("alGetSource3dSOFT"); + alGetSourcedvSOFT = provider.getFunctionAddress("alGetSourcedvSOFT"); + alSourcei64SOFT = provider.getFunctionAddress("alSourcei64SOFT"); + alSource3i64SOFT = provider.getFunctionAddress("alSource3i64SOFT"); + alSourcei64vSOFT = provider.getFunctionAddress("alSourcei64vSOFT"); + alGetSourcei64SOFT = provider.getFunctionAddress("alGetSourcei64SOFT"); + alGetSource3i64SOFT = provider.getFunctionAddress("alGetSource3i64SOFT"); + alGetSourcei64vSOFT = provider.getFunctionAddress("alGetSourcei64vSOFT"); + alGetStringiSOFT = provider.getFunctionAddress("alGetStringiSOFT"); + + OpenAL10 = ext.contains("OpenAL10") && checkExtension("OpenAL10", AL10.isAvailable(this)); + OpenAL11 = ext.contains("OpenAL11") && checkExtension("OpenAL11", AL11.isAvailable(this)); + AL_EXT_ALAW = ext.contains("AL_EXT_ALAW"); + AL_EXT_BFORMAT = ext.contains("AL_EXT_BFORMAT"); + AL_EXT_DOUBLE = ext.contains("AL_EXT_DOUBLE"); + ALC_EXT_EFX = ext.contains("ALC_EXT_EFX") && checkExtension("ALC_EXT_EFX", EXTEfx.isAvailable(this)); + AL_EXT_EXPONENT_DISTANCE = ext.contains("AL_EXT_EXPONENT_DISTANCE"); + AL_EXT_FLOAT32 = ext.contains("AL_EXT_FLOAT32"); + AL_EXT_IMA4 = ext.contains("AL_EXT_IMA4"); + AL_EXT_LINEAR_DISTANCE = ext.contains("AL_EXT_LINEAR_DISTANCE"); + AL_EXT_MCFORMATS = ext.contains("AL_EXT_MCFORMATS"); + AL_EXT_MULAW = ext.contains("AL_EXT_MULAW"); + AL_EXT_MULAW_BFORMAT = ext.contains("AL_EXT_MULAW_BFORMAT"); + AL_EXT_MULAW_MCFORMATS = ext.contains("AL_EXT_MULAW_MCFORMATS"); + AL_EXT_OFFSET = ext.contains("AL_EXT_OFFSET"); + AL_EXT_source_distance_model = ext.contains("AL_EXT_source_distance_model"); + AL_EXT_SOURCE_RADIUS = ext.contains("AL_EXT_SOURCE_RADIUS"); + AL_EXT_static_buffer = ext.contains("AL_EXT_static_buffer") && checkExtension("AL_EXT_static_buffer", EXTStaticBuffer.isAvailable(this)); + AL_EXT_STEREO_ANGLES = ext.contains("AL_EXT_STEREO_ANGLES"); + AL_EXT_vorbis = ext.contains("AL_EXT_vorbis"); + AL_LOKI_IMA_ADPCM = ext.contains("AL_LOKI_IMA_ADPCM"); + AL_LOKI_quadriphonic = ext.contains("AL_LOKI_quadriphonic"); + AL_LOKI_WAVE_format = ext.contains("AL_LOKI_WAVE_format"); + AL_SOFT_block_alignment = ext.contains("AL_SOFT_block_alignment"); + AL_SOFT_deferred_updates = ext.contains("AL_SOFT_deferred_updates") && checkExtension("AL_SOFT_deferred_updates", SOFTDeferredUpdates.isAvailable(this)); + AL_SOFT_direct_channels = ext.contains("AL_SOFT_direct_channels"); + AL_SOFT_gain_clamp_ex = ext.contains("AL_SOFT_gain_clamp_ex"); + AL_SOFT_loop_points = ext.contains("AL_SOFT_loop_points"); + AL_SOFT_MSADPCM = ext.contains("AL_SOFT_MSADPCM"); + AL_SOFT_source_latency = ext.contains("AL_SOFT_source_latency") && checkExtension("AL_SOFT_source_latency", SOFTSourceLatency.isAvailable(this)); + AL_SOFT_source_length = ext.contains("AL_SOFT_source_length"); + AL_SOFT_source_resampler = ext.contains("AL_SOFT_source_resampler") && checkExtension("AL_SOFT_source_resampler", SOFTSourceResampler.isAvailable(this)); + AL_SOFT_source_spatialize = ext.contains("AL_SOFT_source_spatialize"); + + addresses = ThreadLocalUtil.getAddressesFromCapabilities(this); + } + + private static boolean checkExtension(String extension, boolean supported) { + if (supported) { + return true; + } + + apiLog("[AL] " + extension + " was reported as available but an entry point is missing."); + return false; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALUtil.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALUtil.java new file mode 100644 index 00000000..4306ec98 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/ALUtil.java @@ -0,0 +1,53 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.openal; + +import javax.annotation.*; +import java.nio.*; +import java.util.*; + +import static org.lwjgl.openal.ALC10.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** OpenAL utilities. */ +public final class ALUtil { + + private ALUtil() { + } + + /** + * Obtains string values from ALC. This is a custom implementation for those tokens that return a list of strings instead of a single string. + * + * @param deviceHandle the device to query + * @param token the information to query. One of:
{@link ALC11#ALC_ALL_DEVICES_SPECIFIER}, {@link ALC11#ALC_CAPTURE_DEVICE_SPECIFIER} + */ + @Nullable + public static List getStringList(long deviceHandle, int token) { + long __result = nalcGetString(deviceHandle, token); + if (__result == NULL) { + return null; + } + + ByteBuffer buffer = memByteBuffer(__result, Integer.MAX_VALUE); + + List strings = new ArrayList<>(); + + int offset = 0; + while (true) { + if (buffer.get() == 0) { + int limit = buffer.position() - 1; + if (limit == offset) { // Previous char was also a \0 == end of list. + break; + } + + strings.add(memUTF8(buffer, limit - offset, offset)); + offset = buffer.position(); + } + } + + return strings; + } + +} diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTAlaw.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTAlaw.java new file mode 100644 index 00000000..0946edfa --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTAlaw.java @@ -0,0 +1,18 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** Native bindings to the {@code AL_EXT_ALAW} extension. */ +public final class EXTAlaw { + + /** Buffer formats. */ + public static final int + AL_FORMAT_MONO_ALAW_EXT = 0x10016, + AL_FORMAT_STEREO_ALAW_EXT = 0x10017; + + private EXTAlaw() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTBFormat.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTBFormat.java new file mode 100644 index 00000000..627109c9 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTBFormat.java @@ -0,0 +1,36 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** + * Native bindings to the {@code AL_EXT_BFORMAT} extension. + * + *

This extension indicates support for the {@link #AL_FORMAT_BFORMAT2D_8 FORMAT_BFORMAT2D_8}, {@link #AL_FORMAT_BFORMAT2D_16 FORMAT_BFORMAT2D_16}, {@link #AL_FORMAT_BFORMAT2D_FLOAT32 FORMAT_BFORMAT2D_FLOAT32}, {@link #AL_FORMAT_BFORMAT3D_8 FORMAT_BFORMAT3D_8}, + * {@link #AL_FORMAT_BFORMAT3D_16 FORMAT_BFORMAT3D_16} and {@link #AL_FORMAT_BFORMAT3D_FLOAT32 FORMAT_BFORMAT3D_FLOAT32} buffer formats. These provide 2D (WXY) and 3D (WXYZ) 8bit int, 16bit int and ALfloat support for + * Ambisonic three- or four-channel B-Format (using W X Y Z channel ordering, encoded as the first three or four channels of Furse-Malham higher order + * Ambisonics). Use of these formats indicate that sources are Ambisonic sources. Such sources can be oriented via {@link AL10#alSourcefv Sourcefv} using the + * {@link AL10#AL_ORIENTATION ORIENTATION} tag, which takes the same parameters as {@code alListenerfv(AL_ORIENTATION,...)}. Such sources DO support {@link AL10#AL_SOURCE_RELATIVE SOURCE_RELATIVE} and the + * soundfield will rotate to reflect the listener's orientation if this is off (the default). Other behaviour is as for stereo or multichannel assets.

+ * + *

Note that Ambisonics orients X, Y and Z axes in a different way to OpenAL. For clarity, we ignore the Ambisonic coordinate system in the API and stick + * to the OpenAL one, making sure that the Front of the Ambisonic soundfield (actually Ambisonic +X) matches the Front of the OpenAL coordinate system (-Z + * by default) etc. For instance, if the orientation of the source is set so that the "at" vector is to the left, then the front of the B-Format + * soundfield will be presented to the left.

+ */ +public final class EXTBFormat { + + /** Ambisonic formats. */ + public static final int + AL_FORMAT_BFORMAT2D_16 = 0x20022, + AL_FORMAT_BFORMAT2D_8 = 0x20021, + AL_FORMAT_BFORMAT2D_FLOAT32 = 0x20023, + AL_FORMAT_BFORMAT3D_16 = 0x20032, + AL_FORMAT_BFORMAT3D_8 = 0x20031, + AL_FORMAT_BFORMAT3D_FLOAT32 = 0x20033; + + private EXTBFormat() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTCapture.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTCapture.java new file mode 100644 index 00000000..8c1e745b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTCapture.java @@ -0,0 +1,205 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the {@code ALC_EXT_CAPTURE} extension. + * + *

An OpenAL 1.1 implementation will always support the {@code ALC_EXT_CAPTURE} extension. This allows an application written to the OpenAL 1.0 specification to + * access the capture abilities.

+ */ +public class EXTCapture { + + /** String queries. */ + public static final int + ALC_CAPTURE_DEVICE_SPECIFIER = 0x310, + ALC_CAPTURE_DEFAULT_DEVICE_SPECIFIER = 0x311; + + /** Integer queries. */ + public static final int ALC_CAPTURE_SAMPLES = 0x312; + + protected EXTCapture() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(ALCCapabilities caps) { + return checkFunctions( + caps.alcCaptureOpenDevice, caps.alcCaptureCloseDevice, caps.alcCaptureStart, caps.alcCaptureStop, caps.alcCaptureSamples + ); + } + + // --- [ alcCaptureOpenDevice ] --- + + /** Unsafe version of: {@link #alcCaptureOpenDevice CaptureOpenDevice} */ + public static long nalcCaptureOpenDevice(long deviceName, int frequency, int format, int samples) { + return ALC11.nalcCaptureOpenDevice(deviceName, frequency, format, samples); + } + + /** + * Allows the application to connect to a capture device. + * + *

The {@code deviceName} argument is a null terminated string that requests a certain device or device configuration. If {@code NULL} is specified, the implementation + * will provide an implementation specific default.

+ * + * @param deviceName the device or device configuration + * @param frequency the audio frequency + * @param format the audio format + * @param samples the number of sample frames to buffer in the AL + */ + @NativeType("ALCdevice *") + public static long alcCaptureOpenDevice(@Nullable @NativeType("ALCchar const *") ByteBuffer deviceName, @NativeType("ALCuint") int frequency, @NativeType("ALCenum") int format, @NativeType("ALCsizei") int samples) { + return ALC11.alcCaptureOpenDevice(deviceName, frequency, format, samples); + } + + /** + * Allows the application to connect to a capture device. + * + *

The {@code deviceName} argument is a null terminated string that requests a certain device or device configuration. If {@code NULL} is specified, the implementation + * will provide an implementation specific default.

+ * + * @param deviceName the device or device configuration + * @param frequency the audio frequency + * @param format the audio format + * @param samples the number of sample frames to buffer in the AL + */ + @NativeType("ALCdevice *") + public static long alcCaptureOpenDevice(@Nullable @NativeType("ALCchar const *") CharSequence deviceName, @NativeType("ALCuint") int frequency, @NativeType("ALCenum") int format, @NativeType("ALCsizei") int samples) { + return ALC11.alcCaptureOpenDevice(deviceName, frequency, format, samples); + } + + // --- [ alcCaptureCloseDevice ] --- + + /** + * Allows the application to disconnect from a capture device. + * + * @param device the capture device to close + */ + @NativeType("ALCboolean") + public static boolean alcCaptureCloseDevice(@NativeType("ALCdevice *") long device) { + return ALC11.alcCaptureCloseDevice(device); + } + + // --- [ alcCaptureStart ] --- + + /** + * Starts recording audio on the specific capture device. + * + *

Once started, the device will record audio to an internal ring buffer, the size of which was specified when opening the device. The application may + * query the capture device to discover how much data is currently available via the alcGetInteger with the ALC_CAPTURE_SAMPLES token. This will report the + * number of sample frames currently available.

+ * + * @param device the capture device + */ + @NativeType("ALCvoid") + public static void alcCaptureStart(@NativeType("ALCdevice *") long device) { + ALC11.alcCaptureStart(device); + } + + // --- [ alcCaptureStop ] --- + + /** + * Halts audio capturing without closing the capture device. + * + *

The implementation is encouraged to optimize for this case. The amount of audio samples available after restarting a stopped capture device is reset to + * zero. The application does not need to stop the capture device to read from it.

+ * + * @param device the capture device + */ + @NativeType("ALCvoid") + public static void alcCaptureStop(@NativeType("ALCdevice *") long device) { + ALC11.alcCaptureStop(device); + } + + // --- [ alcCaptureSamples ] --- + + /** Unsafe version of: {@link #alcCaptureSamples CaptureSamples} */ + public static void nalcCaptureSamples(long device, long buffer, int samples) { + ALC11.nalcCaptureSamples(device, buffer, samples); + } + + /** + * Obtains captured audio samples from the AL. + * + *

The implementation may defer conversion and resampling until this point. Requesting more sample frames than are currently available is an error.

+ * + * @param device the capture device + * @param buffer the buffer that will receive the samples. It must be big enough to contain at least {@code samples} sample frames. + * @param samples the number of sample frames to obtain + */ + @NativeType("ALCvoid") + public static void alcCaptureSamples(@NativeType("ALCdevice *") long device, @NativeType("ALCvoid *") ByteBuffer buffer, @NativeType("ALCsizei") int samples) { + ALC11.alcCaptureSamples(device, buffer, samples); + } + + /** + * Obtains captured audio samples from the AL. + * + *

The implementation may defer conversion and resampling until this point. Requesting more sample frames than are currently available is an error.

+ * + * @param device the capture device + * @param buffer the buffer that will receive the samples. It must be big enough to contain at least {@code samples} sample frames. + * @param samples the number of sample frames to obtain + */ + @NativeType("ALCvoid") + public static void alcCaptureSamples(@NativeType("ALCdevice *") long device, @NativeType("ALCvoid *") ShortBuffer buffer, @NativeType("ALCsizei") int samples) { + ALC11.alcCaptureSamples(device, buffer, samples); + } + + /** + * Obtains captured audio samples from the AL. + * + *

The implementation may defer conversion and resampling until this point. Requesting more sample frames than are currently available is an error.

+ * + * @param device the capture device + * @param buffer the buffer that will receive the samples. It must be big enough to contain at least {@code samples} sample frames. + * @param samples the number of sample frames to obtain + */ + @NativeType("ALCvoid") + public static void alcCaptureSamples(@NativeType("ALCdevice *") long device, @NativeType("ALCvoid *") IntBuffer buffer, @NativeType("ALCsizei") int samples) { + ALC11.alcCaptureSamples(device, buffer, samples); + } + + /** + * Obtains captured audio samples from the AL. + * + *

The implementation may defer conversion and resampling until this point. Requesting more sample frames than are currently available is an error.

+ * + * @param device the capture device + * @param buffer the buffer that will receive the samples. It must be big enough to contain at least {@code samples} sample frames. + * @param samples the number of sample frames to obtain + */ + @NativeType("ALCvoid") + public static void alcCaptureSamples(@NativeType("ALCdevice *") long device, @NativeType("ALCvoid *") FloatBuffer buffer, @NativeType("ALCsizei") int samples) { + ALC11.alcCaptureSamples(device, buffer, samples); + } + + /** Array version of: {@link #alcCaptureSamples CaptureSamples} */ + @NativeType("ALCvoid") + public static void alcCaptureSamples(@NativeType("ALCdevice *") long device, @NativeType("ALCvoid *") short[] buffer, @NativeType("ALCsizei") int samples) { + ALC11.alcCaptureSamples(device, buffer, samples); + } + + /** Array version of: {@link #alcCaptureSamples CaptureSamples} */ + @NativeType("ALCvoid") + public static void alcCaptureSamples(@NativeType("ALCdevice *") long device, @NativeType("ALCvoid *") int[] buffer, @NativeType("ALCsizei") int samples) { + ALC11.alcCaptureSamples(device, buffer, samples); + } + + /** Array version of: {@link #alcCaptureSamples CaptureSamples} */ + @NativeType("ALCvoid") + public static void alcCaptureSamples(@NativeType("ALCdevice *") long device, @NativeType("ALCvoid *") float[] buffer, @NativeType("ALCsizei") int samples) { + ALC11.alcCaptureSamples(device, buffer, samples); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTDedicated.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTDedicated.java new file mode 100644 index 00000000..c4a76a0a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTDedicated.java @@ -0,0 +1,29 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** + * Native bindings to the {@code ALC_EXT_DEDICATED} extension. + * + *

This extension provides two "routing" EFX effects that allow sounds to be sent to dedicated speaker channels. Audio rendered to the dedicated low + * frequency effect ({@link #AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT}) is routed to a subwoofer if one is present. Otherwise, it is discarded.

+ * + *

Audio rendered to the dedicated dialogue effect ({@link #AL_EFFECT_DEDICATED_DIALOGUE EFFECT_DEDICATED_DIALOGUE}) is routed to a front centre speaker if one is present. Otherwise, it is + * rendered to the front centre using the normal spatialisation logic.

+ * + *

Both effects support a gain control parameter {@link #AL_DEDICATED_GAIN DEDICATED_GAIN}, which defaults to 1.

+ */ +public final class EXTDedicated { + + /** {@code ALC_EXT_DEDICATED} tokens. */ + public static final int + AL_DEDICATED_GAIN = 0x1, + AL_EFFECT_DEDICATED_DIALOGUE = 0x9001, + AL_EFFECT_DEDICATED_LOW_FREQUENCY_EFFECT = 0x9000; + + private EXTDedicated() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTDefaultFilterOrder.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTDefaultFilterOrder.java new file mode 100644 index 00000000..1c1e4821 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTDefaultFilterOrder.java @@ -0,0 +1,23 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** + * Native bindings to the {@code ALC_EXT_DEFAULT_FILTER_ORDER} extension. + * + *

This extension allows the default filter order (i.e. slope) to be selected at context creation time. Attibute {@link #ALC_DEFAULT_FILTER_ORDER DEFAULT_FILTER_ORDER} can be used with a + * value of 1 (for -6dB/oct) or 2 (for -12dB/oct).

+ * + *

{@link #ALC_DEFAULT_FILTER_ORDER DEFAULT_FILTER_ORDER} can also be used with {@link ALC10#alcGetIntegerv GetIntegerv} to find out the current default filter order.

+ */ +public final class EXTDefaultFilterOrder { + + /** {@code ALC_EXT_DEFAULT_FILTER_ORDER} tokens. */ + public static final int ALC_DEFAULT_FILTER_ORDER = 0x1100; + + private EXTDefaultFilterOrder() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTDisconnect.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTDisconnect.java new file mode 100644 index 00000000..4cb48da3 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTDisconnect.java @@ -0,0 +1,66 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** + * Native bindings to the {@code ALC_EXT_disconnect} extension. + * + *

In OpenAL, there is no way to know if a device has been lost, nor is there a spec-approved means to deal with this properly. While most people are + * using either PCI audio cards or a chip welded to their motherboard, there are many devices that are more dynamic in nature, such as USB and Firewire + * based-units. Such units may lose external power seperate from the system, or may have their cables unplugged at runtime. The OS may reassign the + * hardware to a higher-priority process. If nothing else, a user may unplug the hardware without a proper shutdown (or properly shut them down at the OS + * level and not within the application).

+ * + *

Other audio "devices" may vanish, too, such as the network connection that hosts a remote audio device like esound, nas, or arts.

+ * + *

In these cases, the OpenAL spec says nothing, which we must assume means that all resulting behaviour is totally undefined, including everything from + * continued function without audio output to a crash within the AL.

+ * + *

This extension, ALC_EXT_disconnect, strives to define AL behaviour in these cases and give the application a means to discover and deal with total + * device failure.

+ * + *

Device disconnect

+ * + *

If a device is unplugged, lost or otherwise damaged beyond functioning, the device is flagged as "disconnected" and the ALCdevice handle is considered + * a "zombie" device.

+ * + *

When a device is disconnected, the implementation will, in most respects, keep processing as normal. For example, even though there is no longer any + * output when a USB audio device is removed, setting and querying state on the Listener should keep functioning as expected.

+ * + *

All sources in the {@link AL10#AL_PLAYING PLAYING} state will immediately progress to {@link AL10#AL_STOPPED STOPPED} upon disconnect of their containing device. Any source started after the + * disconnect will immediately progress to {@link AL10#AL_STOPPED STOPPED}. As in any stopped source, this also means that queued buffers all go to {@link AL10#AL_PROCESSED PROCESSED} as well. Sources + * that are in the {@link AL10#AL_PAUSED PAUSED} or {@link AL10#AL_INITIAL INITIAL} state do not change on disconnect, but will follow this behaviour if the application later tries to promote them to + * the {@link AL10#AL_PLAYING PLAYING} state.

+ * + *

Zombie devices may not have new contexts created on them; {@link ALC10#alcCreateContext CreateContext} will fail, returning a {@code NULL} pointer, if the specified device has been + * disconnected.

+ * + *

The application may determine if a device has been disconnected by using the {@link #ALC_CONNECTED CONNECTED} token with {@link ALC10#alcGetIntegerv GetIntegerv}. When a device has been + * disconnected, the application is permitted to close the zombie device's handle in the normal way, and may choose to open a new device.

+ * + *

Applications that use {@link #ALC_CONNECTED CONNECTED} are encouraged to query it with relative frequency. A game, for example, should call it once per rendering frame, per + * device. A device may become disconnected at any time without warning.

+ * + *

Once a device is disconnected, it will never become reconnected. Even if the user plugs the device back in, the application must close the existing + * zombie device handle and reopen it with {@code alc*OpenDevice()}.

+ * + *

If device enumeration is available via ALC_ENUMERATION_EXT, ALC_ENUMERATE_ALL_EXT, or AL 1.1, the list of devices may change between calls as devices + * become disconnected and reconnected. To prevent race conditions, the pointer to device list strings provided to the application will remain valid until + * the next call to {@link ALC10#alcGetString GetString}. The implementation may either cache the result of the previous request or perform a complete device redetection + * during the {@link ALC10#alcGetString GetString} call. As such, enumeration may not be a "fast call" and should not be called in time-sensitive code. If capture devices + * are available via ALC_EXT_capture or AL 1.1, disconnection management can be used with both output and capture devices. A disconnected capture device + * will continue to function, but will not report a larger number in the {@link ALC11#ALC_CAPTURE_SAMPLES CAPTURE_SAMPLES} query. If the capture device had reported some number of + * samples were available but the samples were not transferred from the device to the AL at the time of disconnect, the AL should feed the application + * that amount of silence in the {@link ALC11#alcCaptureSamples CaptureSamples} call. Future queries of {@link ALC11#ALC_CAPTURE_SAMPLES CAPTURE_SAMPLES} should report zero samples available.

+ */ +public final class EXTDisconnect { + + /** {@code ALC_EXT_disconnect} tokens. */ + public static final int ALC_CONNECTED = 0x313; + + private EXTDisconnect() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTDouble.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTDouble.java new file mode 100644 index 00000000..a7db63ff --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTDouble.java @@ -0,0 +1,18 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** Native bindings to the {@code AL_EXT_DOUBLE} extension. */ +public final class EXTDouble { + + /** Buffer formats. */ + public static final int + AL_FORMAT_MONO_DOUBLE_EXT = 0x10012, + AL_FORMAT_STEREO_DOUBLE_EXT = 0x10013; + + private EXTDouble() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTEfx.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTEfx.java new file mode 100644 index 00000000..8baa5eef --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTEfx.java @@ -0,0 +1,1878 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the {@code ALC_EXT_EFX} extension. + * + *

The Effects Extension is designed to provide a generic, cross-platform framework for adding advanced DSP effects to OpenAL.

+ */ +public class EXTEfx { + + /** ALC tokens. */ + public static final int + ALC_EFX_MAJOR_VERSION = 0x20001, + ALC_EFX_MINOR_VERSION = 0x20002, + ALC_MAX_AUXILIARY_SENDS = 0x20003; + + /** Listener properties. */ + public static final int AL_METERS_PER_UNIT = 0x20004; + + /** Source properties. */ + public static final int + AL_DIRECT_FILTER = 0x20005, + AL_AUXILIARY_SEND_FILTER = 0x20006, + AL_AIR_ABSORPTION_FACTOR = 0x20007, + AL_ROOM_ROLLOFF_FACTOR = 0x20008, + AL_CONE_OUTER_GAINHF = 0x20009, + AL_DIRECT_FILTER_GAINHF_AUTO = 0x2000A, + AL_AUXILIARY_SEND_FILTER_GAIN_AUTO = 0x2000B, + AL_AUXILIARY_SEND_FILTER_GAINHF_AUTO = 0x2000C; + + /** Auxiliary effect slot properties. */ + public static final int + AL_EFFECTSLOT_NULL = 0x0, + AL_EFFECTSLOT_EFFECT = 0x1, + AL_EFFECTSLOT_GAIN = 0x2, + AL_EFFECTSLOT_AUXILIARY_SEND_AUTO = 0x3; + + /** Reverb effect parameters. */ + public static final int + AL_REVERB_DENSITY = 0x1, + AL_REVERB_DIFFUSION = 0x2, + AL_REVERB_GAIN = 0x3, + AL_REVERB_GAINHF = 0x4, + AL_REVERB_DECAY_TIME = 0x5, + AL_REVERB_DECAY_HFRATIO = 0x6, + AL_REVERB_REFLECTIONS_GAIN = 0x7, + AL_REVERB_REFLECTIONS_DELAY = 0x8, + AL_REVERB_LATE_REVERB_GAIN = 0x9, + AL_REVERB_LATE_REVERB_DELAY = 0xA, + AL_REVERB_AIR_ABSORPTION_GAINHF = 0xB, + AL_REVERB_ROOM_ROLLOFF_FACTOR = 0xC, + AL_REVERB_DECAY_HFLIMIT = 0xD; + + /** EAX Reverb effect parameters. */ + public static final int + AL_EAXREVERB_DENSITY = 0x1, + AL_EAXREVERB_DIFFUSION = 0x2, + AL_EAXREVERB_GAIN = 0x3, + AL_EAXREVERB_GAINHF = 0x4, + AL_EAXREVERB_GAINLF = 0x5, + AL_EAXREVERB_DECAY_TIME = 0x6, + AL_EAXREVERB_DECAY_HFRATIO = 0x7, + AL_EAXREVERB_DECAY_LFRATIO = 0x8, + AL_EAXREVERB_REFLECTIONS_GAIN = 0x9, + AL_EAXREVERB_REFLECTIONS_DELAY = 0xA, + AL_EAXREVERB_REFLECTIONS_PAN = 0xB, + AL_EAXREVERB_LATE_REVERB_GAIN = 0xC, + AL_EAXREVERB_LATE_REVERB_DELAY = 0xD, + AL_EAXREVERB_LATE_REVERB_PAN = 0xE, + AL_EAXREVERB_ECHO_TIME = 0xF, + AL_EAXREVERB_ECHO_DEPTH = 0x10, + AL_EAXREVERB_MODULATION_TIME = 0x11, + AL_EAXREVERB_MODULATION_DEPTH = 0x12, + AL_EAXREVERB_AIR_ABSORPTION_GAINHF = 0x13, + AL_EAXREVERB_HFREFERENCE = 0x14, + AL_EAXREVERB_LFREFERENCE = 0x15, + AL_EAXREVERB_ROOM_ROLLOFF_FACTOR = 0x16, + AL_EAXREVERB_DECAY_HFLIMIT = 0x17; + + /** Chorus effect parameters. */ + public static final int + AL_CHORUS_WAVEFORM = 0x1, + AL_CHORUS_PHASE = 0x2, + AL_CHORUS_RATE = 0x3, + AL_CHORUS_DEPTH = 0x4, + AL_CHORUS_FEEDBACK = 0x5, + AL_CHORUS_DELAY = 0x6; + + /** Distortion effect parameters. */ + public static final int + AL_DISTORTION_EDGE = 0x1, + AL_DISTORTION_GAIN = 0x2, + AL_DISTORTION_LOWPASS_CUTOFF = 0x3, + AL_DISTORTION_EQCENTER = 0x4, + AL_DISTORTION_EQBANDWIDTH = 0x5; + + /** Echo effect parameters. */ + public static final int + AL_ECHO_DELAY = 0x1, + AL_ECHO_LRDELAY = 0x2, + AL_ECHO_DAMPING = 0x3, + AL_ECHO_FEEDBACK = 0x4, + AL_ECHO_SPREAD = 0x5; + + /** Flanger effect parameters. */ + public static final int + AL_FLANGER_WAVEFORM = 0x1, + AL_FLANGER_PHASE = 0x2, + AL_FLANGER_RATE = 0x3, + AL_FLANGER_DEPTH = 0x4, + AL_FLANGER_FEEDBACK = 0x5, + AL_FLANGER_DELAY = 0x6; + + /** Frequency shifter effect parameters. */ + public static final int + AL_FREQUENCY_SHIFTER_FREQUENCY = 0x1, + AL_FREQUENCY_SHIFTER_LEFT_DIRECTION = 0x2, + AL_FREQUENCY_SHIFTER_RIGHT_DIRECTION = 0x3; + + /** Vocal morpher effect parameters. */ + public static final int + AL_VOCMORPHER_PHONEMEA = 0x1, + AL_VOCMORPHER_PHONEMEA_COARSE_TUNING = 0x2, + AL_VOCMORPHER_PHONEMEB = 0x3, + AL_VOCMORPHER_PHONEMEB_COARSE_TUNING = 0x4, + AL_VOCMORPHER_WAVEFORM = 0x5, + AL_VOCMORPHER_RATE = 0x6; + + /** Pitch shifter effect parameters. */ + public static final int + AL_PITCH_SHIFTER_COARSE_TUNE = 0x1, + AL_PITCH_SHIFTER_FINE_TUNE = 0x2; + + /** Ring modulator effect parameters. */ + public static final int + AL_RING_MODULATOR_FREQUENCY = 0x1, + AL_RING_MODULATOR_HIGHPASS_CUTOFF = 0x2, + AL_RING_MODULATOR_WAVEFORM = 0x3; + + /** Autowah effect parameters. */ + public static final int + AL_AUTOWAH_ATTACK_TIME = 0x1, + AL_AUTOWAH_RELEASE_TIME = 0x2, + AL_AUTOWAH_RESONANCE = 0x3, + AL_AUTOWAH_PEAK_GAIN = 0x4; + + /** Compressor effect parameters. */ + public static final int AL_COMPRESSOR_ONOFF = 0x1; + + /** Equalizer effect parameters. */ + public static final int + AL_EQUALIZER_LOW_GAIN = 0x1, + AL_EQUALIZER_LOW_CUTOFF = 0x2, + AL_EQUALIZER_MID1_GAIN = 0x3, + AL_EQUALIZER_MID1_CENTER = 0x4, + AL_EQUALIZER_MID1_WIDTH = 0x5, + AL_EQUALIZER_MID2_GAIN = 0x6, + AL_EQUALIZER_MID2_CENTER = 0x7, + AL_EQUALIZER_MID2_WIDTH = 0x8, + AL_EQUALIZER_HIGH_GAIN = 0x9, + AL_EQUALIZER_HIGH_CUTOFF = 0xA; + + /** Effect type effect parameters. */ + public static final int + AL_EFFECT_FIRST_PARAMETER = 0x0, + AL_EFFECT_LAST_PARAMETER = 0x8000, + AL_EFFECT_TYPE = 0x8001; + + /** Effect types */ + public static final int + AL_EFFECT_NULL = 0x0, + AL_EFFECT_REVERB = 0x1, + AL_EFFECT_CHORUS = 0x2, + AL_EFFECT_DISTORTION = 0x3, + AL_EFFECT_ECHO = 0x4, + AL_EFFECT_FLANGER = 0x5, + AL_EFFECT_FREQUENCY_SHIFTER = 0x6, + AL_EFFECT_VOCAL_MORPHER = 0x7, + AL_EFFECT_PITCH_SHIFTER = 0x8, + AL_EFFECT_RING_MODULATOR = 0x9, + AL_EFFECT_AUTOWAH = 0xA, + AL_EFFECT_COMPRESSOR = 0xB, + AL_EFFECT_EQUALIZER = 0xC, + AL_EFFECT_EAXREVERB = 0x8000; + + /** Lowpass filter properties */ + public static final int + AL_LOWPASS_GAIN = 0x1, + AL_LOWPASS_GAINHF = 0x2; + + /** Highpass filter properties */ + public static final int + AL_HIGHPASS_GAIN = 0x1, + AL_HIGHPASS_GAINLF = 0x2; + + /** Bandpass filter properties */ + public static final int + AL_BANDPASS_GAIN = 0x1, + AL_BANDPASS_GAINLF = 0x2, + AL_BANDPASS_GAINHF = 0x3; + + /** Filter type */ + public static final int + AL_FILTER_FIRST_PARAMETER = 0x0, + AL_FILTER_LAST_PARAMETER = 0x8000, + AL_FILTER_TYPE = 0x8001; + + /** Filter types. */ + public static final int + AL_FILTER_NULL = 0x0, + AL_FILTER_LOWPASS = 0x1, + AL_FILTER_HIGHPASS = 0x2, + AL_FILTER_BANDPASS = 0x3; + + /** Source property value ranges and defaults */ + public static final float + AL_MIN_AIR_ABSORPTION_FACTOR = 0.0f, + AL_MAX_AIR_ABSORPTION_FACTOR = 10.0f, + AL_DEFAULT_AIR_ABSORPTION_FACTOR = 0.0f, + AL_MIN_ROOM_ROLLOFF_FACTOR = 0.0f, + AL_MAX_ROOM_ROLLOFF_FACTOR = 10.0f, + AL_DEFAULT_ROOM_ROLLOFF_FACTOR = 0.0f, + AL_MIN_CONE_OUTER_GAINHF = 0.0f, + AL_MAX_CONE_OUTER_GAINHF = 1.0f, + AL_DEFAULT_CONE_OUTER_GAINHF = 1.0f; + + /** Source property value ranges and defaults */ + public static final int + AL_MIN_DIRECT_FILTER_GAINHF_AUTO = 0x0, + AL_MAX_DIRECT_FILTER_GAINHF_AUTO = 0x1, + AL_DEFAULT_DIRECT_FILTER_GAINHF_AUTO = 0x1, + AL_MIN_AUXILIARY_SEND_FILTER_GAIN_AUTO = 0x0, + AL_MAX_AUXILIARY_SEND_FILTER_GAIN_AUTO = 0x1, + AL_DEFAULT_AUXILIARY_SEND_FILTER_GAIN_AUTO = 0x1, + AL_MIN_AUXILIARY_SEND_FILTER_GAINHF_AUTO = 0x0, + AL_MAX_AUXILIARY_SEND_FILTER_GAINHF_AUTO = 0x1, + AL_DEFAULT_AUXILIARY_SEND_FILTER_GAINHF_AUTO = 0x1; + + /** Listener property value ranges and defaults. */ + public static final float + AL_MIN_METERS_PER_UNIT = 0x0.000002P-126f, + AL_MAX_METERS_PER_UNIT = 0x1.fffffeP+127f, + AL_DEFAULT_METERS_PER_UNIT = 1.0f; + + /** Reverb effect parameter ranges and defaults */ + public static final float + AL_REVERB_MIN_DENSITY = 0.0f, + AL_REVERB_MAX_DENSITY = 1.0f, + AL_REVERB_DEFAULT_DENSITY = 1.0f, + AL_REVERB_MIN_DIFFUSION = 0.0f, + AL_REVERB_MAX_DIFFUSION = 1.0f, + AL_REVERB_DEFAULT_DIFFUSION = 1.0f, + AL_REVERB_MIN_GAIN = 0.0f, + AL_REVERB_MAX_GAIN = 1.0f, + AL_REVERB_DEFAULT_GAIN = 0.32f, + AL_REVERB_MIN_GAINHF = 0.0f, + AL_REVERB_MAX_GAINHF = 1.0f, + AL_REVERB_DEFAULT_GAINHF = 0.89f, + AL_REVERB_MIN_DECAY_TIME = 0.1f, + AL_REVERB_MAX_DECAY_TIME = 20.0f, + AL_REVERB_DEFAULT_DECAY_TIME = 1.49f, + AL_REVERB_MIN_DECAY_HFRATIO = 0.1f, + AL_REVERB_MAX_DECAY_HFRATIO = 2.0f, + AL_REVERB_DEFAULT_DECAY_HFRATIO = 0.83f, + AL_REVERB_MIN_REFLECTIONS_GAIN = 0.0f, + AL_REVERB_MAX_REFLECTIONS_GAIN = 3.16f, + AL_REVERB_DEFAULT_REFLECTIONS_GAIN = 0.05f, + AL_REVERB_MIN_REFLECTIONS_DELAY = 0.0f, + AL_REVERB_MAX_REFLECTIONS_DELAY = 0.3f, + AL_REVERB_DEFAULT_REFLECTIONS_DELAY = 0.007f, + AL_REVERB_MIN_LATE_REVERB_GAIN = 0.0f, + AL_REVERB_MAX_LATE_REVERB_GAIN = 10.0f, + AL_REVERB_DEFAULT_LATE_REVERB_GAIN = 1.26f, + AL_REVERB_MIN_LATE_REVERB_DELAY = 0.0f, + AL_REVERB_MAX_LATE_REVERB_DELAY = 0.1f, + AL_REVERB_DEFAULT_LATE_REVERB_DELAY = 0.011f, + AL_REVERB_MIN_AIR_ABSORPTION_GAINHF = 0.892f, + AL_REVERB_MAX_AIR_ABSORPTION_GAINHF = 1.0f, + AL_REVERB_DEFAULT_AIR_ABSORPTION_GAINHF = 0.994f, + AL_REVERB_MIN_ROOM_ROLLOFF_FACTOR = 0.0f, + AL_REVERB_MAX_ROOM_ROLLOFF_FACTOR = 10.0f, + AL_REVERB_DEFAULT_ROOM_ROLLOFF_FACTOR = 0.0f; + + /** Reverb effect parameter ranges and defaults */ + public static final int + AL_REVERB_MIN_DECAY_HFLIMIT = 0x0, + AL_REVERB_MAX_DECAY_HFLIMIT = 0x1, + AL_REVERB_DEFAULT_DECAY_HFLIMIT = 0x1; + + /** EAX reverb effect parameter ranges and defaults */ + public static final float + AL_EAXREVERB_MIN_DENSITY = 0.0f, + AL_EAXREVERB_MAX_DENSITY = 1.0f, + AL_EAXREVERB_DEFAULT_DENSITY = 1.0f, + AL_EAXREVERB_MIN_DIFFUSION = 0.0f, + AL_EAXREVERB_MAX_DIFFUSION = 1.0f, + AL_EAXREVERB_DEFAULT_DIFFUSION = 1.0f, + AL_EAXREVERB_MIN_GAIN = 0.0f, + AL_EAXREVERB_MAX_GAIN = 1.0f, + AL_EAXREVERB_DEFAULT_GAIN = 0.32f, + AL_EAXREVERB_MIN_GAINHF = 0.0f, + AL_EAXREVERB_MAX_GAINHF = 1.0f, + AL_EAXREVERB_DEFAULT_GAINHF = 0.89f, + AL_EAXREVERB_MIN_GAINLF = 0.0f, + AL_EAXREVERB_MAX_GAINLF = 1.0f, + AL_EAXREVERB_DEFAULT_GAINLF = 1.0f, + AL_EAXREVERB_MIN_DECAY_TIME = 0.1f, + AL_EAXREVERB_MAX_DECAY_TIME = 20.0f, + AL_EAXREVERB_DEFAULT_DECAY_TIME = 1.49f, + AL_EAXREVERB_MIN_DECAY_HFRATIO = 0.1f, + AL_EAXREVERB_MAX_DECAY_HFRATIO = 2.0f, + AL_EAXREVERB_DEFAULT_DECAY_HFRATIO = 0.83f, + AL_EAXREVERB_MIN_DECAY_LFRATIO = 0.1f, + AL_EAXREVERB_MAX_DECAY_LFRATIO = 2.0f, + AL_EAXREVERB_DEFAULT_DECAY_LFRATIO = 1.0f, + AL_EAXREVERB_MIN_REFLECTIONS_GAIN = 0.0f, + AL_EAXREVERB_MAX_REFLECTIONS_GAIN = 3.16f, + AL_EAXREVERB_DEFAULT_REFLECTIONS_GAIN = 0.05f, + AL_EAXREVERB_MIN_REFLECTIONS_DELAY = 0.0f, + AL_EAXREVERB_MAX_REFLECTIONS_DELAY = 0.3f, + AL_EAXREVERB_DEFAULT_REFLECTIONS_DELAY = 0.007f, + AL_EAXREVERB_DEFAULT_REFLECTIONS_PAN_XYZ = 0.0f, + AL_EAXREVERB_MIN_LATE_REVERB_GAIN = 0.0f, + AL_EAXREVERB_MAX_LATE_REVERB_GAIN = 10.0f, + AL_EAXREVERB_DEFAULT_LATE_REVERB_GAIN = 1.26f, + AL_EAXREVERB_MIN_LATE_REVERB_DELAY = 0.0f, + AL_EAXREVERB_MAX_LATE_REVERB_DELAY = 0.1f, + AL_EAXREVERB_DEFAULT_LATE_REVERB_DELAY = 0.011f, + AL_EAXREVERB_DEFAULT_LATE_REVERB_PAN_XYZ = 0.0f, + AL_EAXREVERB_MIN_ECHO_TIME = 0.075f, + AL_EAXREVERB_MAX_ECHO_TIME = 0.25f, + AL_EAXREVERB_DEFAULT_ECHO_TIME = 0.25f, + AL_EAXREVERB_MIN_ECHO_DEPTH = 0.0f, + AL_EAXREVERB_MAX_ECHO_DEPTH = 1.0f, + AL_EAXREVERB_DEFAULT_ECHO_DEPTH = 0.0f, + AL_EAXREVERB_MIN_MODULATION_TIME = 0.04f, + AL_EAXREVERB_MAX_MODULATION_TIME = 4.0f, + AL_EAXREVERB_DEFAULT_MODULATION_TIME = 0.25f, + AL_EAXREVERB_MIN_MODULATION_DEPTH = 0.0f, + AL_EAXREVERB_MAX_MODULATION_DEPTH = 1.0f, + AL_EAXREVERB_DEFAULT_MODULATION_DEPTH = 0.0f, + AL_EAXREVERB_MIN_AIR_ABSORPTION_GAINHF = 0.892f, + AL_EAXREVERB_MAX_AIR_ABSORPTION_GAINHF = 1.0f, + AL_EAXREVERB_DEFAULT_AIR_ABSORPTION_GAINHF = 0.994f, + AL_EAXREVERB_MIN_HFREFERENCE = 1000.0f, + AL_EAXREVERB_MAX_HFREFERENCE = 20000.0f, + AL_EAXREVERB_DEFAULT_HFREFERENCE = 5000.0f, + AL_EAXREVERB_MIN_LFREFERENCE = 20.0f, + AL_EAXREVERB_MAX_LFREFERENCE = 1000.0f, + AL_EAXREVERB_DEFAULT_LFREFERENCE = 250.0f, + AL_EAXREVERB_MIN_ROOM_ROLLOFF_FACTOR = 0.0f, + AL_EAXREVERB_MAX_ROOM_ROLLOFF_FACTOR = 10.0f, + AL_EAXREVERB_DEFAULT_ROOM_ROLLOFF_FACTOR = 0.0f; + + /** EAX reverb effect parameter ranges and defaults */ + public static final int + AL_EAXREVERB_MIN_DECAY_HFLIMIT = 0x0, + AL_EAXREVERB_MAX_DECAY_HFLIMIT = 0x1, + AL_EAXREVERB_DEFAULT_DECAY_HFLIMIT = 0x1; + + /** Chorus effect parameter ranges and defaults */ + public static final int + AL_CHORUS_WAVEFORM_SINUSOID = 0, + AL_CHORUS_WAVEFORM_TRIANGLE = 1, + AL_CHORUS_MIN_WAVEFORM = 0, + AL_CHORUS_MAX_WAVEFORM = 1, + AL_CHORUS_DEFAULT_WAVEFORM = 1, + AL_CHORUS_MIN_PHASE = -180, + AL_CHORUS_MAX_PHASE = 180, + AL_CHORUS_DEFAULT_PHASE = 90; + + /** Chorus effect parameter ranges and defaults */ + public static final float + AL_CHORUS_MIN_RATE = 0.0f, + AL_CHORUS_MAX_RATE = 10.0f, + AL_CHORUS_DEFAULT_RATE = 1.1f, + AL_CHORUS_MIN_DEPTH = 0.0f, + AL_CHORUS_MAX_DEPTH = 1.0f, + AL_CHORUS_DEFAULT_DEPTH = 0.1f, + AL_CHORUS_MIN_FEEDBACK = -1.0f, + AL_CHORUS_MAX_FEEDBACK = 1.0f, + AL_CHORUS_DEFAULT_FEEDBACK = 0.25f, + AL_CHORUS_MIN_DELAY = 0.0f, + AL_CHORUS_MAX_DELAY = 0.016f, + AL_CHORUS_DEFAULT_DELAY = 0.016f; + + /** Distortion effect parameter ranges and defaults */ + public static final float + AL_DISTORTION_MIN_EDGE = 0.0f, + AL_DISTORTION_MAX_EDGE = 1.0f, + AL_DISTORTION_DEFAULT_EDGE = 0.2f, + AL_DISTORTION_MIN_GAIN = 0.01f, + AL_DISTORTION_MAX_GAIN = 1.0f, + AL_DISTORTION_DEFAULT_GAIN = 0.05f, + AL_DISTORTION_MIN_LOWPASS_CUTOFF = 80.0f, + AL_DISTORTION_MAX_LOWPASS_CUTOFF = 24000.0f, + AL_DISTORTION_DEFAULT_LOWPASS_CUTOFF = 8000.0f, + AL_DISTORTION_MIN_EQCENTER = 80.0f, + AL_DISTORTION_MAX_EQCENTER = 24000.0f, + AL_DISTORTION_DEFAULT_EQCENTER = 3600.0f, + AL_DISTORTION_MIN_EQBANDWIDTH = 80.0f, + AL_DISTORTION_MAX_EQBANDWIDTH = 24000.0f, + AL_DISTORTION_DEFAULT_EQBANDWIDTH = 3600.0f; + + /** Echo effect parameter ranges and defaults */ + public static final float + AL_ECHO_MIN_DELAY = 0.0f, + AL_ECHO_MAX_DELAY = 0.207f, + AL_ECHO_DEFAULT_DELAY = 0.1f, + AL_ECHO_MIN_LRDELAY = 0.0f, + AL_ECHO_MAX_LRDELAY = 0.404f, + AL_ECHO_DEFAULT_LRDELAY = 0.1f, + AL_ECHO_MIN_DAMPING = 0.0f, + AL_ECHO_MAX_DAMPING = 0.99f, + AL_ECHO_DEFAULT_DAMPING = 0.5f, + AL_ECHO_MIN_FEEDBACK = 0.0f, + AL_ECHO_MAX_FEEDBACK = 1.0f, + AL_ECHO_DEFAULT_FEEDBACK = 0.5f, + AL_ECHO_MIN_SPREAD = -1.0f, + AL_ECHO_MAX_SPREAD = 1.0f, + AL_ECHO_DEFAULT_SPREAD = -1.0f; + + /** Flanger effect parameter ranges and defaults */ + public static final int + AL_FLANGER_WAVEFORM_SINUSOID = 0, + AL_FLANGER_WAVEFORM_TRIANGLE = 1, + AL_FLANGER_MIN_WAVEFORM = 0, + AL_FLANGER_MAX_WAVEFORM = 1, + AL_FLANGER_DEFAULT_WAVEFORM = 1, + AL_FLANGER_MIN_PHASE = -180, + AL_FLANGER_MAX_PHASE = 180, + AL_FLANGER_DEFAULT_PHASE = 0; + + /** Flanger effect parameter ranges and defaults */ + public static final float + AL_FLANGER_MIN_RATE = 0.0f, + AL_FLANGER_MAX_RATE = 10.0f, + AL_FLANGER_DEFAULT_RATE = 0.27f, + AL_FLANGER_MIN_DEPTH = 0.0f, + AL_FLANGER_MAX_DEPTH = 1.0f, + AL_FLANGER_DEFAULT_DEPTH = 1.0f, + AL_FLANGER_MIN_FEEDBACK = -1.0f, + AL_FLANGER_MAX_FEEDBACK = 1.0f, + AL_FLANGER_DEFAULT_FEEDBACK = -0.5f, + AL_FLANGER_MIN_DELAY = 0.0f, + AL_FLANGER_MAX_DELAY = 0.004f, + AL_FLANGER_DEFAULT_DELAY = 0.002f; + + /** Frequency shifter effect parameter ranges and defaults */ + public static final float + AL_FREQUENCY_SHIFTER_MIN_FREQUENCY = 0.0f, + AL_FREQUENCY_SHIFTER_MAX_FREQUENCY = 24000.0f, + AL_FREQUENCY_SHIFTER_DEFAULT_FREQUENCY = 0.0f; + + /** Frequency shifter effect parameter ranges and defaults */ + public static final int + AL_FREQUENCY_SHIFTER_MIN_LEFT_DIRECTION = 0, + AL_FREQUENCY_SHIFTER_MAX_LEFT_DIRECTION = 2, + AL_FREQUENCY_SHIFTER_DEFAULT_LEFT_DIRECTION = 0, + AL_FREQUENCY_SHIFTER_DIRECTION_DOWN = 0, + AL_FREQUENCY_SHIFTER_DIRECTION_UP = 1, + AL_FREQUENCY_SHIFTER_DIRECTION_OFF = 2, + AL_FREQUENCY_SHIFTER_MIN_RIGHT_DIRECTION = 0, + AL_FREQUENCY_SHIFTER_MAX_RIGHT_DIRECTION = 2, + AL_FREQUENCY_SHIFTER_DEFAULT_RIGHT_DIRECTION = 0; + + /** Vocal morpher effect parameter ranges and defaults */ + public static final int + AL_VOCAL_MORPHER_MIN_PHONEMEA = 0, + AL_VOCAL_MORPHER_MAX_PHONEMEA = 29, + AL_VOCAL_MORPHER_DEFAULT_PHONEMEA = 0, + AL_VOCAL_MORPHER_MIN_PHONEMEA_COARSE_TUNING = -24, + AL_VOCAL_MORPHER_MAX_PHONEMEA_COARSE_TUNING = 24, + AL_VOCAL_MORPHER_DEFAULT_PHONEMEA_COARSE_TUNING = 0, + AL_VOCAL_MORPHER_MIN_PHONEMEB = 0, + AL_VOCAL_MORPHER_MAX_PHONEMEB = 29, + AL_VOCAL_MORPHER_DEFAULT_PHONEMEB = 10, + AL_VOCAL_MORPHER_MIN_PHONEMEB_COARSE_TUNING = -24, + AL_VOCAL_MORPHER_MAX_PHONEMEB_COARSE_TUNING = 24, + AL_VOCAL_MORPHER_DEFAULT_PHONEMEB_COARSE_TUNING = 0, + AL_VOCAL_MORPHER_PHONEME_A = 0, + AL_VOCAL_MORPHER_PHONEME_E = 1, + AL_VOCAL_MORPHER_PHONEME_I = 2, + AL_VOCAL_MORPHER_PHONEME_O = 3, + AL_VOCAL_MORPHER_PHONEME_U = 4, + AL_VOCAL_MORPHER_PHONEME_AA = 5, + AL_VOCAL_MORPHER_PHONEME_AE = 6, + AL_VOCAL_MORPHER_PHONEME_AH = 7, + AL_VOCAL_MORPHER_PHONEME_AO = 8, + AL_VOCAL_MORPHER_PHONEME_EH = 9, + AL_VOCAL_MORPHER_PHONEME_ER = 10, + AL_VOCAL_MORPHER_PHONEME_IH = 11, + AL_VOCAL_MORPHER_PHONEME_IY = 12, + AL_VOCAL_MORPHER_PHONEME_UH = 13, + AL_VOCAL_MORPHER_PHONEME_UW = 14, + AL_VOCAL_MORPHER_PHONEME_B = 15, + AL_VOCAL_MORPHER_PHONEME_D = 16, + AL_VOCAL_MORPHER_PHONEME_F = 17, + AL_VOCAL_MORPHER_PHONEME_G = 18, + AL_VOCAL_MORPHER_PHONEME_J = 19, + AL_VOCAL_MORPHER_PHONEME_K = 20, + AL_VOCAL_MORPHER_PHONEME_L = 21, + AL_VOCAL_MORPHER_PHONEME_M = 22, + AL_VOCAL_MORPHER_PHONEME_N = 23, + AL_VOCAL_MORPHER_PHONEME_P = 24, + AL_VOCAL_MORPHER_PHONEME_R = 25, + AL_VOCAL_MORPHER_PHONEME_S = 26, + AL_VOCAL_MORPHER_PHONEME_T = 27, + AL_VOCAL_MORPHER_PHONEME_V = 28, + AL_VOCAL_MORPHER_PHONEME_Z = 29, + AL_VOCAL_MORPHER_WAVEFORM_SINUSOID = 0, + AL_VOCAL_MORPHER_WAVEFORM_TRIANGLE = 1, + AL_VOCAL_MORPHER_WAVEFORM_SAWTOOTH = 2, + AL_VOCAL_MORPHER_MIN_WAVEFORM = 0, + AL_VOCAL_MORPHER_MAX_WAVEFORM = 2, + AL_VOCAL_MORPHER_DEFAULT_WAVEFORM = 0; + + /** Vocal morpher effect parameter ranges and defaults */ + public static final float + AL_VOCAL_MORPHER_MIN_RATE = 0.0f, + AL_VOCAL_MORPHER_MAX_RATE = 10.0f, + AL_VOCAL_MORPHER_DEFAULT_RATE = 1.41f; + + /** Pitch shifter effect parameter ranges and defaults */ + public static final int + AL_PITCH_SHIFTER_MIN_COARSE_TUNE = -12, + AL_PITCH_SHIFTER_MAX_COARSE_TUNE = 12, + AL_PITCH_SHIFTER_DEFAULT_COARSE_TUNE = 12, + AL_PITCH_SHIFTER_MIN_FINE_TUNE = -50, + AL_PITCH_SHIFTER_MAX_FINE_TUNE = 50, + AL_PITCH_SHIFTER_DEFAULT_FINE_TUNE = 0; + + /** Ring modulator effect parameter ranges and defaults */ + public static final float + AL_RING_MODULATOR_MIN_FREQUENCY = 0.0f, + AL_RING_MODULATOR_MAX_FREQUENCY = 8000.0f, + AL_RING_MODULATOR_DEFAULT_FREQUENCY = 440.0f, + AL_RING_MODULATOR_MIN_HIGHPASS_CUTOFF = 0.0f, + AL_RING_MODULATOR_MAX_HIGHPASS_CUTOFF = 24000.0f, + AL_RING_MODULATOR_DEFAULT_HIGHPASS_CUTOFF = 800.0f; + + /** Ring modulator effect parameter ranges and defaults */ + public static final int + AL_RING_MODULATOR_SINUSOID = 0, + AL_RING_MODULATOR_SAWTOOTH = 1, + AL_RING_MODULATOR_SQUARE = 2, + AL_RING_MODULATOR_MIN_WAVEFORM = 0, + AL_RING_MODULATOR_MAX_WAVEFORM = 2, + AL_RING_MODULATOR_DEFAULT_WAVEFORM = 0; + + /** Autowah effect parameter ranges and defaults */ + public static final float + AL_AUTOWAH_MIN_ATTACK_TIME = 1.0E-4f, + AL_AUTOWAH_MAX_ATTACK_TIME = 1.0f, + AL_AUTOWAH_DEFAULT_ATTACK_TIME = 0.06f, + AL_AUTOWAH_MIN_RELEASE_TIME = 1.0E-4f, + AL_AUTOWAH_MAX_RELEASE_TIME = 1.0f, + AL_AUTOWAH_DEFAULT_RELEASE_TIME = 0.06f, + AL_AUTOWAH_MIN_RESONANCE = 2.0f, + AL_AUTOWAH_MAX_RESONANCE = 1000.0f, + AL_AUTOWAH_DEFAULT_RESONANCE = 1000.0f, + AL_AUTOWAH_MIN_PEAK_GAIN = 3.0E-5f, + AL_AUTOWAH_MAX_PEAK_GAIN = 31621.0f, + AL_AUTOWAH_DEFAULT_PEAK_GAIN = 11.22f; + + /** Compressor effect parameter ranges and defaults */ + public static final int + AL_COMPRESSOR_MIN_ONOFF = 0, + AL_COMPRESSOR_MAX_ONOFF = 1, + AL_COMPRESSOR_DEFAULT_ONOFF = 1; + + /** Equalizer effect parameter ranges and defaults */ + public static final float + AL_EQUALIZER_MIN_LOW_GAIN = 0.126f, + AL_EQUALIZER_MAX_LOW_GAIN = 7.943f, + AL_EQUALIZER_DEFAULT_LOW_GAIN = 1.0f, + AL_EQUALIZER_MIN_LOW_CUTOFF = 50.0f, + AL_EQUALIZER_MAX_LOW_CUTOFF = 800.0f, + AL_EQUALIZER_DEFAULT_LOW_CUTOFF = 200.0f, + AL_EQUALIZER_MIN_MID1_GAIN = 0.126f, + AL_EQUALIZER_MAX_MID1_GAIN = 7.943f, + AL_EQUALIZER_DEFAULT_MID1_GAIN = 1.0f, + AL_EQUALIZER_MIN_MID1_CENTER = 200.0f, + AL_EQUALIZER_MAX_MID1_CENTER = 3000.0f, + AL_EQUALIZER_DEFAULT_MID1_CENTER = 500.0f, + AL_EQUALIZER_MIN_MID1_WIDTH = 0.01f, + AL_EQUALIZER_MAX_MID1_WIDTH = 1.0f, + AL_EQUALIZER_DEFAULT_MID1_WIDTH = 1.0f, + AL_EQUALIZER_MIN_MID2_GAIN = 0.126f, + AL_EQUALIZER_MAX_MID2_GAIN = 7.943f, + AL_EQUALIZER_DEFAULT_MID2_GAIN = 1.0f, + AL_EQUALIZER_MIN_MID2_CENTER = 1000.0f, + AL_EQUALIZER_MAX_MID2_CENTER = 8000.0f, + AL_EQUALIZER_DEFAULT_MID2_CENTER = 3000.0f, + AL_EQUALIZER_MIN_MID2_WIDTH = 0.01f, + AL_EQUALIZER_MAX_MID2_WIDTH = 1.0f, + AL_EQUALIZER_DEFAULT_MID2_WIDTH = 1.0f, + AL_EQUALIZER_MIN_HIGH_GAIN = 0.126f, + AL_EQUALIZER_MAX_HIGH_GAIN = 7.943f, + AL_EQUALIZER_DEFAULT_HIGH_GAIN = 1.0f, + AL_EQUALIZER_MIN_HIGH_CUTOFF = 4000.0f, + AL_EQUALIZER_MAX_HIGH_CUTOFF = 16000.0f, + AL_EQUALIZER_DEFAULT_HIGH_CUTOFF = 6000.0f; + + /** Lowpass filter parameter ranges and defaults */ + public static final float + AL_LOWPASS_MIN_GAIN = 0.0f, + AL_LOWPASS_MAX_GAIN = 1.0f, + AL_LOWPASS_DEFAULT_GAIN = 1.0f, + AL_LOWPASS_MIN_GAINHF = 0.0f, + AL_LOWPASS_MAX_GAINHF = 1.0f, + AL_LOWPASS_DEFAULT_GAINHF = 1.0f; + + /** Highpass filter parameter ranges and defaults */ + public static final float + AL_HIGHPASS_MIN_GAIN = 0.0f, + AL_HIGHPASS_MAX_GAIN = 1.0f, + AL_HIGHPASS_DEFAULT_GAIN = 1.0f, + AL_HIGHPASS_MIN_GAINLF = 0.0f, + AL_HIGHPASS_MAX_GAINLF = 1.0f, + AL_HIGHPASS_DEFAULT_GAINLF = 1.0f; + + /** Bandpass filter parameter ranges and defaults */ + public static final float + AL_BANDPASS_MIN_GAIN = 0.0f, + AL_BANDPASS_MAX_GAIN = 1.0f, + AL_BANDPASS_DEFAULT_GAIN = 1.0f, + AL_BANDPASS_MIN_GAINHF = 0.0f, + AL_BANDPASS_MAX_GAINHF = 1.0f, + AL_BANDPASS_DEFAULT_GAINHF = 1.0f, + AL_BANDPASS_MIN_GAINLF = 0.0f, + AL_BANDPASS_MAX_GAINLF = 1.0f, + AL_BANDPASS_DEFAULT_GAINLF = 1.0f; + + protected EXTEfx() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(ALCapabilities caps) { + return checkFunctions( + caps.alGenEffects, caps.alDeleteEffects, caps.alIsEffect, caps.alEffecti, caps.alEffectiv, caps.alEffectf, caps.alEffectfv, caps.alGetEffecti, + caps.alGetEffectiv, caps.alGetEffectf, caps.alGetEffectfv, caps.alGenFilters, caps.alDeleteFilters, caps.alIsFilter, caps.alFilteri, + caps.alFilteriv, caps.alFilterf, caps.alFilterfv, caps.alGetFilteri, caps.alGetFilteriv, caps.alGetFilterf, caps.alGetFilterfv, + caps.alGenAuxiliaryEffectSlots, caps.alDeleteAuxiliaryEffectSlots, caps.alIsAuxiliaryEffectSlot, caps.alAuxiliaryEffectSloti, + caps.alAuxiliaryEffectSlotiv, caps.alAuxiliaryEffectSlotf, caps.alAuxiliaryEffectSlotfv, caps.alGetAuxiliaryEffectSloti, + caps.alGetAuxiliaryEffectSlotiv, caps.alGetAuxiliaryEffectSlotf, caps.alGetAuxiliaryEffectSlotfv + ); + } + + // --- [ alGenEffects ] --- + + /** + * Unsafe version of: {@link #alGenEffects GenEffects} + * + * @param n the number of effects be to generated + */ + public static void nalGenEffects(int n, long effects) { + long __functionAddress = AL.getICD().alGenEffects; + if (CHECKS) { + check(__functionAddress); + } + invokePV(n, effects, __functionAddress); + } + + /** + * Requests a number of effects. + * + * @param effects the buffer that will receive the effects + */ + @NativeType("ALvoid") + public static void alGenEffects(@NativeType("ALuint *") IntBuffer effects) { + nalGenEffects(effects.remaining(), memAddress(effects)); + } + + /** Requests a number of effects. */ + @NativeType("ALvoid") + public static int alGenEffects() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer effects = stack.callocInt(1); + nalGenEffects(1, memAddress(effects)); + return effects.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alDeleteEffects ] --- + + /** + * Unsafe version of: {@link #alDeleteEffects DeleteEffects} + * + * @param n the number of effects be to deleted + */ + public static void nalDeleteEffects(int n, long effects) { + long __functionAddress = AL.getICD().alDeleteEffects; + if (CHECKS) { + check(__functionAddress); + } + invokePV(n, effects, __functionAddress); + } + + /** + * Deletes a number of effects. + * + * @param effects the effect to delete + */ + @NativeType("ALvoid") + public static void alDeleteEffects(@NativeType("ALuint *") IntBuffer effects) { + nalDeleteEffects(effects.remaining(), memAddress(effects)); + } + + /** Deletes a number of effects. */ + @NativeType("ALvoid") + public static void alDeleteEffects(@NativeType("ALuint *") int effect) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer effects = stack.ints(effect); + nalDeleteEffects(1, memAddress(effects)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alIsEffect ] --- + + /** + * Verifies whether the given object name is an effect. + * + * @param effect a value that may be a effect name + */ + @NativeType("ALboolean") + public static boolean alIsEffect(@NativeType("ALuint") int effect) { + long __functionAddress = AL.getICD().alIsEffect; + if (CHECKS) { + check(__functionAddress); + } + return invokeZ(effect, __functionAddress); + } + + // --- [ alEffecti ] --- + + /** + * Sets the integer value of an effect parameter. + * + * @param effect the effect to modify + * @param param the parameter to modify + * @param value the parameter value + */ + @NativeType("ALvoid") + public static void alEffecti(@NativeType("ALuint") int effect, @NativeType("ALenum") int param, @NativeType("ALint") int value) { + long __functionAddress = AL.getICD().alEffecti; + if (CHECKS) { + check(__functionAddress); + } + invokeV(effect, param, value, __functionAddress); + } + + // --- [ alEffectiv ] --- + + /** Unsafe version of: {@link #alEffectiv Effectiv} */ + public static void nalEffectiv(int effect, int param, long values) { + long __functionAddress = AL.getICD().alEffectiv; + if (CHECKS) { + check(__functionAddress); + } + invokePV(effect, param, values, __functionAddress); + } + + /** + * Pointer version of {@link #alEffecti Effecti}. + * + * @param effect the effect to modify + * @param param the parameter to modify + * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alEffectiv(@NativeType("ALuint") int effect, @NativeType("ALenum") int param, @NativeType("ALint const *") IntBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalEffectiv(effect, param, memAddress(values)); + } + + // --- [ alEffectf ] --- + + /** + * Sets the float value of an effect parameter. + * + * @param effect the effect to modify + * @param param the parameter to modify + * @param value the parameter value + */ + @NativeType("ALvoid") + public static void alEffectf(@NativeType("ALuint") int effect, @NativeType("ALenum") int param, @NativeType("ALfloat") float value) { + long __functionAddress = AL.getICD().alEffectf; + if (CHECKS) { + check(__functionAddress); + } + invokeV(effect, param, value, __functionAddress); + } + + // --- [ alEffectfv ] --- + + /** Unsafe version of: {@link #alEffectfv Effectfv} */ + public static void nalEffectfv(int effect, int param, long values) { + long __functionAddress = AL.getICD().alEffectfv; + if (CHECKS) { + check(__functionAddress); + } + invokePV(effect, param, values, __functionAddress); + } + + /** + * Pointer version of {@link #alEffectf Effectf}. + * + * @param effect the effect to modify + * @param param the parameter to modify + * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alEffectfv(@NativeType("ALuint") int effect, @NativeType("ALenum") int param, @NativeType("ALfloat const *") FloatBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalEffectfv(effect, param, memAddress(values)); + } + + // --- [ alGetEffecti ] --- + + /** Unsafe version of: {@link #alGetEffecti GetEffecti} */ + public static void nalGetEffecti(int effect, int param, long value) { + long __functionAddress = AL.getICD().alGetEffecti; + if (CHECKS) { + check(__functionAddress); + } + invokePV(effect, param, value, __functionAddress); + } + + /** + * Returns the integer value of the specified effect parameter. + * + * @param effect the effect to query + * @param param the parameter to query + * @param value the parameter value + */ + @NativeType("ALvoid") + public static void alGetEffecti(@NativeType("ALuint") int effect, @NativeType("ALenum") int param, @NativeType("ALint *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nalGetEffecti(effect, param, memAddress(value)); + } + + /** + * Returns the integer value of the specified effect parameter. + * + * @param effect the effect to query + * @param param the parameter to query + */ + @NativeType("ALvoid") + public static int alGetEffecti(@NativeType("ALuint") int effect, @NativeType("ALenum") int param) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer value = stack.callocInt(1); + nalGetEffecti(effect, param, memAddress(value)); + return value.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alGetEffectiv ] --- + + /** Unsafe version of: {@link #alGetEffectiv GetEffectiv} */ + public static void nalGetEffectiv(int effect, int param, long values) { + long __functionAddress = AL.getICD().alGetEffectiv; + if (CHECKS) { + check(__functionAddress); + } + invokePV(effect, param, values, __functionAddress); + } + + /** + * Returns the integer values of the specified effect parameter. + * + * @param effect the effect to query + * @param param the parameter to query + * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alGetEffectiv(@NativeType("ALuint") int effect, @NativeType("ALenum") int param, @NativeType("ALint *") IntBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalGetEffectiv(effect, param, memAddress(values)); + } + + // --- [ alGetEffectf ] --- + + /** Unsafe version of: {@link #alGetEffectf GetEffectf} */ + public static void nalGetEffectf(int effect, int param, long value) { + long __functionAddress = AL.getICD().alGetEffectf; + if (CHECKS) { + check(__functionAddress); + } + invokePV(effect, param, value, __functionAddress); + } + + /** + * Returns the float value of the specified effect parameter. + * + * @param effect the effect to query + * @param param the parameter to query + * @param value the parameter value + */ + @NativeType("ALvoid") + public static void alGetEffectf(@NativeType("ALuint") int effect, @NativeType("ALenum") int param, @NativeType("ALfloat *") FloatBuffer value) { + if (CHECKS) { + check(value, 1); + } + nalGetEffectf(effect, param, memAddress(value)); + } + + /** + * Returns the float value of the specified effect parameter. + * + * @param effect the effect to query + * @param param the parameter to query + */ + @NativeType("ALvoid") + public static float alGetEffectf(@NativeType("ALuint") int effect, @NativeType("ALenum") int param) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer value = stack.callocFloat(1); + nalGetEffectf(effect, param, memAddress(value)); + return value.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alGetEffectfv ] --- + + /** Unsafe version of: {@link #alGetEffectfv GetEffectfv} */ + public static void nalGetEffectfv(int effect, int param, long values) { + long __functionAddress = AL.getICD().alGetEffectfv; + if (CHECKS) { + check(__functionAddress); + } + invokePV(effect, param, values, __functionAddress); + } + + /** + * Returns the float values of the specified effect parameter. + * + * @param effect the effect to query + * @param param the parameter to query + * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alGetEffectfv(@NativeType("ALuint") int effect, @NativeType("ALenum") int param, @NativeType("ALfloat *") FloatBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalGetEffectfv(effect, param, memAddress(values)); + } + + // --- [ alGenFilters ] --- + + /** + * Unsafe version of: {@link #alGenFilters GenFilters} + * + * @param n the number of filters be to generated + */ + public static void nalGenFilters(int n, long filters) { + long __functionAddress = AL.getICD().alGenFilters; + if (CHECKS) { + check(__functionAddress); + } + invokePV(n, filters, __functionAddress); + } + + /** + * Requests a number of filters. + * + * @param filters the buffer that will receive the filters + */ + @NativeType("ALvoid") + public static void alGenFilters(@NativeType("ALuint *") IntBuffer filters) { + nalGenFilters(filters.remaining(), memAddress(filters)); + } + + /** Requests a number of filters. */ + @NativeType("ALvoid") + public static int alGenFilters() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer filters = stack.callocInt(1); + nalGenFilters(1, memAddress(filters)); + return filters.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alDeleteFilters ] --- + + /** + * Unsafe version of: {@link #alDeleteFilters DeleteFilters} + * + * @param n the number of filters be to deleted + */ + public static void nalDeleteFilters(int n, long filters) { + long __functionAddress = AL.getICD().alDeleteFilters; + if (CHECKS) { + check(__functionAddress); + } + invokePV(n, filters, __functionAddress); + } + + /** + * Deletes a number of filters. + * + * @param filters the filter to delete + */ + @NativeType("ALvoid") + public static void alDeleteFilters(@NativeType("ALuint *") IntBuffer filters) { + nalDeleteFilters(filters.remaining(), memAddress(filters)); + } + + /** Deletes a number of filters. */ + @NativeType("ALvoid") + public static void alDeleteFilters(@NativeType("ALuint *") int filter) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer filters = stack.ints(filter); + nalDeleteFilters(1, memAddress(filters)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alIsFilter ] --- + + /** + * Verifies whether the given object name is a filter. + * + * @param filter a value that may be a filter name + */ + @NativeType("ALboolean") + public static boolean alIsFilter(@NativeType("ALuint") int filter) { + long __functionAddress = AL.getICD().alIsFilter; + if (CHECKS) { + check(__functionAddress); + } + return invokeZ(filter, __functionAddress); + } + + // --- [ alFilteri ] --- + + /** + * Sets the integer value of a filter parameter. + * + * @param filter the filter to modify + * @param param the parameter to modify + * @param value the parameter value + */ + @NativeType("ALvoid") + public static void alFilteri(@NativeType("ALuint") int filter, @NativeType("ALenum") int param, @NativeType("ALint") int value) { + long __functionAddress = AL.getICD().alFilteri; + if (CHECKS) { + check(__functionAddress); + } + invokeV(filter, param, value, __functionAddress); + } + + // --- [ alFilteriv ] --- + + /** Unsafe version of: {@link #alFilteriv Filteriv} */ + public static void nalFilteriv(int filter, int param, long values) { + long __functionAddress = AL.getICD().alFilteriv; + if (CHECKS) { + check(__functionAddress); + } + invokePV(filter, param, values, __functionAddress); + } + + /** + * Pointer version of {@link #alFilteri Filteri}. + * + * @param filter the filter to modify + * @param param the parameter to modify + * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alFilteriv(@NativeType("ALuint") int filter, @NativeType("ALenum") int param, @NativeType("ALint const *") IntBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalFilteriv(filter, param, memAddress(values)); + } + + // --- [ alFilterf ] --- + + /** + * Sets the float value of a filter parameter. + * + * @param filter the filter to modify + * @param param the parameter to modify + * @param value the parameter value + */ + @NativeType("ALvoid") + public static void alFilterf(@NativeType("ALuint") int filter, @NativeType("ALenum") int param, @NativeType("ALfloat") float value) { + long __functionAddress = AL.getICD().alFilterf; + if (CHECKS) { + check(__functionAddress); + } + invokeV(filter, param, value, __functionAddress); + } + + // --- [ alFilterfv ] --- + + /** Unsafe version of: {@link #alFilterfv Filterfv} */ + public static void nalFilterfv(int filter, int param, long values) { + long __functionAddress = AL.getICD().alFilterfv; + if (CHECKS) { + check(__functionAddress); + } + invokePV(filter, param, values, __functionAddress); + } + + /** + * Pointer version of {@link #alFilterf Filterf}. + * + * @param filter the filter to modify + * @param param the parameter to modify + * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alFilterfv(@NativeType("ALuint") int filter, @NativeType("ALenum") int param, @NativeType("ALfloat const *") FloatBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalFilterfv(filter, param, memAddress(values)); + } + + // --- [ alGetFilteri ] --- + + /** Unsafe version of: {@link #alGetFilteri GetFilteri} */ + public static void nalGetFilteri(int filter, int param, long value) { + long __functionAddress = AL.getICD().alGetFilteri; + if (CHECKS) { + check(__functionAddress); + } + invokePV(filter, param, value, __functionAddress); + } + + /** + * Returns the integer value of the specified filter parameter. + * + * @param filter the filter to query + * @param param the parameter to query + * @param value the parameter value + */ + @NativeType("ALvoid") + public static void alGetFilteri(@NativeType("ALuint") int filter, @NativeType("ALenum") int param, @NativeType("ALint *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nalGetFilteri(filter, param, memAddress(value)); + } + + /** + * Returns the integer value of the specified filter parameter. + * + * @param filter the filter to query + * @param param the parameter to query + */ + @NativeType("ALvoid") + public static int alGetFilteri(@NativeType("ALuint") int filter, @NativeType("ALenum") int param) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer value = stack.callocInt(1); + nalGetFilteri(filter, param, memAddress(value)); + return value.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alGetFilteriv ] --- + + /** Unsafe version of: {@link #alGetFilteriv GetFilteriv} */ + public static void nalGetFilteriv(int filter, int param, long values) { + long __functionAddress = AL.getICD().alGetFilteriv; + if (CHECKS) { + check(__functionAddress); + } + invokePV(filter, param, values, __functionAddress); + } + + /** + * Returns the integer values of the specified filter parameter. + * + * @param filter the filter to query + * @param param the parameter to query + * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alGetFilteriv(@NativeType("ALuint") int filter, @NativeType("ALenum") int param, @NativeType("ALint *") IntBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalGetFilteriv(filter, param, memAddress(values)); + } + + // --- [ alGetFilterf ] --- + + /** Unsafe version of: {@link #alGetFilterf GetFilterf} */ + public static void nalGetFilterf(int filter, int param, long value) { + long __functionAddress = AL.getICD().alGetFilterf; + if (CHECKS) { + check(__functionAddress); + } + invokePV(filter, param, value, __functionAddress); + } + + /** + * Returns the float value of the specified filter parameter. + * + * @param filter the effect to query + * @param param the parameter to query + * @param value the parameter value + */ + @NativeType("ALvoid") + public static void alGetFilterf(@NativeType("ALuint") int filter, @NativeType("ALenum") int param, @NativeType("ALfloat *") FloatBuffer value) { + if (CHECKS) { + check(value, 1); + } + nalGetFilterf(filter, param, memAddress(value)); + } + + /** + * Returns the float value of the specified filter parameter. + * + * @param filter the effect to query + * @param param the parameter to query + */ + @NativeType("ALvoid") + public static float alGetFilterf(@NativeType("ALuint") int filter, @NativeType("ALenum") int param) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer value = stack.callocFloat(1); + nalGetFilterf(filter, param, memAddress(value)); + return value.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alGetFilterfv ] --- + + /** Unsafe version of: {@link #alGetFilterfv GetFilterfv} */ + public static void nalGetFilterfv(int filter, int param, long values) { + long __functionAddress = AL.getICD().alGetFilterfv; + if (CHECKS) { + check(__functionAddress); + } + invokePV(filter, param, values, __functionAddress); + } + + /** + * Returns the float values of the specified filter parameter. + * + * @param filter the effect to query + * @param param the parameter to query + * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alGetFilterfv(@NativeType("ALuint") int filter, @NativeType("ALenum") int param, @NativeType("ALfloat *") FloatBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalGetFilterfv(filter, param, memAddress(values)); + } + + // --- [ alGenAuxiliaryEffectSlots ] --- + + /** + * Unsafe version of: {@link #alGenAuxiliaryEffectSlots GenAuxiliaryEffectSlots} + * + * @param n the number of effect slots be to generated + */ + public static void nalGenAuxiliaryEffectSlots(int n, long effectSlots) { + long __functionAddress = AL.getICD().alGenAuxiliaryEffectSlots; + if (CHECKS) { + check(__functionAddress); + } + invokePV(n, effectSlots, __functionAddress); + } + + /** + * Requests a number of effect slots. + * + * @param effectSlots the buffer that will receive the effect slots + */ + @NativeType("ALvoid") + public static void alGenAuxiliaryEffectSlots(@NativeType("ALuint *") IntBuffer effectSlots) { + nalGenAuxiliaryEffectSlots(effectSlots.remaining(), memAddress(effectSlots)); + } + + /** Requests a number of effect slots. */ + @NativeType("ALvoid") + public static int alGenAuxiliaryEffectSlots() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer effectSlots = stack.callocInt(1); + nalGenAuxiliaryEffectSlots(1, memAddress(effectSlots)); + return effectSlots.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alDeleteAuxiliaryEffectSlots ] --- + + /** + * Unsafe version of: {@link #alDeleteAuxiliaryEffectSlots DeleteAuxiliaryEffectSlots} + * + * @param n the number of effect slots be to deleted + */ + public static void nalDeleteAuxiliaryEffectSlots(int n, long effectSlots) { + long __functionAddress = AL.getICD().alDeleteAuxiliaryEffectSlots; + if (CHECKS) { + check(__functionAddress); + } + invokePV(n, effectSlots, __functionAddress); + } + + /** + * Deletes a number of effect slots. + * + * @param effectSlots the effectSlot to delete + */ + @NativeType("ALvoid") + public static void alDeleteAuxiliaryEffectSlots(@NativeType("ALuint *") IntBuffer effectSlots) { + nalDeleteAuxiliaryEffectSlots(effectSlots.remaining(), memAddress(effectSlots)); + } + + /** Deletes a number of effect slots. */ + @NativeType("ALvoid") + public static void alDeleteAuxiliaryEffectSlots(@NativeType("ALuint *") int effectSlot) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer effectSlots = stack.ints(effectSlot); + nalDeleteAuxiliaryEffectSlots(1, memAddress(effectSlots)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alIsAuxiliaryEffectSlot ] --- + + /** + * Verifies whether the given object name is an effect slot. + * + * @param effectSlot a value that may be an effect slot name + */ + @NativeType("ALboolean") + public static boolean alIsAuxiliaryEffectSlot(@NativeType("ALuint") int effectSlot) { + long __functionAddress = AL.getICD().alIsAuxiliaryEffectSlot; + if (CHECKS) { + check(__functionAddress); + } + return invokeZ(effectSlot, __functionAddress); + } + + // --- [ alAuxiliaryEffectSloti ] --- + + /** + * Sets the integer value of an effect slot parameter. + * + * @param effectSlot the effect slot to modify + * @param param the parameter to modify + * @param value the parameter value + */ + @NativeType("ALvoid") + public static void alAuxiliaryEffectSloti(@NativeType("ALuint") int effectSlot, @NativeType("ALenum") int param, @NativeType("ALint") int value) { + long __functionAddress = AL.getICD().alAuxiliaryEffectSloti; + if (CHECKS) { + check(__functionAddress); + } + invokeV(effectSlot, param, value, __functionAddress); + } + + // --- [ alAuxiliaryEffectSlotiv ] --- + + /** Unsafe version of: {@link #alAuxiliaryEffectSlotiv AuxiliaryEffectSlotiv} */ + public static void nalAuxiliaryEffectSlotiv(int effectSlot, int param, long values) { + long __functionAddress = AL.getICD().alAuxiliaryEffectSlotiv; + if (CHECKS) { + check(__functionAddress); + } + invokePV(effectSlot, param, values, __functionAddress); + } + + /** + * Pointer version of {@link #alAuxiliaryEffectSloti AuxiliaryEffectSloti}. + * + * @param effectSlot the effect slot to modify + * @param param the parameter to modify + * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alAuxiliaryEffectSlotiv(@NativeType("ALuint") int effectSlot, @NativeType("ALenum") int param, @NativeType("ALint const *") IntBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalAuxiliaryEffectSlotiv(effectSlot, param, memAddress(values)); + } + + // --- [ alAuxiliaryEffectSlotf ] --- + + /** + * Sets the float value of an effect slot parameter. + * + * @param effectSlot the effect slot to modify + * @param param the parameter to modify + * @param value the parameter value + */ + @NativeType("ALvoid") + public static void alAuxiliaryEffectSlotf(@NativeType("ALuint") int effectSlot, @NativeType("ALenum") int param, @NativeType("ALfloat") float value) { + long __functionAddress = AL.getICD().alAuxiliaryEffectSlotf; + if (CHECKS) { + check(__functionAddress); + } + invokeV(effectSlot, param, value, __functionAddress); + } + + // --- [ alAuxiliaryEffectSlotfv ] --- + + /** Unsafe version of: {@link #alAuxiliaryEffectSlotfv AuxiliaryEffectSlotfv} */ + public static void nalAuxiliaryEffectSlotfv(int effectSlot, int param, long values) { + long __functionAddress = AL.getICD().alAuxiliaryEffectSlotfv; + if (CHECKS) { + check(__functionAddress); + } + invokePV(effectSlot, param, values, __functionAddress); + } + + /** + * Pointer version of {@link #alAuxiliaryEffectSlotf AuxiliaryEffectSlotf}. + * + * @param effectSlot the effect slot to modify + * @param param the parameter to modify + * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alAuxiliaryEffectSlotfv(@NativeType("ALuint") int effectSlot, @NativeType("ALenum") int param, @NativeType("ALfloat const *") FloatBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalAuxiliaryEffectSlotfv(effectSlot, param, memAddress(values)); + } + + // --- [ alGetAuxiliaryEffectSloti ] --- + + /** Unsafe version of: {@link #alGetAuxiliaryEffectSloti GetAuxiliaryEffectSloti} */ + public static void nalGetAuxiliaryEffectSloti(int effectSlot, int param, long value) { + long __functionAddress = AL.getICD().alGetAuxiliaryEffectSloti; + if (CHECKS) { + check(__functionAddress); + } + invokePV(effectSlot, param, value, __functionAddress); + } + + /** + * Returns the integer value of the specified effect slot parameter. + * + * @param effectSlot the effect slot to query + * @param param the parameter to query + * @param value the parameter value + */ + @NativeType("ALvoid") + public static void alGetAuxiliaryEffectSloti(@NativeType("ALuint") int effectSlot, @NativeType("ALenum") int param, @NativeType("ALint *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nalGetAuxiliaryEffectSloti(effectSlot, param, memAddress(value)); + } + + /** + * Returns the integer value of the specified effect slot parameter. + * + * @param effectSlot the effect slot to query + * @param param the parameter to query + */ + @NativeType("ALvoid") + public static int alGetAuxiliaryEffectSloti(@NativeType("ALuint") int effectSlot, @NativeType("ALenum") int param) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer value = stack.callocInt(1); + nalGetAuxiliaryEffectSloti(effectSlot, param, memAddress(value)); + return value.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alGetAuxiliaryEffectSlotiv ] --- + + /** Unsafe version of: {@link #alGetAuxiliaryEffectSlotiv GetAuxiliaryEffectSlotiv} */ + public static void nalGetAuxiliaryEffectSlotiv(int effectSlot, int param, long values) { + long __functionAddress = AL.getICD().alGetAuxiliaryEffectSlotiv; + if (CHECKS) { + check(__functionAddress); + } + invokePV(effectSlot, param, values, __functionAddress); + } + + /** + * Returns the integer values of the specified effect slot parameter. + * + * @param effectSlot the effect slot to query + * @param param the parameter to query + * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alGetAuxiliaryEffectSlotiv(@NativeType("ALuint") int effectSlot, @NativeType("ALenum") int param, @NativeType("ALint *") IntBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalGetAuxiliaryEffectSlotiv(effectSlot, param, memAddress(values)); + } + + // --- [ alGetAuxiliaryEffectSlotf ] --- + + /** Unsafe version of: {@link #alGetAuxiliaryEffectSlotf GetAuxiliaryEffectSlotf} */ + public static void nalGetAuxiliaryEffectSlotf(int effectSlot, int param, long value) { + long __functionAddress = AL.getICD().alGetAuxiliaryEffectSlotf; + if (CHECKS) { + check(__functionAddress); + } + invokePV(effectSlot, param, value, __functionAddress); + } + + /** + * Returns the float value of the specified filter parameter. + * + * @param effectSlot the effect slot to query + * @param param the parameter to query + * @param value the parameter value + */ + @NativeType("ALvoid") + public static void alGetAuxiliaryEffectSlotf(@NativeType("ALuint") int effectSlot, @NativeType("ALenum") int param, @NativeType("ALfloat *") FloatBuffer value) { + if (CHECKS) { + check(value, 1); + } + nalGetAuxiliaryEffectSlotf(effectSlot, param, memAddress(value)); + } + + /** + * Returns the float value of the specified filter parameter. + * + * @param effectSlot the effect slot to query + * @param param the parameter to query + */ + @NativeType("ALvoid") + public static float alGetAuxiliaryEffectSlotf(@NativeType("ALuint") int effectSlot, @NativeType("ALenum") int param) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer value = stack.callocFloat(1); + nalGetAuxiliaryEffectSlotf(effectSlot, param, memAddress(value)); + return value.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alGetAuxiliaryEffectSlotfv ] --- + + /** Unsafe version of: {@link #alGetAuxiliaryEffectSlotfv GetAuxiliaryEffectSlotfv} */ + public static void nalGetAuxiliaryEffectSlotfv(int effectSlot, int param, long values) { + long __functionAddress = AL.getICD().alGetAuxiliaryEffectSlotfv; + if (CHECKS) { + check(__functionAddress); + } + invokePV(effectSlot, param, values, __functionAddress); + } + + /** + * Returns the float values of the specified effect slot parameter. + * + * @param effectSlot the effect to query + * @param param the parameter to query + * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alGetAuxiliaryEffectSlotfv(@NativeType("ALuint") int effectSlot, @NativeType("ALenum") int param, @NativeType("ALfloat *") FloatBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalGetAuxiliaryEffectSlotfv(effectSlot, param, memAddress(values)); + } + + /** Array version of: {@link #alGenEffects GenEffects} */ + @NativeType("ALvoid") + public static void alGenEffects(@NativeType("ALuint *") int[] effects) { + long __functionAddress = AL.getICD().alGenEffects; + if (CHECKS) { + check(__functionAddress); + } + invokePV(effects.length, effects, __functionAddress); + } + + /** Array version of: {@link #alDeleteEffects DeleteEffects} */ + @NativeType("ALvoid") + public static void alDeleteEffects(@NativeType("ALuint *") int[] effects) { + long __functionAddress = AL.getICD().alDeleteEffects; + if (CHECKS) { + check(__functionAddress); + } + invokePV(effects.length, effects, __functionAddress); + } + + /** Array version of: {@link #alEffectiv Effectiv} */ + @NativeType("ALvoid") + public static void alEffectiv(@NativeType("ALuint") int effect, @NativeType("ALenum") int param, @NativeType("ALint const *") int[] values) { + long __functionAddress = AL.getICD().alEffectiv; + if (CHECKS) { + check(__functionAddress); + check(values, 1); + } + invokePV(effect, param, values, __functionAddress); + } + + /** Array version of: {@link #alEffectfv Effectfv} */ + @NativeType("ALvoid") + public static void alEffectfv(@NativeType("ALuint") int effect, @NativeType("ALenum") int param, @NativeType("ALfloat const *") float[] values) { + long __functionAddress = AL.getICD().alEffectfv; + if (CHECKS) { + check(__functionAddress); + check(values, 1); + } + invokePV(effect, param, values, __functionAddress); + } + + /** Array version of: {@link #alGetEffecti GetEffecti} */ + @NativeType("ALvoid") + public static void alGetEffecti(@NativeType("ALuint") int effect, @NativeType("ALenum") int param, @NativeType("ALint *") int[] value) { + long __functionAddress = AL.getICD().alGetEffecti; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + invokePV(effect, param, value, __functionAddress); + } + + /** Array version of: {@link #alGetEffectiv GetEffectiv} */ + @NativeType("ALvoid") + public static void alGetEffectiv(@NativeType("ALuint") int effect, @NativeType("ALenum") int param, @NativeType("ALint *") int[] values) { + long __functionAddress = AL.getICD().alGetEffectiv; + if (CHECKS) { + check(__functionAddress); + check(values, 1); + } + invokePV(effect, param, values, __functionAddress); + } + + /** Array version of: {@link #alGetEffectf GetEffectf} */ + @NativeType("ALvoid") + public static void alGetEffectf(@NativeType("ALuint") int effect, @NativeType("ALenum") int param, @NativeType("ALfloat *") float[] value) { + long __functionAddress = AL.getICD().alGetEffectf; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + invokePV(effect, param, value, __functionAddress); + } + + /** Array version of: {@link #alGetEffectfv GetEffectfv} */ + @NativeType("ALvoid") + public static void alGetEffectfv(@NativeType("ALuint") int effect, @NativeType("ALenum") int param, @NativeType("ALfloat *") float[] values) { + long __functionAddress = AL.getICD().alGetEffectfv; + if (CHECKS) { + check(__functionAddress); + check(values, 1); + } + invokePV(effect, param, values, __functionAddress); + } + + /** Array version of: {@link #alGenFilters GenFilters} */ + @NativeType("ALvoid") + public static void alGenFilters(@NativeType("ALuint *") int[] filters) { + long __functionAddress = AL.getICD().alGenFilters; + if (CHECKS) { + check(__functionAddress); + } + invokePV(filters.length, filters, __functionAddress); + } + + /** Array version of: {@link #alDeleteFilters DeleteFilters} */ + @NativeType("ALvoid") + public static void alDeleteFilters(@NativeType("ALuint *") int[] filters) { + long __functionAddress = AL.getICD().alDeleteFilters; + if (CHECKS) { + check(__functionAddress); + } + invokePV(filters.length, filters, __functionAddress); + } + + /** Array version of: {@link #alFilteriv Filteriv} */ + @NativeType("ALvoid") + public static void alFilteriv(@NativeType("ALuint") int filter, @NativeType("ALenum") int param, @NativeType("ALint const *") int[] values) { + long __functionAddress = AL.getICD().alFilteriv; + if (CHECKS) { + check(__functionAddress); + check(values, 1); + } + invokePV(filter, param, values, __functionAddress); + } + + /** Array version of: {@link #alFilterfv Filterfv} */ + @NativeType("ALvoid") + public static void alFilterfv(@NativeType("ALuint") int filter, @NativeType("ALenum") int param, @NativeType("ALfloat const *") float[] values) { + long __functionAddress = AL.getICD().alFilterfv; + if (CHECKS) { + check(__functionAddress); + check(values, 1); + } + invokePV(filter, param, values, __functionAddress); + } + + /** Array version of: {@link #alGetFilteri GetFilteri} */ + @NativeType("ALvoid") + public static void alGetFilteri(@NativeType("ALuint") int filter, @NativeType("ALenum") int param, @NativeType("ALint *") int[] value) { + long __functionAddress = AL.getICD().alGetFilteri; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + invokePV(filter, param, value, __functionAddress); + } + + /** Array version of: {@link #alGetFilteriv GetFilteriv} */ + @NativeType("ALvoid") + public static void alGetFilteriv(@NativeType("ALuint") int filter, @NativeType("ALenum") int param, @NativeType("ALint *") int[] values) { + long __functionAddress = AL.getICD().alGetFilteriv; + if (CHECKS) { + check(__functionAddress); + check(values, 1); + } + invokePV(filter, param, values, __functionAddress); + } + + /** Array version of: {@link #alGetFilterf GetFilterf} */ + @NativeType("ALvoid") + public static void alGetFilterf(@NativeType("ALuint") int filter, @NativeType("ALenum") int param, @NativeType("ALfloat *") float[] value) { + long __functionAddress = AL.getICD().alGetFilterf; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + invokePV(filter, param, value, __functionAddress); + } + + /** Array version of: {@link #alGetFilterfv GetFilterfv} */ + @NativeType("ALvoid") + public static void alGetFilterfv(@NativeType("ALuint") int filter, @NativeType("ALenum") int param, @NativeType("ALfloat *") float[] values) { + long __functionAddress = AL.getICD().alGetFilterfv; + if (CHECKS) { + check(__functionAddress); + check(values, 1); + } + invokePV(filter, param, values, __functionAddress); + } + + /** Array version of: {@link #alGenAuxiliaryEffectSlots GenAuxiliaryEffectSlots} */ + @NativeType("ALvoid") + public static void alGenAuxiliaryEffectSlots(@NativeType("ALuint *") int[] effectSlots) { + long __functionAddress = AL.getICD().alGenAuxiliaryEffectSlots; + if (CHECKS) { + check(__functionAddress); + } + invokePV(effectSlots.length, effectSlots, __functionAddress); + } + + /** Array version of: {@link #alDeleteAuxiliaryEffectSlots DeleteAuxiliaryEffectSlots} */ + @NativeType("ALvoid") + public static void alDeleteAuxiliaryEffectSlots(@NativeType("ALuint *") int[] effectSlots) { + long __functionAddress = AL.getICD().alDeleteAuxiliaryEffectSlots; + if (CHECKS) { + check(__functionAddress); + } + invokePV(effectSlots.length, effectSlots, __functionAddress); + } + + /** Array version of: {@link #alAuxiliaryEffectSlotiv AuxiliaryEffectSlotiv} */ + @NativeType("ALvoid") + public static void alAuxiliaryEffectSlotiv(@NativeType("ALuint") int effectSlot, @NativeType("ALenum") int param, @NativeType("ALint const *") int[] values) { + long __functionAddress = AL.getICD().alAuxiliaryEffectSlotiv; + if (CHECKS) { + check(__functionAddress); + check(values, 1); + } + invokePV(effectSlot, param, values, __functionAddress); + } + + /** Array version of: {@link #alAuxiliaryEffectSlotfv AuxiliaryEffectSlotfv} */ + @NativeType("ALvoid") + public static void alAuxiliaryEffectSlotfv(@NativeType("ALuint") int effectSlot, @NativeType("ALenum") int param, @NativeType("ALfloat const *") float[] values) { + long __functionAddress = AL.getICD().alAuxiliaryEffectSlotfv; + if (CHECKS) { + check(__functionAddress); + check(values, 1); + } + invokePV(effectSlot, param, values, __functionAddress); + } + + /** Array version of: {@link #alGetAuxiliaryEffectSloti GetAuxiliaryEffectSloti} */ + @NativeType("ALvoid") + public static void alGetAuxiliaryEffectSloti(@NativeType("ALuint") int effectSlot, @NativeType("ALenum") int param, @NativeType("ALint *") int[] value) { + long __functionAddress = AL.getICD().alGetAuxiliaryEffectSloti; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + invokePV(effectSlot, param, value, __functionAddress); + } + + /** Array version of: {@link #alGetAuxiliaryEffectSlotiv GetAuxiliaryEffectSlotiv} */ + @NativeType("ALvoid") + public static void alGetAuxiliaryEffectSlotiv(@NativeType("ALuint") int effectSlot, @NativeType("ALenum") int param, @NativeType("ALint *") int[] values) { + long __functionAddress = AL.getICD().alGetAuxiliaryEffectSlotiv; + if (CHECKS) { + check(__functionAddress); + check(values, 1); + } + invokePV(effectSlot, param, values, __functionAddress); + } + + /** Array version of: {@link #alGetAuxiliaryEffectSlotf GetAuxiliaryEffectSlotf} */ + @NativeType("ALvoid") + public static void alGetAuxiliaryEffectSlotf(@NativeType("ALuint") int effectSlot, @NativeType("ALenum") int param, @NativeType("ALfloat *") float[] value) { + long __functionAddress = AL.getICD().alGetAuxiliaryEffectSlotf; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + invokePV(effectSlot, param, value, __functionAddress); + } + + /** Array version of: {@link #alGetAuxiliaryEffectSlotfv GetAuxiliaryEffectSlotfv} */ + @NativeType("ALvoid") + public static void alGetAuxiliaryEffectSlotfv(@NativeType("ALuint") int effectSlot, @NativeType("ALenum") int param, @NativeType("ALfloat *") float[] values) { + long __functionAddress = AL.getICD().alGetAuxiliaryEffectSlotfv; + if (CHECKS) { + check(__functionAddress); + check(values, 1); + } + invokePV(effectSlot, param, values, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTExponentDistance.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTExponentDistance.java new file mode 100644 index 00000000..d7a09e1f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTExponentDistance.java @@ -0,0 +1,23 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** + * Native bindings to the {@code AL_EXT_EXPONENT_DISTANCE} extension. + * + *

An OpenAL 1.1 implementation will always support the {@code AL_EXT_EXPONENT_DISTANCE} extension. This allows an application written to the OpenAL 1.0 specification to + * access the exponent distance abilities.

+ */ +public final class EXTExponentDistance { + + /** {@code AL_EXT_EXPONENT_DISTANCE} tokens. */ + public static final int + AL_EXPONENT_DISTANCE = 0xD005, + AL_EXPONENT_DISTANCE_CLAMPED = 0xD006; + + private EXTExponentDistance() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTFloat32.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTFloat32.java new file mode 100644 index 00000000..655388e3 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTFloat32.java @@ -0,0 +1,18 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** Native bindings to the {@code AL_EXT_FLOAT32} extension. */ +public final class EXTFloat32 { + + /** Buffer formats. */ + public static final int + AL_FORMAT_MONO_FLOAT32 = 0x10010, + AL_FORMAT_STEREO_FLOAT32 = 0x10011; + + private EXTFloat32() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTIma4.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTIma4.java new file mode 100644 index 00000000..291ae714 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTIma4.java @@ -0,0 +1,18 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** Native bindings to the {@code AL_EXT_IMA4} extension. */ +public final class EXTIma4 { + + /** Buffer formats. */ + public static final int + AL_FORMAT_MONO_IMA4 = 0x1300, + AL_FORMAT_STEREO_IMA4 = 0x1301; + + private EXTIma4() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTLinearDistance.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTLinearDistance.java new file mode 100644 index 00000000..84ee13aa --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTLinearDistance.java @@ -0,0 +1,23 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** + * Native bindings to the {@code AL_EXT_LINEAR_DISTANCE} extension. + * + *

An OpenAL 1.1 implementation will always support the {@code AL_EXT_LINEAR_DISTANCE} extension. This allows an application written to the OpenAL 1.0 specification to + * access the offset abilities.

+ */ +public final class EXTLinearDistance { + + /** {@code AL_EXT_LINEAR_DISTANCE} tokens. */ + public static final int + AL_LINEAR_DISTANCE = 0xD003, + AL_LINEAR_DISTANCE_CLAMPED = 0xD004; + + private EXTLinearDistance() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTMCFormats.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTMCFormats.java new file mode 100644 index 00000000..13fd2475 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTMCFormats.java @@ -0,0 +1,31 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** Native bindings to the {@code AL_EXT_MCFORMATS} extension. */ +public final class EXTMCFormats { + + /** Buffer formats. */ + public static final int + AL_FORMAT_QUAD8 = 0x1204, + AL_FORMAT_QUAD16 = 0x1205, + AL_FORMAT_QUAD32 = 0x1206, + AL_FORMAT_REAR8 = 0x1207, + AL_FORMAT_REAR16 = 0x1208, + AL_FORMAT_REAR32 = 0x1209, + AL_FORMAT_51CHN8 = 0x120A, + AL_FORMAT_51CHN16 = 0x120B, + AL_FORMAT_51CHN32 = 0x120C, + AL_FORMAT_61CHN8 = 0x120D, + AL_FORMAT_61CHN16 = 0x120E, + AL_FORMAT_61CHN32 = 0x120F, + AL_FORMAT_71CHN8 = 0x1210, + AL_FORMAT_71CHN16 = 0x1211, + AL_FORMAT_71CHN32 = 0x1212; + + private EXTMCFormats() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTMulaw.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTMulaw.java new file mode 100644 index 00000000..711272e7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTMulaw.java @@ -0,0 +1,18 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** Native bindings to the {@code AL_EXT_MULAW} extension. */ +public final class EXTMulaw { + + /** Buffer formats. */ + public static final int + AL_FORMAT_MONO_MULAW_EXT = 0x10014, + AL_FORMAT_STEREO_MULAW_EXT = 0x10015; + + private EXTMulaw() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTMulawBFormat.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTMulawBFormat.java new file mode 100644 index 00000000..9600ba63 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTMulawBFormat.java @@ -0,0 +1,24 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** + * Native bindings to the {@code AL_EXT_MULAW_BFORMAT} extension. + * + *

This extension implies two MULAW formats are available, based on 2D and 3D Ambisonic B-Format.

+ * + *

See {@link EXTBFormat EXT_BFORMAT} for a discussion of the channel numberings and meanings.

+ */ +public final class EXTMulawBFormat { + + /** Buffer formats. */ + public static final int + AL_FORMAT_BFORMAT2D_MULAW = 0x10031, + AL_FORMAT_BFORMAT3D_MULAW = 0x10032; + + private EXTMulawBFormat() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTMulawMCFormats.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTMulawMCFormats.java new file mode 100644 index 00000000..d336a35b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTMulawMCFormats.java @@ -0,0 +1,23 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** Native bindings to the {@code AL_EXT_MULAW_MCFORMATS} extension. */ +public final class EXTMulawMCFormats { + + /** Buffer formats. */ + public static final int + AL_FORMAT_MONO_MULAW = 0x10014, + AL_FORMAT_STEREO_MULAW = 0x10015, + AL_FORMAT_QUAD_MULAW = 0x10021, + AL_FORMAT_REAR_MULAW = 0x10022, + AL_FORMAT_51CHN_MULAW = 0x10023, + AL_FORMAT_61CHN_MULAW = 0x10024, + AL_FORMAT_71CHN_MULAW = 0x10025; + + private EXTMulawMCFormats() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTOffset.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTOffset.java new file mode 100644 index 00000000..43a3a73d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTOffset.java @@ -0,0 +1,24 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** + * Native bindings to the {@code AL_EXT_OFFSET} extension. + * + *

An OpenAL 1.1 implementation will always support the {@code AL_EXT_OFFSET} extension. This allows an application written to the OpenAL 1.0 specification to + * access the offset abilities.

+ */ +public final class EXTOffset { + + /** {@code AL_EXT_OFFSET} tokens. */ + public static final int + AL_SEC_OFFSET = 0x1024, + AL_SAMPLE_OFFSET = 0x1025, + AL_BYTE_OFFSET = 0x1026; + + private EXTOffset() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTSourceDistanceModel.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTSourceDistanceModel.java new file mode 100644 index 00000000..2e6db2ba --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTSourceDistanceModel.java @@ -0,0 +1,22 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** + * Native bindings to the EXT_source_distance_model extension. + * + *

This extension allows each source to specify a distance model, instead of being restricted to one distance model for every source in the context. It + * provides a mechanism for applications to apply different models to each source, without the burden of manually applying the attenuation through the + * source gain.

+ */ +public final class EXTSourceDistanceModel { + + /** Accepted by the {@code target} parameter of {@link AL10#alEnable Enable}, {@link AL10#alDisable Disable}, and {@link AL10#alIsEnabled IsEnabled}. */ + public static final int AL_SOURCE_DISTANCE_MODEL = 0x200; + + private EXTSourceDistanceModel() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTSourceRadius.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTSourceRadius.java new file mode 100644 index 00000000..66dd2879 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTSourceRadius.java @@ -0,0 +1,23 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** + * Native bindings to the {@code AL_EXT_SOURCE_RADIUS} extension. + * + *

This extension allows any mono source to be changed to be a "large" source with a radius. The source has a raised cosine shape.

+ */ +public final class EXTSourceRadius { + + /** + * Can be used with {@link AL10#alSourcef Sourcef} to set the source radius. Units are consistent with the coordinate system in use. The value must be at least zero. Use + * a value of zero to reset to a point source. + */ + public static final int AL_SOURCE_RADIUS = 0x1031; + + private EXTSourceRadius() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTStaticBuffer.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTStaticBuffer.java new file mode 100644 index 00000000..fe904dfc --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTStaticBuffer.java @@ -0,0 +1,132 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the {@code AL_EXT_static_buffer} extension. + * + *

This extension provides a means for the caller to avoid the overhead associated with the {@link AL10#alBufferData BufferData} call which performs a physical copy of the + * data provided by the caller to internal buffers. When using the {@code AL_EXT_static_buffer} extension, OpenAL's internal buffers use the data pointer provided by + * the caller for all data access.

+ */ +public class EXTStaticBuffer { + + protected EXTStaticBuffer() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(ALCapabilities caps) { + return checkFunctions( + caps.alBufferDataStatic + ); + } + + // --- [ alBufferDataStatic ] --- + + /** + * Unsafe version of: {@link #alBufferDataStatic BufferDataStatic} + * + * @param len the data buffer size, in bytes + */ + public static void nalBufferDataStatic(int buffer, int format, long data, int len, int freq) { + long __functionAddress = AL.getICD().alBufferDataStatic; + if (CHECKS) { + check(__functionAddress); + } + invokePV(buffer, format, data, len, freq, __functionAddress); + } + + /** + * Sets the sample data of the specified buffer. + * + * @param buffer the buffer handle + * @param format the data format + * @param data the sample data + * @param freq the data frequency + */ + @NativeType("ALvoid") + public static void alBufferDataStatic(@NativeType("ALint") int buffer, @NativeType("ALenum") int format, @NativeType("ALvoid *") ByteBuffer data, @NativeType("ALsizei") int freq) { + nalBufferDataStatic(buffer, format, memAddress(data), data.remaining(), freq); + } + + /** + * Sets the sample data of the specified buffer. + * + * @param buffer the buffer handle + * @param format the data format + * @param data the sample data + * @param freq the data frequency + */ + @NativeType("ALvoid") + public static void alBufferDataStatic(@NativeType("ALint") int buffer, @NativeType("ALenum") int format, @NativeType("ALvoid *") ShortBuffer data, @NativeType("ALsizei") int freq) { + nalBufferDataStatic(buffer, format, memAddress(data), data.remaining() << 1, freq); + } + + /** + * Sets the sample data of the specified buffer. + * + * @param buffer the buffer handle + * @param format the data format + * @param data the sample data + * @param freq the data frequency + */ + @NativeType("ALvoid") + public static void alBufferDataStatic(@NativeType("ALint") int buffer, @NativeType("ALenum") int format, @NativeType("ALvoid *") IntBuffer data, @NativeType("ALsizei") int freq) { + nalBufferDataStatic(buffer, format, memAddress(data), data.remaining() << 2, freq); + } + + /** + * Sets the sample data of the specified buffer. + * + * @param buffer the buffer handle + * @param format the data format + * @param data the sample data + * @param freq the data frequency + */ + @NativeType("ALvoid") + public static void alBufferDataStatic(@NativeType("ALint") int buffer, @NativeType("ALenum") int format, @NativeType("ALvoid *") FloatBuffer data, @NativeType("ALsizei") int freq) { + nalBufferDataStatic(buffer, format, memAddress(data), data.remaining() << 2, freq); + } + + /** Array version of: {@link #alBufferDataStatic BufferDataStatic} */ + @NativeType("ALvoid") + public static void alBufferDataStatic(@NativeType("ALint") int buffer, @NativeType("ALenum") int format, @NativeType("ALvoid *") short[] data, @NativeType("ALsizei") int freq) { + long __functionAddress = AL.getICD().alBufferDataStatic; + if (CHECKS) { + check(__functionAddress); + } + invokePV(buffer, format, data, data.length << 1, freq, __functionAddress); + } + + /** Array version of: {@link #alBufferDataStatic BufferDataStatic} */ + @NativeType("ALvoid") + public static void alBufferDataStatic(@NativeType("ALint") int buffer, @NativeType("ALenum") int format, @NativeType("ALvoid *") int[] data, @NativeType("ALsizei") int freq) { + long __functionAddress = AL.getICD().alBufferDataStatic; + if (CHECKS) { + check(__functionAddress); + } + invokePV(buffer, format, data, data.length << 2, freq, __functionAddress); + } + + /** Array version of: {@link #alBufferDataStatic BufferDataStatic} */ + @NativeType("ALvoid") + public static void alBufferDataStatic(@NativeType("ALint") int buffer, @NativeType("ALenum") int format, @NativeType("ALvoid *") float[] data, @NativeType("ALsizei") int freq) { + long __functionAddress = AL.getICD().alBufferDataStatic; + if (CHECKS) { + check(__functionAddress); + } + invokePV(buffer, format, data, data.length << 2, freq, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTStereoAngles.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTStereoAngles.java new file mode 100644 index 00000000..e32bb93f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTStereoAngles.java @@ -0,0 +1,25 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** + * Native bindings to the {@code AL_EXT_STEREO_ANGLES} extension. + * + *

This extension allows any stereo source to be "steered" by setting the angles at which the left and right channels should play.

+ */ +public final class EXTStereoAngles { + + /** + * Can be used with {@link AL10#alSourcefv Sourcefv} and two angles. The angles are specified anticlockwise relative to the real front, so a normal 60degree front stage is + * specified with {@code alSourcefv(sid,AL_STEREO_ANGLES,+M_PI/6,-M_PI/6)}. + * + *

Angles are always specified in radians, anticlockwise relative to the real front ({@link AL10#AL_SOURCE_RELATIVE SOURCE_RELATIVE} is not supported).

+ */ + public static final int AL_STEREO_ANGLES = 0x1030; + + private EXTStereoAngles() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTThreadLocalContext.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTThreadLocalContext.java new file mode 100644 index 00000000..df103e7a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTThreadLocalContext.java @@ -0,0 +1,60 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; + +/** + * Native bindings to the EXT_thread_local_context extension. + * + *

This extension introduces the concept of a current thread-local context, with each thread able to have its own current context. The current context is + * what the al- functions work on, effectively allowing multiple threads to independently drive separate OpenAL playback contexts.

+ */ +public class EXTThreadLocalContext { + + protected EXTThreadLocalContext() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(ALCCapabilities caps) { + return checkFunctions( + caps.alcSetThreadContext, caps.alcGetThreadContext + ); + } + + // --- [ alcSetThreadContext ] --- + + /** + * Makes a context current with respect to OpenAL operation on the current thread. The context parameter can be {@code NULL} or a valid context pointer. Using + * {@code NULL} results in no thread-specific context being current in the calling thread, which is useful when shutting OpenAL down. + * + * @param context the context to make current + */ + @NativeType("ALCboolean") + public static boolean alcSetThreadContext(@NativeType("ALCcontext *") long context) { + long __functionAddress = ALC.getICD().alcSetThreadContext; + if (CHECKS) { + check(__functionAddress); + } + return invokePZ(context, __functionAddress); + } + + // --- [ alcGetThreadContext ] --- + + /** Retrieves a handle to the thread-specific context of the calling thread. This function will return {@code NULL} if no thread-specific context is set. */ + @NativeType("ALCcontext *") + public static long alcGetThreadContext() { + long __functionAddress = ALC.getICD().alcGetThreadContext; + if (CHECKS) { + check(__functionAddress); + } + return invokeP(__functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTVorbis.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTVorbis.java new file mode 100644 index 00000000..9bbe98a4 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EXTVorbis.java @@ -0,0 +1,16 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** Native bindings to the {@code AL_EXT_vorbis} extension. */ +public final class EXTVorbis { + + /** {@code AL_EXT_vorbis} tokens. */ + public static final int AL_FORMAT_VORBIS_EXT = 0x10003; + + private EXTVorbis() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EnumerateAllExt.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EnumerateAllExt.java new file mode 100644 index 00000000..94adfe0e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/EnumerateAllExt.java @@ -0,0 +1,26 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** + * Native bindings to the {@code ALC_ENUMERATE_ALL_EXT} extension. + * + *

The Enumerate All Extension enables the application developer to retrieve a complete list of device strings identifying all the available OpenAL + * rendering devices and paths present on the user's PC. It works in exactly the same manner as the Enumeration Extension, but it detects additional audio + * paths that the standard extension will ignore. For instance, it will return all the possible outputs in situations where the user has more than one + * audio device installed, or under Windows Vista where the audio system specifies different “endpoints” for sound such as Speakers, S/PDIF, etc... If you + * don’t require such complete control over the choice of output path, then use the standard Enumeration Extension.

+ */ +public final class EnumerateAllExt { + + /** {@code ALC_ENUMERATE_ALL_EXT} tokens. */ + public static final int + ALC_DEFAULT_ALL_DEVICES_SPECIFIER = 0x1012, + ALC_ALL_DEVICES_SPECIFIER = 0x1013; + + private EnumerateAllExt() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/LOKIAudioChannel.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/LOKIAudioChannel.java new file mode 100644 index 00000000..f21ab013 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/LOKIAudioChannel.java @@ -0,0 +1,19 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** Native bindings to the {@code ALC_LOKI_audio_channel} extension. */ +public final class LOKIAudioChannel { + + /** {@code ALC_LOKI_audio_channel} tokens. */ + public static final int + ALC_CHAN_MAIN_LOKI = 0x500001, + ALC_CHAN_PCM_LOKI = 0x500002, + ALC_CHAN_CD_LOKI = 0x500003; + + private LOKIAudioChannel() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/LOKIIMAADPCM.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/LOKIIMAADPCM.java new file mode 100644 index 00000000..bc0b5d4f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/LOKIIMAADPCM.java @@ -0,0 +1,18 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** Native bindings to the {@code AL_LOKI_IMA_ADPCM} extension. */ +public final class LOKIIMAADPCM { + + /** Buffer formats. */ + public static final int + AL_FORMAT_IMA_ADPCM_MONO16_EXT = 0x10000, + AL_FORMAT_IMA_ADPCM_STEREO16_EXT = 0x10001; + + private LOKIIMAADPCM() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/LOKIQuadriphonic.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/LOKIQuadriphonic.java new file mode 100644 index 00000000..39c3b7d1 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/LOKIQuadriphonic.java @@ -0,0 +1,18 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** Native bindings to the {@code AL_LOKI_quadriphonic} extension. */ +public final class LOKIQuadriphonic { + + /** Buffer formats. */ + public static final int + AL_FORMAT_QUAD8_LOKI = 0x10004, + AL_FORMAT_QUAD16_LOKI = 0x10005; + + private LOKIQuadriphonic() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/LOKIWAVEFormat.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/LOKIWAVEFormat.java new file mode 100644 index 00000000..5f5728af --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/LOKIWAVEFormat.java @@ -0,0 +1,16 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** Native bindings to the {@code AL_LOKI_WAVE_format} extension. */ +public final class LOKIWAVEFormat { + + /** Buffer formats. */ + public static final int AL_FORMAT_WAVE_EXT = 0x10002; + + private LOKIWAVEFormat() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTBlockAlignment.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTBlockAlignment.java new file mode 100644 index 00000000..ebe29a9f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTBlockAlignment.java @@ -0,0 +1,23 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** + * Native bindings to the SOFT_block_alignment extension. + * + *

This extension provides a mechanism for specifying block alignment properties for sample data. This is useful for, though not strictly limited to, + * ADPCM compression where the block alignment is specified in the media file header instead of the data stream, and controls the decoding process.

+ */ +public final class SOFTBlockAlignment { + + /** Accepted by the {@code paramName} parameter of {@link AL11#alBufferi Bufferi}, {@link AL11#alBufferiv Bufferiv}, {@link AL10#alGetBufferi GetBufferi}, and {@link AL11#alGetBufferiv GetBufferiv}. */ + public static final int + AL_UNPACK_BLOCK_ALIGNMENT_SOFT = 0x200C, + AL_PACK_BLOCK_ALIGNMENT_SOFT = 0x200D; + + private SOFTBlockAlignment() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTDeferredUpdates.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTDeferredUpdates.java new file mode 100644 index 00000000..e1f67852 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTDeferredUpdates.java @@ -0,0 +1,72 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; + +/** + * Native bindings to the SOFT_deferred_updates extension. + * + *

This extension allows applications to defer playback state updates. With unextended OpenAL, the playback state would respond to changes as soon as it + * could handle them, which makes it effectively impossible to ensure multiple changes occur at the same time without the potential of a "partial" update + * (where one change is heard without the other). This extension provides a way to prevent state updates from occuring until they've all been done, where + * they will all apply at once.

+ */ +public class SOFTDeferredUpdates { + + /** Accepted by the {@code paramName} parameter of {@link AL10#alGetBoolean GetBoolean}, {@link AL10#alGetBooleanv GetBooleanv} (as well as the Integer, Float, and Double variants). */ + public static final int AL_DEFERRED_UPDATES_SOFT = 0xC002; + + protected SOFTDeferredUpdates() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(ALCapabilities caps) { + return checkFunctions( + caps.alDeferUpdatesSOFT, caps.alProcessUpdatesSOFT + ); + } + + // --- [ alDeferUpdatesSOFT ] --- + + /** + * Sometimes it is desirable to ensure multiple state changes take effect at the same time. Normally this isn't possible due to the AL processing updates + * asychronously, so the playback state can be updated with only part of the changes having been specified. An application can prevent these updates by + * calling this function. + * + *

When called, samples will continue to render and be sent to the output device, but the effects of changing playback properties, such as the source or + * listener gain, or auxiliary slot gain or effect if EFX is supported, among others, will be deferred. Multiple changes can be batched so that they all + * apply at once at a later time.

+ */ + @NativeType("ALvoid") + public static void alDeferUpdatesSOFT() { + long __functionAddress = AL.getICD().alDeferUpdatesSOFT; + if (CHECKS) { + check(__functionAddress); + } + invokeV(__functionAddress); + } + + // --- [ alProcessUpdatesSOFT ] --- + + /** + * Resumes updates. + * + *

Once called, all pending deferred updates will be processed. Any following state changes will also apply as normal.

+ */ + @NativeType("ALvoid") + public static void alProcessUpdatesSOFT() { + long __functionAddress = AL.getICD().alProcessUpdatesSOFT; + if (CHECKS) { + check(__functionAddress); + } + invokeV(__functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTDeviceClock.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTDeviceClock.java new file mode 100644 index 00000000..09b89271 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTDeviceClock.java @@ -0,0 +1,138 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the SOFT_device_clock extension. + * + *

This extension allows applications to query the timing clock from the audio device. This clock lets applications measure the passage of time as the + * audio device sees it, which may be slightly different than the system clock's tick rate (the infamous timer drift).

+ * + *

If the {@link SOFTPauseDevice SOFT_pause_device} extension is available, the device clock does not increment while the device playback is paused. It is + * implementation-defined whether or not the device clock increments while no contexts are allocated. The initial clock time value of an opened device is + * also implementation-defined, except that it must not be negative and should be low enough to avoid wrapping during program execution.

+ * + *

Requires {@link SOFTSourceLatency SOFT_source_latency}

+ */ +public class SOFTDeviceClock { + + /** Accepted as the {@code pname} parameter of {@link #alcGetInteger64vSOFT GetInteger64vSOFT}. */ + public static final int + ALC_DEVICE_CLOCK_SOFT = 0x1600, + ALC_DEVICE_LATENCY_SOFT = 0x1601, + ALC_DEVICE_CLOCK_LATENCY_SOFT = 0x1602; + + /** + * Accepted as the {@code param} parameter of {@link SOFTSourceLatency#alGetSourcei64vSOFT GetSourcei64vSOFT}. + * + *

Returns the playback position, expressed in fixed-point samples, along with the device clock, expressed in nanoseconds. This attribute is read-only.

+ * + *

The first value in the returned vector is the sample offset, which is a 32.32 fixed-point value. The whole number is stored in the upper 32 bits and + * the fractional component is in the lower 32 bits. The value is similar to that returned by {@link AL11#AL_SAMPLE_OFFSET SAMPLE_OFFSET}, just with more precision.

+ * + *

The second value is the device clock, in nanoseconds. This updates at the same rate as the offset, and both are measured atomically with respect to one + * another.

+ */ + public static final int AL_SAMPLE_OFFSET_CLOCK_SOFT = 0x1202; + + /** + * Accepted as the {@code param} parameter of {@link SOFTSourceLatency#alGetSourcedvSOFT GetSourcedvSOFT}. + * + *

Returns the playback position, along with the device clock, both expressed in seconds. This attribute is read-only.

+ * + *

The first value in the returned vector is the offset in seconds. The value is similar to that returned by {@link AL11#AL_SEC_OFFSET SEC_OFFSET}, just with more precision.

+ * + *

The second value is the device clock, in seconds. This updates at the same rate as the offset, and both are measured atomically with respect to one + * another. Be aware that this value may be subtly different from the other device clock queries due to the variable precision of floating-point values.

+ */ + public static final int AL_SEC_OFFSET_CLOCK_SOFT = 0x1203; + + protected SOFTDeviceClock() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(ALCCapabilities caps) { + return checkFunctions( + caps.alcGetInteger64vSOFT + ); + } + + // --- [ alcGetInteger64vSOFT ] --- + + /** Unsafe version of: {@link #alcGetInteger64vSOFT GetInteger64vSOFT} */ + public static void nalcGetInteger64vSOFT(long device, int pname, int size, long values) { + long __functionAddress = ALC.getICD().alcGetInteger64vSOFT; + if (CHECKS) { + check(__functionAddress); + } + invokePPV(device, pname, size, values, __functionAddress); + } + + /** + * Accepts all the same {@link AL10#alGetIntegerv GetIntegerv} queries, in addition to some new ones. + * + *

Note that the size parameter is the number of {@code ALCint64SOFT} elements in the buffer provided, not the number of bytes.

+ * + * @param pname + * + * + * + *
{@link #ALC_DEVICE_CLOCK_SOFT DEVICE_CLOCK_SOFT}The audio device clock time, expressed in nanoseconds. {@code NULL} is an invalid device.
{@link #ALC_DEVICE_LATENCY_SOFT DEVICE_LATENCY_SOFT}The current audio device latency, in nanoseconds. This is effectively the delay for the samples rendered at the the device's current + * clock time fromreaching the physical output. {@code NULL} is an invalid device.
{@link #ALC_DEVICE_CLOCK_LATENCY_SOFT DEVICE_CLOCK_LATENCY_SOFT}Expects a destination size of 2, and provides both the audio device clock time and latency, both in nanoseconds. The two values are + * measured atomically with respect to one another (i.e. the latency value was measured at the same time the device clock value was + * retrieved). {@code NULL} is an invalid device.
+ */ + @NativeType("ALCvoid") + public static void alcGetInteger64vSOFT(@NativeType("ALCdevice *") long device, @NativeType("ALCenum") int pname, @NativeType("ALCint64SOFT *") LongBuffer values) { + nalcGetInteger64vSOFT(device, pname, values.remaining(), memAddress(values)); + } + + /** + * Accepts all the same {@link AL10#alGetIntegerv GetIntegerv} queries, in addition to some new ones. + * + *

Note that the size parameter is the number of {@code ALCint64SOFT} elements in the buffer provided, not the number of bytes.

+ * + * @param pname + * + * + * + *
{@link #ALC_DEVICE_CLOCK_SOFT DEVICE_CLOCK_SOFT}The audio device clock time, expressed in nanoseconds. {@code NULL} is an invalid device.
{@link #ALC_DEVICE_LATENCY_SOFT DEVICE_LATENCY_SOFT}The current audio device latency, in nanoseconds. This is effectively the delay for the samples rendered at the the device's current + * clock time fromreaching the physical output. {@code NULL} is an invalid device.
{@link #ALC_DEVICE_CLOCK_LATENCY_SOFT DEVICE_CLOCK_LATENCY_SOFT}Expects a destination size of 2, and provides both the audio device clock time and latency, both in nanoseconds. The two values are + * measured atomically with respect to one another (i.e. the latency value was measured at the same time the device clock value was + * retrieved). {@code NULL} is an invalid device.
+ */ + @NativeType("ALCvoid") + public static long alcGetInteger64vSOFT(@NativeType("ALCdevice *") long device, @NativeType("ALCenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer values = stack.callocLong(1); + nalcGetInteger64vSOFT(device, pname, 1, memAddress(values)); + return values.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #alcGetInteger64vSOFT GetInteger64vSOFT} */ + @NativeType("ALCvoid") + public static void alcGetInteger64vSOFT(@NativeType("ALCdevice *") long device, @NativeType("ALCenum") int pname, @NativeType("ALCint64SOFT *") long[] values) { + long __functionAddress = ALC.getICD().alcGetInteger64vSOFT; + if (CHECKS) { + check(__functionAddress); + } + invokePPV(device, pname, values.length, values, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTDirectChannels.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTDirectChannels.java new file mode 100644 index 00000000..4eb3ee55 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTDirectChannels.java @@ -0,0 +1,26 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** + * Native bindings to the SOFT_direct_channels extension. + * + *

This extension allows a multi-channel source to play without virtualized output speakers. By default, OpenAL requires buffer channels to be down-mixed + * to the output channel configuration, possibly using HRTF or other virtualization techniques to give a sense of speakers that may not be physically + * present. Sometimes audio tracks are authored with their own spatialization effects, where the AL's virtualization methods can cause a notable decrease + * in audio quality.

+ * + *

This extension provides a mechanism for applications to specify whether audio should be filtered according to the AL's channel virtualization rules for + * multi-channel buffers.

+ */ +public final class SOFTDirectChannels { + + /** Accepted by the {@code paramName} parameter of {@link AL10#alSourcei Sourcei}, {@link AL11#alSourceiv Sourceiv}, {@link AL10#alGetSourcei GetSourcei}, and {@link AL10#alGetSourceiv GetSourceiv}. */ + public static final int AL_DIRECT_CHANNELS_SOFT = 0x1033; + + private SOFTDirectChannels() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTGainClampEx.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTGainClampEx.java new file mode 100644 index 00000000..bd25f794 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTGainClampEx.java @@ -0,0 +1,32 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** + * Native bindings to the SOFT_gain_clamp_ex extension. + * + *

This extension extends the gain clamping mechanism in standard AL. By default, OpenAL allows the source's and listener's {@link AL10#AL_GAIN GAIN} property to be set to + * any value that's greater-than or equal-to 0. The calculated source gain is clamped between its {@link AL10#AL_MIN_GAIN MIN_GAIN} and {@link AL10#AL_MAX_GAIN MAX_GAIN} properties after distance + * attenuation and the directional cone is applied, and before the listener gain is applied, however these two clamping properties are themselves + * restricted to being between 0 and 1 (inclusive).

+ * + *

That behavior effectively nullifies any purpose of setting a source's gain being above 1, as the source's distance- and cone-related properties can be + * modified for the same effect. Oddly, the listener gain is applied to the source gain *after* the clamping, so it is still possible for the final + * calculated gain to exceed 1. On top of this, the spec allows an implementation the option to implicitly clamp the final calculated gain for the source + * as needed, but provides no means for applications to detect such behavior.

+ * + *

This extension aims to fix those problems by removing the maximum limit for {@link AL10#AL_MIN_GAIN MIN_GAIN} and {@link AL10#AL_MAX_GAIN MAX_GAIN}, allowing applications to increase the effective + * source gain above 1. Additionally, it provides a query for the application to retrieve the implicit clamp level an implementation may put on the final + * calculated gain.

+ */ +public final class SOFTGainClampEx { + + /** An implementation-defined maximum per-source gain limit (guaranteed to be at least 1). */ + public static final int AL_GAIN_LIMIT_SOFT = 0x200E; + + private SOFTGainClampEx() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTHRTF.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTHRTF.java new file mode 100644 index 00000000..d7dfb257 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTHRTF.java @@ -0,0 +1,141 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the SOFT_HRTF extension. + * + *

This extension allows an application to request and determine the status of HRTF mixing. HRTF, or Head-Related Transfer Function, is a method of mixing + * 3D audio for "true" 3D panning, typically using filters designed to simulate how sound is affected by a listener's head as the sound waves travel + * between the ears.

+ * + *

As a 3D sound API, OpenAL's design allows implementations to transparently render audio using HRTF. However, the OpenAL API currently has no concept of + * HRTF so there's no way to query if it's being used, and no way for an application to request it on behalf of the user. This aims to fix that.

+ */ +public class SOFTHRTF { + + /** + * Accepted as part of the {@code attrList} parameter of {@link ALC10#alcCreateContext CreateContext} and {@link #alcResetDeviceSOFT ResetDeviceSOFT}, and as the {@code paramName} parameter of + * {@link ALC10#alcGetIntegerv GetIntegerv}. + */ + public static final int ALC_HRTF_SOFT = 0x1992; + + /** Accepted as part of the {@code attrList} parameter of {@link ALC10#alcCreateContext CreateContext} and {@link #alcResetDeviceSOFT ResetDeviceSOFT}. */ + public static final int ALC_HRTF_ID_SOFT = 0x1996; + + /** Accepted as part of the {@code attrList} parameter of {@link ALC10#alcCreateContext CreateContext} and {@link #alcResetDeviceSOFT ResetDeviceSOFT}, for the {@link #ALC_HRTF_SOFT HRTF_SOFT} attribute. */ + public static final int ALC_DONT_CARE_SOFT = 0x2; + + /** Accepted as the {@code paramName} parameter of {@link ALC10#alcGetIntegerv GetIntegerv}. */ + public static final int + ALC_HRTF_STATUS_SOFT = 0x1993, + ALC_NUM_HRTF_SPECIFIERS_SOFT = 0x1994; + + /** Accepted as the {@code paramName} parameter of {@link ALC10#alcGetString GetString} and {@link #alcGetStringiSOFT GetStringiSOFT}. */ + public static final int ALC_HRTF_SPECIFIER_SOFT = 0x1995; + + /** Possible results from a {@link #ALC_HRTF_STATUS_SOFT HRTF_STATUS_SOFT} query. */ + public static final int + ALC_HRTF_DISABLED_SOFT = 0x0, + ALC_HRTF_ENABLED_SOFT = 0x1, + ALC_HRTF_DENIED_SOFT = 0x2, + ALC_HRTF_REQUIRED_SOFT = 0x3, + ALC_HRTF_HEADPHONES_DETECTED_SOFT = 0x4, + ALC_HRTF_UNSUPPORTED_FORMAT_SOFT = 0x5; + + protected SOFTHRTF() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(ALCCapabilities caps) { + return checkFunctions( + caps.alcGetStringiSOFT, caps.alcResetDeviceSOFT + ); + } + + // --- [ alcGetStringiSOFT ] --- + + /** Unsafe version of: {@link #alcGetStringiSOFT GetStringiSOFT} */ + public static long nalcGetStringiSOFT(long device, int paramName, int index) { + long __functionAddress = ALC.getICD().alcGetStringiSOFT; + if (CHECKS) { + check(__functionAddress); + check(device); + } + return invokePP(device, paramName, index, __functionAddress); + } + + /** + * Returns a human-readable string for an HRTF. + * + *

The returned string will be an implementation-defined UTF-8 encoded specifier for the given HRTF index, designed for display to the user. The returned + * strings are valid until the next enumeration point or the device is closed.

+ * + * @param device he same one that previously queried the number of HRTF specifiers + * @param paramName the parameter to query. Must be:
{@link #ALC_HRTF_SPECIFIER_SOFT HRTF_SPECIFIER_SOFT}
+ * @param index an index between 0 (inclusive) and the previously-queried HRTF count (exclusive) + */ + @Nullable + @NativeType("ALCchar const *") + public static String alcGetStringiSOFT(@NativeType("ALCdevice *") long device, @NativeType("ALCenum") int paramName, @NativeType("ALCsizei") int index) { + long __result = nalcGetStringiSOFT(device, paramName, index); + return memUTF8Safe(__result); + } + + // --- [ alcResetDeviceSOFT ] --- + + /** Unsafe version of: {@link #alcResetDeviceSOFT ResetDeviceSOFT} */ + public static boolean nalcResetDeviceSOFT(long device, long attrList) { + long __functionAddress = ALC.getICD().alcResetDeviceSOFT; + if (CHECKS) { + check(__functionAddress); + check(device); + } + return invokePPZ(device, attrList, __functionAddress); + } + + /** + * Resets a device after it is opened for playback, to attempt changing the playback properties. + * + * @param device a handle to a valid playback device as returned by {@link ALC10#alcOpenDevice OpenDevice}, otherwise the call fails and an {@link ALC10#ALC_INVALID_DEVICE INVALID_DEVICE} error is generated + * @param attrList the same as what could be passed to {@link ALC10#alcCreateContext CreateContext}. The AL is allowed to ignore attributes and attribute value combinations the device + * cannot support, for example if the device doesn't support the requested {@link ALC10#ALC_FREQUENCY FREQUENCY} value, another value it does support may be set. + * + * @return on success the function returns {@link ALC10#ALC_TRUE TRUE}, and on failure the function returns {@link ALC10#ALC_FALSE FALSE}. Note that a return of {@link ALC10#ALC_TRUE TRUE} does not + * indicate any attributes were honored, just that the device was successfully reset. If you need to know what the attributes are after a reset, query the + * device using {@link ALC10#alcGetIntegerv GetIntegerv} with the relevant attributes. + */ + @NativeType("ALCboolean") + public static boolean alcResetDeviceSOFT(@NativeType("ALCdevice *") long device, @Nullable @NativeType("ALCint const *") IntBuffer attrList) { + if (CHECKS) { + checkNTSafe(attrList); + } + return nalcResetDeviceSOFT(device, memAddressSafe(attrList)); + } + + /** Array version of: {@link #alcResetDeviceSOFT ResetDeviceSOFT} */ + @NativeType("ALCboolean") + public static boolean alcResetDeviceSOFT(@NativeType("ALCdevice *") long device, @Nullable @NativeType("ALCint const *") int[] attrList) { + long __functionAddress = ALC.getICD().alcResetDeviceSOFT; + if (CHECKS) { + check(__functionAddress); + check(device); + checkNTSafe(attrList); + } + return invokePPZ(device, attrList, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTLoopPoints.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTLoopPoints.java new file mode 100644 index 00000000..d88ddb23 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTLoopPoints.java @@ -0,0 +1,21 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** + * Native bindings to the SOFT_loop_points extension. + * + *

This extension allows an application to specify the offsets at which a buffer loops. Unextended OpenAL only allows for a source to loop a whole buffer, + * or all buffers of a queue, which is not desirable for sounds that may want a lead-in or lead-out along with the looping portion.

+ */ +public final class SOFTLoopPoints { + + /** Accepted by the {@code paramName} parameter of {@link AL11#alBufferiv Bufferiv} and {@link AL11#alGetBufferiv GetBufferiv}. */ + public static final int AL_LOOP_POINTS_SOFT = 0x2015; + + private SOFTLoopPoints() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTLoopback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTLoopback.java new file mode 100644 index 00000000..6e6062f5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTLoopback.java @@ -0,0 +1,244 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the SOFT_loopback extension. + * + *

This extension allows an application to read back OpenAL's rendered audio instead of having it output to an audio device on the system. Unextended + * OpenAL will output audio to an audio device, with no mechanism to allow an application to divert the audio somewhere else.

+ */ +public class SOFTLoopback { + + /** Accepted by the {@code type} parameter of {@link #alcIsRenderFormatSupportedSOFT IsRenderFormatSupportedSOFT}. */ + public static final int + ALC_BYTE_SOFT = 0x1400, + ALC_UNSIGNED_BYTE_SOFT = 0x1401, + ALC_SHORT_SOFT = 0x1402, + ALC_UNSIGNED_SHORT_SOFT = 0x1403, + ALC_INT_SOFT = 0x1404, + ALC_UNSIGNED_INT_SOFT = 0x1405, + ALC_FLOAT_SOFT = 0x1406; + + /** Accepted by the {@code channels} parameter of {@link #alcIsRenderFormatSupportedSOFT IsRenderFormatSupportedSOFT}. */ + public static final int + ALC_MONO_SOFT = 0x1500, + ALC_STEREO_SOFT = 0x1501, + ALC_QUAD_SOFT = 0x1503, + ALC_5POINT1_SOFT = 0x1504, + ALC_6POINT1_SOFT = 0x1505, + ALC_7POINT1_SOFT = 0x1506; + + /** Accepted as part of the {@code attrList} parameter of {@link ALC10#alcCreateContext CreateContext}. */ + public static final int + ALC_FORMAT_CHANNELS_SOFT = 0x1990, + ALC_FORMAT_TYPE_SOFT = 0x1991; + + protected SOFTLoopback() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(ALCCapabilities caps) { + return checkFunctions( + caps.alcLoopbackOpenDeviceSOFT, caps.alcIsRenderFormatSupportedSOFT, caps.alcRenderSamplesSOFT + ); + } + + // --- [ alcLoopbackOpenDeviceSOFT ] --- + + /** Unsafe version of: {@link #alcLoopbackOpenDeviceSOFT LoopbackOpenDeviceSOFT} */ + public static long nalcLoopbackOpenDeviceSOFT(long deviceName) { + long __functionAddress = ALC.getICD().alcLoopbackOpenDeviceSOFT; + if (CHECKS) { + check(__functionAddress); + } + return invokePP(deviceName, __functionAddress); + } + + /** + * Loopback devices provide a way for applications to "read back" rendered audio without it being sent to an actual audio device. It allows applications to + * render audio as fast or slow as it needs, making it suitable for non-real-time rendering, and so it can be passed to an audio codec or something for + * further processing. + * + *

To open a loopback device, use this function.

+ * + *

A loopback device behaves largely the same as a playback device. You may query playback state and error codes, and create contexts, which can then be + * set as current to generate sources and buffers like normal.

+ * + *

Note that loopback devices do not have either the {@link ALC10#ALC_SYNC SYNC} or {@link ALC10#ALC_REFRESH REFRESH} attributes. Attempting to query them will result in an {@link ALC10#ALC_INVALID_ENUM INVALID_ENUM} + * error.

+ * + * @param deviceName which device or device driver to use for subsequent rendering. This may be {@code NULL} for an implementation-defined default, otherwise it must be a + * valid name returned by enumeration (and further must be a device capable of loopback rendering). + */ + @NativeType("ALCdevice *") + public static long alcLoopbackOpenDeviceSOFT(@Nullable @NativeType("ALCchar const *") ByteBuffer deviceName) { + if (CHECKS) { + checkNT1Safe(deviceName); + } + return nalcLoopbackOpenDeviceSOFT(memAddressSafe(deviceName)); + } + + /** + * Loopback devices provide a way for applications to "read back" rendered audio without it being sent to an actual audio device. It allows applications to + * render audio as fast or slow as it needs, making it suitable for non-real-time rendering, and so it can be passed to an audio codec or something for + * further processing. + * + *

To open a loopback device, use this function.

+ * + *

A loopback device behaves largely the same as a playback device. You may query playback state and error codes, and create contexts, which can then be + * set as current to generate sources and buffers like normal.

+ * + *

Note that loopback devices do not have either the {@link ALC10#ALC_SYNC SYNC} or {@link ALC10#ALC_REFRESH REFRESH} attributes. Attempting to query them will result in an {@link ALC10#ALC_INVALID_ENUM INVALID_ENUM} + * error.

+ * + * @param deviceName which device or device driver to use for subsequent rendering. This may be {@code NULL} for an implementation-defined default, otherwise it must be a + * valid name returned by enumeration (and further must be a device capable of loopback rendering). + */ + @NativeType("ALCdevice *") + public static long alcLoopbackOpenDeviceSOFT(@Nullable @NativeType("ALCchar const *") CharSequence deviceName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8Safe(deviceName, true); + long deviceNameEncoded = deviceName == null ? NULL : stack.getPointerAddress(); + return nalcLoopbackOpenDeviceSOFT(deviceNameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alcIsRenderFormatSupportedSOFT ] --- + + /** + * When creating contexts, the attribute list must specify the format used for rendering. This is done with the {@link #ALC_FORMAT_CHANNELS_SOFT FORMAT_CHANNELS_SOFT}, {@link #ALC_FORMAT_TYPE_SOFT FORMAT_TYPE_SOFT}, + * and {@link ALC10#ALC_FREQUENCY FREQUENCY} attributes. This controls the format of the audio subsequently rendered by the device. + * + *

To check if a particular rendering format is available, use this function.

+ * + * @param device the loopback device to query + * @param frequency the sample rate of the rendered audio + * @param channels the channel configuration used for rendering. One of:
{@link #ALC_MONO_SOFT MONO_SOFT}{@link #ALC_STEREO_SOFT STEREO_SOFT}{@link #ALC_QUAD_SOFT QUAD_SOFT}{@link #ALC_5POINT1_SOFT 5POINT1_SOFT}{@link #ALC_6POINT1_SOFT 6POINT1_SOFT}{@link #ALC_7POINT1_SOFT 7POINT1_SOFT}
+ * @param type sample type of the written audio. One of:
{@link #ALC_BYTE_SOFT BYTE_SOFT}{@link #ALC_UNSIGNED_BYTE_SOFT UNSIGNED_BYTE_SOFT}{@link #ALC_SHORT_SOFT SHORT_SOFT}{@link #ALC_UNSIGNED_SHORT_SOFT UNSIGNED_SHORT_SOFT}{@link #ALC_INT_SOFT INT_SOFT}{@link #ALC_UNSIGNED_INT_SOFT UNSIGNED_INT_SOFT}
{@link #ALC_FLOAT_SOFT FLOAT_SOFT}
+ */ + @NativeType("ALCboolean") + public static boolean alcIsRenderFormatSupportedSOFT(@NativeType("ALCdevice *") long device, @NativeType("ALCsizei") int frequency, @NativeType("ALCenum") int channels, @NativeType("ALCenum") int type) { + long __functionAddress = ALC.getICD().alcIsRenderFormatSupportedSOFT; + if (CHECKS) { + check(__functionAddress); + check(device); + } + return invokePZ(device, frequency, channels, type, __functionAddress); + } + + // --- [ alcRenderSamplesSOFT ] --- + + /** Unsafe version of: {@link #alcRenderSamplesSOFT RenderSamplesSOFT} */ + public static void nalcRenderSamplesSOFT(long device, long buffer, int samples) { + long __functionAddress = ALC.getICD().alcRenderSamplesSOFT; + if (CHECKS) { + check(__functionAddress); + check(device); + } + invokePPV(device, buffer, samples, __functionAddress); + } + + /** + * The state of various objects on loopback devices (including processed buffers and source offsets) is processed only when new samples are rendered. To + * render samples, use this function. + * + * @param device the loopback device which samples are rendered from, using its contexts and associated buffers and sources + * @param buffer the buffer that will receive the samples. It must be big enough to contain at least {@code samples} sample frames. + * @param samples the number of sample frames to render + */ + @NativeType("ALCvoid") + public static void alcRenderSamplesSOFT(@NativeType("ALCdevice *") long device, @NativeType("ALCvoid *") ByteBuffer buffer, @NativeType("ALCsizei") int samples) { + nalcRenderSamplesSOFT(device, memAddress(buffer), samples); + } + + /** + * The state of various objects on loopback devices (including processed buffers and source offsets) is processed only when new samples are rendered. To + * render samples, use this function. + * + * @param device the loopback device which samples are rendered from, using its contexts and associated buffers and sources + * @param buffer the buffer that will receive the samples. It must be big enough to contain at least {@code samples} sample frames. + * @param samples the number of sample frames to render + */ + @NativeType("ALCvoid") + public static void alcRenderSamplesSOFT(@NativeType("ALCdevice *") long device, @NativeType("ALCvoid *") ShortBuffer buffer, @NativeType("ALCsizei") int samples) { + nalcRenderSamplesSOFT(device, memAddress(buffer), samples); + } + + /** + * The state of various objects on loopback devices (including processed buffers and source offsets) is processed only when new samples are rendered. To + * render samples, use this function. + * + * @param device the loopback device which samples are rendered from, using its contexts and associated buffers and sources + * @param buffer the buffer that will receive the samples. It must be big enough to contain at least {@code samples} sample frames. + * @param samples the number of sample frames to render + */ + @NativeType("ALCvoid") + public static void alcRenderSamplesSOFT(@NativeType("ALCdevice *") long device, @NativeType("ALCvoid *") IntBuffer buffer, @NativeType("ALCsizei") int samples) { + nalcRenderSamplesSOFT(device, memAddress(buffer), samples); + } + + /** + * The state of various objects on loopback devices (including processed buffers and source offsets) is processed only when new samples are rendered. To + * render samples, use this function. + * + * @param device the loopback device which samples are rendered from, using its contexts and associated buffers and sources + * @param buffer the buffer that will receive the samples. It must be big enough to contain at least {@code samples} sample frames. + * @param samples the number of sample frames to render + */ + @NativeType("ALCvoid") + public static void alcRenderSamplesSOFT(@NativeType("ALCdevice *") long device, @NativeType("ALCvoid *") FloatBuffer buffer, @NativeType("ALCsizei") int samples) { + nalcRenderSamplesSOFT(device, memAddress(buffer), samples); + } + + /** Array version of: {@link #alcRenderSamplesSOFT RenderSamplesSOFT} */ + @NativeType("ALCvoid") + public static void alcRenderSamplesSOFT(@NativeType("ALCdevice *") long device, @NativeType("ALCvoid *") short[] buffer, @NativeType("ALCsizei") int samples) { + long __functionAddress = ALC.getICD().alcRenderSamplesSOFT; + if (CHECKS) { + check(__functionAddress); + check(device); + } + invokePPV(device, buffer, samples, __functionAddress); + } + + /** Array version of: {@link #alcRenderSamplesSOFT RenderSamplesSOFT} */ + @NativeType("ALCvoid") + public static void alcRenderSamplesSOFT(@NativeType("ALCdevice *") long device, @NativeType("ALCvoid *") int[] buffer, @NativeType("ALCsizei") int samples) { + long __functionAddress = ALC.getICD().alcRenderSamplesSOFT; + if (CHECKS) { + check(__functionAddress); + check(device); + } + invokePPV(device, buffer, samples, __functionAddress); + } + + /** Array version of: {@link #alcRenderSamplesSOFT RenderSamplesSOFT} */ + @NativeType("ALCvoid") + public static void alcRenderSamplesSOFT(@NativeType("ALCdevice *") long device, @NativeType("ALCvoid *") float[] buffer, @NativeType("ALCsizei") int samples) { + long __functionAddress = ALC.getICD().alcRenderSamplesSOFT; + if (CHECKS) { + check(__functionAddress); + check(device); + } + invokePPV(device, buffer, samples, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTMSADPCM.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTMSADPCM.java new file mode 100644 index 00000000..e2f814bb --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTMSADPCM.java @@ -0,0 +1,22 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** + * Native bindings to the SOFT_MSADPCM extension. + * + *

This extension adds support for MSADPCM compressed sample formats.

+ */ +public final class SOFTMSADPCM { + + /** Accepted by the {@code format} parameter of {@link AL10#alBufferData BufferData}. */ + public static final int + AL_FORMAT_MONO_MSADPCM_SOFT = 0x1302, + AL_FORMAT_STEREO_MSADPCM_SOFT = 0x1303; + + private SOFTMSADPCM() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTOutputLimiter.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTOutputLimiter.java new file mode 100644 index 00000000..7bf78b70 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTOutputLimiter.java @@ -0,0 +1,21 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** + * Native bindings to the SOFT_output_limiter extension. + * + *

This extension allows an application to control OpenAL Soft's output limiter. OpenAL Soft 1.18 adds an output limiter to prevent excessive clipping on + * the output, and this extension allows applications to turn it off or on.

+ */ +public final class SOFTOutputLimiter { + + /** Accepted as part of the {@code attrList} parameter of {@link ALC10#alcCreateContext CreateContext} and {@link SOFTHRTF#alcResetDeviceSOFT ResetDeviceSOFT}, and as the {@code paramName} parameter of {@link AL10#alGetIntegerv GetIntegerv}. */ + public static final int ALC_OUTPUT_LIMITER_SOFT = 0x199A; + + private SOFTOutputLimiter() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTPauseDevice.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTPauseDevice.java new file mode 100644 index 00000000..1eee97f5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTPauseDevice.java @@ -0,0 +1,75 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; + +/** + * Native bindings to the SOFT_pause_device extension. + * + *

This extension allows applications to pause a playback device. The main purpose of this is to silence output, stop processing, and allow the audio + * hardware to go into a low-power mode. On a mobile device, for instance, apps may want to silence output and not waste battery life with unneeded + * processing when in the background.

+ */ +public class SOFTPauseDevice { + + protected SOFTPauseDevice() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(ALCCapabilities caps) { + return checkFunctions( + caps.alcDevicePauseSOFT, caps.alcDeviceResumeSOFT + ); + } + + // --- [ alcDevicePauseSOFT ] --- + + /** + * Pauses a playback device. + * + *

When paused, no contexts associated with the device will be processed or updated. Playing sources will not produce sound, have their offsets + * incremented, or process any more buffers, until the device is resumed. Pausing a device that is already paused is a legal no-op.

+ * + * @param device the device to pause + */ + @NativeType("ALCvoid") + public static void alcDevicePauseSOFT(@NativeType("ALCdevice *") long device) { + long __functionAddress = ALC.getICD().alcDevicePauseSOFT; + if (CHECKS) { + check(__functionAddress); + check(device); + } + invokePV(device, __functionAddress); + } + + // --- [ alcDeviceResumeSOFT ] --- + + /** + * Resumes playback of a paused device. + * + *

This will restart processing on the device -- sources will resume playing sound as normal. Resuming playback on a device that is not paused is a legal + * no-op.

+ * + *

These functions are not reference counted. alcDeviceResumeSOFT only needs to be called once to resume playback, regardless of how many times + * {@link #alcDevicePauseSOFT DevicePauseSOFT} was called.

+ * + * @param device the device to resume + */ + @NativeType("ALCvoid") + public static void alcDeviceResumeSOFT(@NativeType("ALCdevice *") long device) { + long __functionAddress = ALC.getICD().alcDeviceResumeSOFT; + if (CHECKS) { + check(__functionAddress); + check(device); + } + invokePV(device, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTSourceLatency.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTSourceLatency.java new file mode 100644 index 00000000..73fbc5e5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTSourceLatency.java @@ -0,0 +1,497 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the SOFT_source_latency extension. + * + *

This extension provides a method for applications to more accurately measure the playback latency of sources. Unextended OpenAL allows apps to retrieve + * a source's playback offset in bytes, samples, or seconds, but this is (typically) where the AL is processing the audio data.

+ * + *

Often, more processing is done outside of the AL. Audio servers are common and they can introduce a bit of latency, increasing the time between when the + * AL is done with a piece of audio data until it gets heard by the user. If the OpenAL implementation uses its own mixer, that can also add to the + * latency. This can ultimately cause a not-insignificant delay between where the AL is processing and what is actually being heard.

+ * + *

Although this delay may not be very noticeable for general gaming, if the app is trying to keep a video or animation syncronized with the playback of an + * OpenAL source this extra delay can cause the audio and video to appear of out sync.

+ * + *

Luckily, most audio systems have a way of measuring the latency it takes for sound to actually get to the physical output device (the DAC or speakers). + * By providing this information through the AL, an application can more accurately tell what a user is hearing and thus synchronize better with the audio + * output.

+ */ +public class SOFTSourceLatency { + + /** + * The playback position, expressed in fixed-point samples, along with the playback latency, expressed in nanoseconds (1/1000000000ths of a second). This + * attribute is read-only. + * + *

The first value in the returned vector is the sample offset, which is a 32.32 fixed-point value. The whole number is stored in the upper 32 bits and + * the fractional component is in the lower 32 bits. The value is similar to that returned by {@link AL11#AL_SAMPLE_OFFSET SAMPLE_OFFSET}, just with more precision.

+ * + *

The second value is the latency, in nanoseconds. It represents the length of time it will take for the audio at the current offset to actually reach + * the speakers or DAC. This value should be considered volatile, as it may change very often during playback (it can depend on a number of factors, + * including how full the mixing buffer OpenAL may be using is timer jitter, or other changes deeper in the audio pipeline).

+ * + *

The retrieved offset and latency should be considered atomic, with respect to one another. This means the returned latency was measured exactly when + * the source was at the returned offset.

+ */ + public static final int AL_SAMPLE_OFFSET_LATENCY_SOFT = 0x1200; + + /** + * The playback position, along with the playback latency, both expressed in seconds. This attribute is read-only. + * + *

The first value in the returned vector is the offset in seconds. The value is similar to that returned by {@link AL11#AL_SEC_OFFSET SEC_OFFSET}, just with more precision.

+ * + *

The second value is the latency, in seconds. It represents the length of time it will take for the audio at the current offset to actually reach the + * speakers or DAC. This value should be considered volatile, as it may change very often during playback (it can depend on a number of factors, including + * how full the mixing buffer OpenAL may be using is, timer jitter, or other changes deeper in the audio pipeline).

+ * + *

The retrieved offset and latency should be considered atomic with respect to one another. This means the returned latency was measured exactly when the + * source was at the returned offset.

+ */ + public static final int AL_SEC_OFFSET_LATENCY_SOFT = 0x1201; + + protected SOFTSourceLatency() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(ALCapabilities caps) { + return checkFunctions( + caps.alSourcedSOFT, caps.alSource3dSOFT, caps.alSourcedvSOFT, caps.alGetSourcedSOFT, caps.alGetSource3dSOFT, caps.alGetSourcedvSOFT, + caps.alSourcei64SOFT, caps.alSource3i64SOFT, caps.alSourcei64vSOFT, caps.alGetSourcei64SOFT, caps.alGetSource3i64SOFT, caps.alGetSourcei64vSOFT + ); + } + + // --- [ alSourcedSOFT ] --- + + /** + * Sets the double value of a source parameter. + * + * @param source the source to modify + * @param param the parameter to modify + * @param value the parameter value + */ + @NativeType("ALvoid") + public static void alSourcedSOFT(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALdouble") double value) { + long __functionAddress = AL.getICD().alSourcedSOFT; + if (CHECKS) { + check(__functionAddress); + } + invokeV(source, param, value, __functionAddress); + } + + // --- [ alSource3dSOFT ] --- + + /** + * Sets the 3 dimensional double values of a source parameter. + * + * @param source the source to modify + * @param param the parameter to modify + * @param value1 the first value + * @param value2 the second value + * @param value3 the third value + */ + @NativeType("ALvoid") + public static void alSource3dSOFT(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALdouble") double value1, @NativeType("ALdouble") double value2, @NativeType("ALdouble") double value3) { + long __functionAddress = AL.getICD().alSource3dSOFT; + if (CHECKS) { + check(__functionAddress); + } + invokeV(source, param, value1, value2, value3, __functionAddress); + } + + // --- [ alSourcedvSOFT ] --- + + /** Unsafe version of: {@link #alSourcedvSOFT SourcedvSOFT} */ + public static void nalSourcedvSOFT(int source, int param, long value) { + long __functionAddress = AL.getICD().alSourcedvSOFT; + if (CHECKS) { + check(__functionAddress); + } + invokePV(source, param, value, __functionAddress); + } + + /** + * pointer version of {@link #alSourcedSOFT SourcedSOFT} + * + * @param source the source to modify + * @param param the parameter to modify + * @param value the parameter values + */ + @NativeType("ALvoid") + public static void alSourcedvSOFT(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALdouble const *") DoubleBuffer value) { + if (CHECKS) { + check(value, 1); + } + nalSourcedvSOFT(source, param, memAddress(value)); + } + + // --- [ alGetSourcedSOFT ] --- + + /** Unsafe version of: {@link #alGetSourcedSOFT GetSourcedSOFT} */ + public static void nalGetSourcedSOFT(int source, int param, long value) { + long __functionAddress = AL.getICD().alGetSourcedSOFT; + if (CHECKS) { + check(__functionAddress); + } + invokePV(source, param, value, __functionAddress); + } + + /** + * Gets the double value of a source parameter. + * + * @param source the source to query + * @param param the parameter to query + * @param value the parameter values + */ + @NativeType("ALvoid") + public static void alGetSourcedSOFT(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALdouble *") DoubleBuffer value) { + if (CHECKS) { + check(value, 1); + } + nalGetSourcedSOFT(source, param, memAddress(value)); + } + + /** + * Gets the double value of a source parameter. + * + * @param source the source to query + * @param param the parameter to query + */ + @NativeType("ALvoid") + public static double alGetSourcedSOFT(@NativeType("ALuint") int source, @NativeType("ALenum") int param) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + DoubleBuffer value = stack.callocDouble(1); + nalGetSourcedSOFT(source, param, memAddress(value)); + return value.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alGetSource3dSOFT ] --- + + /** Unsafe version of: {@link #alGetSource3dSOFT GetSource3dSOFT} */ + public static void nalGetSource3dSOFT(int source, int param, long value1, long value2, long value3) { + long __functionAddress = AL.getICD().alGetSource3dSOFT; + if (CHECKS) { + check(__functionAddress); + } + invokePPPV(source, param, value1, value2, value3, __functionAddress); + } + + /** + * Gets the 3 dimensional double values of a source parameter. + * + * @param source the source to query + * @param param the parameter to query + * @param value1 the first value + * @param value2 the second value + * @param value3 the third value + */ + @NativeType("ALvoid") + public static void alGetSource3dSOFT(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALdouble *") DoubleBuffer value1, @NativeType("ALdouble *") DoubleBuffer value2, @NativeType("ALdouble *") DoubleBuffer value3) { + if (CHECKS) { + check(value1, 1); + check(value2, 1); + check(value3, 1); + } + nalGetSource3dSOFT(source, param, memAddress(value1), memAddress(value2), memAddress(value3)); + } + + // --- [ alGetSourcedvSOFT ] --- + + /** Unsafe version of: {@link #alGetSourcedvSOFT GetSourcedvSOFT} */ + public static void nalGetSourcedvSOFT(int source, int param, long values) { + long __functionAddress = AL.getICD().alGetSourcedvSOFT; + if (CHECKS) { + check(__functionAddress); + } + invokePV(source, param, values, __functionAddress); + } + + /** + * Array version of {@link #alGetSourcedSOFT GetSourcedSOFT} + * + * @param source the source to query + * @param param the parameter to query + * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alGetSourcedvSOFT(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALdouble *") DoubleBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalGetSourcedvSOFT(source, param, memAddress(values)); + } + + // --- [ alSourcei64SOFT ] --- + + /** + * Sets the 64 bit integer value of a source parameter. + * + * @param source the source to modify + * @param param the parameter to modify + * @param value the parameter values + */ + @NativeType("ALvoid") + public static void alSourcei64SOFT(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALint64SOFT") long value) { + long __functionAddress = AL.getICD().alSourcei64SOFT; + if (CHECKS) { + check(__functionAddress); + } + invokeJV(source, param, value, __functionAddress); + } + + // --- [ alSource3i64SOFT ] --- + + /** + * Sets the 3 dimensional 64 bit integer values of a source parameter. + * + * @param source the source to modify + * @param param the parameter to modify + * @param value1 the first value + * @param value2 the second value + * @param value3 the third value + */ + @NativeType("ALvoid") + public static void alSource3i64SOFT(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALint64SOFT") long value1, @NativeType("ALint64SOFT") long value2, @NativeType("ALint64SOFT") long value3) { + long __functionAddress = AL.getICD().alSource3i64SOFT; + if (CHECKS) { + check(__functionAddress); + } + invokeJJJV(source, param, value1, value2, value3, __functionAddress); + } + + // --- [ alSourcei64vSOFT ] --- + + /** Unsafe version of: {@link #alSourcei64vSOFT Sourcei64vSOFT} */ + public static void nalSourcei64vSOFT(int source, int param, long values) { + long __functionAddress = AL.getICD().alSourcei64vSOFT; + if (CHECKS) { + check(__functionAddress); + } + invokePV(source, param, values, __functionAddress); + } + + /** + * Array version of {@link #alSourcei64SOFT Sourcei64SOFT} + * + * @param source the source to modify + * @param param the parameter to modify + * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alSourcei64vSOFT(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALint64SOFT const *") LongBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalSourcei64vSOFT(source, param, memAddress(values)); + } + + // --- [ alGetSourcei64SOFT ] --- + + /** Unsafe version of: {@link #alGetSourcei64SOFT GetSourcei64SOFT} */ + public static void nalGetSourcei64SOFT(int source, int param, long value) { + long __functionAddress = AL.getICD().alGetSourcei64SOFT; + if (CHECKS) { + check(__functionAddress); + } + invokePV(source, param, value, __functionAddress); + } + + /** + * Gets the 64 bit integer value of a source parameter. + * + * @param source the source to query + * @param param the parameter to query + * @param value the parameter values + */ + @NativeType("ALvoid") + public static void alGetSourcei64SOFT(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALint64SOFT *") LongBuffer value) { + if (CHECKS) { + check(value, 1); + } + nalGetSourcei64SOFT(source, param, memAddress(value)); + } + + /** + * Gets the 64 bit integer value of a source parameter. + * + * @param source the source to query + * @param param the parameter to query + */ + @NativeType("ALvoid") + public static long alGetSourcei64SOFT(@NativeType("ALuint") int source, @NativeType("ALenum") int param) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer value = stack.callocLong(1); + nalGetSourcei64SOFT(source, param, memAddress(value)); + return value.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ alGetSource3i64SOFT ] --- + + /** Unsafe version of: {@link #alGetSource3i64SOFT GetSource3i64SOFT} */ + public static void nalGetSource3i64SOFT(int source, int param, long value1, long value2, long value3) { + long __functionAddress = AL.getICD().alGetSource3i64SOFT; + if (CHECKS) { + check(__functionAddress); + } + invokePPPV(source, param, value1, value2, value3, __functionAddress); + } + + /** + * Gets the 3 dimensional 64 bit integer values of a source parameter. + * + * @param source the source to query + * @param param the parameter to query + * @param value1 the first value + * @param value2 the second value + * @param value3 the third value + */ + @NativeType("ALvoid") + public static void alGetSource3i64SOFT(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALint64SOFT *") LongBuffer value1, @NativeType("ALint64SOFT *") LongBuffer value2, @NativeType("ALint64SOFT *") LongBuffer value3) { + if (CHECKS) { + check(value1, 1); + check(value2, 1); + check(value3, 1); + } + nalGetSource3i64SOFT(source, param, memAddress(value1), memAddress(value2), memAddress(value3)); + } + + // --- [ alGetSourcei64vSOFT ] --- + + /** Unsafe version of: {@link #alGetSourcei64vSOFT GetSourcei64vSOFT} */ + public static void nalGetSourcei64vSOFT(int source, int param, long values) { + long __functionAddress = AL.getICD().alGetSourcei64vSOFT; + if (CHECKS) { + check(__functionAddress); + } + invokePV(source, param, values, __functionAddress); + } + + /** + * Array version of {@link #alGetSourcei64SOFT GetSourcei64SOFT} + * + * @param source the source to query + * @param param the parameter to query + * @param values the parameter values + */ + @NativeType("ALvoid") + public static void alGetSourcei64vSOFT(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALint64SOFT *") LongBuffer values) { + if (CHECKS) { + check(values, 1); + } + nalGetSourcei64vSOFT(source, param, memAddress(values)); + } + + /** Array version of: {@link #alSourcedvSOFT SourcedvSOFT} */ + @NativeType("ALvoid") + public static void alSourcedvSOFT(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALdouble const *") double[] value) { + long __functionAddress = AL.getICD().alSourcedvSOFT; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + invokePV(source, param, value, __functionAddress); + } + + /** Array version of: {@link #alGetSourcedSOFT GetSourcedSOFT} */ + @NativeType("ALvoid") + public static void alGetSourcedSOFT(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALdouble *") double[] value) { + long __functionAddress = AL.getICD().alGetSourcedSOFT; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + invokePV(source, param, value, __functionAddress); + } + + /** Array version of: {@link #alGetSource3dSOFT GetSource3dSOFT} */ + @NativeType("ALvoid") + public static void alGetSource3dSOFT(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALdouble *") double[] value1, @NativeType("ALdouble *") double[] value2, @NativeType("ALdouble *") double[] value3) { + long __functionAddress = AL.getICD().alGetSource3dSOFT; + if (CHECKS) { + check(__functionAddress); + check(value1, 1); + check(value2, 1); + check(value3, 1); + } + invokePPPV(source, param, value1, value2, value3, __functionAddress); + } + + /** Array version of: {@link #alGetSourcedvSOFT GetSourcedvSOFT} */ + @NativeType("ALvoid") + public static void alGetSourcedvSOFT(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALdouble *") double[] values) { + long __functionAddress = AL.getICD().alGetSourcedvSOFT; + if (CHECKS) { + check(__functionAddress); + check(values, 1); + } + invokePV(source, param, values, __functionAddress); + } + + /** Array version of: {@link #alSourcei64vSOFT Sourcei64vSOFT} */ + @NativeType("ALvoid") + public static void alSourcei64vSOFT(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALint64SOFT const *") long[] values) { + long __functionAddress = AL.getICD().alSourcei64vSOFT; + if (CHECKS) { + check(__functionAddress); + check(values, 1); + } + invokePV(source, param, values, __functionAddress); + } + + /** Array version of: {@link #alGetSourcei64SOFT GetSourcei64SOFT} */ + @NativeType("ALvoid") + public static void alGetSourcei64SOFT(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALint64SOFT *") long[] value) { + long __functionAddress = AL.getICD().alGetSourcei64SOFT; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + invokePV(source, param, value, __functionAddress); + } + + /** Array version of: {@link #alGetSource3i64SOFT GetSource3i64SOFT} */ + @NativeType("ALvoid") + public static void alGetSource3i64SOFT(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALint64SOFT *") long[] value1, @NativeType("ALint64SOFT *") long[] value2, @NativeType("ALint64SOFT *") long[] value3) { + long __functionAddress = AL.getICD().alGetSource3i64SOFT; + if (CHECKS) { + check(__functionAddress); + check(value1, 1); + check(value2, 1); + check(value3, 1); + } + invokePPPV(source, param, value1, value2, value3, __functionAddress); + } + + /** Array version of: {@link #alGetSourcei64vSOFT GetSourcei64vSOFT} */ + @NativeType("ALvoid") + public static void alGetSourcei64vSOFT(@NativeType("ALuint") int source, @NativeType("ALenum") int param, @NativeType("ALint64SOFT *") long[] values) { + long __functionAddress = AL.getICD().alGetSourcei64vSOFT; + if (CHECKS) { + check(__functionAddress); + check(values, 1); + } + invokePV(source, param, values, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTSourceLength.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTSourceLength.java new file mode 100644 index 00000000..652b176d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTSourceLength.java @@ -0,0 +1,30 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** + * Native bindings to the SOFT_source_length extension. + * + *

This extension adds a method to retrieve the total length of a source's buffer data in bytes, samples, and seconds, which correspond to the byte, + * sample, and seconds offset extents. By default, OpenAL only provides a way to retrieve a buffer's storage size in bytes, which does not necessarily + * represent the data size given to alBufferData nor the byte offset extent for the source's {@link AL11#AL_BYTE_OFFSET BYTE_OFFSET} property. The + * {@code AL_SOFT_buffer_samples} extension allows an application to query a buffer for its length in bytes, samples, and seconds, but this is only for a + * single buffer; a buffer queue on a source still requires additional bookkeeping by the application to keep track of the length of each buffer being + * queued and unqueued on a given source. This extension aims to ease that and provide a simple query.

+ */ +public final class SOFTSourceLength { + + /** Accepted by the {@code paramName} parameter of {@link AL10#alGetSourcei GetSourcei} and {@link AL10#alGetSourceiv GetSourceiv} (these are the same as in AL_SOFT_buffer_samples). */ + public static final int + AL_BYTE_LENGTH_SOFT = 0x2009, + AL_SAMPLE_LENGTH_SOFT = 0x200A; + + /** Accepted by the {@code paramName} parameter of {@link AL10#alGetSourcef GetSourcef} and {@link AL10#alGetSourcefv GetSourcefv} (these are the same as in AL_SOFT_buffer_samples). */ + public static final int AL_SEC_LENGTH_SOFT = 0x200B; + + private SOFTSourceLength() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTSourceResampler.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTSourceResampler.java new file mode 100644 index 00000000..2a639e93 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTSourceResampler.java @@ -0,0 +1,64 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the SOFT_source_resampler extension. + * + *

This extension provides a method for applications to use different resamplers for sources. OpenAL automatically resamples when playing a source at a + * sample rate that don't match the device's sample rate, but the resampling method is left unspecified. One could assume it would use the "best" resample + * method available, but this gives no clear information about what's used nor any way to choose between quality or performance. Further, some + * applications may prefer lower quality resamplers for its spectral properties.

+ */ +public class SOFTSourceResampler { + + /** Accepted as the {@code pname} parameter of {@link AL10#alGetInteger GetInteger} and {@link AL10#alGetIntegerv GetIntegerv}. */ + public static final int + AL_NUM_RESAMPLERS_SOFT = 0x1210, + AL_DEFAULT_RESAMPLER_SOFT = 0x1211; + + /** Accepted as the {@code param} parameter of {@link AL10#alSourcei Sourcei}, {@link AL11#alSourceiv Sourceiv}, {@link AL10#alGetSourcei GetSourcei}, and {@link AL10#alGetSourceiv GetSourceiv}. */ + public static final int AL_SOURCE_RESAMPLER_SOFT = 0x1212; + + /** Accepted as the {@code pname} parameter of {@link #alGetStringiSOFT GetStringiSOFT}. */ + public static final int AL_RESAMPLER_NAME_SOFT = 0x1213; + + protected SOFTSourceResampler() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(ALCapabilities caps) { + return checkFunctions( + caps.alGetStringiSOFT + ); + } + + // --- [ alGetStringiSOFT ] --- + + public static long nalGetStringiSOFT(int pname, int index) { + long __functionAddress = AL.getICD().alGetStringiSOFT; + if (CHECKS) { + check(__functionAddress); + } + return invokeP(pname, index, __functionAddress); + } + + @Nullable + @NativeType("ALchar const *") + public static String alGetStringiSOFT(@NativeType("ALenum") int pname, @NativeType("ALsizei") int index) { + long __result = nalGetStringiSOFT(pname, index); + return memUTF8Safe(__result); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTSourceSpatialize.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTSourceSpatialize.java new file mode 100644 index 00000000..3af39304 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/SOFTSourceSpatialize.java @@ -0,0 +1,25 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.openal; + +/** + * Native bindings to the SOFT_source_spatialize extension. + * + *

This extension provides more control over the spatialization behavior of sources. By default, OpenAL will spatialize sources playing a mono buffer and + * not spatialize sources playing a multi-channel buffer. Spatialization features include positional panning, distance attenuation, cone-related + * attenuation, and doppler effects. This extension allows such features to be enabled and disabled per-source independently of the buffer format.

+ */ +public final class SOFTSourceSpatialize { + + /** Accepted as the {@code param} parameter of {@link AL10#alSourcei Sourcei}, {@link AL11#alSourceiv Sourceiv}, {@link AL10#alGetSourcei GetSourcei}, and {@link AL10#alGetSourceiv GetSourceiv}. */ + public static final int AL_SOURCE_SPATIALIZE_SOFT = 0x1214; + + /** Accepted as the {@code value} of the {@link #AL_SOURCE_SPATIALIZE_SOFT SOURCE_SPATIALIZE_SOFT} property. */ + public static final int AL_AUTO_SOFT = 0x2; + + private SOFTSourceSpatialize() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/openal/package-info.java b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/package-info.java new file mode 100644 index 00000000..f7481c36 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/openal/package-info.java @@ -0,0 +1,21 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ + +/** + * Contains bindings to the OpenAL cross-platform 3D audio API. + * + *

LWJGL comes with a software OpenAL implementation, OpenAL Soft.

+ * + *

OpenAL Soft can be dynamically configured with environment variables. A + * very useful option for debugging is {@code ALSOFT_LOGLEVEL}; it can be set to values 0 through 4, with higher values producing more information.

+ * + *

In addition to standard OpenAL features, OpenAL Soft supports HRTF, + * Ambisonics and 3D7.1. + * Documentation for these features is available in the OpenAL Soft repository.

+ */ +@org.lwjgl.system.NonnullDefault +package org.lwjgl.openal; + diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDBlendMinmaxFactor.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDBlendMinmaxFactor.java new file mode 100644 index 00000000..795be0d7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDBlendMinmaxFactor.java @@ -0,0 +1,31 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the AMD_blend_minmax_factor extension. + * + *

The {@link EXTBlendMinmax EXT_blend_minmax} extension extended the GL's blending functionality to allow the blending equation to be specified by the application. That + * extension introduced the {@link EXTBlendMinmax#GL_MIN_EXT MIN_EXT} and {@link EXTBlendMinmax#GL_MAX_EXT MAX_EXT} blend equations, which caused the result of the blend equation to become the minimum or maximum of the + * source color and destination color, respectively.

+ * + *

The {@link EXTBlendMinmax#GL_MIN_EXT MIN_EXT} and {@link EXTBlendMinmax#GL_MAX_EXT MAX_EXT} blend equations, however, do not include the source or destination blend factors in the arguments to the min and max + * functions. This extension provides two new blend equations that produce the minimum or maximum of the products of the source color and source factor, + * and the destination color and destination factor.

+ */ +public final class AMDBlendMinmaxFactor { + + /** + * Accepted by the {@code mode} parameter of BlendEquation and BlendEquationi, and by the {@code modeRGB} and {@code modeAlpha} parameters of + * BlendEquationSeparate and BlendEquationSeparatei. + */ + public static final int + GL_FACTOR_MIN_AMD = 0x901C, + GL_FACTOR_MAX_AMD = 0x901D; + + private AMDBlendMinmaxFactor() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDDebugOutput.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDDebugOutput.java new file mode 100644 index 00000000..e24e6083 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDDebugOutput.java @@ -0,0 +1,338 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the AMD_debug_output extension. + * + *

This extension allows the GL to notify applications when various debug events occur in contexts that have been created with the debug flag, as provided + * by {@link WGLARBCreateContext WGL_ARB_create_context} and {@link GLXARBCreateContext GLX_ARB_create_context}.

+ * + *

These events are represented in the form of enumerable messages with an included human-readable translation. Examples of debug events include incorrect + * use of the GL, warnings of undefined behavior, and performance warnings.

+ * + *

A message is uniquely identified by a category and an implementation-dependent ID within that category. Message categories are general and are used to + * organize large groups of similar messages together. Examples of categories include GL errors, performance warnings, and deprecated functionality + * warnings. Each message is also assigned a severity level that denotes roughly how "important" that message is in comparison to other messages across all + * categories. For example, notification of a GL error would have a higher severity than a performance warning due to redundant state changes.

+ * + *

Messages are communicated to the application through an application-defined callback function that is called by the GL implementation on each debug + * message. The motivation for the callback routine is to free application developers from actively having to query whether any GL error or other + * debuggable event has happened after each call to a GL function. With a callback, developers can keep their code free of debug checks, and only have to + * react to messages as they occur. In order to support indirect rendering, a message log is also provided that stores copies of recent messages until they + * are actively queried.

+ * + *

To control the volume of debug output, messages can be disabled either individually by ID, or entire groups of messages can be turned off based on + * category or severity.

+ * + *

The only requirement on the minimum quantity and type of messages that implementations of this extension must support is that a message must be sent + * notifying the application whenever any GL error occurs. Any further messages are left to the implementation. Implementations do not have to output + * messages from all categories listed by this extension in order to support this extension, and new categories can be added by other extensions.

+ * + *

This extension places no restrictions or requirements on any additional functionality provided by the debug context flag through other extensions.

+ * + *

Requires {@link WGLARBCreateContext WGL_ARB_create_context} or {@link GLXARBCreateContext GLX_ARB_create_context}.

+ */ +public class AMDDebugOutput { + + /** Tokens accepted by GetIntegerv. */ + public static final int + GL_MAX_DEBUG_MESSAGE_LENGTH_AMD = 0x9143, + GL_MAX_DEBUG_LOGGED_MESSAGES_AMD = 0x9144, + GL_DEBUG_LOGGED_MESSAGES_AMD = 0x9145; + + /** Tokens accepted by DebugMessageEnableAMD, GetDebugMessageLogAMD, DebugMessageInsertAMD, and DEBUGPROCAMD callback function for {@code severity}. */ + public static final int + GL_DEBUG_SEVERITY_HIGH_AMD = 0x9146, + GL_DEBUG_SEVERITY_MEDIUM_AMD = 0x9147, + GL_DEBUG_SEVERITY_LOW_AMD = 0x9148; + + /** Tokens accepted by DebugMessageEnableAMD, GetDebugMessageLogAMD, and DEBUGPROCAMD callback function for {@code category}. */ + public static final int + GL_DEBUG_CATEGORY_API_ERROR_AMD = 0x9149, + GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD = 0x914A, + GL_DEBUG_CATEGORY_DEPRECATION_AMD = 0x914B, + GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD = 0x914C, + GL_DEBUG_CATEGORY_PERFORMANCE_AMD = 0x914D, + GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD = 0x914E, + GL_DEBUG_CATEGORY_APPLICATION_AMD = 0x914F, + GL_DEBUG_CATEGORY_OTHER_AMD = 0x9150; + + static { GL.initialize(); } + + protected AMDDebugOutput() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glDebugMessageEnableAMD, caps.glDebugMessageInsertAMD, caps.glDebugMessageCallbackAMD, caps.glGetDebugMessageLogAMD + ); + } + + // --- [ glDebugMessageEnableAMD ] --- + + /** + * Unsafe version of: {@link #glDebugMessageEnableAMD DebugMessageEnableAMD} + * + * @param count the number of values in the {@code ids} array + */ + public static native void nglDebugMessageEnableAMD(int category, int severity, int count, long ids, boolean enabled); + + /** + * Allows disabling or enabling generation of subsets of messages. If {@code enabled} is {@link GL11#GL_TRUE TRUE}, the referenced subset of messages is enabled. If + * {@link GL11#GL_FALSE FALSE}, then those messages are disabled. This command can reference different subsets of messages by varying its parameter values in the following + * ways: + * + *
    + *
  1. To reference all messages, let {@code category}, {@code severity}, and {@code count} all be zero. The value of {@code ids} is ignored in this case.
  2. + *
  3. To reference all messages across all categories with a specific severity level, let {@code category} and {@code count} be zero and let + * {@code severity} identify the severity level. The value of {@code ids} is ignored in this case.
  4. + *
  5. To reference all messages within a single category, let {@code category} identify the referenced category and let {@code severity} and {@code count} + * be zero. The value of {@code ids} is ignored in this case.
  6. + *
  7. To reference all messages within a single category and at a specific severity level, let {@code category} identify the category and {@code severity} + * identify the severity level, and let {@code count} be zero. The value of {@code ids} is ignored in this case.
  8. + *
  9. To reference specific messages by ID within a single category, let {@code category} identify the category, let {@code severity} be zero, let + * {@code count} be greater than zero and let {@code ids} identify the IDs of {@code count} messages within the identified category. Operations on + * message IDs that are not valid within the category are silently ignored.
  10. + *
+ * + *

In all of the above cases, if {@code category} is non-zero and specifies an invalid category, the error {@link GL11#GL_INVALID_ENUM INVALID_ENUM} is generated. Similarly if + * {@code severity} is non-zero and is an invalid severity level, the error {@link GL11#GL_INVALID_ENUM INVALID_ENUM} is generated. If {@code count} is less than zero, the error + * {@link GL11#GL_INVALID_VALUE INVALID_VALUE} is generated. If the parameters do not fall into one of the cases defined above, the error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} is generated. The error + * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated if this command is called in a non-debug context.

+ * + *

Although messages are grouped into categories and severities, and entire groups of messages can be turned off with a single call, there is no explicit + * per-category or per-severity enabled state. Instead the enabled state is stored individually for each message. There is no difference between disabling + * a category of messages with a single call, and enumerating all messages of that category and individually disabling each of them by their ID.

+ * + *

All messages of severity level {@link #GL_DEBUG_SEVERITY_MEDIUM_AMD DEBUG_SEVERITY_MEDIUM_AMD} and {@link #GL_DEBUG_SEVERITY_HIGH_AMD DEBUG_SEVERITY_HIGH_AMD} in all categories are initially enabled, and all messages at + * {@link #GL_DEBUG_SEVERITY_LOW_AMD DEBUG_SEVERITY_LOW_AMD} are initially disabled.

+ * + * @param category the message category. One of:
{@link #GL_DEBUG_CATEGORY_API_ERROR_AMD DEBUG_CATEGORY_API_ERROR_AMD}{@link #GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD DEBUG_CATEGORY_WINDOW_SYSTEM_AMD}
{@link #GL_DEBUG_CATEGORY_DEPRECATION_AMD DEBUG_CATEGORY_DEPRECATION_AMD}{@link #GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD}
{@link #GL_DEBUG_CATEGORY_PERFORMANCE_AMD DEBUG_CATEGORY_PERFORMANCE_AMD}{@link #GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD DEBUG_CATEGORY_SHADER_COMPILER_AMD}
{@link #GL_DEBUG_CATEGORY_APPLICATION_AMD DEBUG_CATEGORY_APPLICATION_AMD}{@link #GL_DEBUG_CATEGORY_OTHER_AMD DEBUG_CATEGORY_OTHER_AMD}
+ * @param severity the message severity. One of:
{@link #GL_DEBUG_SEVERITY_HIGH_AMD DEBUG_SEVERITY_HIGH_AMD}{@link #GL_DEBUG_SEVERITY_MEDIUM_AMD DEBUG_SEVERITY_MEDIUM_AMD}{@link #GL_DEBUG_SEVERITY_LOW_AMD DEBUG_SEVERITY_LOW_AMD}
+ * @param ids an array of message ids + * @param enabled whether to enable or disable the referenced subset of messages + */ + public static void glDebugMessageEnableAMD(@NativeType("GLenum") int category, @NativeType("GLenum") int severity, @Nullable @NativeType("GLuint const *") IntBuffer ids, @NativeType("GLboolean") boolean enabled) { + nglDebugMessageEnableAMD(category, severity, remainingSafe(ids), memAddressSafe(ids), enabled); + } + + /** + * Allows disabling or enabling generation of subsets of messages. If {@code enabled} is {@link GL11#GL_TRUE TRUE}, the referenced subset of messages is enabled. If + * {@link GL11#GL_FALSE FALSE}, then those messages are disabled. This command can reference different subsets of messages by varying its parameter values in the following + * ways: + * + *
    + *
  1. To reference all messages, let {@code category}, {@code severity}, and {@code count} all be zero. The value of {@code ids} is ignored in this case.
  2. + *
  3. To reference all messages across all categories with a specific severity level, let {@code category} and {@code count} be zero and let + * {@code severity} identify the severity level. The value of {@code ids} is ignored in this case.
  4. + *
  5. To reference all messages within a single category, let {@code category} identify the referenced category and let {@code severity} and {@code count} + * be zero. The value of {@code ids} is ignored in this case.
  6. + *
  7. To reference all messages within a single category and at a specific severity level, let {@code category} identify the category and {@code severity} + * identify the severity level, and let {@code count} be zero. The value of {@code ids} is ignored in this case.
  8. + *
  9. To reference specific messages by ID within a single category, let {@code category} identify the category, let {@code severity} be zero, let + * {@code count} be greater than zero and let {@code ids} identify the IDs of {@code count} messages within the identified category. Operations on + * message IDs that are not valid within the category are silently ignored.
  10. + *
+ * + *

In all of the above cases, if {@code category} is non-zero and specifies an invalid category, the error {@link GL11#GL_INVALID_ENUM INVALID_ENUM} is generated. Similarly if + * {@code severity} is non-zero and is an invalid severity level, the error {@link GL11#GL_INVALID_ENUM INVALID_ENUM} is generated. If {@code count} is less than zero, the error + * {@link GL11#GL_INVALID_VALUE INVALID_VALUE} is generated. If the parameters do not fall into one of the cases defined above, the error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} is generated. The error + * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated if this command is called in a non-debug context.

+ * + *

Although messages are grouped into categories and severities, and entire groups of messages can be turned off with a single call, there is no explicit + * per-category or per-severity enabled state. Instead the enabled state is stored individually for each message. There is no difference between disabling + * a category of messages with a single call, and enumerating all messages of that category and individually disabling each of them by their ID.

+ * + *

All messages of severity level {@link #GL_DEBUG_SEVERITY_MEDIUM_AMD DEBUG_SEVERITY_MEDIUM_AMD} and {@link #GL_DEBUG_SEVERITY_HIGH_AMD DEBUG_SEVERITY_HIGH_AMD} in all categories are initially enabled, and all messages at + * {@link #GL_DEBUG_SEVERITY_LOW_AMD DEBUG_SEVERITY_LOW_AMD} are initially disabled.

+ * + * @param category the message category. One of:
{@link #GL_DEBUG_CATEGORY_API_ERROR_AMD DEBUG_CATEGORY_API_ERROR_AMD}{@link #GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD DEBUG_CATEGORY_WINDOW_SYSTEM_AMD}
{@link #GL_DEBUG_CATEGORY_DEPRECATION_AMD DEBUG_CATEGORY_DEPRECATION_AMD}{@link #GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD}
{@link #GL_DEBUG_CATEGORY_PERFORMANCE_AMD DEBUG_CATEGORY_PERFORMANCE_AMD}{@link #GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD DEBUG_CATEGORY_SHADER_COMPILER_AMD}
{@link #GL_DEBUG_CATEGORY_APPLICATION_AMD DEBUG_CATEGORY_APPLICATION_AMD}{@link #GL_DEBUG_CATEGORY_OTHER_AMD DEBUG_CATEGORY_OTHER_AMD}
+ * @param severity the message severity. One of:
{@link #GL_DEBUG_SEVERITY_HIGH_AMD DEBUG_SEVERITY_HIGH_AMD}{@link #GL_DEBUG_SEVERITY_MEDIUM_AMD DEBUG_SEVERITY_MEDIUM_AMD}{@link #GL_DEBUG_SEVERITY_LOW_AMD DEBUG_SEVERITY_LOW_AMD}
+ * @param enabled whether to enable or disable the referenced subset of messages + */ + public static void glDebugMessageEnableAMD(@NativeType("GLenum") int category, @NativeType("GLenum") int severity, @NativeType("GLuint const *") int id, @NativeType("GLboolean") boolean enabled) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer ids = stack.ints(id); + nglDebugMessageEnableAMD(category, severity, 1, memAddress(ids), enabled); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glDebugMessageInsertAMD ] --- + + /** + * Unsafe version of: {@link #glDebugMessageInsertAMD DebugMessageInsertAMD} + * + * @param length the number of character in the message + */ + public static native void nglDebugMessageInsertAMD(int category, int severity, int id, int length, long buf); + + /** + * Injects an application-supplied message into the debug message stream. + * + *

The value of {@code id} specifies the ID for the message and {@code severity} indicates its severity level as defined by the application. If + * {@code severity} is not a valid severity level, the error {@link GL11#GL_INVALID_ENUM INVALID_ENUM} will be generated. The value of {@code category} must be + * {@link #GL_DEBUG_CATEGORY_APPLICATION_AMD DEBUG_CATEGORY_APPLICATION_AMD}, or the error {@link GL11#GL_INVALID_ENUM INVALID_ENUM} will be generated. The string {@code buf} contains the string representation of the + * message. The parameter {@code length} contains the size of the message's string representation, excluding the null-terminator. If {@code length} is + * zero, then its value is derived from the string-length of {@code buf} and {@code buf} must contain a null-terminated string. The error + * {@link GL11#GL_INVALID_VALUE INVALID_VALUE} will be generated if {@code length} is less than zero or its derived value is larger than or equal to {@link #GL_MAX_DEBUG_MESSAGE_LENGTH_AMD MAX_DEBUG_MESSAGE_LENGTH_AMD}. + * The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} will be generated if this function is called in a non-debug context.

+ * + * @param category the message category. Must be:
{@link #GL_DEBUG_CATEGORY_APPLICATION_AMD DEBUG_CATEGORY_APPLICATION_AMD}
+ * @param severity the message severity. One of:
{@link #GL_DEBUG_SEVERITY_HIGH_AMD DEBUG_SEVERITY_HIGH_AMD}{@link #GL_DEBUG_SEVERITY_MEDIUM_AMD DEBUG_SEVERITY_MEDIUM_AMD}{@link #GL_DEBUG_SEVERITY_LOW_AMD DEBUG_SEVERITY_LOW_AMD}
+ * @param id the message id + * @param buf the message characters + */ + public static void glDebugMessageInsertAMD(@NativeType("GLenum") int category, @NativeType("GLenum") int severity, @NativeType("GLuint") int id, @NativeType("GLchar const *") ByteBuffer buf) { + nglDebugMessageInsertAMD(category, severity, id, buf.remaining(), memAddress(buf)); + } + + /** + * Injects an application-supplied message into the debug message stream. + * + *

The value of {@code id} specifies the ID for the message and {@code severity} indicates its severity level as defined by the application. If + * {@code severity} is not a valid severity level, the error {@link GL11#GL_INVALID_ENUM INVALID_ENUM} will be generated. The value of {@code category} must be + * {@link #GL_DEBUG_CATEGORY_APPLICATION_AMD DEBUG_CATEGORY_APPLICATION_AMD}, or the error {@link GL11#GL_INVALID_ENUM INVALID_ENUM} will be generated. The string {@code buf} contains the string representation of the + * message. The parameter {@code length} contains the size of the message's string representation, excluding the null-terminator. If {@code length} is + * zero, then its value is derived from the string-length of {@code buf} and {@code buf} must contain a null-terminated string. The error + * {@link GL11#GL_INVALID_VALUE INVALID_VALUE} will be generated if {@code length} is less than zero or its derived value is larger than or equal to {@link #GL_MAX_DEBUG_MESSAGE_LENGTH_AMD MAX_DEBUG_MESSAGE_LENGTH_AMD}. + * The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} will be generated if this function is called in a non-debug context.

+ * + * @param category the message category. Must be:
{@link #GL_DEBUG_CATEGORY_APPLICATION_AMD DEBUG_CATEGORY_APPLICATION_AMD}
+ * @param severity the message severity. One of:
{@link #GL_DEBUG_SEVERITY_HIGH_AMD DEBUG_SEVERITY_HIGH_AMD}{@link #GL_DEBUG_SEVERITY_MEDIUM_AMD DEBUG_SEVERITY_MEDIUM_AMD}{@link #GL_DEBUG_SEVERITY_LOW_AMD DEBUG_SEVERITY_LOW_AMD}
+ * @param id the message id + * @param buf the message characters + */ + public static void glDebugMessageInsertAMD(@NativeType("GLenum") int category, @NativeType("GLenum") int severity, @NativeType("GLuint") int id, @NativeType("GLchar const *") CharSequence buf) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + int bufEncodedLength = stack.nUTF8(buf, false); + long bufEncoded = stack.getPointerAddress(); + nglDebugMessageInsertAMD(category, severity, id, bufEncodedLength, bufEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glDebugMessageCallbackAMD ] --- + + /** Unsafe version of: {@link #glDebugMessageCallbackAMD DebugMessageCallbackAMD} */ + public static native void nglDebugMessageCallbackAMD(long callback, long userParam); + + /** + * Specifies a callback to receive debugging messages from the GL. + * + *

With {@code callback} storing the address of the callback function. This function's signature must follow the type definition of DEBUGPROCAMD, and its + * calling convention must be the same as the calling convention of GL functions. Anything else will result in undefined behavior. Only one debug callback + * can be specified for the current context, and further calls overwrite the previous callback. Specifying zero as the value of {@code callback} clears the + * current callback and disables message output through callbacks. Applications can specify user-specified data through the pointer {@code userParam}. The + * context will store this pointer and will include it as one of the parameters of each call to the callback function. The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} + * will be generated if this function is called for contexts created without the debug flag.

+ * + *

If the application has specified a callback function in a debug context, the implementation will call that function whenever any unfiltered message is + * generated. The ID, category, and severity of the message are specified by the callback parameters {@code id}, {@code category} and {@code severity}, + * respectively. The string representation of the message is stored in {@code message} and its length (excluding the null-terminator) is stored in + * {@code length}. The parameter {@code userParam} is the user-specified value that was passed when calling DebugMessageCallbackAMD. The memory for + * {@code message} is allocated, owned and released by the implementation, and should only be considered valid for the duration of the callback function + * call. While it is allowed to concurrently use multiple debug contexts with the same debug callback function, note that it is the application's + * responsibility to ensure that any work that occurs inside the debug callback function is thread-safe. Furthermore, calling any GL or window layer + * function from within the callback function results in undefined behavior.

+ * + *

If no callback is set, then messages are instead stored in an internal message log up to some maximum number of strings as defined by the + * implementation-dependent constant {@link #GL_MAX_DEBUG_LOGGED_MESSAGES_AMD MAX_DEBUG_LOGGED_MESSAGES_AMD}. Each context stores its own message log and will only store messages generated by + * commands operating in that context. If the message log is full, then the oldest messages will be removed from the log to make room for newer ones. The + * application can query the number of messages currently in the log by obtaining the value of {@link #GL_DEBUG_LOGGED_MESSAGES_AMD DEBUG_LOGGED_MESSAGES_AMD}.

+ * + * @param callback a callback function that will be called when a debug message is generated + * @param userParam a user supplied pointer that will be passed on each invocation of {@code callback} + */ + public static void glDebugMessageCallbackAMD(@Nullable @NativeType("GLDEBUGPROCAMD") GLDebugMessageAMDCallbackI callback, @NativeType("void *") long userParam) { + nglDebugMessageCallbackAMD(memAddressSafe(callback), userParam); + } + + // --- [ glGetDebugMessageLogAMD ] --- + + /** + * Unsafe version of: {@link #glGetDebugMessageLogAMD GetDebugMessageLogAMD} + * + * @param bufsize the maximum number of characters that can be written in the {@code message} array + */ + public static native int nglGetDebugMessageLogAMD(int count, int bufsize, long categories, long severities, long ids, long lengths, long messageLog); + + /** + * Retrieves messages from the debug message log. + * + *

This function will fetch as many messages as possible from the message log up to {@code count} in order from oldest to newest, and will return the + * number of messages fetched. Those messages that were fetched will be removed from the log. The value of {@code count} must be greater than zero and less + * than {@link #GL_MAX_DEBUG_LOGGED_MESSAGES_AMD MAX_DEBUG_LOGGED_MESSAGES_AMD} or otherwise the error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} will be generated. The value of {@code count} can be larger than the + * actual number of messages currently in the log. If {@code messageLog} is not a null pointer, then the string representations of all fetched messages + * will be stored in the buffer {@code messageLog} and will be separated by null-terminators. The maximum size of the buffer (including all + * null-terminators) is denoted by {@code bufSize}, and strings of messages within {@code count} that do not fit in the buffer will not be fetched. If + * {@code bufSize} is less than zero, the error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} will be generated. If {@code messageLog} is a null pointer, then the value of + * {@code bufSize} is ignored. The categories, severity levels, IDs, and string representation lengths of all (up to {@code count}) removed messages will + * be stored in the arrays {@code categories}, {@code severities}, {@code ids}, and {@code lengths}, respectively. The counts stored in the array + * {@code lengths} include the null-terminator of each string. Any and all of the output arrays, including {@code messageLog}, are optional, and no data is + * returned for those arrays that are specified with a null pointer. To simply delete up to {@code count} messages from the message log and ignoring, the + * application can call the function with null pointers for all output arrays. The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} will be generated by GetDebugMessageLogAMD + * if it is called in a non-debug context.

+ * + * @param count the number of debug messages to retrieve from the log + * @param categories an array of variables to receive the categories of the retrieved messages + * @param severities an array of variables to receive the severities of the retrieved messages + * @param ids an array of variables to receive the ids of the retrieved messages + * @param lengths an array of variables to receive the lengths of the retrieved messages + * @param messageLog an array of characters that will receive the messages + */ + @NativeType("GLuint") + public static int glGetDebugMessageLogAMD(@NativeType("GLuint") int count, @Nullable @NativeType("GLenum *") IntBuffer categories, @Nullable @NativeType("GLuint *") IntBuffer severities, @Nullable @NativeType("GLuint *") IntBuffer ids, @Nullable @NativeType("GLsizei *") IntBuffer lengths, @Nullable @NativeType("GLchar *") ByteBuffer messageLog) { + if (CHECKS) { + checkSafe(categories, count); + checkSafe(severities, count); + checkSafe(ids, count); + checkSafe(lengths, count); + } + return nglGetDebugMessageLogAMD(count, remainingSafe(messageLog), memAddressSafe(categories), memAddressSafe(severities), memAddressSafe(ids), memAddressSafe(lengths), memAddressSafe(messageLog)); + } + + /** Array version of: {@link #glDebugMessageEnableAMD DebugMessageEnableAMD} */ + public static void glDebugMessageEnableAMD(@NativeType("GLenum") int category, @NativeType("GLenum") int severity, @Nullable @NativeType("GLuint const *") int[] ids, @NativeType("GLboolean") boolean enabled) { + long __functionAddress = GL.getICD().glDebugMessageEnableAMD; + if (CHECKS) { + check(__functionAddress); + } + callPV(category, severity, lengthSafe(ids), ids, enabled, __functionAddress); + } + + /** Array version of: {@link #glGetDebugMessageLogAMD GetDebugMessageLogAMD} */ + @NativeType("GLuint") + public static int glGetDebugMessageLogAMD(@NativeType("GLuint") int count, @Nullable @NativeType("GLenum *") int[] categories, @Nullable @NativeType("GLuint *") int[] severities, @Nullable @NativeType("GLuint *") int[] ids, @Nullable @NativeType("GLsizei *") int[] lengths, @Nullable @NativeType("GLchar *") ByteBuffer messageLog) { + long __functionAddress = GL.getICD().glGetDebugMessageLogAMD; + if (CHECKS) { + check(__functionAddress); + checkSafe(categories, count); + checkSafe(severities, count); + checkSafe(ids, count); + checkSafe(lengths, count); + } + return callPPPPPI(count, remainingSafe(messageLog), categories, severities, ids, lengths, memAddressSafe(messageLog), __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDDepthClampSeparate.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDDepthClampSeparate.java new file mode 100644 index 00000000..f4829b0a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDDepthClampSeparate.java @@ -0,0 +1,29 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the AMD_depth_clamp_separate extension. + * + *

The extension {@link ARBDepthClamp ARB_depth_clamp} introduced the ability to control the clamping of the depth value for both the near and far plane. One limitation + * is that the control was for both planes at the same time; some applications can benefit from having clamping enabled for only one of the two planes, in + * order to save fillrate for the other plane by clipping the geometry.

+ * + *

This extension provides exactly such functionality.

+ */ +public final class AMDDepthClampSeparate { + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int + GL_DEPTH_CLAMP_NEAR_AMD = 0x901E, + GL_DEPTH_CLAMP_FAR_AMD = 0x901F; + + private AMDDepthClampSeparate() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDDrawBuffersBlend.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDDrawBuffersBlend.java new file mode 100644 index 00000000..afc86f0d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDDrawBuffersBlend.java @@ -0,0 +1,53 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the AMD_draw_buffers_blend extension. + * + *

This extension builds upon the ARB_draw_buffers and EXT_draw_buffers2 extensions. In ARB_draw_buffers (part of OpenGL 2.0), separate values could be + * written to each color buffer. This was further enhanced by EXT_draw_buffers2 by adding in the ability to enable blending and to set color write masks + * independently per color output.

+ * + *

This extension provides the ability to set individual blend equations and blend functions for each color output.

+ * + *

Requires {@link GL20 OpenGL 2.0} and {@link EXTDrawBuffers2 EXT_draw_buffers2}.

+ */ +public class AMDDrawBuffersBlend { + + static { GL.initialize(); } + + protected AMDDrawBuffersBlend() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBlendFuncIndexedAMD, caps.glBlendFuncSeparateIndexedAMD, caps.glBlendEquationIndexedAMD, caps.glBlendEquationSeparateIndexedAMD + ); + } + + // --- [ glBlendFuncIndexedAMD ] --- + + public static native void glBlendFuncIndexedAMD(@NativeType("GLuint") int buf, @NativeType("GLenum") int src, @NativeType("GLenum") int dst); + + // --- [ glBlendFuncSeparateIndexedAMD ] --- + + public static native void glBlendFuncSeparateIndexedAMD(@NativeType("GLuint") int buf, @NativeType("GLenum") int srcRGB, @NativeType("GLenum") int dstRGB, @NativeType("GLenum") int srcAlpha, @NativeType("GLenum") int dstAlpha); + + // --- [ glBlendEquationIndexedAMD ] --- + + public static native void glBlendEquationIndexedAMD(@NativeType("GLuint") int buf, @NativeType("GLenum") int mode); + + // --- [ glBlendEquationSeparateIndexedAMD ] --- + + public static native void glBlendEquationSeparateIndexedAMD(@NativeType("GLuint") int buf, @NativeType("GLenum") int modeRGB, @NativeType("GLenum") int modeAlpha); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDFramebufferMultisampleAdvanced.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDFramebufferMultisampleAdvanced.java new file mode 100644 index 00000000..019775bb --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDFramebufferMultisampleAdvanced.java @@ -0,0 +1,62 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the AMD_framebuffer_multisample_advanced extension. + * + *

This extension extends {@link ARBFramebufferObject ARB_framebuffer_object} by allowing compromises between image quality and memory footprint of multisample antialiasing.

+ * + *

{@code ARB_framebuffer_object} introduced {@link GL30C#glRenderbufferStorageMultisample RenderbufferStorageMultisample} as a method of defining the parameters for a multisample render buffer. + * This function takes a {@code samples} parameter that has strict requirements on behavior such that no compromises in the final image quality are + * allowed. Additionally, {@code ARB_framebuffer_object} requires that all framebuffer attachments have the same number of samples.

+ * + *

This extension extends {@code ARB_framebuffer_object} by providing a new function, {@link #glRenderbufferStorageMultisampleAdvancedAMD RenderbufferStorageMultisampleAdvancedAMD}, that distinguishes + * between samples and storage samples for color renderbuffers where the number of storage samples can be less than the number of samples. This extension + * also allows non-matching sample counts between color and depth/stencil renderbuffers.

+ * + *

This extension does not require any specific combination of sample counts to be supported.

+ * + *

Requires {@link ARBFramebufferObject ARB_framebuffer_object}.

+ */ +public class AMDFramebufferMultisampleAdvanced { + + /** Accepted by the {@code pname} parameter of {@link GL30C#glGetRenderbufferParameteriv GetRenderbufferParameteriv}. */ + public static final int GL_RENDERBUFFER_STORAGE_SAMPLES_AMD = 0x91B2; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, GetDoublev. */ + public static final int + GL_MAX_COLOR_FRAMEBUFFER_SAMPLES_AMD = 0x91B3, + GL_MAX_COLOR_FRAMEBUFFER_STORAGE_SAMPLES_AMD = 0x91B4, + GL_MAX_DEPTH_STENCIL_FRAMEBUFFER_SAMPLES_AMD = 0x91B5, + GL_NUM_SUPPORTED_MULTISAMPLE_MODES_AMD = 0x91B6, + GL_SUPPORTED_MULTISAMPLE_MODES_AMD = 0x91B7; + + static { GL.initialize(); } + + protected AMDFramebufferMultisampleAdvanced() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glRenderbufferStorageMultisampleAdvancedAMD, caps.glNamedRenderbufferStorageMultisampleAdvancedAMD + ); + } + + // --- [ glRenderbufferStorageMultisampleAdvancedAMD ] --- + + public static native void glRenderbufferStorageMultisampleAdvancedAMD(@NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLsizei") int storageSamples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glNamedRenderbufferStorageMultisampleAdvancedAMD ] --- + + public static native void glNamedRenderbufferStorageMultisampleAdvancedAMD(@NativeType("GLuint") int renderbuffer, @NativeType("GLsizei") int samples, @NativeType("GLsizei") int storageSamples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDGPUShaderHalfFloat.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDGPUShaderHalfFloat.java new file mode 100644 index 00000000..f9dc9632 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDGPUShaderHalfFloat.java @@ -0,0 +1,44 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the AMD_gpu_shader_half_float extension. + * + *

This extension was developed based on the {@link NVGPUShader5 NV_gpu_shader5} extension to allow implementations supporting half float in shader and expose the + * feature without the additional requirements that are present in {@code NV_gpu_shader5}.

+ * + *

The extension introduces the following features for all shader types:

+ * + *
    + *
  • support for half float scalar, vector and matrix data types in shader;
  • + *
  • new built-in functions to pack and unpack half float types into a 32-bit integer vector;
  • + *
  • half float support for all existing single float built-in functions, including angle functions, exponential functions, common functions, geometric + * functions, matrix functions and etc.;
  • + *
+ * + *

This extension is designed to be a functional superset of the half-precision floating-point support from NV_gpu_shader5 and to keep source code + * compatible with that, thus the new procedures, functions, and tokens are identical to those found in that extension.

+ * + *

Requires {@link GL40 OpenGL 4.0} and GLSL 4.00.

+ */ +public final class AMDGPUShaderHalfFloat { + + /** Returned by the {@code type} parameter of GetActiveAttrib, GetActiveUniform, and GetTransformFeedbackVarying. */ + public static final int + GL_FLOAT16_MAT2_AMD = 0x91C5, + GL_FLOAT16_MAT3_AMD = 0x91C6, + GL_FLOAT16_MAT4_AMD = 0x91C7, + GL_FLOAT16_MAT2x3_AMD = 0x91C8, + GL_FLOAT16_MAT2x4_AMD = 0x91C9, + GL_FLOAT16_MAT3x2_AMD = 0x91CA, + GL_FLOAT16_MAT3x4_AMD = 0x91CB, + GL_FLOAT16_MAT4x2_AMD = 0x91CC, + GL_FLOAT16_MAT4x3_AMD = 0x91CD; + + private AMDGPUShaderHalfFloat() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDGPUShaderHalfFloatFetch.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDGPUShaderHalfFloatFetch.java new file mode 100644 index 00000000..6664da7c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDGPUShaderHalfFloatFetch.java @@ -0,0 +1,52 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the AMD_gpu_shader_half_float_fetch extension. + * + *

This extension was developed based on the {@code AMD_gpu_shader_half_float} extension to allow implementations supporting half-precision floating-point + * both in shader texture functions and in shader image memory functions.

+ * + *

Requires {@link GL40 OpenGL 4.0}, GLSL 4.00 and {@link AMDGPUShaderHalfFloat AMD_gpu_shader_half_float}.

+ */ +public final class AMDGPUShaderHalfFloatFetch { + + /** Returned by the {@code type} parameter of {@link GL20C#glGetActiveUniform GetActiveUniform} and {@link GL43C#glGetProgramResourceiv GetProgramResourceiv}. */ + public static final int + GL_FLOAT16_SAMPLER_1D_AMD = 0x91CE, + GL_FLOAT16_SAMPLER_2D_AMD = 0x91CF, + GL_FLOAT16_SAMPLER_3D_AMD = 0x91D0, + GL_FLOAT16_SAMPLER_CUBE_AMD = 0x91D1, + GL_FLOAT16_SAMPLER_2D_RECT_AMD = 0x91D2, + GL_FLOAT16_SAMPLER_1D_ARRAY_AMD = 0x91D3, + GL_FLOAT16_SAMPLER_2D_ARRAY_AMD = 0x91D4, + GL_FLOAT16_SAMPLER_CUBE_MAP_ARRAY_AMD = 0x91D5, + GL_FLOAT16_SAMPLER_BUFFER_AMD = 0x91D6, + GL_FLOAT16_SAMPLER_2D_MULTISAMPLE_AMD = 0x91D7, + GL_FLOAT16_SAMPLER_2D_MULTISAMPLE_ARRAY_AMD = 0x91D8, + GL_FLOAT16_SAMPLER_1D_SHADOW_AMD = 0x91D9, + GL_FLOAT16_SAMPLER_2D_SHADOW_AMD = 0x91DA, + GL_FLOAT16_SAMPLER_2D_RECT_SHADOW_AMD = 0x91DB, + GL_FLOAT16_SAMPLER_1D_ARRAY_SHADOW_AMD = 0x91DC, + GL_FLOAT16_SAMPLER_2D_ARRAY_SHADOW_AMD = 0x91DD, + GL_FLOAT16_SAMPLER_CUBE_SHADOW_AMD = 0x91DE, + GL_FLOAT16_SAMPLER_CUBE_MAP_ARRAY_SHADOW_AMD = 0x91DF, + GL_FLOAT16_IMAGE_1D_AMD = 0x91E0, + GL_FLOAT16_IMAGE_2D_AMD = 0x91E1, + GL_FLOAT16_IMAGE_3D_AMD = 0x91E2, + GL_FLOAT16_IMAGE_2D_RECT_AMD = 0x91E3, + GL_FLOAT16_IMAGE_CUBE_AMD = 0x91E4, + GL_FLOAT16_IMAGE_1D_ARRAY_AMD = 0x91E5, + GL_FLOAT16_IMAGE_2D_ARRAY_AMD = 0x91E6, + GL_FLOAT16_IMAGE_CUBE_MAP_ARRAY_AMD = 0x91E7, + GL_FLOAT16_IMAGE_BUFFER_AMD = 0x91E8, + GL_FLOAT16_IMAGE_2D_MULTISAMPLE_AMD = 0x91E9, + GL_FLOAT16_IMAGE_2D_MULTISAMPLE_ARRAY_AMD = 0x91EA; + + private AMDGPUShaderHalfFloatFetch() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDGPUShaderInt64.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDGPUShaderInt64.java new file mode 100644 index 00000000..e3842210 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDGPUShaderInt64.java @@ -0,0 +1,475 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the AMD_gpu_shader_int64 extension. + * + *

This extension was developed based on the NV_gpu_shader5 extension to allow implementations supporting 64-bit integers to expose the feature without + * the additional requirements that are present in NV_gpu_shader5.

+ * + *

The extension introduces the following features for all shader types:

+ * + *
    + *
  • support for 64-bit scalar and vector integer data types, including uniform API, uniform buffer object, transform feedback, and shader input and + * output support;
  • + *
  • new built-in functions to pack and unpack 64-bit integer types into a two-component 32-bit integer vector;
  • + *
  • new built-in functions to convert double-precision floating-point values to or from their 64-bit integer bit encodings;
  • + *
  • vector relational functions supporting comparisons of vectors of 64-bit integer types; and
  • + *
  • common functions abs, sign, min, max, clamp, and mix supporting arguments of 64-bit integer types.
  • + *
+ * + *

This extension is designed to be a functional superset of the 64-bit integer support introduced by NV_gpu_shader5 and to be source code compatible with + * that, thus the new procedures, functions, and tokens are identical to those found in that extension.

+ * + *

Requires {@link GL40 OpenGL 4.0} and GLSL 4.00.

+ */ +public class AMDGPUShaderInt64 { + + /** Returned by the {@code type} parameter of GetActiveAttrib, GetActiveUniform, and GetTransformFeedbackVarying. */ + public static final int + GL_INT64_NV = 0x140E, + GL_UNSIGNED_INT64_NV = 0x140F, + GL_INT8_NV = 0x8FE0, + GL_INT8_VEC2_NV = 0x8FE1, + GL_INT8_VEC3_NV = 0x8FE2, + GL_INT8_VEC4_NV = 0x8FE3, + GL_INT16_NV = 0x8FE4, + GL_INT16_VEC2_NV = 0x8FE5, + GL_INT16_VEC3_NV = 0x8FE6, + GL_INT16_VEC4_NV = 0x8FE7, + GL_INT64_VEC2_NV = 0x8FE9, + GL_INT64_VEC3_NV = 0x8FEA, + GL_INT64_VEC4_NV = 0x8FEB, + GL_UNSIGNED_INT8_NV = 0x8FEC, + GL_UNSIGNED_INT8_VEC2_NV = 0x8FED, + GL_UNSIGNED_INT8_VEC3_NV = 0x8FEE, + GL_UNSIGNED_INT8_VEC4_NV = 0x8FEF, + GL_UNSIGNED_INT16_NV = 0x8FF0, + GL_UNSIGNED_INT16_VEC2_NV = 0x8FF1, + GL_UNSIGNED_INT16_VEC3_NV = 0x8FF2, + GL_UNSIGNED_INT16_VEC4_NV = 0x8FF3, + GL_UNSIGNED_INT64_VEC2_NV = 0x8FF5, + GL_UNSIGNED_INT64_VEC3_NV = 0x8FF6, + GL_UNSIGNED_INT64_VEC4_NV = 0x8FF7, + GL_FLOAT16_NV = 0x8FF8, + GL_FLOAT16_VEC2_NV = 0x8FF9, + GL_FLOAT16_VEC3_NV = 0x8FFA, + GL_FLOAT16_VEC4_NV = 0x8FFB; + + static { GL.initialize(); } + + protected AMDGPUShaderInt64() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glUniform1i64NV, caps.glUniform2i64NV, caps.glUniform3i64NV, caps.glUniform4i64NV, caps.glUniform1i64vNV, caps.glUniform2i64vNV, + caps.glUniform3i64vNV, caps.glUniform4i64vNV, caps.glUniform1ui64NV, caps.glUniform2ui64NV, caps.glUniform3ui64NV, caps.glUniform4ui64NV, + caps.glUniform1ui64vNV, caps.glUniform2ui64vNV, caps.glUniform3ui64vNV, caps.glUniform4ui64vNV, caps.glGetUniformi64vNV, caps.glGetUniformui64vNV, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform1i64NV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform2i64NV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform3i64NV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform4i64NV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform1i64vNV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform2i64vNV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform3i64vNV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform4i64vNV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform1ui64NV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform2ui64NV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform3ui64NV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform4ui64NV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform1ui64vNV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform2ui64vNV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform3ui64vNV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform4ui64vNV : -1L + ); + } + + // --- [ glUniform1i64NV ] --- + + public static void glUniform1i64NV(@NativeType("GLint") int location, @NativeType("GLint64EXT") long x) { + NVGPUShader5.glUniform1i64NV(location, x); + } + + // --- [ glUniform2i64NV ] --- + + public static void glUniform2i64NV(@NativeType("GLint") int location, @NativeType("GLint64EXT") long x, @NativeType("GLint64EXT") long y) { + NVGPUShader5.glUniform2i64NV(location, x, y); + } + + // --- [ glUniform3i64NV ] --- + + public static void glUniform3i64NV(@NativeType("GLint") int location, @NativeType("GLint64EXT") long x, @NativeType("GLint64EXT") long y, @NativeType("GLint64EXT") long z) { + NVGPUShader5.glUniform3i64NV(location, x, y, z); + } + + // --- [ glUniform4i64NV ] --- + + public static void glUniform4i64NV(@NativeType("GLint") int location, @NativeType("GLint64EXT") long x, @NativeType("GLint64EXT") long y, @NativeType("GLint64EXT") long z, @NativeType("GLint64EXT") long w) { + NVGPUShader5.glUniform4i64NV(location, x, y, z, w); + } + + // --- [ glUniform1i64vNV ] --- + + public static void nglUniform1i64vNV(int location, int count, long value) { + NVGPUShader5.nglUniform1i64vNV(location, count, value); + } + + public static void glUniform1i64vNV(@NativeType("GLint") int location, @NativeType("GLint64EXT const *") LongBuffer value) { + NVGPUShader5.glUniform1i64vNV(location, value); + } + + // --- [ glUniform2i64vNV ] --- + + public static void nglUniform2i64vNV(int location, int count, long value) { + NVGPUShader5.nglUniform2i64vNV(location, count, value); + } + + public static void glUniform2i64vNV(@NativeType("GLint") int location, @NativeType("GLint64EXT const *") LongBuffer value) { + NVGPUShader5.glUniform2i64vNV(location, value); + } + + // --- [ glUniform3i64vNV ] --- + + public static void nglUniform3i64vNV(int location, int count, long value) { + NVGPUShader5.nglUniform3i64vNV(location, count, value); + } + + public static void glUniform3i64vNV(@NativeType("GLint") int location, @NativeType("GLint64EXT const *") LongBuffer value) { + NVGPUShader5.glUniform3i64vNV(location, value); + } + + // --- [ glUniform4i64vNV ] --- + + public static void nglUniform4i64vNV(int location, int count, long value) { + NVGPUShader5.nglUniform4i64vNV(location, count, value); + } + + public static void glUniform4i64vNV(@NativeType("GLint") int location, @NativeType("GLint64EXT const *") LongBuffer value) { + NVGPUShader5.glUniform4i64vNV(location, value); + } + + // --- [ glUniform1ui64NV ] --- + + public static void glUniform1ui64NV(@NativeType("GLint") int location, @NativeType("GLuint64EXT") long x) { + NVGPUShader5.glUniform1ui64NV(location, x); + } + + // --- [ glUniform2ui64NV ] --- + + public static void glUniform2ui64NV(@NativeType("GLint") int location, @NativeType("GLuint64EXT") long x, @NativeType("GLuint64EXT") long y) { + NVGPUShader5.glUniform2ui64NV(location, x, y); + } + + // --- [ glUniform3ui64NV ] --- + + public static void glUniform3ui64NV(@NativeType("GLint") int location, @NativeType("GLuint64EXT") long x, @NativeType("GLuint64EXT") long y, @NativeType("GLuint64EXT") long z) { + NVGPUShader5.glUniform3ui64NV(location, x, y, z); + } + + // --- [ glUniform4ui64NV ] --- + + public static void glUniform4ui64NV(@NativeType("GLint") int location, @NativeType("GLuint64EXT") long x, @NativeType("GLuint64EXT") long y, @NativeType("GLuint64EXT") long z, @NativeType("GLuint64EXT") long w) { + NVGPUShader5.glUniform4ui64NV(location, x, y, z, w); + } + + // --- [ glUniform1ui64vNV ] --- + + public static void nglUniform1ui64vNV(int location, int count, long value) { + NVGPUShader5.nglUniform1ui64vNV(location, count, value); + } + + public static void glUniform1ui64vNV(@NativeType("GLint") int location, @NativeType("GLuint64EXT const *") LongBuffer value) { + NVGPUShader5.glUniform1ui64vNV(location, value); + } + + // --- [ glUniform2ui64vNV ] --- + + public static void nglUniform2ui64vNV(int location, int count, long value) { + NVGPUShader5.nglUniform2ui64vNV(location, count, value); + } + + public static void glUniform2ui64vNV(@NativeType("GLint") int location, @NativeType("GLuint64EXT *") LongBuffer value) { + NVGPUShader5.glUniform2ui64vNV(location, value); + } + + // --- [ glUniform3ui64vNV ] --- + + public static void nglUniform3ui64vNV(int location, int count, long value) { + NVGPUShader5.nglUniform3ui64vNV(location, count, value); + } + + public static void glUniform3ui64vNV(@NativeType("GLint") int location, @NativeType("GLuint64EXT const *") LongBuffer value) { + NVGPUShader5.glUniform3ui64vNV(location, value); + } + + // --- [ glUniform4ui64vNV ] --- + + public static void nglUniform4ui64vNV(int location, int count, long value) { + NVGPUShader5.nglUniform4ui64vNV(location, count, value); + } + + public static void glUniform4ui64vNV(@NativeType("GLint") int location, @NativeType("GLuint64EXT const *") LongBuffer value) { + NVGPUShader5.glUniform4ui64vNV(location, value); + } + + // --- [ glGetUniformi64vNV ] --- + + public static void nglGetUniformi64vNV(int program, int location, long params) { + NVGPUShader5.nglGetUniformi64vNV(program, location, params); + } + + public static void glGetUniformi64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT *") LongBuffer params) { + NVGPUShader5.glGetUniformi64vNV(program, location, params); + } + + @NativeType("void") + public static long glGetUniformi64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + return NVGPUShader5.glGetUniformi64NV(program, location); + } + + // --- [ glGetUniformui64vNV ] --- + + public static void nglGetUniformui64vNV(int program, int location, long params) { + NVShaderBufferLoad.nglGetUniformui64vNV(program, location, params); + } + + public static void glGetUniformui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT *") LongBuffer params) { + NVShaderBufferLoad.glGetUniformui64vNV(program, location, params); + } + + @NativeType("void") + public static long glGetUniformui64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + return NVShaderBufferLoad.glGetUniformui64NV(program, location); + } + + // --- [ glProgramUniform1i64NV ] --- + + public static void glProgramUniform1i64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT") long x) { + NVGPUShader5.glProgramUniform1i64NV(program, location, x); + } + + // --- [ glProgramUniform2i64NV ] --- + + public static void glProgramUniform2i64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT") long x, @NativeType("GLint64EXT") long y) { + NVGPUShader5.glProgramUniform2i64NV(program, location, x, y); + } + + // --- [ glProgramUniform3i64NV ] --- + + public static void glProgramUniform3i64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT") long x, @NativeType("GLint64EXT") long y, @NativeType("GLint64EXT") long z) { + NVGPUShader5.glProgramUniform3i64NV(program, location, x, y, z); + } + + // --- [ glProgramUniform4i64NV ] --- + + public static void glProgramUniform4i64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT") long x, @NativeType("GLint64EXT") long y, @NativeType("GLint64EXT") long z, @NativeType("GLint64EXT") long w) { + NVGPUShader5.glProgramUniform4i64NV(program, location, x, y, z, w); + } + + // --- [ glProgramUniform1i64vNV ] --- + + public static void nglProgramUniform1i64vNV(int program, int location, int count, long value) { + NVGPUShader5.nglProgramUniform1i64vNV(program, location, count, value); + } + + public static void glProgramUniform1i64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT const *") LongBuffer value) { + NVGPUShader5.glProgramUniform1i64vNV(program, location, value); + } + + // --- [ glProgramUniform2i64vNV ] --- + + public static void nglProgramUniform2i64vNV(int program, int location, int count, long value) { + NVGPUShader5.nglProgramUniform2i64vNV(program, location, count, value); + } + + public static void glProgramUniform2i64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT const *") LongBuffer value) { + NVGPUShader5.glProgramUniform2i64vNV(program, location, value); + } + + // --- [ glProgramUniform3i64vNV ] --- + + public static void nglProgramUniform3i64vNV(int program, int location, int count, long value) { + NVGPUShader5.nglProgramUniform3i64vNV(program, location, count, value); + } + + public static void glProgramUniform3i64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT const *") LongBuffer value) { + NVGPUShader5.glProgramUniform3i64vNV(program, location, value); + } + + // --- [ glProgramUniform4i64vNV ] --- + + public static void nglProgramUniform4i64vNV(int program, int location, int count, long value) { + NVGPUShader5.nglProgramUniform4i64vNV(program, location, count, value); + } + + public static void glProgramUniform4i64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT const *") LongBuffer value) { + NVGPUShader5.glProgramUniform4i64vNV(program, location, value); + } + + // --- [ glProgramUniform1ui64NV ] --- + + public static void glProgramUniform1ui64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT") long x) { + NVGPUShader5.glProgramUniform1ui64NV(program, location, x); + } + + // --- [ glProgramUniform2ui64NV ] --- + + public static void glProgramUniform2ui64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT") long x, @NativeType("GLuint64EXT") long y) { + NVGPUShader5.glProgramUniform2ui64NV(program, location, x, y); + } + + // --- [ glProgramUniform3ui64NV ] --- + + public static void glProgramUniform3ui64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT") long x, @NativeType("GLuint64EXT") long y, @NativeType("GLuint64EXT") long z) { + NVGPUShader5.glProgramUniform3ui64NV(program, location, x, y, z); + } + + // --- [ glProgramUniform4ui64NV ] --- + + public static void glProgramUniform4ui64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT") long x, @NativeType("GLuint64EXT") long y, @NativeType("GLuint64EXT") long z, @NativeType("GLuint64EXT") long w) { + NVGPUShader5.glProgramUniform4ui64NV(program, location, x, y, z, w); + } + + // --- [ glProgramUniform1ui64vNV ] --- + + public static void nglProgramUniform1ui64vNV(int program, int location, int count, long value) { + NVGPUShader5.nglProgramUniform1ui64vNV(program, location, count, value); + } + + public static void glProgramUniform1ui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT const *") LongBuffer value) { + NVGPUShader5.glProgramUniform1ui64vNV(program, location, value); + } + + // --- [ glProgramUniform2ui64vNV ] --- + + public static void nglProgramUniform2ui64vNV(int program, int location, int count, long value) { + NVGPUShader5.nglProgramUniform2ui64vNV(program, location, count, value); + } + + public static void glProgramUniform2ui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT const *") LongBuffer value) { + NVGPUShader5.glProgramUniform2ui64vNV(program, location, value); + } + + // --- [ glProgramUniform3ui64vNV ] --- + + public static void nglProgramUniform3ui64vNV(int program, int location, int count, long value) { + NVGPUShader5.nglProgramUniform3ui64vNV(program, location, count, value); + } + + public static void glProgramUniform3ui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT const *") LongBuffer value) { + NVGPUShader5.glProgramUniform3ui64vNV(program, location, value); + } + + // --- [ glProgramUniform4ui64vNV ] --- + + public static void nglProgramUniform4ui64vNV(int program, int location, int count, long value) { + NVGPUShader5.nglProgramUniform4ui64vNV(program, location, count, value); + } + + public static void glProgramUniform4ui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT const *") LongBuffer value) { + NVGPUShader5.glProgramUniform4ui64vNV(program, location, value); + } + + /** Array version of: {@link #glUniform1i64vNV Uniform1i64vNV} */ + public static void glUniform1i64vNV(@NativeType("GLint") int location, @NativeType("GLint64EXT const *") long[] value) { + NVGPUShader5.glUniform1i64vNV(location, value); + } + + /** Array version of: {@link #glUniform2i64vNV Uniform2i64vNV} */ + public static void glUniform2i64vNV(@NativeType("GLint") int location, @NativeType("GLint64EXT const *") long[] value) { + NVGPUShader5.glUniform2i64vNV(location, value); + } + + /** Array version of: {@link #glUniform3i64vNV Uniform3i64vNV} */ + public static void glUniform3i64vNV(@NativeType("GLint") int location, @NativeType("GLint64EXT const *") long[] value) { + NVGPUShader5.glUniform3i64vNV(location, value); + } + + /** Array version of: {@link #glUniform4i64vNV Uniform4i64vNV} */ + public static void glUniform4i64vNV(@NativeType("GLint") int location, @NativeType("GLint64EXT const *") long[] value) { + NVGPUShader5.glUniform4i64vNV(location, value); + } + + /** Array version of: {@link #glUniform1ui64vNV Uniform1ui64vNV} */ + public static void glUniform1ui64vNV(@NativeType("GLint") int location, @NativeType("GLuint64EXT const *") long[] value) { + NVGPUShader5.glUniform1ui64vNV(location, value); + } + + /** Array version of: {@link #glUniform2ui64vNV Uniform2ui64vNV} */ + public static void glUniform2ui64vNV(@NativeType("GLint") int location, @NativeType("GLuint64EXT *") long[] value) { + NVGPUShader5.glUniform2ui64vNV(location, value); + } + + /** Array version of: {@link #glUniform3ui64vNV Uniform3ui64vNV} */ + public static void glUniform3ui64vNV(@NativeType("GLint") int location, @NativeType("GLuint64EXT const *") long[] value) { + NVGPUShader5.glUniform3ui64vNV(location, value); + } + + /** Array version of: {@link #glUniform4ui64vNV Uniform4ui64vNV} */ + public static void glUniform4ui64vNV(@NativeType("GLint") int location, @NativeType("GLuint64EXT const *") long[] value) { + NVGPUShader5.glUniform4ui64vNV(location, value); + } + + /** Array version of: {@link #glGetUniformi64vNV GetUniformi64vNV} */ + public static void glGetUniformi64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT *") long[] params) { + NVGPUShader5.glGetUniformi64vNV(program, location, params); + } + + /** Array version of: {@link #glGetUniformui64vNV GetUniformui64vNV} */ + public static void glGetUniformui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT *") long[] params) { + NVShaderBufferLoad.glGetUniformui64vNV(program, location, params); + } + + /** Array version of: {@link #glProgramUniform1i64vNV ProgramUniform1i64vNV} */ + public static void glProgramUniform1i64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT const *") long[] value) { + NVGPUShader5.glProgramUniform1i64vNV(program, location, value); + } + + /** Array version of: {@link #glProgramUniform2i64vNV ProgramUniform2i64vNV} */ + public static void glProgramUniform2i64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT const *") long[] value) { + NVGPUShader5.glProgramUniform2i64vNV(program, location, value); + } + + /** Array version of: {@link #glProgramUniform3i64vNV ProgramUniform3i64vNV} */ + public static void glProgramUniform3i64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT const *") long[] value) { + NVGPUShader5.glProgramUniform3i64vNV(program, location, value); + } + + /** Array version of: {@link #glProgramUniform4i64vNV ProgramUniform4i64vNV} */ + public static void glProgramUniform4i64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT const *") long[] value) { + NVGPUShader5.glProgramUniform4i64vNV(program, location, value); + } + + /** Array version of: {@link #glProgramUniform1ui64vNV ProgramUniform1ui64vNV} */ + public static void glProgramUniform1ui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT const *") long[] value) { + NVGPUShader5.glProgramUniform1ui64vNV(program, location, value); + } + + /** Array version of: {@link #glProgramUniform2ui64vNV ProgramUniform2ui64vNV} */ + public static void glProgramUniform2ui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT const *") long[] value) { + NVGPUShader5.glProgramUniform2ui64vNV(program, location, value); + } + + /** Array version of: {@link #glProgramUniform3ui64vNV ProgramUniform3ui64vNV} */ + public static void glProgramUniform3ui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT const *") long[] value) { + NVGPUShader5.glProgramUniform3ui64vNV(program, location, value); + } + + /** Array version of: {@link #glProgramUniform4ui64vNV ProgramUniform4ui64vNV} */ + public static void glProgramUniform4ui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT const *") long[] value) { + NVGPUShader5.glProgramUniform4ui64vNV(program, location, value); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDInterleavedElements.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDInterleavedElements.java new file mode 100644 index 00000000..7e28cdfc --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDInterleavedElements.java @@ -0,0 +1,56 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the AMD_interleaved_elements extension. + * + *

The glDrawElements function and its variants (instanced and indirect, for example) allow OpenGL to draw indexed arrays of vertices. Since its + * inception, OpenGL has supported unsigned bytes, unsigned shorts and unsigned integers as index types. However, all enabled vertex arrays may be + * represented by at most one shared index.

+ * + *

A common scenario in graphics rendering is that several faces share a vertex where, for each face some properties of a vertex (position and texture + * coordinates, for example) should be common but others must be unique (colors, normals, and so on). Consider a mesh of a cube with per-face normals, for + * example. There are 8 vertices and 6 normals, and 12 triangles (where each face of the cube is represented as two triangles). To render this cube, we + * must compute the 24 unique permutations of position and normal and build a new element list to index into it. In fact, any advantage of indexed draw is + * lost here as the number of required permutations is equal to the final vertex count required to draw the object.

+ * + *

This extension allows OpenGL to process multi-component packed element data. The maximum size of a vertex's index data is not increased, but the + * facility to store 2 16-bit or 2 or 4 8-bit indices per vertex is introduced. Each vertex attribute is given a swizzle property to allow its index to be + * sourced from one of up to 4 channels of index data. This effectively allows an application to supply multiple interleaved streams of index data to + * OpenGL. Each vertex attribute is given a 'channel selector' to select one of the up to 4 channels of vertex index information presented to OpenGL. This + * enables the use-case described above and many more. The swizzle parameter is also applied to vertex indices passed to shaders, and updates to the + * definition of base vertex parameters and primitive restart are applied.

+ */ +public class AMDInterleavedElements { + + /** Accepted by the {@code pname} parameter of VertexAttribParameteriAMD and GetVertexAttrib{iv|dv|fv|Iiv|Iuiv|Ldv}. */ + public static final int GL_VERTEX_ELEMENT_SWIZZLE_AMD = 0x91A4; + + /** Selected by the {@code pname} parameter of ProgramParameteri and GetProgramiv. */ + public static final int GL_VERTEX_ID_SWIZZLE_AMD = 0x91A5; + + static { GL.initialize(); } + + protected AMDInterleavedElements() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glVertexAttribParameteriAMD + ); + } + + // --- [ glVertexAttribParameteriAMD ] --- + + public static native void glVertexAttribParameteriAMD(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint") int param); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDOcclusionQueryEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDOcclusionQueryEvent.java new file mode 100644 index 00000000..4bd4a3c2 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDOcclusionQueryEvent.java @@ -0,0 +1,61 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the AMD_occlusion_query_event extension. + * + *

This extension introduces the concept of occlusion query events and changes the concept of an occlusion query from counting passed fragments to counting + * fragments that generate any of a user-selectable set of events. Provided events include passing the depth test, and passing or failing the stencil test. + * For a given occlusion query object, counting of these events may be enabled or disabled, allowing any combination to be counted.

+ * + *

Requires {@link GL15 OpenGL 1.5}.

+ */ +public class AMDOcclusionQueryEvent { + + /** + * Accepted by the {@code pname} argument to {@link #glQueryObjectParameteruiAMD QueryObjectParameteruiAMD}, {@link GL15C#glGetQueryObjectiv GetQueryObjectiv}, {@link GL15C#glGetQueryObjectuiv GetQueryObjectuiv}, + * {@link GL33C#glGetQueryObjecti64v GetQueryObjecti64v}, and {@link GL33C#glGetQueryObjectui64v GetQueryObjectui64v}. + */ + public static final int GL_OCCLUSION_QUERY_EVENT_MASK_AMD = 0x874F; + + /** Accepted by the {@code param} argument to {@link #glQueryObjectParameteruiAMD QueryObjectParameteruiAMD}. */ + public static final int + GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD = 0x1, + GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD = 0x2, + GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD = 0x4, + GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD = 0x8, + GL_QUERY_ALL_EVENT_BITS_AMD = 0xFFFFFFFF; + + static { GL.initialize(); } + + protected AMDOcclusionQueryEvent() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glQueryObjectParameteruiAMD + ); + } + + // --- [ glQueryObjectParameteruiAMD ] --- + + /** + * Changes the value of a query object parameter. + * + * @param target a valid query target. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param id a value returned from a previous call to {@link GL15C#glGenQueries GenQueries} + * @param pname the parameter to modify. Must be:
{@link #GL_OCCLUSION_QUERY_EVENT_MASK_AMD OCCLUSION_QUERY_EVENT_MASK_AMD}
+ * @param param the new value. One of:
{@link #GL_QUERY_DEPTH_PASS_EVENT_BIT_AMD QUERY_DEPTH_PASS_EVENT_BIT_AMD}{@link #GL_QUERY_DEPTH_FAIL_EVENT_BIT_AMD QUERY_DEPTH_FAIL_EVENT_BIT_AMD}
{@link #GL_QUERY_STENCIL_FAIL_EVENT_BIT_AMD QUERY_STENCIL_FAIL_EVENT_BIT_AMD}{@link #GL_QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD QUERY_DEPTH_BOUNDS_FAIL_EVENT_BIT_AMD}
{@link #GL_QUERY_ALL_EVENT_BITS_AMD QUERY_ALL_EVENT_BITS_AMD}
+ */ + public static native void glQueryObjectParameteruiAMD(@NativeType("GLenum") int target, @NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLuint") int param); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDPerformanceMonitor.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDPerformanceMonitor.java new file mode 100644 index 00000000..10f282af --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDPerformanceMonitor.java @@ -0,0 +1,292 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the AMD_performance_monitor extension. + * + *

This extension enables the capture and reporting of performance monitors. Performance monitors contain groups of counters which hold arbitrary counted + * data. Typically, the counters hold information on performance-related counters in the underlying hardware. The extension is general enough to allow the + * implementation to choose which counters to expose and pick the data type and range of the counters. The extension also allows counting to start and end + * on arbitrary boundaries during rendering.

+ */ +public class AMDPerformanceMonitor { + + /** Accepted by the {@code pame} parameter of GetPerfMonitorCounterInfoAMD. */ + public static final int + GL_COUNTER_TYPE_AMD = 0x8BC0, + GL_COUNTER_RANGE_AMD = 0x8BC1; + + /** Returned as a valid value in {@code data} parameter of GetPerfMonitorCounterInfoAMD if {@code pname} = COUNTER_TYPE_AMD. */ + public static final int + GL_UNSIGNED_INT64_AMD = 0x8BC2, + GL_PERCENTAGE_AMD = 0x8BC3; + + /** Accepted by the {@code pname} parameter of GetPerfMonitorCounterDataAMD. */ + public static final int + GL_PERFMON_RESULT_AVAILABLE_AMD = 0x8BC4, + GL_PERFMON_RESULT_SIZE_AMD = 0x8BC5, + GL_PERFMON_RESULT_AMD = 0x8BC6; + + static { GL.initialize(); } + + protected AMDPerformanceMonitor() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glGetPerfMonitorGroupsAMD, caps.glGetPerfMonitorCountersAMD, caps.glGetPerfMonitorGroupStringAMD, caps.glGetPerfMonitorCounterStringAMD, + caps.glGetPerfMonitorCounterInfoAMD, caps.glGenPerfMonitorsAMD, caps.glDeletePerfMonitorsAMD, caps.glSelectPerfMonitorCountersAMD, + caps.glBeginPerfMonitorAMD, caps.glEndPerfMonitorAMD, caps.glGetPerfMonitorCounterDataAMD + ); + } + + // --- [ glGetPerfMonitorGroupsAMD ] --- + + public static native void nglGetPerfMonitorGroupsAMD(long numGroups, int groupsSize, long groups); + + public static void glGetPerfMonitorGroupsAMD(@Nullable @NativeType("GLint *") IntBuffer numGroups, @Nullable @NativeType("GLuint *") IntBuffer groups) { + if (CHECKS) { + checkSafe(numGroups, 1); + } + nglGetPerfMonitorGroupsAMD(memAddressSafe(numGroups), remainingSafe(groups), memAddressSafe(groups)); + } + + // --- [ glGetPerfMonitorCountersAMD ] --- + + public static native void nglGetPerfMonitorCountersAMD(int group, long numCounters, long maxActiveCounters, int counterSize, long counters); + + public static void glGetPerfMonitorCountersAMD(@NativeType("GLuint") int group, @NativeType("GLint *") IntBuffer numCounters, @NativeType("GLint *") IntBuffer maxActiveCounters, @NativeType("GLuint *") IntBuffer counters) { + if (CHECKS) { + check(numCounters, 1); + check(maxActiveCounters, 1); + } + nglGetPerfMonitorCountersAMD(group, memAddress(numCounters), memAddress(maxActiveCounters), counters.remaining(), memAddress(counters)); + } + + // --- [ glGetPerfMonitorGroupStringAMD ] --- + + public static native void nglGetPerfMonitorGroupStringAMD(int group, int bufSize, long length, long groupString); + + public static void glGetPerfMonitorGroupStringAMD(@NativeType("GLuint") int group, @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer groupString) { + if (CHECKS) { + check(length, 1); + } + nglGetPerfMonitorGroupStringAMD(group, groupString.remaining(), memAddress(length), memAddress(groupString)); + } + + // --- [ glGetPerfMonitorCounterStringAMD ] --- + + public static native void nglGetPerfMonitorCounterStringAMD(int group, int counter, int bufSize, long length, long counterString); + + public static void glGetPerfMonitorCounterStringAMD(@NativeType("GLuint") int group, @NativeType("GLuint") int counter, @Nullable @NativeType("GLsizei *") IntBuffer length, @Nullable @NativeType("GLchar *") ByteBuffer counterString) { + if (CHECKS) { + checkSafe(length, 1); + } + nglGetPerfMonitorCounterStringAMD(group, counter, remainingSafe(counterString), memAddressSafe(length), memAddressSafe(counterString)); + } + + // --- [ glGetPerfMonitorCounterInfoAMD ] --- + + public static native void nglGetPerfMonitorCounterInfoAMD(int group, int counter, int pname, long data); + + public static void glGetPerfMonitorCounterInfoAMD(@NativeType("GLuint") int group, @NativeType("GLuint") int counter, @NativeType("GLenum") int pname, @NativeType("void *") ByteBuffer data) { + if (CHECKS) { + check(data, 4); + } + nglGetPerfMonitorCounterInfoAMD(group, counter, pname, memAddress(data)); + } + + public static void glGetPerfMonitorCounterInfoAMD(@NativeType("GLuint") int group, @NativeType("GLuint") int counter, @NativeType("GLenum") int pname, @NativeType("void *") IntBuffer data) { + if (CHECKS) { + check(data, 4 >> 2); + } + nglGetPerfMonitorCounterInfoAMD(group, counter, pname, memAddress(data)); + } + + public static void glGetPerfMonitorCounterInfoAMD(@NativeType("GLuint") int group, @NativeType("GLuint") int counter, @NativeType("GLenum") int pname, @NativeType("void *") FloatBuffer data) { + if (CHECKS) { + check(data, 4 >> 2); + } + nglGetPerfMonitorCounterInfoAMD(group, counter, pname, memAddress(data)); + } + + // --- [ glGenPerfMonitorsAMD ] --- + + public static native void nglGenPerfMonitorsAMD(int n, long monitors); + + public static void glGenPerfMonitorsAMD(@NativeType("GLuint *") IntBuffer monitors) { + nglGenPerfMonitorsAMD(monitors.remaining(), memAddress(monitors)); + } + + @NativeType("void") + public static int glGenPerfMonitorsAMD() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer monitors = stack.callocInt(1); + nglGenPerfMonitorsAMD(1, memAddress(monitors)); + return monitors.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glDeletePerfMonitorsAMD ] --- + + public static native void nglDeletePerfMonitorsAMD(int n, long monitors); + + public static void glDeletePerfMonitorsAMD(@NativeType("GLuint *") IntBuffer monitors) { + nglDeletePerfMonitorsAMD(monitors.remaining(), memAddress(monitors)); + } + + public static void glDeletePerfMonitorsAMD(@NativeType("GLuint *") int monitor) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer monitors = stack.ints(monitor); + nglDeletePerfMonitorsAMD(1, memAddress(monitors)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glSelectPerfMonitorCountersAMD ] --- + + public static native void nglSelectPerfMonitorCountersAMD(int monitor, boolean enable, int group, int numCounters, long counterList); + + public static void glSelectPerfMonitorCountersAMD(@NativeType("GLuint") int monitor, @NativeType("GLboolean") boolean enable, @NativeType("GLuint") int group, @NativeType("GLuint *") IntBuffer counterList) { + nglSelectPerfMonitorCountersAMD(monitor, enable, group, counterList.remaining(), memAddress(counterList)); + } + + // --- [ glBeginPerfMonitorAMD ] --- + + public static native void glBeginPerfMonitorAMD(@NativeType("GLuint") int monitor); + + // --- [ glEndPerfMonitorAMD ] --- + + public static native void glEndPerfMonitorAMD(@NativeType("GLuint") int monitor); + + // --- [ glGetPerfMonitorCounterDataAMD ] --- + + public static native void nglGetPerfMonitorCounterDataAMD(int monitor, int pname, int dataSize, long data, long bytesWritten); + + public static void glGetPerfMonitorCounterDataAMD(@NativeType("GLuint") int monitor, @NativeType("GLenum") int pname, @NativeType("GLuint *") IntBuffer data, @Nullable @NativeType("GLint *") IntBuffer bytesWritten) { + if (CHECKS) { + checkSafe(bytesWritten, 1); + } + nglGetPerfMonitorCounterDataAMD(monitor, pname, data.remaining(), memAddress(data), memAddressSafe(bytesWritten)); + } + + /** Array version of: {@link #glGetPerfMonitorGroupsAMD GetPerfMonitorGroupsAMD} */ + public static void glGetPerfMonitorGroupsAMD(@Nullable @NativeType("GLint *") int[] numGroups, @Nullable @NativeType("GLuint *") int[] groups) { + long __functionAddress = GL.getICD().glGetPerfMonitorGroupsAMD; + if (CHECKS) { + check(__functionAddress); + checkSafe(numGroups, 1); + } + callPPV(numGroups, lengthSafe(groups), groups, __functionAddress); + } + + /** Array version of: {@link #glGetPerfMonitorCountersAMD GetPerfMonitorCountersAMD} */ + public static void glGetPerfMonitorCountersAMD(@NativeType("GLuint") int group, @NativeType("GLint *") int[] numCounters, @NativeType("GLint *") int[] maxActiveCounters, @NativeType("GLuint *") int[] counters) { + long __functionAddress = GL.getICD().glGetPerfMonitorCountersAMD; + if (CHECKS) { + check(__functionAddress); + check(numCounters, 1); + check(maxActiveCounters, 1); + } + callPPPV(group, numCounters, maxActiveCounters, counters.length, counters, __functionAddress); + } + + /** Array version of: {@link #glGetPerfMonitorGroupStringAMD GetPerfMonitorGroupStringAMD} */ + public static void glGetPerfMonitorGroupStringAMD(@NativeType("GLuint") int group, @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer groupString) { + long __functionAddress = GL.getICD().glGetPerfMonitorGroupStringAMD; + if (CHECKS) { + check(__functionAddress); + check(length, 1); + } + callPPV(group, groupString.remaining(), length, memAddress(groupString), __functionAddress); + } + + /** Array version of: {@link #glGetPerfMonitorCounterStringAMD GetPerfMonitorCounterStringAMD} */ + public static void glGetPerfMonitorCounterStringAMD(@NativeType("GLuint") int group, @NativeType("GLuint") int counter, @Nullable @NativeType("GLsizei *") int[] length, @Nullable @NativeType("GLchar *") ByteBuffer counterString) { + long __functionAddress = GL.getICD().glGetPerfMonitorCounterStringAMD; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + } + callPPV(group, counter, remainingSafe(counterString), length, memAddressSafe(counterString), __functionAddress); + } + + /** Array version of: {@link #glGetPerfMonitorCounterInfoAMD GetPerfMonitorCounterInfoAMD} */ + public static void glGetPerfMonitorCounterInfoAMD(@NativeType("GLuint") int group, @NativeType("GLuint") int counter, @NativeType("GLenum") int pname, @NativeType("void *") int[] data) { + long __functionAddress = GL.getICD().glGetPerfMonitorCounterInfoAMD; + if (CHECKS) { + check(__functionAddress); + check(data, 4 >> 2); + } + callPV(group, counter, pname, data, __functionAddress); + } + + /** Array version of: {@link #glGetPerfMonitorCounterInfoAMD GetPerfMonitorCounterInfoAMD} */ + public static void glGetPerfMonitorCounterInfoAMD(@NativeType("GLuint") int group, @NativeType("GLuint") int counter, @NativeType("GLenum") int pname, @NativeType("void *") float[] data) { + long __functionAddress = GL.getICD().glGetPerfMonitorCounterInfoAMD; + if (CHECKS) { + check(__functionAddress); + check(data, 4 >> 2); + } + callPV(group, counter, pname, data, __functionAddress); + } + + /** Array version of: {@link #glGenPerfMonitorsAMD GenPerfMonitorsAMD} */ + public static void glGenPerfMonitorsAMD(@NativeType("GLuint *") int[] monitors) { + long __functionAddress = GL.getICD().glGenPerfMonitorsAMD; + if (CHECKS) { + check(__functionAddress); + } + callPV(monitors.length, monitors, __functionAddress); + } + + /** Array version of: {@link #glDeletePerfMonitorsAMD DeletePerfMonitorsAMD} */ + public static void glDeletePerfMonitorsAMD(@NativeType("GLuint *") int[] monitors) { + long __functionAddress = GL.getICD().glDeletePerfMonitorsAMD; + if (CHECKS) { + check(__functionAddress); + } + callPV(monitors.length, monitors, __functionAddress); + } + + /** Array version of: {@link #glSelectPerfMonitorCountersAMD SelectPerfMonitorCountersAMD} */ + public static void glSelectPerfMonitorCountersAMD(@NativeType("GLuint") int monitor, @NativeType("GLboolean") boolean enable, @NativeType("GLuint") int group, @NativeType("GLuint *") int[] counterList) { + long __functionAddress = GL.getICD().glSelectPerfMonitorCountersAMD; + if (CHECKS) { + check(__functionAddress); + } + callPV(monitor, enable, group, counterList.length, counterList, __functionAddress); + } + + /** Array version of: {@link #glGetPerfMonitorCounterDataAMD GetPerfMonitorCounterDataAMD} */ + public static void glGetPerfMonitorCounterDataAMD(@NativeType("GLuint") int monitor, @NativeType("GLenum") int pname, @NativeType("GLuint *") int[] data, @Nullable @NativeType("GLint *") int[] bytesWritten) { + long __functionAddress = GL.getICD().glGetPerfMonitorCounterDataAMD; + if (CHECKS) { + check(__functionAddress); + checkSafe(bytesWritten, 1); + } + callPPV(monitor, pname, data.length, data, bytesWritten, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDPinnedMemory.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDPinnedMemory.java new file mode 100644 index 00000000..f68951d9 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDPinnedMemory.java @@ -0,0 +1,23 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the AMD_pinned_memory extension. + * + *

This extension defines an interface that allows improved control of the physical memory used by the graphics device.

+ * + *

It allows an existing page of system memory allocated by the application to be used as memory directly accessible to the graphics processor. One + * example application of this functionality would be to be able to avoid an explicit synchronous copy with sub-system of the application; for instance it + * is possible to directly draw from a system memory copy of a video image.

+ */ +public final class AMDPinnedMemory { + + public static final int GL_EXTERNAL_VIRTUAL_MEMORY_BUFFER_AMD = 0x9160; + + private AMDPinnedMemory() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDQueryBufferObject.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDQueryBufferObject.java new file mode 100644 index 00000000..d8cc46b6 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDQueryBufferObject.java @@ -0,0 +1,43 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the AMD_query_buffer_object extension. + * + *

Statistics about the operation of the OpenGL pipeline, such as the number of samples that passed the depth test, the elapsed time between two events or + * the number of vertices written to a transform feedback buffer may be retrieved from the GL through query objects. The current value of a query object + * may be retrieved by the application through the OpenGL API. Should the result returned by the API be required for use in a shader, it must be passed + * back to the GL via a program uniform or some other mechanism. This requires a round-trip from the GPU to the CPU and back.

+ * + *

This extension introduces a mechanism whereby the current value of a query result may be retrieved into a buffer object instead of client memory. This + * allows the query result to be made available to a shader without a round-trip to the CPU for example by subsequently using the buffer object as a + * uniform buffer, texture buffer or other data store visible to the shader. This functionality may also be used to place the results of many query + * objects into a single, large buffer and then map or otherwise read back the entire buffer at a later point in time, avoiding a per-query CPU-GPU + * synchronization event.

+ * + *

The result of any query object type supported by the GL implementation may be retrieved into a buffer object. The implementation will determine the + * most efficient method of copying the query result to the buffer.

+ * + *

Requires {@link GL15 OpenGL 1.5}.

+ */ +public final class AMDQueryBufferObject { + + /** Accepted by the {@code pname} parameter of GetQueryObjectiv, GetQueryObjectuiv, GetQueryObjecti64v and GetQueryObjectui64v. */ + public static final int GL_QUERY_RESULT_NO_WAIT_AMD = 0x9194; + + /** + * Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, MapBufferRange, GetBufferSubData, + * GetBufferParameteriv and GetBufferPointerv. + */ + public static final int GL_QUERY_BUFFER_AMD = 0x9192; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_QUERY_BUFFER_BINDING_AMD = 0x9193; + + private AMDQueryBufferObject() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDSamplePositions.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDSamplePositions.java new file mode 100644 index 00000000..d3a3b033 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDSamplePositions.java @@ -0,0 +1,64 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the AMD_sample_positions extension. + * + *

This extension provides a mechanism to explicitly set sample positions for a FBO with multi-sampled attachments. The FBO will use identical sample + * locations for all pixels in each attachment. This forces TEXTURE_FIXED_SAMPLE_LOCATIONS to TRUE if a multi-sampled texture is specified using + * TexImage2DMultisample or TexImage3DMultisample. That is, using GetTexLevelParameter to query TEXTURE_FIXED_SAMPLE_LOCATIONS will always return TRUE if + * the mechanism is explicitly used to set the sample positions.

+ * + *

Requires {@link GL32 OpenGL 3.2} or {@link EXTFramebufferMultisample EXT_framebuffer_multisample}.

+ */ +public class AMDSamplePositions { + + /** Accepted by the {@code pname} parameter of GetFloatv. */ + public static final int GL_SUBSAMPLE_DISTANCE_AMD = 0x883F; + + static { GL.initialize(); } + + protected AMDSamplePositions() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glSetMultisamplefvAMD + ); + } + + // --- [ glSetMultisamplefvAMD ] --- + + public static native void nglSetMultisamplefvAMD(int pname, int index, long val); + + public static void glSetMultisamplefvAMD(@NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer val) { + if (CHECKS) { + check(val, 2); + } + nglSetMultisamplefvAMD(pname, index, memAddress(val)); + } + + /** Array version of: {@link #glSetMultisamplefvAMD SetMultisamplefvAMD} */ + public static void glSetMultisamplefvAMD(@NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] val) { + long __functionAddress = GL.getICD().glSetMultisamplefvAMD; + if (CHECKS) { + check(__functionAddress); + check(val, 2); + } + callPV(pname, index, val, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDSeamlessCubemapPerTexture.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDSeamlessCubemapPerTexture.java new file mode 100644 index 00000000..95f7d4b7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDSeamlessCubemapPerTexture.java @@ -0,0 +1,34 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the AMD_seamless_cubemap_per_texture extension. + * + *

In unextended OpenGL, cube maps are treated as sets of six, independent texture images. Once a face is selected from the set, it is treated exactly as + * any other two-dimensional texture would be. When sampling linearly from the texture, all of the individual texels that would be used to to create the + * final, bilinear sample values are taken from the same cube face. The normal, two-dimensional texture coordinate wrapping modes are honored. This + * sometimes causes seams to appear in cube maps.

+ * + *

ARB_seamless_cube_map addresses this issue by providing a mechanism whereby an implementation could take each of the taps of a bilinear sample from a + * different face, spanning face boundaries and providing seamless filtering from cube map textures. However, in ARB_seamless_cube_map, this feature was + * exposed as a global state, affecting all bound cube map textures. It was not possible to mix seamless and per-face cube map sampling modes during + * multisampling. Furthermore, if an application included cube maps that were meant to be sampled seamlessly and non-seamlessly, it would have to track + * this state and enable or disable seamless cube map sampling as needed.

+ * + *

This extension addresses this issue and provides an orthogonal method for allowing an implementation to provide a per-texture setting for enabling + * seamless sampling from cube maps.

+ * + *

Requires {@link ARBTextureCubeMap ARB_texture_cube_map}.

+ */ +public final class AMDSeamlessCubemapPerTexture { + + /** Accepted by the {@code pname} parameter of TexParameterf, TexParameteri, TexParameterfv, TexParameteriv, GetTexParameterfv, and GetTexParameteriv. */ + public static final int GL_TEXTURE_CUBE_MAP_SEAMLESS = 0x884F; + + private AMDSeamlessCubemapPerTexture() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDSparseTexture.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDSparseTexture.java new file mode 100644 index 00000000..0f220e0a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDSparseTexture.java @@ -0,0 +1,70 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the AMD_sparse_texture extension. + * + *

Recent advances in application complexity and a desire for higher resolutions have pushed texture sizes up considerably. Often, the amount of physical + * memory available to a graphics processor is a limiting factor in the performance of texture-heavy applications. Once the available physical memory is + * exhausted, paging may occur bringing performance down considerably - or worse, the application may fail. Nevertheless, the amount of address space + * available to the graphics processor has increased to the point where many gigabytes - or even terabytes of address space may be usable even though that + * amount of physical memory is not present.

+ * + *

This extension allows the separation of the graphics processor's address space (reservation) from the requirement that all textures must be physically + * backed (commitment). This exposes a limited form of virtualization for textures. Use cases include sparse (or partially resident) textures, texture + * paging, on-demand and delayed loading of texture assets and application controlled level of detail.

+ * + *

Requires {@link GL20 OpenGL 2.0} or {@link ARBFragmentShader ARB_fragment_shader}.

+ */ +public class AMDSparseTexture { + + /** Accepted by the {@code flags} parameter to TexStorageSparseAMD and TextureStorageSparseAMD. */ + public static final int GL_TEXTURE_STORAGE_SPARSE_BIT_AMD = 0x1; + + /** Accepted by the {@code pname} parameter to GetInternalformativ. */ + public static final int + GL_VIRTUAL_PAGE_SIZE_X_AMD = 0x9195, + GL_VIRTUAL_PAGE_SIZE_Y_AMD = 0x9196, + GL_VIRTUAL_PAGE_SIZE_Z_AMD = 0x9197; + + /** Accepted by the {@code pname} parameter to GetIntegerv, GetFloatv, GetDoublev, GetInteger64v, and GetBooleanv. */ + public static final int + GL_MAX_SPARSE_TEXTURE_SIZE_AMD = 0x9198, + GL_MAX_SPARSE_3D_TEXTURE_SIZE_AMD = 0x9199, + GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS = 0x919A; + + /** Accepted by the {@code pname} parameter of GetTexParameter{if}v. */ + public static final int GL_MIN_SPARSE_LEVEL_AMD = 0x919B; + + /** Accepted by the {@code pname} parameter of TexParameter{if}{v} and GetTexParameter{if}v. */ + public static final int GL_MIN_LOD_WARNING_AMD = 0x919C; + + static { GL.initialize(); } + + protected AMDSparseTexture() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glTexStorageSparseAMD, caps.glTextureStorageSparseAMD + ); + } + + // --- [ glTexStorageSparseAMD ] --- + + public static native void glTexStorageSparseAMD(@NativeType("GLenum") int target, @NativeType("GLenum") int internalFormat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLsizei") int layers, @NativeType("GLbitfield") int flags); + + // --- [ glTextureStorageSparseAMD ] --- + + public static native void glTextureStorageSparseAMD(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int internalFormat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLsizei") int layers, @NativeType("GLbitfield") int flags); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDStencilOperationExtended.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDStencilOperationExtended.java new file mode 100644 index 00000000..201605cb --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDStencilOperationExtended.java @@ -0,0 +1,52 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the AMD_stencil_operation_extended extension. + * + *

Stencil buffers are special buffers that allow tests to be made against an incoming value and action taken based on that value. The stencil buffer is + * updated during rasterization, and the operation used to update the stencil buffer is chosen based on whether the fragment passes the stencil test, and + * if it does, whether it passes the depth test. Traditional OpenGL includes support for several primitive operations, such as incrementing, or clearing + * the content of the stencil buffer, or replacing it with a specified reference value.

+ * + *

This extension adds support for an additional set of operations that may be performed on the stencil buffer under each circumstance. Additionally, this + * extension separates the value used as the source for stencil operations from the reference value, allowing different values to be used in the stencil + * test, and in the update of the stencil buffer.

+ */ +public class AMDStencilOperationExtended { + + /** Accepted by the {@code sfail}, {@code dpfail} and {@code dppass} parameters of StencilOp and StencilOpSeparate. */ + public static final int + GL_SET_AMD = 0x874A, + GL_REPLACE_VALUE_AMD = 0x874B; + + /** Accepted by the {@code param} parameter of GetIntegerv, GetFloatv, GetBooleanv GetDoublev and GetInteger64v. */ + public static final int + GL_STENCIL_OP_VALUE_AMD = 0x874C, + GL_STENCIL_BACK_OP_VALUE_AMD = 0x874D; + + static { GL.initialize(); } + + protected AMDStencilOperationExtended() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glStencilOpValueAMD + ); + } + + // --- [ glStencilOpValueAMD ] --- + + public static native void glStencilOpValueAMD(@NativeType("GLenum") int face, @NativeType("GLuint") int value); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDTransformFeedback4.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDTransformFeedback4.java new file mode 100644 index 00000000..a73175a5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDTransformFeedback4.java @@ -0,0 +1,23 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the AMD_transform_feedback4 extension. + * + *

This extension enhances transform feedback in two significant ways. First, it allows multiple transform feedback streams to be captured, each with its + * own, independent primitve type. Second, it allows any combination of streams to be rasterized.

+ * + *

Requires {@link GL40 OpenGL 4.0} or {@link ARBTransformFeedback3 ARB_transform_feedback3}.

+ */ +public final class AMDTransformFeedback4 { + + /** Accepted by the {@code pname} argument to Enablei. Disablei and IsEnabledi. */ + public static final int GL_STREAM_RASTERIZATION_AMD = 0x91A0; + + private AMDTransformFeedback4() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDVertexShaderTessellator.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDVertexShaderTessellator.java new file mode 100644 index 00000000..34fa9e55 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/AMDVertexShaderTessellator.java @@ -0,0 +1,108 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the AMD_vertex_shader_tessellator extension. + * + *

The vertex shader tessellator gives new flexibility to the shader author to shade at a tessellated vertex, rather than just at a provided vertex.

+ * + *

In unextended vertex shading, the built-in attributes such as gl_Vertex, gl_Normal, and gl_MultiTexcoord0, together with the user defined attributes, + * are system provided values which are initialized prior to vertex shader invocation.

+ * + *

With vertex shading tessellation, additional vertex shader special values are available:

+ * + *

+ *         ivec3 gl_VertexTriangleIndex; // indices of the three control
+ *                                       // points for the vertex
+ *         vec3 gl_BarycentricCoord;     // barycentric coordinates
+ *                                       // of the vertex
+ * 
+ *     i o
+ *       |\
+ *       | \
+ *       *--*
+ *       |\ |\
+ *       | \| \
+ *       *--*--*
+ *       |\ |\ |\
+ *       | \| \| \
+ *     j o--*--*--o k
+ * 
+ *     Figure 1  A Tessellated Triangle
+ *     o = control point (and tessellated vertex)
+ *     * = tessellated vertex
+ * 
+ *         ivec4 gl_VertexQuadIndex;   // indices for the four control
+ *                                     // points for the vertex
+ *         vec2 gl_UVCoord;            // UV coordinates of the vertex
+ * 
+ *     i o--*--*--o k
+ *       |\ |\ |\ |
+ *       | \| \| \|
+ *       *--*--*--*
+ *       |\ |\ |\ |
+ *       | \| \| \|
+ *       *--*--*--*
+ *       |\ |\ |\ |
+ *       | \| \| \|
+ *     j o--*--*--o l
+ * 
+ *     Figure 2  A Tessellated Quad
+ *     o = control point (and tessellated vertex)
+ *     * = tessellated vertex
+ * + *

When this extension is enabled, conventional built-in attributes and user defined attributes are uninitialized. The shader writer is responsible for + * explicitly fetching all other vertex data either from textures, uniform buffers, or vertex buffers.

+ * + *

The shader writer is further responsible for interpolating the vertex data at the given barycentric coordinates or uv coordinates of the vertex.

+ * + *

Requires {@link GL20 OpenGL 2.0}.

+ */ +public class AMDVertexShaderTessellator { + + /** Returned by the {@code type} parameter of GetActiveUniform. */ + public static final int + GL_SAMPLER_BUFFER_AMD = 0x9001, + GL_INT_SAMPLER_BUFFER_AMD = 0x9002, + GL_UNSIGNED_INT_SAMPLER_BUFFER_AMD = 0x9003; + + /** Accepted by TessellationModeAMD. */ + public static final int + GL_DISCRETE_AMD = 0x9006, + GL_CONTINUOUS_AMD = 0x9007; + + /** Accepted by GetIntegerv. */ + public static final int GL_TESSELLATION_MODE_AMD = 0x9004; + + /** Accepted by GetFloatv. */ + public static final int GL_TESSELLATION_FACTOR_AMD = 0x9005; + + static { GL.initialize(); } + + protected AMDVertexShaderTessellator() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glTessellationFactorAMD, caps.glTessellationModeAMD + ); + } + + // --- [ glTessellationFactorAMD ] --- + + public static native void glTessellationFactorAMD(@NativeType("GLfloat") float factor); + + // --- [ glTessellationModeAMD ] --- + + public static native void glTessellationModeAMD(@NativeType("GLenum") int mode); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBBaseInstance.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBBaseInstance.java new file mode 100644 index 00000000..567e1157 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBBaseInstance.java @@ -0,0 +1,213 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_base_instance extension. + * + *

This extension allows the offset within buffer objects used for instanced rendering to be specified. This is congruent with the {@code first} parameter + * in {@link GL11C#glDrawArrays DrawArrays} and the {@code basevertex} parameter in {@link GL11C#glDrawElements DrawElements}. When instanced rendering is performed (for example, through + * {@link GL31C#glDrawArraysInstanced DrawArraysInstanced}), instanced vertex attributes whose vertex attribute divisors are non-zero are fetched from enabled vertex arrays + * per-instance rather than per-vertex. However, in unextended OpenGL, there is no way to define the offset into those arrays from which the attributes are + * fetched. This extension adds that offset in the form of a {@code } parameter to several new procedures.

+ * + *

The {@code baseinstance} parameter is added to the index of the array element, after division by the vertex attribute divisor. This allows several sets + * of instanced vertex attribute data to be stored in a single vertex array, and the base offset of that data to be specified for each draw. Further, this + * extension exposes the {@code } parameter as the final and previously undefined structure member of the draw-indirect data structure.

+ * + *

Requires {@link GL31 OpenGL 3.1} or {@link ARBDrawInstanced ARB_draw_instanced}. Promoted to core in {@link GL42 OpenGL 4.2}.

+ */ +public class ARBBaseInstance { + + static { GL.initialize(); } + + protected ARBBaseInstance() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glDrawArraysInstancedBaseInstance, caps.glDrawElementsInstancedBaseInstance, caps.glDrawElementsInstancedBaseVertexBaseInstance + ); + } + + // --- [ glDrawArraysInstancedBaseInstance ] --- + + /** + * Draws multiple instances of a range of elements with an offset applied to instanced attributes. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param first the starting index in the enabled arrays + * @param count the number of indices to be rendered + * @param primcount the number of instances of the specified range of indices to be rendered + * @param baseinstance the base instance for use in fetching instanced vertex attributes + */ + public static void glDrawArraysInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("GLint") int first, @NativeType("GLsizei") int count, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance) { + GL42C.glDrawArraysInstancedBaseInstance(mode, first, count, primcount, baseinstance); + } + + // --- [ glDrawElementsInstancedBaseInstance ] --- + + /** + * Unsafe version of: {@link #glDrawElementsInstancedBaseInstance DrawElementsInstancedBaseInstance} + * + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static void nglDrawElementsInstancedBaseInstance(int mode, int count, int type, long indices, int primcount, int baseinstance) { + GL42C.nglDrawElementsInstancedBaseInstance(mode, count, type, indices, primcount, baseinstance); + } + + /** + * Draws multiple instances of a set of elements with an offset applied to instanced attributes + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the specified range of indices to be rendered + * @param baseinstance the base instance for use in fetching instanced vertex attributes + */ + public static void glDrawElementsInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance) { + GL42C.glDrawElementsInstancedBaseInstance(mode, count, type, indices, primcount, baseinstance); + } + + /** + * Draws multiple instances of a set of elements with an offset applied to instanced attributes + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the specified range of indices to be rendered + * @param baseinstance the base instance for use in fetching instanced vertex attributes + */ + public static void glDrawElementsInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance) { + GL42C.glDrawElementsInstancedBaseInstance(mode, type, indices, primcount, baseinstance); + } + + /** + * Draws multiple instances of a set of elements with an offset applied to instanced attributes + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the specified range of indices to be rendered + * @param baseinstance the base instance for use in fetching instanced vertex attributes + */ + public static void glDrawElementsInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance) { + GL42C.glDrawElementsInstancedBaseInstance(mode, indices, primcount, baseinstance); + } + + /** + * Draws multiple instances of a set of elements with an offset applied to instanced attributes + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the specified range of indices to be rendered + * @param baseinstance the base instance for use in fetching instanced vertex attributes + */ + public static void glDrawElementsInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("void const *") ShortBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance) { + GL42C.glDrawElementsInstancedBaseInstance(mode, indices, primcount, baseinstance); + } + + /** + * Draws multiple instances of a set of elements with an offset applied to instanced attributes + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the specified range of indices to be rendered + * @param baseinstance the base instance for use in fetching instanced vertex attributes + */ + public static void glDrawElementsInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance) { + GL42C.glDrawElementsInstancedBaseInstance(mode, indices, primcount, baseinstance); + } + + // --- [ glDrawElementsInstancedBaseVertexBaseInstance ] --- + + /** + * Unsafe version of: {@link #glDrawElementsInstancedBaseVertexBaseInstance DrawElementsInstancedBaseVertexBaseInstance} + * + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static void nglDrawElementsInstancedBaseVertexBaseInstance(int mode, int count, int type, long indices, int primcount, int basevertex, int baseinstance) { + GL42C.nglDrawElementsInstancedBaseVertexBaseInstance(mode, count, type, indices, primcount, basevertex, baseinstance); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * @param baseinstance the base instance for use in fetching instanced vertex attributes + */ + public static void glDrawElementsInstancedBaseVertexBaseInstance(@NativeType("GLenum") int mode, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex, @NativeType("GLuint") int baseinstance) { + GL42C.glDrawElementsInstancedBaseVertexBaseInstance(mode, count, type, indices, primcount, basevertex, baseinstance); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * @param baseinstance the base instance for use in fetching instanced vertex attributes + */ + public static void glDrawElementsInstancedBaseVertexBaseInstance(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex, @NativeType("GLuint") int baseinstance) { + GL42C.glDrawElementsInstancedBaseVertexBaseInstance(mode, type, indices, primcount, basevertex, baseinstance); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * @param baseinstance the base instance for use in fetching instanced vertex attributes + */ + public static void glDrawElementsInstancedBaseVertexBaseInstance(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex, @NativeType("GLuint") int baseinstance) { + GL42C.glDrawElementsInstancedBaseVertexBaseInstance(mode, indices, primcount, basevertex, baseinstance); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * @param baseinstance the base instance for use in fetching instanced vertex attributes + */ + public static void glDrawElementsInstancedBaseVertexBaseInstance(@NativeType("GLenum") int mode, @NativeType("void const *") ShortBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex, @NativeType("GLuint") int baseinstance) { + GL42C.glDrawElementsInstancedBaseVertexBaseInstance(mode, indices, primcount, basevertex, baseinstance); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * @param baseinstance the base instance for use in fetching instanced vertex attributes + */ + public static void glDrawElementsInstancedBaseVertexBaseInstance(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex, @NativeType("GLuint") int baseinstance) { + GL42C.glDrawElementsInstancedBaseVertexBaseInstance(mode, indices, primcount, basevertex, baseinstance); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBBindlessTexture.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBBindlessTexture.java new file mode 100644 index 00000000..91c953ca --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBBindlessTexture.java @@ -0,0 +1,398 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_bindless_texture extension. + * + *

This extension allows OpenGL applications to access texture objects in shaders without first binding each texture to one of a limited number of texture + * image units. Using this extension, an application can query a 64-bit unsigned integer texture handle for each texture that it wants to access and then + * use that handle directly in GLSL or assembly-based shaders. The ability to access textures without having to bind and/or re-bind them is similar to the + * capability provided by the {@link NVShaderBufferLoad NV_shader_buffer_load} extension that allows shaders to access buffer objects without binding them. In both cases, + * these extensions significantly reduce the amount of API and internal GL driver overhead needed to manage resource bindings.

+ * + *

This extension also provides similar capability for the image load, store, and atomic functionality provided by OpenGL 4.2 and the + * {@link ARBShaderImageLoadStore ARB_shader_image_load_store} and {@link EXTShaderImageLoadStore EXT_shader_image_load_store} extensions, where a texture can be accessed without first binding it to an + * image unit. An image handle can be extracted from a texture object using an API with a set of parameters similar to those for + * {@link EXTShaderImageLoadStore#glBindImageTextureEXT BindImageTextureEXT}.

+ * + *

This extension adds no new data types to GLSL. Instead, it uses existing sampler and image data types and allows them to be populated with texture and + * image handles. This extension does permit sampler and image data types to be used in more contexts than in unextended GLSL 4.00. In particular, sampler + * and image types may be used as shader inputs/outputs, temporary variables, and uniform block members, and may be assigned to by shader code. + * Constructors are provided to convert unsigned integer values to and from sampler and image data types. Additionally, new APIs are provided to load + * values for sampler and image uniforms with 64-bit handle inputs. The use of existing integer-based Uniform* APIs is still permitted, in which case the + * integer specified will identify a texture image or image unit. For samplers and images with values specified as texture image or image units, the GL + * implemenation will translate the unit number to an internal handle as required.

+ * + *

To access texture or image resources using handles, the handles must first be made resident. Accessing a texture or image by handle without first + * making it resident can result in undefined results, including program termination. Since the amount of texture memory required by an application may + * exceed the amount of memory available to the system, this extension provides API calls allowing applications to manage overall texture memory + * consumption by making a texture resident and non-resident as required.

+ * + *

Requires {@link GL40 OpenGL 4.0}.

+ */ +public class ARBBindlessTexture { + + /** Accepted by the {@code type} parameter of VertexAttribLPointer. */ + public static final int GL_UNSIGNED_INT64_ARB = 0x140F; + + static { GL.initialize(); } + + protected ARBBindlessTexture() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glGetTextureHandleARB, caps.glGetTextureSamplerHandleARB, caps.glMakeTextureHandleResidentARB, caps.glMakeTextureHandleNonResidentARB, + caps.glGetImageHandleARB, caps.glMakeImageHandleResidentARB, caps.glMakeImageHandleNonResidentARB, caps.glUniformHandleui64ARB, + caps.glUniformHandleui64vARB, caps.glProgramUniformHandleui64ARB, caps.glProgramUniformHandleui64vARB, caps.glIsTextureHandleResidentARB, + caps.glIsImageHandleResidentARB, caps.glVertexAttribL1ui64ARB, caps.glVertexAttribL1ui64vARB, caps.glGetVertexAttribLui64vARB + ); + } + + // --- [ glGetTextureHandleARB ] --- + + /** + * Creates a texture handle using the current state of the texture named {@code texture}, including any embedded sampler state. See + * {@link #glGetTextureSamplerHandleARB GetTextureSamplerHandleARB} for details. + * + * @param texture the texture object + */ + @NativeType("GLuint64") + public static native long glGetTextureHandleARB(@NativeType("GLuint") int texture); + + // --- [ glGetTextureSamplerHandleARB ] --- + + /** + * Creates a texture handle using the current non-sampler state from the texture named {@code texture} and the sampler state from the sampler object + * {@code sampler}. In both cases, a 64-bit unsigned integer handle is returned. The error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} is generated if {@code texture} is zero or is + * not the name of an existing texture object or if {@code sampler} is zero or is not the name of an existing sampler object. The error + * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated if the texture object {@code texture} is not complete. If an error occurs, a handle of zero is returned. + * + *

The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated if the border color (taken from the embedded sampler for GetTextureHandleARB or from the {@code sampler} + * for GetTextureSamplerHandleARB) is not one of the following allowed values. If the texture's base internal format is signed or unsigned integer, allowed + * values are (0,0,0,0), (0,0,0,1), (1,1,1,0), and (1,1,1,1). If the base internal format is not integer, allowed values are (0.0,0.0,0.0,0.0), + * (0.0,0.0,0.0,1.0), (1.0,1.0,1.0,0.0), and (1.0,1.0,1.0,1.0).

+ * + *

The handle for each texture or texture/sampler pair is unique; the same handle will be returned if GetTextureHandleARB is called multiple times for the + * same texture or if GetTextureSamplerHandleARB is called multiple times for the same texture/sampler pair.

+ * + *

When a texture object is referenced by one or more texture handles, the texture parameters of the object may not be changed, and the size and format of + * the images in the texture object may not be re-specified. The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated if the functions TexImage*, CopyTexImage*, + * CompressedTexImage*, TexBuffer*, or TexParameter* are called to modify a texture object referenced by one or more texture handles. The contents of the + * images in a texture object may still be updated via commands such as TexSubImage*, CopyTexSubImage*, and CompressedTexSubImage*, and by rendering to a + * framebuffer object, even if the texture object is referenced by one or more texture handles.

+ * + *

The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated by {@link GL15C#glBufferData BufferData} if it is called to modify a buffer object bound to a buffer texture while that + * texture object is referenced by one or more texture handles. The contents of the buffer object may still be updated via buffer update commands such as + * {@link GL15C#glBufferSubData BufferSubData} and MapBuffer*, or via the texture update commands, even if the buffer is bound to a texture while that buffer texture object is + * referenced by one or more texture handles.

+ * + *

When a sampler object is referenced by one or more texture handles, the sampler parameters of the object may not be changed. The error + * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated when calling SamplerParameter* functions to modify a sampler object referenced by one or more texture handles.

+ * + * @param texture the texture object + * @param sampler the sampler object + */ + @NativeType("GLuint64") + public static native long glGetTextureSamplerHandleARB(@NativeType("GLuint") int texture, @NativeType("GLuint") int sampler); + + // --- [ glMakeTextureHandleResidentARB ] --- + + /** + * Make a texture handle resident, so that it is accessible to shaders for texture mapping operations. + * + *

While the texture handle is resident, it may be used in texture mapping operations. If a shader attempts to perform a texture mapping operation using a + * handle that is not resident, the results of that operation are undefined and may lead to application termination. When a texture handle is resident, the + * texture it references is also considered resident for the purposes of the {@link GL11#glAreTexturesResident AreTexturesResident} command. The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is + * generated if {@code handle} is not a valid texture handle, or if {@code handle} is already resident in the current GL context.

+ * + * @param handle the texture handle + */ + public static native void glMakeTextureHandleResidentARB(@NativeType("GLuint64") long handle); + + // --- [ glMakeTextureHandleNonResidentARB ] --- + + /** + * Makes a texture handle inaccessible to shaders. + * + *

The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated if {@code handle} is not a valid texture handle, or if {@code handle} is not resident in the current GL + * context.

+ * + * @param handle the texture handle + */ + public static native void glMakeTextureHandleNonResidentARB(@NativeType("GLuint64") long handle); + + // --- [ glGetImageHandleARB ] --- + + /** + * Creates and returns an image handle for level {@code level} of the texture named {@code texture}. If {@code layered} is {@link GL11#GL_TRUE TRUE}, a handle is created + * for the entire texture level. If {@code layered} is {@link GL11#GL_FALSE FALSE}, a handle is created for only the layer {@code layer} of the texture level. + * {@code format} specifies a format used to interpret the texels of the image when used for image loads, stores, and atomics, and has the same meaning as + * the {@code format} parameter of {@link EXTShaderImageLoadStore#glBindImageTextureEXT BindImageTextureEXT}. A 64-bit unsigned integer handle is returned if the command succeeds; otherwise, zero is + * returned. + * + *

The error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} is generated by GetImageHandleARB if:

+ * + *
    + *
  • {@code texture} is zero or not the name of an existing texture object;
  • + *
  • the image for the texture level {@code level} doesn't exist (i.e., has a size of zero in {@code texture}); or
  • + *
  • {@code layered} is FALSE and {@code layer} is greater than or equal to the number of layers in the image at level {@code level}.
  • + *
+ * + *

The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated by GetImageHandleARB if:

+ * + *
    + *
  • the texture object {@code texture} is not complete (section 3.9.14);
  • + *
  • {@code layered} is TRUE and the texture is not a three-dimensional, one-dimensional array, two dimensional array, cube map, or cube map array + * texture.
  • + *
+ * + *

When a texture object is referenced by one or more image handles, the texture parameters of the object may not be changed, and the size and format of + * the images in the texture object may not be re-specified. The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated when calling TexImage*, CopyTexImage*, + * CompressedTexImage*, TexBuffer*, or TexParameter* functions while a texture object is referenced by one or more image handles. The contents of the + * images in a texture object may still be updated via commands such as TexSubImage*, CopyTexSubImage*, and CompressedTexSubImage*, and by rendering to a + * framebuffer object, even if the texture object is referenced by one or more image handles.

+ * + *

The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated by {@link GL15C#glBufferData BufferData} if it is called to modify a buffer object bound to a buffer texture while that texture + * object is referenced by one or more image handles. The contents of the buffer object may still be updated via buffer update commands such as + * {@link GL15C#glBufferSubData BufferSubData} and MapBuffer*, or via the texture update commands, even if the buffer is bound to a texture while that buffer texture object is + * referenced by one or more image handles.

+ * + *

The handle returned for each combination of {@code texture}, {@code level}, {@code layered}, {@code layer}, and {@code format} is unique; the same + * handle will be returned if GetImageHandleARB is called multiple times with the same parameters.

+ * + * @param texture the texture object + * @param level the texture level + * @param layered the layered flag + * @param layer the texture layer + * @param format the texture format + */ + @NativeType("GLuint64") + public static native long glGetImageHandleARB(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLboolean") boolean layered, @NativeType("GLint") int layer, @NativeType("GLenum") int format); + + // --- [ glMakeImageHandleResidentARB ] --- + + /** + * Makes an image handle resident, so that it is accessible to shaders for image loads, stores, and atomic operations. + * + *

{@code access} specifies whether the texture bound to the image handle will be treated as {@link GL15#GL_READ_ONLY READ_ONLY}, {@link GL15#GL_WRITE_ONLY WRITE_ONLY}, or {@link GL15#GL_READ_WRITE READ_WRITE}. If a + * shader reads from an image handle made resident as {@link GL15#GL_WRITE_ONLY WRITE_ONLY}, or writes to an image handle made resident as {@link GL15#GL_READ_ONLY READ_ONLY}, the results of that + * shader operation are undefined and may lead to application termination. The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated if {@code handle} is not a valid + * image handle, or if {@code handle} is already resident in the current GL context.

+ * + *

While the image handle is resident, it may be used in image load, store, and atomic operations. If a shader attempts to perform an image operation using + * a handle that is not resident, the results of that operation are undefined and may lead to application termination. When an image handle is resident, + * the texture it references is not necessarily considered resident for the purposes of the {@link GL11#glAreTexturesResident AreTexturesResident} command.

+ * + * @param handle the image handle + * @param access the access type. One of:
{@link GL15#GL_READ_ONLY READ_ONLY}{@link GL15#GL_WRITE_ONLY WRITE_ONLY}{@link GL15#GL_READ_WRITE READ_WRITE}
+ */ + public static native void glMakeImageHandleResidentARB(@NativeType("GLuint64") long handle, @NativeType("GLenum") int access); + + // --- [ glMakeImageHandleNonResidentARB ] --- + + /** + * Makes an image handle inaccessible to shaders. + * + * @param handle the image handle + */ + public static native void glMakeImageHandleNonResidentARB(@NativeType("GLuint64") long handle); + + // --- [ glUniformHandleui64ARB ] --- + + /** + * Loads a 64-bit unsigned integer handle into a uniform location corresponding to sampler or image variable types. + * + * @param location the uniform location + * @param value the handle value + */ + public static native void glUniformHandleui64ARB(@NativeType("GLint") int location, @NativeType("GLuint64") long value); + + // --- [ glUniformHandleui64vARB ] --- + + /** + * Unsafe version of: {@link #glUniformHandleui64vARB UniformHandleui64vARB} + * + * @param count the number of handles to load + */ + public static native void nglUniformHandleui64vARB(int location, int count, long values); + + /** + * Loads {@code count} 64-bit unsigned integer handles into a uniform location corresponding to sampler or image variable types. + * + * @param location the uniform location + * @param values a buffer from which to load the handles + */ + public static void glUniformHandleui64vARB(@NativeType("GLint") int location, @NativeType("GLuint64 const *") LongBuffer values) { + nglUniformHandleui64vARB(location, values.remaining(), memAddress(values)); + } + + // --- [ glProgramUniformHandleui64ARB ] --- + + /** + * DSA version of {@link #glUniformHandleui64ARB UniformHandleui64ARB}. + * + * @param program the program object + * @param location the uniform location + * @param value the handle value + */ + public static native void glProgramUniformHandleui64ARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64") long value); + + // --- [ glProgramUniformHandleui64vARB ] --- + + /** + * Unsafe version of: {@link #glProgramUniformHandleui64vARB ProgramUniformHandleui64vARB} + * + * @param count the number of handles to load + */ + public static native void nglProgramUniformHandleui64vARB(int program, int location, int count, long values); + + /** + * DSA version of {@link #glUniformHandleui64vARB UniformHandleui64vARB}. + * + * @param program the program object + * @param location the uniform location + * @param values a buffer from which to load the handles + */ + public static void glProgramUniformHandleui64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64 const *") LongBuffer values) { + nglProgramUniformHandleui64vARB(program, location, values.remaining(), memAddress(values)); + } + + // --- [ glIsTextureHandleResidentARB ] --- + + /** + * Returns {@link GL11#GL_TRUE TRUE} if the specified texture handle is resident in the current context. + * + * @param handle the texture handle + */ + @NativeType("GLboolean") + public static native boolean glIsTextureHandleResidentARB(@NativeType("GLuint64") long handle); + + // --- [ glIsImageHandleResidentARB ] --- + + /** + * Returns {@link GL11#GL_TRUE TRUE} if the specified image handle is resident in the current context. + * + * @param handle the image handle + */ + @NativeType("GLboolean") + public static native boolean glIsImageHandleResidentARB(@NativeType("GLuint64") long handle); + + // --- [ glVertexAttribL1ui64ARB ] --- + + /** + * Specifies the 64-bit unsigned integer handle value of a generic vertex attribute. + * + * @param index the index of the generic vertex attribute to be modified + * @param x the handle value + */ + public static native void glVertexAttribL1ui64ARB(@NativeType("GLuint") int index, @NativeType("GLuint64") long x); + + // --- [ glVertexAttribL1ui64vARB ] --- + + /** Unsafe version of: {@link #glVertexAttribL1ui64vARB VertexAttribL1ui64vARB} */ + public static native void nglVertexAttribL1ui64vARB(int index, long v); + + /** + * Pointer version of {@link #glVertexAttribL1ui64ARB VertexAttribL1ui64ARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttribL1ui64vARB(@NativeType("GLuint") int index, @NativeType("GLuint64 const *") LongBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglVertexAttribL1ui64vARB(index, memAddress(v)); + } + + // --- [ glGetVertexAttribLui64vARB ] --- + + /** Unsafe version of: {@link #glGetVertexAttribLui64vARB GetVertexAttribLui64vARB} */ + public static native void nglGetVertexAttribLui64vARB(int index, int pname, long params); + + /** + * Returns the 64-bit unsigned integer handle value of a generic vertex attribute parameter. + * + * @param index the generic vertex attribute index + * @param pname the parameter to query + * @param params a buffer in which to place the returned data + */ + public static void glGetVertexAttribLui64vARB(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLuint64 *") LongBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetVertexAttribLui64vARB(index, pname, memAddress(params)); + } + + /** + * Returns the 64-bit unsigned integer handle value of a generic vertex attribute parameter. + * + * @param index the generic vertex attribute index + * @param pname the parameter to query + */ + @NativeType("void") + public static long glGetVertexAttribLui64ARB(@NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglGetVertexAttribLui64vARB(index, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #glUniformHandleui64vARB UniformHandleui64vARB} */ + public static void glUniformHandleui64vARB(@NativeType("GLint") int location, @NativeType("GLuint64 const *") long[] values) { + long __functionAddress = GL.getICD().glUniformHandleui64vARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, values.length, values, __functionAddress); + } + + /** Array version of: {@link #glProgramUniformHandleui64vARB ProgramUniformHandleui64vARB} */ + public static void glProgramUniformHandleui64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64 const *") long[] values) { + long __functionAddress = GL.getICD().glProgramUniformHandleui64vARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, values.length, values, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribL1ui64vARB VertexAttribL1ui64vARB} */ + public static void glVertexAttribL1ui64vARB(@NativeType("GLuint") int index, @NativeType("GLuint64 const *") long[] v) { + long __functionAddress = GL.getICD().glVertexAttribL1ui64vARB; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glGetVertexAttribLui64vARB GetVertexAttribLui64vARB} */ + public static void glGetVertexAttribLui64vARB(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLuint64 *") long[] params) { + long __functionAddress = GL.getICD().glGetVertexAttribLui64vARB; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(index, pname, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBBlendFuncExtended.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBBlendFuncExtended.java new file mode 100644 index 00000000..ea1c51d5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBBlendFuncExtended.java @@ -0,0 +1,114 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_blend_func_extended extension. + * + *

Traditional OpenGL includes fixed-function blending that combines source colors with the existing content of a render buffer in a variety of ways. A + * number of extensions have enhanced this functionality by adding further sources of blending weights and methods to combine them. However, the inputs to + * the fixed-function blending units are constrained to a source color (as output from fragment shading), destination color (as the current content of the + * frame buffer) or constants that may be used in their place.

+ * + *

This extension adds new blending functions whereby a fragment shader may output two colors, one of which is treated as the source color, and the other + * used as a blending factor for either source or destination colors. Furthermore, this extension increases orthogonality by allowing the + * {@link GL11#GL_SRC_ALPHA_SATURATE SRC_ALPHA_SATURATE} function to be used as the destination weight.

+ * + *

Requires {@link ARBFragmentShader ARB_fragment_shader} and {@link EXTGPUShader4 EXT_gpu_shader4}. Promoted to core in {@link GL33 OpenGL 3.3}.

+ */ +public class ARBBlendFuncExtended { + + /** + * Accepted by the {@code src} and {@code dst} parameters of BlendFunc and BlendFunci, and by the {@code srcRGB}, {@code dstRGB}, {@code srcAlpha} and + * {@code dstAlpha} parameters of BlendFuncSeparate and BlendFuncSeparatei. + */ + public static final int + GL_SRC1_COLOR = 0x88F9, + GL_ONE_MINUS_SRC1_COLOR = 0x88FA, + GL_ONE_MINUS_SRC1_ALPHA = 0x88FB; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv and GetDoublev. */ + public static final int GL_MAX_DUAL_SOURCE_DRAW_BUFFERS = 0x88FC; + + static { GL.initialize(); } + + protected ARBBlendFuncExtended() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBindFragDataLocationIndexed, caps.glGetFragDataIndex + ); + } + + // --- [ glBindFragDataLocationIndexed ] --- + + /** Unsafe version of: {@link #glBindFragDataLocationIndexed BindFragDataLocationIndexed} */ + public static void nglBindFragDataLocationIndexed(int program, int colorNumber, int index, long name) { + GL33C.nglBindFragDataLocationIndexed(program, colorNumber, index, name); + } + + /** + * Binds a user-defined varying out variable to a fragment shader color number and index. + * + * @param program the name of the program containing varying out variable whose binding to modify + * @param colorNumber the color number to bind the user-defined varying out variable to + * @param index the index of the color input to bind the user-defined varying out variable to + * @param name the name of the user-defined varying out variable whose binding to modify + */ + public static void glBindFragDataLocationIndexed(@NativeType("GLuint") int program, @NativeType("GLuint") int colorNumber, @NativeType("GLuint") int index, @NativeType("GLchar const *") ByteBuffer name) { + GL33C.glBindFragDataLocationIndexed(program, colorNumber, index, name); + } + + /** + * Binds a user-defined varying out variable to a fragment shader color number and index. + * + * @param program the name of the program containing varying out variable whose binding to modify + * @param colorNumber the color number to bind the user-defined varying out variable to + * @param index the index of the color input to bind the user-defined varying out variable to + * @param name the name of the user-defined varying out variable whose binding to modify + */ + public static void glBindFragDataLocationIndexed(@NativeType("GLuint") int program, @NativeType("GLuint") int colorNumber, @NativeType("GLuint") int index, @NativeType("GLchar const *") CharSequence name) { + GL33C.glBindFragDataLocationIndexed(program, colorNumber, index, name); + } + + // --- [ glGetFragDataIndex ] --- + + /** Unsafe version of: {@link #glGetFragDataIndex GetFragDataIndex} */ + public static int nglGetFragDataIndex(int program, long name) { + return GL33C.nglGetFragDataIndex(program, name); + } + + /** + * Queries the bindings of color indices to user-defined varying out variables. + * + * @param program the name of the program containing varying out variable whose binding to query + * @param name the name of the user-defined varying out variable whose index to query + */ + @NativeType("GLint") + public static int glGetFragDataIndex(@NativeType("GLuint") int program, @NativeType("GLchar const *") ByteBuffer name) { + return GL33C.glGetFragDataIndex(program, name); + } + + /** + * Queries the bindings of color indices to user-defined varying out variables. + * + * @param program the name of the program containing varying out variable whose binding to query + * @param name the name of the user-defined varying out variable whose index to query + */ + @NativeType("GLint") + public static int glGetFragDataIndex(@NativeType("GLuint") int program, @NativeType("GLchar const *") CharSequence name) { + return GL33C.glGetFragDataIndex(program, name); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBBufferStorage.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBBufferStorage.java new file mode 100644 index 00000000..6965f99f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBBufferStorage.java @@ -0,0 +1,748 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_buffer_storage extension. + * + *

OpenGL has long supported buffer objects as a means of storing data that may be used to source vertex attributes, pixel data for textures, uniforms and + * other elements. In un-extended GL, buffer data stores are mutable - that is, they may be de-allocated or resized while they are in use. The + * {@link ARBTextureStorage ARB_texture_storage} extension added immutable storage for texture object (and was subsequently incorporated into OpenGL 4.2). This extension + * further applies the concept of immutable storage to buffer objects. If an implementation is aware of a buffer's immutability, it may be able to make + * certain assumptions or apply particular optimizations in order to increase performance or reliability.

+ * + *

Furthermore, this extension allows applications to pass additional information about a requested allocation to the implementation which it may use to + * select memory heaps, caching behavior or allocation strategies.

+ * + *

Finally, this extension introduces the concept of persistent client mappings of buffer objects, which allow clients to retain pointers to a buffer's + * data store returned as the result of a mapping, and to issue drawing commands while those mappings are in place.

+ * + *

Promoted to core in {@link GL44 OpenGL 4.4}.

+ */ +public class ARBBufferStorage { + + /** Accepted in the {@code flags} parameter of {@link #glBufferStorage BufferStorage} and {@link #glNamedBufferStorageEXT NamedBufferStorageEXT}. */ + public static final int + GL_MAP_PERSISTENT_BIT = 0x40, + GL_MAP_COHERENT_BIT = 0x80, + GL_DYNAMIC_STORAGE_BIT = 0x100, + GL_CLIENT_STORAGE_BIT = 0x200; + + /** Accepted by the {@code pname} parameter of {@code GetBufferParameter{i|i64}v}. */ + public static final int + GL_BUFFER_IMMUTABLE_STORAGE = 0x821F, + GL_BUFFER_STORAGE_FLAGS = 0x8220; + + /** Accepted by the {@code barriers} parameter of {@link GL42C#glMemoryBarrier MemoryBarrier}. */ + public static final int GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT = 0x4000; + + static { GL.initialize(); } + + protected ARBBufferStorage() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glBufferStorage, ext.contains("GL_EXT_direct_state_access") ? caps.glNamedBufferStorageEXT : -1L + ); + } + + // --- [ glBufferStorage ] --- + + /** + * Unsafe version of: {@link #glBufferStorage BufferStorage} + * + * @param size the size of the data store in basic machine units + */ + public static void nglBufferStorage(int target, long size, long data, int flags) { + GL44C.nglBufferStorage(target, size, data, flags); + } + + /** + * Creates the data store of a buffer object. + * + *

The data store of the buffer object bound to {@code target} is allocated as a result of a call to this function and cannot be de-allocated until the + * buffer is deleted with a call to {@link GL15C#glDeleteBuffers DeleteBuffers}. Such a store may not be re-allocated through further calls to {@code BufferStorage} + * or {@link GL15C#glBufferData BufferData}.

+ * + *

{@code BufferStorage} deletes any existing data store. If any portion of the buffer object is mapped in the current context or any context current to + * another thread, it is as though {@link GL15C#glUnmapBuffer UnmapBuffer} is executed in each such context prior to deleting the existing data store.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param size the size of the data store in basic machine units + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44C#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("GLsizeiptr") long size, @NativeType("GLbitfield") int flags) { + GL44C.glBufferStorage(target, size, flags); + } + + /** + * Creates the data store of a buffer object. + * + *

The data store of the buffer object bound to {@code target} is allocated as a result of a call to this function and cannot be de-allocated until the + * buffer is deleted with a call to {@link GL15C#glDeleteBuffers DeleteBuffers}. Such a store may not be re-allocated through further calls to {@code BufferStorage} + * or {@link GL15C#glBufferData BufferData}.

+ * + *

{@code BufferStorage} deletes any existing data store. If any portion of the buffer object is mapped in the current context or any context current to + * another thread, it is as though {@link GL15C#glUnmapBuffer UnmapBuffer} is executed in each such context prior to deleting the existing data store.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44C#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") ByteBuffer data, @NativeType("GLbitfield") int flags) { + GL44C.glBufferStorage(target, data, flags); + } + + /** + * Creates the data store of a buffer object. + * + *

The data store of the buffer object bound to {@code target} is allocated as a result of a call to this function and cannot be de-allocated until the + * buffer is deleted with a call to {@link GL15C#glDeleteBuffers DeleteBuffers}. Such a store may not be re-allocated through further calls to {@code BufferStorage} + * or {@link GL15C#glBufferData BufferData}.

+ * + *

{@code BufferStorage} deletes any existing data store. If any portion of the buffer object is mapped in the current context or any context current to + * another thread, it is as though {@link GL15C#glUnmapBuffer UnmapBuffer} is executed in each such context prior to deleting the existing data store.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44C#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") ShortBuffer data, @NativeType("GLbitfield") int flags) { + GL44C.glBufferStorage(target, data, flags); + } + + /** + * Creates the data store of a buffer object. + * + *

The data store of the buffer object bound to {@code target} is allocated as a result of a call to this function and cannot be de-allocated until the + * buffer is deleted with a call to {@link GL15C#glDeleteBuffers DeleteBuffers}. Such a store may not be re-allocated through further calls to {@code BufferStorage} + * or {@link GL15C#glBufferData BufferData}.

+ * + *

{@code BufferStorage} deletes any existing data store. If any portion of the buffer object is mapped in the current context or any context current to + * another thread, it is as though {@link GL15C#glUnmapBuffer UnmapBuffer} is executed in each such context prior to deleting the existing data store.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44C#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") IntBuffer data, @NativeType("GLbitfield") int flags) { + GL44C.glBufferStorage(target, data, flags); + } + + /** + * Creates the data store of a buffer object. + * + *

The data store of the buffer object bound to {@code target} is allocated as a result of a call to this function and cannot be de-allocated until the + * buffer is deleted with a call to {@link GL15C#glDeleteBuffers DeleteBuffers}. Such a store may not be re-allocated through further calls to {@code BufferStorage} + * or {@link GL15C#glBufferData BufferData}.

+ * + *

{@code BufferStorage} deletes any existing data store. If any portion of the buffer object is mapped in the current context or any context current to + * another thread, it is as though {@link GL15C#glUnmapBuffer UnmapBuffer} is executed in each such context prior to deleting the existing data store.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44C#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") FloatBuffer data, @NativeType("GLbitfield") int flags) { + GL44C.glBufferStorage(target, data, flags); + } + + /** + * Creates the data store of a buffer object. + * + *

The data store of the buffer object bound to {@code target} is allocated as a result of a call to this function and cannot be de-allocated until the + * buffer is deleted with a call to {@link GL15C#glDeleteBuffers DeleteBuffers}. Such a store may not be re-allocated through further calls to {@code BufferStorage} + * or {@link GL15C#glBufferData BufferData}.

+ * + *

{@code BufferStorage} deletes any existing data store. If any portion of the buffer object is mapped in the current context or any context current to + * another thread, it is as though {@link GL15C#glUnmapBuffer UnmapBuffer} is executed in each such context prior to deleting the existing data store.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44C#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") DoubleBuffer data, @NativeType("GLbitfield") int flags) { + GL44C.glBufferStorage(target, data, flags); + } + + // --- [ glNamedBufferStorageEXT ] --- + + /** + * Unsafe version of: {@link #glNamedBufferStorageEXT NamedBufferStorageEXT} + * + * @param size the size of the data store in basic machine units + */ + public static native void nglNamedBufferStorageEXT(int buffer, long size, long data, int flags); + + /** + * Behaves similarly to {@link #glBufferStorage BufferStorage}, except that the buffer whose storage is to be defined is specified by {@code buffer} rather than by the current + * binding to {@code target}. + * + * @param buffer the buffer object + * @param size the size of the data store in basic machine units + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link #GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ */ + public static void glNamedBufferStorageEXT(@NativeType("GLuint") int buffer, @NativeType("GLsizeiptr") long size, @NativeType("GLbitfield") int flags) { + nglNamedBufferStorageEXT(buffer, size, NULL, flags); + } + + /** + * Behaves similarly to {@link #glBufferStorage BufferStorage}, except that the buffer whose storage is to be defined is specified by {@code buffer} rather than by the current + * binding to {@code target}. + * + * @param buffer the buffer object + * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link #GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ */ + public static void glNamedBufferStorageEXT(@NativeType("GLuint") int buffer, @NativeType("void const *") ByteBuffer data, @NativeType("GLbitfield") int flags) { + nglNamedBufferStorageEXT(buffer, data.remaining(), memAddress(data), flags); + } + + /** + * Behaves similarly to {@link #glBufferStorage BufferStorage}, except that the buffer whose storage is to be defined is specified by {@code buffer} rather than by the current + * binding to {@code target}. + * + * @param buffer the buffer object + * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link #GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ */ + public static void glNamedBufferStorageEXT(@NativeType("GLuint") int buffer, @NativeType("void const *") ShortBuffer data, @NativeType("GLbitfield") int flags) { + nglNamedBufferStorageEXT(buffer, Integer.toUnsignedLong(data.remaining()) << 1, memAddress(data), flags); + } + + /** + * Behaves similarly to {@link #glBufferStorage BufferStorage}, except that the buffer whose storage is to be defined is specified by {@code buffer} rather than by the current + * binding to {@code target}. + * + * @param buffer the buffer object + * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link #GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ */ + public static void glNamedBufferStorageEXT(@NativeType("GLuint") int buffer, @NativeType("void const *") IntBuffer data, @NativeType("GLbitfield") int flags) { + nglNamedBufferStorageEXT(buffer, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data), flags); + } + + /** + * Behaves similarly to {@link #glBufferStorage BufferStorage}, except that the buffer whose storage is to be defined is specified by {@code buffer} rather than by the current + * binding to {@code target}. + * + * @param buffer the buffer object + * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link #GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ */ + public static void glNamedBufferStorageEXT(@NativeType("GLuint") int buffer, @NativeType("void const *") FloatBuffer data, @NativeType("GLbitfield") int flags) { + nglNamedBufferStorageEXT(buffer, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data), flags); + } + + /** + * Behaves similarly to {@link #glBufferStorage BufferStorage}, except that the buffer whose storage is to be defined is specified by {@code buffer} rather than by the current + * binding to {@code target}. + * + * @param buffer the buffer object + * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link #GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ */ + public static void glNamedBufferStorageEXT(@NativeType("GLuint") int buffer, @NativeType("void const *") DoubleBuffer data, @NativeType("GLbitfield") int flags) { + nglNamedBufferStorageEXT(buffer, Integer.toUnsignedLong(data.remaining()) << 3, memAddress(data), flags); + } + + /** Array version of: {@link #glBufferStorage BufferStorage} */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") short[] data, @NativeType("GLbitfield") int flags) { + GL44C.glBufferStorage(target, data, flags); + } + + /** Array version of: {@link #glBufferStorage BufferStorage} */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") int[] data, @NativeType("GLbitfield") int flags) { + GL44C.glBufferStorage(target, data, flags); + } + + /** Array version of: {@link #glBufferStorage BufferStorage} */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") float[] data, @NativeType("GLbitfield") int flags) { + GL44C.glBufferStorage(target, data, flags); + } + + /** Array version of: {@link #glBufferStorage BufferStorage} */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") double[] data, @NativeType("GLbitfield") int flags) { + GL44C.glBufferStorage(target, data, flags); + } + + /** Array version of: {@link #glNamedBufferStorageEXT NamedBufferStorageEXT} */ + public static void glNamedBufferStorageEXT(@NativeType("GLuint") int buffer, @NativeType("void const *") short[] data, @NativeType("GLbitfield") int flags) { + long __functionAddress = GL.getICD().glNamedBufferStorageEXT; + if (CHECKS) { + check(__functionAddress); + } + callPPV(buffer, Integer.toUnsignedLong(data.length) << 1, data, flags, __functionAddress); + } + + /** Array version of: {@link #glNamedBufferStorageEXT NamedBufferStorageEXT} */ + public static void glNamedBufferStorageEXT(@NativeType("GLuint") int buffer, @NativeType("void const *") int[] data, @NativeType("GLbitfield") int flags) { + long __functionAddress = GL.getICD().glNamedBufferStorageEXT; + if (CHECKS) { + check(__functionAddress); + } + callPPV(buffer, Integer.toUnsignedLong(data.length) << 2, data, flags, __functionAddress); + } + + /** Array version of: {@link #glNamedBufferStorageEXT NamedBufferStorageEXT} */ + public static void glNamedBufferStorageEXT(@NativeType("GLuint") int buffer, @NativeType("void const *") float[] data, @NativeType("GLbitfield") int flags) { + long __functionAddress = GL.getICD().glNamedBufferStorageEXT; + if (CHECKS) { + check(__functionAddress); + } + callPPV(buffer, Integer.toUnsignedLong(data.length) << 2, data, flags, __functionAddress); + } + + /** Array version of: {@link #glNamedBufferStorageEXT NamedBufferStorageEXT} */ + public static void glNamedBufferStorageEXT(@NativeType("GLuint") int buffer, @NativeType("void const *") double[] data, @NativeType("GLbitfield") int flags) { + long __functionAddress = GL.getICD().glNamedBufferStorageEXT; + if (CHECKS) { + check(__functionAddress); + } + callPPV(buffer, Integer.toUnsignedLong(data.length) << 3, data, flags, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBClearBufferObject.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBClearBufferObject.java new file mode 100644 index 00000000..d7ed5b1c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBClearBufferObject.java @@ -0,0 +1,410 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_clear_buffer_object extension. + * + *

Buffer objects are fundamental to the operation of OpenGL. Buffers are used as a source of data for vertices and indices, read through buffer textures + * in shaders, used to transfer texture and image data into and out of textures and framebuffers, and may be written to by operations such as transform + * feedback. OpenGL contains mechanisms to copy sections of buffers from one to another, but it has no mechanism to initialize the content of a buffer to a + * known value. In effect, it has {@code memcpy}, but not {@code memset}.

+ * + *

This extension adds such a mechanism and has several use cases. Examples include clearing a pixel unpack buffer before transferring data to a texture or + * resetting buffer data to a known value before sparse updates through shader image stores or transform feedback.

+ * + *

Requires {@link GL15 OpenGL 1.5}. Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ +public class ARBClearBufferObject { + + static { GL.initialize(); } + + protected ARBClearBufferObject() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glClearBufferData, caps.glClearBufferSubData, ext.contains("GL_EXT_direct_state_access") ? caps.glClearNamedBufferDataEXT : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glClearNamedBufferSubDataEXT : -1L + ); + } + + // --- [ glClearBufferData ] --- + + /** Unsafe version of: {@link #glClearBufferData ClearBufferData} */ + public static void nglClearBufferData(int target, int internalformat, int format, int type, long data) { + GL43C.nglClearBufferData(target, internalformat, format, type, data); + } + + /** + * Fills a buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43C#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43C#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearBufferData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer data) { + GL43C.glClearBufferData(target, internalformat, format, type, data); + } + + /** + * Fills a buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43C#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43C#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearBufferData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer data) { + GL43C.glClearBufferData(target, internalformat, format, type, data); + } + + /** + * Fills a buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43C#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43C#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearBufferData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer data) { + GL43C.glClearBufferData(target, internalformat, format, type, data); + } + + /** + * Fills a buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43C#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43C#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearBufferData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer data) { + GL43C.glClearBufferData(target, internalformat, format, type, data); + } + + // --- [ glClearBufferSubData ] --- + + /** Unsafe version of: {@link #glClearBufferSubData ClearBufferSubData} */ + public static void nglClearBufferSubData(int target, int internalformat, long offset, long size, int format, int type, long data) { + GL43C.nglClearBufferSubData(target, internalformat, offset, size, format, type, data); + } + + /** + * Fills all or part of buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43C#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43C#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearBufferSubData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer data) { + GL43C.glClearBufferSubData(target, internalformat, offset, size, format, type, data); + } + + /** + * Fills all or part of buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43C#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43C#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearBufferSubData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer data) { + GL43C.glClearBufferSubData(target, internalformat, offset, size, format, type, data); + } + + /** + * Fills all or part of buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43C#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43C#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearBufferSubData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer data) { + GL43C.glClearBufferSubData(target, internalformat, offset, size, format, type, data); + } + + /** + * Fills all or part of buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43C#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43C#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearBufferSubData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer data) { + GL43C.glClearBufferSubData(target, internalformat, offset, size, format, type, data); + } + + // --- [ glClearNamedBufferDataEXT ] --- + + /** Unsafe version of: {@link #glClearNamedBufferDataEXT ClearNamedBufferDataEXT} */ + public static native void nglClearNamedBufferDataEXT(int buffer, int internalformat, int format, int type, long data); + + /** + * DSA version of {@link #glClearBufferData ClearBufferData}. + * + * @param buffer the buffer object to clear + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearNamedBufferDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer data) { + nglClearNamedBufferDataEXT(buffer, internalformat, format, type, memAddressSafe(data)); + } + + /** + * DSA version of {@link #glClearBufferData ClearBufferData}. + * + * @param buffer the buffer object to clear + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearNamedBufferDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer data) { + nglClearNamedBufferDataEXT(buffer, internalformat, format, type, memAddressSafe(data)); + } + + /** + * DSA version of {@link #glClearBufferData ClearBufferData}. + * + * @param buffer the buffer object to clear + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearNamedBufferDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer data) { + nglClearNamedBufferDataEXT(buffer, internalformat, format, type, memAddressSafe(data)); + } + + /** + * DSA version of {@link #glClearBufferData ClearBufferData}. + * + * @param buffer the buffer object to clear + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearNamedBufferDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer data) { + nglClearNamedBufferDataEXT(buffer, internalformat, format, type, memAddressSafe(data)); + } + + // --- [ glClearNamedBufferSubDataEXT ] --- + + /** Unsafe version of: {@link #glClearNamedBufferSubDataEXT ClearNamedBufferSubDataEXT} */ + public static native void nglClearNamedBufferSubDataEXT(int buffer, int internalformat, long offset, long size, int format, int type, long data); + + /** + * DSA version of {@link #glClearBufferSubData ClearBufferSubData}. + * + * @param buffer the buffer object to clear + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer data) { + nglClearNamedBufferSubDataEXT(buffer, internalformat, offset, size, format, type, memAddressSafe(data)); + } + + /** + * DSA version of {@link #glClearBufferSubData ClearBufferSubData}. + * + * @param buffer the buffer object to clear + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer data) { + nglClearNamedBufferSubDataEXT(buffer, internalformat, offset, size, format, type, memAddressSafe(data)); + } + + /** + * DSA version of {@link #glClearBufferSubData ClearBufferSubData}. + * + * @param buffer the buffer object to clear + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer data) { + nglClearNamedBufferSubDataEXT(buffer, internalformat, offset, size, format, type, memAddressSafe(data)); + } + + /** + * DSA version of {@link #glClearBufferSubData ClearBufferSubData}. + * + * @param buffer the buffer object to clear + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer data) { + nglClearNamedBufferSubDataEXT(buffer, internalformat, offset, size, format, type, memAddressSafe(data)); + } + + /** Array version of: {@link #glClearBufferData ClearBufferData} */ + public static void glClearBufferData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] data) { + GL43C.glClearBufferData(target, internalformat, format, type, data); + } + + /** Array version of: {@link #glClearBufferData ClearBufferData} */ + public static void glClearBufferData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] data) { + GL43C.glClearBufferData(target, internalformat, format, type, data); + } + + /** Array version of: {@link #glClearBufferData ClearBufferData} */ + public static void glClearBufferData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] data) { + GL43C.glClearBufferData(target, internalformat, format, type, data); + } + + /** Array version of: {@link #glClearBufferSubData ClearBufferSubData} */ + public static void glClearBufferSubData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] data) { + GL43C.glClearBufferSubData(target, internalformat, offset, size, format, type, data); + } + + /** Array version of: {@link #glClearBufferSubData ClearBufferSubData} */ + public static void glClearBufferSubData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] data) { + GL43C.glClearBufferSubData(target, internalformat, offset, size, format, type, data); + } + + /** Array version of: {@link #glClearBufferSubData ClearBufferSubData} */ + public static void glClearBufferSubData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] data) { + GL43C.glClearBufferSubData(target, internalformat, offset, size, format, type, data); + } + + /** Array version of: {@link #glClearNamedBufferDataEXT ClearNamedBufferDataEXT} */ + public static void glClearNamedBufferDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] data) { + long __functionAddress = GL.getICD().glClearNamedBufferDataEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(buffer, internalformat, format, type, data, __functionAddress); + } + + /** Array version of: {@link #glClearNamedBufferDataEXT ClearNamedBufferDataEXT} */ + public static void glClearNamedBufferDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] data) { + long __functionAddress = GL.getICD().glClearNamedBufferDataEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(buffer, internalformat, format, type, data, __functionAddress); + } + + /** Array version of: {@link #glClearNamedBufferDataEXT ClearNamedBufferDataEXT} */ + public static void glClearNamedBufferDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] data) { + long __functionAddress = GL.getICD().glClearNamedBufferDataEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(buffer, internalformat, format, type, data, __functionAddress); + } + + /** Array version of: {@link #glClearNamedBufferSubDataEXT ClearNamedBufferSubDataEXT} */ + public static void glClearNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] data) { + long __functionAddress = GL.getICD().glClearNamedBufferSubDataEXT; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, internalformat, offset, size, format, type, data, __functionAddress); + } + + /** Array version of: {@link #glClearNamedBufferSubDataEXT ClearNamedBufferSubDataEXT} */ + public static void glClearNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] data) { + long __functionAddress = GL.getICD().glClearNamedBufferSubDataEXT; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, internalformat, offset, size, format, type, data, __functionAddress); + } + + /** Array version of: {@link #glClearNamedBufferSubDataEXT ClearNamedBufferSubDataEXT} */ + public static void glClearNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] data) { + long __functionAddress = GL.getICD().glClearNamedBufferSubDataEXT; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, internalformat, offset, size, format, type, data, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBClearTexture.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBClearTexture.java new file mode 100644 index 00000000..fe2c2754 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBClearTexture.java @@ -0,0 +1,352 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_clear_texture extension. + * + *

Texture objects are fundamental to the operation of OpenGL. They are used as a source for texture sampling and destination for rendering as well as + * being accessed in shaders for image load/store operations. It is also possible to invalidate the contents of a texture. It is currently only possible to + * set texture image data to known values by uploading some or all of a image array from application memory or by attaching it to a framebuffer object and + * using {@link GL11C#glClear Clear} or the {@link GL30 OpenGL 3.0} ClearBuffer commands.

+ * + *

Both uploading initial texture data and clearing by attaching to a framebuffer have potential disadvantages when one simply wants to initialize texture + * data to a known value. Uploading initial data requires the application to allocate a (potentially large) chunk of memory and transferring that to the + * GL. This can be a costly operation both in terms of memory bandwidth and power usage. Alternatively, attaching a texture level to a framebuffer to clear + * it may not be possible if the texture format isn't supported for rendering, or even if it is, attaching the image to a framebuffer object may cause the + * texture to be allocated in certain types of memory, which it may otherwise not need to be placed in.

+ * + *

This extension solves these problems by providing a mechanism whereby the contents of a texture image array can be set to known values by using the + * {@link #glClearTexImage ClearTexImage} or {@link #glClearTexSubImage ClearTexSubImage} commands. These commands can also be useful for initializing an image that will be used for atomic shader + * operations.

+ * + *

Requires {@link GL13 OpenGL 1.3}. Promoted to core in {@link GL44 OpenGL 4.4}.

+ */ +public class ARBClearTexture { + + /** Accepted by the {@code pname} parameter for {@link GL42C#glGetInternalformativ GetInternalformativ} and {@link GL43C#glGetInternalformati64v GetInternalformati64v}. */ + public static final int GL_CLEAR_TEXTURE = 0x9365; + + static { GL.initialize(); } + + protected ARBClearTexture() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glClearTexSubImage, caps.glClearTexImage + ); + } + + // --- [ glClearTexSubImage ] --- + + /** Unsafe version of: {@link #glClearTexSubImage ClearTexSubImage} */ + public static void nglClearTexSubImage(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, long data) { + GL44C.nglClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); + } + + /** + * Fills all or part of a texture image with a constant value. + * + *

Arguments {@code xoffset}, {@code yoffset}, and {@code zoffset} specify the lower left texel coordinates of a {@code width}-wide by {@code height}-high + * by {@code depth}-deep rectangular subregion of the texel array and are interpreted as they are in {@link GL12C#glTexSubImage3D TexSubImage3D}.

+ * + *

For 1D array textures, {@code yoffset} is interpreted as the first layer to be cleared and {@code height} is the number of layers to clear. For 2D array + * textures, {@code zoffset} is interpreted as the first layer to be cleared and {@code depth} is the number of layers to clear. Cube map textures are + * treated as an array of six slices in the z-dimension, where the value of {@code zoffset} is interpreted as specifying the cube map face for the + * corresponding {@code layer} and {@code depth} is the number of faces to clear. For cube map array textures, {@code zoffset} is the first layer-face to + * clear, and {@code depth} is the number of layer-faces to clear. Each layer-face is translated into an array layer and a cube map face.

+ * + *

Negative values of {@code xoffset}, {@code yoffset}, and {@code zoffset} correspond to the coordinates of border texels.

+ * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer data) { + GL44C.glClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); + } + + /** + * Fills all or part of a texture image with a constant value. + * + *

Arguments {@code xoffset}, {@code yoffset}, and {@code zoffset} specify the lower left texel coordinates of a {@code width}-wide by {@code height}-high + * by {@code depth}-deep rectangular subregion of the texel array and are interpreted as they are in {@link GL12C#glTexSubImage3D TexSubImage3D}.

+ * + *

For 1D array textures, {@code yoffset} is interpreted as the first layer to be cleared and {@code height} is the number of layers to clear. For 2D array + * textures, {@code zoffset} is interpreted as the first layer to be cleared and {@code depth} is the number of layers to clear. Cube map textures are + * treated as an array of six slices in the z-dimension, where the value of {@code zoffset} is interpreted as specifying the cube map face for the + * corresponding {@code layer} and {@code depth} is the number of faces to clear. For cube map array textures, {@code zoffset} is the first layer-face to + * clear, and {@code depth} is the number of layer-faces to clear. Each layer-face is translated into an array layer and a cube map face.

+ * + *

Negative values of {@code xoffset}, {@code yoffset}, and {@code zoffset} correspond to the coordinates of border texels.

+ * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer data) { + GL44C.glClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); + } + + /** + * Fills all or part of a texture image with a constant value. + * + *

Arguments {@code xoffset}, {@code yoffset}, and {@code zoffset} specify the lower left texel coordinates of a {@code width}-wide by {@code height}-high + * by {@code depth}-deep rectangular subregion of the texel array and are interpreted as they are in {@link GL12C#glTexSubImage3D TexSubImage3D}.

+ * + *

For 1D array textures, {@code yoffset} is interpreted as the first layer to be cleared and {@code height} is the number of layers to clear. For 2D array + * textures, {@code zoffset} is interpreted as the first layer to be cleared and {@code depth} is the number of layers to clear. Cube map textures are + * treated as an array of six slices in the z-dimension, where the value of {@code zoffset} is interpreted as specifying the cube map face for the + * corresponding {@code layer} and {@code depth} is the number of faces to clear. For cube map array textures, {@code zoffset} is the first layer-face to + * clear, and {@code depth} is the number of layer-faces to clear. Each layer-face is translated into an array layer and a cube map face.

+ * + *

Negative values of {@code xoffset}, {@code yoffset}, and {@code zoffset} correspond to the coordinates of border texels.

+ * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer data) { + GL44C.glClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); + } + + /** + * Fills all or part of a texture image with a constant value. + * + *

Arguments {@code xoffset}, {@code yoffset}, and {@code zoffset} specify the lower left texel coordinates of a {@code width}-wide by {@code height}-high + * by {@code depth}-deep rectangular subregion of the texel array and are interpreted as they are in {@link GL12C#glTexSubImage3D TexSubImage3D}.

+ * + *

For 1D array textures, {@code yoffset} is interpreted as the first layer to be cleared and {@code height} is the number of layers to clear. For 2D array + * textures, {@code zoffset} is interpreted as the first layer to be cleared and {@code depth} is the number of layers to clear. Cube map textures are + * treated as an array of six slices in the z-dimension, where the value of {@code zoffset} is interpreted as specifying the cube map face for the + * corresponding {@code layer} and {@code depth} is the number of faces to clear. For cube map array textures, {@code zoffset} is the first layer-face to + * clear, and {@code depth} is the number of layer-faces to clear. Each layer-face is translated into an array layer and a cube map face.

+ * + *

Negative values of {@code xoffset}, {@code yoffset}, and {@code zoffset} correspond to the coordinates of border texels.

+ * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer data) { + GL44C.glClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); + } + + /** + * Fills all or part of a texture image with a constant value. + * + *

Arguments {@code xoffset}, {@code yoffset}, and {@code zoffset} specify the lower left texel coordinates of a {@code width}-wide by {@code height}-high + * by {@code depth}-deep rectangular subregion of the texel array and are interpreted as they are in {@link GL12C#glTexSubImage3D TexSubImage3D}.

+ * + *

For 1D array textures, {@code yoffset} is interpreted as the first layer to be cleared and {@code height} is the number of layers to clear. For 2D array + * textures, {@code zoffset} is interpreted as the first layer to be cleared and {@code depth} is the number of layers to clear. Cube map textures are + * treated as an array of six slices in the z-dimension, where the value of {@code zoffset} is interpreted as specifying the cube map face for the + * corresponding {@code layer} and {@code depth} is the number of faces to clear. For cube map array textures, {@code zoffset} is the first layer-face to + * clear, and {@code depth} is the number of layer-faces to clear. Each layer-face is translated into an array layer and a cube map face.

+ * + *

Negative values of {@code xoffset}, {@code yoffset}, and {@code zoffset} correspond to the coordinates of border texels.

+ * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") DoubleBuffer data) { + GL44C.glClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); + } + + // --- [ glClearTexImage ] --- + + /** Unsafe version of: {@link #glClearTexImage ClearTexImage} */ + public static void nglClearTexImage(int texture, int level, int format, int type, long data) { + GL44C.nglClearTexImage(texture, level, format, type, data); + } + + /** + * Is equivalent to calling {@link #glClearTexSubImage ClearTexSubImage} with {@code xoffset}, {@code yoffset}, and {@code zoffset} equal to -{@code b} and {@code width}, + * {@code height}, and {@code depth} equal to the dimensions of the texture image plus {@code 2xb} (or zero and one for dimensions the texture doesn't + * have). + * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer data) { + GL44C.glClearTexImage(texture, level, format, type, data); + } + + /** + * Is equivalent to calling {@link #glClearTexSubImage ClearTexSubImage} with {@code xoffset}, {@code yoffset}, and {@code zoffset} equal to -{@code b} and {@code width}, + * {@code height}, and {@code depth} equal to the dimensions of the texture image plus {@code 2xb} (or zero and one for dimensions the texture doesn't + * have). + * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer data) { + GL44C.glClearTexImage(texture, level, format, type, data); + } + + /** + * Is equivalent to calling {@link #glClearTexSubImage ClearTexSubImage} with {@code xoffset}, {@code yoffset}, and {@code zoffset} equal to -{@code b} and {@code width}, + * {@code height}, and {@code depth} equal to the dimensions of the texture image plus {@code 2xb} (or zero and one for dimensions the texture doesn't + * have). + * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer data) { + GL44C.glClearTexImage(texture, level, format, type, data); + } + + /** + * Is equivalent to calling {@link #glClearTexSubImage ClearTexSubImage} with {@code xoffset}, {@code yoffset}, and {@code zoffset} equal to -{@code b} and {@code width}, + * {@code height}, and {@code depth} equal to the dimensions of the texture image plus {@code 2xb} (or zero and one for dimensions the texture doesn't + * have). + * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer data) { + GL44C.glClearTexImage(texture, level, format, type, data); + } + + /** + * Is equivalent to calling {@link #glClearTexSubImage ClearTexSubImage} with {@code xoffset}, {@code yoffset}, and {@code zoffset} equal to -{@code b} and {@code width}, + * {@code height}, and {@code depth} equal to the dimensions of the texture image plus {@code 2xb} (or zero and one for dimensions the texture doesn't + * have). + * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") DoubleBuffer data) { + GL44C.glClearTexImage(texture, level, format, type, data); + } + + /** Array version of: {@link #glClearTexSubImage ClearTexSubImage} */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] data) { + GL44C.glClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); + } + + /** Array version of: {@link #glClearTexSubImage ClearTexSubImage} */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] data) { + GL44C.glClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); + } + + /** Array version of: {@link #glClearTexSubImage ClearTexSubImage} */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] data) { + GL44C.glClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); + } + + /** Array version of: {@link #glClearTexSubImage ClearTexSubImage} */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") double[] data) { + GL44C.glClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); + } + + /** Array version of: {@link #glClearTexImage ClearTexImage} */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] data) { + GL44C.glClearTexImage(texture, level, format, type, data); + } + + /** Array version of: {@link #glClearTexImage ClearTexImage} */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] data) { + GL44C.glClearTexImage(texture, level, format, type, data); + } + + /** Array version of: {@link #glClearTexImage ClearTexImage} */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] data) { + GL44C.glClearTexImage(texture, level, format, type, data); + } + + /** Array version of: {@link #glClearTexImage ClearTexImage} */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") double[] data) { + GL44C.glClearTexImage(texture, level, format, type, data); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBClipControl.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBClipControl.java new file mode 100644 index 00000000..81a7358c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBClipControl.java @@ -0,0 +1,67 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_clip_control extension. + * + *

This extension provides additional clip control modes to configure how clip space is mapped to window space. This extension's goal is to 1) allow + * OpenGL to effectively match Direct3D's coordinate system conventions, and 2) potentially improve the numerical precision of the Z coordinate mapping.

+ * + *

Promoted to core in {@link GL45 OpenGL 4.5}.

+ */ +public class ARBClipControl { + + /** Accepted by the {@code origin} parameter of {@link #glClipControl ClipControl}. */ + public static final int + GL_LOWER_LEFT = 0x8CA1, + GL_UPPER_LEFT = 0x8CA2; + + /** Accepted by the {@code depth} parameter of {@link #glClipControl ClipControl}. */ + public static final int + GL_NEGATIVE_ONE_TO_ONE = 0x935E, + GL_ZERO_TO_ONE = 0x935F; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_CLIP_ORIGIN = 0x935C, + GL_CLIP_DEPTH_MODE = 0x935D; + + static { GL.initialize(); } + + protected ARBClipControl() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glClipControl + ); + } + + // --- [ glClipControl ] --- + + /** + * Controls the clipping volume behavior. + * + *

These parameters update the clip control origin and depth mode respectively. The initial value of the clip control origin is {@link GL20#GL_LOWER_LEFT LOWER_LEFT} and the + * initial value of the depth mode is {@link GL45C#GL_NEGATIVE_ONE_TO_ONE NEGATIVE_ONE_TO_ONE}.

+ * + *

The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated if ClipControl is executed between the execution of {@link GL11#glBegin Begin} and the corresponding + * execution of {@link GL11#glEnd End}.

+ * + * @param origin the clip origin. One of:
{@link GL20#GL_LOWER_LEFT LOWER_LEFT}{@link GL20#GL_UPPER_LEFT UPPER_LEFT}
+ * @param depth the clip depth mode. One of:
{@link GL45C#GL_NEGATIVE_ONE_TO_ONE NEGATIVE_ONE_TO_ONE}{@link GL45C#GL_ZERO_TO_ONE ZERO_TO_ONE}
+ */ + public static void glClipControl(@NativeType("GLenum") int origin, @NativeType("GLenum") int depth) { + GL45C.glClipControl(origin, depth); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBColorBufferFloat.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBColorBufferFloat.java new file mode 100644 index 00000000..8f19ebe5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBColorBufferFloat.java @@ -0,0 +1,70 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_color_buffer_float extension. + * + *

The standard OpenGL pipeline is based on a fixed-point pipeline. While color components are nominally floating-point values in the pipeline, components + * are frequently clamped to the range [0,1] to accomodate the fixed-point color buffer representation and allow for fixed-point computational hardware.

+ * + *

This extension adds pixel formats or visuals with floating-point RGBA color components and controls for clamping of color components within the pipeline.

+ * + *

For a floating-point RGBA pixel format, the size of each float components is specified using the same attributes that are used for defining the size of + * fixed-point components. 32-bit floating-point components are in the standard IEEE float format. 16-bit floating-point components have 1 sign bit, 5 + * exponent bits, and 10 mantissa bits.

+ * + *

Clamping control provides a way to disable certain color clamps and allow programs, and the fixed-function pipeline, to deal in unclamped colors. There + * are controls to modify clamping of vertex colors, clamping of fragment colors throughout the pipeline, and for pixel return data.

+ * + *

The default state for fragment clamping is {@link #GL_FIXED_ONLY_ARB FIXED_ONLY_ARB}, which has the behavior of clamping colors for fixed-point color buffers and not clamping + * colors for floating-pont color buffers.

+ * + *

Vertex colors are clamped by default.

+ * + *

Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ +public class ARBColorBufferFloat { + + /** Accepted by the {@code pname} parameters of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_RGBA_FLOAT_MODE_ARB = 0x8820; + + /** Accepted by the {@code target} parameter of ClampColorARB and the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_CLAMP_VERTEX_COLOR_ARB = 0x891A, + GL_CLAMP_FRAGMENT_COLOR_ARB = 0x891B, + GL_CLAMP_READ_COLOR_ARB = 0x891C; + + /** Accepted by the {@code clamp} parameter of ClampColorARB. */ + public static final int GL_FIXED_ONLY_ARB = 0x891D; + + static { GL.initialize(); } + + protected ARBColorBufferFloat() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glClampColorARB + ); + } + + // --- [ glClampColorARB ] --- + + /** + * Controls color clamping. + * + * @param target the color target. One of:
{@link #GL_CLAMP_VERTEX_COLOR_ARB CLAMP_VERTEX_COLOR_ARB}{@link #GL_CLAMP_FRAGMENT_COLOR_ARB CLAMP_FRAGMENT_COLOR_ARB}{@link #GL_CLAMP_READ_COLOR_ARB CLAMP_READ_COLOR_ARB}
+ * @param clamp the new clamping state. One of:
{@link GL11#GL_TRUE TRUE}{@link GL11#GL_FALSE FALSE}{@link #GL_FIXED_ONLY_ARB FIXED_ONLY_ARB}
+ */ + public static native void glClampColorARB(@NativeType("GLenum") int target, @NativeType("GLenum") int clamp); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBCompressedTexturePixelStorage.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBCompressedTexturePixelStorage.java new file mode 100644 index 00000000..178ec895 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBCompressedTexturePixelStorage.java @@ -0,0 +1,41 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_compressed_texture_pixel_storage extension. + * + *

This extension expands the functionality of the {@link GL11C#glPixelStorei PixelStorei} modes to allow {@link GL11#GL_UNPACK_ROW_LENGTH UNPACK_ROW_LENGTH}, {@link GL11#GL_UNPACK_SKIP_ROWS UNPACK_SKIP_ROWS}, + * {@link GL11#GL_UNPACK_SKIP_PIXELS UNPACK_SKIP_PIXELS}, {@link GL12#GL_UNPACK_IMAGE_HEIGHT UNPACK_IMAGE_HEIGHT} and {@link GL12#GL_UNPACK_SKIP_IMAGES UNPACK_SKIP_IMAGES} to affect the operation of CompressedTexImage*D and + * CompressedTexSubImage*D. Similarly, it also allows {@link GL11#GL_PACK_ROW_LENGTH PACK_ROW_LENGTH}, {@link GL11#GL_PACK_SKIP_ROWS PACK_SKIP_ROWS}, {@link GL11#GL_PACK_SKIP_PIXELS PACK_SKIP_PIXELS}, {@link GL12#GL_PACK_IMAGE_HEIGHT PACK_IMAGE_HEIGHT} and + * {@link GL12#GL_PACK_SKIP_IMAGES PACK_SKIP_IMAGES} to affect the operation of GetCompressedTexImage*D. This allows data to be transferred to or from a specified sub-rectangle of a + * larger compressed image.

+ * + *

This extension is designed primarily to support compressed image formats with fixed-size blocks. To use this new mechanism, an application should + * program new parameters UNPACK_COMPRESSED_BLOCK_{WIDTH,HEIGHT,DEPTH,SIZE} to indicate the number of texels in each dimension of the fixed-size block as + * well as the number of bytes consumed by each block. These parameters, in addition to the existing PixelStore parameters, are used to identify a + * collection of bytes in client memory or a buffer object's data store to use as compressed texture data. This operation is unlikely to have the desired + * results if the client programs a block size inconsistent with the underlying compressed image format, or if the compressed image format has + * variable-sized blocks.

+ * + *

Requires {@link GL21 OpenGL 2.1}. Promoted to core in {@link GL42 OpenGL 4.2}.

+ */ +public final class ARBCompressedTexturePixelStorage { + + /** Accepted by the {@code pname} parameter of PixelStore[fi], GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int + GL_UNPACK_COMPRESSED_BLOCK_WIDTH = 0x9127, + GL_UNPACK_COMPRESSED_BLOCK_HEIGHT = 0x9128, + GL_UNPACK_COMPRESSED_BLOCK_DEPTH = 0x9129, + GL_UNPACK_COMPRESSED_BLOCK_SIZE = 0x912A, + GL_PACK_COMPRESSED_BLOCK_WIDTH = 0x912B, + GL_PACK_COMPRESSED_BLOCK_HEIGHT = 0x912C, + GL_PACK_COMPRESSED_BLOCK_DEPTH = 0x912D, + GL_PACK_COMPRESSED_BLOCK_SIZE = 0x912E; + + private ARBCompressedTexturePixelStorage() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBComputeShader.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBComputeShader.java new file mode 100644 index 00000000..e45dd50c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBComputeShader.java @@ -0,0 +1,129 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_compute_shader extension. + * + *

Recent graphics hardware has become extremely powerful and a strong desire to harness this power for work (both graphics and non-graphics) that does not + * fit the traditional graphics pipeline well has emerged. To address this, this extension adds a new single-stage program type known as a compute program. + * This program may contain one or more compute shaders which may be launched in a manner that is essentially stateless. This allows arbitrary workloads to + * be sent to the graphics hardware with minimal disturbance to the GL state machine.

+ * + *

In most respects, a compute program is identical to a traditional OpenGL program object, with similar status, uniforms, and other such properties. It + * has access to many of the same resources as fragment and other shader types, such as textures, image variables, atomic counters, and so on. However, it + * has no predefined inputs nor any fixed-function outputs. It cannot be part of a pipeline and its visible side effects are through its actions on images + * and atomic counters.

+ * + *

OpenCL is another solution for using graphics processors as generalized compute devices. This extension addresses a different need. For example, OpenCL + * is designed to be usable on a wide range of devices ranging from CPUs, GPUs, and DSPs through to FPGAs. While one could implement GL on these types of + * devices, the target here is clearly GPUs. Another difference is that OpenCL is more full featured and includes features such as multiple devices, + * asynchronous queues and strict IEEE semantics for floating point operations. This extension follows the semantics of OpenGL - implicitly synchronous, + * in-order operation with single-device, single queue logical architecture and somewhat more relaxed numerical precision requirements. Although not as + * feature rich, this extension offers several advantages for applications that can tolerate the omission of these features. Compute shaders are written in + * GLSL, for example and so code may be shared between compute and other shader types. Objects are created and owned by the same context as the rest of the + * GL, and therefore no interoperability API is required and objects may be freely used by both compute and graphics simultaneously without acquire-release + * semantics or object type translation.

+ * + *

Requires {@link GL42 OpenGL 4.2}. Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ +public class ARBComputeShader { + + /** Accepted by the {@code type} parameter of CreateShader and returned in the {@code params} parameter by GetShaderiv. */ + public static final int GL_COMPUTE_SHADER = 0x91B9; + + /** Accepted by the {@code pname} parameter of GetIntegerv, GetBooleanv, GetFloatv, GetDoublev and GetInteger64v. */ + public static final int + GL_MAX_COMPUTE_UNIFORM_BLOCKS = 0x91BB, + GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS = 0x91BC, + GL_MAX_COMPUTE_IMAGE_UNIFORMS = 0x91BD, + GL_MAX_COMPUTE_SHARED_MEMORY_SIZE = 0x8262, + GL_MAX_COMPUTE_UNIFORM_COMPONENTS = 0x8263, + GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS = 0x8264, + GL_MAX_COMPUTE_ATOMIC_COUNTERS = 0x8265, + GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS = 0x8266, + GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS = 0x90EB; + + /** Accepted by the {@code pname} parameter of GetIntegeri_v, GetBooleani_v, GetFloati_v, GetDoublei_v and GetInteger64i_v. */ + public static final int + GL_MAX_COMPUTE_WORK_GROUP_COUNT = 0x91BE, + GL_MAX_COMPUTE_WORK_GROUP_SIZE = 0x91BF; + + /** Accepted by the {@code pname} parameter of GetProgramiv. */ + public static final int GL_COMPUTE_WORK_GROUP_SIZE = 0x8267; + + /** Accepted by the {@code pname} parameter of GetActiveUniformBlockiv. */ + public static final int GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER = 0x90EC; + + /** Accepted by the {@code pname} parameter of GetActiveAtomicCounterBufferiv. */ + public static final int GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER = 0x90ED; + + /** Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, and GetBufferPointerv. */ + public static final int GL_DISPATCH_INDIRECT_BUFFER = 0x90EE; + + /** Accepted by the {@code value} parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int GL_DISPATCH_INDIRECT_BUFFER_BINDING = 0x90EF; + + /** Accepted by the {@code stages} parameter of UseProgramStages. */ + public static final int GL_COMPUTE_SHADER_BIT = 0x20; + + static { GL.initialize(); } + + protected ARBComputeShader() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glDispatchCompute, caps.glDispatchComputeIndirect + ); + } + + // --- [ glDispatchCompute ] --- + + /** + * Launches one or more compute work groups. + * + * @param num_groups_x the number of work groups to be launched in the X dimension + * @param num_groups_y the number of work groups to be launched in the Y dimension + * @param num_groups_z the number of work groups to be launched in the Z dimension + */ + public static void glDispatchCompute(@NativeType("GLuint") int num_groups_x, @NativeType("GLuint") int num_groups_y, @NativeType("GLuint") int num_groups_z) { + GL43C.glDispatchCompute(num_groups_x, num_groups_y, num_groups_z); + } + + // --- [ glDispatchComputeIndirect ] --- + + /** + * Launches one or more compute work groups using parameters stored in a buffer. + * + *

The parameters addressed by indirect are packed a structure, which takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint num_groups_x;
+     *     uint num_groups_y;
+     *     uint num_groups_z;
+     * } DispatchIndirectCommand;
+ * + *

A call to {@code glDispatchComputeIndirect} is equivalent, assuming no errors are generated, to:

+ * + *

+     * cmd = (const DispatchIndirectCommand *)indirect;
+     * glDispatchCompute(cmd->num_groups_x, cmd->num_groups_y, cmd->num_groups_z);
+ * + * @param indirect the offset into the buffer object currently bound to the {@link GL43C#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER} buffer target at which the dispatch parameters are + * stored. + */ + public static void glDispatchComputeIndirect(@NativeType("GLintptr") long indirect) { + GL43C.glDispatchComputeIndirect(indirect); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBComputeVariableGroupSize.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBComputeVariableGroupSize.java new file mode 100644 index 00000000..a1944795 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBComputeVariableGroupSize.java @@ -0,0 +1,75 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_compute_variable_group_size extension. + * + *

This extension allows applications to write generic compute shaders that operate on work groups with arbitrary dimensions. Instead of specifying a fixed + * work group size in the compute shader, an application can use a compute shader using the {@code local_size_variable} layout qualifer to indicate a + * variable work group size. When using such compute shaders, the new command DispatchComputeGroupSizeARB should be used to specify both a work group size + * and work group count.

+ * + *

In this extension, compute shaders with fixed group sizes must be dispatched by {@link GL43C#glDispatchCompute DispatchCompute} and {@link GL43C#glDispatchComputeIndirect DispatchComputeIndirect}. Compute + * shaders with variable group sizes must be dispatched via {@link #glDispatchComputeGroupSizeARB DispatchComputeGroupSizeARB}. No support is provided in this extension for indirect dispatch + * of compute shaders with a variable group size.

+ * + *

Requires {@link GL43 OpenGL 4.3} or {@link ARBComputeShader ARB_compute_shader}.

+ */ +public class ARBComputeVariableGroupSize { + + /** Accepted by the {@code pname} parameter of GetIntegerv, GetBooleanv, GetFloatv, GetDoublev and GetInteger64v. */ + public static final int + GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB = 0x9344, + GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB = 0x90EB; + + /** Accepted by the {@code pname} parameter of GetIntegeri_v, GetBooleani_v, GetFloati_v, GetDoublei_v and GetInteger64i_v. */ + public static final int + GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB = 0x9345, + GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB = 0x91BF; + + static { GL.initialize(); } + + protected ARBComputeVariableGroupSize() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glDispatchComputeGroupSizeARB + ); + } + + // --- [ glDispatchComputeGroupSizeARB ] --- + + /** + * Launches one or more compute work groups, with arbitrary dimensions. + * + *

An {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} error is generated by DispatchComputeGroupSizeARB if the active program for the compute shader stage has a fixed work group + * size.

+ * + *

An {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error is generated by DispatchComputeGroupSizeARB if any of {@code group_size_x}, {@code group_size_y}, or {@code group_size_z} is + * less than or equal to zero or greater than the maximum local work group size for compute shaders with variable group size + * ({@link #GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB}) in the corresponding dimension.

+ * + *

An {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error is generated by DispatchComputeGroupSizeARB if the product of {@code group_size_x}, {@code group_size_y}, and + * {@code group_size_z} exceeds the implementation-dependent maximum local work group invocation count for compute shaders with variable group size + * ({@link #GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB}).

+ * + * @param num_groups_x the number of work groups to be launched in the X dimension + * @param num_groups_y the number of work groups to be launched in the Y dimension + * @param num_groups_z the number of work groups to be launched in the Z dimension + * @param group_size_x the group size in the X dimension + * @param group_size_y the group size in the Y dimension + * @param group_size_z the group size in the Z dimension + */ + public static native void glDispatchComputeGroupSizeARB(@NativeType("GLuint") int num_groups_x, @NativeType("GLuint") int num_groups_y, @NativeType("GLuint") int num_groups_z, @NativeType("GLuint") int group_size_x, @NativeType("GLuint") int group_size_y, @NativeType("GLuint") int group_size_z); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBConditionalRenderInverted.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBConditionalRenderInverted.java new file mode 100644 index 00000000..1a11ff9a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBConditionalRenderInverted.java @@ -0,0 +1,26 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_conditional_render_inverted extension. + * + *

This extension adds new modes to {@link GL30C#glBeginConditionalRender BeginConditionalRender} which invert the condition used to determine whether to draw or not.

+ * + *

Requires {@link GL30 OpenGL 3.0}. Promoted to core in {@link GL45 OpenGL 4.5}.

+ */ +public final class ARBConditionalRenderInverted { + + /** Accepted by the {@code mode} parameter of {@link GL30C#glBeginConditionalRender BeginConditionalRender}. */ + public static final int + GL_QUERY_WAIT_INVERTED = 0x8E17, + GL_QUERY_NO_WAIT_INVERTED = 0x8E18, + GL_QUERY_BY_REGION_WAIT_INVERTED = 0x8E19, + GL_QUERY_BY_REGION_NO_WAIT_INVERTED = 0x8E1A; + + private ARBConditionalRenderInverted() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBCopyBuffer.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBCopyBuffer.java new file mode 100644 index 00000000..1d38a69e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBCopyBuffer.java @@ -0,0 +1,67 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_copy_buffer extension. + * + *

This extension provides a mechanism to do an accelerated copy from one buffer object to another. This may be useful to load buffer objects in a "loading + * thread" while minimizing cost and synchronization effort in the "rendering thread."

+ * + *

Promoted to core in {@link GL31 OpenGL 3.1}.

+ */ +public class ARBCopyBuffer { + + /** + * Accepted by the target parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferPointerv, MapBufferRange, + * FlushMappedBufferRange, GetBufferParameteriv, BindBufferRange, BindBufferBase, and CopyBufferSubData. + */ + public static final int + GL_COPY_READ_BUFFER = 0x8F36, + GL_COPY_WRITE_BUFFER = 0x8F37; + + static { GL.initialize(); } + + protected ARBCopyBuffer() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glCopyBufferSubData + ); + } + + // --- [ glCopyBufferSubData ] --- + + /** + * Copies all or part of one buffer object's data store to the data store of another buffer object. + * + *

An {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error is generated if any of readoffset, writeoffset, or size are negative, if readoffset+size exceeds the size of the buffer object + * bound to readtarget, or if writeoffset+size exceeds the size of the buffer object bound to writetarget.

+ * + *

An {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error is generated if the same buffer object is bound to both readtarget and writetarget, and the ranges [readoffset, readoffset+size) + * and [writeoffset, writeoffset+size) overlap.

+ * + *

An {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} error is generated if zero is bound to readtarget or writetarget.

+ * + *

An {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} error is generated if the buffer objects bound to either readtarget or writetarget are mapped.

+ * + * @param readTarget the source buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL31C#GL_COPY_READ_BUFFER COPY_READ_BUFFER}{@link GL31C#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}
{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31C#GL_TEXTURE_BUFFER TEXTURE_BUFFER}
{@link GL31C#GL_UNIFORM_BUFFER UNIFORM_BUFFER}
+ * @param writeTarget the destination buffer object target + * @param readOffset the source buffer object offset, in bytes + * @param writeOffset the destination buffer object offset, in bytes + * @param size the number of bytes to copy + */ + public static void glCopyBufferSubData(@NativeType("GLenum") int readTarget, @NativeType("GLenum") int writeTarget, @NativeType("GLintptr") long readOffset, @NativeType("GLintptr") long writeOffset, @NativeType("GLsizeiptr") long size) { + GL31C.glCopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBCopyImage.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBCopyImage.java new file mode 100644 index 00000000..9c521bf3 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBCopyImage.java @@ -0,0 +1,68 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_copy_image extension. + * + *

This extension enables efficient image data transfer between image objects (i.e. textures and renderbuffers) without the need to bind the objects or + * otherwise configure the rendering pipeline.

+ * + *

This is accomplised by adding a new entry-point {@link #glCopyImageSubData CopyImageSubData}, which takes a named source and destination.

+ * + *

CopyImageSubData does not perform general-purpose conversions such as scaling, resizing, blending, color-space, or format conversions. It should be + * considered to operate in a manner similar to a CPU {@code memcpy}, but using the GPU for the copy.

+ * + *

CopyImageSubData supports copies between images with different internal formats, if the formats are compatible for TextureViews.

+ * + *

CopyImageSubData also supports copying between compressed and uncompressed images if the compressed block / uncompressed texel sizes are the same.

+ * + *

Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ +public class ARBCopyImage { + + static { GL.initialize(); } + + protected ARBCopyImage() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glCopyImageSubData + ); + } + + // --- [ glCopyImageSubData ] --- + + /** + * Performs a raw data copy between two images. + * + * @param srcName the name of a texture or renderbuffer object from which to copy + * @param srcTarget the target representing the namespace of the source name {@code srcName} + * @param srcLevel the mipmap level to read from the source + * @param srcX the X coordinate of the left edge of the souce region to copy + * @param srcY the Y coordinate of the top edge of the souce region to copy + * @param srcZ the Z coordinate of the near edge of the souce region to copy + * @param dstName the name of a texture or renderbuffer object to which to copy + * @param dstTarget the target representing the namespace of the destination name {@code dstName} + * @param dstLevel the mipmap level to write to the source + * @param dstX the X coordinate of the left edge of the destination region + * @param dstY the Y coordinate of the top edge of the destination region + * @param dstZ the Z coordinate of the near edge of the destination region + * @param srcWidth the width of the region to be copied + * @param srcHeight the height of the region to be copied + * @param srcDepth the depth of the region to be copied + */ + public static void glCopyImageSubData(@NativeType("GLuint") int srcName, @NativeType("GLenum") int srcTarget, @NativeType("GLint") int srcLevel, @NativeType("GLint") int srcX, @NativeType("GLint") int srcY, @NativeType("GLint") int srcZ, @NativeType("GLuint") int dstName, @NativeType("GLenum") int dstTarget, @NativeType("GLint") int dstLevel, @NativeType("GLint") int dstX, @NativeType("GLint") int dstY, @NativeType("GLint") int dstZ, @NativeType("GLsizei") int srcWidth, @NativeType("GLsizei") int srcHeight, @NativeType("GLsizei") int srcDepth) { + GL43C.glCopyImageSubData(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBCullDistance.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBCullDistance.java new file mode 100644 index 00000000..332a88fe --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBCullDistance.java @@ -0,0 +1,26 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_cull_distance extension. + * + *

This extension adds a new GLSL {@code gl_CullDistance} shader output, similar to {@code gl_ClipDistance}, but used for whole primitive culling.

+ * + *

This new stage in the pipeline is added as part of the primitive clipping stage.

+ * + *

Requires {@link GL30 OpenGL 3.0}. Promoted to core in {@link GL45 OpenGL 4.5}.

+ */ +public final class ARBCullDistance { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetFloatv, GetIntegerv, and GetInteger64v. */ + public static final int + GL_MAX_CULL_DISTANCES = 0x82F9, + GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES = 0x82FA; + + private ARBCullDistance() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDebugOutput.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDebugOutput.java new file mode 100644 index 00000000..25eeb7a1 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDebugOutput.java @@ -0,0 +1,399 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_debug_output extension. + * + *

This extension allows the GL to notify applications when various events occur that may be useful during application development and debugging.

+ * + *

These events are represented in the form of enumerable messages with a human-readable string representation. Examples of debug events include incorrect + * use of the GL, warnings of undefined behavior, and performance warnings.

+ * + *

A message is uniquely identified by a source, a type and an implementation-dependent ID within the source and type pair.

+ * + *

A message's source identifies the origin of the message and can either describe components of the GL, the window system, third-party external sources + * such as external debuggers, or even the application itself.

+ * + *

The type of the message roughly identifies the nature of the event that caused the message. Examples include errors, performance warnings, or warnings + * about undefined behavior.

+ * + *

A message's ID for a given source and type further distinguishes messages within those groups. For example, an error caused by a negative parameter + * value or an invalid internal texture format are both errors generated by the API, but would likely have different message IDs.

+ * + *

Each message is also assigned to a severity level that denotes roughly how "important" that message is in comparison to other messages across all + * sources and types. For example, notification of a GL error would likely have a higher severity than a performance warning due to redundant state + * changes.

+ * + *

Finally, every message contains an implementation-dependent string representation that provides a useful description of the event.

+ * + *

Messages are communicated to the application through an application-defined callback function that is called by the GL implementation on each debug + * message. The motivation for the callback routine is to free application developers from actively having to query whether a GL error, or any other + * debuggable event has happened after each call to a GL function. With a callback, developers can keep their code free of debug checks, and only have to + * react to messages as they occur. In situations where using a callback is not possible, a message log is also provided that stores copies of recent + * messages until they are actively queried.

+ * + *

To control the volume of debug output, messages can be disabled either individually by ID, or entire groups of messages can be turned off based on + * combination of source and type.

+ * + *

The only requirement on the minimum quantity and type of messages that implementations of this extension must support is that some sort of message must + * be sent notifying the application whenever any GL error occurs. Any further messages are left to the implementation. Implementations do not have to + * output messages from all sources nor do they have to use all types of messages listed by this extension, and both new sources and types can be added by + * other extensions.

+ * + *

For performance reasons it is recommended, but not required, that implementations restrict supporting this extension only to contexts created using the + * debug flag as provided by {@link WGLARBCreateContext WGL_ARB_create_context} or {@link GLXARBCreateContext GLX_ARB_create_context}. This extension places no limits on any other functionality + * provided by debug contexts through other extensions.

+ */ +public class ARBDebugOutput { + + /** + * Tokens accepted by the {@code target} parameters of Enable, Disable, and IsEnabled. + * + *

The behavior of how and when the GL driver is allowed to generate debug messages, and subsequently either call back to the application or place the + * message in the debug message log, is affected by the state DEBUG_OUTPUT_SYNCHRONOUS_ARB. This state can be modified by the {@link GL11#glEnable Enable} and + * {@link GL11#glDisable Disable} commands. Its initial value is {@link GL11#GL_FALSE FALSE}.

+ * + *

When DEBUG_OUTPUT_SYNCHRONOUS_ARB is disabled, the driver is optionally allowed to concurrently call the debug callback routine from potentially + * multiple threads, including threads that the context that generated the message is not currently bound to. The implementation may also call the callback + * routine asynchronously after the GL command that generated the message has already returned. The application is fully responsible for ensuring thread + * safety due to debug callbacks under these circumstances. In this situation the {@code userParam} value may be helpful in identifying which application + * thread's command originally generated the debug callback.

+ * + *

When DEBUG_OUTPUT_SYNCHRONOUS_ARB is enabled, the driver guarantees synchronous calls to the callback routine by the context. When synchronous callbacks + * are enabled, all calls to the callback routine will be made by the thread that owns the current context; all such calls will be made serially by the + * current context; and each call will be made before the GL command that generated the debug message is allowed to return.

+ * + *

When no callback is specified and DEBUG_OUTPUT_SYNCHRONOUS_ARB is disabled, the driver can still asynchronously place messages in the debug message log, + * even after the context thread has returned from the GL function that generated those messages. When DEBUG_OUTPUT_SYNCHRONOUS_ARB is enabled, the driver + * guarantees that all messages are added to the log before the GL function returns.

+ * + *

Enabling synchronous debug output greatly simplifies the responsibilities of the application for making its callback functions thread-safe, but may + * potentially result in drastically reduced driver performance.

+ * + *

The DEBUG_OUTPUT_SYNCHRONOUS_ARB only guarantees intra-context synchronization for the callbacks of messages generated by that context, and does not + * guarantee synchronization across multiple contexts. If multiple contexts are concurrently used by the application, it is allowed for those contexts to + * also concurrently call their designated callbacks, and the application is responsible for handling thread safety in that situation even if + * DEBUG_OUTPUT_SYNCHRONOUS_ARB is enabled in all contexts.

+ */ + public static final int GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB = 0x8242; + + /** Tokens accepted by the {@code value} parameters of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_DEBUG_MESSAGE_LENGTH_ARB = 0x9143, + GL_MAX_DEBUG_LOGGED_MESSAGES_ARB = 0x9144, + GL_DEBUG_LOGGED_MESSAGES_ARB = 0x9145, + GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB = 0x8243; + + /** Tokens accepted by the {@code pname} parameter of GetPointerv. */ + public static final int + GL_DEBUG_CALLBACK_FUNCTION_ARB = 0x8244, + GL_DEBUG_CALLBACK_USER_PARAM_ARB = 0x8245; + + /** + * Tokens accepted or provided by the {@code source} parameters of DebugMessageControlARB, DebugMessageInsertARB and DEBUGPROCARB, and the {@code sources} + * parameter of GetDebugMessageLogARB. + */ + public static final int + GL_DEBUG_SOURCE_API_ARB = 0x8246, + GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB = 0x8247, + GL_DEBUG_SOURCE_SHADER_COMPILER_ARB = 0x8248, + GL_DEBUG_SOURCE_THIRD_PARTY_ARB = 0x8249, + GL_DEBUG_SOURCE_APPLICATION_ARB = 0x824A, + GL_DEBUG_SOURCE_OTHER_ARB = 0x824B; + + /** + * Tokens accepted or provided by the {@code type} parameters of DebugMessageControlARB, DebugMessageInsertARB and DEBUGPROCARB, and the {@code types} + * parameter of GetDebugMessageLogARB. + */ + public static final int + GL_DEBUG_TYPE_ERROR_ARB = 0x824C, + GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB = 0x824D, + GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB = 0x824E, + GL_DEBUG_TYPE_PORTABILITY_ARB = 0x824F, + GL_DEBUG_TYPE_PERFORMANCE_ARB = 0x8250, + GL_DEBUG_TYPE_OTHER_ARB = 0x8251; + + /** + * Tokens accepted or provided by the {@code severity} parameters of DebugMessageControlARB, DebugMessageInsertARB and DEBUGPROCARB callback functions, and + * the {@code severities} parameter of GetDebugMessageLogARB. + */ + public static final int + GL_DEBUG_SEVERITY_HIGH_ARB = 0x9146, + GL_DEBUG_SEVERITY_MEDIUM_ARB = 0x9147, + GL_DEBUG_SEVERITY_LOW_ARB = 0x9148; + + static { GL.initialize(); } + + protected ARBDebugOutput() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glDebugMessageControlARB, caps.glDebugMessageInsertARB, caps.glDebugMessageCallbackARB, caps.glGetDebugMessageLogARB + ); + } + + // --- [ glDebugMessageControlARB ] --- + + /** + * Unsafe version of: {@link #glDebugMessageControlARB DebugMessageControlARB} + * + * @param count the number of message IDs in {@code ids} + */ + public static native void nglDebugMessageControlARB(int source, int type, int severity, int count, long ids, boolean enabled); + + /** + * Controls the volume of debug output by disabling specific or groups of messages. + * + *

If {@code enabled} is {@link GL11#GL_TRUE TRUE}, the referenced subset of messages will be enabled. If {@link GL11#GL_FALSE FALSE}, then those messages will be disabled.

+ * + *

This command can reference different subsets of messages by first considering the set of all messages, and filtering out messages based on the following + * ways:

+ * + *
    + *
  • If {@code source} is not {@link GL11#GL_DONT_CARE DONT_CARE}, then all messages whose source does not match {@code source} will not be referenced.
  • + *
  • If {@code type} is not {@link GL11#GL_DONT_CARE DONT_CARE}, then all messages whose type does not match {@code type} will not be referenced.
  • + *
  • If {@code severity} is not {@link GL11#GL_DONT_CARE DONT_CARE}, then all messages whose severity level does not match {@code severity} will not be referenced.
  • + *
  • If {@code count} is greater than zero, then {@code ids} is an array of {@code count} message IDs for the specified combination of {@code source} and + * {@code type}. In this case, if {@code source} or {@code type} is {@link GL11#GL_DONT_CARE DONT_CARE}, or {@code severity} is not {@link GL11#GL_DONT_CARE DONT_CARE}, the error + * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated. If {@code count} is zero, the value if {@code ids} is ignored.
  • + *
+ * + *

Although messages are grouped into an implicit hierarchy by their sources and types, there is no explicit per-source, per-type or per-severity enabled + * state. Instead, the enabled state is stored individually for each message. There is no difference between disabling all messages from one source in a + * single call, and individually disabling all messages from that source using their types and IDs.

+ * + * @param source the message source. One of:
{@link #GL_DEBUG_SOURCE_API_ARB DEBUG_SOURCE_API_ARB}{@link #GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB DEBUG_SOURCE_WINDOW_SYSTEM_ARB}
{@link #GL_DEBUG_SOURCE_SHADER_COMPILER_ARB DEBUG_SOURCE_SHADER_COMPILER_ARB}{@link #GL_DEBUG_SOURCE_THIRD_PARTY_ARB DEBUG_SOURCE_THIRD_PARTY_ARB}
{@link #GL_DEBUG_SOURCE_APPLICATION_ARB DEBUG_SOURCE_APPLICATION_ARB}{@link #GL_DEBUG_SOURCE_OTHER_ARB DEBUG_SOURCE_OTHER_ARB}
+ * @param type the message type. One of:
{@link #GL_DEBUG_TYPE_ERROR_ARB DEBUG_TYPE_ERROR_ARB}{@link #GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB}
{@link #GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB}{@link #GL_DEBUG_TYPE_PORTABILITY_ARB DEBUG_TYPE_PORTABILITY_ARB}
{@link #GL_DEBUG_TYPE_PERFORMANCE_ARB DEBUG_TYPE_PERFORMANCE_ARB}{@link #GL_DEBUG_TYPE_OTHER_ARB DEBUG_TYPE_OTHER_ARB}
+ * @param severity the message severity level. One of:
{@link #GL_DEBUG_SEVERITY_HIGH_ARB DEBUG_SEVERITY_HIGH_ARB}{@link #GL_DEBUG_SEVERITY_MEDIUM_ARB DEBUG_SEVERITY_MEDIUM_ARB}{@link #GL_DEBUG_SEVERITY_LOW_ARB DEBUG_SEVERITY_LOW_ARB}
+ * @param ids the message IDs to enable or disable + * @param enabled whether to enable or disable the references subset of messages + */ + public static void glDebugMessageControlARB(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLenum") int severity, @Nullable @NativeType("GLuint const *") IntBuffer ids, @NativeType("GLboolean") boolean enabled) { + nglDebugMessageControlARB(source, type, severity, remainingSafe(ids), memAddressSafe(ids), enabled); + } + + /** + * Controls the volume of debug output by disabling specific or groups of messages. + * + *

If {@code enabled} is {@link GL11#GL_TRUE TRUE}, the referenced subset of messages will be enabled. If {@link GL11#GL_FALSE FALSE}, then those messages will be disabled.

+ * + *

This command can reference different subsets of messages by first considering the set of all messages, and filtering out messages based on the following + * ways:

+ * + *
    + *
  • If {@code source} is not {@link GL11#GL_DONT_CARE DONT_CARE}, then all messages whose source does not match {@code source} will not be referenced.
  • + *
  • If {@code type} is not {@link GL11#GL_DONT_CARE DONT_CARE}, then all messages whose type does not match {@code type} will not be referenced.
  • + *
  • If {@code severity} is not {@link GL11#GL_DONT_CARE DONT_CARE}, then all messages whose severity level does not match {@code severity} will not be referenced.
  • + *
  • If {@code count} is greater than zero, then {@code ids} is an array of {@code count} message IDs for the specified combination of {@code source} and + * {@code type}. In this case, if {@code source} or {@code type} is {@link GL11#GL_DONT_CARE DONT_CARE}, or {@code severity} is not {@link GL11#GL_DONT_CARE DONT_CARE}, the error + * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated. If {@code count} is zero, the value if {@code ids} is ignored.
  • + *
+ * + *

Although messages are grouped into an implicit hierarchy by their sources and types, there is no explicit per-source, per-type or per-severity enabled + * state. Instead, the enabled state is stored individually for each message. There is no difference between disabling all messages from one source in a + * single call, and individually disabling all messages from that source using their types and IDs.

+ * + * @param source the message source. One of:
{@link #GL_DEBUG_SOURCE_API_ARB DEBUG_SOURCE_API_ARB}{@link #GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB DEBUG_SOURCE_WINDOW_SYSTEM_ARB}
{@link #GL_DEBUG_SOURCE_SHADER_COMPILER_ARB DEBUG_SOURCE_SHADER_COMPILER_ARB}{@link #GL_DEBUG_SOURCE_THIRD_PARTY_ARB DEBUG_SOURCE_THIRD_PARTY_ARB}
{@link #GL_DEBUG_SOURCE_APPLICATION_ARB DEBUG_SOURCE_APPLICATION_ARB}{@link #GL_DEBUG_SOURCE_OTHER_ARB DEBUG_SOURCE_OTHER_ARB}
+ * @param type the message type. One of:
{@link #GL_DEBUG_TYPE_ERROR_ARB DEBUG_TYPE_ERROR_ARB}{@link #GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB}
{@link #GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB}{@link #GL_DEBUG_TYPE_PORTABILITY_ARB DEBUG_TYPE_PORTABILITY_ARB}
{@link #GL_DEBUG_TYPE_PERFORMANCE_ARB DEBUG_TYPE_PERFORMANCE_ARB}{@link #GL_DEBUG_TYPE_OTHER_ARB DEBUG_TYPE_OTHER_ARB}
+ * @param severity the message severity level. One of:
{@link #GL_DEBUG_SEVERITY_HIGH_ARB DEBUG_SEVERITY_HIGH_ARB}{@link #GL_DEBUG_SEVERITY_MEDIUM_ARB DEBUG_SEVERITY_MEDIUM_ARB}{@link #GL_DEBUG_SEVERITY_LOW_ARB DEBUG_SEVERITY_LOW_ARB}
+ * @param enabled whether to enable or disable the references subset of messages + */ + public static void glDebugMessageControlARB(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLenum") int severity, @NativeType("GLuint const *") int id, @NativeType("GLboolean") boolean enabled) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer ids = stack.ints(id); + nglDebugMessageControlARB(source, type, severity, 1, memAddress(ids), enabled); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glDebugMessageInsertARB ] --- + + /** + * Unsafe version of: {@link #glDebugMessageInsertARB DebugMessageInsertARB} + * + * @param length the number of characters in {@code buf}. If negative, it is implied that {@code buf} contains a null terminated string. + */ + public static native void nglDebugMessageInsertARB(int source, int type, int id, int severity, int length, long buf); + + /** + * This function can be called by applications and third-party libraries to generate their own messages, such as ones containing timestamp information or + * signals about specific render system events. + * + *

The error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} will be generated if the number of characters in {@code buf}, excluding the null terminator when {@code length} is + * negative, is not less than {@link #GL_MAX_DEBUG_MESSAGE_LENGTH_ARB MAX_DEBUG_MESSAGE_LENGTH_ARB}.

+ * + * @param source the message source. One of:
{@link #GL_DEBUG_SOURCE_THIRD_PARTY_ARB DEBUG_SOURCE_THIRD_PARTY_ARB}{@link #GL_DEBUG_SOURCE_APPLICATION_ARB DEBUG_SOURCE_APPLICATION_ARB}
+ * @param type the message type. One of:
{@link #GL_DEBUG_TYPE_ERROR_ARB DEBUG_TYPE_ERROR_ARB}{@link #GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB}
{@link #GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB}{@link #GL_DEBUG_TYPE_PORTABILITY_ARB DEBUG_TYPE_PORTABILITY_ARB}
{@link #GL_DEBUG_TYPE_PERFORMANCE_ARB DEBUG_TYPE_PERFORMANCE_ARB}{@link #GL_DEBUG_TYPE_OTHER_ARB DEBUG_TYPE_OTHER_ARB}
+ * @param id the message ID + * @param severity the message severity level. One of:
{@link #GL_DEBUG_SEVERITY_HIGH_ARB DEBUG_SEVERITY_HIGH_ARB}{@link #GL_DEBUG_SEVERITY_MEDIUM_ARB DEBUG_SEVERITY_MEDIUM_ARB}{@link #GL_DEBUG_SEVERITY_LOW_ARB DEBUG_SEVERITY_LOW_ARB}
+ * @param buf the string representation of the message + */ + public static void glDebugMessageInsertARB(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLuint") int id, @NativeType("GLenum") int severity, @NativeType("GLchar const *") ByteBuffer buf) { + nglDebugMessageInsertARB(source, type, id, severity, buf.remaining(), memAddress(buf)); + } + + /** + * This function can be called by applications and third-party libraries to generate their own messages, such as ones containing timestamp information or + * signals about specific render system events. + * + *

The error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} will be generated if the number of characters in {@code buf}, excluding the null terminator when {@code length} is + * negative, is not less than {@link #GL_MAX_DEBUG_MESSAGE_LENGTH_ARB MAX_DEBUG_MESSAGE_LENGTH_ARB}.

+ * + * @param source the message source. One of:
{@link #GL_DEBUG_SOURCE_THIRD_PARTY_ARB DEBUG_SOURCE_THIRD_PARTY_ARB}{@link #GL_DEBUG_SOURCE_APPLICATION_ARB DEBUG_SOURCE_APPLICATION_ARB}
+ * @param type the message type. One of:
{@link #GL_DEBUG_TYPE_ERROR_ARB DEBUG_TYPE_ERROR_ARB}{@link #GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB}
{@link #GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB}{@link #GL_DEBUG_TYPE_PORTABILITY_ARB DEBUG_TYPE_PORTABILITY_ARB}
{@link #GL_DEBUG_TYPE_PERFORMANCE_ARB DEBUG_TYPE_PERFORMANCE_ARB}{@link #GL_DEBUG_TYPE_OTHER_ARB DEBUG_TYPE_OTHER_ARB}
+ * @param id the message ID + * @param severity the message severity level. One of:
{@link #GL_DEBUG_SEVERITY_HIGH_ARB DEBUG_SEVERITY_HIGH_ARB}{@link #GL_DEBUG_SEVERITY_MEDIUM_ARB DEBUG_SEVERITY_MEDIUM_ARB}{@link #GL_DEBUG_SEVERITY_LOW_ARB DEBUG_SEVERITY_LOW_ARB}
+ * @param buf the string representation of the message + */ + public static void glDebugMessageInsertARB(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLuint") int id, @NativeType("GLenum") int severity, @NativeType("GLchar const *") CharSequence buf) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + int bufEncodedLength = stack.nUTF8(buf, false); + long bufEncoded = stack.getPointerAddress(); + nglDebugMessageInsertARB(source, type, id, severity, bufEncodedLength, bufEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glDebugMessageCallbackARB ] --- + + /** Unsafe version of: {@link #glDebugMessageCallbackARB DebugMessageCallbackARB} */ + public static native void nglDebugMessageCallbackARB(long callback, long userParam); + + /** + * Specifies a callback function for receiving debug messages. + * + *

This function's prototype must follow the type definition of DEBUGPROCARB including its platform-dependent calling convention. Anything else will result + * in undefined behavior. Only one debug callback can be specified for the current context, and further calls overwrite the previous callback. Specifying + * {@code NULL} as the value of {@code callback} clears the current callback and disables message output through callbacks. Applications can provide + * user-specified data through the pointer {@code userParam}. The context will store this pointer and will include it as one of the parameters in each call + * to the callback function.

+ * + *

If the application has specified a callback function for receiving debug output, the implementation will call that function whenever any enabled message + * is generated. The source, type, ID, and severity of the message are specified by the DEBUGPROCARB parameters {@code source}, {@code type}, {@code id}, + * and {@code severity}, respectively. The string representation of the message is stored in {@code message} and its length (excluding the null-terminator) + * is stored in {@code length}. The parameter {@code userParam} is the user-specified parameter that was given when calling DebugMessageCallbackARB.

+ * + *

Applications can query the current callback function and the current user-specified parameter by obtaining the values of {@link #GL_DEBUG_CALLBACK_FUNCTION_ARB DEBUG_CALLBACK_FUNCTION_ARB} + * and {@link #GL_DEBUG_CALLBACK_USER_PARAM_ARB DEBUG_CALLBACK_USER_PARAM_ARB}, respectively.

+ * + *

Applications that specify a callback function must be aware of certain special conditions when executing code inside a callback when it is called by the + * GL, regardless of the debug source.

+ * + *

The memory for {@code message} is owned and managed by the GL, and should only be considered valid for the duration of the function call.

+ * + *

The behavior of calling any GL or window system function from within the callback function is undefined and may lead to program termination.

+ * + *

Care must also be taken in securing debug callbacks for use with asynchronous debug output by multi-threaded GL implementations.

+ * + *

If {@link #GL_DEBUG_CALLBACK_FUNCTION_ARB DEBUG_CALLBACK_FUNCTION_ARB} is {@code NULL}, then debug messages are instead stored in an internal message log up to some maximum number of messages as + * defined by the value of {@link #GL_MAX_DEBUG_LOGGED_MESSAGES_ARB MAX_DEBUG_LOGGED_MESSAGES_ARB}.

+ * + *

Each context stores its own message log and will only store messages generated by commands operating in that context. If the message log fills up, then + * any subsequently generated messages will not be placed in the log until the message log is cleared, and will instead be discarded.

+ * + *

Applications can query the number of messages currently in the log by obtaining the value of {@link #GL_DEBUG_LOGGED_MESSAGES_ARB DEBUG_LOGGED_MESSAGES_ARB}, and the string length + * (including its null terminator) of the oldest message in the log through the value of {@link #GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB DEBUG_NEXT_LOGGED_MESSAGE_LENGTH_ARB}.

+ * + * @param callback a callback function that will be called when a debug message is generated + * @param userParam a user supplied pointer that will be passed on each invocation of {@code callback} + */ + public static void glDebugMessageCallbackARB(@Nullable @NativeType("GLDEBUGPROCARB") GLDebugMessageARBCallbackI callback, @NativeType("void const *") long userParam) { + nglDebugMessageCallbackARB(memAddressSafe(callback), userParam); + } + + // --- [ glGetDebugMessageLogARB ] --- + + /** + * Unsafe version of: {@link #glGetDebugMessageLogARB GetDebugMessageLogARB} + * + * @param bufSize the maximum number of characters that can be written in the {@code messageLog} array + */ + public static native int nglGetDebugMessageLogARB(int count, int bufSize, long sources, long types, long ids, long severities, long lengths, long messageLog); + + /** + * When no debug callback is set, debug messages are stored in a debug message log. Messages can be queried from the log by calling this function. + * + *

This function fetches a maximum of {@code count} messages from the message log, and will return the number of messages successfully fetched.

+ * + *

Messages will be fetched from the log in order of oldest to newest. Those messages that were fetched will be removed from the log.

+ * + *

The sources, types, severities, IDs, and string lengths of fetched messages will be stored in the application-provided arrays {@code sources}, + * {@code types}, {@code severities}, {@code ids}, and {@code lengths}, respectively. The application is responsible for allocating enough space for each + * array to hold up to {@code count} elements. The string representations of all fetched messages are stored in the {@code messageLog} array. If multiple + * messages are fetched, their strings are concatenated into the same {@code messageLog} array and will be separated by single null terminators. The last + * string in the array will also be null-terminated. The maximum size of {@code messageLog}, including the space used by all null terminators, is given by + * {@code bufSize}. If {@code bufSize} is less than zero, the error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} will be generated. If a message's string, including its null + * terminator, can not fully fit within the {@code messageLog} array's remaining space, then that message and any subsequent messages will not be fetched + * and will remain in the log. The string lengths stored in the array {@code lengths} include the space for the null terminator of each string.

+ * + *

Any or all of the arrays {@code sources}, {@code types}, {@code ids}, {@code severities}, {@code lengths} and {@code messageLog} can also be null + * pointers, which causes the attributes for such arrays to be discarded when messages are fetched, however those messages will still be removed from the + * log. Thus to simply delete up to {@code count} messages from the message log while ignoring their attributes, the application can call the function with + * null pointers for all attribute arrays. If {@code messageLog} is {@code NULL}, the value of {@code bufSize} is ignored.

+ * + * @param count the number of debug messages to retrieve from the log + * @param sources a buffer in which to place the returned message sources + * @param types a buffer in which to place the returned message typesd + * @param ids a buffer in which to place the returned message IDs + * @param severities a buffer in which to place the returned message severity levels + * @param lengths a buffer in which to place the returned message lengths + * @param messageLog a buffer in which to place the returned messages + */ + @NativeType("GLuint") + public static int glGetDebugMessageLogARB(@NativeType("GLuint") int count, @Nullable @NativeType("GLenum *") IntBuffer sources, @Nullable @NativeType("GLenum *") IntBuffer types, @Nullable @NativeType("GLuint *") IntBuffer ids, @Nullable @NativeType("GLenum *") IntBuffer severities, @Nullable @NativeType("GLsizei *") IntBuffer lengths, @Nullable @NativeType("GLchar *") ByteBuffer messageLog) { + if (CHECKS) { + checkSafe(sources, count); + checkSafe(types, count); + checkSafe(ids, count); + checkSafe(severities, count); + checkSafe(lengths, count); + } + return nglGetDebugMessageLogARB(count, remainingSafe(messageLog), memAddressSafe(sources), memAddressSafe(types), memAddressSafe(ids), memAddressSafe(severities), memAddressSafe(lengths), memAddressSafe(messageLog)); + } + + /** Array version of: {@link #glDebugMessageControlARB DebugMessageControlARB} */ + public static void glDebugMessageControlARB(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLenum") int severity, @Nullable @NativeType("GLuint const *") int[] ids, @NativeType("GLboolean") boolean enabled) { + long __functionAddress = GL.getICD().glDebugMessageControlARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(source, type, severity, lengthSafe(ids), ids, enabled, __functionAddress); + } + + /** Array version of: {@link #glGetDebugMessageLogARB GetDebugMessageLogARB} */ + @NativeType("GLuint") + public static int glGetDebugMessageLogARB(@NativeType("GLuint") int count, @Nullable @NativeType("GLenum *") int[] sources, @Nullable @NativeType("GLenum *") int[] types, @Nullable @NativeType("GLuint *") int[] ids, @Nullable @NativeType("GLenum *") int[] severities, @Nullable @NativeType("GLsizei *") int[] lengths, @Nullable @NativeType("GLchar *") ByteBuffer messageLog) { + long __functionAddress = GL.getICD().glGetDebugMessageLogARB; + if (CHECKS) { + check(__functionAddress); + checkSafe(sources, count); + checkSafe(types, count); + checkSafe(ids, count); + checkSafe(severities, count); + checkSafe(lengths, count); + } + return callPPPPPPI(count, remainingSafe(messageLog), sources, types, ids, severities, lengths, memAddressSafe(messageLog), __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDepthBufferFloat.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDepthBufferFloat.java new file mode 100644 index 00000000..ad79312d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDepthBufferFloat.java @@ -0,0 +1,40 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_depth_buffer_float extension. + * + *

This extension provides new texture internal formats whose depth components are stored as 32-bit floating-point values, rather than the normalized + * unsigned integers used in existing depth formats. Floating-point depth textures support all the functionality supported for fixed-point depth textures, + * including shadow mapping and rendering support via {@link EXTFramebufferObject EXT_framebuffer_object}. Floating-point depth textures can store values outside the range + * {@code [0,1]}.

+ * + *

Additionally, this extension provides new packed depth/stencil pixel formats (see {@link EXTPackedDepthStencil EXT_packed_depth_stencil}) that have 64-bit pixels consisting + * of a 32-bit floating-point depth value, 8 bits of stencil, and 24 unused bites. A packed depth/stencil texture internal format is also provided.

+ * + *

Requires {@link GL20 OpenGL 2.0}, {@link ARBColorBufferFloat ARB_color_buffer_float}, {@link EXTPackedDepthStencil EXT_packed_depth_stencil} and {@link ARBFramebufferObject ARB_framebuffer_object}. + * Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ +public final class ARBDepthBufferFloat { + + /** + * Accepted by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and RenderbufferStorageEXT, and + * returned in the {@code data} parameter of GetTexLevelParameter and GetRenderbufferParameterivEXT. + */ + public static final int + GL_DEPTH_COMPONENT32F = 0x8CAC, + GL_DEPTH32F_STENCIL8 = 0x8CAD; + + /** + * Accepted by the {@code type} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, and + * GetTexImage. + */ + public static final int GL_FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD; + + private ARBDepthBufferFloat() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDepthClamp.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDepthClamp.java new file mode 100644 index 00000000..85cf19d5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDepthClamp.java @@ -0,0 +1,37 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_depth_clamp extension. + * + *

Conventional OpenGL clips geometric primitives to a clip volume with six faces, two of which are the near and far clip planes. Clipping to the near and + * far planes of the clip volume ensures that interpolated depth values (after the depth range transform) must be in the [0,1] range.

+ * + *

In some rendering applications such as shadow volumes, it is useful to allow line and polygon primitives to be rasterized without clipping the primitive + * to the near or far clip volume planes (side clip volume planes clip normally). Without the near and far clip planes, rasterization (pixel coverage + * determination) in X and Y can proceed normally if we ignore the near and far clip planes. The one major issue is that fragments of a primitive may + * extend beyond the conventional window space depth range for depth values (typically the range [0,1]). Rather than discarding fragments that defy the + * window space depth range (effectively what near and far plane clipping accomplish), the depth values can be clamped to the current depth range.

+ * + *

This extension provides exactly such functionality. This functionality is useful to obviate the need for near plane capping of stenciled shadow volumes. + * The functionality may also be useful for rendering geometry "beyond" the far plane if an alternative algorithm (rather than depth testing) for hidden + * surface removal is applied to such geometry (specifically, the painter's algorithm). Similar situations at the near clip plane can be avoided at the + * near clip plane where apparently solid objects can be "seen through" if they intersect the near clip plane.

+ * + *

Promoted to core in {@link GL32 OpenGL 3.2}.

+ */ +public final class ARBDepthClamp { + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_DEPTH_CLAMP = 0x864F; + + private ARBDepthClamp() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDepthTexture.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDepthTexture.java new file mode 100644 index 00000000..28777421 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDepthTexture.java @@ -0,0 +1,34 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_depth_texture extension. + * + *

This extension defines a new depth texture format. An important application of depth texture images is shadow casting, but separating this from the + * shadow extension allows for the potential use of depth textures in other applications such as image-based rendering or displacement mapping. This + * extension does not define new depth-texture environment functions, such as filtering or applying the depth values computed from a texture but leaves + * this to other extensions, such as the shadow extension.

+ * + *

Promoted to core in {@link GL14 OpenGL 1.4}.

+ */ +public final class ARBDepthTexture { + + /** Accepted by the {@code internalFormat} parameter of TexImage1D, TexImage2D, CopyTexImage1D and CopyTexImage2D. */ + public static final int + GL_DEPTH_COMPONENT16_ARB = 0x81A5, + GL_DEPTH_COMPONENT24_ARB = 0x81A6, + GL_DEPTH_COMPONENT32_ARB = 0x81A7; + + /** Accepted by the {@code pname} parameter of GetTexLevelParameterfv and GetTexLevelParameteriv. */ + public static final int GL_TEXTURE_DEPTH_SIZE_ARB = 0x884A; + + /** Accepted by the {@code pname} parameter of TexParameterf, TexParameteri, TexParameterfv, TexParameteriv, GetTexParameterfv, and GetTexParameteriv. */ + public static final int GL_DEPTH_TEXTURE_MODE_ARB = 0x884B; + + private ARBDepthTexture() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDirectStateAccess.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDirectStateAccess.java new file mode 100644 index 00000000..41e80980 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDirectStateAccess.java @@ -0,0 +1,3569 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_direct_state_access extension. + * + *

In unextended OpenGL, most mutation of state contained in objects is through an indirection known as a binding. Objects are attached to a context + * (either directly or indirectly via a container) and then commands to modify or query their state are issued on that context, indirecting through its + * attachments and into the underlying object. This is known as `bind-to-edit'.

+ * + *

This extension derives from the GL_EXT_direct_state_access extension, which added accessors for most state on most objects, allowing it to be queried + * and modified without the object needing to be bound to a context. In cases where a single property of an object is to be modified, directly accessing + * its state can be more efficient than binding the object to the context and then indirecting through it. Further, directly accessing the state of objects + * through their names rather than by bind-to-edit does not disturb the bindings of the current context, which is useful for tools, middleware and other + * applications that are unaware of the outer state but it can also avoid cases of redundant state changes.

+ * + *

Requires {@link GL20 OpenGL 2.0}. Promoted to core in {@link GL45C OpenGL 4.5}.

+ */ +public class ARBDirectStateAccess { + + /** Accepted by the {@code pname} parameter of GetTextureParameter{if}v and GetTextureParameterI{i ui}v. */ + public static final int GL_TEXTURE_TARGET = 0x1006; + + /** Accepted by the {@code pname} parameter of GetQueryObjectiv. */ + public static final int GL_QUERY_TARGET = 0x82EA; + + static { GL.initialize(); } + + protected ARBDirectStateAccess() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + ARB_transform_feedback2(ext) ? caps.glCreateTransformFeedbacks : -1L, ARB_uniform_buffer_object(ext) ? caps.glTransformFeedbackBufferBase : -1L, + ARB_uniform_buffer_object(ext) ? caps.glTransformFeedbackBufferRange : -1L, ARB_transform_feedback2(ext) ? caps.glGetTransformFeedbackiv : -1L, + ARB_transform_feedback2(ext) ? caps.glGetTransformFeedbacki_v : -1L, ARB_transform_feedback2(ext) ? caps.glGetTransformFeedbacki64_v : -1L, + caps.glCreateBuffers, ARB_buffer_storage(ext) ? caps.glNamedBufferStorage : -1L, caps.glNamedBufferData, caps.glNamedBufferSubData, + ARB_copy_buffer(ext) ? caps.glCopyNamedBufferSubData : -1L, ARB_clear_texture(ext) ? caps.glClearNamedBufferData : -1L, + ARB_clear_texture(ext) ? caps.glClearNamedBufferSubData : -1L, caps.glMapNamedBuffer, ARB_map_buffer_range(ext) ? caps.glMapNamedBufferRange : -1L, + caps.glUnmapNamedBuffer, ARB_map_buffer_range(ext) ? caps.glFlushMappedNamedBufferRange : -1L, caps.glGetNamedBufferParameteriv, + caps.glGetNamedBufferParameteri64v, caps.glGetNamedBufferPointerv, caps.glGetNamedBufferSubData, + ARB_framebuffer_object(ext) ? caps.glCreateFramebuffers : -1L, ARB_framebuffer_object(ext) ? caps.glNamedFramebufferRenderbuffer : -1L, + ARB_framebuffer_no_attachments(ext) ? caps.glNamedFramebufferParameteri : -1L, ARB_framebuffer_object(ext) ? caps.glNamedFramebufferTexture : -1L, + ARB_framebuffer_object(ext) ? caps.glNamedFramebufferTextureLayer : -1L, ARB_framebuffer_object(ext) ? caps.glNamedFramebufferDrawBuffer : -1L, + ARB_framebuffer_object(ext) ? caps.glNamedFramebufferDrawBuffers : -1L, ARB_framebuffer_object(ext) ? caps.glNamedFramebufferReadBuffer : -1L, + ARB_invalidate_subdata(ext) ? caps.glInvalidateNamedFramebufferData : -1L, + ARB_invalidate_subdata(ext) ? caps.glInvalidateNamedFramebufferSubData : -1L, ARB_framebuffer_object(ext) ? caps.glClearNamedFramebufferiv : -1L, + ARB_framebuffer_object(ext) ? caps.glClearNamedFramebufferuiv : -1L, ARB_framebuffer_object(ext) ? caps.glClearNamedFramebufferfv : -1L, + ARB_framebuffer_object(ext) ? caps.glClearNamedFramebufferfi : -1L, ARB_framebuffer_object(ext) ? caps.glBlitNamedFramebuffer : -1L, + ARB_framebuffer_object(ext) ? caps.glCheckNamedFramebufferStatus : -1L, + ARB_framebuffer_no_attachments(ext) ? caps.glGetNamedFramebufferParameteriv : -1L, + ARB_framebuffer_object(ext) ? caps.glGetNamedFramebufferAttachmentParameteriv : -1L, ARB_framebuffer_object(ext) ? caps.glCreateRenderbuffers : -1L, + ARB_framebuffer_object(ext) ? caps.glNamedRenderbufferStorage : -1L, ARB_framebuffer_object(ext) ? caps.glNamedRenderbufferStorageMultisample : -1L, + ARB_framebuffer_object(ext) ? caps.glGetNamedRenderbufferParameteriv : -1L, caps.glCreateTextures, + ARB_texture_buffer_object(ext) ? caps.glTextureBuffer : -1L, ARB_texture_buffer_range(ext) ? caps.glTextureBufferRange : -1L, + ARB_texture_storage(ext) ? caps.glTextureStorage1D : -1L, ARB_texture_storage(ext) ? caps.glTextureStorage2D : -1L, + ARB_texture_storage(ext) ? caps.glTextureStorage3D : -1L, ARB_texture_storage_multisample(ext) ? caps.glTextureStorage2DMultisample : -1L, + ARB_texture_storage_multisample(ext) ? caps.glTextureStorage3DMultisample : -1L, caps.glTextureSubImage1D, caps.glTextureSubImage2D, + caps.glTextureSubImage3D, caps.glCompressedTextureSubImage1D, caps.glCompressedTextureSubImage2D, caps.glCompressedTextureSubImage3D, + caps.glCopyTextureSubImage1D, caps.glCopyTextureSubImage2D, caps.glCopyTextureSubImage3D, caps.glTextureParameterf, caps.glTextureParameterfv, + caps.glTextureParameteri, caps.glTextureParameterIiv, caps.glTextureParameterIuiv, caps.glTextureParameteriv, + ARB_framebuffer_object(ext) ? caps.glGenerateTextureMipmap : -1L, caps.glBindTextureUnit, caps.glGetTextureImage, caps.glGetCompressedTextureImage, + caps.glGetTextureLevelParameterfv, caps.glGetTextureLevelParameteriv, caps.glGetTextureParameterfv, caps.glGetTextureParameterIiv, + caps.glGetTextureParameterIuiv, caps.glGetTextureParameteriv, ARB_vertex_array_object(ext) ? caps.glCreateVertexArrays : -1L, + ARB_vertex_array_object(ext) ? caps.glDisableVertexArrayAttrib : -1L, ARB_vertex_array_object(ext) ? caps.glEnableVertexArrayAttrib : -1L, + ARB_vertex_array_object(ext) ? caps.glVertexArrayElementBuffer : -1L, ARB_vertex_attrib_binding(ext) ? caps.glVertexArrayVertexBuffer : -1L, + ARB_multi_bind(ext) ? caps.glVertexArrayVertexBuffers : -1L, ARB_vertex_attrib_binding(ext) ? caps.glVertexArrayAttribFormat : -1L, + ARB_vertex_attrib_binding(ext) ? caps.glVertexArrayAttribIFormat : -1L, ARB_vertex_attrib_binding(ext) ? caps.glVertexArrayAttribLFormat : -1L, + ARB_vertex_attrib_binding(ext) ? caps.glVertexArrayAttribBinding : -1L, ARB_vertex_attrib_binding(ext) ? caps.glVertexArrayBindingDivisor : -1L, + ARB_vertex_array_object(ext) ? caps.glGetVertexArrayiv : -1L, ARB_vertex_array_object(ext) ? caps.glGetVertexArrayIndexediv : -1L, + ARB_vertex_array_object(ext) ? caps.glGetVertexArrayIndexed64iv : -1L, ARB_sampler_objects(ext) ? caps.glCreateSamplers : -1L, + ARB_separate_shader_objects(ext) ? caps.glCreateProgramPipelines : -1L, caps.glCreateQueries, + ARB_query_buffer_object(ext) ? caps.glGetQueryBufferObjecti64v : -1L, ARB_query_buffer_object(ext) ? caps.glGetQueryBufferObjectiv : -1L, + ARB_query_buffer_object(ext) ? caps.glGetQueryBufferObjectui64v : -1L, ARB_query_buffer_object(ext) ? caps.glGetQueryBufferObjectuiv : -1L + ); + } + + // --- [ glCreateTransformFeedbacks ] --- + + /** + * Unsafe version of: {@link #glCreateTransformFeedbacks CreateTransformFeedbacks} + * + * @param n the number of transform feedback object names to create + */ + public static void nglCreateTransformFeedbacks(int n, long ids) { + GL45C.nglCreateTransformFeedbacks(n, ids); + } + + /** + * Returns {@code n} previously unused transform feedback object names in {@code ids}, each representing a new state vector. + * + * @param ids the buffer in which to return the names + */ + public static void glCreateTransformFeedbacks(@NativeType("GLuint *") IntBuffer ids) { + GL45C.glCreateTransformFeedbacks(ids); + } + + /** Returns {@code n} previously unused transform feedback object names in {@code ids}, each representing a new state vector. */ + @NativeType("void") + public static int glCreateTransformFeedbacks() { + return GL45C.glCreateTransformFeedbacks(); + } + + // --- [ glTransformFeedbackBufferBase ] --- + + /** + * Binds a buffer object to a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param index the transform feedback stream index + * @param buffer the name of an existing buffer object + */ + public static void glTransformFeedbackBufferBase(@NativeType("GLuint") int xfb, @NativeType("GLuint") int index, @NativeType("GLuint") int buffer) { + GL45C.glTransformFeedbackBufferBase(xfb, index, buffer); + } + + // --- [ glTransformFeedbackBufferRange ] --- + + /** + * Binds a region of a buffer object to a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param index the transform feedback stream index + * @param buffer the name of an existing buffer object + * @param offset the starting offset in basic machine units into the buffer object + * @param size the amount of data in machine units + */ + public static void glTransformFeedbackBufferRange(@NativeType("GLuint") int xfb, @NativeType("GLuint") int index, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size) { + GL45C.glTransformFeedbackBufferRange(xfb, index, buffer, offset, size); + } + + // --- [ glGetTransformFeedbackiv ] --- + + /** Unsafe version of: {@link #glGetTransformFeedbackiv GetTransformFeedbackiv} */ + public static void nglGetTransformFeedbackiv(int xfb, int pname, long param) { + GL45C.nglGetTransformFeedbackiv(xfb, pname, param); + } + + /** + * Returns information about a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param pname the parameter to query. One of:
{@link GL42#GL_TRANSFORM_FEEDBACK_PAUSED TRANSFORM_FEEDBACK_PAUSED}{@link GL42#GL_TRANSFORM_FEEDBACK_ACTIVE TRANSFORM_FEEDBACK_ACTIVE}
+ * @param param the buffer in which to return the parameter value + */ + public static void glGetTransformFeedbackiv(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer param) { + GL45C.glGetTransformFeedbackiv(xfb, pname, param); + } + + /** + * Returns information about a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param pname the parameter to query. One of:
{@link GL42#GL_TRANSFORM_FEEDBACK_PAUSED TRANSFORM_FEEDBACK_PAUSED}{@link GL42#GL_TRANSFORM_FEEDBACK_ACTIVE TRANSFORM_FEEDBACK_ACTIVE}
+ */ + @NativeType("void") + public static int glGetTransformFeedbacki(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname) { + return GL45C.glGetTransformFeedbacki(xfb, pname); + } + + // --- [ glGetTransformFeedbacki_v ] --- + + /** Unsafe version of: {@link #glGetTransformFeedbacki_v GetTransformFeedbacki_v} */ + public static void nglGetTransformFeedbacki_v(int xfb, int pname, int index, long param) { + GL45C.nglGetTransformFeedbacki_v(xfb, pname, index, param); + } + + /** + * Returns information about a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param pname the parameter to query. Must be:
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER_BINDING TRANSFORM_FEEDBACK_BUFFER_BINDING}
+ * @param index the transform feedback stream index + * @param param the buffer in which to return the parameter value + */ + public static void glGetTransformFeedbacki_v(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLint *") IntBuffer param) { + GL45C.glGetTransformFeedbacki_v(xfb, pname, index, param); + } + + /** + * Returns information about a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param pname the parameter to query. Must be:
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER_BINDING TRANSFORM_FEEDBACK_BUFFER_BINDING}
+ * @param index the transform feedback stream index + */ + @NativeType("void") + public static int glGetTransformFeedbacki(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLuint") int index) { + return GL45C.glGetTransformFeedbacki(xfb, pname, index); + } + + // --- [ glGetTransformFeedbacki64_v ] --- + + /** Unsafe version of: {@link #glGetTransformFeedbacki64_v GetTransformFeedbacki64_v} */ + public static void nglGetTransformFeedbacki64_v(int xfb, int pname, int index, long param) { + GL45C.nglGetTransformFeedbacki64_v(xfb, pname, index, param); + } + + /** + * Returns information about a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param pname the parameter to query. One of:
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER_START TRANSFORM_FEEDBACK_BUFFER_START}{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER_SIZE TRANSFORM_FEEDBACK_BUFFER_SIZE}
+ * @param index the transform feedback stream index + * @param param the buffer in which to return the parameter value + */ + public static void glGetTransformFeedbacki64_v(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLint64 *") LongBuffer param) { + GL45C.glGetTransformFeedbacki64_v(xfb, pname, index, param); + } + + /** + * Returns information about a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param pname the parameter to query. One of:
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER_START TRANSFORM_FEEDBACK_BUFFER_START}{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER_SIZE TRANSFORM_FEEDBACK_BUFFER_SIZE}
+ * @param index the transform feedback stream index + */ + @NativeType("void") + public static long glGetTransformFeedbacki64(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLuint") int index) { + return GL45C.glGetTransformFeedbacki64(xfb, pname, index); + } + + // --- [ glCreateBuffers ] --- + + /** + * Unsafe version of: {@link #glCreateBuffers CreateBuffers} + * + * @param n the number of buffer names to create + */ + public static void nglCreateBuffers(int n, long buffers) { + GL45C.nglCreateBuffers(n, buffers); + } + + /** + * Returns {@code n} previously unused buffer names in {@code buffers}, each representing a new buffer object initialized as if it had been bound to an + * unspecified target. + * + * @param buffers the buffer in which to return the names + */ + public static void glCreateBuffers(@NativeType("GLuint *") IntBuffer buffers) { + GL45C.glCreateBuffers(buffers); + } + + /** + * Returns {@code n} previously unused buffer names in {@code buffers}, each representing a new buffer object initialized as if it had been bound to an + * unspecified target. + */ + @NativeType("void") + public static int glCreateBuffers() { + return GL45C.glCreateBuffers(); + } + + // --- [ glNamedBufferStorage ] --- + + /** + * Unsafe version of: {@link #glNamedBufferStorage NamedBufferStorage} + * + * @param size the size of the data store in basic machine units + */ + public static void nglNamedBufferStorage(int buffer, long size, long data, int flags) { + GL45C.nglNamedBufferStorage(buffer, size, data, flags); + } + + /** + * DSA version of {@link GL44C#glBufferStorage BufferStorage}. + * + * @param buffer the buffer object name + * @param size the size of the data store in basic machine units + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("GLsizeiptr") long size, @NativeType("GLbitfield") int flags) { + GL45C.glNamedBufferStorage(buffer, size, flags); + } + + /** + * DSA version of {@link GL44C#glBufferStorage BufferStorage}. + * + * @param buffer the buffer object name + * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") ByteBuffer data, @NativeType("GLbitfield") int flags) { + GL45C.glNamedBufferStorage(buffer, data, flags); + } + + /** + * DSA version of {@link GL44C#glBufferStorage BufferStorage}. + * + * @param buffer the buffer object name + * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") ShortBuffer data, @NativeType("GLbitfield") int flags) { + GL45C.glNamedBufferStorage(buffer, data, flags); + } + + /** + * DSA version of {@link GL44C#glBufferStorage BufferStorage}. + * + * @param buffer the buffer object name + * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") IntBuffer data, @NativeType("GLbitfield") int flags) { + GL45C.glNamedBufferStorage(buffer, data, flags); + } + + /** + * DSA version of {@link GL44C#glBufferStorage BufferStorage}. + * + * @param buffer the buffer object name + * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") FloatBuffer data, @NativeType("GLbitfield") int flags) { + GL45C.glNamedBufferStorage(buffer, data, flags); + } + + /** + * DSA version of {@link GL44C#glBufferStorage BufferStorage}. + * + * @param buffer the buffer object name + * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") DoubleBuffer data, @NativeType("GLbitfield") int flags) { + GL45C.glNamedBufferStorage(buffer, data, flags); + } + + // --- [ glNamedBufferData ] --- + + /** + * Unsafe version of: {@link #glNamedBufferData NamedBufferData} + * + * @param size the size in bytes of the buffer object's new data store + */ + public static void nglNamedBufferData(int buffer, long size, long data, int usage) { + GL45C.nglNamedBufferData(buffer, size, data, usage); + } + + /** + * DSA version of {@link GL15C#glBufferData BufferData}. + * + * @param size the size in bytes of the buffer object's new data store + * @param usage the expected usage pattern of the data store. One of:
{@link GL15#GL_STREAM_DRAW STREAM_DRAW}{@link GL15#GL_STREAM_READ STREAM_READ}{@link GL15#GL_STREAM_COPY STREAM_COPY}{@link GL15#GL_STATIC_DRAW STATIC_DRAW}{@link GL15#GL_STATIC_READ STATIC_READ}{@link GL15#GL_STATIC_COPY STATIC_COPY}{@link GL15#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, size, usage); + } + + /** + * DSA version of {@link GL15C#glBufferData BufferData}. + * + * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15#GL_STREAM_DRAW STREAM_DRAW}{@link GL15#GL_STREAM_READ STREAM_READ}{@link GL15#GL_STREAM_COPY STREAM_COPY}{@link GL15#GL_STATIC_DRAW STATIC_DRAW}{@link GL15#GL_STATIC_READ STATIC_READ}{@link GL15#GL_STATIC_COPY STATIC_COPY}{@link GL15#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") ByteBuffer data, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, data, usage); + } + + /** + * DSA version of {@link GL15C#glBufferData BufferData}. + * + * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15#GL_STREAM_DRAW STREAM_DRAW}{@link GL15#GL_STREAM_READ STREAM_READ}{@link GL15#GL_STREAM_COPY STREAM_COPY}{@link GL15#GL_STATIC_DRAW STATIC_DRAW}{@link GL15#GL_STATIC_READ STATIC_READ}{@link GL15#GL_STATIC_COPY STATIC_COPY}{@link GL15#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") ShortBuffer data, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, data, usage); + } + + /** + * DSA version of {@link GL15C#glBufferData BufferData}. + * + * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15#GL_STREAM_DRAW STREAM_DRAW}{@link GL15#GL_STREAM_READ STREAM_READ}{@link GL15#GL_STREAM_COPY STREAM_COPY}{@link GL15#GL_STATIC_DRAW STATIC_DRAW}{@link GL15#GL_STATIC_READ STATIC_READ}{@link GL15#GL_STATIC_COPY STATIC_COPY}{@link GL15#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") IntBuffer data, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, data, usage); + } + + /** + * DSA version of {@link GL15C#glBufferData BufferData}. + * + * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15#GL_STREAM_DRAW STREAM_DRAW}{@link GL15#GL_STREAM_READ STREAM_READ}{@link GL15#GL_STREAM_COPY STREAM_COPY}{@link GL15#GL_STATIC_DRAW STATIC_DRAW}{@link GL15#GL_STATIC_READ STATIC_READ}{@link GL15#GL_STATIC_COPY STATIC_COPY}{@link GL15#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") LongBuffer data, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, data, usage); + } + + /** + * DSA version of {@link GL15C#glBufferData BufferData}. + * + * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15#GL_STREAM_DRAW STREAM_DRAW}{@link GL15#GL_STREAM_READ STREAM_READ}{@link GL15#GL_STREAM_COPY STREAM_COPY}{@link GL15#GL_STATIC_DRAW STATIC_DRAW}{@link GL15#GL_STATIC_READ STATIC_READ}{@link GL15#GL_STATIC_COPY STATIC_COPY}{@link GL15#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") FloatBuffer data, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, data, usage); + } + + /** + * DSA version of {@link GL15C#glBufferData BufferData}. + * + * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15#GL_STREAM_DRAW STREAM_DRAW}{@link GL15#GL_STREAM_READ STREAM_READ}{@link GL15#GL_STREAM_COPY STREAM_COPY}{@link GL15#GL_STATIC_DRAW STATIC_DRAW}{@link GL15#GL_STATIC_READ STATIC_READ}{@link GL15#GL_STATIC_COPY STATIC_COPY}{@link GL15#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") DoubleBuffer data, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, data, usage); + } + + // --- [ glNamedBufferSubData ] --- + + /** + * Unsafe version of: {@link #glNamedBufferSubData NamedBufferSubData} + * + * @param size the size in bytes of the data store region being replaced + */ + public static void nglNamedBufferSubData(int buffer, long offset, long size, long data) { + GL45C.nglNamedBufferSubData(buffer, offset, size, data); + } + + /** + * DSA version of {@link GL15C#glBufferSubData BufferSubData}. + * + * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") ByteBuffer data) { + GL45C.glNamedBufferSubData(buffer, offset, data); + } + + /** + * DSA version of {@link GL15C#glBufferSubData BufferSubData}. + * + * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") ShortBuffer data) { + GL45C.glNamedBufferSubData(buffer, offset, data); + } + + /** + * DSA version of {@link GL15C#glBufferSubData BufferSubData}. + * + * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") IntBuffer data) { + GL45C.glNamedBufferSubData(buffer, offset, data); + } + + /** + * DSA version of {@link GL15C#glBufferSubData BufferSubData}. + * + * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") LongBuffer data) { + GL45C.glNamedBufferSubData(buffer, offset, data); + } + + /** + * DSA version of {@link GL15C#glBufferSubData BufferSubData}. + * + * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") FloatBuffer data) { + GL45C.glNamedBufferSubData(buffer, offset, data); + } + + /** + * DSA version of {@link GL15C#glBufferSubData BufferSubData}. + * + * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") DoubleBuffer data) { + GL45C.glNamedBufferSubData(buffer, offset, data); + } + + // --- [ glCopyNamedBufferSubData ] --- + + /** + * DSA version of {@link GL31C#glCopyBufferSubData CopyBufferSubData}. + * + * @param readBuffer the source buffer object name + * @param writeBuffer the destination buffer object name + * @param readOffset the source buffer object offset, in bytes + * @param writeOffset the destination buffer object offset, in bytes + * @param size the number of bytes to copy + */ + public static void glCopyNamedBufferSubData(@NativeType("GLuint") int readBuffer, @NativeType("GLuint") int writeBuffer, @NativeType("GLintptr") long readOffset, @NativeType("GLintptr") long writeOffset, @NativeType("GLsizeiptr") long size) { + GL45C.glCopyNamedBufferSubData(readBuffer, writeBuffer, readOffset, writeOffset, size); + } + + // --- [ glClearNamedBufferData ] --- + + /** Unsafe version of: {@link #glClearNamedBufferData ClearNamedBufferData} */ + public static void nglClearNamedBufferData(int buffer, int internalformat, int format, int type, long data) { + GL45C.nglClearNamedBufferData(buffer, internalformat, format, type, data); + } + + /** + * DSA version of {@link GL43C#glClearBufferData ClearBufferData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer data) { + GL45C.glClearNamedBufferData(buffer, internalformat, format, type, data); + } + + /** + * DSA version of {@link GL43C#glClearBufferData ClearBufferData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer data) { + GL45C.glClearNamedBufferData(buffer, internalformat, format, type, data); + } + + /** + * DSA version of {@link GL43C#glClearBufferData ClearBufferData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer data) { + GL45C.glClearNamedBufferData(buffer, internalformat, format, type, data); + } + + /** + * DSA version of {@link GL43C#glClearBufferData ClearBufferData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer data) { + GL45C.glClearNamedBufferData(buffer, internalformat, format, type, data); + } + + // --- [ glClearNamedBufferSubData ] --- + + /** Unsafe version of: {@link #glClearNamedBufferSubData ClearNamedBufferSubData} */ + public static void nglClearNamedBufferSubData(int buffer, int internalformat, long offset, long size, int format, int type, long data) { + GL45C.nglClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); + } + + /** + * DSA version of {@link GL43C#glClearBufferSubData ClearBufferSubData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer data) { + GL45C.glClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); + } + + /** + * DSA version of {@link GL43C#glClearBufferSubData ClearBufferSubData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer data) { + GL45C.glClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); + } + + /** + * DSA version of {@link GL43C#glClearBufferSubData ClearBufferSubData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer data) { + GL45C.glClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); + } + + /** + * DSA version of {@link GL43C#glClearBufferSubData ClearBufferSubData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + */ + public static void glClearNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer data) { + GL45C.glClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); + } + + // --- [ glMapNamedBuffer ] --- + + /** Unsafe version of: {@link #glMapNamedBuffer MapNamedBuffer} */ + public static long nglMapNamedBuffer(int buffer, int access) { + return GL45C.nglMapNamedBuffer(buffer, access); + } + + /** + * DSA version of {@link GL15C#glMapBuffer MapBuffer}. + * + * @param buffer the buffer object name + * @param access the access policy, indicating whether it will be possible to read from, write to, or both read from and write to the buffer object's mapped data store. One of:
{@link GL15#GL_READ_ONLY READ_ONLY}{@link GL15#GL_WRITE_ONLY WRITE_ONLY}{@link GL15#GL_READ_WRITE READ_WRITE}
+ */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapNamedBuffer(@NativeType("GLuint") int buffer, @NativeType("GLenum") int access) { + return GL45C.glMapNamedBuffer(buffer, access); + } + + /** + * DSA version of {@link GL15C#glMapBuffer MapBuffer}. + * + * @param buffer the buffer object name + * @param access the access policy, indicating whether it will be possible to read from, write to, or both read from and write to the buffer object's mapped data store. One of:
{@link GL15#GL_READ_ONLY READ_ONLY}{@link GL15#GL_WRITE_ONLY WRITE_ONLY}{@link GL15#GL_READ_WRITE READ_WRITE}
+ */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapNamedBuffer(@NativeType("GLuint") int buffer, @NativeType("GLenum") int access, @Nullable ByteBuffer old_buffer) { + return GL45C.glMapNamedBuffer(buffer, access, old_buffer); + } + + /** + * DSA version of {@link GL15C#glMapBuffer MapBuffer}. + * + * @param buffer the buffer object name + * @param access the access policy, indicating whether it will be possible to read from, write to, or both read from and write to the buffer object's mapped data store. One of:
{@link GL15#GL_READ_ONLY READ_ONLY}{@link GL15#GL_WRITE_ONLY WRITE_ONLY}{@link GL15#GL_READ_WRITE READ_WRITE}
+ */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapNamedBuffer(@NativeType("GLuint") int buffer, @NativeType("GLenum") int access, long length, @Nullable ByteBuffer old_buffer) { + return GL45C.glMapNamedBuffer(buffer, access, length, old_buffer); + } + + // --- [ glMapNamedBufferRange ] --- + + /** Unsafe version of: {@link #glMapNamedBufferRange MapNamedBufferRange} */ + public static long nglMapNamedBufferRange(int buffer, long offset, long length, int access) { + return GL45C.nglMapNamedBufferRange(buffer, offset, length, access); + } + + /** + * DSA version of {@link GL30C#glMapBufferRange MapBufferRange}. + * + * @param buffer the buffer object name + * @param offset the starting offset within the buffer of the range to be mapped + * @param length the length of the range to be mapped + * @param access a combination of access flags indicating the desired access to the range. One or more of:
{@link GL30#GL_MAP_READ_BIT MAP_READ_BIT}{@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}{@link GL30#GL_MAP_INVALIDATE_RANGE_BIT MAP_INVALIDATE_RANGE_BIT}{@link GL30#GL_MAP_INVALIDATE_BUFFER_BIT MAP_INVALIDATE_BUFFER_BIT}
{@link GL30#GL_MAP_FLUSH_EXPLICIT_BIT MAP_FLUSH_EXPLICIT_BIT}{@link GL30#GL_MAP_UNSYNCHRONIZED_BIT MAP_UNSYNCHRONIZED_BIT}
+ */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapNamedBufferRange(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length, @NativeType("GLbitfield") int access) { + return GL45C.glMapNamedBufferRange(buffer, offset, length, access); + } + + /** + * DSA version of {@link GL30C#glMapBufferRange MapBufferRange}. + * + * @param buffer the buffer object name + * @param offset the starting offset within the buffer of the range to be mapped + * @param length the length of the range to be mapped + * @param access a combination of access flags indicating the desired access to the range. One or more of:
{@link GL30#GL_MAP_READ_BIT MAP_READ_BIT}{@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}{@link GL30#GL_MAP_INVALIDATE_RANGE_BIT MAP_INVALIDATE_RANGE_BIT}{@link GL30#GL_MAP_INVALIDATE_BUFFER_BIT MAP_INVALIDATE_BUFFER_BIT}
{@link GL30#GL_MAP_FLUSH_EXPLICIT_BIT MAP_FLUSH_EXPLICIT_BIT}{@link GL30#GL_MAP_UNSYNCHRONIZED_BIT MAP_UNSYNCHRONIZED_BIT}
+ */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapNamedBufferRange(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length, @NativeType("GLbitfield") int access, @Nullable ByteBuffer old_buffer) { + return GL45C.glMapNamedBufferRange(buffer, offset, length, access, old_buffer); + } + + // --- [ glUnmapNamedBuffer ] --- + + /** + * DSA version of {@link GL15C#glUnmapBuffer UnmapBuffer}. + * + * @param buffer the buffer object name + */ + @NativeType("GLboolean") + public static boolean glUnmapNamedBuffer(@NativeType("GLuint") int buffer) { + return GL45C.glUnmapNamedBuffer(buffer); + } + + // --- [ glFlushMappedNamedBufferRange ] --- + + /** + * DSA version of {@link GL30C#glFlushMappedBufferRange FlushMappedBufferRange}. + * + * @param buffer the buffer object name + * @param offset the start of the buffer subrange, in basic machine units + * @param length the length of the buffer subrange, in basic machine units + */ + public static void glFlushMappedNamedBufferRange(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length) { + GL45C.glFlushMappedNamedBufferRange(buffer, offset, length); + } + + // --- [ glGetNamedBufferParameteriv ] --- + + /** Unsafe version of: {@link #glGetNamedBufferParameteriv GetNamedBufferParameteriv} */ + public static void nglGetNamedBufferParameteriv(int buffer, int pname, long params) { + GL45C.nglGetNamedBufferParameteriv(buffer, pname, params); + } + + /** + * DSA version of {@link GL15C#glGetBufferParameteriv GetBufferParameteriv}. + * + * @param buffer the buffer object name + * @param pname the symbolic name of a buffer object parameter. One of:
{@link GL15#GL_BUFFER_SIZE BUFFER_SIZE}{@link GL15#GL_BUFFER_USAGE BUFFER_USAGE}{@link GL15#GL_BUFFER_ACCESS BUFFER_ACCESS}{@link GL15#GL_BUFFER_MAPPED BUFFER_MAPPED}
{@link GL30#GL_BUFFER_ACCESS_FLAGS BUFFER_ACCESS_FLAGS}{@link GL30#GL_BUFFER_MAP_LENGTH BUFFER_MAP_LENGTH}{@link GL30#GL_BUFFER_MAP_OFFSET BUFFER_MAP_OFFSET}{@link GL44#GL_BUFFER_IMMUTABLE_STORAGE BUFFER_IMMUTABLE_STORAGE}
{@link GL44#GL_BUFFER_STORAGE_FLAGS BUFFER_STORAGE_FLAGS}
+ * @param params the requested parameter + */ + public static void glGetNamedBufferParameteriv(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL45C.glGetNamedBufferParameteriv(buffer, pname, params); + } + + /** + * DSA version of {@link GL15C#glGetBufferParameteriv GetBufferParameteriv}. + * + * @param buffer the buffer object name + * @param pname the symbolic name of a buffer object parameter. One of:
{@link GL15#GL_BUFFER_SIZE BUFFER_SIZE}{@link GL15#GL_BUFFER_USAGE BUFFER_USAGE}{@link GL15#GL_BUFFER_ACCESS BUFFER_ACCESS}{@link GL15#GL_BUFFER_MAPPED BUFFER_MAPPED}
{@link GL30#GL_BUFFER_ACCESS_FLAGS BUFFER_ACCESS_FLAGS}{@link GL30#GL_BUFFER_MAP_LENGTH BUFFER_MAP_LENGTH}{@link GL30#GL_BUFFER_MAP_OFFSET BUFFER_MAP_OFFSET}{@link GL44#GL_BUFFER_IMMUTABLE_STORAGE BUFFER_IMMUTABLE_STORAGE}
{@link GL44#GL_BUFFER_STORAGE_FLAGS BUFFER_STORAGE_FLAGS}
+ */ + @NativeType("void") + public static int glGetNamedBufferParameteri(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname) { + return GL45C.glGetNamedBufferParameteri(buffer, pname); + } + + // --- [ glGetNamedBufferParameteri64v ] --- + + /** Unsafe version of: {@link #glGetNamedBufferParameteri64v GetNamedBufferParameteri64v} */ + public static void nglGetNamedBufferParameteri64v(int buffer, int pname, long params) { + GL45C.nglGetNamedBufferParameteri64v(buffer, pname, params); + } + + /** + * DSA version of {@link GL32C#glGetBufferParameteri64v GetBufferParameteri64v}. + * + * @param buffer the buffer object name + * @param pname the symbolic name of a buffer object parameter. One of:
{@link GL15#GL_BUFFER_SIZE BUFFER_SIZE}{@link GL15#GL_BUFFER_USAGE BUFFER_USAGE}{@link GL15#GL_BUFFER_ACCESS BUFFER_ACCESS}{@link GL15#GL_BUFFER_MAPPED BUFFER_MAPPED}
{@link GL30#GL_BUFFER_ACCESS_FLAGS BUFFER_ACCESS_FLAGS}{@link GL30#GL_BUFFER_MAP_LENGTH BUFFER_MAP_LENGTH}{@link GL30#GL_BUFFER_MAP_OFFSET BUFFER_MAP_OFFSET}{@link GL44#GL_BUFFER_IMMUTABLE_STORAGE BUFFER_IMMUTABLE_STORAGE}
{@link GL44#GL_BUFFER_STORAGE_FLAGS BUFFER_STORAGE_FLAGS}
+ * @param params the requested parameter + */ + public static void glGetNamedBufferParameteri64v(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLint64 *") LongBuffer params) { + GL45C.glGetNamedBufferParameteri64v(buffer, pname, params); + } + + /** + * DSA version of {@link GL32C#glGetBufferParameteri64v GetBufferParameteri64v}. + * + * @param buffer the buffer object name + * @param pname the symbolic name of a buffer object parameter. One of:
{@link GL15#GL_BUFFER_SIZE BUFFER_SIZE}{@link GL15#GL_BUFFER_USAGE BUFFER_USAGE}{@link GL15#GL_BUFFER_ACCESS BUFFER_ACCESS}{@link GL15#GL_BUFFER_MAPPED BUFFER_MAPPED}
{@link GL30#GL_BUFFER_ACCESS_FLAGS BUFFER_ACCESS_FLAGS}{@link GL30#GL_BUFFER_MAP_LENGTH BUFFER_MAP_LENGTH}{@link GL30#GL_BUFFER_MAP_OFFSET BUFFER_MAP_OFFSET}{@link GL44#GL_BUFFER_IMMUTABLE_STORAGE BUFFER_IMMUTABLE_STORAGE}
{@link GL44#GL_BUFFER_STORAGE_FLAGS BUFFER_STORAGE_FLAGS}
+ */ + @NativeType("void") + public static long glGetNamedBufferParameteri64(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname) { + return GL45C.glGetNamedBufferParameteri64(buffer, pname); + } + + // --- [ glGetNamedBufferPointerv ] --- + + /** Unsafe version of: {@link #glGetNamedBufferPointerv GetNamedBufferPointerv} */ + public static void nglGetNamedBufferPointerv(int buffer, int pname, long params) { + GL45C.nglGetNamedBufferPointerv(buffer, pname, params); + } + + /** + * DSA version of {@link GL15C#glGetBufferPointerv GetBufferPointerv}. + * + * @param buffer the buffer object name + * @param pname the pointer to be returned. Must be:
{@link GL15#GL_BUFFER_MAP_POINTER BUFFER_MAP_POINTER}
+ * @param params the pointer value specified by {@code pname} + */ + public static void glGetNamedBufferPointerv(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("void **") PointerBuffer params) { + GL45C.glGetNamedBufferPointerv(buffer, pname, params); + } + + /** + * DSA version of {@link GL15C#glGetBufferPointerv GetBufferPointerv}. + * + * @param buffer the buffer object name + * @param pname the pointer to be returned. Must be:
{@link GL15#GL_BUFFER_MAP_POINTER BUFFER_MAP_POINTER}
+ */ + @NativeType("void") + public static long glGetNamedBufferPointer(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname) { + return GL45C.glGetNamedBufferPointer(buffer, pname); + } + + // --- [ glGetNamedBufferSubData ] --- + + /** + * Unsafe version of: {@link #glGetNamedBufferSubData GetNamedBufferSubData} + * + * @param size the size in bytes of the data store region being returned + */ + public static void nglGetNamedBufferSubData(int buffer, long offset, long size, long data) { + GL45C.nglGetNamedBufferSubData(buffer, offset, size, data); + } + + /** + * DSA version of {@link GL15C#glGetBufferSubData GetBufferSubData}. + * + * @param buffer the buffer object name + * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") ByteBuffer data) { + GL45C.glGetNamedBufferSubData(buffer, offset, data); + } + + /** + * DSA version of {@link GL15C#glGetBufferSubData GetBufferSubData}. + * + * @param buffer the buffer object name + * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") ShortBuffer data) { + GL45C.glGetNamedBufferSubData(buffer, offset, data); + } + + /** + * DSA version of {@link GL15C#glGetBufferSubData GetBufferSubData}. + * + * @param buffer the buffer object name + * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") IntBuffer data) { + GL45C.glGetNamedBufferSubData(buffer, offset, data); + } + + /** + * DSA version of {@link GL15C#glGetBufferSubData GetBufferSubData}. + * + * @param buffer the buffer object name + * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") LongBuffer data) { + GL45C.glGetNamedBufferSubData(buffer, offset, data); + } + + /** + * DSA version of {@link GL15C#glGetBufferSubData GetBufferSubData}. + * + * @param buffer the buffer object name + * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") FloatBuffer data) { + GL45C.glGetNamedBufferSubData(buffer, offset, data); + } + + /** + * DSA version of {@link GL15C#glGetBufferSubData GetBufferSubData}. + * + * @param buffer the buffer object name + * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") DoubleBuffer data) { + GL45C.glGetNamedBufferSubData(buffer, offset, data); + } + + // --- [ glCreateFramebuffers ] --- + + /** + * Unsafe version of: {@link #glCreateFramebuffers CreateFramebuffers} + * + * @param n the number of framebuffer names to create + */ + public static void nglCreateFramebuffers(int n, long framebuffers) { + GL45C.nglCreateFramebuffers(n, framebuffers); + } + + /** + * Returns {@code n} previously unused framebuffer names in {@code framebuffers}, each representing a new framebuffer object. + * + * @param framebuffers the buffer in which to store the framebuffer names + */ + public static void glCreateFramebuffers(@NativeType("GLuint *") IntBuffer framebuffers) { + GL45C.glCreateFramebuffers(framebuffers); + } + + /** Returns {@code n} previously unused framebuffer names in {@code framebuffers}, each representing a new framebuffer object. */ + @NativeType("void") + public static int glCreateFramebuffers() { + return GL45C.glCreateFramebuffers(); + } + + // --- [ glNamedFramebufferRenderbuffer ] --- + + /** + * DSA version of {@link GL30C#glFramebufferRenderbuffer FramebufferRenderbuffer}. + * + * @param framebuffer the framebuffer name + * @param attachment the attachment point of the framebuffer. One of:
{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param renderbuffertarget the renderbuffer target. Must be:
{@link GL30#GL_RENDERBUFFER RENDERBUFFER}
+ * @param renderbuffer the name of an existing renderbuffer object of type {@code renderbuffertarget} to attach + */ + public static void glNamedFramebufferRenderbuffer(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLenum") int renderbuffertarget, @NativeType("GLuint") int renderbuffer) { + GL45C.glNamedFramebufferRenderbuffer(framebuffer, attachment, renderbuffertarget, renderbuffer); + } + + // --- [ glNamedFramebufferParameteri ] --- + + /** + * DSA version of {@link GL43C#glFramebufferParameteri FramebufferParameteri}. + * + * @param framebuffer the framebuffer name + * @param pname a token indicating the parameter to be modified. One of:
{@link GL43#GL_FRAMEBUFFER_DEFAULT_WIDTH FRAMEBUFFER_DEFAULT_WIDTH}{@link GL43#GL_FRAMEBUFFER_DEFAULT_HEIGHT FRAMEBUFFER_DEFAULT_HEIGHT}
{@link GL43#GL_FRAMEBUFFER_DEFAULT_LAYERS FRAMEBUFFER_DEFAULT_LAYERS}{@link GL43#GL_FRAMEBUFFER_DEFAULT_SAMPLES FRAMEBUFFER_DEFAULT_SAMPLES}
{@link GL43#GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS}
+ * @param param the new value for the parameter named {@code pname} + */ + public static void glNamedFramebufferParameteri(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int pname, @NativeType("GLint") int param) { + GL45C.glNamedFramebufferParameteri(framebuffer, pname, param); + } + + // --- [ glNamedFramebufferTexture ] --- + + /** + * DSA version of {@link GL32C#glFramebufferTexture FramebufferTexture}. + * + * @param framebuffer the framebuffer name + * @param attachment the attachment point of the framebuffer + * @param texture the texture object to attach to the framebuffer attachment point named by {@code attachment} + * @param level the mipmap level of {@code texture} to attach + */ + public static void glNamedFramebufferTexture(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level) { + GL45C.glNamedFramebufferTexture(framebuffer, attachment, texture, level); + } + + // --- [ glNamedFramebufferTextureLayer ] --- + + /** + * DSA version of {@link GL30C#glFramebufferTextureLayer FramebufferTextureLayer}. + * + * @param framebuffer the framebuffer name + * @param attachment the attachment point of the framebuffer. One of:
{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param texture the texture object to attach to the framebuffer attachment point named by {@code attachment} + * @param level the mipmap level of {@code texture} to attach + * @param layer the layer of {@code texture} to attach. + */ + public static void glNamedFramebufferTextureLayer(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int layer) { + GL45C.glNamedFramebufferTextureLayer(framebuffer, attachment, texture, level, layer); + } + + // --- [ glNamedFramebufferDrawBuffer ] --- + + /** + * DSA version of {@link GL11C#glDrawBuffer DrawBuffer}. + * + * @param framebuffer the framebuffer name + * @param buf the color buffer to draw to. One of:
{@link GL11#GL_NONE NONE}{@link GL11#GL_FRONT_LEFT FRONT_LEFT}{@link GL11#GL_FRONT_RIGHT FRONT_RIGHT}{@link GL11#GL_BACK_LEFT BACK_LEFT}{@link GL11#GL_BACK_RIGHT BACK_RIGHT}{@link GL11#GL_FRONT FRONT}{@link GL11#GL_BACK BACK}{@link GL11#GL_LEFT LEFT}
{@link GL11#GL_RIGHT RIGHT}{@link GL11#GL_FRONT_AND_BACK FRONT_AND_BACK}{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}GL30.GL_COLOR_ATTACHMENT[1-15]
+ */ + public static void glNamedFramebufferDrawBuffer(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buf) { + GL45C.glNamedFramebufferDrawBuffer(framebuffer, buf); + } + + // --- [ glNamedFramebufferDrawBuffers ] --- + + /** + * Unsafe version of: {@link #glNamedFramebufferDrawBuffers NamedFramebufferDrawBuffers} + * + * @param n the number of buffers in {@code bufs} + */ + public static void nglNamedFramebufferDrawBuffers(int framebuffer, int n, long bufs) { + GL45C.nglNamedFramebufferDrawBuffers(framebuffer, n, bufs); + } + + /** + * DSA version of {@link GL20C#glDrawBuffers DrawBuffers}. + * + * @param framebuffer the framebuffer name + * @param bufs an array of symbolic constants specifying the buffers into which fragment colors or data values will be written. One of:
{@link GL11#GL_NONE NONE}{@link GL11#GL_FRONT_LEFT FRONT_LEFT}{@link GL11#GL_FRONT_RIGHT FRONT_RIGHT}{@link GL11#GL_BACK_LEFT BACK_LEFT}{@link GL11#GL_BACK_RIGHT BACK_RIGHT}{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}
GL30.GL_COLOR_ATTACHMENT[1-15]
+ */ + public static void glNamedFramebufferDrawBuffers(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") IntBuffer bufs) { + GL45C.glNamedFramebufferDrawBuffers(framebuffer, bufs); + } + + /** + * DSA version of {@link GL20C#glDrawBuffers DrawBuffers}. + * + * @param framebuffer the framebuffer name + */ + public static void glNamedFramebufferDrawBuffers(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") int buf) { + GL45C.glNamedFramebufferDrawBuffers(framebuffer, buf); + } + + // --- [ glNamedFramebufferReadBuffer ] --- + + /** + * DSA version of {@link GL11C#glReadBuffer ReadBuffer}. + * + * @param framebuffer the framebuffer name + * @param src the color buffer to read from. One of:
{@link GL11#GL_NONE NONE}{@link GL11#GL_FRONT_LEFT FRONT_LEFT}{@link GL11#GL_FRONT_RIGHT FRONT_RIGHT}{@link GL11#GL_BACK_LEFT BACK_LEFT}{@link GL11#GL_BACK_RIGHT BACK_RIGHT}{@link GL11#GL_FRONT FRONT}{@link GL11#GL_BACK BACK}{@link GL11#GL_LEFT LEFT}
{@link GL11#GL_RIGHT RIGHT}{@link GL11#GL_FRONT_AND_BACK FRONT_AND_BACK}{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}GL30.GL_COLOR_ATTACHMENT[1-15]
+ */ + public static void glNamedFramebufferReadBuffer(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int src) { + GL45C.glNamedFramebufferReadBuffer(framebuffer, src); + } + + // --- [ glInvalidateNamedFramebufferData ] --- + + /** + * Unsafe version of: {@link #glInvalidateNamedFramebufferData InvalidateNamedFramebufferData} + * + * @param numAttachments the number of entries in the {@code attachments} array + */ + public static void nglInvalidateNamedFramebufferData(int framebuffer, int numAttachments, long attachments) { + GL45C.nglInvalidateNamedFramebufferData(framebuffer, numAttachments, attachments); + } + + /** + * DSA version of {@link GL43C#glInvalidateFramebuffer InvalidateFramebuffer}. + * + * @param framebuffer the framebuffer name + * @param attachments the address of an array identifying the attachments to be invalidated + */ + public static void glInvalidateNamedFramebufferData(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") IntBuffer attachments) { + GL45C.glInvalidateNamedFramebufferData(framebuffer, attachments); + } + + /** + * DSA version of {@link GL43C#glInvalidateFramebuffer InvalidateFramebuffer}. + * + * @param framebuffer the framebuffer name + */ + public static void glInvalidateNamedFramebufferData(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") int attachment) { + GL45C.glInvalidateNamedFramebufferData(framebuffer, attachment); + } + + // --- [ glInvalidateNamedFramebufferSubData ] --- + + /** + * Unsafe version of: {@link #glInvalidateNamedFramebufferSubData InvalidateNamedFramebufferSubData} + * + * @param numAttachments the number of entries in the {@code attachments} array + */ + public static void nglInvalidateNamedFramebufferSubData(int framebuffer, int numAttachments, long attachments, int x, int y, int width, int height) { + GL45C.nglInvalidateNamedFramebufferSubData(framebuffer, numAttachments, attachments, x, y, width, height); + } + + /** + * DSA version of {@link GL43C#glInvalidateSubFramebuffer InvalidateSubFramebuffer}. + * + * @param framebuffer the framebuffer name + * @param attachments an array identifying the attachments to be invalidated + * @param x the X offset of the region to be invalidated + * @param y the Y offset of the region to be invalidated + * @param width the width of the region to be invalidated + * @param height the height of the region to be invalidated + */ + public static void glInvalidateNamedFramebufferSubData(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") IntBuffer attachments, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL45C.glInvalidateNamedFramebufferSubData(framebuffer, attachments, x, y, width, height); + } + + /** + * DSA version of {@link GL43C#glInvalidateSubFramebuffer InvalidateSubFramebuffer}. + * + * @param framebuffer the framebuffer name + * @param x the X offset of the region to be invalidated + * @param y the Y offset of the region to be invalidated + * @param width the width of the region to be invalidated + * @param height the height of the region to be invalidated + */ + public static void glInvalidateNamedFramebufferSubData(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") int attachment, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL45C.glInvalidateNamedFramebufferSubData(framebuffer, attachment, x, y, width, height); + } + + // --- [ glClearNamedFramebufferiv ] --- + + /** Unsafe version of: {@link #glClearNamedFramebufferiv ClearNamedFramebufferiv} */ + public static void nglClearNamedFramebufferiv(int framebuffer, int buffer, int drawbuffer, long value) { + GL45C.nglClearNamedFramebufferiv(framebuffer, buffer, drawbuffer, value); + } + + /** + * DSA version of {@link GL30C#glClearBufferiv ClearBufferiv}. + * + * @param framebuffer the framebuffer name + * @param buffer the buffer to clear. One of:
{@link GL11#GL_COLOR COLOR}{@link GL11#GL_STENCIL STENCIL}
+ * @param drawbuffer the draw buffer to clear + * @param value for color buffers, a pointer to a four-element vector specifying R, G, B and A values to clear the buffer to. For stencil buffers, a pointer to a + * single stencil value to clear the buffer to. + */ + public static void glClearNamedFramebufferiv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLint *") IntBuffer value) { + GL45C.glClearNamedFramebufferiv(framebuffer, buffer, drawbuffer, value); + } + + // --- [ glClearNamedFramebufferuiv ] --- + + /** Unsafe version of: {@link #glClearNamedFramebufferuiv ClearNamedFramebufferuiv} */ + public static void nglClearNamedFramebufferuiv(int framebuffer, int buffer, int drawbuffer, long value) { + GL45C.nglClearNamedFramebufferuiv(framebuffer, buffer, drawbuffer, value); + } + + /** + * DSA version of {@link GL30C#glClearBufferuiv ClearBufferuiv}. + * + * @param framebuffer the framebuffer name + * @param buffer the buffer to clear. Must be:
{@link GL11#GL_COLOR COLOR}
+ * @param drawbuffer the draw buffer to clear + * @param value a pointer to a four-element vector specifying R, G, B and A values to clear the buffer to + */ + public static void glClearNamedFramebufferuiv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLint *") IntBuffer value) { + GL45C.glClearNamedFramebufferuiv(framebuffer, buffer, drawbuffer, value); + } + + // --- [ glClearNamedFramebufferfv ] --- + + /** Unsafe version of: {@link #glClearNamedFramebufferfv ClearNamedFramebufferfv} */ + public static void nglClearNamedFramebufferfv(int framebuffer, int buffer, int drawbuffer, long value) { + GL45C.nglClearNamedFramebufferfv(framebuffer, buffer, drawbuffer, value); + } + + /** + * DSA version of {@link GL30C#glClearBufferfv ClearBufferfv}. + * + * @param framebuffer the framebuffer name + * @param buffer the buffer to clear. One of:
{@link GL11#GL_COLOR COLOR}{@link GL11#GL_DEPTH DEPTH}
+ * @param drawbuffer the draw buffer to clear + * @param value for color buffers, a pointer to a four-element vector specifying R, G, B and A values to clear the buffer to. For depth buffers, a pointer to a + * single depth value to clear the buffer to. + */ + public static void glClearNamedFramebufferfv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLfloat *") FloatBuffer value) { + GL45C.glClearNamedFramebufferfv(framebuffer, buffer, drawbuffer, value); + } + + // --- [ glClearNamedFramebufferfi ] --- + + /** + * DSA version of {@link GL30C#glClearBufferfi ClearBufferfi}. + * + * @param framebuffer the framebuffer name + * @param buffer the buffer to clear. Must be:
{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param drawbuffer the draw buffer to clear + * @param depth the depth value to clear the buffer to + * @param stencil the stencil value to clear the buffer to + */ + public static void glClearNamedFramebufferfi(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLfloat") float depth, @NativeType("GLint") int stencil) { + GL45C.glClearNamedFramebufferfi(framebuffer, buffer, drawbuffer, depth, stencil); + } + + // --- [ glBlitNamedFramebuffer ] --- + + /** + * DSA version of {@link GL30C#glBlitFramebuffer BlitFramebuffer}. + * + * @param readFramebuffer the source framebuffer name + * @param drawFramebuffer the destination framebuffer name + * @param srcX0 the lower-left coordinate of the source rectangle within the read buffer + * @param srcY0 the upper-left coordinate of the source rectangle within the read buffer + * @param srcX1 the lower-right coordinate of the source rectangle within the read buffer + * @param srcY1 the upper-right coordinate of the source rectangle within the read buffer + * @param dstX0 the lower-left coordinate of the destination rectangle within the write buffer + * @param dstY0 the upper-left coordinate of the destination rectangle within the write buffer + * @param dstX1 the lower-right coordinate of the destination rectangle within the write buffer + * @param dstY1 the upper-right coordinate of the destination rectangle within the write buffer + * @param mask the bitwise OR of the flags indicating which buffers are to be copied. One of:
{@link GL11#GL_COLOR_BUFFER_BIT COLOR_BUFFER_BIT}{@link GL11#GL_DEPTH_BUFFER_BIT DEPTH_BUFFER_BIT}{@link GL11#GL_STENCIL_BUFFER_BIT STENCIL_BUFFER_BIT}
+ * @param filter the interpolation to be applied if the image is stretched. One of:
{@link GL11#GL_NEAREST NEAREST}{@link GL11#GL_LINEAR LINEAR}
+ */ + public static void glBlitNamedFramebuffer(@NativeType("GLuint") int readFramebuffer, @NativeType("GLuint") int drawFramebuffer, @NativeType("GLint") int srcX0, @NativeType("GLint") int srcY0, @NativeType("GLint") int srcX1, @NativeType("GLint") int srcY1, @NativeType("GLint") int dstX0, @NativeType("GLint") int dstY0, @NativeType("GLint") int dstX1, @NativeType("GLint") int dstY1, @NativeType("GLbitfield") int mask, @NativeType("GLenum") int filter) { + GL45C.glBlitNamedFramebuffer(readFramebuffer, drawFramebuffer, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); + } + + // --- [ glCheckNamedFramebufferStatus ] --- + + /** + * DSA version of {@link GL30C#glCheckFramebufferStatus CheckFramebufferStatus}. + * + * @param framebuffer the framebuffer name + * @param target the target of the framebuffer completeness check. One of:
{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ */ + @NativeType("GLenum") + public static int glCheckNamedFramebufferStatus(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int target) { + return GL45C.glCheckNamedFramebufferStatus(framebuffer, target); + } + + // --- [ glGetNamedFramebufferParameteriv ] --- + + /** Unsafe version of: {@link #glGetNamedFramebufferParameteriv GetNamedFramebufferParameteriv} */ + public static void nglGetNamedFramebufferParameteriv(int framebuffer, int pname, long params) { + GL45C.nglGetNamedFramebufferParameteriv(framebuffer, pname, params); + } + + /** + * DSA version of {@link GL43C#glGetFramebufferParameteriv GetFramebufferParameteriv}. + * + * @param framebuffer the framebuffer name + * @param pname a token indicating the parameter to be retrieved. One of:
{@link GL43#GL_FRAMEBUFFER_DEFAULT_WIDTH FRAMEBUFFER_DEFAULT_WIDTH}{@link GL43#GL_FRAMEBUFFER_DEFAULT_HEIGHT FRAMEBUFFER_DEFAULT_HEIGHT}
{@link GL43#GL_FRAMEBUFFER_DEFAULT_LAYERS FRAMEBUFFER_DEFAULT_LAYERS}{@link GL43#GL_FRAMEBUFFER_DEFAULT_SAMPLES FRAMEBUFFER_DEFAULT_SAMPLES}
{@link GL43#GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS}
+ * @param params a variable to receive the value of the parameter named {@code pname} + */ + public static void glGetNamedFramebufferParameteriv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL45C.glGetNamedFramebufferParameteriv(framebuffer, pname, params); + } + + /** + * DSA version of {@link GL43C#glGetFramebufferParameteriv GetFramebufferParameteriv}. + * + * @param framebuffer the framebuffer name + * @param pname a token indicating the parameter to be retrieved. One of:
{@link GL43#GL_FRAMEBUFFER_DEFAULT_WIDTH FRAMEBUFFER_DEFAULT_WIDTH}{@link GL43#GL_FRAMEBUFFER_DEFAULT_HEIGHT FRAMEBUFFER_DEFAULT_HEIGHT}
{@link GL43#GL_FRAMEBUFFER_DEFAULT_LAYERS FRAMEBUFFER_DEFAULT_LAYERS}{@link GL43#GL_FRAMEBUFFER_DEFAULT_SAMPLES FRAMEBUFFER_DEFAULT_SAMPLES}
{@link GL43#GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS}
+ */ + @NativeType("void") + public static int glGetNamedFramebufferParameteri(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int pname) { + return GL45C.glGetNamedFramebufferParameteri(framebuffer, pname); + } + + // --- [ glGetNamedFramebufferAttachmentParameteriv ] --- + + /** Unsafe version of: {@link #glGetNamedFramebufferAttachmentParameteriv GetNamedFramebufferAttachmentParameteriv} */ + public static void nglGetNamedFramebufferAttachmentParameteriv(int framebuffer, int attachment, int pname, long params) { + GL45C.nglGetNamedFramebufferAttachmentParameteriv(framebuffer, attachment, pname, params); + } + + /** + * DSA version of {@link GL30C#glGetFramebufferAttachmentParameteriv GetFramebufferAttachmentParameteriv}. + * + * @param framebuffer the framebuffer name + * @param attachment the attachment within {@code target}. One of:
{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param pname the parameter of {@code attachment} to query. One of:
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME FRAMEBUFFER_ATTACHMENT_OBJECT_NAME}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE FRAMEBUFFER_ATTACHMENT_RED_SIZE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE FRAMEBUFFER_ATTACHMENT_GREEN_SIZE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE FRAMEBUFFER_ATTACHMENT_BLUE_SIZE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE}
+ * @param params an array to receive the value of the queried parameter + */ + public static void glGetNamedFramebufferAttachmentParameteriv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL45C.glGetNamedFramebufferAttachmentParameteriv(framebuffer, attachment, pname, params); + } + + /** + * DSA version of {@link GL30C#glGetFramebufferAttachmentParameteriv GetFramebufferAttachmentParameteriv}. + * + * @param framebuffer the framebuffer name + * @param attachment the attachment within {@code target}. One of:
{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param pname the parameter of {@code attachment} to query. One of:
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME FRAMEBUFFER_ATTACHMENT_OBJECT_NAME}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE FRAMEBUFFER_ATTACHMENT_RED_SIZE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE FRAMEBUFFER_ATTACHMENT_GREEN_SIZE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE FRAMEBUFFER_ATTACHMENT_BLUE_SIZE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE}
+ */ + @NativeType("void") + public static int glGetNamedFramebufferAttachmentParameteri(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname) { + return GL45C.glGetNamedFramebufferAttachmentParameteri(framebuffer, attachment, pname); + } + + // --- [ glCreateRenderbuffers ] --- + + /** + * Unsafe version of: {@link #glCreateRenderbuffers CreateRenderbuffers} + * + * @param n the number of renderbuffer names to create + */ + public static void nglCreateRenderbuffers(int n, long renderbuffers) { + GL45C.nglCreateRenderbuffers(n, renderbuffers); + } + + /** + * Returns {@code n} previously unused renderbuffer names in {@code renderbuffers}, each representing a new renderbuffer object. + * + * @param renderbuffers the buffer in which to store the created renderbuffer names + */ + public static void glCreateRenderbuffers(@NativeType("GLuint *") IntBuffer renderbuffers) { + GL45C.glCreateRenderbuffers(renderbuffers); + } + + /** Returns {@code n} previously unused renderbuffer names in {@code renderbuffers}, each representing a new renderbuffer object. */ + @NativeType("void") + public static int glCreateRenderbuffers() { + return GL45C.glCreateRenderbuffers(); + } + + // --- [ glNamedRenderbufferStorage ] --- + + /** + * DSA version of {@link GL30C#glRenderbufferStorage RenderbufferStorage}. + * + * @param internalformat the internal format to use for the renderbuffer object's image. Must be a color-renderable, depth-renderable, or stencil-renderable format. + * @param width the width of the renderbuffer, in pixels + * @param height the height of the renderbuffer, in pixels + */ + public static void glNamedRenderbufferStorage(@NativeType("GLuint") int renderbuffer, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL45C.glNamedRenderbufferStorage(renderbuffer, internalformat, width, height); + } + + // --- [ glNamedRenderbufferStorageMultisample ] --- + + /** + * DSA version of {@link GL30C#glRenderbufferStorageMultisample RenderbufferStorageMultisample}. + * + * @param samples the number of samples to be used for the renderbuffer object's storage + * @param internalformat the internal format to use for the renderbuffer object's image. Must be a color-renderable, depth-renderable, or stencil-renderable format. + * @param width the width of the renderbuffer, in pixels + * @param height the height of the renderbuffer, in pixels + */ + public static void glNamedRenderbufferStorageMultisample(@NativeType("GLuint") int renderbuffer, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL45C.glNamedRenderbufferStorageMultisample(renderbuffer, samples, internalformat, width, height); + } + + // --- [ glGetNamedRenderbufferParameteriv ] --- + + /** Unsafe version of: {@link #glGetNamedRenderbufferParameteriv GetNamedRenderbufferParameteriv} */ + public static void nglGetNamedRenderbufferParameteriv(int renderbuffer, int pname, long params) { + GL45C.nglGetNamedRenderbufferParameteriv(renderbuffer, pname, params); + } + + /** + * DSA version of {@link GL30C#glGetRenderbufferParameteriv GetRenderbufferParameteriv}. + * + * @param pname the parameter whose value to retrieve from the renderbuffer bound to {@code target}. One of:
{@link GL30#GL_RENDERBUFFER_WIDTH RENDERBUFFER_WIDTH}{@link GL30#GL_RENDERBUFFER_HEIGHT RENDERBUFFER_HEIGHT}{@link GL30#GL_RENDERBUFFER_INTERNAL_FORMAT RENDERBUFFER_INTERNAL_FORMAT}
{@link GL30#GL_RENDERBUFFER_RED_SIZE RENDERBUFFER_RED_SIZE}{@link GL30#GL_RENDERBUFFER_GREEN_SIZE RENDERBUFFER_GREEN_SIZE}{@link GL30#GL_RENDERBUFFER_BLUE_SIZE RENDERBUFFER_BLUE_SIZE}
{@link GL30#GL_RENDERBUFFER_ALPHA_SIZE RENDERBUFFER_ALPHA_SIZE}{@link GL30#GL_RENDERBUFFER_DEPTH_SIZE RENDERBUFFER_DEPTH_SIZE}{@link GL30#GL_RENDERBUFFER_STENCIL_SIZE RENDERBUFFER_STENCIL_SIZE}
{@link GL30#GL_RENDERBUFFER_SAMPLES RENDERBUFFER_SAMPLES}
+ * @param params an array to receive the value of the queried parameter + */ + public static void glGetNamedRenderbufferParameteriv(@NativeType("GLuint") int renderbuffer, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL45C.glGetNamedRenderbufferParameteriv(renderbuffer, pname, params); + } + + /** + * DSA version of {@link GL30C#glGetRenderbufferParameteriv GetRenderbufferParameteriv}. + * + * @param pname the parameter whose value to retrieve from the renderbuffer bound to {@code target}. One of:
{@link GL30#GL_RENDERBUFFER_WIDTH RENDERBUFFER_WIDTH}{@link GL30#GL_RENDERBUFFER_HEIGHT RENDERBUFFER_HEIGHT}{@link GL30#GL_RENDERBUFFER_INTERNAL_FORMAT RENDERBUFFER_INTERNAL_FORMAT}
{@link GL30#GL_RENDERBUFFER_RED_SIZE RENDERBUFFER_RED_SIZE}{@link GL30#GL_RENDERBUFFER_GREEN_SIZE RENDERBUFFER_GREEN_SIZE}{@link GL30#GL_RENDERBUFFER_BLUE_SIZE RENDERBUFFER_BLUE_SIZE}
{@link GL30#GL_RENDERBUFFER_ALPHA_SIZE RENDERBUFFER_ALPHA_SIZE}{@link GL30#GL_RENDERBUFFER_DEPTH_SIZE RENDERBUFFER_DEPTH_SIZE}{@link GL30#GL_RENDERBUFFER_STENCIL_SIZE RENDERBUFFER_STENCIL_SIZE}
{@link GL30#GL_RENDERBUFFER_SAMPLES RENDERBUFFER_SAMPLES}
+ */ + @NativeType("void") + public static int glGetNamedRenderbufferParameteri(@NativeType("GLuint") int renderbuffer, @NativeType("GLenum") int pname) { + return GL45C.glGetNamedRenderbufferParameteri(renderbuffer, pname); + } + + // --- [ glCreateTextures ] --- + + /** + * Unsafe version of: {@link #glCreateTextures CreateTextures} + * + * @param n the number of texture names to create + */ + public static void nglCreateTextures(int target, int n, long textures) { + GL45C.nglCreateTextures(target, n, textures); + } + + /** + * Returns {@code n} previously unused texture names in {@code textures}, each representing a new texture object. + * + * @param target the texture target. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param textures the buffer in which to store the created texture names + */ + public static void glCreateTextures(@NativeType("GLenum") int target, @NativeType("GLuint *") IntBuffer textures) { + GL45C.glCreateTextures(target, textures); + } + + /** + * Returns {@code n} previously unused texture names in {@code textures}, each representing a new texture object. + * + * @param target the texture target. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ */ + @NativeType("void") + public static int glCreateTextures(@NativeType("GLenum") int target) { + return GL45C.glCreateTextures(target); + } + + // --- [ glTextureBuffer ] --- + + /** + * DSA version of {@link GL31C#glTexBuffer TexBuffer}. + * + * @param texture the texture name + * @param internalformat the sized internal format of the data in the store belonging to {@code buffer} + * @param buffer the name of the buffer object whose storage to attach to the active buffer texture + */ + public static void glTextureBuffer(@NativeType("GLuint") int texture, @NativeType("GLenum") int internalformat, @NativeType("GLuint") int buffer) { + GL45C.glTextureBuffer(texture, internalformat, buffer); + } + + // --- [ glTextureBufferRange ] --- + + /** + * DSA version of {@link GL43C#glTexBufferRange TexBufferRange}. + * + * @param texture the texture name + * @param internalformat the internal format of the data in the store belonging to {@code buffer} + * @param buffer the name of the buffer object whose storage to attach to the active buffer texture + * @param offset the offset of the start of the range of the buffer's data store to attach + * @param size the size of the range of the buffer's data store to attach + */ + public static void glTextureBufferRange(@NativeType("GLuint") int texture, @NativeType("GLenum") int internalformat, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size) { + GL45C.glTextureBufferRange(texture, internalformat, buffer, offset, size); + } + + // --- [ glTextureStorage1D ] --- + + /** + * DSA version of {@link GL42C#glTexStorage1D TexStorage1D}. + * + * @param texture the texture name + * @param levels the number of texture levels + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + */ + public static void glTextureStorage1D(@NativeType("GLuint") int texture, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width) { + GL45C.glTextureStorage1D(texture, levels, internalformat, width); + } + + // --- [ glTextureStorage2D ] --- + + /** + * DSA version of {@link GL42C#glTexStorage2D TexStorage2D}. + * + * @param texture the texture name + * @param levels the number of texture levels + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + */ + public static void glTextureStorage2D(@NativeType("GLuint") int texture, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL45C.glTextureStorage2D(texture, levels, internalformat, width, height); + } + + // --- [ glTextureStorage3D ] --- + + /** + * DSA version of {@link GL42C#glTexStorage3D TexStorage3D}. + * + * @param texture the texture name + * @param levels the number of texture levels + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * @param depth the depth of the texture, in texels + */ + public static void glTextureStorage3D(@NativeType("GLuint") int texture, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth) { + GL45C.glTextureStorage3D(texture, levels, internalformat, width, height, depth); + } + + // --- [ glTextureStorage2DMultisample ] --- + + /** + * DSA version of {@link GL43C#glTexStorage2DMultisample TexStorage2DMultisample}. + * + * @param texture the texture name + * @param samples the number of samples in the texture + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * @param fixedsamplelocations whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not + * depend on the internal format or size of the image + */ + public static void glTextureStorage2DMultisample(@NativeType("GLuint") int texture, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLboolean") boolean fixedsamplelocations) { + GL45C.glTextureStorage2DMultisample(texture, samples, internalformat, width, height, fixedsamplelocations); + } + + // --- [ glTextureStorage3DMultisample ] --- + + /** + * DSA version of {@link GL43C#glTexStorage3DMultisample TexStorage3DMultisample}. + * + * @param texture the texture name + * @param samples the number of samples in the texture + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * @param depth the depth of the texture, in texels + * @param fixedsamplelocations whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not + * depend on the internal format or size of the image + */ + public static void glTextureStorage3DMultisample(@NativeType("GLuint") int texture, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLboolean") boolean fixedsamplelocations) { + GL45C.glTextureStorage3DMultisample(texture, samples, internalformat, width, height, depth, fixedsamplelocations); + } + + // --- [ glTextureSubImage1D ] --- + + /** Unsafe version of: {@link #glTextureSubImage1D TextureSubImage1D} */ + public static void nglTextureSubImage1D(int texture, int level, int xoffset, int width, int format, int type, long pixels) { + GL45C.nglTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage1D TexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer pixels) { + GL45C.glTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage1D TexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long pixels) { + GL45C.glTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage1D TexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer pixels) { + GL45C.glTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage1D TexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer pixels) { + GL45C.glTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage1D TexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer pixels) { + GL45C.glTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage1D TexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") DoubleBuffer pixels) { + GL45C.glTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + // --- [ glTextureSubImage2D ] --- + + /** Unsafe version of: {@link #glTextureSubImage2D TextureSubImage2D} */ + public static void nglTextureSubImage2D(int texture, int level, int xoffset, int yoffset, int width, int height, int format, int type, long pixels) { + GL45C.nglTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage2D TexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer pixels) { + GL45C.glTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage2D TexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long pixels) { + GL45C.glTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage2D TexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer pixels) { + GL45C.glTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage2D TexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer pixels) { + GL45C.glTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage2D TexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer pixels) { + GL45C.glTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage2D TexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") DoubleBuffer pixels) { + GL45C.glTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + // --- [ glTextureSubImage3D ] --- + + /** Unsafe version of: {@link #glTextureSubImage3D TextureSubImage3D} */ + public static void nglTextureSubImage3D(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, long pixels) { + GL45C.nglTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * DSA version of {@link GL12C#glTexSubImage3D TexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer pixels) { + GL45C.glTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * DSA version of {@link GL12C#glTexSubImage3D TexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long pixels) { + GL45C.glTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * DSA version of {@link GL12C#glTexSubImage3D TexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer pixels) { + GL45C.glTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * DSA version of {@link GL12C#glTexSubImage3D TexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer pixels) { + GL45C.glTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * DSA version of {@link GL12C#glTexSubImage3D TexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer pixels) { + GL45C.glTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * DSA version of {@link GL12C#glTexSubImage3D TexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") DoubleBuffer pixels) { + GL45C.glTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + // --- [ glCompressedTextureSubImage1D ] --- + + /** + * Unsafe version of: {@link #glCompressedTextureSubImage1D CompressedTextureSubImage1D} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static void nglCompressedTextureSubImage1D(int texture, int level, int xoffset, int width, int format, int imageSize, long data) { + GL45C.nglCompressedTextureSubImage1D(texture, level, xoffset, width, format, imageSize, data); + } + + /** + * DSA version of {@link GL13C#glCompressedTexSubImage1D CompressedTexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param width the width of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + */ + public static void glCompressedTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + GL45C.glCompressedTextureSubImage1D(texture, level, xoffset, width, format, imageSize, data); + } + + /** + * DSA version of {@link GL13C#glCompressedTexSubImage1D CompressedTexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param width the width of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param data a pointer to the compressed image data + */ + public static void glCompressedTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + GL45C.glCompressedTextureSubImage1D(texture, level, xoffset, width, format, data); + } + + // --- [ glCompressedTextureSubImage2D ] --- + + /** + * Unsafe version of: {@link #glCompressedTextureSubImage2D CompressedTextureSubImage2D} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static void nglCompressedTextureSubImage2D(int texture, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, long data) { + GL45C.nglCompressedTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, imageSize, data); + } + + /** + * DSA version of {@link GL13C#glCompressedTexSubImage2D CompressedTexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + */ + public static void glCompressedTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + GL45C.glCompressedTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, imageSize, data); + } + + /** + * DSA version of {@link GL13C#glCompressedTexSubImage2D CompressedTexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param data a pointer to the compressed image data + */ + public static void glCompressedTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + GL45C.glCompressedTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, data); + } + + // --- [ glCompressedTextureSubImage3D ] --- + + /** + * Unsafe version of: {@link #glCompressedTextureSubImage3D CompressedTextureSubImage3D} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static void nglCompressedTextureSubImage3D(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, long data) { + GL45C.nglCompressedTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); + } + + /** + * DSA version of {@link GL13C#glCompressedTexSubImage3D CompressedTexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param zoffset a texel offset in the z direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param depth the depth of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + */ + public static void glCompressedTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + GL45C.glCompressedTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); + } + + /** + * DSA version of {@link GL13C#glCompressedTexSubImage3D CompressedTexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param zoffset a texel offset in the z direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param depth the depth of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param data a pointer to the compressed image data + */ + public static void glCompressedTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + GL45C.glCompressedTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, data); + } + + // --- [ glCopyTextureSubImage1D ] --- + + /** + * DSA version of {@link GL11C#glCopyTexSubImage1D CopyTexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param xoffset the left texel coordinate of the texture subregion to update + * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the texture subregion width + */ + public static void glCopyTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width) { + GL45C.glCopyTextureSubImage1D(texture, level, xoffset, x, y, width); + } + + // --- [ glCopyTextureSubImage2D ] --- + + /** + * DSA version of {@link GL11C#glCopyTexSubImage2D CopyTexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param xoffset the left texel coordinate of the texture subregion to update + * @param yoffset the lower texel coordinate of the texture subregion to update + * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the texture subregion width + * @param height the texture subregion height + */ + public static void glCopyTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL45C.glCopyTextureSubImage2D(texture, level, xoffset, yoffset, x, y, width, height); + } + + // --- [ glCopyTextureSubImage3D ] --- + + /** + * DSA version of {@link GL12C#glCopyTexSubImage3D CopyTexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param xoffset the x coordinate of the texture subregion to update + * @param yoffset the y coordinate of the texture subregion to update + * @param zoffset the z coordinate of the texture subregion to update + * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the texture subregion width + * @param height the texture subregion height + */ + public static void glCopyTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL45C.glCopyTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, x, y, width, height); + } + + // --- [ glTextureParameterf ] --- + + /** + * DSA version of {@link GL11C#glTexParameterf TexParameterf}. + * + * @param texture the texture name + * @param pname the parameter to set + * @param param the parameter value + */ + public static void glTextureParameterf(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLfloat") float param) { + GL45C.glTextureParameterf(texture, pname, param); + } + + // --- [ glTextureParameterfv ] --- + + /** Unsafe version of: {@link #glTextureParameterfv TextureParameterfv} */ + public static void nglTextureParameterfv(int texture, int pname, long params) { + GL45C.nglTextureParameterfv(texture, pname, params); + } + + /** + * DSA version of {@link GL11C#glTexParameterfv TexParameterfv}. + * + * @param texture the texture name + * @param pname the parameter to set + * @param params the parameter value + */ + public static void glTextureParameterfv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer params) { + GL45C.glTextureParameterfv(texture, pname, params); + } + + // --- [ glTextureParameteri ] --- + + /** + * DSA version of {@link GL11C#glTexParameteri TexParameteri}. + * + * @param texture the texture name + * @param pname the parameter to set. One of:
{@link GL12#GL_TEXTURE_BASE_LEVEL TEXTURE_BASE_LEVEL}{@link GL11#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}{@link GL12#GL_TEXTURE_MAX_LEVEL TEXTURE_MAX_LEVEL}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}
{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL33#GL_TEXTURE_SWIZZLE_R TEXTURE_SWIZZLE_R}{@link GL33#GL_TEXTURE_SWIZZLE_G TEXTURE_SWIZZLE_G}
{@link GL33#GL_TEXTURE_SWIZZLE_B TEXTURE_SWIZZLE_B}{@link GL33#GL_TEXTURE_SWIZZLE_A TEXTURE_SWIZZLE_A}{@link GL33#GL_TEXTURE_SWIZZLE_RGBA TEXTURE_SWIZZLE_RGBA}{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}
{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL14#GL_DEPTH_TEXTURE_MODE DEPTH_TEXTURE_MODE}{@link GL14#GL_GENERATE_MIPMAP GENERATE_MIPMAP}
+ * @param param the parameter value + */ + public static void glTextureParameteri(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint") int param) { + GL45C.glTextureParameteri(texture, pname, param); + } + + // --- [ glTextureParameterIiv ] --- + + /** Unsafe version of: {@link #glTextureParameterIiv TextureParameterIiv} */ + public static void nglTextureParameterIiv(int texture, int pname, long params) { + GL45C.nglTextureParameterIiv(texture, pname, params); + } + + /** + * DSA version of {@link GL30C#glTexParameterIiv TexParameterIiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a single-valued texture parameter + * @param params the value of {@code pname} + */ + public static void glTextureParameterIiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + GL45C.glTextureParameterIiv(texture, pname, params); + } + + /** + * DSA version of {@link GL30C#glTexParameterIiv TexParameterIiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a single-valued texture parameter + */ + public static void glTextureParameterIi(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint const *") int param) { + GL45C.glTextureParameterIi(texture, pname, param); + } + + // --- [ glTextureParameterIuiv ] --- + + /** Unsafe version of: {@link #glTextureParameterIuiv TextureParameterIuiv} */ + public static void nglTextureParameterIuiv(int texture, int pname, long params) { + GL45C.nglTextureParameterIuiv(texture, pname, params); + } + + /** + * DSA version of {@link GL30C#glTexParameterIuiv TexParameterIuiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a single-valued texture parameter + * @param params the value of {@code pname} + */ + public static void glTextureParameterIuiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLuint const *") IntBuffer params) { + GL45C.glTextureParameterIuiv(texture, pname, params); + } + + /** + * DSA version of {@link GL30C#glTexParameterIuiv TexParameterIuiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a single-valued texture parameter + */ + public static void glTextureParameterIui(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLuint const *") int param) { + GL45C.glTextureParameterIui(texture, pname, param); + } + + // --- [ glTextureParameteriv ] --- + + /** Unsafe version of: {@link #glTextureParameteriv TextureParameteriv} */ + public static void nglTextureParameteriv(int texture, int pname, long params) { + GL45C.nglTextureParameteriv(texture, pname, params); + } + + /** + * DSA version of {@link GL11C#glTexParameteriv TexParameteriv}. + * + * @param texture the texture name + * @param pname the parameter to set + * @param params the parameter value + */ + public static void glTextureParameteriv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + GL45C.glTextureParameteriv(texture, pname, params); + } + + // --- [ glGenerateTextureMipmap ] --- + + /** + * DSA version of {@link GL30C#glGenerateMipmap GenerateMipmap}. + * + * @param texture the texture name + */ + public static void glGenerateTextureMipmap(@NativeType("GLuint") int texture) { + GL45C.glGenerateTextureMipmap(texture); + } + + // --- [ glBindTextureUnit ] --- + + /** + * Binds an existing texture object to the texture unit numbered {@code unit}. + * + *

{@code texture} must be zero or the name of an existing texture object. When {@code texture} is the name of an existing texture object, that object is + * bound to the target, in the corresponding texture unit, that was specified when the object was created. When {@code texture} is zero, each of the targets + * enumerated at the beginning of this section is reset to its default texture for the corresponding texture image unit.

+ * + * @param unit the texture unit number + * @param texture the texture name + */ + public static void glBindTextureUnit(@NativeType("GLuint") int unit, @NativeType("GLuint") int texture) { + GL45C.glBindTextureUnit(unit, texture); + } + + // --- [ glGetTextureImage ] --- + + /** + * Unsafe version of: {@link #glGetTextureImage GetTextureImage} + * + * @param bufSize the size of the buffer to receive the retrieved pixel data + */ + public static void nglGetTextureImage(int texture, int level, int format, int type, int bufSize, long pixels) { + GL45C.nglGetTextureImage(texture, level, format, type, bufSize, pixels); + } + + /** + * DSA version of {@link GL11C#glGetTexImage GetTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param bufSize the size of the buffer to receive the retrieved pixel data + * @param pixels the buffer in which to place the returned data + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int bufSize, @NativeType("void *") long pixels) { + GL45C.glGetTextureImage(texture, level, format, type, bufSize, pixels); + } + + /** + * DSA version of {@link GL11C#glGetTexImage GetTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer pixels) { + GL45C.glGetTextureImage(texture, level, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glGetTexImage GetTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ShortBuffer pixels) { + GL45C.glGetTextureImage(texture, level, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glGetTexImage GetTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") IntBuffer pixels) { + GL45C.glGetTextureImage(texture, level, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glGetTexImage GetTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") FloatBuffer pixels) { + GL45C.glGetTextureImage(texture, level, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glGetTexImage GetTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") DoubleBuffer pixels) { + GL45C.glGetTextureImage(texture, level, format, type, pixels); + } + + // --- [ glGetCompressedTextureImage ] --- + + /** + * Unsafe version of: {@link #glGetCompressedTextureImage GetCompressedTextureImage} + * + * @param bufSize the size of the buffer to receive the retrieved pixel data + */ + public static void nglGetCompressedTextureImage(int texture, int level, int bufSize, long pixels) { + GL45C.nglGetCompressedTextureImage(texture, level, bufSize, pixels); + } + + /** + * DSA version of {@link GL13C#glGetCompressedTexImage GetCompressedTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param bufSize the size of the buffer to receive the retrieved pixel data + * @param pixels a buffer in which to return the compressed texture image + */ + public static void glGetCompressedTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLsizei") int bufSize, @NativeType("void *") long pixels) { + GL45C.glGetCompressedTextureImage(texture, level, bufSize, pixels); + } + + /** + * DSA version of {@link GL13C#glGetCompressedTexImage GetCompressedTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param pixels a buffer in which to return the compressed texture image + */ + public static void glGetCompressedTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("void *") ByteBuffer pixels) { + GL45C.glGetCompressedTextureImage(texture, level, pixels); + } + + // --- [ glGetTextureLevelParameterfv ] --- + + /** Unsafe version of: {@link #glGetTextureLevelParameterfv GetTextureLevelParameterfv} */ + public static void nglGetTextureLevelParameterfv(int texture, int level, int pname, long params) { + GL45C.nglGetTextureLevelParameterfv(texture, level, pname, params); + } + + /** + * DSA version of {@link GL11C#glGetTexLevelParameterfv GetTexLevelParameterfv}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param pname the parameter to query + * @param params a scalar or buffer in which to place the returned data + */ + public static void glGetTextureLevelParameterfv(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + GL45C.glGetTextureLevelParameterfv(texture, level, pname, params); + } + + /** + * DSA version of {@link GL11C#glGetTexLevelParameterfv GetTexLevelParameterfv}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param pname the parameter to query + */ + @NativeType("void") + public static float glGetTextureLevelParameterf(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int pname) { + return GL45C.glGetTextureLevelParameterf(texture, level, pname); + } + + // --- [ glGetTextureLevelParameteriv ] --- + + /** Unsafe version of: {@link #glGetTextureLevelParameteriv GetTextureLevelParameteriv} */ + public static void nglGetTextureLevelParameteriv(int texture, int level, int pname, long params) { + GL45C.nglGetTextureLevelParameteriv(texture, level, pname, params); + } + + /** + * DSA version of {@link GL11C#glGetTexLevelParameteriv GetTexLevelParameteriv}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param pname the parameter to query. One of:
{@link GL11#GL_TEXTURE_WIDTH TEXTURE_WIDTH}{@link GL11#GL_TEXTURE_HEIGHT TEXTURE_HEIGHT}{@link GL12#GL_TEXTURE_DEPTH TEXTURE_DEPTH}{@link GL32#GL_TEXTURE_SAMPLES TEXTURE_SAMPLES}
{@link GL32#GL_TEXTURE_FIXED_SAMPLE_LOCATIONS TEXTURE_FIXED_SAMPLE_LOCATIONS}{@link GL11#GL_TEXTURE_INTERNAL_FORMAT TEXTURE_INTERNAL_FORMAT}{@link GL11#GL_TEXTURE_RED_SIZE TEXTURE_RED_SIZE}{@link GL11#GL_TEXTURE_GREEN_SIZE TEXTURE_GREEN_SIZE}
{@link GL11#GL_TEXTURE_BLUE_SIZE TEXTURE_BLUE_SIZE}{@link GL11#GL_TEXTURE_ALPHA_SIZE TEXTURE_ALPHA_SIZE}{@link GL14#GL_TEXTURE_DEPTH_SIZE TEXTURE_DEPTH_SIZE}{@link GL30#GL_TEXTURE_STENCIL_SIZE TEXTURE_STENCIL_SIZE}
{@link GL30#GL_TEXTURE_SHARED_SIZE TEXTURE_SHARED_SIZE}{@link GL30#GL_TEXTURE_ALPHA_TYPE TEXTURE_ALPHA_TYPE}{@link GL30#GL_TEXTURE_DEPTH_TYPE TEXTURE_DEPTH_TYPE}{@link GL13#GL_TEXTURE_COMPRESSED TEXTURE_COMPRESSED}
{@link GL13#GL_TEXTURE_COMPRESSED_IMAGE_SIZE TEXTURE_COMPRESSED_IMAGE_SIZE}{@link GL31#GL_TEXTURE_BUFFER_DATA_STORE_BINDING TEXTURE_BUFFER_DATA_STORE_BINDING}{@link GL43#GL_TEXTURE_BUFFER_OFFSET TEXTURE_BUFFER_OFFSET}{@link GL43#GL_TEXTURE_BUFFER_SIZE TEXTURE_BUFFER_SIZE}
+ * @param params a scalar or buffer in which to place the returned data + */ + public static void glGetTextureLevelParameteriv(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL45C.glGetTextureLevelParameteriv(texture, level, pname, params); + } + + /** + * DSA version of {@link GL11C#glGetTexLevelParameteriv GetTexLevelParameteriv}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param pname the parameter to query. One of:
{@link GL11#GL_TEXTURE_WIDTH TEXTURE_WIDTH}{@link GL11#GL_TEXTURE_HEIGHT TEXTURE_HEIGHT}{@link GL12#GL_TEXTURE_DEPTH TEXTURE_DEPTH}{@link GL32#GL_TEXTURE_SAMPLES TEXTURE_SAMPLES}
{@link GL32#GL_TEXTURE_FIXED_SAMPLE_LOCATIONS TEXTURE_FIXED_SAMPLE_LOCATIONS}{@link GL11#GL_TEXTURE_INTERNAL_FORMAT TEXTURE_INTERNAL_FORMAT}{@link GL11#GL_TEXTURE_RED_SIZE TEXTURE_RED_SIZE}{@link GL11#GL_TEXTURE_GREEN_SIZE TEXTURE_GREEN_SIZE}
{@link GL11#GL_TEXTURE_BLUE_SIZE TEXTURE_BLUE_SIZE}{@link GL11#GL_TEXTURE_ALPHA_SIZE TEXTURE_ALPHA_SIZE}{@link GL14#GL_TEXTURE_DEPTH_SIZE TEXTURE_DEPTH_SIZE}{@link GL30#GL_TEXTURE_STENCIL_SIZE TEXTURE_STENCIL_SIZE}
{@link GL30#GL_TEXTURE_SHARED_SIZE TEXTURE_SHARED_SIZE}{@link GL30#GL_TEXTURE_ALPHA_TYPE TEXTURE_ALPHA_TYPE}{@link GL30#GL_TEXTURE_DEPTH_TYPE TEXTURE_DEPTH_TYPE}{@link GL13#GL_TEXTURE_COMPRESSED TEXTURE_COMPRESSED}
{@link GL13#GL_TEXTURE_COMPRESSED_IMAGE_SIZE TEXTURE_COMPRESSED_IMAGE_SIZE}{@link GL31#GL_TEXTURE_BUFFER_DATA_STORE_BINDING TEXTURE_BUFFER_DATA_STORE_BINDING}{@link GL43#GL_TEXTURE_BUFFER_OFFSET TEXTURE_BUFFER_OFFSET}{@link GL43#GL_TEXTURE_BUFFER_SIZE TEXTURE_BUFFER_SIZE}
+ */ + @NativeType("void") + public static int glGetTextureLevelParameteri(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int pname) { + return GL45C.glGetTextureLevelParameteri(texture, level, pname); + } + + // --- [ glGetTextureParameterfv ] --- + + /** Unsafe version of: {@link #glGetTextureParameterfv GetTextureParameterfv} */ + public static void nglGetTextureParameterfv(int texture, int pname, long params) { + GL45C.nglGetTextureParameterfv(texture, pname, params); + } + + /** + * DSA version of {@link GL11C#glGetTexParameterfv GetTexParameterfv}. + * + * @param texture the texture name + * @param pname the parameter to query + * @param params a scalar or buffer in which to place the returned data + */ + public static void glGetTextureParameterfv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + GL45C.glGetTextureParameterfv(texture, pname, params); + } + + /** + * DSA version of {@link GL11C#glGetTexParameterfv GetTexParameterfv}. + * + * @param texture the texture name + * @param pname the parameter to query + */ + @NativeType("void") + public static float glGetTextureParameterf(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname) { + return GL45C.glGetTextureParameterf(texture, pname); + } + + // --- [ glGetTextureParameterIiv ] --- + + /** Unsafe version of: {@link #glGetTextureParameterIiv GetTextureParameterIiv} */ + public static void nglGetTextureParameterIiv(int texture, int pname, long params) { + GL45C.nglGetTextureParameterIiv(texture, pname, params); + } + + /** + * DSA version of {@link GL30C#glGetTexParameterIiv GetTexParameterIiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a texture parameter + * @param params returns the texture parameter value + */ + public static void glGetTextureParameterIiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL45C.glGetTextureParameterIiv(texture, pname, params); + } + + /** + * DSA version of {@link GL30C#glGetTexParameterIiv GetTexParameterIiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a texture parameter + */ + @NativeType("void") + public static int glGetTextureParameterIi(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname) { + return GL45C.glGetTextureParameterIi(texture, pname); + } + + // --- [ glGetTextureParameterIuiv ] --- + + /** Unsafe version of: {@link #glGetTextureParameterIuiv GetTextureParameterIuiv} */ + public static void nglGetTextureParameterIuiv(int texture, int pname, long params) { + GL45C.nglGetTextureParameterIuiv(texture, pname, params); + } + + /** + * DSA version of {@link GL30C#glGetTexParameterIuiv GetTexParameterIuiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a texture parameter + * @param params returns the texture parameter value + */ + public static void glGetTextureParameterIuiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLuint *") IntBuffer params) { + GL45C.glGetTextureParameterIuiv(texture, pname, params); + } + + /** + * DSA version of {@link GL30C#glGetTexParameterIuiv GetTexParameterIuiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a texture parameter + */ + @NativeType("void") + public static int glGetTextureParameterIui(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname) { + return GL45C.glGetTextureParameterIui(texture, pname); + } + + // --- [ glGetTextureParameteriv ] --- + + /** Unsafe version of: {@link #glGetTextureParameteriv GetTextureParameteriv} */ + public static void nglGetTextureParameteriv(int texture, int pname, long params) { + GL45C.nglGetTextureParameteriv(texture, pname, params); + } + + /** + * DSA version of {@link GL11C#glGetTexParameteriv GetTexParameteriv}. + * + * @param texture the texture name + * @param pname the parameter to query. One of:
{@link GL12#GL_TEXTURE_BASE_LEVEL TEXTURE_BASE_LEVEL}{@link GL11#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}{@link GL12#GL_TEXTURE_MAX_LEVEL TEXTURE_MAX_LEVEL}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}
{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL33#GL_TEXTURE_SWIZZLE_R TEXTURE_SWIZZLE_R}{@link GL33#GL_TEXTURE_SWIZZLE_G TEXTURE_SWIZZLE_G}
{@link GL33#GL_TEXTURE_SWIZZLE_B TEXTURE_SWIZZLE_B}{@link GL33#GL_TEXTURE_SWIZZLE_A TEXTURE_SWIZZLE_A}{@link GL33#GL_TEXTURE_SWIZZLE_RGBA TEXTURE_SWIZZLE_RGBA}{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}
{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL14#GL_DEPTH_TEXTURE_MODE DEPTH_TEXTURE_MODE}{@link GL14#GL_GENERATE_MIPMAP GENERATE_MIPMAP}
{@link GL42#GL_IMAGE_FORMAT_COMPATIBILITY_TYPE IMAGE_FORMAT_COMPATIBILITY_TYPE}{@link GL42#GL_TEXTURE_IMMUTABLE_FORMAT TEXTURE_IMMUTABLE_FORMAT}{@link GL43#GL_TEXTURE_IMMUTABLE_LEVELS TEXTURE_IMMUTABLE_LEVELS}{@link GL43#GL_TEXTURE_VIEW_MIN_LEVEL TEXTURE_VIEW_MIN_LEVEL}
{@link GL43#GL_TEXTURE_VIEW_NUM_LEVELS TEXTURE_VIEW_NUM_LEVELS}{@link GL43#GL_TEXTURE_VIEW_MIN_LAYER TEXTURE_VIEW_MIN_LAYER}{@link GL43#GL_TEXTURE_VIEW_NUM_LAYERS TEXTURE_VIEW_NUM_LAYERS}
+ * @param params a scalar or buffer in which to place the returned data + */ + public static void glGetTextureParameteriv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL45C.glGetTextureParameteriv(texture, pname, params); + } + + /** + * DSA version of {@link GL11C#glGetTexParameteriv GetTexParameteriv}. + * + * @param texture the texture name + * @param pname the parameter to query. One of:
{@link GL12#GL_TEXTURE_BASE_LEVEL TEXTURE_BASE_LEVEL}{@link GL11#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}{@link GL12#GL_TEXTURE_MAX_LEVEL TEXTURE_MAX_LEVEL}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}
{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL33#GL_TEXTURE_SWIZZLE_R TEXTURE_SWIZZLE_R}{@link GL33#GL_TEXTURE_SWIZZLE_G TEXTURE_SWIZZLE_G}
{@link GL33#GL_TEXTURE_SWIZZLE_B TEXTURE_SWIZZLE_B}{@link GL33#GL_TEXTURE_SWIZZLE_A TEXTURE_SWIZZLE_A}{@link GL33#GL_TEXTURE_SWIZZLE_RGBA TEXTURE_SWIZZLE_RGBA}{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}
{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL14#GL_DEPTH_TEXTURE_MODE DEPTH_TEXTURE_MODE}{@link GL14#GL_GENERATE_MIPMAP GENERATE_MIPMAP}
{@link GL42#GL_IMAGE_FORMAT_COMPATIBILITY_TYPE IMAGE_FORMAT_COMPATIBILITY_TYPE}{@link GL42#GL_TEXTURE_IMMUTABLE_FORMAT TEXTURE_IMMUTABLE_FORMAT}{@link GL43#GL_TEXTURE_IMMUTABLE_LEVELS TEXTURE_IMMUTABLE_LEVELS}{@link GL43#GL_TEXTURE_VIEW_MIN_LEVEL TEXTURE_VIEW_MIN_LEVEL}
{@link GL43#GL_TEXTURE_VIEW_NUM_LEVELS TEXTURE_VIEW_NUM_LEVELS}{@link GL43#GL_TEXTURE_VIEW_MIN_LAYER TEXTURE_VIEW_MIN_LAYER}{@link GL43#GL_TEXTURE_VIEW_NUM_LAYERS TEXTURE_VIEW_NUM_LAYERS}
+ */ + @NativeType("void") + public static int glGetTextureParameteri(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname) { + return GL45C.glGetTextureParameteri(texture, pname); + } + + // --- [ glCreateVertexArrays ] --- + + /** + * Unsafe version of: {@link #glCreateVertexArrays CreateVertexArrays} + * + * @param n the number of vertex array object names to create + */ + public static void nglCreateVertexArrays(int n, long arrays) { + GL45C.nglCreateVertexArrays(n, arrays); + } + + /** + * Returns {@code n} previously unused vertex array object names in {@code arrays}. + * + * @param arrays the buffer in which to return the created vertex array object names + */ + public static void glCreateVertexArrays(@NativeType("GLuint *") IntBuffer arrays) { + GL45C.glCreateVertexArrays(arrays); + } + + /** Returns {@code n} previously unused vertex array object names in {@code arrays}. */ + @NativeType("void") + public static int glCreateVertexArrays() { + return GL45C.glCreateVertexArrays(); + } + + // --- [ glDisableVertexArrayAttrib ] --- + + /** + * DSA version of {@link GL20C#glDisableVertexAttribArray DisableVertexAttribArray}. + * + * @param vaobj the vertex array object name + * @param index the index of the generic vertex attribute to be disabled + */ + public static void glDisableVertexArrayAttrib(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index) { + GL45C.glDisableVertexArrayAttrib(vaobj, index); + } + + // --- [ glEnableVertexArrayAttrib ] --- + + /** + * DSA version of {@link GL20C#glEnableVertexAttribArray EnableVertexAttribArray}. + * + * @param vaobj the vertex array object name + * @param index the index of the generic vertex attribute to be enabled + */ + public static void glEnableVertexArrayAttrib(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index) { + GL45C.glEnableVertexArrayAttrib(vaobj, index); + } + + // --- [ glVertexArrayElementBuffer ] --- + + /** + * Binds a buffer object to the element array buffer bind point of a vertex array object. + * + * @param vaobj the vertex array object name + * @param buffer the buffer object name. If {@code buffer} is zero, any existing element array buffer binding to {@code vaobj} is removed. + */ + public static void glVertexArrayElementBuffer(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int buffer) { + GL45C.glVertexArrayElementBuffer(vaobj, buffer); + } + + // --- [ glVertexArrayVertexBuffer ] --- + + /** + * DSA version of {@link GL43C#glBindVertexBuffer BindVertexBuffer}. + * + * @param vaobj the vertex array object name + * @param bindingindex the index of the vertex buffer binding point to which to bind the buffer + * @param buffer the name of an existing buffer to bind to the vertex buffer binding point + * @param offset the offset of the first element of the buffer + * @param stride the distance between elements within the buffer + */ + public static void glVertexArrayVertexBuffer(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int bindingindex, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizei") int stride) { + GL45C.glVertexArrayVertexBuffer(vaobj, bindingindex, buffer, offset, stride); + } + + // --- [ glVertexArrayVertexBuffers ] --- + + /** + * Unsafe version of: {@link #glVertexArrayVertexBuffers VertexArrayVertexBuffers} + * + * @param count the number of vertex buffer binding points + */ + public static void nglVertexArrayVertexBuffers(int vaobj, int first, int count, long buffers, long offsets, long strides) { + GL45C.nglVertexArrayVertexBuffers(vaobj, first, count, buffers, offsets, strides); + } + + /** + * DSA version of {@link GL44C#glBindVertexBuffers BindVertexBuffers}. + * + * @param vaobj the vertex array object name + * @param first the first vertex buffer binding point + * @param buffers an array of zeros or names of existing buffers objects + * @param offsets an array of offses + * @param strides an array of stride values + */ + public static void glVertexArrayVertexBuffers(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") IntBuffer buffers, @Nullable @NativeType("GLintptr const *") PointerBuffer offsets, @Nullable @NativeType("GLsizei const *") IntBuffer strides) { + GL45C.glVertexArrayVertexBuffers(vaobj, first, buffers, offsets, strides); + } + + // --- [ glVertexArrayAttribFormat ] --- + + /** + * DSA version of {@link GL43C#glVertexAttribFormat VertexAttribFormat}. + * + * @param vaobj the vertex array object name + * @param attribindex the generic vertex attribute array being described + * @param size the number of values per vertex that are stored in the array. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the type of the data stored in the array + * @param normalized if true then integer data is normalized to the range [-1, 1] or [0, 1] if it is signed or unsigned, respectively. If false then integer data is + * directly converted to floating point. + * @param relativeoffset the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from + */ + public static void glVertexArrayAttribFormat(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int attribindex, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint") int relativeoffset) { + GL45C.glVertexArrayAttribFormat(vaobj, attribindex, size, type, normalized, relativeoffset); + } + + // --- [ glVertexArrayAttribIFormat ] --- + + /** + * DSA version of {@link GL43C#glVertexAttribIFormat VertexAttribIFormat}. + * + * @param vaobj the vertex array object name + * @param attribindex the generic vertex attribute array being described + * @param size the number of values per vertex that are stored in the array. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the type of the data stored in the array + * @param relativeoffset the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from + */ + public static void glVertexArrayAttribIFormat(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int attribindex, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLuint") int relativeoffset) { + GL45C.glVertexArrayAttribIFormat(vaobj, attribindex, size, type, relativeoffset); + } + + // --- [ glVertexArrayAttribLFormat ] --- + + /** + * DSA version of {@link GL43C#glVertexAttribLFormat VertexAttribLFormat}. + * + * @param vaobj the vertex array object name + * @param attribindex the generic vertex attribute array being described + * @param size the number of values per vertex that are stored in the array. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the type of the data stored in the array + * @param relativeoffset the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from + */ + public static void glVertexArrayAttribLFormat(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int attribindex, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLuint") int relativeoffset) { + GL45C.glVertexArrayAttribLFormat(vaobj, attribindex, size, type, relativeoffset); + } + + // --- [ glVertexArrayAttribBinding ] --- + + /** + * DSA version of {@link GL43C#glVertexAttribBinding VertexAttribBinding}. + * + * @param vaobj the vertex array object name + * @param attribindex the index of the attribute to associate with a vertex buffer binding + * @param bindingindex the index of the vertex buffer binding with which to associate the generic vertex attribute + */ + public static void glVertexArrayAttribBinding(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int attribindex, @NativeType("GLuint") int bindingindex) { + GL45C.glVertexArrayAttribBinding(vaobj, attribindex, bindingindex); + } + + // --- [ glVertexArrayBindingDivisor ] --- + + /** + * DSA version of {@link GL43C#glVertexBindingDivisor VertexBindingDivisor}. + * + * @param vaobj the vertex array object name + * @param bindingindex the index of the generic vertex attribute + * @param divisor the number of instances that will pass between updates of the generic attribute at slot {@code index} + */ + public static void glVertexArrayBindingDivisor(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int bindingindex, @NativeType("GLuint") int divisor) { + GL45C.glVertexArrayBindingDivisor(vaobj, bindingindex, divisor); + } + + // --- [ glGetVertexArrayiv ] --- + + /** Unsafe version of: {@link #glGetVertexArrayiv GetVertexArrayiv} */ + public static void nglGetVertexArrayiv(int vaobj, int pname, long param) { + GL45C.nglGetVertexArrayiv(vaobj, pname, param); + } + + /** + * Queries parameters of a vertex array object. + * + * @param vaobj the vertex array object name + * @param pname the parameter to query. Must be:
{@link GL15#GL_ELEMENT_ARRAY_BUFFER_BINDING ELEMENT_ARRAY_BUFFER_BINDING}
+ * @param param the buffer in which to return the parameter values + */ + public static void glGetVertexArrayiv(@NativeType("GLuint") int vaobj, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer param) { + GL45C.glGetVertexArrayiv(vaobj, pname, param); + } + + /** + * Queries parameters of a vertex array object. + * + * @param vaobj the vertex array object name + * @param pname the parameter to query. Must be:
{@link GL15#GL_ELEMENT_ARRAY_BUFFER_BINDING ELEMENT_ARRAY_BUFFER_BINDING}
+ */ + @NativeType("void") + public static int glGetVertexArrayi(@NativeType("GLuint") int vaobj, @NativeType("GLenum") int pname) { + return GL45C.glGetVertexArrayi(vaobj, pname); + } + + // --- [ glGetVertexArrayIndexediv ] --- + + /** Unsafe version of: {@link #glGetVertexArrayIndexediv GetVertexArrayIndexediv} */ + public static void nglGetVertexArrayIndexediv(int vaobj, int index, int pname, long param) { + GL45C.nglGetVertexArrayIndexediv(vaobj, index, pname, param); + } + + /** + * Queries parameters of an attribute of a vertex array object. + * + * @param vaobj the vertex array object name + * @param index the attribute to query + * @param pname the parameter to query. One of:
{@link GL20#GL_VERTEX_ATTRIB_ARRAY_ENABLED VERTEX_ATTRIB_ARRAY_ENABLED}{@link GL20#GL_VERTEX_ATTRIB_ARRAY_SIZE VERTEX_ATTRIB_ARRAY_SIZE},
{@link GL20#GL_VERTEX_ATTRIB_ARRAY_STRIDE VERTEX_ATTRIB_ARRAY_STRIDE}{@link GL20#GL_VERTEX_ATTRIB_ARRAY_TYPE VERTEX_ATTRIB_ARRAY_TYPE}
{@link GL20#GL_VERTEX_ATTRIB_ARRAY_NORMALIZED VERTEX_ATTRIB_ARRAY_NORMALIZED}{@link GL30#GL_VERTEX_ATTRIB_ARRAY_INTEGER VERTEX_ATTRIB_ARRAY_INTEGER}
{@link GL33#GL_VERTEX_ATTRIB_ARRAY_DIVISOR VERTEX_ATTRIB_ARRAY_DIVISOR}{@link GL43#GL_VERTEX_ATTRIB_ARRAY_LONG VERTEX_ATTRIB_ARRAY_LONG}
{@link GL43#GL_VERTEX_ATTRIB_RELATIVE_OFFSET VERTEX_ATTRIB_RELATIVE_OFFSET}
+ * @param param the buffer in which to return the parameter values + */ + public static void glGetVertexArrayIndexediv(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer param) { + GL45C.glGetVertexArrayIndexediv(vaobj, index, pname, param); + } + + /** + * Queries parameters of an attribute of a vertex array object. + * + * @param vaobj the vertex array object name + * @param index the attribute to query + * @param pname the parameter to query. One of:
{@link GL20#GL_VERTEX_ATTRIB_ARRAY_ENABLED VERTEX_ATTRIB_ARRAY_ENABLED}{@link GL20#GL_VERTEX_ATTRIB_ARRAY_SIZE VERTEX_ATTRIB_ARRAY_SIZE},
{@link GL20#GL_VERTEX_ATTRIB_ARRAY_STRIDE VERTEX_ATTRIB_ARRAY_STRIDE}{@link GL20#GL_VERTEX_ATTRIB_ARRAY_TYPE VERTEX_ATTRIB_ARRAY_TYPE}
{@link GL20#GL_VERTEX_ATTRIB_ARRAY_NORMALIZED VERTEX_ATTRIB_ARRAY_NORMALIZED}{@link GL30#GL_VERTEX_ATTRIB_ARRAY_INTEGER VERTEX_ATTRIB_ARRAY_INTEGER}
{@link GL33#GL_VERTEX_ATTRIB_ARRAY_DIVISOR VERTEX_ATTRIB_ARRAY_DIVISOR}{@link GL43#GL_VERTEX_ATTRIB_ARRAY_LONG VERTEX_ATTRIB_ARRAY_LONG}
{@link GL43#GL_VERTEX_ATTRIB_RELATIVE_OFFSET VERTEX_ATTRIB_RELATIVE_OFFSET}
+ */ + @NativeType("void") + public static int glGetVertexArrayIndexedi(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + return GL45C.glGetVertexArrayIndexedi(vaobj, index, pname); + } + + // --- [ glGetVertexArrayIndexed64iv ] --- + + /** Unsafe version of: {@link #glGetVertexArrayIndexed64iv GetVertexArrayIndexed64iv} */ + public static void nglGetVertexArrayIndexed64iv(int vaobj, int index, int pname, long param) { + GL45C.nglGetVertexArrayIndexed64iv(vaobj, index, pname, param); + } + + /** + * Queries parameters of an attribute of a vertex array object. + * + * @param vaobj the vertex array object name + * @param index the attribute to query + * @param pname the parameter to query. Must be:
{@link GL43#GL_VERTEX_BINDING_OFFSET VERTEX_BINDING_OFFSET}
+ * @param param the buffer in which to return the parameter values + */ + public static void glGetVertexArrayIndexed64iv(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint64 *") LongBuffer param) { + GL45C.glGetVertexArrayIndexed64iv(vaobj, index, pname, param); + } + + /** + * Queries parameters of an attribute of a vertex array object. + * + * @param vaobj the vertex array object name + * @param index the attribute to query + * @param pname the parameter to query. Must be:
{@link GL43#GL_VERTEX_BINDING_OFFSET VERTEX_BINDING_OFFSET}
+ */ + @NativeType("void") + public static long glGetVertexArrayIndexed64i(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + return GL45C.glGetVertexArrayIndexed64i(vaobj, index, pname); + } + + // --- [ glCreateSamplers ] --- + + /** + * Unsafe version of: {@link #glCreateSamplers CreateSamplers} + * + * @param n the number of sampler object names to create + */ + public static void nglCreateSamplers(int n, long samplers) { + GL45C.nglCreateSamplers(n, samplers); + } + + /** + * Returns {@code n} previously unused sampler names in {@code samplers}, each representing a new sampler object. + * + * @param samplers the buffer in which to return the created sampler object names + */ + public static void glCreateSamplers(@NativeType("GLuint *") IntBuffer samplers) { + GL45C.glCreateSamplers(samplers); + } + + /** Returns {@code n} previously unused sampler names in {@code samplers}, each representing a new sampler object. */ + @NativeType("void") + public static int glCreateSamplers() { + return GL45C.glCreateSamplers(); + } + + // --- [ glCreateProgramPipelines ] --- + + /** + * Unsafe version of: {@link #glCreateProgramPipelines CreateProgramPipelines} + * + * @param n the number of program pipeline names to create + */ + public static void nglCreateProgramPipelines(int n, long pipelines) { + GL45C.nglCreateProgramPipelines(n, pipelines); + } + + /** + * Returns {@code n} previously unused program pipeline names in {@code pipelines}, each representing a new program pipeline object. + * + * @param pipelines the buffer in which to return the created program pipeline names + */ + public static void glCreateProgramPipelines(@NativeType("GLuint *") IntBuffer pipelines) { + GL45C.glCreateProgramPipelines(pipelines); + } + + /** Returns {@code n} previously unused program pipeline names in {@code pipelines}, each representing a new program pipeline object. */ + @NativeType("void") + public static int glCreateProgramPipelines() { + return GL45C.glCreateProgramPipelines(); + } + + // --- [ glCreateQueries ] --- + + /** + * Unsafe version of: {@link #glCreateQueries CreateQueries} + * + * @param n the number of query object names to create + */ + public static void nglCreateQueries(int target, int n, long ids) { + GL45C.nglCreateQueries(target, n, ids); + } + + /** + * Returns {@code n} previously unused query object names in {@code ids}, each representing a new query object with the specified {@code target}. + * + * @param target the query target. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param ids the buffer in which to return the created query object names + */ + public static void glCreateQueries(@NativeType("GLenum") int target, @NativeType("GLuint *") IntBuffer ids) { + GL45C.glCreateQueries(target, ids); + } + + /** + * Returns {@code n} previously unused query object names in {@code ids}, each representing a new query object with the specified {@code target}. + * + * @param target the query target. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ */ + @NativeType("void") + public static int glCreateQueries(@NativeType("GLenum") int target) { + return GL45C.glCreateQueries(target); + } + + // --- [ glGetQueryBufferObjecti64v ] --- + + /** + * 64bit version of {@link #glGetQueryBufferObjectiv GetQueryBufferObjectiv}. + * + * @param id the name of a query object + * @param buffer the name of a buffer object + * @param pname the state to query + * @param offset the offset into {@code buffer} at which the queried value is written + */ + public static void glGetQueryBufferObjecti64v(@NativeType("GLuint") int id, @NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLintptr") long offset) { + GL45C.glGetQueryBufferObjecti64v(id, buffer, pname, offset); + } + + // --- [ glGetQueryBufferObjectiv ] --- + + /** + * Queries the state of a query object. + * + * @param id the name of a query object + * @param buffer the name of a buffer object + * @param pname the state to query + * @param offset the offset into {@code buffer} at which the queried value is written + */ + public static void glGetQueryBufferObjectiv(@NativeType("GLuint") int id, @NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLintptr") long offset) { + GL45C.glGetQueryBufferObjectiv(id, buffer, pname, offset); + } + + // --- [ glGetQueryBufferObjectui64v ] --- + + /** + * 64bit version of {@link #glGetQueryBufferObjectuiv GetQueryBufferObjectuiv}. + * + * @param id the name of a query object + * @param buffer the name of a buffer object + * @param pname the state to query + * @param offset the offset into {@code buffer} at which the queried value is written + */ + public static void glGetQueryBufferObjectui64v(@NativeType("GLuint") int id, @NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLintptr") long offset) { + GL45C.glGetQueryBufferObjectui64v(id, buffer, pname, offset); + } + + // --- [ glGetQueryBufferObjectuiv ] --- + + /** + * Unsigned version of {@link #glGetQueryBufferObjectiv GetQueryBufferObjectiv}. + * + * @param id the name of a query object + * @param buffer the name of a buffer object + * @param pname the state to query + * @param offset the offset into {@code buffer} at which the queried value is written + */ + public static void glGetQueryBufferObjectuiv(@NativeType("GLuint") int id, @NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLintptr") long offset) { + GL45C.glGetQueryBufferObjectuiv(id, buffer, pname, offset); + } + + /** Array version of: {@link #glCreateTransformFeedbacks CreateTransformFeedbacks} */ + public static void glCreateTransformFeedbacks(@NativeType("GLuint *") int[] ids) { + GL45C.glCreateTransformFeedbacks(ids); + } + + /** Array version of: {@link #glGetTransformFeedbackiv GetTransformFeedbackiv} */ + public static void glGetTransformFeedbackiv(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] param) { + GL45C.glGetTransformFeedbackiv(xfb, pname, param); + } + + /** Array version of: {@link #glGetTransformFeedbacki_v GetTransformFeedbacki_v} */ + public static void glGetTransformFeedbacki_v(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLint *") int[] param) { + GL45C.glGetTransformFeedbacki_v(xfb, pname, index, param); + } + + /** Array version of: {@link #glGetTransformFeedbacki64_v GetTransformFeedbacki64_v} */ + public static void glGetTransformFeedbacki64_v(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLint64 *") long[] param) { + GL45C.glGetTransformFeedbacki64_v(xfb, pname, index, param); + } + + /** Array version of: {@link #glCreateBuffers CreateBuffers} */ + public static void glCreateBuffers(@NativeType("GLuint *") int[] buffers) { + GL45C.glCreateBuffers(buffers); + } + + /** Array version of: {@link #glNamedBufferStorage NamedBufferStorage} */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") short[] data, @NativeType("GLbitfield") int flags) { + GL45C.glNamedBufferStorage(buffer, data, flags); + } + + /** Array version of: {@link #glNamedBufferStorage NamedBufferStorage} */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") int[] data, @NativeType("GLbitfield") int flags) { + GL45C.glNamedBufferStorage(buffer, data, flags); + } + + /** Array version of: {@link #glNamedBufferStorage NamedBufferStorage} */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") float[] data, @NativeType("GLbitfield") int flags) { + GL45C.glNamedBufferStorage(buffer, data, flags); + } + + /** Array version of: {@link #glNamedBufferStorage NamedBufferStorage} */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") double[] data, @NativeType("GLbitfield") int flags) { + GL45C.glNamedBufferStorage(buffer, data, flags); + } + + /** Array version of: {@link #glNamedBufferData NamedBufferData} */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") short[] data, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, data, usage); + } + + /** Array version of: {@link #glNamedBufferData NamedBufferData} */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") int[] data, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, data, usage); + } + + /** Array version of: {@link #glNamedBufferData NamedBufferData} */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") long[] data, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, data, usage); + } + + /** Array version of: {@link #glNamedBufferData NamedBufferData} */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") float[] data, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, data, usage); + } + + /** Array version of: {@link #glNamedBufferData NamedBufferData} */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") double[] data, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, data, usage); + } + + /** Array version of: {@link #glNamedBufferSubData NamedBufferSubData} */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") short[] data) { + GL45C.glNamedBufferSubData(buffer, offset, data); + } + + /** Array version of: {@link #glNamedBufferSubData NamedBufferSubData} */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") int[] data) { + GL45C.glNamedBufferSubData(buffer, offset, data); + } + + /** Array version of: {@link #glNamedBufferSubData NamedBufferSubData} */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") long[] data) { + GL45C.glNamedBufferSubData(buffer, offset, data); + } + + /** Array version of: {@link #glNamedBufferSubData NamedBufferSubData} */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") float[] data) { + GL45C.glNamedBufferSubData(buffer, offset, data); + } + + /** Array version of: {@link #glNamedBufferSubData NamedBufferSubData} */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") double[] data) { + GL45C.glNamedBufferSubData(buffer, offset, data); + } + + /** Array version of: {@link #glClearNamedBufferData ClearNamedBufferData} */ + public static void glClearNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] data) { + GL45C.glClearNamedBufferData(buffer, internalformat, format, type, data); + } + + /** Array version of: {@link #glClearNamedBufferData ClearNamedBufferData} */ + public static void glClearNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] data) { + GL45C.glClearNamedBufferData(buffer, internalformat, format, type, data); + } + + /** Array version of: {@link #glClearNamedBufferData ClearNamedBufferData} */ + public static void glClearNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] data) { + GL45C.glClearNamedBufferData(buffer, internalformat, format, type, data); + } + + /** Array version of: {@link #glClearNamedBufferSubData ClearNamedBufferSubData} */ + public static void glClearNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] data) { + GL45C.glClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); + } + + /** Array version of: {@link #glClearNamedBufferSubData ClearNamedBufferSubData} */ + public static void glClearNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] data) { + GL45C.glClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); + } + + /** Array version of: {@link #glClearNamedBufferSubData ClearNamedBufferSubData} */ + public static void glClearNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] data) { + GL45C.glClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); + } + + /** Array version of: {@link #glGetNamedBufferParameteriv GetNamedBufferParameteriv} */ + public static void glGetNamedBufferParameteriv(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL45C.glGetNamedBufferParameteriv(buffer, pname, params); + } + + /** Array version of: {@link #glGetNamedBufferParameteri64v GetNamedBufferParameteri64v} */ + public static void glGetNamedBufferParameteri64v(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLint64 *") long[] params) { + GL45C.glGetNamedBufferParameteri64v(buffer, pname, params); + } + + /** Array version of: {@link #glGetNamedBufferSubData GetNamedBufferSubData} */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") short[] data) { + GL45C.glGetNamedBufferSubData(buffer, offset, data); + } + + /** Array version of: {@link #glGetNamedBufferSubData GetNamedBufferSubData} */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") int[] data) { + GL45C.glGetNamedBufferSubData(buffer, offset, data); + } + + /** Array version of: {@link #glGetNamedBufferSubData GetNamedBufferSubData} */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") long[] data) { + GL45C.glGetNamedBufferSubData(buffer, offset, data); + } + + /** Array version of: {@link #glGetNamedBufferSubData GetNamedBufferSubData} */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") float[] data) { + GL45C.glGetNamedBufferSubData(buffer, offset, data); + } + + /** Array version of: {@link #glGetNamedBufferSubData GetNamedBufferSubData} */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") double[] data) { + GL45C.glGetNamedBufferSubData(buffer, offset, data); + } + + /** Array version of: {@link #glCreateFramebuffers CreateFramebuffers} */ + public static void glCreateFramebuffers(@NativeType("GLuint *") int[] framebuffers) { + GL45C.glCreateFramebuffers(framebuffers); + } + + /** Array version of: {@link #glNamedFramebufferDrawBuffers NamedFramebufferDrawBuffers} */ + public static void glNamedFramebufferDrawBuffers(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") int[] bufs) { + GL45C.glNamedFramebufferDrawBuffers(framebuffer, bufs); + } + + /** Array version of: {@link #glInvalidateNamedFramebufferData InvalidateNamedFramebufferData} */ + public static void glInvalidateNamedFramebufferData(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") int[] attachments) { + GL45C.glInvalidateNamedFramebufferData(framebuffer, attachments); + } + + /** Array version of: {@link #glInvalidateNamedFramebufferSubData InvalidateNamedFramebufferSubData} */ + public static void glInvalidateNamedFramebufferSubData(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") int[] attachments, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL45C.glInvalidateNamedFramebufferSubData(framebuffer, attachments, x, y, width, height); + } + + /** Array version of: {@link #glClearNamedFramebufferiv ClearNamedFramebufferiv} */ + public static void glClearNamedFramebufferiv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLint *") int[] value) { + GL45C.glClearNamedFramebufferiv(framebuffer, buffer, drawbuffer, value); + } + + /** Array version of: {@link #glClearNamedFramebufferuiv ClearNamedFramebufferuiv} */ + public static void glClearNamedFramebufferuiv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLint *") int[] value) { + GL45C.glClearNamedFramebufferuiv(framebuffer, buffer, drawbuffer, value); + } + + /** Array version of: {@link #glClearNamedFramebufferfv ClearNamedFramebufferfv} */ + public static void glClearNamedFramebufferfv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLfloat *") float[] value) { + GL45C.glClearNamedFramebufferfv(framebuffer, buffer, drawbuffer, value); + } + + /** Array version of: {@link #glGetNamedFramebufferParameteriv GetNamedFramebufferParameteriv} */ + public static void glGetNamedFramebufferParameteriv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL45C.glGetNamedFramebufferParameteriv(framebuffer, pname, params); + } + + /** Array version of: {@link #glGetNamedFramebufferAttachmentParameteriv GetNamedFramebufferAttachmentParameteriv} */ + public static void glGetNamedFramebufferAttachmentParameteriv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL45C.glGetNamedFramebufferAttachmentParameteriv(framebuffer, attachment, pname, params); + } + + /** Array version of: {@link #glCreateRenderbuffers CreateRenderbuffers} */ + public static void glCreateRenderbuffers(@NativeType("GLuint *") int[] renderbuffers) { + GL45C.glCreateRenderbuffers(renderbuffers); + } + + /** Array version of: {@link #glGetNamedRenderbufferParameteriv GetNamedRenderbufferParameteriv} */ + public static void glGetNamedRenderbufferParameteriv(@NativeType("GLuint") int renderbuffer, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL45C.glGetNamedRenderbufferParameteriv(renderbuffer, pname, params); + } + + /** Array version of: {@link #glCreateTextures CreateTextures} */ + public static void glCreateTextures(@NativeType("GLenum") int target, @NativeType("GLuint *") int[] textures) { + GL45C.glCreateTextures(target, textures); + } + + /** Array version of: {@link #glTextureSubImage1D TextureSubImage1D} */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] pixels) { + GL45C.glTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + /** Array version of: {@link #glTextureSubImage1D TextureSubImage1D} */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] pixels) { + GL45C.glTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + /** Array version of: {@link #glTextureSubImage1D TextureSubImage1D} */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] pixels) { + GL45C.glTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + /** Array version of: {@link #glTextureSubImage1D TextureSubImage1D} */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") double[] pixels) { + GL45C.glTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + /** Array version of: {@link #glTextureSubImage2D TextureSubImage2D} */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] pixels) { + GL45C.glTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** Array version of: {@link #glTextureSubImage2D TextureSubImage2D} */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] pixels) { + GL45C.glTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** Array version of: {@link #glTextureSubImage2D TextureSubImage2D} */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] pixels) { + GL45C.glTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** Array version of: {@link #glTextureSubImage2D TextureSubImage2D} */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") double[] pixels) { + GL45C.glTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** Array version of: {@link #glTextureSubImage3D TextureSubImage3D} */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] pixels) { + GL45C.glTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** Array version of: {@link #glTextureSubImage3D TextureSubImage3D} */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] pixels) { + GL45C.glTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** Array version of: {@link #glTextureSubImage3D TextureSubImage3D} */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] pixels) { + GL45C.glTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** Array version of: {@link #glTextureSubImage3D TextureSubImage3D} */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") double[] pixels) { + GL45C.glTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** Array version of: {@link #glTextureParameterfv TextureParameterfv} */ + public static void glTextureParameterfv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] params) { + GL45C.glTextureParameterfv(texture, pname, params); + } + + /** Array version of: {@link #glTextureParameterIiv TextureParameterIiv} */ + public static void glTextureParameterIiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + GL45C.glTextureParameterIiv(texture, pname, params); + } + + /** Array version of: {@link #glTextureParameterIuiv TextureParameterIuiv} */ + public static void glTextureParameterIuiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLuint const *") int[] params) { + GL45C.glTextureParameterIuiv(texture, pname, params); + } + + /** Array version of: {@link #glTextureParameteriv TextureParameteriv} */ + public static void glTextureParameteriv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + GL45C.glTextureParameteriv(texture, pname, params); + } + + /** Array version of: {@link #glGetTextureImage GetTextureImage} */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") short[] pixels) { + GL45C.glGetTextureImage(texture, level, format, type, pixels); + } + + /** Array version of: {@link #glGetTextureImage GetTextureImage} */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") int[] pixels) { + GL45C.glGetTextureImage(texture, level, format, type, pixels); + } + + /** Array version of: {@link #glGetTextureImage GetTextureImage} */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") float[] pixels) { + GL45C.glGetTextureImage(texture, level, format, type, pixels); + } + + /** Array version of: {@link #glGetTextureImage GetTextureImage} */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") double[] pixels) { + GL45C.glGetTextureImage(texture, level, format, type, pixels); + } + + /** Array version of: {@link #glGetTextureLevelParameterfv GetTextureLevelParameterfv} */ + public static void glGetTextureLevelParameterfv(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + GL45C.glGetTextureLevelParameterfv(texture, level, pname, params); + } + + /** Array version of: {@link #glGetTextureLevelParameteriv GetTextureLevelParameteriv} */ + public static void glGetTextureLevelParameteriv(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL45C.glGetTextureLevelParameteriv(texture, level, pname, params); + } + + /** Array version of: {@link #glGetTextureParameterfv GetTextureParameterfv} */ + public static void glGetTextureParameterfv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + GL45C.glGetTextureParameterfv(texture, pname, params); + } + + /** Array version of: {@link #glGetTextureParameterIiv GetTextureParameterIiv} */ + public static void glGetTextureParameterIiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL45C.glGetTextureParameterIiv(texture, pname, params); + } + + /** Array version of: {@link #glGetTextureParameterIuiv GetTextureParameterIuiv} */ + public static void glGetTextureParameterIuiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLuint *") int[] params) { + GL45C.glGetTextureParameterIuiv(texture, pname, params); + } + + /** Array version of: {@link #glGetTextureParameteriv GetTextureParameteriv} */ + public static void glGetTextureParameteriv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL45C.glGetTextureParameteriv(texture, pname, params); + } + + /** Array version of: {@link #glCreateVertexArrays CreateVertexArrays} */ + public static void glCreateVertexArrays(@NativeType("GLuint *") int[] arrays) { + GL45C.glCreateVertexArrays(arrays); + } + + /** Array version of: {@link #glVertexArrayVertexBuffers VertexArrayVertexBuffers} */ + public static void glVertexArrayVertexBuffers(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") int[] buffers, @Nullable @NativeType("GLintptr const *") PointerBuffer offsets, @Nullable @NativeType("GLsizei const *") int[] strides) { + GL45C.glVertexArrayVertexBuffers(vaobj, first, buffers, offsets, strides); + } + + /** Array version of: {@link #glGetVertexArrayiv GetVertexArrayiv} */ + public static void glGetVertexArrayiv(@NativeType("GLuint") int vaobj, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] param) { + GL45C.glGetVertexArrayiv(vaobj, pname, param); + } + + /** Array version of: {@link #glGetVertexArrayIndexediv GetVertexArrayIndexediv} */ + public static void glGetVertexArrayIndexediv(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] param) { + GL45C.glGetVertexArrayIndexediv(vaobj, index, pname, param); + } + + /** Array version of: {@link #glGetVertexArrayIndexed64iv GetVertexArrayIndexed64iv} */ + public static void glGetVertexArrayIndexed64iv(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint64 *") long[] param) { + GL45C.glGetVertexArrayIndexed64iv(vaobj, index, pname, param); + } + + /** Array version of: {@link #glCreateSamplers CreateSamplers} */ + public static void glCreateSamplers(@NativeType("GLuint *") int[] samplers) { + GL45C.glCreateSamplers(samplers); + } + + /** Array version of: {@link #glCreateProgramPipelines CreateProgramPipelines} */ + public static void glCreateProgramPipelines(@NativeType("GLuint *") int[] pipelines) { + GL45C.glCreateProgramPipelines(pipelines); + } + + /** Array version of: {@link #glCreateQueries CreateQueries} */ + public static void glCreateQueries(@NativeType("GLenum") int target, @NativeType("GLuint *") int[] ids) { + GL45C.glCreateQueries(target, ids); + } + + private static boolean ARB_framebuffer_object(java.util.Set ext) { + return ext.contains("OpenGL30") || ext.contains("GL_ARB_framebuffer_object"); + } + + private static boolean ARB_map_buffer_range(java.util.Set ext) { + return ext.contains("OpenGL30") || ext.contains("GL_ARB_map_buffer_range"); + } + + private static boolean ARB_vertex_array_object(java.util.Set ext) { + return ext.contains("OpenGL30") || ext.contains("GL_ARB_vertex_array_object"); + } + + private static boolean ARB_copy_buffer(java.util.Set ext) { + return ext.contains("OpenGL31") || ext.contains("GL_ARB_copy_buffer"); + } + + private static boolean ARB_texture_buffer_object(java.util.Set ext) { + return ext.contains("OpenGL31") || ext.contains("GL_ARB_texture_buffer_object"); + } + + private static boolean ARB_uniform_buffer_object(java.util.Set ext) { + return ext.contains("OpenGL31") || ext.contains("GL_ARB_uniform_buffer_object"); + } + + private static boolean ARB_instanced_arrays(java.util.Set ext) { + return ext.contains("OpenGL33") || ext.contains("GL_ARB_instanced_arrays"); + } + + private static boolean ARB_sampler_objects(java.util.Set ext) { + return ext.contains("OpenGL33") || ext.contains("GL_ARB_sampler_objects"); + } + + private static boolean ARB_transform_feedback2(java.util.Set ext) { + return ext.contains("OpenGL40") || ext.contains("GL_ARB_transform_feedback2"); + } + + private static boolean ARB_vertex_attrib_64bit(java.util.Set ext) { + return ext.contains("OpenGL41") || ext.contains("GL_ARB_vertex_attrib_64bit"); + } + + private static boolean ARB_separate_shader_objects(java.util.Set ext) { + return ext.contains("OpenGL41") || ext.contains("GL_ARB_separate_shader_objects"); + } + + private static boolean ARB_texture_storage(java.util.Set ext) { + return ext.contains("OpenGL42") || ext.contains("GL_ARB_texture_storage"); + } + + private static boolean ARB_texture_storage_multisample(java.util.Set ext) { + return ext.contains("OpenGL43") || ext.contains("GL_ARB_texture_storage_multisample"); + } + + private static boolean ARB_vertex_attrib_binding(java.util.Set ext) { + return ext.contains("OpenGL43") || ext.contains("GL_ARB_vertex_attrib_binding"); + } + + private static boolean ARB_invalidate_subdata(java.util.Set ext) { + return ext.contains("OpenGL43") || ext.contains("GL_ARB_invalidate_subdata"); + } + + private static boolean ARB_texture_buffer_range(java.util.Set ext) { + return ext.contains("OpenGL43") || ext.contains("GL_ARB_texture_buffer_range"); + } + + private static boolean ARB_clear_buffer_object(java.util.Set ext) { + return ext.contains("OpenGL43") || ext.contains("GL_ARB_clear_buffer_object"); + } + + private static boolean ARB_framebuffer_no_attachments(java.util.Set ext) { + return ext.contains("OpenGL43") || ext.contains("GL_ARB_framebuffer_no_attachments"); + } + + private static boolean ARB_buffer_storage(java.util.Set ext) { + return ext.contains("OpenGL44") || ext.contains("GL_ARB_buffer_storage"); + } + + private static boolean ARB_clear_texture(java.util.Set ext) { + return ext.contains("OpenGL44") || ext.contains("GL_ARB_clear_texture"); + } + + private static boolean ARB_multi_bind(java.util.Set ext) { + return ext.contains("OpenGL44") || ext.contains("GL_ARB_multi_bind"); + } + + private static boolean ARB_query_buffer_object(java.util.Set ext) { + return ext.contains("OpenGL44") || ext.contains("GL_ARB_query_buffer_object"); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDrawBuffers.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDrawBuffers.java new file mode 100644 index 00000000..1a483895 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDrawBuffers.java @@ -0,0 +1,85 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_draw_buffers extension. + * + *

This extension extends {@link ARBFragmentProgram ARB_fragment_program} and {@link ARBFragmentShader ARB_fragment_shader} to allow multiple output colors, and provides a mechanism for + * directing those outputs to multiple color buffers.

+ * + *

Requires {@link GL13 OpenGL 1.3}. Promoted to core in {@link GL20 OpenGL 2.0}.

+ */ +public class ARBDrawBuffers { + + /** Accepted by the {@code pname} parameters of GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_DRAW_BUFFERS_ARB = 0x8824, + GL_DRAW_BUFFER0_ARB = 0x8825, + GL_DRAW_BUFFER1_ARB = 0x8826, + GL_DRAW_BUFFER2_ARB = 0x8827, + GL_DRAW_BUFFER3_ARB = 0x8828, + GL_DRAW_BUFFER4_ARB = 0x8829, + GL_DRAW_BUFFER5_ARB = 0x882A, + GL_DRAW_BUFFER6_ARB = 0x882B, + GL_DRAW_BUFFER7_ARB = 0x882C, + GL_DRAW_BUFFER8_ARB = 0x882D, + GL_DRAW_BUFFER9_ARB = 0x882E, + GL_DRAW_BUFFER10_ARB = 0x882F, + GL_DRAW_BUFFER11_ARB = 0x8830, + GL_DRAW_BUFFER12_ARB = 0x8831, + GL_DRAW_BUFFER13_ARB = 0x8832, + GL_DRAW_BUFFER14_ARB = 0x8833, + GL_DRAW_BUFFER15_ARB = 0x8834; + + static { GL.initialize(); } + + protected ARBDrawBuffers() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glDrawBuffersARB + ); + } + + // --- [ glDrawBuffersARB ] --- + + /** + * Unsafe version of: {@link #glDrawBuffersARB DrawBuffersARB} + * + * @param n the number of buffers in {@code bufs} + */ + public static native void nglDrawBuffersARB(int n, long bufs); + + /** + * Defines the draw buffers to which all output colors are written. + * + * @param bufs a buffer of symbolic constants specifying the buffer to which each output color is written. One of:
{@link GL11#GL_NONE NONE}{@link GL11#GL_FRONT_LEFT FRONT_LEFT}{@link GL11#GL_FRONT_RIGHT FRONT_RIGHT}{@link GL11#GL_BACK_LEFT BACK_LEFT}{@link GL11#GL_BACK_RIGHT BACK_RIGHT}{@link GL11#GL_AUX0 AUX0}{@link GL11#GL_AUX1 AUX1}{@link GL11#GL_AUX2 AUX2}
{@link GL11#GL_AUX3 AUX3}{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}GL30.GL_COLOR_ATTACHMENT[1-15]
+ */ + public static void glDrawBuffersARB(@NativeType("GLenum const *") IntBuffer bufs) { + nglDrawBuffersARB(bufs.remaining(), memAddress(bufs)); + } + + /** Array version of: {@link #glDrawBuffersARB DrawBuffersARB} */ + public static void glDrawBuffersARB(@NativeType("GLenum const *") int[] bufs) { + long __functionAddress = GL.getICD().glDrawBuffersARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(bufs.length, bufs, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDrawBuffersBlend.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDrawBuffersBlend.java new file mode 100644 index 00000000..3f46368f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDrawBuffersBlend.java @@ -0,0 +1,120 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_draw_buffers_blend extension. + * + *

This extension builds upon the {@link ARBDrawBuffers ARB_draw_buffers} and {@link EXTDrawBuffers2 EXT_draw_buffers2} extensions. In ARB_draw_buffers (part of OpenGL 2.0), separate + * values could be written to each color buffer. This was further enhanced by EXT_draw_buffers2 by adding in the ability to enable blending and to set + * color write masks independently per color output.

+ * + *

This extension provides the ability to set individual blend equations and blend functions for each color output.

+ * + *

Requires {@link GL20 OpenGL 2.0} and {@link EXTDrawBuffers2 EXT_draw_buffers2}. Promoted to core in {@link GL40 OpenGL 4.0}.

+ */ +public class ARBDrawBuffersBlend { + + static { GL.initialize(); } + + protected ARBDrawBuffersBlend() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBlendEquationiARB, caps.glBlendEquationSeparateiARB, caps.glBlendFunciARB, caps.glBlendFuncSeparateiARB + ); + } + + // --- [ glBlendEquationiARB ] --- + + /** + * Provides a way to enable blending and set color write masks independently per color output. + * + *

This call modifies the blend equations associated with an individual draw buffer.

+ * + *

The error {@link GL11#GL_INVALID_ENUM INVALID_ENUM} is generated if the {@code buf} parameter is outside the range [0, {@link GL20#GL_MAX_DRAW_BUFFERS MAX_DRAW_BUFFERS} – 1].

+ * + *

The error {@link GL11#GL_INVALID_ENUM INVALID_ENUM} is generated if {@code mode} is not one of {@link GL14#GL_FUNC_ADD FUNC_ADD}, {@link GL14#GL_FUNC_SUBTRACT FUNC_SUBTRACT}, + * {@link GL14#GL_FUNC_REVERSE_SUBTRACT FUNC_REVERSE_SUBTRACT}, {@link GL14#GL_MAX MAX}, or {@link GL14#GL_MIN MIN}.

+ * + *

The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated if this method is executed between the execution of {@link GL11#glBegin Begin} and the corresponding execution + * of {@link GL11#glEnd End}.

+ * + * @param buf an integer that indicates the {@link GL11#GL_DRAW_BUFFER DRAW_BUFFER} to modify. + * @param mode determines both the RGB and alpha blend equations. One of:
{@link GL14#GL_FUNC_ADD FUNC_ADD}{@link GL14#GL_FUNC_SUBTRACT FUNC_SUBTRACT}{@link GL14#GL_FUNC_REVERSE_SUBTRACT FUNC_REVERSE_SUBTRACT}{@link GL14#GL_MIN MIN}{@link GL14#GL_MAX MAX}
+ */ + public static native void glBlendEquationiARB(@NativeType("GLuint") int buf, @NativeType("GLenum") int mode); + + // --- [ glBlendEquationSeparateiARB ] --- + + /** + * Provides a way to enable blending and set color write masks independently per color output. + * + *

This call modifies the blend equations associated with an individual draw buffer.

+ * + *

The error {@link GL11#GL_INVALID_ENUM INVALID_ENUM} is generated if the {@code buf} parameter is outside the range [0, {@link GL20#GL_MAX_DRAW_BUFFERS MAX_DRAW_BUFFERS} – 1].

+ * + *

The error {@link GL11#GL_INVALID_ENUM INVALID_ENUM} is generated if either {@code modeRGB} or {@code modeAlpha} are not one of {@link GL14#GL_FUNC_ADD FUNC_ADD}, + * {@link GL14#GL_FUNC_SUBTRACT FUNC_SUBTRACT}, {@link GL14#GL_FUNC_REVERSE_SUBTRACT FUNC_REVERSE_SUBTRACT}, {@link GL14#GL_MAX MAX}, or {@link GL14#GL_MIN MIN}.

+ * + *

The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated if this method is executed between the execution of {@link GL11#glBegin Begin} and the corresponding execution + * of {@link GL11#glEnd End}.

+ * + * @param buf an integer that indicates the {@link GL11#GL_DRAW_BUFFER DRAW_BUFFER} to modify. + * @param modeRGB the RGB blend equation. One of:
{@link GL14#GL_FUNC_ADD FUNC_ADD}{@link GL14#GL_FUNC_SUBTRACT FUNC_SUBTRACT}{@link GL14#GL_FUNC_REVERSE_SUBTRACT FUNC_REVERSE_SUBTRACT}{@link GL14#GL_MIN MIN}{@link GL14#GL_MAX MAX}
+ * @param modeAlpha the alpha blend equation. One of:
{@link GL14#GL_FUNC_ADD FUNC_ADD}{@link GL14#GL_FUNC_SUBTRACT FUNC_SUBTRACT}{@link GL14#GL_FUNC_REVERSE_SUBTRACT FUNC_REVERSE_SUBTRACT}{@link GL14#GL_MIN MIN}{@link GL14#GL_MAX MAX}
+ */ + public static native void glBlendEquationSeparateiARB(@NativeType("GLuint") int buf, @NativeType("GLenum") int modeRGB, @NativeType("GLenum") int modeAlpha); + + // --- [ glBlendFunciARB ] --- + + /** + * Provides a way to enable blending and set color write masks independently per color output. + * + *

This call modifies the blend functions associated with an individual draw buffer.

+ * + *

The error {@link GL11#GL_INVALID_ENUM INVALID_ENUM} is generated if the {@code buf} parameter is outside the range [0, {@link GL20#GL_MAX_DRAW_BUFFERS MAX_DRAW_BUFFERS} – 1].

+ * + *

The error {@link GL11#GL_INVALID_ENUM INVALID_ENUM} is generated if either {@code src}, or {@code dst} is not an accepted value.

+ * + *

The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated if this method is executed between the execution of {@link GL11#glBegin Begin} and the corresponding execution + * of {@link GL11#glEnd End}.

+ * + * @param buf an integer that indicates the {@link GL11#GL_DRAW_BUFFER DRAW_BUFFER} to modify. + * @param src determines both RGB and alpha source functions + * @param dst determines both RGB and alpha destination functions + */ + public static native void glBlendFunciARB(@NativeType("GLuint") int buf, @NativeType("GLenum") int src, @NativeType("GLenum") int dst); + + // --- [ glBlendFuncSeparateiARB ] --- + + /** + * Provides a way to enable blending and set color write masks independently per color output. + * + *

This call modifies the blend functions associated with an individual draw buffer.

+ * + *

The error {@link GL11#GL_INVALID_ENUM INVALID_ENUM} is generated if the {@code buf} parameter is outside the range [0, {@link GL20#GL_MAX_DRAW_BUFFERS MAX_DRAW_BUFFERS} – 1].

+ * + *

The error {@link GL11#GL_INVALID_ENUM INVALID_ENUM} is generated if either {@code srcRGB}, {@code dstRGB}, {@code srcAlpha}, or {@code dstAlpha} is not an accepted value.

+ * + *

The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated if this method is executed between the execution of {@link GL11#glBegin Begin} and the corresponding execution + * of {@link GL11#glEnd End}.

+ * + * @param buf an integer that indicates the {@link GL11#GL_DRAW_BUFFER DRAW_BUFFER} to modify. + * @param srcRGB the source RGB blend function + * @param dstRGB the destination RGB blend function + * @param srcAlpha the source alpha blend function + * @param dstAlpha the destination alpha blend function + */ + public static native void glBlendFuncSeparateiARB(@NativeType("GLuint") int buf, @NativeType("GLenum") int srcRGB, @NativeType("GLenum") int dstRGB, @NativeType("GLenum") int srcAlpha, @NativeType("GLenum") int dstAlpha); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDrawElementsBaseVertex.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDrawElementsBaseVertex.java new file mode 100644 index 00000000..3ddba417 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDrawElementsBaseVertex.java @@ -0,0 +1,340 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_draw_elements_base_vertex extension. + * + *

This extension provides a method to specify a "base vertex offset" value which is effectively added to every vertex index that is transferred through + * {@link GL11C#glDrawElements DrawElements}.

+ * + *

This mechanism can be used to decouple a set of indices from the actual vertex array that it is referencing. This is useful if an application stores + * multiple indexed models in a single vertex array. The same index array can be used to draw the model no matter where it ends up in a larger vertex array + * simply by changing the base vertex value. Without this functionality, it would be necessary to rebind all the vertex attributes every time geometry is + * switched and this can have larger performance penalty.

+ * + *

For example consider the (very contrived and simple) example of drawing two triangles to form a quad. In the typical example you have the following + * setup:

+ * + *

+ *     vertices         indices
+ *    ----------        -----
+ * 0 | (-1,  1) |    0 |  0  |
+ * 1 | (-1, -1) |    1 |  1  |
+ * 2 | ( 1, -1) |    2 |  2  |
+ * 3 | ( 1,  1) |    3 |  3  |
+ *    ----------     4 |  0  |
+ *                   5 |  2  |
+ *                      -----
+ * + *

which is normally rendered with the call

+ * + *

+ * DrawElements(TRIANGLES, 6, UNSIGNED_BYTE, &indices).
+ * + *

Now consider the case where the vertices you want to draw are not at the start of a vertex array but are instead located at offset 100 into a larger + * array:

+ * + *

+ *      vertices2         indices2
+ *      ----------        -----
+ *         ....        0 | 100 |
+ * 100 | (-1,  1) |    1 | 101 |
+ * 101 | (-1, -1) |    2 | 102 |
+ * 102 | ( 1, -1) |    3 | 103 |
+ * 103 | ( 1,  1) |    4 | 100 |
+ *         ....        5 | 102 |
+ *      ----------        -----
+ * + *

The typical choices for rendering this are to rebind your vertex attributes with an additional offset of 100*stride, or to create an new array of + * indices (as indices2 in the example). However both rebinding vertex attributes and rebuilding index arrays can be quite costly activities.

+ * + *

With the new drawing commands introduced by this extension you can instead draw using vertices2 and the new draw call:

+ * + *

+ * DrawElementsBaseVertex(TRIANGLES, 6, UNSIGNED_BYTE, &indices, 100)
+ * + *

Promoted to core in {@link GL32 OpenGL 3.2}.

+ */ +public class ARBDrawElementsBaseVertex { + + static { GL.initialize(); } + + protected ARBDrawElementsBaseVertex() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glDrawElementsBaseVertex, caps.glDrawRangeElementsBaseVertex, caps.glDrawElementsInstancedBaseVertex, caps.glMultiDrawElementsBaseVertex + ); + } + + // --- [ glDrawElementsBaseVertex ] --- + + /** + * Unsafe version of: {@link #glDrawElementsBaseVertex DrawElementsBaseVertex} + * + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static void nglDrawElementsBaseVertex(int mode, int count, int type, long indices, int basevertex) { + GL32C.nglDrawElementsBaseVertex(mode, count, type, indices, basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + */ + public static void glDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices, @NativeType("GLint") int basevertex) { + GL32C.glDrawElementsBaseVertex(mode, count, type, indices, basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + */ + public static void glDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices, @NativeType("GLint") int basevertex) { + GL32C.glDrawElementsBaseVertex(mode, type, indices, basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + */ + public static void glDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indices, @NativeType("GLint") int basevertex) { + GL32C.glDrawElementsBaseVertex(mode, indices, basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + */ + public static void glDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("void const *") ShortBuffer indices, @NativeType("GLint") int basevertex) { + GL32C.glDrawElementsBaseVertex(mode, indices, basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + */ + public static void glDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indices, @NativeType("GLint") int basevertex) { + GL32C.glDrawElementsBaseVertex(mode, indices, basevertex); + } + + // --- [ glDrawRangeElementsBaseVertex ] --- + + /** + * Unsafe version of: {@link #glDrawRangeElementsBaseVertex DrawRangeElementsBaseVertex} + * + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static void nglDrawRangeElementsBaseVertex(int mode, int start, int end, int count, int type, long indices, int basevertex) { + GL32C.nglDrawRangeElementsBaseVertex(mode, start, end, count, type, indices, basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + */ + public static void glDrawRangeElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices, @NativeType("GLint") int basevertex) { + GL32C.glDrawRangeElementsBaseVertex(mode, start, end, count, type, indices, basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + */ + public static void glDrawRangeElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices, @NativeType("GLint") int basevertex) { + GL32C.glDrawRangeElementsBaseVertex(mode, start, end, type, indices, basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + */ + public static void glDrawRangeElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("void const *") ByteBuffer indices, @NativeType("GLint") int basevertex) { + GL32C.glDrawRangeElementsBaseVertex(mode, start, end, indices, basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + */ + public static void glDrawRangeElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("void const *") ShortBuffer indices, @NativeType("GLint") int basevertex) { + GL32C.glDrawRangeElementsBaseVertex(mode, start, end, indices, basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + */ + public static void glDrawRangeElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("void const *") IntBuffer indices, @NativeType("GLint") int basevertex) { + GL32C.glDrawRangeElementsBaseVertex(mode, start, end, indices, basevertex); + } + + // --- [ glDrawElementsInstancedBaseVertex ] --- + + /** + * Unsafe version of: {@link #glDrawElementsInstancedBaseVertex DrawElementsInstancedBaseVertex} + * + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static void nglDrawElementsInstancedBaseVertex(int mode, int count, int type, long indices, int primcount, int basevertex) { + GL32C.nglDrawElementsInstancedBaseVertex(mode, count, type, indices, primcount, basevertex); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays + */ + public static void glDrawElementsInstancedBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex) { + GL32C.glDrawElementsInstancedBaseVertex(mode, count, type, indices, primcount, basevertex); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays + */ + public static void glDrawElementsInstancedBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex) { + GL32C.glDrawElementsInstancedBaseVertex(mode, type, indices, primcount, basevertex); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays + */ + public static void glDrawElementsInstancedBaseVertex(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex) { + GL32C.glDrawElementsInstancedBaseVertex(mode, indices, primcount, basevertex); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays + */ + public static void glDrawElementsInstancedBaseVertex(@NativeType("GLenum") int mode, @NativeType("void const *") ShortBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex) { + GL32C.glDrawElementsInstancedBaseVertex(mode, indices, primcount, basevertex); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays + */ + public static void glDrawElementsInstancedBaseVertex(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex) { + GL32C.glDrawElementsInstancedBaseVertex(mode, indices, primcount, basevertex); + } + + // --- [ glMultiDrawElementsBaseVertex ] --- + + /** + * Unsafe version of: {@link #glMultiDrawElementsBaseVertex MultiDrawElementsBaseVertex} + * + * @param drawcount the size of the {@code count} array + */ + public static void nglMultiDrawElementsBaseVertex(int mode, long count, int type, long indices, int drawcount, long basevertex) { + GL32C.nglMultiDrawElementsBaseVertex(mode, count, type, indices, drawcount, basevertex); + } + + /** + * Renders multiple sets of primitives by specifying indices of array data elements and an offset to apply to each index. + * + *

LWJGL note: Use {@link org.lwjgl.system.MemoryUtil#memAddress} to retrieve pointers to the index buffers.

+ * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param count an array of the elements counts + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a pointer to the location where the base vertices are stored + */ + public static void glMultiDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLsizei const *") IntBuffer count, @NativeType("GLenum") int type, @NativeType("void const **") PointerBuffer indices, @NativeType("GLint *") IntBuffer basevertex) { + GL32C.glMultiDrawElementsBaseVertex(mode, count, type, indices, basevertex); + } + + /** Array version of: {@link #glMultiDrawElementsBaseVertex MultiDrawElementsBaseVertex} */ + public static void glMultiDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLsizei const *") int[] count, @NativeType("GLenum") int type, @NativeType("void const **") PointerBuffer indices, @NativeType("GLint *") int[] basevertex) { + GL32C.glMultiDrawElementsBaseVertex(mode, count, type, indices, basevertex); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDrawIndirect.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDrawIndirect.java new file mode 100644 index 00000000..438351fc --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDrawIndirect.java @@ -0,0 +1,279 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_draw_indirect extension. + * + *

This extension provides a mechanism for supplying the arguments to a + * DrawArraysInstanced or DrawElementsInstancedBaseVertex from buffer object + * memory. This is not particularly useful for applications where the CPU + * knows the values of the arguments beforehand, but is helpful when the + * values will be generated on the GPU through any mechanism that can write + * to a buffer object including image stores, atomic counters, or compute + * interop. This allows the GPU to consume these arguments without a round- + * trip to the CPU or the expensive synchronization that would involve. This + * is similar to the DrawTransformFeedbackEXT command from + * EXT_transform_feedback2, but offers much more flexibility in both + * generating the arguments and in the type of Draws that can be accomplished.

+ * + *

Requires {@link GL31 OpenGL 3.1}. Promoted to core in {@link GL40 OpenGL 4.0}.

+ */ +public class ARBDrawIndirect { + + /** + * Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferPointerv, + * MapBufferRange, FlushMappedBufferRange, GetBufferParameteriv, and CopyBufferSubData. + */ + public static final int GL_DRAW_INDIRECT_BUFFER = 0x8F3F; + + /** Accepted by the {@code value} parameter of GetIntegerv, GetBooleanv, GetFloatv, and GetDoublev. */ + public static final int GL_DRAW_INDIRECT_BUFFER_BINDING = 0x8F43; + + static { GL.initialize(); } + + protected ARBDrawIndirect() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glDrawArraysIndirect, caps.glDrawElementsIndirect + ); + } + + // --- [ glDrawArraysIndirect ] --- + + /** Unsafe version of: {@link #glDrawArraysIndirect DrawArraysIndirect} */ + public static void nglDrawArraysIndirect(int mode, long indirect) { + GL40C.nglDrawArraysIndirect(mode, indirect); + } + + /** + * Renders primitives from array data, taking parameters from memory. + * + *

{@code glDrawArraysIndirect} behaves similarly to {@link GL42C#glDrawArraysInstancedBaseInstance DrawArraysInstancedBaseInstance}, except that the parameters to + * glDrawArraysInstancedBaseInstance are stored in memory at the address given by {@code indirect}.

+ * + *

The parameters addressed by {@code indirect} are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint first;
+     *     uint baseInstance; // must be 0 unless OpenGL 4.2 is supported
+     * } DrawArraysIndirectCommand;
+     * 
+     * const DrawArraysIndirectCommand *cmd = (const DrawArraysIndirectCommand *)indirect;
+     * glDrawArraysInstancedBaseInstance(mode, cmd->first, cmd->count, cmd->primCount, cmd->baseInstance);
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40C#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect a structure containing the draw parameters + */ + public static void glDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indirect) { + GL40C.glDrawArraysIndirect(mode, indirect); + } + + /** + * Renders primitives from array data, taking parameters from memory. + * + *

{@code glDrawArraysIndirect} behaves similarly to {@link GL42C#glDrawArraysInstancedBaseInstance DrawArraysInstancedBaseInstance}, except that the parameters to + * glDrawArraysInstancedBaseInstance are stored in memory at the address given by {@code indirect}.

+ * + *

The parameters addressed by {@code indirect} are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint first;
+     *     uint baseInstance; // must be 0 unless OpenGL 4.2 is supported
+     * } DrawArraysIndirectCommand;
+     * 
+     * const DrawArraysIndirectCommand *cmd = (const DrawArraysIndirectCommand *)indirect;
+     * glDrawArraysInstancedBaseInstance(mode, cmd->first, cmd->count, cmd->primCount, cmd->baseInstance);
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40C#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect a structure containing the draw parameters + */ + public static void glDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") long indirect) { + GL40C.glDrawArraysIndirect(mode, indirect); + } + + /** + * Renders primitives from array data, taking parameters from memory. + * + *

{@code glDrawArraysIndirect} behaves similarly to {@link GL42C#glDrawArraysInstancedBaseInstance DrawArraysInstancedBaseInstance}, except that the parameters to + * glDrawArraysInstancedBaseInstance are stored in memory at the address given by {@code indirect}.

+ * + *

The parameters addressed by {@code indirect} are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint first;
+     *     uint baseInstance; // must be 0 unless OpenGL 4.2 is supported
+     * } DrawArraysIndirectCommand;
+     * 
+     * const DrawArraysIndirectCommand *cmd = (const DrawArraysIndirectCommand *)indirect;
+     * glDrawArraysInstancedBaseInstance(mode, cmd->first, cmd->count, cmd->primCount, cmd->baseInstance);
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40C#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect a structure containing the draw parameters + */ + public static void glDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indirect) { + GL40C.glDrawArraysIndirect(mode, indirect); + } + + // --- [ glDrawElementsIndirect ] --- + + /** Unsafe version of: {@link #glDrawElementsIndirect DrawElementsIndirect} */ + public static void nglDrawElementsIndirect(int mode, int type, long indirect) { + GL40C.nglDrawElementsIndirect(mode, type, indirect); + } + + /** + * Renders indexed primitives from array data, taking parameters from memory. + * + *

{@code glDrawElementsIndirect} behaves similarly to {@link GL42C#glDrawElementsInstancedBaseVertexBaseInstance DrawElementsInstancedBaseVertexBaseInstance}, execpt that the parameters to + * glDrawElementsInstancedBaseVertexBaseInstance are stored in memory at the address given by {@code indirect}.

+ * + *

The parameters addressed by {@code indirect} are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint firstIndex;
+     *     uint baseVertex;
+     *     uint baseInstance;
+     * } DrawElementsIndirectCommand;
+ * + *

{@code glDrawElementsIndirect} is equivalent to:

+ * + *

+     * void glDrawElementsIndirect(GLenum mode, GLenum type, const void *indirect) {
+     *     const DrawElementsIndirectCommand *cmd  = (const DrawElementsIndirectCommand *)indirect;
+     *     glDrawElementsInstancedBaseVertexBaseInstance(
+     *         mode,
+     *         cmd->count,
+     *         type,
+     *         cmd->firstIndex + size-of-type,
+     *         cmd->primCount,
+     *         cmd->baseVertex,
+     *         cmd->baseInstance
+     *     );
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40C#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the {@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER} binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect the address of a structure containing the draw parameters + */ + public static void glDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indirect) { + GL40C.glDrawElementsIndirect(mode, type, indirect); + } + + /** + * Renders indexed primitives from array data, taking parameters from memory. + * + *

{@code glDrawElementsIndirect} behaves similarly to {@link GL42C#glDrawElementsInstancedBaseVertexBaseInstance DrawElementsInstancedBaseVertexBaseInstance}, execpt that the parameters to + * glDrawElementsInstancedBaseVertexBaseInstance are stored in memory at the address given by {@code indirect}.

+ * + *

The parameters addressed by {@code indirect} are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint firstIndex;
+     *     uint baseVertex;
+     *     uint baseInstance;
+     * } DrawElementsIndirectCommand;
+ * + *

{@code glDrawElementsIndirect} is equivalent to:

+ * + *

+     * void glDrawElementsIndirect(GLenum mode, GLenum type, const void *indirect) {
+     *     const DrawElementsIndirectCommand *cmd  = (const DrawElementsIndirectCommand *)indirect;
+     *     glDrawElementsInstancedBaseVertexBaseInstance(
+     *         mode,
+     *         cmd->count,
+     *         type,
+     *         cmd->firstIndex + size-of-type,
+     *         cmd->primCount,
+     *         cmd->baseVertex,
+     *         cmd->baseInstance
+     *     );
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40C#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the {@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER} binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect the address of a structure containing the draw parameters + */ + public static void glDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") long indirect) { + GL40C.glDrawElementsIndirect(mode, type, indirect); + } + + /** + * Renders indexed primitives from array data, taking parameters from memory. + * + *

{@code glDrawElementsIndirect} behaves similarly to {@link GL42C#glDrawElementsInstancedBaseVertexBaseInstance DrawElementsInstancedBaseVertexBaseInstance}, execpt that the parameters to + * glDrawElementsInstancedBaseVertexBaseInstance are stored in memory at the address given by {@code indirect}.

+ * + *

The parameters addressed by {@code indirect} are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint firstIndex;
+     *     uint baseVertex;
+     *     uint baseInstance;
+     * } DrawElementsIndirectCommand;
+ * + *

{@code glDrawElementsIndirect} is equivalent to:

+ * + *

+     * void glDrawElementsIndirect(GLenum mode, GLenum type, const void *indirect) {
+     *     const DrawElementsIndirectCommand *cmd  = (const DrawElementsIndirectCommand *)indirect;
+     *     glDrawElementsInstancedBaseVertexBaseInstance(
+     *         mode,
+     *         cmd->count,
+     *         type,
+     *         cmd->firstIndex + size-of-type,
+     *         cmd->primCount,
+     *         cmd->baseVertex,
+     *         cmd->baseInstance
+     *     );
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40C#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the {@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER} binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect the address of a structure containing the draw parameters + */ + public static void glDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer indirect) { + GL40C.glDrawElementsIndirect(mode, type, indirect); + } + + /** Array version of: {@link #glDrawArraysIndirect DrawArraysIndirect} */ + public static void glDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") int[] indirect) { + GL40C.glDrawArraysIndirect(mode, indirect); + } + + /** Array version of: {@link #glDrawElementsIndirect DrawElementsIndirect} */ + public static void glDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") int[] indirect) { + GL40C.glDrawElementsIndirect(mode, type, indirect); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDrawInstanced.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDrawInstanced.java new file mode 100644 index 00000000..742bec54 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBDrawInstanced.java @@ -0,0 +1,127 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_draw_instanced extension. + * + *

A common use case in GL for some applications is to be able to draw the same object, or groups of similar objects that share vertex data, primitive + * count and type, multiple times. This extension provides a means of accelerating such use cases while restricting the number of API calls, and keeping + * the amount of duplicate data to a minimum.

+ * + *

This extension introduces two draw calls which are conceptually equivalent to a series of draw calls. Each conceptual call in this series is considered + * an "instance" of the actual draw call.

+ * + *

This extension also introduces a read-only built-in variable to GLSL which contains the "instance ID." This variable initially contains 0, but increases + * by one after each conceptual draw call.

+ * + *

By using the instance ID or multiples thereof as an index into a uniform array containing transform data, vertex shaders can draw multiple instances of + * an object with a single draw call.

+ * + *

Requires {@link GL30 OpenGL 3.0} or {@link EXTGPUShader4 EXT_gpu_shader4} or NV_vertex_program4. Promoted to core in {@link GL31 OpenGL 3.1}.

+ */ +public class ARBDrawInstanced { + + static { GL.initialize(); } + + protected ARBDrawInstanced() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glDrawArraysInstancedARB, caps.glDrawElementsInstancedARB + ); + } + + // --- [ glDrawArraysInstancedARB ] --- + + /** + * Draw multiple instances of a range of elements. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param first the starting index in the enabled arrays + * @param count the number of indices to be rendered + * @param primcount the number of instances of the specified range of indices to be rendered + */ + public static native void glDrawArraysInstancedARB(@NativeType("GLenum") int mode, @NativeType("GLint") int first, @NativeType("GLsizei") int count, @NativeType("GLsizei") int primcount); + + // --- [ glDrawElementsInstancedARB ] --- + + /** + * Unsafe version of: {@link #glDrawElementsInstancedARB DrawElementsInstancedARB} + * + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static native void nglDrawElementsInstancedARB(int mode, int count, int type, long indices, int primcount); + + /** + * Draws multiple instances of a set of elements. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the specified range of indices to be rendered + */ + public static void glDrawElementsInstancedARB(@NativeType("GLenum") int mode, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices, @NativeType("GLsizei") int primcount) { + nglDrawElementsInstancedARB(mode, count, type, indices, primcount); + } + + /** + * Draws multiple instances of a set of elements. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the specified range of indices to be rendered + */ + public static void glDrawElementsInstancedARB(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount) { + nglDrawElementsInstancedARB(mode, indices.remaining() >> GLChecks.typeToByteShift(type), type, memAddress(indices), primcount); + } + + /** + * Draws multiple instances of a set of elements. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the specified range of indices to be rendered + */ + public static void glDrawElementsInstancedARB(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount) { + nglDrawElementsInstancedARB(mode, indices.remaining(), GL11.GL_UNSIGNED_BYTE, memAddress(indices), primcount); + } + + /** + * Draws multiple instances of a set of elements. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the specified range of indices to be rendered + */ + public static void glDrawElementsInstancedARB(@NativeType("GLenum") int mode, @NativeType("void const *") ShortBuffer indices, @NativeType("GLsizei") int primcount) { + nglDrawElementsInstancedARB(mode, indices.remaining(), GL11.GL_UNSIGNED_SHORT, memAddress(indices), primcount); + } + + /** + * Draws multiple instances of a set of elements. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the specified range of indices to be rendered + */ + public static void glDrawElementsInstancedARB(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indices, @NativeType("GLsizei") int primcount) { + nglDrawElementsInstancedARB(mode, indices.remaining(), GL11.GL_UNSIGNED_INT, memAddress(indices), primcount); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBES2Compatibility.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBES2Compatibility.java new file mode 100644 index 00000000..dbf33651 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBES2Compatibility.java @@ -0,0 +1,156 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_ES2_compatibility extension. + * + *

This extension adds support for features of OpenGL ES 2.0 that are missing from OpenGL 3.x. Enabling these features will ease the process of porting + * applications from OpenGL ES 2.0 to OpenGL.

+ * + *

Promoted to core in {@link GL41 OpenGL 4.1}.

+ */ +public class ARBES2Compatibility { + + /** Accepted by the {@code value} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int + GL_SHADER_COMPILER = 0x8DFA, + GL_SHADER_BINARY_FORMATS = 0x8DF8, + GL_NUM_SHADER_BINARY_FORMATS = 0x8DF9, + GL_MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB, + GL_MAX_VARYING_VECTORS = 0x8DFC, + GL_MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD, + GL_IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A, + GL_IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B; + + /** Accepted by the {@code type} parameter of VertexAttribPointer. */ + public static final int GL_FIXED = 0x140C; + + /** Accepted by the {@code precisiontype} parameter of GetShaderPrecisionFormat. */ + public static final int + GL_LOW_FLOAT = 0x8DF0, + GL_MEDIUM_FLOAT = 0x8DF1, + GL_HIGH_FLOAT = 0x8DF2, + GL_LOW_INT = 0x8DF3, + GL_MEDIUM_INT = 0x8DF4, + GL_HIGH_INT = 0x8DF5; + + /** Accepted by the {@code format} parameter of most commands taking sized internal formats. */ + public static final int GL_RGB565 = 0x8D62; + + static { GL.initialize(); } + + protected ARBES2Compatibility() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glReleaseShaderCompiler, caps.glShaderBinary, caps.glGetShaderPrecisionFormat, caps.glDepthRangef, caps.glClearDepthf + ); + } + + // --- [ glReleaseShaderCompiler ] --- + + /** Releases resources allocated by the shader compiler. This is a hint from the application, and does not prevent later use of the shader compiler. */ + public static void glReleaseShaderCompiler() { + GL41C.glReleaseShaderCompiler(); + } + + // --- [ glShaderBinary ] --- + + /** + * Unsafe version of: {@link #glShaderBinary ShaderBinary} + * + * @param count the number of shader object handles contained in {@code shaders} + * @param length the length of the array whose address is given in binary + */ + public static void nglShaderBinary(int count, long shaders, int binaryformat, long binary, int length) { + GL41C.nglShaderBinary(count, shaders, binaryformat, binary, length); + } + + /** + * Loads pre-compiled shader binaries. + * + * @param shaders an array of shader handles into which to load pre-compiled shader binaries + * @param binaryformat the format of the shader binaries contained in {@code binary} + * @param binary an array of bytes containing pre-compiled binary shader code + */ + public static void glShaderBinary(@NativeType("GLuint const *") IntBuffer shaders, @NativeType("GLenum") int binaryformat, @NativeType("void const *") ByteBuffer binary) { + GL41C.glShaderBinary(shaders, binaryformat, binary); + } + + // --- [ glGetShaderPrecisionFormat ] --- + + /** Unsafe version of: {@link #glGetShaderPrecisionFormat GetShaderPrecisionFormat} */ + public static void nglGetShaderPrecisionFormat(int shadertype, int precisiontype, long range, long precision) { + GL41C.nglGetShaderPrecisionFormat(shadertype, precisiontype, range, precision); + } + + /** + * Retrieves the range and precision for numeric formats supported by the shader compiler. + * + * @param shadertype the type of shader whose precision to query. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}
+ * @param precisiontype the numeric format whose precision and range to query + * @param range the address of array of two integers into which encodings of the implementation's numeric range are returned + * @param precision the address of an integer into which the numeric precision of the implementation is written + */ + public static void glGetShaderPrecisionFormat(@NativeType("GLenum") int shadertype, @NativeType("GLenum") int precisiontype, @NativeType("GLint *") IntBuffer range, @NativeType("GLint *") IntBuffer precision) { + GL41C.glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision); + } + + /** + * Retrieves the range and precision for numeric formats supported by the shader compiler. + * + * @param shadertype the type of shader whose precision to query. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}
+ * @param precisiontype the numeric format whose precision and range to query + * @param range the address of array of two integers into which encodings of the implementation's numeric range are returned + */ + @NativeType("void") + public static int glGetShaderPrecisionFormat(@NativeType("GLenum") int shadertype, @NativeType("GLenum") int precisiontype, @NativeType("GLint *") IntBuffer range) { + return GL41C.glGetShaderPrecisionFormat(shadertype, precisiontype, range); + } + + // --- [ glDepthRangef ] --- + + /** + * Specifies mapping of depth values from normalized device coordinates to window coordinates + * + * @param zNear the mapping of the near clipping plane to window coordinates. The initial value is 0.0f. + * @param zFar the mapping of the far clipping plane to window coordinates. The initial value is 1.0f. + */ + public static void glDepthRangef(@NativeType("GLfloat") float zNear, @NativeType("GLfloat") float zFar) { + GL41C.glDepthRangef(zNear, zFar); + } + + // --- [ glClearDepthf ] --- + + /** + * Specifies the clear value for the depth buffer + * + * @param depth the depth value used when the depth buffer is cleared. The initial value is 1.0f. + */ + public static void glClearDepthf(@NativeType("GLfloat") float depth) { + GL41C.glClearDepthf(depth); + } + + /** Array version of: {@link #glShaderBinary ShaderBinary} */ + public static void glShaderBinary(@NativeType("GLuint const *") int[] shaders, @NativeType("GLenum") int binaryformat, @NativeType("void const *") ByteBuffer binary) { + GL41C.glShaderBinary(shaders, binaryformat, binary); + } + + /** Array version of: {@link #glGetShaderPrecisionFormat GetShaderPrecisionFormat} */ + public static void glGetShaderPrecisionFormat(@NativeType("GLenum") int shadertype, @NativeType("GLenum") int precisiontype, @NativeType("GLint *") int[] range, @NativeType("GLint *") int[] precision) { + GL41C.glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBES31Compatibility.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBES31Compatibility.java new file mode 100644 index 00000000..5e1867cc --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBES31Compatibility.java @@ -0,0 +1,76 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_ES3_1_compatibility extension. + * + *

This extension adds support for features of OpenGL ES 3.1 that are missing from OpenGL 4.4. Enabling these features will ease the process of porting + * applications from OpenGL ES 3.1 to OpenGL. Enabling these features will ease the process of porting applications from OpenGL ES 3.1 to OpenGL.

+ * + *

In particular this adds the following features:

+ * + *
    + *
  • a new {@link #glMemoryBarrierByRegion MemoryBarrierByRegion} API which is potentially more efficient for specific localized memory access patterns.
  • + *
  • increases the minimum required size of SSBOs to 2^27 (128 MB).
  • + *
  • support for GLSL ES version 310.
  • + *
  • a new GLSL built-in function, {@code imageAtomicExchange}, which performs atomic exchanges on {@code r32f} floating point images.
  • + *
  • a new GLSL built-in fragment shader input, {@code gl_HelperInvocation}, that identifies whether the current fragment shader input is a helper + * invocation. Fragment shader code can use this variable to skip performing operations that are useless or potentially dangerous for helper + * invocations.
  • + *
  • a new GLSL built-in constant for the maximum supported samples: {@code gl_MaxSamples}.
  • + *
  • a number of new GLSL built-in constants mirroring the API limits for image uniforms: {@code gl_Max * ImageUniforms}, + * {@code gl_MaxCombinedShaderOutputResources}.
  • + *
  • new GLSL built-in functions which extend {@code mix()} to select between int, uint, and bool components.
  • + *
  • add the "coherent" qualifier to all memory variables taken by the GLSL built-in {@code atomic*} and {@code imageAtomic*} functions.
  • + *
  • + *
  • + *
+ * + *

Requires {@link GL44 OpenGL 4.4}, {@link ARBES2Compatibility ARB_ES2_compatibility}, {@link ARBES3Compatibility ARB_ES3_compatibility}. Promoted to core in {@link GL45 OpenGL 4.5}.

+ */ +public class ARBES31Compatibility { + + static { GL.initialize(); } + + protected ARBES31Compatibility() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glMemoryBarrierByRegion + ); + } + + // --- [ glMemoryBarrierByRegion ] --- + + /** + * Behaves like {@link GL42C#glMemoryBarrier MemoryBarrier}, with two differences: + * + *

First, it narrows the region under consideration so that only reads/writes of prior fragment shaders that are invoked for a smaller region of the + * framebuffer will be completed/reflected prior to subsequent reads/write of following fragment shaders. The size of the region is implementation + * dependent and may be as small as one framebuffer pixel.

+ * + *

Second, it only applies to memory transactions that may be read by or written by a fragment shader.

+ * + *

When barriers is {@link GL42#GL_ALL_BARRIER_BITS ALL_BARRIER_BITS}, shader memory accesses will be synchronized relative to all these barrier bits, but not to other + * barrier bits specific to {@link GL42C#glMemoryBarrier MemoryBarrier}. This implies that reads/writes for scatter/gather-like algorithms may or may not be + * completed/reflected after a MemoryBarrierByRegion command. However, for uses such as deferred shading, where a linked list of visible + * surfaces with the head at a framebuffer address may be constructed, and the entirety of the list is only dependent on previous executions at that + * framebuffer address, MemoryBarrierByRegion may be significantly more efficient than {@link GL42C#glMemoryBarrier MemoryBarrier}.

+ * + * @param barriers the barriers to insert. One or more of:
{@link GL42#GL_ATOMIC_COUNTER_BARRIER_BIT ATOMIC_COUNTER_BARRIER_BIT}{@link GL42#GL_FRAMEBUFFER_BARRIER_BIT FRAMEBUFFER_BARRIER_BIT}{@link GL42#GL_SHADER_IMAGE_ACCESS_BARRIER_BIT SHADER_IMAGE_ACCESS_BARRIER_BIT}
{@link GL43#GL_SHADER_STORAGE_BARRIER_BIT SHADER_STORAGE_BARRIER_BIT}{@link GL42#GL_TEXTURE_FETCH_BARRIER_BIT TEXTURE_FETCH_BARRIER_BIT}{@link GL42#GL_UNIFORM_BARRIER_BIT UNIFORM_BARRIER_BIT}
+ */ + public static void glMemoryBarrierByRegion(@NativeType("GLbitfield") int barriers) { + GL45C.glMemoryBarrierByRegion(barriers); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBES32Compatibility.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBES32Compatibility.java new file mode 100644 index 00000000..c8fa55e2 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBES32Compatibility.java @@ -0,0 +1,71 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_ES3_2_compatibility extension. + * + *

This extension adds support for features of OpenGL ES 3.2 that are missing from OpenGL 4.5. Enabling these features will ease the process of porting + * applications from OpenGL ES 3.2 to OpenGL.

+ * + *

In particular this adds the following features:

+ * + *
    + *
  • Bounding box used to optimization tessellation processing (OES_primitive_bounding_box)
  • + *
  • query for {@link #GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB MULTISAMPLE_LINE_WIDTH_RANGE_ARB}
  • + *
  • support for the OpenGL ES 3.20 shading language
  • + *
+ * + *

For full OpenGL ES 3.2 compatibility the implementation must support {@link KHRBlendEquationAdvanced KHR_blend_equation_advanced} and {@link KHRTextureCompressionASTCLDR KHR_texture_compression_astc_ldr}. + * Those features are not defined in this extension spec since they are already defined at the KHR level.

+ * + *

Requires {@link GL45 OpenGL 4.5}, {@link ARBES2Compatibility ARB_ES2_compatibility}, {@link ARBES3Compatibility ARB_ES3_compatibility} and {@link ARBES31Compatibility ARB_ES3_1_compatibility}.

+ */ +public class ARBES32Compatibility { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetFloatv, GetIntegerv, and GetInteger64v. */ + public static final int + GL_PRIMITIVE_BOUNDING_BOX_ARB = 0x92BE, + GL_MULTISAMPLE_LINE_WIDTH_RANGE_ARB = 0x9381, + GL_MULTISAMPLE_LINE_WIDTH_GRANULARITY_ARB = 0x9382; + + static { GL.initialize(); } + + protected ARBES32Compatibility() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glPrimitiveBoundingBoxARB + ); + } + + // --- [ glPrimitiveBoundingBoxARB ] --- + + /** + * Specifies the primitive bounding box. + * + *

Implementations may be able to optimize performance if the application provides bounds of primitives that will be generated by the tessellation + * primitive generator or the geometry shader prior to executing those stages. If the provided bounds are incorrect and primitives extend beyond them, the + * rasterizer may or may not generate fragments for the portions of primitives outside the bounds.

+ * + * @param minX the minimum x clip space coordinate + * @param minY the minimum y clip space coordinate + * @param minZ the minimum z clip space coordinate + * @param minW the minimum w clip space coordinate + * @param maxX the maximum x clip space coordinate + * @param maxY the maximum y clip space coordinate + * @param maxZ the maximum z clip space coordinate + * @param maxW the maximum w clip space coordinate + */ + public static native void glPrimitiveBoundingBoxARB(@NativeType("GLfloat") float minX, @NativeType("GLfloat") float minY, @NativeType("GLfloat") float minZ, @NativeType("GLfloat") float minW, @NativeType("GLfloat") float maxX, @NativeType("GLfloat") float maxY, @NativeType("GLfloat") float maxZ, @NativeType("GLfloat") float maxW); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBES3Compatibility.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBES3Compatibility.java new file mode 100644 index 00000000..7be5cdb3 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBES3Compatibility.java @@ -0,0 +1,43 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_ES3_compatibility extension. + * + *

This extension adds support for features of OpenGL ES 3.0 that are missing from OpenGL 3.x. Enabling these features will ease the process of porting + * applications from OpenGL ES 3.0 to OpenGL. These features include conservative boolean occlusion queries, primitive restart with a fixed index, the + * OpenGL ES Shading Language 3.00 specification, and the dependencies stated below.

+ * + *

Requires {@link GL33 OpenGL 3.3}, {@link ARBES2Compatibility ARB_ES2_compatibility}, {@link ARBInvalidateSubdata ARB_invalidate_subdata} and {@link ARBTextureStorage ARB_texture_storage}. Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ +public final class ARBES3Compatibility { + + /** Accepted by the {@code internalformat} parameter of CompressedTexImage2D. */ + public static final int + GL_COMPRESSED_RGB8_ETC2 = 0x9274, + GL_COMPRESSED_SRGB8_ETC2 = 0x9275, + GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276, + GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277, + GL_COMPRESSED_RGBA8_ETC2_EAC = 0x9278, + GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279, + GL_COMPRESSED_R11_EAC = 0x9270, + GL_COMPRESSED_SIGNED_R11_EAC = 0x9271, + GL_COMPRESSED_RG11_EAC = 0x9272, + GL_COMPRESSED_SIGNED_RG11_EAC = 0x9273; + + /** Accepted by the {@code target} parameter of Enable and Disable. */ + public static final int GL_PRIMITIVE_RESTART_FIXED_INDEX = 0x8D69; + + /** Accepted by the {@code target} parameter of BeginQuery, EndQuery, GetQueryIndexediv and GetQueryiv. */ + public static final int GL_ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A; + + /** Accepted by the {@code value} parameter of the GetInteger functions. */ + public static final int GL_MAX_ELEMENT_INDEX = 0x8D6B; + + private ARBES3Compatibility() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBEnhancedLayouts.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBEnhancedLayouts.java new file mode 100644 index 00000000..299622ba --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBEnhancedLayouts.java @@ -0,0 +1,35 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_enhanced_layouts extension. + * + *

This extension adds the following functionality to layout qualifiers, including broadening the API where this functionality is reflected. The following + * are added:

+ * + *
    + *
  1. Use compile-time constant expressions.
  2. + *
  3. Specify explicit byte offsets within a uniform or shader storage block.
  4. + *
  5. Force alignment within a uniform or shader storage block.
  6. + *
  7. Specify component numbers to more fully utilize the vec4-slot interfaces between shader outputs and shader inputs.
  8. + *
  9. Specify transform/feedback buffers, locations, and widths.
  10. + *
  11. Allow locations on input and output blocks for SSO interface matching.
  12. + *
+ * + *

Requires {@link GL31 OpenGL 3.1} and GLSL 1.40. Promoted to core in {@link GL44 OpenGL 4.4}.

+ */ +public final class ARBEnhancedLayouts { + + /** Accepted in the {@code props} array of {@link GL43C#glGetProgramResourceiv GetProgramResourceiv}. */ + public static final int + GL_LOCATION_COMPONENT = 0x934A, + GL_TRANSFORM_FEEDBACK_BUFFER_INDEX = 0x934B, + GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE = 0x934C; + + private ARBEnhancedLayouts() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBExplicitUniformLocation.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBExplicitUniformLocation.java new file mode 100644 index 00000000..f6d92f75 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBExplicitUniformLocation.java @@ -0,0 +1,24 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_explicit_uniform_location extension. + * + *

This extension provides a method to pre-assign uniform locations to uniform variables in the default uniform block, including subroutine uniforms. This + * allows an application to modify the uniform values without requiring a GL query like {@link GL20C#glGetUniformLocation GetUniformLocation}, {@link GL40C#glGetSubroutineUniformLocation GetSubroutineUniformLocation} and + * {@link GL40C#glGetSubroutineIndex GetSubroutineIndex}.

+ * + *

Requires {@link GL33 OpenGL 3.3} or ARB_explicit_attrib_location. Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ +public final class ARBExplicitUniformLocation { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev, and GetInteger64v. */ + public static final int GL_MAX_UNIFORM_LOCATIONS = 0x826E; + + private ARBExplicitUniformLocation() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBFragmentProgram.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBFragmentProgram.java new file mode 100644 index 00000000..d3f02be7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBFragmentProgram.java @@ -0,0 +1,74 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_fragment_program extension. + * + *

Unextended OpenGL mandates a certain set of configurable per- fragment computations defining texture application, texture environment, color sum, and + * fog operations. Several extensions have added further per-fragment computations to OpenGL. For example, extensions have defined new texture environment + * capabilities (ARB_texture_env_add, {@link ARBTextureEnvCombine ARB_texture_env_combine}, {@link ARBTextureEnvDot3 ARB_texture_env_dot3}, ARB_texture_env_crossbar), per-fragment depth + * comparisons ({@link ARBDepthTexture ARB_depth_texture}, {@link ARBShadow ARB_shadow}, {@link ARBShadowAmbient ARB_shadow_ambient}, EXT_shadow_funcs), per-fragment lighting + * (EXT_fragment_lighting, EXT_light_texture), and environment mapped bump mapping + * (ATI_envmap_bumpmap).

+ * + *

Each such extension adds a small set of relatively inflexible per-fragment computations.

+ * + *

This inflexibility is in contrast to the typical flexibility provided by the underlying programmable floating point engines (whether micro-coded + * fragment engines, DSPs, or CPUs) that are traditionally used to implement OpenGL's texturing computations. The purpose of this extension is to expose to + * the OpenGL application writer a significant degree of per-fragment programmability for computing fragment parameters.

+ * + *

For the purposes of discussing this extension, a fragment program is a sequence of floating-point 4-component vector operations that determines how a + * set of program parameters (not specific to an individual fragment) and an input set of per-fragment parameters are transformed to a set of per-fragment + * result parameters.

+ * + *

The per-fragment computations for standard OpenGL given a particular set of texture and fog application modes (along with any state for extensions + * defining per-fragment computations) is, in essence, a fragment program. However, the sequence of operations is defined implicitly by the current OpenGL + * state settings rather than defined explicitly as a sequence of instructions.

+ * + *

This extension provides an explicit mechanism for defining fragment program instruction sequences for application-defined fragment programs. In order to + * define such fragment programs, this extension defines a fragment programming model including a floating-point 4-component vector instruction set and a + * relatively large set of floating-point 4-component registers.

+ * + *

The extension's fragment programming model is designed for efficient hardware implementation and to support a wide variety of fragment programs. By + * design, the entire set of existing fragment programs defined by existing OpenGL per-fragment computation extensions can be implemented using the + * extension's fragment programming model.

+ * + *

LWJGL: This extension defines many functions and tokens that are also defined in {@link ARBVertexProgram ARB_vertex_program}. Since these two extensions are often + * used together, the common functionality has only been exposed by {@link ARBVertexProgram ARB_vertex_program}, to avoid static import conflicts.

+ */ +public final class ARBFragmentProgram { + + /** + * Accepted by the {@code cap} parameter of Disable, Enable, and IsEnabled, by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev, and by the {@code target} parameter of ProgramStringARB, BindProgramARB, ProgramEnvParameter4[df][v]ARB, ProgramLocalParameter4[df][v]ARB, + * GetProgramEnvParameter[df]vARB, GetProgramLocalParameter[df]vARB, GetProgramivARB and GetProgramStringARB. + */ + public static final int GL_FRAGMENT_PROGRAM_ARB = 0x8804; + + /** Accepted by the {@code pname} parameter of GetProgramivARB. */ + public static final int + GL_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x8805, + GL_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x8806, + GL_PROGRAM_TEX_INDIRECTIONS_ARB = 0x8807, + GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x8808, + GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x8809, + GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x880A, + GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB = 0x880B, + GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB = 0x880C, + GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB = 0x880D, + GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB = 0x880E, + GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB = 0x880F, + GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB = 0x8810; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_TEXTURE_COORDS_ARB = 0x8871, + GL_MAX_TEXTURE_IMAGE_UNITS_ARB = 0x8872; + + private ARBFragmentProgram() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBFragmentShader.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBFragmentShader.java new file mode 100644 index 00000000..f9cc2f30 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBFragmentShader.java @@ -0,0 +1,32 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_fragment_shader extension. + * + *

This extension adds functionality to define fragment shader objects. A fragment shader object is a shader object (see the ARB_shader_objects extension) + * that, when attached to a program object, can be compiled and linked to produce an executable that runs on the fragment processor in OpenGL. The fragment + * processor is a programmable unit that replaces the OpenGL 1.4 fixed-function texturing, color sum and fog stages. This extension also defines how such + * an executable interacts with the fixed functionality fragment processing of OpenGL 1.4. The language is defined in the OpenGL Shading Language + * specification as the Fragment Shading Language.

+ * + *

Promoted to core in {@link GL20 OpenGL 2.0}.

+ */ +public final class ARBFragmentShader { + + /** Accepted by the {@code shaderType} argument of CreateShaderObjectARB and returned by the {@code params} parameter of GetObjectParameter{fi}vARB. */ + public static final int GL_FRAGMENT_SHADER_ARB = 0x8B30; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB = 0x8B49; + + /** Accepted by the {@code target} parameter of Hint and the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB = 0x8B8B; + + private ARBFragmentShader() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBFramebufferNoAttachments.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBFramebufferNoAttachments.java new file mode 100644 index 00000000..b6ec5fcb --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBFramebufferNoAttachments.java @@ -0,0 +1,185 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_framebuffer_no_attachments extension. + * + *

Framebuffer objects as introduced by {@link ARBFramebufferObject ARB_framebuffer_object} and OpenGL 3.0 provide a generalized mechanism for rendering to off-screen surfaces. + * Each framebuffer object may have depth, stencil and zero or more color attachments that can be written to by the GL. The size of the framebuffer (width, + * height, layer count, sample count) is derived from the attachments of that framebuffer. In unextended OpenGL 4.2, it is not legal to render into a + * framebuffer object that has no attachments. Such a framebuffer would be considered incomplete with the {@link GL30#GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT} + * status.

+ * + *

With OpenGL 4.2 and {@link ARBShaderImageLoadStore ARB_shader_image_load_store}, fragment shaders are capable of doing random access writes to buffer and texture memory via + * image loads, stores, and atomics. This ability enables algorithms using the conventional rasterizer to generate a collection of fragments, where each + * fragment shader invocation will write its outputs to buffer or texture memory using image stores or atomics. Such algorithms may have no need to write + * color or depth values to a conventional framebuffer. However, a framebuffer with no attachments will be considered incomplete and no rasterization or + * fragment shader exectuion will occur. To avoid such errors, an application may be required to create an otherwise unnecessary "dummy" texture and attach + * it to the framebuffer (possibly with color writes masked off). If the algorithm requires the rasterizer to operate over a large number of pixels, this + * dummy texture will needlessly consume a significant amount of memory.

+ * + *

This extension enables the algorithms described above to work even with a framebuffer with no attachments. Applications can specify default width, + * height, layer count, and sample count parameters for a framebuffer object. When a framebuffer with no attachments is bound, it will be considered + * complete as long as the application has specified non-zero default width and height parameters. For the purposes of rasterization, the framebuffer will + * be considered to have a width, height, layer count, and sample count derived from its default parameters. Framebuffers with one or more attachments are + * not affected by these default parameters; the size of the framebuffer will still be derived from the sizes of the attachments in that case.

+ * + *

Additionally, this extension provides queryable implementation-dependent maximums for framebuffer width, height, layer count, and sample count, which + * may differ from similar limits on textures and renderbuffers. These maximums will be used to error-check the default framebuffer parameters and also + * permit implementations to expose the ability to rasterize to an attachment-less framebuffer larger than the maximum supported texture size.

+ * + *

Requires {@link GL30 OpenGL 3.0} or {@link ARBFramebufferObject ARB_framebuffer_object}. Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ +public class ARBFramebufferNoAttachments { + + /** + * Accepted by the {@code pname} parameter of FramebufferParameteri, GetFramebufferParameteriv, NamedFramebufferParameteriEXT, and + * GetNamedFramebufferParameterivEXT. + */ + public static final int + GL_FRAMEBUFFER_DEFAULT_WIDTH = 0x9310, + GL_FRAMEBUFFER_DEFAULT_HEIGHT = 0x9311, + GL_FRAMEBUFFER_DEFAULT_LAYERS = 0x9312, + GL_FRAMEBUFFER_DEFAULT_SAMPLES = 0x9313, + GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS = 0x9314; + + /** Accepted by the {@code pname} parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_FRAMEBUFFER_WIDTH = 0x9315, + GL_MAX_FRAMEBUFFER_HEIGHT = 0x9316, + GL_MAX_FRAMEBUFFER_LAYERS = 0x9317, + GL_MAX_FRAMEBUFFER_SAMPLES = 0x9318; + + static { GL.initialize(); } + + protected ARBFramebufferNoAttachments() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glFramebufferParameteri, caps.glGetFramebufferParameteriv, + ext.contains("GL_EXT_direct_state_access") ? caps.glNamedFramebufferParameteriEXT : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glGetNamedFramebufferParameterivEXT : -1L + ); + } + + // --- [ glFramebufferParameteri ] --- + + /** + * Sets a named parameter of a framebuffer. + * + * @param target target of the operation. One of:
{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}
+ * @param pname a token indicating the parameter to be modified. One of:
{@link GL43C#GL_FRAMEBUFFER_DEFAULT_WIDTH FRAMEBUFFER_DEFAULT_WIDTH}{@link GL43C#GL_FRAMEBUFFER_DEFAULT_HEIGHT FRAMEBUFFER_DEFAULT_HEIGHT}
{@link GL43C#GL_FRAMEBUFFER_DEFAULT_LAYERS FRAMEBUFFER_DEFAULT_LAYERS}{@link GL43C#GL_FRAMEBUFFER_DEFAULT_SAMPLES FRAMEBUFFER_DEFAULT_SAMPLES}
{@link GL43C#GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS}
+ * @param param the new value for the parameter named {@code pname} + */ + public static void glFramebufferParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint") int param) { + GL43C.glFramebufferParameteri(target, pname, param); + } + + // --- [ glGetFramebufferParameteriv ] --- + + /** Unsafe version of: {@link #glGetFramebufferParameteriv GetFramebufferParameteriv} */ + public static void nglGetFramebufferParameteriv(int target, int pname, long params) { + GL43C.nglGetFramebufferParameteriv(target, pname, params); + } + + /** + * Retrieves a named parameter from a framebuffer. + * + * @param target target of the operation. One of:
{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}
+ * @param pname a token indicating the parameter to be retrieved. One of:
{@link GL43C#GL_FRAMEBUFFER_DEFAULT_WIDTH FRAMEBUFFER_DEFAULT_WIDTH}{@link GL43C#GL_FRAMEBUFFER_DEFAULT_HEIGHT FRAMEBUFFER_DEFAULT_HEIGHT}
{@link GL43C#GL_FRAMEBUFFER_DEFAULT_LAYERS FRAMEBUFFER_DEFAULT_LAYERS}{@link GL43C#GL_FRAMEBUFFER_DEFAULT_SAMPLES FRAMEBUFFER_DEFAULT_SAMPLES}
{@link GL43C#GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS}
+ * @param params a variable to receive the value of the parameter named {@code pname} + */ + public static void glGetFramebufferParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL43C.glGetFramebufferParameteriv(target, pname, params); + } + + /** + * Retrieves a named parameter from a framebuffer. + * + * @param target target of the operation. One of:
{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}
+ * @param pname a token indicating the parameter to be retrieved. One of:
{@link GL43C#GL_FRAMEBUFFER_DEFAULT_WIDTH FRAMEBUFFER_DEFAULT_WIDTH}{@link GL43C#GL_FRAMEBUFFER_DEFAULT_HEIGHT FRAMEBUFFER_DEFAULT_HEIGHT}
{@link GL43C#GL_FRAMEBUFFER_DEFAULT_LAYERS FRAMEBUFFER_DEFAULT_LAYERS}{@link GL43C#GL_FRAMEBUFFER_DEFAULT_SAMPLES FRAMEBUFFER_DEFAULT_SAMPLES}
{@link GL43C#GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS}
+ */ + @NativeType("void") + public static int glGetFramebufferParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + return GL43C.glGetFramebufferParameteri(target, pname); + } + + // --- [ glNamedFramebufferParameteriEXT ] --- + + /** + * DSA version of {@link #glFramebufferParameteri FramebufferParameteri}. + * + * @param framebuffer the framebuffer object + * @param pname a token indicating the parameter to be modified. One of:
{@link #GL_FRAMEBUFFER_DEFAULT_WIDTH FRAMEBUFFER_DEFAULT_WIDTH}{@link #GL_FRAMEBUFFER_DEFAULT_HEIGHT FRAMEBUFFER_DEFAULT_HEIGHT}
{@link #GL_FRAMEBUFFER_DEFAULT_LAYERS FRAMEBUFFER_DEFAULT_LAYERS}{@link #GL_FRAMEBUFFER_DEFAULT_SAMPLES FRAMEBUFFER_DEFAULT_SAMPLES}
{@link #GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS}
+ * @param param the new value for the parameter named {@code pname} + */ + public static native void glNamedFramebufferParameteriEXT(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int pname, @NativeType("GLint") int param); + + // --- [ glGetNamedFramebufferParameterivEXT ] --- + + /** Unsafe version of: {@link #glGetNamedFramebufferParameterivEXT GetNamedFramebufferParameterivEXT} */ + public static native void nglGetNamedFramebufferParameterivEXT(int framebuffer, int pname, long params); + + /** + * DSA version of {@link #glGetFramebufferParameteriv GetFramebufferParameteriv}. + * + * @param framebuffer the framebuffer object + * @param pname a token indicating the parameter to be retrieved. One of:
{@link #GL_FRAMEBUFFER_DEFAULT_WIDTH FRAMEBUFFER_DEFAULT_WIDTH}{@link #GL_FRAMEBUFFER_DEFAULT_HEIGHT FRAMEBUFFER_DEFAULT_HEIGHT}
{@link #GL_FRAMEBUFFER_DEFAULT_LAYERS FRAMEBUFFER_DEFAULT_LAYERS}{@link #GL_FRAMEBUFFER_DEFAULT_SAMPLES FRAMEBUFFER_DEFAULT_SAMPLES}
{@link #GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS}
+ * @param params a variable to receive the value of the parameter named {@code pname} + */ + public static void glGetNamedFramebufferParameterivEXT(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetNamedFramebufferParameterivEXT(framebuffer, pname, memAddress(params)); + } + + /** + * DSA version of {@link #glGetFramebufferParameteriv GetFramebufferParameteriv}. + * + * @param framebuffer the framebuffer object + * @param pname a token indicating the parameter to be retrieved. One of:
{@link #GL_FRAMEBUFFER_DEFAULT_WIDTH FRAMEBUFFER_DEFAULT_WIDTH}{@link #GL_FRAMEBUFFER_DEFAULT_HEIGHT FRAMEBUFFER_DEFAULT_HEIGHT}
{@link #GL_FRAMEBUFFER_DEFAULT_LAYERS FRAMEBUFFER_DEFAULT_LAYERS}{@link #GL_FRAMEBUFFER_DEFAULT_SAMPLES FRAMEBUFFER_DEFAULT_SAMPLES}
{@link #GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS}
+ */ + @NativeType("void") + public static int glGetNamedFramebufferParameteriEXT(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetNamedFramebufferParameterivEXT(framebuffer, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #glGetFramebufferParameteriv GetFramebufferParameteriv} */ + public static void glGetFramebufferParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL43C.glGetFramebufferParameteriv(target, pname, params); + } + + /** Array version of: {@link #glGetNamedFramebufferParameterivEXT GetNamedFramebufferParameterivEXT} */ + public static void glGetNamedFramebufferParameterivEXT(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetNamedFramebufferParameterivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(framebuffer, pname, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBFramebufferObject.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBFramebufferObject.java new file mode 100644 index 00000000..66c21495 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBFramebufferObject.java @@ -0,0 +1,731 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_framebuffer_object extension. + * + *

ARB_framebuffer_object is an extension intended to address the following goals:

+ * + *
    + *
  • Reflect FBO-related functionality found in the OpenGL 3.0 specification.
  • + *
  • Integrate multiple disjoint extensions into a single ARB extension. These extensions are: + * + *
      + *
    • {@link EXTFramebufferObject EXT_framebuffer_object}
    • + *
    • {@link EXTFramebufferBlit EXT_framebuffer_blit}
    • + *
    • {@link EXTFramebufferMultisample EXT_framebuffer_multisample}
    • + *
    • {@link EXTPackedDepthStencil EXT_packed_depth_stencil}
    • + *
  • + *
  • Where appropriate, relax some of the constraints expressed by previous FBO-related extensions. In particular the requirement of matching attachment + * dimensions and component sizes has been relaxed, to allow implementations the freedom to support more flexible usages where possible.
  • + *
+ * + *

ARB_framebuffer_object defines an interface for drawing to rendering destinations other than the buffers provided to the GL by the window-system.

+ * + *

In this extension, these newly defined rendering destinations are known collectively as "framebuffer-attachable images". This extension provides a + * mechanism for attaching framebuffer-attachable images to the GL framebuffer as one of the standard GL logical buffers: color, depth, and stencil. + * (Attaching a framebuffer-attachable image to the accum logical buffer is left for a future extension to define). When a framebuffer-attachable image is + * attached to the framebuffer, it is used as the source and destination of fragment operations as described in Chapter 4.

+ * + *

By allowing the use of a framebuffer-attachable image as a rendering destination, this extension enables a form of "offscreen" rendering. Furthermore, + * "render to texture" is supported by allowing the images of a texture to be used as framebuffer-attachable images. A particular image of a texture object + * is selected for use as a framebuffer-attachable image by specifying the mipmap level, cube map face (for a cube map texture), and layer (for a 3D + * texture) that identifies the image. The "render to texture" semantics of this extension are similar to performing traditional rendering to the + * framebuffer, followed immediately by a call to CopyTexSubImage. However, by using this extension instead, an application can achieve the same + * effect, but with the advantage that the GL can usually eliminate the data copy that would have been incurred by calling CopyTexSubImage.

+ * + *

This extension also defines a new GL object type, called a "renderbuffer", which encapsulates a single 2D pixel image. The image of renderbuffer can be + * used as a framebuffer-attachable image for generalized offscreen rendering and it also provides a means to support rendering to GL logical buffer types + * which have no corresponding texture format (stencil, accum, etc). A renderbuffer is similar to a texture in that both renderbuffers and textures can be + * independently allocated and shared among multiple contexts. The framework defined by this extension is general enough that support for attaching images + * from GL objects other than textures and renderbuffers could be added by layered extensions.

+ * + *

To facilitate efficient switching between collections of framebuffer-attachable images, this extension introduces another new GL object, called a + * framebuffer object. A framebuffer object contains the state that defines the traditional GL framebuffer, including its set of images. Prior to this + * extension, it was the window-system which defined and managed this collection of images, traditionally by grouping them into a "drawable". The + * window-system API's would also provide a function (i.e., {@link WGL#wglMakeCurrent}, {@link GLX#glXMakeCurrent}, aglSetDrawable, etc.) to bind a drawable with a GL + * context (as is done in the {@link WGLARBPbuffer WGL_ARB_pbuffer} extension). In this extension however, this functionality is subsumed by the GL and the GL provides + * the function BindFramebuffer to bind a framebuffer object to the current context. Later, the context can bind back to the window-system-provided + * framebuffer in order to display rendered content.

+ * + *

Previous extensions that enabled rendering to a texture have been much more complicated. One example is the combination of {@code ARB_pbuffer} and + * {@code ARB_render_texture}, both of which are window-system extensions. This combination requires calling {@code MakeCurrent}, an operation that may be + * expensive, to switch between the window and the pbuffer drawables. An application must create one pbuffer per renderable texture in order to portably + * use {@code ARB_render_texture}. An application must maintain at least one GL context per texture format, because each context can only operate on a + * single pixelformat or {@code FBConfig}. All of these characteristics make {@code ARB_render_texture} both inefficient and cumbersome to use.

+ * + *

ARB_framebuffer_object, on the other hand, is both simpler to use and more efficient than ARB_render_texture. The ARB_framebuffer_object API is + * contained wholly within the GL API and has no (non-portable) window-system components. Under ARB_framebuffer_object, it is not necessary to create a + * second GL context when rendering to a texture image whose format differs from that of the window. Finally, unlike the pbuffers of + * {@code ARB_render_texture}, a single framebuffer object can facilitate rendering to an unlimited number of texture objects.

+ * + *

This extension differs from EXT_framebuffer_object by splitting the framebuffer object binding point into separate DRAW and READ bindings (incorporating + * functionality introduced by EXT_framebuffer_blit). This allows copying directly from one framebuffer to another. In addition, a new high performance + * blit function is added to facilitate these blits and perform some data conversion where allowed.

+ * + *

This extension also enables usage of multisampling in conjunction with renderbuffers (incorporating functionality from EXT_packed_depth_stencil), as + * follows:

+ * + *

The new operation RenderbufferStorageMultisample() allocates storage for a renderbuffer object that can be used as a multisample buffer. A multisample + * render buffer image differs from a single-sample render buffer image in that a multisample image has a number of {@link GL13#GL_SAMPLES SAMPLES} that is greater than zero. + * No method is provided for creating multisample texture images.

+ * + *

All of the framebuffer-attachable images attached to a framebuffer object must have the same number of {@link GL13#GL_SAMPLES SAMPLES} or else the framebuffer object is + * not "framebuffer complete". If a framebuffer object with multisample attachments is "framebuffer complete", then the framebuffer object behaves as if + * {@link GL13#GL_SAMPLE_BUFFERS SAMPLE_BUFFERS} is one.

+ * + *

In traditional multisample rendering, where {@link #GL_DRAW_FRAMEBUFFER_BINDING DRAW_FRAMEBUFFER_BINDING} is zero and {@link GL13#GL_SAMPLE_BUFFERS SAMPLE_BUFFERS} is one, the GL spec states that "the color sample + * values are resolved to a single, displayable color each time a pixel is updated." There are, however, several modern hardware implementations that do + * not actually resolve for each sample update, but instead postpones the resolve operation to a later time and resolve a batch of sample updates at a + * time. This is OK as long as the implementation behaves "as if" it had resolved a sample-at-a-time. Unfortunately, however, honoring the "as if" rule can + * sometimes degrade performance.

+ * + *

In contrast, when {@link #GL_DRAW_FRAMEBUFFER_BINDING DRAW_FRAMEBUFFER_BINDING} is an application-created framebuffer object, {@link GL13#GL_MULTISAMPLE MULTISAMPLE} is enabled, and {@link GL13#GL_SAMPLE_BUFFERS SAMPLE_BUFFERS} is one, + * there is no implicit per-sample-update resolve. Instead, the application explicitly controls when the resolve operation is performed. The resolve + * operation is affected by calling BlitFramebuffer where the source is a multisample application-created framebuffer object and the destination is a + * single-sample framebuffer object (either application-created or window-system provided).

+ * + *

This design for multisample resolve more closely matches current hardware, but still permits implementations which choose to resolve a single sample at + * a time. If hardware that implements the multisample resolution "one sample at a time" exposes ARB_framebuffer_object, it could perform the implicit + * resolve to a driver-managed hidden surface, then read from that surface when the application calls BlitFramebuffer.

+ * + *

Another motivation for granting the application explicit control over the multisample resolve operation has to do with the flexibility afforded by + * ARB_framebuffer_object. Previously, a drawable (window or pbuffer) had exclusive access to all of its buffers. There was no mechanism for sharing a + * buffer across multiple drawables. Under ARB_framebuffer_object, however, a mechanism exists for sharing a framebuffer-attachable image across several + * framebuffer objects, as well as sharing an image between a framebuffer object and a texture. If we had retained the "implicit" resolve from traditional + * multisampled rendering, and allowed the creation of "multisample" format renderbuffers, then this type of sharing would have lead to two problematic + * situations:

+ * + *
    + *
  • Two contexts, which shared renderbuffers, might perform competing resolve operations into the same single-sample buffer with ambiguous results.
  • + *
  • It would have introduced the unfortunate ability to use the single-sample buffer as a texture while {@link GL13#GL_MULTISAMPLE MULTISAMPLE} is enabled.
  • + *
+ * + *

Using {@link #glBlitFramebuffer BlitFramebuffer} as an explicit resolve to serialize access to the multisampled contents and eliminate the implicit per-sample resolve operation, we avoid both of these problems.

+ * + *

This extension also enables usage of packed depth-stencil formats in renderbuffers (incorporating functionality from EXT_packed_depth_stencil), as + * follows:

+ * + *

Many OpenGL implementations have chosen to interleave the depth and stencil buffers into one buffer, often with 24 bits of depth precision and 8 bits of + * stencil data. 32 bits is more than is needed for the depth buffer much of the time; a 24-bit depth buffer, on the other hand, requires that reads and + * writes of depth data be unaligned with respect to power-of-two boundaries. On the other hand, 8 bits of stencil data is more than sufficient for most + * applications, so it is only natural to pack the two buffers into a single buffer with both depth and stencil data. OpenGL never provides direct access + * to the buffers, so the OpenGL implementation can provide an interface to applications where it appears the one merged buffer is composed of two logical buffers.

+ * + *

One disadvantage of this scheme is that OpenGL lacks any means by which this packed data can be handled efficiently. For example, when an application + * reads from the 24-bit depth buffer, using the type {@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT} will lose 8 bits of data, while {@link GL11#GL_UNSIGNED_INT UNSIGNED_INT} has 8 too many. Both require + * expensive format conversion operations. A 24-bit format would be no more suitable, because it would also suffer from the unaligned memory accesses that + * made the standalone 24-bit depth buffer an unattractive proposition in the first place.

+ * + *

Many applications, such as parallel rendering applications, may also wish to draw to or read back from both the depth and stencil buffers at the same + * time. Currently this requires two separate operations, reducing performance. Since the buffers are interleaved, drawing to or reading from both should + * be no more expensive than using just one; in some cases, it may even be cheaper.

+ * + *

This extension provides a new data format, {@link #GL_DEPTH_STENCIL DEPTH_STENCIL}, that can be used with the {@link GL11#glDrawPixels DrawPixels}, {@link GL11C#glReadPixels ReadPixels}, and {@link GL11#glCopyPixels CopyPixels} + * commands, as well as a packed data type, {@link #GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}, that is meant to be used with {@link #GL_DEPTH_STENCIL DEPTH_STENCIL}. No other data types are supported with + * {@link #GL_DEPTH_STENCIL DEPTH_STENCIL}. If {@link ARBDepthTexture ARB_depth_texture} or SGIX_depth_texture is supported, {@link #GL_DEPTH_STENCIL DEPTH_STENCIL}/{@link #GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8} data can also be used for textures; + * this provides a more efficient way to supply data for a 24-bit depth texture.

+ * + *

{@link #GL_DEPTH_STENCIL DEPTH_STENCIL} data, when passed through the pixel path, undergoes both depth and stencil operations. The depth data is scaled and biased by the current + * {@link GL11#GL_DEPTH_SCALE DEPTH_SCALE} and {@link GL11#GL_DEPTH_BIAS DEPTH_BIAS}, while the stencil data is shifted and offset by the current {@link GL11#GL_INDEX_SHIFT INDEX_SHIFT} and {@link GL11#GL_INDEX_OFFSET INDEX_OFFSET}. The stencil + * data is also put through the stencil-to-stencil pixel map.

+ * + *

{@link GL11#glDrawPixels DrawPixels} of {@link #GL_DEPTH_STENCIL DEPTH_STENCIL} data operates similarly to that of {@link GL11#GL_STENCIL_INDEX STENCIL_INDEX} data, bypassing the OpenGL fragment pipeline entirely, unlike + * the treatment of {@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT} data. The stencil and depth masks are applied, as are the pixel ownership and scissor tests, but all other + * operations are skipped.

+ * + *

{@link GL11C#glReadPixels ReadPixels} of {@link #GL_DEPTH_STENCIL DEPTH_STENCIL} data reads back a rectangle from both the depth and stencil buffers.

+ * + *

{@link GL11#glCopyPixels CopyPixels} of {@link #GL_DEPTH_STENCIL DEPTH_STENCIL} data copies a rectangle from both the depth and stencil buffers. Like glDrawPixels, it applies both the stencil and + * depth masks but skips the remainder of the OpenGL fragment pipeline.

+ * + *

glTex[Sub]Image[1,2,3]D of {@link #GL_DEPTH_STENCIL DEPTH_STENCIL} data loads depth and stencil data into a depth_stencil texture. {@link GL11C#glGetTexImage GetTexImage} of {@link #GL_DEPTH_STENCIL DEPTH_STENCIL} data can be + * used to retrieve depth and stencil data from a depth/stencil texture.

+ * + *

In addition, a new base internal format, {@link #GL_DEPTH_STENCIL DEPTH_STENCIL}, can be used by both texture images and renderbuffer storage. When an image with a + * {@link #GL_DEPTH_STENCIL DEPTH_STENCIL} internal format is attached to both the depth and stencil attachment points of a framebuffer object, then it becomes both the depth and + * stencil buffers of the framebuffer. This fits nicely with hardware that interleaves both depth and stencil data into a single buffer. When a texture + * with {@link #GL_DEPTH_STENCIL DEPTH_STENCIL} data is bound for texturing, only the depth component is accessible through the texture fetcher. The stencil data can be written + * with TexImage or CopyTexImage, and can be read with {@link GL11C#glGetTexImage GetTexImage}. When a {@link #GL_DEPTH_STENCIL DEPTH_STENCIL} image is attached to the stencil attachment of the bound + * framebuffer object, the stencil data can be accessed through any operation that reads from or writes to the framebuffer's stencil buffer.

+ * + *

Glossary of Helpful Terms

+ * + *
    + *
  • logical buffer – One of the color, depth, or stencil buffers of the framebuffer.
  • + *
  • framebuffer: The collection of logical buffers and associated state defining where the output of GL rendering is directed.
  • + *
  • texture: an object which consists of one or more 2D arrays of pixel images and associated state that can be used as a source of data during the texture-mapping process.
  • + *
  • texture image – one of the 2D arrays of pixels that are part of a texture object. Texture images contain and define the texels of the + * texture object.
  • + *
  • renderbuffer – A new type of storage object which contains a single 2D array of pixels and associated state that can be used as a + * destination for pixel data written during the rendering process.
  • + *
  • renderbuffer image – The 2D array of pixels that is part of a renderbuffer object. A renderbuffer image contains and defines the pixels + * of the renderbuffer object.
  • + *
  • framebuffer-attachable image – A 2D pixel image that can be attached to one of the logical buffer attachment points of a framebuffer + * object. Texture images and renderbuffer images are two examples of framebuffer-attachable images.
  • + *
  • attachment point – The set of state which references a specific framebuffer-attachable image, and allows that framebuffer-attachable + * image to be used to store the contents of a logical buffer of a framebuffer object. There is an attachment point state vector for each color, depth, + * and stencil buffer of a framebuffer.
  • + *
  • attach – The act of connecting one object to another object. + * + *

    An "attach" operation is similar to a "bind" operation in that both represent a reference to the attached or bound object for the purpose of + * managing object lifetimes and both enable manipulation of the state of the attached or bound object.

    + * + *

    However, an "attach" is also different from a "bind" in that "binding" an unused object creates a new object, while "attaching" does not. + * Additionally, "bind" establishes a connection between a context and an object, while "attach" establishes a connection between two objects.

    + * + *

    Finally, if object "A" is attached to object "B" and object "B" is bound to context "C", then in most respects, we treat "A" as if it is + * implicitly bound to "C".

  • + *
  • framebuffer attachment completeness – Similar to texture "mipmap" or "cube" completeness, defines a minimum set of criteria for + * framebuffer attachment points.
  • + *
  • framebuffer completeness – Similar to texture "mipmap cube completeness", defines a composite set of "completeness" requirements and + * relationships among the attached framebuffer-attachable images.
  • + *
+ * + *

Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ +public class ARBFramebufferObject { + + /** + * Accepted by the {@code target} parameter of BindFramebuffer, CheckFramebufferStatus, FramebufferTexture{1D|2D|3D}, FramebufferRenderbuffer, and + * GetFramebufferAttachmentParameteriv. + */ + public static final int + GL_FRAMEBUFFER = 0x8D40, + GL_READ_FRAMEBUFFER = 0x8CA8, + GL_DRAW_FRAMEBUFFER = 0x8CA9; + + /** + * Accepted by the {@code target} parameter of BindRenderbuffer, RenderbufferStorage, and GetRenderbufferParameteriv, and returned by + * GetFramebufferAttachmentParameteriv. + */ + public static final int GL_RENDERBUFFER = 0x8D41; + + /** Accepted by the {@code internalformat} parameter of RenderbufferStorage. */ + public static final int + GL_STENCIL_INDEX1 = 0x8D46, + GL_STENCIL_INDEX4 = 0x8D47, + GL_STENCIL_INDEX8 = 0x8D48, + GL_STENCIL_INDEX16 = 0x8D49; + + /** Accepted by the {@code pname} parameter of GetRenderbufferParameteriv. */ + public static final int + GL_RENDERBUFFER_WIDTH = 0x8D42, + GL_RENDERBUFFER_HEIGHT = 0x8D43, + GL_RENDERBUFFER_INTERNAL_FORMAT = 0x8D44, + GL_RENDERBUFFER_RED_SIZE = 0x8D50, + GL_RENDERBUFFER_GREEN_SIZE = 0x8D51, + GL_RENDERBUFFER_BLUE_SIZE = 0x8D52, + GL_RENDERBUFFER_ALPHA_SIZE = 0x8D53, + GL_RENDERBUFFER_DEPTH_SIZE = 0x8D54, + GL_RENDERBUFFER_STENCIL_SIZE = 0x8D55, + GL_RENDERBUFFER_SAMPLES = 0x8CAB; + + /** Accepted by the {@code pname} parameter of GetFramebufferAttachmentParameteriv. */ + public static final int + GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0, + GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1, + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2, + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3, + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4, + GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210, + GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211, + GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212, + GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213, + GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214, + GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215, + GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216, + GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217; + + /** Returned in {@code params} by GetFramebufferAttachmentParameteriv. */ + public static final int + GL_UNSIGNED_NORMALIZED = 0x8C17, + GL_FRAMEBUFFER_DEFAULT = 0x8218, + GL_INDEX = 0x8222; + + /** Accepted by the {@code attachment} parameter of FramebufferTexture{1D|2D|3D}, FramebufferRenderbuffer, and GetFramebufferAttachmentParameteriv. */ + public static final int + GL_COLOR_ATTACHMENT0 = 0x8CE0, + GL_COLOR_ATTACHMENT1 = 0x8CE1, + GL_COLOR_ATTACHMENT2 = 0x8CE2, + GL_COLOR_ATTACHMENT3 = 0x8CE3, + GL_COLOR_ATTACHMENT4 = 0x8CE4, + GL_COLOR_ATTACHMENT5 = 0x8CE5, + GL_COLOR_ATTACHMENT6 = 0x8CE6, + GL_COLOR_ATTACHMENT7 = 0x8CE7, + GL_COLOR_ATTACHMENT8 = 0x8CE8, + GL_COLOR_ATTACHMENT9 = 0x8CE9, + GL_COLOR_ATTACHMENT10 = 0x8CEA, + GL_COLOR_ATTACHMENT11 = 0x8CEB, + GL_COLOR_ATTACHMENT12 = 0x8CEC, + GL_COLOR_ATTACHMENT13 = 0x8CED, + GL_COLOR_ATTACHMENT14 = 0x8CEE, + GL_COLOR_ATTACHMENT15 = 0x8CEF, + GL_DEPTH_ATTACHMENT = 0x8D00, + GL_STENCIL_ATTACHMENT = 0x8D20, + GL_DEPTH_STENCIL_ATTACHMENT = 0x821A; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_MAX_SAMPLES = 0x8D57; + + /** Returned by CheckFramebufferStatus(). */ + public static final int + GL_FRAMEBUFFER_COMPLETE = 0x8CD5, + GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6, + GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7, + GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0x8CDB, + GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC, + GL_FRAMEBUFFER_UNSUPPORTED = 0x8CDD, + GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56, + GL_FRAMEBUFFER_UNDEFINED = 0x8219; + + /** Accepted by the {@code pname} parameters of GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_FRAMEBUFFER_BINDING = 0x8CA6, + GL_DRAW_FRAMEBUFFER_BINDING = 0x8CA6, + GL_READ_FRAMEBUFFER_BINDING = 0x8CAA, + GL_RENDERBUFFER_BINDING = 0x8CA7, + GL_MAX_COLOR_ATTACHMENTS = 0x8CDF, + GL_MAX_RENDERBUFFER_SIZE = 0x84E8; + + /** Returned by GetError(). */ + public static final int GL_INVALID_FRAMEBUFFER_OPERATION = 0x506; + + /** + * Accepted by the {@code format} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, and + * GetTexImage, by the {@code type} parameter of CopyPixels, by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, + * CopyTexImage2D, and RenderbufferStorage, and returned in the {@code data} parameter of GetTexLevelParameter and GetRenderbufferParameteriv. + */ + public static final int GL_DEPTH_STENCIL = 0x84F9; + + /** + * Accepted by the {@code type} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, and + * GetTexImage. + */ + public static final int GL_UNSIGNED_INT_24_8 = 0x84FA; + + /** + * Accepted by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and RenderbufferStorage, and + * returned in the {@code data} parameter of GetTexLevelParameter and GetRenderbufferParameteriv. + */ + public static final int GL_DEPTH24_STENCIL8 = 0x88F0; + + /** Accepted by the {@code value} parameter of GetTexLevelParameter. */ + public static final int GL_TEXTURE_STENCIL_SIZE = 0x88F1; + + static { GL.initialize(); } + + protected ARBFramebufferObject() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glIsRenderbuffer, caps.glBindRenderbuffer, caps.glDeleteRenderbuffers, caps.glGenRenderbuffers, caps.glRenderbufferStorage, + caps.glRenderbufferStorageMultisample, caps.glGetRenderbufferParameteriv, caps.glIsFramebuffer, caps.glBindFramebuffer, caps.glDeleteFramebuffers, + caps.glGenFramebuffers, caps.glCheckFramebufferStatus, caps.glFramebufferTexture1D, caps.glFramebufferTexture2D, caps.glFramebufferTexture3D, + caps.glFramebufferTextureLayer, caps.glFramebufferRenderbuffer, caps.glGetFramebufferAttachmentParameteriv, caps.glBlitFramebuffer, + caps.glGenerateMipmap + ); + } + + // --- [ glIsRenderbuffer ] --- + + /** + * Determines if a name corresponds to a renderbuffer object. + * + * @param renderbuffer a value that may be the name of a renderbuffer object + */ + @NativeType("GLboolean") + public static boolean glIsRenderbuffer(@NativeType("GLuint") int renderbuffer) { + return GL30C.glIsRenderbuffer(renderbuffer); + } + + // --- [ glBindRenderbuffer ] --- + + /** + * Binds a renderbuffer to a renderbuffer target. + * + * @param target the renderbuffer target of the binding operation. Must be:
{@link GL30C#GL_RENDERBUFFER RENDERBUFFER}
+ * @param renderbuffer the name of the renderbuffer object to bind + */ + public static void glBindRenderbuffer(@NativeType("GLenum") int target, @NativeType("GLuint") int renderbuffer) { + GL30C.glBindRenderbuffer(target, renderbuffer); + } + + // --- [ glDeleteRenderbuffers ] --- + + /** + * Unsafe version of: {@link #glDeleteRenderbuffers DeleteRenderbuffers} + * + * @param n the number of renderbuffer objects to be deleted + */ + public static void nglDeleteRenderbuffers(int n, long renderbuffers) { + GL30C.nglDeleteRenderbuffers(n, renderbuffers); + } + + /** + * Deletes renderbuffer objects. + * + * @param renderbuffers an array containing {@code n} renderbuffer objects to be deleted + */ + public static void glDeleteRenderbuffers(@NativeType("GLuint const *") IntBuffer renderbuffers) { + GL30C.glDeleteRenderbuffers(renderbuffers); + } + + /** Deletes renderbuffer objects. */ + public static void glDeleteRenderbuffers(@NativeType("GLuint const *") int renderbuffer) { + GL30C.glDeleteRenderbuffers(renderbuffer); + } + + // --- [ glGenRenderbuffers ] --- + + /** + * Unsafe version of: {@link #glGenRenderbuffers GenRenderbuffers} + * + * @param n the number of renderbuffer object names to generate + */ + public static void nglGenRenderbuffers(int n, long renderbuffers) { + GL30C.nglGenRenderbuffers(n, renderbuffers); + } + + /** + * Generates renderbuffer object names. + * + * @param renderbuffers a buffer in which the generated renderbuffer object names are stored + */ + public static void glGenRenderbuffers(@NativeType("GLuint *") IntBuffer renderbuffers) { + GL30C.glGenRenderbuffers(renderbuffers); + } + + /** Generates renderbuffer object names. */ + @NativeType("void") + public static int glGenRenderbuffers() { + return GL30C.glGenRenderbuffers(); + } + + // --- [ glRenderbufferStorage ] --- + + /** + * Establishes data storage, format and dimensions of a renderbuffer object's image. + * + * @param target the target of the allocation. Must be:
{@link GL30C#GL_RENDERBUFFER RENDERBUFFER}
+ * @param internalformat the internal format to use for the renderbuffer object's image. Must be a color-renderable, depth-renderable, or stencil-renderable format. + * @param width the width of the renderbuffer, in pixels + * @param height the height of the renderbuffer, in pixels + */ + public static void glRenderbufferStorage(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL30C.glRenderbufferStorage(target, internalformat, width, height); + } + + // --- [ glRenderbufferStorageMultisample ] --- + + /** + * Establishes data storage, format, dimensions and sample count of a renderbuffer object's image. + * + *

{@link #glRenderbufferStorage RenderbufferStorage} is equivalent to calling this method with the samples set to zero.

+ * + * @param target the target of the allocation. Must be:
{@link GL30C#GL_RENDERBUFFER RENDERBUFFER}
+ * @param samples the number of samples to be used for the renderbuffer object's storage + * @param internalformat the internal format to use for the renderbuffer object's image. Must be a color-renderable, depth-renderable, or stencil-renderable format. + * @param width the width of the renderbuffer, in pixels + * @param height the height of the renderbuffer, in pixels + */ + public static void glRenderbufferStorageMultisample(@NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL30C.glRenderbufferStorageMultisample(target, samples, internalformat, width, height); + } + + // --- [ glGetRenderbufferParameteriv ] --- + + /** Unsafe version of: {@link #glGetRenderbufferParameteriv GetRenderbufferParameteriv} */ + public static void nglGetRenderbufferParameteriv(int target, int pname, long params) { + GL30C.nglGetRenderbufferParameteriv(target, pname, params); + } + + /** + * Retrieves information about a bound renderbuffer object. + * + * @param target the target of the query operation. Must be:
{@link GL30C#GL_RENDERBUFFER RENDERBUFFER}
+ * @param pname the parameter whose value to retrieve from the renderbuffer bound to {@code target}. One of:
{@link GL30C#GL_RENDERBUFFER_WIDTH RENDERBUFFER_WIDTH}{@link GL30C#GL_RENDERBUFFER_HEIGHT RENDERBUFFER_HEIGHT}{@link GL30C#GL_RENDERBUFFER_INTERNAL_FORMAT RENDERBUFFER_INTERNAL_FORMAT}
{@link GL30C#GL_RENDERBUFFER_RED_SIZE RENDERBUFFER_RED_SIZE}{@link GL30C#GL_RENDERBUFFER_GREEN_SIZE RENDERBUFFER_GREEN_SIZE}{@link GL30C#GL_RENDERBUFFER_BLUE_SIZE RENDERBUFFER_BLUE_SIZE}
{@link GL30C#GL_RENDERBUFFER_ALPHA_SIZE RENDERBUFFER_ALPHA_SIZE}{@link GL30C#GL_RENDERBUFFER_DEPTH_SIZE RENDERBUFFER_DEPTH_SIZE}{@link GL30C#GL_RENDERBUFFER_STENCIL_SIZE RENDERBUFFER_STENCIL_SIZE}
{@link GL30C#GL_RENDERBUFFER_SAMPLES RENDERBUFFER_SAMPLES}
+ * @param params an array to receive the value of the queried parameter + */ + public static void glGetRenderbufferParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL30C.glGetRenderbufferParameteriv(target, pname, params); + } + + /** + * Retrieves information about a bound renderbuffer object. + * + * @param target the target of the query operation. Must be:
{@link GL30C#GL_RENDERBUFFER RENDERBUFFER}
+ * @param pname the parameter whose value to retrieve from the renderbuffer bound to {@code target}. One of:
{@link GL30C#GL_RENDERBUFFER_WIDTH RENDERBUFFER_WIDTH}{@link GL30C#GL_RENDERBUFFER_HEIGHT RENDERBUFFER_HEIGHT}{@link GL30C#GL_RENDERBUFFER_INTERNAL_FORMAT RENDERBUFFER_INTERNAL_FORMAT}
{@link GL30C#GL_RENDERBUFFER_RED_SIZE RENDERBUFFER_RED_SIZE}{@link GL30C#GL_RENDERBUFFER_GREEN_SIZE RENDERBUFFER_GREEN_SIZE}{@link GL30C#GL_RENDERBUFFER_BLUE_SIZE RENDERBUFFER_BLUE_SIZE}
{@link GL30C#GL_RENDERBUFFER_ALPHA_SIZE RENDERBUFFER_ALPHA_SIZE}{@link GL30C#GL_RENDERBUFFER_DEPTH_SIZE RENDERBUFFER_DEPTH_SIZE}{@link GL30C#GL_RENDERBUFFER_STENCIL_SIZE RENDERBUFFER_STENCIL_SIZE}
{@link GL30C#GL_RENDERBUFFER_SAMPLES RENDERBUFFER_SAMPLES}
+ */ + @NativeType("void") + public static int glGetRenderbufferParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + return GL30C.glGetRenderbufferParameteri(target, pname); + } + + // --- [ glIsFramebuffer ] --- + + /** + * Determines if a name corresponds to a framebuffer object. + * + * @param framebuffer a value that may be the name of a framebuffer object + */ + @NativeType("GLboolean") + public static boolean glIsFramebuffer(@NativeType("GLuint") int framebuffer) { + return GL30C.glIsFramebuffer(framebuffer); + } + + // --- [ glBindFramebuffer ] --- + + /** + * Binds a framebuffer to a framebuffer target. + * + * @param target the framebuffer target of the binding operation. One of:
{@link GL30C#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30C#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30C#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param framebuffer the name of the framebuffer object to bind + */ + public static void glBindFramebuffer(@NativeType("GLenum") int target, @NativeType("GLuint") int framebuffer) { + GL30C.glBindFramebuffer(target, framebuffer); + } + + // --- [ glDeleteFramebuffers ] --- + + /** + * Unsafe version of: {@link #glDeleteFramebuffers DeleteFramebuffers} + * + * @param n the number of framebuffer objects to be deleted + */ + public static void nglDeleteFramebuffers(int n, long framebuffers) { + GL30C.nglDeleteFramebuffers(n, framebuffers); + } + + /** + * Deletes framebuffer objects. + * + * @param framebuffers an array containing {@code n} framebuffer objects to be deleted + */ + public static void glDeleteFramebuffers(@NativeType("GLuint const *") IntBuffer framebuffers) { + GL30C.glDeleteFramebuffers(framebuffers); + } + + /** Deletes framebuffer objects. */ + public static void glDeleteFramebuffers(@NativeType("GLuint const *") int framebuffer) { + GL30C.glDeleteFramebuffers(framebuffer); + } + + // --- [ glGenFramebuffers ] --- + + /** + * Unsafe version of: {@link #glGenFramebuffers GenFramebuffers} + * + * @param n the number of framebuffer object names to generate + */ + public static void nglGenFramebuffers(int n, long framebuffers) { + GL30C.nglGenFramebuffers(n, framebuffers); + } + + /** + * Generates framebuffer object names. + * + * @param framebuffers a buffer in which the generated framebuffer object names are stored + */ + public static void glGenFramebuffers(@NativeType("GLuint *") IntBuffer framebuffers) { + GL30C.glGenFramebuffers(framebuffers); + } + + /** Generates framebuffer object names. */ + @NativeType("void") + public static int glGenFramebuffers() { + return GL30C.glGenFramebuffers(); + } + + // --- [ glCheckFramebufferStatus ] --- + + /** + * Checks the completeness status of a framebuffer. + * + * @param target the target of the framebuffer completeness check. One of:
{@link GL30C#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30C#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30C#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ */ + @NativeType("GLenum") + public static int glCheckFramebufferStatus(@NativeType("GLenum") int target) { + return GL30C.glCheckFramebufferStatus(target); + } + + // --- [ glFramebufferTexture1D ] --- + + /** + * Attaches a level of a 1D texture object as a logical buffer to the currently bound framebuffer object. + * + * @param target the framebuffer target. One of:
{@link GL30C#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30C#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30C#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment point of the framebuffer. One of:
{@link GL30C#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30C#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30C#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30C#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30C#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30C#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30C#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30C#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30C#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30C#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30C#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30C#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30C#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30C#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30C#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30C#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30C#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30C#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30C#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30C#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30C#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30C#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30C#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30C#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30C#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30C#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30C#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30C#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30C#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30C#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30C#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30C#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30C#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30C#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30C#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param textarget the type of texture + * @param texture the texture object to attach to the framebuffer attachment point named by {@code attachment} + * @param level the mipmap level of {@code texture} to attach + */ + public static void glFramebufferTexture1D(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int textarget, @NativeType("GLuint") int texture, @NativeType("GLint") int level) { + GL30C.glFramebufferTexture1D(target, attachment, textarget, texture, level); + } + + // --- [ glFramebufferTexture2D ] --- + + /** + * Attaches a level of a 2D texture object as a logical buffer to the currently bound framebuffer object. + * + * @param target the framebuffer target. One of:
{@link GL30C#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30C#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30C#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment point of the framebuffer. One of:
{@link GL30C#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30C#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30C#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30C#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30C#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30C#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30C#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30C#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30C#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30C#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30C#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30C#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30C#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30C#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30C#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30C#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30C#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30C#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30C#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30C#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30C#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30C#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30C#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30C#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30C#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30C#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30C#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30C#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30C#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30C#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30C#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30C#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30C#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30C#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30C#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param textarget the type of texture + * @param texture the texture object to attach to the framebuffer attachment point named by {@code attachment} + * @param level the mipmap level of {@code texture} to attach + */ + public static void glFramebufferTexture2D(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int textarget, @NativeType("GLuint") int texture, @NativeType("GLint") int level) { + GL30C.glFramebufferTexture2D(target, attachment, textarget, texture, level); + } + + // --- [ glFramebufferTexture3D ] --- + + /** + * Attaches a layer of a 3D texture object as a logical buffer to the currently bound framebuffer object. + * + * @param target the framebuffer target. One of:
{@link GL30C#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30C#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30C#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment point of the framebuffer. One of:
{@link GL30C#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30C#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30C#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30C#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30C#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30C#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30C#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30C#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30C#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30C#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30C#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30C#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30C#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30C#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30C#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30C#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30C#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30C#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30C#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30C#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30C#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30C#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30C#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30C#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30C#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30C#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30C#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30C#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30C#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30C#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30C#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30C#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30C#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30C#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30C#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param textarget the type of texture + * @param texture the texture object to attach to the framebuffer attachment point named by {@code attachment} + * @param level the mipmap level of {@code texture} to attach + * @param layer the layer of a 2-dimensional image within the 3-dimensional texture. + */ + public static void glFramebufferTexture3D(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int textarget, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int layer) { + GL30C.glFramebufferTexture3D(target, attachment, textarget, texture, level, layer); + } + + // --- [ glFramebufferTextureLayer ] --- + + /** + * Attaches a single layer of a texture to a framebuffer + * + * @param target the framebuffer target. One of:
{@link GL30C#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30C#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30C#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment point of the framebuffer. One of:
{@link GL30C#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30C#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30C#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30C#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30C#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30C#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30C#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30C#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30C#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30C#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30C#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30C#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30C#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30C#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30C#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30C#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30C#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30C#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30C#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30C#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30C#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30C#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30C#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30C#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30C#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30C#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30C#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30C#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30C#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30C#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30C#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30C#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30C#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30C#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30C#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param texture the texture object to attach to the framebuffer attachment point named by {@code attachment} + * @param level the mipmap level of {@code texture} to attach + * @param layer the layer of {@code texture} to attach. + */ + public static void glFramebufferTextureLayer(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int layer) { + GL30C.glFramebufferTextureLayer(target, attachment, texture, level, layer); + } + + // --- [ glFramebufferRenderbuffer ] --- + + /** + * Attaches a renderbuffer as a logical buffer to the currently bound framebuffer object. + * + * @param target the framebuffer target. One of:
{@link GL30C#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30C#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30C#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment point of the framebuffer. One of:
{@link GL30C#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30C#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30C#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30C#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30C#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30C#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30C#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30C#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30C#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30C#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30C#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30C#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30C#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30C#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30C#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30C#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30C#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30C#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30C#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30C#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30C#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30C#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30C#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30C#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30C#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30C#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30C#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30C#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30C#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30C#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30C#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30C#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30C#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30C#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30C#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param renderbuffertarget the renderbuffer target. Must be:
{@link GL30C#GL_RENDERBUFFER RENDERBUFFER}
+ * @param renderbuffer the name of an existing renderbuffer object of type {@code renderbuffertarget} to attach + */ + public static void glFramebufferRenderbuffer(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int renderbuffertarget, @NativeType("GLuint") int renderbuffer) { + GL30C.glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer); + } + + // --- [ glGetFramebufferAttachmentParameteriv ] --- + + /** Unsafe version of: {@link #glGetFramebufferAttachmentParameteriv GetFramebufferAttachmentParameteriv} */ + public static void nglGetFramebufferAttachmentParameteriv(int target, int attachment, int pname, long params) { + GL30C.nglGetFramebufferAttachmentParameteriv(target, attachment, pname, params); + } + + /** + * Retrievees information about attachments of a bound framebuffer object. + * + * @param target the target of the query operation. One of:
{@link GL30C#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30C#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30C#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment within {@code target}. One of:
{@link GL30C#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30C#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30C#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30C#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30C#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30C#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30C#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30C#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30C#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30C#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30C#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30C#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30C#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30C#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30C#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30C#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30C#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30C#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30C#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30C#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30C#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30C#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30C#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30C#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30C#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30C#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30C#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30C#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30C#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30C#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30C#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30C#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30C#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30C#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30C#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param pname the parameter of {@code attachment} to query. One of:
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME FRAMEBUFFER_ATTACHMENT_OBJECT_NAME}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE FRAMEBUFFER_ATTACHMENT_RED_SIZE}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE FRAMEBUFFER_ATTACHMENT_GREEN_SIZE}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE FRAMEBUFFER_ATTACHMENT_BLUE_SIZE}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE}
+ * @param params an array to receive the value of the queried parameter + */ + public static void glGetFramebufferAttachmentParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL30C.glGetFramebufferAttachmentParameteriv(target, attachment, pname, params); + } + + /** + * Retrievees information about attachments of a bound framebuffer object. + * + * @param target the target of the query operation. One of:
{@link GL30C#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30C#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30C#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment within {@code target}. One of:
{@link GL30C#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30C#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30C#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30C#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30C#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30C#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30C#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30C#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30C#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30C#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30C#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30C#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30C#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30C#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30C#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30C#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30C#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30C#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30C#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30C#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30C#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30C#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30C#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30C#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30C#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30C#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30C#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30C#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30C#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30C#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30C#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30C#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30C#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30C#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30C#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param pname the parameter of {@code attachment} to query. One of:
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME FRAMEBUFFER_ATTACHMENT_OBJECT_NAME}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE FRAMEBUFFER_ATTACHMENT_RED_SIZE}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE FRAMEBUFFER_ATTACHMENT_GREEN_SIZE}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE FRAMEBUFFER_ATTACHMENT_BLUE_SIZE}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE}
+ */ + @NativeType("void") + public static int glGetFramebufferAttachmentParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname) { + return GL30C.glGetFramebufferAttachmentParameteri(target, attachment, pname); + } + + // --- [ glBlitFramebuffer ] --- + + /** + * Copies a block of pixels from the read framebuffer to the draw framebuffer. + * + * @param srcX0 the lower-left coordinate of the source rectangle within the read buffer + * @param srcY0 the upper-left coordinate of the source rectangle within the read buffer + * @param srcX1 the lower-right coordinate of the source rectangle within the read buffer + * @param srcY1 the upper-right coordinate of the source rectangle within the read buffer + * @param dstX0 the lower-left coordinate of the destination rectangle within the write buffer + * @param dstY0 the upper-left coordinate of the destination rectangle within the write buffer + * @param dstX1 the lower-right coordinate of the destination rectangle within the write buffer + * @param dstY1 the upper-right coordinate of the destination rectangle within the write buffer + * @param mask the bitwise OR of the flags indicating which buffers are to be copied. One of:
{@link GL11#GL_COLOR_BUFFER_BIT COLOR_BUFFER_BIT}{@link GL11#GL_DEPTH_BUFFER_BIT DEPTH_BUFFER_BIT}{@link GL11#GL_STENCIL_BUFFER_BIT STENCIL_BUFFER_BIT}
+ * @param filter the interpolation to be applied if the image is stretched. One of:
{@link GL11#GL_NEAREST NEAREST}{@link GL11#GL_LINEAR LINEAR}
+ */ + public static void glBlitFramebuffer(@NativeType("GLint") int srcX0, @NativeType("GLint") int srcY0, @NativeType("GLint") int srcX1, @NativeType("GLint") int srcY1, @NativeType("GLint") int dstX0, @NativeType("GLint") int dstY0, @NativeType("GLint") int dstX1, @NativeType("GLint") int dstY1, @NativeType("GLbitfield") int mask, @NativeType("GLenum") int filter) { + GL30C.glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); + } + + // --- [ glGenerateMipmap ] --- + + /** + * Generate mipmaps for a specified texture target. + * + * @param target the target to which the texture whose mimaps to generate is bound. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30C#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL30C#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ */ + public static void glGenerateMipmap(@NativeType("GLenum") int target) { + GL30C.glGenerateMipmap(target); + } + + /** Array version of: {@link #glDeleteRenderbuffers DeleteRenderbuffers} */ + public static void glDeleteRenderbuffers(@NativeType("GLuint const *") int[] renderbuffers) { + GL30C.glDeleteRenderbuffers(renderbuffers); + } + + /** Array version of: {@link #glGenRenderbuffers GenRenderbuffers} */ + public static void glGenRenderbuffers(@NativeType("GLuint *") int[] renderbuffers) { + GL30C.glGenRenderbuffers(renderbuffers); + } + + /** Array version of: {@link #glGetRenderbufferParameteriv GetRenderbufferParameteriv} */ + public static void glGetRenderbufferParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL30C.glGetRenderbufferParameteriv(target, pname, params); + } + + /** Array version of: {@link #glDeleteFramebuffers DeleteFramebuffers} */ + public static void glDeleteFramebuffers(@NativeType("GLuint const *") int[] framebuffers) { + GL30C.glDeleteFramebuffers(framebuffers); + } + + /** Array version of: {@link #glGenFramebuffers GenFramebuffers} */ + public static void glGenFramebuffers(@NativeType("GLuint *") int[] framebuffers) { + GL30C.glGenFramebuffers(framebuffers); + } + + /** Array version of: {@link #glGetFramebufferAttachmentParameteriv GetFramebufferAttachmentParameteriv} */ + public static void glGetFramebufferAttachmentParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL30C.glGetFramebufferAttachmentParameteriv(target, attachment, pname, params); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBFramebufferSRGB.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBFramebufferSRGB.java new file mode 100644 index 00000000..3411719f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBFramebufferSRGB.java @@ -0,0 +1,39 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_framebuffer_sRGB extension. + * + *

Conventionally, OpenGL assumes framebuffer color components are stored in a linear color space. In particular, framebuffer blending is a linear + * operation.

+ * + *

The sRGB color space is based on typical (non-linear) monitor characteristics expected in a dimly lit office. It has been standardized by the + * International Electrotechnical Commission (IEC) as IEC 61966-2-1. The sRGB color space roughly corresponds to 2.2 gamma correction.

+ * + *

This extension adds a framebuffer capability for sRGB framebuffer update and blending. When blending is disabled but the new sRGB updated mode is + * enabled (assume the framebuffer supports the capability), high-precision linear color component values for red, green, and blue generated by fragment + * coloring are encoded for sRGB prior to being written into the framebuffer. When blending is enabled along with the new sRGB update mode, red, green, and + * blue framebuffer color components are treated as sRGB values that are converted to linear color values, blended with the high-precision color values + * generated by fragment coloring, and then the blend result is encoded for sRGB just prior to being written into the framebuffer.

+ * + *

The primary motivation for this extension is that it allows OpenGL applications to render into a framebuffer that is scanned to a monitor configured to + * assume framebuffer color values are sRGB encoded. This assumption is roughly true of most PC monitors with default gamma correction. This allows + * applications to achieve faithful color reproduction for OpenGL rendering without adjusting the monitor's gamma correction.

+ * + *

Requires {@link ARBFramebufferObject ARB_framebuffer_object}. Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ +public final class ARBFramebufferSRGB { + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_FRAMEBUFFER_SRGB = 0x8DB9; + + private ARBFramebufferSRGB() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGLSPIRV.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGLSPIRV.java new file mode 100644 index 00000000..33df2aff --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGLSPIRV.java @@ -0,0 +1,172 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_gl_spirv extension. + * + *

This is version 100 of the GL_ARB_gl_spirv extension.

+ * + *

This extension does two things:

+ * + *
    + *
  1. Allows a SPIR-V module to be specified as containing a programmable shader stage, rather than using GLSL, whatever the source language was used to + * create the SPIR-V module.
  2. + *
  3. Modifies GLSL to be a source language for creating SPIR-V modules for OpenGL consumption. Such GLSL can be used to create such SPIR-V modules, + * outside of the OpenGL runtime.
  4. + *
+ * + *

Requires {@link GL33 OpenGL 3.3}.

+ */ +public class ARBGLSPIRV { + + /** Accepted by the {@code binaryformat} parameter of {@link GL41C#glShaderBinary ShaderBinary}. */ + public static final int GL_SHADER_BINARY_FORMAT_SPIR_V_ARB = 0x9551; + + /** Accepted by the {@code pname} parameter of {@link GL20C#glGetShaderiv GetShaderiv}. */ + public static final int GL_SPIR_V_BINARY_ARB = 0x9552; + + static { GL.initialize(); } + + protected ARBGLSPIRV() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glSpecializeShaderARB + ); + } + + // --- [ glSpecializeShaderARB ] --- + + /** + * Unsafe version of: {@link #glSpecializeShaderARB SpecializeShaderARB} + * + * @param numSpecializationConstants the number of specialization constants whose values to set in this call + */ + public static native void nglSpecializeShaderARB(int shader, long pEntryPoint, int numSpecializationConstants, long pConstantIndex, long pConstantValue); + + /** + * Specializes a shader created from a SPIR-V module. + * + *

Shaders associated with SPIR-V modules must be specialized before they can be linked into a program object. It is not necessary to specialize the + * shader before it is attached to a program object. Once specialized, a shader may not be specialized again without first re-associating the original + * SPIR-V module with it, through {@link GL41C#glShaderBinary ShaderBinary}.

+ * + *

Specialization does two things:

+ * + *
    + *
  • Selects the name of the entry point, for that shader’s stage, from the SPIR-V module.
  • + *
  • Sets the values of all, or a subset of, the specialization constants in the SPIRV module.
  • + *
+ * + *

On successful shader specialization, the compile status for shader is set to {@link GL11#GL_TRUE TRUE}. On failure, the compile status for shader is set to {@link GL11#GL_FALSE FALSE} and + * additional information about the cause of the failure may be available in the shader compilation log.

+ * + * @param shader the name of a shader object containing unspecialized SPIR-V as created from a successful call to {@link GL41C#glShaderBinary ShaderBinary} to which a SPIR-V module was + * passed + * @param pEntryPoint a pointer to a null-terminated UTF-8 string specifying the name of the entry point in the SPIR-V module to use for this shader + * @param pConstantIndex is a pointer to an array of {@code numSpecializationConstants} unsigned integers, each holding the index of a specialization constant in the SPIR-V + * module whose value to set. + * + *

Specialization constants not referenced by {@code pConstantIndex} retain their default values as specified in the SPIR-V module.

+ * @param pConstantValue an entry in {@code pConstantValue} is used to set the value of the specialization constant indexed by the corresponding entry in + * {@code pConstantIndex}. + * + *

Although this array is of unsigned integer, each entry is bitcast to the appropriate type for the module, and therefore, floating-point constants + * may be set by including their IEEE-754 bit representation in the {@code pConstantValue} array.

+ */ + public static void glSpecializeShaderARB(@NativeType("GLuint") int shader, @NativeType("GLchar const *") ByteBuffer pEntryPoint, @NativeType("GLuint const *") IntBuffer pConstantIndex, @NativeType("GLuint const *") IntBuffer pConstantValue) { + if (CHECKS) { + checkNT1(pEntryPoint); + check(pConstantValue, pConstantIndex.remaining()); + } + nglSpecializeShaderARB(shader, memAddress(pEntryPoint), pConstantIndex.remaining(), memAddress(pConstantIndex), memAddress(pConstantValue)); + } + + /** + * Specializes a shader created from a SPIR-V module. + * + *

Shaders associated with SPIR-V modules must be specialized before they can be linked into a program object. It is not necessary to specialize the + * shader before it is attached to a program object. Once specialized, a shader may not be specialized again without first re-associating the original + * SPIR-V module with it, through {@link GL41C#glShaderBinary ShaderBinary}.

+ * + *

Specialization does two things:

+ * + *
    + *
  • Selects the name of the entry point, for that shader’s stage, from the SPIR-V module.
  • + *
  • Sets the values of all, or a subset of, the specialization constants in the SPIRV module.
  • + *
+ * + *

On successful shader specialization, the compile status for shader is set to {@link GL11#GL_TRUE TRUE}. On failure, the compile status for shader is set to {@link GL11#GL_FALSE FALSE} and + * additional information about the cause of the failure may be available in the shader compilation log.

+ * + * @param shader the name of a shader object containing unspecialized SPIR-V as created from a successful call to {@link GL41C#glShaderBinary ShaderBinary} to which a SPIR-V module was + * passed + * @param pEntryPoint a pointer to a null-terminated UTF-8 string specifying the name of the entry point in the SPIR-V module to use for this shader + * @param pConstantIndex is a pointer to an array of {@code numSpecializationConstants} unsigned integers, each holding the index of a specialization constant in the SPIR-V + * module whose value to set. + * + *

Specialization constants not referenced by {@code pConstantIndex} retain their default values as specified in the SPIR-V module.

+ * @param pConstantValue an entry in {@code pConstantValue} is used to set the value of the specialization constant indexed by the corresponding entry in + * {@code pConstantIndex}. + * + *

Although this array is of unsigned integer, each entry is bitcast to the appropriate type for the module, and therefore, floating-point constants + * may be set by including their IEEE-754 bit representation in the {@code pConstantValue} array.

+ */ + public static void glSpecializeShaderARB(@NativeType("GLuint") int shader, @NativeType("GLchar const *") CharSequence pEntryPoint, @NativeType("GLuint const *") IntBuffer pConstantIndex, @NativeType("GLuint const *") IntBuffer pConstantValue) { + if (CHECKS) { + check(pConstantValue, pConstantIndex.remaining()); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(pEntryPoint, true); + long pEntryPointEncoded = stack.getPointerAddress(); + nglSpecializeShaderARB(shader, pEntryPointEncoded, pConstantIndex.remaining(), memAddress(pConstantIndex), memAddress(pConstantValue)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #glSpecializeShaderARB SpecializeShaderARB} */ + public static void glSpecializeShaderARB(@NativeType("GLuint") int shader, @NativeType("GLchar const *") ByteBuffer pEntryPoint, @NativeType("GLuint const *") int[] pConstantIndex, @NativeType("GLuint const *") int[] pConstantValue) { + long __functionAddress = GL.getICD().glSpecializeShaderARB; + if (CHECKS) { + check(__functionAddress); + checkNT1(pEntryPoint); + check(pConstantValue, pConstantIndex.length); + } + callPPPV(shader, memAddress(pEntryPoint), pConstantIndex.length, pConstantIndex, pConstantValue, __functionAddress); + } + + /** Array version of: {@link #glSpecializeShaderARB SpecializeShaderARB} */ + public static void glSpecializeShaderARB(@NativeType("GLuint") int shader, @NativeType("GLchar const *") CharSequence pEntryPoint, @NativeType("GLuint const *") int[] pConstantIndex, @NativeType("GLuint const *") int[] pConstantValue) { + long __functionAddress = GL.getICD().glSpecializeShaderARB; + if (CHECKS) { + check(__functionAddress); + check(pConstantValue, pConstantIndex.length); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(pEntryPoint, true); + long pEntryPointEncoded = stack.getPointerAddress(); + callPPPV(shader, pEntryPointEncoded, pConstantIndex.length, pConstantIndex, pConstantValue, __functionAddress); + } finally { + stack.setPointer(stackPointer); + } + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGPUShader5.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGPUShader5.java new file mode 100644 index 00000000..94f98606 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGPUShader5.java @@ -0,0 +1,78 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_gpu_shader5 extension. + * + *

This extension provides a set of new features to the OpenGL Shading Language and related APIs to support capabilities of new GPUs, extending the + * capabilities of version 1.50 of the OpenGL Shading Language. Shaders using the new functionality provided by this extension should enable this + * functionality via the construct:

+ * + *

+ * #extension GL_ARB_gpu_shader5 : require     (or enable)
+ * + *

This extension provides a variety of new features for all shader types, including:

+ * + *
    + *
  • support for indexing into arrays of samplers using non-constant indices, as long as the index doesn't diverge if multiple shader invocations are run + * in lockstep;
  • + *
  • extending the uniform block capability of OpenGL 3.1 and 3.2 to allow shaders to index into an array of uniform blocks;
  • + *
  • support for implicitly converting signed integer types to unsigned types, as well as more general implicit conversion and function overloading + * infrastructure to support new data types introduced by other extensions;
  • + *
  • a "precise" qualifier allowing computations to be carried out exactly as specified in the shader source to avoid optimization-induced invariance + * issues (which might cause cracking in tessellation);
  • + *
  • new built-in functions supporting: + * + *
      + *
    • fused floating-point multiply-add operations;
    • + *
    • splitting a floating-point number into a significand and exponent (frexp), or building a floating-point number from a significand and exponent + * (ldexp);
    • + *
    • integer bitfield manipulation, including functions to find the position of the most or least significant set bit, count the number of one bits, + * and bitfield insertion, extraction, and reversal;
    • + *
    • packing and unpacking vectors of small fixed-point data types into a larger scalar; and
    • + *
    • convert floating-point values to or from their integer bit encodings;
    • + *
  • + *
  • extending the textureGather() built-in functions provided by {@link ARBTextureGather ARB_texture_gather}: + * + *
      + *
    • allowing shaders to select any single component of a multi-component texture to produce the gathered 2x2 footprint;
    • + *
    • allowing shaders to perform a per-sample depth comparison when gathering the 2x2 footprint using for shadow sampler types;
    • + *
    • allowing shaders to use arbitrary offsets computed at run-time to select a 2x2 footprint to gather from; and
    • + *
    • allowing shaders to use separate independent offsets for each of the four texels returned, instead of requiring a fixed 2x2 footprint.
    • + *
  • + *
+ * + *

This extension also provides some new capabilities for individual shader types, including:

+ * + *
    + *
  • support for instanced geometry shaders, where a geometry shader may be run multiple times for each primitive, including a built-in + * {@code gl_InvocationID} to identify the invocation number;
  • + *
  • support for emitting vertices in a geometry program where each vertex emitted may be directed independently at a specified vertex stream (as + * provided by ARB_transform_feedback3), and where each shader output is associated with a stream;
  • + *
  • support for reading a mask of covered samples in a fragment shader; and
  • + *
  • support for interpolating a fragment shader input at a programmable offset relative to the pixel center, a programmable sample number, or at the + * centroid.
  • + *
+ * + *

Requires {@link GL32 GL32} and GLSL 1.50. Promoted to core in {@link GL40 OpenGL 4.0}.

+ */ +public final class ARBGPUShader5 { + + /** Accepted by the {@code pname} parameter of GetProgramiv. */ + public static final int GL_GEOMETRY_SHADER_INVOCATIONS = 0x887F; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev, and GetInteger64v. */ + public static final int + GL_MAX_GEOMETRY_SHADER_INVOCATIONS = 0x8E5A, + GL_MIN_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5B, + GL_MAX_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5C, + GL_FRAGMENT_INTERPOLATION_OFFSET_BITS = 0x8E5D, + GL_MAX_VERTEX_STREAMS = 0x8E71; + + private ARBGPUShader5() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGPUShaderFP64.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGPUShaderFP64.java new file mode 100644 index 00000000..204b1fe2 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGPUShaderFP64.java @@ -0,0 +1,957 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_gpu_shader_fp64 extension. + * + *

This extension allows GLSL shaders to use double-precision floating-point data types, including vectors and matrices of doubles. Doubles may be used as + * inputs, outputs, and uniforms.

+ * + *

The shading language supports various arithmetic and comparison operators on double-precision scalar, vector, and matrix types, and provides a set of + * built-in functions including:

+ * + *
    + *
  • square roots and inverse square roots;
  • + *
  • fused floating-point multiply-add operations;
  • + *
  • splitting a floating-point number into a significand and exponent (frexp), or building a floating-point number from a significand and exponent + * (ldexp);
  • + *
  • absolute value, sign tests, various functions to round to an integer value, modulus, minimum, maximum, clamping, blending two values, step + * functions, and testing for infinity and NaN values;
  • + *
  • packing and unpacking doubles into a pair of 32-bit unsigned integers;
  • + *
  • matrix component-wise multiplication, and computation of outer products, transposes, determinants, and inverses; and
  • + *
  • vector relational functions.
  • + *
+ * + *

Double-precision versions of angle, trigonometry, and exponential functions are not supported.

+ * + *

Implicit conversions are supported from integer and single-precision floating-point values to doubles, and this extension uses the relaxed function + * overloading rules specified by the ARB_gpu_shader5 extension to resolve ambiguities.

+ * + *

This extension provides API functions for specifying double-precision uniforms in the default uniform block, including functions similar to the uniform + * functions added by {@link EXTDirectStateAccess EXT_direct_state_access} (if supported).

+ * + *

This extension provides an "LF" suffix for specifying double-precision constants. Floating-point constants without a suffix in GLSL are treated as + * single-precision values for backward compatibility with versions not supporting doubles; similar constants are treated as double-precision values in the + * "C" programming language.

+ * + *

This extension does not support interpolation of double-precision values; doubles used as fragment shader inputs must be qualified as "flat". + * Additionally, this extension does not allow vertex attributes with 64-bit components. That support is added separately by + * EXT_vertex_attrib_64bit.

+ * + *

Requires {@link GL32 GL32} and GLSL 1.50. Promoted to core in {@link GL40 OpenGL 4.0}.

+ */ +public class ARBGPUShaderFP64 { + + /** Returned in the {@code type} parameter of GetActiveUniform, and GetTransformFeedbackVarying. */ + public static final int + GL_DOUBLE_VEC2 = 0x8FFC, + GL_DOUBLE_VEC3 = 0x8FFD, + GL_DOUBLE_VEC4 = 0x8FFE, + GL_DOUBLE_MAT2 = 0x8F46, + GL_DOUBLE_MAT3 = 0x8F47, + GL_DOUBLE_MAT4 = 0x8F48, + GL_DOUBLE_MAT2x3 = 0x8F49, + GL_DOUBLE_MAT2x4 = 0x8F4A, + GL_DOUBLE_MAT3x2 = 0x8F4B, + GL_DOUBLE_MAT3x4 = 0x8F4C, + GL_DOUBLE_MAT4x2 = 0x8F4D, + GL_DOUBLE_MAT4x3 = 0x8F4E; + + static { GL.initialize(); } + + protected ARBGPUShaderFP64() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glUniform1d, caps.glUniform2d, caps.glUniform3d, caps.glUniform4d, caps.glUniform1dv, caps.glUniform2dv, caps.glUniform3dv, caps.glUniform4dv, + caps.glUniformMatrix2dv, caps.glUniformMatrix3dv, caps.glUniformMatrix4dv, caps.glUniformMatrix2x3dv, caps.glUniformMatrix2x4dv, + caps.glUniformMatrix3x2dv, caps.glUniformMatrix3x4dv, caps.glUniformMatrix4x2dv, caps.glUniformMatrix4x3dv, caps.glGetUniformdv + ); + } + + // --- [ glUniform1d ] --- + + /** + * Specifies the value of a double uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + */ + public static void glUniform1d(@NativeType("GLint") int location, @NativeType("GLdouble") double x) { + GL40C.glUniform1d(location, x); + } + + // --- [ glUniform2d ] --- + + /** + * Specifies the value of a dvec2 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + */ + public static void glUniform2d(@NativeType("GLint") int location, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y) { + GL40C.glUniform2d(location, x, y); + } + + // --- [ glUniform3d ] --- + + /** + * Specifies the value of a dvec3 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + */ + public static void glUniform3d(@NativeType("GLint") int location, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z) { + GL40C.glUniform3d(location, x, y, z); + } + + // --- [ glUniform4d ] --- + + /** + * Specifies the value of a dvec4 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * @param w the uniform w value + */ + public static void glUniform4d(@NativeType("GLint") int location, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z, @NativeType("GLdouble") double w) { + GL40C.glUniform4d(location, x, y, z, w); + } + + // --- [ glUniform1dv ] --- + + /** + * Unsafe version of: {@link #glUniform1dv Uniform1dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglUniform1dv(int location, int count, long value) { + GL40C.nglUniform1dv(location, count, value); + } + + /** + * Specifies the value of a single double uniform variable or a double uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glUniform1dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniform1dv(location, value); + } + + // --- [ glUniform2dv ] --- + + /** + * Unsafe version of: {@link #glUniform2dv Uniform2dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglUniform2dv(int location, int count, long value) { + GL40C.nglUniform2dv(location, count, value); + } + + /** + * Specifies the value of a single dvec2 uniform variable or a dvec2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glUniform2dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniform2dv(location, value); + } + + // --- [ glUniform3dv ] --- + + /** + * Unsafe version of: {@link #glUniform3dv Uniform3dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglUniform3dv(int location, int count, long value) { + GL40C.nglUniform3dv(location, count, value); + } + + /** + * Specifies the value of a single dvec3 uniform variable or a dvec3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glUniform3dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniform3dv(location, value); + } + + // --- [ glUniform4dv ] --- + + /** + * Unsafe version of: {@link #glUniform4dv Uniform4dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglUniform4dv(int location, int count, long value) { + GL40C.nglUniform4dv(location, count, value); + } + + /** + * Specifies the value of a single dvec4 uniform variable or a dvec4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glUniform4dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniform4dv(location, value); + } + + // --- [ glUniformMatrix2dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix2dv UniformMatrix2dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix2dv(int location, int count, boolean transpose, long value) { + GL40C.nglUniformMatrix2dv(location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat2 uniform variable or a dmat2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glUniformMatrix2dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniformMatrix2dv(location, transpose, value); + } + + // --- [ glUniformMatrix3dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix3dv UniformMatrix3dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix3dv(int location, int count, boolean transpose, long value) { + GL40C.nglUniformMatrix3dv(location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat3 uniform variable or a dmat3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glUniformMatrix3dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniformMatrix3dv(location, transpose, value); + } + + // --- [ glUniformMatrix4dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix4dv UniformMatrix4dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix4dv(int location, int count, boolean transpose, long value) { + GL40C.nglUniformMatrix4dv(location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat4 uniform variable or a dmat4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glUniformMatrix4dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniformMatrix4dv(location, transpose, value); + } + + // --- [ glUniformMatrix2x3dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix2x3dv UniformMatrix2x3dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix2x3dv(int location, int count, boolean transpose, long value) { + GL40C.nglUniformMatrix2x3dv(location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat2x3 uniform variable or a dmat2x3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glUniformMatrix2x3dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniformMatrix2x3dv(location, transpose, value); + } + + // --- [ glUniformMatrix2x4dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix2x4dv UniformMatrix2x4dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix2x4dv(int location, int count, boolean transpose, long value) { + GL40C.nglUniformMatrix2x4dv(location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat2x4 uniform variable or a dmat2x4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glUniformMatrix2x4dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniformMatrix2x4dv(location, transpose, value); + } + + // --- [ glUniformMatrix3x2dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix3x2dv UniformMatrix3x2dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix3x2dv(int location, int count, boolean transpose, long value) { + GL40C.nglUniformMatrix3x2dv(location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat3x2 uniform variable or a dmat3x2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glUniformMatrix3x2dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniformMatrix3x2dv(location, transpose, value); + } + + // --- [ glUniformMatrix3x4dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix3x4dv UniformMatrix3x4dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix3x4dv(int location, int count, boolean transpose, long value) { + GL40C.nglUniformMatrix3x4dv(location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat3x4 uniform variable or a dmat3x4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glUniformMatrix3x4dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniformMatrix3x4dv(location, transpose, value); + } + + // --- [ glUniformMatrix4x2dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix4x2dv UniformMatrix4x2dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix4x2dv(int location, int count, boolean transpose, long value) { + GL40C.nglUniformMatrix4x2dv(location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat4x2 uniform variable or a dmat4x2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glUniformMatrix4x2dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniformMatrix4x2dv(location, transpose, value); + } + + // --- [ glUniformMatrix4x3dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix4x3dv UniformMatrix4x3dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix4x3dv(int location, int count, boolean transpose, long value) { + GL40C.nglUniformMatrix4x3dv(location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat4x3 uniform variable or a dmat4x3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glUniformMatrix4x3dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniformMatrix4x3dv(location, transpose, value); + } + + // --- [ glGetUniformdv ] --- + + /** Unsafe version of: {@link #glGetUniformdv GetUniformdv} */ + public static void nglGetUniformdv(int program, int location, long params) { + GL40C.nglGetUniformdv(program, location, params); + } + + /** + * Returns the double value(s) of a uniform variable. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * @param params the value of the specified uniform variable + */ + public static void glGetUniformdv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble *") DoubleBuffer params) { + GL40C.glGetUniformdv(program, location, params); + } + + /** + * Returns the double value(s) of a uniform variable. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + */ + @NativeType("void") + public static double glGetUniformd(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + return GL40C.glGetUniformd(program, location); + } + + // --- [ glProgramUniform1dEXT ] --- + + /** + * DSA version of {@link #glUniform1d Uniform1d}. + * + * @param program the program object to update + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + */ + public static native void glProgramUniform1dEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble") double x); + + // --- [ glProgramUniform2dEXT ] --- + + /** + * DSA version of {@link #glUniform2d Uniform2d}. + * + * @param program the program object to update + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + */ + public static native void glProgramUniform2dEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y); + + // --- [ glProgramUniform3dEXT ] --- + + /** + * DSA version of {@link #glUniform3d Uniform3d}. + * + * @param program the program object to update + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + */ + public static native void glProgramUniform3dEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z); + + // --- [ glProgramUniform4dEXT ] --- + + /** + * DSA version of {@link #glUniform4d Uniform4d}. + * + * @param program the program object to update + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * @param w the uniform w value + */ + public static native void glProgramUniform4dEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z, @NativeType("GLdouble") double w); + + // --- [ glProgramUniform1dvEXT ] --- + + /** + * Unsafe version of: {@link #glProgramUniform1dvEXT ProgramUniform1dvEXT} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform1dvEXT(int program, int location, int count, long value); + + /** + * DSA version of {@link #glUniform1dv Uniform1dv}. + * + * @param program the program object to update + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glProgramUniform1dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniform1dvEXT(program, location, value.remaining(), memAddress(value)); + } + + // --- [ glProgramUniform2dvEXT ] --- + + /** + * Unsafe version of: {@link #glProgramUniform2dvEXT ProgramUniform2dvEXT} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform2dvEXT(int program, int location, int count, long value); + + /** + * DSA version of {@link #glUniform2dv Uniform2dv}. + * + * @param program the program object to update + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glProgramUniform2dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniform2dvEXT(program, location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glProgramUniform3dvEXT ] --- + + /** + * Unsafe version of: {@link #glProgramUniform3dvEXT ProgramUniform3dvEXT} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform3dvEXT(int program, int location, int count, long value); + + /** + * DSA version of {@link #glUniform3dv Uniform3dv}. + * + * @param program the program object to update + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glProgramUniform3dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniform3dvEXT(program, location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glProgramUniform4dvEXT ] --- + + /** + * Unsafe version of: {@link #glProgramUniform4dvEXT ProgramUniform4dvEXT} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform4dvEXT(int program, int location, int count, long value); + + /** + * DSA version of {@link #glUniform4dv Uniform4dv}. + * + * @param program the program object to update + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glProgramUniform4dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniform4dvEXT(program, location, value.remaining() >> 2, memAddress(value)); + } + + // --- [ glProgramUniformMatrix2dvEXT ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix2dvEXT ProgramUniformMatrix2dvEXT} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix2dvEXT(int program, int location, int count, boolean transpose, long value); + + /** + * DSA version of {@link #glUniformMatrix2dv UniformMatrix2dv}. + * + * @param program the program object to update + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix2dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniformMatrix2dvEXT(program, location, value.remaining() >> 2, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix3dvEXT ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix3dvEXT ProgramUniformMatrix3dvEXT} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix3dvEXT(int program, int location, int count, boolean transpose, long value); + + /** + * DSA version of {@link #glUniformMatrix3dv UniformMatrix3dv}. + * + * @param program the program object to update + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix3dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniformMatrix3dvEXT(program, location, value.remaining() / 9, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix4dvEXT ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix4dvEXT ProgramUniformMatrix4dvEXT} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix4dvEXT(int program, int location, int count, boolean transpose, long value); + + /** + * DSA version of {@link #glUniformMatrix4dv UniformMatrix4dv}. + * + * @param program the program object to update + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix4dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniformMatrix4dvEXT(program, location, value.remaining() >> 4, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix2x3dvEXT ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix2x3dvEXT ProgramUniformMatrix2x3dvEXT} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix2x3dvEXT(int program, int location, int count, boolean transpose, long value); + + /** + * DSA version of {@link #glUniformMatrix2x3dv UniformMatrix2x3dv}. + * + * @param program the program object to update + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix2x3dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniformMatrix2x3dvEXT(program, location, value.remaining() / 6, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix2x4dvEXT ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix2x4dvEXT ProgramUniformMatrix2x4dvEXT} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix2x4dvEXT(int program, int location, int count, boolean transpose, long value); + + /** + * DSA version of {@link #glUniformMatrix2x4dv UniformMatrix2x4dv}. + * + * @param program the program object to update + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix2x4dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniformMatrix2x4dvEXT(program, location, value.remaining() >> 3, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix3x2dvEXT ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix3x2dvEXT ProgramUniformMatrix3x2dvEXT} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix3x2dvEXT(int program, int location, int count, boolean transpose, long value); + + /** + * DSA version of {@link #glUniformMatrix3x2dv UniformMatrix3x2dv}. + * + * @param program the program object to update + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix3x2dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniformMatrix3x2dvEXT(program, location, value.remaining() / 6, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix3x4dvEXT ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix3x4dvEXT ProgramUniformMatrix3x4dvEXT} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix3x4dvEXT(int program, int location, int count, boolean transpose, long value); + + /** + * DSA version of {@link #glUniformMatrix3x4dv UniformMatrix3x4dv}. + * + * @param program the program object to update + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix3x4dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniformMatrix3x4dvEXT(program, location, value.remaining() / 12, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix4x2dvEXT ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix4x2dvEXT ProgramUniformMatrix4x2dvEXT} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix4x2dvEXT(int program, int location, int count, boolean transpose, long value); + + /** + * DSA version of {@link #glUniformMatrix4x2dv UniformMatrix4x2dv}. + * + * @param program the program object to update + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix4x2dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniformMatrix4x2dvEXT(program, location, value.remaining() >> 3, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix4x3dvEXT ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix4x3dvEXT ProgramUniformMatrix4x3dvEXT} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix4x3dvEXT(int program, int location, int count, boolean transpose, long value); + + /** + * DSA version of {@link #glUniformMatrix4x3dv UniformMatrix4x3dv}. + * + * @param program the program object to update + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix4x3dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniformMatrix4x3dvEXT(program, location, value.remaining() / 12, transpose, memAddress(value)); + } + + /** Array version of: {@link #glUniform1dv Uniform1dv} */ + public static void glUniform1dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniform1dv(location, value); + } + + /** Array version of: {@link #glUniform2dv Uniform2dv} */ + public static void glUniform2dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniform2dv(location, value); + } + + /** Array version of: {@link #glUniform3dv Uniform3dv} */ + public static void glUniform3dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniform3dv(location, value); + } + + /** Array version of: {@link #glUniform4dv Uniform4dv} */ + public static void glUniform4dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniform4dv(location, value); + } + + /** Array version of: {@link #glUniformMatrix2dv UniformMatrix2dv} */ + public static void glUniformMatrix2dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniformMatrix2dv(location, transpose, value); + } + + /** Array version of: {@link #glUniformMatrix3dv UniformMatrix3dv} */ + public static void glUniformMatrix3dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniformMatrix3dv(location, transpose, value); + } + + /** Array version of: {@link #glUniformMatrix4dv UniformMatrix4dv} */ + public static void glUniformMatrix4dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniformMatrix4dv(location, transpose, value); + } + + /** Array version of: {@link #glUniformMatrix2x3dv UniformMatrix2x3dv} */ + public static void glUniformMatrix2x3dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniformMatrix2x3dv(location, transpose, value); + } + + /** Array version of: {@link #glUniformMatrix2x4dv UniformMatrix2x4dv} */ + public static void glUniformMatrix2x4dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniformMatrix2x4dv(location, transpose, value); + } + + /** Array version of: {@link #glUniformMatrix3x2dv UniformMatrix3x2dv} */ + public static void glUniformMatrix3x2dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniformMatrix3x2dv(location, transpose, value); + } + + /** Array version of: {@link #glUniformMatrix3x4dv UniformMatrix3x4dv} */ + public static void glUniformMatrix3x4dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniformMatrix3x4dv(location, transpose, value); + } + + /** Array version of: {@link #glUniformMatrix4x2dv UniformMatrix4x2dv} */ + public static void glUniformMatrix4x2dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniformMatrix4x2dv(location, transpose, value); + } + + /** Array version of: {@link #glUniformMatrix4x3dv UniformMatrix4x3dv} */ + public static void glUniformMatrix4x3dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniformMatrix4x3dv(location, transpose, value); + } + + /** Array version of: {@link #glGetUniformdv GetUniformdv} */ + public static void glGetUniformdv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble *") double[] params) { + GL40C.glGetUniformdv(program, location, params); + } + + /** Array version of: {@link #glProgramUniform1dvEXT ProgramUniform1dvEXT} */ + public static void glProgramUniform1dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniform1dvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform2dvEXT ProgramUniform2dvEXT} */ + public static void glProgramUniform2dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniform2dvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 1, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform3dvEXT ProgramUniform3dvEXT} */ + public static void glProgramUniform3dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniform3dvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 3, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform4dvEXT ProgramUniform4dvEXT} */ + public static void glProgramUniform4dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniform4dvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 2, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniformMatrix2dvEXT ProgramUniformMatrix2dvEXT} */ + public static void glProgramUniformMatrix2dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix2dvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 2, transpose, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniformMatrix3dvEXT ProgramUniformMatrix3dvEXT} */ + public static void glProgramUniformMatrix3dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix3dvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 9, transpose, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniformMatrix4dvEXT ProgramUniformMatrix4dvEXT} */ + public static void glProgramUniformMatrix4dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix4dvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 4, transpose, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniformMatrix2x3dvEXT ProgramUniformMatrix2x3dvEXT} */ + public static void glProgramUniformMatrix2x3dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix2x3dvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 6, transpose, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniformMatrix2x4dvEXT ProgramUniformMatrix2x4dvEXT} */ + public static void glProgramUniformMatrix2x4dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix2x4dvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 3, transpose, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniformMatrix3x2dvEXT ProgramUniformMatrix3x2dvEXT} */ + public static void glProgramUniformMatrix3x2dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix3x2dvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 6, transpose, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniformMatrix3x4dvEXT ProgramUniformMatrix3x4dvEXT} */ + public static void glProgramUniformMatrix3x4dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix3x4dvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 12, transpose, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniformMatrix4x2dvEXT ProgramUniformMatrix4x2dvEXT} */ + public static void glProgramUniformMatrix4x2dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix4x2dvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 3, transpose, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniformMatrix4x3dvEXT ProgramUniformMatrix4x3dvEXT} */ + public static void glProgramUniformMatrix4x3dvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix4x3dvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 12, transpose, value, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGPUShaderInt64.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGPUShaderInt64.java new file mode 100644 index 00000000..bfa4c672 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGPUShaderInt64.java @@ -0,0 +1,901 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_gpu_shader_int64 extension. + * + *

The extension introduces the following features for all shader types:

+ * + *
    + *
  • support for 64-bit scalar and vector integer data types, including uniform API, uniform buffer object, transform feedback, and shader input and + * output support;
  • + *
  • new built-in functions to pack and unpack 64-bit integer types into a two-component 32-bit integer vector;
  • + *
  • new built-in functions to convert double-precision floating-point values to or from their 64-bit integer bit encodings;
  • + *
  • vector relational functions supporting comparisons of vectors of 64-bit integer types; and
  • + *
  • common functions abs, sign, min, max, clamp, and mix supporting arguments of 64-bit integer types.
  • + *
+ * + *

Requires {@link GL40 GL40} and GLSL 4.00.

+ */ +public class ARBGPUShaderInt64 { + + /** Returned by the {@code type} parameter of GetActiveAttrib, GetActiveUniform, and GetTransformFeedbackVarying. */ + public static final int + GL_INT64_ARB = 0x140E, + GL_UNSIGNED_INT64_ARB = 0x140F, + GL_INT64_VEC2_ARB = 0x8FE9, + GL_INT64_VEC3_ARB = 0x8FEA, + GL_INT64_VEC4_ARB = 0x8FEB, + GL_UNSIGNED_INT64_VEC2_ARB = 0x8FF5, + GL_UNSIGNED_INT64_VEC3_ARB = 0x8FF6, + GL_UNSIGNED_INT64_VEC4_ARB = 0x8FF7; + + static { GL.initialize(); } + + protected ARBGPUShaderInt64() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glUniform1i64ARB, caps.glUniform1i64vARB, caps.glProgramUniform1i64ARB, caps.glProgramUniform1i64vARB, caps.glUniform2i64ARB, + caps.glUniform2i64vARB, caps.glProgramUniform2i64ARB, caps.glProgramUniform2i64vARB, caps.glUniform3i64ARB, caps.glUniform3i64vARB, + caps.glProgramUniform3i64ARB, caps.glProgramUniform3i64vARB, caps.glUniform4i64ARB, caps.glUniform4i64vARB, caps.glProgramUniform4i64ARB, + caps.glProgramUniform4i64vARB, caps.glUniform1ui64ARB, caps.glUniform1ui64vARB, caps.glProgramUniform1ui64ARB, caps.glProgramUniform1ui64vARB, + caps.glUniform2ui64ARB, caps.glUniform2ui64vARB, caps.glProgramUniform2ui64ARB, caps.glProgramUniform2ui64vARB, caps.glUniform3ui64ARB, + caps.glUniform3ui64vARB, caps.glProgramUniform3ui64ARB, caps.glProgramUniform3ui64vARB, caps.glUniform4ui64ARB, caps.glUniform4ui64vARB, + caps.glProgramUniform4ui64ARB, caps.glProgramUniform4ui64vARB, caps.glGetUniformi64vARB, caps.glGetUniformui64vARB, caps.glGetnUniformi64vARB, + caps.glGetnUniformui64vARB + ); + } + + // --- [ glUniform1i64ARB ] --- + + /** + * Specifies the value of an int64_t uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + */ + public static native void glUniform1i64ARB(@NativeType("GLint") int location, @NativeType("GLint64") long x); + + // --- [ glUniform1i64vARB ] --- + + /** + * Unsafe version of: {@link #glUniform1i64vARB Uniform1i64vARB} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform1i64vARB(int location, int count, long value); + + /** + * Specifies the value of a single int64_t uniform variable or a int64_t uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified int64_t variable + */ + public static void glUniform1i64vARB(@NativeType("GLint") int location, @NativeType("GLint64 *") LongBuffer value) { + nglUniform1i64vARB(location, value.remaining(), memAddress(value)); + } + + // --- [ glProgramUniform1i64ARB ] --- + + /** + * Specifies the value of an int64_t uniform variable for the specified program object. + * + * @param program the program object + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + */ + public static native void glProgramUniform1i64ARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64") long x); + + // --- [ glProgramUniform1i64vARB ] --- + + /** + * Unsafe version of: {@link #glProgramUniform1i64vARB ProgramUniform1i64vARB} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform1i64vARB(int program, int location, int count, long value); + + /** + * Specifies the value of a single int64_t uniform variable or a int64_t uniform variable array for the specified program object. + * + * @param program the program object + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified int64_t variable + */ + public static void glProgramUniform1i64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64 *") LongBuffer value) { + nglProgramUniform1i64vARB(program, location, value.remaining(), memAddress(value)); + } + + // --- [ glUniform2i64ARB ] --- + + /** + * Specifies the value of an i64vec2 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + */ + public static native void glUniform2i64ARB(@NativeType("GLint") int location, @NativeType("GLint64") long x, @NativeType("GLint64") long y); + + // --- [ glUniform2i64vARB ] --- + + /** + * Unsafe version of: {@link #glUniform2i64vARB Uniform2i64vARB} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform2i64vARB(int location, int count, long value); + + /** + * Specifies the value of a single i64vec2 uniform variable or a i64vec2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified i64vec2 variable + */ + public static void glUniform2i64vARB(@NativeType("GLint") int location, @NativeType("GLint64 *") LongBuffer value) { + nglUniform2i64vARB(location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glProgramUniform2i64ARB ] --- + + /** + * Specifies the value of an i64vec2 uniform variable for the specified program object. + * + * @param program the program object + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + */ + public static native void glProgramUniform2i64ARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64") long x, @NativeType("GLint64") long y); + + // --- [ glProgramUniform2i64vARB ] --- + + /** + * Unsafe version of: {@link #glProgramUniform2i64vARB ProgramUniform2i64vARB} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform2i64vARB(int program, int location, int count, long value); + + /** + * Specifies the value of a single i64vec2 uniform variable or a i64vec2 uniform variable array for the specified program object. + * + * @param program the program object + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified i64vec2 variable + */ + public static void glProgramUniform2i64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64 *") LongBuffer value) { + nglProgramUniform2i64vARB(program, location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glUniform3i64ARB ] --- + + /** + * Specifies the value of an i64vec3 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + */ + public static native void glUniform3i64ARB(@NativeType("GLint") int location, @NativeType("GLint64") long x, @NativeType("GLint64") long y, @NativeType("GLint64") long z); + + // --- [ glUniform3i64vARB ] --- + + /** + * Unsafe version of: {@link #glUniform3i64vARB Uniform3i64vARB} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform3i64vARB(int location, int count, long value); + + /** + * Specifies the value of a single i64vec3 uniform variable or a i64vec3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified i64vec3 variable + */ + public static void glUniform3i64vARB(@NativeType("GLint") int location, @NativeType("GLint64 *") LongBuffer value) { + nglUniform3i64vARB(location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glProgramUniform3i64ARB ] --- + + /** + * Specifies the value of an i64vec3 uniform variable for the specified program object. + * + * @param program the program object + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + */ + public static native void glProgramUniform3i64ARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64") long x, @NativeType("GLint64") long y, @NativeType("GLint64") long z); + + // --- [ glProgramUniform3i64vARB ] --- + + /** + * Unsafe version of: {@link #glProgramUniform3i64vARB ProgramUniform3i64vARB} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform3i64vARB(int program, int location, int count, long value); + + /** + * Specifies the value of a single i64vec3 uniform variable or a i64vec3 uniform variable array for the specified program object. + * + * @param program the program object + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified i64vec3 variable + */ + public static void glProgramUniform3i64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64 *") LongBuffer value) { + nglProgramUniform3i64vARB(program, location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glUniform4i64ARB ] --- + + /** + * Specifies the value of an i64vec4 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * @param w the uniform w value + */ + public static native void glUniform4i64ARB(@NativeType("GLint") int location, @NativeType("GLint64") long x, @NativeType("GLint64") long y, @NativeType("GLint64") long z, @NativeType("GLint64") long w); + + // --- [ glUniform4i64vARB ] --- + + /** + * Unsafe version of: {@link #glUniform4i64vARB Uniform4i64vARB} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform4i64vARB(int location, int count, long value); + + /** + * Specifies the value of a single i64vec4 uniform variable or a i64vec4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified i64vec4 variable + */ + public static void glUniform4i64vARB(@NativeType("GLint") int location, @NativeType("GLint64 *") LongBuffer value) { + nglUniform4i64vARB(location, value.remaining() >> 2, memAddress(value)); + } + + // --- [ glProgramUniform4i64ARB ] --- + + /** + * Specifies the value of an i64vec4 uniform variable for the specified program object. + * + * @param program the program object + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * @param w the uniform w value + */ + public static native void glProgramUniform4i64ARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64") long x, @NativeType("GLint64") long y, @NativeType("GLint64") long z, @NativeType("GLint64") long w); + + // --- [ glProgramUniform4i64vARB ] --- + + /** + * Unsafe version of: {@link #glProgramUniform4i64vARB ProgramUniform4i64vARB} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform4i64vARB(int program, int location, int count, long value); + + /** + * Specifies the value of a single i64vec4 uniform variable or a i64vec4 uniform variable array for the specified program object. + * + * @param program the program object + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified i64vec4 variable + */ + public static void glProgramUniform4i64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64 *") LongBuffer value) { + nglProgramUniform4i64vARB(program, location, value.remaining() >> 2, memAddress(value)); + } + + // --- [ glUniform1ui64ARB ] --- + + /** + * Specifies the value of an uint64_t uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + */ + public static native void glUniform1ui64ARB(@NativeType("GLint") int location, @NativeType("GLuint64") long x); + + // --- [ glUniform1ui64vARB ] --- + + /** + * Unsafe version of: {@link #glUniform1ui64vARB Uniform1ui64vARB} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform1ui64vARB(int location, int count, long value); + + /** + * Specifies the value of a single uint64_t uniform variable or a uint64_t uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uint64_t variable + */ + public static void glUniform1ui64vARB(@NativeType("GLint") int location, @NativeType("GLuint64 const *") LongBuffer value) { + nglUniform1ui64vARB(location, value.remaining(), memAddress(value)); + } + + // --- [ glProgramUniform1ui64ARB ] --- + + /** + * Specifies the value of an uint64_t uniform variable for the current program object. + * + * @param program the program object + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + */ + public static native void glProgramUniform1ui64ARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64") long x); + + // --- [ glProgramUniform1ui64vARB ] --- + + /** + * Unsafe version of: {@link #glProgramUniform1ui64vARB ProgramUniform1ui64vARB} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform1ui64vARB(int program, int location, int count, long value); + + /** + * Specifies the value of a single uint64_t uniform variable or a uint64_t uniform variable array for the specified program object. + * + * @param program the program object + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uint64_t variable + */ + public static void glProgramUniform1ui64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64 const *") LongBuffer value) { + nglProgramUniform1ui64vARB(program, location, value.remaining(), memAddress(value)); + } + + // --- [ glUniform2ui64ARB ] --- + + /** + * Specifies the value of an u64vec2 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + */ + public static native void glUniform2ui64ARB(@NativeType("GLint") int location, @NativeType("GLuint64") long x, @NativeType("GLuint64") long y); + + // --- [ glUniform2ui64vARB ] --- + + /** + * Unsafe version of: {@link #glUniform2ui64vARB Uniform2ui64vARB} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform2ui64vARB(int location, int count, long value); + + /** + * Specifies the value of a single u64vec2 uniform variable or a u64vec2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified u64vec2 variable + */ + public static void glUniform2ui64vARB(@NativeType("GLint") int location, @NativeType("GLuint64 const *") LongBuffer value) { + nglUniform2ui64vARB(location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glProgramUniform2ui64ARB ] --- + + /** + * Specifies the value of an u64vec2 uniform variable for the current program object. + * + * @param program the program object + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + */ + public static native void glProgramUniform2ui64ARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64") long x, @NativeType("GLuint64") long y); + + // --- [ glProgramUniform2ui64vARB ] --- + + /** + * Unsafe version of: {@link #glProgramUniform2ui64vARB ProgramUniform2ui64vARB} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform2ui64vARB(int program, int location, int count, long value); + + /** + * Specifies the value of a single u64vec2 uniform variable or a u64vec2 uniform variable array for the specified program object. + * + * @param program the program object + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified u64vec2 variable + */ + public static void glProgramUniform2ui64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64 const *") LongBuffer value) { + nglProgramUniform2ui64vARB(program, location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glUniform3ui64ARB ] --- + + /** + * Specifies the value of an u64vec3 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + */ + public static native void glUniform3ui64ARB(@NativeType("GLint") int location, @NativeType("GLuint64") long x, @NativeType("GLuint64") long y, @NativeType("GLuint64") long z); + + // --- [ glUniform3ui64vARB ] --- + + /** + * Unsafe version of: {@link #glUniform3ui64vARB Uniform3ui64vARB} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform3ui64vARB(int location, int count, long value); + + /** + * Specifies the value of a single u64vec3 uniform variable or a u64vec3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified u64vec3 variable + */ + public static void glUniform3ui64vARB(@NativeType("GLint") int location, @NativeType("GLuint64 const *") LongBuffer value) { + nglUniform3ui64vARB(location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glProgramUniform3ui64ARB ] --- + + /** + * Specifies the value of an u64vec3 uniform variable for the current program object. + * + * @param program the program object + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + */ + public static native void glProgramUniform3ui64ARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64") long x, @NativeType("GLuint64") long y, @NativeType("GLuint64") long z); + + // --- [ glProgramUniform3ui64vARB ] --- + + /** + * Unsafe version of: {@link #glProgramUniform3ui64vARB ProgramUniform3ui64vARB} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform3ui64vARB(int program, int location, int count, long value); + + /** + * Specifies the value of a single u64vec3 uniform variable or a u64vec3 uniform variable array for the specified program object. + * + * @param program the program object + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified u64vec3 variable + */ + public static void glProgramUniform3ui64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64 const *") LongBuffer value) { + nglProgramUniform3ui64vARB(program, location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glUniform4ui64ARB ] --- + + /** + * Specifies the value of an u64vec4 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * @param w the uniform w value + */ + public static native void glUniform4ui64ARB(@NativeType("GLint") int location, @NativeType("GLuint64") long x, @NativeType("GLuint64") long y, @NativeType("GLuint64") long z, @NativeType("GLuint64") long w); + + // --- [ glUniform4ui64vARB ] --- + + /** + * Unsafe version of: {@link #glUniform4ui64vARB Uniform4ui64vARB} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform4ui64vARB(int location, int count, long value); + + /** + * Specifies the value of a single u64vec4 uniform variable or a u64vec4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified u64vec4 variable + */ + public static void glUniform4ui64vARB(@NativeType("GLint") int location, @NativeType("GLuint64 const *") LongBuffer value) { + nglUniform4ui64vARB(location, value.remaining() >> 2, memAddress(value)); + } + + // --- [ glProgramUniform4ui64ARB ] --- + + /** + * Specifies the value of an u64vec4 uniform variable for the current program object. + * + * @param program the program object + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * @param w the uniform w value + */ + public static native void glProgramUniform4ui64ARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64") long x, @NativeType("GLuint64") long y, @NativeType("GLuint64") long z, @NativeType("GLuint64") long w); + + // --- [ glProgramUniform4ui64vARB ] --- + + /** + * Unsafe version of: {@link #glProgramUniform4ui64vARB ProgramUniform4ui64vARB} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform4ui64vARB(int program, int location, int count, long value); + + /** + * Specifies the value of a single u64vec4 uniform variable or a u64vec4 uniform variable array for the specified program object. + * + * @param program the program object + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified u64vec4 variable + */ + public static void glProgramUniform4ui64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64 const *") LongBuffer value) { + nglProgramUniform4ui64vARB(program, location, value.remaining() >> 2, memAddress(value)); + } + + // --- [ glGetUniformi64vARB ] --- + + /** Unsafe version of: {@link #glGetUniformi64vARB GetUniformi64vARB} */ + public static native void nglGetUniformi64vARB(int program, int location, long params); + + /** + * Returns the int64_t value(s) of a uniform variable. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * @param params the value of the specified uniform variable + */ + public static void glGetUniformi64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64 *") LongBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetUniformi64vARB(program, location, memAddress(params)); + } + + /** + * Returns the int64_t value(s) of a uniform variable. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + */ + @NativeType("void") + public static long glGetUniformi64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglGetUniformi64vARB(program, location, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetUniformui64vARB ] --- + + /** Unsafe version of: {@link #glGetUniformui64vARB GetUniformui64vARB} */ + public static native void nglGetUniformui64vARB(int program, int location, long params); + + /** + * Returns the uint64_t value(s) of a uniform variable. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * @param params the value of the specified uniform variable + */ + public static void glGetUniformui64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64 *") LongBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetUniformui64vARB(program, location, memAddress(params)); + } + + /** + * Returns the uint64_t value(s) of a uniform variable. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + */ + @NativeType("void") + public static long glGetUniformui64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglGetUniformui64vARB(program, location, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetnUniformi64vARB ] --- + + /** + * Unsafe version of: {@link #glGetnUniformi64vARB GetnUniformi64vARB} + * + * @param bufSize the maximum number of values to write in {@code params} + */ + public static native void nglGetnUniformi64vARB(int program, int location, int bufSize, long params); + + /** + * Robust version of {@link #glGetUniformi64vARB GetUniformi64vARB}. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * @param params the value of the specified uniform variable + */ + public static void glGetnUniformi64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64 *") LongBuffer params) { + nglGetnUniformi64vARB(program, location, params.remaining(), memAddress(params)); + } + + /** + * Robust version of {@link #glGetUniformi64vARB GetUniformi64vARB}. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + */ + @NativeType("void") + public static long glGetnUniformi64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglGetnUniformi64vARB(program, location, 1, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetnUniformui64vARB ] --- + + /** + * Unsafe version of: {@link #glGetnUniformui64vARB GetnUniformui64vARB} + * + * @param bufSize the maximum number of values to write in {@code params} + */ + public static native void nglGetnUniformui64vARB(int program, int location, int bufSize, long params); + + /** + * Robust version of {@link #glGetUniformui64vARB GetUniformui64vARB}. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * @param params the value of the specified uniform variable + */ + public static void glGetnUniformui64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64 *") LongBuffer params) { + nglGetnUniformui64vARB(program, location, params.remaining(), memAddress(params)); + } + + /** + * Robust version of {@link #glGetUniformui64vARB GetUniformui64vARB}. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + */ + @NativeType("void") + public static long glGetnUniformui64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglGetnUniformui64vARB(program, location, 1, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #glUniform1i64vARB Uniform1i64vARB} */ + public static void glUniform1i64vARB(@NativeType("GLint") int location, @NativeType("GLint64 *") long[] value) { + long __functionAddress = GL.getICD().glUniform1i64vARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform1i64vARB ProgramUniform1i64vARB} */ + public static void glProgramUniform1i64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64 *") long[] value) { + long __functionAddress = GL.getICD().glProgramUniform1i64vARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length, value, __functionAddress); + } + + /** Array version of: {@link #glUniform2i64vARB Uniform2i64vARB} */ + public static void glUniform2i64vARB(@NativeType("GLint") int location, @NativeType("GLint64 *") long[] value) { + long __functionAddress = GL.getICD().glUniform2i64vARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 1, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform2i64vARB ProgramUniform2i64vARB} */ + public static void glProgramUniform2i64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64 *") long[] value) { + long __functionAddress = GL.getICD().glProgramUniform2i64vARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 1, value, __functionAddress); + } + + /** Array version of: {@link #glUniform3i64vARB Uniform3i64vARB} */ + public static void glUniform3i64vARB(@NativeType("GLint") int location, @NativeType("GLint64 *") long[] value) { + long __functionAddress = GL.getICD().glUniform3i64vARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length / 3, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform3i64vARB ProgramUniform3i64vARB} */ + public static void glProgramUniform3i64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64 *") long[] value) { + long __functionAddress = GL.getICD().glProgramUniform3i64vARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 3, value, __functionAddress); + } + + /** Array version of: {@link #glUniform4i64vARB Uniform4i64vARB} */ + public static void glUniform4i64vARB(@NativeType("GLint") int location, @NativeType("GLint64 *") long[] value) { + long __functionAddress = GL.getICD().glUniform4i64vARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 2, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform4i64vARB ProgramUniform4i64vARB} */ + public static void glProgramUniform4i64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64 *") long[] value) { + long __functionAddress = GL.getICD().glProgramUniform4i64vARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 2, value, __functionAddress); + } + + /** Array version of: {@link #glUniform1ui64vARB Uniform1ui64vARB} */ + public static void glUniform1ui64vARB(@NativeType("GLint") int location, @NativeType("GLuint64 const *") long[] value) { + long __functionAddress = GL.getICD().glUniform1ui64vARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform1ui64vARB ProgramUniform1ui64vARB} */ + public static void glProgramUniform1ui64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64 const *") long[] value) { + long __functionAddress = GL.getICD().glProgramUniform1ui64vARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length, value, __functionAddress); + } + + /** Array version of: {@link #glUniform2ui64vARB Uniform2ui64vARB} */ + public static void glUniform2ui64vARB(@NativeType("GLint") int location, @NativeType("GLuint64 const *") long[] value) { + long __functionAddress = GL.getICD().glUniform2ui64vARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 1, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform2ui64vARB ProgramUniform2ui64vARB} */ + public static void glProgramUniform2ui64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64 const *") long[] value) { + long __functionAddress = GL.getICD().glProgramUniform2ui64vARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 1, value, __functionAddress); + } + + /** Array version of: {@link #glUniform3ui64vARB Uniform3ui64vARB} */ + public static void glUniform3ui64vARB(@NativeType("GLint") int location, @NativeType("GLuint64 const *") long[] value) { + long __functionAddress = GL.getICD().glUniform3ui64vARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length / 3, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform3ui64vARB ProgramUniform3ui64vARB} */ + public static void glProgramUniform3ui64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64 const *") long[] value) { + long __functionAddress = GL.getICD().glProgramUniform3ui64vARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 3, value, __functionAddress); + } + + /** Array version of: {@link #glUniform4ui64vARB Uniform4ui64vARB} */ + public static void glUniform4ui64vARB(@NativeType("GLint") int location, @NativeType("GLuint64 const *") long[] value) { + long __functionAddress = GL.getICD().glUniform4ui64vARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 2, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform4ui64vARB ProgramUniform4ui64vARB} */ + public static void glProgramUniform4ui64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64 const *") long[] value) { + long __functionAddress = GL.getICD().glProgramUniform4ui64vARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 2, value, __functionAddress); + } + + /** Array version of: {@link #glGetUniformi64vARB GetUniformi64vARB} */ + public static void glGetUniformi64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64 *") long[] params) { + long __functionAddress = GL.getICD().glGetUniformi64vARB; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(program, location, params, __functionAddress); + } + + /** Array version of: {@link #glGetUniformui64vARB GetUniformui64vARB} */ + public static void glGetUniformui64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64 *") long[] params) { + long __functionAddress = GL.getICD().glGetUniformui64vARB; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(program, location, params, __functionAddress); + } + + /** Array version of: {@link #glGetnUniformi64vARB GetnUniformi64vARB} */ + public static void glGetnUniformi64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64 *") long[] params) { + long __functionAddress = GL.getICD().glGetnUniformi64vARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, params.length, params, __functionAddress); + } + + /** Array version of: {@link #glGetnUniformui64vARB GetnUniformui64vARB} */ + public static void glGetnUniformui64vARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64 *") long[] params) { + long __functionAddress = GL.getICD().glGetnUniformui64vARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, params.length, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGeometryShader4.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGeometryShader4.java new file mode 100644 index 00000000..2ea37060 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGeometryShader4.java @@ -0,0 +1,172 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_geometry_shader4 extension. + * + *

ARB_geometry_shader4 defines a new shader type available to be run on the GPU, called a geometry shader. Geometry shaders are run after vertices are + * transformed, but prior to color clamping, flat shading and clipping.

+ * + *

A geometry shader begins with a single primitive (point, line, triangle). It can read the attributes of any of the vertices in the primitive and use + * them to generate new primitives. A geometry shader has a fixed output primitive type (point, line strip, or triangle strip) and emits vertices to define + * a new primitive. A geometry shader can emit multiple disconnected primitives. The primitives emitted by the geometry shader are clipped and then + * processed like an equivalent OpenGL primitive specified by the application.

+ * + *

Furthermore, ARB_geometry_shader4 provides four additional primitive types: lines with adjacency, line strips with adjacency, separate triangles with + * adjacency, and triangle strips with adjacency. Some of the vertices specified in these new primitive types are not part of the ordinary primitives, + * instead they represent neighboring vertices that are adjacent to the two line segment end points (lines/strips) or the three triangle edges + * (triangles/tstrips). These vertices can be accessed by geometry shaders and used to match up the vertices emitted by the geometry shader with those of + * neighboring primitives.

+ * + *

Since geometry shaders expect a specific input primitive type, an error will occur if the application presents primitives of a different type. For + * example, if a geometry shader expects points, an error will occur at {@link GL11#glBegin Begin} time, if a primitive mode of {@link GL11#GL_TRIANGLES TRIANGLES} is specified.

+ * + *

Promoted to core in {@link GL32 OpenGL 3.2}.

+ */ +public class ARBGeometryShader4 { + + /** Accepted by the {@code type} parameter of CreateShader and returned by the {@code params} parameter of GetShaderiv. */ + public static final int GL_GEOMETRY_SHADER_ARB = 0x8DD9; + + /** Accepted by the {@code pname} parameter of ProgramParameteriARB and GetProgramiv. */ + public static final int + GL_GEOMETRY_VERTICES_OUT_ARB = 0x8DDA, + GL_GEOMETRY_INPUT_TYPE_ARB = 0x8DDB, + GL_GEOMETRY_OUTPUT_TYPE_ARB = 0x8DDC; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_ARB = 0x8C29, + GL_MAX_GEOMETRY_VARYING_COMPONENTS_ARB = 0x8DDD, + GL_MAX_VERTEX_VARYING_COMPONENTS_ARB = 0x8DDE, + GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_ARB = 0x8DDF, + GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB = 0x8DE0, + GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB = 0x8DE1; + + /** Accepted by the {@code mode} parameter of Begin, DrawArrays, MultiDrawArrays, DrawElements, MultiDrawElements, and DrawRangeElements. */ + public static final int + GL_LINES_ADJACENCY_ARB = 0xA, + GL_LINE_STRIP_ADJACENCY_ARB = 0xB, + GL_TRIANGLES_ADJACENCY_ARB = 0xC, + GL_TRIANGLE_STRIP_ADJACENCY_ARB = 0xD; + + /** Returned by CheckFramebufferStatusARB. */ + public static final int + GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_ARB = 0x8DA8, + GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_ARB = 0x8DA9; + + /** Accepted by the {@code pname} parameter of GetFramebufferAttachment- ParameterivARB. */ + public static final int + GL_FRAMEBUFFER_ATTACHMENT_LAYERED_ARB = 0x8DA7, + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetIntegerv, GetFloatv, GetDoublev, and + * GetBooleanv. + */ + public static final int GL_PROGRAM_POINT_SIZE_ARB = 0x8642; + + static { GL.initialize(); } + + protected ARBGeometryShader4() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glProgramParameteriARB, caps.glFramebufferTextureARB, caps.glFramebufferTextureLayerARB, caps.glFramebufferTextureFaceARB + ); + } + + // --- [ glProgramParameteriARB ] --- + + /** + * Sets a program object parameter. + * + *

The error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} is generated if {@code pname} is {@link #GL_GEOMETRY_INPUT_TYPE_ARB GEOMETRY_INPUT_TYPE_ARB} and {@code value} is not one of {@link GL11#GL_POINTS POINTS}, {@link GL11#GL_LINES LINES}, + * {@link #GL_LINES_ADJACENCY_ARB LINES_ADJACENCY_ARB}, {@link GL11#GL_TRIANGLES TRIANGLES} or {@link #GL_TRIANGLES_ADJACENCY_ARB TRIANGLES_ADJACENCY_ARB}.

+ * + *

The error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} is generated if {@code pname} is {@link #GL_GEOMETRY_OUTPUT_TYPE_ARB GEOMETRY_OUTPUT_TYPE_ARB} and {@code value} is not one of {@link GL11#GL_POINTS POINTS}, {@link GL11#GL_LINE_STRIP LINE_STRIP} or + * {@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}.

+ * + *

The error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} is generated if {@code pname} is {@link #GL_GEOMETRY_VERTICES_OUT_ARB GEOMETRY_VERTICES_OUT_ARB} and {@code value} is negative.

+ * + *

The error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} is generated if {@code pname} is {@link #GL_GEOMETRY_VERTICES_OUT_ARB GEOMETRY_VERTICES_OUT_ARB} and {@code value} exceeds {@link #GL_MAX_GEOMETRY_OUTPUT_VERTICES_ARB MAX_GEOMETRY_OUTPUT_VERTICES_ARB}.

+ * + *

The error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} is generated if {@code pname} is set to {@link #GL_GEOMETRY_VERTICES_OUT_ARB GEOMETRY_VERTICES_OUT_ARB} and the product of {@code value} and the sum of all + * components of all active varying variables exceeds {@link #GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_ARB}.

+ * + * @param program the program object + * @param pname the parameter to set. One of:
{@link #GL_GEOMETRY_VERTICES_OUT_ARB GEOMETRY_VERTICES_OUT_ARB}{@link #GL_GEOMETRY_INPUT_TYPE_ARB GEOMETRY_INPUT_TYPE_ARB}{@link #GL_GEOMETRY_OUTPUT_TYPE_ARB GEOMETRY_OUTPUT_TYPE_ARB}
+ * @param value the value being set + */ + public static native void glProgramParameteriARB(@NativeType("GLuint") int program, @NativeType("GLenum") int pname, @NativeType("GLint") int value); + + // --- [ glFramebufferTextureARB ] --- + + /** + * Attaches a specified level of a texture object as one of the logical buffers of the currently bound framebuffer object, to render directly into the + * texture image. + * + *

If {@code texture} is zero, any image or array of images attached to the attachment point named by {@code attachment} is detached, and the state of the + * attachment point is reset to its initial values. {@code level} is ignored if {@code texture} is zero.

+ * + *

If {@code texture} is non-zero, FramebufferTextureARB attaches level {@code level} of the texture object named {@code texture} to the framebuffer + * attachment point named by {@code attachment}. The error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} is generated if {@code texture} is not the name of a texture object, or if + * {@code level} is not a supported texture level number for textures of the type corresponding to {@code target}. The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is + * generated if {@code texture} is the name of a buffer texture.

+ * + *

If {@code texture} is the name of a three-dimensional texture, cube map texture, or one- or two-dimensional array texture, the texture level attached to + * the framebuffer attachment point is an array of images, and the framebuffer attachment is considered layered.

+ * + * @param target the render target. Must be:
{@link ARBFramebufferObject#GL_FRAMEBUFFER FRAMEBUFFER}
+ * @param attachment must be one of the attachments points of the framebuffer + * @param texture the texture object name + * @param level the texture level + */ + public static native void glFramebufferTextureARB(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level); + + // --- [ glFramebufferTextureLayerARB ] --- + + /** + * Operates like {@link #glFramebufferTextureARB FramebufferTextureARB}, except that only a single layer of the texture level, numbered {@code layer}, is attached to the attachment + * point. + * + *

If {@code texture} is non-zero, the error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} is generated if {@code layer} is negative, or if {@code texture} is not the name of a + * texture object. The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated unless {@code texture} is zero or the name of a three-dimensional or one- or + * two-dimensional array texture.

+ * + * @param target the render target. Must be:
{@link ARBFramebufferObject#GL_FRAMEBUFFER FRAMEBUFFER}
+ * @param attachment must be one of the attachments points of the framebuffer + * @param texture the texture object name + * @param level the texture level + * @param layer the texture layer + */ + public static native void glFramebufferTextureLayerARB(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int layer); + + // --- [ glFramebufferTextureFaceARB ] --- + + /** + * Operates like {@link #glFramebufferTextureARB FramebufferTextureARB}, except that only a single face of a cube map texture, given by {@code face}, is attached to the attachment + * point. + * + *

If {@code texture} is non-zero, the error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} is generated if {@code texture} is not the name of a texture object. The error + * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated unless {@code texture} is zero or the name of a cube map texture.

+ * + * @param target the render target. Must be:
{@link ARBFramebufferObject#GL_FRAMEBUFFER FRAMEBUFFER}
+ * @param attachment must be one of the attachments points of the framebuffer + * @param texture the texture object name + * @param level the texture level + * @param face the cube map face. One of:
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ */ + public static native void glFramebufferTextureFaceARB(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int face); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGetProgramBinary.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGetProgramBinary.java new file mode 100644 index 00000000..bdf22702 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGetProgramBinary.java @@ -0,0 +1,121 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_get_program_binary extension. + * + *

This extension introduces new commands to retrieve and set the binary representation of a program object. {@link #glGetProgramBinary GetProgramBinary} allows an application to + * cache compiled and linked programs to avoid compiling and linking when used again. This may even allow the GL itself to act as an offline compiler. The + * resulting program binary can be reloaded into the GL via {@link #glProgramBinary ProgramBinary}. This is a very useful path for applications that wish to remain portable by + * shipping pure GLSL source shaders, yet would like to avoid the cost of compiling their shaders at runtime. Instead an application can supply its GLSL + * source shaders during first application run, or even during installation. The application then compiles and links its shaders and reads back the program + * binaries. On subsequent runs, only the program binaries need be supplied.

+ * + *

{@link #glProgramBinary ProgramBinary} may also accept binaries in vendor-specific formats produced by specialized offline compilation tools. This extension does not add any + * such formats, but allows for them in further extensions. Though the level of optimization may not be identical -- the offline shader compiler may have + * the luxury of more aggressive optimization at its disposal -- program binaries generated online by the GL are interchangeable with those generated + * offline by an SDK tool.

+ * + *

Requires {@link GL30 OpenGL 3.0}. Promoted to core in {@link GL41 OpenGL 4.1}.

+ */ +public class ARBGetProgramBinary { + + /** Accepted by the {@code pname} parameter of ProgramParameteri and GetProgramiv. */ + public static final int GL_PROGRAM_BINARY_RETRIEVABLE_HINT = 0x8257; + + /** Accepted by the {@code pname} parameter of GetProgramiv. */ + public static final int GL_PROGRAM_BINARY_LENGTH = 0x8741; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv and GetDoublev. */ + public static final int + GL_NUM_PROGRAM_BINARY_FORMATS = 0x87FE, + GL_PROGRAM_BINARY_FORMATS = 0x87FF; + + static { GL.initialize(); } + + protected ARBGetProgramBinary() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glGetProgramBinary, caps.glProgramBinary, caps.glProgramParameteri + ); + } + + // --- [ glGetProgramBinary ] --- + + /** + * Unsafe version of: {@link #glGetProgramBinary GetProgramBinary} + * + * @param bufSize the size of the buffer whose address is given by {@code binary} + */ + public static void nglGetProgramBinary(int program, int bufSize, long length, long binaryFormat, long binary) { + GL41C.nglGetProgramBinary(program, bufSize, length, binaryFormat, binary); + } + + /** + * Returns a binary representation of a program object's compiled and linked executable source. + * + * @param program the name of a program object whose binary representation to retrieve + * @param length the address of a variable to receive the number of bytes written into {@code binary} + * @param binaryFormat a variable to receive a token indicating the format of the binary data returned by the GL + * @param binary an array into which the GL will return {@code program}'s binary representation + */ + public static void glGetProgramBinary(@NativeType("GLuint") int program, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLenum *") IntBuffer binaryFormat, @NativeType("void *") ByteBuffer binary) { + GL41C.glGetProgramBinary(program, length, binaryFormat, binary); + } + + // --- [ glProgramBinary ] --- + + /** + * Unsafe version of: {@link #glProgramBinary ProgramBinary} + * + * @param length the number of bytes contained in {@code binary} + */ + public static void nglProgramBinary(int program, int binaryFormat, long binary, int length) { + GL41C.nglProgramBinary(program, binaryFormat, binary, length); + } + + /** + * Loads a program object with a program binary. + * + * @param program the name of a program object into which to load a program binary + * @param binaryFormat the format of the binary data in binary + * @param binary an array containing the binary to be loaded into {@code program} + */ + public static void glProgramBinary(@NativeType("GLuint") int program, @NativeType("GLenum") int binaryFormat, @NativeType("void const *") ByteBuffer binary) { + GL41C.glProgramBinary(program, binaryFormat, binary); + } + + // --- [ glProgramParameteri ] --- + + /** + * Specifies the integer value of a program object parameter. + * + * @param program the name of a program object whose parameter to modify + * @param pname the name of the parameter to modify. One of:
{@link GL41C#GL_PROGRAM_BINARY_RETRIEVABLE_HINT PROGRAM_BINARY_RETRIEVABLE_HINT}{@link GL41C#GL_PROGRAM_SEPARABLE PROGRAM_SEPARABLE}
+ * @param value the new value of the parameter specified by {@code pname} for {@code program} + */ + public static void glProgramParameteri(@NativeType("GLuint") int program, @NativeType("GLenum") int pname, @NativeType("GLint") int value) { + GL41C.glProgramParameteri(program, pname, value); + } + + /** Array version of: {@link #glGetProgramBinary GetProgramBinary} */ + public static void glGetProgramBinary(@NativeType("GLuint") int program, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLenum *") int[] binaryFormat, @NativeType("void *") ByteBuffer binary) { + GL41C.glGetProgramBinary(program, length, binaryFormat, binary); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGetTextureSubImage.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGetTextureSubImage.java new file mode 100644 index 00000000..748da852 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBGetTextureSubImage.java @@ -0,0 +1,315 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_get_texture_sub_image extension. + * + *

This extension adds a new function to get sub-regions of texture images.

+ * + *

Requires {@link GL20 OpenGL 2.0}. Promoted to core in {@link GL45 OpenGL 4.5}.

+ */ +public class ARBGetTextureSubImage { + + static { GL.initialize(); } + + protected ARBGetTextureSubImage() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glGetTextureSubImage, caps.glGetCompressedTextureSubImage + ); + } + + // --- [ glGetTextureSubImage ] --- + + /** + * Unsafe version of: {@link #glGetTextureSubImage GetTextureSubImage} + * + * @param bufSize the size of the buffer to receive the retrieved pixel data + */ + public static void nglGetTextureSubImage(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, int bufSize, long pixels) { + GL45C.nglGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize, pixels); + } + + /** + * Obtains sub-regions of a texture image from a texture object. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param bufSize the size of the buffer to receive the retrieved pixel data + * @param pixels the buffer in which to place the returned data + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int bufSize, @NativeType("void *") long pixels) { + GL45C.glGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize, pixels); + } + + /** + * Obtains sub-regions of a texture image from a texture object. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels the buffer in which to place the returned data + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer pixels) { + GL45C.glGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Obtains sub-regions of a texture image from a texture object. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels the buffer in which to place the returned data + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ShortBuffer pixels) { + GL45C.glGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Obtains sub-regions of a texture image from a texture object. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels the buffer in which to place the returned data + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") IntBuffer pixels) { + GL45C.glGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Obtains sub-regions of a texture image from a texture object. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels the buffer in which to place the returned data + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") FloatBuffer pixels) { + GL45C.glGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Obtains sub-regions of a texture image from a texture object. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels the buffer in which to place the returned data + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") DoubleBuffer pixels) { + GL45C.glGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + // --- [ glGetCompressedTextureSubImage ] --- + + /** + * Unsafe version of: {@link #glGetCompressedTextureSubImage GetCompressedTextureSubImage} + * + * @param bufSize the size of the buffer to receive the retrieved pixel data + */ + public static void nglGetCompressedTextureSubImage(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int bufSize, long pixels) { + GL45C.nglGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, bufSize, pixels); + } + + /** + * Obtains a sub-region of a compressed texture image. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param bufSize the size of the buffer to receive the retrieved pixel data + * @param pixels the buffer in which to place the returned data + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLsizei") int bufSize, @NativeType("void *") long pixels) { + GL45C.glGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, bufSize, pixels); + } + + /** + * Obtains a sub-region of a compressed texture image. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param pixels the buffer in which to place the returned data + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") ByteBuffer pixels) { + GL45C.glGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels); + } + + /** + * Obtains a sub-region of a compressed texture image. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param pixels the buffer in which to place the returned data + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") ShortBuffer pixels) { + GL45C.glGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels); + } + + /** + * Obtains a sub-region of a compressed texture image. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param pixels the buffer in which to place the returned data + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") IntBuffer pixels) { + GL45C.glGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels); + } + + /** + * Obtains a sub-region of a compressed texture image. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param pixels the buffer in which to place the returned data + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") FloatBuffer pixels) { + GL45C.glGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels); + } + + /** + * Obtains a sub-region of a compressed texture image. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param pixels the buffer in which to place the returned data + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") DoubleBuffer pixels) { + GL45C.glGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels); + } + + /** Array version of: {@link #glGetTextureSubImage GetTextureSubImage} */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") short[] pixels) { + GL45C.glGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** Array version of: {@link #glGetTextureSubImage GetTextureSubImage} */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") int[] pixels) { + GL45C.glGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** Array version of: {@link #glGetTextureSubImage GetTextureSubImage} */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") float[] pixels) { + GL45C.glGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** Array version of: {@link #glGetTextureSubImage GetTextureSubImage} */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") double[] pixels) { + GL45C.glGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** Array version of: {@link #glGetCompressedTextureSubImage GetCompressedTextureSubImage} */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") short[] pixels) { + GL45C.glGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels); + } + + /** Array version of: {@link #glGetCompressedTextureSubImage GetCompressedTextureSubImage} */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") int[] pixels) { + GL45C.glGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels); + } + + /** Array version of: {@link #glGetCompressedTextureSubImage GetCompressedTextureSubImage} */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") float[] pixels) { + GL45C.glGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels); + } + + /** Array version of: {@link #glGetCompressedTextureSubImage GetCompressedTextureSubImage} */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") double[] pixels) { + GL45C.glGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBHalfFloatPixel.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBHalfFloatPixel.java new file mode 100644 index 00000000..65491f82 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBHalfFloatPixel.java @@ -0,0 +1,33 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_half_float_pixel extension. + * + *

This extension introduces a new data type for half-precision (16-bit) floating-point quantities. The floating-point format is very similar to the IEEE + * single-precision floating-point standard, except that it has only 5 exponent bits and 10 mantissa bits. Half-precision floats are smaller than full + * precision floats and provide a larger dynamic range than similarly sized normalized scalar data types.

+ * + *

This extension allows applications to use half-precision floating-point data when specifying pixel data. It extends the existing image specification + * commands to accept the new data type.

+ * + *

Floating-point data is clamped to [0, 1] at various places in the GL unless clamping is disabled with the ARB_color_buffer_float extension.

+ * + *

Requires {@link GL15 OpenGL 1.5}. Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ +public final class ARBHalfFloatPixel { + + /** + * Accepted by the {@code type} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, TexImage3D, GetTexImage, TexSubImage1D, TexSubImage2D, + * TexSubImage3D, GetHistogram, GetMinmax, ConvolutionFilter1D, ConvolutionFilter2D, GetConvolutionFilter, SeparableFilter2D, GetSeparableFilter, + * ColorTable, ColorSubTable, and GetColorTable. + */ + public static final int GL_HALF_FLOAT_ARB = 0x140B; + + private ARBHalfFloatPixel() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBHalfFloatVertex.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBHalfFloatVertex.java new file mode 100644 index 00000000..e05e03ce --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBHalfFloatVertex.java @@ -0,0 +1,31 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_half_float_vertex extension. + * + *

This extension extends the usage of the half-precision (16-bit) floating-point quantities introduced in {@link ARBHalfFloatPixel ARB_half_float_pixel} for usage in + * specifying vertex array data.

+ * + *

This extension allows applications to use half-precision floating point data when specifying vertices. This can allow applications to reduce their + * memory footprint, as well as the memory bandwidth required for vertex data.

+ * + *

This extension extends the existing vertex array commands to accept the new data type.

+ * + *

Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ +public final class ARBHalfFloatVertex { + + /** + * Accepted by the {@code type} argument of VertexPointer, NormalPointer, ColorPointer, SecondaryColorPointer, FogCoordPointer, TexCoordPointer, and + * VertexAttribPointer. + */ + public static final int GL_HALF_FLOAT = 0x140B; + + private ARBHalfFloatVertex() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBImaging.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBImaging.java new file mode 100644 index 00000000..103e59d8 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBImaging.java @@ -0,0 +1,1317 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to the OpenGL 1.2 optional imaging subset. */ +public class ARBImaging { + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev, and by the {@code target} parameter of ColorTable, CopyColorTable, ColorTableParameteriv, ColorTableParameterfv, + * GetColorTable, GetColorTableParameteriv, and GetColorTableParameterfv. + */ + public static final int + GL_COLOR_TABLE = 0x80D0, + GL_POST_CONVOLUTION_COLOR_TABLE = 0x80D1, + GL_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D2; + + /** Accepted by the {@code target} parameter of ColorTable, GetColorTableParameteriv, and GetColorTableParameterfv. */ + public static final int + GL_PROXY_COLOR_TABLE = 0x80D3, + GL_PROXY_POST_CONVOLUTION_COLOR_TABLE = 0x80D4, + GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE = 0x80D5; + + /** + * Accepted by the {@code pname} parameter of ColorTableParameteriv, ColorTableParameterfv, GetColorTableParameteriv, and + * GetColorTableParameterfv. + */ + public static final int + GL_COLOR_TABLE_SCALE = 0x80D6, + GL_COLOR_TABLE_BIAS = 0x80D7; + + /** Accepted by the {@code pname} parameter of GetColorTableParameteriv and GetColorTableParameterfv. */ + public static final int + GL_COLOR_TABLE_FORMAT = 0x80D8, + GL_COLOR_TABLE_WIDTH = 0x80D9, + GL_COLOR_TABLE_RED_SIZE = 0x80DA, + GL_COLOR_TABLE_GREEN_SIZE = 0x80DB, + GL_COLOR_TABLE_BLUE_SIZE = 0x80DC, + GL_COLOR_TABLE_ALPHA_SIZE = 0x80DD, + GL_COLOR_TABLE_LUMINANCE_SIZE = 0x80DE, + GL_COLOR_TABLE_INTENSITY_SIZE = 0x80DF; + + /** ErrorCode */ + public static final int GL_TABLE_TOO_LARGE = 0x8031; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev, and by the {@code target} parameter of ConvolutionFilter1D, CopyConvolutionFilter1D, GetConvolutionFilter, ConvolutionParameteri, + * ConvolutionParameterf, ConvolutionParameteriv, ConvolutionParameterfv, GetConvolutionParameteriv, and GetConvolutionParameterfv. + */ + public static final int GL_CONVOLUTION_1D = 0x8010; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev, and by the {@code target} parameter of ConvolutionFilter2D, CopyConvolutionFilter2D, GetConvolutionFilter, ConvolutionParameteri, + * ConvolutionParameterf, ConvolutionParameteriv, ConvolutionParameterfv, GetConvolutionParameteriv, and GetConvolutionParameterfv. + */ + public static final int GL_CONVOLUTION_2D = 0x8011; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev, and by the {@code target} parameter of SeparableFilter2D, SeparableFilter2D, GetSeparableFilter, ConvolutionParameteri, + * ConvolutionParameterf, ConvolutionParameteriv, ConvolutionParameterfv, GetConvolutionParameteriv, and GetConvolutionParameterfv. + */ + public static final int GL_SEPARABLE_2D = 0x8012; + + /** + * Accepted by the {@code pname} parameter of ConvolutionParameteri, ConvolutionParameterf, ConvolutionParameteriv, ConvolutionParameterfv, + * GetConvolutionParameteriv, and GetConvolutionParameterfv. + */ + public static final int GL_CONVOLUTION_BORDER_MODE = 0x8013; + + /** Accepted by the {@code pname} parameter of ConvolutionParameteriv, ConvolutionParameterfv, GetConvolutionParameteriv, and GetConvolutionParameterfv. */ + public static final int + GL_CONVOLUTION_FILTER_SCALE = 0x8014, + GL_CONVOLUTION_FILTER_BIAS = 0x8015; + + /** + * Accepted by the {@code param} parameter of ConvolutionParameteri, and ConvolutionParameterf, and by the {@code params} parameter of + * ConvolutionParameteriv and ConvolutionParameterfv, when the {@code pname} parameter is CONVOLUTION_BORDER_MODE. + */ + public static final int GL_REDUCE = 0x8016; + + /** Accepted by the {@code pname} parameter of GetConvolutionParameteriv and GetConvolutionParameterfv. */ + public static final int + GL_CONVOLUTION_FORMAT = 0x8017, + GL_CONVOLUTION_WIDTH = 0x8018, + GL_CONVOLUTION_HEIGHT = 0x8019, + GL_MAX_CONVOLUTION_WIDTH = 0x801A, + GL_MAX_CONVOLUTION_HEIGHT = 0x801B; + + /** + * Accepted by the {@code pname} parameter of PixelTransferi, PixelTransferf, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, + * and GetDoublev. + */ + public static final int + GL_POST_CONVOLUTION_RED_SCALE = 0x801C, + GL_POST_CONVOLUTION_GREEN_SCALE = 0x801D, + GL_POST_CONVOLUTION_BLUE_SCALE = 0x801E, + GL_POST_CONVOLUTION_ALPHA_SCALE = 0x801F, + GL_POST_CONVOLUTION_RED_BIAS = 0x8020, + GL_POST_CONVOLUTION_GREEN_BIAS = 0x8021, + GL_POST_CONVOLUTION_BLUE_BIAS = 0x8022, + GL_POST_CONVOLUTION_ALPHA_BIAS = 0x8023; + + /** + * Accepted by the {@code param} parameter of ConvolutionParameteri, and ConvolutionParameterf, and by the {@code params} parameter of + * ConvolutionParameteriv and ConvolutionParameterfv, when the {@code pname} parameter is CONVOLUTION_BORDER_MODE. + */ + public static final int + GL_CONSTANT_BORDER = 0x8151, + GL_REPLICATE_BORDER = 0x8153; + + /** Accepted by the {@code pname} parameter of ConvolutionParameteriv, ConvolutionParameterfv, GetConvolutionParameteriv, and GetConvolutionParameterfv. */ + public static final int GL_CONVOLUTION_BORDER_COLOR = 0x8154; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_COLOR_MATRIX = 0x80B1, + GL_COLOR_MATRIX_STACK_DEPTH = 0x80B2, + GL_MAX_COLOR_MATRIX_STACK_DEPTH = 0x80B3; + + /** Accepted by the {@code pname} parameter of PixelTransfer*, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_POST_COLOR_MATRIX_RED_SCALE = 0x80B4, + GL_POST_COLOR_MATRIX_GREEN_SCALE = 0x80B5, + GL_POST_COLOR_MATRIX_BLUE_SCALE = 0x80B6, + GL_POST_COLOR_MATRIX_ALPHA_SCALE = 0x80B7, + GL_POST_COLOR_MATRIX_RED_BIAS = 0x80B8, + GL_POST_COLOR_MATRIX_GREEN_BIAS = 0x80B9, + GL_POST_COLOR_MATRIX_BLUE_BIAS = 0x80BA, + GL_POST_COLOR_MATRIX_ALPHA_BIAS = 0x80BB; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev, and by the {@code target} parameter of Histogram, ResetHistogram, GetHistogram, GetHistogramParameteriv, and + * GetHistogramParameterfv. + */ + public static final int GL_HISTOGRAM = 0x8024; + + /** Accepted by the {@code target} parameter of Histogram, GetHistogramParameteriv, and GetHistogramParameterfv. */ + public static final int GL_PROXY_HISTOGRAM = 0x8025; + + /** Accepted by the {@code pname} parameter of GetHistogramParameteriv and GetHistogramParameterfv. */ + public static final int + GL_HISTOGRAM_WIDTH = 0x8026, + GL_HISTOGRAM_FORMAT = 0x8027, + GL_HISTOGRAM_RED_SIZE = 0x8028, + GL_HISTOGRAM_GREEN_SIZE = 0x8029, + GL_HISTOGRAM_BLUE_SIZE = 0x802A, + GL_HISTOGRAM_ALPHA_SIZE = 0x802B, + GL_HISTOGRAM_LUMINANCE_SIZE = 0x802C, + GL_HISTOGRAM_SINK = 0x802D; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev, and by the {@code target} parameter of Minmax, ResetMinmax, GetMinmax, GetMinmaxParameteriv, and GetMinmaxParameterfv. + */ + public static final int GL_MINMAX = 0x802E; + + /** Accepted by the {@code pname} parameter of GetMinmaxParameteriv and GetMinmaxParameterfv. */ + public static final int + GL_MINMAX_FORMAT = 0x802F, + GL_MINMAX_SINK = 0x8030; + + /** Accepted by the {@code sfactor} and {@code dfactor} parameters of BlendFunc. */ + public static final int + GL_CONSTANT_COLOR = 0x8001, + GL_ONE_MINUS_CONSTANT_COLOR = 0x8002, + GL_CONSTANT_ALPHA = 0x8003, + GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_BLEND_COLOR = 0x8005; + + /** Accepted by the {@code mode} parameter of BlendEquation. */ + public static final int + GL_FUNC_ADD = 0x8006, + GL_MIN = 0x8007, + GL_MAX = 0x8008; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_BLEND_EQUATION = 0x8009; + + /** Accepted by the {@code mode} parameter of BlendEquation. */ + public static final int + GL_FUNC_SUBTRACT = 0x800A, + GL_FUNC_REVERSE_SUBTRACT = 0x800B; + + static { GL.initialize(); } + + protected ARBImaging() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, boolean fc) { + return (fc || checkFunctions( + caps.glColorTable, caps.glCopyColorTable, caps.glColorTableParameteriv, caps.glColorTableParameterfv, caps.glGetColorTable, + caps.glGetColorTableParameteriv, caps.glGetColorTableParameterfv, caps.glColorSubTable, caps.glCopyColorSubTable, caps.glConvolutionFilter1D, + caps.glConvolutionFilter2D, caps.glCopyConvolutionFilter1D, caps.glCopyConvolutionFilter2D, caps.glGetConvolutionFilter, caps.glSeparableFilter2D, + caps.glGetSeparableFilter, caps.glConvolutionParameteri, caps.glConvolutionParameteriv, caps.glConvolutionParameterf, caps.glConvolutionParameterfv, + caps.glGetConvolutionParameteriv, caps.glGetConvolutionParameterfv, caps.glHistogram, caps.glResetHistogram, caps.glGetHistogram, + caps.glGetHistogramParameteriv, caps.glGetHistogramParameterfv, caps.glMinmax, caps.glResetMinmax, caps.glGetMinmax, caps.glGetMinmaxParameteriv, + caps.glGetMinmaxParameterfv + )) && checkFunctions( + caps.glBlendColor, caps.glBlendEquation + ); + } + + // --- [ glColorTable ] --- + + /** Unsafe version of: {@link #glColorTable ColorTable} */ + public static native void nglColorTable(int target, int internalformat, int width, int format, int type, long table); + + /** + * Specifies a color lookup table. + * + * @param target the color table target. One of:
{@link #GL_COLOR_TABLE COLOR_TABLE}{@link #GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link #GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
{@link #GL_PROXY_COLOR_TABLE PROXY_COLOR_TABLE}{@link #GL_PROXY_POST_CONVOLUTION_COLOR_TABLE PROXY_POST_CONVOLUTION_COLOR_TABLE}{@link #GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE PROXY_POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param internalformat the color table internal format. One of:
{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}
{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}
{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_LUMINANCE LUMINANCE}
{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}{@link GL11#GL_INTENSITY INTENSITY}{@link GL11#GL_ALPHA4 ALPHA4}{@link GL11#GL_ALPHA8 ALPHA8}{@link GL11#GL_ALPHA12 ALPHA12}{@link GL11#GL_ALPHA16 ALPHA16}{@link GL11#GL_LUMINANCE4 LUMINANCE4}{@link GL11#GL_LUMINANCE8 LUMINANCE8}
{@link GL11#GL_LUMINANCE12 LUMINANCE12}{@link GL11#GL_LUMINANCE16 LUMINANCE16}{@link GL11#GL_LUMINANCE4_ALPHA4 LUMINANCE4_ALPHA4}{@link GL11#GL_LUMINANCE6_ALPHA2 LUMINANCE6_ALPHA2}{@link GL11#GL_LUMINANCE8_ALPHA8 LUMINANCE8_ALPHA8}{@link GL11#GL_LUMINANCE12_ALPHA4 LUMINANCE12_ALPHA4}{@link GL11#GL_LUMINANCE12_ALPHA12 LUMINANCE12_ALPHA12}{@link GL11#GL_LUMINANCE16_ALPHA16 LUMINANCE16_ALPHA16}
{@link GL11#GL_INTENSITY4 INTENSITY4}{@link GL11#GL_INTENSITY8 INTENSITY8}{@link GL11#GL_INTENSITY12 INTENSITY12}{@link GL11#GL_INTENSITY16 INTENSITY16}{@link GL21#GL_SLUMINANCE SLUMINANCE}{@link GL21#GL_SLUMINANCE8_ALPHA8 SLUMINANCE8_ALPHA8}
+ * @param width the color table width + * @param format the color data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the color data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param table the color table data + */ + public static void glColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer table) { + nglColorTable(target, internalformat, width, format, type, memAddress(table)); + } + + /** + * Specifies a color lookup table. + * + * @param target the color table target. One of:
{@link #GL_COLOR_TABLE COLOR_TABLE}{@link #GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link #GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
{@link #GL_PROXY_COLOR_TABLE PROXY_COLOR_TABLE}{@link #GL_PROXY_POST_CONVOLUTION_COLOR_TABLE PROXY_POST_CONVOLUTION_COLOR_TABLE}{@link #GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE PROXY_POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param internalformat the color table internal format. One of:
{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}
{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}
{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_LUMINANCE LUMINANCE}
{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}{@link GL11#GL_INTENSITY INTENSITY}{@link GL11#GL_ALPHA4 ALPHA4}{@link GL11#GL_ALPHA8 ALPHA8}{@link GL11#GL_ALPHA12 ALPHA12}{@link GL11#GL_ALPHA16 ALPHA16}{@link GL11#GL_LUMINANCE4 LUMINANCE4}{@link GL11#GL_LUMINANCE8 LUMINANCE8}
{@link GL11#GL_LUMINANCE12 LUMINANCE12}{@link GL11#GL_LUMINANCE16 LUMINANCE16}{@link GL11#GL_LUMINANCE4_ALPHA4 LUMINANCE4_ALPHA4}{@link GL11#GL_LUMINANCE6_ALPHA2 LUMINANCE6_ALPHA2}{@link GL11#GL_LUMINANCE8_ALPHA8 LUMINANCE8_ALPHA8}{@link GL11#GL_LUMINANCE12_ALPHA4 LUMINANCE12_ALPHA4}{@link GL11#GL_LUMINANCE12_ALPHA12 LUMINANCE12_ALPHA12}{@link GL11#GL_LUMINANCE16_ALPHA16 LUMINANCE16_ALPHA16}
{@link GL11#GL_INTENSITY4 INTENSITY4}{@link GL11#GL_INTENSITY8 INTENSITY8}{@link GL11#GL_INTENSITY12 INTENSITY12}{@link GL11#GL_INTENSITY16 INTENSITY16}{@link GL21#GL_SLUMINANCE SLUMINANCE}{@link GL21#GL_SLUMINANCE8_ALPHA8 SLUMINANCE8_ALPHA8}
+ * @param width the color table width + * @param format the color data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the color data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param table the color table data + */ + public static void glColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long table) { + nglColorTable(target, internalformat, width, format, type, table); + } + + /** + * Specifies a color lookup table. + * + * @param target the color table target. One of:
{@link #GL_COLOR_TABLE COLOR_TABLE}{@link #GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link #GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
{@link #GL_PROXY_COLOR_TABLE PROXY_COLOR_TABLE}{@link #GL_PROXY_POST_CONVOLUTION_COLOR_TABLE PROXY_POST_CONVOLUTION_COLOR_TABLE}{@link #GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE PROXY_POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param internalformat the color table internal format. One of:
{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}
{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}
{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_LUMINANCE LUMINANCE}
{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}{@link GL11#GL_INTENSITY INTENSITY}{@link GL11#GL_ALPHA4 ALPHA4}{@link GL11#GL_ALPHA8 ALPHA8}{@link GL11#GL_ALPHA12 ALPHA12}{@link GL11#GL_ALPHA16 ALPHA16}{@link GL11#GL_LUMINANCE4 LUMINANCE4}{@link GL11#GL_LUMINANCE8 LUMINANCE8}
{@link GL11#GL_LUMINANCE12 LUMINANCE12}{@link GL11#GL_LUMINANCE16 LUMINANCE16}{@link GL11#GL_LUMINANCE4_ALPHA4 LUMINANCE4_ALPHA4}{@link GL11#GL_LUMINANCE6_ALPHA2 LUMINANCE6_ALPHA2}{@link GL11#GL_LUMINANCE8_ALPHA8 LUMINANCE8_ALPHA8}{@link GL11#GL_LUMINANCE12_ALPHA4 LUMINANCE12_ALPHA4}{@link GL11#GL_LUMINANCE12_ALPHA12 LUMINANCE12_ALPHA12}{@link GL11#GL_LUMINANCE16_ALPHA16 LUMINANCE16_ALPHA16}
{@link GL11#GL_INTENSITY4 INTENSITY4}{@link GL11#GL_INTENSITY8 INTENSITY8}{@link GL11#GL_INTENSITY12 INTENSITY12}{@link GL11#GL_INTENSITY16 INTENSITY16}{@link GL21#GL_SLUMINANCE SLUMINANCE}{@link GL21#GL_SLUMINANCE8_ALPHA8 SLUMINANCE8_ALPHA8}
+ * @param width the color table width + * @param format the color data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the color data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param table the color table data + */ + public static void glColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer table) { + nglColorTable(target, internalformat, width, format, type, memAddress(table)); + } + + /** + * Specifies a color lookup table. + * + * @param target the color table target. One of:
{@link #GL_COLOR_TABLE COLOR_TABLE}{@link #GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link #GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
{@link #GL_PROXY_COLOR_TABLE PROXY_COLOR_TABLE}{@link #GL_PROXY_POST_CONVOLUTION_COLOR_TABLE PROXY_POST_CONVOLUTION_COLOR_TABLE}{@link #GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE PROXY_POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param internalformat the color table internal format. One of:
{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}
{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}
{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_LUMINANCE LUMINANCE}
{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}{@link GL11#GL_INTENSITY INTENSITY}{@link GL11#GL_ALPHA4 ALPHA4}{@link GL11#GL_ALPHA8 ALPHA8}{@link GL11#GL_ALPHA12 ALPHA12}{@link GL11#GL_ALPHA16 ALPHA16}{@link GL11#GL_LUMINANCE4 LUMINANCE4}{@link GL11#GL_LUMINANCE8 LUMINANCE8}
{@link GL11#GL_LUMINANCE12 LUMINANCE12}{@link GL11#GL_LUMINANCE16 LUMINANCE16}{@link GL11#GL_LUMINANCE4_ALPHA4 LUMINANCE4_ALPHA4}{@link GL11#GL_LUMINANCE6_ALPHA2 LUMINANCE6_ALPHA2}{@link GL11#GL_LUMINANCE8_ALPHA8 LUMINANCE8_ALPHA8}{@link GL11#GL_LUMINANCE12_ALPHA4 LUMINANCE12_ALPHA4}{@link GL11#GL_LUMINANCE12_ALPHA12 LUMINANCE12_ALPHA12}{@link GL11#GL_LUMINANCE16_ALPHA16 LUMINANCE16_ALPHA16}
{@link GL11#GL_INTENSITY4 INTENSITY4}{@link GL11#GL_INTENSITY8 INTENSITY8}{@link GL11#GL_INTENSITY12 INTENSITY12}{@link GL11#GL_INTENSITY16 INTENSITY16}{@link GL21#GL_SLUMINANCE SLUMINANCE}{@link GL21#GL_SLUMINANCE8_ALPHA8 SLUMINANCE8_ALPHA8}
+ * @param width the color table width + * @param format the color data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the color data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param table the color table data + */ + public static void glColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer table) { + nglColorTable(target, internalformat, width, format, type, memAddress(table)); + } + + /** + * Specifies a color lookup table. + * + * @param target the color table target. One of:
{@link #GL_COLOR_TABLE COLOR_TABLE}{@link #GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link #GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
{@link #GL_PROXY_COLOR_TABLE PROXY_COLOR_TABLE}{@link #GL_PROXY_POST_CONVOLUTION_COLOR_TABLE PROXY_POST_CONVOLUTION_COLOR_TABLE}{@link #GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE PROXY_POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param internalformat the color table internal format. One of:
{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}
{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}
{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_LUMINANCE LUMINANCE}
{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}{@link GL11#GL_INTENSITY INTENSITY}{@link GL11#GL_ALPHA4 ALPHA4}{@link GL11#GL_ALPHA8 ALPHA8}{@link GL11#GL_ALPHA12 ALPHA12}{@link GL11#GL_ALPHA16 ALPHA16}{@link GL11#GL_LUMINANCE4 LUMINANCE4}{@link GL11#GL_LUMINANCE8 LUMINANCE8}
{@link GL11#GL_LUMINANCE12 LUMINANCE12}{@link GL11#GL_LUMINANCE16 LUMINANCE16}{@link GL11#GL_LUMINANCE4_ALPHA4 LUMINANCE4_ALPHA4}{@link GL11#GL_LUMINANCE6_ALPHA2 LUMINANCE6_ALPHA2}{@link GL11#GL_LUMINANCE8_ALPHA8 LUMINANCE8_ALPHA8}{@link GL11#GL_LUMINANCE12_ALPHA4 LUMINANCE12_ALPHA4}{@link GL11#GL_LUMINANCE12_ALPHA12 LUMINANCE12_ALPHA12}{@link GL11#GL_LUMINANCE16_ALPHA16 LUMINANCE16_ALPHA16}
{@link GL11#GL_INTENSITY4 INTENSITY4}{@link GL11#GL_INTENSITY8 INTENSITY8}{@link GL11#GL_INTENSITY12 INTENSITY12}{@link GL11#GL_INTENSITY16 INTENSITY16}{@link GL21#GL_SLUMINANCE SLUMINANCE}{@link GL21#GL_SLUMINANCE8_ALPHA8 SLUMINANCE8_ALPHA8}
+ * @param width the color table width + * @param format the color data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the color data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param table the color table data + */ + public static void glColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer table) { + nglColorTable(target, internalformat, width, format, type, memAddress(table)); + } + + // --- [ glCopyColorTable ] --- + + /** + * Defines a color table in exactly the manner of {@link #glColorTable ColorTable}, except that the image data are taken from the framebuffer rather than from client memory. + * + * @param target the color table target. One of:
{@link #GL_COLOR_TABLE COLOR_TABLE}{@link #GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link #GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param internalformat the color table internal format. One of:
{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}
{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}
{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_LUMINANCE LUMINANCE}
{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}{@link GL11#GL_INTENSITY INTENSITY}{@link GL11#GL_ALPHA4 ALPHA4}{@link GL11#GL_ALPHA8 ALPHA8}{@link GL11#GL_ALPHA12 ALPHA12}{@link GL11#GL_ALPHA16 ALPHA16}{@link GL11#GL_LUMINANCE4 LUMINANCE4}{@link GL11#GL_LUMINANCE8 LUMINANCE8}
{@link GL11#GL_LUMINANCE12 LUMINANCE12}{@link GL11#GL_LUMINANCE16 LUMINANCE16}{@link GL11#GL_LUMINANCE4_ALPHA4 LUMINANCE4_ALPHA4}{@link GL11#GL_LUMINANCE6_ALPHA2 LUMINANCE6_ALPHA2}{@link GL11#GL_LUMINANCE8_ALPHA8 LUMINANCE8_ALPHA8}{@link GL11#GL_LUMINANCE12_ALPHA4 LUMINANCE12_ALPHA4}{@link GL11#GL_LUMINANCE12_ALPHA12 LUMINANCE12_ALPHA12}{@link GL11#GL_LUMINANCE16_ALPHA16 LUMINANCE16_ALPHA16}
{@link GL11#GL_INTENSITY4 INTENSITY4}{@link GL11#GL_INTENSITY8 INTENSITY8}{@link GL11#GL_INTENSITY12 INTENSITY12}{@link GL11#GL_INTENSITY16 INTENSITY16}{@link GL21#GL_SLUMINANCE SLUMINANCE}{@link GL21#GL_SLUMINANCE8_ALPHA8 SLUMINANCE8_ALPHA8}
+ * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the color table width + */ + public static native void glCopyColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width); + + // --- [ glColorTableParameteriv ] --- + + /** Unsafe version of: {@link #glColorTableParameteriv ColorTableParameteriv} */ + public static native void nglColorTableParameteriv(int target, int pname, long params); + + /** + * Specifies the scale and bias parameters for a color table. + * + * @param target the color table target. One of:
{@link #GL_COLOR_TABLE COLOR_TABLE}{@link #GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link #GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param pname the parameter to set. One of:
{@link #GL_COLOR_TABLE_SCALE COLOR_TABLE_SCALE}{@link #GL_COLOR_TABLE_BIAS COLOR_TABLE_BIAS}
+ * @param params the parameter value + */ + public static void glColorTableParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglColorTableParameteriv(target, pname, memAddress(params)); + } + + // --- [ glColorTableParameterfv ] --- + + /** Unsafe version of: {@link #glColorTableParameterfv ColorTableParameterfv} */ + public static native void nglColorTableParameterfv(int target, int pname, long params); + + /** + * Float version of {@link #glColorTableParameteriv ColorTableParameteriv}. + * + * @param target the color table target + * @param pname the parameter to set + * @param params the parameter value + */ + public static void glColorTableParameterfv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglColorTableParameterfv(target, pname, memAddress(params)); + } + + // --- [ glGetColorTable ] --- + + /** Unsafe version of: {@link #glGetColorTable GetColorTable} */ + public static native void nglGetColorTable(int target, int format, int type, long table); + + /** + * Returns the current contents of a color table. + * + * @param target the color table target. One of:
{@link #GL_COLOR_TABLE COLOR_TABLE}{@link #GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link #GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param format the color data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the color data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param table the color table data + */ + public static void glGetColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer table) { + nglGetColorTable(target, format, type, memAddress(table)); + } + + /** + * Returns the current contents of a color table. + * + * @param target the color table target. One of:
{@link #GL_COLOR_TABLE COLOR_TABLE}{@link #GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link #GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param format the color data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the color data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param table the color table data + */ + public static void glGetColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") long table) { + nglGetColorTable(target, format, type, table); + } + + /** + * Returns the current contents of a color table. + * + * @param target the color table target. One of:
{@link #GL_COLOR_TABLE COLOR_TABLE}{@link #GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link #GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param format the color data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the color data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param table the color table data + */ + public static void glGetColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ShortBuffer table) { + nglGetColorTable(target, format, type, memAddress(table)); + } + + /** + * Returns the current contents of a color table. + * + * @param target the color table target. One of:
{@link #GL_COLOR_TABLE COLOR_TABLE}{@link #GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link #GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param format the color data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the color data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param table the color table data + */ + public static void glGetColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") IntBuffer table) { + nglGetColorTable(target, format, type, memAddress(table)); + } + + /** + * Returns the current contents of a color table. + * + * @param target the color table target. One of:
{@link #GL_COLOR_TABLE COLOR_TABLE}{@link #GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link #GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param format the color data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the color data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param table the color table data + */ + public static void glGetColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") FloatBuffer table) { + nglGetColorTable(target, format, type, memAddress(table)); + } + + // --- [ glGetColorTableParameteriv ] --- + + /** Unsafe version of: {@link #glGetColorTableParameteriv GetColorTableParameteriv} */ + public static native void nglGetColorTableParameteriv(int target, int pname, long params); + + /** + * Returns the integer value of the specified color table parameter. + * + * @param target the color table target. One of:
{@link #GL_COLOR_TABLE COLOR_TABLE}{@link #GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link #GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
{@link #GL_PROXY_COLOR_TABLE PROXY_COLOR_TABLE}{@link #GL_PROXY_POST_CONVOLUTION_COLOR_TABLE PROXY_POST_CONVOLUTION_COLOR_TABLE}{@link #GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE PROXY_POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param pname the parameter to query. One of:
{@link #GL_COLOR_TABLE_SCALE COLOR_TABLE_SCALE}{@link #GL_COLOR_TABLE_BIAS COLOR_TABLE_BIAS}{@link #GL_COLOR_TABLE_FORMAT COLOR_TABLE_FORMAT}
{@link #GL_COLOR_TABLE_WIDTH COLOR_TABLE_WIDTH}{@link #GL_COLOR_TABLE_RED_SIZE COLOR_TABLE_RED_SIZE}{@link #GL_COLOR_TABLE_GREEN_SIZE COLOR_TABLE_GREEN_SIZE}
{@link #GL_COLOR_TABLE_BLUE_SIZE COLOR_TABLE_BLUE_SIZE}{@link #GL_COLOR_TABLE_ALPHA_SIZE COLOR_TABLE_ALPHA_SIZE}{@link #GL_COLOR_TABLE_LUMINANCE_SIZE COLOR_TABLE_LUMINANCE_SIZE}
{@link #GL_COLOR_TABLE_INTENSITY_SIZE COLOR_TABLE_INTENSITY_SIZE}
+ * @param params a buffer in which to place the returned value + */ + public static void glGetColorTableParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglGetColorTableParameteriv(target, pname, memAddress(params)); + } + + /** + * Returns the integer value of the specified color table parameter. + * + * @param target the color table target. One of:
{@link #GL_COLOR_TABLE COLOR_TABLE}{@link #GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link #GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
{@link #GL_PROXY_COLOR_TABLE PROXY_COLOR_TABLE}{@link #GL_PROXY_POST_CONVOLUTION_COLOR_TABLE PROXY_POST_CONVOLUTION_COLOR_TABLE}{@link #GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE PROXY_POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param pname the parameter to query. One of:
{@link #GL_COLOR_TABLE_SCALE COLOR_TABLE_SCALE}{@link #GL_COLOR_TABLE_BIAS COLOR_TABLE_BIAS}{@link #GL_COLOR_TABLE_FORMAT COLOR_TABLE_FORMAT}
{@link #GL_COLOR_TABLE_WIDTH COLOR_TABLE_WIDTH}{@link #GL_COLOR_TABLE_RED_SIZE COLOR_TABLE_RED_SIZE}{@link #GL_COLOR_TABLE_GREEN_SIZE COLOR_TABLE_GREEN_SIZE}
{@link #GL_COLOR_TABLE_BLUE_SIZE COLOR_TABLE_BLUE_SIZE}{@link #GL_COLOR_TABLE_ALPHA_SIZE COLOR_TABLE_ALPHA_SIZE}{@link #GL_COLOR_TABLE_LUMINANCE_SIZE COLOR_TABLE_LUMINANCE_SIZE}
{@link #GL_COLOR_TABLE_INTENSITY_SIZE COLOR_TABLE_INTENSITY_SIZE}
+ */ + @NativeType("void") + public static int glGetColorTableParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetColorTableParameteriv(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetColorTableParameterfv ] --- + + /** Unsafe version of: {@link #glGetColorTableParameterfv GetColorTableParameterfv} */ + public static native void nglGetColorTableParameterfv(int target, int pname, long params); + + /** + * Float version of {@link #glGetColorTableParameteriv GetColorTableParameteriv}. + * + * @param target the color table target + * @param pname the parameter to query + * @param params a buffer in which to place the returned value + */ + public static void glGetColorTableParameterfv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglGetColorTableParameterfv(target, pname, memAddress(params)); + } + + /** + * Float version of {@link #glGetColorTableParameteriv GetColorTableParameteriv}. + * + * @param target the color table target + * @param pname the parameter to query + */ + @NativeType("void") + public static float glGetColorTableParameterf(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer params = stack.callocFloat(1); + nglGetColorTableParameterfv(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glColorSubTable ] --- + + /** Unsafe version of: {@link #glColorSubTable ColorSubTable} */ + public static native void nglColorSubTable(int target, int start, int count, int format, int type, long data); + + /** + * Respecifies a portion of an existing color table. + * + * @param target the color table target. One of:
{@link #GL_COLOR_TABLE COLOR_TABLE}{@link #GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link #GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param start the starting index of the subregion to respecify + * @param count the number of colors in the subregion to respecify + * @param format the color data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the color data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param data the color table data + */ + public static void glColorSubTable(@NativeType("GLenum") int target, @NativeType("GLsizei") int start, @NativeType("GLsizei") int count, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer data) { + nglColorSubTable(target, start, count, format, type, memAddress(data)); + } + + /** + * Respecifies a portion of an existing color table. + * + * @param target the color table target. One of:
{@link #GL_COLOR_TABLE COLOR_TABLE}{@link #GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link #GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param start the starting index of the subregion to respecify + * @param count the number of colors in the subregion to respecify + * @param format the color data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the color data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param data the color table data + */ + public static void glColorSubTable(@NativeType("GLenum") int target, @NativeType("GLsizei") int start, @NativeType("GLsizei") int count, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long data) { + nglColorSubTable(target, start, count, format, type, data); + } + + // --- [ glCopyColorSubTable ] --- + + /** + * Respecifies a portion of an existing color table using image taken from the framebuffer. + * + * @param target the color table target. One of:
{@link #GL_COLOR_TABLE COLOR_TABLE}{@link #GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link #GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param start the start index of the subregion to respecify + * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the number of colors in the subregion to respecify + */ + public static native void glCopyColorSubTable(@NativeType("GLenum") int target, @NativeType("GLsizei") int start, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width); + + // --- [ glConvolutionFilter1D ] --- + + /** Unsafe version of: {@link #glConvolutionFilter1D ConvolutionFilter1D} */ + public static native void nglConvolutionFilter1D(int target, int internalformat, int width, int format, int type, long data); + + /** + * Defines a one-dimensional convolution filter. + * + * @param target the convolution target. Must be:
{@link #GL_CONVOLUTION_1D CONVOLUTION_1D}
+ * @param internalformat the filter internal format. One of:
{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}
{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}
{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_LUMINANCE LUMINANCE}
{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}{@link GL11#GL_INTENSITY INTENSITY}{@link GL11#GL_ALPHA4 ALPHA4}{@link GL11#GL_ALPHA8 ALPHA8}{@link GL11#GL_ALPHA12 ALPHA12}{@link GL11#GL_ALPHA16 ALPHA16}{@link GL11#GL_LUMINANCE4 LUMINANCE4}{@link GL11#GL_LUMINANCE8 LUMINANCE8}
{@link GL11#GL_LUMINANCE12 LUMINANCE12}{@link GL11#GL_LUMINANCE16 LUMINANCE16}{@link GL11#GL_LUMINANCE4_ALPHA4 LUMINANCE4_ALPHA4}{@link GL11#GL_LUMINANCE6_ALPHA2 LUMINANCE6_ALPHA2}{@link GL11#GL_LUMINANCE8_ALPHA8 LUMINANCE8_ALPHA8}{@link GL11#GL_LUMINANCE12_ALPHA4 LUMINANCE12_ALPHA4}{@link GL11#GL_LUMINANCE12_ALPHA12 LUMINANCE12_ALPHA12}{@link GL11#GL_LUMINANCE16_ALPHA16 LUMINANCE16_ALPHA16}
{@link GL11#GL_INTENSITY4 INTENSITY4}{@link GL11#GL_INTENSITY8 INTENSITY8}{@link GL11#GL_INTENSITY12 INTENSITY12}{@link GL11#GL_INTENSITY16 INTENSITY16}{@link GL21#GL_SLUMINANCE SLUMINANCE}{@link GL21#GL_SLUMINANCE8_ALPHA8 SLUMINANCE8_ALPHA8}
+ * @param width the filter width + * @param format the filter data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the filter data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param data the filter data + */ + public static void glConvolutionFilter1D(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer data) { + nglConvolutionFilter1D(target, internalformat, width, format, type, memAddress(data)); + } + + /** + * Defines a one-dimensional convolution filter. + * + * @param target the convolution target. Must be:
{@link #GL_CONVOLUTION_1D CONVOLUTION_1D}
+ * @param internalformat the filter internal format. One of:
{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}
{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}
{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_LUMINANCE LUMINANCE}
{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}{@link GL11#GL_INTENSITY INTENSITY}{@link GL11#GL_ALPHA4 ALPHA4}{@link GL11#GL_ALPHA8 ALPHA8}{@link GL11#GL_ALPHA12 ALPHA12}{@link GL11#GL_ALPHA16 ALPHA16}{@link GL11#GL_LUMINANCE4 LUMINANCE4}{@link GL11#GL_LUMINANCE8 LUMINANCE8}
{@link GL11#GL_LUMINANCE12 LUMINANCE12}{@link GL11#GL_LUMINANCE16 LUMINANCE16}{@link GL11#GL_LUMINANCE4_ALPHA4 LUMINANCE4_ALPHA4}{@link GL11#GL_LUMINANCE6_ALPHA2 LUMINANCE6_ALPHA2}{@link GL11#GL_LUMINANCE8_ALPHA8 LUMINANCE8_ALPHA8}{@link GL11#GL_LUMINANCE12_ALPHA4 LUMINANCE12_ALPHA4}{@link GL11#GL_LUMINANCE12_ALPHA12 LUMINANCE12_ALPHA12}{@link GL11#GL_LUMINANCE16_ALPHA16 LUMINANCE16_ALPHA16}
{@link GL11#GL_INTENSITY4 INTENSITY4}{@link GL11#GL_INTENSITY8 INTENSITY8}{@link GL11#GL_INTENSITY12 INTENSITY12}{@link GL11#GL_INTENSITY16 INTENSITY16}{@link GL21#GL_SLUMINANCE SLUMINANCE}{@link GL21#GL_SLUMINANCE8_ALPHA8 SLUMINANCE8_ALPHA8}
+ * @param width the filter width + * @param format the filter data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the filter data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param data the filter data + */ + public static void glConvolutionFilter1D(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long data) { + nglConvolutionFilter1D(target, internalformat, width, format, type, data); + } + + // --- [ glConvolutionFilter2D ] --- + + /** Unsafe version of: {@link #glConvolutionFilter2D ConvolutionFilter2D} */ + public static native void nglConvolutionFilter2D(int target, int internalformat, int width, int height, int format, int type, long data); + + /** + * Defines a two-dimensional convolution filter. + * + * @param target the convolution target. Must be:
{@link #GL_CONVOLUTION_2D CONVOLUTION_2D}
+ * @param internalformat the filter internal format. One of:
{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}
{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}
{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_LUMINANCE LUMINANCE}
{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}{@link GL11#GL_INTENSITY INTENSITY}{@link GL11#GL_ALPHA4 ALPHA4}{@link GL11#GL_ALPHA8 ALPHA8}{@link GL11#GL_ALPHA12 ALPHA12}{@link GL11#GL_ALPHA16 ALPHA16}{@link GL11#GL_LUMINANCE4 LUMINANCE4}{@link GL11#GL_LUMINANCE8 LUMINANCE8}
{@link GL11#GL_LUMINANCE12 LUMINANCE12}{@link GL11#GL_LUMINANCE16 LUMINANCE16}{@link GL11#GL_LUMINANCE4_ALPHA4 LUMINANCE4_ALPHA4}{@link GL11#GL_LUMINANCE6_ALPHA2 LUMINANCE6_ALPHA2}{@link GL11#GL_LUMINANCE8_ALPHA8 LUMINANCE8_ALPHA8}{@link GL11#GL_LUMINANCE12_ALPHA4 LUMINANCE12_ALPHA4}{@link GL11#GL_LUMINANCE12_ALPHA12 LUMINANCE12_ALPHA12}{@link GL11#GL_LUMINANCE16_ALPHA16 LUMINANCE16_ALPHA16}
{@link GL11#GL_INTENSITY4 INTENSITY4}{@link GL11#GL_INTENSITY8 INTENSITY8}{@link GL11#GL_INTENSITY12 INTENSITY12}{@link GL11#GL_INTENSITY16 INTENSITY16}{@link GL21#GL_SLUMINANCE SLUMINANCE}{@link GL21#GL_SLUMINANCE8_ALPHA8 SLUMINANCE8_ALPHA8}
+ * @param width the filter width + * @param height the filter height + * @param format the filter data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the filter data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param data the filter data + */ + public static void glConvolutionFilter2D(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer data) { + nglConvolutionFilter2D(target, internalformat, width, height, format, type, memAddress(data)); + } + + /** + * Defines a two-dimensional convolution filter. + * + * @param target the convolution target. Must be:
{@link #GL_CONVOLUTION_2D CONVOLUTION_2D}
+ * @param internalformat the filter internal format. One of:
{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}
{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}
{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_LUMINANCE LUMINANCE}
{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}{@link GL11#GL_INTENSITY INTENSITY}{@link GL11#GL_ALPHA4 ALPHA4}{@link GL11#GL_ALPHA8 ALPHA8}{@link GL11#GL_ALPHA12 ALPHA12}{@link GL11#GL_ALPHA16 ALPHA16}{@link GL11#GL_LUMINANCE4 LUMINANCE4}{@link GL11#GL_LUMINANCE8 LUMINANCE8}
{@link GL11#GL_LUMINANCE12 LUMINANCE12}{@link GL11#GL_LUMINANCE16 LUMINANCE16}{@link GL11#GL_LUMINANCE4_ALPHA4 LUMINANCE4_ALPHA4}{@link GL11#GL_LUMINANCE6_ALPHA2 LUMINANCE6_ALPHA2}{@link GL11#GL_LUMINANCE8_ALPHA8 LUMINANCE8_ALPHA8}{@link GL11#GL_LUMINANCE12_ALPHA4 LUMINANCE12_ALPHA4}{@link GL11#GL_LUMINANCE12_ALPHA12 LUMINANCE12_ALPHA12}{@link GL11#GL_LUMINANCE16_ALPHA16 LUMINANCE16_ALPHA16}
{@link GL11#GL_INTENSITY4 INTENSITY4}{@link GL11#GL_INTENSITY8 INTENSITY8}{@link GL11#GL_INTENSITY12 INTENSITY12}{@link GL11#GL_INTENSITY16 INTENSITY16}{@link GL21#GL_SLUMINANCE SLUMINANCE}{@link GL21#GL_SLUMINANCE8_ALPHA8 SLUMINANCE8_ALPHA8}
+ * @param width the filter width + * @param height the filter height + * @param format the filter data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the filter data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param data the filter data + */ + public static void glConvolutionFilter2D(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long data) { + nglConvolutionFilter2D(target, internalformat, width, height, format, type, data); + } + + // --- [ glCopyConvolutionFilter1D ] --- + + /** + * Defines a one-dimensional filter in exactly the manner of {@link #glConvolutionFilter1D ConvolutionFilter1D}, except that image data are taken from the framebuffer, rather than from + * client memory. + * + * @param target the convolution target. Must be:
{@link #GL_CONVOLUTION_1D CONVOLUTION_1D}
+ * @param internalformat the filter internal format. One of:
{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}
{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}
{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_LUMINANCE LUMINANCE}
{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}{@link GL11#GL_INTENSITY INTENSITY}{@link GL11#GL_ALPHA4 ALPHA4}{@link GL11#GL_ALPHA8 ALPHA8}{@link GL11#GL_ALPHA12 ALPHA12}{@link GL11#GL_ALPHA16 ALPHA16}{@link GL11#GL_LUMINANCE4 LUMINANCE4}{@link GL11#GL_LUMINANCE8 LUMINANCE8}
{@link GL11#GL_LUMINANCE12 LUMINANCE12}{@link GL11#GL_LUMINANCE16 LUMINANCE16}{@link GL11#GL_LUMINANCE4_ALPHA4 LUMINANCE4_ALPHA4}{@link GL11#GL_LUMINANCE6_ALPHA2 LUMINANCE6_ALPHA2}{@link GL11#GL_LUMINANCE8_ALPHA8 LUMINANCE8_ALPHA8}{@link GL11#GL_LUMINANCE12_ALPHA4 LUMINANCE12_ALPHA4}{@link GL11#GL_LUMINANCE12_ALPHA12 LUMINANCE12_ALPHA12}{@link GL11#GL_LUMINANCE16_ALPHA16 LUMINANCE16_ALPHA16}
{@link GL11#GL_INTENSITY4 INTENSITY4}{@link GL11#GL_INTENSITY8 INTENSITY8}{@link GL11#GL_INTENSITY12 INTENSITY12}{@link GL11#GL_INTENSITY16 INTENSITY16}{@link GL21#GL_SLUMINANCE SLUMINANCE}{@link GL21#GL_SLUMINANCE8_ALPHA8 SLUMINANCE8_ALPHA8}
+ * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the filter width + */ + public static native void glCopyConvolutionFilter1D(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width); + + // --- [ glCopyConvolutionFilter2D ] --- + + /** + * Defines a two-dimensional filter in exactly the manner of {@link #glConvolutionFilter1D ConvolutionFilter1D}, except that image data are taken from the framebuffer, rather than from + * client memory. + * + * @param target the convolution target. Must be:
{@link #GL_CONVOLUTION_2D CONVOLUTION_2D}
+ * @param internalformat the filter internal format. One of:
{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}
{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}
{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_LUMINANCE LUMINANCE}
{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}{@link GL11#GL_INTENSITY INTENSITY}{@link GL11#GL_ALPHA4 ALPHA4}{@link GL11#GL_ALPHA8 ALPHA8}{@link GL11#GL_ALPHA12 ALPHA12}{@link GL11#GL_ALPHA16 ALPHA16}{@link GL11#GL_LUMINANCE4 LUMINANCE4}{@link GL11#GL_LUMINANCE8 LUMINANCE8}
{@link GL11#GL_LUMINANCE12 LUMINANCE12}{@link GL11#GL_LUMINANCE16 LUMINANCE16}{@link GL11#GL_LUMINANCE4_ALPHA4 LUMINANCE4_ALPHA4}{@link GL11#GL_LUMINANCE6_ALPHA2 LUMINANCE6_ALPHA2}{@link GL11#GL_LUMINANCE8_ALPHA8 LUMINANCE8_ALPHA8}{@link GL11#GL_LUMINANCE12_ALPHA4 LUMINANCE12_ALPHA4}{@link GL11#GL_LUMINANCE12_ALPHA12 LUMINANCE12_ALPHA12}{@link GL11#GL_LUMINANCE16_ALPHA16 LUMINANCE16_ALPHA16}
{@link GL11#GL_INTENSITY4 INTENSITY4}{@link GL11#GL_INTENSITY8 INTENSITY8}{@link GL11#GL_INTENSITY12 INTENSITY12}{@link GL11#GL_INTENSITY16 INTENSITY16}{@link GL21#GL_SLUMINANCE SLUMINANCE}{@link GL21#GL_SLUMINANCE8_ALPHA8 SLUMINANCE8_ALPHA8}
+ * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the filter width + * @param height the filter height + */ + public static native void glCopyConvolutionFilter2D(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glGetConvolutionFilter ] --- + + /** Unsafe version of: {@link #glGetConvolutionFilter GetConvolutionFilter} */ + public static native void nglGetConvolutionFilter(int target, int format, int type, long image); + + /** + * Returns the contents of a convolution filter. + * + * @param target the convolution target. One of:
{@link #GL_CONVOLUTION_1D CONVOLUTION_1D}{@link #GL_CONVOLUTION_2D CONVOLUTION_2D}
+ * @param format the filter data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the filter data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param image the filter data + */ + public static void glGetConvolutionFilter(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer image) { + nglGetConvolutionFilter(target, format, type, memAddress(image)); + } + + /** + * Returns the contents of a convolution filter. + * + * @param target the convolution target. One of:
{@link #GL_CONVOLUTION_1D CONVOLUTION_1D}{@link #GL_CONVOLUTION_2D CONVOLUTION_2D}
+ * @param format the filter data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the filter data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param image the filter data + */ + public static void glGetConvolutionFilter(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") long image) { + nglGetConvolutionFilter(target, format, type, image); + } + + // --- [ glSeparableFilter2D ] --- + + /** Unsafe version of: {@link #glSeparableFilter2D SeparableFilter2D} */ + public static native void nglSeparableFilter2D(int target, int internalformat, int width, int height, int format, int type, long row, long column); + + /** + * Specifies a two-dimensional separable convolution filter. + * + * @param target the filter target. Must be:
{@link #GL_SEPARABLE_2D SEPARABLE_2D}
+ * @param internalformat the filter internal format. One of:
{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}
{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}
{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_LUMINANCE LUMINANCE}
{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}{@link GL11#GL_INTENSITY INTENSITY}{@link GL11#GL_ALPHA4 ALPHA4}{@link GL11#GL_ALPHA8 ALPHA8}{@link GL11#GL_ALPHA12 ALPHA12}{@link GL11#GL_ALPHA16 ALPHA16}{@link GL11#GL_LUMINANCE4 LUMINANCE4}{@link GL11#GL_LUMINANCE8 LUMINANCE8}
{@link GL11#GL_LUMINANCE12 LUMINANCE12}{@link GL11#GL_LUMINANCE16 LUMINANCE16}{@link GL11#GL_LUMINANCE4_ALPHA4 LUMINANCE4_ALPHA4}{@link GL11#GL_LUMINANCE6_ALPHA2 LUMINANCE6_ALPHA2}{@link GL11#GL_LUMINANCE8_ALPHA8 LUMINANCE8_ALPHA8}{@link GL11#GL_LUMINANCE12_ALPHA4 LUMINANCE12_ALPHA4}{@link GL11#GL_LUMINANCE12_ALPHA12 LUMINANCE12_ALPHA12}{@link GL11#GL_LUMINANCE16_ALPHA16 LUMINANCE16_ALPHA16}
{@link GL11#GL_INTENSITY4 INTENSITY4}{@link GL11#GL_INTENSITY8 INTENSITY8}{@link GL11#GL_INTENSITY12 INTENSITY12}{@link GL11#GL_INTENSITY16 INTENSITY16}{@link GL21#GL_SLUMINANCE SLUMINANCE}{@link GL21#GL_SLUMINANCE8_ALPHA8 SLUMINANCE8_ALPHA8}
+ * @param width the filter width + * @param height the filter height + * @param format the filter data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the filter data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param row the horizontal filter data + * @param column the vertical filter data + */ + public static void glSeparableFilter2D(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer row, @NativeType("void const *") ByteBuffer column) { + nglSeparableFilter2D(target, internalformat, width, height, format, type, memAddress(row), memAddress(column)); + } + + /** + * Specifies a two-dimensional separable convolution filter. + * + * @param target the filter target. Must be:
{@link #GL_SEPARABLE_2D SEPARABLE_2D}
+ * @param internalformat the filter internal format. One of:
{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}
{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}
{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_LUMINANCE LUMINANCE}
{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}{@link GL11#GL_INTENSITY INTENSITY}{@link GL11#GL_ALPHA4 ALPHA4}{@link GL11#GL_ALPHA8 ALPHA8}{@link GL11#GL_ALPHA12 ALPHA12}{@link GL11#GL_ALPHA16 ALPHA16}{@link GL11#GL_LUMINANCE4 LUMINANCE4}{@link GL11#GL_LUMINANCE8 LUMINANCE8}
{@link GL11#GL_LUMINANCE12 LUMINANCE12}{@link GL11#GL_LUMINANCE16 LUMINANCE16}{@link GL11#GL_LUMINANCE4_ALPHA4 LUMINANCE4_ALPHA4}{@link GL11#GL_LUMINANCE6_ALPHA2 LUMINANCE6_ALPHA2}{@link GL11#GL_LUMINANCE8_ALPHA8 LUMINANCE8_ALPHA8}{@link GL11#GL_LUMINANCE12_ALPHA4 LUMINANCE12_ALPHA4}{@link GL11#GL_LUMINANCE12_ALPHA12 LUMINANCE12_ALPHA12}{@link GL11#GL_LUMINANCE16_ALPHA16 LUMINANCE16_ALPHA16}
{@link GL11#GL_INTENSITY4 INTENSITY4}{@link GL11#GL_INTENSITY8 INTENSITY8}{@link GL11#GL_INTENSITY12 INTENSITY12}{@link GL11#GL_INTENSITY16 INTENSITY16}{@link GL21#GL_SLUMINANCE SLUMINANCE}{@link GL21#GL_SLUMINANCE8_ALPHA8 SLUMINANCE8_ALPHA8}
+ * @param width the filter width + * @param height the filter height + * @param format the filter data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the filter data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param row the horizontal filter data + * @param column the vertical filter data + */ + public static void glSeparableFilter2D(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long row, @NativeType("void const *") long column) { + nglSeparableFilter2D(target, internalformat, width, height, format, type, row, column); + } + + // --- [ glGetSeparableFilter ] --- + + /** Unsafe version of: {@link #glGetSeparableFilter GetSeparableFilter} */ + public static native void nglGetSeparableFilter(int target, int format, int type, long row, long column, long span); + + /** + * Returns the current contents of a separable convolution filter. + * + * @param target the filter target. Must be:
{@link #GL_SEPARABLE_2D SEPARABLE_2D}
+ * @param format the filter data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the filter data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param row a buffer in which to return the filter row + * @param column a buffer in which to return the filter column + * @param span unused + */ + public static void glGetSeparableFilter(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer row, @NativeType("void *") ByteBuffer column, @Nullable @NativeType("void *") ByteBuffer span) { + nglGetSeparableFilter(target, format, type, memAddress(row), memAddress(column), memAddressSafe(span)); + } + + /** + * Returns the current contents of a separable convolution filter. + * + * @param target the filter target. Must be:
{@link #GL_SEPARABLE_2D SEPARABLE_2D}
+ * @param format the filter data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the filter data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param row a buffer in which to return the filter row + * @param column a buffer in which to return the filter column + * @param span unused + */ + public static void glGetSeparableFilter(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") long row, @NativeType("void *") long column, @Nullable @NativeType("void *") ByteBuffer span) { + nglGetSeparableFilter(target, format, type, row, column, memAddressSafe(span)); + } + + // --- [ glConvolutionParameteri ] --- + + /** + * Specifies the scale and bias of a convolution filter. + * + * @param target the filter target. One of:
{@link #GL_CONVOLUTION_1D CONVOLUTION_1D}{@link #GL_CONVOLUTION_2D CONVOLUTION_2D}{@link #GL_SEPARABLE_2D SEPARABLE_2D}
+ * @param pname the parameter to set. Must be:
{@link #GL_CONVOLUTION_BORDER_MODE CONVOLUTION_BORDER_MODE}
+ * @param param the parameter value + */ + public static native void glConvolutionParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint") int param); + + // --- [ glConvolutionParameteriv ] --- + + /** Unsafe version of: {@link #glConvolutionParameteriv ConvolutionParameteriv} */ + public static native void nglConvolutionParameteriv(int target, int pname, long params); + + /** + * Pointer version of {@link #glConvolutionParameteri ConvolutionParameteri}. + * + * @param target the filter target + * @param pname the parameter to set. One of:
{@link #GL_CONVOLUTION_FILTER_SCALE CONVOLUTION_FILTER_SCALE}{@link #GL_CONVOLUTION_FILTER_BIAS CONVOLUTION_FILTER_BIAS}{@link #GL_CONVOLUTION_BORDER_COLOR CONVOLUTION_BORDER_COLOR}
+ * @param params the parameter value + */ + public static void glConvolutionParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglConvolutionParameteriv(target, pname, memAddress(params)); + } + + // --- [ glConvolutionParameterf ] --- + + /** + * Float version of {@link #glConvolutionParameteri ConvolutionParameteri} + * + * @param target the filter target + * @param pname the parameter to set + * @param param the parameter value + */ + public static native void glConvolutionParameterf(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat") float param); + + // --- [ glConvolutionParameterfv ] --- + + /** Unsafe version of: {@link #glConvolutionParameterfv ConvolutionParameterfv} */ + public static native void nglConvolutionParameterfv(int target, int pname, long params); + + /** + * Pointer version of {@link #glConvolutionParameterf ConvolutionParameterf}. + * + * @param target the filter target + * @param pname the parameter to set. One of:
{@link #GL_CONVOLUTION_FILTER_SCALE CONVOLUTION_FILTER_SCALE}{@link #GL_CONVOLUTION_FILTER_BIAS CONVOLUTION_FILTER_BIAS}{@link #GL_CONVOLUTION_BORDER_COLOR CONVOLUTION_BORDER_COLOR}
+ * @param params the parameter value + */ + public static void glConvolutionParameterfv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglConvolutionParameterfv(target, pname, memAddress(params)); + } + + // --- [ glGetConvolutionParameteriv ] --- + + /** Unsafe version of: {@link #glGetConvolutionParameteriv GetConvolutionParameteriv} */ + public static native void nglGetConvolutionParameteriv(int target, int pname, long params); + + /** + * Returns the value of a convolution filter parameter. + * + * @param target the filter target. One of:
{@link #GL_CONVOLUTION_1D CONVOLUTION_1D}{@link #GL_CONVOLUTION_2D CONVOLUTION_2D}{@link #GL_SEPARABLE_2D SEPARABLE_2D}
+ * @param pname the parameter to query. One of:
{@link #GL_CONVOLUTION_FORMAT CONVOLUTION_FORMAT}{@link #GL_CONVOLUTION_WIDTH CONVOLUTION_WIDTH}{@link #GL_CONVOLUTION_HEIGHT CONVOLUTION_HEIGHT}{@link #GL_MAX_CONVOLUTION_WIDTH MAX_CONVOLUTION_WIDTH}
{@link #GL_MAX_CONVOLUTION_HEIGHT MAX_CONVOLUTION_HEIGHT}
+ * @param params a buffer in which to return the parameter value + */ + public static void glGetConvolutionParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglGetConvolutionParameteriv(target, pname, memAddress(params)); + } + + /** + * Returns the value of a convolution filter parameter. + * + * @param target the filter target. One of:
{@link #GL_CONVOLUTION_1D CONVOLUTION_1D}{@link #GL_CONVOLUTION_2D CONVOLUTION_2D}{@link #GL_SEPARABLE_2D SEPARABLE_2D}
+ * @param pname the parameter to query. One of:
{@link #GL_CONVOLUTION_FORMAT CONVOLUTION_FORMAT}{@link #GL_CONVOLUTION_WIDTH CONVOLUTION_WIDTH}{@link #GL_CONVOLUTION_HEIGHT CONVOLUTION_HEIGHT}{@link #GL_MAX_CONVOLUTION_WIDTH MAX_CONVOLUTION_WIDTH}
{@link #GL_MAX_CONVOLUTION_HEIGHT MAX_CONVOLUTION_HEIGHT}
+ */ + @NativeType("void") + public static int glGetConvolutionParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetConvolutionParameteriv(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetConvolutionParameterfv ] --- + + /** Unsafe version of: {@link #glGetConvolutionParameterfv GetConvolutionParameterfv} */ + public static native void nglGetConvolutionParameterfv(int target, int pname, long params); + + /** + * Float version of {@link #glGetConvolutionParameteriv GetConvolutionParameteriv}. + * + * @param target the filter target + * @param pname the parameter to query + * @param params a buffer in which to return the parameter value + */ + public static void glGetConvolutionParameterfv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglGetConvolutionParameterfv(target, pname, memAddress(params)); + } + + /** + * Float version of {@link #glGetConvolutionParameteriv GetConvolutionParameteriv}. + * + * @param target the filter target + * @param pname the parameter to query + */ + @NativeType("void") + public static float glGetConvolutionParameterf(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer params = stack.callocFloat(1); + nglGetConvolutionParameterfv(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glHistogram ] --- + + /** + * Specifies the histogram table. + * + * @param target the histogram target. One of:
{@link #GL_HISTOGRAM HISTOGRAM}{@link #GL_PROXY_HISTOGRAM PROXY_HISTOGRAM}
+ * @param width the histogram width + * @param internalformat the histogram internal format. One of:
{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}
{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}
{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_LUMINANCE LUMINANCE}
{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}{@link GL11#GL_INTENSITY INTENSITY}{@link GL11#GL_ALPHA4 ALPHA4}{@link GL11#GL_ALPHA8 ALPHA8}{@link GL11#GL_ALPHA12 ALPHA12}{@link GL11#GL_ALPHA16 ALPHA16}{@link GL11#GL_LUMINANCE4 LUMINANCE4}{@link GL11#GL_LUMINANCE8 LUMINANCE8}
{@link GL11#GL_LUMINANCE12 LUMINANCE12}{@link GL11#GL_LUMINANCE16 LUMINANCE16}{@link GL11#GL_LUMINANCE4_ALPHA4 LUMINANCE4_ALPHA4}{@link GL11#GL_LUMINANCE6_ALPHA2 LUMINANCE6_ALPHA2}{@link GL11#GL_LUMINANCE8_ALPHA8 LUMINANCE8_ALPHA8}{@link GL11#GL_LUMINANCE12_ALPHA4 LUMINANCE12_ALPHA4}{@link GL11#GL_LUMINANCE12_ALPHA12 LUMINANCE12_ALPHA12}{@link GL11#GL_LUMINANCE16_ALPHA16 LUMINANCE16_ALPHA16}
{@link GL11#GL_INTENSITY4 INTENSITY4}{@link GL11#GL_INTENSITY8 INTENSITY8}{@link GL11#GL_INTENSITY12 INTENSITY12}{@link GL11#GL_INTENSITY16 INTENSITY16}{@link GL21#GL_SLUMINANCE SLUMINANCE}{@link GL21#GL_SLUMINANCE8_ALPHA8 SLUMINANCE8_ALPHA8}
+ * @param sink whether pixel groups will be consumed by the histogram operation ({@link GL11#GL_TRUE TRUE}) or passed on to the minmax operation ({@link GL11#GL_FALSE FALSE}) + */ + public static native void glHistogram(@NativeType("GLenum") int target, @NativeType("GLsizei") int width, @NativeType("GLenum") int internalformat, @NativeType("GLboolean") boolean sink); + + // --- [ glResetHistogram ] --- + + /** + * Resets all counters of all elements of the histogram table to zero. + * + * @param target the histogram target. Must be:
{@link #GL_HISTOGRAM HISTOGRAM}
+ */ + public static native void glResetHistogram(@NativeType("GLenum") int target); + + // --- [ glGetHistogram ] --- + + /** Unsafe version of: {@link #glGetHistogram GetHistogram} */ + public static native void nglGetHistogram(int target, boolean reset, int format, int type, long values); + + /** + * Returns the current contents of the histogram table. + * + * @param target the histogram target. Must be:
{@link #GL_HISTOGRAM HISTOGRAM}
+ * @param reset if {@link GL11#GL_TRUE TRUE}, then all counters of all elements of the histogram are reset to zero. Counters are reset whether returned or not. + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel data types. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param values the pixel data + */ + public static void glGetHistogram(@NativeType("GLenum") int target, @NativeType("GLboolean") boolean reset, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer values) { + nglGetHistogram(target, reset, format, type, memAddress(values)); + } + + /** + * Returns the current contents of the histogram table. + * + * @param target the histogram target. Must be:
{@link #GL_HISTOGRAM HISTOGRAM}
+ * @param reset if {@link GL11#GL_TRUE TRUE}, then all counters of all elements of the histogram are reset to zero. Counters are reset whether returned or not. + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel data types. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param values the pixel data + */ + public static void glGetHistogram(@NativeType("GLenum") int target, @NativeType("GLboolean") boolean reset, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") long values) { + nglGetHistogram(target, reset, format, type, values); + } + + // --- [ glGetHistogramParameteriv ] --- + + /** Unsafe version of: {@link #glGetHistogramParameteriv GetHistogramParameteriv} */ + public static native void nglGetHistogramParameteriv(int target, int pname, long params); + + /** + * Returns the integer values of the specified histogram parameter + * + * @param target the histogram target. Must be:
{@link #GL_HISTOGRAM HISTOGRAM}
+ * @param pname the parameter to query. One of:
{@link #GL_HISTOGRAM_WIDTH HISTOGRAM_WIDTH}{@link #GL_HISTOGRAM_FORMAT HISTOGRAM_FORMAT}{@link #GL_HISTOGRAM_RED_SIZE HISTOGRAM_RED_SIZE}{@link #GL_HISTOGRAM_GREEN_SIZE HISTOGRAM_GREEN_SIZE}
{@link #GL_HISTOGRAM_BLUE_SIZE HISTOGRAM_BLUE_SIZE}{@link #GL_HISTOGRAM_ALPHA_SIZE HISTOGRAM_ALPHA_SIZE}{@link #GL_HISTOGRAM_LUMINANCE_SIZE HISTOGRAM_LUMINANCE_SIZE}{@link #GL_HISTOGRAM_SINK HISTOGRAM_SINK}
+ * @param params a buffer in which to return the parameter values + */ + public static void glGetHistogramParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetHistogramParameteriv(target, pname, memAddress(params)); + } + + /** + * Returns the integer values of the specified histogram parameter + * + * @param target the histogram target. Must be:
{@link #GL_HISTOGRAM HISTOGRAM}
+ * @param pname the parameter to query. One of:
{@link #GL_HISTOGRAM_WIDTH HISTOGRAM_WIDTH}{@link #GL_HISTOGRAM_FORMAT HISTOGRAM_FORMAT}{@link #GL_HISTOGRAM_RED_SIZE HISTOGRAM_RED_SIZE}{@link #GL_HISTOGRAM_GREEN_SIZE HISTOGRAM_GREEN_SIZE}
{@link #GL_HISTOGRAM_BLUE_SIZE HISTOGRAM_BLUE_SIZE}{@link #GL_HISTOGRAM_ALPHA_SIZE HISTOGRAM_ALPHA_SIZE}{@link #GL_HISTOGRAM_LUMINANCE_SIZE HISTOGRAM_LUMINANCE_SIZE}{@link #GL_HISTOGRAM_SINK HISTOGRAM_SINK}
+ */ + @NativeType("void") + public static int glGetHistogramParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetHistogramParameteriv(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetHistogramParameterfv ] --- + + /** Unsafe version of: {@link #glGetHistogramParameterfv GetHistogramParameterfv} */ + public static native void nglGetHistogramParameterfv(int target, int pname, long params); + + /** + * Float version of {@link #glGetHistogramParameteriv GetHistogramParameteriv}. + * + * @param target the histogram target + * @param pname the parameter to query + * @param params a buffer in which to place the returned value + */ + public static void glGetHistogramParameterfv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetHistogramParameterfv(target, pname, memAddress(params)); + } + + /** + * Float version of {@link #glGetHistogramParameteriv GetHistogramParameteriv}. + * + * @param target the histogram target + * @param pname the parameter to query + */ + @NativeType("void") + public static float glGetHistogramParameterf(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer params = stack.callocFloat(1); + nglGetHistogramParameterfv(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glMinmax ] --- + + /** + * Specifies the minmax table. + * + * @param target the minmax target. Must be:
{@link #GL_MINMAX MINMAX}
+ * @param internalformat the minmax table internal format. One of:
{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}
{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}
{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_LUMINANCE LUMINANCE}
{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}{@link GL11#GL_INTENSITY INTENSITY}{@link GL11#GL_ALPHA4 ALPHA4}{@link GL11#GL_ALPHA8 ALPHA8}{@link GL11#GL_ALPHA12 ALPHA12}{@link GL11#GL_ALPHA16 ALPHA16}{@link GL11#GL_LUMINANCE4 LUMINANCE4}{@link GL11#GL_LUMINANCE8 LUMINANCE8}
{@link GL11#GL_LUMINANCE12 LUMINANCE12}{@link GL11#GL_LUMINANCE16 LUMINANCE16}{@link GL11#GL_LUMINANCE4_ALPHA4 LUMINANCE4_ALPHA4}{@link GL11#GL_LUMINANCE6_ALPHA2 LUMINANCE6_ALPHA2}{@link GL11#GL_LUMINANCE8_ALPHA8 LUMINANCE8_ALPHA8}{@link GL11#GL_LUMINANCE12_ALPHA4 LUMINANCE12_ALPHA4}{@link GL11#GL_LUMINANCE12_ALPHA12 LUMINANCE12_ALPHA12}{@link GL11#GL_LUMINANCE16_ALPHA16 LUMINANCE16_ALPHA16}
{@link GL11#GL_INTENSITY4 INTENSITY4}{@link GL11#GL_INTENSITY8 INTENSITY8}{@link GL11#GL_INTENSITY12 INTENSITY12}{@link GL11#GL_INTENSITY16 INTENSITY16}{@link GL21#GL_SLUMINANCE SLUMINANCE}{@link GL21#GL_SLUMINANCE8_ALPHA8 SLUMINANCE8_ALPHA8}
+ * @param sink whether pixel groups will be consumed by the minmax operation ({@link GL11#GL_TRUE TRUE}) or passed on to final conversion ({@link GL11#GL_FALSE FALSE}) + */ + public static native void glMinmax(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLboolean") boolean sink); + + // --- [ glResetMinmax ] --- + + /** + * Resets all minimum and maximum values of {@code target} to to their maximum and minimum representable values, respectively. + * + * @param target the minmax target. Must be:
{@link #GL_MINMAX MINMAX}
+ */ + public static native void glResetMinmax(@NativeType("GLenum") int target); + + // --- [ glGetMinmax ] --- + + /** Unsafe version of: {@link #glGetMinmax GetMinmax} */ + public static native void nglGetMinmax(int target, boolean reset, int format, int type, long values); + + /** + * Returns the current contents of the minmax table. + * + * @param target the minmax target. Must be:
{@link #GL_MINMAX MINMAX}
+ * @param reset If {@link GL11#GL_TRUE TRUE}, then each minimum value is reset to the maximum representable value, and each maximum value is reset to the minimum + * representable value. All values are reset, whether returned or not. + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param values a buffer in which to place the minmax values + */ + public static void glGetMinmax(@NativeType("GLenum") int target, @NativeType("GLboolean") boolean reset, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer values) { + nglGetMinmax(target, reset, format, type, memAddress(values)); + } + + /** + * Returns the current contents of the minmax table. + * + * @param target the minmax target. Must be:
{@link #GL_MINMAX MINMAX}
+ * @param reset If {@link GL11#GL_TRUE TRUE}, then each minimum value is reset to the maximum representable value, and each maximum value is reset to the minimum + * representable value. All values are reset, whether returned or not. + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param values a buffer in which to place the minmax values + */ + public static void glGetMinmax(@NativeType("GLenum") int target, @NativeType("GLboolean") boolean reset, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") long values) { + nglGetMinmax(target, reset, format, type, values); + } + + // --- [ glGetMinmaxParameteriv ] --- + + /** Unsafe version of: {@link #glGetMinmaxParameteriv GetMinmaxParameteriv} */ + public static native void nglGetMinmaxParameteriv(int target, int pname, long params); + + /** + * Returns the integer value of the specified minmax parameter. + * + * @param target the minmax target. Must be:
{@link #GL_MINMAX MINMAX}
+ * @param pname the parameter to query + * @param params a buffer in which to place the returned value + */ + public static void glGetMinmaxParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetMinmaxParameteriv(target, pname, memAddress(params)); + } + + /** + * Returns the integer value of the specified minmax parameter. + * + * @param target the minmax target. Must be:
{@link #GL_MINMAX MINMAX}
+ * @param pname the parameter to query + */ + @NativeType("void") + public static int glGetMinmaxParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetMinmaxParameteriv(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetMinmaxParameterfv ] --- + + /** Unsafe version of: {@link #glGetMinmaxParameterfv GetMinmaxParameterfv} */ + public static native void nglGetMinmaxParameterfv(int target, int pname, long params); + + /** + * Float version of {@link #glGetMinmaxParameteriv GetMinmaxParameteriv}. + * + * @param target the minmax target. Must be:
{@link #GL_MINMAX MINMAX}
+ * @param pname the parameter to query + * @param params a buffer in which to place the returned value + */ + public static void glGetMinmaxParameterfv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetMinmaxParameterfv(target, pname, memAddress(params)); + } + + /** + * Float version of {@link #glGetMinmaxParameteriv GetMinmaxParameteriv}. + * + * @param target the minmax target. Must be:
{@link #GL_MINMAX MINMAX}
+ * @param pname the parameter to query + */ + @NativeType("void") + public static float glGetMinmaxParameterf(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer params = stack.callocFloat(1); + nglGetMinmaxParameterfv(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glBlendColor ] --- + + /** + * Specifies the constant color Cc to be used in blending. + * + * @param red the red color component + * @param green the green color component + * @param blue the blue color component + * @param alpha the alpha color component + */ + public static void glBlendColor(@NativeType("GLfloat") float red, @NativeType("GLfloat") float green, @NativeType("GLfloat") float blue, @NativeType("GLfloat") float alpha) { + GL14C.glBlendColor(red, green, blue, alpha); + } + + // --- [ glBlendEquation ] --- + + /** + * Controls the blend equations used for per-fragment blending. + * + * @param mode the blend equation. One of:
{@link GL14C#GL_FUNC_ADD FUNC_ADD}{@link GL14C#GL_FUNC_SUBTRACT FUNC_SUBTRACT}{@link GL14C#GL_FUNC_REVERSE_SUBTRACT FUNC_REVERSE_SUBTRACT}{@link GL14C#GL_MIN MIN}{@link GL14C#GL_MAX MAX}
+ */ + public static void glBlendEquation(@NativeType("GLenum") int mode) { + GL14C.glBlendEquation(mode); + } + + /** Array version of: {@link #glColorTable ColorTable} */ + public static void glColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] table) { + long __functionAddress = GL.getICD().glColorTable; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, internalformat, width, format, type, table, __functionAddress); + } + + /** Array version of: {@link #glColorTable ColorTable} */ + public static void glColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] table) { + long __functionAddress = GL.getICD().glColorTable; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, internalformat, width, format, type, table, __functionAddress); + } + + /** Array version of: {@link #glColorTable ColorTable} */ + public static void glColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] table) { + long __functionAddress = GL.getICD().glColorTable; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, internalformat, width, format, type, table, __functionAddress); + } + + /** Array version of: {@link #glColorTableParameteriv ColorTableParameteriv} */ + public static void glColorTableParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glColorTableParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glColorTableParameterfv ColorTableParameterfv} */ + public static void glColorTableParameterfv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] params) { + long __functionAddress = GL.getICD().glColorTableParameterfv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetColorTable GetColorTable} */ + public static void glGetColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") short[] table) { + long __functionAddress = GL.getICD().glGetColorTable; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, format, type, table, __functionAddress); + } + + /** Array version of: {@link #glGetColorTable GetColorTable} */ + public static void glGetColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") int[] table) { + long __functionAddress = GL.getICD().glGetColorTable; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, format, type, table, __functionAddress); + } + + /** Array version of: {@link #glGetColorTable GetColorTable} */ + public static void glGetColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") float[] table) { + long __functionAddress = GL.getICD().glGetColorTable; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, format, type, table, __functionAddress); + } + + /** Array version of: {@link #glGetColorTableParameteriv GetColorTableParameteriv} */ + public static void glGetColorTableParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetColorTableParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetColorTableParameterfv GetColorTableParameterfv} */ + public static void glGetColorTableParameterfv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetColorTableParameterfv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glConvolutionParameteriv ConvolutionParameteriv} */ + public static void glConvolutionParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glConvolutionParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glConvolutionParameterfv ConvolutionParameterfv} */ + public static void glConvolutionParameterfv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] params) { + long __functionAddress = GL.getICD().glConvolutionParameterfv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetConvolutionParameteriv GetConvolutionParameteriv} */ + public static void glGetConvolutionParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetConvolutionParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetConvolutionParameterfv GetConvolutionParameterfv} */ + public static void glGetConvolutionParameterfv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetConvolutionParameterfv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetHistogramParameteriv GetHistogramParameteriv} */ + public static void glGetHistogramParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetHistogramParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetHistogramParameterfv GetHistogramParameterfv} */ + public static void glGetHistogramParameterfv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetHistogramParameterfv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetMinmaxParameteriv GetMinmaxParameteriv} */ + public static void glGetMinmaxParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetMinmaxParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetMinmaxParameterfv GetMinmaxParameterfv} */ + public static void glGetMinmaxParameterfv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetMinmaxParameterfv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBIndirectParameters.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBIndirectParameters.java new file mode 100644 index 00000000..e82560f9 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBIndirectParameters.java @@ -0,0 +1,196 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_indirect_parameters extension. + * + *

OpenGL 4.3 (with the introduction of the {@link ARBMultiDrawIndirect ARB_multi_draw_indirect} extension) enhanced the ability of OpenGL to allow a large sets of parameters + * for indirect draws (introduced with OpenGL 4.0) into a buffer object and dispatch the entire list with one API call. This allows, for example, a shader + * (such as a compute shader via shader storage buffers, or a geometry shader via transform feedback) to produce lists of draw commands that can then be + * consumed by OpenGL without a server-client round trip. However, when a variable and potentially unknown number of draws are produced by such a shader, + * it becomes difficult to know how many draws are in the output array(s). Applications must resort to techniques such as transform feedback primitive + * queries, or mapping buffers containing the content of atomic counters, which can cause stalls or bubbles in the OpenGL pipeline.

+ * + *

This extension introduces the concept of the "parameter buffer", which is a target allowing buffers to store parameters for certain drawing commands. + * Also in this extension, new variants of {@link GL43C#glMultiDrawArraysIndirect MultiDrawArraysIndirect} and {@link GL43C#glMultiDrawElementsIndirect MultiDrawElementsIndirect} are introduced that source some of their + * parameters from this buffer. Further commands could potentially be introduced that source other parameters from a buffer.

+ * + *

Requires {@link GL42 OpenGL 4.2}.

+ */ +public class ARBIndirectParameters { + + /** + * Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferPointerv, + * MapBufferRange, FlushMappedBufferRange, GetBufferParameteriv, and CopyBufferSubData. + */ + public static final int GL_PARAMETER_BUFFER_ARB = 0x80EE; + + /** Accepted by the {@code value} parameter of GetIntegerv, GetBooleanv, GetFloatv, and GetDoublev. */ + public static final int GL_PARAMETER_BUFFER_BINDING_ARB = 0x80EF; + + static { GL.initialize(); } + + protected ARBIndirectParameters() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glMultiDrawArraysIndirectCountARB, caps.glMultiDrawElementsIndirectCountARB + ); + } + + // --- [ glMultiDrawArraysIndirectCountARB ] --- + + /** Unsafe version of: {@link #glMultiDrawArraysIndirectCountARB MultiDrawArraysIndirectCountARB} */ + public static native void nglMultiDrawArraysIndirectCountARB(int mode, long indirect, long drawcount, int maxdrawcount, int stride); + + /** + * Behaves similarly to {@link GL43C#glMultiDrawArraysIndirect MultiDrawArraysIndirect}, except that {@code drawcount} defines an offset (in bytes) into the buffer object bound to the + * {@link #GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB} binding point at which a single {@code sizei} typed value is stored, which contains the draw count. {@code maxdrawcount} specifies + * the maximum number of draws that are expected to be stored in the buffer. If the value stored at {@code drawcount} into the buffer is greater than + * {@code maxdrawcount}, an implementation stop processing draws after {@code maxdrawcount} parameter sets. {@code drawcount} must be a multiple of four. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect an array of structures containing the draw parameters + * @param drawcount the offset into the parameter buffer object + * @param maxdrawcount the maximum number of draws + * @param stride the distance in basic machine units between elements of the draw parameter array + */ + public static void glMultiDrawArraysIndirectCountARB(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + if (CHECKS) { + check(indirect, maxdrawcount * (stride == 0 ? (4 * 4) : stride)); + } + nglMultiDrawArraysIndirectCountARB(mode, memAddress(indirect), drawcount, maxdrawcount, stride); + } + + /** + * Behaves similarly to {@link GL43C#glMultiDrawArraysIndirect MultiDrawArraysIndirect}, except that {@code drawcount} defines an offset (in bytes) into the buffer object bound to the + * {@link #GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB} binding point at which a single {@code sizei} typed value is stored, which contains the draw count. {@code maxdrawcount} specifies + * the maximum number of draws that are expected to be stored in the buffer. If the value stored at {@code drawcount} into the buffer is greater than + * {@code maxdrawcount}, an implementation stop processing draws after {@code maxdrawcount} parameter sets. {@code drawcount} must be a multiple of four. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect an array of structures containing the draw parameters + * @param drawcount the offset into the parameter buffer object + * @param maxdrawcount the maximum number of draws + * @param stride the distance in basic machine units between elements of the draw parameter array + */ + public static void glMultiDrawArraysIndirectCountARB(@NativeType("GLenum") int mode, @NativeType("void const *") long indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + nglMultiDrawArraysIndirectCountARB(mode, indirect, drawcount, maxdrawcount, stride); + } + + /** + * Behaves similarly to {@link GL43C#glMultiDrawArraysIndirect MultiDrawArraysIndirect}, except that {@code drawcount} defines an offset (in bytes) into the buffer object bound to the + * {@link #GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB} binding point at which a single {@code sizei} typed value is stored, which contains the draw count. {@code maxdrawcount} specifies + * the maximum number of draws that are expected to be stored in the buffer. If the value stored at {@code drawcount} into the buffer is greater than + * {@code maxdrawcount}, an implementation stop processing draws after {@code maxdrawcount} parameter sets. {@code drawcount} must be a multiple of four. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect an array of structures containing the draw parameters + * @param drawcount the offset into the parameter buffer object + * @param maxdrawcount the maximum number of draws + * @param stride the distance in basic machine units between elements of the draw parameter array + */ + public static void glMultiDrawArraysIndirectCountARB(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + if (CHECKS) { + check(indirect, (maxdrawcount * (stride == 0 ? (4 * 4) : stride)) >> 2); + } + nglMultiDrawArraysIndirectCountARB(mode, memAddress(indirect), drawcount, maxdrawcount, stride); + } + + // --- [ glMultiDrawElementsIndirectCountARB ] --- + + /** Unsafe version of: {@link #glMultiDrawElementsIndirectCountARB MultiDrawElementsIndirectCountARB} */ + public static native void nglMultiDrawElementsIndirectCountARB(int mode, int type, long indirect, long drawcount, int maxdrawcount, int stride); + + /** + * Behaves similarly to {@link GL43C#glMultiDrawElementsIndirect MultiDrawElementsIndirect}, except that {@code drawcount} defines an offset (in bytes) into the buffer object bound to the + * {@link #GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB} binding point at which a single {@code sizei} typed value is stored, which contains the draw count. {@code maxdrawcount} specifies + * the maximum number of draws that are expected to be stored in the buffer. If the value stored at {@code drawcount} into the buffer is greater than + * {@code maxdrawcount}, an implementation stop processing draws after {@code maxdrawcount} parameter sets. {@code drawcount} must be a multiple of four. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect a structure containing an array of draw parameters + * @param drawcount the offset into the parameter buffer object + * @param maxdrawcount the maximum number of draws + * @param stride the distance in basic machine units between elements of the draw parameter array + */ + public static void glMultiDrawElementsIndirectCountARB(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + if (CHECKS) { + check(indirect, maxdrawcount * (stride == 0 ? (5 * 4) : stride)); + } + nglMultiDrawElementsIndirectCountARB(mode, type, memAddress(indirect), drawcount, maxdrawcount, stride); + } + + /** + * Behaves similarly to {@link GL43C#glMultiDrawElementsIndirect MultiDrawElementsIndirect}, except that {@code drawcount} defines an offset (in bytes) into the buffer object bound to the + * {@link #GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB} binding point at which a single {@code sizei} typed value is stored, which contains the draw count. {@code maxdrawcount} specifies + * the maximum number of draws that are expected to be stored in the buffer. If the value stored at {@code drawcount} into the buffer is greater than + * {@code maxdrawcount}, an implementation stop processing draws after {@code maxdrawcount} parameter sets. {@code drawcount} must be a multiple of four. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect a structure containing an array of draw parameters + * @param drawcount the offset into the parameter buffer object + * @param maxdrawcount the maximum number of draws + * @param stride the distance in basic machine units between elements of the draw parameter array + */ + public static void glMultiDrawElementsIndirectCountARB(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") long indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + nglMultiDrawElementsIndirectCountARB(mode, type, indirect, drawcount, maxdrawcount, stride); + } + + /** + * Behaves similarly to {@link GL43C#glMultiDrawElementsIndirect MultiDrawElementsIndirect}, except that {@code drawcount} defines an offset (in bytes) into the buffer object bound to the + * {@link #GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB} binding point at which a single {@code sizei} typed value is stored, which contains the draw count. {@code maxdrawcount} specifies + * the maximum number of draws that are expected to be stored in the buffer. If the value stored at {@code drawcount} into the buffer is greater than + * {@code maxdrawcount}, an implementation stop processing draws after {@code maxdrawcount} parameter sets. {@code drawcount} must be a multiple of four. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect a structure containing an array of draw parameters + * @param drawcount the offset into the parameter buffer object + * @param maxdrawcount the maximum number of draws + * @param stride the distance in basic machine units between elements of the draw parameter array + */ + public static void glMultiDrawElementsIndirectCountARB(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + if (CHECKS) { + check(indirect, (maxdrawcount * (stride == 0 ? (5 * 4) : stride)) >> 2); + } + nglMultiDrawElementsIndirectCountARB(mode, type, memAddress(indirect), drawcount, maxdrawcount, stride); + } + + /** Array version of: {@link #glMultiDrawArraysIndirectCountARB MultiDrawArraysIndirectCountARB} */ + public static void glMultiDrawArraysIndirectCountARB(@NativeType("GLenum") int mode, @NativeType("void const *") int[] indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + long __functionAddress = GL.getICD().glMultiDrawArraysIndirectCountARB; + if (CHECKS) { + check(__functionAddress); + check(indirect, (maxdrawcount * (stride == 0 ? (4 * 4) : stride)) >> 2); + } + callPPV(mode, indirect, drawcount, maxdrawcount, stride, __functionAddress); + } + + /** Array version of: {@link #glMultiDrawElementsIndirectCountARB MultiDrawElementsIndirectCountARB} */ + public static void glMultiDrawElementsIndirectCountARB(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") int[] indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + long __functionAddress = GL.getICD().glMultiDrawElementsIndirectCountARB; + if (CHECKS) { + check(__functionAddress); + check(indirect, (maxdrawcount * (stride == 0 ? (5 * 4) : stride)) >> 2); + } + callPPV(mode, type, indirect, drawcount, maxdrawcount, stride, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBInstancedArrays.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBInstancedArrays.java new file mode 100644 index 00000000..07f47e98 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBInstancedArrays.java @@ -0,0 +1,81 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_instanced_arrays extension. + * + *

A common use case in GL for some applications is to be able to draw the same object, or groups of similar objects that share vertex data, primitive + * count and type, multiple times. This extension provides a means of accelerating such use cases while restricting the number of API calls, and keeping + * the amount of duplicate data to a minimum.

+ * + *

In particular, this extension specifies an alternative to the read-only shader variable introduced by ARB_draw_instanced. It uses the same draw calls + * introduced by that extension, but redefines them so that a vertex shader can instead use vertex array attributes as a source of instance data.

+ * + *

This extension introduces an array "divisor" for generic vertex array attributes, which when non-zero specifies that the attribute is "instanced". An + * instanced attribute does not advance per-vertex as usual, but rather after every {@code divisor} conceptual draw calls.

+ * + *

(Attributes which aren't instanced are repeated in their entirety for every conceptual draw call.)

+ * + *

By specifying transform data in an instanced attribute or series of instanced attributes, vertex shaders can, in concert with the instancing draw calls, + * draw multiple instances of an object with one draw call.

+ * + *

Promoted to core in {@link GL33 OpenGL 3.3}.

+ */ +public class ARBInstancedArrays { + + /** Accepted by the {@code pname} parameters of GetVertexAttribdv, GetVertexAttribfv, and GetVertexAttribiv. */ + public static final int GL_VERTEX_ATTRIB_ARRAY_DIVISOR_ARB = 0x88FE; + + static { GL.initialize(); } + + protected ARBInstancedArrays() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glVertexAttribDivisorARB + ); + } + + // --- [ glVertexAttribDivisorARB ] --- + + /** + * Modifies the rate at which generic vertex attributes advance when rendering multiple instances of primitives in a single draw call. If {@code divisor} + * is zero, the attribute at slot {@code index} advances once per vertex. If {@code divisor} is non-zero, the attribute advances once per {@code divisor} + * instances of the set(s) of vertices being rendered. An attribute is referred to as {@code instanced} if its {@code divisor} value is non-zero. + * + * @param index the attribute index + * @param divisor the divisor value + */ + public static native void glVertexAttribDivisorARB(@NativeType("GLuint") int index, @NativeType("GLuint") int divisor); + + // --- [ glVertexArrayVertexAttribDivisorEXT ] --- + + /** + * {@link EXTDirectStateAccess EXT_direct_state_access} version of {@link #glVertexAttribDivisorARB VertexAttribDivisorARB}. + * + *

This function was added to the extension specification in July 2013. Implemenations are allowed to expose ARB_instanced_arrays without providing this + * function. The correct way to test its availability is:

+ * + *

+     * GLCapabilities caps = GL.getCapabilities();
+     * if (caps.GL_ARB_instanced_arrays && ARBInstancedArrays.getInstance().VertexArrayVertexAttribDivisorEXT != NULL) {
+     *     glVertexArrayVertexAttribDivisorEXT(...); // the DSA function can now be used
+     * }
+ * + * @param vaobj the vertex array object + * @param index the attribute index + * @param divisor the divisor value + */ + public static native void glVertexArrayVertexAttribDivisorEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLuint") int divisor); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBInternalformatQuery.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBInternalformatQuery.java new file mode 100644 index 00000000..6d34501c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBInternalformatQuery.java @@ -0,0 +1,82 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_internalformat_query extension. + * + *

OpenGL 4.1 has a number of queries to indicate the maximum number of samples available for different formats. These give a coarse-grained query + * mechanism e.g. an implementation can expose different sample counts for integer and floating-point formats, but not for different floating-point + * formats. There is also no convenient way for the user to determine the granularity of sample counts available, only the maximum.

+ * + *

This extension adds a query mechanism that allows the user to determine which sample counts are available for a specific internal format.

+ * + *

Requires {@link GL30 OpenGL 3.0} or {@link ARBFramebufferObject ARB_framebuffer_object}. Promoted to core in {@link GL42 OpenGL 4.2}.

+ */ +public class ARBInternalformatQuery { + + /** Accepted by the {@code pname} parameter of GetInternalformativ. */ + public static final int GL_NUM_SAMPLE_COUNTS = 0x9380; + + static { GL.initialize(); } + + protected ARBInternalformatQuery() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glGetInternalformativ + ); + } + + // --- [ glGetInternalformativ ] --- + + /** + * Unsafe version of: {@link #glGetInternalformativ GetInternalformativ} + * + * @param bufSize the maximum number of values that may be written to params by the function + */ + public static void nglGetInternalformativ(int target, int internalformat, int pname, int bufSize, long params) { + GL42C.nglGetInternalformativ(target, internalformat, pname, bufSize, params); + } + + /** + * Retrieves information about implementation-dependent support for internal formats. + * + * @param target the usage of the internal format. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param internalformat the internal format about which to retrieve information + * @param pname the type of information to query + * @param params a variable into which to write the retrieved information + */ + public static void glGetInternalformativ(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL42C.glGetInternalformativ(target, internalformat, pname, params); + } + + /** + * Retrieves information about implementation-dependent support for internal formats. + * + * @param target the usage of the internal format. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param internalformat the internal format about which to retrieve information + * @param pname the type of information to query + */ + @NativeType("void") + public static int glGetInternalformati(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int pname) { + return GL42C.glGetInternalformati(target, internalformat, pname); + } + + /** Array version of: {@link #glGetInternalformativ GetInternalformativ} */ + public static void glGetInternalformativ(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL42C.glGetInternalformativ(target, internalformat, pname, params); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBInternalformatQuery2.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBInternalformatQuery2.java new file mode 100644 index 00000000..eccae60a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBInternalformatQuery2.java @@ -0,0 +1,227 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_internalformat_query2 extension. + * + *

This extension extends the {@link ARBInternalformatQuery#glGetInternalformativ GetInternalformativ} query that was added in the {@link ARBInternalformatQuery ARB_internalformat_query} extension to + * provide applications with more granular per-format capability information.

+ * + *

This extension allows the remainder of the texture-style targets to be specified along with any possible internal format. We add queries for additional + * properties supported for an internal format in addition to the multisample-related information that was added in ARB_internalformat_query.

+ * + *

The goals of this extension are to:

+ * + *
    + *
  1. provide a mechanism for implementations to declare support *above* the minimum required by the specification
  2. + *
  3. provide API to allow universally constant information to be queried
  4. + *
  5. provide a user-friendly way of finding out about version- or implementation-specific limitations.
  6. + *
+ * + *

While much of this information can be determined for a single GL version by careful examination of the specification, support for many of these + * properties has been gradually introduced over a number of API revisions. This can observed when considering the range in functionality between the + * various versions of GL 2, 3, and 4, as well as GL ES 2 and 3.

+ * + *

In the case of an application which wishes to be scalable and able to run on a variety of possible GL or GL ES versions without being specifically + * tailored for each version, it must either have knowledge of the specifications built up into either the code or tables, or it must do a number of tests + * on startup to determine which capabilities are present.

+ * + *

In OpenGL, other than the course-grained extension mechanism, many limitations of, or limited support for, an internalformat can only be signaled by + * failing an operation or by operating at reduced performance. Thus, such tests often involve attempts to create resources, using them in specific ways + * and benchmarking the operations to find out if it is supported in the desired form, and at a required performance level. The extension provides a way + * for these properties and caveats to be directly queried from the implementation.

+ * + *

This extension is NOT intended to allow implementations to only support a subset of features that are required by a specific GL version, nor is it + * intended to replace the proper use of extension checks for optional functionality.

+ * + *

Requires {@link GL20 OpenGL 2.0} and {@link ARBInternalformatQuery ARB_internalformat_query}. Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ +public class ARBInternalformatQuery2 { + + /** Accepted by the {@code target} parameter of GetInternalformativ and GetInternalformati64v. */ + public static final int + GL_TEXTURE_1D = 0xDE0, + GL_TEXTURE_1D_ARRAY = 0x8C18, + GL_TEXTURE_2D = 0xDE1, + GL_TEXTURE_2D_ARRAY = 0x8C1A, + GL_TEXTURE_3D = 0x806F, + GL_TEXTURE_CUBE_MAP = 0x8513, + GL_TEXTURE_CUBE_MAP_ARRAY = 0x9009, + GL_TEXTURE_RECTANGLE = 0x84F5, + GL_TEXTURE_BUFFER = 0x8C2A, + GL_RENDERBUFFER = 0x8D41, + GL_TEXTURE_2D_MULTISAMPLE = 0x9100, + GL_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9102; + + /** Accepted by the {@code pname} parameter of GetInternalformativ and GetInternalformati64v. */ + public static final int + GL_SAMPLES = 0x80A9, + GL_NUM_SAMPLE_COUNTS = 0x9380, + GL_INTERNALFORMAT_SUPPORTED = 0x826F, + GL_INTERNALFORMAT_PREFERRED = 0x8270, + GL_INTERNALFORMAT_RED_SIZE = 0x8271, + GL_INTERNALFORMAT_GREEN_SIZE = 0x8272, + GL_INTERNALFORMAT_BLUE_SIZE = 0x8273, + GL_INTERNALFORMAT_ALPHA_SIZE = 0x8274, + GL_INTERNALFORMAT_DEPTH_SIZE = 0x8275, + GL_INTERNALFORMAT_STENCIL_SIZE = 0x8276, + GL_INTERNALFORMAT_SHARED_SIZE = 0x8277, + GL_INTERNALFORMAT_RED_TYPE = 0x8278, + GL_INTERNALFORMAT_GREEN_TYPE = 0x8279, + GL_INTERNALFORMAT_BLUE_TYPE = 0x827A, + GL_INTERNALFORMAT_ALPHA_TYPE = 0x827B, + GL_INTERNALFORMAT_DEPTH_TYPE = 0x827C, + GL_INTERNALFORMAT_STENCIL_TYPE = 0x827D, + GL_MAX_WIDTH = 0x827E, + GL_MAX_HEIGHT = 0x827F, + GL_MAX_DEPTH = 0x8280, + GL_MAX_LAYERS = 0x8281, + GL_MAX_COMBINED_DIMENSIONS = 0x8282, + GL_COLOR_COMPONENTS = 0x8283, + GL_DEPTH_COMPONENTS = 0x8284, + GL_STENCIL_COMPONENTS = 0x8285, + GL_COLOR_RENDERABLE = 0x8286, + GL_DEPTH_RENDERABLE = 0x8287, + GL_STENCIL_RENDERABLE = 0x8288, + GL_FRAMEBUFFER_RENDERABLE = 0x8289, + GL_FRAMEBUFFER_RENDERABLE_LAYERED = 0x828A, + GL_FRAMEBUFFER_BLEND = 0x828B, + GL_READ_PIXELS = 0x828C, + GL_READ_PIXELS_FORMAT = 0x828D, + GL_READ_PIXELS_TYPE = 0x828E, + GL_TEXTURE_IMAGE_FORMAT = 0x828F, + GL_TEXTURE_IMAGE_TYPE = 0x8290, + GL_GET_TEXTURE_IMAGE_FORMAT = 0x8291, + GL_GET_TEXTURE_IMAGE_TYPE = 0x8292, + GL_MIPMAP = 0x8293, + GL_MANUAL_GENERATE_MIPMAP = 0x8294, + GL_AUTO_GENERATE_MIPMAP = 0x8295, + GL_COLOR_ENCODING = 0x8296, + GL_SRGB_READ = 0x8297, + GL_SRGB_WRITE = 0x8298, + GL_SRGB_DECODE_ARB = 0x8299, + GL_FILTER = 0x829A, + GL_VERTEX_TEXTURE = 0x829B, + GL_TESS_CONTROL_TEXTURE = 0x829C, + GL_TESS_EVALUATION_TEXTURE = 0x829D, + GL_GEOMETRY_TEXTURE = 0x829E, + GL_FRAGMENT_TEXTURE = 0x829F, + GL_COMPUTE_TEXTURE = 0x82A0, + GL_TEXTURE_SHADOW = 0x82A1, + GL_TEXTURE_GATHER = 0x82A2, + GL_TEXTURE_GATHER_SHADOW = 0x82A3, + GL_SHADER_IMAGE_LOAD = 0x82A4, + GL_SHADER_IMAGE_STORE = 0x82A5, + GL_SHADER_IMAGE_ATOMIC = 0x82A6, + GL_IMAGE_TEXEL_SIZE = 0x82A7, + GL_IMAGE_COMPATIBILITY_CLASS = 0x82A8, + GL_IMAGE_PIXEL_FORMAT = 0x82A9, + GL_IMAGE_PIXEL_TYPE = 0x82AA, + GL_IMAGE_FORMAT_COMPATIBILITY_TYPE = 0x90C7, + GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST = 0x82AC, + GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST = 0x82AD, + GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE = 0x82AE, + GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE = 0x82AF, + GL_TEXTURE_COMPRESSED = 0x86A1, + GL_TEXTURE_COMPRESSED_BLOCK_WIDTH = 0x82B1, + GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT = 0x82B2, + GL_TEXTURE_COMPRESSED_BLOCK_SIZE = 0x82B3, + GL_CLEAR_BUFFER = 0x82B4, + GL_TEXTURE_VIEW = 0x82B5, + GL_VIEW_COMPATIBILITY_CLASS = 0x82B6; + + /** Returned as possible responses for various {@code pname} queries to GetInternalformativ and GetInternalformati64v. */ + public static final int + GL_FULL_SUPPORT = 0x82B7, + GL_CAVEAT_SUPPORT = 0x82B8, + GL_IMAGE_CLASS_4_X_32 = 0x82B9, + GL_IMAGE_CLASS_2_X_32 = 0x82BA, + GL_IMAGE_CLASS_1_X_32 = 0x82BB, + GL_IMAGE_CLASS_4_X_16 = 0x82BC, + GL_IMAGE_CLASS_2_X_16 = 0x82BD, + GL_IMAGE_CLASS_1_X_16 = 0x82BE, + GL_IMAGE_CLASS_4_X_8 = 0x82BF, + GL_IMAGE_CLASS_2_X_8 = 0x82C0, + GL_IMAGE_CLASS_1_X_8 = 0x82C1, + GL_IMAGE_CLASS_11_11_10 = 0x82C2, + GL_IMAGE_CLASS_10_10_10_2 = 0x82C3, + GL_VIEW_CLASS_128_BITS = 0x82C4, + GL_VIEW_CLASS_96_BITS = 0x82C5, + GL_VIEW_CLASS_64_BITS = 0x82C6, + GL_VIEW_CLASS_48_BITS = 0x82C7, + GL_VIEW_CLASS_32_BITS = 0x82C8, + GL_VIEW_CLASS_24_BITS = 0x82C9, + GL_VIEW_CLASS_16_BITS = 0x82CA, + GL_VIEW_CLASS_8_BITS = 0x82CB, + GL_VIEW_CLASS_S3TC_DXT1_RGB = 0x82CC, + GL_VIEW_CLASS_S3TC_DXT1_RGBA = 0x82CD, + GL_VIEW_CLASS_S3TC_DXT3_RGBA = 0x82CE, + GL_VIEW_CLASS_S3TC_DXT5_RGBA = 0x82CF, + GL_VIEW_CLASS_RGTC1_RED = 0x82D0, + GL_VIEW_CLASS_RGTC2_RG = 0x82D1, + GL_VIEW_CLASS_BPTC_UNORM = 0x82D2, + GL_VIEW_CLASS_BPTC_FLOAT = 0x82D3; + + static { GL.initialize(); } + + protected ARBInternalformatQuery2() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glGetInternalformati64v + ); + } + + // --- [ glGetInternalformati64v ] --- + + /** + * Unsafe version of: {@link #glGetInternalformati64v GetInternalformati64v} + * + * @param bufSize the maximum number of values that may be written to params by the function + */ + public static void nglGetInternalformati64v(int target, int internalformat, int pname, int bufSize, long params) { + GL43C.nglGetInternalformati64v(target, internalformat, pname, bufSize, params); + } + + /** + * Retrieves information about implementation-dependent support for internal formats. + * + * @param target the usage of the internal format. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param internalformat the internal format about which to retrieve information + * @param pname the type of information to query + * @param params a variable into which to write the retrieved information + */ + public static void glGetInternalformati64v(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int pname, @NativeType("GLint64 *") LongBuffer params) { + GL43C.glGetInternalformati64v(target, internalformat, pname, params); + } + + /** + * Retrieves information about implementation-dependent support for internal formats. + * + * @param target the usage of the internal format. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param internalformat the internal format about which to retrieve information + * @param pname the type of information to query + */ + @NativeType("void") + public static long glGetInternalformati64(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int pname) { + return GL43C.glGetInternalformati64(target, internalformat, pname); + } + + /** Array version of: {@link #glGetInternalformati64v GetInternalformati64v} */ + public static void glGetInternalformati64v(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int pname, @NativeType("GLint64 *") long[] params) { + GL43C.glGetInternalformati64v(target, internalformat, pname, params); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBInvalidateSubdata.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBInvalidateSubdata.java new file mode 100644 index 00000000..04f21322 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBInvalidateSubdata.java @@ -0,0 +1,194 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_invalidate_subdata extension. + * + *

This extension adds a mechanism for an application to tell the GL that the previous contents of a subregion of an image or a range of a buffer may be + * invalidated.

+ * + *

GL implementations often include several memory spaces, each with distinct performance characteristics, and the implementations transparently move + * allocations between memory spaces. With this extension, an application can tell the GL that the contents of a texture or buffer are no longer needed, + * and the implementation can avoid transferring the data unnecessarily.

+ * + *

Examples of when this may be useful include:

+ * + *
    + *
  1. invalidating a multisample texture after resolving it into a non-multisample texture.
  2. + *
  3. invalidating depth/stencil buffers after using them to generate a color buffer.
  4. + *
  5. invalidating a subregion of a framebuffer rather than clearing it before rendering to it, when the whole subregion will be overwritten.
  6. + *
  7. invalidating dynamically generated data (e.g. textures written by FBO rendering or CopyTexSubImage, buffers written by transform feedback, etc.) + * after it is no longer needed but before the end of the frame.
  8. + *
+ * + *

It is expected that the situations in which the GL will take advantage of this knowledge and achieve increased performance as a result of its use will + * be implementation-dependent. The first three examples may show benefit on tiled renderers where some data won't need to be copied into or out of on-chip + * memory. The fourth example may show a benefit in multi-GPU systems where some data won't need to be copied between GPUs.

+ * + *

This extension is a superset of the EXT_discard_framebuffer extension with the following additions:

+ * + *
    + *
  • The parameters to InvalidateFramebufferEXT are extended for MRT support and Desktop-GL-only buffer enums.
  • + *
  • New functions to invalidate a region of a texture image or buffer object data store.
  • + *
+ * + *

Requires {@link GL20 OpenGL 2.0}. Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ +public class ARBInvalidateSubdata { + + static { GL.initialize(); } + + protected ARBInvalidateSubdata() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glInvalidateTexSubImage, caps.glInvalidateTexImage, caps.glInvalidateBufferSubData, caps.glInvalidateBufferData, caps.glInvalidateFramebuffer, + caps.glInvalidateSubFramebuffer + ); + } + + // --- [ glInvalidateTexSubImage ] --- + + /** + * Invalidates a region of a texture image. + * + * @param texture the name of a texture object a subregion of which to invalidate + * @param level the level of detail of the texture object within which the region resides + * @param xoffset the X offset of the region to be invalidated + * @param yoffset the Y offset of the region to be invalidated + * @param zoffset the Z offset of the region to be invalidated + * @param width the width of the region to be invalidated + * @param height the height of the region to be invalidated + * @param depth the depth of the region to be invalidated + */ + public static void glInvalidateTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth) { + GL43C.glInvalidateTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth); + } + + // --- [ glInvalidateTexImage ] --- + + /** + * Invalidates the entirety of a texture image. + * + * @param texture the name of a texture object to invalidate + * @param level the level of detail of the texture object to invalidate + */ + public static void glInvalidateTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level) { + GL43C.glInvalidateTexImage(texture, level); + } + + // --- [ glInvalidateBufferSubData ] --- + + /** + * Invalidates a region of a buffer object's data store. + * + * @param buffer the name of a buffer object, a subrange of whose data store to invalidate + * @param offset the offset within the buffer's data store of the start of the range to be invalidated + * @param length the length of the range within the buffer's data store to be invalidated + */ + public static void glInvalidateBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length) { + GL43C.glInvalidateBufferSubData(buffer, offset, length); + } + + // --- [ glInvalidateBufferData ] --- + + /** + * Invalidates the content of a buffer object's data store. + * + * @param buffer the name of a buffer object whose data store to invalidate + */ + public static void glInvalidateBufferData(@NativeType("GLuint") int buffer) { + GL43C.glInvalidateBufferData(buffer); + } + + // --- [ glInvalidateFramebuffer ] --- + + /** + * Unsafe version of: {@link #glInvalidateFramebuffer InvalidateFramebuffer} + * + * @param numAttachments the number of entries in the {@code attachments} array + */ + public static void nglInvalidateFramebuffer(int target, int numAttachments, long attachments) { + GL43C.nglInvalidateFramebuffer(target, numAttachments, attachments); + } + + /** + * Invalidate the content some or all of a framebuffer object's attachments. + * + * @param target the target to which the framebuffer is attached. One of:
{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}
+ * @param attachments the address of an array identifying the attachments to be invalidated + */ + public static void glInvalidateFramebuffer(@NativeType("GLenum") int target, @NativeType("GLenum const *") IntBuffer attachments) { + GL43C.glInvalidateFramebuffer(target, attachments); + } + + /** + * Invalidate the content some or all of a framebuffer object's attachments. + * + * @param target the target to which the framebuffer is attached. One of:
{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}
+ */ + public static void glInvalidateFramebuffer(@NativeType("GLenum") int target, @NativeType("GLenum const *") int attachment) { + GL43C.glInvalidateFramebuffer(target, attachment); + } + + // --- [ glInvalidateSubFramebuffer ] --- + + /** + * Unsafe version of: {@link #glInvalidateSubFramebuffer InvalidateSubFramebuffer} + * + * @param numAttachments the number of entries in the {@code attachments} array + */ + public static void nglInvalidateSubFramebuffer(int target, int numAttachments, long attachments, int x, int y, int width, int height) { + GL43C.nglInvalidateSubFramebuffer(target, numAttachments, attachments, x, y, width, height); + } + + /** + * Invalidates the content of a region of some or all of a framebuffer object's attachments. + * + * @param target the target to which the framebuffer is attached. One of:
{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}
+ * @param attachments an array identifying the attachments to be invalidated + * @param x the X offset of the region to be invalidated + * @param y the Y offset of the region to be invalidated + * @param width the width of the region to be invalidated + * @param height the height of the region to be invalidated + */ + public static void glInvalidateSubFramebuffer(@NativeType("GLenum") int target, @NativeType("GLenum const *") IntBuffer attachments, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL43C.glInvalidateSubFramebuffer(target, attachments, x, y, width, height); + } + + /** + * Invalidates the content of a region of some or all of a framebuffer object's attachments. + * + * @param target the target to which the framebuffer is attached. One of:
{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}
+ * @param x the X offset of the region to be invalidated + * @param y the Y offset of the region to be invalidated + * @param width the width of the region to be invalidated + * @param height the height of the region to be invalidated + */ + public static void glInvalidateSubFramebuffer(@NativeType("GLenum") int target, @NativeType("GLenum const *") int attachment, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL43C.glInvalidateSubFramebuffer(target, attachment, x, y, width, height); + } + + /** Array version of: {@link #glInvalidateFramebuffer InvalidateFramebuffer} */ + public static void glInvalidateFramebuffer(@NativeType("GLenum") int target, @NativeType("GLenum const *") int[] attachments) { + GL43C.glInvalidateFramebuffer(target, attachments); + } + + /** Array version of: {@link #glInvalidateSubFramebuffer InvalidateSubFramebuffer} */ + public static void glInvalidateSubFramebuffer(@NativeType("GLenum") int target, @NativeType("GLenum const *") int[] attachments, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL43C.glInvalidateSubFramebuffer(target, attachments, x, y, width, height); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMapBufferAlignment.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMapBufferAlignment.java new file mode 100644 index 00000000..f49ce655 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMapBufferAlignment.java @@ -0,0 +1,23 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_map_buffer_alignment extension. + * + *

This extension adds a requirement to the pointer returned by {@link GL15C#glMapBuffer MapBuffer} and {@link GL30C#glMapBufferRange MapBufferRange} that they provide a minimum of 64 byte alignment + * to support processing of the data directly with special CPU instructions like SSE and AVX.

+ * + *

Requires {@link GL21 OpenGL 2.1}. Promoted to core in {@link GL42 OpenGL 4.2}.

+ */ +public final class ARBMapBufferAlignment { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int GL_MIN_MAP_BUFFER_ALIGNMENT = 0x90BC; + + private ARBMapBufferAlignment() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMapBufferRange.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMapBufferRange.java new file mode 100644 index 00000000..f0b06d3f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMapBufferRange.java @@ -0,0 +1,119 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_map_buffer_range extension. + * + *

ARB_map_buffer_range expands the buffer object API to allow greater performance when a client application only needs to write to a sub-range of a buffer + * object. To that end, this extension introduces two new buffer object features: non-serialized buffer modification and explicit sub-range flushing for + * mapped buffer objects.

+ * + *

OpenGL requires that commands occur in a FIFO manner meaning that any changes to buffer objects either block until the data has been processed by the + * OpenGL pipeline or else create extra copies to avoid such a block. By providing a method to asynchronously modify buffer object data, an application is + * then able to manage the synchronization points themselves and modify ranges of data contained by a buffer object even though OpenGL might still be using + * other parts of it.

+ * + *

This extension also provides a method for explicitly flushing ranges of a mapped buffer object so OpenGL does not have to assume that the entire range + * may have been modified. Further, it allows the application to more precisely specify its intent with respect to reading, writing, and whether the + * previous contents of a mapped range of interest need be preserved prior to modification.

+ * + *

Requires {@link GL21 OpenGL 2.1}. Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ +public class ARBMapBufferRange { + + /** Accepted by the {@code access} parameter of MapBufferRange. */ + public static final int + GL_MAP_READ_BIT = 0x1, + GL_MAP_WRITE_BIT = 0x2, + GL_MAP_INVALIDATE_RANGE_BIT = 0x4, + GL_MAP_INVALIDATE_BUFFER_BIT = 0x8, + GL_MAP_FLUSH_EXPLICIT_BIT = 0x10, + GL_MAP_UNSYNCHRONIZED_BIT = 0x20; + + static { GL.initialize(); } + + protected ARBMapBufferRange() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glMapBufferRange, caps.glFlushMappedBufferRange + ); + } + + // --- [ glMapBufferRange ] --- + + /** Unsafe version of: {@link #glMapBufferRange MapBufferRange} */ + public static long nglMapBufferRange(int target, long offset, long length, int access) { + return GL30C.nglMapBufferRange(target, offset, length, access); + } + + /** + * Maps a section of a buffer object's data store. + * + *

LWJGL note: This method comes in 2 flavors:

+ * + *
    + *
  1. {@link #glMapBufferRange(int, long, long, int)} - Always returns a new ByteBuffer instance.
  2. + *
  3. {@link #glMapBufferRange(int, long, long, int, ByteBuffer)} - The {@code old_buffer} parameter is reused if not null.
  4. + *
+ * + * @param target a binding to which the target buffer is bound. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30C#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the starting offset within the buffer of the range to be mapped + * @param length the length of the range to be mapped + * @param access a combination of access flags indicating the desired access to the range. One or more of:
{@link GL30C#GL_MAP_READ_BIT MAP_READ_BIT}{@link GL30C#GL_MAP_WRITE_BIT MAP_WRITE_BIT}{@link GL30C#GL_MAP_INVALIDATE_RANGE_BIT MAP_INVALIDATE_RANGE_BIT}{@link GL30C#GL_MAP_INVALIDATE_BUFFER_BIT MAP_INVALIDATE_BUFFER_BIT}
{@link GL30C#GL_MAP_FLUSH_EXPLICIT_BIT MAP_FLUSH_EXPLICIT_BIT}{@link GL30C#GL_MAP_UNSYNCHRONIZED_BIT MAP_UNSYNCHRONIZED_BIT}
+ */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapBufferRange(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length, @NativeType("GLbitfield") int access) { + return GL30C.glMapBufferRange(target, offset, length, access); + } + + /** + * Maps a section of a buffer object's data store. + * + *

LWJGL note: This method comes in 2 flavors:

+ * + *
    + *
  1. {@link #glMapBufferRange(int, long, long, int)} - Always returns a new ByteBuffer instance.
  2. + *
  3. {@link #glMapBufferRange(int, long, long, int, ByteBuffer)} - The {@code old_buffer} parameter is reused if not null.
  4. + *
+ * + * @param target a binding to which the target buffer is bound. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30C#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the starting offset within the buffer of the range to be mapped + * @param length the length of the range to be mapped + * @param access a combination of access flags indicating the desired access to the range. One or more of:
{@link GL30C#GL_MAP_READ_BIT MAP_READ_BIT}{@link GL30C#GL_MAP_WRITE_BIT MAP_WRITE_BIT}{@link GL30C#GL_MAP_INVALIDATE_RANGE_BIT MAP_INVALIDATE_RANGE_BIT}{@link GL30C#GL_MAP_INVALIDATE_BUFFER_BIT MAP_INVALIDATE_BUFFER_BIT}
{@link GL30C#GL_MAP_FLUSH_EXPLICIT_BIT MAP_FLUSH_EXPLICIT_BIT}{@link GL30C#GL_MAP_UNSYNCHRONIZED_BIT MAP_UNSYNCHRONIZED_BIT}
+ */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapBufferRange(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length, @NativeType("GLbitfield") int access, @Nullable ByteBuffer old_buffer) { + return GL30C.glMapBufferRange(target, offset, length, access, old_buffer); + } + + // --- [ glFlushMappedBufferRange ] --- + + /** + * Indicates modifications to a range of a mapped buffer. + * + * @param target the target of the flush operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30C#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the start of the buffer subrange, in basic machine units + * @param length the length of the buffer subrange, in basic machine units + */ + public static void glFlushMappedBufferRange(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length) { + GL30C.glFlushMappedBufferRange(target, offset, length); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMatrixPalette.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMatrixPalette.java new file mode 100644 index 00000000..a8c83013 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMatrixPalette.java @@ -0,0 +1,206 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_matrix_palette extension. + * + *

This extension extends the abilities of {@link ARBVertexBlend} to include a palette of modelview matrices. The n vertex units use a palette of m modelview + * matrices. (Where n and m are constrained to implementation defined maxima.) Each vertex has a set of n indices into the palette, and a corresponding set + * of n weights. Matrix indices can be changed for each vertex (between {@link GL11#glBegin Begin} and {@link GL11#glEnd End}).

+ * + *

When this extension is utilized, the enabled units transform each vertex by the modelview matrices specified by the vertices' respective indices. These + * results are subsequently scaled by the weights of the respective units and then summed to create the eyespace vertex.

+ * + *

A similar procedure is followed for normals. Normals, however, are transformed by the inverse transpose of the modelview matrix.

+ */ +public class ARBMatrixPalette { + + /** + * Accepted by the {@code pname} parameters of GetFloatv, GetDoublev, and IsEnabled, by the {@code mode} parameter of MatrixMode, and by the {@code cap} + * parameters of Enable and Disable. + */ + public static final int GL_MATRIX_PALETTE_ARB = 0x8840; + + /** Accepted by the {@code pname} parameters of GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB = 0x8841, + GL_MAX_PALETTE_MATRICES_ARB = 0x8842, + GL_CURRENT_PALETTE_MATRIX_ARB = 0x8843; + + /** Accepted by the {@code cap} parameters of EnableClientState and DisableClientState and by the {@code pname} parameter of IsEnabled. */ + public static final int GL_MATRIX_INDEX_ARRAY_ARB = 0x8844; + + /** Accepted by the {@code pname} parameter of GetFloatv. */ + public static final int GL_CURRENT_MATRIX_INDEX_ARB = 0x8845; + + /** Accepted by the {@code pname} parameter of GetIntegerv. */ + public static final int + GL_MATRIX_INDEX_ARRAY_SIZE_ARB = 0x8846, + GL_MATRIX_INDEX_ARRAY_TYPE_ARB = 0x8847, + GL_MATRIX_INDEX_ARRAY_STRIDE_ARB = 0x8848; + + /** Accepted by the {@code pname} parameter of GetPointerv. */ + public static final int GL_MATRIX_INDEX_ARRAY_POINTER_ARB = 0x8849; + + static { GL.initialize(); } + + protected ARBMatrixPalette() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glCurrentPaletteMatrixARB, caps.glMatrixIndexuivARB, caps.glMatrixIndexubvARB, caps.glMatrixIndexusvARB, caps.glMatrixIndexPointerARB + ); + } + + // --- [ glCurrentPaletteMatrixARB ] --- + + /** + * Defines which of the palette's matrices is affected by subsequent matrix operations when the current matrix mode is {@link #GL_MATRIX_PALETTE_ARB MATRIX_PALETTE_ARB}, + * + * @param index the current matrix index. Must be a value between 0 and {@link #GL_MAX_PALETTE_MATRICES_ARB MAX_PALETTE_MATRICES_ARB}. + */ + public static native void glCurrentPaletteMatrixARB(@NativeType("GLint") int index); + + // --- [ glMatrixIndexuivARB ] --- + + /** + * Unsafe version of: {@link #glMatrixIndexuivARB MatrixIndexuivARB} + * + * @param size the number of index values to set. Must be a value between 1 and {@link ARBVertexBlend#GL_MAX_VERTEX_UNITS_ARB MAX_VERTEX_UNITS_ARB}. + */ + public static native void nglMatrixIndexuivARB(int size, long indices); + + /** + * Sets the current matrix indices. + * + * @param indices the matrix index values + */ + public static void glMatrixIndexuivARB(@NativeType("GLuint *") IntBuffer indices) { + nglMatrixIndexuivARB(indices.remaining(), memAddress(indices)); + } + + // --- [ glMatrixIndexubvARB ] --- + + /** + * Unsafe version of: {@link #glMatrixIndexubvARB MatrixIndexubvARB} + * + * @param size the number of index values to set. Must be a value between 1 and {@link ARBVertexBlend#GL_MAX_VERTEX_UNITS_ARB MAX_VERTEX_UNITS_ARB}. + */ + public static native void nglMatrixIndexubvARB(int size, long indices); + + /** + * Byte version of {@link #glMatrixIndexuivARB MatrixIndexuivARB}. + * + * @param indices the matrix index values + */ + public static void glMatrixIndexubvARB(@NativeType("GLubyte *") ByteBuffer indices) { + nglMatrixIndexubvARB(indices.remaining(), memAddress(indices)); + } + + // --- [ glMatrixIndexusvARB ] --- + + /** + * Unsafe version of: {@link #glMatrixIndexusvARB MatrixIndexusvARB} + * + * @param size the number of index values to set. Must be a value between 1 and {@link ARBVertexBlend#GL_MAX_VERTEX_UNITS_ARB MAX_VERTEX_UNITS_ARB}. + */ + public static native void nglMatrixIndexusvARB(int size, long indices); + + /** + * Short version of {@link #glMatrixIndexuivARB MatrixIndexuivARB}. + * + * @param indices the matrix index values + */ + public static void glMatrixIndexusvARB(@NativeType("GLushort *") ShortBuffer indices) { + nglMatrixIndexusvARB(indices.remaining(), memAddress(indices)); + } + + // --- [ glMatrixIndexPointerARB ] --- + + /** + * Unsafe version of: {@link #glMatrixIndexPointerARB MatrixIndexPointerARB} + * + * @param type the data type of the values stored in the array. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static native void nglMatrixIndexPointerARB(int size, int type, int stride, long pointer); + + /** + * @param size the number of index values per vertex that are stored in the array. Must be a value between 1 and {@link ARBVertexBlend#GL_MAX_VERTEX_UNITS_ARB MAX_VERTEX_UNITS_ARB}. + * @param type the data type of the values stored in the array. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the matrix index data + */ + public static void glMatrixIndexPointerARB(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + nglMatrixIndexPointerARB(size, type, stride, memAddress(pointer)); + } + + /** + * @param size the number of index values per vertex that are stored in the array. Must be a value between 1 and {@link ARBVertexBlend#GL_MAX_VERTEX_UNITS_ARB MAX_VERTEX_UNITS_ARB}. + * @param type the data type of the values stored in the array. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the matrix index data + */ + public static void glMatrixIndexPointerARB(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + nglMatrixIndexPointerARB(size, type, stride, pointer); + } + + /** + * @param size the number of index values per vertex that are stored in the array. Must be a value between 1 and {@link ARBVertexBlend#GL_MAX_VERTEX_UNITS_ARB MAX_VERTEX_UNITS_ARB}. + * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the matrix index data + */ + public static void glMatrixIndexPointerARB(@NativeType("GLint") int size, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + nglMatrixIndexPointerARB(size, GL11.GL_UNSIGNED_BYTE, stride, memAddress(pointer)); + } + + /** + * @param size the number of index values per vertex that are stored in the array. Must be a value between 1 and {@link ARBVertexBlend#GL_MAX_VERTEX_UNITS_ARB MAX_VERTEX_UNITS_ARB}. + * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the matrix index data + */ + public static void glMatrixIndexPointerARB(@NativeType("GLint") int size, @NativeType("GLsizei") int stride, @NativeType("void const *") ShortBuffer pointer) { + nglMatrixIndexPointerARB(size, GL11.GL_UNSIGNED_SHORT, stride, memAddress(pointer)); + } + + /** + * @param size the number of index values per vertex that are stored in the array. Must be a value between 1 and {@link ARBVertexBlend#GL_MAX_VERTEX_UNITS_ARB MAX_VERTEX_UNITS_ARB}. + * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the matrix index data + */ + public static void glMatrixIndexPointerARB(@NativeType("GLint") int size, @NativeType("GLsizei") int stride, @NativeType("void const *") IntBuffer pointer) { + nglMatrixIndexPointerARB(size, GL11.GL_UNSIGNED_INT, stride, memAddress(pointer)); + } + + /** Array version of: {@link #glMatrixIndexuivARB MatrixIndexuivARB} */ + public static void glMatrixIndexuivARB(@NativeType("GLuint *") int[] indices) { + long __functionAddress = GL.getICD().glMatrixIndexuivARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(indices.length, indices, __functionAddress); + } + + /** Array version of: {@link #glMatrixIndexusvARB MatrixIndexusvARB} */ + public static void glMatrixIndexusvARB(@NativeType("GLushort *") short[] indices) { + long __functionAddress = GL.getICD().glMatrixIndexusvARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(indices.length, indices, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMultiBind.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMultiBind.java new file mode 100644 index 00000000..1a3fd151 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMultiBind.java @@ -0,0 +1,344 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_multi_bind extension. + * + *

This extension provides a new set of commands allowing applications to bind or unbind a set of objects in a single call, instead of requiring a separate + * call for each bind or unbind operation. Using a single command allows OpenGL implementations to amortize function call, name space lookup, and + * potential locking overhead over multiple bind or unbind operations. The rendering loops of graphics applications frequently switch between different + * states, binding different sets of resources, including texture objects, sampler objects, textures for image loads and stores, uniform buffers, and + * vertex buffers; this extension provides "multi-bind" entry points for all of these object types.

+ * + *

Each command in this extension includes a <first> and <count> parameter, specifying a continguous range of binding points to update, as well + * as an array of <count> object names specifying the objects to bind. Unlike single bind commands, multi-bind commands can be used only to bind or + * unbind existing objects. Passing a previously unused object name (generated or not) results in an error and does not create a new object. For binding + * points with associated data (e.g., ranges of a buffer), separate arrays are used to pass the associated data for each binding point. Passing zero values + * in the array of object names removes the object bound to the current bounding point. Additionally, if {@code NULL} is passed as the array of objects, objects + * bound to the entire range of binding points are unbound, as though the caller passed an array of zeroes.

+ * + *

Requires {@link GL30 OpenGL 3.0}. Promoted to core in {@link GL44 OpenGL 4.4}.

+ */ +public class ARBMultiBind { + + static { GL.initialize(); } + + protected ARBMultiBind() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBindBuffersBase, caps.glBindBuffersRange, caps.glBindTextures, caps.glBindSamplers, caps.glBindImageTextures, caps.glBindVertexBuffers + ); + } + + // --- [ glBindBuffersBase ] --- + + /** + * Unsafe version of: {@link #glBindBuffersBase BindBuffersBase} + * + * @param count the number of bindings + */ + public static void nglBindBuffersBase(int target, int first, int count, long buffers) { + GL44C.nglBindBuffersBase(target, first, count, buffers); + } + + /** + * Binds {@code count} existing buffer objects to bindings numbered {@code first} through {@code first+count-1} in the array of buffer binding points + * corresponding to {@code target}. If {@code buffers} is not {@code NULL}, it specifies an array of {@code count} values, each of which must be zero or the name + * of an existing buffer object. It is equivalent to: + * + *

+     * for ( i = 0; i < count; i++ ) {
+     *     if ( buffers == NULL ) {
+     *         glBindBufferBase(target, first + i, 0);
+     *     } else {
+     *         glBindBufferBase(target, first + i, buffers[i]);
+     *     }
+     * }
+ * + *

except that the single general buffer binding corresponding to {@code target} is unmodified, and that buffers will not be created if they do not exist.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param first the first binding + * @param buffers an array of zeros or names of existing buffers objects + */ + public static void glBindBuffersBase(@NativeType("GLenum") int target, @NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") IntBuffer buffers) { + GL44C.glBindBuffersBase(target, first, buffers); + } + + // --- [ glBindBuffersRange ] --- + + /** + * Unsafe version of: {@link #glBindBuffersRange BindBuffersRange} + * + * @param count the number of bindings + */ + public static void nglBindBuffersRange(int target, int first, int count, long buffers, long offsets, long sizes) { + GL44C.nglBindBuffersRange(target, first, count, buffers, offsets, sizes); + } + + /** + * Binds {@code count} existing buffer objects to bindings numbered {@code first} through {@code first+count-1} in the array of buffer binding points + * corresponding to {@code target}. {@code offsets} and {@code sizes} specify arrays of {@code count} values indicating the range of each buffer to bind. + * If {@code buffers} is {@code NULL}, all bindings from {@code first} through {@code first+count-1} are reset to their unbound (zero) state. In this + * case, the offsets and sizes associated with the binding points are set to default values, ignoring {@code offsets} and {@code sizes}. It is equivalent + * to: + * + *

+     * for ( i = 0; i < count; i++ ) {
+     *     if ( buffers == NULL ) {
+     *         glBindBufferRange(target, first + i, 0, 0, 0);
+     *     } else {
+     *         glBindBufferRange(target, first + i, buffers[i], offsets[i], sizes[i]);
+     *     }
+     * }
+ * + *

except that the single general buffer binding corresponding to {@code target} is unmodified, and that buffers will not be created if they do not exist.

+ * + *

The values specified in {@code buffers}, {@code offsets}, and {@code sizes} will be checked separately for each binding point. When values for a + * specific binding point are invalid, the state for that binding point will be unchanged and an error will be generated. However, state for other binding + * points will still be changed if their corresponding values are valid.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param first the first binding + * @param buffers an array of names of existing buffers objects + * @param offsets an array of offsets + * @param sizes an array of sizes + */ + public static void glBindBuffersRange(@NativeType("GLenum") int target, @NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") IntBuffer buffers, @Nullable @NativeType("GLintptr const *") PointerBuffer offsets, @Nullable @NativeType("GLsizeiptr const *") PointerBuffer sizes) { + GL44C.glBindBuffersRange(target, first, buffers, offsets, sizes); + } + + // --- [ glBindTextures ] --- + + /** + * Unsafe version of: {@link #glBindTextures BindTextures} + * + * @param count the number of texture objects + */ + public static void nglBindTextures(int first, int count, long textures) { + GL44C.nglBindTextures(first, count, textures); + } + + /** + * Binds {@code count} existing texture objects to texture image units numbered {@code first} through {@code first+count-1}. If {@code textures} is not + * {@code NULL}, it specifies an array of {@code count} values, each of which must be zero or the name of an existing texture object. When an entry in + * {@code textures} is the name of an existing texture object, that object is bound to corresponding texture unit for the target specified when the texture + * object was created. When an entry in {@code textures} is zero, each of the targets enumerated at the beginning of this section is reset to its default + * texture for the corresponding texture image unit. If {@code textures} is {@code NULL}, each target of each affected texture image unit from {@code first} + * through {@code first+count-1} is reset to its default texture. + * + *

{@code BindTextures} is equivalent to:

+ * + *

+     * for ( i = 0; i < count; i++ ) {
+     *     uint texture;
+     *     if ( textures == NULL ) {
+     *         texture = 0;
+     *     } else {
+     *         texture = textures[i];
+     *     }
+     *     ActiveTexture(TEXTURE0 + first + i);
+     *     if ( texture != 0 ) {
+     *         enum target; // target of texture object textures[i]
+     *         BindTexture(target, textures[i]);
+     *     } else {
+     *         for ( target in all supported targets ) {
+     *             BindTexture(target, 0);
+     *         }
+     *     }
+     * }
+ * + *

except that the active texture selector retains its original value upon completion of the command, and that textures will not be created if they do not + * exist.

+ * + *

The values specified in {@code textures} will be checked separately for each texture image unit. When a value for a specific texture image unit is + * invalid, the state for that texture image unit will be unchanged and an error will be generated. However, state for other texture image units will still + * be changed if their corresponding values are valid.

+ * + * @param first the first texture objects + * @param textures an array of zeros or names of existing texture objects + */ + public static void glBindTextures(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") IntBuffer textures) { + GL44C.glBindTextures(first, textures); + } + + // --- [ glBindSamplers ] --- + + /** + * Unsafe version of: {@link #glBindSamplers BindSamplers} + * + * @param count the number of sampler objects + */ + public static void nglBindSamplers(int first, int count, long samplers) { + GL44C.nglBindSamplers(first, count, samplers); + } + + /** + * Binds {@code count} existing sampler objects to texture image units numbered {@code first} through {@code first+count-1}. If {@code samplers} is not + * {@code NULL}, it specifies an array of {@code count} values, each of which must be zero or the name of an existing sampler object. If {@code samplers} is {@code NULL}, + * each affected texture image unit from {@code first} through {@code first+count-1} will be reset to have no bound sampler object. + * + *

{@code BindSamplers} is equivalent to:

+ * + *

+     * for ( i = 0; i < count; i++ ) {
+     *     if ( samplers == NULL ) {
+     *         glBindSampler(first + i, 0);
+     *     } else {
+     *         glBindSampler(first + i, samplers[i]);
+     *     }
+     * }
+ * + *

The values specified in {@code samplers} will be checked separately for each texture image unit. When a value for a specific texture image unit is + * invalid, the state for that texture image unit will be unchanged and an error will be generated. However, state for other texture image units will still + * be changed if their corresponding values are valid.

+ * + * @param first the first sampler object + * @param samplers an array of zeros or names of existing sampler objects + */ + public static void glBindSamplers(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") IntBuffer samplers) { + GL44C.glBindSamplers(first, samplers); + } + + // --- [ glBindImageTextures ] --- + + /** + * Unsafe version of: {@link #glBindImageTextures BindImageTextures} + * + * @param count the number of image units + */ + public static void nglBindImageTextures(int first, int count, long textures) { + GL44C.nglBindImageTextures(first, count, textures); + } + + /** + * Binds {@code count} existing texture objects to image units numbered {@code first} through {@code first+count-1}. If {@code textures} is not {@code NULL}, it + * specifies an array of {@code count} values, each of which must be zero or the name of an existing texture object. If {@code textures} is {@code NULL}, each + * affected image unit from {@code first} through {@code first+count-1} will be reset to have no bound texture object. + * + *

When binding a non-zero texture object to an image unit, the image unit {@code level}, {@code layered}, {@code layer}, and {@code access} parameters are + * set to zero, {@link GL11#GL_TRUE TRUE}, zero, and {@link GL15#GL_READ_WRITE READ_WRITE}, respectively. The image unit {@code format} parameter is taken from the internal + * format of the texture image at level zero of the texture object identified by {@code textures}. For cube map textures, the internal format of the + * {@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X} image of level zero is used. For multisample, multisample array, buffer, and rectangle textures, the internal + * format of the single texture level is used.

+ * + *

When unbinding a texture object from an image unit, the image unit parameters {@code level}, {@code layered}, {@code layer}, and {@code format} will be + * reset to their default values of zero, {@link GL11#GL_FALSE FALSE}, 0, and {@link GL30#GL_R8 R8}, respectively.

+ * + *

{@code BindImageTextures} is equivalent to:

+ * + *

+     * for ( i = 0; i < count; i++ ) {
+     *     if ( textures == NULL || textures[i] = 0 ) {
+     *         glBindImageTexture(first + i, 0, 0, FALSE, 0, READ_ONLY, R8);
+     *     } else {
+     *         glBindImageTexture(first + i, textures[i], 0, TRUE, 0, READ_WRITE, lookupInternalFormat(textures[i]));
+     *     }
+     * }
+ * + *

where {@code lookupInternalFormat} returns the internal format of the specified texture object.

+ * + *

The values specified in {@code textures} will be checked separately for each image unit. When a value for a specific image unit is invalid, the state + * for that image unit will be unchanged and an error will be generated. However, state for other image units will still be changed if their corresponding + * values are valid.

+ * + * @param first the first image unit + * @param textures an array of zeros or names of existing texture objects + */ + public static void glBindImageTextures(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") IntBuffer textures) { + GL44C.glBindImageTextures(first, textures); + } + + // --- [ glBindVertexBuffers ] --- + + /** + * Unsafe version of: {@link #glBindVertexBuffers BindVertexBuffers} + * + * @param count the number of vertex buffer binding points + */ + public static void nglBindVertexBuffers(int first, int count, long buffers, long offsets, long strides) { + GL44C.nglBindVertexBuffers(first, count, buffers, offsets, strides); + } + + /** + * Binds {@code count} existing buffer objects to vertex buffer binding points numbered {@code first} through {@code first+count-1}. If {@code buffers} is + * not {@code NULL}, it specifies an array of {@code count} values, each of which must be zero or the name of an existing buffer object. {@code offsets} and + * {@code strides} specify arrays of {@code count} values indicating the offset of the first element and stride between elements in each buffer, + * respectively. If {@code buffers} is {@code NULL}, each affected vertex buffer binding point from {@code first} through {@code first+count-1} will be reset to + * have no bound buffer object. In this case, the offsets and strides associated with the binding points are set to default values, ignoring + * {@code offsets} and {@code strides}. + * + *

{@code BindVertexBuffers} is equivalent to:

+ * + *

+     * for ( i = 0; i < count; i++ ) {
+     *     if ( buffers == NULL ) {
+     *         glBindVertexBuffer(first + i, 0, 0, 16);
+     *     } else {
+     *         glBindVertexBuffer(first + i, buffers[i], offsets[i], strides[i]);
+     *     }
+     * }
+ * + *

except that buffers will not be created if they do not exist.

+ * + *

The values specified in {@code buffers}, {@code offsets}, and {@code strides} will be checked separately for each vertex buffer binding point. When a + * value for a specific binding point is invalid, the state for that binding point will be unchanged and an error will be generated. However, state for + * other binding points will still be changed if their corresponding values are valid.

+ * + * @param first the first vertex buffer binding point + * @param buffers an array of zeros or names of existing buffers objects + * @param offsets an array of offses + * @param strides an array of stride values + */ + public static void glBindVertexBuffers(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") IntBuffer buffers, @Nullable @NativeType("GLintptr const *") PointerBuffer offsets, @Nullable @NativeType("GLsizei const *") IntBuffer strides) { + GL44C.glBindVertexBuffers(first, buffers, offsets, strides); + } + + /** Array version of: {@link #glBindBuffersBase BindBuffersBase} */ + public static void glBindBuffersBase(@NativeType("GLenum") int target, @NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") int[] buffers) { + GL44C.glBindBuffersBase(target, first, buffers); + } + + /** Array version of: {@link #glBindBuffersRange BindBuffersRange} */ + public static void glBindBuffersRange(@NativeType("GLenum") int target, @NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") int[] buffers, @Nullable @NativeType("GLintptr const *") PointerBuffer offsets, @Nullable @NativeType("GLsizeiptr const *") PointerBuffer sizes) { + GL44C.glBindBuffersRange(target, first, buffers, offsets, sizes); + } + + /** Array version of: {@link #glBindTextures BindTextures} */ + public static void glBindTextures(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") int[] textures) { + GL44C.glBindTextures(first, textures); + } + + /** Array version of: {@link #glBindSamplers BindSamplers} */ + public static void glBindSamplers(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") int[] samplers) { + GL44C.glBindSamplers(first, samplers); + } + + /** Array version of: {@link #glBindImageTextures BindImageTextures} */ + public static void glBindImageTextures(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") int[] textures) { + GL44C.glBindImageTextures(first, textures); + } + + /** Array version of: {@link #glBindVertexBuffers BindVertexBuffers} */ + public static void glBindVertexBuffers(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") int[] buffers, @Nullable @NativeType("GLintptr const *") PointerBuffer offsets, @Nullable @NativeType("GLsizei const *") int[] strides) { + GL44C.glBindVertexBuffers(first, buffers, offsets, strides); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMultiDrawIndirect.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMultiDrawIndirect.java new file mode 100644 index 00000000..295ad599 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMultiDrawIndirect.java @@ -0,0 +1,275 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_multi_draw_indirect extension. + * + *

The {@link ARBDrawIndirect ARB_draw_indirect} extension (included in OpenGL 4.0) introduced mechanisms whereby the parameters for a draw function may be provided in a + * structure contained in a buffer object rather than as parameters to the drawing procedure. This is known as an indirect draw and is exposed as two new + * functions, {@link ARBDrawIndirect#glDrawArraysIndirect DrawArraysIndirect} and {@link ARBDrawIndirect#glDrawElementsIndirect DrawElementsIndirect}. Each of these functions generates a single batch of + * primitives.

+ * + *

This extension builds on this functionality by providing procedures to invoke multiple draws from a single procedure call. This allows large batches of + * drawing commands to be assembled in server memory (via a buffer object) which may then be dispatched through a single function call.

+ * + *

Requires {@link GL40 OpenGL 4.0} or {@link ARBDrawIndirect ARB_draw_indirect}. Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ +public class ARBMultiDrawIndirect { + + static { GL.initialize(); } + + protected ARBMultiDrawIndirect() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glMultiDrawArraysIndirect, caps.glMultiDrawElementsIndirect + ); + } + + // --- [ glMultiDrawArraysIndirect ] --- + + /** Unsafe version of: {@link #glMultiDrawArraysIndirect MultiDrawArraysIndirect} */ + public static void nglMultiDrawArraysIndirect(int mode, long indirect, int drawcount, int stride) { + GL43C.nglMultiDrawArraysIndirect(mode, indirect, drawcount, stride); + } + + /** + * Renders multiple sets of primitives from array data, taking parameters from memory. + * + *

The parameters addressed by {@code indirect} are packed into an array of structures, each element of which takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint first;
+     *     uint baseInstance;
+     * } DrawArraysIndirectCommand;
+ * + *

A single call to {@code glMultiDrawArraysIndirect} is equivalent, assuming no errors are generated to:

+ * + *

+     * const ubyte *ptr = (const ubyte *)indirect;
+     * for ( i = 0; i < drawcount; i++ ) {
+     *     DrawArraysIndirect(mode, (DrawArraysIndirectCommand*)ptr);
+     *     if ( stride == 0 )
+     *         ptr += sizeof(DrawArraysIndirectCommand);
+     *     else
+     *         ptr += stride;
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect an array of structures containing the draw parameters + * @param drawcount the number of elements in the array of draw parameter structures + * @param stride the distance in basic machine units between elements of the draw parameter array + */ + public static void glMultiDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + GL43C.glMultiDrawArraysIndirect(mode, indirect, drawcount, stride); + } + + /** + * Renders multiple sets of primitives from array data, taking parameters from memory. + * + *

The parameters addressed by {@code indirect} are packed into an array of structures, each element of which takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint first;
+     *     uint baseInstance;
+     * } DrawArraysIndirectCommand;
+ * + *

A single call to {@code glMultiDrawArraysIndirect} is equivalent, assuming no errors are generated to:

+ * + *

+     * const ubyte *ptr = (const ubyte *)indirect;
+     * for ( i = 0; i < drawcount; i++ ) {
+     *     DrawArraysIndirect(mode, (DrawArraysIndirectCommand*)ptr);
+     *     if ( stride == 0 )
+     *         ptr += sizeof(DrawArraysIndirectCommand);
+     *     else
+     *         ptr += stride;
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect an array of structures containing the draw parameters + * @param drawcount the number of elements in the array of draw parameter structures + * @param stride the distance in basic machine units between elements of the draw parameter array + */ + public static void glMultiDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") long indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + GL43C.glMultiDrawArraysIndirect(mode, indirect, drawcount, stride); + } + + /** + * Renders multiple sets of primitives from array data, taking parameters from memory. + * + *

The parameters addressed by {@code indirect} are packed into an array of structures, each element of which takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint first;
+     *     uint baseInstance;
+     * } DrawArraysIndirectCommand;
+ * + *

A single call to {@code glMultiDrawArraysIndirect} is equivalent, assuming no errors are generated to:

+ * + *

+     * const ubyte *ptr = (const ubyte *)indirect;
+     * for ( i = 0; i < drawcount; i++ ) {
+     *     DrawArraysIndirect(mode, (DrawArraysIndirectCommand*)ptr);
+     *     if ( stride == 0 )
+     *         ptr += sizeof(DrawArraysIndirectCommand);
+     *     else
+     *         ptr += stride;
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect an array of structures containing the draw parameters + * @param drawcount the number of elements in the array of draw parameter structures + * @param stride the distance in basic machine units between elements of the draw parameter array + */ + public static void glMultiDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + GL43C.glMultiDrawArraysIndirect(mode, indirect, drawcount, stride); + } + + // --- [ glMultiDrawElementsIndirect ] --- + + /** Unsafe version of: {@link #glMultiDrawElementsIndirect MultiDrawElementsIndirect} */ + public static void nglMultiDrawElementsIndirect(int mode, int type, long indirect, int drawcount, int stride) { + GL43C.nglMultiDrawElementsIndirect(mode, type, indirect, drawcount, stride); + } + + /** + * Renders multiple indexed primitives from array data, taking parameters from memory. + * + *

The parameters addressed by indirect are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint firstIndex;
+     *     uint baseVertex;
+     *     uint baseInstance;
+     * } DrawElementsIndirectCommand;
+ * + *

A single call to {@code glMultiDrawElementsIndirect} is equivalent, assuming no errors are generated to:

+ * + *

+     * const ubyte *ptr = (const ubyte *)indirect;
+     * for ( i = 0; i < drawcount; i++ ) {
+     *     DrawElementsIndirect(mode, type, (DrawElementsIndirectCommand *)ptr);
+     *     if ( stride == 0 )
+     *         ptr += sizeof(DrawElementsIndirectCommand);
+     *     else
+     *         ptr += stride;
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect a structure containing an array of draw parameters + * @param drawcount the number of elements in the array addressed by {@code indirect} + * @param stride the distance in basic machine units between elements of the draw parameter array + */ + public static void glMultiDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + GL43C.glMultiDrawElementsIndirect(mode, type, indirect, drawcount, stride); + } + + /** + * Renders multiple indexed primitives from array data, taking parameters from memory. + * + *

The parameters addressed by indirect are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint firstIndex;
+     *     uint baseVertex;
+     *     uint baseInstance;
+     * } DrawElementsIndirectCommand;
+ * + *

A single call to {@code glMultiDrawElementsIndirect} is equivalent, assuming no errors are generated to:

+ * + *

+     * const ubyte *ptr = (const ubyte *)indirect;
+     * for ( i = 0; i < drawcount; i++ ) {
+     *     DrawElementsIndirect(mode, type, (DrawElementsIndirectCommand *)ptr);
+     *     if ( stride == 0 )
+     *         ptr += sizeof(DrawElementsIndirectCommand);
+     *     else
+     *         ptr += stride;
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect a structure containing an array of draw parameters + * @param drawcount the number of elements in the array addressed by {@code indirect} + * @param stride the distance in basic machine units between elements of the draw parameter array + */ + public static void glMultiDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") long indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + GL43C.glMultiDrawElementsIndirect(mode, type, indirect, drawcount, stride); + } + + /** + * Renders multiple indexed primitives from array data, taking parameters from memory. + * + *

The parameters addressed by indirect are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint firstIndex;
+     *     uint baseVertex;
+     *     uint baseInstance;
+     * } DrawElementsIndirectCommand;
+ * + *

A single call to {@code glMultiDrawElementsIndirect} is equivalent, assuming no errors are generated to:

+ * + *

+     * const ubyte *ptr = (const ubyte *)indirect;
+     * for ( i = 0; i < drawcount; i++ ) {
+     *     DrawElementsIndirect(mode, type, (DrawElementsIndirectCommand *)ptr);
+     *     if ( stride == 0 )
+     *         ptr += sizeof(DrawElementsIndirectCommand);
+     *     else
+     *         ptr += stride;
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect a structure containing an array of draw parameters + * @param drawcount the number of elements in the array addressed by {@code indirect} + * @param stride the distance in basic machine units between elements of the draw parameter array + */ + public static void glMultiDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + GL43C.glMultiDrawElementsIndirect(mode, type, indirect, drawcount, stride); + } + + /** Array version of: {@link #glMultiDrawArraysIndirect MultiDrawArraysIndirect} */ + public static void glMultiDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") int[] indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + GL43C.glMultiDrawArraysIndirect(mode, indirect, drawcount, stride); + } + + /** Array version of: {@link #glMultiDrawElementsIndirect MultiDrawElementsIndirect} */ + public static void glMultiDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") int[] indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + GL43C.glMultiDrawElementsIndirect(mode, type, indirect, drawcount, stride); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMultisample.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMultisample.java new file mode 100644 index 00000000..b66f3552 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMultisample.java @@ -0,0 +1,78 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_multisample extension. + * + *

This extension provides a mechanism to antialias all GL primitives: points, lines, polygons, bitmaps, and images. The technique is to sample all + * primitives multiple times at each pixel. The color sample values are resolved to a single, displayable color each time a pixel is updated, so the + * antialiasing appears to be automatic at the application level. Because each sample includes depth and stencil information, the depth and stencil + * functions perform equivalently to the single-sample mode.

+ * + *

An additional buffer, called the multisample buffer, is added to the framebuffer. Pixel sample values, including color, depth, and stencil values, are + * stored in this buffer. When the framebuffer includes a multisample buffer, it does not also include separate depth or stencil buffers, even if the + * multisample buffer does not store depth or stencil values. Color buffers (left/right, front/back, and aux) do coexist with the multisample buffer, + * however.

+ * + *

Multisample antialiasing is most valuable for rendering polygons, because it requires no sorting for hidden surface elimination, and it correctly + * handles adjacent polygons, object silhouettes, and even intersecting polygons. If only points or lines are being rendered, the "smooth" antialiasing + * mechanism provided by the base GL may result in a higher quality image. This extension is designed to allow multisample and smooth antialiasing + * techniques to be alternated during the rendering of a single scene.

+ */ +public class ARBMultisample { + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int + GL_MULTISAMPLE_ARB = 0x809D, + GL_SAMPLE_ALPHA_TO_COVERAGE_ARB = 0x809E, + GL_SAMPLE_ALPHA_TO_ONE_ARB = 0x809F, + GL_SAMPLE_COVERAGE_ARB = 0x80A0; + + /** Accepted by the {@code mask} parameter of PushAttrib. */ + public static final int GL_MULTISAMPLE_BIT_ARB = 0x20000000; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_SAMPLE_BUFFERS_ARB = 0x80A8, + GL_SAMPLES_ARB = 0x80A9, + GL_SAMPLE_COVERAGE_VALUE_ARB = 0x80AA, + GL_SAMPLE_COVERAGE_INVERT_ARB = 0x80AB; + + static { GL.initialize(); } + + protected ARBMultisample() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glSampleCoverageARB + ); + } + + // --- [ glSampleCoverageARB ] --- + + /** + * Specifies simultaneously the values of {@link #GL_SAMPLE_COVERAGE_VALUE_ARB SAMPLE_COVERAGE_VALUE_ARB} and {@link #GL_SAMPLE_COVERAGE_INVERT_ARB SAMPLE_COVERAGE_INVERT_ARB}. + * + *

If {@link #GL_SAMPLE_COVERAGE_ARB SAMPLE_COVERAGE_ARB} is enabled, the fragment coverage is ANDed with another temporary coverage. This temporary coverage is a function of the value + * of {@link #GL_SAMPLE_COVERAGE_VALUE_ARB SAMPLE_COVERAGE_VALUE_ARB}. If {@link #GL_SAMPLE_COVERAGE_INVERT_ARB SAMPLE_COVERAGE_INVERT_ARB} is {@link GL11#GL_TRUE TRUE}, the temporary coverage is inverted (all bit values are inverted) before it + * is ANDed with the fragment coverage.

+ * + * @param value the desired coverage value + * @param invert if true, the temporary coverage is inverted. One of:
{@link GL11#GL_TRUE TRUE}{@link GL11#GL_FALSE FALSE}
+ */ + public static native void glSampleCoverageARB(@NativeType("GLfloat") float value, @NativeType("GLboolean") boolean invert); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMultitexture.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMultitexture.java new file mode 100644 index 00000000..aaa9a185 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBMultitexture.java @@ -0,0 +1,736 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_multitexture extension. + * + *

This extension allows application of multiple textures to a fragment in one rendering pass.

+ * + *

Promoted to core in {@link GL13 OpenGL 1.3}.

+ */ +public class ARBMultitexture { + + /** Accepted by the {@code texture} parameter of ActiveTexture and MultiTexCoord. */ + public static final int + GL_TEXTURE0_ARB = 0x84C0, + GL_TEXTURE1_ARB = 0x84C1, + GL_TEXTURE2_ARB = 0x84C2, + GL_TEXTURE3_ARB = 0x84C3, + GL_TEXTURE4_ARB = 0x84C4, + GL_TEXTURE5_ARB = 0x84C5, + GL_TEXTURE6_ARB = 0x84C6, + GL_TEXTURE7_ARB = 0x84C7, + GL_TEXTURE8_ARB = 0x84C8, + GL_TEXTURE9_ARB = 0x84C9, + GL_TEXTURE10_ARB = 0x84CA, + GL_TEXTURE11_ARB = 0x84CB, + GL_TEXTURE12_ARB = 0x84CC, + GL_TEXTURE13_ARB = 0x84CD, + GL_TEXTURE14_ARB = 0x84CE, + GL_TEXTURE15_ARB = 0x84CF, + GL_TEXTURE16_ARB = 0x84D0, + GL_TEXTURE17_ARB = 0x84D1, + GL_TEXTURE18_ARB = 0x84D2, + GL_TEXTURE19_ARB = 0x84D3, + GL_TEXTURE20_ARB = 0x84D4, + GL_TEXTURE21_ARB = 0x84D5, + GL_TEXTURE22_ARB = 0x84D6, + GL_TEXTURE23_ARB = 0x84D7, + GL_TEXTURE24_ARB = 0x84D8, + GL_TEXTURE25_ARB = 0x84D9, + GL_TEXTURE26_ARB = 0x84DA, + GL_TEXTURE27_ARB = 0x84DB, + GL_TEXTURE28_ARB = 0x84DC, + GL_TEXTURE29_ARB = 0x84DD, + GL_TEXTURE30_ARB = 0x84DE, + GL_TEXTURE31_ARB = 0x84DF; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_ACTIVE_TEXTURE_ARB = 0x84E0, + GL_CLIENT_ACTIVE_TEXTURE_ARB = 0x84E1, + GL_MAX_TEXTURE_UNITS_ARB = 0x84E2; + + static { GL.initialize(); } + + protected ARBMultitexture() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glActiveTextureARB, caps.glClientActiveTextureARB, caps.glMultiTexCoord1fARB, caps.glMultiTexCoord1sARB, caps.glMultiTexCoord1iARB, + caps.glMultiTexCoord1dARB, caps.glMultiTexCoord1fvARB, caps.glMultiTexCoord1svARB, caps.glMultiTexCoord1ivARB, caps.glMultiTexCoord1dvARB, + caps.glMultiTexCoord2fARB, caps.glMultiTexCoord2sARB, caps.glMultiTexCoord2iARB, caps.glMultiTexCoord2dARB, caps.glMultiTexCoord2fvARB, + caps.glMultiTexCoord2svARB, caps.glMultiTexCoord2ivARB, caps.glMultiTexCoord2dvARB, caps.glMultiTexCoord3fARB, caps.glMultiTexCoord3sARB, + caps.glMultiTexCoord3iARB, caps.glMultiTexCoord3dARB, caps.glMultiTexCoord3fvARB, caps.glMultiTexCoord3svARB, caps.glMultiTexCoord3ivARB, + caps.glMultiTexCoord3dvARB, caps.glMultiTexCoord4fARB, caps.glMultiTexCoord4sARB, caps.glMultiTexCoord4iARB, caps.glMultiTexCoord4dARB, + caps.glMultiTexCoord4fvARB, caps.glMultiTexCoord4svARB, caps.glMultiTexCoord4ivARB, caps.glMultiTexCoord4dvARB + ); + } + + // --- [ glActiveTextureARB ] --- + + /** + * Selects which texture unit subsequent texture state calls will affect. The number of texture units an implementation supports is implementation + * dependent. + * + * @param texture which texture unit to make active. One of:
{@link #GL_TEXTURE0_ARB TEXTURE0_ARB}GL_TEXTURE[1-31]
+ */ + public static native void glActiveTextureARB(@NativeType("GLenum") int texture); + + // --- [ glClientActiveTextureARB ] --- + + /** + * Selects the vertex array client state parameters to be modified by the TexCoordPointer command and the array affected by EnableClientState and + * DisableClientState with parameter TEXTURE_COORD_ARRAY. + * + * @param texture which texture coordinate array to make active. One of:
{@link #GL_TEXTURE0_ARB TEXTURE0_ARB}GL_TEXTURE[1-31]
+ */ + public static native void glClientActiveTextureARB(@NativeType("GLenum") int texture); + + // --- [ glMultiTexCoord1fARB ] --- + + /** + * Sets the current one-dimensional texture coordinate for the specified texture coordinate set. {@code t} and {@code r} are implicitly set to 0 and {@code q} to 1. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + */ + public static native void glMultiTexCoord1fARB(@NativeType("GLenum") int texture, @NativeType("GLfloat") float s); + + // --- [ glMultiTexCoord1sARB ] --- + + /** + * Short version of {@link #glMultiTexCoord1fARB MultiTexCoord1fARB}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + */ + public static native void glMultiTexCoord1sARB(@NativeType("GLenum") int texture, @NativeType("GLshort") short s); + + // --- [ glMultiTexCoord1iARB ] --- + + /** + * Integer version of {@link #glMultiTexCoord1fARB MultiTexCoord1fARB}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + */ + public static native void glMultiTexCoord1iARB(@NativeType("GLenum") int texture, @NativeType("GLint") int s); + + // --- [ glMultiTexCoord1dARB ] --- + + /** + * Double version of {@link #glMultiTexCoord1fARB MultiTexCoord1fARB}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + */ + public static native void glMultiTexCoord1dARB(@NativeType("GLenum") int texture, @NativeType("GLdouble") double s); + + // --- [ glMultiTexCoord1fvARB ] --- + + /** Unsafe version of: {@link #glMultiTexCoord1fvARB MultiTexCoord1fvARB} */ + public static native void nglMultiTexCoord1fvARB(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord1fARB MultiTexCoord1fARB}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + */ + public static void glMultiTexCoord1fvARB(@NativeType("GLenum") int texture, @NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglMultiTexCoord1fvARB(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord1svARB ] --- + + /** Unsafe version of: {@link #glMultiTexCoord1svARB MultiTexCoord1svARB} */ + public static native void nglMultiTexCoord1svARB(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord1sARB MultiTexCoord1sARB}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + */ + public static void glMultiTexCoord1svARB(@NativeType("GLenum") int texture, @NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglMultiTexCoord1svARB(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord1ivARB ] --- + + /** Unsafe version of: {@link #glMultiTexCoord1ivARB MultiTexCoord1ivARB} */ + public static native void nglMultiTexCoord1ivARB(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord1iARB MultiTexCoord1iARB}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + */ + public static void glMultiTexCoord1ivARB(@NativeType("GLenum") int texture, @NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglMultiTexCoord1ivARB(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord1dvARB ] --- + + /** Unsafe version of: {@link #glMultiTexCoord1dvARB MultiTexCoord1dvARB} */ + public static native void nglMultiTexCoord1dvARB(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord1dARB MultiTexCoord1dARB}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + */ + public static void glMultiTexCoord1dvARB(@NativeType("GLenum") int texture, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglMultiTexCoord1dvARB(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord2fARB ] --- + + /** + * Sets the current two-dimensional texture coordinate for the specified texture coordinate set. {@code r} is implicitly set to 0 and {@code q} to 1. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + */ + public static native void glMultiTexCoord2fARB(@NativeType("GLenum") int texture, @NativeType("GLfloat") float s, @NativeType("GLfloat") float t); + + // --- [ glMultiTexCoord2sARB ] --- + + /** + * Short version of {@link #glMultiTexCoord2fARB MultiTexCoord2fARB}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + */ + public static native void glMultiTexCoord2sARB(@NativeType("GLenum") int texture, @NativeType("GLshort") short s, @NativeType("GLshort") short t); + + // --- [ glMultiTexCoord2iARB ] --- + + /** + * Integer version of {@link #glMultiTexCoord2fARB MultiTexCoord2fARB}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + */ + public static native void glMultiTexCoord2iARB(@NativeType("GLenum") int texture, @NativeType("GLint") int s, @NativeType("GLint") int t); + + // --- [ glMultiTexCoord2dARB ] --- + + /** + * Double version of {@link #glMultiTexCoord2fARB MultiTexCoord2fARB}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + */ + public static native void glMultiTexCoord2dARB(@NativeType("GLenum") int texture, @NativeType("GLdouble") double s, @NativeType("GLdouble") double t); + + // --- [ glMultiTexCoord2fvARB ] --- + + /** Unsafe version of: {@link #glMultiTexCoord2fvARB MultiTexCoord2fvARB} */ + public static native void nglMultiTexCoord2fvARB(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord2fARB MultiTexCoord2fARB}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + */ + public static void glMultiTexCoord2fvARB(@NativeType("GLenum") int texture, @NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglMultiTexCoord2fvARB(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord2svARB ] --- + + /** Unsafe version of: {@link #glMultiTexCoord2svARB MultiTexCoord2svARB} */ + public static native void nglMultiTexCoord2svARB(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord2sARB MultiTexCoord2sARB}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + */ + public static void glMultiTexCoord2svARB(@NativeType("GLenum") int texture, @NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglMultiTexCoord2svARB(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord2ivARB ] --- + + /** Unsafe version of: {@link #glMultiTexCoord2ivARB MultiTexCoord2ivARB} */ + public static native void nglMultiTexCoord2ivARB(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord2iARB MultiTexCoord2iARB}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + */ + public static void glMultiTexCoord2ivARB(@NativeType("GLenum") int texture, @NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglMultiTexCoord2ivARB(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord2dvARB ] --- + + /** Unsafe version of: {@link #glMultiTexCoord2dvARB MultiTexCoord2dvARB} */ + public static native void nglMultiTexCoord2dvARB(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord2dARB MultiTexCoord2dARB}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + */ + public static void glMultiTexCoord2dvARB(@NativeType("GLenum") int texture, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglMultiTexCoord2dvARB(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord3fARB ] --- + + /** + * Sets the current three-dimensional texture coordinate for the specified texture coordinate set. {@code q} is implicitly set to 1. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + */ + public static native void glMultiTexCoord3fARB(@NativeType("GLenum") int texture, @NativeType("GLfloat") float s, @NativeType("GLfloat") float t, @NativeType("GLfloat") float r); + + // --- [ glMultiTexCoord3sARB ] --- + + /** + * Short version of {@link #glMultiTexCoord3fARB MultiTexCoord3fARB}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + */ + public static native void glMultiTexCoord3sARB(@NativeType("GLenum") int texture, @NativeType("GLshort") short s, @NativeType("GLshort") short t, @NativeType("GLshort") short r); + + // --- [ glMultiTexCoord3iARB ] --- + + /** + * Integer version of {@link #glMultiTexCoord3fARB MultiTexCoord3fARB}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + */ + public static native void glMultiTexCoord3iARB(@NativeType("GLenum") int texture, @NativeType("GLint") int s, @NativeType("GLint") int t, @NativeType("GLint") int r); + + // --- [ glMultiTexCoord3dARB ] --- + + /** + * Double version of {@link #glMultiTexCoord3fARB MultiTexCoord3fARB}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + */ + public static native void glMultiTexCoord3dARB(@NativeType("GLenum") int texture, @NativeType("GLdouble") double s, @NativeType("GLdouble") double t, @NativeType("GLdouble") double r); + + // --- [ glMultiTexCoord3fvARB ] --- + + /** Unsafe version of: {@link #glMultiTexCoord3fvARB MultiTexCoord3fvARB} */ + public static native void nglMultiTexCoord3fvARB(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord3fARB MultiTexCoord3fARB}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + */ + public static void glMultiTexCoord3fvARB(@NativeType("GLenum") int texture, @NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglMultiTexCoord3fvARB(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord3svARB ] --- + + /** Unsafe version of: {@link #glMultiTexCoord3svARB MultiTexCoord3svARB} */ + public static native void nglMultiTexCoord3svARB(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord3sARB MultiTexCoord3sARB}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + */ + public static void glMultiTexCoord3svARB(@NativeType("GLenum") int texture, @NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglMultiTexCoord3svARB(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord3ivARB ] --- + + /** Unsafe version of: {@link #glMultiTexCoord3ivARB MultiTexCoord3ivARB} */ + public static native void nglMultiTexCoord3ivARB(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord3iARB MultiTexCoord3iARB}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + */ + public static void glMultiTexCoord3ivARB(@NativeType("GLenum") int texture, @NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglMultiTexCoord3ivARB(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord3dvARB ] --- + + /** Unsafe version of: {@link #glMultiTexCoord3dvARB MultiTexCoord3dvARB} */ + public static native void nglMultiTexCoord3dvARB(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord3dARB MultiTexCoord3dARB}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + */ + public static void glMultiTexCoord3dvARB(@NativeType("GLenum") int texture, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglMultiTexCoord3dvARB(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord4fARB ] --- + + /** + * Sets the current four-dimensional texture coordinate for the specified texture coordinate set. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + * @param q the q component of the current texture coordinates + */ + public static native void glMultiTexCoord4fARB(@NativeType("GLenum") int texture, @NativeType("GLfloat") float s, @NativeType("GLfloat") float t, @NativeType("GLfloat") float r, @NativeType("GLfloat") float q); + + // --- [ glMultiTexCoord4sARB ] --- + + /** + * Short version of {@link #glMultiTexCoord4fARB MultiTexCoord4fARB}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + * @param q the q component of the current texture coordinates + */ + public static native void glMultiTexCoord4sARB(@NativeType("GLenum") int texture, @NativeType("GLshort") short s, @NativeType("GLshort") short t, @NativeType("GLshort") short r, @NativeType("GLshort") short q); + + // --- [ glMultiTexCoord4iARB ] --- + + /** + * Integer version of {@link #glMultiTexCoord4fARB MultiTexCoord4fARB}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + * @param q the q component of the current texture coordinates + */ + public static native void glMultiTexCoord4iARB(@NativeType("GLenum") int texture, @NativeType("GLint") int s, @NativeType("GLint") int t, @NativeType("GLint") int r, @NativeType("GLint") int q); + + // --- [ glMultiTexCoord4dARB ] --- + + /** + * Double version of {@link #glMultiTexCoord4fARB MultiTexCoord4fARB}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + * @param q the q component of the current texture coordinates + */ + public static native void glMultiTexCoord4dARB(@NativeType("GLenum") int texture, @NativeType("GLdouble") double s, @NativeType("GLdouble") double t, @NativeType("GLdouble") double r, @NativeType("GLdouble") double q); + + // --- [ glMultiTexCoord4fvARB ] --- + + /** Unsafe version of: {@link #glMultiTexCoord4fvARB MultiTexCoord4fvARB} */ + public static native void nglMultiTexCoord4fvARB(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord4fARB MultiTexCoord4fARB}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + */ + public static void glMultiTexCoord4fvARB(@NativeType("GLenum") int texture, @NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglMultiTexCoord4fvARB(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord4svARB ] --- + + /** Unsafe version of: {@link #glMultiTexCoord4svARB MultiTexCoord4svARB} */ + public static native void nglMultiTexCoord4svARB(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord4sARB MultiTexCoord4sARB}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + */ + public static void glMultiTexCoord4svARB(@NativeType("GLenum") int texture, @NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglMultiTexCoord4svARB(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord4ivARB ] --- + + /** Unsafe version of: {@link #glMultiTexCoord4ivARB MultiTexCoord4ivARB} */ + public static native void nglMultiTexCoord4ivARB(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord4iARB MultiTexCoord4iARB}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + */ + public static void glMultiTexCoord4ivARB(@NativeType("GLenum") int texture, @NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglMultiTexCoord4ivARB(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord4dvARB ] --- + + /** Unsafe version of: {@link #glMultiTexCoord4dvARB MultiTexCoord4dvARB} */ + public static native void nglMultiTexCoord4dvARB(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord4dARB MultiTexCoord4dARB}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + */ + public static void glMultiTexCoord4dvARB(@NativeType("GLenum") int texture, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglMultiTexCoord4dvARB(texture, memAddress(v)); + } + + /** Array version of: {@link #glMultiTexCoord1fvARB MultiTexCoord1fvARB} */ + public static void glMultiTexCoord1fvARB(@NativeType("GLenum") int texture, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord1fvARB; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(texture, v, __functionAddress); + } + + /** Array version of: {@link #glMultiTexCoord1svARB MultiTexCoord1svARB} */ + public static void glMultiTexCoord1svARB(@NativeType("GLenum") int texture, @NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord1svARB; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(texture, v, __functionAddress); + } + + /** Array version of: {@link #glMultiTexCoord1ivARB MultiTexCoord1ivARB} */ + public static void glMultiTexCoord1ivARB(@NativeType("GLenum") int texture, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord1ivARB; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(texture, v, __functionAddress); + } + + /** Array version of: {@link #glMultiTexCoord1dvARB MultiTexCoord1dvARB} */ + public static void glMultiTexCoord1dvARB(@NativeType("GLenum") int texture, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord1dvARB; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(texture, v, __functionAddress); + } + + /** Array version of: {@link #glMultiTexCoord2fvARB MultiTexCoord2fvARB} */ + public static void glMultiTexCoord2fvARB(@NativeType("GLenum") int texture, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord2fvARB; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(texture, v, __functionAddress); + } + + /** Array version of: {@link #glMultiTexCoord2svARB MultiTexCoord2svARB} */ + public static void glMultiTexCoord2svARB(@NativeType("GLenum") int texture, @NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord2svARB; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(texture, v, __functionAddress); + } + + /** Array version of: {@link #glMultiTexCoord2ivARB MultiTexCoord2ivARB} */ + public static void glMultiTexCoord2ivARB(@NativeType("GLenum") int texture, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord2ivARB; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(texture, v, __functionAddress); + } + + /** Array version of: {@link #glMultiTexCoord2dvARB MultiTexCoord2dvARB} */ + public static void glMultiTexCoord2dvARB(@NativeType("GLenum") int texture, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord2dvARB; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(texture, v, __functionAddress); + } + + /** Array version of: {@link #glMultiTexCoord3fvARB MultiTexCoord3fvARB} */ + public static void glMultiTexCoord3fvARB(@NativeType("GLenum") int texture, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord3fvARB; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(texture, v, __functionAddress); + } + + /** Array version of: {@link #glMultiTexCoord3svARB MultiTexCoord3svARB} */ + public static void glMultiTexCoord3svARB(@NativeType("GLenum") int texture, @NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord3svARB; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(texture, v, __functionAddress); + } + + /** Array version of: {@link #glMultiTexCoord3ivARB MultiTexCoord3ivARB} */ + public static void glMultiTexCoord3ivARB(@NativeType("GLenum") int texture, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord3ivARB; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(texture, v, __functionAddress); + } + + /** Array version of: {@link #glMultiTexCoord3dvARB MultiTexCoord3dvARB} */ + public static void glMultiTexCoord3dvARB(@NativeType("GLenum") int texture, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord3dvARB; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(texture, v, __functionAddress); + } + + /** Array version of: {@link #glMultiTexCoord4fvARB MultiTexCoord4fvARB} */ + public static void glMultiTexCoord4fvARB(@NativeType("GLenum") int texture, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord4fvARB; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(texture, v, __functionAddress); + } + + /** Array version of: {@link #glMultiTexCoord4svARB MultiTexCoord4svARB} */ + public static void glMultiTexCoord4svARB(@NativeType("GLenum") int texture, @NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord4svARB; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(texture, v, __functionAddress); + } + + /** Array version of: {@link #glMultiTexCoord4ivARB MultiTexCoord4ivARB} */ + public static void glMultiTexCoord4ivARB(@NativeType("GLenum") int texture, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord4ivARB; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(texture, v, __functionAddress); + } + + /** Array version of: {@link #glMultiTexCoord4dvARB MultiTexCoord4dvARB} */ + public static void glMultiTexCoord4dvARB(@NativeType("GLenum") int texture, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord4dvARB; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(texture, v, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBOcclusionQuery.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBOcclusionQuery.java new file mode 100644 index 00000000..58baaba1 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBOcclusionQuery.java @@ -0,0 +1,335 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_occlusion_query extension. + * + *

This extension defines a mechanism whereby an application can query the number of pixels (or, more precisely, samples) drawn by a primitive or group of + * primitives.

+ * + *

The primary purpose of such a query (hereafter referred to as an "occlusion query") is to determine the visibility of an object. Typically, the + * application will render the major occluders in the scene, then perform an occlusion query for the bounding box of each detail object in the scene. Only + * if said bounding box is visible, i.e., if at least one sample is drawn, should the corresponding object be drawn.

+ * + *

The earlier HP_occlusion_test extension defined a similar mechanism, but it had two major shortcomings.

+ * + *
    + *
  • It returned the result as a simple {@link GL11#GL_TRUE TRUE}/{@link GL11#GL_FALSE FALSE} result, when in fact it is often useful to know exactly how many samples were drawn.
  • + *
  • It provided only a simple "stop-and-wait" model for using multiple queries. The application begins an occlusion test and ends it; then, at some + * later point, it asks for the result, at which point the driver must stop and wait until the result from the previous test is back before the + * application can even begin the next one. This is a very simple model, but its performance is mediocre when an application wishes to perform many + * queries, and it eliminates most of the opportunities for parallelism between the CPU and GPU.
  • + *
+ * + *

This extension solves both of those problems. It returns as its result the number of samples that pass the depth and stencil tests, and it encapsulates + * occlusion queries in "query objects" that allow applications to issue many queries before asking for the result of any one. As a result, they can + * overlap the time it takes for the occlusion query results to be returned with other, more useful work, such as rendering other parts of the scene or + * performing other computations on the CPU.

+ * + *

There are many situations where a pixel/sample count, rather than a boolean result, is useful.

+ * + *
    + *
  • Objects that are visible but cover only a very small number of pixels can be skipped at a minimal reduction of image quality.
  • + *
  • Knowing exactly how many pixels an object might cover may help the application decide which level-of-detail model should be used. If only a few + * pixels are visible, a low-detail model may be acceptable.
  • + *
  • "Depth peeling" techniques, such as order-independent transparency, need to know when to stop rendering more layers; it is difficult to determine a + * priori how many layers are needed. A boolean result allows applications to stop when more layers will not affect the image at all, but this will + * likely result in unacceptable performance. Instead, it makes more sense to stop rendering when the number of pixels in each layer falls below a + * given threshold.
  • + *
  • Occlusion queries can replace glReadPixels of the depth buffer to determine whether (for example) a light source is visible for the purposes of a + * lens flare effect or a halo to simulate glare. Pixel counts allow you to compute the percentage of the light source that is visible, and the + * brightness of these effects can be modulated accordingly.
  • + *
+ * + *

Promoted to core in {@link GL15 OpenGL 1.5}.

+ */ +public class ARBOcclusionQuery { + + /** Accepted by the {@code target} parameter of BeginQueryARB, EndQueryARB, and GetQueryivARB. */ + public static final int GL_SAMPLES_PASSED_ARB = 0x8914; + + /** Accepted by the {@code pname} parameter of GetQueryivARB. */ + public static final int + GL_QUERY_COUNTER_BITS_ARB = 0x8864, + GL_CURRENT_QUERY_ARB = 0x8865; + + /** Accepted by the {@code pname} parameter of GetQueryObjectivARB and GetQueryObjectuivARB. */ + public static final int + GL_QUERY_RESULT_ARB = 0x8866, + GL_QUERY_RESULT_AVAILABLE_ARB = 0x8867; + + static { GL.initialize(); } + + protected ARBOcclusionQuery() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glGenQueriesARB, caps.glDeleteQueriesARB, caps.glIsQueryARB, caps.glBeginQueryARB, caps.glEndQueryARB, caps.glGetQueryivARB, + caps.glGetQueryObjectivARB, caps.glGetQueryObjectuivARB + ); + } + + // --- [ glGenQueriesARB ] --- + + /** + * Unsafe version of: {@link #glGenQueriesARB GenQueriesARB} + * + * @param n the number of query object names to be generated + */ + public static native void nglGenQueriesARB(int n, long ids); + + /** + * Generates query object names. + * + * @param ids a buffer in which the generated query object names are stored + */ + public static void glGenQueriesARB(@NativeType("GLuint *") IntBuffer ids) { + nglGenQueriesARB(ids.remaining(), memAddress(ids)); + } + + /** Generates query object names. */ + @NativeType("void") + public static int glGenQueriesARB() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer ids = stack.callocInt(1); + nglGenQueriesARB(1, memAddress(ids)); + return ids.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glDeleteQueriesARB ] --- + + /** + * Unsafe version of: {@link #glDeleteQueriesARB DeleteQueriesARB} + * + * @param n the number of query objects to be deleted + */ + public static native void nglDeleteQueriesARB(int n, long ids); + + /** + * Deletes named query objects. + * + * @param ids an array of query objects to be deleted + */ + public static void glDeleteQueriesARB(@NativeType("GLuint const *") IntBuffer ids) { + nglDeleteQueriesARB(ids.remaining(), memAddress(ids)); + } + + /** Deletes named query objects. */ + public static void glDeleteQueriesARB(@NativeType("GLuint const *") int id) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer ids = stack.ints(id); + nglDeleteQueriesARB(1, memAddress(ids)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glIsQueryARB ] --- + + /** + * Determine if a name corresponds to a query object. + * + * @param id a value that may be the name of a query object + */ + @NativeType("GLboolean") + public static native boolean glIsQueryARB(@NativeType("GLuint") int id); + + // --- [ glBeginQueryARB ] --- + + /** + * Creates a query object and makes it active. + * + * @param target the target type of query object established. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param id the name of a query object + */ + public static native void glBeginQueryARB(@NativeType("GLenum") int target, @NativeType("GLuint") int id); + + // --- [ glEndQueryARB ] --- + + /** + * Marks the end of the sequence of commands to be tracked for the active query specified by {@code target}. + * + * @param target the query object target. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ */ + public static native void glEndQueryARB(@NativeType("GLenum") int target); + + // --- [ glGetQueryivARB ] --- + + /** Unsafe version of: {@link #glGetQueryivARB GetQueryivARB} */ + public static native void nglGetQueryivARB(int target, int pname, long params); + + /** + * Returns parameters of a query object target. + * + * @param target the query object target. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param pname the symbolic name of a query object target parameter. One of:
{@link #GL_QUERY_COUNTER_BITS_ARB QUERY_COUNTER_BITS_ARB}{@link #GL_CURRENT_QUERY_ARB CURRENT_QUERY_ARB}
+ * @param params the requested data + */ + public static void glGetQueryivARB(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetQueryivARB(target, pname, memAddress(params)); + } + + /** + * Returns parameters of a query object target. + * + * @param target the query object target. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param pname the symbolic name of a query object target parameter. One of:
{@link #GL_QUERY_COUNTER_BITS_ARB QUERY_COUNTER_BITS_ARB}{@link #GL_CURRENT_QUERY_ARB CURRENT_QUERY_ARB}
+ */ + @NativeType("void") + public static int glGetQueryiARB(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetQueryivARB(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetQueryObjectivARB ] --- + + /** Unsafe version of: {@link #glGetQueryObjectivARB GetQueryObjectivARB} */ + public static native void nglGetQueryObjectivARB(int id, int pname, long params); + + /** + * Returns the integer value of a query object parameter. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter. One of:
{@link #GL_QUERY_RESULT_ARB QUERY_RESULT_ARB}{@link #GL_QUERY_RESULT_AVAILABLE_ARB QUERY_RESULT_AVAILABLE_ARB}
+ * @param params the requested data + */ + public static void glGetQueryObjectivARB(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetQueryObjectivARB(id, pname, memAddress(params)); + } + + /** + * Returns the integer value of a query object parameter. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter. One of:
{@link #GL_QUERY_RESULT_ARB QUERY_RESULT_ARB}{@link #GL_QUERY_RESULT_AVAILABLE_ARB QUERY_RESULT_AVAILABLE_ARB}
+ */ + @NativeType("void") + public static int glGetQueryObjectiARB(@NativeType("GLuint") int id, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetQueryObjectivARB(id, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetQueryObjectuivARB ] --- + + /** Unsafe version of: {@link #glGetQueryObjectuivARB GetQueryObjectuivARB} */ + public static native void nglGetQueryObjectuivARB(int id, int pname, long params); + + /** + * Unsigned version of {@link #glGetQueryObjectivARB GetQueryObjectivARB}. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter. One of:
{@link #GL_QUERY_RESULT_ARB QUERY_RESULT_ARB}{@link #GL_QUERY_RESULT_AVAILABLE_ARB QUERY_RESULT_AVAILABLE_ARB}
+ * @param params the requested data + */ + public static void glGetQueryObjectuivARB(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLuint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetQueryObjectuivARB(id, pname, memAddress(params)); + } + + /** + * Unsigned version of {@link #glGetQueryObjectivARB GetQueryObjectivARB}. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter. One of:
{@link #GL_QUERY_RESULT_ARB QUERY_RESULT_ARB}{@link #GL_QUERY_RESULT_AVAILABLE_ARB QUERY_RESULT_AVAILABLE_ARB}
+ */ + @NativeType("void") + public static int glGetQueryObjectuiARB(@NativeType("GLuint") int id, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetQueryObjectuivARB(id, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #glGenQueriesARB GenQueriesARB} */ + public static void glGenQueriesARB(@NativeType("GLuint *") int[] ids) { + long __functionAddress = GL.getICD().glGenQueriesARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(ids.length, ids, __functionAddress); + } + + /** Array version of: {@link #glDeleteQueriesARB DeleteQueriesARB} */ + public static void glDeleteQueriesARB(@NativeType("GLuint const *") int[] ids) { + long __functionAddress = GL.getICD().glDeleteQueriesARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(ids.length, ids, __functionAddress); + } + + /** Array version of: {@link #glGetQueryivARB GetQueryivARB} */ + public static void glGetQueryivARB(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetQueryivARB; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetQueryObjectivARB GetQueryObjectivARB} */ + public static void glGetQueryObjectivARB(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetQueryObjectivARB; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(id, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetQueryObjectuivARB GetQueryObjectuivARB} */ + public static void glGetQueryObjectuivARB(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLuint *") int[] params) { + long __functionAddress = GL.getICD().glGetQueryObjectuivARB; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(id, pname, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBOcclusionQuery2.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBOcclusionQuery2.java new file mode 100644 index 00000000..821aa51f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBOcclusionQuery2.java @@ -0,0 +1,25 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_occlusion_query2 extension. + * + *

This extension trivially adds a boolean occlusion query to {@link ARBOcclusionQuery ARB_occlusion_query}.

+ * + *

While the counter-based occlusion query provided by ARB_occlusion_query is flexible, there is still value to a simple boolean, which is often sufficient + * for applications.

+ * + *

Promoted to core in {@link GL33 OpenGL 3.3}.

+ */ +public final class ARBOcclusionQuery2 { + + /** Accepted by the {@code target} parameter of BeginQuery, EndQuery, and GetQueryiv. */ + public static final int GL_ANY_SAMPLES_PASSED = 0x8C2F; + + private ARBOcclusionQuery2() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBParallelShaderCompile.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBParallelShaderCompile.java new file mode 100644 index 00000000..0f275e21 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBParallelShaderCompile.java @@ -0,0 +1,57 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_parallel_shader_compile extension. + * + *

Compiling GLSL into implementation-specific code can be a time consuming process, so a GL implementation may wish to perform the compilation in a + * separate CPU thread. This extension provides a mechanism for the application to provide a hint to limit the number of threads it wants to be used to + * compile shaders, as well as a query to determine if the compilation process is complete.

+ * + *

Requires {@link GL30 OpenGL 3.0}.

+ */ +public class ARBParallelShaderCompile { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int GL_MAX_SHADER_COMPILER_THREADS_ARB = 0x91B0; + + /** Accepted as part of the {@code pname} parameter to GetShaderiv() and accepted as part of the {@code pname} parameter to GetProgramiv(). */ + public static final int GL_COMPLETION_STATUS_ARB = 0x91B1; + + static { GL.initialize(); } + + protected ARBParallelShaderCompile() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glMaxShaderCompilerThreadsARB + ); + } + + // --- [ glMaxShaderCompilerThreadsARB ] --- + + /** + * Application may use the following to hint to the driver the maximum number background threads it would like to be used in the process of compiling + * shaders or linking programs. + * + *

An implementation may combine the maximum compiler thread request from multiple contexts in a share group in an implementation-specific way.

+ * + *

An application can query the current MaxShaderCompilerThreads() {@code count} by calling {@link GL11C#glGetIntegerv GetIntegerv} with {@code pname} set to + * {@link #GL_MAX_SHADER_COMPILER_THREADS_ARB MAX_SHADER_COMPILER_THREADS_ARB}.

+ * + * @param count the number of background threads. A {@code count} of zero specifies a request for no parallel compiling or linking and a {@code count} of + * {@code 0xFFFFFFFF} requests an implementation-specific maximum. + */ + public static native void glMaxShaderCompilerThreadsARB(@NativeType("GLuint") int count); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBPipelineStatisticsQuery.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBPipelineStatisticsQuery.java new file mode 100644 index 00000000..cdf84b26 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBPipelineStatisticsQuery.java @@ -0,0 +1,45 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_pipeline_statistics_query extension. + * + *

This extension introduces new query types that allow applications to get statistics information about different parts of the pipeline:

+ * + *
    + *
  • Number of vertices and primitives issued to the GL.
  • + *
  • Number of times a vertex shader, tessellation evaluation shader, geometry shader, fragment shader, and compute shader was invoked.
  • + *
  • Number of patches processed by the tessellation control shader stage.
  • + *
  • Number of primitives emitted by a geometry shader.
  • + *
  • Number of primitives that entered the primitive clipping stage.
  • + *
  • Number of primitives that are output by the primitive clipping stage.
  • + *
+ * + *

Requires {@link GL30 OpenGL 3.0}.

+ */ +public final class ARBPipelineStatisticsQuery { + + /** + * Accepted by the {@code target} parameter of {@link GL15C#glBeginQuery BeginQuery}, {@link GL15C#glEndQuery EndQuery}, {@link GL15C#glGetQueryiv GetQueryiv}, + * {@link GL40C#glBeginQueryIndexed BeginQueryIndexed}, {@link GL40C#glEndQueryIndexed EndQueryIndexed} and {@link GL40C#glGetQueryIndexediv GetQueryIndexediv}. + */ + public static final int + GL_VERTICES_SUBMITTED_ARB = 0x82EE, + GL_PRIMITIVES_SUBMITTED_ARB = 0x82EF, + GL_VERTEX_SHADER_INVOCATIONS_ARB = 0x82F0, + GL_TESS_CONTROL_SHADER_PATCHES_ARB = 0x82F1, + GL_TESS_EVALUATION_SHADER_INVOCATIONS_ARB = 0x82F2, + GL_GEOMETRY_SHADER_INVOCATIONS = 0x887F, + GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED_ARB = 0x82F3, + GL_FRAGMENT_SHADER_INVOCATIONS_ARB = 0x82F4, + GL_COMPUTE_SHADER_INVOCATIONS_ARB = 0x82F5, + GL_CLIPPING_INPUT_PRIMITIVES_ARB = 0x82F6, + GL_CLIPPING_OUTPUT_PRIMITIVES_ARB = 0x82F7; + + private ARBPipelineStatisticsQuery() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBPixelBufferObject.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBPixelBufferObject.java new file mode 100644 index 00000000..e16e03e9 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBPixelBufferObject.java @@ -0,0 +1,65 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_pixel_buffer_object extension. + * + *

This extension expands on the interface provided by the {@link ARBVertexBufferObject ARB_vertex_buffer_object} extension (and later integrated into {@link GL15 OpenGL 1.5}) in order to + * permit buffer objects to be used not only with vertex array data, but also with pixel data. The intent is to provide more acceleration opportunities + * for OpenGL pixel commands.

+ * + *

While a single buffer object can be bound for both vertex arrays and pixel commands, we use the designations vertex buffer object (VBO) and pixel buffer + * object (PBO) to indicate their particular usage in a given situation.

+ * + *

Recall that buffer objects conceptually are nothing more than arrays of bytes, just like any chunk of memory. {@link ARBVertexBufferObject ARB_vertex_buffer_object} allows GL + * commands to source data from a buffer object by binding the buffer object to a given target and then overloading a certain set of GL commands' pointer + * arguments to refer to offsets inside the buffer, rather than pointers to user memory. An offset is encoded in a pointer by adding the offset to a null + * pointer.

+ * + *

This extension does not add any new functionality to buffer objects themselves. It simply adds two new targets to which buffer objects can be bound: + * {@link #GL_PIXEL_PACK_BUFFER_ARB PIXEL_PACK_BUFFER_ARB} and {@link #GL_PIXEL_UNPACK_BUFFER_ARB PIXEL_UNPACK_BUFFER_ARB}. When a buffer object is bound to the {@link #GL_PIXEL_PACK_BUFFER_ARB PIXEL_PACK_BUFFER_ARB} target, commands such as + * {@link GL11C#glReadPixels ReadPixels} pack (write) their data into a buffer object. When a buffer object is bound to the {@link #GL_PIXEL_UNPACK_BUFFER_ARB PIXEL_UNPACK_BUFFER_ARB} target, commands such as + * {@link GL11#glDrawPixels DrawPixels} and {@link GL11C#glTexImage2D TexImage2D} unpack (read) their data from a buffer object.

+ * + *

There are a several approaches to improve graphics performance with PBOs. Some of the most interesting approaches are:

+ * + *
    + *
  • Streaming texture updates: If the application uses {@link GL15C#glMapBuffer MapBuffer}/{@link GL15C#glUnmapBuffer UnmapBuffer} to write its data for glTexSubImage into a buffer object, at + * least one of the data copies usually required to download a texture can be eliminated, significantly increasing texture download performance.
  • + *
  • Streaming draw pixels: When {@link GL11#glDrawPixels DrawPixels} sources client memory, OpenGL says the client memory can be modified immediately after the + * glDrawPixels command returns without disturbing the drawn image. This typically necessitates unpacking and copying the image prior to glDrawPixels + * returning. However, when using glDrawPixels with a pixel pack buffer object, glDrawPixels may return prior to image unpacking because future + * modification of the buffer data requires explicit commands ({@link GL15C#glMapBuffer MapBuffer}, {@link GL15C#glBufferData BufferData}, or {@link GL15C#glBufferSubData BufferSubData}).
  • + *
  • Asynchronous {@link GL11C#glReadPixels ReadPixels}: If an application needs to read back a number of images and process them with the CPU, the existing GL interface + * makes it nearly impossible to pipeline this operation. The driver will typically send the hardware a readback command when glReadPixels is called, + * and then wait for all of the data to be available before returning control to the application. Then, the application can either process the data + * immediately or call glReadPixels again; in neither case will the readback overlap with the processing. If the application issues several readbacks + * into several buffer objects, however, and then maps each one to process its data, then the readbacks can proceed in parallel with the data processing.
  • + *
  • Render to vertex array: The application can use a fragment program to render some image into one of its buffers, then read this image out into a + * buffer object via {@link GL11C#glReadPixels ReadPixels}. Then, it can use this buffer object as a source of vertex data.
  • + *
+ * + *

Requires {@link GL15 OpenGL 1.5} or {@link ARBVertexBufferObject ARB_vertex_buffer_object}. Promoted to core in {@link GL21 OpenGL 2.1}.

+ */ +public final class ARBPixelBufferObject { + + /** + * Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferParameteriv, and + * GetBufferPointerv. + */ + public static final int + GL_PIXEL_PACK_BUFFER_ARB = 0x88EB, + GL_PIXEL_UNPACK_BUFFER_ARB = 0x88EC; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_PIXEL_PACK_BUFFER_BINDING_ARB = 0x88ED, + GL_PIXEL_UNPACK_BUFFER_BINDING_ARB = 0x88EF; + + private ARBPixelBufferObject() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBPointParameters.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBPointParameters.java new file mode 100644 index 00000000..19004588 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBPointParameters.java @@ -0,0 +1,94 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_point_parameters extension. + * + *

This extension supports additional geometric characteristics of points. It can be used to render particles or tiny light sources, commonly referred to + * as "Light points".

+ * + *

The raster brightness of a point is a function of the point area, point color, point transparency, and the response of the display's electron gun and + * phosphor. The point area and the point transparency are derived from the point size, currently provided with the {@code size} parameter of + * {@link GL11C#glPointSize PointSize}.

+ * + *

The primary motivation is to allow the size of a point to be affected by distance attenuation. When distance attenuation has an effect, the final point + * size decreases as the distance of the point from the eye increases.

+ * + *

The secondary motivation is a mean to control the mapping from the point size to the raster point area and point transparency. This is done in order to + * increase the dynamic range of the raster brightness of points. In other words, the alpha component of a point may be decreased (and its transparency + * increased) as its area shrinks below a defined threshold.

+ * + *

Promoted to core in {@link GL14 OpenGL 1.4}.

+ */ +public class ARBPointParameters { + + /** Accepted by the {@code pname} parameter of PointParameterfvARB, and the {@code pname} of Get. */ + public static final int + GL_POINT_SIZE_MIN_ARB = 0x8126, + GL_POINT_SIZE_MAX_ARB = 0x8127, + GL_POINT_FADE_THRESHOLD_SIZE_ARB = 0x8128, + GL_POINT_DISTANCE_ATTENUATION_ARB = 0x8129; + + static { GL.initialize(); } + + protected ARBPointParameters() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glPointParameterfARB, caps.glPointParameterfvARB + ); + } + + // --- [ glPointParameterfARB ] --- + + /** + * Sets the float value of a pointer parameter. + * + * @param pname the parameter to set. One of:
{@link #GL_POINT_SIZE_MIN_ARB POINT_SIZE_MIN_ARB}{@link #GL_POINT_SIZE_MAX_ARB POINT_SIZE_MAX_ARB}{@link #GL_POINT_FADE_THRESHOLD_SIZE_ARB POINT_FADE_THRESHOLD_SIZE_ARB}
+ * @param param the parameter value + */ + public static native void glPointParameterfARB(@NativeType("GLenum") int pname, @NativeType("GLfloat") float param); + + // --- [ glPointParameterfvARB ] --- + + /** Unsafe version of: {@link #glPointParameterfvARB PointParameterfvARB} */ + public static native void nglPointParameterfvARB(int pname, long params); + + /** + * Pointer version of {@link #glPointParameterfARB PointParameterfARB}. + * + * @param pname the parameter to set. Must be:
{@link #GL_POINT_DISTANCE_ATTENUATION_ARB POINT_DISTANCE_ATTENUATION_ARB}
+ * @param params the parameter value + */ + public static void glPointParameterfvARB(@NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer params) { + if (CHECKS) { + check(params, 3); + } + nglPointParameterfvARB(pname, memAddress(params)); + } + + /** Array version of: {@link #glPointParameterfvARB PointParameterfvARB} */ + public static void glPointParameterfvARB(@NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] params) { + long __functionAddress = GL.getICD().glPointParameterfvARB; + if (CHECKS) { + check(__functionAddress); + check(params, 3); + } + callPV(pname, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBPointSprite.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBPointSprite.java new file mode 100644 index 00000000..0eab0b79 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBPointSprite.java @@ -0,0 +1,40 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_point_sprite extension. + * + *

Applications such as particle systems have tended to use OpenGL quads rather than points to render their geometry, since they would like to use a + * custom-drawn texture for each particle, rather than the traditional OpenGL round antialiased points, and each fragment in a point has the same texture + * coordinates as every other fragment.

+ * + *

Unfortunately, specifying the geometry for these quads can be expensive, since it quadruples the amount of geometry required, and may also require the + * application to do extra processing to compute the location of each vertex.

+ * + *

The purpose of this extension is to allow such applications to use points rather than quads. When {@link #GL_POINT_SPRITE_ARB POINT_SPRITE_ARB} is enabled, the state of point + * antialiasing is ignored. For each texture unit, the app can then specify whether to replace the existing texture coordinates with point sprite texture + * coordinates, which are interpolated across the point.

+ * + *

Promoted to core in {@link GL20 OpenGL 2.0}.

+ */ +public final class ARBPointSprite { + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev, and by the {@code target} parameter of TexEnvi, TexEnviv, TexEnvf, TexEnvfv, GetTexEnviv, and GetTexEnvfv. + */ + public static final int GL_POINT_SPRITE_ARB = 0x8861; + + /** + * When the {@code target} parameter of TexEnvf, TexEnvfv, TexEnvi, TexEnviv, GetTexEnvfv, or GetTexEnviv is POINT_SPRITE_ARB, then the value of + * {@code pname} may be. + */ + public static final int GL_COORD_REPLACE_ARB = 0x8862; + + private ARBPointSprite() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBPolygonOffsetClamp.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBPolygonOffsetClamp.java new file mode 100644 index 00000000..94bbe7f5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBPolygonOffsetClamp.java @@ -0,0 +1,60 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_polygon_offset_clamp extension. + * + *

This extension adds a new parameter to the polygon offset function that clamps the calculated offset to a minimum or maximum value. The clamping + * functionality is useful when polygons are nearly parallel to the view direction because their high slopes can result in arbitrarily large polygon + * offsets. In the particular case of shadow mapping, the lack of clamping can produce the appearance of unwanted holes when the shadow casting polygons + * are offset beyond the shadow receiving polygons, and this problem can be alleviated by enforcing a maximum offset value.

+ * + *

Requires {@link GL33 OpenGL 3.3}.

+ */ +public class ARBPolygonOffsetClamp { + + /** Accepted by the {@code pname} parameters of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int GL_POLYGON_OFFSET_CLAMP = 0x8E1B; + + static { GL.initialize(); } + + protected ARBPolygonOffsetClamp() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glPolygonOffsetClamp + ); + } + + // --- [ glPolygonOffsetClamp ] --- + + /** + * The depth values of all fragments generated by the rasterization of a polygon may be offset by a single value that is computed for that polygon. This + * function determines this value. + * + *

{@code factor} scales the maximum depth slope of the polygon, and {@code units} scales an implementation-dependent constant that relates to the usable + * resolution of the depth buffer. The resulting values are summed to produce the polygon offset value, which may then be clamped to a minimum or maximum + * value specified by {@code clamp}.

+ * + *

The values {@code factor}, {@code units}, and {@code clamp} may each be positive, negative, or zero. Calling the command {@link GL11C#glPolygonOffset PolygonOffset} is equivalent + * to calling the command {@code PolygonOffsetClamp} with clamp equal to zero.

+ * + * @param factor scales the maximum depth slope of the polygon + * @param units scales an implementation-dependent constant that relates to the usable resolution of the depth buffer + * @param clamp the minimum or maximum polygon offset value + */ + public static void glPolygonOffsetClamp(@NativeType("GLfloat") float factor, @NativeType("GLfloat") float units, @NativeType("GLfloat") float clamp) { + GL46C.glPolygonOffsetClamp(factor, units, clamp); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBProgramInterfaceQuery.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBProgramInterfaceQuery.java new file mode 100644 index 00000000..f8b2d918 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBProgramInterfaceQuery.java @@ -0,0 +1,328 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_program_interface_query extension. + * + *

This extension provides a single unified set of query commands that can be used by applications to determine properties of various interfaces and + * resources used by program objects to communicate with application code, fixed-function OpenGL pipeline stages, and other programs. In unextended OpenGL + * 4.2, there is a separate set of query commands for each different type of interface or resource used by the program. These different sets of queries are + * structured nearly identically, but the queries for some interfaces have limited capability (e.g., there is no ability to enumerate fragment shader + * outputs).

+ * + *

With the single set of query commands provided by this extension, a consistent set of queries is available for all interfaces, and a new interface can + * be added without having to introduce a completely new set of query commands. These queries are intended to provide a superset of the capabilities + * provided by similar queries in OpenGL 4.2, and should allow for the deprecation of the existing queries.

+ * + *

This extension defines two terms: interfaces and active resources. Each interface of a program object provides a way for the program to communicate with + * application code, fixed-function OpenGL pipeline stages, and other programs. Examples of interfaces for a program object include inputs (receiving + * values from vertex attributes or outputs of other programs), outputs (sending values to other programs or per-fragment operations), uniforms (receiving + * values from API calls), uniform blocks (receiving values from bound buffer objects), subroutines and subroutine uniforms (receiving API calls to + * indicate functions to call during program execution), and atomic counter buffers (holding values to be manipulated by atomic counter shader functions). + * Each interface of a program has a set of active resources used by the program. For example, the resources of a program's input interface includes all + * active input variables used by the first stage of the program. The resources of a program's uniform block interface consists of the set of uniform + * blocks with at least one member used by any shader in the program.

+ * + *

Requires {@link GL20 OpenGL 2.0}. Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ +public class ARBProgramInterfaceQuery { + + /** + * Accepted by the {@code programInterface} parameter of GetProgramInterfaceiv, GetProgramResourceIndex, GetProgramResourceName, GetProgramResourceiv, + * GetProgramResourceLocation, and GetProgramResourceLocationIndex. + */ + public static final int + GL_UNIFORM = 0x92E1, + GL_UNIFORM_BLOCK = 0x92E2, + GL_PROGRAM_INPUT = 0x92E3, + GL_PROGRAM_OUTPUT = 0x92E4, + GL_BUFFER_VARIABLE = 0x92E5, + GL_SHADER_STORAGE_BLOCK = 0x92E6, + GL_VERTEX_SUBROUTINE = 0x92E8, + GL_TESS_CONTROL_SUBROUTINE = 0x92E9, + GL_TESS_EVALUATION_SUBROUTINE = 0x92EA, + GL_GEOMETRY_SUBROUTINE = 0x92EB, + GL_FRAGMENT_SUBROUTINE = 0x92EC, + GL_COMPUTE_SUBROUTINE = 0x92ED, + GL_VERTEX_SUBROUTINE_UNIFORM = 0x92EE, + GL_TESS_CONTROL_SUBROUTINE_UNIFORM = 0x92EF, + GL_TESS_EVALUATION_SUBROUTINE_UNIFORM = 0x92F0, + GL_GEOMETRY_SUBROUTINE_UNIFORM = 0x92F1, + GL_FRAGMENT_SUBROUTINE_UNIFORM = 0x92F2, + GL_COMPUTE_SUBROUTINE_UNIFORM = 0x92F3, + GL_TRANSFORM_FEEDBACK_VARYING = 0x92F4; + + /** Accepted by the {@code pname} parameter of GetProgramInterfaceiv. */ + public static final int + GL_ACTIVE_RESOURCES = 0x92F5, + GL_MAX_NAME_LENGTH = 0x92F6, + GL_MAX_NUM_ACTIVE_VARIABLES = 0x92F7, + GL_MAX_NUM_COMPATIBLE_SUBROUTINES = 0x92F8; + + /** Accepted in the {@code props} array of GetProgramResourceiv. */ + public static final int + GL_NAME_LENGTH = 0x92F9, + GL_TYPE = 0x92FA, + GL_ARRAY_SIZE = 0x92FB, + GL_OFFSET = 0x92FC, + GL_BLOCK_INDEX = 0x92FD, + GL_ARRAY_STRIDE = 0x92FE, + GL_MATRIX_STRIDE = 0x92FF, + GL_IS_ROW_MAJOR = 0x9300, + GL_ATOMIC_COUNTER_BUFFER_INDEX = 0x9301, + GL_BUFFER_BINDING = 0x9302, + GL_BUFFER_DATA_SIZE = 0x9303, + GL_NUM_ACTIVE_VARIABLES = 0x9304, + GL_ACTIVE_VARIABLES = 0x9305, + GL_REFERENCED_BY_VERTEX_SHADER = 0x9306, + GL_REFERENCED_BY_TESS_CONTROL_SHADER = 0x9307, + GL_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x9308, + GL_REFERENCED_BY_GEOMETRY_SHADER = 0x9309, + GL_REFERENCED_BY_FRAGMENT_SHADER = 0x930A, + GL_REFERENCED_BY_COMPUTE_SHADER = 0x930B, + GL_TOP_LEVEL_ARRAY_SIZE = 0x930C, + GL_TOP_LEVEL_ARRAY_STRIDE = 0x930D, + GL_LOCATION = 0x930E, + GL_LOCATION_INDEX = 0x930F, + GL_IS_PER_PATCH = 0x92E7; + + static { GL.initialize(); } + + protected ARBProgramInterfaceQuery() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glGetProgramInterfaceiv, caps.glGetProgramResourceIndex, caps.glGetProgramResourceName, caps.glGetProgramResourceiv, + caps.glGetProgramResourceLocation, caps.glGetProgramResourceLocationIndex + ); + } + + // --- [ glGetProgramInterfaceiv ] --- + + /** Unsafe version of: {@link #glGetProgramInterfaceiv GetProgramInterfaceiv} */ + public static void nglGetProgramInterfaceiv(int program, int programInterface, int pname, long params) { + GL43C.nglGetProgramInterfaceiv(program, programInterface, pname, params); + } + + /** + * Queries a property of an interface in a program. + * + * @param program the name of a program object whose interface to query + * @param programInterface a token identifying the interface within {@code program} to query. One of:
{@link GL43C#GL_UNIFORM UNIFORM}{@link GL43C#GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link GL43C#GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link GL43C#GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link GL43C#GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link GL43C#GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link GL43C#GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link GL43C#GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link GL43C#GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link GL43C#GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link GL43C#GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link GL43C#GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link GL43C#GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link GL43C#GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link GL43C#GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param pname the name of the parameter within {@code programInterface} to query. One of:
{@link GL43C#GL_ACTIVE_RESOURCES ACTIVE_RESOURCES}{@link GL43C#GL_MAX_NAME_LENGTH MAX_NAME_LENGTH}{@link GL43C#GL_MAX_NUM_ACTIVE_VARIABLES MAX_NUM_ACTIVE_VARIABLES}
{@link GL43C#GL_MAX_NUM_COMPATIBLE_SUBROUTINES MAX_NUM_COMPATIBLE_SUBROUTINES}
+ * @param params a variable to retrieve the value of {@code pname} for the program interface + */ + public static void glGetProgramInterfaceiv(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL43C.glGetProgramInterfaceiv(program, programInterface, pname, params); + } + + /** + * Queries a property of an interface in a program. + * + * @param program the name of a program object whose interface to query + * @param programInterface a token identifying the interface within {@code program} to query. One of:
{@link GL43C#GL_UNIFORM UNIFORM}{@link GL43C#GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link GL43C#GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link GL43C#GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link GL43C#GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link GL43C#GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link GL43C#GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link GL43C#GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link GL43C#GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link GL43C#GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link GL43C#GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link GL43C#GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link GL43C#GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link GL43C#GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link GL43C#GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param pname the name of the parameter within {@code programInterface} to query. One of:
{@link GL43C#GL_ACTIVE_RESOURCES ACTIVE_RESOURCES}{@link GL43C#GL_MAX_NAME_LENGTH MAX_NAME_LENGTH}{@link GL43C#GL_MAX_NUM_ACTIVE_VARIABLES MAX_NUM_ACTIVE_VARIABLES}
{@link GL43C#GL_MAX_NUM_COMPATIBLE_SUBROUTINES MAX_NUM_COMPATIBLE_SUBROUTINES}
+ */ + @NativeType("void") + public static int glGetProgramInterfacei(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLenum") int pname) { + return GL43C.glGetProgramInterfacei(program, programInterface, pname); + } + + // --- [ glGetProgramResourceIndex ] --- + + /** Unsafe version of: {@link #glGetProgramResourceIndex GetProgramResourceIndex} */ + public static int nglGetProgramResourceIndex(int program, int programInterface, long name) { + return GL43C.nglGetProgramResourceIndex(program, programInterface, name); + } + + /** + * Queries the index of a named resource within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the resource named {Wcode name}. One of:
{@link GL43C#GL_UNIFORM UNIFORM}{@link GL43C#GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link GL43C#GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link GL43C#GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link GL43C#GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link GL43C#GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link GL43C#GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link GL43C#GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link GL43C#GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link GL43C#GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link GL43C#GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link GL43C#GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link GL43C#GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link GL43C#GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link GL43C#GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param name the name of the resource to query the index of + */ + @NativeType("GLuint") + public static int glGetProgramResourceIndex(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLchar const *") ByteBuffer name) { + return GL43C.glGetProgramResourceIndex(program, programInterface, name); + } + + /** + * Queries the index of a named resource within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the resource named {Wcode name}. One of:
{@link GL43C#GL_UNIFORM UNIFORM}{@link GL43C#GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link GL43C#GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link GL43C#GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link GL43C#GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link GL43C#GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link GL43C#GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link GL43C#GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link GL43C#GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link GL43C#GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link GL43C#GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link GL43C#GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link GL43C#GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link GL43C#GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link GL43C#GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param name the name of the resource to query the index of + */ + @NativeType("GLuint") + public static int glGetProgramResourceIndex(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLchar const *") CharSequence name) { + return GL43C.glGetProgramResourceIndex(program, programInterface, name); + } + + // --- [ glGetProgramResourceName ] --- + + /** + * Unsafe version of: {@link #glGetProgramResourceName GetProgramResourceName} + * + * @param bufSize the size of the character array whose address is given by {@code name} + */ + public static void nglGetProgramResourceName(int program, int programInterface, int index, int bufSize, long length, long name) { + GL43C.nglGetProgramResourceName(program, programInterface, index, bufSize, length, name); + } + + /** + * Queries the name of an indexed resource within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the indexed resource. One of:
{@link GL43C#GL_UNIFORM UNIFORM}{@link GL43C#GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link GL43C#GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link GL43C#GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link GL43C#GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link GL43C#GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link GL43C#GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link GL43C#GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link GL43C#GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link GL43C#GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link GL43C#GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link GL43C#GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link GL43C#GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link GL43C#GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link GL43C#GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param index the index of the resource within {@code programInterface} of {@code program} + * @param length a variable which will receive the length of the resource name + * @param name a character array into which will be written the name of the resource + */ + public static void glGetProgramResourceName(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer name) { + GL43C.glGetProgramResourceName(program, programInterface, index, length, name); + } + + /** + * Queries the name of an indexed resource within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the indexed resource. One of:
{@link GL43C#GL_UNIFORM UNIFORM}{@link GL43C#GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link GL43C#GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link GL43C#GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link GL43C#GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link GL43C#GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link GL43C#GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link GL43C#GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link GL43C#GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link GL43C#GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link GL43C#GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link GL43C#GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link GL43C#GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link GL43C#GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link GL43C#GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param index the index of the resource within {@code programInterface} of {@code program} + * @param bufSize the size of the character array whose address is given by {@code name} + */ + @NativeType("void") + public static String glGetProgramResourceName(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLuint") int index, @NativeType("GLsizei") int bufSize) { + return GL43C.glGetProgramResourceName(program, programInterface, index, bufSize); + } + + /** + * Queries the name of an indexed resource within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the indexed resource. One of:
{@link GL43C#GL_UNIFORM UNIFORM}{@link GL43C#GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link GL43C#GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link GL43C#GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link GL43C#GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link GL43C#GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link GL43C#GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link GL43C#GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link GL43C#GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link GL43C#GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link GL43C#GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link GL43C#GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link GL43C#GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link GL43C#GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link GL43C#GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param index the index of the resource within {@code programInterface} of {@code program} + */ + @NativeType("void") + public static String glGetProgramResourceName(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLuint") int index) { + return glGetProgramResourceName(program, programInterface, index, glGetProgramInterfacei(program, programInterface, GL_MAX_NAME_LENGTH)); + } + + // --- [ glGetProgramResourceiv ] --- + + /** + * Unsafe version of: {@link #glGetProgramResourceiv GetProgramResourceiv} + * + * @param propCount the number of properties in {@code props} + * @param bufSize the size of the integer array whose address is given by {@code params} + */ + public static void nglGetProgramResourceiv(int program, int programInterface, int index, int propCount, long props, int bufSize, long length, long params) { + GL43C.nglGetProgramResourceiv(program, programInterface, index, propCount, props, bufSize, length, params); + } + + /** + * Retrieves values for multiple properties of a single active resource within a program object. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the resource named {@code name}. One of:
{@link GL43C#GL_UNIFORM UNIFORM}{@link GL43C#GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link GL43C#GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link GL43C#GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link GL43C#GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link GL43C#GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link GL43C#GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link GL43C#GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link GL43C#GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link GL43C#GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link GL43C#GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link GL43C#GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link GL43C#GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link GL43C#GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link GL43C#GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param index the active resource index + * @param props an array that will receive the active resource properties + * @param length a variable which will receive the number of values returned + * @param params an array that will receive the property values + */ + public static void glGetProgramResourceiv(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLuint") int index, @NativeType("GLenum const *") IntBuffer props, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLint *") IntBuffer params) { + GL43C.glGetProgramResourceiv(program, programInterface, index, props, length, params); + } + + // --- [ glGetProgramResourceLocation ] --- + + /** Unsafe version of: {@link #glGetProgramResourceLocation GetProgramResourceLocation} */ + public static int nglGetProgramResourceLocation(int program, int programInterface, long name) { + return GL43C.nglGetProgramResourceLocation(program, programInterface, name); + } + + /** + * Queries the location of a named resource within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the resource named {@code name} + * @param name the name of the resource to query the location of + */ + @NativeType("GLint") + public static int glGetProgramResourceLocation(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLchar const *") ByteBuffer name) { + return GL43C.glGetProgramResourceLocation(program, programInterface, name); + } + + /** + * Queries the location of a named resource within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the resource named {@code name} + * @param name the name of the resource to query the location of + */ + @NativeType("GLint") + public static int glGetProgramResourceLocation(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLchar const *") CharSequence name) { + return GL43C.glGetProgramResourceLocation(program, programInterface, name); + } + + // --- [ glGetProgramResourceLocationIndex ] --- + + /** Unsafe version of: {@link #glGetProgramResourceLocationIndex GetProgramResourceLocationIndex} */ + public static int nglGetProgramResourceLocationIndex(int program, int programInterface, long name) { + return GL43C.nglGetProgramResourceLocationIndex(program, programInterface, name); + } + + /** + * Queries the fragment color index of a named variable within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the resource named {@code name}. Must be:
{@link GL43C#GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}
+ * @param name the name of the resource to query the location of + */ + @NativeType("GLint") + public static int glGetProgramResourceLocationIndex(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLchar const *") ByteBuffer name) { + return GL43C.glGetProgramResourceLocationIndex(program, programInterface, name); + } + + /** + * Queries the fragment color index of a named variable within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the resource named {@code name}. Must be:
{@link GL43C#GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}
+ * @param name the name of the resource to query the location of + */ + @NativeType("GLint") + public static int glGetProgramResourceLocationIndex(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLchar const *") CharSequence name) { + return GL43C.glGetProgramResourceLocationIndex(program, programInterface, name); + } + + /** Array version of: {@link #glGetProgramInterfaceiv GetProgramInterfaceiv} */ + public static void glGetProgramInterfaceiv(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL43C.glGetProgramInterfaceiv(program, programInterface, pname, params); + } + + /** Array version of: {@link #glGetProgramResourceName GetProgramResourceName} */ + public static void glGetProgramResourceName(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer name) { + GL43C.glGetProgramResourceName(program, programInterface, index, length, name); + } + + /** Array version of: {@link #glGetProgramResourceiv GetProgramResourceiv} */ + public static void glGetProgramResourceiv(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLuint") int index, @NativeType("GLenum const *") int[] props, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLint *") int[] params) { + GL43C.glGetProgramResourceiv(program, programInterface, index, props, length, params); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBProvokingVertex.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBProvokingVertex.java new file mode 100644 index 00000000..f72be000 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBProvokingVertex.java @@ -0,0 +1,68 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_provoking_vertex extension. + * + *

This extension provides an alternative provoking vertex convention for rendering lines, triangles, and (optionally depending on the implementation) + * quads.

+ * + *

The provoking vertex of a primitive is the vertex that determines the constant primary and secondary colors when flat shading is enabled.

+ * + *

In OpenGL, the provoking vertex for triangle, quad, line, and (trivially) point primitives is the last vertex used to assemble the primitive. The + * polygon primitive is an exception in OpenGL where the first vertex of a polygon primitive determines the color of the polygon, even if actually broken + * into triangles and/or quads.

+ * + *

Alternatively the provoking vertex could be the first vertex of the primitive. Other APIs with flat-shading functionality such as Reality Lab and + * Direct3D have adopted the "first vertex of the primitive" convention to determine the provoking vertex. However, these APIs lack quads so do not have a + * defined provoking vertex convention for quads.

+ * + *

The motivation for this extension is to allow applications developed for APIs with a "first vertex of the primitive" provoking vertex to be easily + * converted to OpenGL.

+ * + *

Promoted to core in {@link GL32 OpenGL 3.2}.

+ */ +public class ARBProvokingVertex { + + /** Accepted by the {@code mode} parameter of ProvokingVertex. */ + public static final int + GL_FIRST_VERTEX_CONVENTION = 0x8E4D, + GL_LAST_VERTEX_CONVENTION = 0x8E4E; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_PROVOKING_VERTEX = 0x8E4F, + GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION = 0x8E4C; + + static { GL.initialize(); } + + protected ARBProvokingVertex() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glProvokingVertex + ); + } + + // --- [ glProvokingVertex ] --- + + /** + * Specifies the vertex to be used as the source of data for flat shaded varyings. + * + * @param mode the provoking vertex mode. One of:
{@link GL32C#GL_FIRST_VERTEX_CONVENTION FIRST_VERTEX_CONVENTION}{@link GL32C#GL_LAST_VERTEX_CONVENTION LAST_VERTEX_CONVENTION}
+ */ + public static void glProvokingVertex(@NativeType("GLenum") int mode) { + GL32C.glProvokingVertex(mode); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBQueryBufferObject.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBQueryBufferObject.java new file mode 100644 index 00000000..8983df3a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBQueryBufferObject.java @@ -0,0 +1,47 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_query_buffer_object extension. + * + *

Statistics about the operation of the OpenGL pipeline, such as the number of samples that passed the depth test, the elapsed time between two events or + * the number of vertices written by transform feedback can be retrieved from the GL through query objects. The result of a query object is acquired by the + * application through the OpenGL API into a client provided memory location. Should the result returned by the API be required for use in a shader, it + * must be passed back to the GL via a program uniform or some other mechanism. This requires a round-trip from the GPU to the CPU and back.

+ * + *

This extension introduces a mechanism whereby the result of a query object may be retrieved into a buffer object instead of client memory. This allows + * the query rsult to be made available to a shader without a round-trip to the CPU for example by subsequently using the buffer object as a uniform + * buffer, texture buffer or other data store visible to the shader. This functionality may also be used to place the results of many query objects into a + * single, large buffer and then map or otherwise read back the entire buffer at a later point in time, avoiding a per-query object CPU-GPU synchronization + * event.

+ * + *

The extension allows acquiring the result of any query object type supported by the GL implementation into a buffer object. The implementation will + * determine the most efficient method of copying the query result to the buffer.

+ * + *

Requires {@link GL15 OpenGL 1.5}.

+ */ +public final class ARBQueryBufferObject { + + /** Accepted by the {@code pname} parameter of {@link GL15C#glGetQueryObjectiv GetQueryObjectiv}, {@link GL15C#glGetQueryObjectuiv GetQueryObjectuiv}, {@link GL33C#glGetQueryObjecti64v GetQueryObjecti64v} and {@link GL33C#glGetQueryObjectui64v GetQueryObjectui64v}. */ + public static final int GL_QUERY_RESULT_NO_WAIT = 0x9194; + + /** + * Accepted by the {@code target} parameter of {@link GL15C#glBindBuffer BindBuffer}, {@link GL15C#glBufferData BufferData}, {@link GL15C#glBufferSubData BufferSubData}, {@link GL15C#glMapBuffer MapBuffer}, {@link GL15C#glUnmapBuffer UnmapBuffer}, {@link GL30C#glMapBufferRange MapBufferRange}, + * {@link GL15C#glGetBufferSubData GetBufferSubData}, {@link GL15C#glGetBufferParameteriv GetBufferParameteriv}, {@link GL32C#glGetBufferParameteri64v GetBufferParameteri64v}, {@link GL15C#glGetBufferPointerv GetBufferPointerv}, {@link GL43C#glClearBufferSubData ClearBufferSubData}, and the {@code readtarget} and + * {@code writetarget} parameters of {@link GL31C#glCopyBufferSubData CopyBufferSubData}. + */ + public static final int GL_QUERY_BUFFER = 0x9192; + + /** Accepted by the {@code pname} parameter of {@link GL11C#glGetBooleanv GetBooleanv}, {@link GL11C#glGetIntegerv GetIntegerv}, {@link GL11C#glGetFloatv GetFloatv}, and {@link GL11C#glGetDoublev GetDoublev}. */ + public static final int GL_QUERY_BUFFER_BINDING = 0x9193; + + /** Accepted in the {@code barriers} bitfield in {@link GL42C#glMemoryBarrier MemoryBarrier}. */ + public static final int GL_QUERY_BUFFER_BARRIER_BIT = 0x8000; + + private ARBQueryBufferObject() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBRobustness.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBRobustness.java new file mode 100644 index 00000000..5db139d7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBRobustness.java @@ -0,0 +1,1100 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_robustness extension. + * + *

Several recent trends in how OpenGL integrates into modern computer systems have created new requirements for robustness and security for OpenGL + * rendering contexts.

+ * + *

Additionally GPU architectures now support hardware fault detection; for example, video memory supporting ECC (error correcting codes) and error + * detection. OpenGL contexts should be capable of recovering from hardware faults such as uncorrectable memory errors. Along with recovery from such + * hardware faults, the recovery mechanism can also allow recovery from video memory access exceptions and system software failures. System software + * failures can be due to device changes or driver failures.

+ * + *

Demands for increased software robustness and concerns about malware exploiting buffer overflows have lead API designers to provide additional "safe" + * APIs that bound the amount of data returned by an API query. For example, the safer "snprintf" or "_snprintf" routines are prefered over "sprintf".

+ * + *

The OpenGL API has many such robustness perils. OpenGL queries return (write) some number of bytes to a buffer indicated by a pointer parameter. The + * exact number of bytes written by existing OpenGL queries is not expressed directly by any specific parameter; instead the number of bytes returned is a + * complex function of one or more query arguments, sometimes context state such as pixel store modes or the active texture selector, and the current state + * of an object (such as a texture level's number of total texels). By the standards of modern API design, such queries are not "safe". Making these + * queries safer involves introducing a new query API with an additional parameter that specifies the number of bytes in the buffer and never writing bytes + * beyond that limit.

+ * + *

Multi-threaded use of OpenGL contexts in a "share group" allow sharing of objects such as textures and programs. Such sharing in conjunction with + * concurrent OpenGL commands stream execution by two or more contexts introduces hazards whereby one context can change objects in ways that can cause + * buffer overflows for another context's OpenGL queries.

+ * + *

The original {@link ARBVertexBufferObject ARB_vertex_buffer_object} extension includes an issue that explicitly states program termination is allowed when out-of-bounds + * vertex buffer object fetches occur. Modern GPUs capable of DirectX 10 enforce the well-defined behavior of always returning zero values for indices or + * non-fixed components in this case. Older GPUs may require extra checks to enforce well-defined (and termination free) behavior, but this expense is + * warranted when processing potentially untrusted content.

+ * + *

The intent of this extension is to address some specific robustness goals:

+ * + *
    + *
  • For all existing OpenGL queries, provide additional "safe" APIs that limit data written to user pointers to a buffer size in bytes that is an + * explicit additional parameter of the query.
  • + *
  • Provide a mechanism for an OpenGL application to learn about graphics resets that affect the context. When a graphics reset occurs, the OpenGL + * context becomes unusable and the application must create a new context to continue operation. Detecting a graphics reset happens through an + * inexpensive query.
  • + *
  • Provide an enable to guarantee that out-of-bounds buffer object accesses by the GPU will have deterministic behavior and preclude application + * instability or termination due to an incorrect buffer access. Such accesses include vertex buffer fetches of attributes and indices, and indexed + * reads of uniforms or parameters from buffers.
  • + *
+ * + *

In one anticipated usage model, WebGL contexts may make use of these robust features to grant greater stability when using untrusted code. WebGL + * contexts cannot call OpenGL commands directly but rather must route all OpenGL API calls through the web browser. It is then the web browser that + * configures the context, using the commands in this extension, to enforce safe behavior. In this scenario, the WebGL content cannot specify or change the + * use of this extension's features itself; the web browser enforces this policy.

+ * + *

There are other well-known robustness issues with the OpenGL API which this extension does not address. For example, selector-based OpenGL commands are + * a well-known source of programming errors. Code to manipulate texture state may assume the active texture selector is set appropriately when an + * intervening function call obscures a change to the active texture state resulting in incorrectly updated or queried state. The + * {@link EXTDirectStateAccess EXT_direct_state_access} extension introduces selector-free OpenGL commands and queries to address that particular issue so this extension does + * not.

+ * + *

The intent of this extension is NOT to deprecate any existing API and thereby introduce compatibility issues and coding burdens on existing code, but + * rather to provide new APIs to ensure a level of robustness commensurate with the expectations of modern applications of OpenGL.

+ */ +public class ARBRobustness { + + /** Returned by GetGraphicsResetStatusARB. */ + public static final int + GL_GUILTY_CONTEXT_RESET_ARB = 0x8253, + GL_INNOCENT_CONTEXT_RESET_ARB = 0x8254, + GL_UNKNOWN_CONTEXT_RESET_ARB = 0x8255; + + /** Accepted by the {@code value} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int GL_RESET_NOTIFICATION_STRATEGY_ARB = 0x8256; + + /** Returned by GetIntegerv and related simple queries when {@code value} is RESET_NOTIFICATION_STRATEGY_ARB. */ + public static final int + GL_LOSE_CONTEXT_ON_RESET_ARB = 0x8252, + GL_NO_RESET_NOTIFICATION_ARB = 0x8261; + + /** Returned by GetIntegerv when {@code pname} is CONTEXT_FLAGS. */ + public static final int GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB = 0x4; + + static { GL.initialize(); } + + protected ARBRobustness() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glGetGraphicsResetStatusARB, caps.glGetMapdv != NULL ? caps.glGetnMapdvARB : -1L, caps.glGetMapfv != NULL ? caps.glGetnMapfvARB : -1L, + caps.glGetMapiv != NULL ? caps.glGetnMapivARB : -1L, caps.glGetPixelMapfv != NULL ? caps.glGetnPixelMapfvARB : -1L, + caps.glGetPixelMapuiv != NULL ? caps.glGetnPixelMapuivARB : -1L, caps.glGetPixelMapusv != NULL ? caps.glGetnPixelMapusvARB : -1L, + caps.glGetPolygonStipple != NULL ? caps.glGetnPolygonStippleARB : -1L, caps.glGetnTexImageARB, caps.glReadnPixelsARB, + ext.contains("GL_ARB_imaging") && caps.glGetColorTable != NULL ? caps.glGetnColorTableARB : -1L, + ext.contains("GL_ARB_imaging") && caps.glGetConvolutionFilter != NULL ? caps.glGetnConvolutionFilterARB : -1L, + ext.contains("GL_ARB_imaging") && caps.glGetSeparableFilter != NULL ? caps.glGetnSeparableFilterARB : -1L, + ext.contains("GL_ARB_imaging") && caps.glGetHistogram != NULL ? caps.glGetnHistogramARB : -1L, + ext.contains("GL_ARB_imaging") && caps.glGetMinmax != NULL ? caps.glGetnMinmaxARB : -1L, + ext.contains("OpenGL13") ? caps.glGetnCompressedTexImageARB : -1L, ext.contains("OpenGL20") ? caps.glGetnUniformfvARB : -1L, + ext.contains("OpenGL20") ? caps.glGetnUniformivARB : -1L, ext.contains("OpenGL30") ? caps.glGetnUniformuivARB : -1L, + ext.contains("OpenGL40") ? caps.glGetnUniformdvARB : -1L + ); + } + + // --- [ glGetGraphicsResetStatusARB ] --- + + /** + * The symbolic constant returned indicates if the GL context has been in a reset state at any point since the last call to {@code GetGraphicsResetStatusARB}. + * {@link GL11#GL_NO_ERROR NO_ERROR} indicates that the GL context has not been in a reset state since the last call. {@link #GL_GUILTY_CONTEXT_RESET_ARB GUILTY_CONTEXT_RESET_ARB} indicates that a reset has + * been detected that is attributable to the current GL context. {@link #GL_INNOCENT_CONTEXT_RESET_ARB INNOCENT_CONTEXT_RESET_ARB} indicates a reset has been detected that is not attributable + * to the current GL context. {@link #GL_UNKNOWN_CONTEXT_RESET_ARB UNKNOWN_CONTEXT_RESET_ARB} indicates a detected graphics reset whose cause is unknown. + * + *

If a reset status other than NO_ERROR is returned and subsequent calls return NO_ERROR, the context reset was encountered and completed. If a reset + * status is repeatedly returned, the context may be in the process of resetting.

+ * + *

Reset notification behavior is determined at context creation time, and may be queried by calling {@link GL11C#glGetIntegerv GetIntegerv} with the symbolic constant + * {@link #GL_RESET_NOTIFICATION_STRATEGY_ARB RESET_NOTIFICATION_STRATEGY_ARB}.

+ * + *

If the reset notification behavior is {@link #GL_NO_RESET_NOTIFICATION_ARB NO_RESET_NOTIFICATION_ARB}, then the implementation will never deliver notification of reset events, and + * {@code GetGraphicsResetStatusARB} will always return NO_ERROR.

+ * + *

If the behavior is {@link #GL_LOSE_CONTEXT_ON_RESET_ARB LOSE_CONTEXT_ON_RESET_ARB}, a graphics reset will result in the loss of all context state, requiring the recreation of all associated + * objects. In this case {@code GetGraphicsResetStatusARB}. may return any of the values described above.

+ * + *

If a graphics reset notification occurs in a context, a notification must also occur in all other contexts which share objects with that context.

+ */ + @NativeType("GLenum") + public static native int glGetGraphicsResetStatusARB(); + + // --- [ glGetnMapdvARB ] --- + + /** + * Unsafe version of: {@link #glGetnMapdvARB GetnMapdvARB} + * + * @param bufSize the maximum number of bytes to write into {@code data} + */ + public static native void nglGetnMapdvARB(int target, int query, int bufSize, long data); + + /** + * Robust version of {@link GL11#glGetMapdv GetMapdv} + * + * @param target the evaluator map + * @param query the information to query + * @param data a buffer in which to place the returned data + */ + public static void glGetnMapdvARB(@NativeType("GLenum") int target, @NativeType("GLenum") int query, @NativeType("GLdouble *") DoubleBuffer data) { + nglGetnMapdvARB(target, query, data.remaining(), memAddress(data)); + } + + /** + * Robust version of {@link GL11#glGetMapdv GetMapdv} + * + * @param target the evaluator map + * @param query the information to query + */ + @NativeType("void") + public static double glGetnMapdARB(@NativeType("GLenum") int target, @NativeType("GLenum") int query) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + DoubleBuffer data = stack.callocDouble(1); + nglGetnMapdvARB(target, query, 1, memAddress(data)); + return data.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetnMapfvARB ] --- + + /** + * Unsafe version of: {@link #glGetnMapfvARB GetnMapfvARB} + * + * @param bufSize the maximum number of bytes to write into {@code data} + */ + public static native void nglGetnMapfvARB(int target, int query, int bufSize, long data); + + /** + * Robust version of {@link GL11#glGetMapfv GetMapfv} + * + * @param target the evaluator map + * @param query the information to query + * @param data a buffer in which to place the returned data + */ + public static void glGetnMapfvARB(@NativeType("GLenum") int target, @NativeType("GLenum") int query, @NativeType("GLfloat *") FloatBuffer data) { + nglGetnMapfvARB(target, query, data.remaining(), memAddress(data)); + } + + /** + * Robust version of {@link GL11#glGetMapfv GetMapfv} + * + * @param target the evaluator map + * @param query the information to query + */ + @NativeType("void") + public static float glGetnMapfARB(@NativeType("GLenum") int target, @NativeType("GLenum") int query) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer data = stack.callocFloat(1); + nglGetnMapfvARB(target, query, 1, memAddress(data)); + return data.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetnMapivARB ] --- + + /** + * Unsafe version of: {@link #glGetnMapivARB GetnMapivARB} + * + * @param bufSize the maximum number of bytes to write into {@code data} + */ + public static native void nglGetnMapivARB(int target, int query, int bufSize, long data); + + /** + * Robust version of {@link GL11#glGetMapiv GetMapiv} + * + * @param target the evaluator target. One of:
{@link GL11#GL_MAP1_VERTEX_3 MAP1_VERTEX_3}{@link GL11#GL_MAP1_VERTEX_4 MAP1_VERTEX_4}{@link GL11#GL_MAP1_COLOR_4 MAP1_COLOR_4}{@link GL11#GL_MAP1_NORMAL MAP1_NORMAL}{@link GL11#GL_MAP1_TEXTURE_COORD_1 MAP1_TEXTURE_COORD_1}
{@link GL11#GL_MAP1_TEXTURE_COORD_2 MAP1_TEXTURE_COORD_2}{@link GL11#GL_MAP1_TEXTURE_COORD_3 MAP1_TEXTURE_COORD_3}{@link GL11#GL_MAP1_TEXTURE_COORD_4 MAP1_TEXTURE_COORD_4}{@link GL11#GL_MAP2_VERTEX_3 MAP2_VERTEX_3}{@link GL11#GL_MAP2_VERTEX_4 MAP2_VERTEX_4}
{@link GL11#GL_MAP2_COLOR_4 MAP2_COLOR_4}{@link GL11#GL_MAP2_NORMAL MAP2_NORMAL}{@link GL11#GL_MAP2_TEXTURE_COORD_1 MAP2_TEXTURE_COORD_1}{@link GL11#GL_MAP2_TEXTURE_COORD_2 MAP2_TEXTURE_COORD_2}{@link GL11#GL_MAP2_TEXTURE_COORD_3 MAP2_TEXTURE_COORD_3}
{@link GL11#GL_MAP2_TEXTURE_COORD_4 MAP2_TEXTURE_COORD_4}
+ * @param query the information to query. One of:
{@link GL11#GL_ORDER ORDER}{@link GL11#GL_COEFF COEFF}{@link GL11#GL_DOMAIN DOMAIN}
+ * @param data a buffer in which to place the returned data + */ + public static void glGetnMapivARB(@NativeType("GLenum") int target, @NativeType("GLenum") int query, @NativeType("GLint *") IntBuffer data) { + nglGetnMapivARB(target, query, data.remaining(), memAddress(data)); + } + + /** + * Robust version of {@link GL11#glGetMapiv GetMapiv} + * + * @param target the evaluator target. One of:
{@link GL11#GL_MAP1_VERTEX_3 MAP1_VERTEX_3}{@link GL11#GL_MAP1_VERTEX_4 MAP1_VERTEX_4}{@link GL11#GL_MAP1_COLOR_4 MAP1_COLOR_4}{@link GL11#GL_MAP1_NORMAL MAP1_NORMAL}{@link GL11#GL_MAP1_TEXTURE_COORD_1 MAP1_TEXTURE_COORD_1}
{@link GL11#GL_MAP1_TEXTURE_COORD_2 MAP1_TEXTURE_COORD_2}{@link GL11#GL_MAP1_TEXTURE_COORD_3 MAP1_TEXTURE_COORD_3}{@link GL11#GL_MAP1_TEXTURE_COORD_4 MAP1_TEXTURE_COORD_4}{@link GL11#GL_MAP2_VERTEX_3 MAP2_VERTEX_3}{@link GL11#GL_MAP2_VERTEX_4 MAP2_VERTEX_4}
{@link GL11#GL_MAP2_COLOR_4 MAP2_COLOR_4}{@link GL11#GL_MAP2_NORMAL MAP2_NORMAL}{@link GL11#GL_MAP2_TEXTURE_COORD_1 MAP2_TEXTURE_COORD_1}{@link GL11#GL_MAP2_TEXTURE_COORD_2 MAP2_TEXTURE_COORD_2}{@link GL11#GL_MAP2_TEXTURE_COORD_3 MAP2_TEXTURE_COORD_3}
{@link GL11#GL_MAP2_TEXTURE_COORD_4 MAP2_TEXTURE_COORD_4}
+ * @param query the information to query. One of:
{@link GL11#GL_ORDER ORDER}{@link GL11#GL_COEFF COEFF}{@link GL11#GL_DOMAIN DOMAIN}
+ */ + @NativeType("void") + public static int glGetnMapiARB(@NativeType("GLenum") int target, @NativeType("GLenum") int query) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer data = stack.callocInt(1); + nglGetnMapivARB(target, query, 1, memAddress(data)); + return data.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetnPixelMapfvARB ] --- + + /** + * Unsafe version of: {@link #glGetnPixelMapfvARB GetnPixelMapfvARB} + * + * @param bufSize the maximum number of bytes to write into {@code data} + */ + public static native void nglGetnPixelMapfvARB(int map, int bufSize, long data); + + /** + * Robust version of {@link GL11#glGetPixelMapfv GetPixelMapfv} + * + * @param map the pixel map parameter to query. One of:
{@link GL11#GL_PIXEL_MAP_I_TO_I PIXEL_MAP_I_TO_I}{@link GL11#GL_PIXEL_MAP_S_TO_S PIXEL_MAP_S_TO_S}{@link GL11#GL_PIXEL_MAP_I_TO_R PIXEL_MAP_I_TO_R}{@link GL11#GL_PIXEL_MAP_I_TO_G PIXEL_MAP_I_TO_G}{@link GL11#GL_PIXEL_MAP_I_TO_B PIXEL_MAP_I_TO_B}
{@link GL11#GL_PIXEL_MAP_I_TO_A PIXEL_MAP_I_TO_A}{@link GL11#GL_PIXEL_MAP_R_TO_R PIXEL_MAP_R_TO_R}{@link GL11#GL_PIXEL_MAP_G_TO_G PIXEL_MAP_G_TO_G}{@link GL11#GL_PIXEL_MAP_B_TO_B PIXEL_MAP_B_TO_B}{@link GL11#GL_PIXEL_MAP_A_TO_A PIXEL_MAP_A_TO_A}
+ * @param data a buffer in which to place the returned data + */ + public static void glGetnPixelMapfvARB(@NativeType("GLenum") int map, @NativeType("GLfloat *") FloatBuffer data) { + nglGetnPixelMapfvARB(map, data.remaining(), memAddress(data)); + } + + // --- [ glGetnPixelMapuivARB ] --- + + /** + * Unsafe version of: {@link #glGetnPixelMapuivARB GetnPixelMapuivARB} + * + * @param bufSize the maximum number of bytes to write into {@code data} + */ + public static native void nglGetnPixelMapuivARB(int map, int bufSize, long data); + + /** + * Robust version of {@link GL11#glGetPixelMapuiv GetPixelMapuiv} + * + * @param map the pixel map parameter to query + * @param data a buffer in which to place the returned data + */ + public static void glGetnPixelMapuivARB(@NativeType("GLenum") int map, @NativeType("GLuint *") IntBuffer data) { + nglGetnPixelMapuivARB(map, data.remaining(), memAddress(data)); + } + + // --- [ glGetnPixelMapusvARB ] --- + + /** + * Unsafe version of: {@link #glGetnPixelMapusvARB GetnPixelMapusvARB} + * + * @param bufSize the maximum number of bytes to write into {@code data} + */ + public static native void nglGetnPixelMapusvARB(int map, int bufSize, long data); + + /** + * Robust version of {@link GL11#glGetPixelMapusv GetPixelMapusv} + * + * @param map the pixel map parameter to query + * @param data a buffer in which to place the returned data + */ + public static void glGetnPixelMapusvARB(@NativeType("GLenum") int map, @NativeType("GLushort *") ShortBuffer data) { + nglGetnPixelMapusvARB(map, data.remaining(), memAddress(data)); + } + + // --- [ glGetnPolygonStippleARB ] --- + + /** + * Unsafe version of: {@link #glGetnPolygonStippleARB GetnPolygonStippleARB} + * + * @param bufSize the maximum number of bytes to write into {@code pattern} + */ + public static native void nglGetnPolygonStippleARB(int bufSize, long pattern); + + /** + * Robust version of {@link GL11#glGetPolygonStipple GetPolygonStipple} + * + * @param bufSize the maximum number of bytes to write into {@code pattern} + * @param pattern a buffer in which to place the returned pattern + */ + public static void glGetnPolygonStippleARB(@NativeType("GLsizei") int bufSize, @NativeType("GLubyte *") long pattern) { + nglGetnPolygonStippleARB(bufSize, pattern); + } + + /** + * Robust version of {@link GL11#glGetPolygonStipple GetPolygonStipple} + * + * @param pattern a buffer in which to place the returned pattern + */ + public static void glGetnPolygonStippleARB(@NativeType("GLubyte *") ByteBuffer pattern) { + nglGetnPolygonStippleARB(pattern.remaining(), memAddress(pattern)); + } + + // --- [ glGetnTexImageARB ] --- + + /** + * Unsafe version of: {@link #glGetnTexImageARB GetnTexImageARB} + * + * @param bufSize the maximum number of bytes to write into {@code img} + */ + public static native void nglGetnTexImageARB(int tex, int level, int format, int type, int bufSize, long img); + + /** + * Robust version of {@link GL11C#glGetTexImage GetTexImage} + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param bufSize the maximum number of bytes to write into {@code img} + * @param img a buffer in which to place the returned data + */ + public static void glGetnTexImageARB(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int bufSize, @NativeType("void *") long img) { + nglGetnTexImageARB(tex, level, format, type, bufSize, img); + } + + /** + * Robust version of {@link GL11C#glGetTexImage GetTexImage} + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param img a buffer in which to place the returned data + */ + public static void glGetnTexImageARB(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer img) { + nglGetnTexImageARB(tex, level, format, type, img.remaining(), memAddress(img)); + } + + /** + * Robust version of {@link GL11C#glGetTexImage GetTexImage} + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param img a buffer in which to place the returned data + */ + public static void glGetnTexImageARB(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ShortBuffer img) { + nglGetnTexImageARB(tex, level, format, type, img.remaining() << 1, memAddress(img)); + } + + /** + * Robust version of {@link GL11C#glGetTexImage GetTexImage} + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param img a buffer in which to place the returned data + */ + public static void glGetnTexImageARB(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") IntBuffer img) { + nglGetnTexImageARB(tex, level, format, type, img.remaining() << 2, memAddress(img)); + } + + /** + * Robust version of {@link GL11C#glGetTexImage GetTexImage} + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param img a buffer in which to place the returned data + */ + public static void glGetnTexImageARB(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") FloatBuffer img) { + nglGetnTexImageARB(tex, level, format, type, img.remaining() << 2, memAddress(img)); + } + + /** + * Robust version of {@link GL11C#glGetTexImage GetTexImage} + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param img a buffer in which to place the returned data + */ + public static void glGetnTexImageARB(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") DoubleBuffer img) { + nglGetnTexImageARB(tex, level, format, type, img.remaining() << 3, memAddress(img)); + } + + // --- [ glReadnPixelsARB ] --- + + /** + * Unsafe version of: {@link #glReadnPixelsARB ReadnPixelsARB} + * + * @param bufSize the maximum number of bytes to write into {@code data} + */ + public static native void nglReadnPixelsARB(int x, int y, int width, int height, int format, int type, int bufSize, long data); + + /** + * Robust version of {@link GL11C#glReadPixels ReadPixels} + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param bufSize the maximum number of bytes to write into {@code data} + * @param data a buffer in which to place the returned data + */ + public static void glReadnPixelsARB(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int bufSize, @NativeType("void *") long data) { + nglReadnPixelsARB(x, y, width, height, format, type, bufSize, data); + } + + /** + * Robust version of {@link GL11C#glReadPixels ReadPixels} + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param data a buffer in which to place the returned data + */ + public static void glReadnPixelsARB(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer data) { + nglReadnPixelsARB(x, y, width, height, format, type, data.remaining(), memAddress(data)); + } + + /** + * Robust version of {@link GL11C#glReadPixels ReadPixels} + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param data a buffer in which to place the returned data + */ + public static void glReadnPixelsARB(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ShortBuffer data) { + nglReadnPixelsARB(x, y, width, height, format, type, data.remaining() << 1, memAddress(data)); + } + + /** + * Robust version of {@link GL11C#glReadPixels ReadPixels} + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param data a buffer in which to place the returned data + */ + public static void glReadnPixelsARB(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") IntBuffer data) { + nglReadnPixelsARB(x, y, width, height, format, type, data.remaining() << 2, memAddress(data)); + } + + /** + * Robust version of {@link GL11C#glReadPixels ReadPixels} + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param data a buffer in which to place the returned data + */ + public static void glReadnPixelsARB(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") FloatBuffer data) { + nglReadnPixelsARB(x, y, width, height, format, type, data.remaining() << 2, memAddress(data)); + } + + // --- [ glGetnColorTableARB ] --- + + /** + * Unsafe version of: {@link #glGetnColorTableARB GetnColorTableARB} + * + * @param bufSize the maximum number of bytes to write into {@code table} + */ + public static native void nglGetnColorTableARB(int target, int format, int type, int bufSize, long table); + + /** + * Robust version of {@link ARBImaging#glGetColorTable GetColorTable} + * + * @param target the color table target. One of:
{@link ARBImaging#GL_COLOR_TABLE COLOR_TABLE}{@link ARBImaging#GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link ARBImaging#GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param format the color data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the color data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param bufSize the maximum number of bytes to write into {@code table} + * @param table a buffer in which to place the returned data + */ + public static void glGetnColorTableARB(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int bufSize, @NativeType("void *") long table) { + nglGetnColorTableARB(target, format, type, bufSize, table); + } + + /** + * Robust version of {@link ARBImaging#glGetColorTable GetColorTable} + * + * @param target the color table target. One of:
{@link ARBImaging#GL_COLOR_TABLE COLOR_TABLE}{@link ARBImaging#GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link ARBImaging#GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param format the color data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the color data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param table a buffer in which to place the returned data + */ + public static void glGetnColorTableARB(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer table) { + nglGetnColorTableARB(target, format, type, table.remaining(), memAddress(table)); + } + + /** + * Robust version of {@link ARBImaging#glGetColorTable GetColorTable} + * + * @param target the color table target. One of:
{@link ARBImaging#GL_COLOR_TABLE COLOR_TABLE}{@link ARBImaging#GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link ARBImaging#GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param format the color data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the color data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param table a buffer in which to place the returned data + */ + public static void glGetnColorTableARB(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ShortBuffer table) { + nglGetnColorTableARB(target, format, type, table.remaining() << 1, memAddress(table)); + } + + /** + * Robust version of {@link ARBImaging#glGetColorTable GetColorTable} + * + * @param target the color table target. One of:
{@link ARBImaging#GL_COLOR_TABLE COLOR_TABLE}{@link ARBImaging#GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link ARBImaging#GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param format the color data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the color data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param table a buffer in which to place the returned data + */ + public static void glGetnColorTableARB(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") IntBuffer table) { + nglGetnColorTableARB(target, format, type, table.remaining() << 2, memAddress(table)); + } + + /** + * Robust version of {@link ARBImaging#glGetColorTable GetColorTable} + * + * @param target the color table target. One of:
{@link ARBImaging#GL_COLOR_TABLE COLOR_TABLE}{@link ARBImaging#GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link ARBImaging#GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param format the color data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the color data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param table a buffer in which to place the returned data + */ + public static void glGetnColorTableARB(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") FloatBuffer table) { + nglGetnColorTableARB(target, format, type, table.remaining() << 2, memAddress(table)); + } + + // --- [ glGetnConvolutionFilterARB ] --- + + /** + * Unsafe version of: {@link #glGetnConvolutionFilterARB GetnConvolutionFilterARB} + * + * @param bufSize the maximum number of bytes to write into {@code image} + */ + public static native void nglGetnConvolutionFilterARB(int target, int format, int type, int bufSize, long image); + + /** + * Robust version of {@link ARBImaging#glGetConvolutionFilter GetConvolutionFilter} + * + * @param target the convolution target. One of:
{@link ARBImaging#GL_CONVOLUTION_1D CONVOLUTION_1D}{@link ARBImaging#GL_CONVOLUTION_2D CONVOLUTION_2D}
+ * @param format the filter data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the filter data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param bufSize the maximum number of bytes to write into {@code image} + * @param image a buffer in which to place the returned data + */ + public static void glGetnConvolutionFilterARB(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int bufSize, @NativeType("void *") long image) { + nglGetnConvolutionFilterARB(target, format, type, bufSize, image); + } + + /** + * Robust version of {@link ARBImaging#glGetConvolutionFilter GetConvolutionFilter} + * + * @param target the convolution target. One of:
{@link ARBImaging#GL_CONVOLUTION_1D CONVOLUTION_1D}{@link ARBImaging#GL_CONVOLUTION_2D CONVOLUTION_2D}
+ * @param format the filter data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the filter data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param image a buffer in which to place the returned data + */ + public static void glGetnConvolutionFilterARB(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer image) { + nglGetnConvolutionFilterARB(target, format, type, image.remaining(), memAddress(image)); + } + + // --- [ glGetnSeparableFilterARB ] --- + + /** + * Unsafe version of: {@link #glGetnSeparableFilterARB GetnSeparableFilterARB} + * + * @param rowBufSize the maximum number of bytes to write into {@code row} + * @param columnBufSize the maximum number of bytes to write into {@code column} + */ + public static native void nglGetnSeparableFilterARB(int target, int format, int type, int rowBufSize, long row, int columnBufSize, long column, long span); + + /** + * Robust version of {@link ARBImaging#glGetSeparableFilter GetSeparableFilter} + * + * @param target the filter target. Must be:
{@link ARBImaging#GL_SEPARABLE_2D SEPARABLE_2D}
+ * @param format the filter data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the filter data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param rowBufSize the maximum number of bytes to write into {@code row} + * @param row a buffer in which to return the filter row + * @param columnBufSize the maximum number of bytes to write into {@code column} + * @param column a buffer in which to return the filter column + */ + public static void glGetnSeparableFilterARB(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int rowBufSize, @NativeType("void *") long row, @NativeType("GLsizei") int columnBufSize, @NativeType("void *") long column, @Nullable @NativeType("void *") ByteBuffer span) { + nglGetnSeparableFilterARB(target, format, type, rowBufSize, row, columnBufSize, column, memAddressSafe(span)); + } + + /** + * Robust version of {@link ARBImaging#glGetSeparableFilter GetSeparableFilter} + * + * @param target the filter target. Must be:
{@link ARBImaging#GL_SEPARABLE_2D SEPARABLE_2D}
+ * @param format the filter data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the filter data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param row a buffer in which to return the filter row + * @param column a buffer in which to return the filter column + */ + public static void glGetnSeparableFilterARB(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer row, @NativeType("void *") ByteBuffer column, @Nullable @NativeType("void *") ByteBuffer span) { + nglGetnSeparableFilterARB(target, format, type, row.remaining(), memAddress(row), column.remaining(), memAddress(column), memAddressSafe(span)); + } + + // --- [ glGetnHistogramARB ] --- + + /** + * Unsafe version of: {@link #glGetnHistogramARB GetnHistogramARB} + * + * @param bufSize the maximum number of bytes to write into {@code values} + */ + public static native void nglGetnHistogramARB(int target, boolean reset, int format, int type, int bufSize, long values); + + /** + * Robust version of {@link ARBImaging#glGetHistogram GetHistogram} + * + * @param target the histogram target. Must be:
{@link ARBImaging#GL_HISTOGRAM HISTOGRAM}
+ * @param reset if {@link GL11#GL_TRUE TRUE}, then all counters of all elements of the histogram are reset to zero. Counters are reset whether returned or not. + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel data types. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param bufSize the maximum number of bytes to write into {@code values} + * @param values a buffer in which to place the returned data + */ + public static void glGetnHistogramARB(@NativeType("GLenum") int target, @NativeType("GLboolean") boolean reset, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int bufSize, @NativeType("void *") long values) { + nglGetnHistogramARB(target, reset, format, type, bufSize, values); + } + + /** + * Robust version of {@link ARBImaging#glGetHistogram GetHistogram} + * + * @param target the histogram target. Must be:
{@link ARBImaging#GL_HISTOGRAM HISTOGRAM}
+ * @param reset if {@link GL11#GL_TRUE TRUE}, then all counters of all elements of the histogram are reset to zero. Counters are reset whether returned or not. + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel data types. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param values a buffer in which to place the returned data + */ + public static void glGetnHistogramARB(@NativeType("GLenum") int target, @NativeType("GLboolean") boolean reset, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer values) { + nglGetnHistogramARB(target, reset, format, type, values.remaining(), memAddress(values)); + } + + // --- [ glGetnMinmaxARB ] --- + + /** + * Unsafe version of: {@link #glGetnMinmaxARB GetnMinmaxARB} + * + * @param bufSize the maximum number of bytes to write into {@code values} + */ + public static native void nglGetnMinmaxARB(int target, boolean reset, int format, int type, int bufSize, long values); + + /** + * Robust version of {@link ARBImaging#glGetMinmax GetMinmax} + * + * @param target the minmax target. Must be:
{@link ARBImaging#GL_MINMAX MINMAX}
+ * @param reset If {@link GL11#GL_TRUE TRUE}, then each minimum value is reset to the maximum representable value, and each maximum value is reset to the minimum + * representable value. All values are reset, whether returned or not. + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param bufSize the maximum number of bytes to write into {@code values} + * @param values a buffer in which to place the returned data + */ + public static void glGetnMinmaxARB(@NativeType("GLenum") int target, @NativeType("GLboolean") boolean reset, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int bufSize, @NativeType("void *") long values) { + nglGetnMinmaxARB(target, reset, format, type, bufSize, values); + } + + /** + * Robust version of {@link ARBImaging#glGetMinmax GetMinmax} + * + * @param target the minmax target. Must be:
{@link ARBImaging#GL_MINMAX MINMAX}
+ * @param reset If {@link GL11#GL_TRUE TRUE}, then each minimum value is reset to the maximum representable value, and each maximum value is reset to the minimum + * representable value. All values are reset, whether returned or not. + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param values a buffer in which to place the returned data + */ + public static void glGetnMinmaxARB(@NativeType("GLenum") int target, @NativeType("GLboolean") boolean reset, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer values) { + nglGetnMinmaxARB(target, reset, format, type, values.remaining(), memAddress(values)); + } + + // --- [ glGetnCompressedTexImageARB ] --- + + /** + * Unsafe version of: {@link #glGetnCompressedTexImageARB GetnCompressedTexImageARB} + * + * @param bufSize the maximum number of bytes to write into {@code img} + */ + public static native void nglGetnCompressedTexImageARB(int target, int level, int bufSize, long img); + + /** + * Robust version of {@link GL13C#glGetCompressedTexImage GetCompressedTexImage} + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}
{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param bufSize the maximum number of bytes to write into {@code img} + * @param img a buffer in which to place the returned data + */ + public static void glGetnCompressedTexImageARB(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLsizei") int bufSize, @NativeType("void *") long img) { + nglGetnCompressedTexImageARB(target, level, bufSize, img); + } + + /** + * Robust version of {@link GL13C#glGetCompressedTexImage GetCompressedTexImage} + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}
{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param img a buffer in which to place the returned data + */ + public static void glGetnCompressedTexImageARB(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("void *") ByteBuffer img) { + if (CHECKS) { + if (DEBUG) { + check(img, GL11.glGetTexLevelParameteri(target, level, GL13.GL_TEXTURE_COMPRESSED_IMAGE_SIZE)); + } + } + nglGetnCompressedTexImageARB(target, level, img.remaining(), memAddress(img)); + } + + // --- [ glGetnUniformfvARB ] --- + + /** + * Unsafe version of: {@link #glGetnUniformfvARB GetnUniformfvARB} + * + * @param bufSize the maximum number of bytes to write into {@code params} + */ + public static native void nglGetnUniformfvARB(int program, int location, int bufSize, long params); + + /** + * Robust version of {@link GL20C#glGetUniformfv GetUniformfv} + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * @param params a buffer in which to place the returned data + */ + public static void glGetnUniformfvARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat *") FloatBuffer params) { + nglGetnUniformfvARB(program, location, params.remaining(), memAddress(params)); + } + + /** + * Robust version of {@link GL20C#glGetUniformfv GetUniformfv} + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + */ + @NativeType("void") + public static float glGetnUniformfARB(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer params = stack.callocFloat(1); + nglGetnUniformfvARB(program, location, 1, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetnUniformivARB ] --- + + /** + * Unsafe version of: {@link #glGetnUniformivARB GetnUniformivARB} + * + * @param bufSize the maximum number of bytes to write into {@code params} + */ + public static native void nglGetnUniformivARB(int program, int location, int bufSize, long params); + + /** + * Robust version of {@link GL20C#glGetUniformiv GetUniformiv} + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * @param params a buffer in which to place the returned data + */ + public static void glGetnUniformivARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint *") IntBuffer params) { + nglGetnUniformivARB(program, location, params.remaining(), memAddress(params)); + } + + /** + * Robust version of {@link GL20C#glGetUniformiv GetUniformiv} + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + */ + @NativeType("void") + public static int glGetnUniformiARB(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetnUniformivARB(program, location, 1, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetnUniformuivARB ] --- + + /** + * Unsafe version of: {@link #glGetnUniformuivARB GetnUniformuivARB} + * + * @param bufSize the maximum number of bytes to write into {@code params} + */ + public static native void nglGetnUniformuivARB(int program, int location, int bufSize, long params); + + /** + * Robust version of {@link GL30C#glGetUniformuiv GetUniformuiv} + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * @param params a buffer in which to place the returned data + */ + public static void glGetnUniformuivARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint *") IntBuffer params) { + nglGetnUniformuivARB(program, location, params.remaining(), memAddress(params)); + } + + /** + * Robust version of {@link GL30C#glGetUniformuiv GetUniformuiv} + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + */ + @NativeType("void") + public static int glGetnUniformuiARB(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetnUniformuivARB(program, location, 1, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetnUniformdvARB ] --- + + /** + * Unsafe version of: {@link #glGetnUniformdvARB GetnUniformdvARB} + * + * @param bufSize the maximum number of bytes to write into {@code params} + */ + public static native void nglGetnUniformdvARB(int program, int location, int bufSize, long params); + + /** + * Robust version of {@link GL40C#glGetUniformdv GetUniformdv} + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * @param params a buffer in which to place the returned data + */ + public static void glGetnUniformdvARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble *") DoubleBuffer params) { + nglGetnUniformdvARB(program, location, params.remaining(), memAddress(params)); + } + + /** + * Robust version of {@link GL40C#glGetUniformdv GetUniformdv} + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + */ + @NativeType("void") + public static double glGetnUniformdARB(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + DoubleBuffer params = stack.callocDouble(1); + nglGetnUniformdvARB(program, location, 1, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #glGetnMapdvARB GetnMapdvARB} */ + public static void glGetnMapdvARB(@NativeType("GLenum") int target, @NativeType("GLenum") int query, @NativeType("GLdouble *") double[] data) { + long __functionAddress = GL.getICD().glGetnMapdvARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, query, data.length, data, __functionAddress); + } + + /** Array version of: {@link #glGetnMapfvARB GetnMapfvARB} */ + public static void glGetnMapfvARB(@NativeType("GLenum") int target, @NativeType("GLenum") int query, @NativeType("GLfloat *") float[] data) { + long __functionAddress = GL.getICD().glGetnMapfvARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, query, data.length, data, __functionAddress); + } + + /** Array version of: {@link #glGetnMapivARB GetnMapivARB} */ + public static void glGetnMapivARB(@NativeType("GLenum") int target, @NativeType("GLenum") int query, @NativeType("GLint *") int[] data) { + long __functionAddress = GL.getICD().glGetnMapivARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, query, data.length, data, __functionAddress); + } + + /** Array version of: {@link #glGetnPixelMapfvARB GetnPixelMapfvARB} */ + public static void glGetnPixelMapfvARB(@NativeType("GLenum") int map, @NativeType("GLfloat *") float[] data) { + long __functionAddress = GL.getICD().glGetnPixelMapfvARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(map, data.length, data, __functionAddress); + } + + /** Array version of: {@link #glGetnPixelMapuivARB GetnPixelMapuivARB} */ + public static void glGetnPixelMapuivARB(@NativeType("GLenum") int map, @NativeType("GLuint *") int[] data) { + long __functionAddress = GL.getICD().glGetnPixelMapuivARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(map, data.length, data, __functionAddress); + } + + /** Array version of: {@link #glGetnPixelMapusvARB GetnPixelMapusvARB} */ + public static void glGetnPixelMapusvARB(@NativeType("GLenum") int map, @NativeType("GLushort *") short[] data) { + long __functionAddress = GL.getICD().glGetnPixelMapusvARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(map, data.length, data, __functionAddress); + } + + /** Array version of: {@link #glGetnTexImageARB GetnTexImageARB} */ + public static void glGetnTexImageARB(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") short[] img) { + long __functionAddress = GL.getICD().glGetnTexImageARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(tex, level, format, type, img.length << 1, img, __functionAddress); + } + + /** Array version of: {@link #glGetnTexImageARB GetnTexImageARB} */ + public static void glGetnTexImageARB(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") int[] img) { + long __functionAddress = GL.getICD().glGetnTexImageARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(tex, level, format, type, img.length << 2, img, __functionAddress); + } + + /** Array version of: {@link #glGetnTexImageARB GetnTexImageARB} */ + public static void glGetnTexImageARB(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") float[] img) { + long __functionAddress = GL.getICD().glGetnTexImageARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(tex, level, format, type, img.length << 2, img, __functionAddress); + } + + /** Array version of: {@link #glGetnTexImageARB GetnTexImageARB} */ + public static void glGetnTexImageARB(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") double[] img) { + long __functionAddress = GL.getICD().glGetnTexImageARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(tex, level, format, type, img.length << 3, img, __functionAddress); + } + + /** Array version of: {@link #glReadnPixelsARB ReadnPixelsARB} */ + public static void glReadnPixelsARB(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") short[] data) { + long __functionAddress = GL.getICD().glReadnPixelsARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(x, y, width, height, format, type, data.length << 1, data, __functionAddress); + } + + /** Array version of: {@link #glReadnPixelsARB ReadnPixelsARB} */ + public static void glReadnPixelsARB(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") int[] data) { + long __functionAddress = GL.getICD().glReadnPixelsARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(x, y, width, height, format, type, data.length << 2, data, __functionAddress); + } + + /** Array version of: {@link #glReadnPixelsARB ReadnPixelsARB} */ + public static void glReadnPixelsARB(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") float[] data) { + long __functionAddress = GL.getICD().glReadnPixelsARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(x, y, width, height, format, type, data.length << 2, data, __functionAddress); + } + + /** Array version of: {@link #glGetnColorTableARB GetnColorTableARB} */ + public static void glGetnColorTableARB(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") short[] table) { + long __functionAddress = GL.getICD().glGetnColorTableARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, format, type, table.length << 1, table, __functionAddress); + } + + /** Array version of: {@link #glGetnColorTableARB GetnColorTableARB} */ + public static void glGetnColorTableARB(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") int[] table) { + long __functionAddress = GL.getICD().glGetnColorTableARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, format, type, table.length << 2, table, __functionAddress); + } + + /** Array version of: {@link #glGetnColorTableARB GetnColorTableARB} */ + public static void glGetnColorTableARB(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") float[] table) { + long __functionAddress = GL.getICD().glGetnColorTableARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, format, type, table.length << 2, table, __functionAddress); + } + + /** Array version of: {@link #glGetnUniformfvARB GetnUniformfvARB} */ + public static void glGetnUniformfvARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetnUniformfvARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, params.length, params, __functionAddress); + } + + /** Array version of: {@link #glGetnUniformivARB GetnUniformivARB} */ + public static void glGetnUniformivARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetnUniformivARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, params.length, params, __functionAddress); + } + + /** Array version of: {@link #glGetnUniformuivARB GetnUniformuivARB} */ + public static void glGetnUniformuivARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint *") int[] params) { + long __functionAddress = GL.getICD().glGetnUniformuivARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, params.length, params, __functionAddress); + } + + /** Array version of: {@link #glGetnUniformdvARB GetnUniformdvARB} */ + public static void glGetnUniformdvARB(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble *") double[] params) { + long __functionAddress = GL.getICD().glGetnUniformdvARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, params.length, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSPIRVExtensions.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSPIRVExtensions.java new file mode 100644 index 00000000..2f3a94ef --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSPIRVExtensions.java @@ -0,0 +1,39 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_spirv_extensions extension. + * + *

{@code ARB_gl_spirv} added support for using SPIR-V modules in OpenGL. However it only added support for SPIR-V 1.0 concepts that were part of the + * OpenGL 4.5 Core Profile.

+ * + *

There are a great number of additional OpenGL ARB and vendor extensions which add shading language concepts and since they were defined prior to the + * existence of SPIR-V support in OpenGL they don't add SPIR-V support for their additional features. Ideally {@code GL_ARB_gl_spirv} would have added + * support for them, but as noted in Issue 27 of that extension, support for them was left as a future exercise.

+ * + *

Now that at least some of that functionality has been defined via SPIR-V extensions, there is currently no way for an OpenGL implementation to + * advertise that is supports additional SPIR-V extensions.

+ * + *

This extension provides a mechanism for an implementation to advertise which SPIR-V extensions it supports, and further provides a place where the + * SPIR-V environment for those extensions can be documented for OpenGL.

+ * + *

It is expected that this document can be extended over time as SPIR-V support for additional extensions is added. The mapping between GLSL and SPIR-V + * concepts and any other pertinent information can be provided here as interactions with the corresponding OpenGL and SPIR-V extensions.

+ * + *

Requires {@link ARBGLSPIRV OpenGL B.G}.

+ */ +public final class ARBSPIRVExtensions { + + /** Accepted by the {@code name} parameter of {@link GL30C#glGetStringi GetStringi}. */ + public static final int GL_SPIR_V_EXTENSIONS = 0x9553; + + /** Accepted by the {@code pname} parameter of {@link GL11C#glGetIntegerv GetIntegerv}. */ + public static final int GL_NUM_SPIR_V_EXTENSIONS = 0x9554; + + private ARBSPIRVExtensions() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSampleLocations.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSampleLocations.java new file mode 100644 index 00000000..ea49266d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSampleLocations.java @@ -0,0 +1,138 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_sample_locations extension. + * + *

This extension allows an application to modify the locations of samples within a pixel used in multisample rasterization. Additionally, it allows + * applications to specify different sample locations for each pixel in a group of adjacent pixels, which may increase antialiasing quality (particularly + * if a custom resolve shader is used that takes advantage of these different locations).

+ * + *

It is common for implementations to optimize the storage of depth values by storing values that can be used to reconstruct depth at each sample + * location, rather than storing separate depth values for each sample. For example, the depth values from a single triangle can be represented using + * plane equations. When the depth value for a sample is needed, it is automatically evaluated at the sample location. Modifying the sample locations + * causes the reconstruction to no longer evaluate the same depth values as when the samples were originally generated. This extension provides a command + * to "evaluate" and store per-sample depth values using the currently programmed sample locations, which allows the application to manage this issue + * if/when necessary.

+ * + *

The programmable sample locations are used during rasterization and for evaluation of depth functions during normal geometric rendering. The + * programmable locations are associated with a framebuffer object rather than an individual depth buffer, so if the depth buffer is used as a texture the + * texture sampling may be done at the standard sample locations. Additionally, commands that do not render geometric primitives (e.g. ReadPixels, + * BlitFramebuffer, CopyTexSubImage2D, etc.) may use the standard sample locations to evaluate depth functions rather than the programmable locations. If + * a single depth buffer is used at different times with different sample locations, the depth functions may be interpreted using the current sample + * locations.

+ */ +public class ARBSampleLocations { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int + GL_SAMPLE_LOCATION_SUBPIXEL_BITS_ARB = 0x933D, + GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_ARB = 0x933E, + GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_ARB = 0x933F, + GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB = 0x9340; + + /** + * // Alias of SAMPLE_POSITION. Before NV_expms, the spec used "location". SAMPLE_LOCATION_ARB 0x8E50 PROGRAMMABLE_SAMPLE_LOCATION_ARB 0x9341 Accepted by + * the {@code pname} parameter of FramebufferParameteri, GetFramebufferParameteriv. + */ + public static final int + GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_ARB = 0x9342, + GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_ARB = 0x9343; + + static { GL.initialize(); } + + protected ARBSampleLocations() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glFramebufferSampleLocationsfvARB, caps.glNamedFramebufferSampleLocationsfvARB, caps.glEvaluateDepthValuesARB + ); + } + + // --- [ glFramebufferSampleLocationsfvARB ] --- + + /** + * Unsafe version of: {@link #glFramebufferSampleLocationsfvARB FramebufferSampleLocationsfvARB} + * + * @param count the number of sample locations to update + */ + public static native void nglFramebufferSampleLocationsfvARB(int target, int start, int count, long v); + + /** + * Controls the programmable sample locations for the framebuffer bound to the specified {@code target}. + * + *

There are {@code N} pairs of programmable sample locations values in a framebuffer, where {@code N} is the value of + * {@link #GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_ARB}. Each programmable sample location is specified as a pair of floating point values in the range + * {@code [0,1]}, corresponding to the x and y locations respectively in GL pixel space. {@code (0.5, 0.5)} thus corresponds to the pixel center. Sample + * locations outside of {@code [0,1]} result in undefined behavior.

+ * + * @param target the framebuffer target. One of:
{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}
+ * @param start the first sample location to update + * @param v a pair of values for each sample location to update + */ + public static void glFramebufferSampleLocationsfvARB(@NativeType("GLenum") int target, @NativeType("GLuint") int start, @NativeType("GLfloat const *") FloatBuffer v) { + nglFramebufferSampleLocationsfvARB(target, start, v.remaining() >> 1, memAddress(v)); + } + + // --- [ glNamedFramebufferSampleLocationsfvARB ] --- + + /** + * Unsafe version of: {@link #glNamedFramebufferSampleLocationsfvARB NamedFramebufferSampleLocationsfvARB} + * + * @param count the number of sample locations to update + */ + public static native void nglNamedFramebufferSampleLocationsfvARB(int framebuffer, int start, int count, long v); + + /** + * DSA version of {@link #glFramebufferSampleLocationsfvARB FramebufferSampleLocationsfvARB}. + * + * @param framebuffer the framebuffer object to update + * @param start the first sample location to update + * @param v a pair of values for each sample location to update + */ + public static void glNamedFramebufferSampleLocationsfvARB(@NativeType("GLuint") int framebuffer, @NativeType("GLuint") int start, @NativeType("GLfloat const *") FloatBuffer v) { + nglNamedFramebufferSampleLocationsfvARB(framebuffer, start, v.remaining() >> 1, memAddress(v)); + } + + // --- [ glEvaluateDepthValuesARB ] --- + + /** + * Evaluates depth values for all samples in the current depth buffer (subject to the pixel ownership and scissor tests) and stores each value in the + * depth buffer. This can be used to ensure that later accesses will use depth values consistent with the sample locations used when the samples were + * generated. If the current framebuffer has no depth buffer, EvaluateDepthValuesARB will have no effect. + */ + public static native void glEvaluateDepthValuesARB(); + + /** Array version of: {@link #glFramebufferSampleLocationsfvARB FramebufferSampleLocationsfvARB} */ + public static void glFramebufferSampleLocationsfvARB(@NativeType("GLenum") int target, @NativeType("GLuint") int start, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glFramebufferSampleLocationsfvARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, start, v.length >> 1, v, __functionAddress); + } + + /** Array version of: {@link #glNamedFramebufferSampleLocationsfvARB NamedFramebufferSampleLocationsfvARB} */ + public static void glNamedFramebufferSampleLocationsfvARB(@NativeType("GLuint") int framebuffer, @NativeType("GLuint") int start, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glNamedFramebufferSampleLocationsfvARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(framebuffer, start, v.length >> 1, v, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSampleShading.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSampleShading.java new file mode 100644 index 00000000..fdda3bbb --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSampleShading.java @@ -0,0 +1,63 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_sample_shading extension. + * + *

In standard multisample rendering, an implementation is allowed to assign the same color and texture coordinate values to each sample, which then allows + * the optimization where the shader is only evaluated once and then distributed to the samples that have been determined to be covered by the primitive + * currently being rasterized. This can cause aliasing where the input color and texture coordinates are used to generate a result that doesn't antialias + * itself, for example with alpha-tested transparency.

+ * + *

This extension adds the ability to explicitly request that an implementation use a minimum number of unique set of fragment computation inputs when + * multisampling a pixel. Specifying such a requirement can reduce aliasing that results from evaluating the fragment computations too few times per pixel.

+ * + *

This extension adds new global state that controls the minimum number of samples for which attribute data is independently interpolated. When enabled, + * all operations that were traditionally executed per-fragment operate independently on each sample.

+ * + *

This also extends the shading language to allow control over the sample being processed. This includes built-in fragment input variables identifying the + * sample number and position being processed when executing fragment shaders per sample.

+ * + *

Requires {@link GL20 OpenGL 2.0} and GLSL 1.30. Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ +public class ARBSampleShading { + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_SAMPLE_SHADING_ARB = 0x8C36; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int GL_MIN_SAMPLE_SHADING_VALUE_ARB = 0x8C37; + + static { GL.initialize(); } + + protected ARBSampleShading() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glMinSampleShadingARB + ); + } + + // --- [ glMinSampleShadingARB ] --- + + /** + * Sets the minimum sample shading fraction. {@code value} is clamped to [0,1] when specified. + * + * @param value the minimum sample shading fraction + */ + public static native void glMinSampleShadingARB(@NativeType("GLfloat") float value); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSamplerObjects.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSamplerObjects.java new file mode 100644 index 00000000..0ff1c9fe --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSamplerObjects.java @@ -0,0 +1,390 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_sampler_objects extension. + * + *

In unextended OpenGL textures are considered to be sets of image data (mip-chains, arrays, cube-map face sets, etc.) and sampling state (sampling mode, + * mip-mapping state, coordinate wrapping and clamping rules, etc.) combined into a single object. It is typical for an application to use many textures + * with a limited set of sampling states that are the same between them. In order to use textures in this way, an application must generate and configure + * many texture names, adding overhead both to applications and to implementations. Furthermore, should an application wish to sample from a texture in + * more than one way (with and without mip-mapping, for example) it must either modify the state of the texture or create two textures, each with a copy of + * the same image data. This can introduce runtime and memory costs to the application.

+ * + *

This extension separates sampler state from texture image data. A new object type is introduced, the sampler (representing generic sampling parameters). + * The new sampler objects are represented by a new named type encapsulating the sampling parameters of a traditional texture object. Sampler objects may + * be bound to texture units to supplant the bound texture's sampling state. A single sampler may be bound to more than one texture unit simultaneously, + * allowing different textures to be accessed with a single set of shared sampling parameters. Also, by binding different sampler objects to texture units + * to which the same texture has been bound, the same texture image data may be sampled with different sampling parameters.

+ * + *

Promoted to core in {@link GL33 OpenGL 3.3}.

+ */ +public class ARBSamplerObjects { + + /** Accepted by the {@code value} parameter of the GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv and GetDoublev functions. */ + public static final int GL_SAMPLER_BINDING = 0x8919; + + static { GL.initialize(); } + + protected ARBSamplerObjects() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glGenSamplers, caps.glDeleteSamplers, caps.glIsSampler, caps.glBindSampler, caps.glSamplerParameteri, caps.glSamplerParameterf, + caps.glSamplerParameteriv, caps.glSamplerParameterfv, caps.glSamplerParameterIiv, caps.glSamplerParameterIuiv, caps.glGetSamplerParameteriv, + caps.glGetSamplerParameterfv, caps.glGetSamplerParameterIiv, caps.glGetSamplerParameterIuiv + ); + } + + // --- [ glGenSamplers ] --- + + /** + * Unsafe version of: {@link #glGenSamplers GenSamplers} + * + * @param count the number of sampler object names to generate + */ + public static void nglGenSamplers(int count, long samplers) { + GL33C.nglGenSamplers(count, samplers); + } + + /** + * Generates sampler object names. + * + * @param samplers a buffer in which the generated sampler object names are stored + */ + public static void glGenSamplers(@NativeType("GLuint *") IntBuffer samplers) { + GL33C.glGenSamplers(samplers); + } + + /** Generates sampler object names. */ + @NativeType("void") + public static int glGenSamplers() { + return GL33C.glGenSamplers(); + } + + // --- [ glDeleteSamplers ] --- + + /** + * Unsafe version of: {@link #glDeleteSamplers DeleteSamplers} + * + * @param count the number of sampler objects to be deleted + */ + public static void nglDeleteSamplers(int count, long samplers) { + GL33C.nglDeleteSamplers(count, samplers); + } + + /** + * Deletes named sampler objects. + * + * @param samplers an array of sampler objects to be deleted + */ + public static void glDeleteSamplers(@NativeType("GLuint const *") IntBuffer samplers) { + GL33C.glDeleteSamplers(samplers); + } + + /** Deletes named sampler objects. */ + public static void glDeleteSamplers(@NativeType("GLuint const *") int sampler) { + GL33C.glDeleteSamplers(sampler); + } + + // --- [ glIsSampler ] --- + + /** + * Determines if a name corresponds to a sampler object. + * + * @param sampler a value that may be the name of a sampler object + */ + @NativeType("GLboolean") + public static boolean glIsSampler(@NativeType("GLuint") int sampler) { + return GL33C.glIsSampler(sampler); + } + + // --- [ glBindSampler ] --- + + /** + * Binds a named sampler to a texturing target. + * + * @param unit the index of the texture unit to which the sampler is bound + * @param sampler the name of a sampler + */ + public static void glBindSampler(@NativeType("GLuint") int unit, @NativeType("GLuint") int sampler) { + GL33C.glBindSampler(unit, sampler); + } + + // --- [ glSamplerParameteri ] --- + + /** + * Set the integer value of a sampler parameter. + * + * @param sampler the sampler object whose parameter to modify + * @param pname the symbolic name of a single-valued sampler parameter. One of:
{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}
{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
+ * @param param the value of {@code pname} + */ + public static void glSamplerParameteri(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint") int param) { + GL33C.glSamplerParameteri(sampler, pname, param); + } + + // --- [ glSamplerParameterf ] --- + + /** + * Float version of {@link #glSamplerParameteri SamplerParameteri}. + * + * @param sampler the sampler object whose parameter to modify + * @param pname the symbolic name of a single-valued sampler parameter + * @param param the value of {@code pname} + */ + public static void glSamplerParameterf(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLfloat") float param) { + GL33C.glSamplerParameterf(sampler, pname, param); + } + + // --- [ glSamplerParameteriv ] --- + + /** Unsafe version of: {@link #glSamplerParameteriv SamplerParameteriv} */ + public static void nglSamplerParameteriv(int sampler, int pname, long params) { + GL33C.nglSamplerParameteriv(sampler, pname, params); + } + + /** + * Pointer version of {@link #glSamplerParameteri SamplerParameteri}. + * + * @param sampler the sampler object whose parameter to modify + * @param pname the symbolic name of a sampler parameter. One of:
{@link GL11#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}
{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}
{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
+ * @param params an array where the value or values of {@code pname} are stored + */ + public static void glSamplerParameteriv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + GL33C.glSamplerParameteriv(sampler, pname, params); + } + + // --- [ glSamplerParameterfv ] --- + + /** Unsafe version of: {@link #glSamplerParameterfv SamplerParameterfv} */ + public static void nglSamplerParameterfv(int sampler, int pname, long params) { + GL33C.nglSamplerParameterfv(sampler, pname, params); + } + + /** + * Float version of {@link #glSamplerParameteriv SamplerParameteriv}. + * + * @param sampler the sampler object whose parameter to modify + * @param pname the symbolic name of a sampler parameter + * @param params an array where the value or values of {@code pname} are stored + */ + public static void glSamplerParameterfv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer params) { + GL33C.glSamplerParameterfv(sampler, pname, params); + } + + // --- [ glSamplerParameterIiv ] --- + + /** Unsafe version of: {@link #glSamplerParameterIiv SamplerParameterIiv} */ + public static void nglSamplerParameterIiv(int sampler, int pname, long params) { + GL33C.nglSamplerParameterIiv(sampler, pname, params); + } + + /** + * Pure integer version of {@link #glSamplerParameteriv SamplerParameteriv}. + * + * @param sampler the sampler object whose parameter to modify + * @param pname the symbolic name of a sampler parameter + * @param params an array where the value or values of {@code pname} are stored + */ + public static void glSamplerParameterIiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + GL33C.glSamplerParameterIiv(sampler, pname, params); + } + + // --- [ glSamplerParameterIuiv ] --- + + /** Unsafe version of: {@link #glSamplerParameterIuiv SamplerParameterIuiv} */ + public static void nglSamplerParameterIuiv(int sampler, int pname, long params) { + GL33C.nglSamplerParameterIuiv(sampler, pname, params); + } + + /** + * Unsigned pure integer version of {@link #glSamplerParameteriv SamplerParameteriv}. + * + * @param sampler the sampler object whose parameter to modify + * @param pname the symbolic name of a sampler parameter + * @param params an array where the value or values of {@code pname} are stored + */ + public static void glSamplerParameterIuiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLuint const *") IntBuffer params) { + GL33C.glSamplerParameterIuiv(sampler, pname, params); + } + + // --- [ glGetSamplerParameteriv ] --- + + /** Unsafe version of: {@link #glGetSamplerParameteriv GetSamplerParameteriv} */ + public static void nglGetSamplerParameteriv(int sampler, int pname, long params) { + GL33C.nglGetSamplerParameteriv(sampler, pname, params); + } + + /** + * Return the integer value(s) of a sampler parameter. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter. One of:
{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}
{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
,{@link GL11#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}
+ * @param params the sampler parameters + */ + public static void glGetSamplerParameteriv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL33C.glGetSamplerParameteriv(sampler, pname, params); + } + + /** + * Return the integer value(s) of a sampler parameter. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter. One of:
{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}
{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
,{@link GL11#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}
+ */ + @NativeType("void") + public static int glGetSamplerParameteri(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname) { + return GL33C.glGetSamplerParameteri(sampler, pname); + } + + // --- [ glGetSamplerParameterfv ] --- + + /** Unsafe version of: {@link #glGetSamplerParameterfv GetSamplerParameterfv} */ + public static void nglGetSamplerParameterfv(int sampler, int pname, long params) { + GL33C.nglGetSamplerParameterfv(sampler, pname, params); + } + + /** + * Float version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter + * @param params the sampler parameters + */ + public static void glGetSamplerParameterfv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + GL33C.glGetSamplerParameterfv(sampler, pname, params); + } + + /** + * Float version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter + */ + @NativeType("void") + public static float glGetSamplerParameterf(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname) { + return GL33C.glGetSamplerParameterf(sampler, pname); + } + + // --- [ glGetSamplerParameterIiv ] --- + + /** Unsafe version of: {@link #glGetSamplerParameterIiv GetSamplerParameterIiv} */ + public static void nglGetSamplerParameterIiv(int sampler, int pname, long params) { + GL33C.nglGetSamplerParameterIiv(sampler, pname, params); + } + + /** + * Pure integer version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter + * @param params the sampler parameters + */ + public static void glGetSamplerParameterIiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL33C.glGetSamplerParameterIiv(sampler, pname, params); + } + + /** + * Pure integer version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter + */ + @NativeType("void") + public static int glGetSamplerParameterIi(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname) { + return GL33C.glGetSamplerParameterIi(sampler, pname); + } + + // --- [ glGetSamplerParameterIuiv ] --- + + /** Unsafe version of: {@link #glGetSamplerParameterIuiv GetSamplerParameterIuiv} */ + public static void nglGetSamplerParameterIuiv(int sampler, int pname, long params) { + GL33C.nglGetSamplerParameterIuiv(sampler, pname, params); + } + + /** + * Unsigned pure integer version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter + * @param params the sampler parameters + */ + public static void glGetSamplerParameterIuiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLuint *") IntBuffer params) { + GL33C.glGetSamplerParameterIuiv(sampler, pname, params); + } + + /** + * Unsigned pure integer version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter + */ + @NativeType("void") + public static int glGetSamplerParameterIui(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname) { + return GL33C.glGetSamplerParameterIui(sampler, pname); + } + + /** Array version of: {@link #glGenSamplers GenSamplers} */ + public static void glGenSamplers(@NativeType("GLuint *") int[] samplers) { + GL33C.glGenSamplers(samplers); + } + + /** Array version of: {@link #glDeleteSamplers DeleteSamplers} */ + public static void glDeleteSamplers(@NativeType("GLuint const *") int[] samplers) { + GL33C.glDeleteSamplers(samplers); + } + + /** Array version of: {@link #glSamplerParameteriv SamplerParameteriv} */ + public static void glSamplerParameteriv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + GL33C.glSamplerParameteriv(sampler, pname, params); + } + + /** Array version of: {@link #glSamplerParameterfv SamplerParameterfv} */ + public static void glSamplerParameterfv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] params) { + GL33C.glSamplerParameterfv(sampler, pname, params); + } + + /** Array version of: {@link #glSamplerParameterIiv SamplerParameterIiv} */ + public static void glSamplerParameterIiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + GL33C.glSamplerParameterIiv(sampler, pname, params); + } + + /** Array version of: {@link #glSamplerParameterIuiv SamplerParameterIuiv} */ + public static void glSamplerParameterIuiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLuint const *") int[] params) { + GL33C.glSamplerParameterIuiv(sampler, pname, params); + } + + /** Array version of: {@link #glGetSamplerParameteriv GetSamplerParameteriv} */ + public static void glGetSamplerParameteriv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL33C.glGetSamplerParameteriv(sampler, pname, params); + } + + /** Array version of: {@link #glGetSamplerParameterfv GetSamplerParameterfv} */ + public static void glGetSamplerParameterfv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + GL33C.glGetSamplerParameterfv(sampler, pname, params); + } + + /** Array version of: {@link #glGetSamplerParameterIiv GetSamplerParameterIiv} */ + public static void glGetSamplerParameterIiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL33C.glGetSamplerParameterIiv(sampler, pname, params); + } + + /** Array version of: {@link #glGetSamplerParameterIuiv GetSamplerParameterIuiv} */ + public static void glGetSamplerParameterIuiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLuint *") int[] params) { + GL33C.glGetSamplerParameterIuiv(sampler, pname, params); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSeamlessCubeMap.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSeamlessCubeMap.java new file mode 100644 index 00000000..3cea7886 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSeamlessCubeMap.java @@ -0,0 +1,34 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_seamless_cube_map extension. + * + *

When sampling from cube map textures, a three-dimensional texture coordinate is used to select one of the cube map faces and generate a two dimensional + * texture coordinate ( s t ), at which a texel is sampled from the determined face of the cube map texture. Each face of the texture is treated as an + * independent two-dimensional texture, and the generated ( s t ) coordinate is subjected to the same clamping and wrapping rules as for any other two + * dimensional texture fetch.

+ * + *

Although it is unlikely that the generated ( s t ) coordinate lies significantly outside the determined cube map face, it is often the case that the + * locations of the individual elements required during a linear sampling do not lie within the determined face, and their coordinates will therefore be + * modified by the selected clamping and wrapping rules. This often has the effect of producing seams or other discontinuities in the sampled texture.

+ * + *

This extension allows implementations to take samples from adjacent cube map faces, providing the ability to create seamless cube maps.

+ * + *

Promoted to core in {@link GL32 OpenGL 3.2}.

+ */ +public final class ARBSeamlessCubeMap { + + /** + * Accepted by the {@code cap} parameter of Enable, Disable and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv and + * GetDoublev. + */ + public static final int GL_TEXTURE_CUBE_MAP_SEAMLESS = 0x884F; + + private ARBSeamlessCubeMap() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSeamlessCubemapPerTexture.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSeamlessCubemapPerTexture.java new file mode 100644 index 00000000..b5bcdee4 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSeamlessCubemapPerTexture.java @@ -0,0 +1,37 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_seamless_cubemap_per_texture extension. + * + *

In unextended OpenGL, cube maps are treated as sets of six, independent texture images. Once a face is selected from the set, it is treated exactly as + * any other two-dimensional texture would be. When sampling linearly from the texture, all of the individual texels that would be used to to create the + * final, bilinear sample values are taken from the same cube face. The normal, two-dimensional texture coordinate wrapping modes are honored. This + * sometimes causes seams to appear in cube maps.

+ * + *

{@link ARBSeamlessCubeMap ARB_seamless_cube_map} (and subsequently, OpenGL 3.2) addresses this issue by providing a mechanism whereby an implementation could take each of + * the taps of a bilinear sample from a different face, spanning face boundaries and providing seamless filtering from cube map textures. However, in + * ARB_seamless_cube_map, this feature was exposed as a global state, affecting all bound cube map textures. It was not possible to mix seamless and + * per-face cube map sampling modes during sampling. Furthermore, if an application included cube maps that were meant to be sampled seamlessly and + * non-seamlessly, it would have to track this state and enable or disable seamless cube map sampling as needed.

+ * + *

This extension addresses this issue and provides an orthogonal method for allowing an implementation to provide a per-texture setting for enabling + * seamless sampling from cube maps.

+ * + *

Requires {@link GL32 OpenGL 3.2}.

+ */ +public final class ARBSeamlessCubemapPerTexture { + + /** + * Accepted by the {@code pname} parameter of TexParameter{if}, TexParameter{if}v, GetTexParameter{if}v, SamplerParameter{if}, SamplerParameter{if}v, and + * GetSamplerParameter{if}v. + */ + public static final int GL_TEXTURE_CUBE_MAP_SEAMLESS = 0x884F; + + private ARBSeamlessCubemapPerTexture() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSeparateShaderObjects.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSeparateShaderObjects.java new file mode 100644 index 00000000..5aba41cc --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSeparateShaderObjects.java @@ -0,0 +1,1618 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_separate_shader_objects extension. + * + *

Conventional GLSL requires multiple shader stages (vertex, fragment, geometry, tessellation control, and tessellation evaluation) to be linked into a + * single monolithic program object to specify a GLSL shader for each stage.

+ * + *

While GLSL's monolithic approach has some advantages for optimizing shaders as a unit that span multiple stages, all existing GPU hardware supports the + * more flexible mix-and-match approach.

+ * + *

Shaders written for HLSL9, Cg, the prior OpenGL assembly program extensions, and game console favor a more flexible "mix-and-match" approach to + * specifying shaders independently for these different shader stages. Many developers build their shader content around the mix-and-match approach where + * they can use a single vertex shader with multiple fragment shaders (or vice versa).

+ * + *

This extension adopts a "mix-and-match" shader stage model for GLSL allowing multiple different GLSL program objects to be bound at once each to an + * individual rendering pipeline stage independently of other stage bindings. This allows program objects to contain only the shader stages that best suit + * the applications needs.

+ * + *

This extension introduces the program pipeline object that serves as a container for the program bound to any particular rendering stage. It can be + * bound, unbound, and rebound to simply save and restore the complete shader stage to program object bindings. Like framebuffer and vertex array objects, + * program pipeline objects are "container" objects that are not shared between contexts.

+ * + *

To bind a program object to a specific shader stage or set of stages, {@link #glUseProgramStages UseProgramStages} is used. The {@link #GL_VERTEX_SHADER_BIT VERTEX_SHADER_BIT}, {@link #GL_GEOMETRY_SHADER_BIT GEOMETRY_SHADER_BIT}, + * {@link #GL_FRAGMENT_SHADER_BIT FRAGMENT_SHADER_BIT}, {@link #GL_TESS_CONTROL_SHADER_BIT TESS_CONTROL_SHADER_BIT}, and {@link #GL_TESS_EVALUATION_SHADER_BIT TESS_EVALUATION_SHADER_BIT} tokens refer to the conventional vertex, geometry, fragment, + * tessellation control and tessellation evaluation stages respectively. {@link #glActiveShaderProgram ActiveShaderProgram} specifies the program that Uniform* commands will update.

+ * + *

While {@link #glActiveShaderProgram ActiveShaderProgram} allows the use of conventional Uniform* commands to update uniform variable values for separable program objects, this + * extension provides a preferrable interface in a set of ProgramUniform* commands that update the same uniform variables but take a parameter indicating + * the program object to be updated, rather than updating the currently active program object. These commands mirror those introduced in + * {@link EXTDirectStateAccess EXT_direct_state_access}.

+ * + *

While {@link #glActiveShaderProgram ActiveShaderProgram} provides a selector for setting and querying uniform values of a program object, the glProgramUniform* commands provide a + * selector-free way to modify uniforms of a GLSL program object without an explicit bind. This selector-free model reduces API overhead and provides a + * cleaner interface for applications.

+ * + *

Separate linking creates the possibility that certain output varyings of a shader may go unread by the subsequent shader inputting varyings. In this + * case, the output varyings are simply ignored. It is also possible input varyings from a shader may not be written as output varyings of a preceding + * shader. In this case, the unwritten input varying values are undefined.

+ * + *

This extension builds on the proof-of-concept provided by {@link EXTSeparateShaderObjects EXT_separate_shader_objects} which demonstrated that separate shader objects can work + * for GLSL. {@code EXT_separate_shader_objects} was a response to repeated requests for this functionality from 3D developers.

+ * + *

This ARB version addresses several "loose ends" in the prior EXT extension. In particular, it allows user-defined varyings with explicitly defined + * locations or implicitly assigned locations.

+ * + *

This ARB extension extends the GLSL language's use of layout qualifiers to provide cross-stage interfacing.

+ * + *

Requires {@link GL20 OpenGL 2.0} or {@link ARBShaderObjects ARB_shader_objects}. Promoted to core in {@link GL41 OpenGL 4.1}.

+ */ +public class ARBSeparateShaderObjects { + + /** Accepted by {@code stages} parameter to UseProgramStages. */ + public static final int + GL_VERTEX_SHADER_BIT = 0x1, + GL_FRAGMENT_SHADER_BIT = 0x2, + GL_GEOMETRY_SHADER_BIT = 0x4, + GL_TESS_CONTROL_SHADER_BIT = 0x8, + GL_TESS_EVALUATION_SHADER_BIT = 0x10, + GL_ALL_SHADER_BITS = 0xFFFFFFFF; + + /** Accepted by the {@code pname} parameter of ProgramParameteri and GetProgramiv. */ + public static final int GL_PROGRAM_SEPARABLE = 0x8258; + + /** Accepted by {@code type} parameter to GetProgramPipelineiv. */ + public static final int GL_ACTIVE_PROGRAM = 0x8259; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int GL_PROGRAM_PIPELINE_BINDING = 0x825A; + + static { GL.initialize(); } + + protected ARBSeparateShaderObjects() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glUseProgramStages, caps.glActiveShaderProgram, caps.glCreateShaderProgramv, caps.glBindProgramPipeline, caps.glDeleteProgramPipelines, + caps.glGenProgramPipelines, caps.glIsProgramPipeline, caps.glProgramParameteri, caps.glGetProgramPipelineiv, caps.glProgramUniform1i, + caps.glProgramUniform2i, caps.glProgramUniform3i, caps.glProgramUniform4i, caps.glProgramUniform1ui, caps.glProgramUniform2ui, + caps.glProgramUniform3ui, caps.glProgramUniform4ui, caps.glProgramUniform1f, caps.glProgramUniform2f, caps.glProgramUniform3f, + caps.glProgramUniform4f, caps.glProgramUniform1d, caps.glProgramUniform2d, caps.glProgramUniform3d, caps.glProgramUniform4d, + caps.glProgramUniform1iv, caps.glProgramUniform2iv, caps.glProgramUniform3iv, caps.glProgramUniform4iv, caps.glProgramUniform1uiv, + caps.glProgramUniform2uiv, caps.glProgramUniform3uiv, caps.glProgramUniform4uiv, caps.glProgramUniform1fv, caps.glProgramUniform2fv, + caps.glProgramUniform3fv, caps.glProgramUniform4fv, caps.glProgramUniform1dv, caps.glProgramUniform2dv, caps.glProgramUniform3dv, + caps.glProgramUniform4dv, caps.glProgramUniformMatrix2fv, caps.glProgramUniformMatrix3fv, caps.glProgramUniformMatrix4fv, + caps.glProgramUniformMatrix2dv, caps.glProgramUniformMatrix3dv, caps.glProgramUniformMatrix4dv, caps.glProgramUniformMatrix2x3fv, + caps.glProgramUniformMatrix3x2fv, caps.glProgramUniformMatrix2x4fv, caps.glProgramUniformMatrix4x2fv, caps.glProgramUniformMatrix3x4fv, + caps.glProgramUniformMatrix4x3fv, caps.glProgramUniformMatrix2x3dv, caps.glProgramUniformMatrix3x2dv, caps.glProgramUniformMatrix2x4dv, + caps.glProgramUniformMatrix4x2dv, caps.glProgramUniformMatrix3x4dv, caps.glProgramUniformMatrix4x3dv, caps.glValidateProgramPipeline, + caps.glGetProgramPipelineInfoLog + ); + } + + // --- [ glUseProgramStages ] --- + + /** + * Binds stages of a program object to a program pipeline. + * + * @param pipeline the program pipeline object to which to bind stages from {@code program} + * @param stages a set of program stages to bind to the program pipeline object + * @param program the program object containing the shader executables to use in {@code pipeline} + */ + public static void glUseProgramStages(@NativeType("GLuint") int pipeline, @NativeType("GLbitfield") int stages, @NativeType("GLuint") int program) { + GL41C.glUseProgramStages(pipeline, stages, program); + } + + // --- [ glActiveShaderProgram ] --- + + /** + * Sets the active program object for a program pipeline object. + * + * @param pipeline the program pipeline object to set the active program object for + * @param program the program object to set as the active program pipeline object {@code pipeline} + */ + public static void glActiveShaderProgram(@NativeType("GLuint") int pipeline, @NativeType("GLuint") int program) { + GL41C.glActiveShaderProgram(pipeline, program); + } + + // --- [ glCreateShaderProgramv ] --- + + /** + * Unsafe version of: {@link #glCreateShaderProgramv CreateShaderProgramv} + * + * @param count the number of source code strings in the array {@code strings} + */ + public static int nglCreateShaderProgramv(int type, int count, long strings) { + return GL41C.nglCreateShaderProgramv(type, count, strings); + } + + /** + * Creates a stand-alone program from an array of null-terminated source code strings. + * + *

{@code glCreateShaderProgram} is equivalent (assuming no errors are generated) to:

+ * + *

+     * const GLuint shader = glCreateShader(type);
+     * if (shader) {
+     *     glShaderSource(shader, count, strings, NULL);
+     *     glCompileShader(shader);
+     *     const GLuint program = glCreateProgram();
+     *     if (program) {
+     *         GLint compiled = GL_FALSE;
+     *         glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
+     *         glProgramParameteri(program, GL_PROGRAM_SEPARABLE, GL_TRUE);
+     *         if (compiled) {
+     *             glAttachShader(program, shader);
+     *             glLinkProgram(program);
+     *             glDetachShader(program, shader);
+     *         }
+     *         // append-shader-info-log-to-program-info-log
+     *     }
+     *     glDeleteShader(shader);
+     *     return program;
+     * } else {
+     *     return 0;
+     * }
+ * + *

The program object created by glCreateShaderProgram has its GL_PROGRAM_SEPARABLE status set to GL_TRUE.

+ * + * @param type the type of shader to create + * @param strings an array of pointers to source code strings from which to create the program object + */ + @NativeType("GLuint") + public static int glCreateShaderProgramv(@NativeType("GLenum") int type, @NativeType("GLchar const **") PointerBuffer strings) { + return GL41C.glCreateShaderProgramv(type, strings); + } + + /** + * Creates a stand-alone program from an array of null-terminated source code strings. + * + *

{@code glCreateShaderProgram} is equivalent (assuming no errors are generated) to:

+ * + *

+     * const GLuint shader = glCreateShader(type);
+     * if (shader) {
+     *     glShaderSource(shader, count, strings, NULL);
+     *     glCompileShader(shader);
+     *     const GLuint program = glCreateProgram();
+     *     if (program) {
+     *         GLint compiled = GL_FALSE;
+     *         glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
+     *         glProgramParameteri(program, GL_PROGRAM_SEPARABLE, GL_TRUE);
+     *         if (compiled) {
+     *             glAttachShader(program, shader);
+     *             glLinkProgram(program);
+     *             glDetachShader(program, shader);
+     *         }
+     *         // append-shader-info-log-to-program-info-log
+     *     }
+     *     glDeleteShader(shader);
+     *     return program;
+     * } else {
+     *     return 0;
+     * }
+ * + *

The program object created by glCreateShaderProgram has its GL_PROGRAM_SEPARABLE status set to GL_TRUE.

+ * + * @param type the type of shader to create + * @param strings an array of pointers to source code strings from which to create the program object + */ + @NativeType("GLuint") + public static int glCreateShaderProgramv(@NativeType("GLenum") int type, @NativeType("GLchar const **") CharSequence... strings) { + return GL41C.glCreateShaderProgramv(type, strings); + } + + /** + * Creates a stand-alone program from an array of null-terminated source code strings. + * + *

{@code glCreateShaderProgram} is equivalent (assuming no errors are generated) to:

+ * + *

+     * const GLuint shader = glCreateShader(type);
+     * if (shader) {
+     *     glShaderSource(shader, count, strings, NULL);
+     *     glCompileShader(shader);
+     *     const GLuint program = glCreateProgram();
+     *     if (program) {
+     *         GLint compiled = GL_FALSE;
+     *         glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
+     *         glProgramParameteri(program, GL_PROGRAM_SEPARABLE, GL_TRUE);
+     *         if (compiled) {
+     *             glAttachShader(program, shader);
+     *             glLinkProgram(program);
+     *             glDetachShader(program, shader);
+     *         }
+     *         // append-shader-info-log-to-program-info-log
+     *     }
+     *     glDeleteShader(shader);
+     *     return program;
+     * } else {
+     *     return 0;
+     * }
+ * + *

The program object created by glCreateShaderProgram has its GL_PROGRAM_SEPARABLE status set to GL_TRUE.

+ * + * @param type the type of shader to create + */ + @NativeType("GLuint") + public static int glCreateShaderProgramv(@NativeType("GLenum") int type, @NativeType("GLchar const **") CharSequence string) { + return GL41C.glCreateShaderProgramv(type, string); + } + + // --- [ glBindProgramPipeline ] --- + + /** + * Binds a program pipeline to the current context. + * + * @param pipeline the name of the pipeline object to bind to the context + */ + public static void glBindProgramPipeline(@NativeType("GLuint") int pipeline) { + GL41C.glBindProgramPipeline(pipeline); + } + + // --- [ glDeleteProgramPipelines ] --- + + /** + * Unsafe version of: {@link #glDeleteProgramPipelines DeleteProgramPipelines} + * + * @param n the number of program pipeline objects to delete + */ + public static void nglDeleteProgramPipelines(int n, long pipelines) { + GL41C.nglDeleteProgramPipelines(n, pipelines); + } + + /** + * Deletes program pipeline objects. + * + * @param pipelines an array of names of program pipeline objects to delete + */ + public static void glDeleteProgramPipelines(@NativeType("GLuint const *") IntBuffer pipelines) { + GL41C.glDeleteProgramPipelines(pipelines); + } + + /** Deletes program pipeline objects. */ + public static void glDeleteProgramPipelines(@NativeType("GLuint const *") int pipeline) { + GL41C.glDeleteProgramPipelines(pipeline); + } + + // --- [ glGenProgramPipelines ] --- + + /** + * Unsafe version of: {@link #glGenProgramPipelines GenProgramPipelines} + * + * @param n the number of program pipeline object names to reserve + */ + public static void nglGenProgramPipelines(int n, long pipelines) { + GL41C.nglGenProgramPipelines(n, pipelines); + } + + /** + * Reserves program pipeline object names. + * + * @param pipelines an array of into which the reserved names will be written + */ + public static void glGenProgramPipelines(@NativeType("GLuint *") IntBuffer pipelines) { + GL41C.glGenProgramPipelines(pipelines); + } + + /** Reserves program pipeline object names. */ + @NativeType("void") + public static int glGenProgramPipelines() { + return GL41C.glGenProgramPipelines(); + } + + // --- [ glIsProgramPipeline ] --- + + /** + * Determines if a name corresponds to a program pipeline object. + * + * @param pipeline a value that may be the name of a program pipeline object + */ + @NativeType("GLboolean") + public static boolean glIsProgramPipeline(@NativeType("GLuint") int pipeline) { + return GL41C.glIsProgramPipeline(pipeline); + } + + // --- [ glProgramParameteri ] --- + + /** + * Specifies the integer value of a program object parameter. + * + * @param program the name of a program object whose parameter to modify + * @param pname the name of the parameter to modify. One of:
{@link GL41C#GL_PROGRAM_BINARY_RETRIEVABLE_HINT PROGRAM_BINARY_RETRIEVABLE_HINT}{@link GL41C#GL_PROGRAM_SEPARABLE PROGRAM_SEPARABLE}
+ * @param value the new value of the parameter specified by {@code pname} for {@code program} + */ + public static void glProgramParameteri(@NativeType("GLuint") int program, @NativeType("GLenum") int pname, @NativeType("GLint") int value) { + GL41C.glProgramParameteri(program, pname, value); + } + + // --- [ glGetProgramPipelineiv ] --- + + /** Unsafe version of: {@link #glGetProgramPipelineiv GetProgramPipelineiv} */ + public static void nglGetProgramPipelineiv(int pipeline, int pname, long params) { + GL41C.nglGetProgramPipelineiv(pipeline, pname, params); + } + + /** + * Retrieves properties of a program pipeline object. + * + * @param pipeline the name of a program pipeline object whose parameter retrieve + * @param pname the name of the parameter to retrieve. One of:
{@link GL41C#GL_ACTIVE_PROGRAM ACTIVE_PROGRAM}{@link GL20#GL_INFO_LOG_LENGTH INFO_LOG_LENGTH}{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}
{@link GL40#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}{@link GL40#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param params a variable into which will be written the value or values of {@code pname} for {@code pipeline} + */ + public static void glGetProgramPipelineiv(@NativeType("GLuint") int pipeline, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL41C.glGetProgramPipelineiv(pipeline, pname, params); + } + + /** + * Retrieves properties of a program pipeline object. + * + * @param pipeline the name of a program pipeline object whose parameter retrieve + * @param pname the name of the parameter to retrieve. One of:
{@link GL41C#GL_ACTIVE_PROGRAM ACTIVE_PROGRAM}{@link GL20#GL_INFO_LOG_LENGTH INFO_LOG_LENGTH}{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}
{@link GL40#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}{@link GL40#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ */ + @NativeType("void") + public static int glGetProgramPipelinei(@NativeType("GLuint") int pipeline, @NativeType("GLenum") int pname) { + return GL41C.glGetProgramPipelinei(pipeline, pname); + } + + // --- [ glProgramUniform1i ] --- + + /** + * Specifies the value of an int uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + */ + public static void glProgramUniform1i(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint") int x) { + GL41C.glProgramUniform1i(program, location, x); + } + + // --- [ glProgramUniform2i ] --- + + /** + * Specifies the value of an ivec2 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + */ + public static void glProgramUniform2i(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint") int x, @NativeType("GLint") int y) { + GL41C.glProgramUniform2i(program, location, x, y); + } + + // --- [ glProgramUniform3i ] --- + + /** + * Specifies the value of an ivec3 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + */ + public static void glProgramUniform3i(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z) { + GL41C.glProgramUniform3i(program, location, x, y, z); + } + + // --- [ glProgramUniform4i ] --- + + /** + * Specifies the value of an ivec4 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * @param w the uniform w value + */ + public static void glProgramUniform4i(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z, @NativeType("GLint") int w) { + GL41C.glProgramUniform4i(program, location, x, y, z, w); + } + + // --- [ glProgramUniform1ui ] --- + + /** + * Specifies the value of a uint uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + */ + public static void glProgramUniform1ui(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint") int x) { + GL41C.glProgramUniform1ui(program, location, x); + } + + // --- [ glProgramUniform2ui ] --- + + /** + * Specifies the value of a uvec2 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + */ + public static void glProgramUniform2ui(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint") int x, @NativeType("GLuint") int y) { + GL41C.glProgramUniform2ui(program, location, x, y); + } + + // --- [ glProgramUniform3ui ] --- + + /** + * Specifies the value of a uvec3 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + */ + public static void glProgramUniform3ui(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint") int x, @NativeType("GLuint") int y, @NativeType("GLuint") int z) { + GL41C.glProgramUniform3ui(program, location, x, y, z); + } + + // --- [ glProgramUniform4ui ] --- + + /** + * Specifies the value of a uvec4 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * @param w the uniform w value + */ + public static void glProgramUniform4ui(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint") int x, @NativeType("GLuint") int y, @NativeType("GLuint") int z, @NativeType("GLuint") int w) { + GL41C.glProgramUniform4ui(program, location, x, y, z, w); + } + + // --- [ glProgramUniform1f ] --- + + /** + * Specifies the value of a float uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + */ + public static void glProgramUniform1f(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat") float x) { + GL41C.glProgramUniform1f(program, location, x); + } + + // --- [ glProgramUniform2f ] --- + + /** + * Specifies the value of a vec2 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + */ + public static void glProgramUniform2f(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat") float x, @NativeType("GLfloat") float y) { + GL41C.glProgramUniform2f(program, location, x, y); + } + + // --- [ glProgramUniform3f ] --- + + /** + * Specifies the value of a vec3 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + */ + public static void glProgramUniform3f(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z) { + GL41C.glProgramUniform3f(program, location, x, y, z); + } + + // --- [ glProgramUniform4f ] --- + + /** + * Specifies the value of a vec4 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * @param w the uniform w value + */ + public static void glProgramUniform4f(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z, @NativeType("GLfloat") float w) { + GL41C.glProgramUniform4f(program, location, x, y, z, w); + } + + // --- [ glProgramUniform1d ] --- + + /** + * Specifies the value of a double uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + */ + public static void glProgramUniform1d(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble") double x) { + GL41C.glProgramUniform1d(program, location, x); + } + + // --- [ glProgramUniform2d ] --- + + /** + * Specifies the value of a dvec2 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + */ + public static void glProgramUniform2d(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y) { + GL41C.glProgramUniform2d(program, location, x, y); + } + + // --- [ glProgramUniform3d ] --- + + /** + * Specifies the value of a dvec3 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + */ + public static void glProgramUniform3d(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z) { + GL41C.glProgramUniform3d(program, location, x, y, z); + } + + // --- [ glProgramUniform4d ] --- + + /** + * Specifies the value of a dvec4 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * @param w the uniform w value + */ + public static void glProgramUniform4d(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z, @NativeType("GLdouble") double w) { + GL41C.glProgramUniform4d(program, location, x, y, z, w); + } + + // --- [ glProgramUniform1iv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform1iv ProgramUniform1iv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform1iv(int program, int location, int count, long value) { + GL41C.nglProgramUniform1iv(program, location, count, value); + } + + /** + * Specifies the value of a single float uniform variable or a float uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glProgramUniform1iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + GL41C.glProgramUniform1iv(program, location, value); + } + + // --- [ glProgramUniform2iv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform2iv ProgramUniform2iv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform2iv(int program, int location, int count, long value) { + GL41C.nglProgramUniform2iv(program, location, count, value); + } + + /** + * Specifies the value of a single ivec2 uniform variable or an ivec2 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glProgramUniform2iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + GL41C.glProgramUniform2iv(program, location, value); + } + + // --- [ glProgramUniform3iv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform3iv ProgramUniform3iv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform3iv(int program, int location, int count, long value) { + GL41C.nglProgramUniform3iv(program, location, count, value); + } + + /** + * Specifies the value of a single ivec3 uniform variable or an ivec3 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glProgramUniform3iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + GL41C.glProgramUniform3iv(program, location, value); + } + + // --- [ glProgramUniform4iv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform4iv ProgramUniform4iv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform4iv(int program, int location, int count, long value) { + GL41C.nglProgramUniform4iv(program, location, count, value); + } + + /** + * Specifies the value of a single ivec4 uniform variable or an ivec4 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glProgramUniform4iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + GL41C.glProgramUniform4iv(program, location, value); + } + + // --- [ glProgramUniform1uiv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform1uiv ProgramUniform1uiv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform1uiv(int program, int location, int count, long value) { + GL41C.nglProgramUniform1uiv(program, location, count, value); + } + + /** + * Specifies the value of a single uint uniform variable or a uint uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glProgramUniform1uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + GL41C.glProgramUniform1uiv(program, location, value); + } + + // --- [ glProgramUniform2uiv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform2uiv ProgramUniform2uiv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform2uiv(int program, int location, int count, long value) { + GL41C.nglProgramUniform2uiv(program, location, count, value); + } + + /** + * Specifies the value of a single uvec2 uniform variable or a uvec2 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glProgramUniform2uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + GL41C.glProgramUniform2uiv(program, location, value); + } + + // --- [ glProgramUniform3uiv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform3uiv ProgramUniform3uiv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform3uiv(int program, int location, int count, long value) { + GL41C.nglProgramUniform3uiv(program, location, count, value); + } + + /** + * Specifies the value of a single uvec3 uniform variable or a uvec3 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glProgramUniform3uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + GL41C.glProgramUniform3uiv(program, location, value); + } + + // --- [ glProgramUniform4uiv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform4uiv ProgramUniform4uiv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform4uiv(int program, int location, int count, long value) { + GL41C.nglProgramUniform4uiv(program, location, count, value); + } + + /** + * Specifies the value of a single uvec4 uniform variable or a uvec4 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glProgramUniform4uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + GL41C.glProgramUniform4uiv(program, location, value); + } + + // --- [ glProgramUniform1fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform1fv ProgramUniform1fv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform1fv(int program, int location, int count, long value) { + GL41C.nglProgramUniform1fv(program, location, count, value); + } + + /** + * Specifies the value of a single float uniform variable or a float uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glProgramUniform1fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniform1fv(program, location, value); + } + + // --- [ glProgramUniform2fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform2fv ProgramUniform2fv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform2fv(int program, int location, int count, long value) { + GL41C.nglProgramUniform2fv(program, location, count, value); + } + + /** + * Specifies the value of a single vec2 uniform variable or a vec2 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glProgramUniform2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniform2fv(program, location, value); + } + + // --- [ glProgramUniform3fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform3fv ProgramUniform3fv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform3fv(int program, int location, int count, long value) { + GL41C.nglProgramUniform3fv(program, location, count, value); + } + + /** + * Specifies the value of a single vec3 uniform variable or a vec3 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glProgramUniform3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniform3fv(program, location, value); + } + + // --- [ glProgramUniform4fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform4fv ProgramUniform4fv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform4fv(int program, int location, int count, long value) { + GL41C.nglProgramUniform4fv(program, location, count, value); + } + + /** + * Specifies the value of a single vec4 uniform variable or a vec4 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glProgramUniform4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniform4fv(program, location, value); + } + + // --- [ glProgramUniform1dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform1dv ProgramUniform1dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform1dv(int program, int location, int count, long value) { + GL41C.nglProgramUniform1dv(program, location, count, value); + } + + /** + * Specifies the value of a single double uniform variable or a double uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glProgramUniform1dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniform1dv(program, location, value); + } + + // --- [ glProgramUniform2dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform2dv ProgramUniform2dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform2dv(int program, int location, int count, long value) { + GL41C.nglProgramUniform2dv(program, location, count, value); + } + + /** + * Specifies the value of a single dvec2 uniform variable or a dvec2 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glProgramUniform2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniform2dv(program, location, value); + } + + // --- [ glProgramUniform3dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform3dv ProgramUniform3dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform3dv(int program, int location, int count, long value) { + GL41C.nglProgramUniform3dv(program, location, count, value); + } + + /** + * Specifies the value of a single dvec3 uniform variable or a dvec3 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glProgramUniform3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniform3dv(program, location, value); + } + + // --- [ glProgramUniform4dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform4dv ProgramUniform4dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform4dv(int program, int location, int count, long value) { + GL41C.nglProgramUniform4dv(program, location, count, value); + } + + /** + * Specifies the value of a single dvec4 uniform variable or a dvec4 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + */ + public static void glProgramUniform4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniform4dv(program, location, value); + } + + // --- [ glProgramUniformMatrix2fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix2fv ProgramUniformMatrix2fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix2fv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix2fv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single mat2 uniform variable or a mat2 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniformMatrix2fv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix3fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix3fv ProgramUniformMatrix3fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix3fv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix3fv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single mat3 uniform variable or a mat3 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniformMatrix3fv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix4fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix4fv ProgramUniformMatrix4fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix4fv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix4fv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single mat4 uniform variable or a mat4 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniformMatrix4fv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix2dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix2dv ProgramUniformMatrix2dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix2dv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix2dv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat2 uniform variable or a dmat2 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniformMatrix2dv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix3dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix3dv ProgramUniformMatrix3dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix3dv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix3dv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat3 uniform variable or a dmat3 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniformMatrix3dv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix4dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix4dv ProgramUniformMatrix4dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix4dv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix4dv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat4 uniform variable or a dmat4 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniformMatrix4dv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix2x3fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix2x3fv ProgramUniformMatrix2x3fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix2x3fv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix2x3fv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single mat2x3 uniform variable or a mat2x3 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix2x3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniformMatrix2x3fv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix3x2fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix3x2fv ProgramUniformMatrix3x2fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix3x2fv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix3x2fv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single mat3x2 uniform variable or a mat3x2 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix3x2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniformMatrix3x2fv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix2x4fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix2x4fv ProgramUniformMatrix2x4fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix2x4fv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix2x4fv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single mat2x4 uniform variable or a mat2x4 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix2x4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniformMatrix2x4fv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix4x2fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix4x2fv ProgramUniformMatrix4x2fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix4x2fv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix4x2fv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single mat4x2 uniform variable or a mat4x2 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix4x2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniformMatrix4x2fv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix3x4fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix3x4fv ProgramUniformMatrix3x4fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix3x4fv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix3x4fv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single mat3x4 uniform variable or a mat3x4 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix3x4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniformMatrix3x4fv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix4x3fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix4x3fv ProgramUniformMatrix4x3fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix4x3fv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix4x3fv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single mat4x3 uniform variable or a mat4x3 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix4x3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniformMatrix4x3fv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix2x3dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix2x3dv ProgramUniformMatrix2x3dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix2x3dv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix2x3dv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat2x3 uniform variable or a dmat2x3 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix2x3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniformMatrix2x3dv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix3x2dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix3x2dv ProgramUniformMatrix3x2dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix3x2dv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix3x2dv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat3x2 uniform variable or a dmat3x2 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix3x2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniformMatrix3x2dv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix2x4dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix2x4dv ProgramUniformMatrix2x4dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix2x4dv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix2x4dv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat2x4 uniform variable or a dmat2x4 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix2x4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniformMatrix2x4dv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix4x2dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix4x2dv ProgramUniformMatrix4x2dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix4x2dv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix4x2dv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat4x2 uniform variable or a dmat4x2 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix4x2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniformMatrix4x2dv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix3x4dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix3x4dv ProgramUniformMatrix3x4dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix3x4dv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix3x4dv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat3x4 uniform variable or a dmat3x4 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix3x4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniformMatrix3x4dv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix4x3dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix4x3dv ProgramUniformMatrix4x3dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix4x3dv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix4x3dv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat4x3 uniform variable or a dmat4x3 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + */ + public static void glProgramUniformMatrix4x3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniformMatrix4x3dv(program, location, transpose, value); + } + + // --- [ glValidateProgramPipeline ] --- + + /** + * Validates a program pipeline object against current GL state. + * + * @param pipeline the name of a program pipeline object to validate + */ + public static void glValidateProgramPipeline(@NativeType("GLuint") int pipeline) { + GL41C.glValidateProgramPipeline(pipeline); + } + + // --- [ glGetProgramPipelineInfoLog ] --- + + /** + * Unsafe version of: {@link #glGetProgramPipelineInfoLog GetProgramPipelineInfoLog} + * + * @param bufSize the maximum number of characters, including the null terminator, that may be written into {@code infoLog} + */ + public static void nglGetProgramPipelineInfoLog(int pipeline, int bufSize, long length, long infoLog) { + GL41C.nglGetProgramPipelineInfoLog(pipeline, bufSize, length, infoLog); + } + + /** + * Retrieves the info log string from a program pipeline object. + * + * @param pipeline the name of a program pipeline object from which to retrieve the info log + * @param length a variable into which will be written the number of characters written into {@code infoLog} + * @param infoLog an array of characters into which will be written the info log for {@code pipeline} + */ + public static void glGetProgramPipelineInfoLog(@NativeType("GLuint") int pipeline, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer infoLog) { + GL41C.glGetProgramPipelineInfoLog(pipeline, length, infoLog); + } + + /** + * Retrieves the info log string from a program pipeline object. + * + * @param pipeline the name of a program pipeline object from which to retrieve the info log + * @param bufSize the maximum number of characters, including the null terminator, that may be written into {@code infoLog} + */ + @NativeType("void") + public static String glGetProgramPipelineInfoLog(@NativeType("GLuint") int pipeline, @NativeType("GLsizei") int bufSize) { + return GL41C.glGetProgramPipelineInfoLog(pipeline, bufSize); + } + + /** + * Retrieves the info log string from a program pipeline object. + * + * @param pipeline the name of a program pipeline object from which to retrieve the info log + */ + @NativeType("void") + public static String glGetProgramPipelineInfoLog(@NativeType("GLuint") int pipeline) { + return glGetProgramPipelineInfoLog(pipeline, glGetProgramPipelinei(pipeline, GL20.GL_INFO_LOG_LENGTH)); + } + + /** Array version of: {@link #glDeleteProgramPipelines DeleteProgramPipelines} */ + public static void glDeleteProgramPipelines(@NativeType("GLuint const *") int[] pipelines) { + GL41C.glDeleteProgramPipelines(pipelines); + } + + /** Array version of: {@link #glGenProgramPipelines GenProgramPipelines} */ + public static void glGenProgramPipelines(@NativeType("GLuint *") int[] pipelines) { + GL41C.glGenProgramPipelines(pipelines); + } + + /** Array version of: {@link #glGetProgramPipelineiv GetProgramPipelineiv} */ + public static void glGetProgramPipelineiv(@NativeType("GLuint") int pipeline, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL41C.glGetProgramPipelineiv(pipeline, pname, params); + } + + /** Array version of: {@link #glProgramUniform1iv ProgramUniform1iv} */ + public static void glProgramUniform1iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + GL41C.glProgramUniform1iv(program, location, value); + } + + /** Array version of: {@link #glProgramUniform2iv ProgramUniform2iv} */ + public static void glProgramUniform2iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + GL41C.glProgramUniform2iv(program, location, value); + } + + /** Array version of: {@link #glProgramUniform3iv ProgramUniform3iv} */ + public static void glProgramUniform3iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + GL41C.glProgramUniform3iv(program, location, value); + } + + /** Array version of: {@link #glProgramUniform4iv ProgramUniform4iv} */ + public static void glProgramUniform4iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + GL41C.glProgramUniform4iv(program, location, value); + } + + /** Array version of: {@link #glProgramUniform1uiv ProgramUniform1uiv} */ + public static void glProgramUniform1uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + GL41C.glProgramUniform1uiv(program, location, value); + } + + /** Array version of: {@link #glProgramUniform2uiv ProgramUniform2uiv} */ + public static void glProgramUniform2uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + GL41C.glProgramUniform2uiv(program, location, value); + } + + /** Array version of: {@link #glProgramUniform3uiv ProgramUniform3uiv} */ + public static void glProgramUniform3uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + GL41C.glProgramUniform3uiv(program, location, value); + } + + /** Array version of: {@link #glProgramUniform4uiv ProgramUniform4uiv} */ + public static void glProgramUniform4uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + GL41C.glProgramUniform4uiv(program, location, value); + } + + /** Array version of: {@link #glProgramUniform1fv ProgramUniform1fv} */ + public static void glProgramUniform1fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniform1fv(program, location, value); + } + + /** Array version of: {@link #glProgramUniform2fv ProgramUniform2fv} */ + public static void glProgramUniform2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniform2fv(program, location, value); + } + + /** Array version of: {@link #glProgramUniform3fv ProgramUniform3fv} */ + public static void glProgramUniform3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniform3fv(program, location, value); + } + + /** Array version of: {@link #glProgramUniform4fv ProgramUniform4fv} */ + public static void glProgramUniform4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniform4fv(program, location, value); + } + + /** Array version of: {@link #glProgramUniform1dv ProgramUniform1dv} */ + public static void glProgramUniform1dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniform1dv(program, location, value); + } + + /** Array version of: {@link #glProgramUniform2dv ProgramUniform2dv} */ + public static void glProgramUniform2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniform2dv(program, location, value); + } + + /** Array version of: {@link #glProgramUniform3dv ProgramUniform3dv} */ + public static void glProgramUniform3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniform3dv(program, location, value); + } + + /** Array version of: {@link #glProgramUniform4dv ProgramUniform4dv} */ + public static void glProgramUniform4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniform4dv(program, location, value); + } + + /** Array version of: {@link #glProgramUniformMatrix2fv ProgramUniformMatrix2fv} */ + public static void glProgramUniformMatrix2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniformMatrix2fv(program, location, transpose, value); + } + + /** Array version of: {@link #glProgramUniformMatrix3fv ProgramUniformMatrix3fv} */ + public static void glProgramUniformMatrix3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniformMatrix3fv(program, location, transpose, value); + } + + /** Array version of: {@link #glProgramUniformMatrix4fv ProgramUniformMatrix4fv} */ + public static void glProgramUniformMatrix4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniformMatrix4fv(program, location, transpose, value); + } + + /** Array version of: {@link #glProgramUniformMatrix2dv ProgramUniformMatrix2dv} */ + public static void glProgramUniformMatrix2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniformMatrix2dv(program, location, transpose, value); + } + + /** Array version of: {@link #glProgramUniformMatrix3dv ProgramUniformMatrix3dv} */ + public static void glProgramUniformMatrix3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniformMatrix3dv(program, location, transpose, value); + } + + /** Array version of: {@link #glProgramUniformMatrix4dv ProgramUniformMatrix4dv} */ + public static void glProgramUniformMatrix4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniformMatrix4dv(program, location, transpose, value); + } + + /** Array version of: {@link #glProgramUniformMatrix2x3fv ProgramUniformMatrix2x3fv} */ + public static void glProgramUniformMatrix2x3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniformMatrix2x3fv(program, location, transpose, value); + } + + /** Array version of: {@link #glProgramUniformMatrix3x2fv ProgramUniformMatrix3x2fv} */ + public static void glProgramUniformMatrix3x2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniformMatrix3x2fv(program, location, transpose, value); + } + + /** Array version of: {@link #glProgramUniformMatrix2x4fv ProgramUniformMatrix2x4fv} */ + public static void glProgramUniformMatrix2x4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniformMatrix2x4fv(program, location, transpose, value); + } + + /** Array version of: {@link #glProgramUniformMatrix4x2fv ProgramUniformMatrix4x2fv} */ + public static void glProgramUniformMatrix4x2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniformMatrix4x2fv(program, location, transpose, value); + } + + /** Array version of: {@link #glProgramUniformMatrix3x4fv ProgramUniformMatrix3x4fv} */ + public static void glProgramUniformMatrix3x4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniformMatrix3x4fv(program, location, transpose, value); + } + + /** Array version of: {@link #glProgramUniformMatrix4x3fv ProgramUniformMatrix4x3fv} */ + public static void glProgramUniformMatrix4x3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniformMatrix4x3fv(program, location, transpose, value); + } + + /** Array version of: {@link #glProgramUniformMatrix2x3dv ProgramUniformMatrix2x3dv} */ + public static void glProgramUniformMatrix2x3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniformMatrix2x3dv(program, location, transpose, value); + } + + /** Array version of: {@link #glProgramUniformMatrix3x2dv ProgramUniformMatrix3x2dv} */ + public static void glProgramUniformMatrix3x2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniformMatrix3x2dv(program, location, transpose, value); + } + + /** Array version of: {@link #glProgramUniformMatrix2x4dv ProgramUniformMatrix2x4dv} */ + public static void glProgramUniformMatrix2x4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniformMatrix2x4dv(program, location, transpose, value); + } + + /** Array version of: {@link #glProgramUniformMatrix4x2dv ProgramUniformMatrix4x2dv} */ + public static void glProgramUniformMatrix4x2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniformMatrix4x2dv(program, location, transpose, value); + } + + /** Array version of: {@link #glProgramUniformMatrix3x4dv ProgramUniformMatrix3x4dv} */ + public static void glProgramUniformMatrix3x4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniformMatrix3x4dv(program, location, transpose, value); + } + + /** Array version of: {@link #glProgramUniformMatrix4x3dv ProgramUniformMatrix4x3dv} */ + public static void glProgramUniformMatrix4x3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniformMatrix4x3dv(program, location, transpose, value); + } + + /** Array version of: {@link #glGetProgramPipelineInfoLog GetProgramPipelineInfoLog} */ + public static void glGetProgramPipelineInfoLog(@NativeType("GLuint") int pipeline, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer infoLog) { + GL41C.glGetProgramPipelineInfoLog(pipeline, length, infoLog); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShaderAtomicCounters.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShaderAtomicCounters.java new file mode 100644 index 00000000..35345498 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShaderAtomicCounters.java @@ -0,0 +1,144 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_shader_atomic_counters extension. + * + *

This extension provides a set of atomic counters.

+ * + *

This extension provides GLSL built-in functions to query and increment/decrement these atomic counters.

+ * + *

This enables a shader to write to unique offsets (append to a buffer object) or read from unique offsets (consume from a buffer object).

+ * + *

Opaque handles to atomic counters are declared at global scope and are qualified with the uniform qualifier.

+ * + *

Unlike other user-defined uniforms declared at global scope, they take NO storage from the default partition, they have NO location, and they may NOT be + * set with the Uniform* commands. Atomic counters may also NOT be grouped into uniform blocks.

+ * + *

Active atomic counters can be discovered by the commands {@link GL31C#glGetUniformIndices GetUniformIndices}, {@link GL31C#glGetActiveUniformName GetActiveUniformName}, {@link GL20C#glGetActiveUniform GetActiveUniform} and + * {@link GL31C#glGetActiveUniformsiv GetActiveUniformsiv}.

+ * + *

Like samplers, the opaque handles of the atomic counters and are ONLY used in some GLSL built-in functions.

+ * + *

The atomic counters pointed to by the opaque handles are bound to buffer binding points and buffer offsets through the layout qualifiers in the shading + * language, or they are implicitly assigned by the compiler.

+ * + *

Through the OpenGL API, buffer objects may be bound to these binding points with {@link GL30C#glBindBufferBase BindBufferBase} or {@link GL30C#glBindBufferRange BindBufferRange}.

+ * + *

The contents of the atomic counters are stored in the buffer objects. The contents of atomic counters may be set and queried with buffer object + * manipulation functions (e.g. BufferData, BufferSubData, MapBuffer or MapBufferRange).

+ * + *

Requires {@link GL30 OpenGL 3.0}. Promoted to core in {@link GL42 OpenGL 4.2}.

+ */ +public class ARBShaderAtomicCounters { + + /** Accepted by the {@code target} parameter of BindBufferBase and BindBufferRange. */ + public static final int GL_ATOMIC_COUNTER_BUFFER = 0x92C0; + + /** + * Accepted by the {@code pname} parameter of GetBooleani_v, GetIntegeri_v, GetFloati_v, GetDoublei_v, GetInteger64i_v, GetBooleanv, GetIntegerv, + * GetInteger64v, GetFloatv, GetDoublev, and GetActiveAtomicCounterBufferiv. + */ + public static final int GL_ATOMIC_COUNTER_BUFFER_BINDING = 0x92C1; + + /** Accepted by the {@code pname} parameter of GetIntegeri_64v. */ + public static final int + GL_ATOMIC_COUNTER_BUFFER_START = 0x92C2, + GL_ATOMIC_COUNTER_BUFFER_SIZE = 0x92C3; + + /** Accepted by the {@code pname} parameter of GetActiveAtomicCounterBufferiv. */ + public static final int + GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE = 0x92C4, + GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS = 0x92C5, + GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES = 0x92C6, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER = 0x92C7, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER = 0x92C8, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x92C9, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER = 0x92CA, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER = 0x92CB; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS = 0x92CC, + GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS = 0x92CD, + GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS = 0x92CE, + GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS = 0x92CF, + GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS = 0x92D0, + GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS = 0x92D1, + GL_MAX_VERTEX_ATOMIC_COUNTERS = 0x92D2, + GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS = 0x92D3, + GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS = 0x92D4, + GL_MAX_GEOMETRY_ATOMIC_COUNTERS = 0x92D5, + GL_MAX_FRAGMENT_ATOMIC_COUNTERS = 0x92D6, + GL_MAX_COMBINED_ATOMIC_COUNTERS = 0x92D7, + GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE = 0x92D8, + GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS = 0x92DC; + + /** Accepted by the {@code pname} parameter of GetProgramiv. */ + public static final int GL_ACTIVE_ATOMIC_COUNTER_BUFFERS = 0x92D9; + + /** Accepted by the {@code pname} parameter of GetActiveUniformsiv. */ + public static final int GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX = 0x92DA; + + /** Returned in {@code params} by GetActiveUniform and GetActiveUniformsiv. */ + public static final int GL_UNSIGNED_INT_ATOMIC_COUNTER = 0x92DB; + + static { GL.initialize(); } + + protected ARBShaderAtomicCounters() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glGetActiveAtomicCounterBufferiv + ); + } + + // --- [ glGetActiveAtomicCounterBufferiv ] --- + + /** Unsafe version of: {@link #glGetActiveAtomicCounterBufferiv GetActiveAtomicCounterBufferiv} */ + public static void nglGetActiveAtomicCounterBufferiv(int program, int bufferIndex, int pname, long params) { + GL42C.nglGetActiveAtomicCounterBufferiv(program, bufferIndex, pname, params); + } + + /** + * Obtains information about the set of active atomic counter buffers for a program. + * + * @param program the name of a program object for which the command {@link GL20C#glLinkProgram LinkProgram} has been issued in the past + * @param bufferIndex the index of an active atomic counter buffer + * @param pname the parameter to query. One of:
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE ATOMIC_COUNTER_BUFFER_DATA_SIZE}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER}
+ * @param params a buffer in which to place the returned value + */ + public static void glGetActiveAtomicCounterBufferiv(@NativeType("GLuint") int program, @NativeType("GLuint") int bufferIndex, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL42C.glGetActiveAtomicCounterBufferiv(program, bufferIndex, pname, params); + } + + /** + * Obtains information about the set of active atomic counter buffers for a program. + * + * @param program the name of a program object for which the command {@link GL20C#glLinkProgram LinkProgram} has been issued in the past + * @param bufferIndex the index of an active atomic counter buffer + * @param pname the parameter to query. One of:
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE ATOMIC_COUNTER_BUFFER_DATA_SIZE}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER}
+ */ + @NativeType("void") + public static int glGetActiveAtomicCounterBufferi(@NativeType("GLuint") int program, @NativeType("GLuint") int bufferIndex, @NativeType("GLenum") int pname) { + return GL42C.glGetActiveAtomicCounterBufferi(program, bufferIndex, pname); + } + + /** Array version of: {@link #glGetActiveAtomicCounterBufferiv GetActiveAtomicCounterBufferiv} */ + public static void glGetActiveAtomicCounterBufferiv(@NativeType("GLuint") int program, @NativeType("GLuint") int bufferIndex, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL42C.glGetActiveAtomicCounterBufferiv(program, bufferIndex, pname, params); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShaderImageLoadStore.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShaderImageLoadStore.java new file mode 100644 index 00000000..8273d45a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShaderImageLoadStore.java @@ -0,0 +1,166 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_shader_image_load_store extension. + * + *

This extension provides GLSL built-in functions allowing shaders to load from, store to, and perform atomic read-modify-write operations to a single + * level of a texture object from any shader stage. These built-in functions are named imageLoad(), imageStore(), and imageAtomic*(), respectively, and + * accept integer texel coordinates to identify the texel accessed. The extension adds the notion of "image units" to the OpenGL API, to which texture + * levels are bound for access by the GLSL built-in functions. To allow shaders to specify the image unit to access, GLSL provides a new set of data types + * ("image*") similar to samplers. Each image variable is assigned an integer value to identify an image unit to access, which is specified using + * Uniform*() APIs in a manner similar to samplers.

+ * + *

This extension also provides the capability to explicitly enable "early" per-fragment tests, where operations like depth and stencil testing are + * performed prior to fragment shader execution. In unextended OpenGL, fragment shaders never have any side effects and implementations can sometimes + * perform per-fragment tests and discard some fragments prior to executing the fragment shader. Since this extension allows fragment shaders to write to + * texture and buffer object memory using the built-in image functions, such optimizations could lead to non-deterministic results. To avoid this, + * implementations supporting this extension may not perform such optimizations on shaders having such side effects. However, enabling early per-fragment + * tests guarantees that such tests will be performed prior to fragment shader execution, and ensures that image stores and atomics will not be performed + * by fragment shader invocations where these per-fragment tests fail.

+ * + *

Finally, this extension provides both a GLSL built-in function and an OpenGL API function allowing applications some control over the ordering of image + * loads, stores, and atomics relative to other OpenGL pipeline operations accessing the same memory. Because the extension provides the ability to perform + * random accesses to texture or buffer object memory, such accesses are not easily tracked by the OpenGL driver. To avoid the need for heavy-handed + * synchronization at the driver level, this extension requires manual synchronization. The MemoryBarrier() OpenGL API function allows applications to + * specify a bitfield indicating the set of OpenGL API operations to synchronize relative to shader memory access. The memoryBarrier() GLSL built-in + * function provides a synchronization point within a given shader invocation to ensure that all memory accesses performed prior to the synchronization + * point complete prior to any started after the synchronization point.

+ * + *

Requires {@link GL30 OpenGL 3.0} and GLSL 1.30. Promoted to core in {@link GL42 OpenGL 4.2}.

+ */ +public class ARBShaderImageLoadStore { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev, and GetInteger64v. */ + public static final int + GL_MAX_IMAGE_UNITS = 0x8F38, + GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS = 0x8F39, + GL_MAX_IMAGE_SAMPLES = 0x906D, + GL_MAX_VERTEX_IMAGE_UNIFORMS = 0x90CA, + GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS = 0x90CB, + GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS = 0x90CC, + GL_MAX_GEOMETRY_IMAGE_UNIFORMS = 0x90CD, + GL_MAX_FRAGMENT_IMAGE_UNIFORMS = 0x90CE, + GL_MAX_COMBINED_IMAGE_UNIFORMS = 0x90CF; + + /** Accepted by the {@code target} parameter of GetIntegeri_v and GetBooleani_v. */ + public static final int + GL_IMAGE_BINDING_NAME = 0x8F3A, + GL_IMAGE_BINDING_LEVEL = 0x8F3B, + GL_IMAGE_BINDING_LAYERED = 0x8F3C, + GL_IMAGE_BINDING_LAYER = 0x8F3D, + GL_IMAGE_BINDING_ACCESS = 0x8F3E, + GL_IMAGE_BINDING_FORMAT = 0x906E; + + /** Accepted by the {@code barriers} parameter of MemoryBarrier. */ + public static final int + GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT = 0x1, + GL_ELEMENT_ARRAY_BARRIER_BIT = 0x2, + GL_UNIFORM_BARRIER_BIT = 0x4, + GL_TEXTURE_FETCH_BARRIER_BIT = 0x8, + GL_SHADER_IMAGE_ACCESS_BARRIER_BIT = 0x20, + GL_COMMAND_BARRIER_BIT = 0x40, + GL_PIXEL_BUFFER_BARRIER_BIT = 0x80, + GL_TEXTURE_UPDATE_BARRIER_BIT = 0x100, + GL_BUFFER_UPDATE_BARRIER_BIT = 0x200, + GL_FRAMEBUFFER_BARRIER_BIT = 0x400, + GL_TRANSFORM_FEEDBACK_BARRIER_BIT = 0x800, + GL_ATOMIC_COUNTER_BARRIER_BIT = 0x1000, + GL_ALL_BARRIER_BITS = 0xFFFFFFFF; + + /** Returned by the {@code type} parameter of GetActiveUniform. */ + public static final int + GL_IMAGE_1D = 0x904C, + GL_IMAGE_2D = 0x904D, + GL_IMAGE_3D = 0x904E, + GL_IMAGE_2D_RECT = 0x904F, + GL_IMAGE_CUBE = 0x9050, + GL_IMAGE_BUFFER = 0x9051, + GL_IMAGE_1D_ARRAY = 0x9052, + GL_IMAGE_2D_ARRAY = 0x9053, + GL_IMAGE_CUBE_MAP_ARRAY = 0x9054, + GL_IMAGE_2D_MULTISAMPLE = 0x9055, + GL_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9056, + GL_INT_IMAGE_1D = 0x9057, + GL_INT_IMAGE_2D = 0x9058, + GL_INT_IMAGE_3D = 0x9059, + GL_INT_IMAGE_2D_RECT = 0x905A, + GL_INT_IMAGE_CUBE = 0x905B, + GL_INT_IMAGE_BUFFER = 0x905C, + GL_INT_IMAGE_1D_ARRAY = 0x905D, + GL_INT_IMAGE_2D_ARRAY = 0x905E, + GL_INT_IMAGE_CUBE_MAP_ARRAY = 0x905F, + GL_INT_IMAGE_2D_MULTISAMPLE = 0x9060, + GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9061, + GL_UNSIGNED_INT_IMAGE_1D = 0x9062, + GL_UNSIGNED_INT_IMAGE_2D = 0x9063, + GL_UNSIGNED_INT_IMAGE_3D = 0x9064, + GL_UNSIGNED_INT_IMAGE_2D_RECT = 0x9065, + GL_UNSIGNED_INT_IMAGE_CUBE = 0x9066, + GL_UNSIGNED_INT_IMAGE_BUFFER = 0x9067, + GL_UNSIGNED_INT_IMAGE_1D_ARRAY = 0x9068, + GL_UNSIGNED_INT_IMAGE_2D_ARRAY = 0x9069, + GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY = 0x906A, + GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE = 0x906B, + GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x906C; + + /** Accepted by the {@code value} parameter of GetTexParameteriv, GetTexParameterfv, GetTexParameterIiv, and GetTexParameterIuiv. */ + public static final int GL_IMAGE_FORMAT_COMPATIBILITY_TYPE = 0x90C7; + + /** + * Returned in the {@code data} parameter of GetTexParameteriv, GetTexParameterfv, GetTexParameterIiv, and GetTexParameterIuiv when {@code value} is + * IMAGE_FORMAT_COMPATIBILITY_TYPE. + */ + public static final int + GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE = 0x90C8, + GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS = 0x90C9; + + static { GL.initialize(); } + + protected ARBShaderImageLoadStore() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBindImageTexture, caps.glMemoryBarrier + ); + } + + // --- [ glBindImageTexture ] --- + + /** + * Binds a level of a texture to an image unit. + * + * @param unit the index of the image unit to which to bind the texture + * @param texture the name of the texture to bind to the image unit + * @param level the level of the texture that is to be bound + * @param layered whether a layered texture binding is to be established + * @param layer if {@code layered} is false, specifies the layer of texture to be bound to the image unit. Ignored otherwise. + * @param access a token indicating the type of access that will be performed on the image + * @param format the format that the elements of the image will be treated as for the purposes of formatted stores + */ + public static void glBindImageTexture(@NativeType("GLuint") int unit, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLboolean") boolean layered, @NativeType("GLint") int layer, @NativeType("GLenum") int access, @NativeType("GLenum") int format) { + GL42C.glBindImageTexture(unit, texture, level, layered, layer, access, format); + } + + // --- [ glMemoryBarrier ] --- + + /** + * Defines a barrier ordering memory transactions. + * + * @param barriers the barriers to insert (bitwise combination). One or more of:
{@link GL42C#GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT VERTEX_ATTRIB_ARRAY_BARRIER_BIT}{@link GL42C#GL_ELEMENT_ARRAY_BARRIER_BIT ELEMENT_ARRAY_BARRIER_BIT}{@link GL42C#GL_UNIFORM_BARRIER_BIT UNIFORM_BARRIER_BIT}
{@link GL42C#GL_TEXTURE_FETCH_BARRIER_BIT TEXTURE_FETCH_BARRIER_BIT}{@link GL42C#GL_SHADER_IMAGE_ACCESS_BARRIER_BIT SHADER_IMAGE_ACCESS_BARRIER_BIT}{@link GL42C#GL_COMMAND_BARRIER_BIT COMMAND_BARRIER_BIT}
{@link GL42C#GL_PIXEL_BUFFER_BARRIER_BIT PIXEL_BUFFER_BARRIER_BIT}{@link GL42C#GL_TEXTURE_UPDATE_BARRIER_BIT TEXTURE_UPDATE_BARRIER_BIT}{@link GL42C#GL_BUFFER_UPDATE_BARRIER_BIT BUFFER_UPDATE_BARRIER_BIT}
{@link GL42C#GL_FRAMEBUFFER_BARRIER_BIT FRAMEBUFFER_BARRIER_BIT}{@link GL42C#GL_TRANSFORM_FEEDBACK_BARRIER_BIT TRANSFORM_FEEDBACK_BARRIER_BIT}{@link GL42C#GL_ATOMIC_COUNTER_BARRIER_BIT ATOMIC_COUNTER_BARRIER_BIT}
{@link GL42C#GL_ALL_BARRIER_BITS ALL_BARRIER_BITS}{@link GL43#GL_SHADER_STORAGE_BARRIER_BIT SHADER_STORAGE_BARRIER_BIT}
+ */ + public static void glMemoryBarrier(@NativeType("GLbitfield") int barriers) { + GL42C.glMemoryBarrier(barriers); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShaderObjects.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShaderObjects.java new file mode 100644 index 00000000..1097d3a8 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShaderObjects.java @@ -0,0 +1,1319 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_shader_objects extension. + * + *

This extension adds API calls that are necessary to manage shader objects and program objects as defined in the OpenGL 2.0 white papers by 3Dlabs.

+ * + *

The generation of an executable that runs on one of OpenGL's programmable units is modeled to that of developing a typical C/C++ application. There are + * one or more source files, each of which are stored by OpenGL in a shader object. Each shader object (source file) needs to be compiled and attached to a + * program object. Once all shader objects are compiled successfully, the program object needs to be linked to produce an executable. This executable is + * part of the program object, and can now be loaded onto the programmable units to make it part of the current OpenGL state. Both the compile and link + * stages generate a text string that can be queried to get more information. This information could be, but is not limited to, compile errors, link errors, + * optimization hints, etc. Values for uniform variables, declared in a shader, can be set by the application and used to control a shader's behavior.

+ * + *

This extension defines functions for creating shader objects and program objects, for compiling shader objects, for linking program objects, for + * attaching shader objects to program objects, and for using a program object as part of current state. Functions to load uniform values are also defined. + * Some house keeping functions, like deleting an object and querying object state, are also provided.

+ * + *

Although this extension defines the API for creating shader objects, it does not define any specific types of shader objects. It is assumed that this + * extension will be implemented along with at least one such additional extension for creating a specific type of OpenGL 2.0 shader (e.g., the + * {@link ARBFragmentShader ARB_fragment_shader} extension or the {@link ARBVertexShader ARB_vertex_shader} extension).

+ * + *

Promoted to core in {@link GL20 OpenGL 2.0}.

+ */ +public class ARBShaderObjects { + + /** Accepted by the {@code pname} argument of GetHandleARB. */ + public static final int GL_PROGRAM_OBJECT_ARB = 0x8B40; + + /** Accepted by the {@code pname} parameter of GetObjectParameter{fi}vARB. */ + public static final int + GL_OBJECT_TYPE_ARB = 0x8B4E, + GL_OBJECT_SUBTYPE_ARB = 0x8B4F, + GL_OBJECT_DELETE_STATUS_ARB = 0x8B80, + GL_OBJECT_COMPILE_STATUS_ARB = 0x8B81, + GL_OBJECT_LINK_STATUS_ARB = 0x8B82, + GL_OBJECT_VALIDATE_STATUS_ARB = 0x8B83, + GL_OBJECT_INFO_LOG_LENGTH_ARB = 0x8B84, + GL_OBJECT_ATTACHED_OBJECTS_ARB = 0x8B85, + GL_OBJECT_ACTIVE_UNIFORMS_ARB = 0x8B86, + GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB = 0x8B87, + GL_OBJECT_SHADER_SOURCE_LENGTH_ARB = 0x8B88; + + /** Returned by the {@code params} parameter of GetObjectParameter{fi}vARB. */ + public static final int GL_SHADER_OBJECT_ARB = 0x8B48; + + /** Returned by the {@code type} parameter of GetActiveUniformARB. */ + public static final int + GL_FLOAT_VEC2_ARB = 0x8B50, + GL_FLOAT_VEC3_ARB = 0x8B51, + GL_FLOAT_VEC4_ARB = 0x8B52, + GL_INT_VEC2_ARB = 0x8B53, + GL_INT_VEC3_ARB = 0x8B54, + GL_INT_VEC4_ARB = 0x8B55, + GL_BOOL_ARB = 0x8B56, + GL_BOOL_VEC2_ARB = 0x8B57, + GL_BOOL_VEC3_ARB = 0x8B58, + GL_BOOL_VEC4_ARB = 0x8B59, + GL_FLOAT_MAT2_ARB = 0x8B5A, + GL_FLOAT_MAT3_ARB = 0x8B5B, + GL_FLOAT_MAT4_ARB = 0x8B5C, + GL_SAMPLER_1D_ARB = 0x8B5D, + GL_SAMPLER_2D_ARB = 0x8B5E, + GL_SAMPLER_3D_ARB = 0x8B5F, + GL_SAMPLER_CUBE_ARB = 0x8B60, + GL_SAMPLER_1D_SHADOW_ARB = 0x8B61, + GL_SAMPLER_2D_SHADOW_ARB = 0x8B62, + GL_SAMPLER_2D_RECT_ARB = 0x8B63, + GL_SAMPLER_2D_RECT_SHADOW_ARB = 0x8B64; + + static { GL.initialize(); } + + protected ARBShaderObjects() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glDeleteObjectARB, caps.glGetHandleARB, caps.glDetachObjectARB, caps.glCreateShaderObjectARB, caps.glShaderSourceARB, caps.glCompileShaderARB, + caps.glCreateProgramObjectARB, caps.glAttachObjectARB, caps.glLinkProgramARB, caps.glUseProgramObjectARB, caps.glValidateProgramARB, + caps.glUniform1fARB, caps.glUniform2fARB, caps.glUniform3fARB, caps.glUniform4fARB, caps.glUniform1iARB, caps.glUniform2iARB, caps.glUniform3iARB, + caps.glUniform4iARB, caps.glUniform1fvARB, caps.glUniform2fvARB, caps.glUniform3fvARB, caps.glUniform4fvARB, caps.glUniform1ivARB, + caps.glUniform2ivARB, caps.glUniform3ivARB, caps.glUniform4ivARB, caps.glUniformMatrix2fvARB, caps.glUniformMatrix3fvARB, + caps.glUniformMatrix4fvARB, caps.glGetObjectParameterfvARB, caps.glGetObjectParameterivARB, caps.glGetInfoLogARB, caps.glGetAttachedObjectsARB, + caps.glGetUniformLocationARB, caps.glGetActiveUniformARB, caps.glGetUniformfvARB, caps.glGetUniformivARB, caps.glGetShaderSourceARB + ); + } + + // --- [ glDeleteObjectARB ] --- + + /** + * Either deletes the object, or flags it for deletion. An object that is attached to a container object is not deleted until it is no longer attached to + * any container object, for any context. If it is still attached to at least one container object, the object is flagged for deletion. If the object is + * part of the current rendering state, it is not deleted until it is no longer part of the current rendering state for any context. If the object is still + * part of the rendering state of at least one context, it is flagged for deletion. + * + *

If an object is flagged for deletion, its Boolean status bit {@link #GL_OBJECT_DELETE_STATUS_ARB OBJECT_DELETE_STATUS_ARB} is set to true.

+ * + *

DeleteObjectARB will silently ignore the value zero.

+ * + *

When a container object is deleted, it will detach each attached object as part of the deletion process. When an object is deleted, all information for + * the object referenced is lost. The data for the object is also deleted.

+ * + * @param obj the shader object to delete + */ + public static native void glDeleteObjectARB(@NativeType("GLhandleARB") int obj); + + // --- [ glGetHandleARB ] --- + + /** + * Returns the handle to an object that is in use as part of current state. + * + * @param pname the state item for which the current object is to be returned. Must be:
{@link #GL_PROGRAM_OBJECT_ARB PROGRAM_OBJECT_ARB}
+ */ + @NativeType("GLhandleARB") + public static native int glGetHandleARB(@NativeType("GLenum") int pname); + + // --- [ glDetachObjectARB ] --- + + /** + * Detaches an object from the container object it is attached to. + * + * @param containerObj the container object + * @param attachedObj the object to detach + */ + public static native void glDetachObjectARB(@NativeType("GLhandleARB") int containerObj, @NativeType("GLhandleARB") int attachedObj); + + // --- [ glCreateShaderObjectARB ] --- + + /** + * Creates a shader object. + * + * @param shaderType the type of the shader object to be created. One of:
{@link ARBVertexShader#GL_VERTEX_SHADER_ARB VERTEX_SHADER_ARB}{@link ARBFragmentShader#GL_FRAGMENT_SHADER_ARB FRAGMENT_SHADER_ARB}
+ */ + @NativeType("GLhandleARB") + public static native int glCreateShaderObjectARB(@NativeType("GLenum") int shaderType); + + // --- [ glShaderSourceARB ] --- + + /** + * Unsafe version of: {@link #glShaderSourceARB ShaderSourceARB} + * + * @param count the number of strings in the array + */ + public static native void nglShaderSourceARB(int shaderObj, int count, long string, long length); + + /** + * Sets the source code for the specified shader object {@code shaderObj} to the text strings in the {@code string} array. If the object previously had + * source code loaded into it, it is completely replaced. + * + *

The strings that are loaded into a shader object are expected to form the source code for a valid shader as defined in the OpenGL Shading Language + * Specification.

+ * + * @param shaderObj the shader object + * @param string an array of pointers to one or more, optionally null terminated, character strings that make up the source code + * @param length an array with the number of charARBs in each string (the string length). Each element in this array can be set to negative one (or smaller), + * indicating that its accompanying string is null terminated. If {@code length} is set to {@code NULL}, all strings in the {@code string} argument are + * considered null terminated. + */ + public static void glShaderSourceARB(@NativeType("GLhandleARB") int shaderObj, @NativeType("GLcharARB const **") PointerBuffer string, @Nullable @NativeType("GLint const *") IntBuffer length) { + if (CHECKS) { + checkSafe(length, string.remaining()); + } + nglShaderSourceARB(shaderObj, string.remaining(), memAddress(string), memAddressSafe(length)); + } + + /** + * Sets the source code for the specified shader object {@code shaderObj} to the text strings in the {@code string} array. If the object previously had + * source code loaded into it, it is completely replaced. + * + *

The strings that are loaded into a shader object are expected to form the source code for a valid shader as defined in the OpenGL Shading Language + * Specification.

+ * + * @param shaderObj the shader object + * @param string an array of pointers to one or more, optionally null terminated, character strings that make up the source code + */ + public static void glShaderSourceARB(@NativeType("GLhandleARB") int shaderObj, @NativeType("GLcharARB const **") CharSequence... string) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + long stringAddress = org.lwjgl.system.APIUtil.apiArrayi(stack, MemoryUtil::memUTF8, string); + nglShaderSourceARB(shaderObj, string.length, stringAddress, stringAddress - (string.length << 2)); + org.lwjgl.system.APIUtil.apiArrayFree(stringAddress, string.length); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Sets the source code for the specified shader object {@code shaderObj} to the text strings in the {@code string} array. If the object previously had + * source code loaded into it, it is completely replaced. + * + *

The strings that are loaded into a shader object are expected to form the source code for a valid shader as defined in the OpenGL Shading Language + * Specification.

+ * + * @param shaderObj the shader object + * @param string an array of pointers to one or more, optionally null terminated, character strings that make up the source code + */ + public static void glShaderSourceARB(@NativeType("GLhandleARB") int shaderObj, @NativeType("GLcharARB const **") CharSequence string) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + long stringAddress = org.lwjgl.system.APIUtil.apiArrayi(stack, MemoryUtil::memUTF8, string); + nglShaderSourceARB(shaderObj, 1, stringAddress, stringAddress - 4); + org.lwjgl.system.APIUtil.apiArrayFree(stringAddress, 1); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glCompileShaderARB ] --- + + /** + * Compiles a shader object. Each shader object has a Boolean status, {@link #GL_OBJECT_COMPILE_STATUS_ARB OBJECT_COMPILE_STATUS_ARB}, that is modified as a result of compilation. This status + * can be queried with {@link #glGetObjectParameterivARB GetObjectParameterivARB}. This status will be set to {@link GL11#GL_TRUE TRUE} if the shader {@code shaderObj} was compiled without errors and is + * ready for use, and {@link GL11#GL_FALSE FALSE} otherwise. Compilation can fail for a variety of reasons as listed in the OpenGL Shading Language Specification. If + * CompileShaderARB failed, any information about a previous compile is lost and is not restored. Thus a failed compile does not restore the old state of + * {@code shaderObj}. If {@code shaderObj} does not reference a shader object, the error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated. + * + *

Note that changing the source code of a shader object, through ShaderSourceARB, does not change its compile status {@link #GL_OBJECT_COMPILE_STATUS_ARB OBJECT_COMPILE_STATUS_ARB}.

+ * + *

Each shader object has an information log that is modified as a result of compilation. This information log can be queried with {@link #glGetInfoLogARB GetInfoLogARB} to + * obtain more information about the compilation attempt.

+ * + * @param shaderObj the shader object to compile + */ + public static native void glCompileShaderARB(@NativeType("GLhandleARB") int shaderObj); + + // --- [ glCreateProgramObjectARB ] --- + + /** + * Creates a program object. + * + *

A program object is a container object. Shader objects are attached to a program object with the command AttachObjectARB. It is permissible to attach + * shader objects to program objects before source code has been loaded into the shader object, or before the shader object has been compiled. It is + * permissible to attach multiple shader objects of the same type to a single program object, and it is permissible to attach a shader object to more than + * one program object.

+ */ + @NativeType("GLhandleARB") + public static native int glCreateProgramObjectARB(); + + // --- [ glAttachObjectARB ] --- + + /** + * Attaches an object to a container object. + * + * @param containerObj the container object + * @param obj the object to attach + */ + public static native void glAttachObjectARB(@NativeType("GLhandleARB") int containerObj, @NativeType("GLhandleARB") int obj); + + // --- [ glLinkProgramARB ] --- + + /** + * Links a program object. + * + *

Each program object has a Boolean status, {@link #GL_OBJECT_LINK_STATUS_ARB OBJECT_LINK_STATUS_ARB}, that is modified as a result of linking. This status can be queried with + * {@link #glGetObjectParameterivARB GetObjectParameterivARB}. This status will be set to {@link GL11#GL_TRUE TRUE} if a valid executable is created, and {@link GL11#GL_FALSE FALSE} otherwise. Linking can fail for a + * variety of reasons as specified in the OpenGL Shading Language Specification. Linking will also fail if one or more of the shader objects, attached to + * {@code programObj}, are not compiled successfully, or if more active uniform or active sampler variables are used in {@code programObj} than allowed. + * If LinkProgramARB failed, any information about a previous link is lost and is not restored. Thus a failed link does not restore the old state of + * {@code programObj}. If {@code programObj} is not of type {@link #GL_PROGRAM_OBJECT_ARB PROGRAM_OBJECT_ARB}, the error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated.

+ * + *

Each program object has an information log that is modified as a result of a link operation. This information log can be queried with {@link #glGetInfoLogARB GetInfoLogARB} + * to obtain more information about the link operation.

+ * + * @param programObj the program object to link + */ + public static native void glLinkProgramARB(@NativeType("GLhandleARB") int programObj); + + // --- [ glUseProgramObjectARB ] --- + + /** + * Installs the executable code as part of current rendering state if the program object {@code programObj} contains valid executable code, i.e. has been + * linked successfully. If UseProgramObjectARB is called with the handle set to 0, it is as if the GL had no programmable stages and the fixed + * functionality paths will be used instead. If {@code programObj} cannot be made part of the current rendering state, an {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} error will + * be generated and the current rendering state left unmodified. This error will be set, for example, if {@code programObj} has not been linked + * successfully. If {@code programObj} is not of type {@link #GL_PROGRAM_OBJECT_ARB PROGRAM_OBJECT_ARB}, the error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated. + * + *

While a program object is in use, applications are free to modify attached shader objects, compile attached shader objects, attach additional shader + * objects, and detach shader objects. This does not affect the link status {@link #GL_OBJECT_LINK_STATUS_ARB OBJECT_LINK_STATUS_ARB} of the program object. This does not affect the + * executable code that is part of the current state either. That executable code is only affected when the program object has been re-linked successfully. + * After such a successful re-link, the {@link #glLinkProgramARB LinkProgramARB} command will install the generated executable code as part of the current rendering state if the + * specified program object was already in use as a result of a previous call to UseProgramObjectARB. If this re-link failed, then the executable code part + * of the current state does not change.

+ * + * @param programObj the program object to use + */ + public static native void glUseProgramObjectARB(@NativeType("GLhandleARB") int programObj); + + // --- [ glValidateProgramARB ] --- + + /** + * Validates the program object {@code programObj} against the GL state at that moment. Each program object has a Boolean status, + * {@link #GL_OBJECT_VALIDATE_STATUS_ARB OBJECT_VALIDATE_STATUS_ARB}, that is modified as a result of validation. This status can be queried with {@link #glGetObjectParameterivARB GetObjectParameterivARB}. If validation + * succeeded this status will be set to {@link GL11#GL_TRUE TRUE}, otherwise it will be set to {@link GL11#GL_FALSE FALSE}. If validation succeeded the program object is guaranteed to + * execute, given the current GL state. If validation failed, the program object is guaranteed to not execute, given the current GL state. If + * {@code programObj} is not of type {@link #GL_PROGRAM_OBJECT_ARB PROGRAM_OBJECT_ARB}, the error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated. + * + *

ValidateProgramARB will validate at least as much as is done when a rendering command is issued, and it could validate more. For example, it could give + * a hint on how to optimize some piece of shader code.

+ * + *

ValidateProgramARB will store its information in the info log. This information will either be an empty string or it will contain validation information.

+ * + *

ValidateProgramARB is typically only useful during application development. An application should not expect different OpenGL implementations to produce + * identical information.

+ * + * @param programObj the program object to validate + */ + public static native void glValidateProgramARB(@NativeType("GLhandleARB") int programObj); + + // --- [ glUniform1fARB ] --- + + /** + * float version of {@link #glUniform4fARB Uniform4fARB}. + * + * @param location the uniform variable location + * @param v0 the uniform x value + */ + public static native void glUniform1fARB(@NativeType("GLint") int location, @NativeType("GLfloat") float v0); + + // --- [ glUniform2fARB ] --- + + /** + * vec2 version of {@link #glUniform4fARB Uniform4fARB}. + * + * @param location the uniform variable location + * @param v0 the uniform x value + * @param v1 the uniform y value + */ + public static native void glUniform2fARB(@NativeType("GLint") int location, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1); + + // --- [ glUniform3fARB ] --- + + /** + * vec3 version of {@link #glUniform4fARB Uniform4fARB}. + * + * @param location the uniform variable location + * @param v0 the uniform x value + * @param v1 the uniform y value + * @param v2 the uniform z value + */ + public static native void glUniform3fARB(@NativeType("GLint") int location, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1, @NativeType("GLfloat") float v2); + + // --- [ glUniform4fARB ] --- + + /** + * Loads a vec4 value into a uniform variable of the program object that is currently in use. + * + * @param location the uniform variable location + * @param v0 the uniform x value + * @param v1 the uniform y value + * @param v2 the uniform z value + * @param v3 the uniform w value + */ + public static native void glUniform4fARB(@NativeType("GLint") int location, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1, @NativeType("GLfloat") float v2, @NativeType("GLfloat") float v3); + + // --- [ glUniform1iARB ] --- + + /** + * int version of {@link #glUniform1fARB Uniform1fARB}. + * + * @param location the uniform variable location + * @param v0 the uniform x value + */ + public static native void glUniform1iARB(@NativeType("GLint") int location, @NativeType("GLint") int v0); + + // --- [ glUniform2iARB ] --- + + /** + * ivec2 version of {@link #glUniform2fARB Uniform2fARB}. + * + * @param location the uniform variable location + * @param v0 the uniform x value + * @param v1 the uniform y value + */ + public static native void glUniform2iARB(@NativeType("GLint") int location, @NativeType("GLint") int v0, @NativeType("GLint") int v1); + + // --- [ glUniform3iARB ] --- + + /** + * ivec3 version of {@link #glUniform3fARB Uniform3fARB}. + * + * @param location the uniform variable location + * @param v0 the uniform x value + * @param v1 the uniform y value + * @param v2 the uniform z value + */ + public static native void glUniform3iARB(@NativeType("GLint") int location, @NativeType("GLint") int v0, @NativeType("GLint") int v1, @NativeType("GLint") int v2); + + // --- [ glUniform4iARB ] --- + + /** + * ivec4 version of {@link #glUniform4fARB Uniform4fARB}. + * + * @param location the uniform variable location + * @param v0 the uniform x value + * @param v1 the uniform y value + * @param v2 the uniform z value + * @param v3 the uniform w value + */ + public static native void glUniform4iARB(@NativeType("GLint") int location, @NativeType("GLint") int v0, @NativeType("GLint") int v1, @NativeType("GLint") int v2, @NativeType("GLint") int v3); + + // --- [ glUniform1fvARB ] --- + + /** + * Unsafe version of: {@link #glUniform1fvARB Uniform1fvARB} + * + * @param count the number of float values to load + */ + public static native void nglUniform1fvARB(int location, int count, long value); + + /** + * Loads floating-point values {@code count} times into a uniform location defined as an array of float values. + * + * @param location the uniform variable location + * @param value the values to load + */ + public static void glUniform1fvARB(@NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + nglUniform1fvARB(location, value.remaining(), memAddress(value)); + } + + // --- [ glUniform2fvARB ] --- + + /** + * Unsafe version of: {@link #glUniform2fvARB Uniform2fvARB} + * + * @param count the number of vec2 vectors to load + */ + public static native void nglUniform2fvARB(int location, int count, long value); + + /** + * Loads floating-point values {@code count} times into a uniform location defined as an array of vec2 vectors. + * + * @param location the uniform variable location + * @param value the values to load + */ + public static void glUniform2fvARB(@NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + nglUniform2fvARB(location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glUniform3fvARB ] --- + + /** + * Unsafe version of: {@link #glUniform3fvARB Uniform3fvARB} + * + * @param count the number of vec3 vectors to load + */ + public static native void nglUniform3fvARB(int location, int count, long value); + + /** + * Loads floating-point values {@code count} times into a uniform location defined as an array of vec3 vectors. + * + * @param location the uniform variable location + * @param value the values to load + */ + public static void glUniform3fvARB(@NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + nglUniform3fvARB(location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glUniform4fvARB ] --- + + /** + * Unsafe version of: {@link #glUniform4fvARB Uniform4fvARB} + * + * @param count the number of vec4 vectors to load + */ + public static native void nglUniform4fvARB(int location, int count, long value); + + /** + * Loads floating-point values {@code count} times into a uniform location defined as an array of vec4 vectors. + * + * @param location the uniform variable location + * @param value the values to load + */ + public static void glUniform4fvARB(@NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + nglUniform4fvARB(location, value.remaining() >> 2, memAddress(value)); + } + + // --- [ glUniform1ivARB ] --- + + /** + * Unsafe version of: {@link #glUniform1ivARB Uniform1ivARB} + * + * @param count the number of integer values to load + */ + public static native void nglUniform1ivARB(int location, int count, long value); + + /** + * Loads integer values {@code count} times into a uniform location defined as an array of integer values. + * + * @param location the uniform variable location + * @param value the values to load + */ + public static void glUniform1ivARB(@NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + nglUniform1ivARB(location, value.remaining(), memAddress(value)); + } + + // --- [ glUniform2ivARB ] --- + + /** + * Unsafe version of: {@link #glUniform2ivARB Uniform2ivARB} + * + * @param count the number of ivec2 vectors to load + */ + public static native void nglUniform2ivARB(int location, int count, long value); + + /** + * Loads integer values {@code count} times into a uniform location defined as an array of ivec2 vectors. + * + * @param location the uniform variable location + * @param value the values to load + */ + public static void glUniform2ivARB(@NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + nglUniform2ivARB(location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glUniform3ivARB ] --- + + /** + * Unsafe version of: {@link #glUniform3ivARB Uniform3ivARB} + * + * @param count the number of ivec3 vectors to load + */ + public static native void nglUniform3ivARB(int location, int count, long value); + + /** + * Loads integer values {@code count} times into a uniform location defined as an array of ivec3 vectors. + * + * @param location the uniform variable location + * @param value the values to load + */ + public static void glUniform3ivARB(@NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + nglUniform3ivARB(location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glUniform4ivARB ] --- + + /** + * Unsafe version of: {@link #glUniform4ivARB Uniform4ivARB} + * + * @param count the number of ivec4 vectors to load + */ + public static native void nglUniform4ivARB(int location, int count, long value); + + /** + * Loads integer values {@code count} times into a uniform location defined as an array of ivec4 vectors. + * + * @param location the uniform variable location + * @param value the values to load + */ + public static void glUniform4ivARB(@NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + nglUniform4ivARB(location, value.remaining() >> 2, memAddress(value)); + } + + // --- [ glUniformMatrix2fvARB ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix2fvARB UniformMatrix2fvARB} + * + * @param count the number of 2x2 matrices to load + */ + public static native void nglUniformMatrix2fvARB(int location, int count, boolean transpose, long value); + + /** + * Loads a 2x2 matrix of floating-point values {@code count} times into a uniform location defined as a matrix or an array of matrices. + * + * @param location the uniform variable location + * @param transpose if {@link GL11#GL_FALSE FALSE}, the matrix is specified in column major order, otherwise in row major order + * @param value the matrix values to load + */ + public static void glUniformMatrix2fvARB(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglUniformMatrix2fvARB(location, value.remaining() >> 2, transpose, memAddress(value)); + } + + // --- [ glUniformMatrix3fvARB ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix3fvARB UniformMatrix3fvARB} + * + * @param count the number of 3x3 matrices to load + */ + public static native void nglUniformMatrix3fvARB(int location, int count, boolean transpose, long value); + + /** + * Loads a 3x3 matrix of floating-point values {@code count} times into a uniform location defined as a matrix or an array of matrices. + * + * @param location the uniform variable location + * @param transpose if {@link GL11#GL_FALSE FALSE}, the matrix is specified in column major order, otherwise in row major order + * @param value the matrix values to load + */ + public static void glUniformMatrix3fvARB(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglUniformMatrix3fvARB(location, value.remaining() / 9, transpose, memAddress(value)); + } + + // --- [ glUniformMatrix4fvARB ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix4fvARB UniformMatrix4fvARB} + * + * @param count the number of 4x4 matrices to load + */ + public static native void nglUniformMatrix4fvARB(int location, int count, boolean transpose, long value); + + /** + * Loads a 4x4 matrix of floating-point values {@code count} times into a uniform location defined as a matrix or an array of matrices. + * + * @param location the uniform variable location + * @param transpose if {@link GL11#GL_FALSE FALSE}, the matrix is specified in column major order, otherwise in row major order + * @param value the matrix values to load + */ + public static void glUniformMatrix4fvARB(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglUniformMatrix4fvARB(location, value.remaining() >> 4, transpose, memAddress(value)); + } + + // --- [ glGetObjectParameterfvARB ] --- + + /** Unsafe version of: {@link #glGetObjectParameterfvARB GetObjectParameterfvARB} */ + public static native void nglGetObjectParameterfvARB(int obj, int pname, long params); + + /** + * Returns object specific parameter values. + * + * @param obj the object to query + * @param pname the parameter to query + * @param params a buffer in which to return the parameter value + */ + public static void glGetObjectParameterfvARB(@NativeType("GLhandleARB") int obj, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetObjectParameterfvARB(obj, pname, memAddress(params)); + } + + // --- [ glGetObjectParameterivARB ] --- + + /** Unsafe version of: {@link #glGetObjectParameterivARB GetObjectParameterivARB} */ + public static native void nglGetObjectParameterivARB(int obj, int pname, long params); + + /** + * Returns object specific parameter values. + * + * @param obj the object to query + * @param pname the parameter to query. One of:
{@link #GL_OBJECT_TYPE_ARB OBJECT_TYPE_ARB}{@link #GL_OBJECT_SUBTYPE_ARB OBJECT_SUBTYPE_ARB}{@link #GL_OBJECT_DELETE_STATUS_ARB OBJECT_DELETE_STATUS_ARB}
{@link #GL_OBJECT_COMPILE_STATUS_ARB OBJECT_COMPILE_STATUS_ARB}{@link #GL_OBJECT_LINK_STATUS_ARB OBJECT_LINK_STATUS_ARB}{@link #GL_OBJECT_VALIDATE_STATUS_ARB OBJECT_VALIDATE_STATUS_ARB}
{@link #GL_OBJECT_INFO_LOG_LENGTH_ARB OBJECT_INFO_LOG_LENGTH_ARB}{@link #GL_OBJECT_ATTACHED_OBJECTS_ARB OBJECT_ATTACHED_OBJECTS_ARB}{@link #GL_OBJECT_ACTIVE_UNIFORMS_ARB OBJECT_ACTIVE_UNIFORMS_ARB}
{@link #GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB}{@link #GL_OBJECT_SHADER_SOURCE_LENGTH_ARB OBJECT_SHADER_SOURCE_LENGTH_ARB}
+ * @param params a buffer in which to return the parameter value + */ + public static void glGetObjectParameterivARB(@NativeType("GLhandleARB") int obj, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetObjectParameterivARB(obj, pname, memAddress(params)); + } + + /** + * Returns object specific parameter values. + * + * @param obj the object to query + * @param pname the parameter to query. One of:
{@link #GL_OBJECT_TYPE_ARB OBJECT_TYPE_ARB}{@link #GL_OBJECT_SUBTYPE_ARB OBJECT_SUBTYPE_ARB}{@link #GL_OBJECT_DELETE_STATUS_ARB OBJECT_DELETE_STATUS_ARB}
{@link #GL_OBJECT_COMPILE_STATUS_ARB OBJECT_COMPILE_STATUS_ARB}{@link #GL_OBJECT_LINK_STATUS_ARB OBJECT_LINK_STATUS_ARB}{@link #GL_OBJECT_VALIDATE_STATUS_ARB OBJECT_VALIDATE_STATUS_ARB}
{@link #GL_OBJECT_INFO_LOG_LENGTH_ARB OBJECT_INFO_LOG_LENGTH_ARB}{@link #GL_OBJECT_ATTACHED_OBJECTS_ARB OBJECT_ATTACHED_OBJECTS_ARB}{@link #GL_OBJECT_ACTIVE_UNIFORMS_ARB OBJECT_ACTIVE_UNIFORMS_ARB}
{@link #GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB}{@link #GL_OBJECT_SHADER_SOURCE_LENGTH_ARB OBJECT_SHADER_SOURCE_LENGTH_ARB}
+ */ + @NativeType("void") + public static int glGetObjectParameteriARB(@NativeType("GLhandleARB") int obj, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetObjectParameterivARB(obj, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetInfoLogARB ] --- + + /** + * Unsafe version of: {@link #glGetInfoLogARB GetInfoLogARB} + * + * @param maxLength the maximum number of characters the GL is allowed to write into {@code infoLog} + */ + public static native void nglGetInfoLogARB(int obj, int maxLength, long length, long infoLog); + + /** + * A string that contains information about the last link or validation attempt and last compilation attempt are kept per program or shader object. This + * string is called the info log and can be obtained with this command. + * + *

This string will be null terminated. The number of characters in the info log is given by {@link #GL_OBJECT_INFO_LOG_LENGTH_ARB OBJECT_INFO_LOG_LENGTH_ARB}, which can be queried with + * {@link #glGetObjectParameterivARB GetObjectParameterivARB}. If {@code obj} is a shader object, the returned info log will either be an empty string or it will contain + * information about the last compilation attempt for that object. If {@code obj} is a program object, the returned info log will either be an empty string + * or it will contain information about the last link attempt or last validation attempt for that object. If {@code obj} is not of type {@link #GL_PROGRAM_OBJECT_ARB PROGRAM_OBJECT_ARB} + * or {@link #GL_SHADER_OBJECT_ARB SHADER_OBJECT_ARB}, the error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated. If an error occurred, the return parameters {@code length} and {@code infoLog} + * will be unmodified.

+ * + *

The info log is typically only useful during application development and an application should not expect different OpenGL implementations to produce + * identical info logs.

+ * + * @param obj the shader object to query + * @param length the actual number of characters written by the GL into {@code infoLog} is returned in {@code length}, excluding the null termination. If + * {@code length} is {@code NULL} then the GL ignores this parameter. + * @param infoLog a buffer in which to return the info log + */ + public static void glGetInfoLogARB(@NativeType("GLhandleARB") int obj, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLcharARB *") ByteBuffer infoLog) { + if (CHECKS) { + checkSafe(length, 1); + } + nglGetInfoLogARB(obj, infoLog.remaining(), memAddressSafe(length), memAddress(infoLog)); + } + + /** + * A string that contains information about the last link or validation attempt and last compilation attempt are kept per program or shader object. This + * string is called the info log and can be obtained with this command. + * + *

This string will be null terminated. The number of characters in the info log is given by {@link #GL_OBJECT_INFO_LOG_LENGTH_ARB OBJECT_INFO_LOG_LENGTH_ARB}, which can be queried with + * {@link #glGetObjectParameterivARB GetObjectParameterivARB}. If {@code obj} is a shader object, the returned info log will either be an empty string or it will contain + * information about the last compilation attempt for that object. If {@code obj} is a program object, the returned info log will either be an empty string + * or it will contain information about the last link attempt or last validation attempt for that object. If {@code obj} is not of type {@link #GL_PROGRAM_OBJECT_ARB PROGRAM_OBJECT_ARB} + * or {@link #GL_SHADER_OBJECT_ARB SHADER_OBJECT_ARB}, the error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated. If an error occurred, the return parameters {@code length} and {@code infoLog} + * will be unmodified.

+ * + *

The info log is typically only useful during application development and an application should not expect different OpenGL implementations to produce + * identical info logs.

+ * + * @param obj the shader object to query + * @param maxLength the maximum number of characters the GL is allowed to write into {@code infoLog} + */ + @NativeType("void") + public static String glGetInfoLogARB(@NativeType("GLhandleARB") int obj, @NativeType("GLsizei") int maxLength) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + ByteBuffer infoLog = memAlloc(maxLength); + try { + IntBuffer length = stack.ints(0); + nglGetInfoLogARB(obj, maxLength, memAddress(length), memAddress(infoLog)); + return memUTF8(infoLog, length.get(0)); + } finally { + memFree(infoLog); + stack.setPointer(stackPointer); + } + } + + /** + * A string that contains information about the last link or validation attempt and last compilation attempt are kept per program or shader object. This + * string is called the info log and can be obtained with this command. + * + *

This string will be null terminated. The number of characters in the info log is given by {@link #GL_OBJECT_INFO_LOG_LENGTH_ARB OBJECT_INFO_LOG_LENGTH_ARB}, which can be queried with + * {@link #glGetObjectParameterivARB GetObjectParameterivARB}. If {@code obj} is a shader object, the returned info log will either be an empty string or it will contain + * information about the last compilation attempt for that object. If {@code obj} is a program object, the returned info log will either be an empty string + * or it will contain information about the last link attempt or last validation attempt for that object. If {@code obj} is not of type {@link #GL_PROGRAM_OBJECT_ARB PROGRAM_OBJECT_ARB} + * or {@link #GL_SHADER_OBJECT_ARB SHADER_OBJECT_ARB}, the error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated. If an error occurred, the return parameters {@code length} and {@code infoLog} + * will be unmodified.

+ * + *

The info log is typically only useful during application development and an application should not expect different OpenGL implementations to produce + * identical info logs.

+ * + * @param obj the shader object to query + */ + @NativeType("void") + public static String glGetInfoLogARB(@NativeType("GLhandleARB") int obj) { + return glGetInfoLogARB(obj, glGetObjectParameteriARB(obj, GL_OBJECT_INFO_LOG_LENGTH_ARB)); + } + + // --- [ glGetAttachedObjectsARB ] --- + + /** + * Unsafe version of: {@link #glGetAttachedObjectsARB GetAttachedObjectsARB} + * + * @param maxCount the maximum number of handles the GL is allowed to write into {@code obj} + */ + public static native void nglGetAttachedObjectsARB(int containerObj, int maxCount, long count, long obj); + + /** + * Returns the handles of objects attached to {@code containerObj} in {@code obj}. . The number of objects attached to {@code containerObj} is given by + * {@link #GL_OBJECT_ATTACHED_OBJECTS_ARB OBJECT_ATTACHED_OBJECTS_ARB}, which can be queried with {@link #glGetObjectParameterivARB GetObjectParameterivARB}. If {@code containerObj} is not of type {@link #GL_PROGRAM_OBJECT_ARB PROGRAM_OBJECT_ARB}, the + * error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated. If an error occurred, the return parameters {@code count} and {@code obj} will be unmodified. + * + * @param containerObj the container object to query + * @param count a buffer in which to return the actual number of object handles written by the GL into {@code obj}. If {@code NULL} then the GL ignores this parameter. + * @param obj a buffer in which to return the attached object handles + */ + public static void glGetAttachedObjectsARB(@NativeType("GLhandleARB") int containerObj, @Nullable @NativeType("GLsizei *") IntBuffer count, @NativeType("GLhandleARB *") IntBuffer obj) { + if (CHECKS) { + checkSafe(count, 1); + } + nglGetAttachedObjectsARB(containerObj, obj.remaining(), memAddressSafe(count), memAddress(obj)); + } + + // --- [ glGetUniformLocationARB ] --- + + /** Unsafe version of: {@link #glGetUniformLocationARB GetUniformLocationARB} */ + public static native int nglGetUniformLocationARB(int programObj, long name); + + /** + * Returns the location of uniform variable {@code name}. {@code name} has to be a null terminated string, without white space. The value of -1 will be + * returned if {@code name} does not correspond to an active uniform variable name in {@code programObj} or if {@code name} starts with the reserved prefix + * "gl_". If {@code programObj} has not been successfully linked, or if {@code programObj} is not of type {@link #GL_PROGRAM_OBJECT_ARB PROGRAM_OBJECT_ARB}, the error + * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated. The location of a uniform variable does not change until the next link command is issued. + * + *

A valid {@code name} cannot be a structure, an array of structures, or a subcomponent of a vector or a matrix. In order to identify a valid {@code name}, + * the "." (dot) and "[]" operators can be used in {@code name} to operate on a structure or to operate on an array.

+ * + *

The first element of a uniform array is identified using the name of the uniform array appended with "[0]". Except if the last part of the string + * {@code name} indicates a uniform array, then the location of the first element of that array can be retrieved by either using the name of the uniform + * array, or the name of the uniform array appended with "[0]".

+ * + * @param programObj the program object to query + * @param name the name of the uniform variable whose location is to be queried + */ + @NativeType("GLint") + public static int glGetUniformLocationARB(@NativeType("GLhandleARB") int programObj, @NativeType("GLcharARB const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nglGetUniformLocationARB(programObj, memAddress(name)); + } + + /** + * Returns the location of uniform variable {@code name}. {@code name} has to be a null terminated string, without white space. The value of -1 will be + * returned if {@code name} does not correspond to an active uniform variable name in {@code programObj} or if {@code name} starts with the reserved prefix + * "gl_". If {@code programObj} has not been successfully linked, or if {@code programObj} is not of type {@link #GL_PROGRAM_OBJECT_ARB PROGRAM_OBJECT_ARB}, the error + * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated. The location of a uniform variable does not change until the next link command is issued. + * + *

A valid {@code name} cannot be a structure, an array of structures, or a subcomponent of a vector or a matrix. In order to identify a valid {@code name}, + * the "." (dot) and "[]" operators can be used in {@code name} to operate on a structure or to operate on an array.

+ * + *

The first element of a uniform array is identified using the name of the uniform array appended with "[0]". Except if the last part of the string + * {@code name} indicates a uniform array, then the location of the first element of that array can be retrieved by either using the name of the uniform + * array, or the name of the uniform array appended with "[0]".

+ * + * @param programObj the program object to query + * @param name the name of the uniform variable whose location is to be queried + */ + @NativeType("GLint") + public static int glGetUniformLocationARB(@NativeType("GLhandleARB") int programObj, @NativeType("GLcharARB const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(name, true); + long nameEncoded = stack.getPointerAddress(); + return nglGetUniformLocationARB(programObj, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetActiveUniformARB ] --- + + /** + * Unsafe version of: {@link #glGetActiveUniformARB GetActiveUniformARB} + * + * @param maxLength the maximum number of characters the GL is allowed to write into {@code name}. + */ + public static native void nglGetActiveUniformARB(int programObj, int index, int maxLength, long length, long size, long type, long name); + + /** + * Determines which of the declared uniform variables are active and their sizes and types. + * + *

This command provides information about the uniform selected by {@code index}. The {@code index} of 0 selects the first active uniform, and + * {@code index} of {@link #GL_OBJECT_ACTIVE_UNIFORMS_ARB OBJECT_ACTIVE_UNIFORMS_ARB} - 1 selects the last active uniform. The value of {@link #GL_OBJECT_ACTIVE_UNIFORMS_ARB OBJECT_ACTIVE_UNIFORMS_ARB} can be queried with + * {@link #glGetObjectParameterivARB GetObjectParameterivARB}. If {@code index} is greater than or equal to {@link #GL_OBJECT_ACTIVE_UNIFORMS_ARB OBJECT_ACTIVE_UNIFORMS_ARB}, the error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} is generated.

+ * + *

If an error occurred, the return parameters {@code length}, {@code size}, {@code type} and {@code name} will be unmodified.

+ * + *

The returned uniform name can be the name of built-in uniform state as well. The length of the longest uniform name in {@code programObj} is given by + * {@link #GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB}, which can be queried with {@link #glGetObjectParameterivARB GetObjectParameterivARB}.

+ * + *

Each uniform variable, declared in a shader, is broken down into one or more strings using the "." (dot) and "[]" operators, if necessary, to the point + * that it is legal to pass each string back into {@link #glGetUniformLocationARB GetUniformLocationARB}. Each of these strings constitutes one active uniform, and each string is + * assigned an index.

+ * + *

If one or more elements of an array are active, GetActiveUniformARB will return the name of the array in {@code name}, subject to the restrictions + * listed above. The type of the array is returned in {@code type}. The {@code size} parameter contains the highest array element index used, plus one. The + * compiler or linker determines the highest index used. There will be only one active uniform reported by the GL per uniform array.

+ * + *

This command will return as much information about active uniforms as possible. If no information is available, {@code length} will be set to zero and + * {@code name} will be an empty string. This situation could arise if GetActiveUniformARB is issued after a failed link.

+ * + * @param programObj a handle to a program object for which the command {@link #glLinkProgramARB LinkProgramARB} has been issued in the past. It is not necessary for {@code programObj} to have + * been linked successfully. The link could have failed because the number of active uniforms exceeded the limit. + * @param index the uniform index + * @param length a buffer in which to return the actual number of characters written by the GL into {@code name}. This count excludes the null termination. If + * {@code length} is {@code NULL} then the GL ignores this parameter. + * @param size a buffer in which to return the uniform size. The size is in units of the type returned in {@code type}. + * @param type a buffer in which to return the uniform type + * @param name a buffer in which to return the uniform name + */ + public static void glGetActiveUniformARB(@NativeType("GLhandleARB") int programObj, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLint *") IntBuffer size, @NativeType("GLenum *") IntBuffer type, @NativeType("GLcharARB *") ByteBuffer name) { + if (CHECKS) { + checkSafe(length, 1); + check(size, 1); + check(type, 1); + } + nglGetActiveUniformARB(programObj, index, name.remaining(), memAddressSafe(length), memAddress(size), memAddress(type), memAddress(name)); + } + + /** + * Determines which of the declared uniform variables are active and their sizes and types. + * + *

This command provides information about the uniform selected by {@code index}. The {@code index} of 0 selects the first active uniform, and + * {@code index} of {@link #GL_OBJECT_ACTIVE_UNIFORMS_ARB OBJECT_ACTIVE_UNIFORMS_ARB} - 1 selects the last active uniform. The value of {@link #GL_OBJECT_ACTIVE_UNIFORMS_ARB OBJECT_ACTIVE_UNIFORMS_ARB} can be queried with + * {@link #glGetObjectParameterivARB GetObjectParameterivARB}. If {@code index} is greater than or equal to {@link #GL_OBJECT_ACTIVE_UNIFORMS_ARB OBJECT_ACTIVE_UNIFORMS_ARB}, the error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} is generated.

+ * + *

If an error occurred, the return parameters {@code length}, {@code size}, {@code type} and {@code name} will be unmodified.

+ * + *

The returned uniform name can be the name of built-in uniform state as well. The length of the longest uniform name in {@code programObj} is given by + * {@link #GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB}, which can be queried with {@link #glGetObjectParameterivARB GetObjectParameterivARB}.

+ * + *

Each uniform variable, declared in a shader, is broken down into one or more strings using the "." (dot) and "[]" operators, if necessary, to the point + * that it is legal to pass each string back into {@link #glGetUniformLocationARB GetUniformLocationARB}. Each of these strings constitutes one active uniform, and each string is + * assigned an index.

+ * + *

If one or more elements of an array are active, GetActiveUniformARB will return the name of the array in {@code name}, subject to the restrictions + * listed above. The type of the array is returned in {@code type}. The {@code size} parameter contains the highest array element index used, plus one. The + * compiler or linker determines the highest index used. There will be only one active uniform reported by the GL per uniform array.

+ * + *

This command will return as much information about active uniforms as possible. If no information is available, {@code length} will be set to zero and + * {@code name} will be an empty string. This situation could arise if GetActiveUniformARB is issued after a failed link.

+ * + * @param programObj a handle to a program object for which the command {@link #glLinkProgramARB LinkProgramARB} has been issued in the past. It is not necessary for {@code programObj} to have + * been linked successfully. The link could have failed because the number of active uniforms exceeded the limit. + * @param index the uniform index + * @param maxLength the maximum number of characters the GL is allowed to write into {@code name}. + * @param size a buffer in which to return the uniform size. The size is in units of the type returned in {@code type}. + * @param type a buffer in which to return the uniform type + */ + @NativeType("void") + public static String glGetActiveUniformARB(@NativeType("GLhandleARB") int programObj, @NativeType("GLuint") int index, @NativeType("GLsizei") int maxLength, @NativeType("GLint *") IntBuffer size, @NativeType("GLenum *") IntBuffer type) { + if (CHECKS) { + check(size, 1); + check(type, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer length = stack.ints(0); + ByteBuffer name = stack.malloc(maxLength); + nglGetActiveUniformARB(programObj, index, maxLength, memAddress(length), memAddress(size), memAddress(type), memAddress(name)); + return memUTF8(name, length.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Determines which of the declared uniform variables are active and their sizes and types. + * + *

This command provides information about the uniform selected by {@code index}. The {@code index} of 0 selects the first active uniform, and + * {@code index} of {@link #GL_OBJECT_ACTIVE_UNIFORMS_ARB OBJECT_ACTIVE_UNIFORMS_ARB} - 1 selects the last active uniform. The value of {@link #GL_OBJECT_ACTIVE_UNIFORMS_ARB OBJECT_ACTIVE_UNIFORMS_ARB} can be queried with + * {@link #glGetObjectParameterivARB GetObjectParameterivARB}. If {@code index} is greater than or equal to {@link #GL_OBJECT_ACTIVE_UNIFORMS_ARB OBJECT_ACTIVE_UNIFORMS_ARB}, the error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} is generated.

+ * + *

If an error occurred, the return parameters {@code length}, {@code size}, {@code type} and {@code name} will be unmodified.

+ * + *

The returned uniform name can be the name of built-in uniform state as well. The length of the longest uniform name in {@code programObj} is given by + * {@link #GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB}, which can be queried with {@link #glGetObjectParameterivARB GetObjectParameterivARB}.

+ * + *

Each uniform variable, declared in a shader, is broken down into one or more strings using the "." (dot) and "[]" operators, if necessary, to the point + * that it is legal to pass each string back into {@link #glGetUniformLocationARB GetUniformLocationARB}. Each of these strings constitutes one active uniform, and each string is + * assigned an index.

+ * + *

If one or more elements of an array are active, GetActiveUniformARB will return the name of the array in {@code name}, subject to the restrictions + * listed above. The type of the array is returned in {@code type}. The {@code size} parameter contains the highest array element index used, plus one. The + * compiler or linker determines the highest index used. There will be only one active uniform reported by the GL per uniform array.

+ * + *

This command will return as much information about active uniforms as possible. If no information is available, {@code length} will be set to zero and + * {@code name} will be an empty string. This situation could arise if GetActiveUniformARB is issued after a failed link.

+ * + * @param programObj a handle to a program object for which the command {@link #glLinkProgramARB LinkProgramARB} has been issued in the past. It is not necessary for {@code programObj} to have + * been linked successfully. The link could have failed because the number of active uniforms exceeded the limit. + * @param index the uniform index + * @param size a buffer in which to return the uniform size. The size is in units of the type returned in {@code type}. + * @param type a buffer in which to return the uniform type + */ + @NativeType("void") + public static String glGetActiveUniformARB(@NativeType("GLhandleARB") int programObj, @NativeType("GLuint") int index, @NativeType("GLint *") IntBuffer size, @NativeType("GLenum *") IntBuffer type) { + return glGetActiveUniformARB(programObj, index, glGetObjectParameteriARB(programObj, GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB), size, type); + } + + // --- [ glGetUniformfvARB ] --- + + /** Unsafe version of: {@link #glGetUniformfvARB GetUniformfvARB} */ + public static native void nglGetUniformfvARB(int programObj, int location, long params); + + /** + * Returns the floating-point value or values of a uniform. + * + * @param programObj the program object to query + * @param location the uniform variable location + * @param params a buffer in which to return the uniform values + */ + public static void glGetUniformfvARB(@NativeType("GLhandleARB") int programObj, @NativeType("GLint") int location, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetUniformfvARB(programObj, location, memAddress(params)); + } + + /** + * Returns the floating-point value or values of a uniform. + * + * @param programObj the program object to query + * @param location the uniform variable location + */ + @NativeType("void") + public static float glGetUniformfARB(@NativeType("GLhandleARB") int programObj, @NativeType("GLint") int location) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer params = stack.callocFloat(1); + nglGetUniformfvARB(programObj, location, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetUniformivARB ] --- + + /** Unsafe version of: {@link #glGetUniformivARB GetUniformivARB} */ + public static native void nglGetUniformivARB(int programObj, int location, long params); + + /** + * Returns the integer value or values of a uniform. + * + * @param programObj the program object to query + * @param location the uniform variable location + * @param params a buffer in which to return the uniform values + */ + public static void glGetUniformivARB(@NativeType("GLhandleARB") int programObj, @NativeType("GLint") int location, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetUniformivARB(programObj, location, memAddress(params)); + } + + /** + * Returns the integer value or values of a uniform. + * + * @param programObj the program object to query + * @param location the uniform variable location + */ + @NativeType("void") + public static int glGetUniformiARB(@NativeType("GLhandleARB") int programObj, @NativeType("GLint") int location) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetUniformivARB(programObj, location, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetShaderSourceARB ] --- + + /** + * Unsafe version of: {@link #glGetShaderSourceARB GetShaderSourceARB} + * + * @param maxLength the maximum number of characters the GL is allowed to write into {@code source} + */ + public static native void nglGetShaderSourceARB(int obj, int maxLength, long length, long source); + + /** + * Returns the string making up the source code for a shader object. + * + *

The string {@code source} is a concatenation of the strings passed to OpenGL using {@link #glShaderSourceARB ShaderSourceARB}. The length of this concatenation is given by + * {@link #GL_OBJECT_SHADER_SOURCE_LENGTH_ARB OBJECT_SHADER_SOURCE_LENGTH_ARB}, which can be queried with {@link #glGetObjectParameterivARB GetObjectParameterivARB}. If {@code obj} is not of type {@link #GL_SHADER_OBJECT_ARB SHADER_OBJECT_ARB}, the error + * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated. If an error occurred, the return parameters {@code length} and {@code source} will be unmodified.

+ * + * @param obj the shader object to query + * @param length a buffer in which to return the actual number of characters written by the GL into {@code source}, excluding the null termination. If + * {@code length} is {@code NULL} then the GL ignores this parameter. + * @param source a buffer in which to return the shader object source + */ + public static void glGetShaderSourceARB(@NativeType("GLhandleARB") int obj, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLcharARB *") ByteBuffer source) { + if (CHECKS) { + checkSafe(length, 1); + } + nglGetShaderSourceARB(obj, source.remaining(), memAddressSafe(length), memAddress(source)); + } + + /** + * Returns the string making up the source code for a shader object. + * + *

The string {@code source} is a concatenation of the strings passed to OpenGL using {@link #glShaderSourceARB ShaderSourceARB}. The length of this concatenation is given by + * {@link #GL_OBJECT_SHADER_SOURCE_LENGTH_ARB OBJECT_SHADER_SOURCE_LENGTH_ARB}, which can be queried with {@link #glGetObjectParameterivARB GetObjectParameterivARB}. If {@code obj} is not of type {@link #GL_SHADER_OBJECT_ARB SHADER_OBJECT_ARB}, the error + * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated. If an error occurred, the return parameters {@code length} and {@code source} will be unmodified.

+ * + * @param obj the shader object to query + * @param maxLength the maximum number of characters the GL is allowed to write into {@code source} + */ + @NativeType("void") + public static String glGetShaderSourceARB(@NativeType("GLhandleARB") int obj, @NativeType("GLsizei") int maxLength) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + ByteBuffer source = memAlloc(maxLength); + try { + IntBuffer length = stack.ints(0); + nglGetShaderSourceARB(obj, maxLength, memAddress(length), memAddress(source)); + return memUTF8(source, length.get(0)); + } finally { + memFree(source); + stack.setPointer(stackPointer); + } + } + + /** + * Returns the string making up the source code for a shader object. + * + *

The string {@code source} is a concatenation of the strings passed to OpenGL using {@link #glShaderSourceARB ShaderSourceARB}. The length of this concatenation is given by + * {@link #GL_OBJECT_SHADER_SOURCE_LENGTH_ARB OBJECT_SHADER_SOURCE_LENGTH_ARB}, which can be queried with {@link #glGetObjectParameterivARB GetObjectParameterivARB}. If {@code obj} is not of type {@link #GL_SHADER_OBJECT_ARB SHADER_OBJECT_ARB}, the error + * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated. If an error occurred, the return parameters {@code length} and {@code source} will be unmodified.

+ * + * @param obj the shader object to query + */ + @NativeType("void") + public static String glGetShaderSourceARB(@NativeType("GLhandleARB") int obj) { + return glGetShaderSourceARB(obj, glGetObjectParameteriARB(obj, GL_OBJECT_SHADER_SOURCE_LENGTH_ARB)); + } + + /** Array version of: {@link #glShaderSourceARB ShaderSourceARB} */ + public static void glShaderSourceARB(@NativeType("GLhandleARB") int shaderObj, @NativeType("GLcharARB const **") PointerBuffer string, @Nullable @NativeType("GLint const *") int[] length) { + long __functionAddress = GL.getICD().glShaderSourceARB; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, string.remaining()); + } + callPPV(shaderObj, string.remaining(), memAddress(string), length, __functionAddress); + } + + /** Array version of: {@link #glUniform1fvARB Uniform1fvARB} */ + public static void glUniform1fvARB(@NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glUniform1fvARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length, value, __functionAddress); + } + + /** Array version of: {@link #glUniform2fvARB Uniform2fvARB} */ + public static void glUniform2fvARB(@NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glUniform2fvARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 1, value, __functionAddress); + } + + /** Array version of: {@link #glUniform3fvARB Uniform3fvARB} */ + public static void glUniform3fvARB(@NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glUniform3fvARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length / 3, value, __functionAddress); + } + + /** Array version of: {@link #glUniform4fvARB Uniform4fvARB} */ + public static void glUniform4fvARB(@NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glUniform4fvARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 2, value, __functionAddress); + } + + /** Array version of: {@link #glUniform1ivARB Uniform1ivARB} */ + public static void glUniform1ivARB(@NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + long __functionAddress = GL.getICD().glUniform1ivARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length, value, __functionAddress); + } + + /** Array version of: {@link #glUniform2ivARB Uniform2ivARB} */ + public static void glUniform2ivARB(@NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + long __functionAddress = GL.getICD().glUniform2ivARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 1, value, __functionAddress); + } + + /** Array version of: {@link #glUniform3ivARB Uniform3ivARB} */ + public static void glUniform3ivARB(@NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + long __functionAddress = GL.getICD().glUniform3ivARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length / 3, value, __functionAddress); + } + + /** Array version of: {@link #glUniform4ivARB Uniform4ivARB} */ + public static void glUniform4ivARB(@NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + long __functionAddress = GL.getICD().glUniform4ivARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 2, value, __functionAddress); + } + + /** Array version of: {@link #glUniformMatrix2fvARB UniformMatrix2fvARB} */ + public static void glUniformMatrix2fvARB(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glUniformMatrix2fvARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 2, transpose, value, __functionAddress); + } + + /** Array version of: {@link #glUniformMatrix3fvARB UniformMatrix3fvARB} */ + public static void glUniformMatrix3fvARB(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glUniformMatrix3fvARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length / 9, transpose, value, __functionAddress); + } + + /** Array version of: {@link #glUniformMatrix4fvARB UniformMatrix4fvARB} */ + public static void glUniformMatrix4fvARB(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glUniformMatrix4fvARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 4, transpose, value, __functionAddress); + } + + /** Array version of: {@link #glGetObjectParameterfvARB GetObjectParameterfvARB} */ + public static void glGetObjectParameterfvARB(@NativeType("GLhandleARB") int obj, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetObjectParameterfvARB; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(obj, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetObjectParameterivARB GetObjectParameterivARB} */ + public static void glGetObjectParameterivARB(@NativeType("GLhandleARB") int obj, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetObjectParameterivARB; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(obj, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetInfoLogARB GetInfoLogARB} */ + public static void glGetInfoLogARB(@NativeType("GLhandleARB") int obj, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLcharARB *") ByteBuffer infoLog) { + long __functionAddress = GL.getICD().glGetInfoLogARB; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + } + callPPV(obj, infoLog.remaining(), length, memAddress(infoLog), __functionAddress); + } + + /** Array version of: {@link #glGetAttachedObjectsARB GetAttachedObjectsARB} */ + public static void glGetAttachedObjectsARB(@NativeType("GLhandleARB") int containerObj, @Nullable @NativeType("GLsizei *") int[] count, @NativeType("GLhandleARB *") int[] obj) { + long __functionAddress = GL.getICD().glGetAttachedObjectsARB; + if (CHECKS) { + check(__functionAddress); + checkSafe(count, 1); + } + callPPV(containerObj, obj.length, count, obj, __functionAddress); + } + + /** Array version of: {@link #glGetActiveUniformARB GetActiveUniformARB} */ + public static void glGetActiveUniformARB(@NativeType("GLhandleARB") int programObj, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLint *") int[] size, @NativeType("GLenum *") int[] type, @NativeType("GLcharARB *") ByteBuffer name) { + long __functionAddress = GL.getICD().glGetActiveUniformARB; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + check(size, 1); + check(type, 1); + } + callPPPPV(programObj, index, name.remaining(), length, size, type, memAddress(name), __functionAddress); + } + + /** Array version of: {@link #glGetUniformfvARB GetUniformfvARB} */ + public static void glGetUniformfvARB(@NativeType("GLhandleARB") int programObj, @NativeType("GLint") int location, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetUniformfvARB; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(programObj, location, params, __functionAddress); + } + + /** Array version of: {@link #glGetUniformivARB GetUniformivARB} */ + public static void glGetUniformivARB(@NativeType("GLhandleARB") int programObj, @NativeType("GLint") int location, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetUniformivARB; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(programObj, location, params, __functionAddress); + } + + /** Array version of: {@link #glGetShaderSourceARB GetShaderSourceARB} */ + public static void glGetShaderSourceARB(@NativeType("GLhandleARB") int obj, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLcharARB *") ByteBuffer source) { + long __functionAddress = GL.getICD().glGetShaderSourceARB; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + } + callPPV(obj, source.remaining(), length, memAddress(source), __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShaderStorageBufferObject.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShaderStorageBufferObject.java new file mode 100644 index 00000000..9990a51d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShaderStorageBufferObject.java @@ -0,0 +1,96 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_shader_storage_buffer_object extension. + * + *

This extension provides the ability for OpenGL shaders to perform random access reads, writes, and atomic memory operations on variables stored in a + * buffer object. Application shader code can declare sets of variables (referred to as "buffer variables") arranged into interface blocks in a manner + * similar to that done with uniform blocks in OpenGL 3.1. In both cases, the values of the variables declared in a given interface block are taken from a + * buffer object bound to a binding point associated with the block. Buffer objects used in this extension are referred to as "shader storage buffers".

+ * + *

While the capability provided by this extension is similar to that provided by OpenGL 3.1 and {@link ARBUniformBufferObject ARB_uniform_buffer_object}, there are several + * significant differences. Most importantly, shader code is allowed to write to shader storage buffers, while uniform buffers are always read-only. Shader + * storage buffers have a separate set of binding points, with different counts and size limits. The maximum usable size for shader storage buffers is + * implementation-dependent, but its minimum value is substantially larger than the minimum for uniform buffers.

+ * + *

The ability to write to buffer objects creates the potential for multiple independent shader invocations to read and write the same underlying memory. + * The same issue exists with the {@link ARBShaderImageLoadStore ARB_shader_image_load_store} extension provided in OpenGL 4.2, which can write to texture objects and buffers. In + * both cases, the specification makes few guarantees related to the relative order of memory reads and writes performed by the shader invocations. For + * ARB_shader_image_load_store, the OpenGL API and shading language do provide some control over memory transactions; those mechanisms also affect reads + * and writes of shader storage buffers. In the OpenGL API, the {@link GL42C#glMemoryBarrier MemoryBarrier} call can be used to ensure that certain memory operations related to + * commands issued prior the barrier complete before other operations related to commands issued after the barrier. Additionally, the shading language + * provides the {@code memoryBarrier()} function to control the relative order of memory accesses within individual shader invocations and provides + * various memory qualifiers controlling how the memory corresponding to individual variables is accessed.

+ * + *

Requires {@link GL40 OpenGL 4.0} and {@link GL43 OpenGL 4.3} or {@link ARBProgramInterfaceQuery ARB_program_interface_query}. Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ +public class ARBShaderStorageBufferObject { + + /** Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, and GetBufferPointerv. */ + public static final int GL_SHADER_STORAGE_BUFFER = 0x90D2; + + /** + * Accepted by the {@code pname} parameter of GetIntegerv, GetIntegeri_v, GetBooleanv, GetInteger64v, GetFloatv, GetDoublev, GetBooleani_v, GetIntegeri_v, + * GetFloati_v, GetDoublei_v, and GetInteger64i_v. + */ + public static final int GL_SHADER_STORAGE_BUFFER_BINDING = 0x90D3; + + /** Accepted by the {@code pname} parameter of GetIntegeri_v, GetBooleani_v, GetIntegeri_v, GetFloati_v, GetDoublei_v, and GetInteger64i_v. */ + public static final int + GL_SHADER_STORAGE_BUFFER_START = 0x90D4, + GL_SHADER_STORAGE_BUFFER_SIZE = 0x90D5; + + /** Accepted by the {@code pname} parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS = 0x90D6, + GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS = 0x90D7, + GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS = 0x90D8, + GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS = 0x90D9, + GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS = 0x90DA, + GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS = 0x90DB, + GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS = 0x90DC, + GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS = 0x90DD, + GL_MAX_SHADER_STORAGE_BLOCK_SIZE = 0x90DE, + GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT = 0x90DF; + + /** Accepted in the {@code barriers} bitfield in glMemoryBarrier. */ + public static final int GL_SHADER_STORAGE_BARRIER_BIT = 0x2000; + + /** Also, add a new alias for the existing token MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS. */ + public static final int GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES = 0x8F39; + + static { GL.initialize(); } + + protected ARBShaderStorageBufferObject() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glShaderStorageBlockBinding + ); + } + + // --- [ glShaderStorageBlockBinding ] --- + + /** + * Changes an active shader storage block binding. + * + * @param program the name of the program containing the block whose binding to change + * @param storageBlockIndex the index storage block within the program + * @param storageBlockBinding the index storage block binding to associate with the specified storage block + */ + public static void glShaderStorageBlockBinding(@NativeType("GLuint") int program, @NativeType("GLuint") int storageBlockIndex, @NativeType("GLuint") int storageBlockBinding) { + GL43C.glShaderStorageBlockBinding(program, storageBlockIndex, storageBlockBinding); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShaderSubroutine.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShaderSubroutine.java new file mode 100644 index 00000000..37cf3f52 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShaderSubroutine.java @@ -0,0 +1,371 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_shader_subroutine extension. + * + *

This extension adds support to shaders for "indirect subroutine calls", where a single shader can include many subroutines and dynamically select + * through the API which subroutine is called from each call site. Switching subroutines dynamically in this fashion can avoid the cost of recompiling and + * managing multiple shaders, while still retaining most of the performance of specialized shaders.

+ * + *

Requires {@link ARBGPUShader5 ARB_gpu_shader5}. Promoted to core in {@link GL40 OpenGL 4.0}.

+ */ +public class ARBShaderSubroutine { + + /** Accepted by the {@code pname} parameter of GetProgramStageiv. */ + public static final int + GL_ACTIVE_SUBROUTINES = 0x8DE5, + GL_ACTIVE_SUBROUTINE_UNIFORMS = 0x8DE6, + GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS = 0x8E47, + GL_ACTIVE_SUBROUTINE_MAX_LENGTH = 0x8E48, + GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH = 0x8E49; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev, and GetInteger64v. */ + public static final int + GL_MAX_SUBROUTINES = 0x8DE7, + GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS = 0x8DE8; + + /** Accepted by the {@code pname} parameter of GetActiveSubroutineUniformiv. */ + public static final int + GL_NUM_COMPATIBLE_SUBROUTINES = 0x8E4A, + GL_COMPATIBLE_SUBROUTINES = 0x8E4B; + + static { GL.initialize(); } + + protected ARBShaderSubroutine() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glGetSubroutineUniformLocation, caps.glGetSubroutineIndex, caps.glGetActiveSubroutineUniformiv, caps.glGetActiveSubroutineUniformName, + caps.glGetActiveSubroutineName, caps.glUniformSubroutinesuiv, caps.glGetUniformSubroutineuiv, caps.glGetProgramStageiv + ); + } + + // --- [ glGetSubroutineUniformLocation ] --- + + /** Unsafe version of: {@link #glGetSubroutineUniformLocation GetSubroutineUniformLocation} */ + public static int nglGetSubroutineUniformLocation(int program, int shadertype, long name) { + return GL40C.nglGetSubroutineUniformLocation(program, shadertype, name); + } + + /** + * Retrieves the location of a subroutine uniform of a given shader stage within a program. + * + * @param program the name of the program containing shader stage + * @param shadertype the shader stage from which to query for subroutine uniform index. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param name the name of the subroutine uniform whose index to query. + */ + @NativeType("GLint") + public static int glGetSubroutineUniformLocation(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLchar const *") ByteBuffer name) { + return GL40C.glGetSubroutineUniformLocation(program, shadertype, name); + } + + /** + * Retrieves the location of a subroutine uniform of a given shader stage within a program. + * + * @param program the name of the program containing shader stage + * @param shadertype the shader stage from which to query for subroutine uniform index. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param name the name of the subroutine uniform whose index to query. + */ + @NativeType("GLint") + public static int glGetSubroutineUniformLocation(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLchar const *") CharSequence name) { + return GL40C.glGetSubroutineUniformLocation(program, shadertype, name); + } + + // --- [ glGetSubroutineIndex ] --- + + /** Unsafe version of: {@link #glGetSubroutineIndex GetSubroutineIndex} */ + public static int nglGetSubroutineIndex(int program, int shadertype, long name) { + return GL40C.nglGetSubroutineIndex(program, shadertype, name); + } + + /** + * Retrieves the index of a subroutine function of a given shader stage within a program. + * + * @param program the name of the program containing shader stage + * @param shadertype the shader stage from which to query for subroutine function index. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param name the name of the subroutine function whose index to query + */ + @NativeType("GLuint") + public static int glGetSubroutineIndex(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLchar const *") ByteBuffer name) { + return GL40C.glGetSubroutineIndex(program, shadertype, name); + } + + /** + * Retrieves the index of a subroutine function of a given shader stage within a program. + * + * @param program the name of the program containing shader stage + * @param shadertype the shader stage from which to query for subroutine function index. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param name the name of the subroutine function whose index to query + */ + @NativeType("GLuint") + public static int glGetSubroutineIndex(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLchar const *") CharSequence name) { + return GL40C.glGetSubroutineIndex(program, shadertype, name); + } + + // --- [ glGetActiveSubroutineUniformiv ] --- + + /** Unsafe version of: {@link #glGetActiveSubroutineUniformiv GetActiveSubroutineUniformiv} */ + public static void nglGetActiveSubroutineUniformiv(int program, int shadertype, int index, int pname, long values) { + GL40C.nglGetActiveSubroutineUniformiv(program, shadertype, index, pname, values); + } + + /** + * Queries a property of an active shader subroutine uniform. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query for the subroutine parameter. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + * @param pname the parameter of the shader subroutine uniform to query. One of:
{@link GL40C#GL_NUM_COMPATIBLE_SUBROUTINES NUM_COMPATIBLE_SUBROUTINES}{@link GL40C#GL_COMPATIBLE_SUBROUTINES COMPATIBLE_SUBROUTINES}{@link GL31#GL_UNIFORM_SIZE UNIFORM_SIZE}{@link GL31#GL_UNIFORM_NAME_LENGTH UNIFORM_NAME_LENGTH}
+ * @param values the address of a buffer into which the queried value or values will be placed + */ + public static void glGetActiveSubroutineUniformiv(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer values) { + GL40C.glGetActiveSubroutineUniformiv(program, shadertype, index, pname, values); + } + + /** + * Queries a property of an active shader subroutine uniform. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query for the subroutine parameter. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + * @param pname the parameter of the shader subroutine uniform to query. One of:
{@link GL40C#GL_NUM_COMPATIBLE_SUBROUTINES NUM_COMPATIBLE_SUBROUTINES}{@link GL40C#GL_COMPATIBLE_SUBROUTINES COMPATIBLE_SUBROUTINES}{@link GL31#GL_UNIFORM_SIZE UNIFORM_SIZE}{@link GL31#GL_UNIFORM_NAME_LENGTH UNIFORM_NAME_LENGTH}
+ */ + @NativeType("void") + public static int glGetActiveSubroutineUniformi(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + return GL40C.glGetActiveSubroutineUniformi(program, shadertype, index, pname); + } + + // --- [ glGetActiveSubroutineUniformName ] --- + + /** + * Unsafe version of: {@link #glGetActiveSubroutineUniformName GetActiveSubroutineUniformName} + * + * @param bufsize the size of the buffer whose address is given in {@code name} + */ + public static void nglGetActiveSubroutineUniformName(int program, int shadertype, int index, int bufsize, long length, long name) { + GL40C.nglGetActiveSubroutineUniformName(program, shadertype, index, bufsize, length, name); + } + + /** + * Queries the name of an active shader subroutine uniform. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query for the subroutine parameter. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + * @param length the address of a variable into which is written the number of characters copied into {@code name} + * @param name the address of a buffer that will receive the name of the specified shader subroutine uniform + */ + public static void glGetActiveSubroutineUniformName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer name) { + GL40C.glGetActiveSubroutineUniformName(program, shadertype, index, length, name); + } + + /** + * Queries the name of an active shader subroutine uniform. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query for the subroutine parameter. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + * @param bufsize the size of the buffer whose address is given in {@code name} + */ + @NativeType("void") + public static String glGetActiveSubroutineUniformName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @NativeType("GLsizei") int bufsize) { + return GL40C.glGetActiveSubroutineUniformName(program, shadertype, index, bufsize); + } + + /** + * Queries the name of an active shader subroutine uniform. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query for the subroutine parameter. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + */ + @NativeType("void") + public static String glGetActiveSubroutineUniformName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index) { + return glGetActiveSubroutineUniformName(program, shadertype, index, glGetActiveSubroutineUniformi(program, shadertype, index, GL31.GL_UNIFORM_NAME_LENGTH)); + } + + // --- [ glGetActiveSubroutineName ] --- + + /** + * Unsafe version of: {@link #glGetActiveSubroutineName GetActiveSubroutineName} + * + * @param bufsize the size of the buffer whose address is given in {@code name} + */ + public static void nglGetActiveSubroutineName(int program, int shadertype, int index, int bufsize, long length, long name) { + GL40C.nglGetActiveSubroutineName(program, shadertype, index, bufsize, length, name); + } + + /** + * Queries the name of an active shader subroutine. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query the subroutine name. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + * @param length a variable which is to receive the length of the shader subroutine uniform name + * @param name an array into which the name of the shader subroutine uniform will be written + */ + public static void glGetActiveSubroutineName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer name) { + GL40C.glGetActiveSubroutineName(program, shadertype, index, length, name); + } + + /** + * Queries the name of an active shader subroutine. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query the subroutine name. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + * @param bufsize the size of the buffer whose address is given in {@code name} + */ + @NativeType("void") + public static String glGetActiveSubroutineName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @NativeType("GLsizei") int bufsize) { + return GL40C.glGetActiveSubroutineName(program, shadertype, index, bufsize); + } + + /** + * Queries the name of an active shader subroutine. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query the subroutine name. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + */ + @NativeType("void") + public static String glGetActiveSubroutineName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index) { + return glGetActiveSubroutineName(program, shadertype, index, glGetProgramStagei(program, shadertype, GL_ACTIVE_SUBROUTINE_MAX_LENGTH)); + } + + // --- [ glUniformSubroutinesuiv ] --- + + /** + * Unsafe version of: {@link #glUniformSubroutinesuiv UniformSubroutinesuiv} + * + * @param count the number of uniform indices stored in {@code indices} + */ + public static void nglUniformSubroutinesuiv(int shadertype, int count, long indices) { + GL40C.nglUniformSubroutinesuiv(shadertype, count, indices); + } + + /** + * Loads active subroutine uniforms. + * + * @param shadertype the shader stage to update. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param indices an array holding the indices to load into the shader subroutine variables + */ + public static void glUniformSubroutinesuiv(@NativeType("GLenum") int shadertype, @NativeType("GLuint const *") IntBuffer indices) { + GL40C.glUniformSubroutinesuiv(shadertype, indices); + } + + /** + * Loads active subroutine uniforms. + * + * @param shadertype the shader stage to update. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ */ + public static void glUniformSubroutinesui(@NativeType("GLenum") int shadertype, @NativeType("GLuint const *") int index) { + GL40C.glUniformSubroutinesui(shadertype, index); + } + + // --- [ glGetUniformSubroutineuiv ] --- + + /** Unsafe version of: {@link #glGetUniformSubroutineuiv GetUniformSubroutineuiv} */ + public static void nglGetUniformSubroutineuiv(int shadertype, int location, long params) { + GL40C.nglGetUniformSubroutineuiv(shadertype, location, params); + } + + /** + * Retrieves the value of a subroutine uniform of a given shader stage of the current program. + * + * @param shadertype the shader stage from which to query for subroutine uniform index. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param location the location of the subroutine uniform + * @param params a variable to receive the value or values of the subroutine uniform + */ + public static void glGetUniformSubroutineuiv(@NativeType("GLenum") int shadertype, @NativeType("GLint") int location, @NativeType("GLuint *") IntBuffer params) { + GL40C.glGetUniformSubroutineuiv(shadertype, location, params); + } + + /** + * Retrieves the value of a subroutine uniform of a given shader stage of the current program. + * + * @param shadertype the shader stage from which to query for subroutine uniform index. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param location the location of the subroutine uniform + */ + @NativeType("void") + public static int glGetUniformSubroutineui(@NativeType("GLenum") int shadertype, @NativeType("GLint") int location) { + return GL40C.glGetUniformSubroutineui(shadertype, location); + } + + // --- [ glGetProgramStageiv ] --- + + /** Unsafe version of: {@link #glGetProgramStageiv GetProgramStageiv} */ + public static void nglGetProgramStageiv(int program, int shadertype, int pname, long values) { + GL40C.nglGetProgramStageiv(program, shadertype, pname, values); + } + + /** + * Retrieves properties of a program object corresponding to a specified shader stage. + * + * @param program the name of the program containing shader stage + * @param shadertype the shader stage from which to query for the subroutine parameter. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param pname the parameter of the shader to query. One of:
{@link GL40C#GL_ACTIVE_SUBROUTINES ACTIVE_SUBROUTINES}{@link GL40C#GL_ACTIVE_SUBROUTINE_UNIFORMS ACTIVE_SUBROUTINE_UNIFORMS}
{@link GL40C#GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS}{@link GL40C#GL_ACTIVE_SUBROUTINE_MAX_LENGTH ACTIVE_SUBROUTINE_MAX_LENGTH}
{@link GL40C#GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH}
+ * @param values a variable into which the queried value or values will be placed + */ + public static void glGetProgramStageiv(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer values) { + GL40C.glGetProgramStageiv(program, shadertype, pname, values); + } + + /** + * Retrieves properties of a program object corresponding to a specified shader stage. + * + * @param program the name of the program containing shader stage + * @param shadertype the shader stage from which to query for the subroutine parameter. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param pname the parameter of the shader to query. One of:
{@link GL40C#GL_ACTIVE_SUBROUTINES ACTIVE_SUBROUTINES}{@link GL40C#GL_ACTIVE_SUBROUTINE_UNIFORMS ACTIVE_SUBROUTINE_UNIFORMS}
{@link GL40C#GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS}{@link GL40C#GL_ACTIVE_SUBROUTINE_MAX_LENGTH ACTIVE_SUBROUTINE_MAX_LENGTH}
{@link GL40C#GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH}
+ */ + @NativeType("void") + public static int glGetProgramStagei(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLenum") int pname) { + return GL40C.glGetProgramStagei(program, shadertype, pname); + } + + /** Array version of: {@link #glGetActiveSubroutineUniformiv GetActiveSubroutineUniformiv} */ + public static void glGetActiveSubroutineUniformiv(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] values) { + GL40C.glGetActiveSubroutineUniformiv(program, shadertype, index, pname, values); + } + + /** Array version of: {@link #glGetActiveSubroutineUniformName GetActiveSubroutineUniformName} */ + public static void glGetActiveSubroutineUniformName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer name) { + GL40C.glGetActiveSubroutineUniformName(program, shadertype, index, length, name); + } + + /** Array version of: {@link #glGetActiveSubroutineName GetActiveSubroutineName} */ + public static void glGetActiveSubroutineName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer name) { + GL40C.glGetActiveSubroutineName(program, shadertype, index, length, name); + } + + /** Array version of: {@link #glUniformSubroutinesuiv UniformSubroutinesuiv} */ + public static void glUniformSubroutinesuiv(@NativeType("GLenum") int shadertype, @NativeType("GLuint const *") int[] indices) { + GL40C.glUniformSubroutinesuiv(shadertype, indices); + } + + /** Array version of: {@link #glGetUniformSubroutineuiv GetUniformSubroutineuiv} */ + public static void glGetUniformSubroutineuiv(@NativeType("GLenum") int shadertype, @NativeType("GLint") int location, @NativeType("GLuint *") int[] params) { + GL40C.glGetUniformSubroutineuiv(shadertype, location, params); + } + + /** Array version of: {@link #glGetProgramStageiv GetProgramStageiv} */ + public static void glGetProgramStageiv(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] values) { + GL40C.glGetProgramStageiv(program, shadertype, pname, values); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShadingLanguage100.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShadingLanguage100.java new file mode 100644 index 00000000..76f92510 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShadingLanguage100.java @@ -0,0 +1,22 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_shading_language_100 extension. + * + *

This extension indicates that the OpenGL Shading Language is supported.

+ * + *

Requires {@link ARBShaderObjects ARB_shader_objects}, {@link ARBFragmentShader ARB_fragment_shader} and {@link ARBVertexShader ARB_vertex_shader}. Promoted to core in {@link GL20 OpenGL 2.0}.

+ */ +public final class ARBShadingLanguage100 { + + /** Accepted by the {@code name} parameter of GetString. */ + public static final int GL_SHADING_LANGUAGE_VERSION_ARB = 0x8B8C; + + private ARBShadingLanguage100() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShadingLanguageInclude.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShadingLanguageInclude.java new file mode 100644 index 00000000..babedfb7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShadingLanguageInclude.java @@ -0,0 +1,446 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_shading_language_include extension. + * + *

This extension introduces a {@code #include} GLSL directive to allow reusing the same shader text in multiple shaders and defines the semantics and syntax of + * the names allowed in {@code #include} directives. It also defines API mechanisms to define the named string backing a {@code #include}.

+ * + *

Introduction

+ * + *

The GLSL {@code #include} mechanism looks up paths in a tree built through the OpenGL API. This appendix describes the syntax and semantic model of the tree and + * paths into the tree. How the tree is used is up to users of the tree, like the OpenGL API or GLSL.

+ * + *

The Tree

+ * + *

The tree is a singly rooted hierarchy of tree locations. The root may have one or more child locations, and any location may in turn have its own + * children. Except for the root, each location has exactly one parent; the root has no parent.

+ * + *

Paths into the Tree

+ * + *

The locations in the tree are created or looked up by path strings. The path string "/" locates the root of the tree. The path "/foo" locates the child + * "foo" of the root. Formally, a valid path is a sequence of tokens delimited by the beginning of the string, by the path-separator forward slash ( / ), + * and by the end of the string. The string "foo/bar" has two tokens; "foo" and "bar". The string "/foo/./bar" has 3 tokens; "foo", ".", and "bar". The + * string "/foo/.." has two tokens; "foo" and "..". The string "/foo/.bar" has two tokens; "foo" and ".bar". A path is invalid if

+ * + *
    + *
  • {@code path} contains any characters not listed in Section 3.1 "Character Set", or the double quote character, or angled brackets, or any white + * space characters other than the space character.
  • + *
  • {@code path} has consecutive forward slashes ( // ); "/foo//bar" is not valid (zero length tokens are not allowed).
  • + *
  • {@code path} ends with a forward slash ( / )
  • + *
  • {@code path} contains no characters.
  • + *
+ * + *

There are no path escape characters, so there is no way to get the forward slash delimiter within a single token.

+ * + *

When using a path to lookup a tree location, the path tokens are used to walk the tree. The initial location to start the walk is specified by the user + * of the tree and is updated as follows by the tokens in the path. (Paths starting with "/" will start at the root.) Taken left to right:

+ * + *

The token ".." walks to the parent. Or, if already at the root, then the location remains at the root.

+ * + *

The token "." leaves the location unchanged.

+ * + *

Any other token is considered the name of a child of the current location, and walks to that child. (If there is no child of that name, this may result + * in a failed lookup or in the child being created, as specified by the user of the tree for the operation being performed.)

+ * + *

Associated Strings

+ * + *

Each location in the tree can have an additional string associated with it (that a user like the {@code #include} mechanism can use as an included string). This + * is true even for locations that have children: "/foo/bar" can exist in the tree at the same time that "/foo" has an additional string associated with + * it. Typically, when a path is used to find a location in the tree, it is for the purpose of returning this associated string.

+ * + *

Hence, the tree can be built from a collection of (path,string) pairs, where path is a string establishing the existence of a location in the tree and + * string is the string associated with the node. Details of how to do this are specified by the user of the tree.

+ * + *

Requires GLSL 1.10.

+ */ +public class ARBShadingLanguageInclude { + + /** Accepted by the {@code type} parameter of NamedStringARB. */ + public static final int GL_SHADER_INCLUDE_ARB = 0x8DAE; + + /** Accepted by the {@code pname} parameter of GetNamedStringivARB. */ + public static final int + GL_NAMED_STRING_LENGTH_ARB = 0x8DE9, + GL_NAMED_STRING_TYPE_ARB = 0x8DEA; + + static { GL.initialize(); } + + protected ARBShadingLanguageInclude() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glNamedStringARB, caps.glDeleteNamedStringARB, caps.glCompileShaderIncludeARB, caps.glIsNamedStringARB, caps.glGetNamedStringARB, + caps.glGetNamedStringivARB + ); + } + + // --- [ glNamedStringARB ] --- + + /** + * Unsafe version of: {@link #glNamedStringARB NamedStringARB} + * + * @param namelen the number of characters in {@code name}. If negative, {@code name} is considered to be a null-terminated string. + * @param stringlen the number of characters in {@code string}. If negative, {@code string} is considered to be a null-terminated string. + */ + public static native void nglNamedStringARB(int type, int namelen, long name, int stringlen, long string); + + /** + * Specifies a string and its name. Such strings can be included by name in shaders during compilation, allowing reuse of the same code segments. + * + *

After calling NamedStringARB, the contents of {@code string} are associated with the tree location corresponding to {@code name}. If a string is already + * associated with that tree location, it will be replaced with the new {@code string}.

+ * + * @param type the string type. Must be:
{@link #GL_SHADER_INCLUDE_ARB SHADER_INCLUDE_ARB}
+ * @param name the name associated with the string + * @param string an arbitrary string of characters + */ + public static void glNamedStringARB(@NativeType("GLenum") int type, @NativeType("GLchar const *") ByteBuffer name, @NativeType("GLchar const *") ByteBuffer string) { + nglNamedStringARB(type, name.remaining(), memAddress(name), string.remaining(), memAddress(string)); + } + + /** + * Specifies a string and its name. Such strings can be included by name in shaders during compilation, allowing reuse of the same code segments. + * + *

After calling NamedStringARB, the contents of {@code string} are associated with the tree location corresponding to {@code name}. If a string is already + * associated with that tree location, it will be replaced with the new {@code string}.

+ * + * @param type the string type. Must be:
{@link #GL_SHADER_INCLUDE_ARB SHADER_INCLUDE_ARB}
+ * @param name the name associated with the string + * @param string an arbitrary string of characters + */ + public static void glNamedStringARB(@NativeType("GLenum") int type, @NativeType("GLchar const *") CharSequence name, @NativeType("GLchar const *") CharSequence string) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + int nameEncodedLength = stack.nASCII(name, false); + long nameEncoded = stack.getPointerAddress(); + int stringEncodedLength = stack.nUTF8(string, false); + long stringEncoded = stack.getPointerAddress(); + nglNamedStringARB(type, nameEncodedLength, nameEncoded, stringEncodedLength, stringEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glDeleteNamedStringARB ] --- + + /** + * Unsafe version of: {@link #glDeleteNamedStringARB DeleteNamedStringARB} + * + * @param namelen the number of characters in {@code name}. If negative, {@code name} is considered to be a null-terminated string. + */ + public static native void nglDeleteNamedStringARB(int namelen, long name); + + /** + * Deletes a named string. + * + * @param name the name associated with the string + */ + public static void glDeleteNamedStringARB(@NativeType("GLchar const *") ByteBuffer name) { + nglDeleteNamedStringARB(name.remaining(), memAddress(name)); + } + + /** + * Deletes a named string. + * + * @param name the name associated with the string + */ + public static void glDeleteNamedStringARB(@NativeType("GLchar const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + int nameEncodedLength = stack.nASCII(name, false); + long nameEncoded = stack.getPointerAddress(); + nglDeleteNamedStringARB(nameEncodedLength, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glCompileShaderIncludeARB ] --- + + /** Unsafe version of: {@link #glCompileShaderIncludeARB CompileShaderIncludeARB} */ + public static native void nglCompileShaderIncludeARB(int shader, int count, long path, long length); + + /** + * Compiles a shader object. + * + *

The ordered list of {@code path}s is used during compilation, together with the arguments of {@code #include} directives in the shader source, to search for + * named strings corresponding to the {@code #include} directives. If a {@code #include} directive does not correspond to a valid named string, compilation will fail.

+ * + * @param shader the shader object compile + * @param path an ordered array of {@code count} pointers to optionally null-terminated character strings defining search paths + * @param length an array {@code count} values with the number of characters in each string (the string length). If an element in {@code length} is negative, its + * accompanying string is null-terminated. If {@code length} is {@code NULL}, all strings in the {@code path} argument are considered null-terminated. + */ + public static void glCompileShaderIncludeARB(@NativeType("GLuint") int shader, @NativeType("GLchar const * const *") PointerBuffer path, @Nullable @NativeType("GLint const *") IntBuffer length) { + if (CHECKS) { + checkSafe(length, path.remaining()); + } + nglCompileShaderIncludeARB(shader, path.remaining(), memAddress(path), memAddressSafe(length)); + } + + // --- [ glIsNamedStringARB ] --- + + /** + * Unsafe version of: {@link #glIsNamedStringARB IsNamedStringARB} + * + * @param namelen the number of characters in {@code name}. If negative, {@code name} is considered to be a null-terminated string. + */ + public static native boolean nglIsNamedStringARB(int namelen, long name); + + /** + * Returns {@link GL11#GL_TRUE TRUE} if the tree location corresponding to {@code name} has a string associated with it, and {@link GL11#GL_FALSE FALSE} if the tree location has no string + * associated with it. + * + * @param name the name associated with the string + */ + @NativeType("GLboolean") + public static boolean glIsNamedStringARB(@NativeType("GLchar const *") ByteBuffer name) { + return nglIsNamedStringARB(name.remaining(), memAddress(name)); + } + + /** + * Returns {@link GL11#GL_TRUE TRUE} if the tree location corresponding to {@code name} has a string associated with it, and {@link GL11#GL_FALSE FALSE} if the tree location has no string + * associated with it. + * + * @param name the name associated with the string + */ + @NativeType("GLboolean") + public static boolean glIsNamedStringARB(@NativeType("GLchar const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + int nameEncodedLength = stack.nASCII(name, false); + long nameEncoded = stack.getPointerAddress(); + return nglIsNamedStringARB(nameEncodedLength, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetNamedStringARB ] --- + + /** + * Unsafe version of: {@link #glGetNamedStringARB GetNamedStringARB} + * + * @param namelen the number of characters in {@code name}. If negative, {@code name} is considered to be a null-terminated string. + * @param bufSize the maximum number of characters that may be written into {@code string}, including the null terminator + */ + public static native void nglGetNamedStringARB(int namelen, long name, int bufSize, long stringlen, long string); + + /** + * Returns in {@code string} the string corresponding to the specified {@code name}. The returned string will be null-terminated. + * + * @param name the name associated with the string + * @param stringlen a buffer in which to place the actual number of characters written into {@code string}, excluding the null terminator. If {@code NULL}, no length is + * returned. + * @param string a buffer in which to place the returned string + */ + public static void glGetNamedStringARB(@NativeType("GLchar const *") ByteBuffer name, @Nullable @NativeType("GLint *") IntBuffer stringlen, @NativeType("GLchar *") ByteBuffer string) { + if (CHECKS) { + checkSafe(stringlen, 1); + } + nglGetNamedStringARB(name.remaining(), memAddress(name), string.remaining(), memAddressSafe(stringlen), memAddress(string)); + } + + /** + * Returns in {@code string} the string corresponding to the specified {@code name}. The returned string will be null-terminated. + * + * @param name the name associated with the string + * @param stringlen a buffer in which to place the actual number of characters written into {@code string}, excluding the null terminator. If {@code NULL}, no length is + * returned. + * @param string a buffer in which to place the returned string + */ + public static void glGetNamedStringARB(@NativeType("GLchar const *") CharSequence name, @Nullable @NativeType("GLint *") IntBuffer stringlen, @NativeType("GLchar *") ByteBuffer string) { + if (CHECKS) { + checkSafe(stringlen, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + int nameEncodedLength = stack.nASCII(name, false); + long nameEncoded = stack.getPointerAddress(); + nglGetNamedStringARB(nameEncodedLength, nameEncoded, string.remaining(), memAddressSafe(stringlen), memAddress(string)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Returns in {@code string} the string corresponding to the specified {@code name}. The returned string will be null-terminated. + * + * @param name the name associated with the string + * @param bufSize the maximum number of characters that may be written into {@code string}, including the null terminator + */ + @NativeType("void") + public static String glGetNamedStringARB(@NativeType("GLchar const *") CharSequence name, @NativeType("GLsizei") int bufSize) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + int nameEncodedLength = stack.nASCII(name, false); + long nameEncoded = stack.getPointerAddress(); + IntBuffer stringlen = stack.ints(0); + ByteBuffer string = stack.malloc(bufSize); + nglGetNamedStringARB(nameEncodedLength, nameEncoded, bufSize, memAddress(stringlen), memAddress(string)); + return memUTF8(string, stringlen.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Returns in {@code string} the string corresponding to the specified {@code name}. The returned string will be null-terminated. + * + * @param name the name associated with the string + */ + @NativeType("void") + public static String glGetNamedStringARB(@NativeType("GLchar const *") CharSequence name) { + return glGetNamedStringARB(name, glGetNamedStringiARB(name, GL_NAMED_STRING_LENGTH_ARB)); + } + + // --- [ glGetNamedStringivARB ] --- + + /** + * Unsafe version of: {@link #glGetNamedStringivARB GetNamedStringivARB} + * + * @param namelen the number of characters in {@code name}. If negative, {@code name} is considered to be a null-terminated string. + */ + public static native void nglGetNamedStringivARB(int namelen, long name, int pname, long params); + + /** + * Returns properties of the named string whose tree location corresponds to {@code name}. + * + * @param name the name associated with the string + * @param pname the parameter to query. One of:
{@link #GL_NAMED_STRING_LENGTH_ARB NAMED_STRING_LENGTH_ARB}{@link #GL_NAMED_STRING_TYPE_ARB NAMED_STRING_TYPE_ARB}
+ * @param params a buffer in which to place the returned value + */ + public static void glGetNamedStringivARB(@NativeType("GLchar const *") ByteBuffer name, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetNamedStringivARB(name.remaining(), memAddress(name), pname, memAddress(params)); + } + + /** + * Returns properties of the named string whose tree location corresponds to {@code name}. + * + * @param name the name associated with the string + * @param pname the parameter to query. One of:
{@link #GL_NAMED_STRING_LENGTH_ARB NAMED_STRING_LENGTH_ARB}{@link #GL_NAMED_STRING_TYPE_ARB NAMED_STRING_TYPE_ARB}
+ * @param params a buffer in which to place the returned value + */ + public static void glGetNamedStringivARB(@NativeType("GLchar const *") CharSequence name, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + int nameEncodedLength = stack.nASCII(name, false); + long nameEncoded = stack.getPointerAddress(); + nglGetNamedStringivARB(nameEncodedLength, nameEncoded, pname, memAddress(params)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Returns properties of the named string whose tree location corresponds to {@code name}. + * + * @param name the name associated with the string + * @param pname the parameter to query. One of:
{@link #GL_NAMED_STRING_LENGTH_ARB NAMED_STRING_LENGTH_ARB}{@link #GL_NAMED_STRING_TYPE_ARB NAMED_STRING_TYPE_ARB}
+ */ + @NativeType("void") + public static int glGetNamedStringiARB(@NativeType("GLchar const *") CharSequence name, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + int nameEncodedLength = stack.nASCII(name, false); + long nameEncoded = stack.getPointerAddress(); + IntBuffer params = stack.callocInt(1); + nglGetNamedStringivARB(nameEncodedLength, nameEncoded, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #glCompileShaderIncludeARB CompileShaderIncludeARB} */ + public static void glCompileShaderIncludeARB(@NativeType("GLuint") int shader, @NativeType("GLchar const * const *") PointerBuffer path, @Nullable @NativeType("GLint const *") int[] length) { + long __functionAddress = GL.getICD().glCompileShaderIncludeARB; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, path.remaining()); + } + callPPV(shader, path.remaining(), memAddress(path), length, __functionAddress); + } + + /** Array version of: {@link #glGetNamedStringARB GetNamedStringARB} */ + public static void glGetNamedStringARB(@NativeType("GLchar const *") ByteBuffer name, @Nullable @NativeType("GLint *") int[] stringlen, @NativeType("GLchar *") ByteBuffer string) { + long __functionAddress = GL.getICD().glGetNamedStringARB; + if (CHECKS) { + check(__functionAddress); + checkSafe(stringlen, 1); + } + callPPPV(name.remaining(), memAddress(name), string.remaining(), stringlen, memAddress(string), __functionAddress); + } + + /** Array version of: {@link #glGetNamedStringARB GetNamedStringARB} */ + public static void glGetNamedStringARB(@NativeType("GLchar const *") CharSequence name, @Nullable @NativeType("GLint *") int[] stringlen, @NativeType("GLchar *") ByteBuffer string) { + long __functionAddress = GL.getICD().glGetNamedStringARB; + if (CHECKS) { + check(__functionAddress); + checkSafe(stringlen, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + int nameEncodedLength = stack.nASCII(name, false); + long nameEncoded = stack.getPointerAddress(); + callPPPV(nameEncodedLength, nameEncoded, string.remaining(), stringlen, memAddress(string), __functionAddress); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #glGetNamedStringivARB GetNamedStringivARB} */ + public static void glGetNamedStringivARB(@NativeType("GLchar const *") ByteBuffer name, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetNamedStringivARB; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPPV(name.remaining(), memAddress(name), pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetNamedStringivARB GetNamedStringivARB} */ + public static void glGetNamedStringivARB(@NativeType("GLchar const *") CharSequence name, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetNamedStringivARB; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + int nameEncodedLength = stack.nASCII(name, false); + long nameEncoded = stack.getPointerAddress(); + callPPV(nameEncodedLength, nameEncoded, pname, params, __functionAddress); + } finally { + stack.setPointer(stackPointer); + } + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShadow.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShadow.java new file mode 100644 index 00000000..8378d48e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShadow.java @@ -0,0 +1,33 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_shadow extension. + * + *

This extension supports comparing the texture R coordinate to a depth texture value in order to produce a boolean texture value. This can be used to + * implement shadow maps.

+ * + *

The extension is written in generic terms such that other texture comparison modes can be accommodated in the future.

+ * + *

Requires {@link ARBDepthTexture ARB_depth_texture}. Promoted to core in {@link GL14 OpenGL 1.4}.

+ */ +public final class ARBShadow { + + /** Accepted by the {@code pname} parameter of TexParameterf, TexParameteri, TexParameterfv, TexParameteriv, GetTexParameterfv, and GetTexParameteriv. */ + public static final int + GL_TEXTURE_COMPARE_MODE_ARB = 0x884C, + GL_TEXTURE_COMPARE_FUNC_ARB = 0x884D; + + /** + * Accepted by the {@code param} parameter of TexParameterf, TexParameteri, TexParameterfv, and TexParameteriv when the {@code pname} parameter is + * TEXTURE_COMPARE_MODE_ARB. + */ + public static final int GL_COMPARE_R_TO_TEXTURE_ARB = 0x884E; + + private ARBShadow() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShadowAmbient.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShadowAmbient.java new file mode 100644 index 00000000..4c97165a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBShadowAmbient.java @@ -0,0 +1,24 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_shadow_ambient extension. + * + *

This extension allows the user to specify the texture value to use when the texture compare function fails. Normally this value is zero. By allowing an + * arbitrary value we can get functionality which otherwise requires an advanced texture combine extension (such as + * NV_register_combiners) and multiple texture units.

+ * + *

Requires {@link ARBShadow ARB_shadow} and {@link ARBDepthTexture ARB_depth_texture}.

+ */ +public final class ARBShadowAmbient { + + /** Accepted by the {@code pname} parameter of TexParameterf, TexParameteri, TexParameterfv, TexParameteriv, GetTexParameterfv, and GetTexParameteriv. */ + public static final int GL_TEXTURE_COMPARE_FAIL_VALUE_ARB = 0x80BF; + + private ARBShadowAmbient() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSparseBuffer.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSparseBuffer.java new file mode 100644 index 00000000..249c5f78 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSparseBuffer.java @@ -0,0 +1,79 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_sparse_buffer extension. + * + *

This extension adds to GL a mechanism to decouple the virtual and physical storage requirements of textures and allows an application + * to create partially populated textures that would over-subscribe available graphics memory if made fully resident. This extension provides like + * functionality for buffer objects, allowing applications to manage buffer object storage in a similar manner.

+ * + *

Requires {@link GL15 OpenGL 1.5} or {@link ARBVertexBufferObject ARB_vertex_buffer_object}.

+ */ +public class ARBSparseBuffer { + + /** Accepted as part of the {@code flags} parameter to {@link GL44C#glBufferStorage BufferStorage}. */ + public static final int GL_SPARSE_STORAGE_BIT_ARB = 0x400; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetFloatv, GetIntegerv, and GetInteger64v. */ + public static final int GL_SPARSE_BUFFER_PAGE_SIZE_ARB = 0x82F8; + + static { GL.initialize(); } + + protected ARBSparseBuffer() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glBufferPageCommitmentARB + ); + } + + // --- [ glBufferPageCommitmentARB ] --- + + /** + * Commit and de-commits regions of sparse buffer storage. + * + * @param target buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the region offset. Must be an integer multiple of the implementation dependent constant {@link #GL_SPARSE_BUFFER_PAGE_SIZE_ARB SPARSE_BUFFER_PAGE_SIZE_ARB}. + * @param size the data size. must either be a multiple of {@link #GL_SPARSE_BUFFER_PAGE_SIZE_ARB SPARSE_BUFFER_PAGE_SIZE_ARB}, or extend to the end of the buffer's data store. + * @param commit If true, then pages contained in the specified range become committed and become physically backed. If false, then physical storage associated with + * the data store in the specified region may be freed and those pages become uncommitted. Newly committed pages have undefined content. However, + * redundantly committing pages does not alter their content. + */ + public static native void glBufferPageCommitmentARB(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLboolean") boolean commit); + + // --- [ glNamedBufferPageCommitmentEXT ] --- + + /** + * Direct-state-access version of {@link #glBufferPageCommitmentARB BufferPageCommitmentARB}. + * + * @param buffer the buffer object + * @param offset the region offset. Must be an integer multiple of the implementation dependent constant {@link #GL_SPARSE_BUFFER_PAGE_SIZE_ARB SPARSE_BUFFER_PAGE_SIZE_ARB}. + * @param size the data size. must either be a multiple of {@link #GL_SPARSE_BUFFER_PAGE_SIZE_ARB SPARSE_BUFFER_PAGE_SIZE_ARB}, or extend to the end of the buffer's data store. + * @param commit the commit state + */ + public static native void glNamedBufferPageCommitmentEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLboolean") boolean commit); + + // --- [ glNamedBufferPageCommitmentARB ] --- + + /** + * Direct-state-access version of {@link #glBufferPageCommitmentARB BufferPageCommitmentARB}. + * + * @param buffer the buffer object + * @param offset the region offset. Must be an integer multiple of the implementation dependent constant {@link #GL_SPARSE_BUFFER_PAGE_SIZE_ARB SPARSE_BUFFER_PAGE_SIZE_ARB}. + * @param size the data size. must either be a multiple of {@link #GL_SPARSE_BUFFER_PAGE_SIZE_ARB SPARSE_BUFFER_PAGE_SIZE_ARB}, or extend to the end of the buffer's data store. + * @param commit the commit state + */ + public static native void glNamedBufferPageCommitmentARB(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLboolean") boolean commit); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSparseTexture.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSparseTexture.java new file mode 100644 index 00000000..1040aec9 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSparseTexture.java @@ -0,0 +1,156 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_sparse_texture extension. + * + *

Recent advances in application complexity and a desire for higher resolutions have pushed texture sizes up considerably. Often, the amount of physical + * memory available to a graphics processor is a limiting factor in the performance of texture-heavy applications. Once the available physical memory is + * exhausted, paging may occur bringing performance down considerably - or worse, the application may fail. Nevertheless, the amount of address space + * available to the graphics processor has increased to the point where many gigabytes - or even terabytes of address space may be usable even though that + * amount of physical memory is not present.

+ * + *

This extension allows the separation of the graphics processor's address space (reservation) from the requirement that all textures must be physically + * backed (commitment). This exposes a limited form of virtualization for textures. Use cases include sparse (or partially resident) textures, texture + * paging, on-demand and delayed loading of texture assets and application controlled level of detail.

+ */ +public class ARBSparseTexture { + + /** Accepted by the {@code pname} parameter to TexParameter{i f}{v}, TexParameterI{u}v, GetTexParameter{if}v and GetTexParameterIi{u}v. */ + public static final int + GL_TEXTURE_SPARSE_ARB = 0x91A6, + GL_VIRTUAL_PAGE_SIZE_INDEX_ARB = 0x91A7; + + /** Accepted by the {@code pname} parameter of GetTexParameter{if}v and GetTexParameterIi{u}v. */ + public static final int GL_NUM_SPARSE_LEVELS_ARB = 0x91AA; + + /** Accepted by the {@code pname} parameter to GetInternalformativ. */ + public static final int + GL_NUM_VIRTUAL_PAGE_SIZES_ARB = 0x91A8, + GL_VIRTUAL_PAGE_SIZE_X_ARB = 0x9195, + GL_VIRTUAL_PAGE_SIZE_Y_ARB = 0x9196, + GL_VIRTUAL_PAGE_SIZE_Z_ARB = 0x9197; + + /** Accepted by the {@code pname} parameter to GetIntegerv, GetFloatv, GetDoublev, GetInteger64v, and GetBooleanv. */ + public static final int + GL_MAX_SPARSE_TEXTURE_SIZE_ARB = 0x9198, + GL_MAX_SPARSE_3D_TEXTURE_SIZE_ARB = 0x9199, + GL_MAX_SPARSE_ARRAY_TEXTURE_LAYERS_ARB = 0x919A, + GL_SPARSE_TEXTURE_FULL_ARRAY_CUBE_MIPMAPS_ARB = 0x91A9; + + static { GL.initialize(); } + + protected ARBSparseTexture() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glTexPageCommitmentARB, ext.contains("GL_EXT_direct_state_access") ? caps.glTexturePageCommitmentEXT : -1L + ); + } + + // --- [ glTexPageCommitmentARB ] --- + + /** + * Makes individual pages of a sparse texture resident or non resident. + * + *

If the value of {@code commit} is {@link GL11#GL_TRUE TRUE}, then the texture pages contained in the region defined by the values of {@code xoffset}, {@code yoffset}, + * {@code zoffset}, {@code width}, {@code height} and {@code depth} are committed. If they were not committed before the call, then new physical backing + * store is allocated and associated with the sparse pages and their initial content is undefined. If the pages were already committed, then they remain + * committed, no error is generated, and the content of those pages remains unmodified. If the value of {@code committed} is {@link GL11#GL_FALSE FALSE}, then the texture + * pages contained in the region are made de-committed. Their physical store is de-allocated, and their contents again become undefined.

+ * + *

For the purposes of commitment, a cube map texture is treated as a 2D array texture with a depth of six and cube map array textures are treated as 2D + * array textures with a depth equal to six times the number of layers in the cube map array.

+ * + *

For levels of a sparse texture where each dimension is a multiple of the virtual page size, the residency of individual page-size regions is controlled + * by TexPageCommitmentARB and such levels may be partially populated. When the mipmap chain reaches a level that is not an integer multiple of the virtual + * page size in any dimension, padding and memory layout considerations may make it impossible to treat that level and subsequent smaller ones as partially + * populated. The set of levels that can be partially populated is implementation-dependent. The total number of levels that may be partially populated may + * be queried by calling {@link GL11C#glGetTexParameteriv GetTexParameteriv} with the {@code pname} {@link #GL_NUM_SPARSE_LEVELS_ARB NUM_SPARSE_LEVELS_ARB}.

+ * + *

The collection of texture levels that may not be partially populated, if any, consists of levels {@link #GL_NUM_SPARSE_LEVELS_ARB NUM_SPARSE_LEVELS_ARB} and higher, and is referred to + * as the mipmap 'tail'. The levels comprising the tail are made resident or non-resident as a unit. The tail is resident if and only if + * TexPageCommitmentARB has been called successfully with {@code level} greater than or equal to {@link #GL_NUM_SPARSE_LEVELS_ARB NUM_SPARSE_LEVELS_ARB} and the value of {@code commit} was + * {@link GL11#GL_TRUE TRUE} for the last such call.

+ * + *

Views of sparse textures are also considered sparse. Modifications to commitment of a texture via a view of it affect the parent texture and any other + * views containing the modified pages. If a view of a sparse texture references its tail (or is entirely contained within it), modifications to commitment + * of the tail via the view will affect the entire tail of the parent, even for parts of the tail that are not referenced by the view. Furthermore, + * modifications to tail commitment may affect views referencing other parts of the tail.

+ * + *
Errors
+ * + *

An {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} error is generated if {@code xoffset} + {@code width} or {@code yoffset} + {@code height} is greater than the width or height, + * respectively, of level {@code level} of the texture bound to {@code target}.

+ * + *

An {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} error is generated if {@code zoffset} + {@code depth} is greater than

+ * + *
    + *
  • the depth of level {@code level} of the texture bound to {@code target}, if {@code target} is {@link GL12#GL_TEXTURE_3D TEXTURE_3D};
  • + *
  • the number of layers of level {@code level} of the texture bound to {@code target}, if {@code target} is {@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY};
  • + *
  • six times the number of layers of level {@code level} of the texture bound to {@code target}, if {@code target} is {@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}; or
  • + *
  • one, for all other targets.
  • + *
+ * + *

An {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error is generated if {@code xoffset}, {@code yoffset}, or {@code zoffset} is not a multiple of {@link #GL_VIRTUAL_PAGE_SIZE_X_ARB VIRTUAL_PAGE_SIZE_X_ARB}, + * {@link #GL_VIRTUAL_PAGE_SIZE_Y_ARB VIRTUAL_PAGE_SIZE_Y_ARB}, or {@link #GL_VIRTUAL_PAGE_SIZE_Z_ARB VIRTUAL_PAGE_SIZE_Z_ARB}, respectively, of the texture bound to {@code target}.

+ * + *

An {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} error is generated if {@code width} is not an integer multiple of {@link #GL_VIRTUAL_PAGE_SIZE_X_ARB VIRTUAL_PAGE_SIZE_X_ARB} and {@code width} plus + * {@code xoffset} is not equal to the width of level {@code level} of the texture bound to {@code target}.

+ * + *

An {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} error is generated if {@code height} is not an integer multiple of {@link #GL_VIRTUAL_PAGE_SIZE_Y_ARB VIRTUAL_PAGE_SIZE_Y_ARB} and {@code height} plus + * {@code yoffset} is not equal to the height of level {@code level} of the texture bound to {@code target}.

+ * + *

An {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} error is generated if {@code depth} is not an integer multiple of {@link #GL_VIRTUAL_PAGE_SIZE_Z_ARB VIRTUAL_PAGE_SIZE_Z_ARB} and {@code depth} plus + * {@code zoffset} is not equal to

+ * + *
    + *
  • the depth of level {@code level} of the texture bound to {@code target}, if {@code target} is TEXTURE_3D;
  • + *
  • the number of layers of level {@code level} of the texture bound to {@code target}, if {@code target} is TEXTURE_2D_ARRAY;
  • + *
  • six times the number of layers of level {@code level} of the texture bound to {@code target}, if {@code target} is TEXTURE_CUBE_MAP_ARRAY; or
  • + *
  • one, for all other targets.
  • + *
+ * + *

An {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} error is generated if the value of {@link GL42#GL_TEXTURE_IMMUTABLE_FORMAT TEXTURE_IMMUTABLE_FORMAT} or {@link #GL_TEXTURE_SPARSE_ARB TEXTURE_SPARSE_ARB} for the texture bound to + * {@code target} is {@link GL11#GL_FALSE FALSE}.

+ * + * @param target the texture target. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param commit the commit flag + */ + public static native void glTexPageCommitmentARB(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLboolean") boolean commit); + + // --- [ glTexturePageCommitmentEXT ] --- + + /** + * DSA version of {@link #glTexPageCommitmentARB TexPageCommitmentARB}. + * + * @param texture the texture object + * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param commit the commit flag + */ + public static native void glTexturePageCommitmentEXT(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLboolean") boolean commit); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBStencilTexturing.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBStencilTexturing.java new file mode 100644 index 00000000..b9bc785b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBStencilTexturing.java @@ -0,0 +1,24 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_stencil_texturing extension. + * + *

This extension allows texturing of the stencil component of a packed depth stencil texture. Stencil values are returned as unsigned integers. It is not + * possible to sample both depth and stencil values from the same texture, and this extension allows the app to select which is sampled for the bound + * texture.

+ * + *

Requires {@link ARBDepthTexture ARB_depth_texture} and {@link EXTPackedDepthStencil EXT_packed_depth_stencil}. Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ +public final class ARBStencilTexturing { + + /** Accepted by the {@code pname} parameter of TexParameter and GetTexParameter*. */ + public static final int GL_DEPTH_STENCIL_TEXTURE_MODE = 0x90EA; + + private ARBStencilTexturing() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSync.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSync.java new file mode 100644 index 00000000..e69adb1b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBSync.java @@ -0,0 +1,253 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_sync extension. + * + *

This extension introduces the concept of "sync objects". Sync objects are a synchronization primitive - a representation of events whose completion + * status can be tested or waited upon. One specific type of sync object, the "fence sync object", is supported in this extension, and additional types can + * easily be added in the future.

+ * + *

Fence sync objects have corresponding fences, which are inserted into the OpenGL command stream at the time the sync object is created. A sync object + * can be queried for a given condition. The only condition supported for fence sync objects is completion of the corresponding fence command. Fence + * completion allows applications to request a partial Finish, wherein all commands prior to the fence will be forced to complete before control is + * returned to the calling process.

+ * + *

These new mechanisms allow for synchronization between the host CPU and the GPU, which may be accessing the same resources (typically memory), as well + * as between multiple GL contexts bound to multiple threads in the host CPU.

+ * + *

Requires {@link GL31 OpenGL 3.1}. Promoted to core in {@link GL32 OpenGL 3.2}.

+ */ +public class ARBSync { + + /** Accepted as the {@code pname} parameter of GetInteger64v. */ + public static final int GL_MAX_SERVER_WAIT_TIMEOUT = 0x9111; + + /** Accepted as the {@code pname} parameter of GetSynciv. */ + public static final int + GL_OBJECT_TYPE = 0x9112, + GL_SYNC_CONDITION = 0x9113, + GL_SYNC_STATUS = 0x9114, + GL_SYNC_FLAGS = 0x9115; + + /** Returned in {@code values} for GetSynciv {@code pname} OBJECT_TYPE. */ + public static final int GL_SYNC_FENCE = 0x9116; + + /** Returned in {@code values} for GetSynciv {@code pname} SYNC_CONDITION. */ + public static final int GL_SYNC_GPU_COMMANDS_COMPLETE = 0x9117; + + /** Returned in {@code values} for GetSynciv {@code pname} SYNC_STATUS. */ + public static final int + GL_UNSIGNALED = 0x9118, + GL_SIGNALED = 0x9119; + + /** Accepted in the {@code flags} parameter of ClientWaitSync. */ + public static final int GL_SYNC_FLUSH_COMMANDS_BIT = 0x1; + + /** Accepted in the {@code timeout} parameter of WaitSync. */ + public static final long GL_TIMEOUT_IGNORED = 0xFFFFFFFFFFFFFFFFL; + + /** Returned by ClientWaitSync. */ + public static final int + GL_ALREADY_SIGNALED = 0x911A, + GL_TIMEOUT_EXPIRED = 0x911B, + GL_CONDITION_SATISFIED = 0x911C, + GL_WAIT_FAILED = 0x911D; + + static { GL.initialize(); } + + protected ARBSync() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glFenceSync, caps.glIsSync, caps.glDeleteSync, caps.glClientWaitSync, caps.glWaitSync, caps.glGetInteger64v, caps.glGetSynciv + ); + } + + // --- [ glFenceSync ] --- + + /** + * Creates a new sync object and inserts it into the GL command stream. + * + * @param condition the condition that must be met to set the sync object's state to signaled. Must be:
{@link GL32C#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE}
+ * @param flags a bitwise combination of flags controlling the behavior of the sync object. No flags are presently defined for this operation and {@code flags} must + * be zero. + */ + @NativeType("GLsync") + public static long glFenceSync(@NativeType("GLenum") int condition, @NativeType("GLbitfield") int flags) { + return GL32C.glFenceSync(condition, flags); + } + + // --- [ glIsSync ] --- + + /** Unsafe version of: {@link #glIsSync IsSync} */ + public static boolean nglIsSync(long sync) { + return GL32C.nglIsSync(sync); + } + + /** + * Determines if a name corresponds to a sync object. + * + * @param sync a value that may be the name of a sync object + */ + @NativeType("GLboolean") + public static boolean glIsSync(@NativeType("GLsync") long sync) { + return GL32C.glIsSync(sync); + } + + // --- [ glDeleteSync ] --- + + /** Unsafe version of: {@link #glDeleteSync DeleteSync} */ + public static void nglDeleteSync(long sync) { + GL32C.nglDeleteSync(sync); + } + + /** + * Deletes a sync object. + * + * @param sync the sync object to be deleted + */ + public static void glDeleteSync(@NativeType("GLsync") long sync) { + GL32C.glDeleteSync(sync); + } + + // --- [ glClientWaitSync ] --- + + /** Unsafe version of: {@link #glClientWaitSync ClientWaitSync} */ + public static int nglClientWaitSync(long sync, int flags, long timeout) { + return GL32C.nglClientWaitSync(sync, flags, timeout); + } + + /** + * Causes the client to block and wait for a sync object to become signaled. If {@code sync} is signaled when {@code glClientWaitSync} is called, + * {@code glClientWaitSync} returns immediately, otherwise it will block and wait for up to timeout nanoseconds for {@code sync} to become signaled. + * + *

The return value is one of four status values:

+ * + *
    + *
  • {@link GL32C#GL_ALREADY_SIGNALED ALREADY_SIGNALED} indicates that sync was signaled at the time that glClientWaitSync was called.
  • + *
  • {@link GL32C#GL_TIMEOUT_EXPIRED TIMEOUT_EXPIRED} indicates that at least timeout nanoseconds passed and sync did not become signaled.
  • + *
  • {@link GL32C#GL_CONDITION_SATISFIED CONDITION_SATISFIED} indicates that sync was signaled before the timeout expired.
  • + *
  • {@link GL32C#GL_WAIT_FAILED WAIT_FAILED} indicates that an error occurred. Additionally, an OpenGL error will be generated.
  • + *
+ * + * @param sync the sync object whose status to wait on + * @param flags a bitfield controlling the command flushing behavior. One or more of:
0{@link GL32C#GL_SYNC_FLUSH_COMMANDS_BIT SYNC_FLUSH_COMMANDS_BIT}
+ * @param timeout the timeout, specified in nanoseconds, for which the implementation should wait for {@code sync} to become signaled + */ + @NativeType("GLenum") + public static int glClientWaitSync(@NativeType("GLsync") long sync, @NativeType("GLbitfield") int flags, @NativeType("GLuint64") long timeout) { + return GL32C.glClientWaitSync(sync, flags, timeout); + } + + // --- [ glWaitSync ] --- + + /** Unsafe version of: {@link #glWaitSync WaitSync} */ + public static void nglWaitSync(long sync, int flags, long timeout) { + GL32C.nglWaitSync(sync, flags, timeout); + } + + /** + * Causes the GL server to block and wait for a sync object to become signaled. + * + *

{@code glWaitSync} will always wait no longer than an implementation-dependent timeout. The duration of this timeout in nanoseconds may be queried by + * with {@link GL32C#GL_MAX_SERVER_WAIT_TIMEOUT MAX_SERVER_WAIT_TIMEOUT}. There is currently no way to determine whether glWaitSync unblocked because the timeout expired or because the + * sync object being waited on was signaled.

+ * + *

If an error occurs, {@code glWaitSync} does not cause the GL server to block.

+ * + * @param sync the sync object whose status to wait on + * @param flags a bitfield controlling the command flushing behavior. Must be:
0
+ * @param timeout the timeout that the server should wait before continuing. Must be:
{@link GL32C#GL_TIMEOUT_IGNORED TIMEOUT_IGNORED}
+ */ + public static void glWaitSync(@NativeType("GLsync") long sync, @NativeType("GLbitfield") int flags, @NativeType("GLuint64") long timeout) { + GL32C.glWaitSync(sync, flags, timeout); + } + + // --- [ glGetInteger64v ] --- + + /** Unsafe version of: {@link #glGetInteger64v GetInteger64v} */ + public static void nglGetInteger64v(int pname, long params) { + GL32C.nglGetInteger64v(pname, params); + } + + /** + * Returns the 64bit integer value or values of a selected parameter. + * + * @param pname the parameter value to be returned + * @param params the value or values of the specified parameter + */ + public static void glGetInteger64v(@NativeType("GLenum") int pname, @NativeType("GLint64 *") LongBuffer params) { + GL32C.glGetInteger64v(pname, params); + } + + /** + * Returns the 64bit integer value or values of a selected parameter. + * + * @param pname the parameter value to be returned + */ + @NativeType("void") + public static long glGetInteger64(@NativeType("GLenum") int pname) { + return GL32C.glGetInteger64(pname); + } + + // --- [ glGetSynciv ] --- + + /** + * Unsafe version of: {@link #glGetSynciv GetSynciv} + * + * @param bufSize the size of the buffer whose address is given in {@code values} + */ + public static void nglGetSynciv(long sync, int pname, int bufSize, long length, long values) { + GL32C.nglGetSynciv(sync, pname, bufSize, length, values); + } + + /** + * Queries the properties of a sync object. + * + * @param sync the sync object whose properties to query + * @param pname the parameter whose value to retrieve from the sync object specified in {@code sync}. One of:
{@link GL32C#GL_OBJECT_TYPE OBJECT_TYPE}{@link GL32C#GL_SYNC_CONDITION SYNC_CONDITION}{@link GL32C#GL_SYNC_STATUS SYNC_STATUS}{@link GL32C#GL_SYNC_FLAGS SYNC_FLAGS}
+ * @param length the address of an variable to receive the number of integers placed in {@code values} + * @param values the address of an array to receive the values of the queried parameter + */ + public static void glGetSynciv(@NativeType("GLsync") long sync, @NativeType("GLenum") int pname, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLint *") IntBuffer values) { + GL32C.glGetSynciv(sync, pname, length, values); + } + + /** + * Queries the properties of a sync object. + * + * @param sync the sync object whose properties to query + * @param pname the parameter whose value to retrieve from the sync object specified in {@code sync}. One of:
{@link GL32C#GL_OBJECT_TYPE OBJECT_TYPE}{@link GL32C#GL_SYNC_CONDITION SYNC_CONDITION}{@link GL32C#GL_SYNC_STATUS SYNC_STATUS}{@link GL32C#GL_SYNC_FLAGS SYNC_FLAGS}
+ * @param length the address of an variable to receive the number of integers placed in {@code values} + */ + @NativeType("void") + public static int glGetSynci(@NativeType("GLsync") long sync, @NativeType("GLenum") int pname, @Nullable @NativeType("GLsizei *") IntBuffer length) { + return GL32C.glGetSynci(sync, pname, length); + } + + /** Array version of: {@link #glGetInteger64v GetInteger64v} */ + public static void glGetInteger64v(@NativeType("GLenum") int pname, @NativeType("GLint64 *") long[] params) { + GL32C.glGetInteger64v(pname, params); + } + + /** Array version of: {@link #glGetSynciv GetSynciv} */ + public static void glGetSynciv(@NativeType("GLsync") long sync, @NativeType("GLenum") int pname, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLint *") int[] values) { + GL32C.glGetSynciv(sync, pname, length, values); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTessellationShader.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTessellationShader.java new file mode 100644 index 00000000..5aa5c12a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTessellationShader.java @@ -0,0 +1,159 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_tessellation_shader extension. + * + *

This extension introduces new tessellation stages and two new shader types to the OpenGL primitive processing pipeline. These pipeline stages operate on + * a new basic primitive type, called a patch. A patch consists of a fixed-size collection of vertices, each with per-vertex attributes, plus a number of + * associated per-patch attributes. Tessellation control shaders transform an input patch specified by the application, computing per-vertex and per-patch + * attributes for a new output patch. A fixed-function tessellation primitive generator subdivides the patch, and tessellation evaluation shaders are used + * to compute the position and attributes of each vertex produced by the tessellator.

+ * + *

When tessellation is active, it begins by running the optional tessellation control shader. This shader consumes an input patch and produces a new + * fixed-size output patch. The output patch consists of an array of vertices, and a set of per-patch attributes. The per-patch attributes include + * tessellation levels that control how finely the patch will be tessellated. For each patch processed, multiple tessellation control shader invocations + * are performed -- one per output patch vertex. Each tessellation control shader invocation writes all the attributes of its corresponding output patch + * vertex. A tessellation control shader may also read the per-vertex outputs of other tessellation control shader invocations, as well as read and write + * shared per-patch outputs. The tessellation control shader invocations for a single patch effectively run as a group. A built-in {@code barrier()} + * function is provided to allow synchronization points where no shader invocation will continue until all shader invocations have reached the barrier.

+ * + *

The tessellation primitive generator then decomposes a patch into a new set of primitives using the tessellation levels to determine how finely + * tessellated the output should be. The primitive generator begins with either a triangle or a quad, and splits each outer edge of the primitive into a + * number of segments approximately equal to the corresponding element of the outer tessellation level array. The interior of the primitive is tessellated + * according to elements of the inner tessellation level array. The primitive generator has three modes: "triangles" and "quads" split a triangular or + * quad-shaped patch into a set of triangles that cover the original patch; "isolines" splits a quad-shaped patch into a set of line strips running across + * the patch horizontally. Each vertex generated by the tessellation primitive generator is assigned a (u,v) or (u,v,w) coordinate indicating its relative + * location in the subdivided triangle or quad.

+ * + *

For each vertex produced by the tessellation primitive generator, the tessellation evaluation shader is run to compute its position and other attributes + * of the vertex, using its (u,v) or (u,v,w) coordinate. When computing final vertex attributes, the tessellation evaluation shader can also read the + * attributes of any of the vertices of the patch written by the tessellation control shader. Tessellation evaluation shader invocations are completely + * independent, although all invocations for a single patch share the same collection of input vertices and per-patch attributes.

+ * + *

The tessellator operates on vertices after they have been transformed by a vertex shader. The primitives generated by the tessellator are passed further + * down the OpenGL pipeline, where they can be used as inputs to geometry shaders, transform feedback, and the rasterizer.

+ * + *

The tessellation control and evaluation shaders are both optional. If neither shader type is present, the tessellation stage has no effect. If no + * tessellation control shader is present, the input patch provided by the application is passed directly to the tessellation primitive generator, and a + * set of default tessellation level parameters is used to control primitive generation. In this extension, patches may not be passed beyond the + * tessellation evaluation shader, and an error is generated if an application provides patches and the current program object contains no tessellation + * evaluation shader.

+ * + *

Requires {@link GL32 GL32} and GLSL 1.50. Promoted to core in {@link GL40 OpenGL 4.0}.

+ */ +public class ARBTessellationShader { + + /** Accepted by the {@code mode} parameter of Begin and all vertex array functions that implicitly call Begin. */ + public static final int GL_PATCHES = 0xE; + + /** Accepted by the {@code pname} parameter of PatchParameteri, GetBooleanv, GetDoublev, GetFloatv, GetIntegerv, and GetInteger64v. */ + public static final int GL_PATCH_VERTICES = 0x8E72; + + /** Accepted by the {@code pname} parameter of PatchParameterfv, GetBooleanv, GetDoublev, GetFloatv, and GetIntegerv, and GetInteger64v. */ + public static final int + GL_PATCH_DEFAULT_INNER_LEVEL = 0x8E73, + GL_PATCH_DEFAULT_OUTER_LEVEL = 0x8E74; + + /** Accepted by the {@code pname} parameter of GetProgramiv. */ + public static final int + GL_TESS_CONTROL_OUTPUT_VERTICES = 0x8E75, + GL_TESS_GEN_MODE = 0x8E76, + GL_TESS_GEN_SPACING = 0x8E77, + GL_TESS_GEN_VERTEX_ORDER = 0x8E78, + GL_TESS_GEN_POINT_MODE = 0x8E79; + + /** Returned by GetProgramiv when {@code pname} is TESS_GEN_MODE. */ + public static final int GL_ISOLINES = 0x8E7A; + + /** Returned by GetProgramiv when {@code pname} is TESS_GEN_SPACING. */ + public static final int + GL_FRACTIONAL_ODD = 0x8E7B, + GL_FRACTIONAL_EVEN = 0x8E7C; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetFloatv, GetIntegerv, and GetInteger64v. */ + public static final int + GL_MAX_PATCH_VERTICES = 0x8E7D, + GL_MAX_TESS_GEN_LEVEL = 0x8E7E, + GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E7F, + GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E80, + GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS = 0x8E81, + GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS = 0x8E82, + GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS = 0x8E83, + GL_MAX_TESS_PATCH_COMPONENTS = 0x8E84, + GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS = 0x8E85, + GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS = 0x8E86, + GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS = 0x8E89, + GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS = 0x8E8A, + GL_MAX_TESS_CONTROL_INPUT_COMPONENTS = 0x886C, + GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS = 0x886D, + GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E1E, + GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E1F; + + /** Accepted by the {@code pname} parameter of GetActiveUniformBlockiv. */ + public static final int + GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER = 0x84F0, + GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x84F1; + + /** Accepted by the {@code type} parameter of CreateShader and returned by the {@code params} parameter of GetShaderiv. */ + public static final int + GL_TESS_EVALUATION_SHADER = 0x8E87, + GL_TESS_CONTROL_SHADER = 0x8E88; + + static { GL.initialize(); } + + protected ARBTessellationShader() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glPatchParameteri, caps.glPatchParameterfv + ); + } + + // --- [ glPatchParameteri ] --- + + /** + * Specifies the integer value of the specified parameter for patch primitives. + * + * @param pname the name of the parameter to set. Must be:
{@link GL40C#GL_PATCH_VERTICES PATCH_VERTICES}
+ * @param value the new value for the parameter given by {@code pname} + */ + public static void glPatchParameteri(@NativeType("GLenum") int pname, @NativeType("GLint") int value) { + GL40C.glPatchParameteri(pname, value); + } + + // --- [ glPatchParameterfv ] --- + + /** Unsafe version of: {@link #glPatchParameterfv PatchParameterfv} */ + public static void nglPatchParameterfv(int pname, long values) { + GL40C.nglPatchParameterfv(pname, values); + } + + /** + * Specifies an array of float values for the specified parameter for patch primitives. + * + * @param pname the name of the parameter to set. One of:
{@link GL40C#GL_PATCH_DEFAULT_OUTER_LEVEL PATCH_DEFAULT_OUTER_LEVEL}{@link GL40C#GL_PATCH_DEFAULT_INNER_LEVEL PATCH_DEFAULT_INNER_LEVEL}
+ * @param values an array containing the new values for the parameter given by {@code pname} + */ + public static void glPatchParameterfv(@NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer values) { + GL40C.glPatchParameterfv(pname, values); + } + + /** Array version of: {@link #glPatchParameterfv PatchParameterfv} */ + public static void glPatchParameterfv(@NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] values) { + GL40C.glPatchParameterfv(pname, values); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureBarrier.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureBarrier.java new file mode 100644 index 00000000..b53e8c9e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureBarrier.java @@ -0,0 +1,40 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_texture_barrier extension. + * + *

This extension relaxes the restrictions on rendering to a currently bound texture and provides a mechanism to avoid read-after-write hazards.

+ * + *

Promoted to core in {@link GL45 OpenGL 4.5}.

+ */ +public class ARBTextureBarrier { + + static { GL.initialize(); } + + protected ARBTextureBarrier() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glTextureBarrier + ); + } + + // --- [ glTextureBarrier ] --- + + /** Guarantees that writes have completed and caches have been invalidated before subsequent Draws are executed. */ + public static void glTextureBarrier() { + GL45C.glTextureBarrier(); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureBorderClamp.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureBorderClamp.java new file mode 100644 index 00000000..e5c1ec5d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureBorderClamp.java @@ -0,0 +1,31 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_texture_border_clamp extension. + * + *

The base OpenGL provides clamping such that the texture coordinates are limited to exactly the range [0,1]. When a texture coordinate is clamped using + * this algorithm, the texture sampling filter straddles the edge of the texture image, taking 1/2 its sample values from within the texture image, and the + * other 1/2 from the texture border. It is sometimes desirable for a texture to be clamped to the border color, rather than to an average of the border + * and edge colors.

+ * + *

This extension defines an additional texture clamping algorithm. {@link #GL_CLAMP_TO_BORDER_ARB CLAMP_TO_BORDER_ARB} clamps texture coordinates at all mipmap levels such that + * {@link GL11#GL_NEAREST NEAREST} and {@link GL11#GL_LINEAR LINEAR} filters return only the color of the border texels.

+ * + *

Promoted to core in {@link GL13 OpenGL 1.3}.

+ */ +public final class ARBTextureBorderClamp { + + /** + * Accepted by the {@code param} parameter of {@link GL11C#glTexParameteri TexParameteri} and {@link GL11C#glTexParameterf TexParameterf}, and by the {@code params} parameter of {@link GL11C#glTexParameteriv TexParameteriv} + * and {@link GL11C#glTexParameterfv TexParameterfv}, when their {@code pname} parameter is {@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}, {@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}, or {@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}. + */ + public static final int GL_CLAMP_TO_BORDER_ARB = 0x812D; + + private ARBTextureBorderClamp() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureBufferObject.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureBufferObject.java new file mode 100644 index 00000000..f4ee6c8c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureBufferObject.java @@ -0,0 +1,94 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_texture_buffer_object extension. + * + *

This extension provides a new texture type, called a buffer texture. Buffer textures are one-dimensional arrays of texels whose storage comes from an + * attached buffer object. When a buffer object is bound to a buffer texture, a format is specified, and the data in the buffer object is treated as an + * array of texels of the specified format.

+ * + *

The use of a buffer object to provide storage allows the texture data to be specified in a number of different ways: via buffer object loads + * ({@link GL15C#glBufferData BufferData}), direct CPU writes ({@link GL15C#glMapBuffer MapBuffer}), framebuffer readbacks (EXT_pixel_buffer_object extension). A buffer object can also be loaded + * by transform feedback (NV_transform_feedback extension), which captures selected transformed attributes of vertices processed by the GL. Several of + * these mechanisms do not require an extra data copy, which would be required when using conventional TexImage-like entry points.

+ * + *

Buffer textures do not support mipmapping, texture lookups with normalized floating-point texture coordinates, and texture filtering of any sort, and + * may not be used in fixed-function fragment processing. They can be accessed via single texel fetch operations in programmable shaders. For assembly + * shaders (NV_gpu_program4), the TXF instruction is used. For GLSL (EXT_gpu_shader4), a new sampler type and texel fetch function are used.

+ * + *

While buffer textures can be substantially larger than equivalent one-dimensional textures; the maximum texture size supported for buffer textures in + * the initial implementation of this extension is 2^27 texels, versus 2^13 (8192) texels for otherwise equivalent one-dimensional textures. When a buffer + * object is attached to a buffer texture, a size is not specified; rather, the number of texels in the texture is taken by dividing the size of the buffer + * object by the size of each texel.

+ * + *

Requires {@link GL20 OpenGL 2.0} and NV_gpu_program4 or {@link EXTGPUShader4 EXT_gpu_shader4}. Promoted to core in {@link GL31 OpenGL 3.1}.

+ */ +public class ARBTextureBufferObject { + + /** + * Accepted by the {@code target} parameter of BindBuffer, BufferData, BufferSubData, MapBuffer, MapBufferRangeARB, BindTexture, UnmapBuffer, + * GetBufferSubData, GetBufferParameteriv, GetBufferPointerv, and TexBufferARB, and the {@code pname} parameter of GetBooleanv, GetDoublev, GetFloatv, and + * GetIntegerv. + */ + public static final int GL_TEXTURE_BUFFER_ARB = 0x8C2A; + + /** Accepted by the {@code pname} parameters of GetBooleanv, GetDoublev, GetFloatv, and GetIntegerv. */ + public static final int + GL_MAX_TEXTURE_BUFFER_SIZE_ARB = 0x8C2B, + GL_TEXTURE_BINDING_BUFFER_ARB = 0x8C2C, + GL_TEXTURE_BUFFER_DATA_STORE_BINDING_ARB = 0x8C2D, + GL_TEXTURE_BUFFER_FORMAT_ARB = 0x8C2E; + + static { GL.initialize(); } + + protected ARBTextureBufferObject() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glTexBufferARB + ); + } + + // --- [ glTexBufferARB ] --- + + /** + * Attaches the storage for the buffer object named {@code buffer} to the active buffer texture, and specifies an internal format for the texel array found + * in the attached buffer object. If {@code buffer} is zero, any buffer object attached to the buffer texture is detached, and no new buffer object is + * attached. If {@code buffer} is non-zero, but is not the name of an existing buffer object, the error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated. + * + *

When a buffer object is attached to a buffer texture, the buffer object's data store is taken as the texture's texel array. The number of texels in the + * buffer texture's texel array is given by

+ * + *

{@code floor(buffer_size / (components * sizeof(base_type))},

+ * + *

where {@code buffer_size} is the size of the buffer object, in basic machine units and {@code components} and {@code base_type} are the element count + * and base data type for elements. The number of texels in the texel array is then clamped to the implementation-dependent limit + * {@link #GL_MAX_TEXTURE_BUFFER_SIZE_ARB MAX_TEXTURE_BUFFER_SIZE_ARB}. When a buffer texture is accessed in a shader, the results of a texel fetch are undefined if the specified texel number is + * greater than or equal to the clamped number of texels in the texel array.

+ * + *

When a buffer texture is accessed in a shader, an integer is provided to indicate the texel number being accessed. If no buffer object is bound to the + * buffer texture, the results of the texel access are undefined. Otherwise, the attached buffer object's data store is interpreted as an array of elements + * of the GL data type corresponding to {@code internalformat}. Each texel consists of one to four elements that are mapped to texture components + * (R, G, B, A, L, and I). Element {@code m} of the texel numbered {@code n} is taken from element {@code n} * {@code components} + {@code m} of the + * attached buffer object's data store. Elements and texels are both numbered starting with zero. For texture formats with normalized components, the + * extracted values are converted to floating-point values. The components of the texture are then converted to an (R,G,B,A) vector, and returned to the + * shader as a four-component result vector with components of the appropriate data type for the texture's internal format.

+ * + * @param target the target of the operation. Must be:
{@link #GL_TEXTURE_BUFFER_ARB TEXTURE_BUFFER_ARB}
+ * @param internalformat the sized internal format of the data in the store belonging to {@code buffer} + * @param buffer the name of the buffer object whose storage to attach to the active buffer texture + */ + public static native void glTexBufferARB(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLuint") int buffer); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureBufferRange.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureBufferRange.java new file mode 100644 index 00000000..db84a2ba --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureBufferRange.java @@ -0,0 +1,73 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_texture_buffer_range extension. + * + *

{@link ARBTextureBufferObject ARB_texture_buffer_object} (which was promoted to core in OpenGL 3.1) introduced the ability to attach the data store of a buffer object to a buffer + * texture and access it from shaders. The extension only allows the entire store of the buffer object to the texture. This extension expands on this and + * allows a sub-range of the buffer's data store to be attached to a texture. This can be used, for example, to allow multiple buffer textures to be backed + * by independent sub-ranges of the same buffer object, or for different sub-ranges of a single buffer object to be used for different purposes.

+ * + *

Requires {@link GL15 OpenGL 1.5}. Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ +public class ARBTextureBufferRange { + + /** Accepted by the {@code pname} parameter of GetTexLevelParameter. */ + public static final int + GL_TEXTURE_BUFFER_OFFSET = 0x919D, + GL_TEXTURE_BUFFER_SIZE = 0x919E; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT = 0x919F; + + static { GL.initialize(); } + + protected ARBTextureBufferRange() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glTexBufferRange, ext.contains("GL_EXT_direct_state_access") ? caps.glTextureBufferRangeEXT : -1L + ); + } + + // --- [ glTexBufferRange ] --- + + /** + * Binds a range of a buffer's data store to a buffer texture. + * + * @param target the target of the operation. Must be:
{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}
+ * @param internalformat the internal format of the data in the store belonging to {@code buffer} + * @param buffer the name of the buffer object whose storage to attach to the active buffer texture + * @param offset the offset of the start of the range of the buffer's data store to attach + * @param size the size of the range of the buffer's data store to attach + */ + public static void glTexBufferRange(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size) { + GL43C.glTexBufferRange(target, internalformat, buffer, offset, size); + } + + // --- [ glTextureBufferRangeEXT ] --- + + /** + * DSA version of {@link #glTexBufferRange TexBufferRange}. + * + * @param texture the texture object + * @param target the target of the operation. Must be:
{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}
+ * @param internalformat the internal format of the data in the store belonging to {@code buffer} + * @param buffer the name of the buffer object whose storage to attach to the active buffer texture + * @param offset the offset of the start of the range of the buffer's data store to attach + * @param size the size of the range of the buffer's data store to attach + */ + public static native void glTextureBufferRangeEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureCompression.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureCompression.java new file mode 100644 index 00000000..37ac7d01 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureCompression.java @@ -0,0 +1,352 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_texture_compression extension. + * + *

Compressing texture images can reduce texture memory utilization and improve performance when rendering textured primitives. This extension allows + * OpenGL applications to use compressed texture images by providing:

+ * + *
    + *
  1. A framework upon which extensions providing specific compressed image formats can be built.
  2. + *
  3. A set of generic compressed internal formats that allow applications to specify that texture images should be stored in compressed form without + * needing to code for specific compression formats.
  4. + *
+ * + *

An application can define compressed texture images by providing a texture image stored in a specific compressed image format. This extension does not + * define any specific compressed image formats, but it does provide the mechanisms necessary to enable other extensions that do.

+ * + *

An application can also define compressed texture images by providing an uncompressed texture image but specifying a compressed internal format. In this + * case, the GL will automatically compress the texture image using the appropriate image format. Compressed internal formats can either be specific (as + * above) or generic. Generic compressed internal formats are not actual image formats, but are instead mapped into one of the specific compressed formats + * provided by the GL (or to an uncompressed base internal format if no appropriate compressed format is available). Generic compressed internal formats + * allow applications to use texture compression without needing to code to any particular compression algorithm. Generic compressed formats allow the use + * of texture compression across a wide range of platforms with differing compression algorithms and also allow future GL implementations to substitute + * improved compression methods transparently.

+ * + *

Promoted to core in {@link GL13 OpenGL 1.3}.

+ */ +public class ARBTextureCompression { + + /** Accepted by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, and CopyTexImage2D. */ + public static final int + GL_COMPRESSED_ALPHA_ARB = 0x84E9, + GL_COMPRESSED_LUMINANCE_ARB = 0x84EA, + GL_COMPRESSED_LUMINANCE_ALPHA_ARB = 0x84EB, + GL_COMPRESSED_INTENSITY_ARB = 0x84EC, + GL_COMPRESSED_RGB_ARB = 0x84ED, + GL_COMPRESSED_RGBA_ARB = 0x84EE; + + /** Accepted by the {@code target} parameter of Hint and the {@code value} parameter of GetIntegerv, GetBooleanv, GetFloatv, and GetDoublev. */ + public static final int GL_TEXTURE_COMPRESSION_HINT_ARB = 0x84EF; + + /** Accepted by the {@code value} parameter of GetTexLevelParameter. */ + public static final int + GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB = 0x86A0, + GL_TEXTURE_COMPRESSED_ARB = 0x86A1; + + /** Accepted by the {@code value} parameter of GetIntegerv, GetBooleanv, GetFloatv, and GetDoublev. */ + public static final int + GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A2, + GL_COMPRESSED_TEXTURE_FORMATS_ARB = 0x86A3; + + static { GL.initialize(); } + + protected ARBTextureCompression() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glCompressedTexImage3DARB, caps.glCompressedTexImage2DARB, caps.glCompressedTexImage1DARB, caps.glCompressedTexSubImage3DARB, + caps.glCompressedTexSubImage2DARB, caps.glCompressedTexSubImage1DARB, caps.glGetCompressedTexImageARB + ); + } + + // --- [ glCompressedTexImage3DARB ] --- + + /** + * Unsafe version of: {@link #glCompressedTexImage3DARB CompressedTexImage3DARB} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static native void nglCompressedTexImage3DARB(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, long data); + + /** + * Specifies a three-dimensional texture image in a compressed format. + * + * @param target the target texture. One of:
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL12#GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param internalformat the format of the compressed image data. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param width the width of the texture image + * @param height the height of the texture image + * @param depth the depth of the texture image + * @param border must be 0 + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + */ + public static void glCompressedTexImage3DARB(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, border, imageSize, data); + } + + /** + * Specifies a three-dimensional texture image in a compressed format. + * + * @param target the target texture. One of:
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL12#GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param internalformat the format of the compressed image data. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param width the width of the texture image + * @param height the height of the texture image + * @param depth the depth of the texture image + * @param data a pointer to the compressed image data + */ + public static void glCompressedTexImage3DARB(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void const *") ByteBuffer data) { + nglCompressedTexImage3DARB(target, level, internalformat, width, height, depth, 0, data.remaining(), memAddress(data)); + } + + // --- [ glCompressedTexImage2DARB ] --- + + /** + * Unsafe version of: {@link #glCompressedTexImage2DARB CompressedTexImage2DARB} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static native void nglCompressedTexImage2DARB(int target, int level, int internalformat, int width, int height, int border, int imageSize, long data); + + /** + * Specifies a two-dimensional texture image in a compressed format. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL11#GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param internalformat the format of the compressed image data. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param width the width of the texture image + * @param height the height of the texture image + * @param border must be 0 + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + */ + public static void glCompressedTexImage2DARB(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + nglCompressedTexImage2DARB(target, level, internalformat, width, height, border, imageSize, data); + } + + /** + * Specifies a two-dimensional texture image in a compressed format. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL11#GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param internalformat the format of the compressed image data. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param width the width of the texture image + * @param height the height of the texture image + * @param data a pointer to the compressed image data + */ + public static void glCompressedTexImage2DARB(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("void const *") ByteBuffer data) { + nglCompressedTexImage2DARB(target, level, internalformat, width, height, 0, data.remaining(), memAddress(data)); + } + + // --- [ glCompressedTexImage1DARB ] --- + + /** + * Unsafe version of: {@link #glCompressedTexImage1DARB CompressedTexImage1DARB} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static native void nglCompressedTexImage1DARB(int target, int level, int internalformat, int width, int border, int imageSize, long data); + + /** + * Specifies a one-dimensional texture image in a compressed format. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param internalformat the format of the compressed image data. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param width the width of the texture image + * @param border must be 0 + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + */ + public static void glCompressedTexImage1DARB(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + nglCompressedTexImage1DARB(target, level, internalformat, width, border, imageSize, data); + } + + /** + * Specifies a one-dimensional texture image in a compressed format. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param internalformat the format of the compressed image data. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param width the width of the texture image + * @param data a pointer to the compressed image data + */ + public static void glCompressedTexImage1DARB(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("void const *") ByteBuffer data) { + nglCompressedTexImage1DARB(target, level, internalformat, width, 0, data.remaining(), memAddress(data)); + } + + // --- [ glCompressedTexSubImage3DARB ] --- + + /** + * Unsafe version of: {@link #glCompressedTexSubImage3DARB CompressedTexSubImage3DARB} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static native void nglCompressedTexSubImage3DARB(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, long data); + + /** + * Respecifies only a cubic subregion of an existing 3D texel array, with incoming data stored in a specific compressed image format. + * + * @param target the target texture. One of:
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param zoffset a texel offset in the z direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param depth the depth of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + */ + public static void glCompressedTexSubImage3DARB(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); + } + + /** + * Respecifies only a cubic subregion of an existing 3D texel array, with incoming data stored in a specific compressed image format. + * + * @param target the target texture. One of:
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param zoffset a texel offset in the z direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param depth the depth of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param data a pointer to the compressed image data + */ + public static void glCompressedTexSubImage3DARB(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + nglCompressedTexSubImage3DARB(target, level, xoffset, yoffset, zoffset, width, height, depth, format, data.remaining(), memAddress(data)); + } + + // --- [ glCompressedTexSubImage2DARB ] --- + + /** + * Unsafe version of: {@link #glCompressedTexSubImage2DARB CompressedTexSubImage2DARB} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static native void nglCompressedTexSubImage2DARB(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, long data); + + /** + * Respecifies only a rectangular subregion of an existing 2D texel array, with incoming data stored in a specific compressed image format. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + */ + public static void glCompressedTexSubImage2DARB(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, format, imageSize, data); + } + + /** + * Respecifies only a rectangular subregion of an existing 2D texel array, with incoming data stored in a specific compressed image format. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param data a pointer to the compressed image data + */ + public static void glCompressedTexSubImage2DARB(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + nglCompressedTexSubImage2DARB(target, level, xoffset, yoffset, width, height, format, data.remaining(), memAddress(data)); + } + + // --- [ glCompressedTexSubImage1DARB ] --- + + /** + * Unsafe version of: {@link #glCompressedTexSubImage1DARB CompressedTexSubImage1DARB} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static native void nglCompressedTexSubImage1DARB(int target, int level, int xoffset, int width, int format, int imageSize, long data); + + /** + * Respecifies only a subregion of an existing 1D texel array, with incoming data stored in a specific compressed image format. + * + * @param target the target texture. Must be:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param width the width of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + */ + public static void glCompressedTexSubImage1DARB(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + nglCompressedTexSubImage1DARB(target, level, xoffset, width, format, imageSize, data); + } + + /** + * Respecifies only a subregion of an existing 1D texel array, with incoming data stored in a specific compressed image format. + * + * @param target the target texture. Must be:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param width the width of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param data a pointer to the compressed image data + */ + public static void glCompressedTexSubImage1DARB(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + nglCompressedTexSubImage1DARB(target, level, xoffset, width, format, data.remaining(), memAddress(data)); + } + + // --- [ glGetCompressedTexImageARB ] --- + + /** Unsafe version of: {@link #glGetCompressedTexImageARB GetCompressedTexImageARB} */ + public static native void nglGetCompressedTexImageARB(int target, int level, long pixels); + + /** + * Returns a compressed texture image. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}
{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param pixels a buffer in which to return the compressed texture image + */ + public static void glGetCompressedTexImageARB(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("void *") ByteBuffer pixels) { + if (CHECKS) { + if (DEBUG) { + check(pixels, GL11.glGetTexLevelParameteri(target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB)); + } + } + nglGetCompressedTexImageARB(target, level, memAddress(pixels)); + } + + /** + * Returns a compressed texture image. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}
{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param pixels a buffer in which to return the compressed texture image + */ + public static void glGetCompressedTexImageARB(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("void *") long pixels) { + nglGetCompressedTexImageARB(target, level, pixels); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureCompressionBPTC.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureCompressionBPTC.java new file mode 100644 index 00000000..b1d84ced --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureCompressionBPTC.java @@ -0,0 +1,36 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_texture_compression_bptc extension. + * + *

This extension provides additional texture compression functionality specific to the BPTC and BPTC_FLOAT compressed texture formats (called BC7 and BC6H + * respectively in Microsoft's DirectX API), subject to all the requirements and limitations described by the extension {@link ARBTextureCompression ARB_texture_compression}.

+ * + *

Traditional block compression methods as typified by s3tc and latc compress a block of pixels into indicies along a gradient. This works well for smooth + * images, but can have quality issues along sharp edges and strong chrominance transitions. To improve quality in these problematic cases, the BPTC + * formats can divide each block into multiple partitions, each of which are compressed using an independent gradient.

+ * + *

In addition, it is desirable to directly support high dynamic range imagery in compressed formats, which is accomplished by the BPTC_FLOAT formats.

+ * + *

Requires {@link GL31 OpenGL 3.1} and {@link ARBTextureCompression ARB_texture_compression}.

+ */ +public final class ARBTextureCompressionBPTC { + + /** + * Accepted by the {@code internalformat} parameter of TexImage2D, TexImage3D, CopyTexImage2D, CopyTexImage3D, CompressedTexImage2DARB, and + * CompressedTexImage3DARB and the {@code format} parameter of CompressedTexSubImage2DARB and CompressedTexSubImage3DARB. + */ + public static final int + GL_COMPRESSED_RGBA_BPTC_UNORM_ARB = 0x8E8C, + GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM_ARB = 0x8E8D, + GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT_ARB = 0x8E8E, + GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT_ARB = 0x8E8F; + + private ARBTextureCompressionBPTC() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureCompressionRGTC.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureCompressionRGTC.java new file mode 100644 index 00000000..8e8aea8c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureCompressionRGTC.java @@ -0,0 +1,39 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_texture_compression_rgtc extension. + * + *

This extension introduces four new block-based texture compression formats suited for unsigned and signed red and red-green textures (hence the name + * "rgtc" for Red-Green Texture Compression).

+ * + *

These formats are designed to reduce the storage requirements and memory bandwidth required for red and red-green textures by a factor of 2-to-1 over + * conventional uncompressed luminance and luminance-alpha textures with 8-bit components ({@link GL11#GL_LUMINANCE8 LUMINANCE8} and {@link GL11#GL_LUMINANCE8_ALPHA8 LUMINANCE8_ALPHA8}).

+ * + *

The compressed signed red-green format is reasonably suited for storing compressed normal maps.

+ * + *

This extension uses the same compression format as the {@link EXTTextureCompressionLATC EXT_texture_compression_latc} extension except the color data is stored in the red and + * green components rather than luminance and alpha. Representing compressed red and green components is consistent with the BC4 and BC5 compressed + * formats supported by DirectX 10.

+ * + *

Requires {@link GL13 OpenGL 1.3} or {@link ARBTextureCompression ARB_texture_compression}. Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ +public final class ARBTextureCompressionRGTC { + + /** + * Accepted by the {@code internalformat} parameter of TexImage2D, CopyTexImage2D, and CompressedTexImage2D and the {@code format} parameter of + * CompressedTexSubImage2D. + */ + public static final int + GL_COMPRESSED_RED_RGTC1 = 0x8DBB, + GL_COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC, + GL_COMPRESSED_RG_RGTC2 = 0x8DBD, + GL_COMPRESSED_SIGNED_RG_RGTC2 = 0x8DBE; + + private ARBTextureCompressionRGTC() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureCubeMap.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureCubeMap.java new file mode 100644 index 00000000..8fa0430c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureCubeMap.java @@ -0,0 +1,68 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_texture_cube_map extension. + * + *

This extension provides a new texture generation scheme for cube map textures. Instead of the current texture providing a 1D, 2D, or 3D lookup into a + * 1D, 2D, or 3D texture image, the texture is a set of six 2D images representing the faces of a cube. The (s,t,r) texture coordinates are treated as a + * direction vector emanating from the center of a cube. At texture generation time, the interpolated per-fragment (s,t,r) selects one cube face 2D image + * based on the largest magnitude coordinate (the major axis). A new 2D (s,t) is calculated by dividing the two other coordinates (the minor axes values) + * by the major axis value. Then the new (s,t) is used to lookup into the selected 2D texture image face of the cube map.

+ * + *

Unlike a standard 1D, 2D, or 3D texture that have just one target, a cube map texture has six targets, one for each of its six 2D texture image cube + * faces. All these targets must be consistent, complete, and have equal width and height (ie, square dimensions).

+ * + *

This extension also provides two new texture coordinate generation modes for use in conjunction with cube map texturing. The reflection map mode + * generates texture coordinates (s,t,r) matching the vertex's eye-space reflection vector. The reflection map mode is useful for environment mapping + * without the singularity inherent in sphere mapping. The normal map mode generates texture coordinates (s,t,r) matching the vertex's transformed + * eye-space normal. The normal map mode is useful for sophisticated cube map texturing-based diffuse lighting models.

+ * + *

The intent of the new texgen functionality is that an application using cube map texturing can use the new texgen modes to automatically generate the + * reflection or normal vectors used to look up into the cube map texture.

+ * + *

Promoted to core in {@link GL13 OpenGL 1.3}.

+ */ +public final class ARBTextureCubeMap { + + /** Accepted by the {@code param} parameters of TexGend, TexGenf, and TexGeni when {@code pname} parameter is TEXTURE_GEN_MODE. */ + public static final int + GL_NORMAL_MAP_ARB = 0x8511, + GL_REFLECTION_MAP_ARB = 0x8512; + + /** + * When the {@code pname} parameter of TexGendv, TexGenfv, and TexGeniv is TEXTURE_GEN_MODE, then the array {@code params} may also contain NORMAL_MAP_ARB + * or REFLECTION_MAP_ARB. Accepted by the {@code cap} parameter of Enable, Disable, IsEnabled, and by the {@code pname} parameter of GetBooleanv, + * GetIntegerv, GetFloatv, and GetDoublev, and by the {@code target} parameter of BindTexture, GetTexParameterfv, GetTexParameteriv, TexParameterf, + * TexParameteri, TexParameterfv, and TexParameteriv. + */ + public static final int GL_TEXTURE_CUBE_MAP_ARB = 0x8513; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_TEXTURE_BINDING_CUBE_MAP_ARB = 0x8514; + + /** + * Accepted by the {@code target} parameter of GetTexImage, GetTexLevelParameteriv, GetTexLevelParameterfv, TexImage2D, CopyTexImage2D, TexSubImage2D, and + * CopySubTexImage2D. + */ + public static final int + GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x8515, + GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x8516, + GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x8517, + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x8518, + GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = 0x8519, + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x851A; + + /** Accepted by the {@code target} parameter of GetTexLevelParameteriv, GetTexLevelParameterfv, GetTexParameteriv, and TexImage2D. */ + public static final int GL_PROXY_TEXTURE_CUBE_MAP_ARB = 0x851B; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB = 0x851C; + + private ARBTextureCubeMap() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureCubeMapArray.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureCubeMapArray.java new file mode 100644 index 00000000..d1671958 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureCubeMapArray.java @@ -0,0 +1,48 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_texture_cube_map_array extension. + * + *

The {@link EXTTextureArray EXT_texture_array} extension, and subsequently OpenGL 3.0 have introduced the concept of one- and two-dimensional array textures. An array + * texture is an ordered set of images with the same size and format. Each image in an array texture has a unique level. This extension expands texture + * array support to include cube map textures.

+ * + *

A cube map array texture is a 2-dimensional array texture that may contain many cube map layers. Each cube map layer is a unique cube map image set. + * Images in a cube map array have the same size and format limitations as one- and two-dimensional array textures. A cube map array texture is specified + * using {@link GL12C#glTexImage3D TexImage3D} in a similar manner to two-dimensional arrays. Cube map array textures can be bound to a render targets of a frame buffer object + * as two-dimensional arrays are using FramebufferTextureLayer.

+ * + *

When accessed by a programmable shader, a cube map array texture acts as a single unit. The "s", "t", "r" texture coordinates are treated as a regular + * cube map texture fetch. The "q" texture is treated as an unnormalized floating-point value identifying the layer of the cube map array texture. Cube map + * array texture lookups do not filter between layers.

+ * + *

This extension does not provide for the use of cube map array textures with fixed-function fragment processing.

+ * + *

Promoted to core in {@link GL40 OpenGL 4.0}.

+ */ +public final class ARBTextureCubeMapArray { + + /** Accepted by the {@code target} parameter of TexParameteri, TexParameteriv, TexParameterf, TexParameterfv, BindTexture, and GenerateMipmap. */ + public static final int GL_TEXTURE_CUBE_MAP_ARRAY_ARB = 0x9009; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv and GetFloatv. */ + public static final int GL_TEXTURE_BINDING_CUBE_MAP_ARRAY_ARB = 0x900A; + + /** Accepted by the {@code target} parameter of TexImage3D, TexSubImage3D, CompressedTeximage3D, CompressedTexSubImage3D and CopyTexSubImage3D. */ + public static final int GL_PROXY_TEXTURE_CUBE_MAP_ARRAY_ARB = 0x900B; + + /** TEXTURE_CUBE_MAP_ARRAY_ARB Returned by the {@code type} parameter of GetActiveUniform. */ + public static final int + GL_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900C, + GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW_ARB = 0x900D, + GL_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900E, + GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY_ARB = 0x900F; + + private ARBTextureCubeMapArray() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureEnvCombine.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureEnvCombine.java new file mode 100644 index 00000000..c625a4cd --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureEnvCombine.java @@ -0,0 +1,58 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_texture_env_combine extension. + * + *

New texture environment function COMBINE_ARB allows programmable texture combiner operations.

+ * + *

Requires {@link ARBMultitexture ARB_multitexture}. Promoted to core in {@link GL13 OpenGL 1.3}.

+ */ +public final class ARBTextureEnvCombine { + + /** Accepted by the {@code params} parameter of TexEnvf, TexEnvi, TexEnvfv, and TexEnviv when the {@code pname} parameter value is TEXTURE_ENV_MODE. */ + public static final int GL_COMBINE_ARB = 0x8570; + + /** Accepted by the {@code pname} parameter of TexEnvf, TexEnvi, TexEnvfv, and TexEnviv when the {@code target} parameter value is TEXTURE_ENV. */ + public static final int + GL_COMBINE_RGB_ARB = 0x8571, + GL_COMBINE_ALPHA_ARB = 0x8572, + GL_SOURCE0_RGB_ARB = 0x8580, + GL_SOURCE1_RGB_ARB = 0x8581, + GL_SOURCE2_RGB_ARB = 0x8582, + GL_SOURCE0_ALPHA_ARB = 0x8588, + GL_SOURCE1_ALPHA_ARB = 0x8589, + GL_SOURCE2_ALPHA_ARB = 0x858A, + GL_OPERAND0_RGB_ARB = 0x8590, + GL_OPERAND1_RGB_ARB = 0x8591, + GL_OPERAND2_RGB_ARB = 0x8592, + GL_OPERAND0_ALPHA_ARB = 0x8598, + GL_OPERAND1_ALPHA_ARB = 0x8599, + GL_OPERAND2_ALPHA_ARB = 0x859A, + GL_RGB_SCALE_ARB = 0x8573; + + /** + * Accepted by the {@code params} parameter of TexEnvf, TexEnvi, TexEnvfv, and TexEnviv when the {@code pname} parameter value is COMBINE_RGB_ARB or + * COMBINE_ALPHA_ARB. + */ + public static final int + GL_ADD_SIGNED_ARB = 0x8574, + GL_INTERPOLATE_ARB = 0x8575, + GL_SUBTRACT_ARB = 0x84E7; + + /** + * Accepted by the {@code params} parameter of TexEnvf, TexEnvi, TexEnvfv, and TexEnviv when the {@code pname} parameter value is SOURCE0_RGB_ARB, + * SOURCE1_RGB_ARB, SOURCE2_RGB_ARB, SOURCE0_ALPHA_ARB, SOURCE1_ALPHA_ARB, or SOURCE2_ALPHA_ARB. + */ + public static final int + GL_CONSTANT_ARB = 0x8576, + GL_PRIMARY_COLOR_ARB = 0x8577, + GL_PREVIOUS_ARB = 0x8578; + + private ARBTextureEnvCombine() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureEnvDot3.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureEnvDot3.java new file mode 100644 index 00000000..39c2962d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureEnvDot3.java @@ -0,0 +1,24 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_texture_env_dot3 extension. + * + *

Adds new dot product operation to the texture combiner operations.

+ * + *

Requires {@link ARBMultitexture ARB_multitexture} and {@link ARBTextureEnvCombine ARB_texture_env_combine}. Promoted to core in {@link GL13 OpenGL 1.3}.

+ */ +public final class ARBTextureEnvDot3 { + + /** Accepted by the {@code params} parameter of TexEnvf, TexEnvi, TexEnvfv, and TexEnviv when the {@code pname} parameter value is COMBINE_RGB_ARB. */ + public static final int + GL_DOT3_RGB_ARB = 0x86AE, + GL_DOT3_RGBA_ARB = 0x86AF; + + private ARBTextureEnvDot3() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureFilterAnisotropic.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureFilterAnisotropic.java new file mode 100644 index 00000000..c9ef7b7f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureFilterAnisotropic.java @@ -0,0 +1,46 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_texture_filter_anisotropic extension. + * + *

Texture mapping using OpenGL's existing mipmap texture filtering modes assumes that the projection of the pixel filter footprint into texture space is + * a square (ie, isotropic). In practice however, the footprint may be long and narrow (ie, anisotropic). Consequently, mipmap filtering severely blurs + * images on surfaces angled obliquely away from the viewer.

+ * + *

Several approaches exist for improving texture sampling by accounting for the anisotropic nature of the pixel filter footprint into texture space. This + * extension provides a general mechanism for supporting anisotropic texturing filtering schemes without specifying a particular formulation of + * anisotropic filtering.

+ * + *

The extension permits the OpenGL application to specify on a per-texture or -sampler object basis the maximum degree of anisotropy to account for in + * texture filtering.

+ * + *

Increasing the maximum degree of anisotropy may improve texture filtering, but may also significantly reduce the implementation's texture filtering + * rate. Implementations are free to clamp the specified degree of anisotropy to the implementation's maximum supported degree of anisotropy.

+ * + *

A sampler or texture's maximum degree of anisotropy is specified independently from its minification and magnification filter (as opposed to being + * supported as an entirely new filtering mode). Implementations are free to use the specified minification and magnification filter to select a + * particular anisotropic texture filtering scheme. For example, a NEAREST filter with a maximum degree of anisotropy of two could be treated as a 2-tap + * filter that accounts for the direction of anisotropy. Implementations are also permitted to ignore the minification or magnification filter and + * implement the highest quality of anisotropic filtering possible.

+ * + *

Applications seeking the highest quality anisotropic filtering available are advised to request a {@link GL11#GL_LINEAR_MIPMAP_LINEAR LINEAR_MIPMAP_LINEAR} minification filter, a {@link GL11#GL_LINEAR LINEAR} + * magnification filter, and a large maximum degree of anisotropy.

+ * + *

Requires {@link GL12 OpenGL 1.2}.

+ */ +public final class ARBTextureFilterAnisotropic { + + /** Accepted by the {@code pname} parameters of GetTexParameterfv, GetTexParameteriv, TexParameterf, TexParameterfv, TexParameteri, and TexParameteriv. */ + public static final int GL_TEXTURE_MAX_ANISOTROPY = 0x84FE; + + /** Accepted by the {@code pname} parameters of GetBooleanv, GetDoublev, GetFloatv, and GetIntegerv. */ + public static final int GL_MAX_TEXTURE_MAX_ANISOTROPY = 0x84FF; + + private ARBTextureFilterAnisotropic() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureFilterMinmax.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureFilterMinmax.java new file mode 100644 index 00000000..b7caa889 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureFilterMinmax.java @@ -0,0 +1,38 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_texture_filter_minmax extension. + * + *

In unextended OpenGL, minification and magnification filters such as {@link GL11#GL_LINEAR LINEAR} allow texture lookups to returned a filtered texel value produced by + * computing an weighted average of a collection of texels in the neighborhood of the texture coordinate provided.

+ * + *

This extension provides a new texture and sampler parameter ({@link #GL_TEXTURE_REDUCTION_MODE_ARB TEXTURE_REDUCTION_MODE_ARB}) which allows applications to produce a filtered texel value + * by computing a component-wise minimum ({@link GL14#GL_MIN MIN}) or maximum ({@link GL14#GL_MAX MAX}) of the texels that would normally be averaged. The reduction mode is orthogonal + * to the minification and magnification filter parameters. The filter parameters are used to identify the set of texels used to produce a final filtered + * value; the reduction mode identifies how these texels are combined.

+ * + *

Requires {@link GL33 OpenGL 3.3}.

+ */ +public final class ARBTextureFilterMinmax { + + /** + * Accepted by the {@code pname} parameter to SamplerParameter{i f}{v}, SamplerParameterI{u}iv, GetSamplerParameter{i f}v, GetSamplerParameterI{u}iv, + * TexParameter{i f}{v}, TexParameterI{u}iv, GetTexParameter{i f}v, GetTexParameterI{u}iv, TextureParameter{i f}{v}, TextureParameterI{u}iv, + * GetTextureParameter{i f}v, and GetTextureParameterI{u}iv. + */ + public static final int GL_TEXTURE_REDUCTION_MODE_ARB = 0x9366; + + /** + * Accepted by the {@code param} or {@code params} parameter to SamplerParameter{i f}{v}, SamplerParameterI{u}iv, TexParameter{i f}{v}, TexParameterI{u}iv, + * TextureParameter{i f}{v}, and TextureParameterI{u}iv when {@code pname} is TEXTURE_REDUCTION_MODE_ARB. + */ + public static final int GL_WEIGHTED_AVERAGE_ARB = 0x9367; + + private ARBTextureFilterMinmax() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureFloat.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureFloat.java new file mode 100644 index 00000000..44491270 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureFloat.java @@ -0,0 +1,49 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_texture_float extension. + * + *

This extension adds texture internal formats with 16- and 32-bit floating-point components. The 32-bit floating-point components are in the standard + * IEEE float format. The 16-bit floating-point components have 1 sign bit, 5 exponent bits, and 10 mantissa bits. Floating-point components are clamped to + * the limits of the range representable by their format.

+ * + *

Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ +public final class ARBTextureFloat { + + /** Accepted by the {@code value} parameter of GetTexLevelParameter. */ + public static final int + GL_TEXTURE_RED_TYPE_ARB = 0x8C10, + GL_TEXTURE_GREEN_TYPE_ARB = 0x8C11, + GL_TEXTURE_BLUE_TYPE_ARB = 0x8C12, + GL_TEXTURE_ALPHA_TYPE_ARB = 0x8C13, + GL_TEXTURE_LUMINANCE_TYPE_ARB = 0x8C14, + GL_TEXTURE_INTENSITY_TYPE_ARB = 0x8C15, + GL_TEXTURE_DEPTH_TYPE_ARB = 0x8C16; + + /** Returned by the {@code params} parameter of GetTexLevelParameter. */ + public static final int GL_UNSIGNED_NORMALIZED_ARB = 0x8C17; + + /** Accepted by the {@code internalFormat} parameter of TexImage1D, TexImage2D, and TexImage3D. */ + public static final int + GL_RGBA32F_ARB = 0x8814, + GL_RGB32F_ARB = 0x8815, + GL_ALPHA32F_ARB = 0x8816, + GL_INTENSITY32F_ARB = 0x8817, + GL_LUMINANCE32F_ARB = 0x8818, + GL_LUMINANCE_ALPHA32F_ARB = 0x8819, + GL_RGBA16F_ARB = 0x881A, + GL_RGB16F_ARB = 0x881B, + GL_ALPHA16F_ARB = 0x881C, + GL_INTENSITY16F_ARB = 0x881D, + GL_LUMINANCE16F_ARB = 0x881E, + GL_LUMINANCE_ALPHA16F_ARB = 0x881F; + + private ARBTextureFloat() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureGather.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureGather.java new file mode 100644 index 00000000..75f232a0 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureGather.java @@ -0,0 +1,26 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_texture_gather extension. + * + *

This extension provides a new set of texture functions (textureGather) to the shading language that determine 2x2 footprint that are used for linear + * filtering in a texture lookup, and return a vector consisting of the first component from each of the four texels in the footprint.

+ * + *

Promoted to core in {@link GL40 OpenGL 4.0}.

+ */ +public final class ARBTextureGather { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5E, + GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET_ARB = 0x8E5F, + GL_MAX_PROGRAM_TEXTURE_GATHER_COMPONENTS_ARB = 0x8F9F; + + private ARBTextureGather() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureMirrorClampToEdge.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureMirrorClampToEdge.java new file mode 100644 index 00000000..0dbbbcca --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureMirrorClampToEdge.java @@ -0,0 +1,30 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_texture_mirror_clamp_to_edge extension. + * + *

ARB_texture_mirror_clamp_to_edge extends the set of texture wrap modes to include an additional mode ({@link #GL_MIRROR_CLAMP_TO_EDGE MIRROR_CLAMP_TO_EDGE}) that effectively uses a + * texture map twice as large as the original image in which the additional half of the new image is a mirror image of the original image.

+ * + *

This new mode relaxes the need to generate images whose opposite edges match by using the original image to generate a matching "mirror image". This + * mode allows the texture to be mirrored only once in the negative s, t, and r directions.

+ * + *

Requires {@link GL14 OpenGL 1.4}. Promoted to core in {@link GL44 OpenGL 4.4}.

+ */ +public final class ARBTextureMirrorClampToEdge { + + /** + * Accepted by the {@code param} parameter of TexParameter{if}, SamplerParameter{if} and SamplerParameter{if}v, and by the {@code params} parameter of + * TexParameter{if}v, TexParameterI{i ui}v and SamplerParameterI{i ui}v when their {@code pname} parameter is {@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}, {@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}, or + * {@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}. + */ + public static final int GL_MIRROR_CLAMP_TO_EDGE = 0x8743; + + private ARBTextureMirrorClampToEdge() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureMirroredRepeat.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureMirroredRepeat.java new file mode 100644 index 00000000..97c8ef4e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureMirroredRepeat.java @@ -0,0 +1,28 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_texture_mirrored_repeat extension. + * + *

ARB_texture_mirrored_repeat extends the set of texture wrap modes to include a mode ({@link #GL_MIRRORED_REPEAT_ARB MIRRORED_REPEAT_ARB}) that effectively uses a texture map twice + * as large at the original image in which the additional half, for each coordinate, of the new image is a mirror image of the original image.

+ * + *

This new mode relaxes the need to generate images whose opposite edges match by using the original image to generate a matching "mirror image".

+ * + *

Promoted to core in {@link GL14 OpenGL 1.4}.

+ */ +public final class ARBTextureMirroredRepeat { + + /** + * Accepted by the {@code param} parameter of TexParameteri and TexParameterf, and by the {@code params} parameter of TexParameteriv and TexParameterfv, + * when their {@code pname} parameter is TEXTURE_WRAP_S, TEXTURE_WRAP_T, or TEXTURE_WRAP_R. + */ + public static final int GL_MIRRORED_REPEAT_ARB = 0x8370; + + private ARBTextureMirroredRepeat() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureMultisample.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureMultisample.java new file mode 100644 index 00000000..d9b165a3 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureMultisample.java @@ -0,0 +1,173 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_texture_multisample extension. + * + *

This extension provides support for two new types of "multisample textures" - two-dimensional and two-dimensional array - as well as mechanisms to + * fetch a specific sample from such a texture in a shader, and to attach such textures to FBOs for rendering.

+ * + *

This extension also includes the following functionality, first described in {@link NVExplicitMultisample NV_explicit_multisample}:

+ * + *
    + *
  • A query in the API to query the location of samples within the pixel
  • + *
  • An explicit control for the multisample sample mask to augment the control provided by SampleCoverage
  • + *
+ * + *

Promoted to core in {@link GL32 OpenGL 3.2}.

+ */ +public class ARBTextureMultisample { + + /** Accepted by the {@code pname} parameter of GetMultisamplefv. */ + public static final int GL_SAMPLE_POSITION = 0x8E50; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_SAMPLE_MASK = 0x8E51; + + /** Accepted by the {@code target} parameter of GetBooleani_v and GetIntegeri_v. */ + public static final int GL_SAMPLE_MASK_VALUE = 0x8E52; + + /** Accepted by the {@code target} parameter of BindTexture and TexImage2DMultisample. */ + public static final int GL_TEXTURE_2D_MULTISAMPLE = 0x9100; + + /** Accepted by the {@code target} parameter of TexImage2DMultisample. */ + public static final int GL_PROXY_TEXTURE_2D_MULTISAMPLE = 0x9101; + + /** Accepted by the {@code target} parameter of BindTexture and TexImage3DMultisample. */ + public static final int GL_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9102; + + /** Accepted by the {@code target} parameter of TexImage3DMultisample. */ + public static final int GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9103; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_MAX_SAMPLE_MASK_WORDS = 0x8E59, + GL_MAX_COLOR_TEXTURE_SAMPLES = 0x910E, + GL_MAX_DEPTH_TEXTURE_SAMPLES = 0x910F, + GL_MAX_INTEGER_SAMPLES = 0x9110, + GL_TEXTURE_BINDING_2D_MULTISAMPLE = 0x9104, + GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 0x9105; + + /** Accepted by the {@code pname} parameter of GetTexLevelParameter. */ + public static final int + GL_TEXTURE_SAMPLES = 0x9106, + GL_TEXTURE_FIXED_SAMPLE_LOCATIONS = 0x9107; + + /** Returned by the {@code type} parameter of GetActiveUniform. */ + public static final int + GL_SAMPLER_2D_MULTISAMPLE = 0x9108, + GL_INT_SAMPLER_2D_MULTISAMPLE = 0x9109, + GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 0x910A, + GL_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910B, + GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910C, + GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910D; + + static { GL.initialize(); } + + protected ARBTextureMultisample() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glTexImage2DMultisample, caps.glTexImage3DMultisample, caps.glGetMultisamplefv, caps.glSampleMaski + ); + } + + // --- [ glTexImage2DMultisample ] --- + + /** + * Establishes the data storage, format, dimensions, and number of samples of a 2D multisample texture's image. + * + * @param target the target of the operation. One of:
{@link GL32C#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32C#GL_PROXY_TEXTURE_2D_MULTISAMPLE PROXY_TEXTURE_2D_MULTISAMPLE}
+ * @param samples the number of samples in the multisample texture's image + * @param internalformat the internal format to be used to store the multisample texture's image. {@code internalformat} must specify a color-renderable, depth-renderable, + * or stencil-renderable format. + * @param width the width of the multisample texture's image, in texels + * @param height the height of the multisample texture's image, in texels + * @param fixedsamplelocations whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not + * depend on the internal format or size of the image + */ + public static void glTexImage2DMultisample(@NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLboolean") boolean fixedsamplelocations) { + GL32C.glTexImage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations); + } + + // --- [ glTexImage3DMultisample ] --- + + /** + * Establishes the data storage, format, dimensions, and number of samples of a 3D multisample texture's image. + * + * @param target the target of the operation. One of:
{@link GL32C#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}{@link GL32C#GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param samples the number of samples in the multisample texture's image + * @param internalformat the internal format to be used to store the multisample texture's image. {@code internalformat} must specify a color-renderable, depth-renderable, + * or stencil-renderable format. + * @param width the width of the multisample texture's image, in texels + * @param height the height of the multisample texture's image, in texels + * @param depth the depth of the multisample texture's image, in texels + * @param fixedsamplelocations whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not + * depend on the internal format or size of the image + */ + public static void glTexImage3DMultisample(@NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLboolean") boolean fixedsamplelocations) { + GL32C.glTexImage3DMultisample(target, samples, internalformat, width, height, depth, fixedsamplelocations); + } + + // --- [ glGetMultisamplefv ] --- + + /** Unsafe version of: {@link #glGetMultisamplefv GetMultisamplefv} */ + public static void nglGetMultisamplefv(int pname, int index, long val) { + GL32C.nglGetMultisamplefv(pname, index, val); + } + + /** + * Retrieves the location of a sample. + * + * @param pname the sample parameter name. Must be:
{@link GL32C#GL_SAMPLE_POSITION SAMPLE_POSITION}
+ * @param index the index of the sample whose position to query + * @param val an array to receive the position of the sample + */ + public static void glGetMultisamplefv(@NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLfloat *") FloatBuffer val) { + GL32C.glGetMultisamplefv(pname, index, val); + } + + /** + * Retrieves the location of a sample. + * + * @param pname the sample parameter name. Must be:
{@link GL32C#GL_SAMPLE_POSITION SAMPLE_POSITION}
+ * @param index the index of the sample whose position to query + */ + @NativeType("void") + public static float glGetMultisamplef(@NativeType("GLenum") int pname, @NativeType("GLuint") int index) { + return GL32C.glGetMultisamplef(pname, index); + } + + // --- [ glSampleMaski ] --- + + /** + * Sets the value of a sub-word of the sample mask. + * + * @param index which 32-bit sub-word of the sample mask to update + * @param mask the new value of the mask sub-word + */ + public static void glSampleMaski(@NativeType("GLuint") int index, @NativeType("GLbitfield") int mask) { + GL32C.glSampleMaski(index, mask); + } + + /** Array version of: {@link #glGetMultisamplefv GetMultisamplefv} */ + public static void glGetMultisamplefv(@NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLfloat *") float[] val) { + GL32C.glGetMultisamplefv(pname, index, val); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureRG.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureRG.java new file mode 100644 index 00000000..747b5f8c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureRG.java @@ -0,0 +1,59 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_texture_rg extension. + * + *

Historically one- and two- component textures have been specified in OpenGL using the intensity, luminance or luminance-alpha (I/L/LA) formats. With the + * advent of programmable shaders and render-to-texture capabilites these legacy formats carry some historical artifacts which are no longer useful.

+ * + *

For example, when sampling from such textures, the luminance values are replicated across the color components, and the intensity values are replicated + * across both the color and alpha components. This is no longer necessary with programmable shaders.

+ * + *

It is also desirable to be able to render to one- and two- component format textures using capabilities such as framebuffer objects (FBO), but rendering + * to I/L/LA formats is under-specified (specifically how to map R/G/B/A values to I/L/A texture channels).

+ * + *

This extension adds new base internal formats for the one-component {@link GL11#GL_RED RED} and two-component {@link #GL_RG RG} (red green) texture formats as well as sized + * internal formats for fixed-point, floating-point and pure integer texture formats. The new texure formats can be used for texturing as well as for + * rendering into with framebuffer objects.

+ * + *

Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ +public final class ARBTextureRG { + + /** Accepted by the {@code internalFormat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, and CopyTexImage2D. */ + public static final int + GL_R8 = 0x8229, + GL_R16 = 0x822A, + GL_RG8 = 0x822B, + GL_RG16 = 0x822C, + GL_R16F = 0x822D, + GL_R32F = 0x822E, + GL_RG16F = 0x822F, + GL_RG32F = 0x8230, + GL_R8I = 0x8231, + GL_R8UI = 0x8232, + GL_R16I = 0x8233, + GL_R16UI = 0x8234, + GL_R32I = 0x8235, + GL_R32UI = 0x8236, + GL_RG8I = 0x8237, + GL_RG8UI = 0x8238, + GL_RG16I = 0x8239, + GL_RG16UI = 0x823A, + GL_RG32I = 0x823B, + GL_RG32UI = 0x823C, + GL_RG = 0x8227, + GL_COMPRESSED_RED = 0x8225, + GL_COMPRESSED_RG = 0x8226; + + /** Accepted by the {@code format} parameter of TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, and ReadPixels. */ + public static final int GL_RG_INTEGER = 0x8228; + + private ARBTextureRG() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureRGB10_A2UI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureRGB10_A2UI.java new file mode 100644 index 00000000..37819206 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureRGB10_A2UI.java @@ -0,0 +1,28 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_texture_rgb10_a2ui extension. + * + *

This extension adds support for a new texturing format for unsigned 10.10.10.2 integer textures.

+ * + *

OpenGL has supported {@link GL11#GL_RGB10 RGB10} and {@link GL11#GL_RGB10_A2 RGB10_A2} formats for a very long time. This extension provides a variant of RGB10_A2 which supports unsigned + * integer data (in contrast to the above "unsigned normalized integer" formats).

+ * + *

Requires {@link GL30 OpenGL 3.0} or {@link EXTTextureInteger EXT_texture_integer}. Promoted to core in {@link GL33 OpenGL 3.3}.

+ */ +public final class ARBTextureRGB10_A2UI { + + /** + * Accepted by the {@code internalFormat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, RenderbufferStorage and + * RenderbufferStorageMultisample. + */ + public static final int GL_RGB10_A2UI = 0x906F; + + private ARBTextureRGB10_A2UI() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureRectangle.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureRectangle.java new file mode 100644 index 00000000..bfb14545 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureRectangle.java @@ -0,0 +1,61 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_texture_rectangle extension. + * + *

OpenGL texturing is limited to images with power-of-two dimensions and an optional 1-texel border. The ARB_texture_rectangle extension adds a new + * texture target that supports 2D textures without requiring power-of-two dimensions.

+ * + *

Non-power-of-two sized (NPOTS) textures are useful for storing video images that do not have power-of-two sized (POTS). Re-sampling artifacts are + * avoided and less texture memory may be required by using non-power-of-two sized textures. Non-power-of-two sized textures are also useful for shadow + * maps and window-space texturing.

+ * + *

However, non-power-of-two sized textures have limitations that do not apply to power-of-two sized textures. NPOTS textures may not use mipmap filtering; + * POTS textures support both mipmapped and non-mipmapped filtering. NPOTS textures support only the {@link GL11#GL_CLAMP CLAMP}, {@link GL12#GL_CLAMP_TO_EDGE CLAMP_TO_EDGE}, and + * {@link GL13#GL_CLAMP_TO_BORDER CLAMP_TO_BORDER} wrap modes; POTS textures support {@link GL12#GL_CLAMP_TO_EDGE CLAMP_TO_EDGE}, {@link GL11#GL_REPEAT REPEAT}, {@link GL11#GL_CLAMP CLAMP}, {@link GL14#GL_MIRRORED_REPEAT MIRRORED_REPEAT}, and {@link GL13#GL_CLAMP_TO_BORDER CLAMP_TO_BORDER} + * (and GL_MIRROR_CLAMP_ATI and GL_MIRROR_CLAMP_TO_EDGE_ATI if ATI_texture_mirror_once is supported). NPOTS textures do not + * support an optional 1-texel border; POTS textures do support an optional 1-texel border.

+ * + *

NPOTS textures are accessed by dimension-dependent (aka non-normalized) texture coordinates. So instead of thinking of the texture image lying in a + * [0..1]x[0..1] range, the NPOTS texture image lies in a [0..w]x[0..h] range.

+ * + *

This extension adds a new texture target and related state (proxy, binding, max texture size).

+ */ +public final class ARBTextureRectangle { + + /** + * Accepted by the {@code cap} parameter of Enable, Disable and IsEnabled; by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv and + * GetDoublev; and by the {@code target} parameter of BindTexture, GetTexParameterfv, GetTexParameteriv, TexParameterf, TexParameteri, TexParameterfv and + * TexParameteriv. + */ + public static final int GL_TEXTURE_RECTANGLE_ARB = 0x84F5; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv and GetDoublev. */ + public static final int GL_TEXTURE_BINDING_RECTANGLE_ARB = 0x84F6; + + /** Accepted by the {@code target} parameter of GetTexLevelParameteriv, GetTexLevelParameterfv, GetTexParameteriv and TexImage2D. */ + public static final int GL_PROXY_TEXTURE_RECTANGLE_ARB = 0x84F7; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv and GetFloatv. */ + public static final int GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB = 0x84F8; + + /** + * TEXTURE_RECTANGLE_ARB Returned by {@code type} parameter of GetActiveUniform when the location {@code index} for program object {@code program} is of + * type sampler2DRect. + */ + public static final int GL_SAMPLER_2D_RECT_ARB = 0x8B63; + + /** + * Returned by {@code type} parameter of GetActiveUniform when the location {@code index} for program object {@code program} is of type + * sampler2DRectShadow. + */ + public static final int GL_SAMPLER_2D_RECT_SHADOW_ARB = 0x8B64; + + private ARBTextureRectangle() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureStorage.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureStorage.java new file mode 100644 index 00000000..5a649a97 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureStorage.java @@ -0,0 +1,136 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_texture_storage extension. + * + *

The texture image specification commands in OpenGL allow each level to be separately specified with different sizes, formats, types and so on, and only + * imposes consistency checks at draw time. This adds overhead for implementations.

+ * + *

This extension provides a mechanism for specifying the entire structure of a texture in a single call, allowing certain consistency checks and memory + * allocations to be done up front. Once specified, the format and dimensions of the image array become immutable, to simplify completeness checks in the + * implementation.

+ * + *

When using this extension, it is no longer possible to supply texture data using TexImage*. Instead, data can be uploaded using TexSubImage*, or + * produced by other means (such as render-to-texture, mipmap generation, or rendering to a sibling EGLImage).

+ * + *

This extension has complicated interactions with other extensions. The goal of most of these interactions is to ensure that a texture is always mipmap + * complete (and cube complete for cubemap textures).

+ * + *

Requires {@link GL12 OpenGL 1.2}. Promoted to core in {@link GL42 OpenGL 4.2}.

+ */ +public class ARBTextureStorage { + + /** Accepted by the {@code value} parameter of GetTexParameter{if}v. */ + public static final int GL_TEXTURE_IMMUTABLE_FORMAT = 0x912F; + + static { GL.initialize(); } + + protected ARBTextureStorage() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glTexStorage1D, caps.glTexStorage2D, caps.glTexStorage3D, ext.contains("GL_EXT_direct_state_access") ? caps.glTextureStorage1DEXT : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glTextureStorage2DEXT : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glTextureStorage3DEXT : -1L + ); + } + + // --- [ glTexStorage1D ] --- + + /** + * Simultaneously specifies storage for all levels of a one-dimensional texture. + * + * @param target the target of the operation. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}
+ * @param levels the number of texture levels + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + */ + public static void glTexStorage1D(@NativeType("GLenum") int target, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width) { + GL42C.glTexStorage1D(target, levels, internalformat, width); + } + + // --- [ glTexStorage2D ] --- + + /** + * Simultaneously specifies storage for all levels of a two-dimensional or one-dimensional array texture. + * + * @param target the target of the operation. One of:
{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL11#GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
+ * @param levels the number of texture levels + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + */ + public static void glTexStorage2D(@NativeType("GLenum") int target, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL42C.glTexStorage2D(target, levels, internalformat, width, height); + } + + // --- [ glTexStorage3D ] --- + + /** + * Simultaneously specifies storage for all levels of a three-dimensional, two-dimensional array or cube-map array texture. + * + * @param target the target of the operation. One of:
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL12#GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}
+ * @param levels the number of texture levels + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * @param depth the depth of the texture, in texels + */ + public static void glTexStorage3D(@NativeType("GLenum") int target, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth) { + GL42C.glTexStorage3D(target, levels, internalformat, width, height, depth); + } + + // --- [ glTextureStorage1DEXT ] --- + + /** + * DSA version of {@link #glTexStorage1D TexStorage1D}. + * + * @param texture the texture object to update + * @param target the target of the operation. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}
+ * @param levels the number of texture levels + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + */ + public static native void glTextureStorage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width); + + // --- [ glTextureStorage2DEXT ] --- + + /** + * DSA version of {@link #glTexStorage2D TexStorage2D}. + * + * @param texture the texture object to update + * @param target the target of the operation. One of:
{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL11#GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
+ * @param levels the number of texture levels + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + */ + public static native void glTextureStorage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glTextureStorage3DEXT ] --- + + /** + * DSA version of {@link #glTexStorage3D TexStorage3D}. + * + * @param texture the texture object to update + * @param target the target of the operation. One of:
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL12#GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}
+ * @param levels the number of texture levels + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * @param depth the depth of the texture, in texels + */ + public static native void glTextureStorage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureStorageMultisample.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureStorageMultisample.java new file mode 100644 index 00000000..64458525 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureStorageMultisample.java @@ -0,0 +1,108 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_texture_storage_multisample extension. + * + *

The {@link ARBTextureStorage ARB_texture_storage} extension and OpenGL 4.2 introduced the concept of immutable texture objects. With these objects, once their data store + * has been sized and allocated, it could not be resized for the lifetime of the objects (although its content could be updated). OpenGL implementations + * may be able to take advantage of the knowledge that the underlying data store of certain objects cannot be deleted or otherwise reallocated without + * destruction of the whole object (normally, a much heavier weight and less frequent operation). Immutable storage for all types of textures besides + * multisample and buffer textures was introduced by ARB_texture_storage. For completeness, this extension introduces immutable storage for multisampled + * textures.

+ * + *

Requires {@link GL42 OpenGL 4.2} or {@link ARBTextureStorage ARB_texture_storage}. Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ +public class ARBTextureStorageMultisample { + + static { GL.initialize(); } + + protected ARBTextureStorageMultisample() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glTexStorage2DMultisample, caps.glTexStorage3DMultisample, + ext.contains("GL_EXT_direct_state_access") ? caps.glTextureStorage2DMultisampleEXT : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glTextureStorage3DMultisampleEXT : -1L + ); + } + + // --- [ glTexStorage2DMultisample ] --- + + /** + * Specifies storage for a two-dimensional multisample texture. + * + * @param target the target of the operation. One of:
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_PROXY_TEXTURE_2D_MULTISAMPLE PROXY_TEXTURE_2D_MULTISAMPLE}
+ * @param samples the number of samples in the texture + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * @param fixedsamplelocations whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not + * depend on the internal format or size of the image + */ + public static void glTexStorage2DMultisample(@NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLboolean") boolean fixedsamplelocations) { + GL43C.glTexStorage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations); + } + + // --- [ glTexStorage3DMultisample ] --- + + /** + * Specifies storage for a two-dimensional multisample array texture. + * + * @param target the target of the operation. One of:
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}{@link GL32#GL_PROXY_TEXTURE_2D_MULTISAMPLE PROXY_TEXTURE_2D_MULTISAMPLE}
+ * @param samples the number of samples in the texture + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * @param depth the depth of the texture, in texels + * @param fixedsamplelocations whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not + * depend on the internal format or size of the image + */ + public static void glTexStorage3DMultisample(@NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLboolean") boolean fixedsamplelocations) { + GL43C.glTexStorage3DMultisample(target, samples, internalformat, width, height, depth, fixedsamplelocations); + } + + // --- [ glTextureStorage2DMultisampleEXT ] --- + + /** + * DSA version of {@link #glTexStorage2DMultisample TexStorage2DMultisample}. + * + * @param texture the texture object + * @param target the target of the operation. One of:
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_PROXY_TEXTURE_2D_MULTISAMPLE PROXY_TEXTURE_2D_MULTISAMPLE}
+ * @param samples the number of samples in the texture + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * @param fixedsamplelocations whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not + * depend on the internal format or size of the image + */ + public static native void glTextureStorage2DMultisampleEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLboolean") boolean fixedsamplelocations); + + // --- [ glTextureStorage3DMultisampleEXT ] --- + + /** + * DSA version of {@link #glTexStorage3DMultisample TexStorage3DMultisample}. + * + * @param texture the texture object + * @param target the target of the operation. One of:
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}{@link GL32#GL_PROXY_TEXTURE_2D_MULTISAMPLE PROXY_TEXTURE_2D_MULTISAMPLE}
+ * @param samples the number of samples in the texture + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * @param depth the depth of the texture, in texels + * @param fixedsamplelocations whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not + * depend on the internal format or size of the image + */ + public static native void glTextureStorage3DMultisampleEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLboolean") boolean fixedsamplelocations); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureSwizzle.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureSwizzle.java new file mode 100644 index 00000000..d595f3fe --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureSwizzle.java @@ -0,0 +1,39 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_texture_swizzle extension. + * + *

Classic OpenGL texture formats conflate texture storage and interpretation, and assume that textures represent color. In modern applications, a + * significant quantity of textures don't represent color, but rather data like shadow maps, normal maps, page tables, occlusion data, etc. For the latter + * class of data, calling the data "RGBA" is just a convenient mapping of what the data is onto the current model, but isn't an accurate reflection of the + * reality of the data.

+ * + *

The existing texture formats provide an almost orthogonal set of data types, sizes, and number of components, but the mappings of this storage into what + * the shader or fixed-function pipeline fetches is very much non-orthogonal. Previous extensions have added some of the most demanded missing formats, but + * the problem has not been solved once and for all.

+ * + *

This extension provides a mechanism to swizzle the components of a texture before they are applied according to the texture environment in + * fixed-function or as they are returned to the shader.

+ * + *

Promoted to core in {@link GL33 OpenGL 3.3}.

+ */ +public final class ARBTextureSwizzle { + + /** Accepted by the {@code pname} parameters of TexParameteri, TexParameterf, TexParameteriv, TexParameterfv, GetTexParameterfv, and GetTexParameteriv. */ + public static final int + GL_TEXTURE_SWIZZLE_R = 0x8E42, + GL_TEXTURE_SWIZZLE_G = 0x8E43, + GL_TEXTURE_SWIZZLE_B = 0x8E44, + GL_TEXTURE_SWIZZLE_A = 0x8E45; + + /** Accepted by the {@code pname} parameters of TexParameteriv, TexParameterfv, GetTexParameterfv, and GetTexParameteriv. */ + public static final int GL_TEXTURE_SWIZZLE_RGBA = 0x8E46; + + private ARBTextureSwizzle() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureView.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureView.java new file mode 100644 index 00000000..dbbbd617 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTextureView.java @@ -0,0 +1,77 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_texture_view extension. + * + *

This extension allows a texture's data store to be "viewed" in multiple ways, either reinterpreting the data format/type as a different format/type with + * the same element size, or by clamping the mipmap level range or array slice range.

+ * + *

The goals of this extension are to avoid having these alternate views become shared mutable containers of shared mutable objects, and to add the views + * to the API in a minimally invasive way.

+ * + *

No new object types are added. Conceptually, a texture object is split into the following parts:

+ * + *
    + *
  • A data store holding texel data.
  • + *
  • State describing which portions of the data store to use, and how to interpret the data elements.
  • + *
  • An embedded sampler object.
  • + *
  • Various other texture parameters.
  • + *
+ * + *

With this extension, multiple textures can share a data store and have different state describing which portions of the data store to use and how to + * interpret the data elements. The data store is refcounted and not destroyed until the last texture sharing it is deleted.

+ * + *

This extension leverages the {@link ARBTextureStorage ARB_texture_storage} concept of an "immutable texture". Views can only be created of textures created with TexStorage.

+ * + *

Requires {@link GL42 OpenGL 4.2} or {@link ARBTextureStorage ARB_texture_storage}. Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ +public class ARBTextureView { + + /** Accepted by the {@code pname} parameters of GetTexParameterfv and GetTexParameteriv. */ + public static final int + GL_TEXTURE_VIEW_MIN_LEVEL = 0x82DB, + GL_TEXTURE_VIEW_NUM_LEVELS = 0x82DC, + GL_TEXTURE_VIEW_MIN_LAYER = 0x82DD, + GL_TEXTURE_VIEW_NUM_LAYERS = 0x82DE, + GL_TEXTURE_IMMUTABLE_LEVELS = 0x82DF; + + static { GL.initialize(); } + + protected ARBTextureView() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glTextureView + ); + } + + // --- [ glTextureView ] --- + + /** + * Initializes a texture as a data alias of another texture's data store. + * + * @param texture the texture object to be initialized as a view + * @param target the target to be used for the newly initialized texture + * @param origtexture the name of a texture object of which to make a view + * @param internalformat the internal format for the newly created view + * @param minlevel the lowest level of detail of the view + * @param numlevels the number of levels of detail to include in the view + * @param minlayer the index of the first layer to include in the view + * @param numlayers the number of layers to include in the view + */ + public static void glTextureView(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLuint") int origtexture, @NativeType("GLenum") int internalformat, @NativeType("GLuint") int minlevel, @NativeType("GLuint") int numlevels, @NativeType("GLuint") int minlayer, @NativeType("GLuint") int numlayers) { + GL43C.glTextureView(texture, target, origtexture, internalformat, minlevel, numlevels, minlayer, numlayers); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTimerQuery.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTimerQuery.java new file mode 100644 index 00000000..c4ce6280 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTimerQuery.java @@ -0,0 +1,134 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_timer_query extension. + * + *

Applications can benefit from accurate timing information in a number of different ways. During application development, timing information can help + * identify application or driver bottlenecks. At run time, applications can use timing information to dynamically adjust the amount of detail in a scene + * to achieve constant frame rates. OpenGL implementations have historically provided little to no useful timing information. Applications can get some + * idea of timing by reading timers on the CPU, but these timers are not synchronized with the graphics rendering pipeline. Reading a CPU timer does not + * guarantee the completion of a potentially large amount of graphics work accumulated before the timer is read, and will thus produce wildly inaccurate + * results. {@link GL11C#glFinish Finish} can be used to determine when previous rendering commands have been completed, but will idle the graphics pipeline and adversely + * affect application performance.

+ * + *

This extension provides a query mechanism that can be used to determine the amount of time it takes to fully complete a set of GL commands, and without + * stalling the rendering pipeline. It uses the query object mechanisms first introduced in the occlusion query extension, which allow time intervals to be + * polled asynchronously by the application.

+ * + *

Promoted to core in {@link GL33 OpenGL 3.3}.

+ */ +public class ARBTimerQuery { + + /** Accepted by the {@code target} parameter of BeginQuery, EndQuery, and GetQueryiv. */ + public static final int GL_TIME_ELAPSED = 0x88BF; + + /** + * Accepted by the {@code target} parameter of GetQueryiv and QueryCounter. Accepted by the {@code value} parameter of GetBooleanv, GetIntegerv, + * GetInteger64v, GetFloatv, and GetDoublev. + */ + public static final int GL_TIMESTAMP = 0x8E28; + + static { GL.initialize(); } + + protected ARBTimerQuery() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glQueryCounter, caps.glGetQueryObjecti64v, caps.glGetQueryObjectui64v + ); + } + + // --- [ glQueryCounter ] --- + + /** + * Records the GL time into a query object after all previous commands have reached the GL server but have not yet necessarily executed. + * + * @param id the name of a query object into which to record the GL time + * @param target the counter to query. Must be:
{@link GL33C#GL_TIMESTAMP TIMESTAMP}
+ */ + public static void glQueryCounter(@NativeType("GLuint") int id, @NativeType("GLenum") int target) { + GL33C.glQueryCounter(id, target); + } + + // --- [ glGetQueryObjecti64v ] --- + + /** Unsafe version of: {@link #glGetQueryObjecti64v GetQueryObjecti64v} */ + public static void nglGetQueryObjecti64v(int id, int pname, long params) { + GL33C.nglGetQueryObjecti64v(id, pname, params); + } + + /** + * Returns the 64bit integer value of query object parameter. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter. One of:
{@link GL15#GL_QUERY_RESULT QUERY_RESULT}{@link GL15#GL_QUERY_RESULT_AVAILABLE QUERY_RESULT_AVAILABLE}
+ * @param params the requested data + */ + public static void glGetQueryObjecti64v(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLint64 *") LongBuffer params) { + GL33C.glGetQueryObjecti64v(id, pname, params); + } + + /** + * Returns the 64bit integer value of query object parameter. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter. One of:
{@link GL15#GL_QUERY_RESULT QUERY_RESULT}{@link GL15#GL_QUERY_RESULT_AVAILABLE QUERY_RESULT_AVAILABLE}
+ */ + @NativeType("void") + public static long glGetQueryObjecti64(@NativeType("GLuint") int id, @NativeType("GLenum") int pname) { + return GL33C.glGetQueryObjecti64(id, pname); + } + + // --- [ glGetQueryObjectui64v ] --- + + /** Unsafe version of: {@link #glGetQueryObjectui64v GetQueryObjectui64v} */ + public static void nglGetQueryObjectui64v(int id, int pname, long params) { + GL33C.nglGetQueryObjectui64v(id, pname, params); + } + + /** + * Unsigned version of {@link #glGetQueryObjecti64v GetQueryObjecti64v}. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter + * @param params the requested data + */ + public static void glGetQueryObjectui64v(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLuint64 *") LongBuffer params) { + GL33C.glGetQueryObjectui64v(id, pname, params); + } + + /** + * Unsigned version of {@link #glGetQueryObjecti64v GetQueryObjecti64v}. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter + */ + @NativeType("void") + public static long glGetQueryObjectui64(@NativeType("GLuint") int id, @NativeType("GLenum") int pname) { + return GL33C.glGetQueryObjectui64(id, pname); + } + + /** Array version of: {@link #glGetQueryObjecti64v GetQueryObjecti64v} */ + public static void glGetQueryObjecti64v(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLint64 *") long[] params) { + GL33C.glGetQueryObjecti64v(id, pname, params); + } + + /** Array version of: {@link #glGetQueryObjectui64v GetQueryObjectui64v} */ + public static void glGetQueryObjectui64v(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLuint64 *") long[] params) { + GL33C.glGetQueryObjectui64v(id, pname, params); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTransformFeedback2.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTransformFeedback2.java new file mode 100644 index 00000000..6067038a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTransformFeedback2.java @@ -0,0 +1,185 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_transform_feedback2 extension. + * + *

The {@link EXTTransformFeedback EXT_transform_feedback} extension allows applications to capture primitives to one or more buffer objects when transformed by the GL. This + * extension provides a few additional capabilities to these extensions, making transform feedback mode more useful.

+ * + *

First, it provides transform feedback objects which encapsulate transform feedback-related state, allowing applications to replace the entire transform + * feedback configuration in a single bind call. Second, it provides the ability to pause and resume transform feedback operations. When transform feedback + * is paused, applications may render without transform feedback or may use transform feedback with different state and a different transform feedback + * object. When transform feedback is resumed, additional primitives are captured and appended to previously captured primitives for the object.

+ * + *

Additionally, this extension provides the ability to draw primitives captured in transform feedback mode without querying the captured primitive count. + * The command {@link #glDrawTransformFeedback DrawTransformFeedback} is equivalent to {@code glDrawArrays(, 0, )}, where {@code count} is the number of + * vertices captured to buffer objects during the last transform feedback capture operation on the transform feedback object used. This draw operation + * only provides a vertex count -- it does not automatically set up vertex array state or vertex buffer object bindings, which must be done separately by + * the application.

+ * + *

Requires {@link GL20 GL20} or {@link ARBShaderObjects ARB_shader_objects} and {@link NVTransformFeedback NV_transform_feedback} or {@link EXTTransformFeedback EXT_transform_feedback}. + * Promoted to core in {@link GL40 OpenGL 4.0}.

+ */ +public class ARBTransformFeedback2 { + + /** Accepted by the {@code target} parameter of BindTransformFeedback. */ + public static final int GL_TRANSFORM_FEEDBACK = 0x8E22; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED = 0x8E23, + GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE = 0x8E24, + GL_TRANSFORM_FEEDBACK_BINDING = 0x8E25; + + static { GL.initialize(); } + + protected ARBTransformFeedback2() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBindTransformFeedback, caps.glDeleteTransformFeedbacks, caps.glGenTransformFeedbacks, caps.glIsTransformFeedback, + caps.glPauseTransformFeedback, caps.glResumeTransformFeedback, caps.glDrawTransformFeedback + ); + } + + // --- [ glBindTransformFeedback ] --- + + /** + * Binds a transform feedback object. + * + * @param target the target to which to bind the transform feedback object {@code id}. Must be:
{@link GL40C#GL_TRANSFORM_FEEDBACK TRANSFORM_FEEDBACK}
+ * @param id the name of a transform feedback object + */ + public static void glBindTransformFeedback(@NativeType("GLenum") int target, @NativeType("GLuint") int id) { + GL40C.glBindTransformFeedback(target, id); + } + + // --- [ glDeleteTransformFeedbacks ] --- + + /** + * Unsafe version of: {@link #glDeleteTransformFeedbacks DeleteTransformFeedbacks} + * + * @param n the number of transform feedback objects to delete + */ + public static void nglDeleteTransformFeedbacks(int n, long ids) { + GL40C.nglDeleteTransformFeedbacks(n, ids); + } + + /** + * Deletes transform feedback objects. + * + * @param ids an array of names of transform feedback objects to delete + */ + public static void glDeleteTransformFeedbacks(@NativeType("GLuint const *") IntBuffer ids) { + GL40C.glDeleteTransformFeedbacks(ids); + } + + /** Deletes transform feedback objects. */ + public static void glDeleteTransformFeedbacks(@NativeType("GLuint const *") int id) { + GL40C.glDeleteTransformFeedbacks(id); + } + + // --- [ glGenTransformFeedbacks ] --- + + /** + * Unsafe version of: {@link #glGenTransformFeedbacks GenTransformFeedbacks} + * + * @param n the number of transform feedback object names to reserve + */ + public static void nglGenTransformFeedbacks(int n, long ids) { + GL40C.nglGenTransformFeedbacks(n, ids); + } + + /** + * Reserves transform feedback object names. + * + * @param ids an array of into which the reserved names will be written + */ + public static void glGenTransformFeedbacks(@NativeType("GLuint *") IntBuffer ids) { + GL40C.glGenTransformFeedbacks(ids); + } + + /** Reserves transform feedback object names. */ + @NativeType("void") + public static int glGenTransformFeedbacks() { + return GL40C.glGenTransformFeedbacks(); + } + + // --- [ glIsTransformFeedback ] --- + + /** + * Determines if a name corresponds to a transform feedback object. + * + * @param id a value that may be the name of a transform feedback object + */ + @NativeType("GLboolean") + public static boolean glIsTransformFeedback(@NativeType("GLuint") int id) { + return GL40C.glIsTransformFeedback(id); + } + + // --- [ glPauseTransformFeedback ] --- + + /** + * Pauses transform feedback operations for the currently bound transform feedback object. + * + *

When transform feedback operations are paused, transform feedback is still considered active and changing most transform feedback state related to the + * object results in an error. However, a new transform feedback object may be bound while transform feedback is paused. The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} + * is generated by PauseTransformFeedback if the currently bound transform feedback is not active or is paused.

+ * + *

When transform feedback is active and not paused, all geometric primitives generated must be compatible with the value of {@code primitiveMode} passed + * to {@link GL30C#glBeginTransformFeedback BeginTransformFeedback}. The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated by {@link GL11#glBegin Begin} or any operation that implicitly calls {@link GL11#glBegin Begin} + * (such as {@link GL11C#glDrawElements DrawElements}) if {@code mode} is not one of the allowed modes. If a geometry shader is active, its output primitive type is used instead + * of the {@code mode} parameter passed to {@link GL11#glBegin Begin} for the purposes of this error check. Any primitive type may be used while transform feedback is + * paused.

+ */ + public static void glPauseTransformFeedback() { + GL40C.glPauseTransformFeedback(); + } + + // --- [ glResumeTransformFeedback ] --- + + /** + * Resumes transform feedback operations for the currently bound transform feedback object. + * + *

The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated by {@link #glResumeTransformFeedback ResumeTransformFeedback} if the currently bound transform feedback is not active or is not paused.

+ */ + public static void glResumeTransformFeedback() { + GL40C.glResumeTransformFeedback(); + } + + // --- [ glDrawTransformFeedback ] --- + + /** + * Render primitives using a count derived from a transform feedback object. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40C#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param id the name of a transform feedback object from which to retrieve a primitive count + */ + public static void glDrawTransformFeedback(@NativeType("GLenum") int mode, @NativeType("GLuint") int id) { + GL40C.glDrawTransformFeedback(mode, id); + } + + /** Array version of: {@link #glDeleteTransformFeedbacks DeleteTransformFeedbacks} */ + public static void glDeleteTransformFeedbacks(@NativeType("GLuint const *") int[] ids) { + GL40C.glDeleteTransformFeedbacks(ids); + } + + /** Array version of: {@link #glGenTransformFeedbacks GenTransformFeedbacks} */ + public static void glGenTransformFeedbacks(@NativeType("GLuint *") int[] ids) { + GL40C.glGenTransformFeedbacks(ids); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTransformFeedback3.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTransformFeedback3.java new file mode 100644 index 00000000..f7db2782 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTransformFeedback3.java @@ -0,0 +1,141 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_transform_feedback3 extension. + * + *

This extension further extends the transform feedback capabilities provided by the {@link EXTTransformFeedback EXT_transform_feedback}, {@link NVTransformFeedback NV_transform_feedback}, and + * {@link NVTransformFeedback2 NV_transform_feedback2} extensions. Those extensions provided a new transform feedback mode, where selected vertex attributes can be recorded to + * a buffer object for each primitive processed by the GL.

+ * + *

This extension provides increased flexibility in how vertex attributes can be written to buffer objects. Previous extensions allowed applications to + * record a set of attributes interleaved into a single buffer object (interleaved mode) or to record into multiple objects, but with only a single + * attribute per buffer (separate mode). This extension extends interleaved mode to write into multiple buffers, with multiple attributes per buffer. This + * capability is supported for all three styles of transform feedback:

+ * + *
    + *
  • "EXT"-style GLSL transform feedback ({@link EXTTransformFeedback EXT_transform_feedback}), where a list of varyings is provided prior to linking a program object and is + * used whenever that program object is used.
  • + *
  • "NV"-style GLSL transform feedback ({@link NVTransformFeedback2 NV_transform_feedback2}), where "locations" of active varyings are queried after linking + * and are then passed to a function that sets the active transform feedback varyings for the program object. Unlike the "EXT"-style mode, the set of + * varyings to capture can be changed without relinking.
  • + *
  • Transform feedback for fixed-function or assembly vertex/geometry shaders ({@link NVTransformFeedback2 NV_transform_feedback2}), where applications specify a set of + * canonical attribute enums/numbers to capture.
  • + *
+ * + *

Additionally, this extension adds new support for multiple separate vertex streams. New geometry shader functionality provided by the + * {@link ARBGPUShader5 ARB_gpu_shader5} and NV_gpu_program5 extensions allows geometry shaders to direct each vertex arbitrarily at a specified + * vertex stream. For example, a geometry program might write each "regular" vertex it emits to one vertex stream while writing some per-primitive data it + * computes to a second vertex stream. This extension allows applications to choose a vertex stream for each buffer object it writes to, and allows the + * vertices written to each vertex stream to be recorded in separate buffer objects. Only one stream may be selected for rasterization, and in the initial + * implementation, the geometry shader output topology must be {@link GL11#GL_POINTS POINTS} if multiple streams are used. When geometry shaders are not used, or when an old + * geometry shader not writing multiple streams is used, all vertices produced by the GL are directed at the stream numbered zero. The set of transform + * feedback-related query targets is extended to accommodate multiple vertex streams, so it is possible to count the number of processed and recorded + * primitives for each stream separately.

+ * + *

Requires {@link GL30 OpenGL 3.0} or {@link EXTTransformFeedback EXT_transform_feedback} or {@link NVTransformFeedback NV_transform_feedback}. Promoted to core in {@link GL40 OpenGL 4.0}.

+ */ +public class ARBTransformFeedback3 { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_MAX_TRANSFORM_FEEDBACK_BUFFERS = 0x8E70, + GL_MAX_VERTEX_STREAMS = 0x8E71; + + static { GL.initialize(); } + + protected ARBTransformFeedback3() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glDrawTransformFeedbackStream, caps.glBeginQueryIndexed, caps.glEndQueryIndexed, caps.glGetQueryIndexediv + ); + } + + // --- [ glDrawTransformFeedbackStream ] --- + + /** + * Renders primitives using a count derived from a specifed stream of a transform feedback object. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40C#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param id the name of a transform feedback object from which to retrieve a primitive count + * @param stream the index of the transform feedback stream from which to retrieve a primitive count + */ + public static void glDrawTransformFeedbackStream(@NativeType("GLenum") int mode, @NativeType("GLuint") int id, @NativeType("GLuint") int stream) { + GL40C.glDrawTransformFeedbackStream(mode, id, stream); + } + + // --- [ glBeginQueryIndexed ] --- + + /** + * Begins a query object on an indexed target + * + * @param target the target type of query object established between {@code glBeginQueryIndexed} and the subsequent {@link #glEndQueryIndexed EndQueryIndexed}. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param index the index of the query target upon which to begin the query + * @param id the name of a query object + */ + public static void glBeginQueryIndexed(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLuint") int id) { + GL40C.glBeginQueryIndexed(target, index, id); + } + + // --- [ glEndQueryIndexed ] --- + + /** + * Ends a query object on an indexed target + * + * @param target the target type of query object to be concluded. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param index the index of the query target upon which to end the query + */ + public static void glEndQueryIndexed(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + GL40C.glEndQueryIndexed(target, index); + } + + // --- [ glGetQueryIndexediv ] --- + + /** Unsafe version of: {@link #glGetQueryIndexediv GetQueryIndexediv} */ + public static void nglGetQueryIndexediv(int target, int index, int pname, long params) { + GL40C.nglGetQueryIndexediv(target, index, pname, params); + } + + /** + * Returns parameters of an indexed query object target. + * + * @param target a query object target. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param index the index of the query object target + * @param pname the symbolic name of a query object target parameter + * @param params the requested data + */ + public static void glGetQueryIndexediv(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL40C.glGetQueryIndexediv(target, index, pname, params); + } + + /** + * Returns parameters of an indexed query object target. + * + * @param target a query object target. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param index the index of the query object target + * @param pname the symbolic name of a query object target parameter + */ + @NativeType("void") + public static int glGetQueryIndexedi(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + return GL40C.glGetQueryIndexedi(target, index, pname); + } + + /** Array version of: {@link #glGetQueryIndexediv GetQueryIndexediv} */ + public static void glGetQueryIndexediv(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL40C.glGetQueryIndexediv(target, index, pname, params); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTransformFeedbackInstanced.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTransformFeedbackInstanced.java new file mode 100644 index 00000000..bc7f1462 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTransformFeedbackInstanced.java @@ -0,0 +1,65 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_transform_feedback_instanced extension. + * + *

Multiple instances of geometry may be specified to the GL by calling functions such as {@link GL31C#glDrawArraysInstanced DrawArraysInstanced} and {@link GL31C#glDrawElementsInstanced DrawElementsInstanced}. + * Further, the results of a transform feedback operation may be returned to the GL by calling {@link GL40C#glDrawTransformFeedback DrawTransformFeedback}, or + * {@link GL40C#glDrawTransformFeedbackStream DrawTransformFeedbackStream}. However, it is not presently possible to draw multiple instances of data transform feedback without using a query + * and the resulting round trip from server to client.

+ * + *

This extension adds functionality to draw multiple instances of the result of a transform feedback operation.

+ * + *

Requires {@link GL40 OpenGL 4.0} or {@link ARBTransformFeedback2 ARB_transform_feedback2}. Requires {@link GL31 OpenGL 3.1} or {@link ARBDrawInstanced ARB_draw_instanced}. Promoted to core in {@link GL42 OpenGL 4.2}.

+ */ +public class ARBTransformFeedbackInstanced { + + static { GL.initialize(); } + + protected ARBTransformFeedbackInstanced() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glDrawTransformFeedbackInstanced, caps.glDrawTransformFeedbackStreamInstanced + ); + } + + // --- [ glDrawTransformFeedbackInstanced ] --- + + /** + * Renders multiple instances of primitives using a count derived from a transform feedback object. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param id the name of a transform feedback object from which to retrieve a primitive count + * @param primcount the number of instances of the geometry to render + */ + public static void glDrawTransformFeedbackInstanced(@NativeType("GLenum") int mode, @NativeType("GLuint") int id, @NativeType("GLsizei") int primcount) { + GL42C.glDrawTransformFeedbackInstanced(mode, id, primcount); + } + + // --- [ glDrawTransformFeedbackStreamInstanced ] --- + + /** + * Renders multiple instances of primitives using a count derived from a specifed stream of a transform feedback object. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param id the name of a transform feedback object from which to retrieve a primitive count + * @param stream the index of the transform feedback stream from which to retrieve a primitive count + * @param primcount the number of instances of the geometry to render + */ + public static void glDrawTransformFeedbackStreamInstanced(@NativeType("GLenum") int mode, @NativeType("GLuint") int id, @NativeType("GLuint") int stream, @NativeType("GLsizei") int primcount) { + GL42C.glDrawTransformFeedbackStreamInstanced(mode, id, stream, primcount); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTransformFeedbackOverflowQuery.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTransformFeedbackOverflowQuery.java new file mode 100644 index 00000000..3ad17a97 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTransformFeedbackOverflowQuery.java @@ -0,0 +1,28 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_transform_feedback_overflow_query extension. + * + *

This extension adds new query types which can be used to detect overflow of transform feedback buffers. The new query types are also accepted by + * conditional rendering commands.

+ * + *

Requires {@link GL30 OpenGL 3.0}.

+ */ +public final class ARBTransformFeedbackOverflowQuery { + + /** + * Accepted by the {@code target} parameter of {@link GL15C#glBeginQuery BeginQuery}, {@link GL15C#glEndQuery EndQuery}, {@link GL15C#glGetQueryiv GetQueryiv}, + * {@link GL40C#glBeginQueryIndexed BeginQueryIndexed}, {@link GL40C#glEndQueryIndexed EndQueryIndexed} and {@link GL40C#glGetQueryIndexediv GetQueryIndexediv}. + */ + public static final int + GL_TRANSFORM_FEEDBACK_OVERFLOW_ARB = 0x82EC, + GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW_ARB = 0x82ED; + + private ARBTransformFeedbackOverflowQuery() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTransposeMatrix.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTransposeMatrix.java new file mode 100644 index 00000000..2b0a3263 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBTransposeMatrix.java @@ -0,0 +1,167 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_transpose_matrix extension. + * + *

New functions and tokens are added allowing application matrices stored in row major order rather than column major order to be transferred to the + * OpenGL implementation. This allows an application to use standard C-language 2-dimensional arrays ({@code m[row][col]}) and have the array indices match the + * expected matrix row and column indexes. These arrays are referred to as transpose matrices since they are the transpose of the standard matrices passed + * to OpenGL.

+ * + *

This extension adds an interface for transfering data to and from the OpenGL pipeline, it does not change any OpenGL processing or imply any changes in + * state representation.

+ * + *

Promoted to core in {@link GL13 OpenGL 1.3}.

+ */ +public class ARBTransposeMatrix { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_TRANSPOSE_MODELVIEW_MATRIX_ARB = 0x84E3, + GL_TRANSPOSE_PROJECTION_MATRIX_ARB = 0x84E4, + GL_TRANSPOSE_TEXTURE_MATRIX_ARB = 0x84E5, + GL_TRANSPOSE_COLOR_MATRIX_ARB = 0x84E6; + + static { GL.initialize(); } + + protected ARBTransposeMatrix() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glLoadTransposeMatrixfARB, caps.glLoadTransposeMatrixdARB, caps.glMultTransposeMatrixfARB, caps.glMultTransposeMatrixdARB + ); + } + + // --- [ glLoadTransposeMatrixfARB ] --- + + /** Unsafe version of: {@link #glLoadTransposeMatrixfARB LoadTransposeMatrixfARB} */ + public static native void nglLoadTransposeMatrixfARB(long m); + + /** + * Sets the current matrix to a 4 × 4 matrix in row-major order. + * + *

The matrix is stored as 16 consecutive values, i.e. as:

+ * + * + * + * + * + * + *
a1a2a3a4
a5a6a7a8
a9a10a11a12
a13a14a15a16
+ * + * @param m the matrix data + */ + public static void glLoadTransposeMatrixfARB(@NativeType("GLfloat const *") FloatBuffer m) { + if (CHECKS) { + check(m, 16); + } + nglLoadTransposeMatrixfARB(memAddress(m)); + } + + // --- [ glLoadTransposeMatrixdARB ] --- + + /** Unsafe version of: {@link #glLoadTransposeMatrixdARB LoadTransposeMatrixdARB} */ + public static native void nglLoadTransposeMatrixdARB(long m); + + /** + * Double version of {@link #glLoadTransposeMatrixfARB LoadTransposeMatrixfARB}. + * + * @param m the matrix data + */ + public static void glLoadTransposeMatrixdARB(@NativeType("GLdouble const *") DoubleBuffer m) { + if (CHECKS) { + check(m, 16); + } + nglLoadTransposeMatrixdARB(memAddress(m)); + } + + // --- [ glMultTransposeMatrixfARB ] --- + + /** Unsafe version of: {@link #glMultTransposeMatrixfARB MultTransposeMatrixfARB} */ + public static native void nglMultTransposeMatrixfARB(long m); + + /** + * Multiplies the current matrix with a 4 × 4 matrix in row-major order. See {@link #glLoadTransposeMatrixfARB LoadTransposeMatrixfARB} for details. + * + * @param m the matrix data + */ + public static void glMultTransposeMatrixfARB(@NativeType("GLfloat const *") FloatBuffer m) { + if (CHECKS) { + check(m, 16); + } + nglMultTransposeMatrixfARB(memAddress(m)); + } + + // --- [ glMultTransposeMatrixdARB ] --- + + /** Unsafe version of: {@link #glMultTransposeMatrixdARB MultTransposeMatrixdARB} */ + public static native void nglMultTransposeMatrixdARB(long m); + + /** + * Double version of {@link #glMultTransposeMatrixfARB MultTransposeMatrixfARB}. + * + * @param m the matrix data + */ + public static void glMultTransposeMatrixdARB(@NativeType("GLdouble const *") DoubleBuffer m) { + if (CHECKS) { + check(m, 16); + } + nglMultTransposeMatrixdARB(memAddress(m)); + } + + /** Array version of: {@link #glLoadTransposeMatrixfARB LoadTransposeMatrixfARB} */ + public static void glLoadTransposeMatrixfARB(@NativeType("GLfloat const *") float[] m) { + long __functionAddress = GL.getICD().glLoadTransposeMatrixfARB; + if (CHECKS) { + check(__functionAddress); + check(m, 16); + } + callPV(m, __functionAddress); + } + + /** Array version of: {@link #glLoadTransposeMatrixdARB LoadTransposeMatrixdARB} */ + public static void glLoadTransposeMatrixdARB(@NativeType("GLdouble const *") double[] m) { + long __functionAddress = GL.getICD().glLoadTransposeMatrixdARB; + if (CHECKS) { + check(__functionAddress); + check(m, 16); + } + callPV(m, __functionAddress); + } + + /** Array version of: {@link #glMultTransposeMatrixfARB MultTransposeMatrixfARB} */ + public static void glMultTransposeMatrixfARB(@NativeType("GLfloat const *") float[] m) { + long __functionAddress = GL.getICD().glMultTransposeMatrixfARB; + if (CHECKS) { + check(__functionAddress); + check(m, 16); + } + callPV(m, __functionAddress); + } + + /** Array version of: {@link #glMultTransposeMatrixdARB MultTransposeMatrixdARB} */ + public static void glMultTransposeMatrixdARB(@NativeType("GLdouble const *") double[] m) { + long __functionAddress = GL.getICD().glMultTransposeMatrixdARB; + if (CHECKS) { + check(__functionAddress); + check(m, 16); + } + callPV(m, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBUniformBufferObject.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBUniformBufferObject.java new file mode 100644 index 00000000..1225d62f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBUniformBufferObject.java @@ -0,0 +1,490 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_uniform_buffer_object extension. + * + *

This extension introduces the concept of a group of GLSL uniforms known as a "uniform block", and the API mechanisms to store "uniform blocks" in GL + * buffer objects.

+ * + *

The extension also defines both a standard cross-platform layout in memory for uniform block data, as well as mechanisms to allow the GL to optimize the + * data layout in an implementation-defined manner.

+ * + *

Prior to this extension, the existing interface for modification of uniform values allowed modification of large numbers of values using glUniform* + * calls, but only for a single uniform name (or a uniform array) at a time. However, updating uniforms in this manner may not map well to heterogenous + * uniform data structures defined for a GL application and in these cases, the application is forced to either:

+ * + *
    + *
  1. restructure their uniform data definitions into arrays or
  2. + *
  3. make an excessive number of calls through the GL interface to one of the Uniform* variants.
  4. + *
+ * + *

These solutions have their disadvantages. Solution A imposes considerable development overhead on the application developer. Solution B may impose + * considerable run-time overhead on the application if the number of uniforms modified in a given frame of rendering is sufficiently large.

+ * + *

This extension provides a better alternative to either (A) or (B) by allowing buffer object backing for the storage associated with all uniforms of a + * given GLSL program.

+ * + *

Storing uniform blocks in buffer objects enables several key use cases:

+ * + *
    + *
  • sharing of uniform data storage between program objects and between program stages
  • + *
  • rapid swapping of sets of previously defined uniforms by storing sets of uniform data on the GL server
  • + *
  • rapid updates of uniform data from both the client and the server
  • + *
+ * + *

The data storage for a uniform block can be declared to use one of three layouts in memory: packed, shared, or std140.

+ * + *
    + *
  • "packed" uniform blocks have an implementation-dependent data layout for efficiency, and unused uniforms may be eliminated by the compiler to save + * space.
  • + *
  • "shared" uniform blocks, the default layout, have an implementation-dependent data layout for efficiency, but the layout will be uniquely determined + * by the structure of the block, allowing data storage to be shared across programs.
  • + *
  • "std140" uniform blocks have a standard cross-platform cross-vendor layout (see below). Unused uniforms will not be eliminated.
  • + *
+ * + *

Any uniforms not declared in a named uniform block are said to be part of the "default uniform block".

+ * + *

While uniforms in the default uniform block are updated with glUniform* entry points and can have static initializers, uniforms in named uniform blocks + * are not. Instead, uniform block data is updated using the routines that update buffer objects and can not use static initializers.

+ * + *

Rules and Concepts Guiding this Specification:

+ * + *

For reference, a uniform has a "uniform index" (subsequently referred to as "u_index) and also a "uniform location" to efficiently identify it in the + * uniform data store of the implementation. We subsequently refer to this uniform data store of the implementation as the "uniform database".

+ * + *

A "uniform block" only has a "uniform block index" used for queries and connecting the "uniform block" to a buffer object. A "uniform block" has no + * "location" because "uniform blocks" are not updated directly. The buffer object APIs are used instead.

+ * + *

Properties of Uniforms and uniform blocks:

+ * + *
    + *
  1. A uniform is "active" if it exists in the database and has a valid u_index.
  2. + *
  3. A "uniform block" is "active" if it exists in the database and has a valid ub_index.
  4. + *
  5. Uniforms and "uniform blocks" can be inactive because they don't exist in the source, or because they have been removed by dead code elimination.
  6. + *
  7. An inactive uniform has u_index == {@link #GL_INVALID_INDEX INVALID_INDEX}.
  8. + *
  9. An inactive uniform block has ub_index == {@link #GL_INVALID_INDEX INVALID_INDEX}.
  10. + *
  11. A u_index or ub_index of {@link #GL_INVALID_INDEX INVALID_INDEX} generates the {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error if given as a function argument.
  12. + *
  13. The default uniform block, which is not assigned any ub_index, uses a private, internal data storage, and does not have any buffer object associated + * with it.
  14. + *
  15. An active uniform that is a member of the default uniform block has location ≥ 0 and it has offset == stride == -1.
  16. + *
  17. An active uniform that is a member of a named uniform block has location == -1.
  18. + *
  19. A uniform location of -1 is silently ignored if given as a function argument.
  20. + *
  21. Uniform block declarations may not be nested
  22. + *
+ * + *

Requires {@link GL20 OpenGL 2.0} or {@link ARBShaderObjects ARB_shader_objects} and {@link GL15 OpenGL 1.5} or {@link ARBVertexBufferObject ARB_vertex_buffer_object}. Promoted to core in {@link GL31 OpenGL 3.1}.

+ */ +public class ARBUniformBufferObject { + + /** Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, and GetBufferPointerv. */ + public static final int GL_UNIFORM_BUFFER = 0x8A11; + + /** Accepted by the {@code pname} parameter of GetIntegeri_v, GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_UNIFORM_BUFFER_BINDING = 0x8A28; + + /** Accepted by the {@code pname} parameter of GetIntegeri_v. */ + public static final int + GL_UNIFORM_BUFFER_START = 0x8A29, + GL_UNIFORM_BUFFER_SIZE = 0x8A2A; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B, + GL_MAX_GEOMETRY_UNIFORM_BLOCKS = 0x8A2C, + GL_MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D, + GL_MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E, + GL_MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F, + GL_MAX_UNIFORM_BLOCK_SIZE = 0x8A30, + GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31, + GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 0x8A32, + GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33, + GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34; + + /** Accepted by the {@code pname} parameter of GetProgramiv. */ + public static final int + GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35, + GL_ACTIVE_UNIFORM_BLOCKS = 0x8A36; + + /** Accepted by the {@code pname} parameter of GetActiveUniformsiv. */ + public static final int + GL_UNIFORM_TYPE = 0x8A37, + GL_UNIFORM_SIZE = 0x8A38, + GL_UNIFORM_NAME_LENGTH = 0x8A39, + GL_UNIFORM_BLOCK_INDEX = 0x8A3A, + GL_UNIFORM_OFFSET = 0x8A3B, + GL_UNIFORM_ARRAY_STRIDE = 0x8A3C, + GL_UNIFORM_MATRIX_STRIDE = 0x8A3D, + GL_UNIFORM_IS_ROW_MAJOR = 0x8A3E; + + /** Accepted by the {@code pname} parameter of GetActiveUniformBlockiv. */ + public static final int + GL_UNIFORM_BLOCK_BINDING = 0x8A3F, + GL_UNIFORM_BLOCK_DATA_SIZE = 0x8A40, + GL_UNIFORM_BLOCK_NAME_LENGTH = 0x8A41, + GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42, + GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43, + GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44, + GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 0x8A45, + GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46; + + /** Returned by GetActiveUniformsiv and GetUniformBlockIndex. */ + public static final int GL_INVALID_INDEX = 0xFFFFFFFF; + + static { GL.initialize(); } + + protected ARBUniformBufferObject() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glGetUniformIndices, caps.glGetActiveUniformsiv, caps.glGetActiveUniformName, caps.glGetUniformBlockIndex, caps.glGetActiveUniformBlockiv, + caps.glGetActiveUniformBlockName, caps.glBindBufferRange, caps.glBindBufferBase, caps.glGetIntegeri_v, caps.glUniformBlockBinding + ); + } + + // --- [ glGetUniformIndices ] --- + + /** + * Unsafe version of: {@link #glGetUniformIndices GetUniformIndices} + * + * @param uniformCount the number of uniforms whose indices to query + */ + public static void nglGetUniformIndices(int program, int uniformCount, long uniformNames, long uniformIndices) { + GL31C.nglGetUniformIndices(program, uniformCount, uniformNames, uniformIndices); + } + + /** + * Retrieves the indices of a number of uniforms within a program object + * + * @param program the name of a program containing uniforms whose indices to query + * @param uniformNames an array of pointers to buffers containing the names of the queried uniforms + * @param uniformIndices an array that will receive the indices of the uniforms + */ + public static void glGetUniformIndices(@NativeType("GLuint") int program, @NativeType("GLchar const **") PointerBuffer uniformNames, @NativeType("GLuint *") IntBuffer uniformIndices) { + GL31C.glGetUniformIndices(program, uniformNames, uniformIndices); + } + + /** + * Retrieves the indices of a number of uniforms within a program object + * + * @param program the name of a program containing uniforms whose indices to query + * @param uniformNames an array of pointers to buffers containing the names of the queried uniforms + * @param uniformIndices an array that will receive the indices of the uniforms + */ + public static void glGetUniformIndices(@NativeType("GLuint") int program, @NativeType("GLchar const **") CharSequence[] uniformNames, @NativeType("GLuint *") IntBuffer uniformIndices) { + GL31C.glGetUniformIndices(program, uniformNames, uniformIndices); + } + + /** + * Retrieves the indices of a number of uniforms within a program object + * + * @param program the name of a program containing uniforms whose indices to query + */ + @NativeType("void") + public static int glGetUniformIndices(@NativeType("GLuint") int program, @NativeType("GLchar const **") CharSequence uniformName) { + return GL31C.glGetUniformIndices(program, uniformName); + } + + // --- [ glGetActiveUniformsiv ] --- + + /** + * Unsafe version of: {@link #glGetActiveUniformsiv GetActiveUniformsiv} + * + * @param uniformCount the number of elements in the array of indices {@code uniformIndices} and the number of parameters written to {@code params} upon successful return + */ + public static void nglGetActiveUniformsiv(int program, int uniformCount, long uniformIndices, int pname, long params) { + GL31C.nglGetActiveUniformsiv(program, uniformCount, uniformIndices, pname, params); + } + + /** + * Returns information about several active uniform variables for the specified program object. + * + * @param program the program object to be queried + * @param uniformIndices an array of {@code uniformCount} integers containing the indices of uniforms within {@code program} + * @param pname the property of the each uniform in {@code uniformIndices} that should be written into the corresponding element of {@code params} + * @param params an array of {@code uniformCount} integers which are to receive the value of {@code pname} for each uniform in {@code uniformIndices} + */ + public static void glGetActiveUniformsiv(@NativeType("GLuint") int program, @NativeType("GLuint const *") IntBuffer uniformIndices, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL31C.glGetActiveUniformsiv(program, uniformIndices, pname, params); + } + + /** + * Returns information about several active uniform variables for the specified program object. + * + * @param program the program object to be queried + * @param pname the property of the each uniform in {@code uniformIndices} that should be written into the corresponding element of {@code params} + */ + @NativeType("void") + public static int glGetActiveUniformsi(@NativeType("GLuint") int program, @NativeType("GLuint const *") int uniformIndex, @NativeType("GLenum") int pname) { + return GL31C.glGetActiveUniformsi(program, uniformIndex, pname); + } + + // --- [ glGetActiveUniformName ] --- + + /** + * Unsafe version of: {@link #glGetActiveUniformName GetActiveUniformName} + * + * @param bufSize the size of the buffer, in units of {@code GLchar}, of the buffer whose address is specified in {@code uniformName} + */ + public static void nglGetActiveUniformName(int program, int uniformIndex, int bufSize, long length, long uniformName) { + GL31C.nglGetActiveUniformName(program, uniformIndex, bufSize, length, uniformName); + } + + /** + * Queries the name of an active uniform. + * + * @param program the program containing the active uniform index {@code uniformIndex} + * @param uniformIndex the index of the active uniform whose name to query + * @param length the address of a variable that will receive the number of characters that were or would have been written to the buffer addressed by {@code uniformName} + * @param uniformName the address of a buffer into which the GL will place the name of the active uniform at {@code uniformIndex} within {@code program} + */ + public static void glGetActiveUniformName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformIndex, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer uniformName) { + GL31C.glGetActiveUniformName(program, uniformIndex, length, uniformName); + } + + /** + * Queries the name of an active uniform. + * + * @param program the program containing the active uniform index {@code uniformIndex} + * @param uniformIndex the index of the active uniform whose name to query + * @param bufSize the size of the buffer, in units of {@code GLchar}, of the buffer whose address is specified in {@code uniformName} + */ + @NativeType("void") + public static String glGetActiveUniformName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformIndex, @NativeType("GLsizei") int bufSize) { + return GL31C.glGetActiveUniformName(program, uniformIndex, bufSize); + } + + /** + * Queries the name of an active uniform. + * + * @param program the program containing the active uniform index {@code uniformIndex} + * @param uniformIndex the index of the active uniform whose name to query + */ + @NativeType("void") + public static String glGetActiveUniformName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformIndex) { + return glGetActiveUniformName(program, uniformIndex, glGetActiveUniformsi(program, uniformIndex, GL_UNIFORM_NAME_LENGTH)); + } + + // --- [ glGetUniformBlockIndex ] --- + + /** Unsafe version of: {@link #glGetUniformBlockIndex GetUniformBlockIndex} */ + public static int nglGetUniformBlockIndex(int program, long uniformBlockName) { + return GL31C.nglGetUniformBlockIndex(program, uniformBlockName); + } + + /** + * Retrieves the index of a named uniform block. + * + * @param program the name of a program containing the uniform block + * @param uniformBlockName an array of characters to containing the name of the uniform block whose index to retrieve + */ + @NativeType("GLuint") + public static int glGetUniformBlockIndex(@NativeType("GLuint") int program, @NativeType("GLchar const *") ByteBuffer uniformBlockName) { + return GL31C.glGetUniformBlockIndex(program, uniformBlockName); + } + + /** + * Retrieves the index of a named uniform block. + * + * @param program the name of a program containing the uniform block + * @param uniformBlockName an array of characters to containing the name of the uniform block whose index to retrieve + */ + @NativeType("GLuint") + public static int glGetUniformBlockIndex(@NativeType("GLuint") int program, @NativeType("GLchar const *") CharSequence uniformBlockName) { + return GL31C.glGetUniformBlockIndex(program, uniformBlockName); + } + + // --- [ glGetActiveUniformBlockiv ] --- + + /** Unsafe version of: {@link #glGetActiveUniformBlockiv GetActiveUniformBlockiv} */ + public static void nglGetActiveUniformBlockiv(int program, int uniformBlockIndex, int pname, long params) { + GL31C.nglGetActiveUniformBlockiv(program, uniformBlockIndex, pname, params); + } + + /** + * Queries information about an active uniform block. + * + * @param program the name of a program containing the uniform block + * @param uniformBlockIndex the index of the uniform block within {@code program} + * @param pname the name of the parameter to query. One of:
{@link GL31C#GL_UNIFORM_BLOCK_BINDING UNIFORM_BLOCK_BINDING}{@link GL31C#GL_UNIFORM_BLOCK_DATA_SIZE UNIFORM_BLOCK_DATA_SIZE}
{@link GL31C#GL_UNIFORM_BLOCK_NAME_LENGTH UNIFORM_BLOCK_NAME_LENGTH}{@link GL31C#GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS UNIFORM_BLOCK_ACTIVE_UNIFORMS}
{@link GL31C#GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES}{@link GL31C#GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER}
{@link GL31C#GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER}{@link GL31C#GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER}
+ * @param params the address of a variable to receive the result of the query + */ + public static void glGetActiveUniformBlockiv(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL31C.glGetActiveUniformBlockiv(program, uniformBlockIndex, pname, params); + } + + /** + * Queries information about an active uniform block. + * + * @param program the name of a program containing the uniform block + * @param uniformBlockIndex the index of the uniform block within {@code program} + * @param pname the name of the parameter to query. One of:
{@link GL31C#GL_UNIFORM_BLOCK_BINDING UNIFORM_BLOCK_BINDING}{@link GL31C#GL_UNIFORM_BLOCK_DATA_SIZE UNIFORM_BLOCK_DATA_SIZE}
{@link GL31C#GL_UNIFORM_BLOCK_NAME_LENGTH UNIFORM_BLOCK_NAME_LENGTH}{@link GL31C#GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS UNIFORM_BLOCK_ACTIVE_UNIFORMS}
{@link GL31C#GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES}{@link GL31C#GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER}
{@link GL31C#GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER}{@link GL31C#GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER}
+ */ + @NativeType("void") + public static int glGetActiveUniformBlocki(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex, @NativeType("GLenum") int pname) { + return GL31C.glGetActiveUniformBlocki(program, uniformBlockIndex, pname); + } + + // --- [ glGetActiveUniformBlockName ] --- + + /** + * Unsafe version of: {@link #glGetActiveUniformBlockName GetActiveUniformBlockName} + * + * @param bufSize the size of the buffer addressed by {@code uniformBlockName} + */ + public static void nglGetActiveUniformBlockName(int program, int uniformBlockIndex, int bufSize, long length, long uniformBlockName) { + GL31C.nglGetActiveUniformBlockName(program, uniformBlockIndex, bufSize, length, uniformBlockName); + } + + /** + * Retrieves the name of an active uniform block. + * + * @param program the name of a program containing the uniform block + * @param uniformBlockIndex the index of the uniform block within {@code program} + * @param length the address of a variable to receive the number of characters that were written to {@code uniformBlockName} + * @param uniformBlockName an array of characters to receive the name of the uniform block at {@code uniformBlockIndex} + */ + public static void glGetActiveUniformBlockName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer uniformBlockName) { + GL31C.glGetActiveUniformBlockName(program, uniformBlockIndex, length, uniformBlockName); + } + + /** + * Retrieves the name of an active uniform block. + * + * @param program the name of a program containing the uniform block + * @param uniformBlockIndex the index of the uniform block within {@code program} + * @param bufSize the size of the buffer addressed by {@code uniformBlockName} + */ + @NativeType("void") + public static String glGetActiveUniformBlockName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex, @NativeType("GLsizei") int bufSize) { + return GL31C.glGetActiveUniformBlockName(program, uniformBlockIndex, bufSize); + } + + /** + * Retrieves the name of an active uniform block. + * + * @param program the name of a program containing the uniform block + * @param uniformBlockIndex the index of the uniform block within {@code program} + */ + @NativeType("void") + public static String glGetActiveUniformBlockName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex) { + return glGetActiveUniformBlockName(program, uniformBlockIndex, glGetActiveUniformBlocki(program, uniformBlockIndex, GL_UNIFORM_BLOCK_NAME_LENGTH)); + } + + // --- [ glBindBufferRange ] --- + + /** + * Binds a range within a buffer object to an indexed buffer target. + * + * @param target the target of the bind operation. One of:
{@link GL30C#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}
+ * @param index the index of the binding point within the array specified by {@code target} + * @param buffer a buffer object to bind to the specified binding point + * @param offset the starting offset in basic machine units into the buffer object {@code buffer} + * @param size the amount of data in machine units that can be read from the buffer object while used as an indexed target + */ + public static void glBindBufferRange(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size) { + GL30C.glBindBufferRange(target, index, buffer, offset, size); + } + + // --- [ glBindBufferBase ] --- + + /** + * Binds a buffer object to an indexed buffer target. + * + * @param target the target of the bind operation. One of:
{@link GL30C#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}
+ * @param index the index of the binding point within the array specified by {@code target} + * @param buffer a buffer object to bind to the specified binding point + */ + public static void glBindBufferBase(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLuint") int buffer) { + GL30C.glBindBufferBase(target, index, buffer); + } + + // --- [ glGetIntegeri_v ] --- + + /** Unsafe version of: {@link #glGetIntegeri_v GetIntegeri_v} */ + public static void nglGetIntegeri_v(int target, int index, long data) { + GL30C.nglGetIntegeri_v(target, index, data); + } + + /** + * Queries the integer value of an indexed state variable. + * + * @param target the indexed state to query + * @param index the index of the element being queried + * @param data a scalar or buffer in which to place the returned data + */ + public static void glGetIntegeri_v(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLint *") IntBuffer data) { + GL30C.glGetIntegeri_v(target, index, data); + } + + /** + * Queries the integer value of an indexed state variable. + * + * @param target the indexed state to query + * @param index the index of the element being queried + */ + @NativeType("void") + public static int glGetIntegeri(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + return GL30C.glGetIntegeri(target, index); + } + + // --- [ glUniformBlockBinding ] --- + + /** + * Assigns a binding point to an active uniform block. + * + * @param program the name of a program object containing the active uniform block whose binding to assign + * @param uniformBlockIndex the index of the active uniform block within {@code program} whose binding to assign + * @param uniformBlockBinding the binding point to which to bind the uniform block with index {@code uniformBlockIndex} within {@code program} + */ + public static void glUniformBlockBinding(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex, @NativeType("GLuint") int uniformBlockBinding) { + GL31C.glUniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding); + } + + /** Array version of: {@link #glGetUniformIndices GetUniformIndices} */ + public static void glGetUniformIndices(@NativeType("GLuint") int program, @NativeType("GLchar const **") PointerBuffer uniformNames, @NativeType("GLuint *") int[] uniformIndices) { + GL31C.glGetUniformIndices(program, uniformNames, uniformIndices); + } + + /** Array version of: {@link #glGetActiveUniformsiv GetActiveUniformsiv} */ + public static void glGetActiveUniformsiv(@NativeType("GLuint") int program, @NativeType("GLuint const *") int[] uniformIndices, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL31C.glGetActiveUniformsiv(program, uniformIndices, pname, params); + } + + /** Array version of: {@link #glGetActiveUniformName GetActiveUniformName} */ + public static void glGetActiveUniformName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformIndex, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer uniformName) { + GL31C.glGetActiveUniformName(program, uniformIndex, length, uniformName); + } + + /** Array version of: {@link #glGetActiveUniformBlockiv GetActiveUniformBlockiv} */ + public static void glGetActiveUniformBlockiv(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL31C.glGetActiveUniformBlockiv(program, uniformBlockIndex, pname, params); + } + + /** Array version of: {@link #glGetActiveUniformBlockName GetActiveUniformBlockName} */ + public static void glGetActiveUniformBlockName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer uniformBlockName) { + GL31C.glGetActiveUniformBlockName(program, uniformBlockIndex, length, uniformBlockName); + } + + /** Array version of: {@link #glGetIntegeri_v GetIntegeri_v} */ + public static void glGetIntegeri_v(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLint *") int[] data) { + GL30C.glGetIntegeri_v(target, index, data); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexArrayBGRA.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexArrayBGRA.java new file mode 100644 index 00000000..34b6e14b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexArrayBGRA.java @@ -0,0 +1,56 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ARB_vertex_array_bgra extension. + * + *

This extension provides a single new component format for vertex arrays to read 4-component unsigned byte vertex attributes with a BGRA component + * ordering.

+ * + *

OpenGL expects vertex arrays containing 4 unsigned bytes per element to be in the RGBA, STRQ, or XYZW order (reading components left-to-right in their + * lower address to higher address order). Essentially the order the components appear in memory is the order the components appear in the resulting vertex + * attribute vector.

+ * + *

However Direct3D has color (diffuse and specular) vertex arrays containing 4 unsigned bytes per element that are in a BGRA order (again reading + * components left-to-right in their lower address to higher address order). Direct3D calls this "ARGB" reading the components in the opposite order + * (reading components left-to-right in their higher address to lower address order). This ordering is generalized in the DirectX 10 by the + * DXGI_FORMAT_B8G8R8A8_UNORM format.

+ * + *

For an OpenGL application to source color data from a vertex buffer formatted for Direct3D's color array format conventions, the application is forced + * to either:

+ * + *
    + *
  1. Rely on a vertex program or shader to swizzle the color components from the BGRA to conventional RGBA order.
  2. + *
  3. Re-order the color data components in the vertex buffer from Direct3D's native BGRA order to OpenGL's native RGBA order.
  4. + *
+ * + *

Neither option is entirely satisfactory.

+ * + *

Option 1 means vertex shaders have to be re-written to source colors differently. If the same vertex shader is used with vertex arrays configured to + * source the color as 4 floating-point color components, the swizzle for BGRA colors stored as 4 unsigned bytes is no longer appropriate. The shader's + * swizzling of colors becomes dependent on the type and number of color components. Ideally the vertex shader should be independent from the format and + * component ordering of the data it sources.

+ * + *

Option 2 is expensive because vertex buffers may have to be reformatted prior to use. OpenGL treats the memory for vertex arrays (whether client-side + * memory or buffer objects) as essentially untyped memory and vertex arrays can be stored separately, interleaved, or even interwoven (where multiple + * arrays overlap with differing strides and formats).

+ * + *

Rather than force a re-ordering of either vertex array components in memory or a vertex array format-dependent re-ordering of vertex shader inputs, + * OpenGL can simply provide a vertex array format that matches the Direct3D color component ordering.

+ * + *

This approach mimics that of the {@link EXTBGRA EXT_bgra} extension for pixel and texel formats except for vertex instead of image data.

+ * + *

Promoted to core in {@link GL32 OpenGL 3.2}.

+ */ +public final class ARBVertexArrayBGRA { + + /** Accepted by the {@code size} parameter of ColorPointer, SecondaryColorPointer, and VertexAttribPointer. */ + public static final int GL_BGRA = 0x80E1; + + private ARBVertexArrayBGRA() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexArrayObject.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexArrayObject.java new file mode 100644 index 00000000..a090d25e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexArrayObject.java @@ -0,0 +1,127 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_vertex_array_object extension. + * + *

This extension introduces named vertex array objects which encapsulate vertex array state on the client side. These objects allow applications to + * rapidly switch between large sets of array state. In addition, layered libraries can return to the default array state by simply creating and binding a + * new vertex array object.

+ * + *

This extension differs from GL_APPLE_vertex_array_object in that client memory cannot be accessed through a non-zero vertex array object. It also + * differs in that vertex array objects are explicitly not sharable between contexts.

+ * + *

Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ +public class ARBVertexArrayObject { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_VERTEX_ARRAY_BINDING = 0x85B5; + + static { GL.initialize(); } + + protected ARBVertexArrayObject() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBindVertexArray, caps.glDeleteVertexArrays, caps.glGenVertexArrays, caps.glIsVertexArray + ); + } + + // --- [ glBindVertexArray ] --- + + /** + * Binds a vertex array object + * + * @param array the name of the vertex array to bind + */ + public static void glBindVertexArray(@NativeType("GLuint") int array) { + GL30C.glBindVertexArray(array); + } + + // --- [ glDeleteVertexArrays ] --- + + /** + * Unsafe version of: {@link #glDeleteVertexArrays DeleteVertexArrays} + * + * @param n the number of vertex array objects to be deleted + */ + public static void nglDeleteVertexArrays(int n, long arrays) { + GL30C.nglDeleteVertexArrays(n, arrays); + } + + /** + * Deletes vertex array objects. + * + * @param arrays an array containing the n names of the objects to be deleted + */ + public static void glDeleteVertexArrays(@NativeType("GLuint const *") IntBuffer arrays) { + GL30C.glDeleteVertexArrays(arrays); + } + + /** Deletes vertex array objects. */ + public static void glDeleteVertexArrays(@NativeType("GLuint const *") int array) { + GL30C.glDeleteVertexArrays(array); + } + + // --- [ glGenVertexArrays ] --- + + /** + * Unsafe version of: {@link #glGenVertexArrays GenVertexArrays} + * + * @param n the number of vertex array object names to generate + */ + public static void nglGenVertexArrays(int n, long arrays) { + GL30C.nglGenVertexArrays(n, arrays); + } + + /** + * Generates vertex array object names. + * + * @param arrays a buffer in which the generated vertex array object names are stored + */ + public static void glGenVertexArrays(@NativeType("GLuint *") IntBuffer arrays) { + GL30C.glGenVertexArrays(arrays); + } + + /** Generates vertex array object names. */ + @NativeType("void") + public static int glGenVertexArrays() { + return GL30C.glGenVertexArrays(); + } + + // --- [ glIsVertexArray ] --- + + /** + * Determines if a name corresponds to a vertex array object. + * + * @param array a value that may be the name of a vertex array object + */ + @NativeType("GLboolean") + public static boolean glIsVertexArray(@NativeType("GLuint") int array) { + return GL30C.glIsVertexArray(array); + } + + /** Array version of: {@link #glDeleteVertexArrays DeleteVertexArrays} */ + public static void glDeleteVertexArrays(@NativeType("GLuint const *") int[] arrays) { + GL30C.glDeleteVertexArrays(arrays); + } + + /** Array version of: {@link #glGenVertexArrays GenVertexArrays} */ + public static void glGenVertexArrays(@NativeType("GLuint *") int[] arrays) { + GL30C.glGenVertexArrays(arrays); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexAttrib64Bit.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexAttrib64Bit.java new file mode 100644 index 00000000..9de44e47 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexAttrib64Bit.java @@ -0,0 +1,309 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_vertex_attrib_64bit extension. + * + *

This extension provides OpenGL shading language support for vertex shader inputs with 64-bit floating-point components and OpenGL API support for + * specifying the value of those inputs using vertex array or immediate mode entry points. This builds on the support for general-purpose support for + * 64-bit floating-point values in the ARB_gpu_shader_fp64 extension.

+ * + *

This extension provides a new class of vertex attribute functions, beginning with "VertexAttribL" ("L" for "long"), that can be used to specify + * attributes with 64-bit floating-point components. This extension provides no automatic type conversion between attribute and shader variables; + * single-precision attributes are not automatically converted to double-precision or vice versa. For shader variables with 64-bit component types, the + * "VertexAttribL" functions must be used to specify attribute values. For other shader variables, the "VertexAttribL" functions must not be used. If a + * vertex attribute is specified using the wrong attribute function, the values of the corresponding shader input are undefined. This approach requiring + * matching types is identical to that used for the "VertexAttribI" functions provided by OpenGL 3.0 and the {@link EXTGPUShader4 EXT_gpu_shader4} extension.

+ * + *

Additionally, some vertex shader inputs using the wider 64-bit components may count double against the implementation-dependent limit on the number of + * vertex shader attribute vectors. A 64-bit scalar or a two-component vector consumes only a single generic vertex attribute; three- and four-component + * "long" may count as two. This approach is similar to the one used in the current GL where matrix attributes consume multiple attributes.

+ * + *

Note that 64-bit generic vertex attributes were nominally supported beginning with the introduction of vertex shaders in OpenGL 2.0. However, the OpenGL + * Shading Language at the time had no support for 64-bit data types, so any such values were automatically converted to 32-bit.

+ * + *

Support for 64-bit floating-point vertex attributes in this extension can be combined with other extensions. In particular, this extension provides an + * entry point that can be used with EXT_direct_state_access to directly set state for any vertex array object. Also, the related + * {@link NVVertexAttribInteger64bit NV_vertex_attrib_integer_64bit} extension provides an entry point to specify bindless vertex attribute arrays with 64-bit + * components, integer or floating-point.

+ * + *

Requires {@link GL30 OpenGL 3.0}, GLSL 1.30 and {@link ARBGPUShaderFP64 ARB_gpu_shader_fp64}. Promoted to core in {@link GL41 OpenGL 4.1}.

+ */ +public class ARBVertexAttrib64Bit { + + /** Returned in the {@code type} parameter of GetActiveAttrib. */ + public static final int + GL_DOUBLE_VEC2 = 0x8FFC, + GL_DOUBLE_VEC3 = 0x8FFD, + GL_DOUBLE_VEC4 = 0x8FFE, + GL_DOUBLE_MAT2 = 0x8F46, + GL_DOUBLE_MAT3 = 0x8F47, + GL_DOUBLE_MAT4 = 0x8F48, + GL_DOUBLE_MAT2x3 = 0x8F49, + GL_DOUBLE_MAT2x4 = 0x8F4A, + GL_DOUBLE_MAT3x2 = 0x8F4B, + GL_DOUBLE_MAT3x4 = 0x8F4C, + GL_DOUBLE_MAT4x2 = 0x8F4D, + GL_DOUBLE_MAT4x3 = 0x8F4E; + + static { GL.initialize(); } + + protected ARBVertexAttrib64Bit() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glVertexAttribL1d, caps.glVertexAttribL2d, caps.glVertexAttribL3d, caps.glVertexAttribL4d, caps.glVertexAttribL1dv, caps.glVertexAttribL2dv, + caps.glVertexAttribL3dv, caps.glVertexAttribL4dv, caps.glVertexAttribLPointer, caps.glGetVertexAttribLdv, + ext.contains("GL_EXT_direct_state_access") ? caps.glVertexArrayVertexAttribLOffsetEXT : -1L + ); + } + + // --- [ glVertexAttribL1d ] --- + + /** + * Specifies the value of a generic vertex attribute. The y and z components are implicitly set to 0.0 and w to 1.0. + * + * @param index the index of the generic vertex attribute to be modified + * @param x the vertex attribute x component + */ + public static void glVertexAttribL1d(@NativeType("GLuint") int index, @NativeType("GLdouble") double x) { + GL41C.glVertexAttribL1d(index, x); + } + + // --- [ glVertexAttribL2d ] --- + + /** + * Specifies the value of a generic vertex attribute. The y component is implicitly set to 0.0 and w to 1.0. + * + * @param index the index of the generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + */ + public static void glVertexAttribL2d(@NativeType("GLuint") int index, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y) { + GL41C.glVertexAttribL2d(index, x, y); + } + + // --- [ glVertexAttribL3d ] --- + + /** + * Specifies the value of a generic vertex attribute. The w is implicitly set to 1.0. + * + * @param index the index of the generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * @param z the vertex attribute z component + */ + public static void glVertexAttribL3d(@NativeType("GLuint") int index, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z) { + GL41C.glVertexAttribL3d(index, x, y, z); + } + + // --- [ glVertexAttribL4d ] --- + + /** + * Specifies the value of a generic vertex attribute. + * + * @param index the index of the generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * @param z the vertex attribute z component + * @param w the vertex attribute w component + */ + public static void glVertexAttribL4d(@NativeType("GLuint") int index, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z, @NativeType("GLdouble") double w) { + GL41C.glVertexAttribL4d(index, x, y, z, w); + } + + // --- [ glVertexAttribL1dv ] --- + + /** Unsafe version of: {@link #glVertexAttribL1dv VertexAttribL1dv} */ + public static void nglVertexAttribL1dv(int index, long v) { + GL41C.nglVertexAttribL1dv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttribL1d VertexAttribL1d}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttribL1dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + GL41C.glVertexAttribL1dv(index, v); + } + + // --- [ glVertexAttribL2dv ] --- + + /** Unsafe version of: {@link #glVertexAttribL2dv VertexAttribL2dv} */ + public static void nglVertexAttribL2dv(int index, long v) { + GL41C.nglVertexAttribL2dv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttribL2d VertexAttribL2d}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttribL2dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + GL41C.glVertexAttribL2dv(index, v); + } + + // --- [ glVertexAttribL3dv ] --- + + /** Unsafe version of: {@link #glVertexAttribL3dv VertexAttribL3dv} */ + public static void nglVertexAttribL3dv(int index, long v) { + GL41C.nglVertexAttribL3dv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttribL3d VertexAttribL3d}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttribL3dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + GL41C.glVertexAttribL3dv(index, v); + } + + // --- [ glVertexAttribL4dv ] --- + + /** Unsafe version of: {@link #glVertexAttribL4dv VertexAttribL4dv} */ + public static void nglVertexAttribL4dv(int index, long v) { + GL41C.nglVertexAttribL4dv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttribL4d VertexAttribL4d}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttribL4dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + GL41C.glVertexAttribL4dv(index, v); + } + + // --- [ glVertexAttribLPointer ] --- + + /** + * Unsafe version of: {@link #glVertexAttribLPointer VertexAttribLPointer} + * + * @param type the data type of each component in the array. Must be:
{@link GL11#GL_DOUBLE DOUBLE}
+ */ + public static void nglVertexAttribLPointer(int index, int size, int type, int stride, long pointer) { + GL41C.nglVertexAttribLPointer(index, size, type, stride, pointer); + } + + /** + * Specifies the location and organization of a 64-bit vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. Must be:
{@link GL11#GL_DOUBLE DOUBLE}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + */ + public static void glVertexAttribLPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + GL41C.glVertexAttribLPointer(index, size, type, stride, pointer); + } + + /** + * Specifies the location and organization of a 64-bit vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. Must be:
{@link GL11#GL_DOUBLE DOUBLE}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + */ + public static void glVertexAttribLPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + GL41C.glVertexAttribLPointer(index, size, type, stride, pointer); + } + + /** + * Specifies the location and organization of a 64-bit vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + */ + public static void glVertexAttribLPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLsizei") int stride, @NativeType("void const *") DoubleBuffer pointer) { + GL41C.glVertexAttribLPointer(index, size, stride, pointer); + } + + // --- [ glGetVertexAttribLdv ] --- + + /** Unsafe version of: {@link #glGetVertexAttribLdv GetVertexAttribLdv} */ + public static void nglGetVertexAttribLdv(int index, int pname, long params) { + GL41C.nglGetVertexAttribLdv(index, pname, params); + } + + /** + * Double version of {@link GL20C#glGetVertexAttribiv GetVertexAttribiv}. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the vertex attribute parameter to be queried + * @param params the requested data + */ + public static void glGetVertexAttribLdv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLdouble *") DoubleBuffer params) { + GL41C.glGetVertexAttribLdv(index, pname, params); + } + + // --- [ glVertexArrayVertexAttribLOffsetEXT ] --- + + /** + * DSA version of {@link #glVertexAttribLPointer VertexAttribLPointer}. + * + * @param vaobj the vertex array object + * @param buffer the buffer object + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. Must be:
{@link GL11#GL_DOUBLE DOUBLE}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param offset the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer. The initial value is 0. + */ + public static native void glVertexArrayVertexAttribLOffsetEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int buffer, @NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("GLintptr") long offset); + + /** Array version of: {@link #glVertexAttribL1dv VertexAttribL1dv} */ + public static void glVertexAttribL1dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + GL41C.glVertexAttribL1dv(index, v); + } + + /** Array version of: {@link #glVertexAttribL2dv VertexAttribL2dv} */ + public static void glVertexAttribL2dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + GL41C.glVertexAttribL2dv(index, v); + } + + /** Array version of: {@link #glVertexAttribL3dv VertexAttribL3dv} */ + public static void glVertexAttribL3dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + GL41C.glVertexAttribL3dv(index, v); + } + + /** Array version of: {@link #glVertexAttribL4dv VertexAttribL4dv} */ + public static void glVertexAttribL4dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + GL41C.glVertexAttribL4dv(index, v); + } + + /** Array version of: {@link #glGetVertexAttribLdv GetVertexAttribLdv} */ + public static void glGetVertexAttribLdv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLdouble *") double[] params) { + GL41C.glGetVertexAttribLdv(index, pname, params); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexAttribBinding.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexAttribBinding.java new file mode 100644 index 00000000..a2de33f4 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexAttribBinding.java @@ -0,0 +1,239 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_vertex_attrib_binding extension. + * + *

OpenGL currently supports (at least) 16 vertex attributes and 16 vertex buffer bindings, with a fixed mapping between vertex attributes and vertex + * buffer bindings. This extension allows the application to change the mapping between attributes and bindings, which can make it more efficient to update + * vertex buffer bindings for interleaved vertex formats where many attributes share the same buffer.

+ * + *

This extension also separates the vertex binding update from the vertex attribute format update, which saves applications the effort of redundantly + * specifying the same format state over and over.

+ * + *

Conceptually, this extension splits the state for generic vertex attribute arrays into:

+ * + *
    + *
  • An array of vertex buffer binding points, each of which specifies: + * + *
      + *
    • a bound buffer object
    • + *
    • a starting offset for the vertex attribute data in that buffer object
    • + *
    • a stride used by all attributes using that binding point, and
    • + *
    • a frequency divisor used by all attributes using that binding point.
    • + *
  • + *
  • An array of generic vertex attribute format information records, each of which specifies: + * + *
      + *
    • a reference to one of the new buffer binding points above
    • + *
    • a component count and format, and a normalization flag for the attribute data, and
    • + *
    • the offset of the attribute data relative to the base offset of each vertex found at the associated binding point.
    • + *
  • + *
+ * + *

Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ +public class ARBVertexAttribBinding { + + /** Accepted by the {@code pname} parameter of GetVertexAttrib*v. */ + public static final int + GL_VERTEX_ATTRIB_BINDING = 0x82D4, + GL_VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D5; + + /** Accepted by the {@code target} parameter of GetBooleani_v, GetIntegeri_v, GetFloati_v, GetDoublei_v, and GetInteger64i_v. */ + public static final int + GL_VERTEX_BINDING_DIVISOR = 0x82D6, + GL_VERTEX_BINDING_OFFSET = 0x82D7, + GL_VERTEX_BINDING_STRIDE = 0x82D8, + GL_VERTEX_BINDING_BUFFER = 0x8F4F; + + /** Accepted by the {@code pname} parameter of GetIntegerv, .... */ + public static final int + GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D9, + GL_MAX_VERTEX_ATTRIB_BINDINGS = 0x82DA; + + static { GL.initialize(); } + + protected ARBVertexAttribBinding() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glBindVertexBuffer, caps.glVertexAttribFormat, caps.glVertexAttribIFormat, caps.glVertexAttribLFormat, caps.glVertexAttribBinding, + caps.glVertexBindingDivisor, ext.contains("GL_EXT_direct_state_access") ? caps.glVertexArrayBindVertexBufferEXT : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glVertexArrayVertexAttribFormatEXT : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glVertexArrayVertexAttribIFormatEXT : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glVertexArrayVertexAttribLFormatEXT : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glVertexArrayVertexAttribBindingEXT : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glVertexArrayVertexBindingDivisorEXT : -1L + ); + } + + // --- [ glBindVertexBuffer ] --- + + /** + * Binds a buffer to a vertex buffer bind point. + * + * @param bindingindex the index of the vertex buffer binding point to which to bind the buffer + * @param buffer the name of an existing buffer to bind to the vertex buffer binding point + * @param offset the offset of the first element of the buffer + * @param stride the distance between elements within the buffer + */ + public static void glBindVertexBuffer(@NativeType("GLuint") int bindingindex, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizei") int stride) { + GL43C.glBindVertexBuffer(bindingindex, buffer, offset, stride); + } + + // --- [ glVertexAttribFormat ] --- + + /** + * Specifies the organization of data in vertex arrays. + * + * @param attribindex the generic vertex attribute array being described + * @param size the number of values per vertex that are stored in the array. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the type of the data stored in the array + * @param normalized if true then integer data is normalized to the range [-1, 1] or [0, 1] if it is signed or unsigned, respectively. If false then integer data is + * directly converted to floating point. + * @param relativeoffset the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from + */ + public static void glVertexAttribFormat(@NativeType("GLuint") int attribindex, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint") int relativeoffset) { + GL43C.glVertexAttribFormat(attribindex, size, type, normalized, relativeoffset); + } + + // --- [ glVertexAttribIFormat ] --- + + /** + * Specifies the organization of pure integer data in vertex arrays. + * + * @param attribindex the generic vertex attribute array being described + * @param size the number of values per vertex that are stored in the array. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the type of the data stored in the array + * @param relativeoffset the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from + */ + public static void glVertexAttribIFormat(@NativeType("GLuint") int attribindex, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLuint") int relativeoffset) { + GL43C.glVertexAttribIFormat(attribindex, size, type, relativeoffset); + } + + // --- [ glVertexAttribLFormat ] --- + + /** + * Specifies the organization of 64-bit double data in vertex arrays. + * + * @param attribindex the generic vertex attribute array being described + * @param size the number of values per vertex that are stored in the array. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the type of the data stored in the array + * @param relativeoffset the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from + */ + public static void glVertexAttribLFormat(@NativeType("GLuint") int attribindex, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLuint") int relativeoffset) { + GL43C.glVertexAttribLFormat(attribindex, size, type, relativeoffset); + } + + // --- [ glVertexAttribBinding ] --- + + /** + * Associate a vertex attribute and a vertex buffer binding. + * + * @param attribindex the index of the attribute to associate with a vertex buffer binding + * @param bindingindex the index of the vertex buffer binding with which to associate the generic vertex attribute + */ + public static void glVertexAttribBinding(@NativeType("GLuint") int attribindex, @NativeType("GLuint") int bindingindex) { + GL43C.glVertexAttribBinding(attribindex, bindingindex); + } + + // --- [ glVertexBindingDivisor ] --- + + /** + * Modifies the rate at which generic vertex attributes advance during instanced rendering. + * + * @param bindingindex the index of the generic vertex attribute + * @param divisor the number of instances that will pass between updates of the generic attribute at slot {@code index} + */ + public static void glVertexBindingDivisor(@NativeType("GLuint") int bindingindex, @NativeType("GLuint") int divisor) { + GL43C.glVertexBindingDivisor(bindingindex, divisor); + } + + // --- [ glVertexArrayBindVertexBufferEXT ] --- + + /** + * DSA version of {@link #glBindVertexBuffer BindVertexBuffer}. + * + * @param vaobj the vertex array object + * @param bindingindex the index of the vertex buffer binding point to which to bind the buffer + * @param buffer the name of an existing buffer to bind to the vertex buffer binding point + * @param offset the offset of the first element of the buffer + * @param stride the distance between elements within the buffer + */ + public static native void glVertexArrayBindVertexBufferEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int bindingindex, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizei") int stride); + + // --- [ glVertexArrayVertexAttribFormatEXT ] --- + + /** + * DSA version of {@link #glVertexAttribFormat VertexAttribFormat}. + * + * @param vaobj the vertex array object + * @param attribindex the generic vertex attribute array being described + * @param size the number of values per vertex that are stored in the array. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the type of the data stored in the array + * @param normalized if true then integer data is normalized to the range [-1, 1] or [0, 1] if it is signed or unsigned, respectively. If false then integer data is + * directly converted to floating point. + * @param relativeoffset the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from + */ + public static native void glVertexArrayVertexAttribFormatEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int attribindex, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint") int relativeoffset); + + // --- [ glVertexArrayVertexAttribIFormatEXT ] --- + + /** + * DSA version of {@link #glVertexAttribIFormat VertexAttribIFormat}. + * + * @param vaobj the vertex array object + * @param attribindex the generic vertex attribute array being described + * @param size the number of values per vertex that are stored in the array. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the type of the data stored in the array + * @param relativeoffset the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from + */ + public static native void glVertexArrayVertexAttribIFormatEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int attribindex, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLuint") int relativeoffset); + + // --- [ glVertexArrayVertexAttribLFormatEXT ] --- + + /** + * DSA version of {@link #glVertexAttribLFormat VertexAttribLFormat}. + * + * @param vaobj the vertex array object + * @param attribindex the generic vertex attribute array being described + * @param size the number of values per vertex that are stored in the array. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the type of the data stored in the array + * @param relativeoffset the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from + */ + public static native void glVertexArrayVertexAttribLFormatEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int attribindex, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLuint") int relativeoffset); + + // --- [ glVertexArrayVertexAttribBindingEXT ] --- + + /** + * DSA version of {@link #glVertexAttribBinding VertexAttribBinding}. + * + * @param vaobj the vertex array object + * @param attribindex the index of the attribute to associate with a vertex buffer binding + * @param bindingindex the index of the vertex buffer binding with which to associate the generic vertex attribute + */ + public static native void glVertexArrayVertexAttribBindingEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int attribindex, @NativeType("GLuint") int bindingindex); + + // --- [ glVertexArrayVertexBindingDivisorEXT ] --- + + /** + * DSA version of {@link #glVertexBindingDivisor VertexBindingDivisor}. + * + * @param vaobj the vertex array object + * @param bindingindex the index of the generic vertex attribute + * @param divisor the number of instances that will pass between updates of the generic attribute at slot {@code index} + */ + public static native void glVertexArrayVertexBindingDivisorEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int bindingindex, @NativeType("GLuint") int divisor); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexBlend.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexBlend.java new file mode 100644 index 00000000..22f38cc3 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexBlend.java @@ -0,0 +1,405 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_vertex_blend extension. + * + *

This extension provides the ability to replace the single modelview transformation with a set of n vertex units. (Where n is constrained to an + * implementation defined maximum.) Each unit has its own modelview transform matrix. For each unit, there is a current weight associated with the vertex. + * When this extension is enabled the vertices are transformed by the modelview matrices of all of the enabled units. Afterward, these results are scaled + * by the weights for the respective units and then summed to create the eye-space vertex. A similar procedure is followed for the normals, except they are + * transformed by the inverse transpose of the modelview matrices.

+ */ +public class ARBVertexBlend { + + /** Accepted by the {@code value} parameters of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_VERTEX_UNITS_ARB = 0x86A4, + GL_ACTIVE_VERTEX_UNITS_ARB = 0x86A5; + + /** + * Accepted by the {@code cap} parameters of Enable and Disable, by the {@code value} parameter of IsEnabled, GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int + GL_WEIGHT_SUM_UNITY_ARB = 0x86A6, + GL_VERTEX_BLEND_ARB = 0x86A7; + + /** Accepted by the {@code mode} parameter of MatrixMode and by the {@code value} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MODELVIEW0_ARB = 0x1700, + GL_MODELVIEW1_ARB = 0x850A, + GL_MODELVIEW2_ARB = 0x8722, + GL_MODELVIEW3_ARB = 0x8723, + GL_MODELVIEW4_ARB = 0x8724, + GL_MODELVIEW5_ARB = 0x8725, + GL_MODELVIEW6_ARB = 0x8726, + GL_MODELVIEW7_ARB = 0x8727, + GL_MODELVIEW8_ARB = 0x8728, + GL_MODELVIEW9_ARB = 0x8729, + GL_MODELVIEW10_ARB = 0x872A, + GL_MODELVIEW11_ARB = 0x872B, + GL_MODELVIEW12_ARB = 0x872C, + GL_MODELVIEW13_ARB = 0x872D, + GL_MODELVIEW14_ARB = 0x872E, + GL_MODELVIEW15_ARB = 0x872F, + GL_MODELVIEW16_ARB = 0x8730, + GL_MODELVIEW17_ARB = 0x8731, + GL_MODELVIEW18_ARB = 0x8732, + GL_MODELVIEW19_ARB = 0x8733, + GL_MODELVIEW20_ARB = 0x8734, + GL_MODELVIEW21_ARB = 0x8735, + GL_MODELVIEW22_ARB = 0x8736, + GL_MODELVIEW23_ARB = 0x8737, + GL_MODELVIEW24_ARB = 0x8738, + GL_MODELVIEW25_ARB = 0x8739, + GL_MODELVIEW26_ARB = 0x873A, + GL_MODELVIEW27_ARB = 0x873B, + GL_MODELVIEW28_ARB = 0x873C, + GL_MODELVIEW29_ARB = 0x873D, + GL_MODELVIEW30_ARB = 0x873E, + GL_MODELVIEW31_ARB = 0x873F; + + /** Accepted by the {@code value} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_CURRENT_WEIGHT_ARB = 0x86A8; + + /** Accepted by the {@code value} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_WEIGHT_ARRAY_TYPE_ARB = 0x86A9, + GL_WEIGHT_ARRAY_STRIDE_ARB = 0x86AA, + GL_WEIGHT_ARRAY_SIZE_ARB = 0x86AB; + + /** Accepted by the {@code pname} parameter of GetPointerv. */ + public static final int GL_WEIGHT_ARRAY_POINTER_ARB = 0x86AC; + + /** + * Accepted by the {@code cap} parameters of EnableClientState and DisableClientState, by the {@code value} parameter of IsEnabled, GetBooleanv, + * GetIntegerv, GetFloatv, and GetDoublev. + */ + public static final int GL_WEIGHT_ARRAY_ARB = 0x86AD; + + static { GL.initialize(); } + + protected ARBVertexBlend() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glWeightfvARB, caps.glWeightbvARB, caps.glWeightubvARB, caps.glWeightsvARB, caps.glWeightusvARB, caps.glWeightivARB, caps.glWeightuivARB, + caps.glWeightdvARB, caps.glWeightPointerARB, caps.glVertexBlendARB + ); + } + + // --- [ glWeightfvARB ] --- + + /** + * Unsafe version of: {@link #glWeightfvARB WeightfvARB} + * + * @param size the number of weights to set. Must be a value between 1 and {@link #GL_MAX_VERTEX_UNITS_ARB MAX_VERTEX_UNITS_ARB}. + */ + public static native void nglWeightfvARB(int size, long weights); + + /** + * Sets the current vertex weights. + * + * @param weights the vertex weights + */ + public static void glWeightfvARB(@NativeType("GLfloat *") FloatBuffer weights) { + nglWeightfvARB(weights.remaining(), memAddress(weights)); + } + + // --- [ glWeightbvARB ] --- + + /** + * Unsafe version of: {@link #glWeightbvARB WeightbvARB} + * + * @param size the number of weights to set. Must be a value between 1 and {@link #GL_MAX_VERTEX_UNITS_ARB MAX_VERTEX_UNITS_ARB}. + */ + public static native void nglWeightbvARB(int size, long weights); + + /** + * Byte version of {@link #glWeightfvARB WeightfvARB}. + * + * @param weights the vertex weights + */ + public static void glWeightbvARB(@NativeType("GLbyte *") ByteBuffer weights) { + nglWeightbvARB(weights.remaining(), memAddress(weights)); + } + + // --- [ glWeightubvARB ] --- + + /** + * Unsafe version of: {@link #glWeightubvARB WeightubvARB} + * + * @param size the number of weights to set. Must be a value between 1 and {@link #GL_MAX_VERTEX_UNITS_ARB MAX_VERTEX_UNITS_ARB}. + */ + public static native void nglWeightubvARB(int size, long weights); + + /** + * Unsigned byte version of {@link #glWeightfvARB WeightfvARB}. + * + * @param weights the vertex weights + */ + public static void glWeightubvARB(@NativeType("GLubyte *") ByteBuffer weights) { + nglWeightubvARB(weights.remaining(), memAddress(weights)); + } + + // --- [ glWeightsvARB ] --- + + /** + * Unsafe version of: {@link #glWeightsvARB WeightsvARB} + * + * @param size the number of weights to set. Must be a value between 1 and {@link #GL_MAX_VERTEX_UNITS_ARB MAX_VERTEX_UNITS_ARB}. + */ + public static native void nglWeightsvARB(int size, long weights); + + /** + * Short version of {@link #glWeightfvARB WeightfvARB}. + * + * @param weights the vertex weights + */ + public static void glWeightsvARB(@NativeType("GLshort *") ShortBuffer weights) { + nglWeightsvARB(weights.remaining(), memAddress(weights)); + } + + // --- [ glWeightusvARB ] --- + + /** + * Unsafe version of: {@link #glWeightusvARB WeightusvARB} + * + * @param size the number of weights to set. Must be a value between 1 and {@link #GL_MAX_VERTEX_UNITS_ARB MAX_VERTEX_UNITS_ARB}. + */ + public static native void nglWeightusvARB(int size, long weights); + + /** + * Unsigned short version of {@link #glWeightfvARB WeightfvARB}. + * + * @param weights the vertex weights + */ + public static void glWeightusvARB(@NativeType("GLushort *") ShortBuffer weights) { + nglWeightusvARB(weights.remaining(), memAddress(weights)); + } + + // --- [ glWeightivARB ] --- + + /** + * Unsafe version of: {@link #glWeightivARB WeightivARB} + * + * @param size the number of weights to set. Must be a value between 1 and {@link #GL_MAX_VERTEX_UNITS_ARB MAX_VERTEX_UNITS_ARB}. + */ + public static native void nglWeightivARB(int size, long weights); + + /** + * Integer version of {@link #glWeightfvARB WeightfvARB}. + * + * @param weights the vertex weights + */ + public static void glWeightivARB(@NativeType("GLint *") IntBuffer weights) { + nglWeightivARB(weights.remaining(), memAddress(weights)); + } + + // --- [ glWeightuivARB ] --- + + /** + * Unsafe version of: {@link #glWeightuivARB WeightuivARB} + * + * @param size the number of weights to set. Must be a value between 1 and {@link #GL_MAX_VERTEX_UNITS_ARB MAX_VERTEX_UNITS_ARB}. + */ + public static native void nglWeightuivARB(int size, long weights); + + /** + * Unsigned integer version of {@link #glWeightfvARB WeightfvARB}. + * + * @param weights the vertex weights + */ + public static void glWeightuivARB(@NativeType("GLuint *") IntBuffer weights) { + nglWeightuivARB(weights.remaining(), memAddress(weights)); + } + + // --- [ glWeightdvARB ] --- + + /** + * Unsafe version of: {@link #glWeightdvARB WeightdvARB} + * + * @param size the number of weights to set. Must be a value between 1 and {@link #GL_MAX_VERTEX_UNITS_ARB MAX_VERTEX_UNITS_ARB}. + */ + public static native void nglWeightdvARB(int size, long weights); + + /** + * Double version of {@link #glWeightfvARB WeightfvARB}. + * + * @param weights the vertex weights + */ + public static void glWeightdvARB(@NativeType("GLdouble *") DoubleBuffer weights) { + nglWeightdvARB(weights.remaining(), memAddress(weights)); + } + + // --- [ glWeightPointerARB ] --- + + /** Unsafe version of: {@link #glWeightPointerARB WeightPointerARB} */ + public static native void nglWeightPointerARB(int size, int type, int stride, long pointer); + + /** + * Specifies the location and organization of a weight array. + * + * @param size the number of values per vertex that are stored in the array. Must be a value between 1 and {@link #GL_MAX_VERTEX_UNITS_ARB MAX_VERTEX_UNITS_ARB}. + * @param type the data type of the values stored in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_FLOAT FLOAT}{@link GL11#GL_DOUBLE DOUBLE}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the weight data + */ + public static void glWeightPointerARB(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + nglWeightPointerARB(size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a weight array. + * + * @param size the number of values per vertex that are stored in the array. Must be a value between 1 and {@link #GL_MAX_VERTEX_UNITS_ARB MAX_VERTEX_UNITS_ARB}. + * @param type the data type of the values stored in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_FLOAT FLOAT}{@link GL11#GL_DOUBLE DOUBLE}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the weight data + */ + public static void glWeightPointerARB(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + nglWeightPointerARB(size, type, stride, pointer); + } + + /** + * Specifies the location and organization of a weight array. + * + * @param size the number of values per vertex that are stored in the array. Must be a value between 1 and {@link #GL_MAX_VERTEX_UNITS_ARB MAX_VERTEX_UNITS_ARB}. + * @param type the data type of the values stored in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_FLOAT FLOAT}{@link GL11#GL_DOUBLE DOUBLE}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the weight data + */ + public static void glWeightPointerARB(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ShortBuffer pointer) { + nglWeightPointerARB(size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a weight array. + * + * @param size the number of values per vertex that are stored in the array. Must be a value between 1 and {@link #GL_MAX_VERTEX_UNITS_ARB MAX_VERTEX_UNITS_ARB}. + * @param type the data type of the values stored in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_FLOAT FLOAT}{@link GL11#GL_DOUBLE DOUBLE}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the weight data + */ + public static void glWeightPointerARB(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") IntBuffer pointer) { + nglWeightPointerARB(size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a weight array. + * + * @param size the number of values per vertex that are stored in the array. Must be a value between 1 and {@link #GL_MAX_VERTEX_UNITS_ARB MAX_VERTEX_UNITS_ARB}. + * @param type the data type of the values stored in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_FLOAT FLOAT}{@link GL11#GL_DOUBLE DOUBLE}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the weight data + */ + public static void glWeightPointerARB(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") FloatBuffer pointer) { + nglWeightPointerARB(size, type, stride, memAddress(pointer)); + } + + // --- [ glVertexBlendARB ] --- + + /** + * Sets the number of active transformations applied. + * + * @param count the number of transformations to blend + */ + public static native void glVertexBlendARB(@NativeType("GLint") int count); + + /** Array version of: {@link #glWeightfvARB WeightfvARB} */ + public static void glWeightfvARB(@NativeType("GLfloat *") float[] weights) { + long __functionAddress = GL.getICD().glWeightfvARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(weights.length, weights, __functionAddress); + } + + /** Array version of: {@link #glWeightsvARB WeightsvARB} */ + public static void glWeightsvARB(@NativeType("GLshort *") short[] weights) { + long __functionAddress = GL.getICD().glWeightsvARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(weights.length, weights, __functionAddress); + } + + /** Array version of: {@link #glWeightusvARB WeightusvARB} */ + public static void glWeightusvARB(@NativeType("GLushort *") short[] weights) { + long __functionAddress = GL.getICD().glWeightusvARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(weights.length, weights, __functionAddress); + } + + /** Array version of: {@link #glWeightivARB WeightivARB} */ + public static void glWeightivARB(@NativeType("GLint *") int[] weights) { + long __functionAddress = GL.getICD().glWeightivARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(weights.length, weights, __functionAddress); + } + + /** Array version of: {@link #glWeightuivARB WeightuivARB} */ + public static void glWeightuivARB(@NativeType("GLuint *") int[] weights) { + long __functionAddress = GL.getICD().glWeightuivARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(weights.length, weights, __functionAddress); + } + + /** Array version of: {@link #glWeightdvARB WeightdvARB} */ + public static void glWeightdvARB(@NativeType("GLdouble *") double[] weights) { + long __functionAddress = GL.getICD().glWeightdvARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(weights.length, weights, __functionAddress); + } + + /** Array version of: {@link #glWeightPointerARB WeightPointerARB} */ + public static void glWeightPointerARB(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") short[] pointer) { + long __functionAddress = GL.getICD().glWeightPointerARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(size, type, stride, pointer, __functionAddress); + } + + /** Array version of: {@link #glWeightPointerARB WeightPointerARB} */ + public static void glWeightPointerARB(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") int[] pointer) { + long __functionAddress = GL.getICD().glWeightPointerARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(size, type, stride, pointer, __functionAddress); + } + + /** Array version of: {@link #glWeightPointerARB WeightPointerARB} */ + public static void glWeightPointerARB(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") float[] pointer) { + long __functionAddress = GL.getICD().glWeightPointerARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(size, type, stride, pointer, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexBufferObject.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexBufferObject.java new file mode 100644 index 00000000..598daac5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexBufferObject.java @@ -0,0 +1,818 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_vertex_buffer_object extension. + * + *

This extension defines an interface that allows various types of data (especially vertex array data) to be cached in high-performance graphics memory on + * the server, thereby increasing the rate of data transfers.

+ * + *

Chunks of data are encapsulated within "buffer objects", which conceptually are nothing more than arrays of bytes, just like any chunk of memory. An API + * is provided whereby applications can read from or write to buffers, either via the GL itself ({@link #glBufferDataARB BufferDataARB}, {@link #glBufferSubDataARB BufferSubDataARB}, + * {@link #glGetBufferSubDataARB GetBufferSubDataARB}) or via a pointer to the memory.

+ * + *

The latter technique is known as "mapping" a buffer. When an application maps a buffer, it is given a pointer to the memory. When the application + * finishes reading from or writing to the memory, it is required to "unmap" the buffer before it is once again permitted to use that buffer as a GL data + * source or sink. Mapping often allows applications to eliminate an extra data copy otherwise required to access the buffer, thereby enhancing + * performance. In addition, requiring that applications unmap the buffer to use it as a data source or sink ensures that certain classes of latent + * synchronization bugs cannot occur.

+ * + *

Although this extension only defines hooks for buffer objects to be used with OpenGL's vertex array APIs, the API defined in this extension permits + * buffer objects to be used as either data sources or sinks for any GL command that takes a pointer as an argument. Normally, in the absence of this + * extension, a pointer passed into the GL is simply a pointer to the user's data. This extension defines a mechanism whereby this pointer is used not as a + * pointer to the data itself, but as an offset into a currently bound buffer object. The buffer object ID zero is reserved, and when buffer object zero is + * bound to a given target, the commands affected by that buffer binding behave normally. When a nonzero buffer ID is bound, then the pointer represents an + * offset.

+ * + *

In the case of vertex arrays, this extension defines not merely one binding for all attributes, but a separate binding for each individual attribute. As + * a result, applications can source their attributes from multiple buffers. An application might, for example, have a model with constant texture + * coordinates and variable geometry. The texture coordinates might be retrieved from a buffer object with the usage mode "STATIC_DRAW", indicating to the + * GL that the application does not expect to update the contents of the buffer frequently or even at all, while the vertices might be retrieved from a + * buffer object with the usage mode "STREAM_DRAW", indicating that the vertices will be updated on a regular basis.

+ * + *

In addition, a binding is defined by which applications can source index data (as used by {@link GL11C#glDrawElements DrawElements}, {@link GL12C#glDrawRangeElements DrawRangeElements}, and + * {@link GL14C#glMultiDrawElements MultiDrawElements}) from a buffer object. On some platforms, this enables very large models to be rendered with no more than a few small commands + * to the graphics device.

+ * + *

It is expected that a future extension will allow sourcing pixel data from and writing pixel data to a buffer object.

+ * + *

Promoted to core in {@link GL15 OpenGL 1.5}.

+ */ +public class ARBVertexBufferObject { + + /** + * Accepted by the {@code target} parameters of BindBufferARB, BufferDataARB, BufferSubDataARB, MapBufferARB, UnmapBufferARB, GetBufferSubDataARB, + * GetBufferParameterivARB, and GetBufferPointervARB. + */ + public static final int + GL_ARRAY_BUFFER_ARB = 0x8892, + GL_ELEMENT_ARRAY_BUFFER_ARB = 0x8893; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_ARRAY_BUFFER_BINDING_ARB = 0x8894, + GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB = 0x8895, + GL_VERTEX_ARRAY_BUFFER_BINDING_ARB = 0x8896, + GL_NORMAL_ARRAY_BUFFER_BINDING_ARB = 0x8897, + GL_COLOR_ARRAY_BUFFER_BINDING_ARB = 0x8898, + GL_INDEX_ARRAY_BUFFER_BINDING_ARB = 0x8899, + GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB = 0x889A, + GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB = 0x889B, + GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB = 0x889C, + GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB = 0x889D, + GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB = 0x889E; + + /** Accepted by the {@code pname} parameter of GetVertexAttribivARB. */ + public static final int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB = 0x889F; + + /** Accepted by the {@code usage} parameter of BufferDataARB. */ + public static final int + GL_STREAM_DRAW_ARB = 0x88E0, + GL_STREAM_READ_ARB = 0x88E1, + GL_STREAM_COPY_ARB = 0x88E2, + GL_STATIC_DRAW_ARB = 0x88E4, + GL_STATIC_READ_ARB = 0x88E5, + GL_STATIC_COPY_ARB = 0x88E6, + GL_DYNAMIC_DRAW_ARB = 0x88E8, + GL_DYNAMIC_READ_ARB = 0x88E9, + GL_DYNAMIC_COPY_ARB = 0x88EA; + + /** Accepted by the {@code access} parameter of MapBufferARB. */ + public static final int + GL_READ_ONLY_ARB = 0x88B8, + GL_WRITE_ONLY_ARB = 0x88B9, + GL_READ_WRITE_ARB = 0x88BA; + + /** Accepted by the {@code pname} parameter of GetBufferParameterivARB. */ + public static final int + GL_BUFFER_SIZE_ARB = 0x8764, + GL_BUFFER_USAGE_ARB = 0x8765, + GL_BUFFER_ACCESS_ARB = 0x88BB, + GL_BUFFER_MAPPED_ARB = 0x88BC; + + /** Accepted by the {@code pname} parameter of GetBufferPointervARB. */ + public static final int GL_BUFFER_MAP_POINTER_ARB = 0x88BD; + + static { GL.initialize(); } + + protected ARBVertexBufferObject() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBindBufferARB, caps.glDeleteBuffersARB, caps.glGenBuffersARB, caps.glIsBufferARB, caps.glBufferDataARB, caps.glBufferSubDataARB, + caps.glGetBufferSubDataARB, caps.glMapBufferARB, caps.glUnmapBufferARB, caps.glGetBufferParameterivARB, caps.glGetBufferPointervARB + ); + } + + // --- [ glBindBufferARB ] --- + + /** + * Binds a named buffer object. + * + * @param target the target to which the buffer object is bound. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param buffer the name of a buffer object + */ + public static native void glBindBufferARB(@NativeType("GLenum") int target, @NativeType("GLuint") int buffer); + + // --- [ glDeleteBuffersARB ] --- + + /** + * Unsafe version of: {@link #glDeleteBuffersARB DeleteBuffersARB} + * + * @param n the number of buffer objects to be deleted + */ + public static native void nglDeleteBuffersARB(int n, long buffers); + + /** + * Deletes named buffer objects. + * + * @param buffers an array of buffer objects to be deleted + */ + public static void glDeleteBuffersARB(@NativeType("GLuint const *") IntBuffer buffers) { + nglDeleteBuffersARB(buffers.remaining(), memAddress(buffers)); + } + + /** Deletes named buffer objects. */ + public static void glDeleteBuffersARB(@NativeType("GLuint const *") int buffer) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer buffers = stack.ints(buffer); + nglDeleteBuffersARB(1, memAddress(buffers)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGenBuffersARB ] --- + + /** + * Unsafe version of: {@link #glGenBuffersARB GenBuffersARB} + * + * @param n the number of buffer object names to be generated + */ + public static native void nglGenBuffersARB(int n, long buffers); + + /** + * Generates buffer object names. + * + * @param buffers a buffer in which the generated buffer object names are stored + */ + public static void glGenBuffersARB(@NativeType("GLuint *") IntBuffer buffers) { + nglGenBuffersARB(buffers.remaining(), memAddress(buffers)); + } + + /** Generates buffer object names. */ + @NativeType("void") + public static int glGenBuffersARB() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer buffers = stack.callocInt(1); + nglGenBuffersARB(1, memAddress(buffers)); + return buffers.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glIsBufferARB ] --- + + /** + * Determines if a name corresponds to a buffer object. + * + * @param buffer a value that may be the name of a buffer object + */ + @NativeType("GLboolean") + public static native boolean glIsBufferARB(@NativeType("GLuint") int buffer); + + // --- [ glBufferDataARB ] --- + + /** + * Unsafe version of: {@link #glBufferDataARB BufferDataARB} + * + * @param size the size in bytes of the buffer object's new data store + */ + public static native void nglBufferDataARB(int target, long size, long data, int usage); + + /** + * Creates and initializes a buffer object's data store. + * + *

{@code usage} is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make + * more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store. + * {@code usage} can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The + * frequency of access may be one of these:

+ * + *
    + *
  • STREAM - The data store contents will be modified once and used at most a few times.
  • + *
  • STATIC - The data store contents will be modified once and used many times.
  • + *
  • DYNAMIC - The data store contents will be modified repeatedly and used many times.
  • + *
+ * + *

The nature of access may be one of these:

+ * + *
    + *
  • DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
  • + *
  • READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
  • + *
  • COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
  • + *
+ * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param size the size in bytes of the buffer object's new data store + * @param usage the expected usage pattern of the data store. One of:
{@link #GL_STREAM_DRAW_ARB STREAM_DRAW_ARB}{@link #GL_STREAM_READ_ARB STREAM_READ_ARB}{@link #GL_STREAM_COPY_ARB STREAM_COPY_ARB}{@link #GL_STATIC_DRAW_ARB STATIC_DRAW_ARB}{@link #GL_STATIC_READ_ARB STATIC_READ_ARB}
{@link #GL_STATIC_COPY_ARB STATIC_COPY_ARB}{@link #GL_DYNAMIC_DRAW_ARB DYNAMIC_DRAW_ARB}{@link #GL_DYNAMIC_READ_ARB DYNAMIC_READ_ARB}{@link #GL_DYNAMIC_COPY_ARB DYNAMIC_COPY_ARB}
+ */ + public static void glBufferDataARB(@NativeType("GLenum") int target, @NativeType("GLsizeiptrARB") long size, @NativeType("GLenum") int usage) { + nglBufferDataARB(target, size, NULL, usage); + } + + /** + * Creates and initializes a buffer object's data store. + * + *

{@code usage} is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make + * more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store. + * {@code usage} can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The + * frequency of access may be one of these:

+ * + *
    + *
  • STREAM - The data store contents will be modified once and used at most a few times.
  • + *
  • STATIC - The data store contents will be modified once and used many times.
  • + *
  • DYNAMIC - The data store contents will be modified repeatedly and used many times.
  • + *
+ * + *

The nature of access may be one of these:

+ * + *
    + *
  • DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
  • + *
  • READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
  • + *
  • COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
  • + *
+ * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link #GL_STREAM_DRAW_ARB STREAM_DRAW_ARB}{@link #GL_STREAM_READ_ARB STREAM_READ_ARB}{@link #GL_STREAM_COPY_ARB STREAM_COPY_ARB}{@link #GL_STATIC_DRAW_ARB STATIC_DRAW_ARB}{@link #GL_STATIC_READ_ARB STATIC_READ_ARB}
{@link #GL_STATIC_COPY_ARB STATIC_COPY_ARB}{@link #GL_DYNAMIC_DRAW_ARB DYNAMIC_DRAW_ARB}{@link #GL_DYNAMIC_READ_ARB DYNAMIC_READ_ARB}{@link #GL_DYNAMIC_COPY_ARB DYNAMIC_COPY_ARB}
+ */ + public static void glBufferDataARB(@NativeType("GLenum") int target, @NativeType("void const *") ByteBuffer data, @NativeType("GLenum") int usage) { + nglBufferDataARB(target, data.remaining(), memAddress(data), usage); + } + + /** + * Creates and initializes a buffer object's data store. + * + *

{@code usage} is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make + * more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store. + * {@code usage} can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The + * frequency of access may be one of these:

+ * + *
    + *
  • STREAM - The data store contents will be modified once and used at most a few times.
  • + *
  • STATIC - The data store contents will be modified once and used many times.
  • + *
  • DYNAMIC - The data store contents will be modified repeatedly and used many times.
  • + *
+ * + *

The nature of access may be one of these:

+ * + *
    + *
  • DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
  • + *
  • READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
  • + *
  • COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
  • + *
+ * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link #GL_STREAM_DRAW_ARB STREAM_DRAW_ARB}{@link #GL_STREAM_READ_ARB STREAM_READ_ARB}{@link #GL_STREAM_COPY_ARB STREAM_COPY_ARB}{@link #GL_STATIC_DRAW_ARB STATIC_DRAW_ARB}{@link #GL_STATIC_READ_ARB STATIC_READ_ARB}
{@link #GL_STATIC_COPY_ARB STATIC_COPY_ARB}{@link #GL_DYNAMIC_DRAW_ARB DYNAMIC_DRAW_ARB}{@link #GL_DYNAMIC_READ_ARB DYNAMIC_READ_ARB}{@link #GL_DYNAMIC_COPY_ARB DYNAMIC_COPY_ARB}
+ */ + public static void glBufferDataARB(@NativeType("GLenum") int target, @NativeType("void const *") ShortBuffer data, @NativeType("GLenum") int usage) { + nglBufferDataARB(target, Integer.toUnsignedLong(data.remaining()) << 1, memAddress(data), usage); + } + + /** + * Creates and initializes a buffer object's data store. + * + *

{@code usage} is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make + * more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store. + * {@code usage} can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The + * frequency of access may be one of these:

+ * + *
    + *
  • STREAM - The data store contents will be modified once and used at most a few times.
  • + *
  • STATIC - The data store contents will be modified once and used many times.
  • + *
  • DYNAMIC - The data store contents will be modified repeatedly and used many times.
  • + *
+ * + *

The nature of access may be one of these:

+ * + *
    + *
  • DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
  • + *
  • READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
  • + *
  • COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
  • + *
+ * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link #GL_STREAM_DRAW_ARB STREAM_DRAW_ARB}{@link #GL_STREAM_READ_ARB STREAM_READ_ARB}{@link #GL_STREAM_COPY_ARB STREAM_COPY_ARB}{@link #GL_STATIC_DRAW_ARB STATIC_DRAW_ARB}{@link #GL_STATIC_READ_ARB STATIC_READ_ARB}
{@link #GL_STATIC_COPY_ARB STATIC_COPY_ARB}{@link #GL_DYNAMIC_DRAW_ARB DYNAMIC_DRAW_ARB}{@link #GL_DYNAMIC_READ_ARB DYNAMIC_READ_ARB}{@link #GL_DYNAMIC_COPY_ARB DYNAMIC_COPY_ARB}
+ */ + public static void glBufferDataARB(@NativeType("GLenum") int target, @NativeType("void const *") IntBuffer data, @NativeType("GLenum") int usage) { + nglBufferDataARB(target, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data), usage); + } + + /** + * Creates and initializes a buffer object's data store. + * + *

{@code usage} is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make + * more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store. + * {@code usage} can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The + * frequency of access may be one of these:

+ * + *
    + *
  • STREAM - The data store contents will be modified once and used at most a few times.
  • + *
  • STATIC - The data store contents will be modified once and used many times.
  • + *
  • DYNAMIC - The data store contents will be modified repeatedly and used many times.
  • + *
+ * + *

The nature of access may be one of these:

+ * + *
    + *
  • DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
  • + *
  • READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
  • + *
  • COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
  • + *
+ * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link #GL_STREAM_DRAW_ARB STREAM_DRAW_ARB}{@link #GL_STREAM_READ_ARB STREAM_READ_ARB}{@link #GL_STREAM_COPY_ARB STREAM_COPY_ARB}{@link #GL_STATIC_DRAW_ARB STATIC_DRAW_ARB}{@link #GL_STATIC_READ_ARB STATIC_READ_ARB}
{@link #GL_STATIC_COPY_ARB STATIC_COPY_ARB}{@link #GL_DYNAMIC_DRAW_ARB DYNAMIC_DRAW_ARB}{@link #GL_DYNAMIC_READ_ARB DYNAMIC_READ_ARB}{@link #GL_DYNAMIC_COPY_ARB DYNAMIC_COPY_ARB}
+ */ + public static void glBufferDataARB(@NativeType("GLenum") int target, @NativeType("void const *") FloatBuffer data, @NativeType("GLenum") int usage) { + nglBufferDataARB(target, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data), usage); + } + + /** + * Creates and initializes a buffer object's data store. + * + *

{@code usage} is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make + * more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store. + * {@code usage} can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The + * frequency of access may be one of these:

+ * + *
    + *
  • STREAM - The data store contents will be modified once and used at most a few times.
  • + *
  • STATIC - The data store contents will be modified once and used many times.
  • + *
  • DYNAMIC - The data store contents will be modified repeatedly and used many times.
  • + *
+ * + *

The nature of access may be one of these:

+ * + *
    + *
  • DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
  • + *
  • READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
  • + *
  • COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
  • + *
+ * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link #GL_STREAM_DRAW_ARB STREAM_DRAW_ARB}{@link #GL_STREAM_READ_ARB STREAM_READ_ARB}{@link #GL_STREAM_COPY_ARB STREAM_COPY_ARB}{@link #GL_STATIC_DRAW_ARB STATIC_DRAW_ARB}{@link #GL_STATIC_READ_ARB STATIC_READ_ARB}
{@link #GL_STATIC_COPY_ARB STATIC_COPY_ARB}{@link #GL_DYNAMIC_DRAW_ARB DYNAMIC_DRAW_ARB}{@link #GL_DYNAMIC_READ_ARB DYNAMIC_READ_ARB}{@link #GL_DYNAMIC_COPY_ARB DYNAMIC_COPY_ARB}
+ */ + public static void glBufferDataARB(@NativeType("GLenum") int target, @NativeType("void const *") DoubleBuffer data, @NativeType("GLenum") int usage) { + nglBufferDataARB(target, Integer.toUnsignedLong(data.remaining()) << 3, memAddress(data), usage); + } + + // --- [ glBufferSubDataARB ] --- + + /** + * Unsafe version of: {@link #glBufferSubDataARB BufferSubDataARB} + * + * @param size the size in bytes of the data store region being replaced + */ + public static native void nglBufferSubDataARB(int target, long offset, long size, long data); + + /** + * Updates a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + */ + public static void glBufferSubDataARB(@NativeType("GLenum") int target, @NativeType("GLintptrARB") long offset, @NativeType("void const *") ByteBuffer data) { + nglBufferSubDataARB(target, offset, data.remaining(), memAddress(data)); + } + + /** + * Updates a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + */ + public static void glBufferSubDataARB(@NativeType("GLenum") int target, @NativeType("GLintptrARB") long offset, @NativeType("void const *") ShortBuffer data) { + nglBufferSubDataARB(target, offset, Integer.toUnsignedLong(data.remaining()) << 1, memAddress(data)); + } + + /** + * Updates a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + */ + public static void glBufferSubDataARB(@NativeType("GLenum") int target, @NativeType("GLintptrARB") long offset, @NativeType("void const *") IntBuffer data) { + nglBufferSubDataARB(target, offset, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data)); + } + + /** + * Updates a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + */ + public static void glBufferSubDataARB(@NativeType("GLenum") int target, @NativeType("GLintptrARB") long offset, @NativeType("void const *") FloatBuffer data) { + nglBufferSubDataARB(target, offset, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data)); + } + + /** + * Updates a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + */ + public static void glBufferSubDataARB(@NativeType("GLenum") int target, @NativeType("GLintptrARB") long offset, @NativeType("void const *") DoubleBuffer data) { + nglBufferSubDataARB(target, offset, Integer.toUnsignedLong(data.remaining()) << 3, memAddress(data)); + } + + // --- [ glGetBufferSubDataARB ] --- + + /** + * Unsafe version of: {@link #glGetBufferSubDataARB GetBufferSubDataARB} + * + * @param size the size in bytes of the data store region being returned + */ + public static native void nglGetBufferSubDataARB(int target, long offset, long size, long data); + + /** + * Returns a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + */ + public static void glGetBufferSubDataARB(@NativeType("GLenum") int target, @NativeType("GLintptrARB") long offset, @NativeType("void *") ByteBuffer data) { + nglGetBufferSubDataARB(target, offset, data.remaining(), memAddress(data)); + } + + /** + * Returns a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + */ + public static void glGetBufferSubDataARB(@NativeType("GLenum") int target, @NativeType("GLintptrARB") long offset, @NativeType("void *") ShortBuffer data) { + nglGetBufferSubDataARB(target, offset, Integer.toUnsignedLong(data.remaining()) << 1, memAddress(data)); + } + + /** + * Returns a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + */ + public static void glGetBufferSubDataARB(@NativeType("GLenum") int target, @NativeType("GLintptrARB") long offset, @NativeType("void *") IntBuffer data) { + nglGetBufferSubDataARB(target, offset, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data)); + } + + /** + * Returns a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + */ + public static void glGetBufferSubDataARB(@NativeType("GLenum") int target, @NativeType("GLintptrARB") long offset, @NativeType("void *") FloatBuffer data) { + nglGetBufferSubDataARB(target, offset, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data)); + } + + /** + * Returns a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + */ + public static void glGetBufferSubDataARB(@NativeType("GLenum") int target, @NativeType("GLintptrARB") long offset, @NativeType("void *") DoubleBuffer data) { + nglGetBufferSubDataARB(target, offset, Integer.toUnsignedLong(data.remaining()) << 3, memAddress(data)); + } + + // --- [ glMapBufferARB ] --- + + /** Unsafe version of: {@link #glMapBufferARB MapBufferARB} */ + public static native long nglMapBufferARB(int target, int access); + + /** + * Maps a buffer object's data store. + * + *

LWJGL note: This method comes in 3 flavors:

+ * + *
    + *
  1. {@link #glMapBufferARB(int, int)} - Calls {@link #glGetBufferParameterivARB GetBufferParameterivARB} to retrieve the buffer size and a new ByteBuffer instance is always returned.
  2. + *
  3. {@link #glMapBufferARB(int, int, ByteBuffer)} - Calls {@link #glGetBufferParameterivARB GetBufferParameterivARB} to retrieve the buffer size and the {@code old_buffer} parameter is reused if not null.
  4. + *
  5. {@link #glMapBufferARB(int, int, long, ByteBuffer)} - The buffer size is explicitly specified and the {@code old_buffer} parameter is reused if not null. This is the most efficient method.
  6. + *
+ * + * @param target the target buffer object being mapped. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param access the access policy, indicating whether it will be possible to read from, write to, or both read from and write to the buffer object's mapped data store. One of:
{@link #GL_READ_ONLY_ARB READ_ONLY_ARB}{@link #GL_WRITE_ONLY_ARB WRITE_ONLY_ARB}{@link #GL_READ_WRITE_ARB READ_WRITE_ARB}
+ */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapBufferARB(@NativeType("GLenum") int target, @NativeType("GLenum") int access) { + long __result = nglMapBufferARB(target, access); + return memByteBufferSafe(__result, glGetBufferParameteriARB(target, GL_BUFFER_SIZE_ARB)); + } + + /** + * Maps a buffer object's data store. + * + *

LWJGL note: This method comes in 3 flavors:

+ * + *
    + *
  1. {@link #glMapBufferARB(int, int)} - Calls {@link #glGetBufferParameterivARB GetBufferParameterivARB} to retrieve the buffer size and a new ByteBuffer instance is always returned.
  2. + *
  3. {@link #glMapBufferARB(int, int, ByteBuffer)} - Calls {@link #glGetBufferParameterivARB GetBufferParameterivARB} to retrieve the buffer size and the {@code old_buffer} parameter is reused if not null.
  4. + *
  5. {@link #glMapBufferARB(int, int, long, ByteBuffer)} - The buffer size is explicitly specified and the {@code old_buffer} parameter is reused if not null. This is the most efficient method.
  6. + *
+ * + * @param target the target buffer object being mapped. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param access the access policy, indicating whether it will be possible to read from, write to, or both read from and write to the buffer object's mapped data store. One of:
{@link #GL_READ_ONLY_ARB READ_ONLY_ARB}{@link #GL_WRITE_ONLY_ARB WRITE_ONLY_ARB}{@link #GL_READ_WRITE_ARB READ_WRITE_ARB}
+ */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapBufferARB(@NativeType("GLenum") int target, @NativeType("GLenum") int access, @Nullable ByteBuffer old_buffer) { + long __result = nglMapBufferARB(target, access); + int length = glGetBufferParameteriARB(target, GL_BUFFER_SIZE_ARB); + return apiGetMappedBuffer(old_buffer, __result, length); + } + + /** + * Maps a buffer object's data store. + * + *

LWJGL note: This method comes in 3 flavors:

+ * + *
    + *
  1. {@link #glMapBufferARB(int, int)} - Calls {@link #glGetBufferParameterivARB GetBufferParameterivARB} to retrieve the buffer size and a new ByteBuffer instance is always returned.
  2. + *
  3. {@link #glMapBufferARB(int, int, ByteBuffer)} - Calls {@link #glGetBufferParameterivARB GetBufferParameterivARB} to retrieve the buffer size and the {@code old_buffer} parameter is reused if not null.
  4. + *
  5. {@link #glMapBufferARB(int, int, long, ByteBuffer)} - The buffer size is explicitly specified and the {@code old_buffer} parameter is reused if not null. This is the most efficient method.
  6. + *
+ * + * @param target the target buffer object being mapped. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param access the access policy, indicating whether it will be possible to read from, write to, or both read from and write to the buffer object's mapped data store. One of:
{@link #GL_READ_ONLY_ARB READ_ONLY_ARB}{@link #GL_WRITE_ONLY_ARB WRITE_ONLY_ARB}{@link #GL_READ_WRITE_ARB READ_WRITE_ARB}
+ */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapBufferARB(@NativeType("GLenum") int target, @NativeType("GLenum") int access, long length, @Nullable ByteBuffer old_buffer) { + long __result = nglMapBufferARB(target, access); + return apiGetMappedBuffer(old_buffer, __result, (int)length); + } + + // --- [ glUnmapBufferARB ] --- + + /** + * Relinquishes the mapping of a buffer object and invalidates the pointer to its data store. + * + *

Returns TRUE unless data values in the buffer’s data store have become corrupted during the period that the buffer was mapped. Such corruption can be + * the result of a screen resolution change or other window system-dependent event that causes system heaps such as those for high-performance graphics + * memory to be discarded. GL implementations must guarantee that such corruption can occur only during the periods that a buffer’s data store is mapped. + * If such corruption has occurred, UnmapBuffer returns FALSE, and the contents of the buffer’s data store become undefined.

+ * + * @param target the target buffer object being unmapped. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ */ + @NativeType("GLboolean") + public static native boolean glUnmapBufferARB(@NativeType("GLenum") int target); + + // --- [ glGetBufferParameterivARB ] --- + + /** Unsafe version of: {@link #glGetBufferParameterivARB GetBufferParameterivARB} */ + public static native void nglGetBufferParameterivARB(int target, int pname, long params); + + /** + * Returns the value of a buffer object parameter. + * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param pname the symbolic name of a buffer object parameter. One of:
{@link GL15#GL_BUFFER_SIZE BUFFER_SIZE}{@link GL15#GL_BUFFER_USAGE BUFFER_USAGE}{@link GL15#GL_BUFFER_ACCESS BUFFER_ACCESS}{@link GL15#GL_BUFFER_MAPPED BUFFER_MAPPED}
{@link GL30#GL_BUFFER_ACCESS_FLAGS BUFFER_ACCESS_FLAGS}{@link GL30#GL_BUFFER_MAP_LENGTH BUFFER_MAP_LENGTH}{@link GL30#GL_BUFFER_MAP_OFFSET BUFFER_MAP_OFFSET}{@link GL44#GL_BUFFER_IMMUTABLE_STORAGE BUFFER_IMMUTABLE_STORAGE}
{@link GL44#GL_BUFFER_STORAGE_FLAGS BUFFER_STORAGE_FLAGS}
+ * @param params the requested parameter + */ + public static void glGetBufferParameterivARB(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetBufferParameterivARB(target, pname, memAddress(params)); + } + + /** + * Returns the value of a buffer object parameter. + * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param pname the symbolic name of a buffer object parameter. One of:
{@link GL15#GL_BUFFER_SIZE BUFFER_SIZE}{@link GL15#GL_BUFFER_USAGE BUFFER_USAGE}{@link GL15#GL_BUFFER_ACCESS BUFFER_ACCESS}{@link GL15#GL_BUFFER_MAPPED BUFFER_MAPPED}
{@link GL30#GL_BUFFER_ACCESS_FLAGS BUFFER_ACCESS_FLAGS}{@link GL30#GL_BUFFER_MAP_LENGTH BUFFER_MAP_LENGTH}{@link GL30#GL_BUFFER_MAP_OFFSET BUFFER_MAP_OFFSET}{@link GL44#GL_BUFFER_IMMUTABLE_STORAGE BUFFER_IMMUTABLE_STORAGE}
{@link GL44#GL_BUFFER_STORAGE_FLAGS BUFFER_STORAGE_FLAGS}
+ */ + @NativeType("void") + public static int glGetBufferParameteriARB(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetBufferParameterivARB(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetBufferPointervARB ] --- + + /** Unsafe version of: {@link #glGetBufferPointervARB GetBufferPointervARB} */ + public static native void nglGetBufferPointervARB(int target, int pname, long params); + + /** + * Returns the pointer to a mapped buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param pname the pointer to be returned. Must be:
{@link #GL_BUFFER_MAP_POINTER_ARB BUFFER_MAP_POINTER_ARB}
+ * @param params the pointer value specified by {@code pname} + */ + public static void glGetBufferPointervARB(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("void **") PointerBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetBufferPointervARB(target, pname, memAddress(params)); + } + + /** + * Returns the pointer to a mapped buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param pname the pointer to be returned. Must be:
{@link #GL_BUFFER_MAP_POINTER_ARB BUFFER_MAP_POINTER_ARB}
+ */ + @NativeType("void") + public static long glGetBufferPointerARB(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + PointerBuffer params = stack.callocPointer(1); + nglGetBufferPointervARB(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #glDeleteBuffersARB DeleteBuffersARB} */ + public static void glDeleteBuffersARB(@NativeType("GLuint const *") int[] buffers) { + long __functionAddress = GL.getICD().glDeleteBuffersARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(buffers.length, buffers, __functionAddress); + } + + /** Array version of: {@link #glGenBuffersARB GenBuffersARB} */ + public static void glGenBuffersARB(@NativeType("GLuint *") int[] buffers) { + long __functionAddress = GL.getICD().glGenBuffersARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(buffers.length, buffers, __functionAddress); + } + + /** Array version of: {@link #glBufferDataARB BufferDataARB} */ + public static void glBufferDataARB(@NativeType("GLenum") int target, @NativeType("void const *") short[] data, @NativeType("GLenum") int usage) { + long __functionAddress = GL.getICD().glBufferDataARB; + if (CHECKS) { + check(__functionAddress); + } + callPPV(target, Integer.toUnsignedLong(data.length) << 1, data, usage, __functionAddress); + } + + /** Array version of: {@link #glBufferDataARB BufferDataARB} */ + public static void glBufferDataARB(@NativeType("GLenum") int target, @NativeType("void const *") int[] data, @NativeType("GLenum") int usage) { + long __functionAddress = GL.getICD().glBufferDataARB; + if (CHECKS) { + check(__functionAddress); + } + callPPV(target, Integer.toUnsignedLong(data.length) << 2, data, usage, __functionAddress); + } + + /** Array version of: {@link #glBufferDataARB BufferDataARB} */ + public static void glBufferDataARB(@NativeType("GLenum") int target, @NativeType("void const *") float[] data, @NativeType("GLenum") int usage) { + long __functionAddress = GL.getICD().glBufferDataARB; + if (CHECKS) { + check(__functionAddress); + } + callPPV(target, Integer.toUnsignedLong(data.length) << 2, data, usage, __functionAddress); + } + + /** Array version of: {@link #glBufferDataARB BufferDataARB} */ + public static void glBufferDataARB(@NativeType("GLenum") int target, @NativeType("void const *") double[] data, @NativeType("GLenum") int usage) { + long __functionAddress = GL.getICD().glBufferDataARB; + if (CHECKS) { + check(__functionAddress); + } + callPPV(target, Integer.toUnsignedLong(data.length) << 3, data, usage, __functionAddress); + } + + /** Array version of: {@link #glBufferSubDataARB BufferSubDataARB} */ + public static void glBufferSubDataARB(@NativeType("GLenum") int target, @NativeType("GLintptrARB") long offset, @NativeType("void const *") short[] data) { + long __functionAddress = GL.getICD().glBufferSubDataARB; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(target, offset, Integer.toUnsignedLong(data.length) << 1, data, __functionAddress); + } + + /** Array version of: {@link #glBufferSubDataARB BufferSubDataARB} */ + public static void glBufferSubDataARB(@NativeType("GLenum") int target, @NativeType("GLintptrARB") long offset, @NativeType("void const *") int[] data) { + long __functionAddress = GL.getICD().glBufferSubDataARB; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(target, offset, Integer.toUnsignedLong(data.length) << 2, data, __functionAddress); + } + + /** Array version of: {@link #glBufferSubDataARB BufferSubDataARB} */ + public static void glBufferSubDataARB(@NativeType("GLenum") int target, @NativeType("GLintptrARB") long offset, @NativeType("void const *") float[] data) { + long __functionAddress = GL.getICD().glBufferSubDataARB; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(target, offset, Integer.toUnsignedLong(data.length) << 2, data, __functionAddress); + } + + /** Array version of: {@link #glBufferSubDataARB BufferSubDataARB} */ + public static void glBufferSubDataARB(@NativeType("GLenum") int target, @NativeType("GLintptrARB") long offset, @NativeType("void const *") double[] data) { + long __functionAddress = GL.getICD().glBufferSubDataARB; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(target, offset, Integer.toUnsignedLong(data.length) << 3, data, __functionAddress); + } + + /** Array version of: {@link #glGetBufferSubDataARB GetBufferSubDataARB} */ + public static void glGetBufferSubDataARB(@NativeType("GLenum") int target, @NativeType("GLintptrARB") long offset, @NativeType("void *") short[] data) { + long __functionAddress = GL.getICD().glGetBufferSubDataARB; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(target, offset, Integer.toUnsignedLong(data.length) << 1, data, __functionAddress); + } + + /** Array version of: {@link #glGetBufferSubDataARB GetBufferSubDataARB} */ + public static void glGetBufferSubDataARB(@NativeType("GLenum") int target, @NativeType("GLintptrARB") long offset, @NativeType("void *") int[] data) { + long __functionAddress = GL.getICD().glGetBufferSubDataARB; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(target, offset, Integer.toUnsignedLong(data.length) << 2, data, __functionAddress); + } + + /** Array version of: {@link #glGetBufferSubDataARB GetBufferSubDataARB} */ + public static void glGetBufferSubDataARB(@NativeType("GLenum") int target, @NativeType("GLintptrARB") long offset, @NativeType("void *") float[] data) { + long __functionAddress = GL.getICD().glGetBufferSubDataARB; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(target, offset, Integer.toUnsignedLong(data.length) << 2, data, __functionAddress); + } + + /** Array version of: {@link #glGetBufferSubDataARB GetBufferSubDataARB} */ + public static void glGetBufferSubDataARB(@NativeType("GLenum") int target, @NativeType("GLintptrARB") long offset, @NativeType("void *") double[] data) { + long __functionAddress = GL.getICD().glGetBufferSubDataARB; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(target, offset, Integer.toUnsignedLong(data.length) << 3, data, __functionAddress); + } + + /** Array version of: {@link #glGetBufferParameterivARB GetBufferParameterivARB} */ + public static void glGetBufferParameterivARB(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetBufferParameterivARB; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexProgram.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexProgram.java new file mode 100644 index 00000000..a1edac5a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexProgram.java @@ -0,0 +1,1574 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_vertex_program extension. + * + *

Unextended OpenGL mandates a certain set of configurable per-vertex computations defining vertex transformation, texture coordinate generation and + * transformation, and lighting. Several extensions have added further per-vertex computations to OpenGL. For example, extensions have defined new texture + * coordinate generation modes ({@link ARBTextureCubeMap ARB_texture_cube_map}, {@link NVTexgenReflection NV_texgen_reflection}, NV_texgen_emboss), new vertex + * transformation modes ({@link ARBVertexBlend ARB_vertex_blend}, EXT_vertex_weighting), new lighting modes (OpenGL 1.2's separate specular and + * rescale normal functionality), several modes for fog distance generation ({@link NVFogDistance NV_fog_distance}), and eye-distance point size attenuation + * ({@link ARBPointParameters ARB_point_parameters}).

+ * + *

Each such extension adds a small set of relatively inflexible per-vertex computations.

+ * + *

This inflexibility is in contrast to the typical flexibility provided by the underlying programmable floating point engines (whether micro-coded vertex + * engines, DSPs, or CPUs) that are traditionally used to implement OpenGL's per-vertex computations. The purpose of this extension is to expose to the + * OpenGL application writer a significant degree of per-vertex programmability for computing vertex parameters.

+ * + *

For the purposes of discussing this extension, a vertex program is a sequence of floating-point 4-component vector operations that determines how a set + * of program parameters (defined outside of OpenGL's {@link GL11#glBegin Begin}/{@link GL11#glEnd End} pair) and an input set of per-vertex parameters are transformed to a set of + * per-vertex result parameters.

+ * + *

The per-vertex computations for standard OpenGL given a particular set of lighting and texture coordinate generation modes (along with any state for + * extensions defining per-vertex computations) is, in essence, a vertex program. However, the sequence of operations is defined implicitly by the current + * OpenGL state settings rather than defined explicitly as a sequence of instructions.

+ * + *

This extension provides an explicit mechanism for defining vertex program instruction sequences for application-defined vertex programs. In order to + * define such vertex programs, this extension defines a vertex programming model including a floating-point 4-component vector instruction set and a + * relatively large set of floating-point 4-component registers.

+ * + *

The extension's vertex programming model is designed for efficient hardware implementation and to support a wide variety of vertex programs. By design, + * the entire set of existing vertex programs defined by existing OpenGL per-vertex computation extensions can be implemented using the extension's vertex + * programming model.

+ */ +public class ARBVertexProgram { + + /** + * Accepted by the {@code cap} parameter of Disable, Enable, and IsEnabled, by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev, and by the {@code target} parameter of ProgramStringARB, BindProgramARB, ProgramEnvParameter4[df][v]ARB, ProgramLocalParameter4[df][v]ARB, + * GetProgramEnvParameter[df]vARB, GetProgramLocalParameter[df]vARB, GetProgramivARB, and GetProgramStringARB. + */ + public static final int GL_VERTEX_PROGRAM_ARB = 0x8620; + + /** + * Accepted by the {@code cap} parameter of Disable, Enable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int + GL_VERTEX_PROGRAM_POINT_SIZE_ARB = 0x8642, + GL_VERTEX_PROGRAM_TWO_SIDE_ARB = 0x8643, + GL_COLOR_SUM_ARB = 0x8458; + + /** Accepted by the {@code format} parameter of ProgramStringARB. */ + public static final int GL_PROGRAM_FORMAT_ASCII_ARB = 0x8875; + + /** Accepted by the {@code pname} parameter of GetVertexAttrib[dfi]vARB. */ + public static final int + GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB = 0x8622, + GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB = 0x8623, + GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB = 0x8624, + GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB = 0x8625, + GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = 0x886A, + GL_CURRENT_VERTEX_ATTRIB_ARB = 0x8626; + + /** Accepted by the {@code pname} parameter of GetVertexAttribPointervARB. */ + public static final int GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB = 0x8645; + + /** Accepted by the {@code pname} parameter of GetProgramivARB. */ + public static final int + GL_PROGRAM_LENGTH_ARB = 0x8627, + GL_PROGRAM_FORMAT_ARB = 0x8876, + GL_PROGRAM_BINDING_ARB = 0x8677, + GL_PROGRAM_INSTRUCTIONS_ARB = 0x88A0, + GL_MAX_PROGRAM_INSTRUCTIONS_ARB = 0x88A1, + GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A2, + GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB = 0x88A3, + GL_PROGRAM_TEMPORARIES_ARB = 0x88A4, + GL_MAX_PROGRAM_TEMPORARIES_ARB = 0x88A5, + GL_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A6, + GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB = 0x88A7, + GL_PROGRAM_PARAMETERS_ARB = 0x88A8, + GL_MAX_PROGRAM_PARAMETERS_ARB = 0x88A9, + GL_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AA, + GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB = 0x88AB, + GL_PROGRAM_ATTRIBS_ARB = 0x88AC, + GL_MAX_PROGRAM_ATTRIBS_ARB = 0x88AD, + GL_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AE, + GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB = 0x88AF, + GL_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B0, + GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB = 0x88B1, + GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B2, + GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB = 0x88B3, + GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB = 0x88B4, + GL_MAX_PROGRAM_ENV_PARAMETERS_ARB = 0x88B5, + GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB = 0x88B6; + + /** Accepted by the {@code pname} parameter of GetProgramStringARB. */ + public static final int GL_PROGRAM_STRING_ARB = 0x8628; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_PROGRAM_ERROR_POSITION_ARB = 0x864B, + GL_CURRENT_MATRIX_ARB = 0x8641, + GL_TRANSPOSE_CURRENT_MATRIX_ARB = 0x88B7, + GL_CURRENT_MATRIX_STACK_DEPTH_ARB = 0x8640, + GL_MAX_VERTEX_ATTRIBS_ARB = 0x8869, + GL_MAX_PROGRAM_MATRICES_ARB = 0x862F, + GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB = 0x862E; + + /** Accepted by the {@code name} parameter of GetString. */ + public static final int GL_PROGRAM_ERROR_STRING_ARB = 0x8874; + + /** Accepted by the {@code mode} parameter of MatrixMode. */ + public static final int + GL_MATRIX0_ARB = 0x88C0, + GL_MATRIX1_ARB = 0x88C1, + GL_MATRIX2_ARB = 0x88C2, + GL_MATRIX3_ARB = 0x88C3, + GL_MATRIX4_ARB = 0x88C4, + GL_MATRIX5_ARB = 0x88C5, + GL_MATRIX6_ARB = 0x88C6, + GL_MATRIX7_ARB = 0x88C7, + GL_MATRIX8_ARB = 0x88C8, + GL_MATRIX9_ARB = 0x88C9, + GL_MATRIX10_ARB = 0x88CA, + GL_MATRIX11_ARB = 0x88CB, + GL_MATRIX12_ARB = 0x88CC, + GL_MATRIX13_ARB = 0x88CD, + GL_MATRIX14_ARB = 0x88CE, + GL_MATRIX15_ARB = 0x88CF, + GL_MATRIX16_ARB = 0x88D0, + GL_MATRIX17_ARB = 0x88D1, + GL_MATRIX18_ARB = 0x88D2, + GL_MATRIX19_ARB = 0x88D3, + GL_MATRIX20_ARB = 0x88D4, + GL_MATRIX21_ARB = 0x88D5, + GL_MATRIX22_ARB = 0x88D6, + GL_MATRIX23_ARB = 0x88D7, + GL_MATRIX24_ARB = 0x88D8, + GL_MATRIX25_ARB = 0x88D9, + GL_MATRIX26_ARB = 0x88DA, + GL_MATRIX27_ARB = 0x88DB, + GL_MATRIX28_ARB = 0x88DC, + GL_MATRIX29_ARB = 0x88DD, + GL_MATRIX30_ARB = 0x88DE, + GL_MATRIX31_ARB = 0x88DF; + + static { GL.initialize(); } + + protected ARBVertexProgram() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glVertexAttrib1sARB, caps.glVertexAttrib1fARB, caps.glVertexAttrib1dARB, caps.glVertexAttrib2sARB, caps.glVertexAttrib2fARB, + caps.glVertexAttrib2dARB, caps.glVertexAttrib3sARB, caps.glVertexAttrib3fARB, caps.glVertexAttrib3dARB, caps.glVertexAttrib4sARB, + caps.glVertexAttrib4fARB, caps.glVertexAttrib4dARB, caps.glVertexAttrib4NubARB, caps.glVertexAttrib1svARB, caps.glVertexAttrib1fvARB, + caps.glVertexAttrib1dvARB, caps.glVertexAttrib2svARB, caps.glVertexAttrib2fvARB, caps.glVertexAttrib2dvARB, caps.glVertexAttrib3svARB, + caps.glVertexAttrib3fvARB, caps.glVertexAttrib3dvARB, caps.glVertexAttrib4fvARB, caps.glVertexAttrib4bvARB, caps.glVertexAttrib4svARB, + caps.glVertexAttrib4ivARB, caps.glVertexAttrib4ubvARB, caps.glVertexAttrib4usvARB, caps.glVertexAttrib4uivARB, caps.glVertexAttrib4dvARB, + caps.glVertexAttrib4NbvARB, caps.glVertexAttrib4NsvARB, caps.glVertexAttrib4NivARB, caps.glVertexAttrib4NubvARB, caps.glVertexAttrib4NusvARB, + caps.glVertexAttrib4NuivARB, caps.glVertexAttribPointerARB, caps.glEnableVertexAttribArrayARB, caps.glDisableVertexAttribArrayARB, + caps.glProgramStringARB, caps.glBindProgramARB, caps.glDeleteProgramsARB, caps.glGenProgramsARB, caps.glProgramEnvParameter4dARB, + caps.glProgramEnvParameter4dvARB, caps.glProgramEnvParameter4fARB, caps.glProgramEnvParameter4fvARB, caps.glProgramLocalParameter4dARB, + caps.glProgramLocalParameter4dvARB, caps.glProgramLocalParameter4fARB, caps.glProgramLocalParameter4fvARB, caps.glGetProgramEnvParameterfvARB, + caps.glGetProgramEnvParameterdvARB, caps.glGetProgramLocalParameterfvARB, caps.glGetProgramLocalParameterdvARB, caps.glGetProgramivARB, + caps.glGetProgramStringARB, caps.glGetVertexAttribfvARB, caps.glGetVertexAttribdvARB, caps.glGetVertexAttribivARB, + caps.glGetVertexAttribPointervARB, caps.glIsProgramARB + ); + } + + // --- [ glVertexAttrib1sARB ] --- + + /** + * Short version of {@link #glVertexAttrib1fARB VertexAttrib1fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + */ + public static void glVertexAttrib1sARB(@NativeType("GLuint") int index, @NativeType("GLshort") short v0) { + ARBVertexShader.glVertexAttrib1sARB(index, v0); + } + + // --- [ glVertexAttrib1fARB ] --- + + /** + * Specifies the value of a generic vertex attribute. The y and z components are implicitly set to 0.0f and w to 1.0f. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + */ + public static void glVertexAttrib1fARB(@NativeType("GLuint") int index, @NativeType("GLfloat") float v0) { + ARBVertexShader.glVertexAttrib1fARB(index, v0); + } + + // --- [ glVertexAttrib1dARB ] --- + + /** + * Double version of {@link #glVertexAttrib1fARB VertexAttrib1fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + */ + public static void glVertexAttrib1dARB(@NativeType("GLuint") int index, @NativeType("GLdouble") double v0) { + ARBVertexShader.glVertexAttrib1dARB(index, v0); + } + + // --- [ glVertexAttrib2sARB ] --- + + /** + * Short version of {@link #glVertexAttrib2fARB VertexAttrib2fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + */ + public static void glVertexAttrib2sARB(@NativeType("GLuint") int index, @NativeType("GLshort") short v0, @NativeType("GLshort") short v1) { + ARBVertexShader.glVertexAttrib2sARB(index, v0, v1); + } + + // --- [ glVertexAttrib2fARB ] --- + + /** + * Specifies the value of a generic vertex attribute. The y component is implicitly set to 0.0f and w to 1.0f. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + */ + public static void glVertexAttrib2fARB(@NativeType("GLuint") int index, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1) { + ARBVertexShader.glVertexAttrib2fARB(index, v0, v1); + } + + // --- [ glVertexAttrib2dARB ] --- + + /** + * Double version of {@link #glVertexAttrib2fARB VertexAttrib2fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + */ + public static void glVertexAttrib2dARB(@NativeType("GLuint") int index, @NativeType("GLdouble") double v0, @NativeType("GLdouble") double v1) { + ARBVertexShader.glVertexAttrib2dARB(index, v0, v1); + } + + // --- [ glVertexAttrib3sARB ] --- + + /** + * Short version of {@link #glVertexAttrib3fARB VertexAttrib3fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + */ + public static void glVertexAttrib3sARB(@NativeType("GLuint") int index, @NativeType("GLshort") short v0, @NativeType("GLshort") short v1, @NativeType("GLshort") short v2) { + ARBVertexShader.glVertexAttrib3sARB(index, v0, v1, v2); + } + + // --- [ glVertexAttrib3fARB ] --- + + /** + * Specifies the value of a generic vertex attribute. The w is implicitly set to 1.0f. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + */ + public static void glVertexAttrib3fARB(@NativeType("GLuint") int index, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1, @NativeType("GLfloat") float v2) { + ARBVertexShader.glVertexAttrib3fARB(index, v0, v1, v2); + } + + // --- [ glVertexAttrib3dARB ] --- + + /** + * Double version of {@link #glVertexAttrib3fARB VertexAttrib3fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + */ + public static void glVertexAttrib3dARB(@NativeType("GLuint") int index, @NativeType("GLdouble") double v0, @NativeType("GLdouble") double v1, @NativeType("GLdouble") double v2) { + ARBVertexShader.glVertexAttrib3dARB(index, v0, v1, v2); + } + + // --- [ glVertexAttrib4sARB ] --- + + /** + * Short version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + * @param v3 the vertex attribute w component + */ + public static void glVertexAttrib4sARB(@NativeType("GLuint") int index, @NativeType("GLshort") short v0, @NativeType("GLshort") short v1, @NativeType("GLshort") short v2, @NativeType("GLshort") short v3) { + ARBVertexShader.glVertexAttrib4sARB(index, v0, v1, v2, v3); + } + + // --- [ glVertexAttrib4fARB ] --- + + /** + * Specifies the value of a generic vertex attribute. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + * @param v3 the vertex attribute w component + */ + public static void glVertexAttrib4fARB(@NativeType("GLuint") int index, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1, @NativeType("GLfloat") float v2, @NativeType("GLfloat") float v3) { + ARBVertexShader.glVertexAttrib4fARB(index, v0, v1, v2, v3); + } + + // --- [ glVertexAttrib4dARB ] --- + + /** + * Double version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + * @param v3 the vertex attribute w component + */ + public static void glVertexAttrib4dARB(@NativeType("GLuint") int index, @NativeType("GLdouble") double v0, @NativeType("GLdouble") double v1, @NativeType("GLdouble") double v2, @NativeType("GLdouble") double v3) { + ARBVertexShader.glVertexAttrib4dARB(index, v0, v1, v2, v3); + } + + // --- [ glVertexAttrib4NubARB ] --- + + /** + * Normalized unsigned byte version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * @param z the vertex attribute z component + * @param w the vertex attribute w component + */ + public static void glVertexAttrib4NubARB(@NativeType("GLuint") int index, @NativeType("GLubyte") byte x, @NativeType("GLubyte") byte y, @NativeType("GLubyte") byte z, @NativeType("GLubyte") byte w) { + ARBVertexShader.glVertexAttrib4NubARB(index, x, y, z, w); + } + + // --- [ glVertexAttrib1svARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib1svARB VertexAttrib1svARB} */ + public static void nglVertexAttrib1svARB(int index, long v) { + ARBVertexShader.nglVertexAttrib1svARB(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib1sARB VertexAttrib1sARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib1svARB(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + ARBVertexShader.glVertexAttrib1svARB(index, v); + } + + // --- [ glVertexAttrib1fvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib1fvARB VertexAttrib1fvARB} */ + public static void nglVertexAttrib1fvARB(int index, long v) { + ARBVertexShader.nglVertexAttrib1fvARB(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib1fARB VertexAttrib1fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib1fvARB(@NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer v) { + ARBVertexShader.glVertexAttrib1fvARB(index, v); + } + + // --- [ glVertexAttrib1dvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib1dvARB VertexAttrib1dvARB} */ + public static void nglVertexAttrib1dvARB(int index, long v) { + ARBVertexShader.nglVertexAttrib1dvARB(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib1dARB VertexAttrib1dARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib1dvARB(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + ARBVertexShader.glVertexAttrib1dvARB(index, v); + } + + // --- [ glVertexAttrib2svARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib2svARB VertexAttrib2svARB} */ + public static void nglVertexAttrib2svARB(int index, long v) { + ARBVertexShader.nglVertexAttrib2svARB(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib2sARB VertexAttrib2sARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib2svARB(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + ARBVertexShader.glVertexAttrib2svARB(index, v); + } + + // --- [ glVertexAttrib2fvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib2fvARB VertexAttrib2fvARB} */ + public static void nglVertexAttrib2fvARB(int index, long v) { + ARBVertexShader.nglVertexAttrib2fvARB(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib2fARB VertexAttrib2fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib2fvARB(@NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer v) { + ARBVertexShader.glVertexAttrib2fvARB(index, v); + } + + // --- [ glVertexAttrib2dvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib2dvARB VertexAttrib2dvARB} */ + public static void nglVertexAttrib2dvARB(int index, long v) { + ARBVertexShader.nglVertexAttrib2dvARB(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib2dARB VertexAttrib2dARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib2dvARB(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + ARBVertexShader.glVertexAttrib2dvARB(index, v); + } + + // --- [ glVertexAttrib3svARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib3svARB VertexAttrib3svARB} */ + public static void nglVertexAttrib3svARB(int index, long v) { + ARBVertexShader.nglVertexAttrib3svARB(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib3sARB VertexAttrib3sARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib3svARB(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + ARBVertexShader.glVertexAttrib3svARB(index, v); + } + + // --- [ glVertexAttrib3fvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib3fvARB VertexAttrib3fvARB} */ + public static void nglVertexAttrib3fvARB(int index, long v) { + ARBVertexShader.nglVertexAttrib3fvARB(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib3fARB VertexAttrib3fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib3fvARB(@NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer v) { + ARBVertexShader.glVertexAttrib3fvARB(index, v); + } + + // --- [ glVertexAttrib3dvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib3dvARB VertexAttrib3dvARB} */ + public static void nglVertexAttrib3dvARB(int index, long v) { + ARBVertexShader.nglVertexAttrib3dvARB(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib3dARB VertexAttrib3dARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib3dvARB(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + ARBVertexShader.glVertexAttrib3dvARB(index, v); + } + + // --- [ glVertexAttrib4fvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4fvARB VertexAttrib4fvARB} */ + public static void nglVertexAttrib4fvARB(int index, long v) { + ARBVertexShader.nglVertexAttrib4fvARB(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4fvARB(@NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer v) { + ARBVertexShader.glVertexAttrib4fvARB(index, v); + } + + // --- [ glVertexAttrib4bvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4bvARB VertexAttrib4bvARB} */ + public static void nglVertexAttrib4bvARB(int index, long v) { + ARBVertexShader.nglVertexAttrib4bvARB(index, v); + } + + /** + * Byte pointer version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4bvARB(@NativeType("GLuint") int index, @NativeType("GLbyte const *") ByteBuffer v) { + ARBVertexShader.glVertexAttrib4bvARB(index, v); + } + + // --- [ glVertexAttrib4svARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4svARB VertexAttrib4svARB} */ + public static void nglVertexAttrib4svARB(int index, long v) { + ARBVertexShader.nglVertexAttrib4svARB(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib4sARB VertexAttrib4sARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4svARB(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + ARBVertexShader.glVertexAttrib4svARB(index, v); + } + + // --- [ glVertexAttrib4ivARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4ivARB VertexAttrib4ivARB} */ + public static void nglVertexAttrib4ivARB(int index, long v) { + ARBVertexShader.nglVertexAttrib4ivARB(index, v); + } + + /** + * Integer pointer version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4ivARB(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + ARBVertexShader.glVertexAttrib4ivARB(index, v); + } + + // --- [ glVertexAttrib4ubvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4ubvARB VertexAttrib4ubvARB} */ + public static void nglVertexAttrib4ubvARB(int index, long v) { + ARBVertexShader.nglVertexAttrib4ubvARB(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib4NubARB VertexAttrib4NubARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4ubvARB(@NativeType("GLuint") int index, @NativeType("GLubyte const *") ByteBuffer v) { + ARBVertexShader.glVertexAttrib4ubvARB(index, v); + } + + // --- [ glVertexAttrib4usvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4usvARB VertexAttrib4usvARB} */ + public static void nglVertexAttrib4usvARB(int index, long v) { + ARBVertexShader.nglVertexAttrib4usvARB(index, v); + } + + /** + * Unsigned short pointer version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4usvARB(@NativeType("GLuint") int index, @NativeType("GLushort const *") ShortBuffer v) { + ARBVertexShader.glVertexAttrib4usvARB(index, v); + } + + // --- [ glVertexAttrib4uivARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4uivARB VertexAttrib4uivARB} */ + public static void nglVertexAttrib4uivARB(int index, long v) { + ARBVertexShader.nglVertexAttrib4uivARB(index, v); + } + + /** + * Unsigned int pointer version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4uivARB(@NativeType("GLuint") int index, @NativeType("GLuint const *") IntBuffer v) { + ARBVertexShader.glVertexAttrib4uivARB(index, v); + } + + // --- [ glVertexAttrib4dvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4dvARB VertexAttrib4dvARB} */ + public static void nglVertexAttrib4dvARB(int index, long v) { + ARBVertexShader.nglVertexAttrib4dvARB(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib4dARB VertexAttrib4dARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4dvARB(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + ARBVertexShader.glVertexAttrib4dvARB(index, v); + } + + // --- [ glVertexAttrib4NbvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4NbvARB VertexAttrib4NbvARB} */ + public static void nglVertexAttrib4NbvARB(int index, long v) { + ARBVertexShader.nglVertexAttrib4NbvARB(index, v); + } + + /** + * Normalized byte pointer version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4NbvARB(@NativeType("GLuint") int index, @NativeType("GLbyte const *") ByteBuffer v) { + ARBVertexShader.glVertexAttrib4NbvARB(index, v); + } + + // --- [ glVertexAttrib4NsvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4NsvARB VertexAttrib4NsvARB} */ + public static void nglVertexAttrib4NsvARB(int index, long v) { + ARBVertexShader.nglVertexAttrib4NsvARB(index, v); + } + + /** + * Normalized short pointer version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4NsvARB(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + ARBVertexShader.glVertexAttrib4NsvARB(index, v); + } + + // --- [ glVertexAttrib4NivARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4NivARB VertexAttrib4NivARB} */ + public static void nglVertexAttrib4NivARB(int index, long v) { + ARBVertexShader.nglVertexAttrib4NivARB(index, v); + } + + /** + * Normalized int pointer version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4NivARB(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + ARBVertexShader.glVertexAttrib4NivARB(index, v); + } + + // --- [ glVertexAttrib4NubvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4NubvARB VertexAttrib4NubvARB} */ + public static void nglVertexAttrib4NubvARB(int index, long v) { + ARBVertexShader.nglVertexAttrib4NubvARB(index, v); + } + + /** + * Normalized unsigned byte pointer version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4NubvARB(@NativeType("GLuint") int index, @NativeType("GLubyte const *") ByteBuffer v) { + ARBVertexShader.glVertexAttrib4NubvARB(index, v); + } + + // --- [ glVertexAttrib4NusvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4NusvARB VertexAttrib4NusvARB} */ + public static void nglVertexAttrib4NusvARB(int index, long v) { + ARBVertexShader.nglVertexAttrib4NusvARB(index, v); + } + + /** + * Normalized unsigned short pointer version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4NusvARB(@NativeType("GLuint") int index, @NativeType("GLushort const *") ShortBuffer v) { + ARBVertexShader.glVertexAttrib4NusvARB(index, v); + } + + // --- [ glVertexAttrib4NuivARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4NuivARB VertexAttrib4NuivARB} */ + public static void nglVertexAttrib4NuivARB(int index, long v) { + ARBVertexShader.nglVertexAttrib4NuivARB(index, v); + } + + /** + * Normalized unsigned int pointer version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4NuivARB(@NativeType("GLuint") int index, @NativeType("GLuint const *") IntBuffer v) { + ARBVertexShader.glVertexAttrib4NuivARB(index, v); + } + + // --- [ glVertexAttribPointerARB ] --- + + /** Unsafe version of: {@link #glVertexAttribPointerARB VertexAttribPointerARB} */ + public static void nglVertexAttribPointerARB(int index, int size, int type, boolean normalized, int stride, long pointer) { + ARBVertexShader.nglVertexAttribPointerARB(index, size, type, normalized, stride, pointer); + } + + /** + * Specifies the location and organization of a vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. The initial value is GL_FLOAT. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL41#GL_FIXED FIXED}
+ * @param normalized whether fixed-point data values should be normalized or converted directly as fixed-point values when they are accessed + * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + */ + public static void glVertexAttribPointerARB(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + ARBVertexShader.glVertexAttribPointerARB(index, size, type, normalized, stride, pointer); + } + + /** + * Specifies the location and organization of a vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. The initial value is GL_FLOAT. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL41#GL_FIXED FIXED}
+ * @param normalized whether fixed-point data values should be normalized or converted directly as fixed-point values when they are accessed + * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + */ + public static void glVertexAttribPointerARB(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + ARBVertexShader.glVertexAttribPointerARB(index, size, type, normalized, stride, pointer); + } + + /** + * Specifies the location and organization of a vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. The initial value is GL_FLOAT. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL41#GL_FIXED FIXED}
+ * @param normalized whether fixed-point data values should be normalized or converted directly as fixed-point values when they are accessed + * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + */ + public static void glVertexAttribPointerARB(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") ShortBuffer pointer) { + ARBVertexShader.glVertexAttribPointerARB(index, size, type, normalized, stride, pointer); + } + + /** + * Specifies the location and organization of a vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. The initial value is GL_FLOAT. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL41#GL_FIXED FIXED}
+ * @param normalized whether fixed-point data values should be normalized or converted directly as fixed-point values when they are accessed + * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + */ + public static void glVertexAttribPointerARB(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") IntBuffer pointer) { + ARBVertexShader.glVertexAttribPointerARB(index, size, type, normalized, stride, pointer); + } + + /** + * Specifies the location and organization of a vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. The initial value is GL_FLOAT. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL41#GL_FIXED FIXED}
+ * @param normalized whether fixed-point data values should be normalized or converted directly as fixed-point values when they are accessed + * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + */ + public static void glVertexAttribPointerARB(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") FloatBuffer pointer) { + ARBVertexShader.glVertexAttribPointerARB(index, size, type, normalized, stride, pointer); + } + + // --- [ glEnableVertexAttribArrayARB ] --- + + /** + * Enables a generic vertex attribute array. + * + * @param index the index of the generic vertex attribute to be enabled + */ + public static void glEnableVertexAttribArrayARB(@NativeType("GLuint") int index) { + ARBVertexShader.glEnableVertexAttribArrayARB(index); + } + + // --- [ glDisableVertexAttribArrayARB ] --- + + /** + * Disables a generic vertex attribute array. + * + * @param index the index of the generic vertex attribute to be disabled + */ + public static void glDisableVertexAttribArrayARB(@NativeType("GLuint") int index) { + ARBVertexShader.glDisableVertexAttribArrayARB(index); + } + + // --- [ glProgramStringARB ] --- + + /** + * Unsafe version of: {@link #glProgramStringARB ProgramStringARB} + * + * @param len the length of the program string, excluding the null-terminator + */ + public static native void nglProgramStringARB(int target, int format, int len, long string); + + /** + * Updates the program string for the current program object for {@code target}. + * + *

When a program string is loaded, it is interpreted according to syntactic and semantic rules corresponding to the program target specified by + * {@code target}. If a program violates the syntactic or semantic restrictions of the program target, ProgramStringARB generates the error + * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION}.

+ * + *

Additionally, ProgramString will update the program error position ({@link #GL_PROGRAM_ERROR_POSITION_ARB PROGRAM_ERROR_POSITION_ARB}) and error string ({@link #GL_PROGRAM_ERROR_STRING_ARB PROGRAM_ERROR_STRING_ARB}). If a + * program fails to load, the value of the program error position is set to the ubyte offset into the specified program string indicating where the first + * program error was detected. If the program fails to load because of a semantic restriction that is not detected until the program is fully scanned, the + * error position is set to the value of {@code len}. If a program loads successfully, the error position is set to the value negative one. The + * implementation-dependent program error string contains one or more error or warning messages. If a program loads succesfully, the error string may + * either contain warning messages or be empty.

+ * + * @param target the program target. One of:
{@link #GL_VERTEX_PROGRAM_ARB VERTEX_PROGRAM_ARB}{@link ARBFragmentProgram#GL_FRAGMENT_PROGRAM_ARB FRAGMENT_PROGRAM_ARB}
+ * @param format the format of the program string. Must be:
{@link #GL_PROGRAM_FORMAT_ASCII_ARB PROGRAM_FORMAT_ASCII_ARB}
+ * @param string an array of bytes representing the program string being loaded + */ + public static void glProgramStringARB(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer string) { + nglProgramStringARB(target, format, string.remaining(), memAddress(string)); + } + + // --- [ glBindProgramARB ] --- + + /** + * Creates a named program object by binding an unused program object name to a valid program target. Also can be used to bind an existing program object + * to a program target. + * + * @param target the program target. One of:
{@link #GL_VERTEX_PROGRAM_ARB VERTEX_PROGRAM_ARB}{@link ARBFragmentProgram#GL_FRAGMENT_PROGRAM_ARB FRAGMENT_PROGRAM_ARB}
+ * @param program the program object to bind. If {@code program} is zero, the default program object for {@code target} is bound. If {@code program} is the name of + * an existing program object whose associated program target is {@code target}, the named program object is bound. + */ + public static native void glBindProgramARB(@NativeType("GLenum") int target, @NativeType("GLuint") int program); + + // --- [ glDeleteProgramsARB ] --- + + /** + * Unsafe version of: {@link #glDeleteProgramsARB DeleteProgramsARB} + * + * @param n the number of program object to delete + */ + public static native void nglDeleteProgramsARB(int n, long programs); + + /** + * Deletes program objects. + * + * @param programs an array of {@code n} program objects to be deleted + */ + public static void glDeleteProgramsARB(@NativeType("GLuint const *") IntBuffer programs) { + nglDeleteProgramsARB(programs.remaining(), memAddress(programs)); + } + + // --- [ glGenProgramsARB ] --- + + /** + * Unsafe version of: {@link #glGenProgramsARB GenProgramsARB} + * + * @param n the number of program names to genereate + */ + public static native void nglGenProgramsARB(int n, long programs); + + /** + * Returns {@code n} currently unused program names in {@code programs}. These names are marked as used, for the purposes of GenProgramsARB only, but + * objects are created only when they are first bound using {@link #glBindProgramARB BindProgramARB}. + * + * @param programs an array in which to return the generated program names + */ + public static void glGenProgramsARB(@NativeType("GLuint *") IntBuffer programs) { + nglGenProgramsARB(programs.remaining(), memAddress(programs)); + } + + /** + * Returns {@code n} currently unused program names in {@code programs}. These names are marked as used, for the purposes of GenProgramsARB only, but + * objects are created only when they are first bound using {@link #glBindProgramARB BindProgramARB}. + */ + @NativeType("void") + public static int glGenProgramsARB() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer programs = stack.callocInt(1); + nglGenProgramsARB(1, memAddress(programs)); + return programs.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glProgramEnvParameter4dARB ] --- + + /** + * Double version of {@link #glProgramEnvParameter4fARB ProgramEnvParameter4fARB}. + * + * @param target the program target. One of:
{@link #GL_VERTEX_PROGRAM_ARB VERTEX_PROGRAM_ARB}{@link ARBFragmentProgram#GL_FRAGMENT_PROGRAM_ARB FRAGMENT_PROGRAM_ARB}
+ * @param index the environment parameter index + * @param x the {@code x} parameter component + * @param y the {@code y} parameter component + * @param z the {@code z} parameter component + * @param w the {@code w} parameter component + */ + public static native void glProgramEnvParameter4dARB(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z, @NativeType("GLdouble") double w); + + // --- [ glProgramEnvParameter4dvARB ] --- + + /** Unsafe version of: {@link #glProgramEnvParameter4dvARB ProgramEnvParameter4dvARB} */ + public static native void nglProgramEnvParameter4dvARB(int target, int index, long params); + + /** + * Pointer version of {@link #glProgramEnvParameter4dARB ProgramEnvParameter4dARB} + * + * @param target the program target. One of:
{@link #GL_VERTEX_PROGRAM_ARB VERTEX_PROGRAM_ARB}{@link ARBFragmentProgram#GL_FRAGMENT_PROGRAM_ARB FRAGMENT_PROGRAM_ARB}
+ * @param index the environment parameter index + * @param params a buffer from which to read the parameter value + */ + public static void glProgramEnvParameter4dvARB(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglProgramEnvParameter4dvARB(target, index, memAddress(params)); + } + + // --- [ glProgramEnvParameter4fARB ] --- + + /** + * Updates the values of the program environment parameter numbered {@code index} for the specified program target {@code target}. + * + * @param target the program target. One of:
{@link #GL_VERTEX_PROGRAM_ARB VERTEX_PROGRAM_ARB}{@link ARBFragmentProgram#GL_FRAGMENT_PROGRAM_ARB FRAGMENT_PROGRAM_ARB}
+ * @param index the environment parameter index + * @param x the {@code x} parameter component + * @param y the {@code y} parameter component + * @param z the {@code z} parameter component + * @param w the {@code w} parameter component + */ + public static native void glProgramEnvParameter4fARB(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z, @NativeType("GLfloat") float w); + + // --- [ glProgramEnvParameter4fvARB ] --- + + /** Unsafe version of: {@link #glProgramEnvParameter4fvARB ProgramEnvParameter4fvARB} */ + public static native void nglProgramEnvParameter4fvARB(int target, int index, long params); + + /** + * Pointer version of {@link #glProgramEnvParameter4fARB ProgramEnvParameter4fARB}. + * + * @param target the program target. One of:
{@link #GL_VERTEX_PROGRAM_ARB VERTEX_PROGRAM_ARB}{@link ARBFragmentProgram#GL_FRAGMENT_PROGRAM_ARB FRAGMENT_PROGRAM_ARB}
+ * @param index the environment parameter index + * @param params a buffer from which to read the parameter value + */ + public static void glProgramEnvParameter4fvARB(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglProgramEnvParameter4fvARB(target, index, memAddress(params)); + } + + // --- [ glProgramLocalParameter4dARB ] --- + + /** + * Double version of {@link #glProgramLocalParameter4fARB ProgramLocalParameter4fARB}. + * + * @param target the program target. One of:
{@link #GL_VERTEX_PROGRAM_ARB VERTEX_PROGRAM_ARB}{@link ARBFragmentProgram#GL_FRAGMENT_PROGRAM_ARB FRAGMENT_PROGRAM_ARB}
+ * @param index the environment parameter index + * @param x the {@code x} parameter component + * @param y the {@code y} parameter component + * @param z the {@code z} parameter component + * @param w the {@code w} parameter component + */ + public static native void glProgramLocalParameter4dARB(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z, @NativeType("GLdouble") double w); + + // --- [ glProgramLocalParameter4dvARB ] --- + + /** Unsafe version of: {@link #glProgramLocalParameter4dvARB ProgramLocalParameter4dvARB} */ + public static native void nglProgramLocalParameter4dvARB(int target, int index, long params); + + /** + * Pointer version of {@link #glProgramLocalParameter4dARB ProgramLocalParameter4dARB}. + * + * @param target the program target. One of:
{@link #GL_VERTEX_PROGRAM_ARB VERTEX_PROGRAM_ARB}{@link ARBFragmentProgram#GL_FRAGMENT_PROGRAM_ARB FRAGMENT_PROGRAM_ARB}
+ * @param index the environment parameter index + * @param params a buffer from which to read the parameter value + */ + public static void glProgramLocalParameter4dvARB(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglProgramLocalParameter4dvARB(target, index, memAddress(params)); + } + + // --- [ glProgramLocalParameter4fARB ] --- + + /** + * Updates the values of the program local parameter numbered {@code index} for the specified program target {@code target}. + * + * @param target the program target. One of:
{@link #GL_VERTEX_PROGRAM_ARB VERTEX_PROGRAM_ARB}{@link ARBFragmentProgram#GL_FRAGMENT_PROGRAM_ARB FRAGMENT_PROGRAM_ARB}
+ * @param index the environment parameter index + * @param x the {@code x} parameter component + * @param y the {@code y} parameter component + * @param z the {@code z} parameter component + * @param w the {@code w} parameter component + */ + public static native void glProgramLocalParameter4fARB(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z, @NativeType("GLfloat") float w); + + // --- [ glProgramLocalParameter4fvARB ] --- + + /** Unsafe version of: {@link #glProgramLocalParameter4fvARB ProgramLocalParameter4fvARB} */ + public static native void nglProgramLocalParameter4fvARB(int target, int index, long params); + + /** + * Pointer version of {@link #glProgramLocalParameter4fARB ProgramLocalParameter4fARB}. + * + * @param target the program target. One of:
{@link #GL_VERTEX_PROGRAM_ARB VERTEX_PROGRAM_ARB}{@link ARBFragmentProgram#GL_FRAGMENT_PROGRAM_ARB FRAGMENT_PROGRAM_ARB}
+ * @param index the environment parameter index + * @param params a buffer from which to read the parameter value + */ + public static void glProgramLocalParameter4fvARB(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglProgramLocalParameter4fvARB(target, index, memAddress(params)); + } + + // --- [ glGetProgramEnvParameterfvARB ] --- + + /** Unsafe version of: {@link #glGetProgramEnvParameterfvARB GetProgramEnvParameterfvARB} */ + public static native void nglGetProgramEnvParameterfvARB(int target, int index, long params); + + /** + * Obtain the current value for the program environment parameter numbered {@code index} for the specified program target {@code target}, and places the + * information in the array {@code params}. + * + * @param target the program target. One of:
{@link #GL_VERTEX_PROGRAM_ARB VERTEX_PROGRAM_ARB}{@link ARBFragmentProgram#GL_FRAGMENT_PROGRAM_ARB FRAGMENT_PROGRAM_ARB}
+ * @param index the environment parameter index + * @param params a buffer in which to place the current parameter value + */ + public static void glGetProgramEnvParameterfvARB(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglGetProgramEnvParameterfvARB(target, index, memAddress(params)); + } + + // --- [ glGetProgramEnvParameterdvARB ] --- + + /** Unsafe version of: {@link #glGetProgramEnvParameterdvARB GetProgramEnvParameterdvARB} */ + public static native void nglGetProgramEnvParameterdvARB(int target, int index, long params); + + /** + * Double version of {@link #glGetProgramEnvParameterfvARB GetProgramEnvParameterfvARB}. + * + * @param target the program target. One of:
{@link #GL_VERTEX_PROGRAM_ARB VERTEX_PROGRAM_ARB}{@link ARBFragmentProgram#GL_FRAGMENT_PROGRAM_ARB FRAGMENT_PROGRAM_ARB}
+ * @param index the environment parameter index + * @param params a buffer in which to place the current parameter value + */ + public static void glGetProgramEnvParameterdvARB(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble *") DoubleBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglGetProgramEnvParameterdvARB(target, index, memAddress(params)); + } + + // --- [ glGetProgramLocalParameterfvARB ] --- + + /** Unsafe version of: {@link #glGetProgramLocalParameterfvARB GetProgramLocalParameterfvARB} */ + public static native void nglGetProgramLocalParameterfvARB(int target, int index, long params); + + /** + * Obtain the current value for the program local parameter numbered {@code index} for the specified program target {@code target}, and places the + * information in the array {@code params}. + * + * @param target the program target. One of:
{@link #GL_VERTEX_PROGRAM_ARB VERTEX_PROGRAM_ARB}{@link ARBFragmentProgram#GL_FRAGMENT_PROGRAM_ARB FRAGMENT_PROGRAM_ARB}
+ * @param index the environment parameter index + * @param params a buffer in which to place the current parameter value + */ + public static void glGetProgramLocalParameterfvARB(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglGetProgramLocalParameterfvARB(target, index, memAddress(params)); + } + + // --- [ glGetProgramLocalParameterdvARB ] --- + + /** Unsafe version of: {@link #glGetProgramLocalParameterdvARB GetProgramLocalParameterdvARB} */ + public static native void nglGetProgramLocalParameterdvARB(int target, int index, long params); + + /** + * Double version of {@link #glGetProgramLocalParameterfvARB GetProgramLocalParameterfvARB}. + * + * @param target the program target. One of:
{@link #GL_VERTEX_PROGRAM_ARB VERTEX_PROGRAM_ARB}{@link ARBFragmentProgram#GL_FRAGMENT_PROGRAM_ARB FRAGMENT_PROGRAM_ARB}
+ * @param index the environment parameter index + * @param params a buffer in which to place the current parameter value + */ + public static void glGetProgramLocalParameterdvARB(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble *") DoubleBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglGetProgramLocalParameterdvARB(target, index, memAddress(params)); + } + + // --- [ glGetProgramivARB ] --- + + /** Unsafe version of: {@link #glGetProgramivARB GetProgramivARB} */ + public static native void nglGetProgramivARB(int target, int pname, long params); + + /** + * Obtains program state for the program target {@code target}, writing the state into the array given by {@code params}. GetProgramivARB can be used to + * determine the properties of the currently bound program object or implementation limits for {@code target}. + * + * @param target the program target. One of:
{@link #GL_VERTEX_PROGRAM_ARB VERTEX_PROGRAM_ARB}{@link ARBFragmentProgram#GL_FRAGMENT_PROGRAM_ARB FRAGMENT_PROGRAM_ARB}
+ * @param pname the parameter to query. One of:
{@link #GL_PROGRAM_LENGTH_ARB PROGRAM_LENGTH_ARB}{@link #GL_PROGRAM_FORMAT_ARB PROGRAM_FORMAT_ARB}
{@link #GL_PROGRAM_BINDING_ARB PROGRAM_BINDING_ARB}{@link #GL_PROGRAM_INSTRUCTIONS_ARB PROGRAM_INSTRUCTIONS_ARB}
{@link #GL_MAX_PROGRAM_INSTRUCTIONS_ARB MAX_PROGRAM_INSTRUCTIONS_ARB}{@link #GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB PROGRAM_NATIVE_INSTRUCTIONS_ARB}
{@link #GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB}{@link #GL_PROGRAM_TEMPORARIES_ARB PROGRAM_TEMPORARIES_ARB}
{@link #GL_MAX_PROGRAM_TEMPORARIES_ARB MAX_PROGRAM_TEMPORARIES_ARB}{@link #GL_PROGRAM_NATIVE_TEMPORARIES_ARB PROGRAM_NATIVE_TEMPORARIES_ARB}
{@link #GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB MAX_PROGRAM_NATIVE_TEMPORARIES_ARB}{@link #GL_PROGRAM_PARAMETERS_ARB PROGRAM_PARAMETERS_ARB}
{@link #GL_MAX_PROGRAM_PARAMETERS_ARB MAX_PROGRAM_PARAMETERS_ARB}{@link #GL_PROGRAM_NATIVE_PARAMETERS_ARB PROGRAM_NATIVE_PARAMETERS_ARB}
{@link #GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB MAX_PROGRAM_NATIVE_PARAMETERS_ARB}{@link #GL_PROGRAM_ATTRIBS_ARB PROGRAM_ATTRIBS_ARB}
{@link #GL_MAX_PROGRAM_ATTRIBS_ARB MAX_PROGRAM_ATTRIBS_ARB}{@link #GL_PROGRAM_NATIVE_ATTRIBS_ARB PROGRAM_NATIVE_ATTRIBS_ARB}
{@link #GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB MAX_PROGRAM_NATIVE_ATTRIBS_ARB}{@link #GL_PROGRAM_ADDRESS_REGISTERS_ARB PROGRAM_ADDRESS_REGISTERS_ARB}
{@link #GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB MAX_PROGRAM_ADDRESS_REGISTERS_ARB}{@link #GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB}
{@link #GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB}{@link #GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB MAX_PROGRAM_LOCAL_PARAMETERS_ARB}
{@link #GL_MAX_PROGRAM_ENV_PARAMETERS_ARB MAX_PROGRAM_ENV_PARAMETERS_ARB}{@link #GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB PROGRAM_UNDER_NATIVE_LIMITS_ARB}
+ * @param params an array in which to place the parameter value + */ + public static void glGetProgramivARB(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetProgramivARB(target, pname, memAddress(params)); + } + + /** + * Obtains program state for the program target {@code target}, writing the state into the array given by {@code params}. GetProgramivARB can be used to + * determine the properties of the currently bound program object or implementation limits for {@code target}. + * + * @param target the program target. One of:
{@link #GL_VERTEX_PROGRAM_ARB VERTEX_PROGRAM_ARB}{@link ARBFragmentProgram#GL_FRAGMENT_PROGRAM_ARB FRAGMENT_PROGRAM_ARB}
+ * @param pname the parameter to query. One of:
{@link #GL_PROGRAM_LENGTH_ARB PROGRAM_LENGTH_ARB}{@link #GL_PROGRAM_FORMAT_ARB PROGRAM_FORMAT_ARB}
{@link #GL_PROGRAM_BINDING_ARB PROGRAM_BINDING_ARB}{@link #GL_PROGRAM_INSTRUCTIONS_ARB PROGRAM_INSTRUCTIONS_ARB}
{@link #GL_MAX_PROGRAM_INSTRUCTIONS_ARB MAX_PROGRAM_INSTRUCTIONS_ARB}{@link #GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB PROGRAM_NATIVE_INSTRUCTIONS_ARB}
{@link #GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB}{@link #GL_PROGRAM_TEMPORARIES_ARB PROGRAM_TEMPORARIES_ARB}
{@link #GL_MAX_PROGRAM_TEMPORARIES_ARB MAX_PROGRAM_TEMPORARIES_ARB}{@link #GL_PROGRAM_NATIVE_TEMPORARIES_ARB PROGRAM_NATIVE_TEMPORARIES_ARB}
{@link #GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB MAX_PROGRAM_NATIVE_TEMPORARIES_ARB}{@link #GL_PROGRAM_PARAMETERS_ARB PROGRAM_PARAMETERS_ARB}
{@link #GL_MAX_PROGRAM_PARAMETERS_ARB MAX_PROGRAM_PARAMETERS_ARB}{@link #GL_PROGRAM_NATIVE_PARAMETERS_ARB PROGRAM_NATIVE_PARAMETERS_ARB}
{@link #GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB MAX_PROGRAM_NATIVE_PARAMETERS_ARB}{@link #GL_PROGRAM_ATTRIBS_ARB PROGRAM_ATTRIBS_ARB}
{@link #GL_MAX_PROGRAM_ATTRIBS_ARB MAX_PROGRAM_ATTRIBS_ARB}{@link #GL_PROGRAM_NATIVE_ATTRIBS_ARB PROGRAM_NATIVE_ATTRIBS_ARB}
{@link #GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB MAX_PROGRAM_NATIVE_ATTRIBS_ARB}{@link #GL_PROGRAM_ADDRESS_REGISTERS_ARB PROGRAM_ADDRESS_REGISTERS_ARB}
{@link #GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB MAX_PROGRAM_ADDRESS_REGISTERS_ARB}{@link #GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB}
{@link #GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB}{@link #GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB MAX_PROGRAM_LOCAL_PARAMETERS_ARB}
{@link #GL_MAX_PROGRAM_ENV_PARAMETERS_ARB MAX_PROGRAM_ENV_PARAMETERS_ARB}{@link #GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB PROGRAM_UNDER_NATIVE_LIMITS_ARB}
+ */ + @NativeType("void") + public static int glGetProgramiARB(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetProgramivARB(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetProgramStringARB ] --- + + /** Unsafe version of: {@link #glGetProgramStringARB GetProgramStringARB} */ + public static native void nglGetProgramStringARB(int target, int pname, long string); + + /** + * Obtains the program string for the program object bound to {@code target} and places the information in the array {@code string}. + * + *

{@code n} ubytes are returned into the array program where {@code n} is the length of the program in ubytes, as returned by {@link #glGetProgramivARB GetProgramivARB} when + * {@code pname} is {@link #GL_PROGRAM_LENGTH_ARB PROGRAM_LENGTH_ARB}. The program string is always returned using the format given when the program string was specified.

+ * + * @param target the program target. One of:
{@link #GL_VERTEX_PROGRAM_ARB VERTEX_PROGRAM_ARB}{@link ARBFragmentProgram#GL_FRAGMENT_PROGRAM_ARB FRAGMENT_PROGRAM_ARB}
+ * @param pname the parameter to query. Must be:
{@link #GL_PROGRAM_STRING_ARB PROGRAM_STRING_ARB}
+ * @param string an array in which to place the program string + */ + public static void glGetProgramStringARB(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("void *") ByteBuffer string) { + if (CHECKS) { + if (DEBUG) { + check(string, glGetProgramiARB(target, GL_PROGRAM_LENGTH_ARB)); + } + } + nglGetProgramStringARB(target, pname, memAddress(string)); + } + + // --- [ glGetVertexAttribfvARB ] --- + + /** Unsafe version of: {@link #glGetVertexAttribfvARB GetVertexAttribfvARB} */ + public static void nglGetVertexAttribfvARB(int index, int pname, long params) { + ARBVertexShader.nglGetVertexAttribfvARB(index, pname, params); + } + + /** + * Float version of {@link #glGetVertexAttribivARB GetVertexAttribivARB}. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the vertex attribute parameter to be queried + * @param params returns the requested data + */ + public static void glGetVertexAttribfvARB(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + ARBVertexShader.glGetVertexAttribfvARB(index, pname, params); + } + + // --- [ glGetVertexAttribdvARB ] --- + + /** Unsafe version of: {@link #glGetVertexAttribdvARB GetVertexAttribdvARB} */ + public static void nglGetVertexAttribdvARB(int index, int pname, long params) { + ARBVertexShader.nglGetVertexAttribdvARB(index, pname, params); + } + + /** + * Double version of {@link #glGetVertexAttribivARB GetVertexAttribivARB}. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the vertex attribute parameter to be queried + * @param params returns the requested data + */ + public static void glGetVertexAttribdvARB(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLdouble *") DoubleBuffer params) { + ARBVertexShader.glGetVertexAttribdvARB(index, pname, params); + } + + // --- [ glGetVertexAttribivARB ] --- + + /** Unsafe version of: {@link #glGetVertexAttribivARB GetVertexAttribivARB} */ + public static void nglGetVertexAttribivARB(int index, int pname, long params) { + ARBVertexShader.nglGetVertexAttribivARB(index, pname, params); + } + + /** + * Returns the integer value of a generic vertex attribute parameter. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the vertex attribute parameter to be queried. One of:
{@link GL15#GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING VERTEX_ATTRIB_ARRAY_BUFFER_BINDING}{@link ARBVertexShader#GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB VERTEX_ATTRIB_ARRAY_ENABLED_ARB}
{@link ARBVertexShader#GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB VERTEX_ATTRIB_ARRAY_SIZE_ARB}{@link ARBVertexShader#GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB VERTEX_ATTRIB_ARRAY_STRIDE_ARB}
{@link ARBVertexShader#GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB VERTEX_ATTRIB_ARRAY_TYPE_ARB}{@link ARBVertexShader#GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB}
{@link ARBVertexShader#GL_CURRENT_VERTEX_ATTRIB_ARB CURRENT_VERTEX_ATTRIB_ARB}{@link GL30#GL_VERTEX_ATTRIB_ARRAY_INTEGER VERTEX_ATTRIB_ARRAY_INTEGER}
{@link GL33#GL_VERTEX_ATTRIB_ARRAY_DIVISOR VERTEX_ATTRIB_ARRAY_DIVISOR}
+ * @param params returns the requested data + */ + public static void glGetVertexAttribivARB(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + ARBVertexShader.glGetVertexAttribivARB(index, pname, params); + } + + /** + * Returns the integer value of a generic vertex attribute parameter. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the vertex attribute parameter to be queried. One of:
{@link GL15#GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING VERTEX_ATTRIB_ARRAY_BUFFER_BINDING}{@link ARBVertexShader#GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB VERTEX_ATTRIB_ARRAY_ENABLED_ARB}
{@link ARBVertexShader#GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB VERTEX_ATTRIB_ARRAY_SIZE_ARB}{@link ARBVertexShader#GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB VERTEX_ATTRIB_ARRAY_STRIDE_ARB}
{@link ARBVertexShader#GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB VERTEX_ATTRIB_ARRAY_TYPE_ARB}{@link ARBVertexShader#GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB}
{@link ARBVertexShader#GL_CURRENT_VERTEX_ATTRIB_ARB CURRENT_VERTEX_ATTRIB_ARB}{@link GL30#GL_VERTEX_ATTRIB_ARRAY_INTEGER VERTEX_ATTRIB_ARRAY_INTEGER}
{@link GL33#GL_VERTEX_ATTRIB_ARRAY_DIVISOR VERTEX_ATTRIB_ARRAY_DIVISOR}
+ */ + @NativeType("void") + public static int glGetVertexAttribiARB(@NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + return ARBVertexShader.glGetVertexAttribiARB(index, pname); + } + + // --- [ glGetVertexAttribPointervARB ] --- + + /** Unsafe version of: {@link #glGetVertexAttribPointervARB GetVertexAttribPointervARB} */ + public static void nglGetVertexAttribPointervARB(int index, int pname, long pointer) { + ARBVertexShader.nglGetVertexAttribPointervARB(index, pname, pointer); + } + + /** + * Returns the address of the specified generic vertex attribute pointer. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the generic vertex attribute parameter to be returned. Must be:
{@link ARBVertexShader#GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB VERTEX_ATTRIB_ARRAY_POINTER_ARB}
+ * @param pointer the pointer value + */ + public static void glGetVertexAttribPointervARB(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("void **") PointerBuffer pointer) { + ARBVertexShader.glGetVertexAttribPointervARB(index, pname, pointer); + } + + /** + * Returns the address of the specified generic vertex attribute pointer. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the generic vertex attribute parameter to be returned. Must be:
{@link ARBVertexShader#GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB VERTEX_ATTRIB_ARRAY_POINTER_ARB}
+ */ + @NativeType("void") + public static long glGetVertexAttribPointerARB(@NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + return ARBVertexShader.glGetVertexAttribPointerARB(index, pname); + } + + // --- [ glIsProgramARB ] --- + + /** + * Returns {@link GL11#GL_TRUE TRUE} if {@code program} is the name of a program object. If {@code program} is zero or is a non-zero value that is not the name of a + * program object, or if an error condition occurs, IsProgramARB returns {@link GL11#GL_FALSE FALSE}. A name returned by {@link #glGenProgramsARB GenProgramsARB}, but not yet bound, is not the + * name of a program object. + * + * @param program the program name + */ + @NativeType("GLboolean") + public static native boolean glIsProgramARB(@NativeType("GLuint") int program); + + /** Array version of: {@link #glVertexAttrib1svARB VertexAttrib1svARB} */ + public static void glVertexAttrib1svARB(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + ARBVertexShader.glVertexAttrib1svARB(index, v); + } + + /** Array version of: {@link #glVertexAttrib1fvARB VertexAttrib1fvARB} */ + public static void glVertexAttrib1fvARB(@NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] v) { + ARBVertexShader.glVertexAttrib1fvARB(index, v); + } + + /** Array version of: {@link #glVertexAttrib1dvARB VertexAttrib1dvARB} */ + public static void glVertexAttrib1dvARB(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + ARBVertexShader.glVertexAttrib1dvARB(index, v); + } + + /** Array version of: {@link #glVertexAttrib2svARB VertexAttrib2svARB} */ + public static void glVertexAttrib2svARB(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + ARBVertexShader.glVertexAttrib2svARB(index, v); + } + + /** Array version of: {@link #glVertexAttrib2fvARB VertexAttrib2fvARB} */ + public static void glVertexAttrib2fvARB(@NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] v) { + ARBVertexShader.glVertexAttrib2fvARB(index, v); + } + + /** Array version of: {@link #glVertexAttrib2dvARB VertexAttrib2dvARB} */ + public static void glVertexAttrib2dvARB(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + ARBVertexShader.glVertexAttrib2dvARB(index, v); + } + + /** Array version of: {@link #glVertexAttrib3svARB VertexAttrib3svARB} */ + public static void glVertexAttrib3svARB(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + ARBVertexShader.glVertexAttrib3svARB(index, v); + } + + /** Array version of: {@link #glVertexAttrib3fvARB VertexAttrib3fvARB} */ + public static void glVertexAttrib3fvARB(@NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] v) { + ARBVertexShader.glVertexAttrib3fvARB(index, v); + } + + /** Array version of: {@link #glVertexAttrib3dvARB VertexAttrib3dvARB} */ + public static void glVertexAttrib3dvARB(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + ARBVertexShader.glVertexAttrib3dvARB(index, v); + } + + /** Array version of: {@link #glVertexAttrib4fvARB VertexAttrib4fvARB} */ + public static void glVertexAttrib4fvARB(@NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] v) { + ARBVertexShader.glVertexAttrib4fvARB(index, v); + } + + /** Array version of: {@link #glVertexAttrib4svARB VertexAttrib4svARB} */ + public static void glVertexAttrib4svARB(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + ARBVertexShader.glVertexAttrib4svARB(index, v); + } + + /** Array version of: {@link #glVertexAttrib4ivARB VertexAttrib4ivARB} */ + public static void glVertexAttrib4ivARB(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + ARBVertexShader.glVertexAttrib4ivARB(index, v); + } + + /** Array version of: {@link #glVertexAttrib4usvARB VertexAttrib4usvARB} */ + public static void glVertexAttrib4usvARB(@NativeType("GLuint") int index, @NativeType("GLushort const *") short[] v) { + ARBVertexShader.glVertexAttrib4usvARB(index, v); + } + + /** Array version of: {@link #glVertexAttrib4uivARB VertexAttrib4uivARB} */ + public static void glVertexAttrib4uivARB(@NativeType("GLuint") int index, @NativeType("GLuint const *") int[] v) { + ARBVertexShader.glVertexAttrib4uivARB(index, v); + } + + /** Array version of: {@link #glVertexAttrib4dvARB VertexAttrib4dvARB} */ + public static void glVertexAttrib4dvARB(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + ARBVertexShader.glVertexAttrib4dvARB(index, v); + } + + /** Array version of: {@link #glVertexAttrib4NsvARB VertexAttrib4NsvARB} */ + public static void glVertexAttrib4NsvARB(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + ARBVertexShader.glVertexAttrib4NsvARB(index, v); + } + + /** Array version of: {@link #glVertexAttrib4NivARB VertexAttrib4NivARB} */ + public static void glVertexAttrib4NivARB(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + ARBVertexShader.glVertexAttrib4NivARB(index, v); + } + + /** Array version of: {@link #glVertexAttrib4NusvARB VertexAttrib4NusvARB} */ + public static void glVertexAttrib4NusvARB(@NativeType("GLuint") int index, @NativeType("GLushort const *") short[] v) { + ARBVertexShader.glVertexAttrib4NusvARB(index, v); + } + + /** Array version of: {@link #glVertexAttrib4NuivARB VertexAttrib4NuivARB} */ + public static void glVertexAttrib4NuivARB(@NativeType("GLuint") int index, @NativeType("GLuint const *") int[] v) { + ARBVertexShader.glVertexAttrib4NuivARB(index, v); + } + + /** Array version of: {@link #glVertexAttribPointerARB VertexAttribPointerARB} */ + public static void glVertexAttribPointerARB(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") short[] pointer) { + ARBVertexShader.glVertexAttribPointerARB(index, size, type, normalized, stride, pointer); + } + + /** Array version of: {@link #glVertexAttribPointerARB VertexAttribPointerARB} */ + public static void glVertexAttribPointerARB(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") int[] pointer) { + ARBVertexShader.glVertexAttribPointerARB(index, size, type, normalized, stride, pointer); + } + + /** Array version of: {@link #glVertexAttribPointerARB VertexAttribPointerARB} */ + public static void glVertexAttribPointerARB(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") float[] pointer) { + ARBVertexShader.glVertexAttribPointerARB(index, size, type, normalized, stride, pointer); + } + + /** Array version of: {@link #glDeleteProgramsARB DeleteProgramsARB} */ + public static void glDeleteProgramsARB(@NativeType("GLuint const *") int[] programs) { + long __functionAddress = GL.getICD().glDeleteProgramsARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(programs.length, programs, __functionAddress); + } + + /** Array version of: {@link #glGenProgramsARB GenProgramsARB} */ + public static void glGenProgramsARB(@NativeType("GLuint *") int[] programs) { + long __functionAddress = GL.getICD().glGenProgramsARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(programs.length, programs, __functionAddress); + } + + /** Array version of: {@link #glProgramEnvParameter4dvARB ProgramEnvParameter4dvARB} */ + public static void glProgramEnvParameter4dvARB(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] params) { + long __functionAddress = GL.getICD().glProgramEnvParameter4dvARB; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(target, index, params, __functionAddress); + } + + /** Array version of: {@link #glProgramEnvParameter4fvARB ProgramEnvParameter4fvARB} */ + public static void glProgramEnvParameter4fvARB(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] params) { + long __functionAddress = GL.getICD().glProgramEnvParameter4fvARB; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(target, index, params, __functionAddress); + } + + /** Array version of: {@link #glProgramLocalParameter4dvARB ProgramLocalParameter4dvARB} */ + public static void glProgramLocalParameter4dvARB(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] params) { + long __functionAddress = GL.getICD().glProgramLocalParameter4dvARB; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(target, index, params, __functionAddress); + } + + /** Array version of: {@link #glProgramLocalParameter4fvARB ProgramLocalParameter4fvARB} */ + public static void glProgramLocalParameter4fvARB(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] params) { + long __functionAddress = GL.getICD().glProgramLocalParameter4fvARB; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(target, index, params, __functionAddress); + } + + /** Array version of: {@link #glGetProgramEnvParameterfvARB GetProgramEnvParameterfvARB} */ + public static void glGetProgramEnvParameterfvARB(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetProgramEnvParameterfvARB; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(target, index, params, __functionAddress); + } + + /** Array version of: {@link #glGetProgramEnvParameterdvARB GetProgramEnvParameterdvARB} */ + public static void glGetProgramEnvParameterdvARB(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble *") double[] params) { + long __functionAddress = GL.getICD().glGetProgramEnvParameterdvARB; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(target, index, params, __functionAddress); + } + + /** Array version of: {@link #glGetProgramLocalParameterfvARB GetProgramLocalParameterfvARB} */ + public static void glGetProgramLocalParameterfvARB(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetProgramLocalParameterfvARB; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(target, index, params, __functionAddress); + } + + /** Array version of: {@link #glGetProgramLocalParameterdvARB GetProgramLocalParameterdvARB} */ + public static void glGetProgramLocalParameterdvARB(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble *") double[] params) { + long __functionAddress = GL.getICD().glGetProgramLocalParameterdvARB; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(target, index, params, __functionAddress); + } + + /** Array version of: {@link #glGetProgramivARB GetProgramivARB} */ + public static void glGetProgramivARB(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetProgramivARB; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetVertexAttribfvARB GetVertexAttribfvARB} */ + public static void glGetVertexAttribfvARB(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + ARBVertexShader.glGetVertexAttribfvARB(index, pname, params); + } + + /** Array version of: {@link #glGetVertexAttribdvARB GetVertexAttribdvARB} */ + public static void glGetVertexAttribdvARB(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLdouble *") double[] params) { + ARBVertexShader.glGetVertexAttribdvARB(index, pname, params); + } + + /** Array version of: {@link #glGetVertexAttribivARB GetVertexAttribivARB} */ + public static void glGetVertexAttribivARB(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + ARBVertexShader.glGetVertexAttribivARB(index, pname, params); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexShader.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexShader.java new file mode 100644 index 00000000..b125768c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexShader.java @@ -0,0 +1,1283 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_vertex_shader extension. + * + *

This extension adds programmable vertex level processing to OpenGL. The application can write vertex shaders in a high level language as defined in the + * OpenGL Shading Language specification. A vertex shader replaces the transformation, texture coordinate generation and lighting parts of OpenGL, and it + * also adds texture access at the vertex level. Furthermore, management of vertex shader objects and loading generic attributes are discussed. A vertex + * shader object, attached to a program object, can be compiled and linked to produce an executable that runs on the vertex processor in OpenGL. + * This extension also defines how such an executable interacts with the fixed functionality vertex processing of OpenGL 1.4.

+ * + *

Promoted to core in {@link GL20 OpenGL 2.0}.

+ */ +public class ARBVertexShader { + + /** Accepted by the {@code shaderType} argument of CreateShaderObjectARB and returned by the {@code params} parameter of GetObjectParameter{if}vARB. */ + public static final int GL_VERTEX_SHADER_ARB = 0x8B31; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB = 0x8B4A, + GL_MAX_VARYING_FLOATS_ARB = 0x8B4B, + GL_MAX_VERTEX_ATTRIBS_ARB = 0x8869, + GL_MAX_TEXTURE_IMAGE_UNITS_ARB = 0x8872, + GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB = 0x8B4C, + GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB = 0x8B4D, + GL_MAX_TEXTURE_COORDS_ARB = 0x8871; + + /** + * Accepted by the {@code cap} parameter of Disable, Enable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int + GL_VERTEX_PROGRAM_POINT_SIZE_ARB = 0x8642, + GL_VERTEX_PROGRAM_TWO_SIDE_ARB = 0x8643; + + /** Accepted by the {@code pname} parameter GetObjectParameter{if}vARB. */ + public static final int + GL_OBJECT_ACTIVE_ATTRIBUTES_ARB = 0x8B89, + GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB = 0x8B8A; + + /** Accepted by the {@code pname} parameter of GetVertexAttrib{dfi}vARB. */ + public static final int + GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB = 0x8622, + GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB = 0x8623, + GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB = 0x8624, + GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB = 0x8625, + GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB = 0x886A, + GL_CURRENT_VERTEX_ATTRIB_ARB = 0x8626; + + /** Accepted by the {@code pname} parameter of GetVertexAttribPointervARB. */ + public static final int GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB = 0x8645; + + /** Returned by the {@code type} parameter of GetActiveAttribARB. */ + public static final int + GL_FLOAT_VEC2_ARB = 0x8B50, + GL_FLOAT_VEC3_ARB = 0x8B51, + GL_FLOAT_VEC4_ARB = 0x8B52, + GL_FLOAT_MAT2_ARB = 0x8B5A, + GL_FLOAT_MAT3_ARB = 0x8B5B, + GL_FLOAT_MAT4_ARB = 0x8B5C; + + static { GL.initialize(); } + + protected ARBVertexShader() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glVertexAttrib1fARB, caps.glVertexAttrib1sARB, caps.glVertexAttrib1dARB, caps.glVertexAttrib2fARB, caps.glVertexAttrib2sARB, + caps.glVertexAttrib2dARB, caps.glVertexAttrib3fARB, caps.glVertexAttrib3sARB, caps.glVertexAttrib3dARB, caps.glVertexAttrib4fARB, + caps.glVertexAttrib4sARB, caps.glVertexAttrib4dARB, caps.glVertexAttrib4NubARB, caps.glVertexAttrib1fvARB, caps.glVertexAttrib1svARB, + caps.glVertexAttrib1dvARB, caps.glVertexAttrib2fvARB, caps.glVertexAttrib2svARB, caps.glVertexAttrib2dvARB, caps.glVertexAttrib3fvARB, + caps.glVertexAttrib3svARB, caps.glVertexAttrib3dvARB, caps.glVertexAttrib4fvARB, caps.glVertexAttrib4svARB, caps.glVertexAttrib4dvARB, + caps.glVertexAttrib4ivARB, caps.glVertexAttrib4bvARB, caps.glVertexAttrib4ubvARB, caps.glVertexAttrib4usvARB, caps.glVertexAttrib4uivARB, + caps.glVertexAttrib4NbvARB, caps.glVertexAttrib4NsvARB, caps.glVertexAttrib4NivARB, caps.glVertexAttrib4NubvARB, caps.glVertexAttrib4NusvARB, + caps.glVertexAttrib4NuivARB, caps.glVertexAttribPointerARB, caps.glEnableVertexAttribArrayARB, caps.glDisableVertexAttribArrayARB, + caps.glBindAttribLocationARB, caps.glGetActiveAttribARB, caps.glGetAttribLocationARB, caps.glGetVertexAttribivARB, caps.glGetVertexAttribfvARB, + caps.glGetVertexAttribdvARB, caps.glGetVertexAttribPointervARB + ); + } + + // --- [ glVertexAttrib1fARB ] --- + + /** + * Specifies the value of a generic vertex attribute. The y and z components are implicitly set to 0.0f and w to 1.0f. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + */ + public static native void glVertexAttrib1fARB(@NativeType("GLuint") int index, @NativeType("GLfloat") float v0); + + // --- [ glVertexAttrib1sARB ] --- + + /** + * Short version of {@link #glVertexAttrib1fARB VertexAttrib1fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + */ + public static native void glVertexAttrib1sARB(@NativeType("GLuint") int index, @NativeType("GLshort") short v0); + + // --- [ glVertexAttrib1dARB ] --- + + /** + * Double version of {@link #glVertexAttrib1fARB VertexAttrib1fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + */ + public static native void glVertexAttrib1dARB(@NativeType("GLuint") int index, @NativeType("GLdouble") double v0); + + // --- [ glVertexAttrib2fARB ] --- + + /** + * Specifies the value of a generic vertex attribute. The y component is implicitly set to 0.0f and w to 1.0f. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + */ + public static native void glVertexAttrib2fARB(@NativeType("GLuint") int index, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1); + + // --- [ glVertexAttrib2sARB ] --- + + /** + * Short version of {@link #glVertexAttrib2fARB VertexAttrib2fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + */ + public static native void glVertexAttrib2sARB(@NativeType("GLuint") int index, @NativeType("GLshort") short v0, @NativeType("GLshort") short v1); + + // --- [ glVertexAttrib2dARB ] --- + + /** + * Double version of {@link #glVertexAttrib2fARB VertexAttrib2fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + */ + public static native void glVertexAttrib2dARB(@NativeType("GLuint") int index, @NativeType("GLdouble") double v0, @NativeType("GLdouble") double v1); + + // --- [ glVertexAttrib3fARB ] --- + + /** + * Specifies the value of a generic vertex attribute. The w is implicitly set to 1.0f. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + */ + public static native void glVertexAttrib3fARB(@NativeType("GLuint") int index, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1, @NativeType("GLfloat") float v2); + + // --- [ glVertexAttrib3sARB ] --- + + /** + * Short version of {@link #glVertexAttrib3fARB VertexAttrib3fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + */ + public static native void glVertexAttrib3sARB(@NativeType("GLuint") int index, @NativeType("GLshort") short v0, @NativeType("GLshort") short v1, @NativeType("GLshort") short v2); + + // --- [ glVertexAttrib3dARB ] --- + + /** + * Double version of {@link #glVertexAttrib3fARB VertexAttrib3fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + */ + public static native void glVertexAttrib3dARB(@NativeType("GLuint") int index, @NativeType("GLdouble") double v0, @NativeType("GLdouble") double v1, @NativeType("GLdouble") double v2); + + // --- [ glVertexAttrib4fARB ] --- + + /** + * Specifies the value of a generic vertex attribute. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + * @param v3 the vertex attribute w component + */ + public static native void glVertexAttrib4fARB(@NativeType("GLuint") int index, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1, @NativeType("GLfloat") float v2, @NativeType("GLfloat") float v3); + + // --- [ glVertexAttrib4sARB ] --- + + /** + * Short version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + * @param v3 the vertex attribute w component + */ + public static native void glVertexAttrib4sARB(@NativeType("GLuint") int index, @NativeType("GLshort") short v0, @NativeType("GLshort") short v1, @NativeType("GLshort") short v2, @NativeType("GLshort") short v3); + + // --- [ glVertexAttrib4dARB ] --- + + /** + * Double version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + * @param v3 the vertex attribute w component + */ + public static native void glVertexAttrib4dARB(@NativeType("GLuint") int index, @NativeType("GLdouble") double v0, @NativeType("GLdouble") double v1, @NativeType("GLdouble") double v2, @NativeType("GLdouble") double v3); + + // --- [ glVertexAttrib4NubARB ] --- + + /** + * Normalized unsigned byte version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * @param z the vertex attribute z component + * @param w the vertex attribute w component + */ + public static native void glVertexAttrib4NubARB(@NativeType("GLuint") int index, @NativeType("GLubyte") byte x, @NativeType("GLubyte") byte y, @NativeType("GLubyte") byte z, @NativeType("GLubyte") byte w); + + // --- [ glVertexAttrib1fvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib1fvARB VertexAttrib1fvARB} */ + public static native void nglVertexAttrib1fvARB(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib1fARB VertexAttrib1fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib1fvARB(@NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglVertexAttrib1fvARB(index, memAddress(v)); + } + + // --- [ glVertexAttrib1svARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib1svARB VertexAttrib1svARB} */ + public static native void nglVertexAttrib1svARB(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib1sARB VertexAttrib1sARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib1svARB(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglVertexAttrib1svARB(index, memAddress(v)); + } + + // --- [ glVertexAttrib1dvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib1dvARB VertexAttrib1dvARB} */ + public static native void nglVertexAttrib1dvARB(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib1dARB VertexAttrib1dARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib1dvARB(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglVertexAttrib1dvARB(index, memAddress(v)); + } + + // --- [ glVertexAttrib2fvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib2fvARB VertexAttrib2fvARB} */ + public static native void nglVertexAttrib2fvARB(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib2fARB VertexAttrib2fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib2fvARB(@NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglVertexAttrib2fvARB(index, memAddress(v)); + } + + // --- [ glVertexAttrib2svARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib2svARB VertexAttrib2svARB} */ + public static native void nglVertexAttrib2svARB(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib2sARB VertexAttrib2sARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib2svARB(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglVertexAttrib2svARB(index, memAddress(v)); + } + + // --- [ glVertexAttrib2dvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib2dvARB VertexAttrib2dvARB} */ + public static native void nglVertexAttrib2dvARB(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib2dARB VertexAttrib2dARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib2dvARB(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglVertexAttrib2dvARB(index, memAddress(v)); + } + + // --- [ glVertexAttrib3fvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib3fvARB VertexAttrib3fvARB} */ + public static native void nglVertexAttrib3fvARB(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib3fARB VertexAttrib3fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib3fvARB(@NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglVertexAttrib3fvARB(index, memAddress(v)); + } + + // --- [ glVertexAttrib3svARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib3svARB VertexAttrib3svARB} */ + public static native void nglVertexAttrib3svARB(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib3sARB VertexAttrib3sARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib3svARB(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglVertexAttrib3svARB(index, memAddress(v)); + } + + // --- [ glVertexAttrib3dvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib3dvARB VertexAttrib3dvARB} */ + public static native void nglVertexAttrib3dvARB(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib3dARB VertexAttrib3dARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib3dvARB(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglVertexAttrib3dvARB(index, memAddress(v)); + } + + // --- [ glVertexAttrib4fvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4fvARB VertexAttrib4fvARB} */ + public static native void nglVertexAttrib4fvARB(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4fvARB(@NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4fvARB(index, memAddress(v)); + } + + // --- [ glVertexAttrib4svARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4svARB VertexAttrib4svARB} */ + public static native void nglVertexAttrib4svARB(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib4sARB VertexAttrib4sARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4svARB(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4svARB(index, memAddress(v)); + } + + // --- [ glVertexAttrib4dvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4dvARB VertexAttrib4dvARB} */ + public static native void nglVertexAttrib4dvARB(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib4dARB VertexAttrib4dARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4dvARB(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4dvARB(index, memAddress(v)); + } + + // --- [ glVertexAttrib4ivARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4ivARB VertexAttrib4ivARB} */ + public static native void nglVertexAttrib4ivARB(int index, long v); + + /** + * Integer pointer version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4ivARB(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4ivARB(index, memAddress(v)); + } + + // --- [ glVertexAttrib4bvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4bvARB VertexAttrib4bvARB} */ + public static native void nglVertexAttrib4bvARB(int index, long v); + + /** + * Byte pointer version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4bvARB(@NativeType("GLuint") int index, @NativeType("GLbyte const *") ByteBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4bvARB(index, memAddress(v)); + } + + // --- [ glVertexAttrib4ubvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4ubvARB VertexAttrib4ubvARB} */ + public static native void nglVertexAttrib4ubvARB(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib4NubARB VertexAttrib4NubARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4ubvARB(@NativeType("GLuint") int index, @NativeType("GLubyte const *") ByteBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4ubvARB(index, memAddress(v)); + } + + // --- [ glVertexAttrib4usvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4usvARB VertexAttrib4usvARB} */ + public static native void nglVertexAttrib4usvARB(int index, long v); + + /** + * Unsigned short pointer version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4usvARB(@NativeType("GLuint") int index, @NativeType("GLushort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4usvARB(index, memAddress(v)); + } + + // --- [ glVertexAttrib4uivARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4uivARB VertexAttrib4uivARB} */ + public static native void nglVertexAttrib4uivARB(int index, long v); + + /** + * Unsigned int pointer version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4uivARB(@NativeType("GLuint") int index, @NativeType("GLuint const *") IntBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4uivARB(index, memAddress(v)); + } + + // --- [ glVertexAttrib4NbvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4NbvARB VertexAttrib4NbvARB} */ + public static native void nglVertexAttrib4NbvARB(int index, long v); + + /** + * Normalized byte pointer version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4NbvARB(@NativeType("GLuint") int index, @NativeType("GLbyte const *") ByteBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4NbvARB(index, memAddress(v)); + } + + // --- [ glVertexAttrib4NsvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4NsvARB VertexAttrib4NsvARB} */ + public static native void nglVertexAttrib4NsvARB(int index, long v); + + /** + * Normalized short pointer version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4NsvARB(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4NsvARB(index, memAddress(v)); + } + + // --- [ glVertexAttrib4NivARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4NivARB VertexAttrib4NivARB} */ + public static native void nglVertexAttrib4NivARB(int index, long v); + + /** + * Normalized int pointer version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4NivARB(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4NivARB(index, memAddress(v)); + } + + // --- [ glVertexAttrib4NubvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4NubvARB VertexAttrib4NubvARB} */ + public static native void nglVertexAttrib4NubvARB(int index, long v); + + /** + * Normalized unsigned byte pointer version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4NubvARB(@NativeType("GLuint") int index, @NativeType("GLubyte const *") ByteBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4NubvARB(index, memAddress(v)); + } + + // --- [ glVertexAttrib4NusvARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4NusvARB VertexAttrib4NusvARB} */ + public static native void nglVertexAttrib4NusvARB(int index, long v); + + /** + * Normalized unsigned short pointer version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4NusvARB(@NativeType("GLuint") int index, @NativeType("GLushort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4NusvARB(index, memAddress(v)); + } + + // --- [ glVertexAttrib4NuivARB ] --- + + /** Unsafe version of: {@link #glVertexAttrib4NuivARB VertexAttrib4NuivARB} */ + public static native void nglVertexAttrib4NuivARB(int index, long v); + + /** + * Normalized unsigned int pointer version of {@link #glVertexAttrib4fARB VertexAttrib4fARB}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + */ + public static void glVertexAttrib4NuivARB(@NativeType("GLuint") int index, @NativeType("GLuint const *") IntBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4NuivARB(index, memAddress(v)); + } + + // --- [ glVertexAttribPointerARB ] --- + + /** Unsafe version of: {@link #glVertexAttribPointerARB VertexAttribPointerARB} */ + public static native void nglVertexAttribPointerARB(int index, int size, int type, boolean normalized, int stride, long pointer); + + /** + * Specifies the location and organization of a vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. The initial value is GL_FLOAT. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL41#GL_FIXED FIXED}
+ * @param normalized whether fixed-point data values should be normalized or converted directly as fixed-point values when they are accessed + * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + */ + public static void glVertexAttribPointerARB(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + nglVertexAttribPointerARB(index, size, type, normalized, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. The initial value is GL_FLOAT. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL41#GL_FIXED FIXED}
+ * @param normalized whether fixed-point data values should be normalized or converted directly as fixed-point values when they are accessed + * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + */ + public static void glVertexAttribPointerARB(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + nglVertexAttribPointerARB(index, size, type, normalized, stride, pointer); + } + + /** + * Specifies the location and organization of a vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. The initial value is GL_FLOAT. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL41#GL_FIXED FIXED}
+ * @param normalized whether fixed-point data values should be normalized or converted directly as fixed-point values when they are accessed + * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + */ + public static void glVertexAttribPointerARB(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") ShortBuffer pointer) { + nglVertexAttribPointerARB(index, size, type, normalized, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. The initial value is GL_FLOAT. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL41#GL_FIXED FIXED}
+ * @param normalized whether fixed-point data values should be normalized or converted directly as fixed-point values when they are accessed + * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + */ + public static void glVertexAttribPointerARB(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") IntBuffer pointer) { + nglVertexAttribPointerARB(index, size, type, normalized, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. The initial value is GL_FLOAT. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL41#GL_FIXED FIXED}
+ * @param normalized whether fixed-point data values should be normalized or converted directly as fixed-point values when they are accessed + * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + */ + public static void glVertexAttribPointerARB(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") FloatBuffer pointer) { + nglVertexAttribPointerARB(index, size, type, normalized, stride, memAddress(pointer)); + } + + // --- [ glEnableVertexAttribArrayARB ] --- + + /** + * Enables a generic vertex attribute array. + * + * @param index the index of the generic vertex attribute to be enabled + */ + public static native void glEnableVertexAttribArrayARB(@NativeType("GLuint") int index); + + // --- [ glDisableVertexAttribArrayARB ] --- + + /** + * Disables a generic vertex attribute array. + * + * @param index the index of the generic vertex attribute to be disabled + */ + public static native void glDisableVertexAttribArrayARB(@NativeType("GLuint") int index); + + // --- [ glBindAttribLocationARB ] --- + + /** Unsafe version of: {@link #glBindAttribLocationARB BindAttribLocationARB} */ + public static native void nglBindAttribLocationARB(int programObj, int index, long name); + + /** + * Associates a generic vertex attribute index with a named attribute variable. + * + * @param programObj the handle of the program object in which the association is to be made + * @param index the index of the generic vertex attribute to be bound + * @param name a null terminated string containing the name of the vertex shader attribute variable to which {@code index} is to be bound + */ + public static void glBindAttribLocationARB(@NativeType("GLhandleARB") int programObj, @NativeType("GLuint") int index, @NativeType("GLchar const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + nglBindAttribLocationARB(programObj, index, memAddress(name)); + } + + /** + * Associates a generic vertex attribute index with a named attribute variable. + * + * @param programObj the handle of the program object in which the association is to be made + * @param index the index of the generic vertex attribute to be bound + * @param name a null terminated string containing the name of the vertex shader attribute variable to which {@code index} is to be bound + */ + public static void glBindAttribLocationARB(@NativeType("GLhandleARB") int programObj, @NativeType("GLuint") int index, @NativeType("GLchar const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + nglBindAttribLocationARB(programObj, index, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetActiveAttribARB ] --- + + /** + * Unsafe version of: {@link #glGetActiveAttribARB GetActiveAttribARB} + * + * @param maxLength the maximum number of characters OpenGL is allowed to write in the character buffer indicated by {@code name} + */ + public static native void nglGetActiveAttribARB(int programObj, int index, int maxLength, long length, long size, long type, long name); + + /** + * Returns information about an active attribute variable for the specified program object. + * + * @param programObj the program object to be queried + * @param index the index of the attribute variable to be queried + * @param length the number of characters actually written by OpenGL in the string indicated by {@code name} (excluding the null terminator) if a value other than + * {@code NULL} is passed + * @param size the size of the attribute variable + * @param type the data type of the attribute variable + * @param name a null terminated string containing the name of the attribute variable + */ + public static void glGetActiveAttribARB(@NativeType("GLhandleARB") int programObj, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLint *") IntBuffer size, @NativeType("GLenum *") IntBuffer type, @NativeType("GLchar *") ByteBuffer name) { + if (CHECKS) { + checkSafe(length, 1); + check(size, 1); + check(type, 1); + } + nglGetActiveAttribARB(programObj, index, name.remaining(), memAddressSafe(length), memAddress(size), memAddress(type), memAddress(name)); + } + + /** + * Returns information about an active attribute variable for the specified program object. + * + * @param programObj the program object to be queried + * @param index the index of the attribute variable to be queried + * @param maxLength the maximum number of characters OpenGL is allowed to write in the character buffer indicated by {@code name} + * @param size the size of the attribute variable + * @param type the data type of the attribute variable + */ + @NativeType("void") + public static String glGetActiveAttribARB(@NativeType("GLhandleARB") int programObj, @NativeType("GLuint") int index, @NativeType("GLsizei") int maxLength, @NativeType("GLint *") IntBuffer size, @NativeType("GLenum *") IntBuffer type) { + if (CHECKS) { + check(size, 1); + check(type, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer length = stack.ints(0); + ByteBuffer name = stack.malloc(maxLength); + nglGetActiveAttribARB(programObj, index, maxLength, memAddress(length), memAddress(size), memAddress(type), memAddress(name)); + return memASCII(name, length.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Returns information about an active attribute variable for the specified program object. + * + * @param programObj the program object to be queried + * @param index the index of the attribute variable to be queried + * @param size the size of the attribute variable + * @param type the data type of the attribute variable + */ + @NativeType("void") + public static String glGetActiveAttribARB(@NativeType("GLhandleARB") int programObj, @NativeType("GLuint") int index, @NativeType("GLint *") IntBuffer size, @NativeType("GLenum *") IntBuffer type) { + return glGetActiveAttribARB(programObj, index, ARBShaderObjects.glGetObjectParameteriARB(programObj, GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB), size, type); + } + + // --- [ glGetAttribLocationARB ] --- + + /** Unsafe version of: {@link #glGetAttribLocationARB GetAttribLocationARB} */ + public static native int nglGetAttribLocationARB(int programObj, long name); + + /** + * Returns the location of an attribute variable. + * + * @param programObj the program object to be queried + * @param name a null terminated string containing the name of the attribute variable whose location is to be queried + */ + @NativeType("GLint") + public static int glGetAttribLocationARB(@NativeType("GLhandleARB") int programObj, @NativeType("GLchar const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nglGetAttribLocationARB(programObj, memAddress(name)); + } + + /** + * Returns the location of an attribute variable. + * + * @param programObj the program object to be queried + * @param name a null terminated string containing the name of the attribute variable whose location is to be queried + */ + @NativeType("GLint") + public static int glGetAttribLocationARB(@NativeType("GLhandleARB") int programObj, @NativeType("GLchar const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + return nglGetAttribLocationARB(programObj, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetVertexAttribivARB ] --- + + /** Unsafe version of: {@link #glGetVertexAttribivARB GetVertexAttribivARB} */ + public static native void nglGetVertexAttribivARB(int index, int pname, long params); + + /** + * Returns the integer value of a generic vertex attribute parameter. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the vertex attribute parameter to be queried. One of:
{@link GL15#GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING VERTEX_ATTRIB_ARRAY_BUFFER_BINDING}{@link #GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB VERTEX_ATTRIB_ARRAY_ENABLED_ARB}
{@link #GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB VERTEX_ATTRIB_ARRAY_SIZE_ARB}{@link #GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB VERTEX_ATTRIB_ARRAY_STRIDE_ARB}
{@link #GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB VERTEX_ATTRIB_ARRAY_TYPE_ARB}{@link #GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB}
{@link #GL_CURRENT_VERTEX_ATTRIB_ARB CURRENT_VERTEX_ATTRIB_ARB}{@link GL30#GL_VERTEX_ATTRIB_ARRAY_INTEGER VERTEX_ATTRIB_ARRAY_INTEGER}
{@link GL33#GL_VERTEX_ATTRIB_ARRAY_DIVISOR VERTEX_ATTRIB_ARRAY_DIVISOR}
+ * @param params returns the requested data + */ + public static void glGetVertexAttribivARB(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetVertexAttribivARB(index, pname, memAddress(params)); + } + + /** + * Returns the integer value of a generic vertex attribute parameter. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the vertex attribute parameter to be queried. One of:
{@link GL15#GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING VERTEX_ATTRIB_ARRAY_BUFFER_BINDING}{@link #GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB VERTEX_ATTRIB_ARRAY_ENABLED_ARB}
{@link #GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB VERTEX_ATTRIB_ARRAY_SIZE_ARB}{@link #GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB VERTEX_ATTRIB_ARRAY_STRIDE_ARB}
{@link #GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB VERTEX_ATTRIB_ARRAY_TYPE_ARB}{@link #GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB}
{@link #GL_CURRENT_VERTEX_ATTRIB_ARB CURRENT_VERTEX_ATTRIB_ARB}{@link GL30#GL_VERTEX_ATTRIB_ARRAY_INTEGER VERTEX_ATTRIB_ARRAY_INTEGER}
{@link GL33#GL_VERTEX_ATTRIB_ARRAY_DIVISOR VERTEX_ATTRIB_ARRAY_DIVISOR}
+ */ + @NativeType("void") + public static int glGetVertexAttribiARB(@NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetVertexAttribivARB(index, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetVertexAttribfvARB ] --- + + /** Unsafe version of: {@link #glGetVertexAttribfvARB GetVertexAttribfvARB} */ + public static native void nglGetVertexAttribfvARB(int index, int pname, long params); + + /** + * Float version of {@link #glGetVertexAttribivARB GetVertexAttribivARB}. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the vertex attribute parameter to be queried + * @param params returns the requested data + */ + public static void glGetVertexAttribfvARB(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglGetVertexAttribfvARB(index, pname, memAddress(params)); + } + + // --- [ glGetVertexAttribdvARB ] --- + + /** Unsafe version of: {@link #glGetVertexAttribdvARB GetVertexAttribdvARB} */ + public static native void nglGetVertexAttribdvARB(int index, int pname, long params); + + /** + * Double version of {@link #glGetVertexAttribivARB GetVertexAttribivARB}. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the vertex attribute parameter to be queried + * @param params returns the requested data + */ + public static void glGetVertexAttribdvARB(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLdouble *") DoubleBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglGetVertexAttribdvARB(index, pname, memAddress(params)); + } + + // --- [ glGetVertexAttribPointervARB ] --- + + /** Unsafe version of: {@link #glGetVertexAttribPointervARB GetVertexAttribPointervARB} */ + public static native void nglGetVertexAttribPointervARB(int index, int pname, long pointer); + + /** + * Returns the address of the specified generic vertex attribute pointer. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the generic vertex attribute parameter to be returned. Must be:
{@link #GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB VERTEX_ATTRIB_ARRAY_POINTER_ARB}
+ * @param pointer the pointer value + */ + public static void glGetVertexAttribPointervARB(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("void **") PointerBuffer pointer) { + if (CHECKS) { + check(pointer, 1); + } + nglGetVertexAttribPointervARB(index, pname, memAddress(pointer)); + } + + /** + * Returns the address of the specified generic vertex attribute pointer. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the generic vertex attribute parameter to be returned. Must be:
{@link #GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB VERTEX_ATTRIB_ARRAY_POINTER_ARB}
+ */ + @NativeType("void") + public static long glGetVertexAttribPointerARB(@NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + PointerBuffer pointer = stack.callocPointer(1); + nglGetVertexAttribPointervARB(index, pname, memAddress(pointer)); + return pointer.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #glVertexAttrib1fvARB VertexAttrib1fvARB} */ + public static void glVertexAttrib1fvARB(@NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glVertexAttrib1fvARB; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttrib1svARB VertexAttrib1svARB} */ + public static void glVertexAttrib1svARB(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttrib1svARB; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttrib1dvARB VertexAttrib1dvARB} */ + public static void glVertexAttrib1dvARB(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glVertexAttrib1dvARB; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttrib2fvARB VertexAttrib2fvARB} */ + public static void glVertexAttrib2fvARB(@NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glVertexAttrib2fvARB; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttrib2svARB VertexAttrib2svARB} */ + public static void glVertexAttrib2svARB(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttrib2svARB; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttrib2dvARB VertexAttrib2dvARB} */ + public static void glVertexAttrib2dvARB(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glVertexAttrib2dvARB; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttrib3fvARB VertexAttrib3fvARB} */ + public static void glVertexAttrib3fvARB(@NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glVertexAttrib3fvARB; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttrib3svARB VertexAttrib3svARB} */ + public static void glVertexAttrib3svARB(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttrib3svARB; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttrib3dvARB VertexAttrib3dvARB} */ + public static void glVertexAttrib3dvARB(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glVertexAttrib3dvARB; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttrib4fvARB VertexAttrib4fvARB} */ + public static void glVertexAttrib4fvARB(@NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glVertexAttrib4fvARB; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttrib4svARB VertexAttrib4svARB} */ + public static void glVertexAttrib4svARB(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttrib4svARB; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttrib4dvARB VertexAttrib4dvARB} */ + public static void glVertexAttrib4dvARB(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glVertexAttrib4dvARB; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttrib4ivARB VertexAttrib4ivARB} */ + public static void glVertexAttrib4ivARB(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttrib4ivARB; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttrib4usvARB VertexAttrib4usvARB} */ + public static void glVertexAttrib4usvARB(@NativeType("GLuint") int index, @NativeType("GLushort const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttrib4usvARB; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttrib4uivARB VertexAttrib4uivARB} */ + public static void glVertexAttrib4uivARB(@NativeType("GLuint") int index, @NativeType("GLuint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttrib4uivARB; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttrib4NsvARB VertexAttrib4NsvARB} */ + public static void glVertexAttrib4NsvARB(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttrib4NsvARB; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttrib4NivARB VertexAttrib4NivARB} */ + public static void glVertexAttrib4NivARB(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttrib4NivARB; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttrib4NusvARB VertexAttrib4NusvARB} */ + public static void glVertexAttrib4NusvARB(@NativeType("GLuint") int index, @NativeType("GLushort const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttrib4NusvARB; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttrib4NuivARB VertexAttrib4NuivARB} */ + public static void glVertexAttrib4NuivARB(@NativeType("GLuint") int index, @NativeType("GLuint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttrib4NuivARB; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribPointerARB VertexAttribPointerARB} */ + public static void glVertexAttribPointerARB(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") short[] pointer) { + long __functionAddress = GL.getICD().glVertexAttribPointerARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(index, size, type, normalized, stride, pointer, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribPointerARB VertexAttribPointerARB} */ + public static void glVertexAttribPointerARB(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") int[] pointer) { + long __functionAddress = GL.getICD().glVertexAttribPointerARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(index, size, type, normalized, stride, pointer, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribPointerARB VertexAttribPointerARB} */ + public static void glVertexAttribPointerARB(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") float[] pointer) { + long __functionAddress = GL.getICD().glVertexAttribPointerARB; + if (CHECKS) { + check(__functionAddress); + } + callPV(index, size, type, normalized, stride, pointer, __functionAddress); + } + + /** Array version of: {@link #glGetActiveAttribARB GetActiveAttribARB} */ + public static void glGetActiveAttribARB(@NativeType("GLhandleARB") int programObj, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLint *") int[] size, @NativeType("GLenum *") int[] type, @NativeType("GLchar *") ByteBuffer name) { + long __functionAddress = GL.getICD().glGetActiveAttribARB; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + check(size, 1); + check(type, 1); + } + callPPPPV(programObj, index, name.remaining(), length, size, type, memAddress(name), __functionAddress); + } + + /** Array version of: {@link #glGetVertexAttribivARB GetVertexAttribivARB} */ + public static void glGetVertexAttribivARB(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetVertexAttribivARB; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(index, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetVertexAttribfvARB GetVertexAttribfvARB} */ + public static void glGetVertexAttribfvARB(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetVertexAttribfvARB; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(index, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetVertexAttribdvARB GetVertexAttribdvARB} */ + public static void glGetVertexAttribdvARB(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLdouble *") double[] params) { + long __functionAddress = GL.getICD().glGetVertexAttribdvARB; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(index, pname, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexType2_10_10_10_REV.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexType2_10_10_10_REV.java new file mode 100644 index 00000000..44348738 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBVertexType2_10_10_10_REV.java @@ -0,0 +1,720 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_vertex_type_2_10_10_10_rev extension. + * + *

This extension adds two new vertex attribute data formats: a signed 2.10.10.10 and an unsigned 2.10.10.10 vertex data format. These vertex data formats + * describe a 4 component stream which can be used to store normals or other attributes in a quantized form. Normals, tangents, binormals and other vertex + * attributes can often be specified at reduced precision without introducing noticeable artifacts, reducing the amount of memory and memory bandwidth they consume.

+ * + *

Promoted to core in {@link GL33 OpenGL 3.3}.

+ */ +public class ARBVertexType2_10_10_10_REV { + + /** + * Accepted by the {@code type} parameter of VertexAttribPointer, VertexPointer, NormalPointer, ColorPointer, SecondaryColorPointer, TexCoordPointer, + * VertexAttribP{1234}ui, VertexP*, TexCoordP*, MultiTexCoordP*, NormalP3ui, ColorP*, SecondaryColorP and VertexAttribP*. + */ + public static final int GL_INT_2_10_10_10_REV = 0x8D9F; + + static { GL.initialize(); } + + protected ARBVertexType2_10_10_10_REV() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, boolean fc) { + return (fc || checkFunctions( + caps.glVertexP2ui, caps.glVertexP3ui, caps.glVertexP4ui, caps.glVertexP2uiv, caps.glVertexP3uiv, caps.glVertexP4uiv, caps.glTexCoordP1ui, + caps.glTexCoordP2ui, caps.glTexCoordP3ui, caps.glTexCoordP4ui, caps.glTexCoordP1uiv, caps.glTexCoordP2uiv, caps.glTexCoordP3uiv, + caps.glTexCoordP4uiv, caps.glMultiTexCoordP1ui, caps.glMultiTexCoordP2ui, caps.glMultiTexCoordP3ui, caps.glMultiTexCoordP4ui, + caps.glMultiTexCoordP1uiv, caps.glMultiTexCoordP2uiv, caps.glMultiTexCoordP3uiv, caps.glMultiTexCoordP4uiv, caps.glNormalP3ui, caps.glNormalP3uiv, + caps.glColorP3ui, caps.glColorP4ui, caps.glColorP3uiv, caps.glColorP4uiv, caps.glSecondaryColorP3ui, caps.glSecondaryColorP3uiv + )) && checkFunctions( + caps.glVertexAttribP1ui, caps.glVertexAttribP2ui, caps.glVertexAttribP3ui, caps.glVertexAttribP4ui, caps.glVertexAttribP1uiv, + caps.glVertexAttribP2uiv, caps.glVertexAttribP3uiv, caps.glVertexAttribP4uiv + ); + } + + // --- [ glVertexP2ui ] --- + + /** + * Packed component version of {@link GL11#glVertex2f Vertex2f}. + * + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param value the packed value + */ + public static void glVertexP2ui(@NativeType("GLenum") int type, @NativeType("GLuint") int value) { + GL33.glVertexP2ui(type, value); + } + + // --- [ glVertexP3ui ] --- + + /** + * Packed component version of {@link GL11#glVertex3f Vertex3f}. + * + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param value the packed value + */ + public static void glVertexP3ui(@NativeType("GLenum") int type, @NativeType("GLuint") int value) { + GL33.glVertexP3ui(type, value); + } + + // --- [ glVertexP4ui ] --- + + /** + * Packed component version of {@link GL11#glVertex4f Vertex4f}. + * + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param value the packed value + */ + public static void glVertexP4ui(@NativeType("GLenum") int type, @NativeType("GLuint") int value) { + GL33.glVertexP4ui(type, value); + } + + // --- [ glVertexP2uiv ] --- + + /** Unsafe version of: {@link #glVertexP2uiv VertexP2uiv} */ + public static void nglVertexP2uiv(int type, long value) { + GL33.nglVertexP2uiv(type, value); + } + + /** + * Pointer version of {@link #glVertexP2ui VertexP2ui}. + * + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param value the packed value + */ + public static void glVertexP2uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer value) { + GL33.glVertexP2uiv(type, value); + } + + // --- [ glVertexP3uiv ] --- + + /** Unsafe version of: {@link #glVertexP3uiv VertexP3uiv} */ + public static void nglVertexP3uiv(int type, long value) { + GL33.nglVertexP3uiv(type, value); + } + + /** + * Pointer version of {@link #glVertexP3ui VertexP3ui}. + * + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param value the packed value + */ + public static void glVertexP3uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer value) { + GL33.glVertexP3uiv(type, value); + } + + // --- [ glVertexP4uiv ] --- + + /** Unsafe version of: {@link #glVertexP4uiv VertexP4uiv} */ + public static void nglVertexP4uiv(int type, long value) { + GL33.nglVertexP4uiv(type, value); + } + + /** + * Pointer version of {@link #glVertexP4ui VertexP4ui}. + * + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param value the packed value + */ + public static void glVertexP4uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer value) { + GL33.glVertexP4uiv(type, value); + } + + // --- [ glTexCoordP1ui ] --- + + /** + * Packed component version of {@link GL11#glTexCoord1f TexCoord1f}. + * + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + */ + public static void glTexCoordP1ui(@NativeType("GLenum") int type, @NativeType("GLuint") int coords) { + GL33.glTexCoordP1ui(type, coords); + } + + // --- [ glTexCoordP2ui ] --- + + /** + * Packed component version of {@link GL11#glTexCoord2f TexCoord2f}. + * + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + */ + public static void glTexCoordP2ui(@NativeType("GLenum") int type, @NativeType("GLuint") int coords) { + GL33.glTexCoordP2ui(type, coords); + } + + // --- [ glTexCoordP3ui ] --- + + /** + * Packed component version of {@link GL11#glTexCoord3f TexCoord3f}. + * + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + */ + public static void glTexCoordP3ui(@NativeType("GLenum") int type, @NativeType("GLuint") int coords) { + GL33.glTexCoordP3ui(type, coords); + } + + // --- [ glTexCoordP4ui ] --- + + /** + * Packed component version of {@link GL11#glTexCoord4f TexCoord4f}. + * + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + */ + public static void glTexCoordP4ui(@NativeType("GLenum") int type, @NativeType("GLuint") int coords) { + GL33.glTexCoordP4ui(type, coords); + } + + // --- [ glTexCoordP1uiv ] --- + + /** Unsafe version of: {@link #glTexCoordP1uiv TexCoordP1uiv} */ + public static void nglTexCoordP1uiv(int type, long coords) { + GL33.nglTexCoordP1uiv(type, coords); + } + + /** + * Pointer version of {@link #glTexCoordP1ui TexCoordP1ui}. + * + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + */ + public static void glTexCoordP1uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer coords) { + GL33.glTexCoordP1uiv(type, coords); + } + + // --- [ glTexCoordP2uiv ] --- + + /** Unsafe version of: {@link #glTexCoordP2uiv TexCoordP2uiv} */ + public static void nglTexCoordP2uiv(int type, long coords) { + GL33.nglTexCoordP2uiv(type, coords); + } + + /** + * Pointer version of {@link #glTexCoordP2ui TexCoordP2ui}. + * + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + */ + public static void glTexCoordP2uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer coords) { + GL33.glTexCoordP2uiv(type, coords); + } + + // --- [ glTexCoordP3uiv ] --- + + /** Unsafe version of: {@link #glTexCoordP3uiv TexCoordP3uiv} */ + public static void nglTexCoordP3uiv(int type, long coords) { + GL33.nglTexCoordP3uiv(type, coords); + } + + /** + * Pointer version of {@link #glTexCoordP3ui TexCoordP3ui}. + * + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + */ + public static void glTexCoordP3uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer coords) { + GL33.glTexCoordP3uiv(type, coords); + } + + // --- [ glTexCoordP4uiv ] --- + + /** Unsafe version of: {@link #glTexCoordP4uiv TexCoordP4uiv} */ + public static void nglTexCoordP4uiv(int type, long coords) { + GL33.nglTexCoordP4uiv(type, coords); + } + + /** + * Pointer version of {@link #glTexCoordP4ui TexCoordP4ui}. + * + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + */ + public static void glTexCoordP4uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer coords) { + GL33.glTexCoordP4uiv(type, coords); + } + + // --- [ glMultiTexCoordP1ui ] --- + + /** + * Packed component version of {@link GL13#glMultiTexCoord1f MultiTexCoord1f}. + * + * @param texture the coordinate set to be modified + * @param type type of packing used on the data. One of:
typeofpackingusedonthedata
+ * @param coords the packed value + */ + public static void glMultiTexCoordP1ui(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint") int coords) { + GL33.glMultiTexCoordP1ui(texture, type, coords); + } + + // --- [ glMultiTexCoordP2ui ] --- + + /** + * Packed component version of {@link GL13#glMultiTexCoord2f MultiTexCoord2f}. + * + * @param texture the coordinate set to be modified + * @param type type of packing used on the data. One of:
typeofpackingusedonthedata
+ * @param coords the packed value + */ + public static void glMultiTexCoordP2ui(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint") int coords) { + GL33.glMultiTexCoordP2ui(texture, type, coords); + } + + // --- [ glMultiTexCoordP3ui ] --- + + /** + * Packed component version of {@link GL13#glMultiTexCoord3f MultiTexCoord3f}. + * + * @param texture the coordinate set to be modified + * @param type type of packing used on the data. One of:
typeofpackingusedonthedata
+ * @param coords the packed value + */ + public static void glMultiTexCoordP3ui(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint") int coords) { + GL33.glMultiTexCoordP3ui(texture, type, coords); + } + + // --- [ glMultiTexCoordP4ui ] --- + + /** + * Packed component version of {@link GL13#glMultiTexCoord4f MultiTexCoord4f}. + * + * @param texture the coordinate set to be modified + * @param type type of packing used on the data. One of:
typeofpackingusedonthedata
+ * @param coords the packed value + */ + public static void glMultiTexCoordP4ui(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint") int coords) { + GL33.glMultiTexCoordP4ui(texture, type, coords); + } + + // --- [ glMultiTexCoordP1uiv ] --- + + /** Unsafe version of: {@link #glMultiTexCoordP1uiv MultiTexCoordP1uiv} */ + public static void nglMultiTexCoordP1uiv(int texture, int type, long coords) { + GL33.nglMultiTexCoordP1uiv(texture, type, coords); + } + + /** + * Pointer version of {@link #glMultiTexCoordP1ui MultiTexCoordP1ui}. + * + * @param texture the coordinate set to be modified + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + */ + public static void glMultiTexCoordP1uiv(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer coords) { + GL33.glMultiTexCoordP1uiv(texture, type, coords); + } + + // --- [ glMultiTexCoordP2uiv ] --- + + /** Unsafe version of: {@link #glMultiTexCoordP2uiv MultiTexCoordP2uiv} */ + public static void nglMultiTexCoordP2uiv(int texture, int type, long coords) { + GL33.nglMultiTexCoordP2uiv(texture, type, coords); + } + + /** + * Pointer version of {@link #glMultiTexCoordP2ui MultiTexCoordP2ui}. + * + * @param texture the coordinate set to be modified + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + */ + public static void glMultiTexCoordP2uiv(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer coords) { + GL33.glMultiTexCoordP2uiv(texture, type, coords); + } + + // --- [ glMultiTexCoordP3uiv ] --- + + /** Unsafe version of: {@link #glMultiTexCoordP3uiv MultiTexCoordP3uiv} */ + public static void nglMultiTexCoordP3uiv(int texture, int type, long coords) { + GL33.nglMultiTexCoordP3uiv(texture, type, coords); + } + + /** + * Pointer version of {@link #glMultiTexCoordP3ui MultiTexCoordP3ui}. + * + * @param texture the coordinate set to be modified + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + */ + public static void glMultiTexCoordP3uiv(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer coords) { + GL33.glMultiTexCoordP3uiv(texture, type, coords); + } + + // --- [ glMultiTexCoordP4uiv ] --- + + /** Unsafe version of: {@link #glMultiTexCoordP4uiv MultiTexCoordP4uiv} */ + public static void nglMultiTexCoordP4uiv(int texture, int type, long coords) { + GL33.nglMultiTexCoordP4uiv(texture, type, coords); + } + + /** + * Pointer version of {@link #glMultiTexCoordP4ui MultiTexCoordP4ui}. + * + * @param texture the coordinate set to be modified + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + */ + public static void glMultiTexCoordP4uiv(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer coords) { + GL33.glMultiTexCoordP4uiv(texture, type, coords); + } + + // --- [ glNormalP3ui ] --- + + /** + * Packed component version of {@link GL11#glNormal3f Normal3f}. + * + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + */ + public static void glNormalP3ui(@NativeType("GLenum") int type, @NativeType("GLuint") int coords) { + GL33.glNormalP3ui(type, coords); + } + + // --- [ glNormalP3uiv ] --- + + /** Unsafe version of: {@link #glNormalP3uiv NormalP3uiv} */ + public static void nglNormalP3uiv(int type, long coords) { + GL33.nglNormalP3uiv(type, coords); + } + + /** + * Pointer version {@link #glNormalP3ui NormalP3ui}. + * + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + */ + public static void glNormalP3uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer coords) { + GL33.glNormalP3uiv(type, coords); + } + + // --- [ glColorP3ui ] --- + + /** + * Packed component version of {@link GL11#glColor3f Color3f}. + * + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param color the packed value + */ + public static void glColorP3ui(@NativeType("GLenum") int type, @NativeType("GLuint") int color) { + GL33.glColorP3ui(type, color); + } + + // --- [ glColorP4ui ] --- + + /** + * Packed component version of {@link GL11#glColor4f Color4f}. + * + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param color the packed value + */ + public static void glColorP4ui(@NativeType("GLenum") int type, @NativeType("GLuint") int color) { + GL33.glColorP4ui(type, color); + } + + // --- [ glColorP3uiv ] --- + + /** Unsafe version of: {@link #glColorP3uiv ColorP3uiv} */ + public static void nglColorP3uiv(int type, long color) { + GL33.nglColorP3uiv(type, color); + } + + /** + * Pointer version of {@link #glColorP3ui ColorP3ui}. + * + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param color the packed value + */ + public static void glColorP3uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer color) { + GL33.glColorP3uiv(type, color); + } + + // --- [ glColorP4uiv ] --- + + /** Unsafe version of: {@link #glColorP4uiv ColorP4uiv} */ + public static void nglColorP4uiv(int type, long color) { + GL33.nglColorP4uiv(type, color); + } + + /** + * Pointer version of {@link #glColorP4ui ColorP4ui}. + * + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param color the packed value + */ + public static void glColorP4uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer color) { + GL33.glColorP4uiv(type, color); + } + + // --- [ glSecondaryColorP3ui ] --- + + /** + * Packed component version of {@link GL14#glSecondaryColor3f SecondaryColor3f}. + * + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param color the packed value + */ + public static void glSecondaryColorP3ui(@NativeType("GLenum") int type, @NativeType("GLuint") int color) { + GL33.glSecondaryColorP3ui(type, color); + } + + // --- [ glSecondaryColorP3uiv ] --- + + /** Unsafe version of: {@link #glSecondaryColorP3uiv SecondaryColorP3uiv} */ + public static void nglSecondaryColorP3uiv(int type, long color) { + GL33.nglSecondaryColorP3uiv(type, color); + } + + /** + * Pointer version of {@link #glSecondaryColorP3ui SecondaryColorP3ui}. + * + * @param type type of packing used on the data. One of:
{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param color the packed value + */ + public static void glSecondaryColorP3uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer color) { + GL33.glSecondaryColorP3uiv(type, color); + } + + // --- [ glVertexAttribP1ui ] --- + + /** + * Packed component version of {@link GL20C#glVertexAttrib1f VertexAttrib1f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link GL33C#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + */ + public static void glVertexAttribP1ui(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint") int value) { + GL33C.glVertexAttribP1ui(index, type, normalized, value); + } + + // --- [ glVertexAttribP2ui ] --- + + /** + * Packed component version of {@link GL20C#glVertexAttrib2f VertexAttrib2f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link GL33C#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + */ + public static void glVertexAttribP2ui(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint") int value) { + GL33C.glVertexAttribP2ui(index, type, normalized, value); + } + + // --- [ glVertexAttribP3ui ] --- + + /** + * Packed component version of {@link GL20C#glVertexAttrib3f VertexAttrib3f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link GL33C#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + */ + public static void glVertexAttribP3ui(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint") int value) { + GL33C.glVertexAttribP3ui(index, type, normalized, value); + } + + // --- [ glVertexAttribP4ui ] --- + + /** + * Packed component version of {@link GL20C#glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link GL33C#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + */ + public static void glVertexAttribP4ui(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint") int value) { + GL33C.glVertexAttribP4ui(index, type, normalized, value); + } + + // --- [ glVertexAttribP1uiv ] --- + + /** Unsafe version of: {@link #glVertexAttribP1uiv VertexAttribP1uiv} */ + public static void nglVertexAttribP1uiv(int index, int type, boolean normalized, long value) { + GL33C.nglVertexAttribP1uiv(index, type, normalized, value); + } + + /** + * Pointer version of {@link #glVertexAttribP1ui VertexAttribP1ui}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link GL33C#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + */ + public static void glVertexAttribP1uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") IntBuffer value) { + GL33C.glVertexAttribP1uiv(index, type, normalized, value); + } + + // --- [ glVertexAttribP2uiv ] --- + + /** Unsafe version of: {@link #glVertexAttribP2uiv VertexAttribP2uiv} */ + public static void nglVertexAttribP2uiv(int index, int type, boolean normalized, long value) { + GL33C.nglVertexAttribP2uiv(index, type, normalized, value); + } + + /** + * Pointer version of {@link #glVertexAttribP2ui VertexAttribP2ui}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link GL33C#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + */ + public static void glVertexAttribP2uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") IntBuffer value) { + GL33C.glVertexAttribP2uiv(index, type, normalized, value); + } + + // --- [ glVertexAttribP3uiv ] --- + + /** Unsafe version of: {@link #glVertexAttribP3uiv VertexAttribP3uiv} */ + public static void nglVertexAttribP3uiv(int index, int type, boolean normalized, long value) { + GL33C.nglVertexAttribP3uiv(index, type, normalized, value); + } + + /** + * Pointer version of {@link #glVertexAttribP3ui VertexAttribP3ui}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link GL33C#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + */ + public static void glVertexAttribP3uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") IntBuffer value) { + GL33C.glVertexAttribP3uiv(index, type, normalized, value); + } + + // --- [ glVertexAttribP4uiv ] --- + + /** Unsafe version of: {@link #glVertexAttribP4uiv VertexAttribP4uiv} */ + public static void nglVertexAttribP4uiv(int index, int type, boolean normalized, long value) { + GL33C.nglVertexAttribP4uiv(index, type, normalized, value); + } + + /** + * Pointer version of {@link #glVertexAttribP4ui VertexAttribP4ui}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link GL33C#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + */ + public static void glVertexAttribP4uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") IntBuffer value) { + GL33C.glVertexAttribP4uiv(index, type, normalized, value); + } + + /** Array version of: {@link #glVertexP2uiv VertexP2uiv} */ + public static void glVertexP2uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") int[] value) { + GL33.glVertexP2uiv(type, value); + } + + /** Array version of: {@link #glVertexP3uiv VertexP3uiv} */ + public static void glVertexP3uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") int[] value) { + GL33.glVertexP3uiv(type, value); + } + + /** Array version of: {@link #glVertexP4uiv VertexP4uiv} */ + public static void glVertexP4uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") int[] value) { + GL33.glVertexP4uiv(type, value); + } + + /** Array version of: {@link #glTexCoordP1uiv TexCoordP1uiv} */ + public static void glTexCoordP1uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") int[] coords) { + GL33.glTexCoordP1uiv(type, coords); + } + + /** Array version of: {@link #glTexCoordP2uiv TexCoordP2uiv} */ + public static void glTexCoordP2uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") int[] coords) { + GL33.glTexCoordP2uiv(type, coords); + } + + /** Array version of: {@link #glTexCoordP3uiv TexCoordP3uiv} */ + public static void glTexCoordP3uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") int[] coords) { + GL33.glTexCoordP3uiv(type, coords); + } + + /** Array version of: {@link #glTexCoordP4uiv TexCoordP4uiv} */ + public static void glTexCoordP4uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") int[] coords) { + GL33.glTexCoordP4uiv(type, coords); + } + + /** Array version of: {@link #glMultiTexCoordP1uiv MultiTexCoordP1uiv} */ + public static void glMultiTexCoordP1uiv(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint const *") int[] coords) { + GL33.glMultiTexCoordP1uiv(texture, type, coords); + } + + /** Array version of: {@link #glMultiTexCoordP2uiv MultiTexCoordP2uiv} */ + public static void glMultiTexCoordP2uiv(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint const *") int[] coords) { + GL33.glMultiTexCoordP2uiv(texture, type, coords); + } + + /** Array version of: {@link #glMultiTexCoordP3uiv MultiTexCoordP3uiv} */ + public static void glMultiTexCoordP3uiv(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint const *") int[] coords) { + GL33.glMultiTexCoordP3uiv(texture, type, coords); + } + + /** Array version of: {@link #glMultiTexCoordP4uiv MultiTexCoordP4uiv} */ + public static void glMultiTexCoordP4uiv(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint const *") int[] coords) { + GL33.glMultiTexCoordP4uiv(texture, type, coords); + } + + /** Array version of: {@link #glNormalP3uiv NormalP3uiv} */ + public static void glNormalP3uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") int[] coords) { + GL33.glNormalP3uiv(type, coords); + } + + /** Array version of: {@link #glColorP3uiv ColorP3uiv} */ + public static void glColorP3uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") int[] color) { + GL33.glColorP3uiv(type, color); + } + + /** Array version of: {@link #glColorP4uiv ColorP4uiv} */ + public static void glColorP4uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") int[] color) { + GL33.glColorP4uiv(type, color); + } + + /** Array version of: {@link #glSecondaryColorP3uiv SecondaryColorP3uiv} */ + public static void glSecondaryColorP3uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") int[] color) { + GL33.glSecondaryColorP3uiv(type, color); + } + + /** Array version of: {@link #glVertexAttribP1uiv VertexAttribP1uiv} */ + public static void glVertexAttribP1uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") int[] value) { + GL33C.glVertexAttribP1uiv(index, type, normalized, value); + } + + /** Array version of: {@link #glVertexAttribP2uiv VertexAttribP2uiv} */ + public static void glVertexAttribP2uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") int[] value) { + GL33C.glVertexAttribP2uiv(index, type, normalized, value); + } + + /** Array version of: {@link #glVertexAttribP3uiv VertexAttribP3uiv} */ + public static void glVertexAttribP3uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") int[] value) { + GL33C.glVertexAttribP3uiv(index, type, normalized, value); + } + + /** Array version of: {@link #glVertexAttribP4uiv VertexAttribP4uiv} */ + public static void glVertexAttribP4uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") int[] value) { + GL33C.glVertexAttribP4uiv(index, type, normalized, value); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBViewportArray.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBViewportArray.java new file mode 100644 index 00000000..0523c583 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBViewportArray.java @@ -0,0 +1,291 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the ARB_viewport_array extension. + * + *

OpenGL is modeled on a pipeline of operations. The final stage in this pipeline before rasterization is the viewport transformation. This stage + * transforms vertices from view space into window coordinates and allows the application to specify a rectangular region of screen space into which OpenGL + * should draw primitives. Unextended OpenGL implementations provide a single viewport per context. In order to draw primitives into multiple viewports, + * the OpenGL viewport may be changed between several draw calls. With the advent of Geometry Shaders, it has become possible for an application to amplify + * geometry and produce multiple output primitives for each primitive input to the Geometry Shader. It is possible to direct these primitives to render + * into a selected render target. However, all render targets share the same, global OpenGL viewport.

+ * + *

This extension enhances OpenGL by providing a mechanism to expose multiple viewports. Each viewport is specified as a rectangle. The destination + * viewport may be selected per-primitive by the geometry shader. This allows the Geometry Shader to produce different versions of primitives destined for + * separate viewport rectangles on the same surface. Additionally, when combined with multiple framebuffer attachments, it allows a different viewport + * rectangle to be selected for each. This extension also exposes a separate scissor rectangle for each viewport. Finally, the viewport bounds are now + * floating point quantities allowing fractional pixel offsets to be applied during the viewport transform.

+ * + *

Requires {@link GL32 OpenGL 3.2} or {@link EXTGeometryShader4 EXT_geometry_shader4} or {@link ARBGeometryShader4 ARB_geometry_shader4}. Promoted to core in {@link GL41 OpenGL 4.1}.

+ */ +public class ARBViewportArray { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v. */ + public static final int + GL_MAX_VIEWPORTS = 0x825B, + GL_VIEWPORT_SUBPIXEL_BITS = 0x825C, + GL_VIEWPORT_BOUNDS_RANGE = 0x825D, + GL_LAYER_PROVOKING_VERTEX = 0x825E, + GL_VIEWPORT_INDEX_PROVOKING_VERTEX = 0x825F; + + /** Returned in the {@code data} parameter from a Get query with a {@code pname} of LAYER_PROVOKING_VERTEX or VIEWPORT_INDEX_PROVOKING_VERTEX. */ + public static final int GL_UNDEFINED_VERTEX = 0x8260; + + static { GL.initialize(); } + + protected ARBViewportArray() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glViewportArrayv, caps.glViewportIndexedf, caps.glViewportIndexedfv, caps.glScissorArrayv, caps.glScissorIndexed, caps.glScissorIndexedv, + caps.glDepthRangeArrayv, caps.glDepthRangeIndexed, caps.glGetFloati_v, caps.glGetDoublei_v + ); + } + + // --- [ glViewportArrayv ] --- + + /** + * Unsafe version of: {@link #glViewportArrayv ViewportArrayv} + * + * @param count the number of viewports to set + */ + public static void nglViewportArrayv(int first, int count, long v) { + GL41C.nglViewportArrayv(first, count, v); + } + + /** + * Sets multiple viewports. + * + * @param first the first viewport to set + * @param v an array containing the viewport parameters + */ + public static void glViewportArrayv(@NativeType("GLuint") int first, @NativeType("GLfloat const *") FloatBuffer v) { + GL41C.glViewportArrayv(first, v); + } + + // --- [ glViewportIndexedf ] --- + + /** + * Sets a specified viewport. + * + * @param index the viewport to set + * @param x the left viewport coordinate + * @param y the bottom viewport coordinate + * @param w the viewport width + * @param h the viewport height + */ + public static void glViewportIndexedf(@NativeType("GLuint") int index, @NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float w, @NativeType("GLfloat") float h) { + GL41C.glViewportIndexedf(index, x, y, w, h); + } + + // --- [ glViewportIndexedfv ] --- + + /** Unsafe version of: {@link #glViewportIndexedfv ViewportIndexedfv} */ + public static void nglViewportIndexedfv(int index, long v) { + GL41C.nglViewportIndexedfv(index, v); + } + + /** + * Pointer version of {@link #glViewportIndexedf ViewportIndexedf}. + * + * @param index the viewport to set + * @param v the viewport parameters + */ + public static void glViewportIndexedfv(@NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer v) { + GL41C.glViewportIndexedfv(index, v); + } + + // --- [ glScissorArrayv ] --- + + /** + * Unsafe version of: {@link #glScissorArrayv ScissorArrayv} + * + * @param count the number of scissor boxes to modify + */ + public static void nglScissorArrayv(int first, int count, long v) { + GL41C.nglScissorArrayv(first, count, v); + } + + /** + * Defines the scissor box for multiple viewports. + * + * @param first the index of the first viewport whose scissor box to modify + * @param v an array containing the left, bottom, width and height of each scissor box, in that order + */ + public static void glScissorArrayv(@NativeType("GLuint") int first, @NativeType("GLint const *") IntBuffer v) { + GL41C.glScissorArrayv(first, v); + } + + // --- [ glScissorIndexed ] --- + + /** + * Defines the scissor box for a specific viewport. + * + * @param index the index of the viewport whose scissor box to modify + * @param left the left scissor box coordinate + * @param bottom the bottom scissor box coordinate + * @param width the scissor box width + * @param height the scissor box height + */ + public static void glScissorIndexed(@NativeType("GLuint") int index, @NativeType("GLint") int left, @NativeType("GLint") int bottom, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL41C.glScissorIndexed(index, left, bottom, width, height); + } + + // --- [ glScissorIndexedv ] --- + + /** Unsafe version of: {@link #glScissorIndexedv ScissorIndexedv} */ + public static void nglScissorIndexedv(int index, long v) { + GL41C.nglScissorIndexedv(index, v); + } + + /** + * Pointer version of {@link #glScissorIndexed ScissorIndexed}. + * + * @param index the index of the viewport whose scissor box to modify + * @param v an array containing the left, bottom, width and height of each scissor box, in that order + */ + public static void glScissorIndexedv(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + GL41C.glScissorIndexedv(index, v); + } + + // --- [ glDepthRangeArrayv ] --- + + /** + * Unsafe version of: {@link #glDepthRangeArrayv DepthRangeArrayv} + * + * @param count the number of viewports whose depth range to update + */ + public static void nglDepthRangeArrayv(int first, int count, long v) { + GL41C.nglDepthRangeArrayv(first, count, v); + } + + /** + * Specifies mapping of depth values from normalized device coordinates to window coordinates for a specified set of viewports. + * + * @param first the index of the first viewport whose depth range to update + * @param v n array containing the near and far values for the depth range of each modified viewport + */ + public static void glDepthRangeArrayv(@NativeType("GLuint") int first, @NativeType("GLdouble const *") DoubleBuffer v) { + GL41C.glDepthRangeArrayv(first, v); + } + + // --- [ glDepthRangeIndexed ] --- + + /** + * Specifies mapping of depth values from normalized device coordinates to window coordinates for a specified viewport. + * + * @param index the index of the viewport whose depth range to update + * @param zNear the mapping of the near clipping plane to window coordinates. The initial value is 0. + * @param zFar the mapping of the far clipping plane to window coordinates. The initial value is 1. + */ + public static void glDepthRangeIndexed(@NativeType("GLuint") int index, @NativeType("GLdouble") double zNear, @NativeType("GLdouble") double zFar) { + GL41C.glDepthRangeIndexed(index, zNear, zFar); + } + + // --- [ glGetFloati_v ] --- + + /** Unsafe version of: {@link #glGetFloati_v GetFloati_v} */ + public static void nglGetFloati_v(int target, int index, long data) { + GL41C.nglGetFloati_v(target, index, data); + } + + /** + * Queries the float value of an indexed state variable. + * + * @param target the indexed state to query + * @param index the index of the element being queried + * @param data a scalar or buffer in which to place the returned data + */ + public static void glGetFloati_v(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat *") FloatBuffer data) { + GL41C.glGetFloati_v(target, index, data); + } + + /** + * Queries the float value of an indexed state variable. + * + * @param target the indexed state to query + * @param index the index of the element being queried + */ + @NativeType("void") + public static float glGetFloati(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + return GL41C.glGetFloati(target, index); + } + + // --- [ glGetDoublei_v ] --- + + /** Unsafe version of: {@link #glGetDoublei_v GetDoublei_v} */ + public static void nglGetDoublei_v(int target, int index, long data) { + GL41C.nglGetDoublei_v(target, index, data); + } + + /** + * Queries the double value of an indexed state variable. + * + * @param target the indexed state to query + * @param index the index of the element being queried + * @param data a scalar or buffer in which to place the returned data + */ + public static void glGetDoublei_v(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble *") DoubleBuffer data) { + GL41C.glGetDoublei_v(target, index, data); + } + + /** + * Queries the double value of an indexed state variable. + * + * @param target the indexed state to query + * @param index the index of the element being queried + */ + @NativeType("void") + public static double glGetDoublei(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + return GL41C.glGetDoublei(target, index); + } + + /** Array version of: {@link #glViewportArrayv ViewportArrayv} */ + public static void glViewportArrayv(@NativeType("GLuint") int first, @NativeType("GLfloat const *") float[] v) { + GL41C.glViewportArrayv(first, v); + } + + /** Array version of: {@link #glViewportIndexedfv ViewportIndexedfv} */ + public static void glViewportIndexedfv(@NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] v) { + GL41C.glViewportIndexedfv(index, v); + } + + /** Array version of: {@link #glScissorArrayv ScissorArrayv} */ + public static void glScissorArrayv(@NativeType("GLuint") int first, @NativeType("GLint const *") int[] v) { + GL41C.glScissorArrayv(first, v); + } + + /** Array version of: {@link #glScissorIndexedv ScissorIndexedv} */ + public static void glScissorIndexedv(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + GL41C.glScissorIndexedv(index, v); + } + + /** Array version of: {@link #glDepthRangeArrayv DepthRangeArrayv} */ + public static void glDepthRangeArrayv(@NativeType("GLuint") int first, @NativeType("GLdouble const *") double[] v) { + GL41C.glDepthRangeArrayv(first, v); + } + + /** Array version of: {@link #glGetFloati_v GetFloati_v} */ + public static void glGetFloati_v(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat *") float[] data) { + GL41C.glGetFloati_v(target, index, data); + } + + /** Array version of: {@link #glGetDoublei_v GetDoublei_v} */ + public static void glGetDoublei_v(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble *") double[] data) { + GL41C.glGetDoublei_v(target, index, data); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBWindowPos.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBWindowPos.java new file mode 100644 index 00000000..619b6457 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ARBWindowPos.java @@ -0,0 +1,347 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the ARB_window_pos extension. + * + *

In order to set the current raster position to a specific window coordinate with the {@link GL11#glRasterPos2i RasterPos2i} command, the modelview matrix, projection matrix + * and viewport must be set very carefully. Furthermore, if the desired window coordinate is outside of the window's bounds one must rely on a subtle + * side-effect of the {@link GL11#glBitmap Bitmap} command in order to avoid frustum clipping.

+ * + *

This extension provides a set of functions to directly set the current raster position in window coordinates, bypassing the modelview matrix, the + * projection matrix and the viewport-to-window mapping. Furthermore, clip testing is not performed, so that the current raster position is always valid.

+ * + *

This greatly simplifies the process of setting the current raster position to a specific window coordinate prior to calling {@link GL11#glDrawPixels DrawPixels}, + * {@link GL11#glCopyPixels CopyPixels} or {@link GL11#glBitmap Bitmap}. Many matrix operations can be avoided when mixing 2D and 3D rendering.

+ * + *

Promoted to core in {@link GL14 OpenGL 1.4}.

+ */ +public class ARBWindowPos { + + static { GL.initialize(); } + + protected ARBWindowPos() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glWindowPos2iARB, caps.glWindowPos2sARB, caps.glWindowPos2fARB, caps.glWindowPos2dARB, caps.glWindowPos2ivARB, caps.glWindowPos2svARB, + caps.glWindowPos2fvARB, caps.glWindowPos2dvARB, caps.glWindowPos3iARB, caps.glWindowPos3sARB, caps.glWindowPos3fARB, caps.glWindowPos3dARB, + caps.glWindowPos3ivARB, caps.glWindowPos3svARB, caps.glWindowPos3fvARB, caps.glWindowPos3dvARB + ); + } + + // --- [ glWindowPos2iARB ] --- + + /** + * Alternate way to set the current raster position. {@code z} is implictly set to 0. + * + * @param x the x value + * @param y the y value + */ + public static native void glWindowPos2iARB(@NativeType("GLint") int x, @NativeType("GLint") int y); + + // --- [ glWindowPos2sARB ] --- + + /** + * Short version of {@link #glWindowPos2iARB WindowPos2iARB}. + * + * @param x the x value + * @param y the y value + */ + public static native void glWindowPos2sARB(@NativeType("GLshort") short x, @NativeType("GLshort") short y); + + // --- [ glWindowPos2fARB ] --- + + /** + * Float version of {@link #glWindowPos2iARB WindowPos2iARB}. + * + * @param x the x value + * @param y the y value + */ + public static native void glWindowPos2fARB(@NativeType("GLfloat") float x, @NativeType("GLfloat") float y); + + // --- [ glWindowPos2dARB ] --- + + /** + * Double version of {@link #glWindowPos2iARB WindowPos2iARB}. + * + * @param x the x value + * @param y the y value + */ + public static native void glWindowPos2dARB(@NativeType("GLdouble") double x, @NativeType("GLdouble") double y); + + // --- [ glWindowPos2ivARB ] --- + + /** Unsafe version of: {@link #glWindowPos2ivARB WindowPos2ivARB} */ + public static native void nglWindowPos2ivARB(long p); + + /** + * Pointer version of {@link #glWindowPos2iARB WindowPos2iARB}. + * + * @param p the position value + */ + public static void glWindowPos2ivARB(@NativeType("GLint const *") IntBuffer p) { + if (CHECKS) { + check(p, 2); + } + nglWindowPos2ivARB(memAddress(p)); + } + + // --- [ glWindowPos2svARB ] --- + + /** Unsafe version of: {@link #glWindowPos2svARB WindowPos2svARB} */ + public static native void nglWindowPos2svARB(long p); + + /** + * Pointer version of {@link #glWindowPos2sARB WindowPos2sARB}. + * + * @param p the position value + */ + public static void glWindowPos2svARB(@NativeType("GLshort const *") ShortBuffer p) { + if (CHECKS) { + check(p, 2); + } + nglWindowPos2svARB(memAddress(p)); + } + + // --- [ glWindowPos2fvARB ] --- + + /** Unsafe version of: {@link #glWindowPos2fvARB WindowPos2fvARB} */ + public static native void nglWindowPos2fvARB(long p); + + /** + * Pointer version of {@link #glWindowPos2fARB WindowPos2fARB}. + * + * @param p the position value + */ + public static void glWindowPos2fvARB(@NativeType("GLfloat const *") FloatBuffer p) { + if (CHECKS) { + check(p, 2); + } + nglWindowPos2fvARB(memAddress(p)); + } + + // --- [ glWindowPos2dvARB ] --- + + /** Unsafe version of: {@link #glWindowPos2dvARB WindowPos2dvARB} */ + public static native void nglWindowPos2dvARB(long p); + + /** + * Pointer version of {@link #glWindowPos2dARB WindowPos2dARB}. + * + * @param p the position value + */ + public static void glWindowPos2dvARB(@NativeType("GLdouble const *") DoubleBuffer p) { + if (CHECKS) { + check(p, 2); + } + nglWindowPos2dvARB(memAddress(p)); + } + + // --- [ glWindowPos3iARB ] --- + + /** + * Alternate way to set the current raster position. + * + * @param x the x value + * @param y the y value + * @param z the z value + */ + public static native void glWindowPos3iARB(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z); + + // --- [ glWindowPos3sARB ] --- + + /** + * Short version of {@link #glWindowPos3iARB WindowPos3iARB}. + * + * @param x the x value + * @param y the y value + * @param z the z value + */ + public static native void glWindowPos3sARB(@NativeType("GLshort") short x, @NativeType("GLshort") short y, @NativeType("GLshort") short z); + + // --- [ glWindowPos3fARB ] --- + + /** + * Float version of {@link #glWindowPos3iARB WindowPos3iARB}. + * + * @param x the x value + * @param y the y value + * @param z the z value + */ + public static native void glWindowPos3fARB(@NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z); + + // --- [ glWindowPos3dARB ] --- + + /** + * Double version of {@link #glWindowPos3iARB WindowPos3iARB}. + * + * @param x the x value + * @param y the y value + * @param z the z value + */ + public static native void glWindowPos3dARB(@NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z); + + // --- [ glWindowPos3ivARB ] --- + + /** Unsafe version of: {@link #glWindowPos3ivARB WindowPos3ivARB} */ + public static native void nglWindowPos3ivARB(long p); + + /** + * Pointer version of {@link #glWindowPos3iARB WindowPos3iARB}. + * + * @param p the position value + */ + public static void glWindowPos3ivARB(@NativeType("GLint const *") IntBuffer p) { + if (CHECKS) { + check(p, 3); + } + nglWindowPos3ivARB(memAddress(p)); + } + + // --- [ glWindowPos3svARB ] --- + + /** Unsafe version of: {@link #glWindowPos3svARB WindowPos3svARB} */ + public static native void nglWindowPos3svARB(long p); + + /** + * Pointer version of {@link #glWindowPos3sARB WindowPos3sARB}. + * + * @param p the position value + */ + public static void glWindowPos3svARB(@NativeType("GLshort const *") ShortBuffer p) { + if (CHECKS) { + check(p, 3); + } + nglWindowPos3svARB(memAddress(p)); + } + + // --- [ glWindowPos3fvARB ] --- + + /** Unsafe version of: {@link #glWindowPos3fvARB WindowPos3fvARB} */ + public static native void nglWindowPos3fvARB(long p); + + /** + * Pointer version of {@link #glWindowPos3fARB WindowPos3fARB}. + * + * @param p the position value + */ + public static void glWindowPos3fvARB(@NativeType("GLfloat const *") FloatBuffer p) { + if (CHECKS) { + check(p, 3); + } + nglWindowPos3fvARB(memAddress(p)); + } + + // --- [ glWindowPos3dvARB ] --- + + /** Unsafe version of: {@link #glWindowPos3dvARB WindowPos3dvARB} */ + public static native void nglWindowPos3dvARB(long p); + + /** + * Pointer version of {@link #glWindowPos3dARB WindowPos3dARB}. + * + * @param p the position value + */ + public static void glWindowPos3dvARB(@NativeType("GLdouble const *") DoubleBuffer p) { + if (CHECKS) { + check(p, 3); + } + nglWindowPos3dvARB(memAddress(p)); + } + + /** Array version of: {@link #glWindowPos2ivARB WindowPos2ivARB} */ + public static void glWindowPos2ivARB(@NativeType("GLint const *") int[] p) { + long __functionAddress = GL.getICD().glWindowPos2ivARB; + if (CHECKS) { + check(__functionAddress); + check(p, 2); + } + callPV(p, __functionAddress); + } + + /** Array version of: {@link #glWindowPos2svARB WindowPos2svARB} */ + public static void glWindowPos2svARB(@NativeType("GLshort const *") short[] p) { + long __functionAddress = GL.getICD().glWindowPos2svARB; + if (CHECKS) { + check(__functionAddress); + check(p, 2); + } + callPV(p, __functionAddress); + } + + /** Array version of: {@link #glWindowPos2fvARB WindowPos2fvARB} */ + public static void glWindowPos2fvARB(@NativeType("GLfloat const *") float[] p) { + long __functionAddress = GL.getICD().glWindowPos2fvARB; + if (CHECKS) { + check(__functionAddress); + check(p, 2); + } + callPV(p, __functionAddress); + } + + /** Array version of: {@link #glWindowPos2dvARB WindowPos2dvARB} */ + public static void glWindowPos2dvARB(@NativeType("GLdouble const *") double[] p) { + long __functionAddress = GL.getICD().glWindowPos2dvARB; + if (CHECKS) { + check(__functionAddress); + check(p, 2); + } + callPV(p, __functionAddress); + } + + /** Array version of: {@link #glWindowPos3ivARB WindowPos3ivARB} */ + public static void glWindowPos3ivARB(@NativeType("GLint const *") int[] p) { + long __functionAddress = GL.getICD().glWindowPos3ivARB; + if (CHECKS) { + check(__functionAddress); + check(p, 3); + } + callPV(p, __functionAddress); + } + + /** Array version of: {@link #glWindowPos3svARB WindowPos3svARB} */ + public static void glWindowPos3svARB(@NativeType("GLshort const *") short[] p) { + long __functionAddress = GL.getICD().glWindowPos3svARB; + if (CHECKS) { + check(__functionAddress); + check(p, 3); + } + callPV(p, __functionAddress); + } + + /** Array version of: {@link #glWindowPos3fvARB WindowPos3fvARB} */ + public static void glWindowPos3fvARB(@NativeType("GLfloat const *") float[] p) { + long __functionAddress = GL.getICD().glWindowPos3fvARB; + if (CHECKS) { + check(__functionAddress); + check(p, 3); + } + callPV(p, __functionAddress); + } + + /** Array version of: {@link #glWindowPos3dvARB WindowPos3dvARB} */ + public static void glWindowPos3dvARB(@NativeType("GLdouble const *") double[] p) { + long __functionAddress = GL.getICD().glWindowPos3dvARB; + if (CHECKS) { + check(__functionAddress); + check(p, 3); + } + callPV(p, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ATIMeminfo.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ATIMeminfo.java new file mode 100644 index 00000000..5b67085c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ATIMeminfo.java @@ -0,0 +1,28 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the ATI_meminfo extension. + * + *

Traditionally, OpenGL has treated resource management as a task of hardware virtualization hidden from applications. While providing great portability, + * this shielding of information can prevent applications from making intelligent decisions on the management of resources they create. For instance, an + * application may be better served by choosing a different rendering method if there is not sufficient resources to efficiently utilize its preferred + * method.

+ * + *

Requires {@link GL11 OpenGL 1.1}

+ */ +public final class ATIMeminfo { + + /** Accepted by the {@code param} parameter of GetIntegerv. */ + public static final int + GL_VBO_FREE_MEMORY_ATI = 0x87FB, + GL_TEXTURE_FREE_MEMORY_ATI = 0x87FC, + GL_RENDERBUFFER_FREE_MEMORY_ATI = 0x87FD; + + private ATIMeminfo() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ATITextureCompression3DC.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ATITextureCompression3DC.java new file mode 100644 index 00000000..14705dd4 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/ATITextureCompression3DC.java @@ -0,0 +1,16 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** This extension is undocumented. See 3Dc for information. */ +public final class ATITextureCompression3DC { + + /** Accepted by the {@code internalformat} parameter of TexImage functions. */ + public static final int GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI = 0x8837; + + private ATITextureCompression3DC() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/CGL.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/CGL.java new file mode 100644 index 00000000..8b1e55d1 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/CGL.java @@ -0,0 +1,1650 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to CGL. */ +public class CGL { + + /** Attribute names for {@link #CGLChoosePixelFormat ChoosePixelFormat} and {@link #CGLDescribePixelFormat DescribePixelFormat}. */ + public static final int + kCGLPFAAllRenderers = 1, + kCGLPFATripleBuffer = 3, + kCGLPFADoubleBuffer = 5, + kCGLPFAStereo = 6, + kCGLPFAColorSize = 8, + kCGLPFAAlphaSize = 11, + kCGLPFADepthSize = 12, + kCGLPFAStencilSize = 13, + kCGLPFAMinimumPolicy = 51, + kCGLPFAMaximumPolicy = 52, + kCGLPFASampleBuffers = 55, + kCGLPFASamples = 56, + kCGLPFAColorFloat = 58, + kCGLPFAMultisample = 59, + kCGLPFASupersample = 60, + kCGLPFASampleAlpha = 61, + kCGLPFARendererID = 70, + kCGLPFASingleRenderer = 71, + kCGLPFANoRecovery = 72, + kCGLPFAAccelerated = 73, + kCGLPFAClosestPolicy = 74, + kCGLPFABackingStore = 76, + kCGLPFABackingVolatile = 77, + kCGLPFADisplayMask = 84, + kCGLPFAAllowOfflineRenderers = 96, + kCGLPFAAcceleratedCompute = 97, + kCGLPFAOpenGLProfile = 99, + kCGLPFASupportsAutomaticGraphicsSwitching = 101, + kCGLPFAVirtualScreenCount = 128, + kCGLPFAAuxBuffers = 7, + kCGLPFAAccumSize = 14, + kCGLPFAOffScreen = 53, + kCGLPFAAuxDepthStencil = 57, + kCGLPFAWindow = 80, + kCGLPFACompliant = 83, + kCGLPFAPBuffer = 90, + kCGLPFARemotePBuffer = 91, + kCGLPFARobust = 75, + kCGLPFAMPSafe = 78, + kCGLPFAMultiScreen = 81, + kCGLPFAFullScreen = 54; + + /** Property names for {@link #CGLDescribeRenderer DescribeRenderer}. */ + public static final int + kCGLRPOffScreen = 53, + kCGLRPRendererID = 70, + kCGLRPAccelerated = 73, + kCGLRPBackingStore = 76, + kCGLRPWindow = 80, + kCGLRPCompliant = 83, + kCGLRPDisplayMask = 84, + kCGLRPBufferModes = 100, + kCGLRPColorModes = 103, + kCGLRPAccumModes = 104, + kCGLRPDepthModes = 105, + kCGLRPStencilModes = 106, + kCGLRPMaxAuxBuffers = 107, + kCGLRPMaxSampleBuffers = 108, + kCGLRPMaxSamples = 109, + kCGLRPSampleModes = 110, + kCGLRPSampleAlpha = 111, + kCGLRPVideoMemory = 120, + kCGLRPTextureMemory = 121, + kCGLRPGPUVertProcCapable = 122, + kCGLRPGPUFragProcCapable = 123, + kCGLRPRendererCount = 128, + kCGLRPOnline = 129, + kCGLRPAcceleratedCompute = 130, + kCGLRPVideoMemoryMegabytes = 131, + kCGLRPTextureMemoryMegabytes = 132, + kCGLRPRobust = 75, + kCGLRPMPSafe = 78, + kCGLRPMultiScreen = 81, + kCGLRPFullScreen = 54; + + /** Enable names for {@link #CGLEnable Enable}, {@link #CGLDisable Disable}, and {@link #CGLIsEnabled IsEnabled}. */ + public static final int + kCGLCESwapRectangle = 201, + kCGLCESwapLimit = 203, + kCGLCERasterization = 221, + kCGLCEStateValidation = 301, + kCGLCESurfaceBackingSize = 305, + kCGLCEDisplayListOptimization = 307, + kCGLCEMPEngine = 313; + + /** Parameter names for {@link #CGLSetParameter SetParameter} and {@link #CGLGetParameter GetParameter}. */ + public static final int + kCGLCPSwapRectangle = 200, + kCGLCPSwapInterval = 222, + kCGLCPDispatchTableSize = 224, + kCGLCPClientStorage = 226, + kCGLCPSurfaceTexture = 228, + kCGLCPSurfaceOrder = 235, + kCGLCPSurfaceOpacity = 236, + kCGLCPSurfaceBackingSize = 304, + kCGLCPSurfaceSurfaceVolatile = 306, + kCGLCPReclaimResources = 308, + kCGLCPCurrentRendererID = 309, + kCGLCPGPUVertexProcessing = 310, + kCGLCPGPUFragmentProcessing = 311, + kCGLCPHasDrawable = 314, + kCGLCPMPSwapsInFlight = 315; + + /** Option names for {@link #CGLSetGlobalOption SetGlobalOption} and {@link #CGLGetGlobalOption GetGlobalOption}. */ + public static final int + kCGLGOFormatCacheSize = 501, + kCGLGOClearFormatCache = 502, + kCGLGORetainRenderers = 503, + kCGLGOResetLibrary = 504, + kCGLGOUseErrorHandler = 505, + kCGLGOUseBuildCache = 506; + + /** OpenGL Implementation Profiles. */ + public static final int + kCGLOGLPVersion_Legacy = 0x1000, + kCGLOGLPVersion_3_2_Core = 0x3200; + + /** CGL error return values. */ + public static final int + kCGLNoError = 0, + kCGLBadAttribute = 10000, + kCGLBadProperty = 10001, + kCGLBadPixelFormat = 10002, + kCGLBadRendererInfo = 10003, + kCGLBadContext = 10004, + kCGLBadDrawable = 10005, + kCGLBadDisplay = 10006, + kCGLBadState = 10007, + kCGLBadValue = 10008, + kCGLBadMatch = 10009, + kCGLBadEnumeration = 10010, + kCGLBadOffScreen = 10011, + kCGLBadFullScreen = 10012, + kCGLBadWindow = 10013, + kCGLBadAddress = 10014, + kCGLBadCodeModule = 10015, + kCGLBadAlloc = 10016, + kCGLBadConnection = 10017; + + /** Buffer modes. */ + public static final int + kCGLMonoscopicBit = 0x1, + kCGLStereoscopicBit = 0x2, + kCGLSingleBufferBit = 0x4, + kCGLDoubleBufferBit = 0x8, + kCGLTripleBufferBit = 0x10; + + /** Depth and stencil buffer depths. */ + public static final int + kCGL0Bit = 0x1, + kCGL1Bit = 0x2, + kCGL2Bit = 0x4, + kCGL3Bit = 0x8, + kCGL4Bit = 0x10, + kCGL5Bit = 0x20, + kCGL6Bit = 0x40, + kCGL8Bit = 0x80, + kCGL10Bit = 0x100, + kCGL12Bit = 0x200, + kCGL16Bit = 0x400, + kCGL24Bit = 0x800, + kCGL32Bit = 0x1000, + kCGL48Bit = 0x2000, + kCGL64Bit = 0x4000, + kCGL96Bit = 0x8000, + kCGL128Bit = 0x10000; + + /** Color and accumulation buffer formats. */ + public static final int + kCGLRGB444Bit = 0x40, + kCGLARGB4444Bit = 0x80, + kCGLRGB444A8Bit = 0x100, + kCGLRGB555Bit = 0x200, + kCGLARGB1555Bit = 0x400, + kCGLRGB555A8Bit = 0x800, + kCGLRGB565Bit = 0x1000, + kCGLRGB565A8Bit = 0x2000, + kCGLRGB888Bit = 0x4000, + kCGLARGB8888Bit = 0x8000, + kCGLRGB888A8Bit = 0x10000, + kCGLRGB101010Bit = 0x20000, + kCGLARGB2101010Bit = 0x40000, + kCGLRGB101010_A8Bit = 0x80000, + kCGLRGB121212Bit = 0x100000, + kCGLARGB12121212Bit = 0x200000, + kCGLRGB161616Bit = 0x400000, + kCGLRGBA16161616Bit = 0x800000, + kCGLRGBFloat64Bit = 0x1000000, + kCGLRGBAFloat64Bit = 0x2000000, + kCGLRGBFloat128Bit = 0x4000000, + kCGLRGBAFloat128Bit = 0x8000000, + kCGLRGBFloat256Bit = 0x10000000, + kCGLRGBAFloat256Bit = 0x20000000; + + /** Sampling modes. */ + public static final int + kCGLSupersampleBit = 0x1, + kCGLMultisampleBit = 0x2; + + protected CGL() { + throw new UnsupportedOperationException(); + } + + /** Contains the function pointers loaded from {@code GL.getFunctionProvider()}. */ + public static final class Functions { + + private Functions() {} + + /** Function address. */ + public static final long + GetCurrentContext = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLGetCurrentContext"), + SetCurrentContext = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLSetCurrentContext"), + GetShareGroup = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLGetShareGroup"), + ChoosePixelFormat = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLChoosePixelFormat"), + DestroyPixelFormat = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLDestroyPixelFormat"), + DescribePixelFormat = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLDescribePixelFormat"), + ReleasePixelFormat = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLReleasePixelFormat"), + RetainPixelFormat = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLRetainPixelFormat"), + GetPixelFormatRetainCount = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLGetPixelFormatRetainCount"), + QueryRendererInfo = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLQueryRendererInfo"), + DestroyRendererInfo = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLDestroyRendererInfo"), + DescribeRenderer = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLDescribeRenderer"), + CreateContext = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLCreateContext"), + DestroyContext = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLDestroyContext"), + CopyContext = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLCopyContext"), + RetainContext = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLRetainContext"), + ReleaseContext = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLReleaseContext"), + GetContextRetainCount = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLGetContextRetainCount"), + GetPixelFormat = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLGetPixelFormat"), + CreatePBuffer = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLCreatePBuffer"), + DestroyPBuffer = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLDestroyPBuffer"), + DescribePBuffer = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLDescribePBuffer"), + TexImagePBuffer = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLTexImagePBuffer"), + RetainPBuffer = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLRetainPBuffer"), + ReleasePBuffer = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLReleasePBuffer"), + GetPBufferRetainCount = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLGetPBufferRetainCount"), + SetOffScreen = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLSetOffScreen"), + GetOffScreen = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLGetOffScreen"), + SetFullScreen = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLSetFullScreen"), + SetFullScreenOnDisplay = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLSetFullScreenOnDisplay"), + SetPBuffer = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLSetPBuffer"), + GetPBuffer = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLGetPBuffer"), + ClearDrawable = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLClearDrawable"), + FlushDrawable = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLFlushDrawable"), + Enable = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLEnable"), + Disable = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLDisable"), + IsEnabled = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLIsEnabled"), + SetParameter = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLSetParameter"), + GetParameter = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLGetParameter"), + SetVirtualScreen = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLSetVirtualScreen"), + GetVirtualScreen = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLGetVirtualScreen"), + UpdateContext = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLUpdateContext"), + SetGlobalOption = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLSetGlobalOption"), + GetGlobalOption = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLGetGlobalOption"), + LockContext = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLLockContext"), + UnlockContext = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLUnlockContext"), + GetVersion = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLGetVersion"), + ErrorString = apiGetFunctionAddress(GL.getFunctionProvider(), "CGLErrorString"); + + } + + // --- [ CGLGetCurrentContext ] --- + + /** Returns the current rendering context. If there is none, returns {@code NULL}. */ + @NativeType("CGLContextObj") + public static long CGLGetCurrentContext() { + long __functionAddress = Functions.GetCurrentContext; + return callP(__functionAddress); + } + + // --- [ CGLSetCurrentContext ] --- + + /** + * Sets the specified rendering context as the current rendering context. + * + *

There can be only one current rendering context. Subsequent OpenGL rendering calls operate on the current rendering context to modify the drawable + * object associated with it.

+ * + *

You can use AGL macros to bypass the current rendering context mechanism and maintain your own current rendering context.

+ * + *

A context is current on a per-thread basis. Multiple threads must serialize calls into the same context.

+ * + * @param context the rendering context to set as the current rendering context. Pass {@code NULL} to release the current rendering context without assigning a new one. + */ + @NativeType("CGLError") + public static int CGLSetCurrentContext(@NativeType("CGLContextObj") long context) { + long __functionAddress = Functions.SetCurrentContext; + return callPI(context, __functionAddress); + } + + // --- [ CGLGetShareGroup ] --- + + /** + * Returns the sharegroup of the specified rendering context. + * + * @param ctx a rendering context + */ + @NativeType("CGLShareGroupObj") + public static long CGLGetShareGroup(@NativeType("CGLContextObj") long ctx) { + long __functionAddress = Functions.GetShareGroup; + if (CHECKS) { + check(ctx); + } + return callPP(ctx, __functionAddress); + } + + // --- [ CGLChoosePixelFormat ] --- + + /** Unsafe version of: {@link #CGLChoosePixelFormat ChoosePixelFormat} */ + public static int nCGLChoosePixelFormat(long attribs, long pix, long npix) { + long __functionAddress = Functions.ChoosePixelFormat; + return callPPPI(attribs, pix, npix, __functionAddress); + } + + /** + * Creates a pixel format object that satisfies the constraints of the specified buffer and renderer attributes. + * + * @param attribs a 0 terminated array that contains a list of buffer and renderer attributes. Attributes can be Boolean or integer. If an attribute is integer, you + * must supply the desired value immediately following the attribute. If the attribute is Boolean, do not supply a value because its presence in the + * attributes array implies a true value. One of:
{@link #kCGLPFAAllRenderers PFAAllRenderers}{@link #kCGLPFATripleBuffer PFATripleBuffer}{@link #kCGLPFADoubleBuffer PFADoubleBuffer}{@link #kCGLPFAStereo PFAStereo}{@link #kCGLPFAColorSize PFAColorSize}
{@link #kCGLPFAAlphaSize PFAAlphaSize}{@link #kCGLPFADepthSize PFADepthSize}{@link #kCGLPFAStencilSize PFAStencilSize}{@link #kCGLPFAMinimumPolicy PFAMinimumPolicy}{@link #kCGLPFAMaximumPolicy PFAMaximumPolicy}
{@link #kCGLPFASampleBuffers PFASampleBuffers}{@link #kCGLPFASamples PFASamples}{@link #kCGLPFAColorFloat PFAColorFloat}{@link #kCGLPFAMultisample PFAMultisample}{@link #kCGLPFASupersample PFASupersample}
{@link #kCGLPFASampleAlpha PFASampleAlpha}{@link #kCGLPFARendererID PFARendererID}{@link #kCGLPFASingleRenderer PFASingleRenderer}{@link #kCGLPFANoRecovery PFANoRecovery}{@link #kCGLPFAAccelerated PFAAccelerated}
{@link #kCGLPFAClosestPolicy PFAClosestPolicy}{@link #kCGLPFABackingStore PFABackingStore}{@link #kCGLPFABackingVolatile PFABackingVolatile}{@link #kCGLPFADisplayMask PFADisplayMask}{@link #kCGLPFAAllowOfflineRenderers PFAAllowOfflineRenderers}
{@link #kCGLPFAAcceleratedCompute PFAAcceleratedCompute}{@link #kCGLPFAOpenGLProfile PFAOpenGLProfile}{@link #kCGLPFASupportsAutomaticGraphicsSwitching PFASupportsAutomaticGraphicsSwitching}{@link #kCGLPFAVirtualScreenCount PFAVirtualScreenCount}{@link #kCGLPFAAuxBuffers PFAAuxBuffers}
{@link #kCGLPFAAccumSize PFAAccumSize}{@link #kCGLPFAOffScreen PFAOffScreen}{@link #kCGLPFAAuxDepthStencil PFAAuxDepthStencil}{@link #kCGLPFAWindow PFAWindow}{@link #kCGLPFACompliant PFACompliant}
{@link #kCGLPFAPBuffer PFAPBuffer}{@link #kCGLPFARemotePBuffer PFARemotePBuffer}{@link #kCGLPFARobust PFARobust}{@link #kCGLPFAMPSafe PFAMPSafe}{@link #kCGLPFAMultiScreen PFAMultiScreen}
{@link #kCGLPFAFullScreen PFAFullScreen}
+ * @param pix the memory address of a pixel format object. On return, points to a new pixel format object that contains pixel format information and a list of + * virtual screens. If there are no pixel formats or virtual screens that satisfy the constraints of the buffer and renderer attributes, the value of + * pix is set to {@code NULL}. + * @param npix on return, points to the number of virtual screens referenced by pix. If pix is {@code NULL}, the value of {@code npix} is set to 0. + */ + @NativeType("CGLError") + public static int CGLChoosePixelFormat(@NativeType("CGLPixelFormatAttribute const *") IntBuffer attribs, @NativeType("CGLPixelFormatObj *") PointerBuffer pix, @NativeType("GLint *") IntBuffer npix) { + if (CHECKS) { + checkNT(attribs); + check(pix, 1); + check(npix, 1); + } + return nCGLChoosePixelFormat(memAddress(attribs), memAddress(pix), memAddress(npix)); + } + + // --- [ CGLDestroyPixelFormat ] --- + + /** + * Frees the memory associated with a pixel format object. Calling this function is equivalent to calling {@link #CGLReleasePixelFormat ReleasePixelFormat}. + * + * @param pix the pixel format object to destroy + */ + @NativeType("CGLError") + public static int CGLDestroyPixelFormat(@NativeType("CGLPixelFormatObj") long pix) { + long __functionAddress = Functions.DestroyPixelFormat; + if (CHECKS) { + check(pix); + } + return callPI(pix, __functionAddress); + } + + // --- [ CGLDescribePixelFormat ] --- + + /** Unsafe version of: {@link #CGLDescribePixelFormat DescribePixelFormat} */ + public static int nCGLDescribePixelFormat(long pix, int pix_num, int attrib, long value) { + long __functionAddress = Functions.DescribePixelFormat; + if (CHECKS) { + check(pix); + } + return callPPI(pix, pix_num, attrib, value, __functionAddress); + } + + /** + * Retrieves the values of an attribute associated with a pixel format object. + * + * @param pix the pixel format object to query + * @param pix_num the virtual screen number whose attribute value you want to retrieve. This value must be between 0 and the number of virtual screens minus one. + * @param attrib the attribute whose value you want to obtain. One of:
{@link #kCGLPFAAllRenderers PFAAllRenderers}{@link #kCGLPFATripleBuffer PFATripleBuffer}{@link #kCGLPFADoubleBuffer PFADoubleBuffer}{@link #kCGLPFAStereo PFAStereo}{@link #kCGLPFAColorSize PFAColorSize}
{@link #kCGLPFAAlphaSize PFAAlphaSize}{@link #kCGLPFADepthSize PFADepthSize}{@link #kCGLPFAStencilSize PFAStencilSize}{@link #kCGLPFAMinimumPolicy PFAMinimumPolicy}{@link #kCGLPFAMaximumPolicy PFAMaximumPolicy}
{@link #kCGLPFASampleBuffers PFASampleBuffers}{@link #kCGLPFASamples PFASamples}{@link #kCGLPFAColorFloat PFAColorFloat}{@link #kCGLPFAMultisample PFAMultisample}{@link #kCGLPFASupersample PFASupersample}
{@link #kCGLPFASampleAlpha PFASampleAlpha}{@link #kCGLPFARendererID PFARendererID}{@link #kCGLPFASingleRenderer PFASingleRenderer}{@link #kCGLPFANoRecovery PFANoRecovery}{@link #kCGLPFAAccelerated PFAAccelerated}
{@link #kCGLPFAClosestPolicy PFAClosestPolicy}{@link #kCGLPFABackingStore PFABackingStore}{@link #kCGLPFABackingVolatile PFABackingVolatile}{@link #kCGLPFADisplayMask PFADisplayMask}{@link #kCGLPFAAllowOfflineRenderers PFAAllowOfflineRenderers}
{@link #kCGLPFAAcceleratedCompute PFAAcceleratedCompute}{@link #kCGLPFAOpenGLProfile PFAOpenGLProfile}{@link #kCGLPFASupportsAutomaticGraphicsSwitching PFASupportsAutomaticGraphicsSwitching}{@link #kCGLPFAVirtualScreenCount PFAVirtualScreenCount}{@link #kCGLPFAAuxBuffers PFAAuxBuffers}
{@link #kCGLPFAAccumSize PFAAccumSize}{@link #kCGLPFAOffScreen PFAOffScreen}{@link #kCGLPFAAuxDepthStencil PFAAuxDepthStencil}{@link #kCGLPFAWindow PFAWindow}{@link #kCGLPFACompliant PFACompliant}
{@link #kCGLPFAPBuffer PFAPBuffer}{@link #kCGLPFARemotePBuffer PFARemotePBuffer}{@link #kCGLPFARobust PFARobust}{@link #kCGLPFAMPSafe PFAMPSafe}{@link #kCGLPFAMultiScreen PFAMultiScreen}
{@link #kCGLPFAFullScreen PFAFullScreen}
+ * @param value on return, points to the value of the attribute + */ + @NativeType("CGLError") + public static int CGLDescribePixelFormat(@NativeType("CGLPixelFormatObj") long pix, @NativeType("GLint") int pix_num, @NativeType("CGLPixelFormatAttribute") int attrib, @NativeType("GLint *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + return nCGLDescribePixelFormat(pix, pix_num, attrib, memAddress(value)); + } + + // --- [ CGLReleasePixelFormat ] --- + + /** + * Decrements the reference count of a pixel format object. + * + *

The system retains the pixel format object when you call the function {@link #CGLCreateContext CreateContext}, so you can release a pixel format object immediately + * after passing it to the context creation function.

+ * + *

Each call to CGLReleasePixelFormat decreases the reference count by 1. If the reference count reaches 0, the pixel format object is destroyed.

+ * + * @param pix the pixel format object whose reference count should be decremented + */ + public static void CGLReleasePixelFormat(@NativeType("CGLPixelFormatObj") long pix) { + long __functionAddress = Functions.ReleasePixelFormat; + if (CHECKS) { + check(pix); + } + callPV(pix, __functionAddress); + } + + // --- [ CGLRetainPixelFormat ] --- + + /** + * Increments the receiver's reference count. + * + *

Each call to CGLRetainPixelFormat increases the reference count by 1. Each call to CGLRetainPixelFormat must be matched with a call to + * {@link #CGLReleasePixelFormat ReleasePixelFormat}.

+ * + * @param pix the pixel format object whose reference count should be incremented + */ + @NativeType("CGLPixelFormatObj") + public static long CGLRetainPixelFormat(@NativeType("CGLPixelFormatObj") long pix) { + long __functionAddress = Functions.RetainPixelFormat; + if (CHECKS) { + check(pix); + } + return callPP(pix, __functionAddress); + } + + // --- [ CGLGetPixelFormatRetainCount ] --- + + /** + * Returns the retain count of a pixel format object. + * + * @param pix a pixel format object + */ + @NativeType("GLuint") + public static int CGLGetPixelFormatRetainCount(@NativeType("CGLPixelFormatObj") long pix) { + long __functionAddress = Functions.GetPixelFormatRetainCount; + if (CHECKS) { + check(pix); + } + return callPI(pix, __functionAddress); + } + + // --- [ CGLQueryRendererInfo ] --- + + /** Unsafe version of: {@link #CGLQueryRendererInfo QueryRendererInfo} */ + public static int nCGLQueryRendererInfo(int display_mask, long rend, long nrend) { + long __functionAddress = Functions.QueryRendererInfo; + return callPPI(display_mask, rend, nrend, __functionAddress); + } + + /** + * Creates a renderer information object that contains properties and values for renderers able to drive all the specified displays in a given display + * mask. + * + * @param display_mask a bit field that contains the bitwise OR of OpenGL display masks returned by the CGDisplayIDToOpenGLDisplayMask function. If you want to obtain + * information for all renderers in the system you must call CGLQueryRendererInfo once for each display bit. + * @param rend the memory address of a renderer information object. On return, points to a renderer information object that describes all renderers that are able + * to drive the displays specified by the {@code display_mask} parameter. If {@code display_mask} does not specify any displays, the value of + * {@code rend} is set to {@code NULL}. You must call {@link #CGLDestroyRendererInfo DestroyRendererInfo} when you no longer need this object. + * @param nrend on return, points to the number of renderers described in the renderer information object. If {@code display_mask} does not specify any displays, + * the value of {@code nrend} is set to 0. + */ + @NativeType("CGLError") + public static int CGLQueryRendererInfo(@NativeType("GLuint") int display_mask, @NativeType("CGLRendererInfoObj *") PointerBuffer rend, @NativeType("GLint *") IntBuffer nrend) { + if (CHECKS) { + check(rend, 1); + check(nrend, 1); + } + return nCGLQueryRendererInfo(display_mask, memAddress(rend), memAddress(nrend)); + } + + // --- [ CGLDestroyRendererInfo ] --- + + /** + * Frees resources associated with a renderer information object. + * + * @param rend the renderer information object to destroy + */ + @NativeType("CGLError") + public static int CGLDestroyRendererInfo(@NativeType("CGLRendererInfoObj") long rend) { + long __functionAddress = Functions.DestroyRendererInfo; + if (CHECKS) { + check(rend); + } + return callPI(rend, __functionAddress); + } + + // --- [ CGLDescribeRenderer ] --- + + /** Unsafe version of: {@link #CGLDescribeRenderer DescribeRenderer} */ + public static int nCGLDescribeRenderer(long rend, int rend_num, int prop, long value) { + long __functionAddress = Functions.DescribeRenderer; + if (CHECKS) { + check(rend); + } + return callPPI(rend, rend_num, prop, value, __functionAddress); + } + + /** + * Obtains the value associated with a renderer property. + * + * @param rend an opaque renderer information object that contains a description of the renderer capabilities you want to inspect. You can obtain a renderer + * information object by calling the function {@link #CGLQueryRendererInfo QueryRendererInfo}. You must call {@link #CGLDestroyRendererInfo DestroyRendererInfo} when you no longer need this + * object. + * @param rend_num the index of the renderer inside the renderer information object — a value between 0 and the number of renderers minus one. The number of renderers + * can be obtained by calling {@link #CGLDescribeRenderer DescribeRenderer}, passing in {@code rend}, renderer number 0, and the renderer property + * {@link #kCGLRPRendererCount RPRendererCount}. + * @param prop the renderer property whose value you want to obtain. One of:
{@link #kCGLRPOffScreen RPOffScreen}{@link #kCGLRPRendererID RPRendererID}{@link #kCGLRPAccelerated RPAccelerated}{@link #kCGLRPBackingStore RPBackingStore}{@link #kCGLRPWindow RPWindow}
{@link #kCGLRPCompliant RPCompliant}{@link #kCGLRPDisplayMask RPDisplayMask}{@link #kCGLRPBufferModes RPBufferModes}{@link #kCGLRPColorModes RPColorModes}{@link #kCGLRPAccumModes RPAccumModes}
{@link #kCGLRPDepthModes RPDepthModes}{@link #kCGLRPStencilModes RPStencilModes}{@link #kCGLRPMaxAuxBuffers RPMaxAuxBuffers}{@link #kCGLRPMaxSampleBuffers RPMaxSampleBuffers}{@link #kCGLRPMaxSamples RPMaxSamples}
{@link #kCGLRPSampleModes RPSampleModes}{@link #kCGLRPSampleAlpha RPSampleAlpha}{@link #kCGLRPVideoMemory RPVideoMemory}{@link #kCGLRPTextureMemory RPTextureMemory}{@link #kCGLRPGPUVertProcCapable RPGPUVertProcCapable}
{@link #kCGLRPGPUFragProcCapable RPGPUFragProcCapable}{@link #kCGLRPRendererCount RPRendererCount}{@link #kCGLRPOnline RPOnline}{@link #kCGLRPAcceleratedCompute RPAcceleratedCompute}{@link #kCGLRPVideoMemoryMegabytes RPVideoMemoryMegabytes}
{@link #kCGLRPTextureMemoryMegabytes RPTextureMemoryMegabytes}{@link #kCGLRPRobust RPRobust}{@link #kCGLRPMPSafe RPMPSafe}{@link #kCGLRPMultiScreen RPMultiScreen}{@link #kCGLRPFullScreen RPFullScreen}
+ * @param value on return, points to the value of the requested property + */ + @NativeType("CGLError") + public static int CGLDescribeRenderer(@NativeType("CGLRendererInfoObj") long rend, @NativeType("GLint") int rend_num, @NativeType("CGLRendererProperty") int prop, @NativeType("GLint *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + return nCGLDescribeRenderer(rend, rend_num, prop, memAddress(value)); + } + + // --- [ CGLCreateContext ] --- + + /** Unsafe version of: {@link #CGLCreateContext CreateContext} */ + public static int nCGLCreateContext(long pix, long share, long ctx) { + long __functionAddress = Functions.CreateContext; + if (CHECKS) { + check(pix); + } + return callPPPI(pix, share, ctx, __functionAddress); + } + + /** + * Creates a CGL rendering context. + * + * @param pix a pixel format object created by calling the function {@link #CGLChoosePixelFormat ChoosePixelFormat} + * @param share the rendering context with which to share the OpenGL object state — including texture objects, programs and shader display lists, vertex array + * objects, vertex buffer objects, pixel buffer objects, and frame buffer objects — and the object state associated which each of these object types. + * Pass {@code NULL} to indicate that no sharing is to take place. + * @param ctx the memory address of a context object. On return, points to a new context object with the buffers and attributes specified by the {@code pix} + * parameter. If the context can not be created as specified, the value of {@code ctx} is set to {@code NULL}. + */ + @NativeType("CGLError") + public static int CGLCreateContext(@NativeType("CGLPixelFormatObj") long pix, @NativeType("CGLContextObj") long share, @NativeType("CGLContextObj *") PointerBuffer ctx) { + if (CHECKS) { + check(ctx, 1); + } + return nCGLCreateContext(pix, share, memAddress(ctx)); + } + + // --- [ CGLDestroyContext ] --- + + /** + * Frees the resources associated with a rendering context. + * + *

Starting in Mac OS 10.5, CGL rendering contexts are reference counted. For compatibility reasons, calling CGLDestroyContext clears the drawable + * associated with the rendering context. Calling CGLDestroyContext is the equivalent of calling both {@link #CGLClearDrawable ClearDrawable} and + * {@link #CGLReleaseContext ReleaseContext}.

+ * + * @param ctx the rendering context to destroy + */ + @NativeType("CGLError") + public static int CGLDestroyContext(@NativeType("CGLContextObj") long ctx) { + long __functionAddress = Functions.DestroyContext; + if (CHECKS) { + check(ctx); + } + return callPI(ctx, __functionAddress); + } + + // --- [ CGLCopyContext ] --- + + /** + * Copies the specified state variables from one rendering context to another. + * + * @param src the source rendering context + * @param dst the destination rendering context + * @param mask a mask that specifies the state variables to copy. Pass a bit field that contains the bitwise OR of the state variable names that you want to copy. + * Use the symbolic mask constants that are passed to the OpenGL function {@link GL11#glPushAttrib PushAttrib}. To copy as many state variables + * as possible, supply the constant {@link GL11#GL_ALL_ATTRIB_BITS ALL_ATTRIB_BITS}. + */ + @NativeType("CGLError") + public static int CGLCopyContext(@NativeType("CGLContextObj") long src, @NativeType("CGLContextObj") long dst, @NativeType("GLbitfield") int mask) { + long __functionAddress = Functions.CopyContext; + if (CHECKS) { + check(src); + check(dst); + } + return callPPI(src, dst, mask, __functionAddress); + } + + // --- [ CGLRetainContext ] --- + + /** + * Increments the retain count on a CGL rendering context. + * + *

Each call to CGLRetainContext increases the retain count by 1. To prevent memory leaks, each retain call must be balanced with a call to + * {@link #CGLReleaseContext ReleaseContext}.

+ * + * @param ctx the rendering context to be retained + * + * @return the same context that was passed into the function. + */ + @NativeType("CGLContextObj") + public static long CGLRetainContext(@NativeType("CGLContextObj") long ctx) { + long __functionAddress = Functions.RetainContext; + if (CHECKS) { + check(ctx); + } + return callPP(ctx, __functionAddress); + } + + // --- [ CGLReleaseContext ] --- + + /** + * Decrements the retain count on a CGL rendering context. + * + *

Each call to CGLReleaseContext decreases the retain count by 1.

+ * + *

When the retain count reaches 0, all resources associated with the rendering context are freed. If the rendering context that you pass is the current + * rendering context and it is freed, the current context is set to {@code NULL} and there is no current rendering context after the function executes. After the + * context is freed, you must make sure you do not use the destroyed rendering context. This includes using CGL macros in which the rendering context is + * explicitly passed to OpenGL.

+ * + * @param ctx the rendering context to be released + */ + public static void CGLReleaseContext(@NativeType("CGLContextObj") long ctx) { + long __functionAddress = Functions.ReleaseContext; + if (CHECKS) { + check(ctx); + } + callPV(ctx, __functionAddress); + } + + // --- [ CGLGetContextRetainCount ] --- + + /** + * Returns the current retain count of a CGL rendering context. + * + * @param ctx the CGL rendering context whose retain count you wish to discover + */ + @NativeType("GLuint") + public static int CGLGetContextRetainCount(@NativeType("CGLContextObj") long ctx) { + long __functionAddress = Functions.GetContextRetainCount; + if (CHECKS) { + check(ctx); + } + return callPI(ctx, __functionAddress); + } + + // --- [ CGLGetPixelFormat ] --- + + /** + * Retrieves the current pixel format associated with a CGL rendering context. + * + *

The pixel format object is not retained before being returned to your application. If your application needs to maintain this object, it should call + * {@link #CGLRetainPixelFormat RetainPixelFormat}.

+ * + * @param ctx the CGL rendering context whose format you want to receive + */ + @NativeType("CGLPixelFormatObj") + public static long CGLGetPixelFormat(@NativeType("CGLContextObj") long ctx) { + long __functionAddress = Functions.GetPixelFormat; + if (CHECKS) { + check(ctx); + } + return callPP(ctx, __functionAddress); + } + + // --- [ CGLCreatePBuffer ] --- + + /** Unsafe version of: {@link #CGLCreatePBuffer CreatePBuffer} */ + public static int nCGLCreatePBuffer(int width, int height, int target, int internalFormat, int max_level, long pbuffer) { + long __functionAddress = Functions.CreatePBuffer; + return callPI(width, height, target, internalFormat, max_level, pbuffer, __functionAddress); + } + + /** + * Creates a pixel buffer of the specified size, compatible with the specified texture target. + * + *

This function does not have any knowledge of OpenGL contexts or pixel format objects and does not specifically allocate the storage needed for the + * actual pixel buffer. These operations occur when you call the function {@link #CGLSetPBuffer SetPBuffer}.

+ * + *

You can determine the dimensional limits of a pixel buffer by calling the OpenGL function glGetInteger. You can find the maximum size supported by + * querying GL_MAX_VIEWPORT_DIMS and the minimum size by querying GL_MIN_PBUFFER_VIEWPORT_DIMS_APPLE, which returns two integer values (similar to + * GL_MAX_VIEWPORT_DIMS). All pixel buffer dimensions that you request with the function aglCreatePBuffer should fall within these limits (inclusively) + * and should comply with any limitations imposed by the texture target you select.

+ * + *

The maximum viewport size supported in OS X is quite large. You should take into consideration the amount of video or system memory required to support + * the requested pixel buffer size, including additional memory needed for multiple buffers and options such as multisampling.

+ * + *

Starting in OS X v10.5, pixel buffer objects are reference counted. Pixel buffer objects are created with a reference count of 1 and are destroyed when + * the last reference to the object is released.

+ * + *

Deprecated in OS X v10.7.

+ * + * @param width the width, in pixels, of the pixel buffer + * @param height the height, in pixels, of the pixel buffer + * @param target a constant that specifies the type of the pixel buffer target texture. One of:
{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}
+ * @param internalFormat a constant that specifies the internal color format of the pixel buffer. The format controls whether the alpha channel of the pixel buffer is used + * for texturing operations. One of:
{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA}
+ * @param max_level the maximum level of mipmap detail allowable. Pass 0 for a pixel buffer that is not using mipmaps. The value passed should never exceed the actual + * maximum number of mipmap levels that can be represented with the given width and height. + * @param pbuffer on return, points to a new pixel buffer object + */ + @NativeType("CGLError") + public static int CGLCreatePBuffer(@NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int target, @NativeType("GLenum") int internalFormat, @NativeType("GLint") int max_level, @NativeType("CGLPBufferObj *") PointerBuffer pbuffer) { + if (CHECKS) { + check(pbuffer, 1); + } + return nCGLCreatePBuffer(width, height, target, internalFormat, max_level, memAddress(pbuffer)); + } + + // --- [ CGLDestroyPBuffer ] --- + + /** + * Releases the resources associated with a pixel buffer object. + * + *

Starting in OS X v10.5, pixel buffer objects are reference counted. Calling this function is equivalent to calling {@link #CGLReleasePBuffer ReleasePBuffer}.

+ * + *

Deprecated in OS X v10.7.

+ * + * @param pbuffer the pixel buffer object whose resources you want to release + */ + @NativeType("CGLError") + public static int CGLDestroyPBuffer(@NativeType("CGLPBufferObj") long pbuffer) { + long __functionAddress = Functions.DestroyPBuffer; + if (CHECKS) { + check(pbuffer); + } + return callPI(pbuffer, __functionAddress); + } + + // --- [ CGLDescribePBuffer ] --- + + /** Unsafe version of: {@link #CGLDescribePBuffer DescribePBuffer} */ + public static int nCGLDescribePBuffer(long obj, long width, long height, long target, long internalFormat, long mipmap) { + long __functionAddress = Functions.DescribePBuffer; + if (CHECKS) { + check(obj); + } + return callPPPPPPI(obj, width, height, target, internalFormat, mipmap, __functionAddress); + } + + /** + * Retrieves information that describes the specified pixel buffer object. + * + *

The width, height, texture target, and internal texture color format of a pixel buffer object are set at its creation and cannot be changed without + * destroying and recreating the object. The level is set when the pixel buffer object is attached to a rendering context by calling the function + * {@link #CGLSetPBuffer SetPBuffer}.

+ * + *

Deprecated in OS X v10.7.

+ * + * @param obj a pointer to the pixel buffer object + * @param width on return, points to the width, in pixels, of the pixel buffer + * @param height on return, points to the height, in pixels, of the pixel buffer + * @param target on return, points to a constant that specifies the pixel buffer texture target + * @param internalFormat on return, points to a constant that specifies the internal color format of the pixel buffer + * @param mipmap on return, points to the mipmap level of the pixel buffer or 0 if it doesn't use mipmaps + */ + @NativeType("CGLError") + public static int CGLDescribePBuffer(@NativeType("CGLPBufferObj") long obj, @NativeType("GLsizei *") IntBuffer width, @NativeType("GLsizei *") IntBuffer height, @NativeType("GLenum *") IntBuffer target, @NativeType("GLenum *") IntBuffer internalFormat, @NativeType("GLint *") IntBuffer mipmap) { + if (CHECKS) { + check(width, 1); + check(height, 1); + check(target, 1); + check(internalFormat, 1); + check(mipmap, 1); + } + return nCGLDescribePBuffer(obj, memAddress(width), memAddress(height), memAddress(target), memAddress(internalFormat), memAddress(mipmap)); + } + + // --- [ CGLTexImagePBuffer ] --- + + /** + * Binds the contents of a pixel buffer to a data source for a texture object. + * + *

You must generate and bind a texture name (using standard OpenGL texturing calls) that is compatible with the pixel buffer texture target. Don't supply + * a texture object that was used previously for nonpixel buffer texturing operations unless you first call glDeleteTextures to regenerate the texture + * name.

+ * + *

If you modify the content of a pixel buffer that uses mipmap levels, you must call this function again before drawing with the pixel buffer, to ensure + * that the content is synchronized with OpenGL. For pixel buffers without mipmaps, simply rebind to the texture object to synchronize content.

+ * + *

No OpenGL texturing calls that modify a pixel buffer texture content are permitted (such as glTexSubImage2D or glCopyTexImage2D) with the pixel buffer + * texture as the destination. It is permitted to use texturing commands to read data from a pixel buffer texture, such as glCopyTexImage2D, with the + * pixel buffer texture as the source. It is also legal to use OpenGL functions such as glReadPixels to read the contents of a pixel buffer directly + * through the pixel buffer context.

+ * + *

Note that texturing with the CGLTexImagePBuffer function can fail to produce the intended results without error in the same way other OpenGL texturing + * commands can normally fail. The function fails if you set an incompatible filter mode, do not enable the proper texture target, or other conditions + * described in the OpenGL specification.

+ * + *

You don't need to share a context to use a pixel buffer object as a texture source. You can use independent pixel format objects and OpenGL contexts + * for both the pixel buffer and the target drawable object without sharing resources, and still texture using a pixel buffer in the target context.

+ * + *

Deprecated in OS X v10.7.

+ * + * @param ctx a rendering context, which is the target context for the texture operation. This is the context that you plan to render content to. This is not the + * context attached to the pixel buffer. + * @param pbuffer a pixel buffer object + * @param source the source buffer to get the texture from, which should be a valid OpenGL buffer such as GL_FRONT or GL_BACK and should be compatible with the + * buffer and renderer attributes that you used to create the rendering context attached to the pixel buffer. This means that the pixel buffer must + * possess the buffer in question for the texturing operation to succeed. + */ + @NativeType("CGLError") + public static int CGLTexImagePBuffer(@NativeType("CGLContextObj") long ctx, @NativeType("CGLPBufferObj") long pbuffer, @NativeType("GLenum") int source) { + long __functionAddress = Functions.TexImagePBuffer; + if (CHECKS) { + check(ctx); + check(pbuffer); + } + return callPPI(ctx, pbuffer, source, __functionAddress); + } + + // --- [ CGLRetainPBuffer ] --- + + /** + * Increments the retain count on a pixel buffer object. + * + *

Each call to CGLRetainPBuffer increases the retain count by 1. To prevent the pixel buffer object from being leaked, each retain call must be matched + * with a call to {@link #CGLReleasePBuffer ReleasePBuffer}.

+ * + *

Deprecated in OS X v10.7.

+ * + * @param pbuffer the pixel buffer object whose retain count you wish to increment + */ + @NativeType("CGLPBufferObj") + public static long CGLRetainPBuffer(@NativeType("CGLPBufferObj") long pbuffer) { + long __functionAddress = Functions.RetainPBuffer; + if (CHECKS) { + check(pbuffer); + } + return callPP(pbuffer, __functionAddress); + } + + // --- [ CGLReleasePBuffer ] --- + + /** + * Releases the resources associated with a pixel buffer object. + * + *

Starting in OS X v10.5, pixel buffer objects are reference counted. Calling this function is equivalent to calling CGLReleasePBuffer.

+ * + *

Deprecated in OS X v10.7.

+ * + * @param pbuffer the pixel buffer object whose resources you want to release + */ + public static void CGLReleasePBuffer(@NativeType("CGLPBufferObj") long pbuffer) { + long __functionAddress = Functions.ReleasePBuffer; + if (CHECKS) { + check(pbuffer); + } + callPV(pbuffer, __functionAddress); + } + + // --- [ CGLGetPBufferRetainCount ] --- + + /** + * Returns the retain count of a pixel buffer object. + * + *

Deprecated in OS X v10.7.

+ * + * @param pbuffer the pixel buffer object whose retain count you wish to retrieve + */ + @NativeType("GLuint") + public static int CGLGetPBufferRetainCount(@NativeType("CGLPBufferObj") long pbuffer) { + long __functionAddress = Functions.GetPBufferRetainCount; + if (CHECKS) { + check(pbuffer); + } + return callPI(pbuffer, __functionAddress); + } + + // --- [ CGLSetOffScreen ] --- + + /** Unsafe version of: {@link #CGLSetOffScreen SetOffScreen} */ + public static int nCGLSetOffScreen(long ctx, int width, int height, int rowbytes, long baseaddr) { + long __functionAddress = Functions.SetOffScreen; + if (CHECKS) { + check(ctx); + } + return callPPI(ctx, width, height, rowbytes, baseaddr, __functionAddress); + } + + /** + * Attaches a rendering context to an offscreen buffer. + * + *

Before calling this function, you must set up the rendering context using a pixel format object created with the kCGLPFAOffScreen attribute. For more + * information about kCGLPFAOffScreen, see Buffer and Renderer Attributes.

+ * + *

After calling this function, subsequent OpenGL drawing is rendered into the offscreen buffer and the viewport of the rendering context is set to the + * full size of the offscreen area.

+ * + *

To exit offscreen mode, call {@link #CGLClearDrawable ClearDrawable}.

+ * + *

To obtain functionality similar to offscreen mode on renderers that do not support it, attach the context to a hidden window and use the OpenGL + * function glReadPixels.

+ * + *

Deprecated in OS X v10.7.

+ * + * @param ctx a rendering context + * @param width the width, in pixels, of the offscreen buffer + * @param height the height, in pixels, of the offscreen buffer + * @param rowbytes the number of bytes per row of the offscreen buffer, which must be greater than or equal to width times bytes per pixel + * @param baseaddr a pointer to a block of memory to use as the offscreen buffer. The size of the memory must be at least {@code rowbytes*height} bytes. + */ + @NativeType("CGLError") + public static int CGLSetOffScreen(@NativeType("CGLContextObj") long ctx, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int rowbytes, @NativeType("void *") ByteBuffer baseaddr) { + if (CHECKS) { + check(baseaddr, rowbytes * height); + } + return nCGLSetOffScreen(ctx, width, height, rowbytes, memAddress(baseaddr)); + } + + // --- [ CGLGetOffScreen ] --- + + /** Unsafe version of: {@link #CGLGetOffScreen GetOffScreen} */ + public static int nCGLGetOffScreen(long ctx, long width, long height, long rowbytes, long baseaddr) { + long __functionAddress = Functions.GetOffScreen; + if (CHECKS) { + check(ctx); + } + return callPPPPPI(ctx, width, height, rowbytes, baseaddr, __functionAddress); + } + + /** + * Retrieves an offscreen buffer and its parameters for a specified rendering context. + * + *

Deprecated in OS X v10.7.

+ * + * @param ctx a rendering context + * @param width on return, points to the width, in pixels, of the offscreen buffer. If the rendering context is not attached to an offscreen drawable object, the + * value of width is set to 0. + * @param height on return, points to the height, in pixels, of the offscreen buffer. If the rendering context is not attached to an offscreen drawable object, the + * value of height is set to 0. + * @param rowbytes on return, points to the number of bytes per row of the offscreen buffer. If the context is not attached to an offscreen drawable object, the value + * of rowbytes is set to 0. + * @param baseaddr on return, points to the base address of the offscreen buffer. If the context is not attached to an offscreen drawable object, the value of + * {@code baseaddr} is set to {@code NULL}. + */ + @NativeType("CGLError") + public static int CGLGetOffScreen(@NativeType("CGLContextObj") long ctx, @NativeType("GLsizei *") IntBuffer width, @NativeType("GLsizei *") IntBuffer height, @NativeType("GLint *") IntBuffer rowbytes, @NativeType("void **") PointerBuffer baseaddr) { + if (CHECKS) { + check(width, 1); + check(height, 1); + check(rowbytes, 1); + check(baseaddr, 1); + } + return nCGLGetOffScreen(ctx, memAddress(width), memAddress(height), memAddress(rowbytes), memAddress(baseaddr)); + } + + // --- [ CGLSetFullScreen ] --- + + /** + * Attaches a rendering context to its full-screen drawable object. + * + *

Before calling this function, you must set up the rendering context using a pixel format object created with the kCGLPFAFullScreen attribute (see + * Buffer and Renderer Attributes). Some OpenGL renderers, such as the software renderer, do not support full-screen mode. After you call the function + * {@link #CGLChoosePixelFormat ChoosePixelFormat} with the full-screen attribute, you need to check whether the pixel format object is created successfully.

+ * + *

You must capture the display prior to entering full-screen mode and release it after exiting. After calling this function, subsequent OpenGL drawing is + * rendered into the entire screen. For more information, see OpenGL Programming Guide for Mac.

+ * + *

To exit full-screen mode, call {@link #CGLClearDrawable ClearDrawable}.

+ * + *

Deprecated in OS X v10.7. Use {@link #CGLSetFullScreenOnDisplay SetFullScreenOnDisplay} instead.

+ * + * @param ctx a rendering context + */ + @NativeType("CGLError") + public static int CGLSetFullScreen(@NativeType("CGLContextObj") long ctx) { + long __functionAddress = Functions.SetFullScreen; + if (CHECKS) { + check(ctx); + } + return callPI(ctx, __functionAddress); + } + + // --- [ CGLSetFullScreenOnDisplay ] --- + + /** + * Attaches a rendering context to a full-screen drawable object." + + * + *

This function obtains a drawable object that covers an entire screen and attaches it to the rendering context. A full-screen rendering context may + * allow the underlying renderer to provide better performance compared to a context associated with a window that partially covers the screen.

+ * + *

Prior to calling this function, your application should ensure that the context is capable of rendering to this display by querying the appropriate + * renderer properties. For more information, see {@link #CGLQueryRendererInfo QueryRendererInfo}. Note that some renderers, including the software renderer, do not support + * full-screen mode.

+ * + *

You must capture the screen prior to entering full-screen mode and release it after exiting. After calling this function, subsequent OpenGL drawing is + * rendered into the entire screen. For more information, see OpenGL Programming Guide for Mac.

+ * + *

To exit full-screen mode, call {@link #CGLClearDrawable ClearDrawable}.

+ * + *

In OS X v10.6 or later, this function is not deprecated, but is usually not necessary. If your application creates a window that completely covers the + * screen, the system implicitly creates a full-screen instance, for the same potential performance benefit.

+ * + *

Deprecated in OS X v10.7.

+ * + * @param ctx a rendering context + * @param display_mask a bit field that contains the OpenGL display mask for the screen you wish the context to cover + */ + @NativeType("CGLError") + public static int CGLSetFullScreenOnDisplay(@NativeType("CGLContextObj") long ctx, @NativeType("GLuint") int display_mask) { + long __functionAddress = Functions.SetFullScreenOnDisplay; + if (CHECKS) { + check(ctx); + } + return callPI(ctx, display_mask, __functionAddress); + } + + // --- [ CGLSetPBuffer ] --- + + /** + * Attaches a pixel buffer object to a rendering context. + * + *

The first time you call this function for a specific pixel buffer object, the system creates the necessary buffers. The buffers are created to support + * the attributes dictated by the pixel format object used to create the rendering context and by the parameters used to create the pixel buffer object. + * The storage requirements for pixel buffer objects, which can be quite large, are very similar to the requirements for windows or views with OpenGL + * contexts attached. All drawable objects compete for the same scarce resources. This function can fail is there is not enough contiguous VRAM for each + * buffer. It's best to code defensively with a scheme that reduces resource consumption without causing the application to resort to failure. Unless, of + * course, failure is the only viable alternative.

+ * + *

The ability to attach a pixel buffer to a context is supported only on renderers that export GL_APPLE_pixel_buffer in the GL_EXTENSIONS string. Before + * calling this function, you should programmatically determine if it’s possible to attach a pixel buffer to a context by querying GL_EXTENSIONS in the + * context and looking for GL_APPLE_pixel_buffer. If that extension is not present, the renderer won’t allow setting the pixel buffer.

+ * + *

In order of performance, these are the renderers you should consider using when setting up a rendering context to attach to a pixel buffer:

+ * + *
    + *
  • A hardware renderer.
  • + *
  • The generic render, but only with an offscreen pixel format and glTexSubImage.
  • + *
  • The Apple software renderer, which supports pixel buffers in OS X v10.4.8 and later.
  • + *
+ * + *

Deprecated in OS X v10.7.

+ * + * @param ctx the rendering context to attach the pixel buffer to + * @param pbuffer a pixel buffer object + * @param face the cube map face to draw if the pixel buffer texture target type is {@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}; otherwise pass 0. + * @param level the mipmap level to draw. This must not exceed the maximum mipmap level set when the pixel buffer object was created. Pass 0 for a texture target + * that does not support mipmaps. + * @param screen a virtual screen value. The virtual screen determines the renderer OpenGL uses to draw to the pixel buffer object. For best performance, for a + * pixel buffer used as a texture source, you should supply the virtual screen value that results in using the same renderer used by the context + * that's the texturing target. + */ + @NativeType("CGLError") + public static int CGLSetPBuffer(@NativeType("CGLContextObj") long ctx, @NativeType("CGLPBufferObj") long pbuffer, @NativeType("GLenum") int face, @NativeType("GLint") int level, @NativeType("GLint") int screen) { + long __functionAddress = Functions.SetPBuffer; + if (CHECKS) { + check(ctx); + check(pbuffer); + } + return callPPI(ctx, pbuffer, face, level, screen, __functionAddress); + } + + // --- [ CGLGetPBuffer ] --- + + /** Unsafe version of: {@link #CGLGetPBuffer GetPBuffer} */ + public static int nCGLGetPBuffer(long ctx, long pbuffer, long face, long level, long screen) { + long __functionAddress = Functions.GetPBuffer; + if (CHECKS) { + check(ctx); + } + return callPPPPPI(ctx, pbuffer, face, level, screen, __functionAddress); + } + + /** + * Retrieves a pixel buffer and its parameters for a specified rendering context. + * + *

Deprecated in OS X v10.7.

+ * + * @param ctx a rendering context + * @param pbuffer on return, points to the pixel buffer object attached to the rendering context + * @param face on return, points to the cube map face that is set if the pixel buffer texture target type is {@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}; otherwise 0 for all other + * texture target types. + * @param level on return, points to the current mipmap level for drawing + * @param screen on return, points to the current virtual screen number, as set by the last valid call to {@link #CGLSetPBuffer SetPBuffer} + */ + @NativeType("CGLError") + public static int CGLGetPBuffer(@NativeType("CGLContextObj") long ctx, @NativeType("CGLPBufferObj *") PointerBuffer pbuffer, @NativeType("GLenum *") IntBuffer face, @NativeType("GLint *") IntBuffer level, @NativeType("GLint *") IntBuffer screen) { + if (CHECKS) { + check(pbuffer, 1); + check(face, 1); + check(level, 1); + check(screen, 1); + } + return nCGLGetPBuffer(ctx, memAddress(pbuffer), memAddress(face), memAddress(level), memAddress(screen)); + } + + // --- [ CGLClearDrawable ] --- + + /** + * Disassociates a rendering context from any drawable objects attached to it. + * + * @param ctx a rendering context + */ + @NativeType("CGLError") + public static int CGLClearDrawable(@NativeType("CGLContextObj") long ctx) { + long __functionAddress = Functions.ClearDrawable; + if (CHECKS) { + check(ctx); + } + return callPI(ctx, __functionAddress); + } + + // --- [ CGLFlushDrawable ] --- + + /** + * Copies the back buffer of a double-buffered context to the front buffer. + * + *

To create a double-buffered context, specify the {@link #kCGLPFADoubleBuffer PFADoubleBuffer} attribute when you create the pixel format object for the rendering + * context. If the backing store attribute is set to false, the buffers can be exchanged rather than copied. This is often the case in full-screen mode. If + * the receiver is not a double-buffered context, this call does nothing.

+ * + *

If you set the swap interval attribute ({@link #kCGLCPSwapInterval CPSwapInterval}) appropriately, the copy takes place during the vertical retrace of the display, + * rather than immediately after CGLFlushDrawable is called. An implicit {@link GL11C#glFlush Flush} operation is performed by CGLFlushDrawable + * before it returns. For optimal performance, an application should not call glFlush immediately before calling CGLFlushDrawable. Subsequent OpenGL + * commands can be issued immediately after calling CGLFlushDrawable, but are not executed until the buffer copy is completed.

+ * + * @param ctx the context object + */ + @NativeType("CGLError") + public static int CGLFlushDrawable(@NativeType("CGLContextObj") long ctx) { + long __functionAddress = Functions.FlushDrawable; + if (CHECKS) { + check(ctx); + } + return callPI(ctx, __functionAddress); + } + + // --- [ CGLEnable ] --- + + /** + * Enables an option for a rendering context. + * + * @param ctx a rendering context + * @param pname the option to enable. One of:
{@link #kCGLCESwapRectangle CESwapRectangle}{@link #kCGLCESwapLimit CESwapLimit}{@link #kCGLCERasterization CERasterization}{@link #kCGLCEStateValidation CEStateValidation}{@link #kCGLCESurfaceBackingSize CESurfaceBackingSize}
{@link #kCGLCEDisplayListOptimization CEDisplayListOptimization}{@link #kCGLCEMPEngine CEMPEngine}
+ */ + @NativeType("CGLError") + public static int CGLEnable(@NativeType("CGLContextObj") long ctx, @NativeType("CGLContextEnable") int pname) { + long __functionAddress = Functions.Enable; + if (CHECKS) { + check(ctx); + } + return callPI(ctx, pname, __functionAddress); + } + + // --- [ CGLDisable ] --- + + /** + * Disables an option for a rendering context. + * + * @param ctx a rendering context + * @param pname the option to disable. One of:
{@link #kCGLCESwapRectangle CESwapRectangle}{@link #kCGLCESwapLimit CESwapLimit}{@link #kCGLCERasterization CERasterization}{@link #kCGLCEStateValidation CEStateValidation}{@link #kCGLCESurfaceBackingSize CESurfaceBackingSize}
{@link #kCGLCEDisplayListOptimization CEDisplayListOptimization}{@link #kCGLCEMPEngine CEMPEngine}
+ */ + @NativeType("CGLError") + public static int CGLDisable(@NativeType("CGLContextObj") long ctx, @NativeType("CGLContextEnable") int pname) { + long __functionAddress = Functions.Disable; + if (CHECKS) { + check(ctx); + } + return callPI(ctx, pname, __functionAddress); + } + + // --- [ CGLIsEnabled ] --- + + /** Unsafe version of: {@link #CGLIsEnabled IsEnabled} */ + public static int nCGLIsEnabled(long ctx, int pname, long enable) { + long __functionAddress = Functions.IsEnabled; + if (CHECKS) { + check(ctx); + } + return callPPI(ctx, pname, enable, __functionAddress); + } + + /** + * Reports whether an option is enabled for a rendering context. + * + * @param ctx a rendering context + * @param pname the option to query. One of:
{@link #kCGLCESwapRectangle CESwapRectangle}{@link #kCGLCESwapLimit CESwapLimit}{@link #kCGLCERasterization CERasterization}{@link #kCGLCEStateValidation CEStateValidation}{@link #kCGLCESurfaceBackingSize CESurfaceBackingSize}
{@link #kCGLCEDisplayListOptimization CEDisplayListOptimization}{@link #kCGLCEMPEngine CEMPEngine}
+ * @param enable on return, enable is set to true if the option is enabled + */ + @NativeType("CGLError") + public static int CGLIsEnabled(@NativeType("CGLContextObj") long ctx, @NativeType("CGLContextEnable") int pname, @NativeType("GLint *") IntBuffer enable) { + if (CHECKS) { + check(enable, 1); + } + return nCGLIsEnabled(ctx, pname, memAddress(enable)); + } + + // --- [ CGLSetParameter ] --- + + /** Unsafe version of: {@link #CGLSetParameter SetParameter} */ + public static int nCGLSetParameter(long ctx, int pname, long params) { + long __functionAddress = Functions.SetParameter; + if (CHECKS) { + check(ctx); + } + return callPPI(ctx, pname, params, __functionAddress); + } + + /** + * Sets the value of a rendering context parameter. + * + * @param ctx a rendering context + * @param pname the parameter whose value you want to set. One of:
{@link #kCGLCPSwapRectangle CPSwapRectangle}{@link #kCGLCPSwapInterval CPSwapInterval}{@link #kCGLCPDispatchTableSize CPDispatchTableSize}{@link #kCGLCPClientStorage CPClientStorage}
{@link #kCGLCPSurfaceTexture CPSurfaceTexture}{@link #kCGLCPSurfaceOrder CPSurfaceOrder}{@link #kCGLCPSurfaceOpacity CPSurfaceOpacity}{@link #kCGLCPSurfaceBackingSize CPSurfaceBackingSize}
{@link #kCGLCPSurfaceSurfaceVolatile CPSurfaceSurfaceVolatile}{@link #kCGLCPReclaimResources CPReclaimResources}{@link #kCGLCPCurrentRendererID CPCurrentRendererID}{@link #kCGLCPGPUVertexProcessing CPGPUVertexProcessing}
{@link #kCGLCPGPUFragmentProcessing CPGPUFragmentProcessing}{@link #kCGLCPHasDrawable CPHasDrawable}{@link #kCGLCPMPSwapsInFlight CPMPSwapsInFlight}
+ * @param params a pointer to the value to set the parameter to + */ + @NativeType("CGLError") + public static int CGLSetParameter(@NativeType("CGLContextObj") long ctx, @NativeType("CGLContextParameter") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + return nCGLSetParameter(ctx, pname, memAddress(params)); + } + + /** + * Sets the value of a rendering context parameter. + * + * @param ctx a rendering context + * @param pname the parameter whose value you want to set. One of:
{@link #kCGLCPSwapRectangle CPSwapRectangle}{@link #kCGLCPSwapInterval CPSwapInterval}{@link #kCGLCPDispatchTableSize CPDispatchTableSize}{@link #kCGLCPClientStorage CPClientStorage}
{@link #kCGLCPSurfaceTexture CPSurfaceTexture}{@link #kCGLCPSurfaceOrder CPSurfaceOrder}{@link #kCGLCPSurfaceOpacity CPSurfaceOpacity}{@link #kCGLCPSurfaceBackingSize CPSurfaceBackingSize}
{@link #kCGLCPSurfaceSurfaceVolatile CPSurfaceSurfaceVolatile}{@link #kCGLCPReclaimResources CPReclaimResources}{@link #kCGLCPCurrentRendererID CPCurrentRendererID}{@link #kCGLCPGPUVertexProcessing CPGPUVertexProcessing}
{@link #kCGLCPGPUFragmentProcessing CPGPUFragmentProcessing}{@link #kCGLCPHasDrawable CPHasDrawable}{@link #kCGLCPMPSwapsInFlight CPMPSwapsInFlight}
+ */ + @NativeType("CGLError") + public static int CGLSetParameter(@NativeType("CGLContextObj") long ctx, @NativeType("CGLContextParameter") int pname, @NativeType("GLint const *") int param) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.ints(param); + return nCGLSetParameter(ctx, pname, memAddress(params)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ CGLGetParameter ] --- + + /** Unsafe version of: {@link #CGLGetParameter GetParameter} */ + public static int nCGLGetParameter(long ctx, int pname, long params) { + long __functionAddress = Functions.GetParameter; + if (CHECKS) { + check(ctx); + } + return callPPI(ctx, pname, params, __functionAddress); + } + + /** + * Retrieves the value of a rendering context parameter. + * + * @param ctx a rendering context + * @param pname the parameter whose value you want to retrieve. One of:
{@link #kCGLCPSwapRectangle CPSwapRectangle}{@link #kCGLCPSwapInterval CPSwapInterval}{@link #kCGLCPDispatchTableSize CPDispatchTableSize}{@link #kCGLCPClientStorage CPClientStorage}
{@link #kCGLCPSurfaceTexture CPSurfaceTexture}{@link #kCGLCPSurfaceOrder CPSurfaceOrder}{@link #kCGLCPSurfaceOpacity CPSurfaceOpacity}{@link #kCGLCPSurfaceBackingSize CPSurfaceBackingSize}
{@link #kCGLCPSurfaceSurfaceVolatile CPSurfaceSurfaceVolatile}{@link #kCGLCPReclaimResources CPReclaimResources}{@link #kCGLCPCurrentRendererID CPCurrentRendererID}{@link #kCGLCPGPUVertexProcessing CPGPUVertexProcessing}
{@link #kCGLCPGPUFragmentProcessing CPGPUFragmentProcessing}{@link #kCGLCPHasDrawable CPHasDrawable}{@link #kCGLCPMPSwapsInFlight CPMPSwapsInFlight}
+ * @param params on return, points to the value of the parameter + */ + @NativeType("CGLError") + public static int CGLGetParameter(@NativeType("CGLContextObj") long ctx, @NativeType("CGLContextParameter") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + return nCGLGetParameter(ctx, pname, memAddress(params)); + } + + // --- [ CGLSetVirtualScreen ] --- + + /** + * Forces subsequent OpenGL commands to the specified virtual screen. + * + *

Setting the virtual screen forces the renderer associated with the virtual screen to process OpenGL commands issued to the specified context. Changing + * the virtual screen changes the current renderer. You should use this function only when it is necessary to override the default behavior. The current + * virtual screen is normally set automatically. Because the current virtual screen determines which OpenGL renderer is processing commands, the return + * values of all glGetXXX functions can be affected by the current virtual screen.

+ * + * @param ctx a rendering context + * @param screen a virtual screen number, which must be a value between 0 and the number of virtual screens minus one. The number of virtual screens available in a + * context can be obtained by calling the function {@link #CGLDescribePixelFormat DescribePixelFormat}, passing in the pixel format object used to create the rendering + * context, 0 for the virtual screen number ({@code pix_num} parameter), and the attribute constant {@link #kCGLPFAVirtualScreenCount PFAVirtualScreenCount}. + */ + @NativeType("CGLError") + public static int CGLSetVirtualScreen(@NativeType("CGLContextObj") long ctx, @NativeType("GLint") int screen) { + long __functionAddress = Functions.SetVirtualScreen; + if (CHECKS) { + check(ctx); + } + return callPI(ctx, screen, __functionAddress); + } + + // --- [ CGLGetVirtualScreen ] --- + + /** Unsafe version of: {@link #CGLGetVirtualScreen GetVirtualScreen} */ + public static int nCGLGetVirtualScreen(long ctx, long screen) { + long __functionAddress = Functions.GetVirtualScreen; + if (CHECKS) { + check(ctx); + } + return callPPI(ctx, screen, __functionAddress); + } + + /** + * Gets the current virtual screen number associated with a rendering context. + * + *

The current virtual screen can change when a drawable object is moved or resized across graphics device boundaries. A change in the current virtual + * screen can affect the return values of some OpenGL functions and in most cases also means that the renderer has changed.

+ * + * @param ctx a rendering context + * @param screen on return, points to the virtual screen associated with the context. The value is always 0 on a single-display system and –1 if the function fails + * for any reason. + */ + @NativeType("CGLError") + public static int CGLGetVirtualScreen(@NativeType("CGLContextObj") long ctx, @NativeType("GLint *") IntBuffer screen) { + if (CHECKS) { + check(screen, 1); + } + return nCGLGetVirtualScreen(ctx, memAddress(screen)); + } + + // --- [ CGLUpdateContext ] --- + + /** + * Synchronizes new renderer state to that of the application context + * + * @param ctx a rendering context + */ + @NativeType("CGLError") + public static int CGLUpdateContext(@NativeType("CGLContextObj") long ctx) { + long __functionAddress = Functions.UpdateContext; + if (CHECKS) { + check(ctx); + } + return callPI(ctx, __functionAddress); + } + + // --- [ CGLSetGlobalOption ] --- + + /** Unsafe version of: {@link #CGLSetGlobalOption SetGlobalOption} */ + public static int nCGLSetGlobalOption(int pname, long params) { + long __functionAddress = Functions.SetGlobalOption; + return callPI(pname, params, __functionAddress); + } + + /** + * Sets the value of a global option. + * + * @param pname the name of the option whose value you want to set. One of:
{@link #kCGLGOFormatCacheSize GOFormatCacheSize}{@link #kCGLGOClearFormatCache GOClearFormatCache}{@link #kCGLGORetainRenderers GORetainRenderers}{@link #kCGLGOResetLibrary GOResetLibrary}{@link #kCGLGOUseErrorHandler GOUseErrorHandler}
{@link #kCGLGOUseBuildCache GOUseBuildCache}
+ * @param params the value to set the option to + */ + @NativeType("CGLError") + public static int CGLSetGlobalOption(@NativeType("CGLGlobalOption") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + return nCGLSetGlobalOption(pname, memAddress(params)); + } + + /** + * Sets the value of a global option. + * + * @param pname the name of the option whose value you want to set. One of:
{@link #kCGLGOFormatCacheSize GOFormatCacheSize}{@link #kCGLGOClearFormatCache GOClearFormatCache}{@link #kCGLGORetainRenderers GORetainRenderers}{@link #kCGLGOResetLibrary GOResetLibrary}{@link #kCGLGOUseErrorHandler GOUseErrorHandler}
{@link #kCGLGOUseBuildCache GOUseBuildCache}
+ */ + @NativeType("CGLError") + public static int CGLSetGlobalOption(@NativeType("CGLGlobalOption") int pname, @NativeType("GLint const *") int param) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.ints(param); + return nCGLSetGlobalOption(pname, memAddress(params)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ CGLGetGlobalOption ] --- + + /** Unsafe version of: {@link #CGLGetGlobalOption GetGlobalOption} */ + public static int nCGLGetGlobalOption(int pname, long params) { + long __functionAddress = Functions.GetGlobalOption; + return callPI(pname, params, __functionAddress); + } + + /** + * Retrieves the value of a global option. + * + * @param pname the name of the option whose value you want to get. One of:
{@link #kCGLGOFormatCacheSize GOFormatCacheSize}{@link #kCGLGOClearFormatCache GOClearFormatCache}{@link #kCGLGORetainRenderers GORetainRenderers}{@link #kCGLGOResetLibrary GOResetLibrary}{@link #kCGLGOUseErrorHandler GOUseErrorHandler}
{@link #kCGLGOUseBuildCache GOUseBuildCache}
+ * @param params on return, a pointer to the value of the option + */ + @NativeType("CGLError") + public static int CGLGetGlobalOption(@NativeType("CGLGlobalOption") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + return nCGLGetGlobalOption(pname, memAddress(params)); + } + + // --- [ CGLLockContext ] --- + + /** + * Locks a CGL rendering context. + * + *

The function CGLLockContext blocks the thread it is on until all other threads have unlocked the same context using the function + * {@link #CGLUnlockContext UnlockContext}. You can use CGLLockContext recursively. Context-specific CGL calls by themselves do not require locking, but you can + * guarantee serial processing for a group of calls by surrounding them with CGLLockContext and CGLUnlockContext. Keep in mind that calls from the OpenGL + * API (the API provided by the Architecture Review Board) require locking.

+ * + *

Applications that use NSOpenGL classes with multithreading can lock contexts using the functions CGLLockContext and CGLUnlockContext. To perform + * rendering in a thread other than the main one, you can lock the context that you want to access and safely execute OpenGL commands. The locking calls + * must be placed around all OpenGL calls in all threads.

+ * + * @param context a rendering context + */ + @NativeType("CGLError") + public static int CGLLockContext(@NativeType("CGLContextObj") long context) { + long __functionAddress = Functions.LockContext; + if (CHECKS) { + check(context); + } + return callPI(context, __functionAddress); + } + + // --- [ CGLUnlockContext ] --- + + /** + * Unlocks a CGL rendering context. + * + * @param context the CGL context to unlock + */ + @NativeType("CGLError") + public static int CGLUnlockContext(@NativeType("CGLContextObj") long context) { + long __functionAddress = Functions.UnlockContext; + if (CHECKS) { + check(context); + } + return callPI(context, __functionAddress); + } + + // --- [ CGLGetVersion ] --- + + /** Unsafe version of: {@link #CGLGetVersion GetVersion} */ + public static void nCGLGetVersion(long majorvers, long minorvers) { + long __functionAddress = Functions.GetVersion; + callPPV(majorvers, minorvers, __functionAddress); + } + + /** + * Gets the major and minor version numbers of the CGL library. + * + * @param majorvers on return, points to the major version number of the CGL library + * @param minorvers on return, points to the minor version number of the CGL library + */ + public static void CGLGetVersion(@NativeType("GLint *") IntBuffer majorvers, @NativeType("GLint *") IntBuffer minorvers) { + if (CHECKS) { + check(majorvers, 1); + check(minorvers, 1); + } + nCGLGetVersion(memAddress(majorvers), memAddress(minorvers)); + } + + // --- [ CGLErrorString ] --- + + /** Unsafe version of: {@link #CGLErrorString ErrorString} */ + public static long nCGLErrorString(int error) { + long __functionAddress = Functions.ErrorString; + return callP(error, __functionAddress); + } + + /** + * Returns a string that describes the specified result code. + * + * @param error the CGL result code constant returned from a CGL function. One of:
{@link #kCGLNoError NoError}{@link #kCGLBadAttribute BadAttribute}{@link #kCGLBadProperty BadProperty}{@link #kCGLBadPixelFormat BadPixelFormat}{@link #kCGLBadRendererInfo BadRendererInfo}{@link #kCGLBadContext BadContext}{@link #kCGLBadDrawable BadDrawable}
{@link #kCGLBadDisplay BadDisplay}{@link #kCGLBadState BadState}{@link #kCGLBadValue BadValue}{@link #kCGLBadMatch BadMatch}{@link #kCGLBadEnumeration BadEnumeration}{@link #kCGLBadOffScreen BadOffScreen}{@link #kCGLBadFullScreen BadFullScreen}
{@link #kCGLBadWindow BadWindow}{@link #kCGLBadAddress BadAddress}{@link #kCGLBadCodeModule BadCodeModule}{@link #kCGLBadAlloc BadAlloc}{@link #kCGLBadConnection BadConnection}
+ */ + @Nullable + @NativeType("char const *") + public static String CGLErrorString(@NativeType("CGLError") int error) { + long __result = nCGLErrorString(error); + return memASCIISafe(__result); + } + + /** Array version of: {@link #CGLChoosePixelFormat ChoosePixelFormat} */ + @NativeType("CGLError") + public static int CGLChoosePixelFormat(@NativeType("CGLPixelFormatAttribute const *") int[] attribs, @NativeType("CGLPixelFormatObj *") PointerBuffer pix, @NativeType("GLint *") int[] npix) { + long __functionAddress = Functions.ChoosePixelFormat; + if (CHECKS) { + checkNT(attribs); + check(pix, 1); + check(npix, 1); + } + return callPPPI(attribs, memAddress(pix), npix, __functionAddress); + } + + /** Array version of: {@link #CGLDescribePixelFormat DescribePixelFormat} */ + @NativeType("CGLError") + public static int CGLDescribePixelFormat(@NativeType("CGLPixelFormatObj") long pix, @NativeType("GLint") int pix_num, @NativeType("CGLPixelFormatAttribute") int attrib, @NativeType("GLint *") int[] value) { + long __functionAddress = Functions.DescribePixelFormat; + if (CHECKS) { + check(pix); + check(value, 1); + } + return callPPI(pix, pix_num, attrib, value, __functionAddress); + } + + /** Array version of: {@link #CGLQueryRendererInfo QueryRendererInfo} */ + @NativeType("CGLError") + public static int CGLQueryRendererInfo(@NativeType("GLuint") int display_mask, @NativeType("CGLRendererInfoObj *") PointerBuffer rend, @NativeType("GLint *") int[] nrend) { + long __functionAddress = Functions.QueryRendererInfo; + if (CHECKS) { + check(rend, 1); + check(nrend, 1); + } + return callPPI(display_mask, memAddress(rend), nrend, __functionAddress); + } + + /** Array version of: {@link #CGLDescribeRenderer DescribeRenderer} */ + @NativeType("CGLError") + public static int CGLDescribeRenderer(@NativeType("CGLRendererInfoObj") long rend, @NativeType("GLint") int rend_num, @NativeType("CGLRendererProperty") int prop, @NativeType("GLint *") int[] value) { + long __functionAddress = Functions.DescribeRenderer; + if (CHECKS) { + check(rend); + check(value, 1); + } + return callPPI(rend, rend_num, prop, value, __functionAddress); + } + + /** Array version of: {@link #CGLDescribePBuffer DescribePBuffer} */ + @NativeType("CGLError") + public static int CGLDescribePBuffer(@NativeType("CGLPBufferObj") long obj, @NativeType("GLsizei *") int[] width, @NativeType("GLsizei *") int[] height, @NativeType("GLenum *") int[] target, @NativeType("GLenum *") int[] internalFormat, @NativeType("GLint *") int[] mipmap) { + long __functionAddress = Functions.DescribePBuffer; + if (CHECKS) { + check(obj); + check(width, 1); + check(height, 1); + check(target, 1); + check(internalFormat, 1); + check(mipmap, 1); + } + return callPPPPPPI(obj, width, height, target, internalFormat, mipmap, __functionAddress); + } + + /** Array version of: {@link #CGLGetOffScreen GetOffScreen} */ + @NativeType("CGLError") + public static int CGLGetOffScreen(@NativeType("CGLContextObj") long ctx, @NativeType("GLsizei *") int[] width, @NativeType("GLsizei *") int[] height, @NativeType("GLint *") int[] rowbytes, @NativeType("void **") PointerBuffer baseaddr) { + long __functionAddress = Functions.GetOffScreen; + if (CHECKS) { + check(ctx); + check(width, 1); + check(height, 1); + check(rowbytes, 1); + check(baseaddr, 1); + } + return callPPPPPI(ctx, width, height, rowbytes, memAddress(baseaddr), __functionAddress); + } + + /** Array version of: {@link #CGLGetPBuffer GetPBuffer} */ + @NativeType("CGLError") + public static int CGLGetPBuffer(@NativeType("CGLContextObj") long ctx, @NativeType("CGLPBufferObj *") PointerBuffer pbuffer, @NativeType("GLenum *") int[] face, @NativeType("GLint *") int[] level, @NativeType("GLint *") int[] screen) { + long __functionAddress = Functions.GetPBuffer; + if (CHECKS) { + check(ctx); + check(pbuffer, 1); + check(face, 1); + check(level, 1); + check(screen, 1); + } + return callPPPPPI(ctx, memAddress(pbuffer), face, level, screen, __functionAddress); + } + + /** Array version of: {@link #CGLIsEnabled IsEnabled} */ + @NativeType("CGLError") + public static int CGLIsEnabled(@NativeType("CGLContextObj") long ctx, @NativeType("CGLContextEnable") int pname, @NativeType("GLint *") int[] enable) { + long __functionAddress = Functions.IsEnabled; + if (CHECKS) { + check(ctx); + check(enable, 1); + } + return callPPI(ctx, pname, enable, __functionAddress); + } + + /** Array version of: {@link #CGLSetParameter SetParameter} */ + @NativeType("CGLError") + public static int CGLSetParameter(@NativeType("CGLContextObj") long ctx, @NativeType("CGLContextParameter") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = Functions.SetParameter; + if (CHECKS) { + check(ctx); + check(params, 1); + } + return callPPI(ctx, pname, params, __functionAddress); + } + + /** Array version of: {@link #CGLGetParameter GetParameter} */ + @NativeType("CGLError") + public static int CGLGetParameter(@NativeType("CGLContextObj") long ctx, @NativeType("CGLContextParameter") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = Functions.GetParameter; + if (CHECKS) { + check(ctx); + check(params, 1); + } + return callPPI(ctx, pname, params, __functionAddress); + } + + /** Array version of: {@link #CGLGetVirtualScreen GetVirtualScreen} */ + @NativeType("CGLError") + public static int CGLGetVirtualScreen(@NativeType("CGLContextObj") long ctx, @NativeType("GLint *") int[] screen) { + long __functionAddress = Functions.GetVirtualScreen; + if (CHECKS) { + check(ctx); + check(screen, 1); + } + return callPPI(ctx, screen, __functionAddress); + } + + /** Array version of: {@link #CGLSetGlobalOption SetGlobalOption} */ + @NativeType("CGLError") + public static int CGLSetGlobalOption(@NativeType("CGLGlobalOption") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = Functions.SetGlobalOption; + if (CHECKS) { + check(params, 1); + } + return callPI(pname, params, __functionAddress); + } + + /** Array version of: {@link #CGLGetGlobalOption GetGlobalOption} */ + @NativeType("CGLError") + public static int CGLGetGlobalOption(@NativeType("CGLGlobalOption") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = Functions.GetGlobalOption; + if (CHECKS) { + check(params, 1); + } + return callPI(pname, params, __functionAddress); + } + + /** Array version of: {@link #CGLGetVersion GetVersion} */ + public static void CGLGetVersion(@NativeType("GLint *") int[] majorvers, @NativeType("GLint *") int[] minorvers) { + long __functionAddress = Functions.GetVersion; + if (CHECKS) { + check(majorvers, 1); + check(minorvers, 1); + } + callPPV(majorvers, minorvers, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXT422Pixels.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXT422Pixels.java new file mode 100644 index 00000000..17e0f81c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXT422Pixels.java @@ -0,0 +1,36 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_422_pixels extension. + * + *

This extension provides support for converting 422 pixels in host memory to 444 pixels as part of the pixel storage operation.

+ * + *

The pixel unpack storage operation treats a 422 pixel as a 2 element format where the first element is C (chrominance) and the second element is L + * (luminance). Luminance is present on all pixels; a full chrominance value requires two pixels.

+ * + *

The pixel pack storage operation converts RGB to a 422 pixel defined as a 2 element format where the first element stored is C (chrominance) and the + * second element stored is L (luminance). Luminance is present on all pixels; a full chrominance value requires two pixels.

+ * + *

Both averaging and non-averaging is supported for green and blue assignments for pack and unpack operations.

+ */ +public final class EXT422Pixels { + + /** + * Accepted by the {@code format} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, GetTexImage, TexImage3D, TexSubImage1D, TexSubImage2D, + * TexSubImage3D, GetHistogram, GetMinmax, ConvolutionFilter1D, ConvolutionFilter2D, ConvolutionFilter3D, GetConvolutionFilter, SeparableFilter2D, + * SeparableFilter3D, GetSeparableFilter, ColorTable, and GetColorTable. + */ + public static final int + GL_422_EXT = 0x80CC, + GL_422_REV_EXT = 0x80CD, + GL_422_AVERAGE_EXT = 0x80CE, + GL_422_REV_AVERAGE_EXT = 0x80CF; + + private EXT422Pixels() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTABGR.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTABGR.java new file mode 100644 index 00000000..1e7374da --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTABGR.java @@ -0,0 +1,21 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_abgr extension. + * + *

EXT_abgr extends the list of host-memory color formats. Specifically, it provides a reverse-order alternative to image format RGBA. The ABGR component + * order matches the cpack Iris GL format on big-endian machines.

+ */ +public final class EXTABGR { + + /** Accepted by the {@code format} parameter of DrawPixels, GetTexImage, ReadPixels, TexImage1D, and TexImage2D. */ + public static final int GL_ABGR_EXT = 0x8000; + + private EXTABGR() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBGRA.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBGRA.java new file mode 100644 index 00000000..ae858cb4 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBGRA.java @@ -0,0 +1,25 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_bgra extension. + * + *

EXT_bgra extends the list of host-memory color formats. Specifically, it provides formats which match the memory layout of Windows DIBs so that + * applications can use the same data in both Windows API calls and OpenGL pixel API calls.

+ * + *

Promoted to core in {@link GL12 OpenGL 1.2}.

+ */ +public final class EXTBGRA { + + /** Accepted by the {@code format} parameter of DrawPixels, GetTexImage, ReadPixels, TexImage1D, and TexImage2D. */ + public static final int + GL_BGR_EXT = 0x80E0, + GL_BGRA_EXT = 0x80E1; + + private EXTBGRA() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBindableUniform.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBindableUniform.java new file mode 100644 index 00000000..34563891 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBindableUniform.java @@ -0,0 +1,65 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_bindable_uniform extension. + * + *

This extension introduces the concept of bindable uniforms to the OpenGL Shading Language. A uniform variable can be declared bindable, which means that + * the storage for the uniform is not allocated by the compiler/linker anymore, but is backed by a buffer object. This buffer object is bound to the + * bindable uniform through the new command UniformBufferEXT(). Binding needs to happen after linking a program object.

+ * + *

Binding different buffer objects to a bindable uniform allows an application to easily use different "uniform data sets", without having to re-specify + * the data every time.

+ * + *

A buffer object can be bound to bindable uniforms in different program objects. If those bindable uniforms are all of the same type, accessing a + * bindable uniform in program object A will result in the same data if the same access is made in program object B. This provides a mechanism for + * 'environment uniforms', uniform values that can be shared among multiple program objects.

+ */ +public class EXTBindableUniform { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT = 0x8DE2, + GL_MAX_FRAGMENT_BINDABLE_UNIFORMS_EXT = 0x8DE3, + GL_MAX_GEOMETRY_BINDABLE_UNIFORMS_EXT = 0x8DE4, + GL_MAX_BINDABLE_UNIFORM_SIZE_EXT = 0x8DED, + GL_UNIFORM_BUFFER_BINDING_EXT = 0x8DEF; + + /** Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, and GetBufferPointerv. */ + public static final int GL_UNIFORM_BUFFER_EXT = 0x8DEE; + + static { GL.initialize(); } + + protected EXTBindableUniform() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glUniformBufferEXT, caps.glGetUniformBufferSizeEXT, caps.glGetUniformOffsetEXT + ); + } + + // --- [ glUniformBufferEXT ] --- + + public static native void glUniformBufferEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint") int buffer); + + // --- [ glGetUniformBufferSizeEXT ] --- + + @NativeType("GLint") + public static native int glGetUniformBufferSizeEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location); + + // --- [ glGetUniformOffsetEXT ] --- + + @NativeType("GLintptr") + public static native long glGetUniformOffsetEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBlendColor.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBlendColor.java new file mode 100644 index 00000000..11dccf67 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBlendColor.java @@ -0,0 +1,48 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_blend_color extension. + * + *

Blending capability is extended by defining a constant color that can be included in blending equations. A typical usage is blending two RGB images. + * Without the constant blend factor, one image must have an alpha channel with each pixel set to the desired blend factor.

+ * + *

Promoted to core in {@link GL14 OpenGL 1.4}.

+ */ +public class EXTBlendColor { + + /** Accepted by the {@code sfactor} and {@code dfactor} parameters of BlendFunc. */ + public static final int + GL_CONSTANT_COLOR_EXT = 0x8001, + GL_ONE_MINUS_CONSTANT_COLOR_EXT = 0x8002, + GL_CONSTANT_ALPHA_EXT = 0x8003, + GL_ONE_MINUS_CONSTANT_ALPHA_EXT = 0x8004; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_BLEND_COLOR_EXT = 0x8005; + + static { GL.initialize(); } + + protected EXTBlendColor() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBlendColorEXT + ); + } + + // --- [ glBlendColorEXT ] --- + + public static native void glBlendColorEXT(@NativeType("GLfloat") float red, @NativeType("GLfloat") float green, @NativeType("GLfloat") float blue, @NativeType("GLfloat") float alpha); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBlendEquationSeparate.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBlendEquationSeparate.java new file mode 100644 index 00000000..447883d5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBlendEquationSeparate.java @@ -0,0 +1,49 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_blend_equation_separate extension. + * + *

{@link EXTBlendFuncSeparate EXT_blend_func_separate} introduced separate RGB and alpha blend factors. {@link EXTBlendMinmax EXT_blend_minmax} introduced a distinct blend equation for + * combining source and destination blend terms. ({@link EXTBlendSubtract EXT_blend_subtract} & EXT_blend_logic_op added other blend equation + * modes.) OpenGL 1.4 integrated both functionalities into the core standard.

+ * + *

While there are separate blend functions for the RGB and alpha blend factors, OpenGL 1.4 provides a single blend equation that applies to both RGB and + * alpha portions of blending.

+ * + *

This extension provides a separate blend equation for RGB and alpha to match the generality available for blend factors.

+ * + *

Requires {@link GL14 OpenGL 1.4} or {@link ARBImaging ARB_imaging} or {@link EXTBlendMinmax EXT_blend_minmax} and/or {@link EXTBlendSubtract EXT_blend_subtract}. Promoted to core in {@link GL20 OpenGL 2.0}.

+ */ +public class EXTBlendEquationSeparate { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_BLEND_EQUATION_RGB_EXT = 0x8009, + GL_BLEND_EQUATION_ALPHA_EXT = 0x883D; + + static { GL.initialize(); } + + protected EXTBlendEquationSeparate() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBlendEquationSeparateEXT + ); + } + + // --- [ glBlendEquationSeparateEXT ] --- + + public static native void glBlendEquationSeparateEXT(@NativeType("GLenum") int modeRGB, @NativeType("GLenum") int modeAlpha); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBlendFuncSeparate.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBlendFuncSeparate.java new file mode 100644 index 00000000..7fc9d9ae --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBlendFuncSeparate.java @@ -0,0 +1,45 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_blend_func_separate extension. + * + *

Blending capability is extended by defining a function that allows independent setting of the RGB and alpha blend factors for blend operations that + * require source and destination blend factors. It is not always desired that the blending used for RGB is also applied to alpha.

+ * + *

Promoted to core in {@link GL14 OpenGL 1.4}.

+ */ +public class EXTBlendFuncSeparate { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_BLEND_DST_RGB_EXT = 0x80C8, + GL_BLEND_SRC_RGB_EXT = 0x80C9, + GL_BLEND_DST_ALPHA_EXT = 0x80CA, + GL_BLEND_SRC_ALPHA_EXT = 0x80CB; + + static { GL.initialize(); } + + protected EXTBlendFuncSeparate() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBlendFuncSeparateEXT + ); + } + + // --- [ glBlendFuncSeparateEXT ] --- + + public static native void glBlendFuncSeparateEXT(@NativeType("GLenum") int sfactorRGB, @NativeType("GLenum") int dfactorRGB, @NativeType("GLenum") int sfactorAlpha, @NativeType("GLenum") int dfactorAlpha); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBlendMinmax.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBlendMinmax.java new file mode 100644 index 00000000..8952be90 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBlendMinmax.java @@ -0,0 +1,50 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_blend_minmax extension. + * + *

Blending capability is extended by respecifying the entire blend equation. While this document defines only two new equations, the {@link #glBlendEquationEXT BlendEquationEXT} + * procedure that it defines will be used by subsequent extensions to define additional blending equations.

+ * + *

The two new equations defined by this extension produce the minimum (or maximum) color components of the source and destination colors. Taking the + * maximum is useful for applications such as maximum projection in medical imaging.

+ * + *

Promoted to core in {@link GL14 OpenGL 1.4}.

+ */ +public class EXTBlendMinmax { + + /** Accepted by the {@code mode} parameter of BlendEquationEXT. */ + public static final int + GL_FUNC_ADD_EXT = 0x8006, + GL_MIN_EXT = 0x8007, + GL_MAX_EXT = 0x8008; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_BLEND_EQUATION_EXT = 0x8009; + + static { GL.initialize(); } + + protected EXTBlendMinmax() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBlendEquationEXT + ); + } + + // --- [ glBlendEquationEXT ] --- + + public static native void glBlendEquationEXT(@NativeType("GLenum") int mode); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBlendSubtract.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBlendSubtract.java new file mode 100644 index 00000000..4bad34b2 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTBlendSubtract.java @@ -0,0 +1,26 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_blend_subtract extension. + * + *

Two additional blending equations are specified using the interface defined by {@link EXTBlendMinmax EXT_blend_minmax}. These equations are similar to the default + * blending equation, but produce the difference of its left and right hand sides, rather than the sum. Image differences are useful in many image + * processing applications.

+ * + *

Promoted to core in {@link GL14 OpenGL 1.4}.

+ */ +public final class EXTBlendSubtract { + + /** Accepted by the {@code mode} parameter of BlendEquationEXT. */ + public static final int + GL_FUNC_SUBTRACT_EXT = 0x800A, + GL_FUNC_REVERSE_SUBTRACT_EXT = 0x800B; + + private EXTBlendSubtract() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTClipVolumeHint.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTClipVolumeHint.java new file mode 100644 index 00000000..a3926f4b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTClipVolumeHint.java @@ -0,0 +1,22 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_clip_volume_hint extension. + * + *

EXT_clip_volume_hint provides a mechanism for applications to indicate that they do not require clip volume clipping for primitives. It allows + * applications to maximize performance in situations where they know that clipping is unnecessary. EXT_clip_volume_hint is only an indication, though, + * and implementations are free to ignore it.

+ */ +public final class EXTClipVolumeHint { + + /** Accepted by the target parameter of Hint and the pname parameter of GetBooleanv, GetDoublev, GetFloatv and GetIntegerv. */ + public static final int GL_CLIP_VOLUME_CLIPPING_HINT_EXT = 0x80F0; + + private EXTClipVolumeHint() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTCompiledVertexArray.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTCompiledVertexArray.java new file mode 100644 index 00000000..8287814a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTCompiledVertexArray.java @@ -0,0 +1,51 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_compiled_vertex_array extension. + * + *

This extension defines an interface which allows static vertex array data to be cached or pre-compiled for more efficient rendering. This is useful for + * implementations which can cache the transformed results of array data for reuse by several DrawArrays, ArrayElement, or DrawElements commands. It is + * also useful for implementations which can transfer array data to fast memory for more efficient processing.

+ * + *

For example, rendering an M by N mesh of quadrilaterals can be accomplished by setting up vertex arrays containing all of the vertexes in the mesh and + * issuing M DrawElements commands each of which operate on 2 * N vertexes. Each DrawElements command after the first will share N vertexes with the + * preceding DrawElements command. If the vertex array data is locked while the DrawElements commands are executed, then OpenGL may be able to transform + * each of these shared vertexes just once.

+ */ +public class EXTCompiledVertexArray { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_ARRAY_ELEMENT_LOCK_FIRST_EXT = 0x81A8, + GL_ARRAY_ELEMENT_LOCK_COUNT_EXT = 0x81A9; + + static { GL.initialize(); } + + protected EXTCompiledVertexArray() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glLockArraysEXT, caps.glUnlockArraysEXT + ); + } + + // --- [ glLockArraysEXT ] --- + + public static native void glLockArraysEXT(@NativeType("GLint") int first, @NativeType("GLsizei") int count); + + // --- [ glUnlockArraysEXT ] --- + + public static native void glUnlockArraysEXT(); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDebugLabel.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDebugLabel.java new file mode 100644 index 00000000..af10208c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDebugLabel.java @@ -0,0 +1,105 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the EXT_debug_label extension. + * + *

This extension defines a mechanism for OpenGL and OpenGL ES applications to label their objects (textures, buffers, shaders, etc.) with a descriptive + * string.

+ * + *

When profiling or debugging such an application within a debugger or profiler it is difficult to identify resources from their object names. Even when + * the resource itself is viewed it can be problematic to differentiate between similar resources. Attaching a label to an object helps obviate this + * difficulty.

+ * + *

The intended purpose of this is purely to improve the user experience within OpenGL and OpenGL ES development tools.

+ */ +public class EXTDebugLabel { + + /** Accepted by the {@code type} parameter of LabelObjectEXT and GetObjectLabelEXT. */ + public static final int + GL_BUFFER_OBJECT_EXT = 0x9151, + GL_SHADER_OBJECT_EXT = 0x8B48, + GL_PROGRAM_OBJECT_EXT = 0x8B40, + GL_VERTEX_ARRAY_OBJECT_EXT = 0x9154, + GL_QUERY_OBJECT_EXT = 0x9153, + GL_PROGRAM_PIPELINE_OBJECT_EXT = 0x8A4F; + + static { GL.initialize(); } + + protected EXTDebugLabel() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glLabelObjectEXT, caps.glGetObjectLabelEXT + ); + } + + // --- [ glLabelObjectEXT ] --- + + public static native void nglLabelObjectEXT(int type, int object, int length, long label); + + public static void glLabelObjectEXT(@NativeType("GLenum") int type, @NativeType("GLuint") int object, @NativeType("GLchar const *") ByteBuffer label) { + nglLabelObjectEXT(type, object, label.remaining(), memAddress(label)); + } + + public static void glLabelObjectEXT(@NativeType("GLenum") int type, @NativeType("GLuint") int object, @NativeType("GLchar const *") CharSequence label) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + int labelEncodedLength = stack.nUTF8(label, false); + long labelEncoded = stack.getPointerAddress(); + nglLabelObjectEXT(type, object, labelEncodedLength, labelEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetObjectLabelEXT ] --- + + public static native void nglGetObjectLabelEXT(int type, int object, int bufSize, long length, long label); + + public static void glGetObjectLabelEXT(@NativeType("GLenum") int type, @NativeType("GLuint") int object, @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer label) { + if (CHECKS) { + check(length, 1); + } + nglGetObjectLabelEXT(type, object, label.remaining(), memAddress(length), memAddress(label)); + } + + @NativeType("void") + public static String glGetObjectLabelEXT(@NativeType("GLenum") int type, @NativeType("GLuint") int object, @NativeType("GLsizei") int bufSize) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer length = stack.ints(0); + ByteBuffer label = stack.malloc(bufSize); + nglGetObjectLabelEXT(type, object, bufSize, memAddress(length), memAddress(label)); + return memUTF8(label, length.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #glGetObjectLabelEXT GetObjectLabelEXT} */ + public static void glGetObjectLabelEXT(@NativeType("GLenum") int type, @NativeType("GLuint") int object, @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer label) { + long __functionAddress = GL.getICD().glGetObjectLabelEXT; + if (CHECKS) { + check(__functionAddress); + check(length, 1); + } + callPPV(type, object, label.remaining(), length, memAddress(label), __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDebugMarker.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDebugMarker.java new file mode 100644 index 00000000..6ddc565a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDebugMarker.java @@ -0,0 +1,83 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the EXT_debug_marker extension. + * + *

This extension defines a mechanism for OpenGL and OpenGL ES applications to annotate their command stream with markers for discrete events and groups + * of commands using descriptive text markers.

+ * + *

When profiling or debugging such an application within a debugger or profiler it is difficult to relate the commands within the command stream to the + * elements of the scene or parts of the program code to which they correspond. Markers help obviate this by allowing applications to specify this link.

+ * + *

The intended purpose of this is purely to improve the user experience within OpenGL and OpenGL ES development tools.

+ */ +public class EXTDebugMarker { + + static { GL.initialize(); } + + protected EXTDebugMarker() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glInsertEventMarkerEXT, caps.glPushGroupMarkerEXT, caps.glPopGroupMarkerEXT + ); + } + + // --- [ glInsertEventMarkerEXT ] --- + + public static native void nglInsertEventMarkerEXT(int length, long marker); + + public static void glInsertEventMarkerEXT(@NativeType("GLchar const *") ByteBuffer marker) { + nglInsertEventMarkerEXT(marker.remaining(), memAddress(marker)); + } + + public static void glInsertEventMarkerEXT(@NativeType("GLchar const *") CharSequence marker) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + int markerEncodedLength = stack.nUTF8(marker, false); + long markerEncoded = stack.getPointerAddress(); + nglInsertEventMarkerEXT(markerEncodedLength, markerEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glPushGroupMarkerEXT ] --- + + public static native void nglPushGroupMarkerEXT(int length, long marker); + + public static void glPushGroupMarkerEXT(@NativeType("GLchar const *") ByteBuffer marker) { + nglPushGroupMarkerEXT(marker.remaining(), memAddress(marker)); + } + + public static void glPushGroupMarkerEXT(@NativeType("GLchar const *") CharSequence marker) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + int markerEncodedLength = stack.nUTF8(marker, false); + long markerEncoded = stack.getPointerAddress(); + nglPushGroupMarkerEXT(markerEncodedLength, markerEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glPopGroupMarkerEXT ] --- + + public static native void glPopGroupMarkerEXT(); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDepthBoundsTest.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDepthBoundsTest.java new file mode 100644 index 00000000..0ae6a8e5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDepthBoundsTest.java @@ -0,0 +1,65 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_depth_bounds_test extension. + * + *

This extension adds a new per-fragment test that is, logically, after the scissor test and before the alpha test. The depth bounds test compares the + * depth value stored at the location given by the incoming fragment's (xw,yw) coordinates to a user-defined minimum and maximum depth value. If the stored + * depth value is outside the user-defined range (exclusive), the incoming fragment is discarded.

+ * + *

Unlike the depth test, the depth bounds test has NO dependency on the fragment's window-space depth value.

+ * + *

This functionality is useful in the context of attenuated stenciled shadow volume rendering. To motivate the functionality's utility in this context, we + * first describe how conventional scissor testing can be used to optimize shadow volume rendering.

+ * + *

If an attenuated light source's illumination can be bounded to a rectangle in XY window-space, the conventional scissor test can be used to discard + * shadow volume fragments that are guaranteed to be outside the light source's window-space XY rectangle. The stencil increments and decrements that would + * otherwise be generated by these scissored fragments are inconsequential because the light source's illumination can pre-determined to be fully + * attenuated outside the scissored region. In other words, the scissor test can be used to discard shadow volume fragments rendered outside the scissor, + * thereby improving performance, without affecting the ultimate illumination of these pixels with respect to the attenuated light source.

+ * + *

This scissoring optimization can be used both when rendering the stenciled shadow volumes to update stencil (incrementing and decrementing the stencil + * buffer) AND when adding the illumination contribution of attenuated light source's.

+ * + *

In a similar fashion, we can compute the attenuated light source's window-space Z bounds (zmin,zmax) of consequential illumination. Unless a depth value + * (in the depth buffer) at a pixel is within the range [zmin,zmax], the light source's illumination can be pre-determined to be inconsequential for the + * pixel. Said another way, the pixel being illuminated is either far enough in front of or behind the attenuated light source so that the light source's + * illumination for the pixel is fully attenuated. The depth bounds test can perform this test.

+ */ +public class EXTDepthBoundsTest { + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_DEPTH_BOUNDS_TEST_EXT = 0x8890; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_DEPTH_BOUNDS_EXT = 0x8891; + + static { GL.initialize(); } + + protected EXTDepthBoundsTest() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glDepthBoundsEXT + ); + } + + // --- [ glDepthBoundsEXT ] --- + + public static native void glDepthBoundsEXT(double zmin, double zmax); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDirectStateAccess.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDirectStateAccess.java new file mode 100644 index 00000000..49477bd0 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDirectStateAccess.java @@ -0,0 +1,4144 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the EXT_direct_state_access extension. + * + *

This extension introduces a set of new "direct state access" commands (meaning no selector is involved) to access (update and query) OpenGL state that + * previously depended on the OpenGL state selectors for access. These new commands supplement the existing selector-based OpenGL commands to access the + * same state.

+ * + *

The intent of this extension is to make it more efficient for libraries to avoid disturbing selector and latched state. The extension also allows more + * efficient command usage by eliminating the need for selector update commands.

+ * + *

Two derivative advantages of this extension are 1) display lists can be executed using these commands that avoid disturbing selectors that subsequent + * commands may depend on, and 2) drivers implemented with a dual-thread partitioning with OpenGL command buffering from an application thread and then + * OpenGL command dispatching in a concurrent driver thread can avoid thread synchronization created by selector saving, setting, command execution, and + * selector restoration.

+ * + *

This extension does not itself add any new OpenGL state.

+ * + *

We call a state variable in OpenGL an "OpenGL state selector" or simply a "selector" if OpenGL commands depend on the state variable to determine what + * state to query or update. The matrix mode and active texture are both selectors. Object bindings for buffers, programs, textures, and framebuffer + * objects are also selectors.

+ * + *

We call OpenGL state "latched" if the state is set by one OpenGL command but then that state is saved by a subsequent command or the state determines + * how client memory or buffer object memory is accessed by a subsequent command. The array and element array buffer bindings are latched by vertex array + * specification commands to determine which buffer a given vertex array uses. Vertex array state and pixel pack/unpack state decides how client memory or + * buffer object memory is accessed by subsequent vertex pulling or image specification commands.

+ * + *

The existence of selectors and latched state in the OpenGL API reduces the number of parameters to various sets of OpenGL commands but complicates the + * access to state for layered libraries which seek to access state without disturbing other state, namely the state of state selectors and latched state. + * In many cases, selectors and latched state were introduced by extensions as OpenGL evolved to minimize the disruption to the OpenGL API when new + * functionality, particularly the pluralization of existing functionality as when texture objects and later multiple texture units, was introduced.

+ * + *

The OpenGL API involves several selectors (listed in historical order of introduction):

+ * + *
    + *
  • The matrix mode.
  • + *
  • The current bound texture for each supported texture target.
  • + *
  • The active texture.
  • + *
  • The active client texture.
  • + *
  • The current bound program for each supported program target.
  • + *
  • The current bound buffer for each supported buffer target.
  • + *
  • The current GLSL program.
  • + *
  • The current framebuffer object.
  • + *
+ * + *

The new selector-free update commands can be compiled into display lists.

+ * + *

The OpenGL API has latched state for vertex array buffer objects and pixel store state. When an application issues a GL command to unpack or pack pixels + * (for example, glTexImage2D or glReadPixels respectively), the current unpack and pack pixel store state determines how the pixels are unpacked + * from/packed to client memory or pixel buffer objects. For example, consider:

+ * + *

+ * glPixelStorei(GL_UNPACK_SWAP_BYTES, GL_TRUE);
+ * glPixelStorei(GL_UNPACK_ROW_LENGTH, 640);
+ * glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 47);
+ * glDrawPixels(100, 100, GL_RGB, GL_FLOAT, pixels);
+ * + *

The unpack swap bytes and row length state set by the preceding glPixelStorei commands (as well as the 6 other unpack pixel store state variables) + * control how data is read (unpacked) from buffer of data pointed to by pixels. The glBindBuffer command also specifies an unpack buffer object (47) so + * the pixel pointer is actually treated as a byte offset into buffer object 47.

+ * + *

When an application issues a command to configure a vertex array, the current array buffer state is latched as the binding for the particular vertex + * array being specified. For example, consider:

+ * + *

+ * glBindBuffer(GL_ARRAY_BUFFER, 23);
+ * glVertexPointer(3, GL_FLOAT, 12, pointer);
+ * + *

The glBindBuffer command updates the array buffering binding (GL_ARRAY_BUFFER_BINDING) to the buffer object named 23. The subsequent glVertexPointer + * command specifies explicit parameters for the size, type, stride, and pointer to access the position vertex array BUT ALSO latches the current array + * buffer binding for the vertex array buffer binding (GL_VERTEX_ARRAY_BUFFER_BINDING). Effectively the current array buffer binding buffer object becomes + * an implicit fifth parameter to glVertexPointer and this applies to all the gl*Pointer vertex array specification commands.

+ * + *

Selectors and latched state create problems for layered libraries using OpenGL because selectors require the selector state to be modified to update + * some other state and latched state means implicit state can affect the operation of commands specifying, packing, or unpacking data through + * pointers/offsets. For layered libraries, a state update performed by the library may attempt to save the selector state, set the selector, update/query + * some state the selector controls, and then restore the selector to its saved state. Layered libraries can skip the selector save/restore but this risks + * introducing uncertainty about the state of a selector after calling layered library routines. Such selector side-effects are difficult to document and + * lead to compatibility issues as the layered library evolves or its usage varies. For latched state, layered libraries may find commands such as + * glDrawPixels do not work as expected because latched pixel store state is not what the library expects. Querying or pushing the latched state, setting + * the latched state explicitly, performing the operation involving latched state, and then restoring or popping the latched state avoids entanglements + * with latched state but at considerable cost.

+ * + *

EXAMPLE USAGE OF THIS EXTENSION'S FUNCTIONALITY

+ * + *

Consider the following routine to set the modelview matrix involving the matrix mode selector:

+ * + *

+ * void setModelviewMatrix(const GLfloat matrix[16])
+ * {
+ *     GLenum savedMatrixMode;
+ * 
+ *     glGetIntegerv(GL_MATRIX_MODE, &savedMatrixMode);
+ *     glMatrixMode(GL_MODELVIEW);
+ *     glLoadMatrixf(matrix);
+ *     glMatrixMode(savedMatrixMode);
+ * }
+ * + *

Notice that four OpenGL commands are required to update the current modelview matrix without disturbing the matrix mode selector.

+ * + *

OpenGL query commands can also substantially reduce the performance of modern OpenGL implementations which may off-load OpenGL state processing to + * another CPU core/thread or to the GPU itself.

+ * + *

An alternative to querying the selector is to use the glPushAttrib/glPopAttrib commands. However this approach typically involves pushing far more state + * than simply the one or two selectors that need to be saved and restored. Because so much state is associated with a given push/pop attribute bit, the + * glPushAttrib and glPopAttrib commands are considerably more costly than the save/restore approach. Additionally glPushAttrib risks overflowing the + * attribute stack.

+ * + *

The reliability and performance of layered libraries and applications can be improved by adding to the OpenGL API a new set of commands to access + * directly OpenGL state that otherwise involves selectors to access.

+ * + *

The above example can be reimplemented more efficiently and without selector side-effects:

+ * + *

+ * void setModelviewMatrix(const GLfloat matrix[16])
+ * {
+ *     glMatrixLoadfEXT(GL_MODELVIEW, matrix);
+ * }
+ * + *

Consider a layered library seeking to load a texture:

+ * + *

+ * void loadTexture(GLint texobj, GLint width, GLint height, void *data)
+ * {
+ *     glBindTexture(GL_TEXTURE_2D, texobj);
+ *     glTexImage2D(GL_TEXTURE_2D, 0, GL_RGB8, width, height, GL_RGB, GL_FLOAT, data);
+ * }
+ * + *

The library expects the data to be packed into the buffer pointed to by data. But what if the current pixel unpack buffer binding is not zero so the + * current pixel unpack buffer, rather than client memory, will be read? Or what if the application has modified the GL_UNPACK_ROW_LENGTH pixel store state + * before loadTexture is called?

+ * + *

We can fix the routine by calling glBindBuffer(GL_PIXEL_UNPACK_BUFFER, 0) and setting all the pixel store unpack state to the initial state the + * loadTexture routine expects, but this is expensive. It also risks disturbing the state so when loadTexture returns to the application, the application + * doesn't realize the current texture object (for whatever texture unit the current active texture happens to be) and pixel store state has changed.

+ * + *

We can more efficiently implement this routine without disturbing selector or latched state as follows:

+ * + *

+ * void loadTexture(GLint texobj, GLint width, GLint height, void *data)
+ * {
+ *     glPushClientAttribDefaultEXT(GL_CLIENT_PIXEL_STORE_BIT);
+ *     glTextureImage2D(texobj, GL_TEXTURE_2D, 0, GL_RGB8, width, height, GL_RGB, GL_FLOAT, data);
+ *     glPopClientAttrib();
+ * }
+ * + *

Now loadTexture does not have to worry about inappropriately configured pixel store state or a non-zero pixel unpack buffer binding. And loadTexture has + * no unintended side-effects for selector or latched state (assuming the client attrib state does not overflow).

+ */ +public class EXTDirectStateAccess { + + /** GetBooleani_v, GetIntegeri_v, GetFloati_vEXT, GetDoublei_vEXT. */ + public static final int + GL_PROGRAM_MATRIX_EXT = 0x8E2D, + GL_TRANSPOSE_PROGRAM_MATRIX_EXT = 0x8E2E, + GL_PROGRAM_MATRIX_STACK_DEPTH_EXT = 0x8E2F; + + static { GL.initialize(); } + + protected EXTDirectStateAccess() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glClientAttribDefaultEXT, caps.glPushClientAttribDefaultEXT, caps.glMatrixLoadfEXT, caps.glMatrixLoaddEXT, caps.glMatrixMultfEXT, + caps.glMatrixMultdEXT, caps.glMatrixLoadIdentityEXT, caps.glMatrixRotatefEXT, caps.glMatrixRotatedEXT, caps.glMatrixScalefEXT, + caps.glMatrixScaledEXT, caps.glMatrixTranslatefEXT, caps.glMatrixTranslatedEXT, caps.glMatrixOrthoEXT, caps.glMatrixFrustumEXT, + caps.glMatrixPushEXT, caps.glMatrixPopEXT, caps.glTextureParameteriEXT, caps.glTextureParameterivEXT, caps.glTextureParameterfEXT, + caps.glTextureParameterfvEXT, caps.glTextureImage1DEXT, caps.glTextureImage2DEXT, caps.glTextureSubImage1DEXT, caps.glTextureSubImage2DEXT, + caps.glCopyTextureImage1DEXT, caps.glCopyTextureImage2DEXT, caps.glCopyTextureSubImage1DEXT, caps.glCopyTextureSubImage2DEXT, + caps.glGetTextureImageEXT, caps.glGetTextureParameterfvEXT, caps.glGetTextureParameterivEXT, caps.glGetTextureLevelParameterfvEXT, + caps.glGetTextureLevelParameterivEXT, ext.contains("OpenGL12") ? caps.glTextureImage3DEXT : -1L, + ext.contains("OpenGL12") ? caps.glTextureSubImage3DEXT : -1L, ext.contains("OpenGL12") ? caps.glCopyTextureSubImage3DEXT : -1L, + ext.contains("OpenGL13") ? caps.glBindMultiTextureEXT : -1L, ext.contains("OpenGL13") ? caps.glMultiTexCoordPointerEXT : -1L, + ext.contains("OpenGL13") ? caps.glMultiTexEnvfEXT : -1L, ext.contains("OpenGL13") ? caps.glMultiTexEnvfvEXT : -1L, + ext.contains("OpenGL13") ? caps.glMultiTexEnviEXT : -1L, ext.contains("OpenGL13") ? caps.glMultiTexEnvivEXT : -1L, + ext.contains("OpenGL13") ? caps.glMultiTexGendEXT : -1L, ext.contains("OpenGL13") ? caps.glMultiTexGendvEXT : -1L, + ext.contains("OpenGL13") ? caps.glMultiTexGenfEXT : -1L, ext.contains("OpenGL13") ? caps.glMultiTexGenfvEXT : -1L, + ext.contains("OpenGL13") ? caps.glMultiTexGeniEXT : -1L, ext.contains("OpenGL13") ? caps.glMultiTexGenivEXT : -1L, + ext.contains("OpenGL13") ? caps.glGetMultiTexEnvfvEXT : -1L, ext.contains("OpenGL13") ? caps.glGetMultiTexEnvivEXT : -1L, + ext.contains("OpenGL13") ? caps.glGetMultiTexGendvEXT : -1L, ext.contains("OpenGL13") ? caps.glGetMultiTexGenfvEXT : -1L, + ext.contains("OpenGL13") ? caps.glGetMultiTexGenivEXT : -1L, ext.contains("OpenGL13") ? caps.glMultiTexParameteriEXT : -1L, + ext.contains("OpenGL13") ? caps.glMultiTexParameterivEXT : -1L, ext.contains("OpenGL13") ? caps.glMultiTexParameterfEXT : -1L, + ext.contains("OpenGL13") ? caps.glMultiTexParameterfvEXT : -1L, ext.contains("OpenGL13") ? caps.glMultiTexImage1DEXT : -1L, + ext.contains("OpenGL13") ? caps.glMultiTexImage2DEXT : -1L, ext.contains("OpenGL13") ? caps.glMultiTexSubImage1DEXT : -1L, + ext.contains("OpenGL13") ? caps.glMultiTexSubImage2DEXT : -1L, ext.contains("OpenGL13") ? caps.glCopyMultiTexImage1DEXT : -1L, + ext.contains("OpenGL13") ? caps.glCopyMultiTexImage2DEXT : -1L, ext.contains("OpenGL13") ? caps.glCopyMultiTexSubImage1DEXT : -1L, + ext.contains("OpenGL13") ? caps.glCopyMultiTexSubImage2DEXT : -1L, ext.contains("OpenGL13") ? caps.glGetMultiTexImageEXT : -1L, + ext.contains("OpenGL13") ? caps.glGetMultiTexParameterfvEXT : -1L, ext.contains("OpenGL13") ? caps.glGetMultiTexParameterivEXT : -1L, + ext.contains("OpenGL13") ? caps.glGetMultiTexLevelParameterfvEXT : -1L, ext.contains("OpenGL13") ? caps.glGetMultiTexLevelParameterivEXT : -1L, + ext.contains("OpenGL13") ? caps.glMultiTexImage3DEXT : -1L, ext.contains("OpenGL13") ? caps.glMultiTexSubImage3DEXT : -1L, + ext.contains("OpenGL13") ? caps.glCopyMultiTexSubImage3DEXT : -1L, ext.contains("OpenGL13") ? caps.glEnableClientStateIndexedEXT : -1L, + ext.contains("OpenGL13") ? caps.glDisableClientStateIndexedEXT : -1L, ext.contains("OpenGL13") ? caps.glGetFloatIndexedvEXT : -1L, + ext.contains("OpenGL13") ? caps.glGetDoubleIndexedvEXT : -1L, ext.contains("OpenGL13") ? caps.glGetPointerIndexedvEXT : -1L, + ext.contains("OpenGL13") ? caps.glEnableIndexedEXT : -1L, ext.contains("OpenGL13") ? caps.glDisableIndexedEXT : -1L, + ext.contains("OpenGL13") ? caps.glIsEnabledIndexedEXT : -1L, ext.contains("OpenGL13") ? caps.glGetIntegerIndexedvEXT : -1L, + ext.contains("OpenGL13") ? caps.glGetBooleanIndexedvEXT : -1L, ext.contains("GL_ARB_vertex_program") ? caps.glNamedProgramStringEXT : -1L, + ext.contains("GL_ARB_vertex_program") ? caps.glNamedProgramLocalParameter4dEXT : -1L, + ext.contains("GL_ARB_vertex_program") ? caps.glNamedProgramLocalParameter4dvEXT : -1L, + ext.contains("GL_ARB_vertex_program") ? caps.glNamedProgramLocalParameter4fEXT : -1L, + ext.contains("GL_ARB_vertex_program") ? caps.glNamedProgramLocalParameter4fvEXT : -1L, + ext.contains("GL_ARB_vertex_program") ? caps.glGetNamedProgramLocalParameterdvEXT : -1L, + ext.contains("GL_ARB_vertex_program") ? caps.glGetNamedProgramLocalParameterfvEXT : -1L, + ext.contains("GL_ARB_vertex_program") ? caps.glGetNamedProgramivEXT : -1L, + ext.contains("GL_ARB_vertex_program") ? caps.glGetNamedProgramStringEXT : -1L, ext.contains("OpenGL13") ? caps.glCompressedTextureImage3DEXT : -1L, + ext.contains("OpenGL13") ? caps.glCompressedTextureImage2DEXT : -1L, ext.contains("OpenGL13") ? caps.glCompressedTextureImage1DEXT : -1L, + ext.contains("OpenGL13") ? caps.glCompressedTextureSubImage3DEXT : -1L, ext.contains("OpenGL13") ? caps.glCompressedTextureSubImage2DEXT : -1L, + ext.contains("OpenGL13") ? caps.glCompressedTextureSubImage1DEXT : -1L, ext.contains("OpenGL13") ? caps.glGetCompressedTextureImageEXT : -1L, + ext.contains("OpenGL13") ? caps.glCompressedMultiTexImage3DEXT : -1L, ext.contains("OpenGL13") ? caps.glCompressedMultiTexImage2DEXT : -1L, + ext.contains("OpenGL13") ? caps.glCompressedMultiTexImage1DEXT : -1L, ext.contains("OpenGL13") ? caps.glCompressedMultiTexSubImage3DEXT : -1L, + ext.contains("OpenGL13") ? caps.glCompressedMultiTexSubImage2DEXT : -1L, ext.contains("OpenGL13") ? caps.glCompressedMultiTexSubImage1DEXT : -1L, + ext.contains("OpenGL13") ? caps.glGetCompressedMultiTexImageEXT : -1L, ext.contains("OpenGL13") ? caps.glMatrixLoadTransposefEXT : -1L, + ext.contains("OpenGL13") ? caps.glMatrixLoadTransposedEXT : -1L, ext.contains("OpenGL13") ? caps.glMatrixMultTransposefEXT : -1L, + ext.contains("OpenGL13") ? caps.glMatrixMultTransposedEXT : -1L, ext.contains("OpenGL15") ? caps.glNamedBufferDataEXT : -1L, + ext.contains("OpenGL15") ? caps.glNamedBufferSubDataEXT : -1L, ext.contains("OpenGL15") ? caps.glMapNamedBufferEXT : -1L, + ext.contains("OpenGL15") ? caps.glUnmapNamedBufferEXT : -1L, ext.contains("OpenGL15") ? caps.glGetNamedBufferParameterivEXT : -1L, + ext.contains("OpenGL15") ? caps.glGetNamedBufferSubDataEXT : -1L, ext.contains("OpenGL20") ? caps.glProgramUniform1fEXT : -1L, + ext.contains("OpenGL20") ? caps.glProgramUniform2fEXT : -1L, ext.contains("OpenGL20") ? caps.glProgramUniform3fEXT : -1L, + ext.contains("OpenGL20") ? caps.glProgramUniform4fEXT : -1L, ext.contains("OpenGL20") ? caps.glProgramUniform1iEXT : -1L, + ext.contains("OpenGL20") ? caps.glProgramUniform2iEXT : -1L, ext.contains("OpenGL20") ? caps.glProgramUniform3iEXT : -1L, + ext.contains("OpenGL20") ? caps.glProgramUniform4iEXT : -1L, ext.contains("OpenGL20") ? caps.glProgramUniform1fvEXT : -1L, + ext.contains("OpenGL20") ? caps.glProgramUniform2fvEXT : -1L, ext.contains("OpenGL20") ? caps.glProgramUniform3fvEXT : -1L, + ext.contains("OpenGL20") ? caps.glProgramUniform4fvEXT : -1L, ext.contains("OpenGL20") ? caps.glProgramUniform1ivEXT : -1L, + ext.contains("OpenGL20") ? caps.glProgramUniform2ivEXT : -1L, ext.contains("OpenGL20") ? caps.glProgramUniform3ivEXT : -1L, + ext.contains("OpenGL20") ? caps.glProgramUniform4ivEXT : -1L, ext.contains("OpenGL20") ? caps.glProgramUniformMatrix2fvEXT : -1L, + ext.contains("OpenGL20") ? caps.glProgramUniformMatrix3fvEXT : -1L, ext.contains("OpenGL20") ? caps.glProgramUniformMatrix4fvEXT : -1L, + ext.contains("OpenGL21") ? caps.glProgramUniformMatrix2x3fvEXT : -1L, ext.contains("OpenGL21") ? caps.glProgramUniformMatrix3x2fvEXT : -1L, + ext.contains("OpenGL21") ? caps.glProgramUniformMatrix2x4fvEXT : -1L, ext.contains("OpenGL21") ? caps.glProgramUniformMatrix4x2fvEXT : -1L, + ext.contains("OpenGL21") ? caps.glProgramUniformMatrix3x4fvEXT : -1L, ext.contains("OpenGL21") ? caps.glProgramUniformMatrix4x3fvEXT : -1L, + ext.contains("GL_EXT_texture_buffer_object") ? caps.glTextureBufferEXT : -1L, + ext.contains("GL_EXT_texture_buffer_object") ? caps.glMultiTexBufferEXT : -1L, + ext.contains("GL_EXT_texture_integer") ? caps.glTextureParameterIivEXT : -1L, + ext.contains("GL_EXT_texture_integer") ? caps.glTextureParameterIuivEXT : -1L, + ext.contains("GL_EXT_texture_integer") ? caps.glGetTextureParameterIivEXT : -1L, + ext.contains("GL_EXT_texture_integer") ? caps.glGetTextureParameterIuivEXT : -1L, + ext.contains("GL_EXT_texture_integer") ? caps.glMultiTexParameterIivEXT : -1L, + ext.contains("GL_EXT_texture_integer") ? caps.glMultiTexParameterIuivEXT : -1L, + ext.contains("GL_EXT_texture_integer") ? caps.glGetMultiTexParameterIivEXT : -1L, + ext.contains("GL_EXT_texture_integer") ? caps.glGetMultiTexParameterIuivEXT : -1L, + ext.contains("GL_EXT_gpu_shader4") ? caps.glProgramUniform1uiEXT : -1L, ext.contains("GL_EXT_gpu_shader4") ? caps.glProgramUniform2uiEXT : -1L, + ext.contains("GL_EXT_gpu_shader4") ? caps.glProgramUniform3uiEXT : -1L, ext.contains("GL_EXT_gpu_shader4") ? caps.glProgramUniform4uiEXT : -1L, + ext.contains("GL_EXT_gpu_shader4") ? caps.glProgramUniform1uivEXT : -1L, ext.contains("GL_EXT_gpu_shader4") ? caps.glProgramUniform2uivEXT : -1L, + ext.contains("GL_EXT_gpu_shader4") ? caps.glProgramUniform3uivEXT : -1L, ext.contains("GL_EXT_gpu_shader4") ? caps.glProgramUniform4uivEXT : -1L, + ext.contains("GL_EXT_gpu_program_parameters") ? caps.glNamedProgramLocalParameters4fvEXT : -1L, + ext.contains("GL_NV_gpu_program4") ? caps.glNamedProgramLocalParameterI4iEXT : -1L, + ext.contains("GL_NV_gpu_program4") ? caps.glNamedProgramLocalParameterI4ivEXT : -1L, + ext.contains("GL_NV_gpu_program4") ? caps.glNamedProgramLocalParametersI4ivEXT : -1L, + ext.contains("GL_NV_gpu_program4") ? caps.glNamedProgramLocalParameterI4uiEXT : -1L, + ext.contains("GL_NV_gpu_program4") ? caps.glNamedProgramLocalParameterI4uivEXT : -1L, + ext.contains("GL_NV_gpu_program4") ? caps.glNamedProgramLocalParametersI4uivEXT : -1L, + ext.contains("GL_NV_gpu_program4") ? caps.glGetNamedProgramLocalParameterIivEXT : -1L, + ext.contains("GL_NV_gpu_program4") ? caps.glGetNamedProgramLocalParameterIuivEXT : -1L, + ext.contains("OpenGL30") ? caps.glNamedRenderbufferStorageEXT : -1L, ext.contains("OpenGL30") ? caps.glGetNamedRenderbufferParameterivEXT : -1L, + ext.contains("OpenGL30") ? caps.glNamedRenderbufferStorageMultisampleEXT : -1L, + ext.contains("GL_NV_framebuffer_multisample_coverage") ? caps.glNamedRenderbufferStorageMultisampleCoverageEXT : -1L, + ext.contains("OpenGL30") ? caps.glCheckNamedFramebufferStatusEXT : -1L, ext.contains("OpenGL30") ? caps.glNamedFramebufferTexture1DEXT : -1L, + ext.contains("OpenGL30") ? caps.glNamedFramebufferTexture2DEXT : -1L, ext.contains("OpenGL30") ? caps.glNamedFramebufferTexture3DEXT : -1L, + ext.contains("OpenGL30") ? caps.glNamedFramebufferRenderbufferEXT : -1L, + ext.contains("OpenGL30") ? caps.glGetNamedFramebufferAttachmentParameterivEXT : -1L, + ext.contains("OpenGL30") ? caps.glGenerateTextureMipmapEXT : -1L, ext.contains("OpenGL30") ? caps.glGenerateMultiTexMipmapEXT : -1L, + ext.contains("OpenGL30") ? caps.glFramebufferDrawBufferEXT : -1L, ext.contains("OpenGL30") ? caps.glFramebufferDrawBuffersEXT : -1L, + ext.contains("OpenGL30") ? caps.glFramebufferReadBufferEXT : -1L, ext.contains("OpenGL30") ? caps.glGetFramebufferParameterivEXT : -1L, + ext.contains("OpenGL30") ? caps.glNamedCopyBufferSubDataEXT : -1L, + ext.contains("GL_EXT_geometry_shader4") || ext.contains("GL_NV_gpu_program4") ? caps.glNamedFramebufferTextureEXT : -1L, + ext.contains("GL_EXT_geometry_shader4") || ext.contains("GL_NV_gpu_program4") ? caps.glNamedFramebufferTextureLayerEXT : -1L, + ext.contains("GL_EXT_geometry_shader4") || ext.contains("GL_NV_gpu_program4") ? caps.glNamedFramebufferTextureFaceEXT : -1L, + ext.contains("GL_NV_explicit_multisample") ? caps.glTextureRenderbufferEXT : -1L, + ext.contains("GL_NV_explicit_multisample") ? caps.glMultiTexRenderbufferEXT : -1L, + ext.contains("OpenGL30") ? caps.glVertexArrayVertexOffsetEXT : -1L, ext.contains("OpenGL30") ? caps.glVertexArrayColorOffsetEXT : -1L, + ext.contains("OpenGL30") ? caps.glVertexArrayEdgeFlagOffsetEXT : -1L, ext.contains("OpenGL30") ? caps.glVertexArrayIndexOffsetEXT : -1L, + ext.contains("OpenGL30") ? caps.glVertexArrayNormalOffsetEXT : -1L, ext.contains("OpenGL30") ? caps.glVertexArrayTexCoordOffsetEXT : -1L, + ext.contains("OpenGL30") ? caps.glVertexArrayMultiTexCoordOffsetEXT : -1L, ext.contains("OpenGL30") ? caps.glVertexArrayFogCoordOffsetEXT : -1L, + ext.contains("OpenGL30") ? caps.glVertexArraySecondaryColorOffsetEXT : -1L, + ext.contains("OpenGL30") ? caps.glVertexArrayVertexAttribOffsetEXT : -1L, ext.contains("OpenGL30") ? caps.glVertexArrayVertexAttribIOffsetEXT : -1L, + ext.contains("OpenGL30") ? caps.glEnableVertexArrayEXT : -1L, ext.contains("OpenGL30") ? caps.glDisableVertexArrayEXT : -1L, + ext.contains("OpenGL30") ? caps.glEnableVertexArrayAttribEXT : -1L, ext.contains("OpenGL30") ? caps.glDisableVertexArrayAttribEXT : -1L, + ext.contains("OpenGL30") ? caps.glGetVertexArrayIntegervEXT : -1L, ext.contains("OpenGL30") ? caps.glGetVertexArrayPointervEXT : -1L, + ext.contains("OpenGL30") ? caps.glGetVertexArrayIntegeri_vEXT : -1L, ext.contains("OpenGL30") ? caps.glGetVertexArrayPointeri_vEXT : -1L, + ext.contains("OpenGL30") ? caps.glMapNamedBufferRangeEXT : -1L, ext.contains("OpenGL30") ? caps.glFlushMappedNamedBufferRangeEXT : -1L + ); + } + + // --- [ glClientAttribDefaultEXT ] --- + + public static native void glClientAttribDefaultEXT(@NativeType("GLbitfield") int mask); + + // --- [ glPushClientAttribDefaultEXT ] --- + + public static native void glPushClientAttribDefaultEXT(@NativeType("GLbitfield") int mask); + + // --- [ glMatrixLoadfEXT ] --- + + public static native void nglMatrixLoadfEXT(int matrixMode, long m); + + public static void glMatrixLoadfEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat const *") FloatBuffer m) { + if (CHECKS) { + check(m, 16); + } + nglMatrixLoadfEXT(matrixMode, memAddress(m)); + } + + // --- [ glMatrixLoaddEXT ] --- + + public static native void nglMatrixLoaddEXT(int matrixMode, long m); + + public static void glMatrixLoaddEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLdouble const *") DoubleBuffer m) { + if (CHECKS) { + check(m, 16); + } + nglMatrixLoaddEXT(matrixMode, memAddress(m)); + } + + // --- [ glMatrixMultfEXT ] --- + + public static native void nglMatrixMultfEXT(int matrixMode, long m); + + public static void glMatrixMultfEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat const *") FloatBuffer m) { + if (CHECKS) { + check(m, 16); + } + nglMatrixMultfEXT(matrixMode, memAddress(m)); + } + + // --- [ glMatrixMultdEXT ] --- + + public static native void nglMatrixMultdEXT(int matrixMode, long m); + + public static void glMatrixMultdEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLdouble const *") DoubleBuffer m) { + if (CHECKS) { + check(m, 16); + } + nglMatrixMultdEXT(matrixMode, memAddress(m)); + } + + // --- [ glMatrixLoadIdentityEXT ] --- + + public static native void glMatrixLoadIdentityEXT(@NativeType("GLenum") int matrixMode); + + // --- [ glMatrixRotatefEXT ] --- + + public static native void glMatrixRotatefEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat") float angle, @NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z); + + // --- [ glMatrixRotatedEXT ] --- + + public static native void glMatrixRotatedEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLdouble") double angle, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z); + + // --- [ glMatrixScalefEXT ] --- + + public static native void glMatrixScalefEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z); + + // --- [ glMatrixScaledEXT ] --- + + public static native void glMatrixScaledEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z); + + // --- [ glMatrixTranslatefEXT ] --- + + public static native void glMatrixTranslatefEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z); + + // --- [ glMatrixTranslatedEXT ] --- + + public static native void glMatrixTranslatedEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z); + + // --- [ glMatrixOrthoEXT ] --- + + public static native void glMatrixOrthoEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLdouble") double l, @NativeType("GLdouble") double r, @NativeType("GLdouble") double b, @NativeType("GLdouble") double t, @NativeType("GLdouble") double n, @NativeType("GLdouble") double f); + + // --- [ glMatrixFrustumEXT ] --- + + public static native void glMatrixFrustumEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLdouble") double l, @NativeType("GLdouble") double r, @NativeType("GLdouble") double b, @NativeType("GLdouble") double t, @NativeType("GLdouble") double n, @NativeType("GLdouble") double f); + + // --- [ glMatrixPushEXT ] --- + + public static native void glMatrixPushEXT(@NativeType("GLenum") int matrixMode); + + // --- [ glMatrixPopEXT ] --- + + public static native void glMatrixPopEXT(@NativeType("GLenum") int matrixMode); + + // --- [ glTextureParameteriEXT ] --- + + public static native void glTextureParameteriEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint") int param); + + // --- [ glTextureParameterivEXT ] --- + + public static native void nglTextureParameterivEXT(int texture, int target, int pname, long param); + + public static void glTextureParameterivEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer param) { + if (CHECKS) { + check(param, 4); + } + nglTextureParameterivEXT(texture, target, pname, memAddress(param)); + } + + // --- [ glTextureParameterfEXT ] --- + + public static native void glTextureParameterfEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat") float param); + + // --- [ glTextureParameterfvEXT ] --- + + public static native void nglTextureParameterfvEXT(int texture, int target, int pname, long param); + + public static void glTextureParameterfvEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer param) { + if (CHECKS) { + check(param, 4); + } + nglTextureParameterfvEXT(texture, target, pname, memAddress(param)); + } + + // --- [ glTextureImage1DEXT ] --- + + public static native void nglTextureImage1DEXT(int texture, int target, int level, int internalformat, int width, int border, int format, int type, long pixels); + + public static void glTextureImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer pixels) { + nglTextureImage1DEXT(texture, target, level, internalformat, width, border, format, type, memAddressSafe(pixels)); + } + + public static void glTextureImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") long pixels) { + nglTextureImage1DEXT(texture, target, level, internalformat, width, border, format, type, pixels); + } + + public static void glTextureImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer pixels) { + nglTextureImage1DEXT(texture, target, level, internalformat, width, border, format, type, memAddressSafe(pixels)); + } + + public static void glTextureImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer pixels) { + nglTextureImage1DEXT(texture, target, level, internalformat, width, border, format, type, memAddressSafe(pixels)); + } + + public static void glTextureImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer pixels) { + nglTextureImage1DEXT(texture, target, level, internalformat, width, border, format, type, memAddressSafe(pixels)); + } + + public static void glTextureImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") DoubleBuffer pixels) { + nglTextureImage1DEXT(texture, target, level, internalformat, width, border, format, type, memAddressSafe(pixels)); + } + + // --- [ glTextureImage2DEXT ] --- + + public static native void nglTextureImage2DEXT(int texture, int target, int level, int internalformat, int width, int height, int border, int format, int type, long pixels); + + public static void glTextureImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer pixels) { + nglTextureImage2DEXT(texture, target, level, internalformat, width, height, border, format, type, memAddressSafe(pixels)); + } + + public static void glTextureImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") long pixels) { + nglTextureImage2DEXT(texture, target, level, internalformat, width, height, border, format, type, pixels); + } + + public static void glTextureImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer pixels) { + nglTextureImage2DEXT(texture, target, level, internalformat, width, height, border, format, type, memAddressSafe(pixels)); + } + + public static void glTextureImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer pixels) { + nglTextureImage2DEXT(texture, target, level, internalformat, width, height, border, format, type, memAddressSafe(pixels)); + } + + public static void glTextureImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer pixels) { + nglTextureImage2DEXT(texture, target, level, internalformat, width, height, border, format, type, memAddressSafe(pixels)); + } + + public static void glTextureImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") DoubleBuffer pixels) { + nglTextureImage2DEXT(texture, target, level, internalformat, width, height, border, format, type, memAddressSafe(pixels)); + } + + // --- [ glTextureSubImage1DEXT ] --- + + public static native void nglTextureSubImage1DEXT(int texture, int target, int level, int xoffset, int width, int format, int type, long pixels); + + public static void glTextureSubImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer pixels) { + nglTextureSubImage1DEXT(texture, target, level, xoffset, width, format, type, memAddress(pixels)); + } + + public static void glTextureSubImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long pixels) { + nglTextureSubImage1DEXT(texture, target, level, xoffset, width, format, type, pixels); + } + + public static void glTextureSubImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer pixels) { + nglTextureSubImage1DEXT(texture, target, level, xoffset, width, format, type, memAddress(pixels)); + } + + public static void glTextureSubImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer pixels) { + nglTextureSubImage1DEXT(texture, target, level, xoffset, width, format, type, memAddress(pixels)); + } + + public static void glTextureSubImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer pixels) { + nglTextureSubImage1DEXT(texture, target, level, xoffset, width, format, type, memAddress(pixels)); + } + + public static void glTextureSubImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") DoubleBuffer pixels) { + nglTextureSubImage1DEXT(texture, target, level, xoffset, width, format, type, memAddress(pixels)); + } + + // --- [ glTextureSubImage2DEXT ] --- + + public static native void nglTextureSubImage2DEXT(int texture, int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, long pixels); + + public static void glTextureSubImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer pixels) { + nglTextureSubImage2DEXT(texture, target, level, xoffset, yoffset, width, height, format, type, memAddress(pixels)); + } + + public static void glTextureSubImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long pixels) { + nglTextureSubImage2DEXT(texture, target, level, xoffset, yoffset, width, height, format, type, pixels); + } + + public static void glTextureSubImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer pixels) { + nglTextureSubImage2DEXT(texture, target, level, xoffset, yoffset, width, height, format, type, memAddress(pixels)); + } + + public static void glTextureSubImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer pixels) { + nglTextureSubImage2DEXT(texture, target, level, xoffset, yoffset, width, height, format, type, memAddress(pixels)); + } + + public static void glTextureSubImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer pixels) { + nglTextureSubImage2DEXT(texture, target, level, xoffset, yoffset, width, height, format, type, memAddress(pixels)); + } + + public static void glTextureSubImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") DoubleBuffer pixels) { + nglTextureSubImage2DEXT(texture, target, level, xoffset, yoffset, width, height, format, type, memAddress(pixels)); + } + + // --- [ glCopyTextureImage1DEXT ] --- + + public static native void glCopyTextureImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLint") int border); + + // --- [ glCopyTextureImage2DEXT ] --- + + public static native void glCopyTextureImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border); + + // --- [ glCopyTextureSubImage1DEXT ] --- + + public static native void glCopyTextureSubImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width); + + // --- [ glCopyTextureSubImage2DEXT ] --- + + public static native void glCopyTextureSubImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glGetTextureImageEXT ] --- + + public static native void nglGetTextureImageEXT(int texture, int target, int level, int format, int type, long pixels); + + public static void glGetTextureImageEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer pixels) { + nglGetTextureImageEXT(texture, target, level, format, type, memAddress(pixels)); + } + + public static void glGetTextureImageEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") long pixels) { + nglGetTextureImageEXT(texture, target, level, format, type, pixels); + } + + public static void glGetTextureImageEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ShortBuffer pixels) { + nglGetTextureImageEXT(texture, target, level, format, type, memAddress(pixels)); + } + + public static void glGetTextureImageEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") IntBuffer pixels) { + nglGetTextureImageEXT(texture, target, level, format, type, memAddress(pixels)); + } + + public static void glGetTextureImageEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") FloatBuffer pixels) { + nglGetTextureImageEXT(texture, target, level, format, type, memAddress(pixels)); + } + + public static void glGetTextureImageEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") DoubleBuffer pixels) { + nglGetTextureImageEXT(texture, target, level, format, type, memAddress(pixels)); + } + + // --- [ glGetTextureParameterfvEXT ] --- + + public static native void nglGetTextureParameterfvEXT(int texture, int target, int pname, long params); + + public static void glGetTextureParameterfvEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetTextureParameterfvEXT(texture, target, pname, memAddress(params)); + } + + @NativeType("void") + public static float glGetTextureParameterfEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer params = stack.callocFloat(1); + nglGetTextureParameterfvEXT(texture, target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTextureParameterivEXT ] --- + + public static native void nglGetTextureParameterivEXT(int texture, int target, int pname, long params); + + public static void glGetTextureParameterivEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetTextureParameterivEXT(texture, target, pname, memAddress(params)); + } + + @NativeType("void") + public static int glGetTextureParameteriEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetTextureParameterivEXT(texture, target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTextureLevelParameterfvEXT ] --- + + public static native void nglGetTextureLevelParameterfvEXT(int texture, int target, int level, int pname, long params); + + public static void glGetTextureLevelParameterfvEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetTextureLevelParameterfvEXT(texture, target, level, pname, memAddress(params)); + } + + @NativeType("void") + public static float glGetTextureLevelParameterfEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer params = stack.callocFloat(1); + nglGetTextureLevelParameterfvEXT(texture, target, level, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTextureLevelParameterivEXT ] --- + + public static native void nglGetTextureLevelParameterivEXT(int texture, int target, int level, int pname, long params); + + public static void glGetTextureLevelParameterivEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetTextureLevelParameterivEXT(texture, target, level, pname, memAddress(params)); + } + + @NativeType("void") + public static int glGetTextureLevelParameteriEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetTextureLevelParameterivEXT(texture, target, level, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glTextureImage3DEXT ] --- + + public static native void nglTextureImage3DEXT(int texture, int target, int level, int internalformat, int width, int height, int depth, int border, int format, int type, long pixels); + + public static void glTextureImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer pixels) { + nglTextureImage3DEXT(texture, target, level, internalformat, width, height, depth, border, format, type, memAddressSafe(pixels)); + } + + public static void glTextureImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") long pixels) { + nglTextureImage3DEXT(texture, target, level, internalformat, width, height, depth, border, format, type, pixels); + } + + public static void glTextureImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer pixels) { + nglTextureImage3DEXT(texture, target, level, internalformat, width, height, depth, border, format, type, memAddressSafe(pixels)); + } + + public static void glTextureImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer pixels) { + nglTextureImage3DEXT(texture, target, level, internalformat, width, height, depth, border, format, type, memAddressSafe(pixels)); + } + + public static void glTextureImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer pixels) { + nglTextureImage3DEXT(texture, target, level, internalformat, width, height, depth, border, format, type, memAddressSafe(pixels)); + } + + public static void glTextureImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") DoubleBuffer pixels) { + nglTextureImage3DEXT(texture, target, level, internalformat, width, height, depth, border, format, type, memAddressSafe(pixels)); + } + + // --- [ glTextureSubImage3DEXT ] --- + + public static native void nglTextureSubImage3DEXT(int texture, int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, long pixels); + + public static void glTextureSubImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer pixels) { + nglTextureSubImage3DEXT(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddress(pixels)); + } + + public static void glTextureSubImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long pixels) { + nglTextureSubImage3DEXT(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + public static void glTextureSubImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer pixels) { + nglTextureSubImage3DEXT(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddress(pixels)); + } + + public static void glTextureSubImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer pixels) { + nglTextureSubImage3DEXT(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddress(pixels)); + } + + public static void glTextureSubImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer pixels) { + nglTextureSubImage3DEXT(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddress(pixels)); + } + + public static void glTextureSubImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") DoubleBuffer pixels) { + nglTextureSubImage3DEXT(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddress(pixels)); + } + + // --- [ glCopyTextureSubImage3DEXT ] --- + + public static native void glCopyTextureSubImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glBindMultiTextureEXT ] --- + + public static native void glBindMultiTextureEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLuint") int texture); + + // --- [ glMultiTexCoordPointerEXT ] --- + + public static native void nglMultiTexCoordPointerEXT(int texunit, int size, int type, int stride, long pointer); + + public static void glMultiTexCoordPointerEXT(@NativeType("GLenum") int texunit, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + nglMultiTexCoordPointerEXT(texunit, size, type, stride, memAddress(pointer)); + } + + public static void glMultiTexCoordPointerEXT(@NativeType("GLenum") int texunit, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + nglMultiTexCoordPointerEXT(texunit, size, type, stride, pointer); + } + + public static void glMultiTexCoordPointerEXT(@NativeType("GLenum") int texunit, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ShortBuffer pointer) { + nglMultiTexCoordPointerEXT(texunit, size, type, stride, memAddress(pointer)); + } + + public static void glMultiTexCoordPointerEXT(@NativeType("GLenum") int texunit, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") IntBuffer pointer) { + nglMultiTexCoordPointerEXT(texunit, size, type, stride, memAddress(pointer)); + } + + public static void glMultiTexCoordPointerEXT(@NativeType("GLenum") int texunit, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") FloatBuffer pointer) { + nglMultiTexCoordPointerEXT(texunit, size, type, stride, memAddress(pointer)); + } + + // --- [ glMultiTexEnvfEXT ] --- + + public static native void glMultiTexEnvfEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat") float param); + + // --- [ glMultiTexEnvfvEXT ] --- + + public static native void nglMultiTexEnvfvEXT(int texunit, int target, int pname, long params); + + public static void glMultiTexEnvfvEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglMultiTexEnvfvEXT(texunit, target, pname, memAddress(params)); + } + + // --- [ glMultiTexEnviEXT ] --- + + public static native void glMultiTexEnviEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint") int param); + + // --- [ glMultiTexEnvivEXT ] --- + + public static native void nglMultiTexEnvivEXT(int texunit, int target, int pname, long params); + + public static void glMultiTexEnvivEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglMultiTexEnvivEXT(texunit, target, pname, memAddress(params)); + } + + // --- [ glMultiTexGendEXT ] --- + + public static native void glMultiTexGendEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLdouble") double param); + + // --- [ glMultiTexGendvEXT ] --- + + public static native void nglMultiTexGendvEXT(int texunit, int coord, int pname, long params); + + public static void glMultiTexGendvEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLdouble const *") DoubleBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglMultiTexGendvEXT(texunit, coord, pname, memAddress(params)); + } + + // --- [ glMultiTexGenfEXT ] --- + + public static native void glMultiTexGenfEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLfloat") float param); + + // --- [ glMultiTexGenfvEXT ] --- + + public static native void nglMultiTexGenfvEXT(int texunit, int coord, int pname, long params); + + public static void glMultiTexGenfvEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglMultiTexGenfvEXT(texunit, coord, pname, memAddress(params)); + } + + // --- [ glMultiTexGeniEXT ] --- + + public static native void glMultiTexGeniEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLint") int param); + + // --- [ glMultiTexGenivEXT ] --- + + public static native void nglMultiTexGenivEXT(int texunit, int coord, int pname, long params); + + public static void glMultiTexGenivEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglMultiTexGenivEXT(texunit, coord, pname, memAddress(params)); + } + + // --- [ glGetMultiTexEnvfvEXT ] --- + + public static native void nglGetMultiTexEnvfvEXT(int texunit, int target, int pname, long params); + + public static void glGetMultiTexEnvfvEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetMultiTexEnvfvEXT(texunit, target, pname, memAddress(params)); + } + + @NativeType("void") + public static float glGetMultiTexEnvfEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer params = stack.callocFloat(1); + nglGetMultiTexEnvfvEXT(texunit, target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetMultiTexEnvivEXT ] --- + + public static native void nglGetMultiTexEnvivEXT(int texunit, int target, int pname, long params); + + public static void glGetMultiTexEnvivEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetMultiTexEnvivEXT(texunit, target, pname, memAddress(params)); + } + + @NativeType("void") + public static int glGetMultiTexEnviEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetMultiTexEnvivEXT(texunit, target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetMultiTexGendvEXT ] --- + + public static native void nglGetMultiTexGendvEXT(int texunit, int coord, int pname, long params); + + public static void glGetMultiTexGendvEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLdouble *") DoubleBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetMultiTexGendvEXT(texunit, coord, pname, memAddress(params)); + } + + @NativeType("void") + public static double glGetMultiTexGendEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int coord, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + DoubleBuffer params = stack.callocDouble(1); + nglGetMultiTexGendvEXT(texunit, coord, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetMultiTexGenfvEXT ] --- + + public static native void nglGetMultiTexGenfvEXT(int texunit, int coord, int pname, long params); + + public static void glGetMultiTexGenfvEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetMultiTexGenfvEXT(texunit, coord, pname, memAddress(params)); + } + + @NativeType("void") + public static float glGetMultiTexGenfEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int coord, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer params = stack.callocFloat(1); + nglGetMultiTexGenfvEXT(texunit, coord, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetMultiTexGenivEXT ] --- + + public static native void nglGetMultiTexGenivEXT(int texunit, int coord, int pname, long params); + + public static void glGetMultiTexGenivEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetMultiTexGenivEXT(texunit, coord, pname, memAddress(params)); + } + + @NativeType("void") + public static int glGetMultiTexGeniEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int coord, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetMultiTexGenivEXT(texunit, coord, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glMultiTexParameteriEXT ] --- + + public static native void glMultiTexParameteriEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint") int param); + + // --- [ glMultiTexParameterivEXT ] --- + + public static native void nglMultiTexParameterivEXT(int texunit, int target, int pname, long param); + + public static void glMultiTexParameterivEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer param) { + if (CHECKS) { + check(param, 4); + } + nglMultiTexParameterivEXT(texunit, target, pname, memAddress(param)); + } + + // --- [ glMultiTexParameterfEXT ] --- + + public static native void glMultiTexParameterfEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat") float param); + + // --- [ glMultiTexParameterfvEXT ] --- + + public static native void nglMultiTexParameterfvEXT(int texunit, int target, int pname, long param); + + public static void glMultiTexParameterfvEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer param) { + if (CHECKS) { + check(param, 4); + } + nglMultiTexParameterfvEXT(texunit, target, pname, memAddress(param)); + } + + // --- [ glMultiTexImage1DEXT ] --- + + public static native void nglMultiTexImage1DEXT(int texunit, int target, int level, int internalformat, int width, int border, int format, int type, long pixels); + + public static void glMultiTexImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer pixels) { + nglMultiTexImage1DEXT(texunit, target, level, internalformat, width, border, format, type, memAddressSafe(pixels)); + } + + public static void glMultiTexImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") long pixels) { + nglMultiTexImage1DEXT(texunit, target, level, internalformat, width, border, format, type, pixels); + } + + public static void glMultiTexImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer pixels) { + nglMultiTexImage1DEXT(texunit, target, level, internalformat, width, border, format, type, memAddressSafe(pixels)); + } + + public static void glMultiTexImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer pixels) { + nglMultiTexImage1DEXT(texunit, target, level, internalformat, width, border, format, type, memAddressSafe(pixels)); + } + + public static void glMultiTexImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer pixels) { + nglMultiTexImage1DEXT(texunit, target, level, internalformat, width, border, format, type, memAddressSafe(pixels)); + } + + public static void glMultiTexImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") DoubleBuffer pixels) { + nglMultiTexImage1DEXT(texunit, target, level, internalformat, width, border, format, type, memAddressSafe(pixels)); + } + + // --- [ glMultiTexImage2DEXT ] --- + + public static native void nglMultiTexImage2DEXT(int texunit, int target, int level, int internalformat, int width, int height, int border, int format, int type, long pixels); + + public static void glMultiTexImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer pixels) { + nglMultiTexImage2DEXT(texunit, target, level, internalformat, width, height, border, format, type, memAddressSafe(pixels)); + } + + public static void glMultiTexImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") long pixels) { + nglMultiTexImage2DEXT(texunit, target, level, internalformat, width, height, border, format, type, pixels); + } + + public static void glMultiTexImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer pixels) { + nglMultiTexImage2DEXT(texunit, target, level, internalformat, width, height, border, format, type, memAddressSafe(pixels)); + } + + public static void glMultiTexImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer pixels) { + nglMultiTexImage2DEXT(texunit, target, level, internalformat, width, height, border, format, type, memAddressSafe(pixels)); + } + + public static void glMultiTexImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer pixels) { + nglMultiTexImage2DEXT(texunit, target, level, internalformat, width, height, border, format, type, memAddressSafe(pixels)); + } + + public static void glMultiTexImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") DoubleBuffer pixels) { + nglMultiTexImage2DEXT(texunit, target, level, internalformat, width, height, border, format, type, memAddressSafe(pixels)); + } + + // --- [ glMultiTexSubImage1DEXT ] --- + + public static native void nglMultiTexSubImage1DEXT(int texunit, int target, int level, int xoffset, int width, int format, int type, long pixels); + + public static void glMultiTexSubImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer pixels) { + nglMultiTexSubImage1DEXT(texunit, target, level, xoffset, width, format, type, memAddress(pixels)); + } + + public static void glMultiTexSubImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long pixels) { + nglMultiTexSubImage1DEXT(texunit, target, level, xoffset, width, format, type, pixels); + } + + public static void glMultiTexSubImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer pixels) { + nglMultiTexSubImage1DEXT(texunit, target, level, xoffset, width, format, type, memAddress(pixels)); + } + + public static void glMultiTexSubImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer pixels) { + nglMultiTexSubImage1DEXT(texunit, target, level, xoffset, width, format, type, memAddress(pixels)); + } + + public static void glMultiTexSubImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer pixels) { + nglMultiTexSubImage1DEXT(texunit, target, level, xoffset, width, format, type, memAddress(pixels)); + } + + public static void glMultiTexSubImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") DoubleBuffer pixels) { + nglMultiTexSubImage1DEXT(texunit, target, level, xoffset, width, format, type, memAddress(pixels)); + } + + // --- [ glMultiTexSubImage2DEXT ] --- + + public static native void nglMultiTexSubImage2DEXT(int texunit, int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, long pixels); + + public static void glMultiTexSubImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer pixels) { + nglMultiTexSubImage2DEXT(texunit, target, level, xoffset, yoffset, width, height, format, type, memAddress(pixels)); + } + + public static void glMultiTexSubImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long pixels) { + nglMultiTexSubImage2DEXT(texunit, target, level, xoffset, yoffset, width, height, format, type, pixels); + } + + public static void glMultiTexSubImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer pixels) { + nglMultiTexSubImage2DEXT(texunit, target, level, xoffset, yoffset, width, height, format, type, memAddress(pixels)); + } + + public static void glMultiTexSubImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer pixels) { + nglMultiTexSubImage2DEXT(texunit, target, level, xoffset, yoffset, width, height, format, type, memAddress(pixels)); + } + + public static void glMultiTexSubImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer pixels) { + nglMultiTexSubImage2DEXT(texunit, target, level, xoffset, yoffset, width, height, format, type, memAddress(pixels)); + } + + public static void glMultiTexSubImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") DoubleBuffer pixels) { + nglMultiTexSubImage2DEXT(texunit, target, level, xoffset, yoffset, width, height, format, type, memAddress(pixels)); + } + + // --- [ glCopyMultiTexImage1DEXT ] --- + + public static native void glCopyMultiTexImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLint") int border); + + // --- [ glCopyMultiTexImage2DEXT ] --- + + public static native void glCopyMultiTexImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border); + + // --- [ glCopyMultiTexSubImage1DEXT ] --- + + public static native void glCopyMultiTexSubImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width); + + // --- [ glCopyMultiTexSubImage2DEXT ] --- + + public static native void glCopyMultiTexSubImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glGetMultiTexImageEXT ] --- + + public static native void nglGetMultiTexImageEXT(int texunit, int target, int level, int format, int type, long pixels); + + public static void glGetMultiTexImageEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer pixels) { + nglGetMultiTexImageEXT(texunit, target, level, format, type, memAddress(pixels)); + } + + public static void glGetMultiTexImageEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") long pixels) { + nglGetMultiTexImageEXT(texunit, target, level, format, type, pixels); + } + + public static void glGetMultiTexImageEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ShortBuffer pixels) { + nglGetMultiTexImageEXT(texunit, target, level, format, type, memAddress(pixels)); + } + + public static void glGetMultiTexImageEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") IntBuffer pixels) { + nglGetMultiTexImageEXT(texunit, target, level, format, type, memAddress(pixels)); + } + + public static void glGetMultiTexImageEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") FloatBuffer pixels) { + nglGetMultiTexImageEXT(texunit, target, level, format, type, memAddress(pixels)); + } + + public static void glGetMultiTexImageEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") DoubleBuffer pixels) { + nglGetMultiTexImageEXT(texunit, target, level, format, type, memAddress(pixels)); + } + + // --- [ glGetMultiTexParameterfvEXT ] --- + + public static native void nglGetMultiTexParameterfvEXT(int texunit, int target, int pname, long params); + + public static void glGetMultiTexParameterfvEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetMultiTexParameterfvEXT(texunit, target, pname, memAddress(params)); + } + + @NativeType("void") + public static float glGetMultiTexParameterfEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer params = stack.callocFloat(1); + nglGetMultiTexParameterfvEXT(texunit, target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetMultiTexParameterivEXT ] --- + + public static native void nglGetMultiTexParameterivEXT(int texunit, int target, int pname, long params); + + public static void glGetMultiTexParameterivEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetMultiTexParameterivEXT(texunit, target, pname, memAddress(params)); + } + + @NativeType("void") + public static int glGetMultiTexParameteriEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetMultiTexParameterivEXT(texunit, target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetMultiTexLevelParameterfvEXT ] --- + + public static native void nglGetMultiTexLevelParameterfvEXT(int texunit, int target, int level, int pname, long params); + + public static void glGetMultiTexLevelParameterfvEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetMultiTexLevelParameterfvEXT(texunit, target, level, pname, memAddress(params)); + } + + @NativeType("void") + public static float glGetMultiTexLevelParameterfEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer params = stack.callocFloat(1); + nglGetMultiTexLevelParameterfvEXT(texunit, target, level, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetMultiTexLevelParameterivEXT ] --- + + public static native void nglGetMultiTexLevelParameterivEXT(int texunit, int target, int level, int pname, long params); + + public static void glGetMultiTexLevelParameterivEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetMultiTexLevelParameterivEXT(texunit, target, level, pname, memAddress(params)); + } + + @NativeType("void") + public static int glGetMultiTexLevelParameteriEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetMultiTexLevelParameterivEXT(texunit, target, level, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glMultiTexImage3DEXT ] --- + + public static native void nglMultiTexImage3DEXT(int texunit, int target, int level, int internalformat, int width, int height, int depth, int border, int format, int type, long pixels); + + public static void glMultiTexImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer pixels) { + nglMultiTexImage3DEXT(texunit, target, level, internalformat, width, height, depth, border, format, type, memAddressSafe(pixels)); + } + + public static void glMultiTexImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") long pixels) { + nglMultiTexImage3DEXT(texunit, target, level, internalformat, width, height, depth, border, format, type, pixels); + } + + public static void glMultiTexImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer pixels) { + nglMultiTexImage3DEXT(texunit, target, level, internalformat, width, height, depth, border, format, type, memAddressSafe(pixels)); + } + + public static void glMultiTexImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer pixels) { + nglMultiTexImage3DEXT(texunit, target, level, internalformat, width, height, depth, border, format, type, memAddressSafe(pixels)); + } + + public static void glMultiTexImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer pixels) { + nglMultiTexImage3DEXT(texunit, target, level, internalformat, width, height, depth, border, format, type, memAddressSafe(pixels)); + } + + public static void glMultiTexImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") DoubleBuffer pixels) { + nglMultiTexImage3DEXT(texunit, target, level, internalformat, width, height, depth, border, format, type, memAddressSafe(pixels)); + } + + // --- [ glMultiTexSubImage3DEXT ] --- + + public static native void nglMultiTexSubImage3DEXT(int texunit, int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, long pixels); + + public static void glMultiTexSubImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer pixels) { + nglMultiTexSubImage3DEXT(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddress(pixels)); + } + + public static void glMultiTexSubImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long pixels) { + nglMultiTexSubImage3DEXT(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + public static void glMultiTexSubImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer pixels) { + nglMultiTexSubImage3DEXT(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddress(pixels)); + } + + public static void glMultiTexSubImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer pixels) { + nglMultiTexSubImage3DEXT(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddress(pixels)); + } + + public static void glMultiTexSubImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer pixels) { + nglMultiTexSubImage3DEXT(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddress(pixels)); + } + + public static void glMultiTexSubImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") DoubleBuffer pixels) { + nglMultiTexSubImage3DEXT(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddress(pixels)); + } + + // --- [ glCopyMultiTexSubImage3DEXT ] --- + + public static native void glCopyMultiTexSubImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glEnableClientStateIndexedEXT ] --- + + public static native void glEnableClientStateIndexedEXT(@NativeType("GLenum") int array, @NativeType("GLuint") int index); + + // --- [ glDisableClientStateIndexedEXT ] --- + + public static native void glDisableClientStateIndexedEXT(@NativeType("GLenum") int array, @NativeType("GLuint") int index); + + // --- [ glEnableClientStateiEXT ] --- + + public static native void glEnableClientStateiEXT(@NativeType("GLenum") int array, @NativeType("GLuint") int index); + + // --- [ glDisableClientStateiEXT ] --- + + public static native void glDisableClientStateiEXT(@NativeType("GLenum") int array, @NativeType("GLuint") int index); + + // --- [ glGetFloatIndexedvEXT ] --- + + public static native void nglGetFloatIndexedvEXT(int target, int index, long params); + + public static void glGetFloatIndexedvEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetFloatIndexedvEXT(target, index, memAddress(params)); + } + + @NativeType("void") + public static float glGetFloatIndexedEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer params = stack.callocFloat(1); + nglGetFloatIndexedvEXT(target, index, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetDoubleIndexedvEXT ] --- + + public static native void nglGetDoubleIndexedvEXT(int target, int index, long params); + + public static void glGetDoubleIndexedvEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble *") DoubleBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetDoubleIndexedvEXT(target, index, memAddress(params)); + } + + @NativeType("void") + public static double glGetDoubleIndexedEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + DoubleBuffer params = stack.callocDouble(1); + nglGetDoubleIndexedvEXT(target, index, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetPointerIndexedvEXT ] --- + + public static native void nglGetPointerIndexedvEXT(int target, int index, long params); + + public static void glGetPointerIndexedvEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("void **") PointerBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetPointerIndexedvEXT(target, index, memAddress(params)); + } + + @NativeType("void") + public static long glGetPointerIndexedEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + PointerBuffer params = stack.callocPointer(1); + nglGetPointerIndexedvEXT(target, index, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetFloati_vEXT ] --- + + public static native void nglGetFloati_vEXT(int pname, int index, long params); + + public static void glGetFloati_vEXT(@NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetFloati_vEXT(pname, index, memAddress(params)); + } + + @NativeType("void") + public static float glGetFloatiEXT(@NativeType("GLenum") int pname, @NativeType("GLuint") int index) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer params = stack.callocFloat(1); + nglGetFloati_vEXT(pname, index, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetDoublei_vEXT ] --- + + public static native void nglGetDoublei_vEXT(int pname, int index, long params); + + public static void glGetDoublei_vEXT(@NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLdouble *") DoubleBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetDoublei_vEXT(pname, index, memAddress(params)); + } + + @NativeType("void") + public static double glGetDoubleiEXT(@NativeType("GLenum") int pname, @NativeType("GLuint") int index) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + DoubleBuffer params = stack.callocDouble(1); + nglGetDoublei_vEXT(pname, index, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetPointeri_vEXT ] --- + + public static native void nglGetPointeri_vEXT(int pname, int index, long params); + + public static void glGetPointeri_vEXT(@NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("void **") PointerBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetPointeri_vEXT(pname, index, memAddress(params)); + } + + @NativeType("void") + public static long glGetPointeriEXT(@NativeType("GLenum") int pname, @NativeType("GLuint") int index) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + PointerBuffer params = stack.callocPointer(1); + nglGetPointeri_vEXT(pname, index, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glEnableIndexedEXT ] --- + + public static void glEnableIndexedEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + EXTDrawBuffers2.glEnableIndexedEXT(target, index); + } + + // --- [ glDisableIndexedEXT ] --- + + public static void glDisableIndexedEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + EXTDrawBuffers2.glDisableIndexedEXT(target, index); + } + + // --- [ glIsEnabledIndexedEXT ] --- + + @NativeType("GLboolean") + public static boolean glIsEnabledIndexedEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + return EXTDrawBuffers2.glIsEnabledIndexedEXT(target, index); + } + + // --- [ glGetIntegerIndexedvEXT ] --- + + public static void nglGetIntegerIndexedvEXT(int target, int index, long data) { + EXTDrawBuffers2.nglGetIntegerIndexedvEXT(target, index, data); + } + + public static void glGetIntegerIndexedvEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLint *") IntBuffer data) { + EXTDrawBuffers2.glGetIntegerIndexedvEXT(target, index, data); + } + + @NativeType("void") + public static int glGetIntegerIndexedEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + return EXTDrawBuffers2.glGetIntegerIndexedEXT(target, index); + } + + // --- [ glGetBooleanIndexedvEXT ] --- + + public static void nglGetBooleanIndexedvEXT(int target, int index, long data) { + EXTDrawBuffers2.nglGetBooleanIndexedvEXT(target, index, data); + } + + public static void glGetBooleanIndexedvEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLboolean *") ByteBuffer data) { + EXTDrawBuffers2.glGetBooleanIndexedvEXT(target, index, data); + } + + @NativeType("void") + public static boolean glGetBooleanIndexedEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + return EXTDrawBuffers2.glGetBooleanIndexedEXT(target, index); + } + + // --- [ glNamedProgramStringEXT ] --- + + public static native void nglNamedProgramStringEXT(int program, int target, int format, int len, long string); + + public static void glNamedProgramStringEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer string) { + nglNamedProgramStringEXT(program, target, format, string.remaining(), memAddress(string)); + } + + // --- [ glNamedProgramLocalParameter4dEXT ] --- + + public static native void glNamedProgramLocalParameter4dEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z, @NativeType("GLdouble") double w); + + // --- [ glNamedProgramLocalParameter4dvEXT ] --- + + public static native void nglNamedProgramLocalParameter4dvEXT(int program, int target, int index, long params); + + public static void glNamedProgramLocalParameter4dvEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglNamedProgramLocalParameter4dvEXT(program, target, index, memAddress(params)); + } + + // --- [ glNamedProgramLocalParameter4fEXT ] --- + + public static native void glNamedProgramLocalParameter4fEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z, @NativeType("GLfloat") float w); + + // --- [ glNamedProgramLocalParameter4fvEXT ] --- + + public static native void nglNamedProgramLocalParameter4fvEXT(int program, int target, int index, long params); + + public static void glNamedProgramLocalParameter4fvEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglNamedProgramLocalParameter4fvEXT(program, target, index, memAddress(params)); + } + + // --- [ glGetNamedProgramLocalParameterdvEXT ] --- + + public static native void nglGetNamedProgramLocalParameterdvEXT(int program, int target, int index, long params); + + public static void glGetNamedProgramLocalParameterdvEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble *") DoubleBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglGetNamedProgramLocalParameterdvEXT(program, target, index, memAddress(params)); + } + + // --- [ glGetNamedProgramLocalParameterfvEXT ] --- + + public static native void nglGetNamedProgramLocalParameterfvEXT(int program, int target, int index, long params); + + public static void glGetNamedProgramLocalParameterfvEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglGetNamedProgramLocalParameterfvEXT(program, target, index, memAddress(params)); + } + + // --- [ glGetNamedProgramivEXT ] --- + + public static native void nglGetNamedProgramivEXT(int program, int target, int pname, long params); + + public static void glGetNamedProgramivEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetNamedProgramivEXT(program, target, pname, memAddress(params)); + } + + @NativeType("void") + public static int glGetNamedProgramiEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetNamedProgramivEXT(program, target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetNamedProgramStringEXT ] --- + + public static native void nglGetNamedProgramStringEXT(int program, int target, int pname, long string); + + public static void glGetNamedProgramStringEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("void *") ByteBuffer string) { + if (CHECKS) { + if (DEBUG) { + check(string, glGetNamedProgramiEXT(program, target, ARBVertexProgram.GL_PROGRAM_LENGTH_ARB)); + } + } + nglGetNamedProgramStringEXT(program, target, pname, memAddress(string)); + } + + // --- [ glCompressedTextureImage3DEXT ] --- + + public static native void nglCompressedTextureImage3DEXT(int texture, int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, long data); + + public static void glCompressedTextureImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLsizei") int imageSize, @Nullable @NativeType("void const *") long data) { + nglCompressedTextureImage3DEXT(texture, target, level, internalformat, width, height, depth, border, imageSize, data); + } + + public static void glCompressedTextureImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @Nullable @NativeType("void const *") ByteBuffer data) { + nglCompressedTextureImage3DEXT(texture, target, level, internalformat, width, height, depth, border, remainingSafe(data), memAddressSafe(data)); + } + + // --- [ glCompressedTextureImage2DEXT ] --- + + public static native void nglCompressedTextureImage2DEXT(int texture, int target, int level, int internalformat, int width, int height, int border, int imageSize, long data); + + public static void glCompressedTextureImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLsizei") int imageSize, @Nullable @NativeType("void const *") long data) { + nglCompressedTextureImage2DEXT(texture, target, level, internalformat, width, height, border, imageSize, data); + } + + public static void glCompressedTextureImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @Nullable @NativeType("void const *") ByteBuffer data) { + nglCompressedTextureImage2DEXT(texture, target, level, internalformat, width, height, border, remainingSafe(data), memAddressSafe(data)); + } + + // --- [ glCompressedTextureImage1DEXT ] --- + + public static native void nglCompressedTextureImage1DEXT(int texture, int target, int level, int internalformat, int width, int border, int imageSize, long data); + + public static void glCompressedTextureImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLsizei") int imageSize, @Nullable @NativeType("void const *") long data) { + nglCompressedTextureImage1DEXT(texture, target, level, internalformat, width, border, imageSize, data); + } + + public static void glCompressedTextureImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @Nullable @NativeType("void const *") ByteBuffer data) { + nglCompressedTextureImage1DEXT(texture, target, level, internalformat, width, border, remainingSafe(data), memAddressSafe(data)); + } + + // --- [ glCompressedTextureSubImage3DEXT ] --- + + public static native void nglCompressedTextureSubImage3DEXT(int texture, int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, long data); + + public static void glCompressedTextureSubImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + nglCompressedTextureSubImage3DEXT(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); + } + + public static void glCompressedTextureSubImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + nglCompressedTextureSubImage3DEXT(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, data.remaining(), memAddress(data)); + } + + // --- [ glCompressedTextureSubImage2DEXT ] --- + + public static native void nglCompressedTextureSubImage2DEXT(int texture, int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, long data); + + public static void glCompressedTextureSubImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + nglCompressedTextureSubImage2DEXT(texture, target, level, xoffset, yoffset, width, height, format, imageSize, data); + } + + public static void glCompressedTextureSubImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + nglCompressedTextureSubImage2DEXT(texture, target, level, xoffset, yoffset, width, height, format, data.remaining(), memAddress(data)); + } + + // --- [ glCompressedTextureSubImage1DEXT ] --- + + public static native void nglCompressedTextureSubImage1DEXT(int texture, int target, int level, int xoffset, int width, int format, int imageSize, long data); + + public static void glCompressedTextureSubImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + nglCompressedTextureSubImage1DEXT(texture, target, level, xoffset, width, format, imageSize, data); + } + + public static void glCompressedTextureSubImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + nglCompressedTextureSubImage1DEXT(texture, target, level, xoffset, width, format, data.remaining(), memAddress(data)); + } + + // --- [ glGetCompressedTextureImageEXT ] --- + + public static native void nglGetCompressedTextureImageEXT(int texture, int target, int level, long img); + + public static void glGetCompressedTextureImageEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("void *") ByteBuffer img) { + if (CHECKS) { + if (DEBUG) { + check(img, glGetTextureLevelParameteriEXT(texture, target, level, GL13.GL_TEXTURE_COMPRESSED_IMAGE_SIZE)); + } + } + nglGetCompressedTextureImageEXT(texture, target, level, memAddress(img)); + } + + public static void glGetCompressedTextureImageEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("void *") long img) { + nglGetCompressedTextureImageEXT(texture, target, level, img); + } + + // --- [ glCompressedMultiTexImage3DEXT ] --- + + public static native void nglCompressedMultiTexImage3DEXT(int texunit, int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, long data); + + public static void glCompressedMultiTexImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLsizei") int imageSize, @Nullable @NativeType("void const *") long data) { + nglCompressedMultiTexImage3DEXT(texunit, target, level, internalformat, width, height, depth, border, imageSize, data); + } + + public static void glCompressedMultiTexImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @Nullable @NativeType("void const *") ByteBuffer data) { + nglCompressedMultiTexImage3DEXT(texunit, target, level, internalformat, width, height, depth, border, remainingSafe(data), memAddressSafe(data)); + } + + // --- [ glCompressedMultiTexImage2DEXT ] --- + + public static native void nglCompressedMultiTexImage2DEXT(int texunit, int target, int level, int internalformat, int width, int height, int border, int imageSize, long data); + + public static void glCompressedMultiTexImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLsizei") int imageSize, @Nullable @NativeType("void const *") long data) { + nglCompressedMultiTexImage2DEXT(texunit, target, level, internalformat, width, height, border, imageSize, data); + } + + public static void glCompressedMultiTexImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @Nullable @NativeType("void const *") ByteBuffer data) { + nglCompressedMultiTexImage2DEXT(texunit, target, level, internalformat, width, height, border, remainingSafe(data), memAddressSafe(data)); + } + + // --- [ glCompressedMultiTexImage1DEXT ] --- + + public static native void nglCompressedMultiTexImage1DEXT(int texunit, int target, int level, int internalformat, int width, int border, int imageSize, long data); + + public static void glCompressedMultiTexImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLsizei") int imageSize, @Nullable @NativeType("void const *") long data) { + nglCompressedMultiTexImage1DEXT(texunit, target, level, internalformat, width, border, imageSize, data); + } + + public static void glCompressedMultiTexImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @Nullable @NativeType("void const *") ByteBuffer data) { + nglCompressedMultiTexImage1DEXT(texunit, target, level, internalformat, width, border, remainingSafe(data), memAddressSafe(data)); + } + + // --- [ glCompressedMultiTexSubImage3DEXT ] --- + + public static native void nglCompressedMultiTexSubImage3DEXT(int texunit, int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, long data); + + public static void glCompressedMultiTexSubImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + nglCompressedMultiTexSubImage3DEXT(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); + } + + public static void glCompressedMultiTexSubImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + nglCompressedMultiTexSubImage3DEXT(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, data.remaining(), memAddress(data)); + } + + // --- [ glCompressedMultiTexSubImage2DEXT ] --- + + public static native void nglCompressedMultiTexSubImage2DEXT(int texunit, int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, long data); + + public static void glCompressedMultiTexSubImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + nglCompressedMultiTexSubImage2DEXT(texunit, target, level, xoffset, yoffset, width, height, format, imageSize, data); + } + + public static void glCompressedMultiTexSubImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + nglCompressedMultiTexSubImage2DEXT(texunit, target, level, xoffset, yoffset, width, height, format, data.remaining(), memAddress(data)); + } + + // --- [ glCompressedMultiTexSubImage1DEXT ] --- + + public static native void nglCompressedMultiTexSubImage1DEXT(int texunit, int target, int level, int xoffset, int width, int format, int imageSize, long data); + + public static void glCompressedMultiTexSubImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + nglCompressedMultiTexSubImage1DEXT(texunit, target, level, xoffset, width, format, imageSize, data); + } + + public static void glCompressedMultiTexSubImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + nglCompressedMultiTexSubImage1DEXT(texunit, target, level, xoffset, width, format, data.remaining(), memAddress(data)); + } + + // --- [ glGetCompressedMultiTexImageEXT ] --- + + public static native void nglGetCompressedMultiTexImageEXT(int texunit, int target, int level, long img); + + public static void glGetCompressedMultiTexImageEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("void *") ByteBuffer img) { + if (CHECKS) { + if (DEBUG) { + check(img, glGetMultiTexLevelParameteriEXT(texunit, target, level, GL13.GL_TEXTURE_COMPRESSED_IMAGE_SIZE)); + } + } + nglGetCompressedMultiTexImageEXT(texunit, target, level, memAddress(img)); + } + + public static void glGetCompressedMultiTexImageEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("void *") long img) { + nglGetCompressedMultiTexImageEXT(texunit, target, level, img); + } + + // --- [ glMatrixLoadTransposefEXT ] --- + + public static native void nglMatrixLoadTransposefEXT(int matrixMode, long m); + + public static void glMatrixLoadTransposefEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat const *") FloatBuffer m) { + if (CHECKS) { + check(m, 16); + } + nglMatrixLoadTransposefEXT(matrixMode, memAddress(m)); + } + + // --- [ glMatrixLoadTransposedEXT ] --- + + public static native void nglMatrixLoadTransposedEXT(int matrixMode, long m); + + public static void glMatrixLoadTransposedEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLdouble const *") DoubleBuffer m) { + if (CHECKS) { + check(m, 16); + } + nglMatrixLoadTransposedEXT(matrixMode, memAddress(m)); + } + + // --- [ glMatrixMultTransposefEXT ] --- + + public static native void nglMatrixMultTransposefEXT(int matrixMode, long m); + + public static void glMatrixMultTransposefEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat const *") FloatBuffer m) { + if (CHECKS) { + check(m, 16); + } + nglMatrixMultTransposefEXT(matrixMode, memAddress(m)); + } + + // --- [ glMatrixMultTransposedEXT ] --- + + public static native void nglMatrixMultTransposedEXT(int matrixMode, long m); + + public static void glMatrixMultTransposedEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLdouble const *") DoubleBuffer m) { + if (CHECKS) { + check(m, 16); + } + nglMatrixMultTransposedEXT(matrixMode, memAddress(m)); + } + + // --- [ glNamedBufferDataEXT ] --- + + public static native void nglNamedBufferDataEXT(int buffer, long size, long data, int usage); + + public static void glNamedBufferDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int usage) { + nglNamedBufferDataEXT(buffer, size, NULL, usage); + } + + public static void glNamedBufferDataEXT(@NativeType("GLuint") int buffer, @NativeType("void const *") ByteBuffer data, @NativeType("GLenum") int usage) { + nglNamedBufferDataEXT(buffer, data.remaining(), memAddress(data), usage); + } + + public static void glNamedBufferDataEXT(@NativeType("GLuint") int buffer, @NativeType("void const *") ShortBuffer data, @NativeType("GLenum") int usage) { + nglNamedBufferDataEXT(buffer, Integer.toUnsignedLong(data.remaining()) << 1, memAddress(data), usage); + } + + public static void glNamedBufferDataEXT(@NativeType("GLuint") int buffer, @NativeType("void const *") IntBuffer data, @NativeType("GLenum") int usage) { + nglNamedBufferDataEXT(buffer, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data), usage); + } + + public static void glNamedBufferDataEXT(@NativeType("GLuint") int buffer, @NativeType("void const *") FloatBuffer data, @NativeType("GLenum") int usage) { + nglNamedBufferDataEXT(buffer, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data), usage); + } + + public static void glNamedBufferDataEXT(@NativeType("GLuint") int buffer, @NativeType("void const *") DoubleBuffer data, @NativeType("GLenum") int usage) { + nglNamedBufferDataEXT(buffer, Integer.toUnsignedLong(data.remaining()) << 3, memAddress(data), usage); + } + + // --- [ glNamedBufferSubDataEXT ] --- + + public static native void nglNamedBufferSubDataEXT(int buffer, long offset, long size, long data); + + public static void glNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") ByteBuffer data) { + nglNamedBufferSubDataEXT(buffer, offset, data.remaining(), memAddress(data)); + } + + public static void glNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") ShortBuffer data) { + nglNamedBufferSubDataEXT(buffer, offset, Integer.toUnsignedLong(data.remaining()) << 1, memAddress(data)); + } + + public static void glNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") IntBuffer data) { + nglNamedBufferSubDataEXT(buffer, offset, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data)); + } + + public static void glNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") FloatBuffer data) { + nglNamedBufferSubDataEXT(buffer, offset, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data)); + } + + public static void glNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") DoubleBuffer data) { + nglNamedBufferSubDataEXT(buffer, offset, Integer.toUnsignedLong(data.remaining()) << 3, memAddress(data)); + } + + // --- [ glMapNamedBufferEXT ] --- + + public static native long nglMapNamedBufferEXT(int buffer, int access); + + @Nullable + @NativeType("void *") + public static ByteBuffer glMapNamedBufferEXT(@NativeType("GLuint") int buffer, @NativeType("GLenum") int access) { + long __result = nglMapNamedBufferEXT(buffer, access); + return memByteBufferSafe(__result, glGetNamedBufferParameteriEXT(buffer, GL15.GL_BUFFER_SIZE)); + } + + @Nullable + @NativeType("void *") + public static ByteBuffer glMapNamedBufferEXT(@NativeType("GLuint") int buffer, @NativeType("GLenum") int access, @Nullable ByteBuffer old_buffer) { + long __result = nglMapNamedBufferEXT(buffer, access); + int length = glGetNamedBufferParameteriEXT(buffer, GL15.GL_BUFFER_SIZE); + return apiGetMappedBuffer(old_buffer, __result, length); + } + + @Nullable + @NativeType("void *") + public static ByteBuffer glMapNamedBufferEXT(@NativeType("GLuint") int buffer, @NativeType("GLenum") int access, long length, @Nullable ByteBuffer old_buffer) { + long __result = nglMapNamedBufferEXT(buffer, access); + return apiGetMappedBuffer(old_buffer, __result, (int)length); + } + + // --- [ glUnmapNamedBufferEXT ] --- + + @NativeType("GLboolean") + public static native boolean glUnmapNamedBufferEXT(@NativeType("GLuint") int buffer); + + // --- [ glGetNamedBufferParameterivEXT ] --- + + public static native void nglGetNamedBufferParameterivEXT(int buffer, int pname, long params); + + public static void glGetNamedBufferParameterivEXT(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetNamedBufferParameterivEXT(buffer, pname, memAddress(params)); + } + + @NativeType("void") + public static int glGetNamedBufferParameteriEXT(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetNamedBufferParameterivEXT(buffer, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetNamedBufferSubDataEXT ] --- + + public static native void nglGetNamedBufferSubDataEXT(int buffer, long offset, long size, long data); + + public static void glGetNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") ByteBuffer data) { + nglGetNamedBufferSubDataEXT(buffer, offset, data.remaining(), memAddress(data)); + } + + public static void glGetNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") ShortBuffer data) { + nglGetNamedBufferSubDataEXT(buffer, offset, Integer.toUnsignedLong(data.remaining()) << 1, memAddress(data)); + } + + public static void glGetNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") IntBuffer data) { + nglGetNamedBufferSubDataEXT(buffer, offset, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data)); + } + + public static void glGetNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") FloatBuffer data) { + nglGetNamedBufferSubDataEXT(buffer, offset, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data)); + } + + public static void glGetNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") DoubleBuffer data) { + nglGetNamedBufferSubDataEXT(buffer, offset, Integer.toUnsignedLong(data.remaining()) << 3, memAddress(data)); + } + + // --- [ glProgramUniform1fEXT ] --- + + public static native void glProgramUniform1fEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat") float v0); + + // --- [ glProgramUniform2fEXT ] --- + + public static native void glProgramUniform2fEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1); + + // --- [ glProgramUniform3fEXT ] --- + + public static native void glProgramUniform3fEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1, @NativeType("GLfloat") float v2); + + // --- [ glProgramUniform4fEXT ] --- + + public static native void glProgramUniform4fEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1, @NativeType("GLfloat") float v2, @NativeType("GLfloat") float v3); + + // --- [ glProgramUniform1iEXT ] --- + + public static native void glProgramUniform1iEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint") int v0); + + // --- [ glProgramUniform2iEXT ] --- + + public static native void glProgramUniform2iEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint") int v0, @NativeType("GLint") int v1); + + // --- [ glProgramUniform3iEXT ] --- + + public static native void glProgramUniform3iEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint") int v0, @NativeType("GLint") int v1, @NativeType("GLint") int v2); + + // --- [ glProgramUniform4iEXT ] --- + + public static native void glProgramUniform4iEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint") int v0, @NativeType("GLint") int v1, @NativeType("GLint") int v2, @NativeType("GLint") int v3); + + // --- [ glProgramUniform1fvEXT ] --- + + public static native void nglProgramUniform1fvEXT(int program, int location, int count, long value); + + public static void glProgramUniform1fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniform1fvEXT(program, location, value.remaining(), memAddress(value)); + } + + // --- [ glProgramUniform2fvEXT ] --- + + public static native void nglProgramUniform2fvEXT(int program, int location, int count, long value); + + public static void glProgramUniform2fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniform2fvEXT(program, location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glProgramUniform3fvEXT ] --- + + public static native void nglProgramUniform3fvEXT(int program, int location, int count, long value); + + public static void glProgramUniform3fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniform3fvEXT(program, location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glProgramUniform4fvEXT ] --- + + public static native void nglProgramUniform4fvEXT(int program, int location, int count, long value); + + public static void glProgramUniform4fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniform4fvEXT(program, location, value.remaining() >> 2, memAddress(value)); + } + + // --- [ glProgramUniform1ivEXT ] --- + + public static native void nglProgramUniform1ivEXT(int program, int location, int count, long value); + + public static void glProgramUniform1ivEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + nglProgramUniform1ivEXT(program, location, value.remaining(), memAddress(value)); + } + + // --- [ glProgramUniform2ivEXT ] --- + + public static native void nglProgramUniform2ivEXT(int program, int location, int count, long value); + + public static void glProgramUniform2ivEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + nglProgramUniform2ivEXT(program, location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glProgramUniform3ivEXT ] --- + + public static native void nglProgramUniform3ivEXT(int program, int location, int count, long value); + + public static void glProgramUniform3ivEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + nglProgramUniform3ivEXT(program, location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glProgramUniform4ivEXT ] --- + + public static native void nglProgramUniform4ivEXT(int program, int location, int count, long value); + + public static void glProgramUniform4ivEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + nglProgramUniform4ivEXT(program, location, value.remaining() >> 2, memAddress(value)); + } + + // --- [ glProgramUniformMatrix2fvEXT ] --- + + public static native void nglProgramUniformMatrix2fvEXT(int program, int location, int count, boolean transpose, long value); + + public static void glProgramUniformMatrix2fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniformMatrix2fvEXT(program, location, value.remaining() >> 2, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix3fvEXT ] --- + + public static native void nglProgramUniformMatrix3fvEXT(int program, int location, int count, boolean transpose, long value); + + public static void glProgramUniformMatrix3fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniformMatrix3fvEXT(program, location, value.remaining() / 9, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix4fvEXT ] --- + + public static native void nglProgramUniformMatrix4fvEXT(int program, int location, int count, boolean transpose, long value); + + public static void glProgramUniformMatrix4fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniformMatrix4fvEXT(program, location, value.remaining() >> 4, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix2x3fvEXT ] --- + + public static native void nglProgramUniformMatrix2x3fvEXT(int program, int location, int count, boolean transpose, long value); + + public static void glProgramUniformMatrix2x3fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniformMatrix2x3fvEXT(program, location, value.remaining() / 6, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix3x2fvEXT ] --- + + public static native void nglProgramUniformMatrix3x2fvEXT(int program, int location, int count, boolean transpose, long value); + + public static void glProgramUniformMatrix3x2fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniformMatrix3x2fvEXT(program, location, value.remaining() / 6, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix2x4fvEXT ] --- + + public static native void nglProgramUniformMatrix2x4fvEXT(int program, int location, int count, boolean transpose, long value); + + public static void glProgramUniformMatrix2x4fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniformMatrix2x4fvEXT(program, location, value.remaining() >> 3, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix4x2fvEXT ] --- + + public static native void nglProgramUniformMatrix4x2fvEXT(int program, int location, int count, boolean transpose, long value); + + public static void glProgramUniformMatrix4x2fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniformMatrix4x2fvEXT(program, location, value.remaining() >> 3, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix3x4fvEXT ] --- + + public static native void nglProgramUniformMatrix3x4fvEXT(int program, int location, int count, boolean transpose, long value); + + public static void glProgramUniformMatrix3x4fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniformMatrix3x4fvEXT(program, location, value.remaining() / 12, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix4x3fvEXT ] --- + + public static native void nglProgramUniformMatrix4x3fvEXT(int program, int location, int count, boolean transpose, long value); + + public static void glProgramUniformMatrix4x3fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniformMatrix4x3fvEXT(program, location, value.remaining() / 12, transpose, memAddress(value)); + } + + // --- [ glTextureBufferEXT ] --- + + public static native void glTextureBufferEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLuint") int buffer); + + // --- [ glMultiTexBufferEXT ] --- + + public static native void glMultiTexBufferEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLuint") int buffer); + + // --- [ glTextureParameterIivEXT ] --- + + public static native void nglTextureParameterIivEXT(int texture, int target, int pname, long params); + + public static void glTextureParameterIivEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglTextureParameterIivEXT(texture, target, pname, memAddress(params)); + } + + // --- [ glTextureParameterIuivEXT ] --- + + public static native void nglTextureParameterIuivEXT(int texture, int target, int pname, long params); + + public static void glTextureParameterIuivEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint const *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglTextureParameterIuivEXT(texture, target, pname, memAddress(params)); + } + + // --- [ glGetTextureParameterIivEXT ] --- + + public static native void nglGetTextureParameterIivEXT(int texture, int target, int pname, long params); + + public static void glGetTextureParameterIivEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetTextureParameterIivEXT(texture, target, pname, memAddress(params)); + } + + @NativeType("void") + public static int glGetTextureParameterIiEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetTextureParameterIivEXT(texture, target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTextureParameterIuivEXT ] --- + + public static native void nglGetTextureParameterIuivEXT(int texture, int target, int pname, long params); + + public static void glGetTextureParameterIuivEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetTextureParameterIuivEXT(texture, target, pname, memAddress(params)); + } + + @NativeType("void") + public static int glGetTextureParameterIuiEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetTextureParameterIuivEXT(texture, target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glMultiTexParameterIivEXT ] --- + + public static native void nglMultiTexParameterIivEXT(int texunit, int target, int pname, long params); + + public static void glMultiTexParameterIivEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglMultiTexParameterIivEXT(texunit, target, pname, memAddress(params)); + } + + // --- [ glMultiTexParameterIuivEXT ] --- + + public static native void nglMultiTexParameterIuivEXT(int texunit, int target, int pname, long params); + + public static void glMultiTexParameterIuivEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint const *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglMultiTexParameterIuivEXT(texunit, target, pname, memAddress(params)); + } + + // --- [ glGetMultiTexParameterIivEXT ] --- + + public static native void nglGetMultiTexParameterIivEXT(int texunit, int target, int pname, long params); + + public static void glGetMultiTexParameterIivEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetMultiTexParameterIivEXT(texunit, target, pname, memAddress(params)); + } + + @NativeType("void") + public static int glGetMultiTexParameterIiEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetMultiTexParameterIivEXT(texunit, target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetMultiTexParameterIuivEXT ] --- + + public static native void nglGetMultiTexParameterIuivEXT(int texunit, int target, int pname, long params); + + public static void glGetMultiTexParameterIuivEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetMultiTexParameterIuivEXT(texunit, target, pname, memAddress(params)); + } + + @NativeType("void") + public static int glGetMultiTexParameterIuiEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetMultiTexParameterIuivEXT(texunit, target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glProgramUniform1uiEXT ] --- + + public static native void glProgramUniform1uiEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint") int v0); + + // --- [ glProgramUniform2uiEXT ] --- + + public static native void glProgramUniform2uiEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint") int v0, @NativeType("GLuint") int v1); + + // --- [ glProgramUniform3uiEXT ] --- + + public static native void glProgramUniform3uiEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint") int v0, @NativeType("GLuint") int v1, @NativeType("GLuint") int v2); + + // --- [ glProgramUniform4uiEXT ] --- + + public static native void glProgramUniform4uiEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint") int v0, @NativeType("GLuint") int v1, @NativeType("GLuint") int v2, @NativeType("GLuint") int v3); + + // --- [ glProgramUniform1uivEXT ] --- + + public static native void nglProgramUniform1uivEXT(int program, int location, int count, long value); + + public static void glProgramUniform1uivEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + nglProgramUniform1uivEXT(program, location, value.remaining(), memAddress(value)); + } + + // --- [ glProgramUniform2uivEXT ] --- + + public static native void nglProgramUniform2uivEXT(int program, int location, int count, long value); + + public static void glProgramUniform2uivEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + nglProgramUniform2uivEXT(program, location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glProgramUniform3uivEXT ] --- + + public static native void nglProgramUniform3uivEXT(int program, int location, int count, long value); + + public static void glProgramUniform3uivEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + nglProgramUniform3uivEXT(program, location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glProgramUniform4uivEXT ] --- + + public static native void nglProgramUniform4uivEXT(int program, int location, int count, long value); + + public static void glProgramUniform4uivEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + nglProgramUniform4uivEXT(program, location, value.remaining() >> 2, memAddress(value)); + } + + // --- [ glNamedProgramLocalParameters4fvEXT ] --- + + public static native void nglNamedProgramLocalParameters4fvEXT(int program, int target, int index, int count, long params); + + public static void glNamedProgramLocalParameters4fvEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer params) { + nglNamedProgramLocalParameters4fvEXT(program, target, index, params.remaining() >> 2, memAddress(params)); + } + + // --- [ glNamedProgramLocalParameterI4iEXT ] --- + + public static native void glNamedProgramLocalParameterI4iEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z, @NativeType("GLint") int w); + + // --- [ glNamedProgramLocalParameterI4ivEXT ] --- + + public static native void nglNamedProgramLocalParameterI4ivEXT(int program, int target, int index, long params); + + public static void glNamedProgramLocalParameterI4ivEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglNamedProgramLocalParameterI4ivEXT(program, target, index, memAddress(params)); + } + + // --- [ glNamedProgramLocalParametersI4ivEXT ] --- + + public static native void nglNamedProgramLocalParametersI4ivEXT(int program, int target, int index, int count, long params); + + public static void glNamedProgramLocalParametersI4ivEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer params) { + nglNamedProgramLocalParametersI4ivEXT(program, target, index, params.remaining() >> 2, memAddress(params)); + } + + // --- [ glNamedProgramLocalParameterI4uiEXT ] --- + + public static native void glNamedProgramLocalParameterI4uiEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLuint") int x, @NativeType("GLuint") int y, @NativeType("GLuint") int z, @NativeType("GLuint") int w); + + // --- [ glNamedProgramLocalParameterI4uivEXT ] --- + + public static native void nglNamedProgramLocalParameterI4uivEXT(int program, int target, int index, long params); + + public static void glNamedProgramLocalParameterI4uivEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLuint const *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglNamedProgramLocalParameterI4uivEXT(program, target, index, memAddress(params)); + } + + // --- [ glNamedProgramLocalParametersI4uivEXT ] --- + + public static native void nglNamedProgramLocalParametersI4uivEXT(int program, int target, int index, int count, long params); + + public static void glNamedProgramLocalParametersI4uivEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLuint const *") IntBuffer params) { + nglNamedProgramLocalParametersI4uivEXT(program, target, index, params.remaining() >> 2, memAddress(params)); + } + + // --- [ glGetNamedProgramLocalParameterIivEXT ] --- + + public static native void nglGetNamedProgramLocalParameterIivEXT(int program, int target, int index, long params); + + public static void glGetNamedProgramLocalParameterIivEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglGetNamedProgramLocalParameterIivEXT(program, target, index, memAddress(params)); + } + + // --- [ glGetNamedProgramLocalParameterIuivEXT ] --- + + public static native void nglGetNamedProgramLocalParameterIuivEXT(int program, int target, int index, long params); + + public static void glGetNamedProgramLocalParameterIuivEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLuint *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglGetNamedProgramLocalParameterIuivEXT(program, target, index, memAddress(params)); + } + + // --- [ glNamedRenderbufferStorageEXT ] --- + + public static native void glNamedRenderbufferStorageEXT(@NativeType("GLuint") int renderbuffer, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glGetNamedRenderbufferParameterivEXT ] --- + + public static native void nglGetNamedRenderbufferParameterivEXT(int renderbuffer, int pname, long params); + + public static void glGetNamedRenderbufferParameterivEXT(@NativeType("GLuint") int renderbuffer, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetNamedRenderbufferParameterivEXT(renderbuffer, pname, memAddress(params)); + } + + @NativeType("void") + public static int glGetNamedRenderbufferParameteriEXT(@NativeType("GLuint") int renderbuffer, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetNamedRenderbufferParameterivEXT(renderbuffer, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glNamedRenderbufferStorageMultisampleEXT ] --- + + public static native void glNamedRenderbufferStorageMultisampleEXT(@NativeType("GLuint") int renderbuffer, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glNamedRenderbufferStorageMultisampleCoverageEXT ] --- + + public static native void glNamedRenderbufferStorageMultisampleCoverageEXT(@NativeType("GLuint") int renderbuffer, @NativeType("GLsizei") int coverageSamples, @NativeType("GLsizei") int colorSamples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glCheckNamedFramebufferStatusEXT ] --- + + @NativeType("GLenum") + public static native int glCheckNamedFramebufferStatusEXT(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int target); + + // --- [ glNamedFramebufferTexture1DEXT ] --- + + public static native void glNamedFramebufferTexture1DEXT(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLenum") int textarget, @NativeType("GLuint") int texture, @NativeType("GLint") int level); + + // --- [ glNamedFramebufferTexture2DEXT ] --- + + public static native void glNamedFramebufferTexture2DEXT(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLenum") int textarget, @NativeType("GLuint") int texture, @NativeType("GLint") int level); + + // --- [ glNamedFramebufferTexture3DEXT ] --- + + public static native void glNamedFramebufferTexture3DEXT(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLenum") int textarget, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int zoffset); + + // --- [ glNamedFramebufferRenderbufferEXT ] --- + + public static native void glNamedFramebufferRenderbufferEXT(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLenum") int renderbuffertarget, @NativeType("GLuint") int renderbuffer); + + // --- [ glGetNamedFramebufferAttachmentParameterivEXT ] --- + + public static native void nglGetNamedFramebufferAttachmentParameterivEXT(int framebuffer, int attachment, int pname, long params); + + public static void glGetNamedFramebufferAttachmentParameterivEXT(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetNamedFramebufferAttachmentParameterivEXT(framebuffer, attachment, pname, memAddress(params)); + } + + @NativeType("void") + public static int glGetNamedFramebufferAttachmentParameteriEXT(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetNamedFramebufferAttachmentParameterivEXT(framebuffer, attachment, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGenerateTextureMipmapEXT ] --- + + public static native void glGenerateTextureMipmapEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target); + + // --- [ glGenerateMultiTexMipmapEXT ] --- + + public static native void glGenerateMultiTexMipmapEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target); + + // --- [ glFramebufferDrawBufferEXT ] --- + + public static native void glFramebufferDrawBufferEXT(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int mode); + + // --- [ glFramebufferDrawBuffersEXT ] --- + + public static native void nglFramebufferDrawBuffersEXT(int framebuffer, int n, long bufs); + + public static void glFramebufferDrawBuffersEXT(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") IntBuffer bufs) { + nglFramebufferDrawBuffersEXT(framebuffer, bufs.remaining(), memAddress(bufs)); + } + + // --- [ glFramebufferReadBufferEXT ] --- + + public static native void glFramebufferReadBufferEXT(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int mode); + + // --- [ glGetFramebufferParameterivEXT ] --- + + public static native void nglGetFramebufferParameterivEXT(int framebuffer, int pname, long param); + + public static void glGetFramebufferParameterivEXT(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer param) { + if (CHECKS) { + check(param, 1); + } + nglGetFramebufferParameterivEXT(framebuffer, pname, memAddress(param)); + } + + @NativeType("void") + public static int glGetFramebufferParameteriEXT(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer param = stack.callocInt(1); + nglGetFramebufferParameterivEXT(framebuffer, pname, memAddress(param)); + return param.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glNamedCopyBufferSubDataEXT ] --- + + public static native void glNamedCopyBufferSubDataEXT(@NativeType("GLuint") int readBuffer, @NativeType("GLuint") int writeBuffer, @NativeType("GLintptr") long readOffset, @NativeType("GLintptr") long writeOffset, @NativeType("GLsizeiptr") long size); + + // --- [ glNamedFramebufferTextureEXT ] --- + + public static native void glNamedFramebufferTextureEXT(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level); + + // --- [ glNamedFramebufferTextureLayerEXT ] --- + + public static native void glNamedFramebufferTextureLayerEXT(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int layer); + + // --- [ glNamedFramebufferTextureFaceEXT ] --- + + public static native void glNamedFramebufferTextureFaceEXT(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int face); + + // --- [ glTextureRenderbufferEXT ] --- + + public static native void glTextureRenderbufferEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLuint") int renderbuffer); + + // --- [ glMultiTexRenderbufferEXT ] --- + + public static native void glMultiTexRenderbufferEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLuint") int renderbuffer); + + // --- [ glVertexArrayVertexOffsetEXT ] --- + + public static native void glVertexArrayVertexOffsetEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int buffer, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("GLintptr") long offset); + + // --- [ glVertexArrayColorOffsetEXT ] --- + + public static native void glVertexArrayColorOffsetEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int buffer, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("GLintptr") long offset); + + // --- [ glVertexArrayEdgeFlagOffsetEXT ] --- + + public static native void glVertexArrayEdgeFlagOffsetEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int buffer, @NativeType("GLsizei") int stride, @NativeType("GLintptr") long offset); + + // --- [ glVertexArrayIndexOffsetEXT ] --- + + public static native void glVertexArrayIndexOffsetEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int buffer, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("GLintptr") long offset); + + // --- [ glVertexArrayNormalOffsetEXT ] --- + + public static native void glVertexArrayNormalOffsetEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int buffer, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("GLintptr") long offset); + + // --- [ glVertexArrayTexCoordOffsetEXT ] --- + + public static native void glVertexArrayTexCoordOffsetEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int buffer, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("GLintptr") long offset); + + // --- [ glVertexArrayMultiTexCoordOffsetEXT ] --- + + public static native void glVertexArrayMultiTexCoordOffsetEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int buffer, @NativeType("GLenum") int texunit, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("GLintptr") long offset); + + // --- [ glVertexArrayFogCoordOffsetEXT ] --- + + public static native void glVertexArrayFogCoordOffsetEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int buffer, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("GLintptr") long offset); + + // --- [ glVertexArraySecondaryColorOffsetEXT ] --- + + public static native void glVertexArraySecondaryColorOffsetEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int buffer, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("GLintptr") long offset); + + // --- [ glVertexArrayVertexAttribOffsetEXT ] --- + + public static native void glVertexArrayVertexAttribOffsetEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int buffer, @NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("GLintptr") long offset); + + // --- [ glVertexArrayVertexAttribIOffsetEXT ] --- + + public static native void glVertexArrayVertexAttribIOffsetEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int buffer, @NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("GLintptr") long offset); + + // --- [ glEnableVertexArrayEXT ] --- + + public static native void glEnableVertexArrayEXT(@NativeType("GLuint") int vaobj, @NativeType("GLenum") int array); + + // --- [ glDisableVertexArrayEXT ] --- + + public static native void glDisableVertexArrayEXT(@NativeType("GLuint") int vaobj, @NativeType("GLenum") int array); + + // --- [ glEnableVertexArrayAttribEXT ] --- + + public static native void glEnableVertexArrayAttribEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index); + + // --- [ glDisableVertexArrayAttribEXT ] --- + + public static native void glDisableVertexArrayAttribEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index); + + // --- [ glGetVertexArrayIntegervEXT ] --- + + public static native void nglGetVertexArrayIntegervEXT(int vaobj, int pname, long param); + + public static void glGetVertexArrayIntegervEXT(@NativeType("GLuint") int vaobj, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer param) { + if (CHECKS) { + check(param, 1); + } + nglGetVertexArrayIntegervEXT(vaobj, pname, memAddress(param)); + } + + @NativeType("void") + public static int glGetVertexArrayIntegerEXT(@NativeType("GLuint") int vaobj, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer param = stack.callocInt(1); + nglGetVertexArrayIntegervEXT(vaobj, pname, memAddress(param)); + return param.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetVertexArrayPointervEXT ] --- + + public static native void nglGetVertexArrayPointervEXT(int vaobj, int pname, long param); + + public static void glGetVertexArrayPointervEXT(@NativeType("GLuint") int vaobj, @NativeType("GLenum") int pname, @NativeType("void **") PointerBuffer param) { + if (CHECKS) { + check(param, 1); + } + nglGetVertexArrayPointervEXT(vaobj, pname, memAddress(param)); + } + + @NativeType("void") + public static long glGetVertexArrayPointerEXT(@NativeType("GLuint") int vaobj, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + PointerBuffer param = stack.callocPointer(1); + nglGetVertexArrayPointervEXT(vaobj, pname, memAddress(param)); + return param.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetVertexArrayIntegeri_vEXT ] --- + + public static native void nglGetVertexArrayIntegeri_vEXT(int vaobj, int index, int pname, long param); + + public static void glGetVertexArrayIntegeri_vEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer param) { + if (CHECKS) { + check(param, 1); + } + nglGetVertexArrayIntegeri_vEXT(vaobj, index, pname, memAddress(param)); + } + + @NativeType("void") + public static int glGetVertexArrayIntegeriEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer param = stack.callocInt(1); + nglGetVertexArrayIntegeri_vEXT(vaobj, index, pname, memAddress(param)); + return param.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetVertexArrayPointeri_vEXT ] --- + + public static native void nglGetVertexArrayPointeri_vEXT(int vaobj, int index, int pname, long param); + + public static void glGetVertexArrayPointeri_vEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("void **") PointerBuffer param) { + if (CHECKS) { + check(param, 1); + } + nglGetVertexArrayPointeri_vEXT(vaobj, index, pname, memAddress(param)); + } + + @NativeType("void") + public static long glGetVertexArrayPointeriEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + PointerBuffer param = stack.callocPointer(1); + nglGetVertexArrayPointeri_vEXT(vaobj, index, pname, memAddress(param)); + return param.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glMapNamedBufferRangeEXT ] --- + + public static native long nglMapNamedBufferRangeEXT(int buffer, long offset, long length, int access); + + @Nullable + @NativeType("void *") + public static ByteBuffer glMapNamedBufferRangeEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length, @NativeType("GLbitfield") int access) { + long __result = nglMapNamedBufferRangeEXT(buffer, offset, length, access); + return memByteBufferSafe(__result, (int)length); + } + + @Nullable + @NativeType("void *") + public static ByteBuffer glMapNamedBufferRangeEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length, @NativeType("GLbitfield") int access, @Nullable ByteBuffer old_buffer) { + long __result = nglMapNamedBufferRangeEXT(buffer, offset, length, access); + return apiGetMappedBuffer(old_buffer, __result, (int)length); + } + + // --- [ glFlushMappedNamedBufferRangeEXT ] --- + + public static native void glFlushMappedNamedBufferRangeEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length); + + /** Array version of: {@link #glMatrixLoadfEXT MatrixLoadfEXT} */ + public static void glMatrixLoadfEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat const *") float[] m) { + long __functionAddress = GL.getICD().glMatrixLoadfEXT; + if (CHECKS) { + check(__functionAddress); + check(m, 16); + } + callPV(matrixMode, m, __functionAddress); + } + + /** Array version of: {@link #glMatrixLoaddEXT MatrixLoaddEXT} */ + public static void glMatrixLoaddEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLdouble const *") double[] m) { + long __functionAddress = GL.getICD().glMatrixLoaddEXT; + if (CHECKS) { + check(__functionAddress); + check(m, 16); + } + callPV(matrixMode, m, __functionAddress); + } + + /** Array version of: {@link #glMatrixMultfEXT MatrixMultfEXT} */ + public static void glMatrixMultfEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat const *") float[] m) { + long __functionAddress = GL.getICD().glMatrixMultfEXT; + if (CHECKS) { + check(__functionAddress); + check(m, 16); + } + callPV(matrixMode, m, __functionAddress); + } + + /** Array version of: {@link #glMatrixMultdEXT MatrixMultdEXT} */ + public static void glMatrixMultdEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLdouble const *") double[] m) { + long __functionAddress = GL.getICD().glMatrixMultdEXT; + if (CHECKS) { + check(__functionAddress); + check(m, 16); + } + callPV(matrixMode, m, __functionAddress); + } + + /** Array version of: {@link #glTextureParameterivEXT TextureParameterivEXT} */ + public static void glTextureParameterivEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] param) { + long __functionAddress = GL.getICD().glTextureParameterivEXT; + if (CHECKS) { + check(__functionAddress); + check(param, 4); + } + callPV(texture, target, pname, param, __functionAddress); + } + + /** Array version of: {@link #glTextureParameterfvEXT TextureParameterfvEXT} */ + public static void glTextureParameterfvEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] param) { + long __functionAddress = GL.getICD().glTextureParameterfvEXT; + if (CHECKS) { + check(__functionAddress); + check(param, 4); + } + callPV(texture, target, pname, param, __functionAddress); + } + + /** Array version of: {@link #glTextureImage1DEXT TextureImage1DEXT} */ + public static void glTextureImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] pixels) { + long __functionAddress = GL.getICD().glTextureImage1DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, internalformat, width, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glTextureImage1DEXT TextureImage1DEXT} */ + public static void glTextureImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] pixels) { + long __functionAddress = GL.getICD().glTextureImage1DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, internalformat, width, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glTextureImage1DEXT TextureImage1DEXT} */ + public static void glTextureImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] pixels) { + long __functionAddress = GL.getICD().glTextureImage1DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, internalformat, width, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glTextureImage1DEXT TextureImage1DEXT} */ + public static void glTextureImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") double[] pixels) { + long __functionAddress = GL.getICD().glTextureImage1DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, internalformat, width, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glTextureImage2DEXT TextureImage2DEXT} */ + public static void glTextureImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] pixels) { + long __functionAddress = GL.getICD().glTextureImage2DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, internalformat, width, height, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glTextureImage2DEXT TextureImage2DEXT} */ + public static void glTextureImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] pixels) { + long __functionAddress = GL.getICD().glTextureImage2DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, internalformat, width, height, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glTextureImage2DEXT TextureImage2DEXT} */ + public static void glTextureImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] pixels) { + long __functionAddress = GL.getICD().glTextureImage2DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, internalformat, width, height, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glTextureImage2DEXT TextureImage2DEXT} */ + public static void glTextureImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") double[] pixels) { + long __functionAddress = GL.getICD().glTextureImage2DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, internalformat, width, height, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glTextureSubImage1DEXT TextureSubImage1DEXT} */ + public static void glTextureSubImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage1DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, xoffset, width, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glTextureSubImage1DEXT TextureSubImage1DEXT} */ + public static void glTextureSubImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage1DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, xoffset, width, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glTextureSubImage1DEXT TextureSubImage1DEXT} */ + public static void glTextureSubImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage1DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, xoffset, width, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glTextureSubImage1DEXT TextureSubImage1DEXT} */ + public static void glTextureSubImage1DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") double[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage1DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, xoffset, width, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glTextureSubImage2DEXT TextureSubImage2DEXT} */ + public static void glTextureSubImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage2DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, xoffset, yoffset, width, height, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glTextureSubImage2DEXT TextureSubImage2DEXT} */ + public static void glTextureSubImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage2DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, xoffset, yoffset, width, height, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glTextureSubImage2DEXT TextureSubImage2DEXT} */ + public static void glTextureSubImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage2DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, xoffset, yoffset, width, height, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glTextureSubImage2DEXT TextureSubImage2DEXT} */ + public static void glTextureSubImage2DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") double[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage2DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, xoffset, yoffset, width, height, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glGetTextureImageEXT GetTextureImageEXT} */ + public static void glGetTextureImageEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") short[] pixels) { + long __functionAddress = GL.getICD().glGetTextureImageEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glGetTextureImageEXT GetTextureImageEXT} */ + public static void glGetTextureImageEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") int[] pixels) { + long __functionAddress = GL.getICD().glGetTextureImageEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glGetTextureImageEXT GetTextureImageEXT} */ + public static void glGetTextureImageEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") float[] pixels) { + long __functionAddress = GL.getICD().glGetTextureImageEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glGetTextureImageEXT GetTextureImageEXT} */ + public static void glGetTextureImageEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") double[] pixels) { + long __functionAddress = GL.getICD().glGetTextureImageEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glGetTextureParameterfvEXT GetTextureParameterfvEXT} */ + public static void glGetTextureParameterfvEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetTextureParameterfvEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texture, target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetTextureParameterivEXT GetTextureParameterivEXT} */ + public static void glGetTextureParameterivEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetTextureParameterivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texture, target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetTextureLevelParameterfvEXT GetTextureLevelParameterfvEXT} */ + public static void glGetTextureLevelParameterfvEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetTextureLevelParameterfvEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texture, target, level, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetTextureLevelParameterivEXT GetTextureLevelParameterivEXT} */ + public static void glGetTextureLevelParameterivEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetTextureLevelParameterivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texture, target, level, pname, params, __functionAddress); + } + + /** Array version of: {@link #glTextureImage3DEXT TextureImage3DEXT} */ + public static void glTextureImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] pixels) { + long __functionAddress = GL.getICD().glTextureImage3DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, internalformat, width, height, depth, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glTextureImage3DEXT TextureImage3DEXT} */ + public static void glTextureImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] pixels) { + long __functionAddress = GL.getICD().glTextureImage3DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, internalformat, width, height, depth, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glTextureImage3DEXT TextureImage3DEXT} */ + public static void glTextureImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] pixels) { + long __functionAddress = GL.getICD().glTextureImage3DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, internalformat, width, height, depth, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glTextureImage3DEXT TextureImage3DEXT} */ + public static void glTextureImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") double[] pixels) { + long __functionAddress = GL.getICD().glTextureImage3DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, internalformat, width, height, depth, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glTextureSubImage3DEXT TextureSubImage3DEXT} */ + public static void glTextureSubImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage3DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glTextureSubImage3DEXT TextureSubImage3DEXT} */ + public static void glTextureSubImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage3DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glTextureSubImage3DEXT TextureSubImage3DEXT} */ + public static void glTextureSubImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage3DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glTextureSubImage3DEXT TextureSubImage3DEXT} */ + public static void glTextureSubImage3DEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") double[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage3DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexCoordPointerEXT MultiTexCoordPointerEXT} */ + public static void glMultiTexCoordPointerEXT(@NativeType("GLenum") int texunit, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") short[] pointer) { + long __functionAddress = GL.getICD().glMultiTexCoordPointerEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, size, type, stride, pointer, __functionAddress); + } + + /** Array version of: {@link #glMultiTexCoordPointerEXT MultiTexCoordPointerEXT} */ + public static void glMultiTexCoordPointerEXT(@NativeType("GLenum") int texunit, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") int[] pointer) { + long __functionAddress = GL.getICD().glMultiTexCoordPointerEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, size, type, stride, pointer, __functionAddress); + } + + /** Array version of: {@link #glMultiTexCoordPointerEXT MultiTexCoordPointerEXT} */ + public static void glMultiTexCoordPointerEXT(@NativeType("GLenum") int texunit, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") float[] pointer) { + long __functionAddress = GL.getICD().glMultiTexCoordPointerEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, size, type, stride, pointer, __functionAddress); + } + + /** Array version of: {@link #glMultiTexEnvfvEXT MultiTexEnvfvEXT} */ + public static void glMultiTexEnvfvEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] params) { + long __functionAddress = GL.getICD().glMultiTexEnvfvEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(texunit, target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glMultiTexEnvivEXT MultiTexEnvivEXT} */ + public static void glMultiTexEnvivEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glMultiTexEnvivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(texunit, target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glMultiTexGendvEXT MultiTexGendvEXT} */ + public static void glMultiTexGendvEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLdouble const *") double[] params) { + long __functionAddress = GL.getICD().glMultiTexGendvEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(texunit, coord, pname, params, __functionAddress); + } + + /** Array version of: {@link #glMultiTexGenfvEXT MultiTexGenfvEXT} */ + public static void glMultiTexGenfvEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] params) { + long __functionAddress = GL.getICD().glMultiTexGenfvEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(texunit, coord, pname, params, __functionAddress); + } + + /** Array version of: {@link #glMultiTexGenivEXT MultiTexGenivEXT} */ + public static void glMultiTexGenivEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glMultiTexGenivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(texunit, coord, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetMultiTexEnvfvEXT GetMultiTexEnvfvEXT} */ + public static void glGetMultiTexEnvfvEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetMultiTexEnvfvEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texunit, target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetMultiTexEnvivEXT GetMultiTexEnvivEXT} */ + public static void glGetMultiTexEnvivEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetMultiTexEnvivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texunit, target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetMultiTexGendvEXT GetMultiTexGendvEXT} */ + public static void glGetMultiTexGendvEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLdouble *") double[] params) { + long __functionAddress = GL.getICD().glGetMultiTexGendvEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texunit, coord, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetMultiTexGenfvEXT GetMultiTexGenfvEXT} */ + public static void glGetMultiTexGenfvEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetMultiTexGenfvEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texunit, coord, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetMultiTexGenivEXT GetMultiTexGenivEXT} */ + public static void glGetMultiTexGenivEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetMultiTexGenivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texunit, coord, pname, params, __functionAddress); + } + + /** Array version of: {@link #glMultiTexParameterivEXT MultiTexParameterivEXT} */ + public static void glMultiTexParameterivEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] param) { + long __functionAddress = GL.getICD().glMultiTexParameterivEXT; + if (CHECKS) { + check(__functionAddress); + check(param, 4); + } + callPV(texunit, target, pname, param, __functionAddress); + } + + /** Array version of: {@link #glMultiTexParameterfvEXT MultiTexParameterfvEXT} */ + public static void glMultiTexParameterfvEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] param) { + long __functionAddress = GL.getICD().glMultiTexParameterfvEXT; + if (CHECKS) { + check(__functionAddress); + check(param, 4); + } + callPV(texunit, target, pname, param, __functionAddress); + } + + /** Array version of: {@link #glMultiTexImage1DEXT MultiTexImage1DEXT} */ + public static void glMultiTexImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] pixels) { + long __functionAddress = GL.getICD().glMultiTexImage1DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, internalformat, width, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexImage1DEXT MultiTexImage1DEXT} */ + public static void glMultiTexImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] pixels) { + long __functionAddress = GL.getICD().glMultiTexImage1DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, internalformat, width, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexImage1DEXT MultiTexImage1DEXT} */ + public static void glMultiTexImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] pixels) { + long __functionAddress = GL.getICD().glMultiTexImage1DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, internalformat, width, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexImage1DEXT MultiTexImage1DEXT} */ + public static void glMultiTexImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") double[] pixels) { + long __functionAddress = GL.getICD().glMultiTexImage1DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, internalformat, width, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexImage2DEXT MultiTexImage2DEXT} */ + public static void glMultiTexImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] pixels) { + long __functionAddress = GL.getICD().glMultiTexImage2DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, internalformat, width, height, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexImage2DEXT MultiTexImage2DEXT} */ + public static void glMultiTexImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] pixels) { + long __functionAddress = GL.getICD().glMultiTexImage2DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, internalformat, width, height, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexImage2DEXT MultiTexImage2DEXT} */ + public static void glMultiTexImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] pixels) { + long __functionAddress = GL.getICD().glMultiTexImage2DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, internalformat, width, height, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexImage2DEXT MultiTexImage2DEXT} */ + public static void glMultiTexImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") double[] pixels) { + long __functionAddress = GL.getICD().glMultiTexImage2DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, internalformat, width, height, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexSubImage1DEXT MultiTexSubImage1DEXT} */ + public static void glMultiTexSubImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] pixels) { + long __functionAddress = GL.getICD().glMultiTexSubImage1DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, xoffset, width, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexSubImage1DEXT MultiTexSubImage1DEXT} */ + public static void glMultiTexSubImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] pixels) { + long __functionAddress = GL.getICD().glMultiTexSubImage1DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, xoffset, width, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexSubImage1DEXT MultiTexSubImage1DEXT} */ + public static void glMultiTexSubImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] pixels) { + long __functionAddress = GL.getICD().glMultiTexSubImage1DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, xoffset, width, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexSubImage1DEXT MultiTexSubImage1DEXT} */ + public static void glMultiTexSubImage1DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") double[] pixels) { + long __functionAddress = GL.getICD().glMultiTexSubImage1DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, xoffset, width, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexSubImage2DEXT MultiTexSubImage2DEXT} */ + public static void glMultiTexSubImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] pixels) { + long __functionAddress = GL.getICD().glMultiTexSubImage2DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, xoffset, yoffset, width, height, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexSubImage2DEXT MultiTexSubImage2DEXT} */ + public static void glMultiTexSubImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] pixels) { + long __functionAddress = GL.getICD().glMultiTexSubImage2DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, xoffset, yoffset, width, height, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexSubImage2DEXT MultiTexSubImage2DEXT} */ + public static void glMultiTexSubImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] pixels) { + long __functionAddress = GL.getICD().glMultiTexSubImage2DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, xoffset, yoffset, width, height, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexSubImage2DEXT MultiTexSubImage2DEXT} */ + public static void glMultiTexSubImage2DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") double[] pixels) { + long __functionAddress = GL.getICD().glMultiTexSubImage2DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, xoffset, yoffset, width, height, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glGetMultiTexImageEXT GetMultiTexImageEXT} */ + public static void glGetMultiTexImageEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") short[] pixels) { + long __functionAddress = GL.getICD().glGetMultiTexImageEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glGetMultiTexImageEXT GetMultiTexImageEXT} */ + public static void glGetMultiTexImageEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") int[] pixels) { + long __functionAddress = GL.getICD().glGetMultiTexImageEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glGetMultiTexImageEXT GetMultiTexImageEXT} */ + public static void glGetMultiTexImageEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") float[] pixels) { + long __functionAddress = GL.getICD().glGetMultiTexImageEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glGetMultiTexImageEXT GetMultiTexImageEXT} */ + public static void glGetMultiTexImageEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") double[] pixels) { + long __functionAddress = GL.getICD().glGetMultiTexImageEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glGetMultiTexParameterfvEXT GetMultiTexParameterfvEXT} */ + public static void glGetMultiTexParameterfvEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetMultiTexParameterfvEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texunit, target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetMultiTexParameterivEXT GetMultiTexParameterivEXT} */ + public static void glGetMultiTexParameterivEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetMultiTexParameterivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texunit, target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetMultiTexLevelParameterfvEXT GetMultiTexLevelParameterfvEXT} */ + public static void glGetMultiTexLevelParameterfvEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetMultiTexLevelParameterfvEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texunit, target, level, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetMultiTexLevelParameterivEXT GetMultiTexLevelParameterivEXT} */ + public static void glGetMultiTexLevelParameterivEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetMultiTexLevelParameterivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texunit, target, level, pname, params, __functionAddress); + } + + /** Array version of: {@link #glMultiTexImage3DEXT MultiTexImage3DEXT} */ + public static void glMultiTexImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] pixels) { + long __functionAddress = GL.getICD().glMultiTexImage3DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, internalformat, width, height, depth, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexImage3DEXT MultiTexImage3DEXT} */ + public static void glMultiTexImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] pixels) { + long __functionAddress = GL.getICD().glMultiTexImage3DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, internalformat, width, height, depth, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexImage3DEXT MultiTexImage3DEXT} */ + public static void glMultiTexImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] pixels) { + long __functionAddress = GL.getICD().glMultiTexImage3DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, internalformat, width, height, depth, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexImage3DEXT MultiTexImage3DEXT} */ + public static void glMultiTexImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") double[] pixels) { + long __functionAddress = GL.getICD().glMultiTexImage3DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, internalformat, width, height, depth, border, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexSubImage3DEXT MultiTexSubImage3DEXT} */ + public static void glMultiTexSubImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] pixels) { + long __functionAddress = GL.getICD().glMultiTexSubImage3DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexSubImage3DEXT MultiTexSubImage3DEXT} */ + public static void glMultiTexSubImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] pixels) { + long __functionAddress = GL.getICD().glMultiTexSubImage3DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexSubImage3DEXT MultiTexSubImage3DEXT} */ + public static void glMultiTexSubImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] pixels) { + long __functionAddress = GL.getICD().glMultiTexSubImage3DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glMultiTexSubImage3DEXT MultiTexSubImage3DEXT} */ + public static void glMultiTexSubImage3DEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") double[] pixels) { + long __functionAddress = GL.getICD().glMultiTexSubImage3DEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(texunit, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, __functionAddress); + } + + /** Array version of: {@link #glGetFloatIndexedvEXT GetFloatIndexedvEXT} */ + public static void glGetFloatIndexedvEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetFloatIndexedvEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, index, params, __functionAddress); + } + + /** Array version of: {@link #glGetDoubleIndexedvEXT GetDoubleIndexedvEXT} */ + public static void glGetDoubleIndexedvEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble *") double[] params) { + long __functionAddress = GL.getICD().glGetDoubleIndexedvEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, index, params, __functionAddress); + } + + /** Array version of: {@link #glGetFloati_vEXT GetFloati_vEXT} */ + public static void glGetFloati_vEXT(@NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetFloati_vEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(pname, index, params, __functionAddress); + } + + /** Array version of: {@link #glGetDoublei_vEXT GetDoublei_vEXT} */ + public static void glGetDoublei_vEXT(@NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLdouble *") double[] params) { + long __functionAddress = GL.getICD().glGetDoublei_vEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(pname, index, params, __functionAddress); + } + + /** Array version of: {@link #glGetIntegerIndexedvEXT GetIntegerIndexedvEXT} */ + public static void glGetIntegerIndexedvEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLint *") int[] data) { + EXTDrawBuffers2.glGetIntegerIndexedvEXT(target, index, data); + } + + /** Array version of: {@link #glNamedProgramLocalParameter4dvEXT NamedProgramLocalParameter4dvEXT} */ + public static void glNamedProgramLocalParameter4dvEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] params) { + long __functionAddress = GL.getICD().glNamedProgramLocalParameter4dvEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(program, target, index, params, __functionAddress); + } + + /** Array version of: {@link #glNamedProgramLocalParameter4fvEXT NamedProgramLocalParameter4fvEXT} */ + public static void glNamedProgramLocalParameter4fvEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] params) { + long __functionAddress = GL.getICD().glNamedProgramLocalParameter4fvEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(program, target, index, params, __functionAddress); + } + + /** Array version of: {@link #glGetNamedProgramLocalParameterdvEXT GetNamedProgramLocalParameterdvEXT} */ + public static void glGetNamedProgramLocalParameterdvEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble *") double[] params) { + long __functionAddress = GL.getICD().glGetNamedProgramLocalParameterdvEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(program, target, index, params, __functionAddress); + } + + /** Array version of: {@link #glGetNamedProgramLocalParameterfvEXT GetNamedProgramLocalParameterfvEXT} */ + public static void glGetNamedProgramLocalParameterfvEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetNamedProgramLocalParameterfvEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(program, target, index, params, __functionAddress); + } + + /** Array version of: {@link #glGetNamedProgramivEXT GetNamedProgramivEXT} */ + public static void glGetNamedProgramivEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetNamedProgramivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(program, target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glMatrixLoadTransposefEXT MatrixLoadTransposefEXT} */ + public static void glMatrixLoadTransposefEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat const *") float[] m) { + long __functionAddress = GL.getICD().glMatrixLoadTransposefEXT; + if (CHECKS) { + check(__functionAddress); + check(m, 16); + } + callPV(matrixMode, m, __functionAddress); + } + + /** Array version of: {@link #glMatrixLoadTransposedEXT MatrixLoadTransposedEXT} */ + public static void glMatrixLoadTransposedEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLdouble const *") double[] m) { + long __functionAddress = GL.getICD().glMatrixLoadTransposedEXT; + if (CHECKS) { + check(__functionAddress); + check(m, 16); + } + callPV(matrixMode, m, __functionAddress); + } + + /** Array version of: {@link #glMatrixMultTransposefEXT MatrixMultTransposefEXT} */ + public static void glMatrixMultTransposefEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat const *") float[] m) { + long __functionAddress = GL.getICD().glMatrixMultTransposefEXT; + if (CHECKS) { + check(__functionAddress); + check(m, 16); + } + callPV(matrixMode, m, __functionAddress); + } + + /** Array version of: {@link #glMatrixMultTransposedEXT MatrixMultTransposedEXT} */ + public static void glMatrixMultTransposedEXT(@NativeType("GLenum") int matrixMode, @NativeType("GLdouble const *") double[] m) { + long __functionAddress = GL.getICD().glMatrixMultTransposedEXT; + if (CHECKS) { + check(__functionAddress); + check(m, 16); + } + callPV(matrixMode, m, __functionAddress); + } + + /** Array version of: {@link #glNamedBufferDataEXT NamedBufferDataEXT} */ + public static void glNamedBufferDataEXT(@NativeType("GLuint") int buffer, @NativeType("void const *") short[] data, @NativeType("GLenum") int usage) { + long __functionAddress = GL.getICD().glNamedBufferDataEXT; + if (CHECKS) { + check(__functionAddress); + } + callPPV(buffer, Integer.toUnsignedLong(data.length) << 1, data, usage, __functionAddress); + } + + /** Array version of: {@link #glNamedBufferDataEXT NamedBufferDataEXT} */ + public static void glNamedBufferDataEXT(@NativeType("GLuint") int buffer, @NativeType("void const *") int[] data, @NativeType("GLenum") int usage) { + long __functionAddress = GL.getICD().glNamedBufferDataEXT; + if (CHECKS) { + check(__functionAddress); + } + callPPV(buffer, Integer.toUnsignedLong(data.length) << 2, data, usage, __functionAddress); + } + + /** Array version of: {@link #glNamedBufferDataEXT NamedBufferDataEXT} */ + public static void glNamedBufferDataEXT(@NativeType("GLuint") int buffer, @NativeType("void const *") float[] data, @NativeType("GLenum") int usage) { + long __functionAddress = GL.getICD().glNamedBufferDataEXT; + if (CHECKS) { + check(__functionAddress); + } + callPPV(buffer, Integer.toUnsignedLong(data.length) << 2, data, usage, __functionAddress); + } + + /** Array version of: {@link #glNamedBufferDataEXT NamedBufferDataEXT} */ + public static void glNamedBufferDataEXT(@NativeType("GLuint") int buffer, @NativeType("void const *") double[] data, @NativeType("GLenum") int usage) { + long __functionAddress = GL.getICD().glNamedBufferDataEXT; + if (CHECKS) { + check(__functionAddress); + } + callPPV(buffer, Integer.toUnsignedLong(data.length) << 3, data, usage, __functionAddress); + } + + /** Array version of: {@link #glNamedBufferSubDataEXT NamedBufferSubDataEXT} */ + public static void glNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") short[] data) { + long __functionAddress = GL.getICD().glNamedBufferSubDataEXT; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, offset, Integer.toUnsignedLong(data.length) << 1, data, __functionAddress); + } + + /** Array version of: {@link #glNamedBufferSubDataEXT NamedBufferSubDataEXT} */ + public static void glNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") int[] data) { + long __functionAddress = GL.getICD().glNamedBufferSubDataEXT; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, offset, Integer.toUnsignedLong(data.length) << 2, data, __functionAddress); + } + + /** Array version of: {@link #glNamedBufferSubDataEXT NamedBufferSubDataEXT} */ + public static void glNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") float[] data) { + long __functionAddress = GL.getICD().glNamedBufferSubDataEXT; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, offset, Integer.toUnsignedLong(data.length) << 2, data, __functionAddress); + } + + /** Array version of: {@link #glNamedBufferSubDataEXT NamedBufferSubDataEXT} */ + public static void glNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") double[] data) { + long __functionAddress = GL.getICD().glNamedBufferSubDataEXT; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, offset, Integer.toUnsignedLong(data.length) << 3, data, __functionAddress); + } + + /** Array version of: {@link #glGetNamedBufferParameterivEXT GetNamedBufferParameterivEXT} */ + public static void glGetNamedBufferParameterivEXT(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetNamedBufferParameterivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(buffer, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetNamedBufferSubDataEXT GetNamedBufferSubDataEXT} */ + public static void glGetNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") short[] data) { + long __functionAddress = GL.getICD().glGetNamedBufferSubDataEXT; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, offset, Integer.toUnsignedLong(data.length) << 1, data, __functionAddress); + } + + /** Array version of: {@link #glGetNamedBufferSubDataEXT GetNamedBufferSubDataEXT} */ + public static void glGetNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") int[] data) { + long __functionAddress = GL.getICD().glGetNamedBufferSubDataEXT; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, offset, Integer.toUnsignedLong(data.length) << 2, data, __functionAddress); + } + + /** Array version of: {@link #glGetNamedBufferSubDataEXT GetNamedBufferSubDataEXT} */ + public static void glGetNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") float[] data) { + long __functionAddress = GL.getICD().glGetNamedBufferSubDataEXT; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, offset, Integer.toUnsignedLong(data.length) << 2, data, __functionAddress); + } + + /** Array version of: {@link #glGetNamedBufferSubDataEXT GetNamedBufferSubDataEXT} */ + public static void glGetNamedBufferSubDataEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") double[] data) { + long __functionAddress = GL.getICD().glGetNamedBufferSubDataEXT; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, offset, Integer.toUnsignedLong(data.length) << 3, data, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform1fvEXT ProgramUniform1fvEXT} */ + public static void glProgramUniform1fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniform1fvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform2fvEXT ProgramUniform2fvEXT} */ + public static void glProgramUniform2fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniform2fvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 1, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform3fvEXT ProgramUniform3fvEXT} */ + public static void glProgramUniform3fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniform3fvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 3, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform4fvEXT ProgramUniform4fvEXT} */ + public static void glProgramUniform4fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniform4fvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 2, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform1ivEXT ProgramUniform1ivEXT} */ + public static void glProgramUniform1ivEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + long __functionAddress = GL.getICD().glProgramUniform1ivEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform2ivEXT ProgramUniform2ivEXT} */ + public static void glProgramUniform2ivEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + long __functionAddress = GL.getICD().glProgramUniform2ivEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 1, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform3ivEXT ProgramUniform3ivEXT} */ + public static void glProgramUniform3ivEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + long __functionAddress = GL.getICD().glProgramUniform3ivEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 3, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform4ivEXT ProgramUniform4ivEXT} */ + public static void glProgramUniform4ivEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + long __functionAddress = GL.getICD().glProgramUniform4ivEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 2, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniformMatrix2fvEXT ProgramUniformMatrix2fvEXT} */ + public static void glProgramUniformMatrix2fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix2fvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 2, transpose, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniformMatrix3fvEXT ProgramUniformMatrix3fvEXT} */ + public static void glProgramUniformMatrix3fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix3fvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 9, transpose, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniformMatrix4fvEXT ProgramUniformMatrix4fvEXT} */ + public static void glProgramUniformMatrix4fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix4fvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 4, transpose, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniformMatrix2x3fvEXT ProgramUniformMatrix2x3fvEXT} */ + public static void glProgramUniformMatrix2x3fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix2x3fvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 6, transpose, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniformMatrix3x2fvEXT ProgramUniformMatrix3x2fvEXT} */ + public static void glProgramUniformMatrix3x2fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix3x2fvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 6, transpose, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniformMatrix2x4fvEXT ProgramUniformMatrix2x4fvEXT} */ + public static void glProgramUniformMatrix2x4fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix2x4fvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 3, transpose, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniformMatrix4x2fvEXT ProgramUniformMatrix4x2fvEXT} */ + public static void glProgramUniformMatrix4x2fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix4x2fvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 3, transpose, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniformMatrix3x4fvEXT ProgramUniformMatrix3x4fvEXT} */ + public static void glProgramUniformMatrix3x4fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix3x4fvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 12, transpose, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniformMatrix4x3fvEXT ProgramUniformMatrix4x3fvEXT} */ + public static void glProgramUniformMatrix4x3fvEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix4x3fvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 12, transpose, value, __functionAddress); + } + + /** Array version of: {@link #glTextureParameterIivEXT TextureParameterIivEXT} */ + public static void glTextureParameterIivEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glTextureParameterIivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(texture, target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glTextureParameterIuivEXT TextureParameterIuivEXT} */ + public static void glTextureParameterIuivEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint const *") int[] params) { + long __functionAddress = GL.getICD().glTextureParameterIuivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(texture, target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetTextureParameterIivEXT GetTextureParameterIivEXT} */ + public static void glGetTextureParameterIivEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetTextureParameterIivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texture, target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetTextureParameterIuivEXT GetTextureParameterIuivEXT} */ + public static void glGetTextureParameterIuivEXT(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint *") int[] params) { + long __functionAddress = GL.getICD().glGetTextureParameterIuivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texture, target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glMultiTexParameterIivEXT MultiTexParameterIivEXT} */ + public static void glMultiTexParameterIivEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glMultiTexParameterIivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(texunit, target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glMultiTexParameterIuivEXT MultiTexParameterIuivEXT} */ + public static void glMultiTexParameterIuivEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint const *") int[] params) { + long __functionAddress = GL.getICD().glMultiTexParameterIuivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(texunit, target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetMultiTexParameterIivEXT GetMultiTexParameterIivEXT} */ + public static void glGetMultiTexParameterIivEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetMultiTexParameterIivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texunit, target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetMultiTexParameterIuivEXT GetMultiTexParameterIuivEXT} */ + public static void glGetMultiTexParameterIuivEXT(@NativeType("GLenum") int texunit, @NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint *") int[] params) { + long __functionAddress = GL.getICD().glGetMultiTexParameterIuivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texunit, target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform1uivEXT ProgramUniform1uivEXT} */ + public static void glProgramUniform1uivEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glProgramUniform1uivEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform2uivEXT ProgramUniform2uivEXT} */ + public static void glProgramUniform2uivEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glProgramUniform2uivEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 1, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform3uivEXT ProgramUniform3uivEXT} */ + public static void glProgramUniform3uivEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glProgramUniform3uivEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 3, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform4uivEXT ProgramUniform4uivEXT} */ + public static void glProgramUniform4uivEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glProgramUniform4uivEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 2, value, __functionAddress); + } + + /** Array version of: {@link #glNamedProgramLocalParameters4fvEXT NamedProgramLocalParameters4fvEXT} */ + public static void glNamedProgramLocalParameters4fvEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] params) { + long __functionAddress = GL.getICD().glNamedProgramLocalParameters4fvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, target, index, params.length >> 2, params, __functionAddress); + } + + /** Array version of: {@link #glNamedProgramLocalParameterI4ivEXT NamedProgramLocalParameterI4ivEXT} */ + public static void glNamedProgramLocalParameterI4ivEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glNamedProgramLocalParameterI4ivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(program, target, index, params, __functionAddress); + } + + /** Array version of: {@link #glNamedProgramLocalParametersI4ivEXT NamedProgramLocalParametersI4ivEXT} */ + public static void glNamedProgramLocalParametersI4ivEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glNamedProgramLocalParametersI4ivEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, target, index, params.length >> 2, params, __functionAddress); + } + + /** Array version of: {@link #glNamedProgramLocalParameterI4uivEXT NamedProgramLocalParameterI4uivEXT} */ + public static void glNamedProgramLocalParameterI4uivEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLuint const *") int[] params) { + long __functionAddress = GL.getICD().glNamedProgramLocalParameterI4uivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(program, target, index, params, __functionAddress); + } + + /** Array version of: {@link #glNamedProgramLocalParametersI4uivEXT NamedProgramLocalParametersI4uivEXT} */ + public static void glNamedProgramLocalParametersI4uivEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLuint const *") int[] params) { + long __functionAddress = GL.getICD().glNamedProgramLocalParametersI4uivEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, target, index, params.length >> 2, params, __functionAddress); + } + + /** Array version of: {@link #glGetNamedProgramLocalParameterIivEXT GetNamedProgramLocalParameterIivEXT} */ + public static void glGetNamedProgramLocalParameterIivEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetNamedProgramLocalParameterIivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(program, target, index, params, __functionAddress); + } + + /** Array version of: {@link #glGetNamedProgramLocalParameterIuivEXT GetNamedProgramLocalParameterIuivEXT} */ + public static void glGetNamedProgramLocalParameterIuivEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLuint *") int[] params) { + long __functionAddress = GL.getICD().glGetNamedProgramLocalParameterIuivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(program, target, index, params, __functionAddress); + } + + /** Array version of: {@link #glGetNamedRenderbufferParameterivEXT GetNamedRenderbufferParameterivEXT} */ + public static void glGetNamedRenderbufferParameterivEXT(@NativeType("GLuint") int renderbuffer, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetNamedRenderbufferParameterivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(renderbuffer, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetNamedFramebufferAttachmentParameterivEXT GetNamedFramebufferAttachmentParameterivEXT} */ + public static void glGetNamedFramebufferAttachmentParameterivEXT(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetNamedFramebufferAttachmentParameterivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(framebuffer, attachment, pname, params, __functionAddress); + } + + /** Array version of: {@link #glFramebufferDrawBuffersEXT FramebufferDrawBuffersEXT} */ + public static void glFramebufferDrawBuffersEXT(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") int[] bufs) { + long __functionAddress = GL.getICD().glFramebufferDrawBuffersEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(framebuffer, bufs.length, bufs, __functionAddress); + } + + /** Array version of: {@link #glGetFramebufferParameterivEXT GetFramebufferParameterivEXT} */ + public static void glGetFramebufferParameterivEXT(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] param) { + long __functionAddress = GL.getICD().glGetFramebufferParameterivEXT; + if (CHECKS) { + check(__functionAddress); + check(param, 1); + } + callPV(framebuffer, pname, param, __functionAddress); + } + + /** Array version of: {@link #glGetVertexArrayIntegervEXT GetVertexArrayIntegervEXT} */ + public static void glGetVertexArrayIntegervEXT(@NativeType("GLuint") int vaobj, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] param) { + long __functionAddress = GL.getICD().glGetVertexArrayIntegervEXT; + if (CHECKS) { + check(__functionAddress); + check(param, 1); + } + callPV(vaobj, pname, param, __functionAddress); + } + + /** Array version of: {@link #glGetVertexArrayIntegeri_vEXT GetVertexArrayIntegeri_vEXT} */ + public static void glGetVertexArrayIntegeri_vEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] param) { + long __functionAddress = GL.getICD().glGetVertexArrayIntegeri_vEXT; + if (CHECKS) { + check(__functionAddress); + check(param, 1); + } + callPV(vaobj, index, pname, param, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDrawBuffers2.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDrawBuffers2.java new file mode 100644 index 00000000..554202c2 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDrawBuffers2.java @@ -0,0 +1,116 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the EXT_draw_buffers2 extension. + * + *

This extension builds upon the ARB_draw_buffers extension and provides separate blend enables and color write masks for each color output. In + * ARB_draw_buffers (part of OpenGL 2.0), separate values can be written to each color buffer, but the blend enable and color write mask are global and + * apply to all color outputs.

+ * + *

While this extension does provide separate blend enables, it does not provide separate blend functions or blend equations per color output.

+ * + *

Requires {@link GL20 OpenGL 2.0}.

+ */ +public class EXTDrawBuffers2 { + + static { GL.initialize(); } + + protected EXTDrawBuffers2() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glColorMaskIndexedEXT, caps.glGetBooleanIndexedvEXT, caps.glGetIntegerIndexedvEXT, caps.glEnableIndexedEXT, caps.glDisableIndexedEXT, + caps.glIsEnabledIndexedEXT + ); + } + + // --- [ glColorMaskIndexedEXT ] --- + + public static native void glColorMaskIndexedEXT(@NativeType("GLuint") int index, @NativeType("GLboolean") boolean r, @NativeType("GLboolean") boolean g, @NativeType("GLboolean") boolean b, @NativeType("GLboolean") boolean a); + + // --- [ glGetBooleanIndexedvEXT ] --- + + public static native void nglGetBooleanIndexedvEXT(int target, int index, long data); + + public static void glGetBooleanIndexedvEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLboolean *") ByteBuffer data) { + if (CHECKS) { + check(data, 1); + } + nglGetBooleanIndexedvEXT(target, index, memAddress(data)); + } + + @NativeType("void") + public static boolean glGetBooleanIndexedEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + ByteBuffer data = stack.calloc(1); + nglGetBooleanIndexedvEXT(target, index, memAddress(data)); + return data.get(0) != 0; + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetIntegerIndexedvEXT ] --- + + public static native void nglGetIntegerIndexedvEXT(int target, int index, long data); + + public static void glGetIntegerIndexedvEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLint *") IntBuffer data) { + if (CHECKS) { + check(data, 1); + } + nglGetIntegerIndexedvEXT(target, index, memAddress(data)); + } + + @NativeType("void") + public static int glGetIntegerIndexedEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer data = stack.callocInt(1); + nglGetIntegerIndexedvEXT(target, index, memAddress(data)); + return data.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glEnableIndexedEXT ] --- + + public static native void glEnableIndexedEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index); + + // --- [ glDisableIndexedEXT ] --- + + public static native void glDisableIndexedEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index); + + // --- [ glIsEnabledIndexedEXT ] --- + + @NativeType("GLboolean") + public static native boolean glIsEnabledIndexedEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index); + + /** Array version of: {@link #glGetIntegerIndexedvEXT GetIntegerIndexedvEXT} */ + public static void glGetIntegerIndexedvEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLint *") int[] data) { + long __functionAddress = GL.getICD().glGetIntegerIndexedvEXT; + if (CHECKS) { + check(__functionAddress); + check(data, 1); + } + callPV(target, index, data, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDrawInstanced.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDrawInstanced.java new file mode 100644 index 00000000..4ee89030 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTDrawInstanced.java @@ -0,0 +1,65 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the EXT_draw_instanced extension. + * + *

This extension provides the means to render multiple instances of an object with a single draw call, and an "instance ID" variable which can be used by + * the vertex program to compute per-instance values, typically an object's transform.

+ * + *

Requires {@link GL20 OpenGL 2.0}.

+ */ +public class EXTDrawInstanced { + + static { GL.initialize(); } + + protected EXTDrawInstanced() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glDrawArraysInstancedEXT, caps.glDrawElementsInstancedEXT + ); + } + + // --- [ glDrawArraysInstancedEXT ] --- + + public static native void glDrawArraysInstancedEXT(@NativeType("GLenum") int mode, @NativeType("GLint") int start, @NativeType("GLsizei") int count, @NativeType("GLsizei") int primcount); + + // --- [ glDrawElementsInstancedEXT ] --- + + public static native void nglDrawElementsInstancedEXT(int mode, int count, int type, long indices, int primcount); + + public static void glDrawElementsInstancedEXT(@NativeType("GLenum") int mode, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices, @NativeType("GLsizei") int primcount) { + nglDrawElementsInstancedEXT(mode, count, type, indices, primcount); + } + + public static void glDrawElementsInstancedEXT(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount) { + nglDrawElementsInstancedEXT(mode, indices.remaining() >> GLChecks.typeToByteShift(type), type, memAddress(indices), primcount); + } + + public static void glDrawElementsInstancedEXT(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount) { + nglDrawElementsInstancedEXT(mode, indices.remaining(), GL11.GL_UNSIGNED_BYTE, memAddress(indices), primcount); + } + + public static void glDrawElementsInstancedEXT(@NativeType("GLenum") int mode, @NativeType("void const *") ShortBuffer indices, @NativeType("GLsizei") int primcount) { + nglDrawElementsInstancedEXT(mode, indices.remaining(), GL11.GL_UNSIGNED_SHORT, memAddress(indices), primcount); + } + + public static void glDrawElementsInstancedEXT(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indices, @NativeType("GLsizei") int primcount) { + nglDrawElementsInstancedEXT(mode, indices.remaining(), GL11.GL_UNSIGNED_INT, memAddress(indices), primcount); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTEGLImageStorage.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTEGLImageStorage.java new file mode 100644 index 00000000..b1b65488 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTEGLImageStorage.java @@ -0,0 +1,93 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the EXT_EGL_image_storage extension. + * + *

The OpenGL ES extension {@code OES_EGL_image} provides a mechanism for creating GL textures sharing storage with {@code EGLImage} objects (in other + * words, creating GL texture {@code EGLImage} targets). The extension was written against the OpenGL ES 2.0 specification, which does not have the + * concept of immutable textures. As a result, it specifies that respecification of a texture by calling {@code TexImage*} on a texture that is an + * {@code EGLImage} target causes it to be implicitly orphaned. In most cases, this is not the desired behavior, but rather a result of an application + * error.

+ * + *

This extension provides a mechanism for creating texture objects that are both {@code EGLImage} targets and immutable. Since immutable textures cannot + * be respecified, they also cannot accidentally be orphaned, and attempts to do so generate errors instead of resulting in well-defined, but often + * undesirable and surprising behavior. It provides a strong guarantee that texture data that is intended to be shared will remain shared.

+ * + *

Requires {@link GL42 OpenGL 4.2} or {@link ARBTextureStorage ARB_texture_storage}. Requires EGL 1.4 and either the {@code EGL_KHR_image} or {@code EGL_KHR_image_base} extensions.

+ */ +public class EXTEGLImageStorage { + + static { GL.initialize(); } + + protected EXTEGLImageStorage() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glEGLImageTargetTexStorageEXT, caps.hasDSA(ext) ? caps.glEGLImageTargetTextureStorageEXT : -1L + ); + } + + // --- [ glEGLImageTargetTexStorageEXT ] --- + + public static native void nglEGLImageTargetTexStorageEXT(int target, long image, long attrib_list); + + public static void glEGLImageTargetTexStorageEXT(@NativeType("GLenum") int target, @NativeType("GLeglImageOES") long image, @Nullable @NativeType("int const *") IntBuffer attrib_list) { + if (CHECKS) { + check(image); + checkNTSafe(attrib_list); + } + nglEGLImageTargetTexStorageEXT(target, image, memAddressSafe(attrib_list)); + } + + // --- [ glEGLImageTargetTextureStorageEXT ] --- + + public static native void nglEGLImageTargetTextureStorageEXT(int texture, long image, long attrib_list); + + public static void glEGLImageTargetTextureStorageEXT(@NativeType("GLuint") int texture, @NativeType("GLeglImageOES") long image, @Nullable @NativeType("int const *") IntBuffer attrib_list) { + if (CHECKS) { + check(image); + checkNTSafe(attrib_list); + } + nglEGLImageTargetTextureStorageEXT(texture, image, memAddressSafe(attrib_list)); + } + + /** Array version of: {@link #glEGLImageTargetTexStorageEXT EGLImageTargetTexStorageEXT} */ + public static void glEGLImageTargetTexStorageEXT(@NativeType("GLenum") int target, @NativeType("GLeglImageOES") long image, @Nullable @NativeType("int const *") int[] attrib_list) { + long __functionAddress = GL.getICD().glEGLImageTargetTexStorageEXT; + if (CHECKS) { + check(__functionAddress); + check(image); + checkNTSafe(attrib_list); + } + callPPV(target, image, attrib_list, __functionAddress); + } + + /** Array version of: {@link #glEGLImageTargetTextureStorageEXT EGLImageTargetTextureStorageEXT} */ + public static void glEGLImageTargetTextureStorageEXT(@NativeType("GLuint") int texture, @NativeType("GLeglImageOES") long image, @Nullable @NativeType("int const *") int[] attrib_list) { + long __functionAddress = GL.getICD().glEGLImageTargetTextureStorageEXT; + if (CHECKS) { + check(__functionAddress); + check(image); + checkNTSafe(attrib_list); + } + callPPV(texture, image, attrib_list, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTExternalBuffer.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTExternalBuffer.java new file mode 100644 index 00000000..c8105146 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTExternalBuffer.java @@ -0,0 +1,75 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_external_buffer extension. + * + *

Extension EXT_buffer_storage introduced immutable storage buffers to OpenGL ES. This extension allows the data store for an immutable buffer to be + * sourced from an external {@code EGLClientBuffer}, allowing sharing of EGL client buffers across APIs, across processes, and across different processing + * cores such as the GPU, CPU, and DSP.

+ * + *

Operations can then be performed on the external buffer using standard GL buffer object procedures. The data in the allocation is not copied to the + * buffer object's data store; the external allocation represents a single memory allocation that can be shared across multiple GL objects -- this aspect + * is similar to EGL external images. On the other hand, the external buffer does not provide lifetime guarantees including orphaning and sibling behavior + * as provided by EGL external images.

+ * + *

The {@code EGLClientBuffer} must be allocated in a way which permits this shared access. For example, on Android via a shareable Android hardware + * buffer. This extension does not enable support for arbitrary {@code EGLClientBuffers} to be used as an external buffer.

+ * + *

It is the application's responsibility to ensure synchronization between operations performed by separate components (DSP / CPU / GPU) and processes on + * the external buffer. Additionally the application is responsible for avoiding violating existing GL spec requirements. For example, mapping a single + * shared allocation to two GL buffer objects and then performing {@code CopyBufferSubData} such that the read and write regions overlap would violate the + * existing {@code CopyBufferSubData} spec regarding copies performed with the same buffer set for source and destination.

+ * + *

The application must take any steps necessary to ensure memory access to the external buffer behaves as required by the application. For example, + * preventing compilation differences in data padding from causing data to be inadvertently corrupted by using defined structure alignment methods such as + * the std140 layout qualifier. The application is responsible for managing the lifetime of the external buffer, ensuring that the external buffer is not + * deleted as long as there are any GL buffer objects referring to it.

+ * + *

Requires {@link GL44 OpenGL 4.4}.

+ */ +public class EXTExternalBuffer { + + static { GL.initialize(); } + + protected EXTExternalBuffer() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glBufferStorageExternalEXT, caps.hasDSA(ext) ? caps.glNamedBufferStorageExternalEXT : -1L + ); + } + + // --- [ glBufferStorageExternalEXT ] --- + + public static native void nglBufferStorageExternalEXT(int target, long offset, long size, long clientBuffer, int flags); + + public static void glBufferStorageExternalEXT(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLeglClientBufferEXT") long clientBuffer, @NativeType("GLbitfield") int flags) { + if (CHECKS) { + check(clientBuffer); + } + nglBufferStorageExternalEXT(target, offset, size, clientBuffer, flags); + } + + // --- [ glNamedBufferStorageExternalEXT ] --- + + public static native void nglNamedBufferStorageExternalEXT(int buffer, long offset, long size, long clientBuffer, int flags); + + public static void glNamedBufferStorageExternalEXT(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLeglClientBufferEXT") long clientBuffer, @NativeType("GLbitfield") int flags) { + if (CHECKS) { + check(clientBuffer); + } + nglNamedBufferStorageExternalEXT(buffer, offset, size, clientBuffer, flags); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTFramebufferBlit.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTFramebufferBlit.java new file mode 100644 index 00000000..4a4cb544 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTFramebufferBlit.java @@ -0,0 +1,52 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_framebuffer_blit extension. + * + *

This extension modifies EXT_framebuffer_object by splitting the framebuffer object binding point into separate DRAW and READ bindings. This allows + * copying directly from one framebuffer to another. In addition, a new high performance blit function is added to facilitate these blits and perform some + * data conversion where allowed.

+ * + *

Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ +public class EXTFramebufferBlit { + + /** + * Accepted by the {@code target} parameter of BindFramebufferEXT, CheckFramebufferStatusEXT, FramebufferTexture{1D|2D|3D}EXT, FramebufferRenderbufferEXT, + * and GetFramebufferAttachmentParameterivEXT. + */ + public static final int + GL_READ_FRAMEBUFFER_EXT = 0x8CA8, + GL_DRAW_FRAMEBUFFER_EXT = 0x8CA9; + + /** Accepted by the {@code pname} parameters of GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_DRAW_FRAMEBUFFER_BINDING_EXT = 0x8CA6, + GL_READ_FRAMEBUFFER_BINDING_EXT = 0x8CAA; + + static { GL.initialize(); } + + protected EXTFramebufferBlit() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBlitFramebufferEXT + ); + } + + // --- [ glBlitFramebufferEXT ] --- + + public static native void glBlitFramebufferEXT(@NativeType("GLint") int srcX0, @NativeType("GLint") int srcY0, @NativeType("GLint") int srcX1, @NativeType("GLint") int srcY1, @NativeType("GLint") int dstX0, @NativeType("GLint") int dstY0, @NativeType("GLint") int dstX1, @NativeType("GLint") int dstY1, @NativeType("GLbitfield") int mask, @NativeType("GLenum") int filter); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTFramebufferMultisample.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTFramebufferMultisample.java new file mode 100644 index 00000000..5a303c80 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTFramebufferMultisample.java @@ -0,0 +1,84 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_framebuffer_multisample extension. + * + *

This extension extends the EXT_framebuffer_object framework to enable multisample rendering.

+ * + *

The new operation RenderbufferStorageMultisampleEXT() allocates storage for a renderbuffer object that can be used as a multisample buffer. A + * multisample render buffer image differs from a single-sample render buffer image in that a multisample image has a number of SAMPLES that is greater + * than zero. No method is provided for creating multisample texture images.

+ * + *

All of the framebuffer-attachable images attached to a framebuffer object must have the same number of SAMPLES or else the framebuffer object is not + * "framebuffer complete". If a framebuffer object with multisample attachments is "framebuffer complete", then the framebuffer object behaves as if + * SAMPLE_BUFFERS is one.

+ * + *

In traditional multisample rendering, where DRAW_FRAMEBUFFER_BINDING_EXT is zero and SAMPLE_BUFFERS is one, the GL spec states that "the color sample + * values are resolved to a single, displayable color each time a pixel is updated." There are, however, several modern hardware implementations that do + * not actually resolve for each sample update, but instead postpones the resolve operation to a later time and resolve a batch of sample updates at a + * time. This is OK as long as the implementation behaves "as if" it had resolved a sample-at-a-time. Unfortunately, however, honoring the "as if" rule can + * sometimes degrade performance.

+ * + *

In contrast, when DRAW_FRAMEBUFFER_BINDING_EXT is an application-created framebuffer object, MULTISAMPLE is enabled, and SAMPLE_BUFFERS is one, there is + * no implicit per-sample-update resolve. Instead, the application explicitly controls when the resolve operation is performed. The resolve operation is + * affected by calling BlitFramebufferEXT (provided by the EXT_framebuffer_blit extension) where the source is a multisample application-created + * framebuffer object and the destination is a single-sample framebuffer object (either application-created or window-system provided).

+ * + *

This design for multisample resolve more closely matches current hardware, but still permits implementations which choose to resolve a single sample at + * a time. If hardware that implementes the multisample resolution "one sample at a time" exposes EXT_framebuffer_multisample, it could perform the + * implicit resolve to a driver-managed hidden surface, then read from that surface when the application calls BlitFramebufferEXT.

+ * + *

Another motivation for granting the application explicit control over the multisample resolve operation has to do with the flexibility afforded by + * EXT_framebuffer_object. Previously, a drawable (window or pbuffer) had exclusive access to all of its buffers. There was no mechanism for sharing a + * buffer across multiple drawables. Under EXT_framebuffer_object, however, a mechanism exists for sharing a framebuffer-attachable image across several + * framebuffer objects, as well as sharing an image between a framebuffer object and a texture. If we had retained the "implicit" + * resolve from traditional multisampled rendering, and allowed the creation of "multisample" format renderbuffers, then this type of sharing would have + * lead to two problematic situations:

+ * + *
    + *
  • Two contexts, which shared renderbuffers, might perform competing resolve operations into the same single-sample buffer with ambiguous results.
  • + *
  • It would have introduced the unfortunate ability to use the single-sample buffer as a texture while MULTISAMPLE is ENABLED.
  • + *
+ * + *

By using the BlitFramebufferEXT from EXT_framebuffer_blit as an explicit resolve to serialize access to the multisampled contents and eliminate the + * implicit per-sample resolve operation, we avoid both of these problems.

+ * + *

Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ +public class EXTFramebufferMultisample { + + /** Accepted by the {@code pname} parameter of GetRenderbufferParameterivEXT. */ + public static final int GL_RENDERBUFFER_SAMPLES_EXT = 0x8CAB; + + /** Returned by CheckFramebufferStatusEXT. */ + public static final int GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT = 0x8D56; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_MAX_SAMPLES_EXT = 0x8D57; + + static { GL.initialize(); } + + protected EXTFramebufferMultisample() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glRenderbufferStorageMultisampleEXT + ); + } + + // --- [ glRenderbufferStorageMultisampleEXT ] --- + + public static native void glRenderbufferStorageMultisampleEXT(@NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTFramebufferMultisampleBlitScaled.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTFramebufferMultisampleBlitScaled.java new file mode 100644 index 00000000..605f2944 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTFramebufferMultisampleBlitScaled.java @@ -0,0 +1,38 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_framebuffer_multisample_blit_scaled extension. + * + *

This extension relaxes some of the restrictions associated with multisample resolve operations, specifically to allow a combined resolve and scale + * operation through a single call to BlitFramebuffer. It also adds two new filter types to control the quality of the combined scaled resolve operation.

+ * + *

In traditional multisampled framebuffer rendering, color samples must be explicitly resolved via BlitFramebuffer before any other operation on the + * resulting pixel values can be performed. This multisample resolve operation must be done using a BlitFramebuffer call where the dimensions of the source + * and destination rectangles are identical. If the resulting pixel values need to be copied to a texture with different dimensions, these resolved values + * can then be scaled with a second call to BlitFramebuffer.

+ * + *

By requiring two separate calls to BlitFramebuffer, the quality of final image can be maintained to a certain degree. The samples are first resolved, + * and then these resolved values can be filtered to produce the final image. This image quality comes at the price of increased memory usage and lower + * performance. However, the scaling blit can still introduce artifacts, particularly if it is done with a simple bilinear filter.

+ * + *

The new filter types introduced by this extension allow the scaled resolve to be done with a single call to BlitFramebuffer. Not all samples from the + * read framebuffer are required to be be used when producing the final pixel values, and there may be a loss in quality when compared to an image produced + * by a separate resolve and scale. However, the single-pass scaled resolve blit should be faster than the traditional two-pass resolve then scale blits.

+ * + *

Requires {@link ARBFramebufferObject ARB_framebuffer_object}.

+ */ +public final class EXTFramebufferMultisampleBlitScaled { + + /** Accepted by the {@code filter} parameter of BlitFramebuffer. */ + public static final int + GL_SCALED_RESOLVE_FASTEST_EXT = 0x90BA, + GL_SCALED_RESOLVE_NICEST_EXT = 0x90BB; + + private EXTFramebufferMultisampleBlitScaled() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTFramebufferObject.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTFramebufferObject.java new file mode 100644 index 00000000..ad84518a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTFramebufferObject.java @@ -0,0 +1,384 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the EXT_framebuffer_object extension. + * + *

This extension defines a simple interface for drawing to rendering destinations other than the buffers provided to the GL by the window-system.

+ * + *

In this extension, these newly defined rendering destinations are known collectively as "framebuffer-attachable images". This extension provides a + * mechanism for attaching framebuffer-attachable images to the GL framebuffer as one of the standard GL logical buffers: color, depth, and stencil. + * (Attaching a framebuffer-attachable image to the accum logical buffer is left for a future extension to define). When a framebuffer-attachable image is + * attached to the framebuffer, it is used as the source and destination of fragment operations.

+ * + *

By allowing the use of a framebuffer-attachable image as a rendering destination, this extension enables a form of "offscreen" rendering. Furthermore, + * "render to texture" is supported by allowing the images of a texture to be used as framebuffer-attachable images. A particular image of a texture object + * is selected for use as a framebuffer-attachable image by specifying the mipmap level, cube map face (for a cube map texture), and z-offset (for a 3D + * texture) that identifies the image. The "render to texture" semantics of this extension are similar to performing traditional rendering to the + * framebuffer, followed immediately by a call to CopyTexSubImage. However, by using this extension instead, an application can achieve the same effect, + * but with the advantage that the GL can usually eliminate the data copy that would have been incurred by calling CopyTexSubImage.

+ * + *

This extension also defines a new GL object type, called a "renderbuffer", which encapsulates a single 2D pixel image. The image of renderbuffer can be + * used as a framebuffer-attachable image for generalized offscreen rendering and it also provides a means to support rendering to GL logical buffer types + * which have no corresponding texture format (stencil, accum, etc). A renderbuffer is similar to a texture in that both renderbuffers and textures can be + * independently allocated and shared among multiple contexts. The framework defined by this extension is general enough that support for attaching images + * from GL objects other than textures and renderbuffers could be added by layered extensions.

+ * + *

To facilitate efficient switching between collections of framebuffer-attachable images, this extension introduces another new GL object, called a + * framebuffer object. A framebuffer object contains the state that defines the traditional GL framebuffer, including its set of images. Prior to this + * extension, it was the window-system which defined and managed this collection of images, traditionally by grouping them into a "drawable". The + * window-system API's would also provide a function (i.e., wglMakeCurrent, glXMakeCurrent, aglSetDrawable, etc.) to bind a drawable with a GL context (as + * is done in the WGL_ARB_pbuffer extension). In this extension however, this functionality is subsumed by the GL and the GL provides the function + * BindFramebufferEXT to bind a framebuffer object to the current context. Later, the context can bind back to the window-system-provided framebuffer in + * order to display rendered content.

+ * + *

Previous extensions that enabled rendering to a texture have been much more complicated. One example is the combination of ARB_pbuffer and + * ARB_render_texture, both of which are window-system extensions. This combination requires calling MakeCurrent, an operation that may be expensive, to + * switch between the window and the pbuffer drawables. An application must create one pbuffer per renderable texture in order to portably use + * ARB_render_texture. An application must maintain at least one GL context per texture format, because each context can only operate on a single + * pixelformat or FBConfig. All of these characteristics make ARB_render_texture both inefficient and cumbersome to use.

+ * + *

EXT_framebuffer_object, on the other hand, is both simpler to use and more efficient than ARB_render_texture. The EXT_framebuffer_object API is + * contained wholly within the GL API and has no (non-portable) window-system components. Under EXT_framebuffer_object, it is not necessary to create a + * second GL context when rendering to a texture image whose format differs from that of the window. Finally, unlike the pbuffers of ARB_render_texture, a + * single framebuffer object can facilitate rendering to an unlimited number of texture objects.

+ * + *

Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ +public class EXTFramebufferObject { + + /** + * Accepted by the {@code target} parameter of BindFramebufferEXT, CheckFramebufferStatusEXT, FramebufferTexture{1D|2D|3D}EXT, FramebufferRenderbufferEXT, + * and GetFramebufferAttachmentParameterivEXT. + */ + public static final int GL_FRAMEBUFFER_EXT = 0x8D40; + + /** + * Accepted by the {@code target} parameter of BindRenderbufferEXT, RenderbufferStorageEXT, and GetRenderbufferParameterivEXT, and returned by + * GetFramebufferAttachmentParameterivEXT. + */ + public static final int GL_RENDERBUFFER_EXT = 0x8D41; + + /** Accepted by the {@code internalformat} parameter of RenderbufferStorageEXT. */ + public static final int + GL_STENCIL_INDEX1_EXT = 0x8D46, + GL_STENCIL_INDEX4_EXT = 0x8D47, + GL_STENCIL_INDEX8_EXT = 0x8D48, + GL_STENCIL_INDEX16_EXT = 0x8D49; + + /** Accepted by the {@code pname} parameter of GetRenderbufferParameterivEXT. */ + public static final int + GL_RENDERBUFFER_WIDTH_EXT = 0x8D42, + GL_RENDERBUFFER_HEIGHT_EXT = 0x8D43, + GL_RENDERBUFFER_INTERNAL_FORMAT_EXT = 0x8D44, + GL_RENDERBUFFER_RED_SIZE_EXT = 0x8D50, + GL_RENDERBUFFER_GREEN_SIZE_EXT = 0x8D51, + GL_RENDERBUFFER_BLUE_SIZE_EXT = 0x8D52, + GL_RENDERBUFFER_ALPHA_SIZE_EXT = 0x8D53, + GL_RENDERBUFFER_DEPTH_SIZE_EXT = 0x8D54, + GL_RENDERBUFFER_STENCIL_SIZE_EXT = 0x8D55; + + /** Accepted by the {@code pname} parameter of GetFramebufferAttachmentParameterivEXT. */ + public static final int + GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT = 0x8CD0, + GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT = 0x8CD1, + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT = 0x8CD2, + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT = 0x8CD3, + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT = 0x8CD4; + + /** Accepted by the {@code attachment} parameter of FramebufferTexture{1D|2D|3D}EXT, FramebufferRenderbufferEXT, and GetFramebufferAttachmentParameterivEXT. */ + public static final int + GL_COLOR_ATTACHMENT0_EXT = 0x8CE0, + GL_COLOR_ATTACHMENT1_EXT = 0x8CE1, + GL_COLOR_ATTACHMENT2_EXT = 0x8CE2, + GL_COLOR_ATTACHMENT3_EXT = 0x8CE3, + GL_COLOR_ATTACHMENT4_EXT = 0x8CE4, + GL_COLOR_ATTACHMENT5_EXT = 0x8CE5, + GL_COLOR_ATTACHMENT6_EXT = 0x8CE6, + GL_COLOR_ATTACHMENT7_EXT = 0x8CE7, + GL_COLOR_ATTACHMENT8_EXT = 0x8CE8, + GL_COLOR_ATTACHMENT9_EXT = 0x8CE9, + GL_COLOR_ATTACHMENT10_EXT = 0x8CEA, + GL_COLOR_ATTACHMENT11_EXT = 0x8CEB, + GL_COLOR_ATTACHMENT12_EXT = 0x8CEC, + GL_COLOR_ATTACHMENT13_EXT = 0x8CED, + GL_COLOR_ATTACHMENT14_EXT = 0x8CEE, + GL_COLOR_ATTACHMENT15_EXT = 0x8CEF, + GL_DEPTH_ATTACHMENT_EXT = 0x8D00, + GL_STENCIL_ATTACHMENT_EXT = 0x8D20; + + /** Returned by CheckFramebufferStatusEXT(). */ + public static final int + GL_FRAMEBUFFER_COMPLETE_EXT = 0x8CD5, + GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT = 0x8CD6, + GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT = 0x8CD7, + GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT = 0x8CD9, + GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT = 0x8CDA, + GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT = 0x8CDB, + GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT = 0x8CDC, + GL_FRAMEBUFFER_UNSUPPORTED_EXT = 0x8CDD; + + /** Accepted by GetIntegerv(). */ + public static final int + GL_FRAMEBUFFER_BINDING_EXT = 0x8CA6, + GL_RENDERBUFFER_BINDING_EXT = 0x8CA7, + GL_MAX_COLOR_ATTACHMENTS_EXT = 0x8CDF, + GL_MAX_RENDERBUFFER_SIZE_EXT = 0x84E8; + + /** Returned by GetError(). */ + public static final int GL_INVALID_FRAMEBUFFER_OPERATION_EXT = 0x506; + + static { GL.initialize(); } + + protected EXTFramebufferObject() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glIsRenderbufferEXT, caps.glBindRenderbufferEXT, caps.glDeleteRenderbuffersEXT, caps.glGenRenderbuffersEXT, caps.glRenderbufferStorageEXT, + caps.glGetRenderbufferParameterivEXT, caps.glIsFramebufferEXT, caps.glBindFramebufferEXT, caps.glDeleteFramebuffersEXT, caps.glGenFramebuffersEXT, + caps.glCheckFramebufferStatusEXT, caps.glFramebufferTexture1DEXT, caps.glFramebufferTexture2DEXT, caps.glFramebufferTexture3DEXT, + caps.glFramebufferRenderbufferEXT, caps.glGetFramebufferAttachmentParameterivEXT, caps.glGenerateMipmapEXT + ); + } + + // --- [ glIsRenderbufferEXT ] --- + + @NativeType("GLboolean") + public static native boolean glIsRenderbufferEXT(@NativeType("GLuint") int renderbuffer); + + // --- [ glBindRenderbufferEXT ] --- + + public static native void glBindRenderbufferEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int renderbuffer); + + // --- [ glDeleteRenderbuffersEXT ] --- + + public static native void nglDeleteRenderbuffersEXT(int n, long renderbuffers); + + public static void glDeleteRenderbuffersEXT(@NativeType("GLuint const *") IntBuffer renderbuffers) { + nglDeleteRenderbuffersEXT(renderbuffers.remaining(), memAddress(renderbuffers)); + } + + public static void glDeleteRenderbuffersEXT(@NativeType("GLuint const *") int renderbuffer) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer renderbuffers = stack.ints(renderbuffer); + nglDeleteRenderbuffersEXT(1, memAddress(renderbuffers)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGenRenderbuffersEXT ] --- + + public static native void nglGenRenderbuffersEXT(int n, long renderbuffers); + + public static void glGenRenderbuffersEXT(@NativeType("GLuint *") IntBuffer renderbuffers) { + nglGenRenderbuffersEXT(renderbuffers.remaining(), memAddress(renderbuffers)); + } + + @NativeType("void") + public static int glGenRenderbuffersEXT() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer renderbuffers = stack.callocInt(1); + nglGenRenderbuffersEXT(1, memAddress(renderbuffers)); + return renderbuffers.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glRenderbufferStorageEXT ] --- + + public static native void glRenderbufferStorageEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glGetRenderbufferParameterivEXT ] --- + + public static native void nglGetRenderbufferParameterivEXT(int target, int pname, long params); + + public static void glGetRenderbufferParameterivEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetRenderbufferParameterivEXT(target, pname, memAddress(params)); + } + + @NativeType("void") + public static int glGetRenderbufferParameteriEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetRenderbufferParameterivEXT(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glIsFramebufferEXT ] --- + + @NativeType("GLboolean") + public static native boolean glIsFramebufferEXT(@NativeType("GLuint") int framebuffer); + + // --- [ glBindFramebufferEXT ] --- + + public static native void glBindFramebufferEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int framebuffer); + + // --- [ glDeleteFramebuffersEXT ] --- + + public static native void nglDeleteFramebuffersEXT(int n, long framebuffers); + + public static void glDeleteFramebuffersEXT(@NativeType("GLuint const *") IntBuffer framebuffers) { + nglDeleteFramebuffersEXT(framebuffers.remaining(), memAddress(framebuffers)); + } + + public static void glDeleteFramebuffersEXT(@NativeType("GLuint const *") int framebuffer) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer framebuffers = stack.ints(framebuffer); + nglDeleteFramebuffersEXT(1, memAddress(framebuffers)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGenFramebuffersEXT ] --- + + public static native void nglGenFramebuffersEXT(int n, long framebuffers); + + public static void glGenFramebuffersEXT(@NativeType("GLuint *") IntBuffer framebuffers) { + nglGenFramebuffersEXT(framebuffers.remaining(), memAddress(framebuffers)); + } + + @NativeType("void") + public static int glGenFramebuffersEXT() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer framebuffers = stack.callocInt(1); + nglGenFramebuffersEXT(1, memAddress(framebuffers)); + return framebuffers.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glCheckFramebufferStatusEXT ] --- + + @NativeType("GLenum") + public static native int glCheckFramebufferStatusEXT(@NativeType("GLenum") int target); + + // --- [ glFramebufferTexture1DEXT ] --- + + public static native void glFramebufferTexture1DEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int textarget, @NativeType("GLuint") int texture, @NativeType("GLint") int level); + + // --- [ glFramebufferTexture2DEXT ] --- + + public static native void glFramebufferTexture2DEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int textarget, @NativeType("GLuint") int texture, @NativeType("GLint") int level); + + // --- [ glFramebufferTexture3DEXT ] --- + + public static native void glFramebufferTexture3DEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int textarget, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int zoffset); + + // --- [ glFramebufferRenderbufferEXT ] --- + + public static native void glFramebufferRenderbufferEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int renderbuffertarget, @NativeType("GLuint") int renderbuffer); + + // --- [ glGetFramebufferAttachmentParameterivEXT ] --- + + public static native void nglGetFramebufferAttachmentParameterivEXT(int target, int attachment, int pname, long params); + + public static void glGetFramebufferAttachmentParameterivEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetFramebufferAttachmentParameterivEXT(target, attachment, pname, memAddress(params)); + } + + @NativeType("void") + public static int glGetFramebufferAttachmentParameteriEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetFramebufferAttachmentParameterivEXT(target, attachment, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGenerateMipmapEXT ] --- + + public static native void glGenerateMipmapEXT(@NativeType("GLenum") int target); + + /** Array version of: {@link #glDeleteRenderbuffersEXT DeleteRenderbuffersEXT} */ + public static void glDeleteRenderbuffersEXT(@NativeType("GLuint const *") int[] renderbuffers) { + long __functionAddress = GL.getICD().glDeleteRenderbuffersEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(renderbuffers.length, renderbuffers, __functionAddress); + } + + /** Array version of: {@link #glGenRenderbuffersEXT GenRenderbuffersEXT} */ + public static void glGenRenderbuffersEXT(@NativeType("GLuint *") int[] renderbuffers) { + long __functionAddress = GL.getICD().glGenRenderbuffersEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(renderbuffers.length, renderbuffers, __functionAddress); + } + + /** Array version of: {@link #glGetRenderbufferParameterivEXT GetRenderbufferParameterivEXT} */ + public static void glGetRenderbufferParameterivEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetRenderbufferParameterivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glDeleteFramebuffersEXT DeleteFramebuffersEXT} */ + public static void glDeleteFramebuffersEXT(@NativeType("GLuint const *") int[] framebuffers) { + long __functionAddress = GL.getICD().glDeleteFramebuffersEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(framebuffers.length, framebuffers, __functionAddress); + } + + /** Array version of: {@link #glGenFramebuffersEXT GenFramebuffersEXT} */ + public static void glGenFramebuffersEXT(@NativeType("GLuint *") int[] framebuffers) { + long __functionAddress = GL.getICD().glGenFramebuffersEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(framebuffers.length, framebuffers, __functionAddress); + } + + /** Array version of: {@link #glGetFramebufferAttachmentParameterivEXT GetFramebufferAttachmentParameterivEXT} */ + public static void glGetFramebufferAttachmentParameterivEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetFramebufferAttachmentParameterivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, attachment, pname, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTFramebufferSRGB.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTFramebufferSRGB.java new file mode 100644 index 00000000..5ce5d0d9 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTFramebufferSRGB.java @@ -0,0 +1,42 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_framebuffer_sRGB extension. + * + *

Conventionally, OpenGL assumes framebuffer color components are stored in a linear color space. In particular, framebuffer blending is a linear + * operation.

+ * + *

The sRGB color space is based on typical (non-linear) monitor characteristics expected in a dimly lit office. It has been standardized by the + * International Electrotechnical Commission (IEC) as IEC 61966-2-1. The sRGB color space roughly corresponds to 2.2 gamma correction.

+ * + *

This extension adds a framebuffer capability for sRGB framebuffer update and blending. When blending is disabled but the new sRGB updated mode is + * enabled (assume the framebuffer supports the capability), high-precision linear color component values for red, green, and blue generated by fragment + * coloring are encoded for sRGB prior to being written into the framebuffer. When blending is enabled along with the new sRGB update mode, red, green, and + * blue framebuffer color components are treated as sRGB values that are converted to linear color values, blended with the high-precision color values + * generated by fragment coloring, and then the blend result is encoded for sRGB just prior to being written into the framebuffer.

+ * + *

The primary motivation for this extension is that it allows OpenGL applications to render into a framebuffer that is scanned to a monitor configured to + * assume framebuffer color values are sRGB encoded. This assumption is roughly true of most PC monitors with default gamma correction. This allows + * applications to achieve faithful color reproduction for OpenGL rendering without adjusting the monitor's gamma correction.

+ * + *

Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ +public final class EXTFramebufferSRGB { + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_FRAMEBUFFER_SRGB_EXT = 0x8DB9; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_FRAMEBUFFER_SRGB_CAPABLE_EXT = 0x8DBA; + + private EXTFramebufferSRGB() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTGPUProgramParameters.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTGPUProgramParameters.java new file mode 100644 index 00000000..4b46f910 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTGPUProgramParameters.java @@ -0,0 +1,74 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the EXT_gpu_program_parameters extension. + * + *

This extension provides a new set of procedures to load multiple consecutive program environment parameters more efficiently, via a single GL call + * instead of multiple calls. This will reduce the amount of CPU overhead involved in loading parameters.

+ * + *

With the existing ARB_vertex_program and ARB_fragment_program APIs, program parameters must be loaded one at a time, via separate calls. While the + * NV_vertex_program extension provides a set of similar functions that can be used to load program environment parameters (which are equivalent to + * "program parameters" in NV_vertex_program), no such function exists for program local parameters.

+ */ +public class EXTGPUProgramParameters { + + static { GL.initialize(); } + + protected EXTGPUProgramParameters() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glProgramEnvParameters4fvEXT, caps.glProgramLocalParameters4fvEXT + ); + } + + // --- [ glProgramEnvParameters4fvEXT ] --- + + public static native void nglProgramEnvParameters4fvEXT(int target, int index, int count, long params); + + public static void glProgramEnvParameters4fvEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer params) { + nglProgramEnvParameters4fvEXT(target, index, params.remaining() >> 2, memAddress(params)); + } + + // --- [ glProgramLocalParameters4fvEXT ] --- + + public static native void nglProgramLocalParameters4fvEXT(int target, int index, int count, long params); + + public static void glProgramLocalParameters4fvEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer params) { + nglProgramLocalParameters4fvEXT(target, index, params.remaining() >> 2, memAddress(params)); + } + + /** Array version of: {@link #glProgramEnvParameters4fvEXT ProgramEnvParameters4fvEXT} */ + public static void glProgramEnvParameters4fvEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] params) { + long __functionAddress = GL.getICD().glProgramEnvParameters4fvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, index, params.length >> 2, params, __functionAddress); + } + + /** Array version of: {@link #glProgramLocalParameters4fvEXT ProgramLocalParameters4fvEXT} */ + public static void glProgramLocalParameters4fvEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] params) { + long __functionAddress = GL.getICD().glProgramLocalParameters4fvEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, index, params.length >> 2, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTGPUShader4.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTGPUShader4.java new file mode 100644 index 00000000..7787f5f8 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTGPUShader4.java @@ -0,0 +1,874 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the EXT_gpu_shader4 extension. + * + *

This extension provides a set of new features to the OpenGL Shading Language and related APIs to support capabilities of new hardware. In particular, + * this extension provides the following functionality:

+ * + *
    + *
  • New texture lookup functions are provided that allow shaders to access individual texels using integer coordinates referring to the texel location + * and level of detail. No filtering is performed. These functions allow applications to use textures as one-, two-, and three-dimensional arrays.
  • + *
  • New texture lookup functions are provided that allow shaders to query the dimensions of a specific level-of-detail image of a texture object.
  • + *
  • New texture lookup functions variants are provided that allow shaders to pass a constant integer vector used to offset the texel locations used + * during the lookup to assist in custom texture filtering operations.
  • + *
  • New texture lookup functions are provided that allow shaders to access one- and two-dimensional array textures. The second, or third, coordinate is + * used to select the layer of the array to access.
  • + *
  • New "Grad" texture lookup functions are provided that allow shaders to explicitely pass in derivative values which are used by the GL to compute the + * level-of-detail when performing a texture lookup.
  • + *
  • A new texture lookup function is provided to access a buffer texture.
  • + *
  • The existing absolute LOD texture lookup functions are no longer restricted to the vertex shader only.
  • + *
  • The ability to specify and use cubemap textures with a DEPTH_COMPONENT internal format. This also enables shadow mapping on cubemaps. The 'q' + * coordinate is used as the reference value for comparisons. A set of new texture lookup functions is provided to lookup into shadow cubemaps.
  • + *
  • The ability to specify if varying variables are interpolated in a non-perspective correct manner, if they are flat shaded or, if multi-sampling, if + * centroid sampling should be performed.
  • + *
  • Full signed integer and unsigned integer support in the OpenGL Shading Language: + * + *
      + *
    • Integers are defined as 32 bit values using two's complement.
    • + *
    • Unsigned integers and vectors thereof are added.
    • + *
    • New texture lookup functions are provided that return integer values. These functions are to be used in conjunction with new texture formats + * whose components are actual integers, rather than integers that encode a floating-point value. To support these lookup functions, new integer + * and unsigned-integer sampler types are introduced.
    • + *
    • Integer bitwise operators are now enabled.
    • + *
    • Several built-in functions and operators now operate on integers or vectors of integers.
    • + *
    • New vertex attribute functions are added that load integer attribute data and can be referenced in a vertex shader as integer data.
    • + *
    • New uniform loading commands are added to load unsigned integer data.
    • + *
    • Varying variables can now be (unsigned) integers. If declared as such, they have to be flat shaded.
    • + *
    • Fragment shaders can define their own output variables, and declare them to be of type floating-point, integer or unsigned integer. These + * variables are bound to a fragment color index with the new API command BindFragDataLocationEXT(), and directed to buffers using the existing + * DrawBuffer or DrawBuffers API commands.
    • + *
  • + *
  • Added new built-in functions truncate() and round() to the shading language.
  • + *
  • A new built-in variable accessible from within vertex shaders that holds the index {@code i} implicitly passed to ArrayElement to specify the + * vertex. This is called the vertex ID.
  • + *
  • A new built-in variable accessible from within fragment and geometry shaders that hold the index of the currently processed primitive. This is + * called the primitive ID.
  • + *
+ * + *

This extension also briefly mentions a new shader type, called a geometry shader. A geometry shader is run after vertices are transformed, but before + * clipping. A geometry shader begins with a single primitive (point, line, triangle. It can read the attributes of any of the vertices in the primitive + * and use them to generate new primitives. A geometry shader has a fixed output primitive type (point, line strip, or triangle strip) and emits vertices + * to define a new primitive. Geometry shaders are discussed in detail in the GL_EXT_geometry_shader4 specification.

+ * + *

Requires {@link GL20 OpenGL 2.0}.

+ */ +public class EXTGPUShader4 { + + /** Accepted by the {@code pname} parameters of GetVertexAttribdv, GetVertexAttribfv, GetVertexAttribiv, GetVertexAttribIuivEXT and GetVertexAttribIivEXT. */ + public static final int GL_VERTEX_ATTRIB_ARRAY_INTEGER_EXT = 0x88FD; + + /** Returned by the {@code type} parameter of GetActiveUniform. */ + public static final int + GL_SAMPLER_1D_ARRAY_EXT = 0x8DC0, + GL_SAMPLER_2D_ARRAY_EXT = 0x8DC1, + GL_SAMPLER_BUFFER_EXT = 0x8DC2, + GL_SAMPLER_1D_ARRAY_SHADOW_EXT = 0x8DC3, + GL_SAMPLER_2D_ARRAY_SHADOW_EXT = 0x8DC4, + GL_SAMPLER_CUBE_SHADOW_EXT = 0x8DC5, + GL_UNSIGNED_INT_VEC2_EXT = 0x8DC6, + GL_UNSIGNED_INT_VEC3_EXT = 0x8DC7, + GL_UNSIGNED_INT_VEC4_EXT = 0x8DC8, + GL_INT_SAMPLER_1D_EXT = 0x8DC9, + GL_INT_SAMPLER_2D_EXT = 0x8DCA, + GL_INT_SAMPLER_3D_EXT = 0x8DCB, + GL_INT_SAMPLER_CUBE_EXT = 0x8DCC, + GL_INT_SAMPLER_2D_RECT_EXT = 0x8DCD, + GL_INT_SAMPLER_1D_ARRAY_EXT = 0x8DCE, + GL_INT_SAMPLER_2D_ARRAY_EXT = 0x8DCF, + GL_INT_SAMPLER_BUFFER_EXT = 0x8DD0, + GL_UNSIGNED_INT_SAMPLER_1D_EXT = 0x8DD1, + GL_UNSIGNED_INT_SAMPLER_2D_EXT = 0x8DD2, + GL_UNSIGNED_INT_SAMPLER_3D_EXT = 0x8DD3, + GL_UNSIGNED_INT_SAMPLER_CUBE_EXT = 0x8DD4, + GL_UNSIGNED_INT_SAMPLER_2D_RECT_EXT = 0x8DD5, + GL_UNSIGNED_INT_SAMPLER_1D_ARRAY_EXT = 0x8DD6, + GL_UNSIGNED_INT_SAMPLER_2D_ARRAY_EXT = 0x8DD7, + GL_UNSIGNED_INT_SAMPLER_BUFFER_EXT = 0x8DD8; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MIN_PROGRAM_TEXEL_OFFSET_EXT = 0x8904, + GL_MAX_PROGRAM_TEXEL_OFFSET_EXT = 0x8905; + + static { GL.initialize(); } + + protected EXTGPUShader4() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glVertexAttribI1iEXT, caps.glVertexAttribI2iEXT, caps.glVertexAttribI3iEXT, caps.glVertexAttribI4iEXT, caps.glVertexAttribI1uiEXT, + caps.glVertexAttribI2uiEXT, caps.glVertexAttribI3uiEXT, caps.glVertexAttribI4uiEXT, caps.glVertexAttribI1ivEXT, caps.glVertexAttribI2ivEXT, + caps.glVertexAttribI3ivEXT, caps.glVertexAttribI4ivEXT, caps.glVertexAttribI1uivEXT, caps.glVertexAttribI2uivEXT, caps.glVertexAttribI3uivEXT, + caps.glVertexAttribI4uivEXT, caps.glVertexAttribI4bvEXT, caps.glVertexAttribI4svEXT, caps.glVertexAttribI4ubvEXT, caps.glVertexAttribI4usvEXT, + caps.glVertexAttribIPointerEXT, caps.glGetVertexAttribIivEXT, caps.glGetVertexAttribIuivEXT, caps.glGetUniformuivEXT, + caps.glBindFragDataLocationEXT, caps.glGetFragDataLocationEXT, caps.glUniform1uiEXT, caps.glUniform2uiEXT, caps.glUniform3uiEXT, + caps.glUniform4uiEXT, caps.glUniform1uivEXT, caps.glUniform2uivEXT, caps.glUniform3uivEXT, caps.glUniform4uivEXT + ); + } + + // --- [ glVertexAttribI1iEXT ] --- + + /** + * Specifies the value of a pure integer generic vertex attribute. The y and z components are implicitly set to 0 and w to 1. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + */ + public static native void glVertexAttribI1iEXT(@NativeType("GLuint") int index, @NativeType("GLint") int x); + + // --- [ glVertexAttribI2iEXT ] --- + + /** + * Specifies the value of a pure integer generic vertex attribute. The z component is implicitly set to 0 and w to 1. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + */ + public static native void glVertexAttribI2iEXT(@NativeType("GLuint") int index, @NativeType("GLint") int x, @NativeType("GLint") int y); + + // --- [ glVertexAttribI3iEXT ] --- + + /** + * Specifies the value of a pure integer generic vertex attribute. The w component is implicitly set to 1. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * @param z the vertex attribute z component + */ + public static native void glVertexAttribI3iEXT(@NativeType("GLuint") int index, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z); + + // --- [ glVertexAttribI4iEXT ] --- + + /** + * Specifies the value of a pure integer generic vertex attribute. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * @param z the vertex attribute z component + * @param w the vertex attribute w component + */ + public static native void glVertexAttribI4iEXT(@NativeType("GLuint") int index, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z, @NativeType("GLint") int w); + + // --- [ glVertexAttribI1uiEXT ] --- + + /** + * Specifies the value of an unsigned pure integer generic vertex attribute. The y and z components are implicitly set to 0 and w to 1. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + */ + public static native void glVertexAttribI1uiEXT(@NativeType("GLuint") int index, @NativeType("GLuint") int x); + + // --- [ glVertexAttribI2uiEXT ] --- + + /** + * Specifies the value of an unsigned pure integer generic vertex attribute. The z component is implicitly set to 0 and w to 1. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + */ + public static native void glVertexAttribI2uiEXT(@NativeType("GLuint") int index, @NativeType("GLuint") int x, @NativeType("GLuint") int y); + + // --- [ glVertexAttribI3uiEXT ] --- + + /** + * Specifies the value of an unsigned pure integer generic vertex attribute. The w component is implicitly set to 1. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * @param z the vertex attribute z component + */ + public static native void glVertexAttribI3uiEXT(@NativeType("GLuint") int index, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z); + + // --- [ glVertexAttribI4uiEXT ] --- + + /** + * Specifies the value of an unsigned pure integer generic vertex attribute. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * @param z the vertex attribute z component + * @param w the vertex attribute w component + */ + public static native void glVertexAttribI4uiEXT(@NativeType("GLuint") int index, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z, @NativeType("GLint") int w); + + // --- [ glVertexAttribI1ivEXT ] --- + + /** Unsafe version of: {@link #glVertexAttribI1ivEXT VertexAttribI1ivEXT} */ + public static native void nglVertexAttribI1ivEXT(int index, long v); + + /** + * Pointer version of {@link #glVertexAttribI1iEXT VertexAttribI1iEXT}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + */ + public static void glVertexAttribI1ivEXT(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglVertexAttribI1ivEXT(index, memAddress(v)); + } + + // --- [ glVertexAttribI2ivEXT ] --- + + /** Unsafe version of: {@link #glVertexAttribI2ivEXT VertexAttribI2ivEXT} */ + public static native void nglVertexAttribI2ivEXT(int index, long v); + + /** + * Pointer version of {@link #glVertexAttribI2iEXT VertexAttribI2iEXT}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + */ + public static void glVertexAttribI2ivEXT(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglVertexAttribI2ivEXT(index, memAddress(v)); + } + + // --- [ glVertexAttribI3ivEXT ] --- + + /** Unsafe version of: {@link #glVertexAttribI3ivEXT VertexAttribI3ivEXT} */ + public static native void nglVertexAttribI3ivEXT(int index, long v); + + /** + * Pointer version of {@link #glVertexAttribI3iEXT VertexAttribI3iEXT}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + */ + public static void glVertexAttribI3ivEXT(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglVertexAttribI3ivEXT(index, memAddress(v)); + } + + // --- [ glVertexAttribI4ivEXT ] --- + + /** Unsafe version of: {@link #glVertexAttribI4ivEXT VertexAttribI4ivEXT} */ + public static native void nglVertexAttribI4ivEXT(int index, long v); + + /** + * Pointer version of {@link #glVertexAttribI4iEXT VertexAttribI4iEXT}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + */ + public static void glVertexAttribI4ivEXT(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttribI4ivEXT(index, memAddress(v)); + } + + // --- [ glVertexAttribI1uivEXT ] --- + + /** Unsafe version of: {@link #glVertexAttribI1uivEXT VertexAttribI1uivEXT} */ + public static native void nglVertexAttribI1uivEXT(int index, long v); + + /** + * Pointer version of {@link #glVertexAttribI1uiEXT VertexAttribI1uiEXT}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + */ + public static void glVertexAttribI1uivEXT(@NativeType("GLuint") int index, @NativeType("GLuint const *") IntBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglVertexAttribI1uivEXT(index, memAddress(v)); + } + + // --- [ glVertexAttribI2uivEXT ] --- + + /** Unsafe version of: {@link #glVertexAttribI2uivEXT VertexAttribI2uivEXT} */ + public static native void nglVertexAttribI2uivEXT(int index, long v); + + /** + * Pointer version of {@link #glVertexAttribI2uiEXT VertexAttribI2uiEXT}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + */ + public static void glVertexAttribI2uivEXT(@NativeType("GLuint") int index, @NativeType("GLuint const *") IntBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglVertexAttribI2uivEXT(index, memAddress(v)); + } + + // --- [ glVertexAttribI3uivEXT ] --- + + /** Unsafe version of: {@link #glVertexAttribI3uivEXT VertexAttribI3uivEXT} */ + public static native void nglVertexAttribI3uivEXT(int index, long v); + + /** + * Pointer version of {@link #glVertexAttribI3uiEXT VertexAttribI3uiEXT}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + */ + public static void glVertexAttribI3uivEXT(@NativeType("GLuint") int index, @NativeType("GLuint const *") IntBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglVertexAttribI3uivEXT(index, memAddress(v)); + } + + // --- [ glVertexAttribI4uivEXT ] --- + + /** Unsafe version of: {@link #glVertexAttribI4uivEXT VertexAttribI4uivEXT} */ + public static native void nglVertexAttribI4uivEXT(int index, long v); + + /** + * Pointer version of {@link #glVertexAttribI4uiEXT VertexAttribI4uiEXT}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + */ + public static void glVertexAttribI4uivEXT(@NativeType("GLuint") int index, @NativeType("GLuint const *") IntBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttribI4uivEXT(index, memAddress(v)); + } + + // --- [ glVertexAttribI4bvEXT ] --- + + /** Unsafe version of: {@link #glVertexAttribI4bvEXT VertexAttribI4bvEXT} */ + public static native void nglVertexAttribI4bvEXT(int index, long v); + + /** + * Byte version of {@link #glVertexAttribI4ivEXT VertexAttribI4ivEXT}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + */ + public static void glVertexAttribI4bvEXT(@NativeType("GLuint") int index, @NativeType("GLbyte const *") ByteBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttribI4bvEXT(index, memAddress(v)); + } + + // --- [ glVertexAttribI4svEXT ] --- + + /** Unsafe version of: {@link #glVertexAttribI4svEXT VertexAttribI4svEXT} */ + public static native void nglVertexAttribI4svEXT(int index, long v); + + /** + * Short version of {@link #glVertexAttribI4ivEXT VertexAttribI4ivEXT}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + */ + public static void glVertexAttribI4svEXT(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttribI4svEXT(index, memAddress(v)); + } + + // --- [ glVertexAttribI4ubvEXT ] --- + + /** Unsafe version of: {@link #glVertexAttribI4ubvEXT VertexAttribI4ubvEXT} */ + public static native void nglVertexAttribI4ubvEXT(int index, long v); + + /** + * Byte version of {@link #glVertexAttribI4uivEXT VertexAttribI4uivEXT}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + */ + public static void glVertexAttribI4ubvEXT(@NativeType("GLuint") int index, @NativeType("GLbyte const *") ByteBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttribI4ubvEXT(index, memAddress(v)); + } + + // --- [ glVertexAttribI4usvEXT ] --- + + /** Unsafe version of: {@link #glVertexAttribI4usvEXT VertexAttribI4usvEXT} */ + public static native void nglVertexAttribI4usvEXT(int index, long v); + + /** + * Short version of {@link #glVertexAttribI4uivEXT VertexAttribI4uivEXT}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + */ + public static void glVertexAttribI4usvEXT(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttribI4usvEXT(index, memAddress(v)); + } + + // --- [ glVertexAttribIPointerEXT ] --- + + /** Unsafe version of: {@link #glVertexAttribIPointerEXT VertexAttribIPointerEXT} */ + public static native void nglVertexAttribIPointerEXT(int index, int size, int type, int stride, long pointer); + + /** + * Specifies the location and organization of a pure integer vertex attribute array. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + */ + public static void glVertexAttribIPointerEXT(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + nglVertexAttribIPointerEXT(index, size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a pure integer vertex attribute array. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + */ + public static void glVertexAttribIPointerEXT(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + nglVertexAttribIPointerEXT(index, size, type, stride, pointer); + } + + /** + * Specifies the location and organization of a pure integer vertex attribute array. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + */ + public static void glVertexAttribIPointerEXT(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ShortBuffer pointer) { + nglVertexAttribIPointerEXT(index, size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a pure integer vertex attribute array. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + */ + public static void glVertexAttribIPointerEXT(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") IntBuffer pointer) { + nglVertexAttribIPointerEXT(index, size, type, stride, memAddress(pointer)); + } + + // --- [ glGetVertexAttribIivEXT ] --- + + /** Unsafe version of: {@link #glGetVertexAttribIivEXT GetVertexAttribIivEXT} */ + public static native void nglGetVertexAttribIivEXT(int index, int pname, long params); + + /** + * Returns the value of a pure integer generic vertex attribute parameter. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param pname the symbolic name of the vertex attribute parameter to be queried + * @param params returns the requested data + */ + public static void glGetVertexAttribIivEXT(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglGetVertexAttribIivEXT(index, pname, memAddress(params)); + } + + /** + * Returns the value of a pure integer generic vertex attribute parameter. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param pname the symbolic name of the vertex attribute parameter to be queried + */ + @NativeType("void") + public static int glGetVertexAttribIiEXT(@NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetVertexAttribIivEXT(index, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetVertexAttribIuivEXT ] --- + + /** Unsafe version of: {@link #glGetVertexAttribIuivEXT GetVertexAttribIuivEXT} */ + public static native void nglGetVertexAttribIuivEXT(int index, int pname, long params); + + /** + * Unsigned version of {@link #glGetVertexAttribIivEXT GetVertexAttribIivEXT}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param pname the symbolic name of the vertex attribute parameter to be queried + * @param params returns the requested data + */ + public static void glGetVertexAttribIuivEXT(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLuint *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglGetVertexAttribIuivEXT(index, pname, memAddress(params)); + } + + /** + * Unsigned version of {@link #glGetVertexAttribIivEXT GetVertexAttribIivEXT}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param pname the symbolic name of the vertex attribute parameter to be queried + */ + @NativeType("void") + public static int glGetVertexAttribIuiEXT(@NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetVertexAttribIuivEXT(index, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetUniformuivEXT ] --- + + public static native void nglGetUniformuivEXT(int program, int location, long params); + + public static void glGetUniformuivEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetUniformuivEXT(program, location, memAddress(params)); + } + + @NativeType("void") + public static int glGetUniformuiEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetUniformuivEXT(program, location, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glBindFragDataLocationEXT ] --- + + public static native void nglBindFragDataLocationEXT(int program, int color, long name); + + public static void glBindFragDataLocationEXT(@NativeType("GLuint") int program, @NativeType("GLuint") int color, @NativeType("GLchar const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + nglBindFragDataLocationEXT(program, color, memAddress(name)); + } + + public static void glBindFragDataLocationEXT(@NativeType("GLuint") int program, @NativeType("GLuint") int color, @NativeType("GLchar const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + nglBindFragDataLocationEXT(program, color, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetFragDataLocationEXT ] --- + + public static native int nglGetFragDataLocationEXT(int program, long name); + + @NativeType("GLint") + public static int glGetFragDataLocationEXT(@NativeType("GLuint") int program, @NativeType("GLchar const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nglGetFragDataLocationEXT(program, memAddress(name)); + } + + @NativeType("GLint") + public static int glGetFragDataLocationEXT(@NativeType("GLuint") int program, @NativeType("GLchar const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + return nglGetFragDataLocationEXT(program, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glUniform1uiEXT ] --- + + public static native void glUniform1uiEXT(@NativeType("GLint") int location, @NativeType("GLuint") int v0); + + // --- [ glUniform2uiEXT ] --- + + public static native void glUniform2uiEXT(@NativeType("GLint") int location, @NativeType("GLuint") int v0, @NativeType("GLuint") int v1); + + // --- [ glUniform3uiEXT ] --- + + public static native void glUniform3uiEXT(@NativeType("GLint") int location, @NativeType("GLuint") int v0, @NativeType("GLuint") int v1, @NativeType("GLuint") int v2); + + // --- [ glUniform4uiEXT ] --- + + public static native void glUniform4uiEXT(@NativeType("GLint") int location, @NativeType("GLuint") int v0, @NativeType("GLuint") int v1, @NativeType("GLuint") int v2, @NativeType("GLuint") int v3); + + // --- [ glUniform1uivEXT ] --- + + public static native void nglUniform1uivEXT(int location, int count, long value); + + public static void glUniform1uivEXT(@NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + nglUniform1uivEXT(location, value.remaining(), memAddress(value)); + } + + // --- [ glUniform2uivEXT ] --- + + public static native void nglUniform2uivEXT(int location, int count, long value); + + public static void glUniform2uivEXT(@NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + nglUniform2uivEXT(location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glUniform3uivEXT ] --- + + public static native void nglUniform3uivEXT(int location, int count, long value); + + public static void glUniform3uivEXT(@NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + nglUniform3uivEXT(location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glUniform4uivEXT ] --- + + public static native void nglUniform4uivEXT(int location, int count, long value); + + public static void glUniform4uivEXT(@NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + nglUniform4uivEXT(location, value.remaining() >> 2, memAddress(value)); + } + + /** Array version of: {@link #glVertexAttribI1ivEXT VertexAttribI1ivEXT} */ + public static void glVertexAttribI1ivEXT(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttribI1ivEXT; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribI2ivEXT VertexAttribI2ivEXT} */ + public static void glVertexAttribI2ivEXT(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttribI2ivEXT; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribI3ivEXT VertexAttribI3ivEXT} */ + public static void glVertexAttribI3ivEXT(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttribI3ivEXT; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribI4ivEXT VertexAttribI4ivEXT} */ + public static void glVertexAttribI4ivEXT(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttribI4ivEXT; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribI1uivEXT VertexAttribI1uivEXT} */ + public static void glVertexAttribI1uivEXT(@NativeType("GLuint") int index, @NativeType("GLuint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttribI1uivEXT; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribI2uivEXT VertexAttribI2uivEXT} */ + public static void glVertexAttribI2uivEXT(@NativeType("GLuint") int index, @NativeType("GLuint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttribI2uivEXT; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribI3uivEXT VertexAttribI3uivEXT} */ + public static void glVertexAttribI3uivEXT(@NativeType("GLuint") int index, @NativeType("GLuint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttribI3uivEXT; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribI4uivEXT VertexAttribI4uivEXT} */ + public static void glVertexAttribI4uivEXT(@NativeType("GLuint") int index, @NativeType("GLuint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttribI4uivEXT; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribI4svEXT VertexAttribI4svEXT} */ + public static void glVertexAttribI4svEXT(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttribI4svEXT; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribI4usvEXT VertexAttribI4usvEXT} */ + public static void glVertexAttribI4usvEXT(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttribI4usvEXT; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribIPointerEXT VertexAttribIPointerEXT} */ + public static void glVertexAttribIPointerEXT(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") short[] pointer) { + long __functionAddress = GL.getICD().glVertexAttribIPointerEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(index, size, type, stride, pointer, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribIPointerEXT VertexAttribIPointerEXT} */ + public static void glVertexAttribIPointerEXT(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") int[] pointer) { + long __functionAddress = GL.getICD().glVertexAttribIPointerEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(index, size, type, stride, pointer, __functionAddress); + } + + /** Array version of: {@link #glGetVertexAttribIivEXT GetVertexAttribIivEXT} */ + public static void glGetVertexAttribIivEXT(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetVertexAttribIivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(index, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetVertexAttribIuivEXT GetVertexAttribIuivEXT} */ + public static void glGetVertexAttribIuivEXT(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLuint *") int[] params) { + long __functionAddress = GL.getICD().glGetVertexAttribIuivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(index, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetUniformuivEXT GetUniformuivEXT} */ + public static void glGetUniformuivEXT(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint *") int[] params) { + long __functionAddress = GL.getICD().glGetUniformuivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(program, location, params, __functionAddress); + } + + /** Array version of: {@link #glUniform1uivEXT Uniform1uivEXT} */ + public static void glUniform1uivEXT(@NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glUniform1uivEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length, value, __functionAddress); + } + + /** Array version of: {@link #glUniform2uivEXT Uniform2uivEXT} */ + public static void glUniform2uivEXT(@NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glUniform2uivEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 1, value, __functionAddress); + } + + /** Array version of: {@link #glUniform3uivEXT Uniform3uivEXT} */ + public static void glUniform3uivEXT(@NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glUniform3uivEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length / 3, value, __functionAddress); + } + + /** Array version of: {@link #glUniform4uivEXT Uniform4uivEXT} */ + public static void glUniform4uivEXT(@NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glUniform4uivEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 2, value, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTGeometryShader4.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTGeometryShader4.java new file mode 100644 index 00000000..12a301b4 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTGeometryShader4.java @@ -0,0 +1,106 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_geometry_shader4 extension. + * + *

EXT_geometry_shader4 defines a new shader type available to be run on the GPU, called a geometry shader. Geometry shaders are run after vertices are + * transformed, but prior to color clamping, flat shading and clipping.

+ * + *

A geometry shader begins with a single primitive (point, line, triangle). It can read the attributes of any of the vertices in the primitive and use + * them to generate new primitives. A geometry shader has a fixed output primitive type (point, line strip, or triangle strip) and emits vertices to + * define a new primitive. A geometry shader can emit multiple disconnected primitives. The primitives emitted by the geometry shader are clipped and then + * processed like an equivalent OpenGL primitive specified by the application.

+ * + *

Furthermore, EXT_geometry_shader4 provides four additional primitive types: lines with adjacency, line strips with adjacency, separate triangles with + * adjacency, and triangle strips with adjacency. Some of the vertices specified in these new primitive types are not part of the ordinary primitives, + * instead they represent neighboring vertices that are adjacent to the two line segment end points (lines/strips) or the three triangle edges + * (triangles/tstrips). These vertices can be accessed by geometry shaders and used to match up the vertices emitted by the geometry shader with those of + * neighboring primitives.

+ * + *

Since geometry shaders expect a specific input primitive type, an error will occur if the application presents primitives of a different type. For + * example, if a geometry shader expects points, an error will occur at Begin() time, if a primitive mode of TRIANGLES is specified.

+ */ +public class EXTGeometryShader4 { + + /** Accepted by the {@code type} parameter of CreateShader and returned by the {@code params} parameter of GetShaderiv. */ + public static final int GL_GEOMETRY_SHADER_EXT = 0x8DD9; + + /** Accepted by the {@code pname} parameter of ProgramParameteriEXT and GetProgramiv. */ + public static final int + GL_GEOMETRY_VERTICES_OUT_EXT = 0x8DDA, + GL_GEOMETRY_INPUT_TYPE_EXT = 0x8DDB, + GL_GEOMETRY_OUTPUT_TYPE_EXT = 0x8DDC; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS_EXT = 0x8C29, + GL_MAX_GEOMETRY_VARYING_COMPONENTS_EXT = 0x8DDD, + GL_MAX_VERTEX_VARYING_COMPONENTS_EXT = 0x8DDE, + GL_MAX_VARYING_COMPONENTS_EXT = 0x8B4B, + GL_MAX_GEOMETRY_UNIFORM_COMPONENTS_EXT = 0x8DDF, + GL_MAX_GEOMETRY_OUTPUT_VERTICES_EXT = 0x8DE0, + GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS_EXT = 0x8DE1; + + /** Accepted by the {@code mode} parameter of Begin, DrawArrays, MultiDrawArrays, DrawElements, MultiDrawElements, and DrawRangeElements. */ + public static final int + GL_LINES_ADJACENCY_EXT = 0xA, + GL_LINE_STRIP_ADJACENCY_EXT = 0xB, + GL_TRIANGLES_ADJACENCY_EXT = 0xC, + GL_TRIANGLE_STRIP_ADJACENCY_EXT = 0xD; + + /** Returned by CheckFramebufferStatusEXT. */ + public static final int + GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS_EXT = 0x8DA8, + GL_FRAMEBUFFER_INCOMPLETE_LAYER_COUNT_EXT = 0x8DA9; + + /** Accepted by the {@code pname} parameter of GetFramebufferAttachment- ParameterivEXT. */ + public static final int + GL_FRAMEBUFFER_ATTACHMENT_LAYERED_EXT = 0x8DA7, + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT = 0x8CD4; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetIntegerv, GetFloatv, GetDoublev, and + * GetBooleanv. + */ + public static final int GL_PROGRAM_POINT_SIZE_EXT = 0x8642; + + static { GL.initialize(); } + + protected EXTGeometryShader4() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glProgramParameteriEXT, caps.glFramebufferTextureEXT, caps.glFramebufferTextureLayerEXT, caps.glFramebufferTextureFaceEXT + ); + } + + // --- [ glProgramParameteriEXT ] --- + + public static native void glProgramParameteriEXT(@NativeType("GLuint") int program, @NativeType("GLenum") int pname, @NativeType("GLint") int value); + + // --- [ glFramebufferTextureEXT ] --- + + public static native void glFramebufferTextureEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level); + + // --- [ glFramebufferTextureLayerEXT ] --- + + public static void glFramebufferTextureLayerEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int layer) { + EXTTextureArray.glFramebufferTextureLayerEXT(target, attachment, texture, level, layer); + } + + // --- [ glFramebufferTextureFaceEXT ] --- + + public static native void glFramebufferTextureFaceEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int face); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTMemoryObject.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTMemoryObject.java new file mode 100644 index 00000000..27fcbab3 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTMemoryObject.java @@ -0,0 +1,286 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the EXT_memory_object extension. + * + *

The Vulkan API introduces the concept of explicit memory objects and reusable synchronization objects. This extension brings those concepts to the + * OpenGL API via two new object types:

+ * + *
    + *
  • Memory objects
  • + *
  • Semaphores
  • + *
+ * + *

Rather than allocating memory as a response to object allocation, memory allocation and binding are two separate operations in Vulkan. This extension + * allows an OpenGL application to import a Vulkan memory object, and to bind textures and/or buffer objects to it.

+ * + *

No methods to import memory objects are defined here. Separate platform-specific extensions are defined for this purpose.

+ * + *

Semaphores are synchronization primitives that can be waited on and signaled only by the GPU, or in GL terms, in the GL server. They are similar in + * concept to GL's "sync" objects and EGL's "EGLSync" objects, but different enough that compatibilities between the two are difficult to derive.

+ * + *

Rather than attempt to map Vulkan semaphores on to GL/EGL sync objects to achieve interoperability, this extension introduces a new object, GL + * semaphores, that map directly to the semantics of Vulkan semaphores. To achieve full image and buffer memory coherence with a Vulkan driver, the + * commands that manipulate semaphores also allow external usage information to be imported and exported.

+ * + *

Requires {@link GL42 OpenGL 4.2} or {@link ARBTextureStorage ARB_texture_storage}.

+ */ +public class EXTMemoryObject { + + /** + * Accepted by the {@code pname} parameter of TexParameter{ifx}{v}, TexParameterI{i ui}v, TextureParameter{if}{v}, TextureParameterI{i ui}v, + * GetTexParameter{if}v, GetTexParameterI{i ui}v, GetTextureParameter{if}v, and GetTextureParameterI{i ui}v. + */ + public static final int GL_TEXTURE_TILING_EXT = 0x9580; + + /** Accepted by the {@code pname} parameter of {@link #glMemoryObjectParameterivEXT MemoryObjectParameterivEXT}, and {@link #glGetMemoryObjectParameterivEXT GetMemoryObjectParameterivEXT}. */ + public static final int GL_DEDICATED_MEMORY_OBJECT_EXT = 0x9581; + + /** Accepted by the {@code pname} parameter of GetInternalFormativ or GetInternalFormati64v. */ + public static final int + GL_NUM_TILING_TYPES_EXT = 0x9582, + GL_TILING_TYPES_EXT = 0x9583; + + /** + * Returned in the {@code params} parameter of GetInternalFormativ or GetInternalFormati64v when the {@code pname} parameter is {@link #GL_TILING_TYPES_EXT TILING_TYPES_EXT}, + * returned in the {@code params} parameter of GetTexParameter{if}v, GetTexParameterI{i ui}v, GetTextureParameter{if}v, and GetTextureParameterI{i ui}v + * when the {@code pname} parameter is {@link #GL_TEXTURE_TILING_EXT TEXTURE_TILING_EXT}, and accepted by the {@code params} parameter of TexParameter{ifx}{v}, TexParameterI{i ui}v, + * TextureParameter{if}{v}, TextureParameterI{i ui}v when the {@code pname} parameter is {@link #GL_TEXTURE_TILING_EXT TEXTURE_TILING_EXT}. + */ + public static final int + GL_OPTIMAL_TILING_EXT = 0x9584, + GL_LINEAR_TILING_EXT = 0x9585; + + /** + * Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetFloatv, GetIntegerv, GetInteger64v, {@link #glGetUnsignedBytevEXT GetUnsignedBytevEXT}, and the + * {@code target} parameter of GetBooleani_v, GetIntegeri_v,GetFloati_v, GetDoublei_v, GetInteger64i_v, and {@link #glGetUnsignedBytei_vEXT GetUnsignedBytei_vEXT}. + */ + public static final int + GL_NUM_DEVICE_UUIDS_EXT = 0x9596, + GL_DEVICE_UUID_EXT = 0x9597, + GL_DRIVER_UUID_EXT = 0x9598; + + /** Constant values. */ + public static final int GL_UUID_SIZE_EXT = 16; + + static { GL.initialize(); } + + protected EXTMemoryObject() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glGetUnsignedBytevEXT, caps.glGetUnsignedBytei_vEXT, caps.glDeleteMemoryObjectsEXT, caps.glIsMemoryObjectEXT, caps.glCreateMemoryObjectsEXT, + caps.glMemoryObjectParameterivEXT, caps.glGetMemoryObjectParameterivEXT, caps.glTexStorageMem2DEXT, caps.glTexStorageMem2DMultisampleEXT, + caps.glTexStorageMem3DEXT, caps.glTexStorageMem3DMultisampleEXT, caps.glBufferStorageMemEXT, caps.hasDSA(ext) ? caps.glTextureStorageMem2DEXT : -1L, + caps.hasDSA(ext) ? caps.glTextureStorageMem2DMultisampleEXT : -1L, caps.hasDSA(ext) ? caps.glTextureStorageMem3DEXT : -1L, + caps.hasDSA(ext) ? caps.glTextureStorageMem3DMultisampleEXT : -1L, caps.hasDSA(ext) ? caps.glNamedBufferStorageMemEXT : -1L, + caps.glTexStorageMem1DEXT, caps.hasDSA(ext) ? caps.glTextureStorageMem1DEXT : -1L + ); + } + + // --- [ glGetUnsignedBytevEXT ] --- + + public static native void nglGetUnsignedBytevEXT(int pname, long data); + + public static void glGetUnsignedBytevEXT(@NativeType("GLenum") int pname, @NativeType("GLubyte *") ByteBuffer data) { + nglGetUnsignedBytevEXT(pname, memAddress(data)); + } + + // --- [ glGetUnsignedBytei_vEXT ] --- + + public static native void nglGetUnsignedBytei_vEXT(int target, int index, long data); + + public static void glGetUnsignedBytei_vEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLubyte *") ByteBuffer data) { + nglGetUnsignedBytei_vEXT(target, index, memAddress(data)); + } + + // --- [ glDeleteMemoryObjectsEXT ] --- + + public static native void nglDeleteMemoryObjectsEXT(int n, long memoryObjects); + + public static void glDeleteMemoryObjectsEXT(@NativeType("GLuint const *") IntBuffer memoryObjects) { + nglDeleteMemoryObjectsEXT(memoryObjects.remaining(), memAddress(memoryObjects)); + } + + public static void glDeleteMemoryObjectsEXT(@NativeType("GLuint const *") int memoryObject) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer memoryObjects = stack.ints(memoryObject); + nglDeleteMemoryObjectsEXT(1, memAddress(memoryObjects)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glIsMemoryObjectEXT ] --- + + @NativeType("GLboolean") + public static native boolean glIsMemoryObjectEXT(@NativeType("GLuint") int memoryObject); + + // --- [ glCreateMemoryObjectsEXT ] --- + + public static native void nglCreateMemoryObjectsEXT(int n, long memoryObjects); + + public static void glCreateMemoryObjectsEXT(@NativeType("GLuint *") IntBuffer memoryObjects) { + nglCreateMemoryObjectsEXT(memoryObjects.remaining(), memAddress(memoryObjects)); + } + + @NativeType("void") + public static int glCreateMemoryObjectsEXT() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer memoryObjects = stack.callocInt(1); + nglCreateMemoryObjectsEXT(1, memAddress(memoryObjects)); + return memoryObjects.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glMemoryObjectParameterivEXT ] --- + + public static native void nglMemoryObjectParameterivEXT(int memoryObject, int pname, long params); + + public static void glMemoryObjectParameterivEXT(@NativeType("GLuint") int memoryObject, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglMemoryObjectParameterivEXT(memoryObject, pname, memAddress(params)); + } + + public static void glMemoryObjectParameteriEXT(@NativeType("GLuint") int memoryObject, @NativeType("GLenum") int pname, @NativeType("GLint const *") int param) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.ints(param); + nglMemoryObjectParameterivEXT(memoryObject, pname, memAddress(params)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetMemoryObjectParameterivEXT ] --- + + public static native void nglGetMemoryObjectParameterivEXT(int memoryObject, int pname, long params); + + public static void glGetMemoryObjectParameterivEXT(@NativeType("GLuint") int memoryObject, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetMemoryObjectParameterivEXT(memoryObject, pname, memAddress(params)); + } + + @NativeType("void") + public static int glGetMemoryObjectParameteriEXT(@NativeType("GLuint") int memoryObject, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetMemoryObjectParameterivEXT(memoryObject, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glTexStorageMem2DEXT ] --- + + public static native void glTexStorageMem2DEXT(@NativeType("GLenum") int target, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalFormat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLuint") int memory, @NativeType("GLuint64") long offset); + + // --- [ glTexStorageMem2DMultisampleEXT ] --- + + public static native void glTexStorageMem2DMultisampleEXT(@NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalFormat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLboolean") boolean fixedSampleLocations, @NativeType("GLuint") int memory, @NativeType("GLuint64") long offset); + + // --- [ glTexStorageMem3DEXT ] --- + + public static native void glTexStorageMem3DEXT(@NativeType("GLenum") int target, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalFormat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLuint") int memory, @NativeType("GLuint64") long offset); + + // --- [ glTexStorageMem3DMultisampleEXT ] --- + + public static native void glTexStorageMem3DMultisampleEXT(@NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalFormat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLboolean") boolean fixedSampleLocations, @NativeType("GLuint") int memory, @NativeType("GLuint64") long offset); + + // --- [ glBufferStorageMemEXT ] --- + + public static native void glBufferStorageMemEXT(@NativeType("GLenum") int target, @NativeType("GLsizeiptr") long size, @NativeType("GLuint") int memory, @NativeType("GLuint64") long offset); + + // --- [ glTextureStorageMem2DEXT ] --- + + public static native void glTextureStorageMem2DEXT(@NativeType("GLuint") int texture, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalFormat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLuint") int memory, @NativeType("GLuint64") long offset); + + // --- [ glTextureStorageMem2DMultisampleEXT ] --- + + public static native void glTextureStorageMem2DMultisampleEXT(@NativeType("GLuint") int texture, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalFormat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLboolean") boolean fixedSampleLocations, @NativeType("GLuint") int memory, @NativeType("GLuint64") long offset); + + // --- [ glTextureStorageMem3DEXT ] --- + + public static native void glTextureStorageMem3DEXT(@NativeType("GLuint") int texture, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalFormat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLuint") int memory, @NativeType("GLuint64") long offset); + + // --- [ glTextureStorageMem3DMultisampleEXT ] --- + + public static native void glTextureStorageMem3DMultisampleEXT(@NativeType("GLuint") int texture, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalFormat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLboolean") boolean fixedSampleLocations, @NativeType("GLuint") int memory, @NativeType("GLuint64") long offset); + + // --- [ glNamedBufferStorageMemEXT ] --- + + public static native void glNamedBufferStorageMemEXT(@NativeType("GLuint") int buffer, @NativeType("GLsizeiptr") long size, @NativeType("GLuint") int memory, @NativeType("GLuint64") long offset); + + // --- [ glTexStorageMem1DEXT ] --- + + public static native void glTexStorageMem1DEXT(@NativeType("GLenum") int target, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalFormat, @NativeType("GLsizei") int width, @NativeType("GLuint") int memory, @NativeType("GLuint64") long offset); + + // --- [ glTextureStorageMem1DEXT ] --- + + public static native void glTextureStorageMem1DEXT(@NativeType("GLuint") int texture, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalFormat, @NativeType("GLsizei") int width, @NativeType("GLuint") int memory, @NativeType("GLuint64") long offset); + + /** Array version of: {@link #glDeleteMemoryObjectsEXT DeleteMemoryObjectsEXT} */ + public static void glDeleteMemoryObjectsEXT(@NativeType("GLuint const *") int[] memoryObjects) { + long __functionAddress = GL.getICD().glDeleteMemoryObjectsEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(memoryObjects.length, memoryObjects, __functionAddress); + } + + /** Array version of: {@link #glCreateMemoryObjectsEXT CreateMemoryObjectsEXT} */ + public static void glCreateMemoryObjectsEXT(@NativeType("GLuint *") int[] memoryObjects) { + long __functionAddress = GL.getICD().glCreateMemoryObjectsEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(memoryObjects.length, memoryObjects, __functionAddress); + } + + /** Array version of: {@link #glMemoryObjectParameterivEXT MemoryObjectParameterivEXT} */ + public static void glMemoryObjectParameterivEXT(@NativeType("GLuint") int memoryObject, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glMemoryObjectParameterivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(memoryObject, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetMemoryObjectParameterivEXT GetMemoryObjectParameterivEXT} */ + public static void glGetMemoryObjectParameterivEXT(@NativeType("GLuint") int memoryObject, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetMemoryObjectParameterivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(memoryObject, pname, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTMemoryObjectFD.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTMemoryObjectFD.java new file mode 100644 index 00000000..45e3f595 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTMemoryObjectFD.java @@ -0,0 +1,41 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_memory_object_fd extension. + * + *

Building upon the OpenGL memory object and semaphore framework defined in EXT_external_objects this extension enables an OpenGL + * application to import a memory object or semaphore from POSIX file descriptor external handles.

+ * + *

Requires {@link EXTMemoryObject EXT_memory_object} and {@link ARBTextureStorage ARB_texture_storage} or a version of OpenGL that incorporates it.

+ */ +public class EXTMemoryObjectFD { + + /** Accepted by the {@code handleType} parameter of {@link #glImportMemoryFdEXT ImportMemoryFdEXT} */ + public static final int GL_HANDLE_TYPE_OPAQUE_FD_EXT = 0x9586; + + static { GL.initialize(); } + + protected EXTMemoryObjectFD() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glImportMemoryFdEXT + ); + } + + // --- [ glImportMemoryFdEXT ] --- + + public static native void glImportMemoryFdEXT(@NativeType("GLuint") int memory, @NativeType("GLuint64") long size, @NativeType("GLenum") int handleType, @NativeType("GLint") int fd); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTMemoryObjectWin32.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTMemoryObjectWin32.java new file mode 100644 index 00000000..f4377b56 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTMemoryObjectWin32.java @@ -0,0 +1,83 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_memory_object_win32 extension. + * + *

Building upon the OpenGL memory object and semaphore framework defined in EXT_external_objects, this extension enables an + * OpenGL application to import a memory object or semaphore from a Win32 NT handle or a KMT share handle.

+ */ +public class EXTMemoryObjectWin32 { + + /** + * Accepted by the {@code handleType} parameter of {@link #glImportMemoryWin32HandleEXT ImportMemoryWin32HandleEXT}, {@link #glImportMemoryWin32NameEXT ImportMemoryWin32NameEXT}, {@link EXTSemaphoreWin32#glImportSemaphoreWin32HandleEXT ImportSemaphoreWin32HandleEXT}, and + * {@link EXTSemaphoreWin32#glImportSemaphoreWin32NameEXT ImportSemaphoreWin32NameEXT}. + */ + public static final int GL_HANDLE_TYPE_OPAQUE_WIN32_EXT = 0x9587; + + /** Accepted by the {@code handleType} parameter of {@link #glImportMemoryWin32HandleEXT ImportMemoryWin32HandleEXT} and {@link EXTSemaphoreWin32#glImportSemaphoreWin32HandleEXT ImportSemaphoreWin32HandleEXT}. */ + public static final int GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT = 0x9588; + + /** + * Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetFloatv, GetIntegerv, GetInteger64v, GetBooleani_v, GetIntegeri_v, GetFloati_v, + * GetDoublei_v, and GetInteger64i_v. + */ + public static final int + GL_DEVICE_LUID_EXT = 0x9599, + GL_DEVICE_NODE_MASK_EXT = 0x959A; + + /** Constant values. */ + public static final int GL_LUID_SIZE_EXT = 8; + + /** Accepted by the {@code handleType} parameter of {@link #glImportMemoryWin32HandleEXT ImportMemoryWin32HandleEXT} and {@link #glImportMemoryWin32NameEXT ImportMemoryWin32NameEXT}. */ + public static final int + GL_HANDLE_TYPE_D3D12_TILEPOOL_EXT = 0x9589, + GL_HANDLE_TYPE_D3D12_RESOURCE_EXT = 0x958A, + GL_HANDLE_TYPE_D3D11_IMAGE_EXT = 0x958B; + + /** Accepted by the {@code handleType} parameter of {@link #glImportMemoryWin32HandleEXT ImportMemoryWin32HandleEXT}. */ + public static final int GL_HANDLE_TYPE_D3D11_IMAGE_KMT_EXT = 0x958C; + + static { GL.initialize(); } + + protected EXTMemoryObjectWin32() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glImportMemoryWin32HandleEXT, caps.glImportMemoryWin32NameEXT + ); + } + + // --- [ glImportMemoryWin32HandleEXT ] --- + + public static native void nglImportMemoryWin32HandleEXT(int memory, long size, int handleType, long handle); + + public static void glImportMemoryWin32HandleEXT(@NativeType("GLuint") int memory, @NativeType("GLuint64") long size, @NativeType("GLenum") int handleType, @NativeType("void *") long handle) { + if (CHECKS) { + check(handle); + } + nglImportMemoryWin32HandleEXT(memory, size, handleType, handle); + } + + // --- [ glImportMemoryWin32NameEXT ] --- + + public static native void nglImportMemoryWin32NameEXT(int memory, long size, int handleType, long name); + + public static void glImportMemoryWin32NameEXT(@NativeType("GLuint") int memory, @NativeType("GLuint64") long size, @NativeType("GLenum") int handleType, @NativeType("void const *") long name) { + if (CHECKS) { + check(name); + } + nglImportMemoryWin32NameEXT(memory, size, handleType, name); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTPackedDepthStencil.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTPackedDepthStencil.java new file mode 100644 index 00000000..4d637c26 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTPackedDepthStencil.java @@ -0,0 +1,84 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_packed_depth_stencil extension. + * + *

Many OpenGL implementations have chosen to interleave the depth and stencil buffers into one buffer, often with 24 bits of depth precision and 8 bits + * of stencil data. 32 bits is more than is needed for the depth buffer much of the time; a 24-bit depth buffer, on the other hand, requires that reads + * and writes of depth data be unaligned with respect to power-of-two boundaries. On the other hand, 8 bits of stencil data is more than sufficient for + * most applications, so it is only natural to pack the two buffers into a single buffer with both depth and stencil data. OpenGL never provides direct + * access to the buffers, so the OpenGL implementation can provide an interface to applications where it appears the one merged buffer is composed of two + * logical buffers.

+ * + *

One disadvantage of this scheme is that OpenGL lacks any means by which this packed data can be handled efficiently. For example, when an application + * reads from the 24-bit depth buffer, using the type GL_UNSIGNED_SHORT will lose 8 bits of data, while GL_UNSIGNED_INT has 8 too many. Both require + * expensive format conversion operations. A 24-bit format would be no more suitable, because it would also suffer from the unaligned memory accesses that + * made the standalone 24-bit depth buffer an unattractive proposition in the first place.

+ * + *

Many applications, such as parallel rendering applications, may also wish to draw to or read back from both the depth and stencil buffers at the same + * time. Currently this requires two separate operations, reducing performance. Since the buffers are interleaved, drawing to or reading from both should + * be no more expensive than using just one; in some cases, it may even be cheaper.

+ * + *

This extension provides a new data format, GL_DEPTH_STENCIL_EXT, that can be used with the glDrawPixels, glReadPixels, and glCopyPixels commands, as + * well as a packed data type, GL_UNSIGNED_INT_24_8_EXT, that is meant to be used with GL_DEPTH_STENCIL_EXT. No other data types are supported with + * GL_DEPTH_STENCIL_EXT. If ARB_depth_texture or SGIX_depth_texture is supported, GL_DEPTH_STENCIL_EXT/GL_UNSIGNED_INT_24_8_EXT data can also be used for + * textures; this provides a more efficient way to supply data for a 24-bit depth texture.

+ * + *

GL_DEPTH_STENCIL_EXT data, when passed through the pixel path, undergoes both depth and stencil operations. The depth data is scaled and biased by the + * current GL_DEPTH_SCALE and GL_DEPTH_BIAS, while the stencil data is shifted and offset by the current GL_INDEX_SHIFT and GL_INDEX_OFFSET. The stencil + * data is also put through the stencil-to-stencil pixel map.

+ * + *

glDrawPixels of GL_DEPTH_STENCIL_EXT data operates similarly to that of GL_STENCIL_INDEX data, bypassing the OpenGL fragment pipeline entirely, unlike + * the treatment of GL_DEPTH_COMPONENT data. The stencil and depth masks are applied, as are the pixel ownership and scissor tests, but all other + * operations are skipped.

+ * + *

glReadPixels of GL_DEPTH_STENCIL_EXT data reads back a rectangle from both the depth and stencil buffers.

+ * + *

glCopyPixels of GL_DEPTH_STENCIL_EXT data copies a rectangle from both the depth and stencil buffers. Like glDrawPixels, it applies both the stencil + * and depth masks but skips the remainder of the OpenGL fragment pipeline.

+ * + *

glTex[Sub]Image[1,2,3]D of GL_DEPTH_STENCIL_EXT data loads depth and stencil data into a depth_stencil texture. glGetTexImage of GL_DEPTH_STENCIL_EXT + * data can be used to retrieve depth and stencil data from a depth/stencil texture.

+ * + *

In addition, a new base internal format, GL_DEPTH_STENCIL_EXT, can be used by both texture images and renderbuffer storage. When an image with a + * DEPTH_STENCIL_EXT internal format is attached to both the depth and stencil attachment points of a framebuffer object (see EXT_framebuffer_object), + * then it becomes both the depth and stencil buffers of the framebuffer. This fits nicely with hardware that interleaves both depth and stencil data into + * a single buffer. When a texture with DEPTH_STENCIL_EXT data is bound for texturing, only the depth component is accessible through the texture fetcher. + * The stencil data can be written with TexImage or CopyTexImage, and can be read with GetTexImage. When a DEPTH_STENCIL_EXT image is attached to the + * stencil attachment of the bound framebuffer object, the stencil data can be accessed through any operation that reads from or writes to the + * framebuffer's stencil buffer.

+ * + *

Requires {@link EXTFramebufferObject EXT_framebuffer_object}. Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ +public final class EXTPackedDepthStencil { + + /** + * Accepted by the {@code format} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, and + * GetTexImage, by the {@code type} parameter of CopyPixels, by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, + * CopyTexImage2D, and RenderbufferStorageEXT, and returned in the {@code data} parameter of GetTexLevelParameter and GetRenderbufferParameterivEXT. + */ + public static final int GL_DEPTH_STENCIL_EXT = 0x84F9; + + /** + * Accepted by the {@code type} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, and + * GetTexImage. + */ + public static final int GL_UNSIGNED_INT_24_8_EXT = 0x84FA; + + /** + * Accepted by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and RenderbufferStorageEXT, and + * returned in the {@code data} parameter of GetTexLevelParameter and GetRenderbufferParameterivEXT. + */ + public static final int GL_DEPTH24_STENCIL8_EXT = 0x88F0; + + /** Accepted by the {@code value} parameter of GetTexLevelParameter. */ + public static final int GL_TEXTURE_STENCIL_SIZE_EXT = 0x88F1; + + private EXTPackedDepthStencil() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTPackedFloat.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTPackedFloat.java new file mode 100644 index 00000000..2231ea6f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTPackedFloat.java @@ -0,0 +1,41 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_packed_float extension. + * + *

This extension adds a new 3-component floating-point texture format that fits within a single 32-bit word. This format stores 5 bits of biased exponent + * per component in the same manner as 16-bit floating-point formats, but rather than 10 mantissa bits, the red, green, and blue components have 6, 6, and + * 5 bits respectively. Each mantissa is assumed to have an implied leading one except in the denorm exponent case. There is no sign bit so only + * non-negative values can be represented. Positive infinity, positive denorms, and positive NaN values are representable. The value of the fourth + * component returned by a texture fetch is always 1.0.

+ * + *

This extension also provides support for rendering into an unsigned floating-point rendering format with the assumption that the texture format + * described above could also be advertised as an unsigned floating-point format for rendering.

+ * + *

The extension also provides a pixel external format for specifying packed float values directly.

+ * + *

Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ +public final class EXTPackedFloat { + + /** Accepted by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and RenderbufferStorageEXT. */ + public static final int GL_R11F_G11F_B10F_EXT = 0x8C3A; + + /** + * Accepted by the {@code type} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, GetTexImage, TexImage3D, TexSubImage1D, TexSubImage2D, + * TexSubImage3D, GetHistogram, GetMinmax, ConvolutionFilter1D, ConvolutionFilter2D, ConvolutionFilter3D, GetConvolutionFilter, SeparableFilter2D, + * GetSeparableFilter, ColorTable, ColorSubTable, and GetColorTable. + */ + public static final int GL_UNSIGNED_INT_10F_11F_11F_REV_EXT = 0x8C3B; + + /** Accepted by the {@code pname} parameters of GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_RGBA_SIGNED_COMPONENTS_EXT = 0x8C3C; + + private EXTPackedFloat() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTPixelBufferObject.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTPixelBufferObject.java new file mode 100644 index 00000000..06ac8a81 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTPixelBufferObject.java @@ -0,0 +1,31 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_pixel_buffer_object extension. + * + *

This extension expands on the interface provided by buffer objects. It is intended to permit buffer objects to be used not only with vertex array data, + * but also with pixel data. Buffer objects were promoted from the ARB_vertex_buffer_object extension in OpenGL 1.5.

+ */ +public final class EXTPixelBufferObject { + + /** + * Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferParameteriv, and + * GetBufferPointerv. + */ + public static final int + GL_PIXEL_PACK_BUFFER_EXT = 0x88EB, + GL_PIXEL_UNPACK_BUFFER_EXT = 0x88EC; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_PIXEL_PACK_BUFFER_BINDING_EXT = 0x88ED, + GL_PIXEL_UNPACK_BUFFER_BINDING_EXT = 0x88EF; + + private EXTPixelBufferObject() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTPointParameters.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTPointParameters.java new file mode 100644 index 00000000..bc355aeb --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTPointParameters.java @@ -0,0 +1,106 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the EXT_point_parameters extension. + * + *

This extension supports additional geometric characteristics of points. It can be used to render particles or tiny light sources, commonly referred as + * "Light points".

+ * + *

The raster brightness of a point is a function of the point area, point color, point transparency, and the response of the display's electron gun and + * phosphor. The point area and the point transparency are derived from the point size, currently provided with the {@code size} parameter of + * {@link GL11C#glPointSize PointSize}.

+ * + *

The primary motivation is to allow the size of a point to be affected by distance attenuation. When distance attenuation has an effect, the final point + * size decreases as the distance of the point from the eye increases.

+ * + *

The secondary motivation is a mean to control the mapping from the point size to the raster point area and point transparency. This is done in order to + * increase the dynamic range of the raster brightness of points. In other words, the alpha component of a point may be decreased (and its transparency + * increased) as its area shrinks below a defined threshold.

+ * + *

This extension defines a derived point size to be closely related to point brightness. The brightness of a point is given by:

+ * + *

+ *                         1
+ * dist_atten(d) = -------------------
+ *                 a + b * d + c * d^2
+ * 
+ * brightness(Pe) = Brightness * dist_atten(|Pe|)
+ * + *

where 'Pe' is the point in eye coordinates, and 'Brightness' is some initial value proportional to the square of the size provided with glPointSize. + * Here we simplify the raster brightness to be a function of the rasterized point area and point transparency.

+ * + *

+ *             brightness(Pe)      brightness(Pe) >= Threshold_Area
+ * area(Pe) =
+ *             Threshold_Area      Otherwise
+ * 
+ * factor(Pe) = brightness(Pe)/Threshold_Area
+ * 
+ * alpha(Pe) = Alpha * factor(Pe)
+ * + *

where 'Alpha' comes with the point color (possibly modified by lighting).

+ * + *

'Threshold_Area' above is in area units. Thus, it is proportional to the square of the threshold provided by the programmer through this extension.

+ * + *

The new point size derivation method applies to all points, while the threshold applies to multisample points only.

+ */ +public class EXTPointParameters { + + /** Accepted by the {@code pname} parameter of glPointParameterfvEXT, and the {@code pname} of glGet. */ + public static final int + GL_POINT_SIZE_MIN_EXT = 0x8126, + GL_POINT_SIZE_MAX_EXT = 0x8127, + GL_POINT_FADE_THRESHOLD_SIZE_EXT = 0x8128, + GL_DISTANCE_ATTENUATION_EXT = 0x8129; + + static { GL.initialize(); } + + protected EXTPointParameters() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glPointParameterfEXT, caps.glPointParameterfvEXT + ); + } + + // --- [ glPointParameterfEXT ] --- + + public static native void glPointParameterfEXT(@NativeType("GLenum") int pname, @NativeType("GLfloat") float param); + + // --- [ glPointParameterfvEXT ] --- + + public static native void nglPointParameterfvEXT(int pname, long params); + + public static void glPointParameterfvEXT(@NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglPointParameterfvEXT(pname, memAddress(params)); + } + + /** Array version of: {@link #glPointParameterfvEXT PointParameterfvEXT} */ + public static void glPointParameterfvEXT(@NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] params) { + long __functionAddress = GL.getICD().glPointParameterfvEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(pname, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTPolygonOffsetClamp.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTPolygonOffsetClamp.java new file mode 100644 index 00000000..00884d4c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTPolygonOffsetClamp.java @@ -0,0 +1,56 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_polygon_offset_clamp extension. + * + *

This extension adds a new parameter to the polygon offset function that clamps the calculated offset to a minimum or maximum value. The clamping + * functionality is useful when polygons are nearly parallel to the view direction because their high slopes can result in arbitrarily large polygon + * offsets. In the particular case of shadow mapping, the lack of clamping can produce the appearance of unwanted holes when the shadow casting polygons + * are offset beyond the shadow receiving polygons, and this problem can be alleviated by enforcing a maximum offset value.

+ * + *

Requires {@link GL33 OpenGL 3.3}.

+ */ +public class EXTPolygonOffsetClamp { + + /** Accepted by the {@code pname} parameters of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int GL_POLYGON_OFFSET_CLAMP_EXT = 0x8E1B; + + static { GL.initialize(); } + + protected EXTPolygonOffsetClamp() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glPolygonOffsetClampEXT + ); + } + + // --- [ glPolygonOffsetClampEXT ] --- + + /** + * The depth values of all fragments generated by the rasterization of a polygon may be offset by a single value that is computed for that polygon. The + * function that determines this value is specified with this command. + * + *

{@code factor} scales the maximum depth slope of the polygon, and {@code units} scales an implementation-dependent constant that relates to the usable + * resolution of the depth buffer. The resulting values are summed to produce the polygon offset value, which may then be clamped to a minimum or maximum + * value specified by {@code clamp}. The values {@code factor}, {@code units}, and {@code clamp} may each be positive, negative, or zero. Calling the + * command {@link GL11C#glPolygonOffset PolygonOffset} is equivalent to calling the command PolygonOffsetClampEXT with {@code clamp} equal to zero.

+ * + * @param factor scales the maximum depth slope of the polygon + * @param units scales an implementation-dependent constant that relates to the usable resolution of the depth buffer + * @param clamp the minimum or maximum clamp value + */ + public static native void glPolygonOffsetClampEXT(@NativeType("GLfloat") float factor, @NativeType("GLfloat") float units, @NativeType("GLfloat") float clamp); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTProvokingVertex.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTProvokingVertex.java new file mode 100644 index 00000000..3a3eacef --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTProvokingVertex.java @@ -0,0 +1,61 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_provoking_vertex extension. + * + *

This extension provides an alternative provoking vertex convention for rendering lines, triangles, and (optionally depending on the implementation) + * quads.

+ * + *

The provoking vertex of a primitive is the vertex that determines the constant primary and secondary colors when flat shading is enabled.

+ * + *

In OpenGL, the provoking vertex for triangle, quad, line, and (trivially) point primitives is the last vertex used to assemble the primitive. The + * polygon primitive is an exception in OpenGL where the first vertex of a polygon primitive determines the color of the polygon, even if actually broken + * into triangles and/or quads.

+ * + *

See section 2.14.7 (Flatshading) of the OpenGL 2.1 specification, particularly Table 2.12 for more details.

+ * + *

Alternatively the provoking vertex could be the first vertex of the primitive. Other APIs with flat-shading functionality such as Reality Lab and + * Direct3D have adopted the "first vertex of the primitive" convention to determine the provoking vertex. However, these APIs lack quads so do not have a + * defined provoking vertex convention for quads.

+ * + *

The motivation for this extension is to allow applications developed for APIs with a "first vertex of the primitive" provoking vertex to be easily + * converted to OpenGL.

+ */ +public class EXTProvokingVertex { + + /** Accepted by the {@code mode} parameter of ProvokingVertexEXT. */ + public static final int + GL_FIRST_VERTEX_CONVENTION_EXT = 0x8E4D, + GL_LAST_VERTEX_CONVENTION_EXT = 0x8E4E; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_PROVOKING_VERTEX_EXT = 0x8E4F, + GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION_EXT = 0x8E4C; + + static { GL.initialize(); } + + protected EXTProvokingVertex() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glProvokingVertexEXT + ); + } + + // --- [ glProvokingVertexEXT ] --- + + public static native void glProvokingVertexEXT(@NativeType("GLenum") int mode); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTRasterMultisample.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTRasterMultisample.java new file mode 100644 index 00000000..d5d6c96b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTRasterMultisample.java @@ -0,0 +1,86 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_raster_multisample extension. + * + *

This extension allows rendering to a non-multisample color buffer while rasterizing with more than one sample. The result of rasterization (coverage) + * is available in the {@code gl_SampleMaskIn[]} fragment shader input, multisample rasterization is enabled for all primitives, and several per- fragment + * operations operate at the raster sample rate.

+ * + *

When using the functionality provided by this extension, depth, stencil, and depth bounds tests must be disabled, and a multisample draw framebuffer + * must not be used.

+ * + *

A fragment's "coverage", or "effective raster samples" is considered to have "N bits" (as opposed to "one bit" corresponding to the single color + * sample) through the fragment shader, in the sample mask output, through the multisample fragment operations and occlusion query, until the coverage is + * finally "reduced" to a single bit in a new "Coverage Reduction" stage that occurs before blending.

+ */ +public class EXTRasterMultisample { + + /** Accepted by the {@code cap} parameter of Enable, Disable, IsEnabled. */ + public static final int GL_RASTER_MULTISAMPLE_EXT = 0x9327; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_RASTER_SAMPLES_EXT = 0x9328, + GL_MAX_RASTER_SAMPLES_EXT = 0x9329, + GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT = 0x932A, + GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT = 0x932B, + GL_EFFECTIVE_RASTER_SAMPLES_EXT = 0x932C; + + static { GL.initialize(); } + + protected EXTRasterMultisample() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glRasterSamplesEXT + ); + } + + // --- [ glRasterSamplesEXT ] --- + + /** + * Selects the number of samples to be used for rasterization. {@code samples} represents a request for a desired minimum number of samples. Since + * different implementations may support different sample counts, the actual sample pattern used is implementation-dependent. However, the resulting value + * for {@link #GL_RASTER_SAMPLES_EXT RASTER_SAMPLES_EXT} is guaranteed to be greater than or equal to {@code samples} and no more than the next larger sample count supported by the + * implementation. If {@code fixedsamplelocations} is {@link GL11#GL_TRUE TRUE}, identical sample locations will be used for all pixels. The sample locations chosen are a + * function of only the parameters to RasterSamplesEXT and not of any other state. + * + *

If {@link #GL_RASTER_MULTISAMPLE_EXT RASTER_MULTISAMPLE_EXT} is enabled, then the sample pattern chosen by RasterSamplesEXT will be used instead of sampling at the center of the pixel. + * The sample locations can be queried with {@link GL32C#glGetMultisamplefv GetMultisamplefv} with a {@code pname} of {@link GL32#GL_SAMPLE_POSITION SAMPLE_POSITION}, similar to normal multisample sample + * locations.

+ * + *

The value {@link #GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT MULTISAMPLE_RASTERIZATION_ALLOWED_EXT} is {@link GL11#GL_TRUE TRUE} if {@link GL13#GL_SAMPLE_BUFFERS SAMPLE_BUFFERS} is one or if {@link #GL_RASTER_MULTISAMPLE_EXT RASTER_MULTISAMPLE_EXT} is enabled. The value + * {@link #GL_EFFECTIVE_RASTER_SAMPLES_EXT EFFECTIVE_RASTER_SAMPLES_EXT} is equal to {@link #GL_RASTER_SAMPLES_EXT RASTER_SAMPLES_EXT} if {@link #GL_RASTER_MULTISAMPLE_EXT RASTER_MULTISAMPLE_EXT} is enabled, otherwise is equal to {@link GL13#GL_SAMPLES SAMPLES}.

+ * + *

Explicit multisample rasterization can not be used in conjunction with depth, stencil, or depth bounds tests, multisample framebuffers, or if + * {@link #GL_RASTER_SAMPLES_EXT RASTER_SAMPLES_EXT} is zero. If {@link #GL_RASTER_MULTISAMPLE_EXT RASTER_MULTISAMPLE_EXT} is enabled, the error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} will be generated by Draw commands if

+ * + *
    + *
  • the value of {@link #GL_RASTER_SAMPLES_EXT RASTER_SAMPLES_EXT} is zero
  • + *
  • the depth, stencil, or depth bounds test is enabled
  • + *
  • a multisample draw framebuffer is bound ({@link GL13#GL_SAMPLE_BUFFERS SAMPLE_BUFFERS} is one)
  • + *
+ * + *
Errors
+ * + *

An {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error is generated if {@code samples} is greater than the value of {@link #GL_MAX_RASTER_SAMPLES_EXT MAX_RASTER_SAMPLES_EXT} (the implementation-dependent maximum + * number of samples).

+ * + * @param samples the number of samples to be used for rasterization + * @param fixedsamplelocations if {@link GL11#GL_TRUE TRUE}, identical sample locations will be used for all pixels + */ + public static native void glRasterSamplesEXT(@NativeType("GLuint") int samples, @NativeType("GLboolean") boolean fixedsamplelocations); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSecondaryColor.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSecondaryColor.java new file mode 100644 index 00000000..040cc876 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSecondaryColor.java @@ -0,0 +1,434 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the EXT_secondary_color extension. + * + *

This extension allows specifying the RGB components of the secondary color used in the Color Sum stage, instead of using the default (0,0,0,0) color. + * It applies only in RGBA mode and when LIGHTING is disabled.

+ */ +public class EXTSecondaryColor { + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_COLOR_SUM_EXT = 0x8458; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_CURRENT_SECONDARY_COLOR_EXT = 0x8459, + GL_SECONDARY_COLOR_ARRAY_SIZE_EXT = 0x845A, + GL_SECONDARY_COLOR_ARRAY_TYPE_EXT = 0x845B, + GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT = 0x845C; + + /** Accepted by the {@code pname} parameter of GetPointerv. */ + public static final int GL_SECONDARY_COLOR_ARRAY_POINTER_EXT = 0x845D; + + /** Accepted by the {@code array} parameter of EnableClientState and DisableClientState. */ + public static final int GL_SECONDARY_COLOR_ARRAY_EXT = 0x845E; + + static { GL.initialize(); } + + protected EXTSecondaryColor() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glSecondaryColor3bEXT, caps.glSecondaryColor3sEXT, caps.glSecondaryColor3iEXT, caps.glSecondaryColor3fEXT, caps.glSecondaryColor3dEXT, + caps.glSecondaryColor3ubEXT, caps.glSecondaryColor3usEXT, caps.glSecondaryColor3uiEXT, caps.glSecondaryColor3bvEXT, caps.glSecondaryColor3svEXT, + caps.glSecondaryColor3ivEXT, caps.glSecondaryColor3fvEXT, caps.glSecondaryColor3dvEXT, caps.glSecondaryColor3ubvEXT, caps.glSecondaryColor3usvEXT, + caps.glSecondaryColor3uivEXT, caps.glSecondaryColorPointerEXT + ); + } + + // --- [ glSecondaryColor3bEXT ] --- + + /** + * Sets the R, G, and B components of the current secondary color. + * + * @param red the red component of the current secondary color + * @param green the green component of the current secondary color + * @param blue the blue component of the current secondary color + */ + public static native void glSecondaryColor3bEXT(@NativeType("GLbyte") byte red, @NativeType("GLbyte") byte green, @NativeType("GLbyte") byte blue); + + // --- [ glSecondaryColor3sEXT ] --- + + /** + * Short version of {@link #glSecondaryColor3bEXT SecondaryColor3bEXT} + * + * @param red the red component of the current secondary color + * @param green the green component of the current secondary color + * @param blue the blue component of the current secondary color + */ + public static native void glSecondaryColor3sEXT(@NativeType("GLshort") short red, @NativeType("GLshort") short green, @NativeType("GLshort") short blue); + + // --- [ glSecondaryColor3iEXT ] --- + + /** + * Integer version of {@link #glSecondaryColor3bEXT SecondaryColor3bEXT} + * + * @param red the red component of the current secondary color + * @param green the green component of the current secondary color + * @param blue the blue component of the current secondary color + */ + public static native void glSecondaryColor3iEXT(@NativeType("GLint") int red, @NativeType("GLint") int green, @NativeType("GLint") int blue); + + // --- [ glSecondaryColor3fEXT ] --- + + /** + * Float version of {@link #glSecondaryColor3bEXT SecondaryColor3bEXT} + * + * @param red the red component of the current secondary color + * @param green the green component of the current secondary color + * @param blue the blue component of the current secondary color + */ + public static native void glSecondaryColor3fEXT(@NativeType("GLfloat") float red, @NativeType("GLfloat") float green, @NativeType("GLfloat") float blue); + + // --- [ glSecondaryColor3dEXT ] --- + + /** + * Double version of {@link #glSecondaryColor3bEXT SecondaryColor3bEXT} + * + * @param red the red component of the current secondary color + * @param green the green component of the current secondary color + * @param blue the blue component of the current secondary color + */ + public static native void glSecondaryColor3dEXT(@NativeType("GLdouble") double red, @NativeType("GLdouble") double green, @NativeType("GLdouble") double blue); + + // --- [ glSecondaryColor3ubEXT ] --- + + /** + * Unsigned version of {@link #glSecondaryColor3bEXT SecondaryColor3bEXT} + * + * @param red the red component of the current secondary color + * @param green the green component of the current secondary color + * @param blue the blue component of the current secondary color + */ + public static native void glSecondaryColor3ubEXT(@NativeType("GLubyte") byte red, @NativeType("GLubyte") byte green, @NativeType("GLubyte") byte blue); + + // --- [ glSecondaryColor3usEXT ] --- + + /** + * Unsigned short version of {@link #glSecondaryColor3bEXT SecondaryColor3bEXT} + * + * @param red the red component of the current secondary color + * @param green the green component of the current secondary color + * @param blue the blue component of the current secondary color + */ + public static native void glSecondaryColor3usEXT(@NativeType("GLushort") short red, @NativeType("GLushort") short green, @NativeType("GLushort") short blue); + + // --- [ glSecondaryColor3uiEXT ] --- + + /** + * Unsigned int version of {@link #glSecondaryColor3bEXT SecondaryColor3bEXT} + * + * @param red the red component of the current secondary color + * @param green the green component of the current secondary color + * @param blue the blue component of the current secondary color + */ + public static native void glSecondaryColor3uiEXT(@NativeType("GLint") int red, @NativeType("GLint") int green, @NativeType("GLint") int blue); + + // --- [ glSecondaryColor3bvEXT ] --- + + /** Unsafe version of: {@link #glSecondaryColor3bvEXT SecondaryColor3bvEXT} */ + public static native void nglSecondaryColor3bvEXT(long v); + + /** + * Pointer version of {@link #glSecondaryColor3bEXT SecondaryColor3bEXT}. + * + * @param v the secondary color buffer + */ + public static void glSecondaryColor3bvEXT(@NativeType("GLbyte const *") ByteBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglSecondaryColor3bvEXT(memAddress(v)); + } + + // --- [ glSecondaryColor3svEXT ] --- + + /** Unsafe version of: {@link #glSecondaryColor3svEXT SecondaryColor3svEXT} */ + public static native void nglSecondaryColor3svEXT(long v); + + /** + * Pointer version of {@link #glSecondaryColor3sEXT SecondaryColor3sEXT}. + * + * @param v the secondary color buffer + */ + public static void glSecondaryColor3svEXT(@NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglSecondaryColor3svEXT(memAddress(v)); + } + + // --- [ glSecondaryColor3ivEXT ] --- + + /** Unsafe version of: {@link #glSecondaryColor3ivEXT SecondaryColor3ivEXT} */ + public static native void nglSecondaryColor3ivEXT(long v); + + /** + * Pointer version of {@link #glSecondaryColor3iEXT SecondaryColor3iEXT}. + * + * @param v the secondary color buffer + */ + public static void glSecondaryColor3ivEXT(@NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglSecondaryColor3ivEXT(memAddress(v)); + } + + // --- [ glSecondaryColor3fvEXT ] --- + + /** Unsafe version of: {@link #glSecondaryColor3fvEXT SecondaryColor3fvEXT} */ + public static native void nglSecondaryColor3fvEXT(long v); + + /** + * Pointer version of {@link #glSecondaryColor3fEXT SecondaryColor3fEXT}. + * + * @param v the secondary color buffer + */ + public static void glSecondaryColor3fvEXT(@NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglSecondaryColor3fvEXT(memAddress(v)); + } + + // --- [ glSecondaryColor3dvEXT ] --- + + /** Unsafe version of: {@link #glSecondaryColor3dvEXT SecondaryColor3dvEXT} */ + public static native void nglSecondaryColor3dvEXT(long v); + + /** + * Pointer version of {@link #glSecondaryColor3dEXT SecondaryColor3dEXT}. + * + * @param v the secondary color buffer + */ + public static void glSecondaryColor3dvEXT(@NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglSecondaryColor3dvEXT(memAddress(v)); + } + + // --- [ glSecondaryColor3ubvEXT ] --- + + /** Unsafe version of: {@link #glSecondaryColor3ubvEXT SecondaryColor3ubvEXT} */ + public static native void nglSecondaryColor3ubvEXT(long v); + + /** + * Pointer version of {@link #glSecondaryColor3ubEXT SecondaryColor3ubEXT}. + * + * @param v the secondary color buffer + */ + public static void glSecondaryColor3ubvEXT(@NativeType("GLubyte const *") ByteBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglSecondaryColor3ubvEXT(memAddress(v)); + } + + // --- [ glSecondaryColor3usvEXT ] --- + + /** Unsafe version of: {@link #glSecondaryColor3usvEXT SecondaryColor3usvEXT} */ + public static native void nglSecondaryColor3usvEXT(long v); + + /** + * Pointer version of {@link #glSecondaryColor3usEXT SecondaryColor3usEXT}. + * + * @param v the secondary color buffer + */ + public static void glSecondaryColor3usvEXT(@NativeType("GLushort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglSecondaryColor3usvEXT(memAddress(v)); + } + + // --- [ glSecondaryColor3uivEXT ] --- + + /** Unsafe version of: {@link #glSecondaryColor3uivEXT SecondaryColor3uivEXT} */ + public static native void nglSecondaryColor3uivEXT(long v); + + /** + * Pointer version of {@link #glSecondaryColor3uiEXT SecondaryColor3uiEXT}. + * + * @param v the secondary color buffer + */ + public static void glSecondaryColor3uivEXT(@NativeType("GLuint const *") IntBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglSecondaryColor3uivEXT(memAddress(v)); + } + + // --- [ glSecondaryColorPointerEXT ] --- + + /** Unsafe version of: {@link #glSecondaryColorPointerEXT SecondaryColorPointerEXT} */ + public static native void nglSecondaryColorPointerEXT(int size, int type, int stride, long pointer); + + /** + * Specifies the location and organization of a secondary color array. + * + * @param size the number of values per vertex that are stored in the array, as well as their component ordering. Must be:
3
+ * @param type the data type of the values stored in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}
{@link GL11#GL_FLOAT FLOAT}{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the secondary color array data + */ + public static void glSecondaryColorPointerEXT(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + nglSecondaryColorPointerEXT(size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a secondary color array. + * + * @param size the number of values per vertex that are stored in the array, as well as their component ordering. Must be:
3
+ * @param type the data type of the values stored in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}
{@link GL11#GL_FLOAT FLOAT}{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the secondary color array data + */ + public static void glSecondaryColorPointerEXT(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + nglSecondaryColorPointerEXT(size, type, stride, pointer); + } + + /** + * Specifies the location and organization of a secondary color array. + * + * @param size the number of values per vertex that are stored in the array, as well as their component ordering. Must be:
3
+ * @param type the data type of the values stored in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}
{@link GL11#GL_FLOAT FLOAT}{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the secondary color array data + */ + public static void glSecondaryColorPointerEXT(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ShortBuffer pointer) { + nglSecondaryColorPointerEXT(size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a secondary color array. + * + * @param size the number of values per vertex that are stored in the array, as well as their component ordering. Must be:
3
+ * @param type the data type of the values stored in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}
{@link GL11#GL_FLOAT FLOAT}{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the secondary color array data + */ + public static void glSecondaryColorPointerEXT(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") IntBuffer pointer) { + nglSecondaryColorPointerEXT(size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a secondary color array. + * + * @param size the number of values per vertex that are stored in the array, as well as their component ordering. Must be:
3
+ * @param type the data type of the values stored in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}
{@link GL11#GL_FLOAT FLOAT}{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the secondary color array data + */ + public static void glSecondaryColorPointerEXT(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") FloatBuffer pointer) { + nglSecondaryColorPointerEXT(size, type, stride, memAddress(pointer)); + } + + /** Array version of: {@link #glSecondaryColor3svEXT SecondaryColor3svEXT} */ + public static void glSecondaryColor3svEXT(@NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glSecondaryColor3svEXT; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** Array version of: {@link #glSecondaryColor3ivEXT SecondaryColor3ivEXT} */ + public static void glSecondaryColor3ivEXT(@NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glSecondaryColor3ivEXT; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** Array version of: {@link #glSecondaryColor3fvEXT SecondaryColor3fvEXT} */ + public static void glSecondaryColor3fvEXT(@NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glSecondaryColor3fvEXT; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** Array version of: {@link #glSecondaryColor3dvEXT SecondaryColor3dvEXT} */ + public static void glSecondaryColor3dvEXT(@NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glSecondaryColor3dvEXT; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** Array version of: {@link #glSecondaryColor3usvEXT SecondaryColor3usvEXT} */ + public static void glSecondaryColor3usvEXT(@NativeType("GLushort const *") short[] v) { + long __functionAddress = GL.getICD().glSecondaryColor3usvEXT; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** Array version of: {@link #glSecondaryColor3uivEXT SecondaryColor3uivEXT} */ + public static void glSecondaryColor3uivEXT(@NativeType("GLuint const *") int[] v) { + long __functionAddress = GL.getICD().glSecondaryColor3uivEXT; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** Array version of: {@link #glSecondaryColorPointerEXT SecondaryColorPointerEXT} */ + public static void glSecondaryColorPointerEXT(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") short[] pointer) { + long __functionAddress = GL.getICD().glSecondaryColorPointerEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(size, type, stride, pointer, __functionAddress); + } + + /** Array version of: {@link #glSecondaryColorPointerEXT SecondaryColorPointerEXT} */ + public static void glSecondaryColorPointerEXT(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") int[] pointer) { + long __functionAddress = GL.getICD().glSecondaryColorPointerEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(size, type, stride, pointer, __functionAddress); + } + + /** Array version of: {@link #glSecondaryColorPointerEXT SecondaryColorPointerEXT} */ + public static void glSecondaryColorPointerEXT(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") float[] pointer) { + long __functionAddress = GL.getICD().glSecondaryColorPointerEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(size, type, stride, pointer, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSemaphore.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSemaphore.java new file mode 100644 index 00000000..75ef9734 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSemaphore.java @@ -0,0 +1,266 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the EXT_semaphore extension. + * + *

The Vulkan API introduces the concept of explicit memory objects and reusable synchronization objects. This extension brings those concepts to the + * OpenGL API via two new object types:

+ * + *
    + *
  • Memory objects
  • + *
  • Semaphores
  • + *
+ * + *

Rather than allocating memory as a response to object allocation, memory allocation and binding are two separate operations in Vulkan. This extension + * allows an OpenGL application to import a Vulkan memory object, and to bind textures and/or buffer objects to it.

+ * + *

No methods to import memory objects are defined here. Separate platform-specific extensions are defined for this purpose.

+ * + *

Semaphores are synchronization primitives that can be waited on and signaled only by the GPU, or in GL terms, in the GL server. They are similar in + * concept to GL's "sync" objects and EGL's "EGLSync" objects, but different enough that compatibilities between the two are difficult to derive.

+ * + *

Rather than attempt to map Vulkan semaphores on to GL/EGL sync objects to achieve interoperability, this extension introduces a new object, GL + * semaphores, that map directly to the semantics of Vulkan semaphores. To achieve full image and buffer memory coherence with a Vulkan driver, the + * commands that manipulate semaphores also allow external usage information to be imported and exported.

+ */ +public class EXTSemaphore { + + /** + * Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetFloatv, GetIntegerv, GetInteger64v, {@link #glGetUnsignedBytevEXT GetUnsignedBytevEXT}, and the + * {@code target} parameter of GetBooleani_v, GetIntegeri_v,GetFloati_v, GetDoublei_v, GetInteger64i_v, and {@link #glGetUnsignedBytei_vEXT GetUnsignedBytei_vEXT}. + */ + public static final int + GL_NUM_DEVICE_UUIDS_EXT = 0x9596, + GL_DEVICE_UUID_EXT = 0x9597, + GL_DRIVER_UUID_EXT = 0x9598; + + /** Constant values. */ + public static final int GL_UUID_SIZE_EXT = 16; + + /** Accepted by the {@code dstLayouts} parameter of {@link #glSignalSemaphoreEXT SignalSemaphoreEXT} and the {@code srcLayouts} parameter of {@link #glWaitSemaphoreEXT WaitSemaphoreEXT}. */ + public static final int + GL_LAYOUT_GENERAL_EXT = 0x958D, + GL_LAYOUT_COLOR_ATTACHMENT_EXT = 0x958E, + GL_LAYOUT_DEPTH_STENCIL_ATTACHMENT_EXT = 0x958F, + GL_LAYOUT_DEPTH_STENCIL_READ_ONLY_EXT = 0x9590, + GL_LAYOUT_SHADER_READ_ONLY_EXT = 0x9591, + GL_LAYOUT_TRANSFER_SRC_EXT = 0x9592, + GL_LAYOUT_TRANSFER_DST_EXT = 0x9593, + GL_LAYOUT_DEPTH_READ_ONLY_STENCIL_ATTACHMENT_EXT = 0x9530, + GL_LAYOUT_DEPTH_ATTACHMENT_STENCIL_READ_ONLY_EXT = 0x9531; + + static { GL.initialize(); } + + protected EXTSemaphore() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glGetUnsignedBytevEXT, caps.glGetUnsignedBytei_vEXT, caps.glGenSemaphoresEXT, caps.glDeleteSemaphoresEXT, caps.glIsSemaphoreEXT, + caps.glSemaphoreParameterui64vEXT, caps.glGetSemaphoreParameterui64vEXT, caps.glWaitSemaphoreEXT, caps.glSignalSemaphoreEXT + ); + } + + // --- [ glGetUnsignedBytevEXT ] --- + + public static void nglGetUnsignedBytevEXT(int pname, long data) { + EXTMemoryObject.nglGetUnsignedBytevEXT(pname, data); + } + + public static void glGetUnsignedBytevEXT(@NativeType("GLenum") int pname, @NativeType("GLubyte *") ByteBuffer data) { + EXTMemoryObject.glGetUnsignedBytevEXT(pname, data); + } + + // --- [ glGetUnsignedBytei_vEXT ] --- + + public static void nglGetUnsignedBytei_vEXT(int target, int index, long data) { + EXTMemoryObject.nglGetUnsignedBytei_vEXT(target, index, data); + } + + public static void glGetUnsignedBytei_vEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLubyte *") ByteBuffer data) { + EXTMemoryObject.glGetUnsignedBytei_vEXT(target, index, data); + } + + // --- [ glGenSemaphoresEXT ] --- + + public static native void nglGenSemaphoresEXT(int n, long semaphores); + + public static void glGenSemaphoresEXT(@NativeType("GLuint *") IntBuffer semaphores) { + nglGenSemaphoresEXT(semaphores.remaining(), memAddress(semaphores)); + } + + @NativeType("void") + public static int glGenSemaphoresEXT() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer semaphores = stack.callocInt(1); + nglGenSemaphoresEXT(1, memAddress(semaphores)); + return semaphores.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glDeleteSemaphoresEXT ] --- + + public static native void nglDeleteSemaphoresEXT(int n, long semaphores); + + public static void glDeleteSemaphoresEXT(@NativeType("GLuint const *") IntBuffer semaphores) { + nglDeleteSemaphoresEXT(semaphores.remaining(), memAddress(semaphores)); + } + + public static void glDeleteSemaphoresEXT(@NativeType("GLuint const *") int semaphore) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer semaphores = stack.ints(semaphore); + nglDeleteSemaphoresEXT(1, memAddress(semaphores)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glIsSemaphoreEXT ] --- + + @NativeType("GLboolean") + public static native boolean glIsSemaphoreEXT(@NativeType("GLuint") int semaphore); + + // --- [ glSemaphoreParameterui64vEXT ] --- + + public static native void nglSemaphoreParameterui64vEXT(int semaphore, int pname, long params); + + public static void glSemaphoreParameterui64vEXT(@NativeType("GLuint") int semaphore, @NativeType("GLenum") int pname, @NativeType("GLuint64 const *") LongBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglSemaphoreParameterui64vEXT(semaphore, pname, memAddress(params)); + } + + public static void glSemaphoreParameterui64EXT(@NativeType("GLuint") int semaphore, @NativeType("GLenum") int pname, @NativeType("GLuint64 const *") long param) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.longs(param); + nglSemaphoreParameterui64vEXT(semaphore, pname, memAddress(params)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetSemaphoreParameterui64vEXT ] --- + + public static native void nglGetSemaphoreParameterui64vEXT(int semaphore, int pname, long params); + + public static void glGetSemaphoreParameterui64vEXT(@NativeType("GLuint") int semaphore, @NativeType("GLenum") int pname, @NativeType("GLuint64 *") LongBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetSemaphoreParameterui64vEXT(semaphore, pname, memAddress(params)); + } + + @NativeType("void") + public static long glGetSemaphoreParameterui64EXT(@NativeType("GLuint") int semaphore, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglGetSemaphoreParameterui64vEXT(semaphore, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glWaitSemaphoreEXT ] --- + + public static native void nglWaitSemaphoreEXT(int semaphore, int numBufferBarriers, long buffers, int numTextureBarriers, long textures, long srcLayouts); + + public static void glWaitSemaphoreEXT(@NativeType("GLuint") int semaphore, @NativeType("GLuint const *") IntBuffer buffers, @NativeType("GLuint const *") IntBuffer textures, @NativeType("GLenum const *") IntBuffer srcLayouts) { + if (CHECKS) { + check(srcLayouts, textures.remaining()); + } + nglWaitSemaphoreEXT(semaphore, buffers.remaining(), memAddress(buffers), textures.remaining(), memAddress(textures), memAddress(srcLayouts)); + } + + // --- [ glSignalSemaphoreEXT ] --- + + public static native void nglSignalSemaphoreEXT(int semaphore, int numBufferBarriers, long buffers, int numTextureBarriers, long textures, long dstLayouts); + + public static void glSignalSemaphoreEXT(@NativeType("GLuint") int semaphore, @NativeType("GLuint const *") IntBuffer buffers, @NativeType("GLuint const *") IntBuffer textures, @NativeType("GLenum const *") IntBuffer dstLayouts) { + if (CHECKS) { + check(dstLayouts, textures.remaining()); + } + nglSignalSemaphoreEXT(semaphore, buffers.remaining(), memAddress(buffers), textures.remaining(), memAddress(textures), memAddress(dstLayouts)); + } + + /** Array version of: {@link #glGenSemaphoresEXT GenSemaphoresEXT} */ + public static void glGenSemaphoresEXT(@NativeType("GLuint *") int[] semaphores) { + long __functionAddress = GL.getICD().glGenSemaphoresEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(semaphores.length, semaphores, __functionAddress); + } + + /** Array version of: {@link #glDeleteSemaphoresEXT DeleteSemaphoresEXT} */ + public static void glDeleteSemaphoresEXT(@NativeType("GLuint const *") int[] semaphores) { + long __functionAddress = GL.getICD().glDeleteSemaphoresEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(semaphores.length, semaphores, __functionAddress); + } + + /** Array version of: {@link #glSemaphoreParameterui64vEXT SemaphoreParameterui64vEXT} */ + public static void glSemaphoreParameterui64vEXT(@NativeType("GLuint") int semaphore, @NativeType("GLenum") int pname, @NativeType("GLuint64 const *") long[] params) { + long __functionAddress = GL.getICD().glSemaphoreParameterui64vEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(semaphore, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetSemaphoreParameterui64vEXT GetSemaphoreParameterui64vEXT} */ + public static void glGetSemaphoreParameterui64vEXT(@NativeType("GLuint") int semaphore, @NativeType("GLenum") int pname, @NativeType("GLuint64 *") long[] params) { + long __functionAddress = GL.getICD().glGetSemaphoreParameterui64vEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(semaphore, pname, params, __functionAddress); + } + + /** Array version of: {@link #glWaitSemaphoreEXT WaitSemaphoreEXT} */ + public static void glWaitSemaphoreEXT(@NativeType("GLuint") int semaphore, @NativeType("GLuint const *") int[] buffers, @NativeType("GLuint const *") int[] textures, @NativeType("GLenum const *") int[] srcLayouts) { + long __functionAddress = GL.getICD().glWaitSemaphoreEXT; + if (CHECKS) { + check(__functionAddress); + check(srcLayouts, textures.length); + } + callPPPV(semaphore, buffers.length, buffers, textures.length, textures, srcLayouts, __functionAddress); + } + + /** Array version of: {@link #glSignalSemaphoreEXT SignalSemaphoreEXT} */ + public static void glSignalSemaphoreEXT(@NativeType("GLuint") int semaphore, @NativeType("GLuint const *") int[] buffers, @NativeType("GLuint const *") int[] textures, @NativeType("GLenum const *") int[] dstLayouts) { + long __functionAddress = GL.getICD().glSignalSemaphoreEXT; + if (CHECKS) { + check(__functionAddress); + check(dstLayouts, textures.length); + } + callPPPV(semaphore, buffers.length, buffers, textures.length, textures, dstLayouts, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSemaphoreFD.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSemaphoreFD.java new file mode 100644 index 00000000..28224f35 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSemaphoreFD.java @@ -0,0 +1,41 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_semaphore_fd extension. + * + *

Building upon the OpenGL memory object and semaphore framework defined in EXT_external_objects this extension enables an OpenGL + * application to import a memory object or semaphore from POSIX file descriptor external handles.

+ * + *

Requires {@link EXTSemaphore EXT_semaphore} and {@link ARBTextureStorage ARB_texture_storage} or a version of OpenGL that incorporates it.

+ */ +public class EXTSemaphoreFD { + + /** Accepted by the {@code handleType} parameter of {@link #glImportSemaphoreFdEXT ImportSemaphoreFdEXT}. */ + public static final int GL_HANDLE_TYPE_OPAQUE_FD_EXT = 0x9586; + + static { GL.initialize(); } + + protected EXTSemaphoreFD() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glImportSemaphoreFdEXT + ); + } + + // --- [ glImportSemaphoreFdEXT ] --- + + public static native void glImportSemaphoreFdEXT(@NativeType("GLuint") int semaphore, @NativeType("GLenum") int handleType, @NativeType("GLint") int fd); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSemaphoreWin32.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSemaphoreWin32.java new file mode 100644 index 00000000..381c4b24 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSemaphoreWin32.java @@ -0,0 +1,80 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_semaphore_win32 extension. + * + *

Building upon the OpenGL memory object and semaphore framework defined in EXT_external_objects, this extension enables an + * OpenGL application to import a memory object or semaphore from a Win32 NT handle or a KMT share handle.

+ */ +public class EXTSemaphoreWin32 { + + /** + * Accepted by the {@code handleType} parameter of {@link EXTMemoryObjectWin32#glImportMemoryWin32HandleEXT ImportMemoryWin32HandleEXT}, {@link EXTMemoryObjectWin32#glImportMemoryWin32NameEXT ImportMemoryWin32NameEXT}, {@link #glImportSemaphoreWin32HandleEXT ImportSemaphoreWin32HandleEXT}, and + * {@link #glImportSemaphoreWin32NameEXT ImportSemaphoreWin32NameEXT}. + */ + public static final int GL_HANDLE_TYPE_OPAQUE_WIN32_EXT = 0x9587; + + /** Accepted by the {@code handleType} parameter of {@link EXTMemoryObjectWin32#glImportMemoryWin32HandleEXT ImportMemoryWin32HandleEXT} and {@link #glImportSemaphoreWin32HandleEXT ImportSemaphoreWin32HandleEXT}. */ + public static final int GL_HANDLE_TYPE_OPAQUE_WIN32_KMT_EXT = 0x9588; + + /** + * Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetFloatv, GetIntegerv, GetInteger64v, GetBooleani_v, GetIntegeri_v, GetFloati_v, + * GetDoublei_v, and GetInteger64i_v. + */ + public static final int + GL_DEVICE_LUID_EXT = 0x9599, + GL_DEVICE_NODE_MASK_EXT = 0x959A; + + /** Constant values. */ + public static final int GL_LUID_SIZE_EXT = 8; + + /** Accepted by the {@code handleType} parameter of {@link #glImportSemaphoreWin32HandleEXT ImportSemaphoreWin32HandleEXT}. */ + public static final int GL_HANDLE_TYPE_D3D12_FENCE_EXT = 0x9594; + + /** Accepted by the {@code pname} parameter of {@link EXTSemaphore#glSemaphoreParameterui64vEXT SemaphoreParameterui64vEXT} and {@link EXTSemaphore#glGetSemaphoreParameterui64vEXT GetSemaphoreParameterui64vEXT}. */ + public static final int GL_D3D12_FENCE_VALUE_EXT = 0x9595; + + static { GL.initialize(); } + + protected EXTSemaphoreWin32() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glImportSemaphoreWin32HandleEXT, caps.glImportSemaphoreWin32NameEXT + ); + } + + // --- [ glImportSemaphoreWin32HandleEXT ] --- + + public static native void nglImportSemaphoreWin32HandleEXT(int semaphore, int handleType, long handle); + + public static void glImportSemaphoreWin32HandleEXT(@NativeType("GLuint") int semaphore, @NativeType("GLenum") int handleType, @NativeType("void *") long handle) { + if (CHECKS) { + check(handle); + } + nglImportSemaphoreWin32HandleEXT(semaphore, handleType, handle); + } + + // --- [ glImportSemaphoreWin32NameEXT ] --- + + public static native void nglImportSemaphoreWin32NameEXT(int semaphore, int handleType, long name); + + public static void glImportSemaphoreWin32NameEXT(@NativeType("GLuint") int semaphore, @NativeType("GLenum") int handleType, @NativeType("void const *") long name) { + if (CHECKS) { + check(name); + } + nglImportSemaphoreWin32NameEXT(semaphore, handleType, name); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSeparateShaderObjects.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSeparateShaderObjects.java new file mode 100644 index 00000000..87067cd0 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSeparateShaderObjects.java @@ -0,0 +1,102 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the EXT_separate_shader_objects extension. + * + *

rior to this extension, GLSL requires multiple shader domains (vertex, fragment, geometry) to be linked into a single monolithic program object to + * specify a GLSL shader for each domain.

+ * + *

While GLSL's monolithic approach has some advantages for optimizing shaders as a unit that span multiple domains, all existing GPU hardware supports + * the more flexible mix-and-match approach.

+ * + *

HLSL9, Cg, the prior OpenGL assembly program extensions, and game console programmers favor a more flexible "mix-and-match" approach to specifying + * shaders independently for these different shader domains. Many developers build their shader content around the mix-and-match approach where they can + * use a single vertex shader with multiple fragment shaders (or vice versa).

+ * + *

This keep-it-simple extension adapts the "mix-and-match" shader domain model for GLSL so different GLSL program objects can be bound to different + * shader domains.

+ * + *

This extension redefines the operation of glUseProgram(GLenum program) to be equivalent to:

+ * + *

+ *  glUseShaderProgramEXT(GL_VERTEX_SHADER, program);
+ * glUseShaderProgramEXT(GL_GEOMETRY_SHADER_EXT, program);
+ * glUseShaderProgramEXT(GL_FRAGMENT_SHADER, program);
+ * glActiveProgramEXT(program);
+ * + *

You can also call these commands separately to bind each respective domain. The GL_VERTEX_SHADER, GL_GEOMETRY_SHADER_EXT, and GL_FRAGMENT_SHADER tokens + * refer to the conventional vertex, geometry, and fragment domains respectively. glActiveProgramEXT specifies the program that glUniform* commands will + * update.

+ * + *

Separate linking creates the possibility that certain output varyings of a shader may go unread by the subsequent shader inputting varyings. In this + * case, the output varyings are simply ignored. It is also possible input varyings from a shader may not be written as output varyings of a preceding + * shader. In this case, the unwritten input varying values are undefined. Implementations are encouraged to zero these undefined input varying values.

+ * + *

This extension is a proof-of-concept that separate shader objects can work for GLSL and a response to repeated requests for this functionality. There + * are various loose ends, particularly when dealing with user-defined varyings. The hope is a future extension will improve this situation.

+ * + *

Requires {@link GL20 OpenGL 2.0} or {@link ARBShaderObjects ARB_shader_objects}.

+ */ +public class EXTSeparateShaderObjects { + + /** Accepted by {@code type} parameter to GetIntegerv and GetFloatv. */ + public static final int GL_ACTIVE_PROGRAM_EXT = 0x8B8D; + + static { GL.initialize(); } + + protected EXTSeparateShaderObjects() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glUseShaderProgramEXT, caps.glActiveProgramEXT, caps.glCreateShaderProgramEXT + ); + } + + // --- [ glUseShaderProgramEXT ] --- + + public static native void glUseShaderProgramEXT(@NativeType("GLenum") int type, @NativeType("GLuint") int program); + + // --- [ glActiveProgramEXT ] --- + + public static native void glActiveProgramEXT(@NativeType("GLuint") int program); + + // --- [ glCreateShaderProgramEXT ] --- + + public static native int nglCreateShaderProgramEXT(int type, long string); + + @NativeType("GLuint") + public static int glCreateShaderProgramEXT(@NativeType("GLenum") int type, @NativeType("GLchar const *") ByteBuffer string) { + if (CHECKS) { + checkNT1(string); + } + return nglCreateShaderProgramEXT(type, memAddress(string)); + } + + @NativeType("GLuint") + public static int glCreateShaderProgramEXT(@NativeType("GLenum") int type, @NativeType("GLchar const *") CharSequence string) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(string, true); + long stringEncoded = stack.getPointerAddress(); + return nglCreateShaderProgramEXT(type, stringEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTShaderFramebufferFetch.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTShaderFramebufferFetch.java new file mode 100644 index 00000000..612314a3 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTShaderFramebufferFetch.java @@ -0,0 +1,42 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_shader_framebuffer_fetch extension. + * + *

Conventional OpenGL blending provides a configurable series of operations that can be used to combine the output values from a fragment shader with the + * values already in the framebuffer. While these operations are suitable for basic image compositing, other compositing operations or operations that + * treat fragment output as something other than a color (normals, for instance) may not be expressible without multiple passes or render-to-texture + * operations.

+ * + *

This extension provides a mechanism whereby a fragment shader may read existing framebuffer data as input. This can be used to implement compositing + * operations that would have been inconvenient or impossible with fixed-function blending. It can also be used to apply a function to the framebuffer + * color, by writing a shader which uses the existing framebuffer color as its only input.

+ * + *

This extension provides two alternative name strings:

+ * + *
    + *
  • {@code GL_EXT_shader_framebuffer_fetch} guarantees full coherency between framebuffer reads and writes. If this extension string is exposed, the + * result of reading from the framebuffer from a fragment shader invocation is guaranteed to reflect values written by any previous overlapping + * samples in API primitive order, unless requested otherwise in the shader source using the noncoherent layout qualifier.
  • + *
  • {@code GL_EXT_shader_framebuffer_fetch_non_coherent} provides limited implicit coherency guarantees. Instead, the application is expected to call + * the {@link EXTShaderFramebufferFetchNonCoherent#glFramebufferFetchBarrierEXT FramebufferFetchBarrierEXT} command for previous framebuffer writes to become visible to subsequent fragment shader invocations. For this + * extension to give well-defined results applications may have to split rendering into multiple passes separated with + * {@code FramebufferFetchBarrierEXT} calls. The functionality provided by this extension is requested in the shader source using the noncoherent + * layout qualifier.
  • + *
+ * + *

Requires {@link GL20 OpenGL 2.0}.

+ */ +public final class EXTShaderFramebufferFetch { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_FRAGMENT_SHADER_DISCARDS_SAMPLES_EXT = 0x8A52; + + private EXTShaderFramebufferFetch() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTShaderFramebufferFetchNonCoherent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTShaderFramebufferFetchNonCoherent.java new file mode 100644 index 00000000..76044e0f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTShaderFramebufferFetchNonCoherent.java @@ -0,0 +1,45 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_shader_framebuffer_fetch_non_coherent extension. + * + *

See {@link EXTShaderFramebufferFetch EXT_shader_framebuffer_fetch}.

+ */ +public class EXTShaderFramebufferFetchNonCoherent { + + static { GL.initialize(); } + + protected EXTShaderFramebufferFetchNonCoherent() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glFramebufferFetchBarrierEXT + ); + } + + // --- [ glFramebufferFetchBarrierEXT ] --- + + /** + * Specifies a boundary between passes when reading existing framebuffer data from fragment shaders via the {@code gl_LastFragData} built-in variable. + * Previous framebuffer object writes regardless of the mechanism (including clears, blits and primitive rendering) are guaranteed to be visible to + * subsequent fragment shader invocations that read from the framebuffer once {@code FramebufferFetchBarrierEXT} is executed. + * + *

If {@code EXT_shader_framebuffer_fetch} is also supported: Because the implementation guarantees coherency of framebuffer reads and writes for color + * outputs not explicitly marked with the noncoherent layout qualifier, calling the {@code FramebufferFetchBarrierEXT} command is not required unless the + * application wishes to manage memory ordering of framebuffer reads and writes explicitly, which may provide better performance on some implementations + * in cases where rendering can be split into multiple passes with non-self-overlapping geometry.

+ */ + public static native void glFramebufferFetchBarrierEXT(); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTShaderImageLoadStore.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTShaderImageLoadStore.java new file mode 100644 index 00000000..d2516e09 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTShaderImageLoadStore.java @@ -0,0 +1,130 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_shader_image_load_store extension. + * + *

This extension provides GLSL built-in functions allowing shaders to load from, store to, and perform atomic read-modify-write operations to a single + * level of a texture object from any shader stage. These built-in functions are named imageLoad(), imageStore(), and imageAtomic*(), respectively, and + * accept integer texel coordinates to identify the texel accessed. The extension adds the notion of "image units" to the OpenGL API, to which texture + * levels are bound for access by the GLSL built-in functions. To allow shaders to specify the image unit to access, GLSL provides a new set of data types + * ("image*") similar to samplers. Each image variable is assigned an integer value to identify an image unit to access, which is specified using + * Uniform*() APIs in a manner similar to samplers. For implementations supporting the NV_gpu_program5 extensions, assembly language instructions to + * perform image loads, stores, and atomics are also provided.

+ * + *

This extension also provides the capability to explicitly enable "early" per-fragment tests, where operations like depth and stencil testing are + * performed prior to fragment shader execution. In unextended OpenGL, fragment shaders never have any side effects and implementations can sometimes + * perform per-fragment tests and discard some fragments prior to executing the fragment shader. Since this extension allows fragment shaders to write to + * texture and buffer object memory using the built-in image functions, such optimizations could lead to non-deterministic results. To avoid this, + * implementations supporting this extension may not perform such optimizations on shaders having such side effects. However, enabling early per-fragment + * tests guarantees that such tests will be performed prior to fragment shader execution, and ensures that image stores and atomics will not be performed + * by fragment shader invocations where these per-fragment tests fail.

+ * + *

Finally, this extension provides both a GLSL built-in function and an OpenGL API function allowing applications some control over the ordering of image + * loads, stores, and atomics relative to other OpenGL pipeline operations accessing the same memory. Because the extension provides the ability to + * perform random accesses to texture or buffer object memory, such accesses are not easily tracked by the OpenGL driver. To avoid the need for + * heavy-handed synchronization at the driver level, this extension requires manual synchronization. The MemoryBarrierEXT() OpenGL API function allows + * applications to specify a bitfield indicating the set of OpenGL API operations to synchronize relative to shader memory access. The memoryBarrier() + * GLSL built-in function provides a synchronization point within a given shader invocation to ensure that all memory accesses performed prior to the + * synchronization point complete prior to any started after the synchronization point.

+ * + *

Requires {@link GL30 OpenGL 3.0}.

+ */ +public class EXTShaderImageLoadStore { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_IMAGE_UNITS_EXT = 0x8F38, + GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS_EXT = 0x8F39, + GL_MAX_IMAGE_SAMPLES_EXT = 0x906D; + + /** Accepted by the {@code target} parameter of GetIntegeri_v and GetBooleani_v. */ + public static final int + GL_IMAGE_BINDING_NAME_EXT = 0x8F3A, + GL_IMAGE_BINDING_LEVEL_EXT = 0x8F3B, + GL_IMAGE_BINDING_LAYERED_EXT = 0x8F3C, + GL_IMAGE_BINDING_LAYER_EXT = 0x8F3D, + GL_IMAGE_BINDING_ACCESS_EXT = 0x8F3E, + GL_IMAGE_BINDING_FORMAT_EXT = 0x906E; + + /** Accepted by the {@code barriers} parameter of MemoryBarrierEXT. */ + public static final int + GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT_EXT = 0x1, + GL_ELEMENT_ARRAY_BARRIER_BIT_EXT = 0x2, + GL_UNIFORM_BARRIER_BIT_EXT = 0x4, + GL_TEXTURE_FETCH_BARRIER_BIT_EXT = 0x8, + GL_SHADER_IMAGE_ACCESS_BARRIER_BIT_EXT = 0x20, + GL_COMMAND_BARRIER_BIT_EXT = 0x40, + GL_PIXEL_BUFFER_BARRIER_BIT_EXT = 0x80, + GL_TEXTURE_UPDATE_BARRIER_BIT_EXT = 0x100, + GL_BUFFER_UPDATE_BARRIER_BIT_EXT = 0x200, + GL_FRAMEBUFFER_BARRIER_BIT_EXT = 0x400, + GL_TRANSFORM_FEEDBACK_BARRIER_BIT_EXT = 0x800, + GL_ATOMIC_COUNTER_BARRIER_BIT_EXT = 0x1000, + GL_ALL_BARRIER_BITS_EXT = 0xFFFFFFFF; + + /** Returned by the {@code type} parameter of GetActiveUniform. */ + public static final int + GL_IMAGE_1D_EXT = 0x904C, + GL_IMAGE_2D_EXT = 0x904D, + GL_IMAGE_3D_EXT = 0x904E, + GL_IMAGE_2D_RECT_EXT = 0x904F, + GL_IMAGE_CUBE_EXT = 0x9050, + GL_IMAGE_BUFFER_EXT = 0x9051, + GL_IMAGE_1D_ARRAY_EXT = 0x9052, + GL_IMAGE_2D_ARRAY_EXT = 0x9053, + GL_IMAGE_CUBE_MAP_ARRAY_EXT = 0x9054, + GL_IMAGE_2D_MULTISAMPLE_EXT = 0x9055, + GL_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x9056, + GL_INT_IMAGE_1D_EXT = 0x9057, + GL_INT_IMAGE_2D_EXT = 0x9058, + GL_INT_IMAGE_3D_EXT = 0x9059, + GL_INT_IMAGE_2D_RECT_EXT = 0x905A, + GL_INT_IMAGE_CUBE_EXT = 0x905B, + GL_INT_IMAGE_BUFFER_EXT = 0x905C, + GL_INT_IMAGE_1D_ARRAY_EXT = 0x905D, + GL_INT_IMAGE_2D_ARRAY_EXT = 0x905E, + GL_INT_IMAGE_CUBE_MAP_ARRAY_EXT = 0x905F, + GL_INT_IMAGE_2D_MULTISAMPLE_EXT = 0x9060, + GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x9061, + GL_UNSIGNED_INT_IMAGE_1D_EXT = 0x9062, + GL_UNSIGNED_INT_IMAGE_2D_EXT = 0x9063, + GL_UNSIGNED_INT_IMAGE_3D_EXT = 0x9064, + GL_UNSIGNED_INT_IMAGE_2D_RECT_EXT = 0x9065, + GL_UNSIGNED_INT_IMAGE_CUBE_EXT = 0x9066, + GL_UNSIGNED_INT_IMAGE_BUFFER_EXT = 0x9067, + GL_UNSIGNED_INT_IMAGE_1D_ARRAY_EXT = 0x9068, + GL_UNSIGNED_INT_IMAGE_2D_ARRAY_EXT = 0x9069, + GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY_EXT = 0x906A, + GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_EXT = 0x906B, + GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY_EXT = 0x906C; + + static { GL.initialize(); } + + protected EXTShaderImageLoadStore() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBindImageTextureEXT, caps.glMemoryBarrierEXT + ); + } + + // --- [ glBindImageTextureEXT ] --- + + public static native void glBindImageTextureEXT(@NativeType("GLuint") int index, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLboolean") boolean layered, @NativeType("GLint") int layer, @NativeType("GLenum") int access, @NativeType("GLint") int format); + + // --- [ glMemoryBarrierEXT ] --- + + public static native void glMemoryBarrierEXT(@NativeType("GLbitfield") int barriers); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSharedTexturePalette.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSharedTexturePalette.java new file mode 100644 index 00000000..b0263737 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTSharedTexturePalette.java @@ -0,0 +1,28 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_shared_texture_palette extension. + * + *

EXT_shared_texture_palette defines a shared texture palette which may be used in place of the texture object palettes provided by + * EXT_paletted_texture. This is useful for rapidly changing a palette common to many textures, rather than having to reload the + * new palette for each texture. The extension acts as a switch, causing all lookups that would normally be done on the texture's palette to instead use + * the shared palette.

+ * + *

Requires EXT_paletted_texture.

+ */ +public final class EXTSharedTexturePalette { + + /** + * Accepted by the {@code pname} parameters of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev, IsEnabled, Enable, Disable, ColorTableEXT, + * ColorSubTableEXT, GetColorTableEXT, GetColorTableParameterivEXT, and GetColorTableParameterfd EXT. + */ + public static final int GL_SHARED_TEXTURE_PALETTE_EXT = 0x81FB; + + private EXTSharedTexturePalette() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTStencilClearTag.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTStencilClearTag.java new file mode 100644 index 00000000..7e2d37ca --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTStencilClearTag.java @@ -0,0 +1,71 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_stencil_clear_tag extension. + * + *

Stencil-only framebuffer clears are increasingly common as 3D applications are now using rendering algorithms such as stenciled shadow volume rendering + * for multiple light sources in a single frame, recent "soft" stenciled shadow volume techniques, and stencil-based constructive solid geometry + * techniques. In such algorithms there are multiple stencil buffer clears for each depth buffer clear. Additionally in most cases, these algorithms do + * not require all of the 8 typical stencil bitplanes for their stencil requirements. In such cases, there is the potential for unused stencil bitplanes + * to encode a "stencil clear tag" in such a way to reduce the number of actual stencil clears. The idea is that switching to an unused stencil clear tag + * logically corresponds to when an application would otherwise perform a framebuffer-wide stencil clear.

+ * + *

This extension exposes an inexpensive hardware mechanism for amortizing the cost of multiple stencil-only clears by using a client-specified number of + * upper bits of the stencil buffer to maintain a per-pixel stencil tag.

+ * + *

The upper bits of each stencil value is treated as a tag that indicates the state of the upper bits of the "stencil clear tag" state when the stencil + * value was last written. If a stencil value is read and its upper bits containing its tag do NOT match the current upper bits of the stencil clear tag + * state, the stencil value is substituted with the lower bits of the stencil clear tag (the reset value). Either way, the upper tag bits of the stencil + * value are ignored by subsequent stencil function and operation processing of the stencil value.

+ * + *

When a stencil value is written to the stencil buffer, its upper bits are overridden with the upper bits of the current stencil clear tag state so + * subsequent reads, prior to any subsequent stencil clear tag state change, properly return the updated lower bits.

+ * + *

In this way, the stencil clear tag functionality provides a way to replace multiple bandwidth-intensive stencil clears with very inexpensive update of + * the stencil clear tag state.

+ * + *

If used as expected with the client specifying 3 bits for the stencil tag, every 7 of 8 stencil-only clears of the entire stencil buffer can be + * substituted for an update of the current stencil clear tag rather than an actual update of all the framebuffer's stencil values. Still, every 8th clear + * must be an actual stencil clear. The net effect is that the aggregate cost of stencil clears is reduced by a factor of 1/(2^n) where n is the number of + * bits devoted to the stencil tag.

+ * + *

The application specifies two new pieces of state: 1) the number of upper stencil bits, n, assigned to maintain the tag bits for each stencil value + * within the stencil buffer, and 2) a stencil clear tag value that packs the current tag and a reset value into a single integer values. The upper n bits + * of the stencil clear tag value specify the current tag while the lower s-min(n,s) bits specify the current reset value, where s is the number of + * bitplanes in the stencil buffer and n is the current number of stencil tag bits.

+ * + *

If zero stencil clear tag bits are assigned to the stencil tag encoding, then the stencil buffer operates in the conventional manner.

+ */ +public class EXTStencilClearTag { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_STENCIL_TAG_BITS_EXT = 0x88F2, + GL_STENCIL_CLEAR_TAG_VALUE_EXT = 0x88F3; + + static { GL.initialize(); } + + protected EXTStencilClearTag() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glStencilClearTagEXT + ); + } + + // --- [ glStencilClearTagEXT ] --- + + public static native void glStencilClearTagEXT(@NativeType("GLsizei") int stencilTagBits, @NativeType("GLuint") int stencilClearTag); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTStencilTwoSide.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTStencilTwoSide.java new file mode 100644 index 00000000..6aabe388 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTStencilTwoSide.java @@ -0,0 +1,46 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_stencil_two_side extension. + * + *

This extension provides two-sided stencil testing where the stencil-related state (stencil operations, reference value, compare mask, and write mask) + * may be different for front- and back-facing polygons. Two-sided stencil testing may improve the performance of stenciled shadow volume and Constructive + * Solid Geometry (CSG) rendering algorithms.

+ */ +public class EXTStencilTwoSide { + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_STENCIL_TEST_TWO_SIDE_EXT = 0x8910; + + /** Accepted by the {@code pname} parameters of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_ACTIVE_STENCIL_FACE_EXT = 0x8911; + + static { GL.initialize(); } + + protected EXTStencilTwoSide() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glActiveStencilFaceEXT + ); + } + + // --- [ glActiveStencilFaceEXT ] --- + + public static native void glActiveStencilFaceEXT(@NativeType("GLenum") int face); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTStencilWrap.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTStencilWrap.java new file mode 100644 index 00000000..37f79079 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTStencilWrap.java @@ -0,0 +1,33 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_stencil_wrap extension. + * + *

Various algorithms use the stencil buffer to "count" the number of surfaces that a ray passes through. As the ray passes into an object, the stencil + * buffer is incremented. As the ray passes out of an object, the stencil buffer is decremented.

+ * + *

GL requires that the stencil increment operation clamps to its maximum value. For algorithms that depend on the difference between the sum of the + * increments and the sum of the decrements, clamping causes an erroneous result.

+ * + *

This extension provides an enable for both maximum and minimum wrapping of stencil values. Instead, the stencil value wraps in both directions.

+ * + *

Two additional stencil operations are specified. These new operations are similiar to the existing INCR and DECR operations, but they wrap their result + * instead of saturating it. This functionality matches the new stencil operations introduced by DirectX 6.

+ * + *

Promoted to core in {@link GL14 OpenGL 1.4}.

+ */ +public final class EXTStencilWrap { + + /** Accepted by the {@code sfail}, {@code dpfail}, and {@code dppass} parameter of StencilOp. */ + public static final int + GL_INCR_WRAP_EXT = 0x8507, + GL_DECR_WRAP_EXT = 0x8508; + + private EXTStencilWrap() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureArray.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureArray.java new file mode 100644 index 00000000..88ac0a0e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureArray.java @@ -0,0 +1,96 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_texture_array extension. + * + *

This extension introduces the notion of one- and two-dimensional array textures. An array texture is a collection of one- and two-dimensional images of + * identical size and format, arranged in layers. A one-dimensional array texture is specified using TexImage2D; a two-dimensional array texture is + * specified using TexImage3D. The height (1D array) or depth (2D array) specify the number of layers in the image.

+ * + *

An array texture is accessed as a single unit in a programmable shader, using a single coordinate vector. A single layer is selected, and that layer is + * then accessed as though it were a one- or two-dimensional texture. The layer used is specified using the "t" or "r" texture coordinate for 1D and 2D + * array textures, respectively. The layer coordinate is provided as an unnormalized floating-point value in the range {@code [0,-1]}, where + * {@code } is the number of layers in the array texture. Texture lookups do not filter between layers, though such filtering can be achieved using + * programmable shaders. When mipmapping is used, each level of an array texture has the same number of layers as the base level; the number of layers is + * not reduced as the image size decreases.

+ * + *

Array textures can be rendered to by binding them to a framebuffer object (EXT_framebuffer_object). A single layer of an array texture can be bound + * using normal framebuffer object mechanisms, or an entire array texture can be bound and rendered to using the layered rendering mechanisms provided by + * NV_geometry_program4.

+ * + *

This extension does not provide for the use of array textures with fixed-function fragment processing. Such support could be added by providing an + * additional extension allowing applications to pass the new target enumerants (TEXTURE_1D_ARRAY_EXT and TEXTURE_2D_ARRAY_EXT) to Enable and Disable.

+ * + *

Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ +public class EXTTextureArray { + + /** Accepted by the {@code target} parameter of TexParameteri, TexParameteriv, TexParameterf, TexParameterfv, GenerateMipmapEXT, and BindTexture. */ + public static final int + GL_TEXTURE_1D_ARRAY_EXT = 0x8C18, + GL_TEXTURE_2D_ARRAY_EXT = 0x8C1A; + + /** Accepted by the {@code target} parameter of TexImage3D, TexSubImage3D, CopyTexSubImage3D, CompressedTexImage3D, and CompressedTexSubImage3D. */ + public static final int GL_PROXY_TEXTURE_2D_ARRAY_EXT = 0x8C1B; + + /** + * Accepted by the {@code target} parameter of TexImage2D, TexSubImage2D, CopyTexImage2D, CopyTexSubImage2D, CompressedTexImage2D, and + * CompressedTexSubImage2D. + */ + public static final int GL_PROXY_TEXTURE_1D_ARRAY_EXT = 0x8C19; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv and GetFloatv. */ + public static final int + GL_TEXTURE_BINDING_1D_ARRAY_EXT = 0x8C1C, + GL_TEXTURE_BINDING_2D_ARRAY_EXT = 0x8C1D, + GL_MAX_ARRAY_TEXTURE_LAYERS_EXT = 0x88FF; + + /** + * Accepted by the {@code param} parameter of TexParameterf, TexParameteri, TexParameterfv, and TexParameteriv when the {@code pname} parameter is + * TEXTURE_COMPARE_MODE_ARB. + */ + public static final int GL_COMPARE_REF_DEPTH_TO_TEXTURE_EXT = 0x884E; + + /** + * COMPARE_REF_DEPTH_TO_TEXTURE_EXT is simply an alias for the existing COMPARE_R_TO_TEXTURE token in OpenGL 2.0; the alternate name reflects the fact that + * the R coordinate is not always used.) Accepted by the {@code pname} parameter of GetFramebufferAttachmentParameterivEXT. + */ + public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER_EXT = 0x8CD4; + + /** + * FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER is simply an alias for the FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT token provided in EXT_framebuffer_object. + * This extension generalizes the notion of "{@code zoffset}" to include layers of an array texture.) Returned by the {@code type} parameter of + * GetActiveUniform. + */ + public static final int + GL_SAMPLER_1D_ARRAY_EXT = 0x8DC0, + GL_SAMPLER_2D_ARRAY_EXT = 0x8DC1, + GL_SAMPLER_1D_ARRAY_SHADOW_EXT = 0x8DC3, + GL_SAMPLER_2D_ARRAY_SHADOW_EXT = 0x8DC4; + + static { GL.initialize(); } + + protected EXTTextureArray() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glFramebufferTextureLayerEXT + ); + } + + // --- [ glFramebufferTextureLayerEXT ] --- + + public static native void glFramebufferTextureLayerEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int layer); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureBufferObject.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureBufferObject.java new file mode 100644 index 00000000..cac6c724 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureBufferObject.java @@ -0,0 +1,67 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_texture_buffer_object extension. + * + *

This extension provides a new texture type, called a buffer texture. Buffer textures are one-dimensional arrays of texels whose storage comes from an + * attached buffer object. When a buffer object is bound to a buffer texture, a format is specified, and the data in the buffer object is treated as an + * array of texels of the specified format.

+ * + *

The use of a buffer object to provide storage allows the texture data to be specified in a number of different ways: via buffer object loads + * (BufferData), direct CPU writes (MapBuffer), framebuffer readbacks (EXT_pixel_buffer_object extension). A buffer object can also be loaded by transform + * feedback (NV_transform_feedback extension), which captures selected transformed attributes of vertices processed by the GL. Several of these mechanisms + * do not require an extra data copy, which would be required when using conventional TexImage-like entry points.

+ * + *

Buffer textures do not support mipmapping, texture lookups with normalized floating-point texture coordinates, and texture filtering of any sort, and + * may not be used in fixed-function fragment processing. They can be accessed via single texel fetch operations in programmable shaders. For assembly + * shaders (NV_gpu_program4), the TXF instruction is used. For GLSL (EXT_gpu_shader4), a new sampler type and texel fetch function are used.

+ * + *

Buffer textures can be substantially larger than equivalent one-dimensional textures; the maximum texture size supported for buffer textures in the + * initial implementation of this extension is 2^27 texels, versus 2^13 (8192) texels for otherwise equivalent one-dimensional textures. (Note that this + * extension only guarantees support for buffer textures with 2^16 texels, but we expect most implementations to exceed that substantially.) When a buffer + * object is attached to a buffer texture, a size is not specified; rather, the number of texels in the texture is taken by dividing the size of the + * buffer object by the size of each texel.

+ * + *

Requires {@link GL20 OpenGL 2.0} and {@link EXTGPUShader4 EXT_gpu_shader4} or NV_gpu_program4.

+ */ +public class EXTTextureBufferObject { + + /** + * Accepted by the {@code target} parameter of BindBuffer, BufferData, BufferSubData, MapBuffer, BindTexture, UnmapBuffer, GetBufferSubData, + * GetBufferParameteriv, GetBufferPointerv, and TexBufferEXT, and the {@code pname} parameter of GetBooleanv, GetDoublev, GetFloatv, and GetIntegerv. + */ + public static final int GL_TEXTURE_BUFFER_EXT = 0x8C2A; + + /** Accepted by the {@code pname} parameters of GetBooleanv, GetDoublev, GetFloatv, and GetIntegerv. */ + public static final int + GL_MAX_TEXTURE_BUFFER_SIZE_EXT = 0x8C2B, + GL_TEXTURE_BINDING_BUFFER_EXT = 0x8C2C, + GL_TEXTURE_BUFFER_DATA_STORE_BINDING_EXT = 0x8C2D, + GL_TEXTURE_BUFFER_FORMAT_EXT = 0x8C2E; + + static { GL.initialize(); } + + protected EXTTextureBufferObject() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glTexBufferEXT + ); + } + + // --- [ glTexBufferEXT ] --- + + public static native void glTexBufferEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLuint") int buffer); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureCompressionLATC.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureCompressionLATC.java new file mode 100644 index 00000000..ec113f53 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureCompressionLATC.java @@ -0,0 +1,35 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_texture_compression_latc extension. + * + *

This extension introduces four new block-based texture compression formats suited for unsigned and signed luminance and luminance-alpha textures (hence + * the name "latc" for Luminance-Alpha Texture Compression).

+ * + *

These formats are designed to reduce the storage requirements and memory bandwidth required for luminance and luminance-alpha textures by a factor of + * 2-to-1 over conventional uncompressed luminance and luminance-alpha textures with 8-bit components ({@link GL11#GL_LUMINANCE8 LUMINANCE8} and {@link GL11#GL_LUMINANCE8_ALPHA8 LUMINANCE8_ALPHA8}).

+ * + *

The compressed signed luminance-alpha format is reasonably suited for storing compressed normal maps.

+ * + *

Requires {@link GL13 OpenGL 1.3} or {@link ARBTextureCompression ARB_texture_compression}.

+ */ +public final class EXTTextureCompressionLATC { + + /** + * Accepted by the {@code internalformat} parameter of TexImage2D, CopyTexImage2D, and CompressedTexImage2D and the {@code format} parameter of + * CompressedTexSubImage2D. + */ + public static final int + GL_COMPRESSED_LUMINANCE_LATC1_EXT = 0x8C70, + GL_COMPRESSED_SIGNED_LUMINANCE_LATC1_EXT = 0x8C71, + GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT = 0x8C72, + GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT = 0x8C73; + + private EXTTextureCompressionLATC() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureCompressionRGTC.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureCompressionRGTC.java new file mode 100644 index 00000000..a1c0725c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureCompressionRGTC.java @@ -0,0 +1,39 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_texture_compression_rgtc extension. + * + *

This extension introduces four new block-based texture compression formats suited for unsigned and signed red and red-green textures (hence the name + * "rgtc" for Red-Green Texture Compression).

+ * + *

These formats are designed to reduce the storage requirements and memory bandwidth required for red and red-green textures by a factor of 2-to-1 over + * conventional uncompressed luminance and luminance-alpha textures with 8-bit components ({@link GL11#GL_LUMINANCE8 LUMINANCE8} and {@link GL11#GL_LUMINANCE8_ALPHA8 LUMINANCE8_ALPHA8}).

+ * + *

The compressed signed red-green format is reasonably suited for storing compressed normal maps.

+ * + *

This extension uses the same compression format as the EXT_texture_compression_latc extension except the color data is stored in the red and green + * components rather than luminance and alpha. Representing compressed red and green components is consistent with the BC4 and BC5 compressed formats + * supported by DirectX 10.

+ * + *

Requires {@link GL13 OpenGL 1.3} or {@link ARBTextureCompression ARB_texture_compression}.

+ */ +public final class EXTTextureCompressionRGTC { + + /** + * Accepted by the {@code internalformat} parameter of TexImage2D, CopyTexImage2D, and CompressedTexImage2D and the {@code format} parameter of + * CompressedTexSubImage2D. + */ + public static final int + GL_COMPRESSED_RED_RGTC1_EXT = 0x8DBB, + GL_COMPRESSED_SIGNED_RED_RGTC1_EXT = 0x8DBC, + GL_COMPRESSED_RED_GREEN_RGTC2_EXT = 0x8DBD, + GL_COMPRESSED_SIGNED_RED_GREEN_RGTC2_EXT = 0x8DBE; + + private EXTTextureCompressionRGTC() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureCompressionS3TC.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureCompressionS3TC.java new file mode 100644 index 00000000..90d71af3 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureCompressionS3TC.java @@ -0,0 +1,33 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_texture_compression_s3tc extension. + * + *

This extension provides additional texture compression functionality specific to S3's S3TC format (called DXTC in Microsoft's DirectX API), subject to + * all the requirements and limitations described by the extension {@link ARBTextureCompression ARB_texture_compression}.

+ * + *

This extension supports DXT1, DXT3, and DXT5 texture compression formats. For the DXT1 image format, this specification supports an RGB-only mode and a + * special RGBA mode with single-bit "transparent" alpha.

+ * + *

Requires {@link ARBTextureCompression ARB_texture_compression}.

+ */ +public final class EXTTextureCompressionS3TC { + + /** + * Accepted by the {@code internalformat} parameter of TexImage2D, CopyTexImage2D, and CompressedTexImage2D and the {@code format} parameter of + * CompressedTexSubImage2D. + */ + public static final int + GL_COMPRESSED_RGB_S3TC_DXT1_EXT = 0x83F0, + GL_COMPRESSED_RGBA_S3TC_DXT1_EXT = 0x83F1, + GL_COMPRESSED_RGBA_S3TC_DXT3_EXT = 0x83F2, + GL_COMPRESSED_RGBA_S3TC_DXT5_EXT = 0x83F3; + + private EXTTextureCompressionS3TC() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureFilterAnisotropic.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureFilterAnisotropic.java new file mode 100644 index 00000000..2c347b55 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureFilterAnisotropic.java @@ -0,0 +1,44 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_texture_filter_anisotropic extension. + * + *

Texture mapping using OpenGL's existing mipmap texture filtering modes assumes that the projection of the pixel filter footprint into texture space is a + * square (ie, isotropic). In practice however, the footprint may be long and narrow (ie, anisotropic). Consequently, mipmap filtering severely blurs + * images on surfaces angled obliquely away from the viewer.

+ * + *

Several approaches exist for improving texture sampling by accounting for the anisotropic nature of the pixel filter footprint into texture space. This + * extension provides a general mechanism for supporting anisotropic texturing filtering schemes without specifying a particular formulation of anisotropic + * filtering.

+ * + *

The extension permits the OpenGL application to specify on a per-texture object basis the maximum degree of anisotropy to account for in texture + * filtering.

+ * + *

Increasing a texture object's maximum degree of anisotropy may improve texture filtering but may also significantly reduce the implementation's texture + * filtering rate. Implementations are free to clamp the specified degree of anisotropy to the implementation's maximum supported degree of anisotropy.

+ * + *

A texture's maximum degree of anisotropy is specified independent from the texture's minification and magnification filter (as opposed to being + * supported as an entirely new filtering mode). Implementations are free to use the specified minification and magnification filter to select a particular + * anisotropic texture filtering scheme. For example, a NEAREST filter with a maximum degree of anisotropy of two could be treated as a 2-tap filter that + * accounts for the direction of anisotropy. Implementations are also permitted to ignore the minification or magnification filter and implement the + * highest quality of anisotropic filtering possible.

+ * + *

Applications seeking the highest quality anisotropic filtering available are advised to request a {@link GL11#GL_LINEAR_MIPMAP_LINEAR LINEAR_MIPMAP_LINEAR} minification filter, a + * {@link GL11#GL_LINEAR LINEAR} magnification filter, and a large maximum degree of anisotropy.

+ */ +public final class EXTTextureFilterAnisotropic { + + /** Accepted by the {@code pname} parameters of GetTexParameterfv, GetTexParameteriv, TexParameterf, TexParameterfv, TexParameteri, and TexParameteriv. */ + public static final int GL_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FE; + + /** Accepted by the {@code pname} parameters of GetBooleanv, GetDoublev, GetFloatv, and GetIntegerv. */ + public static final int GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT = 0x84FF; + + private EXTTextureFilterAnisotropic() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureFilterMinmax.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureFilterMinmax.java new file mode 100644 index 00000000..adb84443 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureFilterMinmax.java @@ -0,0 +1,38 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_texture_filter_minmax extension. + * + *

In unextended OpenGL 4.3, minification and magnification filters such as {@link GL11#GL_LINEAR LINEAR} allow texture lookups to returned a filtered texel value produced + * by computing an weighted average of a collection of texels in the neighborhood of the texture coordinate provided.

+ * + *

This extension provides a new texture and sampler parameter ({@link #GL_TEXTURE_REDUCTION_MODE_EXT TEXTURE_REDUCTION_MODE_EXT}) which allows applications to produce a filtered texel value + * by computing a component-wise minimum ({@link GL14#GL_MIN MIN}) or maximum ({@link GL14#GL_MAX MAX}) of the texels that would normally be averaged. The reduction mode is orthogonal + * to the minification and magnification filter parameters. The filter parameters are used to identify the set of texels used to produce a final filtered + * value; the reduction mode identifies how these texels are combined.

+ */ +public final class EXTTextureFilterMinmax { + + /** + * Accepted by the {@code pname} parameter to SamplerParameter{i f}{v}, SamplerParameterI{u}iv, GetSamplerParameter{i f}v, GetSamplerParameterI{u}iv, + * TexParameter{i f}{v}, TexParameterI{u}iv, GetTexParameter{i f}v, GetTexParameterI{u}iv, TextureParameter{i f}{v}EXT, TextureParameterI{u}ivEXT, + * GetTextureParameter{i f}vEXT, GetTextureParameterI{u}ivEXT, MultiTexParameter{i f}{v}EXT, MultiTexParameterI{u}ivEXT, GetMultiTexParameter{i f}vEXT, and + * GetMultiTexParameterI{u}ivEXT. + */ + public static final int GL_TEXTURE_REDUCTION_MODE_EXT = 0x9366; + + /** + * Accepted by the {@code param} or {@code params} parameter to SamplerParameter{i f}{v}, SamplerParameterI{u}iv, TexParameter{i f}{v}, TexParameterI{u}iv, + * TextureParameter{i f}{v}EXT, TextureParameterI{u}ivEXT, MultiTexParameter{i f}{v}EXT, or MultiTexParameterI{u}ivEXT when {@code pname} is + * TEXTURE_REDUCTION_MODE_EXT. + */ + public static final int GL_WEIGHTED_AVERAGE_EXT = 0x9367; + + private EXTTextureFilterMinmax() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureInteger.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureInteger.java new file mode 100644 index 00000000..6fe9bceb --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureInteger.java @@ -0,0 +1,260 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the EXT_texture_integer extension. + * + *

Fixed-point textures in unextended OpenGL have integer components, but those values are taken to represent floating-point values in the range [0,1]. + * These integer components are considered "normalized" integers. When such a texture is accessed by a shader or by fixed-function fragment processing, + * floating-point values are returned.

+ * + *

This extension provides a set of new "unnormalized" integer texture formats. Formats with both signed and unsigned integers are provided. In these + * formats, the components are treated as true integers. When such textures are accessed by a shader, actual integer values are returned.

+ * + *

Pixel operations that read from or write to a texture or color buffer with unnormalized integer components follow a path similar to that used for color + * index pixel operations, except that more than one component may be provided at once. Integer values flow through the pixel processing pipe, and no pixel + * transfer operations are performed. Integer format enumerants used for such operations indicate unnormalized integer data.

+ * + *

Textures or render buffers with unnormalized integer formats may also be attached to framebuffer objects to receive fragment color values written by a + * fragment shader. Per-fragment operations that require floating-point color components, including multisample alpha operations, alpha test, blending, and + * dithering, have no effect when the corresponding colors are written to an integer color buffer. The NV_gpu_program4 and + * {@link EXTGPUShader4 EXT_gpu_shader4} extensions add the capability to fragment programs and fragment shaders to write signed and unsigned integer output values.

+ * + *

This extension does not enforce type consistency for texture accesses or between fragment shaders and the corresponding framebuffer attachments. The + * results of a texture lookup from an integer texture are undefined:

+ * + *
    + *
  • for fixed-function fragment processing, or
  • + *
  • for shader texture accesses expecting floating-point return values.
  • + *
+ * + *

The color components used for per-fragment operations and written into a color buffer are undefined:

+ * + *
    + *
  • for fixed-function fragment processing with an integer color buffer,
  • + *
  • for fragment shaders that write floating-point color components to an integer color buffer, or
  • + *
  • for fragment shaders that write integer color components to a color buffer with floating point or normalized integer components.
  • + *
+ * + *

Requires {@link GL20 OpenGL 2.0} and NV_gpu_program4 or {@link EXTGPUShader4 EXT_gpu_shader4}. Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ +public class EXTTextureInteger { + + /** Accepted by the {@code pname} parameters of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_RGBA_INTEGER_MODE_EXT = 0x8D9E; + + /** Accepted by the {@code internalFormat} parameter of TexImage1D, TexImage2D, and TexImage3D. */ + public static final int + GL_RGBA32UI_EXT = 0x8D70, + GL_RGB32UI_EXT = 0x8D71, + GL_ALPHA32UI_EXT = 0x8D72, + GL_INTENSITY32UI_EXT = 0x8D73, + GL_LUMINANCE32UI_EXT = 0x8D74, + GL_LUMINANCE_ALPHA32UI_EXT = 0x8D75, + GL_RGBA16UI_EXT = 0x8D76, + GL_RGB16UI_EXT = 0x8D77, + GL_ALPHA16UI_EXT = 0x8D78, + GL_INTENSITY16UI_EXT = 0x8D79, + GL_LUMINANCE16UI_EXT = 0x8D7A, + GL_LUMINANCE_ALPHA16UI_EXT = 0x8D7B, + GL_RGBA8UI_EXT = 0x8D7C, + GL_RGB8UI_EXT = 0x8D7D, + GL_ALPHA8UI_EXT = 0x8D7E, + GL_INTENSITY8UI_EXT = 0x8D7F, + GL_LUMINANCE8UI_EXT = 0x8D80, + GL_LUMINANCE_ALPHA8UI_EXT = 0x8D81, + GL_RGBA32I_EXT = 0x8D82, + GL_RGB32I_EXT = 0x8D83, + GL_ALPHA32I_EXT = 0x8D84, + GL_INTENSITY32I_EXT = 0x8D85, + GL_LUMINANCE32I_EXT = 0x8D86, + GL_LUMINANCE_ALPHA32I_EXT = 0x8D87, + GL_RGBA16I_EXT = 0x8D88, + GL_RGB16I_EXT = 0x8D89, + GL_ALPHA16I_EXT = 0x8D8A, + GL_INTENSITY16I_EXT = 0x8D8B, + GL_LUMINANCE16I_EXT = 0x8D8C, + GL_LUMINANCE_ALPHA16I_EXT = 0x8D8D, + GL_RGBA8I_EXT = 0x8D8E, + GL_RGB8I_EXT = 0x8D8F, + GL_ALPHA8I_EXT = 0x8D90, + GL_INTENSITY8I_EXT = 0x8D91, + GL_LUMINANCE8I_EXT = 0x8D92, + GL_LUMINANCE_ALPHA8I_EXT = 0x8D93; + + /** Accepted by the {@code format} parameter of TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, DrawPixels and ReadPixels. */ + public static final int + GL_RED_INTEGER_EXT = 0x8D94, + GL_GREEN_INTEGER_EXT = 0x8D95, + GL_BLUE_INTEGER_EXT = 0x8D96, + GL_ALPHA_INTEGER_EXT = 0x8D97, + GL_RGB_INTEGER_EXT = 0x8D98, + GL_RGBA_INTEGER_EXT = 0x8D99, + GL_BGR_INTEGER_EXT = 0x8D9A, + GL_BGRA_INTEGER_EXT = 0x8D9B, + GL_LUMINANCE_INTEGER_EXT = 0x8D9C, + GL_LUMINANCE_ALPHA_INTEGER_EXT = 0x8D9D; + + static { GL.initialize(); } + + protected EXTTextureInteger() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glClearColorIiEXT, caps.glClearColorIuiEXT, caps.glTexParameterIivEXT, caps.glTexParameterIuivEXT, caps.glGetTexParameterIivEXT, + caps.glGetTexParameterIuivEXT + ); + } + + // --- [ glClearColorIiEXT ] --- + + public static native void glClearColorIiEXT(@NativeType("GLint") int r, @NativeType("GLint") int g, @NativeType("GLint") int b, @NativeType("GLint") int a); + + // --- [ glClearColorIuiEXT ] --- + + public static native void glClearColorIuiEXT(@NativeType("GLuint") int r, @NativeType("GLuint") int g, @NativeType("GLuint") int b, @NativeType("GLuint") int a); + + // --- [ glTexParameterIivEXT ] --- + + public static native void nglTexParameterIivEXT(int target, int pname, long params); + + public static void glTexParameterIivEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglTexParameterIivEXT(target, pname, memAddress(params)); + } + + public static void glTexParameterIiEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int param) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.ints(param); + nglTexParameterIivEXT(target, pname, memAddress(params)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glTexParameterIuivEXT ] --- + + public static native void nglTexParameterIuivEXT(int target, int pname, long params); + + public static void glTexParameterIuivEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglTexParameterIuivEXT(target, pname, memAddress(params)); + } + + public static void glTexParameterIuiEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint *") int param) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.ints(param); + nglTexParameterIuivEXT(target, pname, memAddress(params)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTexParameterIivEXT ] --- + + public static native void nglGetTexParameterIivEXT(int target, int pname, long params); + + public static void glGetTexParameterIivEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetTexParameterIivEXT(target, pname, memAddress(params)); + } + + @NativeType("void") + public static int glGetTexParameterIiEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetTexParameterIivEXT(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTexParameterIuivEXT ] --- + + public static native void nglGetTexParameterIuivEXT(int target, int pname, long params); + + public static void glGetTexParameterIuivEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetTexParameterIuivEXT(target, pname, memAddress(params)); + } + + @NativeType("void") + public static int glGetTexParameterIuiEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetTexParameterIuivEXT(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #glTexParameterIivEXT TexParameterIivEXT} */ + public static void glTexParameterIivEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glTexParameterIivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glTexParameterIuivEXT TexParameterIuivEXT} */ + public static void glTexParameterIuivEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint *") int[] params) { + long __functionAddress = GL.getICD().glTexParameterIuivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetTexParameterIivEXT GetTexParameterIivEXT} */ + public static void glGetTexParameterIivEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetTexParameterIivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetTexParameterIuivEXT GetTexParameterIuivEXT} */ + public static void glGetTexParameterIuivEXT(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint *") int[] params) { + long __functionAddress = GL.getICD().glGetTexParameterIuivEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureMirrorClamp.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureMirrorClamp.java new file mode 100644 index 00000000..a27f1b51 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureMirrorClamp.java @@ -0,0 +1,31 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_texture_mirror_clamp extension. + * + *

EXT_texture_mirror_clamp extends the set of texture wrap modes to include three modes ({@link #GL_MIRROR_CLAMP_EXT MIRROR_CLAMP_EXT}, {@link #GL_MIRROR_CLAMP_TO_EDGE_EXT MIRROR_CLAMP_TO_EDGE_EXT}, + * {@link #GL_MIRROR_CLAMP_TO_BORDER_EXT MIRROR_CLAMP_TO_BORDER_EXT}) that effectively use a texture map twice as large as the original image in which the additional half of the new image is + * a mirror image of the original image.

+ * + *

This new mode relaxes the need to generate images whose opposite edges match by using the original image to generate a matching "mirror image". This + * mode allows the texture to be mirrored only once in the negative s, t, and r directions.

+ */ +public final class EXTTextureMirrorClamp { + + /** + * Accepted by the {@code param} parameter of TexParameteri and TexParameterf, and by the {@code params} parameter of TexParameteriv and TexParameterfv, + * when their {@code pname} parameter is TEXTURE_WRAP_S, TEXTURE_WRAP_T, or TEXTURE_WRAP_R. + */ + public static final int + GL_MIRROR_CLAMP_EXT = 0x8742, + GL_MIRROR_CLAMP_TO_EDGE_EXT = 0x8743, + GL_MIRROR_CLAMP_TO_BORDER_EXT = 0x8912; + + private EXTTextureMirrorClamp() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSRGB.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSRGB.java new file mode 100644 index 00000000..a57ec825 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSRGB.java @@ -0,0 +1,50 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_texture_sRGB extension. + * + *

Conventional texture formats assume a linear color space. So for a conventional internal texture format such as GL_RGB8, the 256 discrete values for + * each 8-bit color component map linearly and uniformly to the [0,1] range.

+ * + *

The sRGB color space is based on typical (non-linear) monitor characteristics expected in a dimly lit office. It has been standardized by the + * International Electrotechnical Commission (IEC) as IEC 61966-2-1. The sRGB color space roughly corresponds to 2.2 gamma correction.

+ * + *

This extension adds a few new uncompressed and compressed color texture formats with sRGB color components.

+ * + *

Promoted to core in {@link GL21 OpenGL 2.1}.

+ */ +public final class EXTTextureSRGB { + + /** Accepted by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D. */ + public static final int + GL_SRGB_EXT = 0x8C40, + GL_SRGB8_EXT = 0x8C41, + GL_SRGB_ALPHA_EXT = 0x8C42, + GL_SRGB8_ALPHA8_EXT = 0x8C43, + GL_SLUMINANCE_ALPHA_EXT = 0x8C44, + GL_SLUMINANCE8_ALPHA8_EXT = 0x8C45, + GL_SLUMINANCE_EXT = 0x8C46, + GL_SLUMINANCE8_EXT = 0x8C47, + GL_COMPRESSED_SRGB_EXT = 0x8C48, + GL_COMPRESSED_SRGB_ALPHA_EXT = 0x8C49, + GL_COMPRESSED_SLUMINANCE_EXT = 0x8C4A, + GL_COMPRESSED_SLUMINANCE_ALPHA_EXT = 0x8C4B; + + /** + * Accepted by the {@code internalformat} parameter of TexImage2D, CopyTexImage2D, and CompressedTexImage2DARB and the {@code format} parameter of + * CompressedTexSubImage2DARB. + */ + public static final int + GL_COMPRESSED_SRGB_S3TC_DXT1_EXT = 0x8C4C, + GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT1_EXT = 0x8C4D, + GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT3_EXT = 0x8C4E, + GL_COMPRESSED_SRGB_ALPHA_S3TC_DXT5_EXT = 0x8C4F; + + private EXTTextureSRGB() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSRGBDecode.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSRGBDecode.java new file mode 100644 index 00000000..09c7d9bf --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSRGBDecode.java @@ -0,0 +1,50 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_texture_sRGB_decode extension. + * + *

The EXT_texture_sRGB extension (promoted to core in OpenGL 2.1) provides a texture format stored in the sRGB color space. Sampling one of these + * textures will always return the color value decoded into a linear color space. However, an application may wish to sample and retrieve the undecoded + * sRGB data from the texture and manipulate that directly.

+ * + *

This extension adds a Texture Parameter and Sampler Object parameter to allow sRGB textures to be read directly, without decoding.

+ * + *

The new parameter, {@link #GL_TEXTURE_SRGB_DECODE_EXT TEXTURE_SRGB_DECODE_EXT} controls whether the decoding happens at sample time. It only applies to textures with an internal format + * that is sRGB and is ignored for all other textures. This value defaults to {@link #GL_DECODE_EXT DECODE_EXT}, which indicates the texture should be decoded to linear color + * space.

+ * + *

Requires {@link GL21 OpenGL 2.1} or {@link EXTTextureSRGB EXT_texture_sRGB}.

+ */ +public final class EXTTextureSRGBDecode { + + /** + * Accepted by the {@code pname} parameter of TexParameterf, TexParameteri, TexParameterfv, TexParameteriv, TexParameterIiv, TexParameterIuiv, + * TexParameterIivEXT, TexParameterIuivEXT, TextureParameterfEXT, TextureParameterfvEXT, TextureParameteriEXT, TextureParameterivEXT, + * TextureParameterIivEXT, TextureParameterIuivEXT, MultiTexParameterfEXT, MultiTexParameterfvEXT, MultiTexParameteriEXT, MultiTexParameterivEXT, + * MultiTexParameterIivEXT, MultiTexParameterIuivEXT, GetTexParameterfv, GetTexParameteriv, GetTexParameterIiv, GetTexParameterIuiv, GetTexParameterIivEXT, + * GetTexParameterIuivEXT, GetTextureParameterfEXT, GetTextureParameterfvEXT, GetTextureParameteriEXT, GetTextureParameterivEXT, GetTextureParameterIivEXT, + * GetTextureParameterIuivEXT, GetMultiTexParameterfEXT, GetMultiTexParameterfvEXT, GetMultiTexParameteriEXT, GetMultiTexParameterivEXT, + * GetMultiTexParameterIivEXT, GetMultiTexParameterIuivEXT, SamplerParameteri, SamplerParameterf, SamplerParameteriv, SamplerParameterfv, + * SamplerParameterIiv, SamplerParameterIuiv, GetSamplerParameteriv, GetSamplerParameterfv, GetSamplerParameterIiv, and GetSamplerParameterIuiv. + */ + public static final int GL_TEXTURE_SRGB_DECODE_EXT = 0x8A48; + + /** + * Accepted by the {@code param} parameter of TexParameterf, TexParameteri, TexParameterfv, TexParameteriv, TexParameterIiv, TexParameterIuiv, + * TexParameterIivEXT, TexParameterIuivEXT, TextureParameterfEXT, TextureParameterfvEXT, TextureParameteriEXT, TextureParameterivEXT, + * TextureParameterIivEXT, TextureParameterIuivEXT, MultiTexParameterfEXT, MultiTexParameterfvEXT, MultiTexParameteriEXT, MultiTexParameterivEXT, + * MultiTexParameterIivEXT, MultiTexParameterIuivEXT, SamplerParameteri, SamplerParameterf, SamplerParameteriv, SamplerParameterfv, SamplerParameterIiv, + * and SamplerParameterIuiv. + */ + public static final int + GL_DECODE_EXT = 0x8A49, + GL_SKIP_DECODE_EXT = 0x8A4A; + + private EXTTextureSRGBDecode() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSRGBR8.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSRGBR8.java new file mode 100644 index 00000000..f8390312 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSRGBR8.java @@ -0,0 +1,26 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_texture_sRGB_R8 extension. + * + *

This extension introduces {@link #GL_SR8_EXT SR8_EXT} as an acceptable internal format. This allows efficient sRGB sampling for source images stored as a separate texture + * per channel.

+ * + *

Requires {@link GL12 OpenGL 1.2}.

+ */ +public final class EXTTextureSRGBR8 { + + /** + * Accepted by the {@code internalformat} parameters of {@link GL12C#glTexImage3D TexImage3D}, {@link GL11C#glTexImage2D TexImage2D}, {@link GL11C#glTexImage1D TexImage1D}, {@link GL42C#glTexStorage3D TexStorage3D}, {@link GL42C#glTexStorage2D TexStorage2D}, {@link GL42C#glTexStorage1D TexStorage1D}, + * {@link GL45C#glTextureStorage3D TextureStorage3D}, {@link GL45C#glTextureStorage2D TextureStorage2D}, and {@link GL45C#glTextureStorage1D TextureStorage1D}. + */ + public static final int GL_SR8_EXT = 0x8FBD; + + private EXTTextureSRGBR8() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSharedExponent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSharedExponent.java new file mode 100644 index 00000000..cffb6d74 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSharedExponent.java @@ -0,0 +1,42 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_texture_shared_exponent extension. + * + *

Existing texture formats provide either fixed-point formats with limited range and precision but with compact encodings (allowing 32 or fewer bits per + * multi-component texel), or floating-point formats with tremendous range and precision but without compact encodings (typically 16 or 32 bits per + * component).

+ * + *

This extension adds a new packed format and new internal texture format for encoding 3-component vectors (typically RGB colors) with a single 5-bit + * exponent (biased up by 15) and three 9-bit mantissas for each respective component. There is no sign bit so all three components must be non-negative. + * The fractional mantissas are stored without an implied 1 to the left of the decimal point. Neither infinity nor not-a-number (NaN) are representable in + * this shared exponent format.

+ * + *

This 32 bits/texel shared exponent format is particularly well-suited to high dynamic range (HDR) applications where light intensity is typically stored + * as non-negative red, green, and blue components with considerable range.

+ * + *

Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ +public final class EXTTextureSharedExponent { + + /** Accepted by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and RenderbufferStorageEXT. */ + public static final int GL_RGB9_E5_EXT = 0x8C3D; + + /** + * Accepted by the {@code type} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, GetTexImage, TexImage3D, TexSubImage1D, TexSubImage2D, + * TexSubImage3D, GetHistogram, GetMinmax, ConvolutionFilter1D, ConvolutionFilter2D, ConvolutionFilter3D, GetConvolutionFilter, SeparableFilter2D, + * GetSeparableFilter, ColorTable, ColorSubTable, and GetColorTable. + */ + public static final int GL_UNSIGNED_INT_5_9_9_9_REV_EXT = 0x8C3E; + + /** Accepted by the {@code pname} parameter of GetTexLevelParameterfv and GetTexLevelParameteriv. */ + public static final int GL_TEXTURE_SHARED_SIZE_EXT = 0x8C3F; + + private EXTTextureSharedExponent() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSnorm.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSnorm.java new file mode 100644 index 00000000..184764c5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSnorm.java @@ -0,0 +1,54 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_texture_snorm extension. + * + *

Fixed-point textures in unextended OpenGL have integer components, but those values are taken to represent floating-point values in the range + * [0.0,1.0]. These integer components are considered "unsigned normalized" integers. When such a texture is accessed by a shader or by fixed-function + * fragment processing, floating-point values are returned in the range [0.0,1.0].

+ * + *

This extension provides a set of new "signed normalized" integer texture formats. These are taken to represent a floating-point value in the range + * [-1.0,1.0] with an exact 0.0.

+ * + *

Requires {@link GL30 OpenGL 3.0}.

+ */ +public final class EXTTextureSnorm { + + /** ccepted by the {@code internalFormat} parameter of TexImage1D, TexImage2D, and TexImage3D. */ + public static final int + GL_RED_SNORM = 0x8F90, + GL_RG_SNORM = 0x8F91, + GL_RGB_SNORM = 0x8F92, + GL_RGBA_SNORM = 0x8F93, + GL_ALPHA_SNORM = 0x9010, + GL_LUMINANCE_SNORM = 0x9011, + GL_LUMINANCE_ALPHA_SNORM = 0x9012, + GL_INTENSITY_SNORM = 0x9013, + GL_R8_SNORM = 0x8F94, + GL_RG8_SNORM = 0x8F95, + GL_RGB8_SNORM = 0x8F96, + GL_RGBA8_SNORM = 0x8F97, + GL_ALPHA8_SNORM = 0x9014, + GL_LUMINANCE8_SNORM = 0x9015, + GL_LUMINANCE8_ALPHA8_SNORM = 0x9016, + GL_INTENSITY8_SNORM = 0x9017, + GL_R16_SNORM = 0x8F98, + GL_RG16_SNORM = 0x8F99, + GL_RGB16_SNORM = 0x8F9A, + GL_RGBA16_SNORM = 0x8F9B, + GL_ALPHA16_SNORM = 0x9018, + GL_LUMINANCE16_SNORM = 0x9019, + GL_LUMINANCE16_ALPHA16_SNORM = 0x901A, + GL_INTENSITY16_SNORM = 0x901B; + + /** Returned by GetTexLevelParmeter. */ + public static final int GL_SIGNED_NORMALIZED = 0x8F9C; + + private EXTTextureSnorm() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSwizzle.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSwizzle.java new file mode 100644 index 00000000..fef96270 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTextureSwizzle.java @@ -0,0 +1,37 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the EXT_texture_swizzle extension. + * + *

Classic OpenGL texture formats conflate texture storage and interpretation, and assume that textures represent color. In modern applications, a + * significant quantity of textures don't represent color, but rather data like shadow maps, normal maps, page tables, occlusion data, etc.. For the + * latter class of data, calling the data "RGBA" is just a convenient mapping of what the data is onto the current model, but isn't an accurate reflection + * of the reality of the data.

+ * + *

The existing texture formats provide an almost orthogonal set of data types, sizes, and number of components, but the mappings of this storage into + * what the shader or fixed-function pipeline fetches is very much non-orthogonal. Previous extensions have added some of the most demanded missing + * formats, but the problem has not been solved once and for all.

+ * + *

This extension provides a mechanism to swizzle the components of a texture before they are applied according to the texture environment in + * fixed-function or as they are returned to the shader.

+ */ +public final class EXTTextureSwizzle { + + /** Accepted by the {@code pname} parameters of TexParameteri, TexParameterf, TexParameteriv, TexParameterfv, GetTexParameterfv, and GetTexParameteriv. */ + public static final int + GL_TEXTURE_SWIZZLE_R_EXT = 0x8E42, + GL_TEXTURE_SWIZZLE_G_EXT = 0x8E43, + GL_TEXTURE_SWIZZLE_B_EXT = 0x8E44, + GL_TEXTURE_SWIZZLE_A_EXT = 0x8E45; + + /** Accepted by the {@code pname} parameters of TexParameteriv, TexParameterfv, GetTexParameterfv, and GetTexParameteriv. */ + public static final int GL_TEXTURE_SWIZZLE_RGBA_EXT = 0x8E46; + + private EXTTextureSwizzle() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTimerQuery.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTimerQuery.java new file mode 100644 index 00000000..f208e759 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTimerQuery.java @@ -0,0 +1,117 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the EXT_timer_query extension. + * + *

Applications can benefit from accurate timing information in a number of different ways. During application development, timing information can help + * identify application or driver bottlenecks. At run time, applications can use timing information to dynamically adjust the amount of detail in a scene + * to achieve constant frame rates. OpenGL implementations have historically provided little to no useful timing information. Applications can get some + * idea of timing by reading timers on the CPU, but these timers are not synchronized with the graphics rendering pipeline. Reading a CPU timer does not + * guarantee the completion of a potentially large amount of graphics work accumulated before the timer is read, and will thus produce wildly inaccurate + * results. glFinish() can be used to determine when previous rendering commands have been completed, but will idle the graphics pipeline and adversely + * affect application performance.

+ * + *

This extension provides a query mechanism that can be used to determine the amount of time it takes to fully complete a set of GL commands, and without + * stalling the rendering pipeline. It uses the query object mechanisms first introduced in the occlusion query extension, which allow time intervals to + * be polled asynchronously by the application.

+ * + *

Requires {@link GL15 OpenGL 1.5}.

+ */ +public class EXTTimerQuery { + + /** Accepted by the {@code target} parameter of BeginQuery, EndQuery, and GetQueryiv. */ + public static final int GL_TIME_ELAPSED_EXT = 0x88BF; + + static { GL.initialize(); } + + protected EXTTimerQuery() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glGetQueryObjecti64vEXT, caps.glGetQueryObjectui64vEXT + ); + } + + // --- [ glGetQueryObjecti64vEXT ] --- + + public static native void nglGetQueryObjecti64vEXT(int id, int pname, long params); + + public static void glGetQueryObjecti64vEXT(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLint64 *") LongBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetQueryObjecti64vEXT(id, pname, memAddress(params)); + } + + @NativeType("void") + public static long glGetQueryObjecti64EXT(@NativeType("GLuint") int id, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglGetQueryObjecti64vEXT(id, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetQueryObjectui64vEXT ] --- + + public static native void nglGetQueryObjectui64vEXT(int id, int pname, long params); + + public static void glGetQueryObjectui64vEXT(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLuint64 *") LongBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetQueryObjectui64vEXT(id, pname, memAddress(params)); + } + + @NativeType("void") + public static long glGetQueryObjectui64EXT(@NativeType("GLuint") int id, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglGetQueryObjectui64vEXT(id, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #glGetQueryObjecti64vEXT GetQueryObjecti64vEXT} */ + public static void glGetQueryObjecti64vEXT(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLint64 *") long[] params) { + long __functionAddress = GL.getICD().glGetQueryObjecti64vEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(id, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetQueryObjectui64vEXT GetQueryObjectui64vEXT} */ + public static void glGetQueryObjectui64vEXT(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLuint64 *") long[] params) { + long __functionAddress = GL.getICD().glGetQueryObjectui64vEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(id, pname, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTransformFeedback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTransformFeedback.java new file mode 100644 index 00000000..b596b921 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTTransformFeedback.java @@ -0,0 +1,237 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the EXT_transform_feedback extension. + * + *

This extension provides a new mode to the GL, called transform feedback, which records selected vertex attributes for each primitive processed by the + * GL. The selected attributes are written into buffer objects, and can be written with each attribute in a separate buffer object or with all attributes + * interleaved into a single buffer object. If a geometry shader is active, the primitives recorded are those emitted by the geometry shader. Otherwise, + * transform feedback captures primitives whose vertices are transformed by a vertex shader. In either case, the primitives captured are those generated + * prior to clipping. Transform feedback mode captures the values of specified varying variables emitted from GLSL vertex or geometry shaders.

+ * + *

The vertex data recorded in transform feedback mode is stored into buffer objects as an array of vertex attributes. The regular representation and the + * use of buffer objects allows the recorded data to be processed directly by the GL without requiring CPU intervention to copy data. In particular, + * transform feedback data can be used for vertex arrays (via vertex buffer objects), as the source for pixel data (via pixel buffer objects), as shader + * constant data (via the NV_parameter_buffer_object or {@link EXTBindableUniform EXT_bindable_uniform} extensions), or via any other extension that + * makes use of buffer objects.

+ * + *

This extension introduces new query object support to allow transform feedback mode to operate asynchronously. Query objects allow applications to + * determine when transform feedback results are complete, as well as the number of primitives processed and written back to buffer objects while in + * transform feedback mode. This extension also provides a new rasterizer discard enable, which allows applications to use transform feedback to capture + * vertex attributes without rendering anything.

+ * + *

Requires {@link GL20 OpenGL 2.0} or {@link ARBShaderObjects ARB_shader_objects}. Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ +public class EXTTransformFeedback { + + /** + * Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferPointerv, + * BindBufferRangeEXT, BindBufferOffsetEXT and BindBufferBaseEXT. + */ + public static final int GL_TRANSFORM_FEEDBACK_BUFFER_EXT = 0x8C8E; + + /** Accepted by the {@code param} parameter of GetIntegerIndexedvEXT and GetBooleanIndexedvEXT. */ + public static final int + GL_TRANSFORM_FEEDBACK_BUFFER_START_EXT = 0x8C84, + GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_EXT = 0x8C85; + + /** + * Accepted by the {@code param} parameter of GetIntegerIndexedvEXT and GetBooleanIndexedvEXT, and by the {@code pname} parameter of GetBooleanv, + * GetDoublev, GetIntegerv, and GetFloatv. + */ + public static final int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_EXT = 0x8C8F; + + /** Accepted by the {@code bufferMode} parameter of TransformFeedbackVaryingsEXT. */ + public static final int + GL_INTERLEAVED_ATTRIBS_EXT = 0x8C8C, + GL_SEPARATE_ATTRIBS_EXT = 0x8C8D; + + /** Accepted by the {@code target} parameter of BeginQuery, EndQuery, and GetQueryiv. */ + public static final int + GL_PRIMITIVES_GENERATED_EXT = 0x8C87, + GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_EXT = 0x8C88; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_RASTERIZER_DISCARD_EXT = 0x8C89; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_EXT = 0x8C8A, + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_EXT = 0x8C8B, + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_EXT = 0x8C80; + + /** Accepted by the {@code pname} parameter of GetProgramiv. */ + public static final int + GL_TRANSFORM_FEEDBACK_VARYINGS_EXT = 0x8C83, + GL_TRANSFORM_FEEDBACK_BUFFER_MODE_EXT = 0x8C7F, + GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT = 0x8C76; + + static { GL.initialize(); } + + protected EXTTransformFeedback() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBindBufferRangeEXT, caps.glBindBufferOffsetEXT, caps.glBindBufferBaseEXT, caps.glBeginTransformFeedbackEXT, caps.glEndTransformFeedbackEXT, + caps.glTransformFeedbackVaryingsEXT, caps.glGetTransformFeedbackVaryingEXT, caps.glGetIntegerIndexedvEXT, caps.glGetBooleanIndexedvEXT + ); + } + + // --- [ glBindBufferRangeEXT ] --- + + public static native void glBindBufferRangeEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size); + + // --- [ glBindBufferOffsetEXT ] --- + + public static native void glBindBufferOffsetEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset); + + // --- [ glBindBufferBaseEXT ] --- + + public static native void glBindBufferBaseEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLuint") int buffer); + + // --- [ glBeginTransformFeedbackEXT ] --- + + public static native void glBeginTransformFeedbackEXT(@NativeType("GLenum") int primitiveMode); + + // --- [ glEndTransformFeedbackEXT ] --- + + public static native void glEndTransformFeedbackEXT(); + + // --- [ glTransformFeedbackVaryingsEXT ] --- + + public static native void nglTransformFeedbackVaryingsEXT(int program, int count, long varyings, int bufferMode); + + public static void glTransformFeedbackVaryingsEXT(@NativeType("GLuint") int program, @NativeType("GLchar const * const *") PointerBuffer varyings, @NativeType("GLenum") int bufferMode) { + nglTransformFeedbackVaryingsEXT(program, varyings.remaining(), memAddress(varyings), bufferMode); + } + + public static void glTransformFeedbackVaryingsEXT(@NativeType("GLuint") int program, @NativeType("GLchar const * const *") CharSequence[] varyings, @NativeType("GLenum") int bufferMode) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + long varyingsAddress = org.lwjgl.system.APIUtil.apiArray(stack, MemoryUtil::memASCII, varyings); + nglTransformFeedbackVaryingsEXT(program, varyings.length, varyingsAddress, bufferMode); + org.lwjgl.system.APIUtil.apiArrayFree(varyingsAddress, varyings.length); + } finally { + stack.setPointer(stackPointer); + } + } + + public static void glTransformFeedbackVaryingsEXT(@NativeType("GLuint") int program, @NativeType("GLchar const * const *") CharSequence varying, @NativeType("GLenum") int bufferMode) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + long varyingsAddress = org.lwjgl.system.APIUtil.apiArray(stack, MemoryUtil::memASCII, varying); + nglTransformFeedbackVaryingsEXT(program, 1, varyingsAddress, bufferMode); + org.lwjgl.system.APIUtil.apiArrayFree(varyingsAddress, 1); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTransformFeedbackVaryingEXT ] --- + + public static native void nglGetTransformFeedbackVaryingEXT(int program, int index, int bufSize, long length, long size, long type, long name); + + public static void glGetTransformFeedbackVaryingEXT(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLsizei *") IntBuffer size, @NativeType("GLenum *") IntBuffer type, @NativeType("GLchar *") ByteBuffer name) { + if (CHECKS) { + checkSafe(length, 1); + check(size, 1); + check(type, 1); + } + nglGetTransformFeedbackVaryingEXT(program, index, name.remaining(), memAddressSafe(length), memAddress(size), memAddress(type), memAddress(name)); + } + + @NativeType("void") + public static String glGetTransformFeedbackVaryingEXT(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @NativeType("GLsizei") int bufSize, @NativeType("GLsizei *") IntBuffer size, @NativeType("GLenum *") IntBuffer type) { + if (CHECKS) { + check(size, 1); + check(type, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer length = stack.ints(0); + ByteBuffer name = stack.malloc(bufSize); + nglGetTransformFeedbackVaryingEXT(program, index, bufSize, memAddress(length), memAddress(size), memAddress(type), memAddress(name)); + return memASCII(name, length.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + @NativeType("void") + public static String glGetTransformFeedbackVaryingEXT(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @NativeType("GLsizei *") IntBuffer size, @NativeType("GLenum *") IntBuffer type) { + return glGetTransformFeedbackVaryingEXT(program, index, GL.getCapabilities().OpenGL20 + ? GL20.glGetProgrami(program, GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT) + : ARBShaderObjects.glGetObjectParameteriARB(program, GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH_EXT), size, type); + } + + // --- [ glGetIntegerIndexedvEXT ] --- + + public static void nglGetIntegerIndexedvEXT(int target, int index, long data) { + EXTDrawBuffers2.nglGetIntegerIndexedvEXT(target, index, data); + } + + public static void glGetIntegerIndexedvEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLint *") IntBuffer data) { + EXTDrawBuffers2.glGetIntegerIndexedvEXT(target, index, data); + } + + @NativeType("void") + public static int glGetIntegerIndexedEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + return EXTDrawBuffers2.glGetIntegerIndexedEXT(target, index); + } + + // --- [ glGetBooleanIndexedvEXT ] --- + + public static void nglGetBooleanIndexedvEXT(int target, int index, long data) { + EXTDrawBuffers2.nglGetBooleanIndexedvEXT(target, index, data); + } + + public static void glGetBooleanIndexedvEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLboolean *") ByteBuffer data) { + EXTDrawBuffers2.glGetBooleanIndexedvEXT(target, index, data); + } + + @NativeType("void") + public static boolean glGetBooleanIndexedEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + return EXTDrawBuffers2.glGetBooleanIndexedEXT(target, index); + } + + /** Array version of: {@link #glGetTransformFeedbackVaryingEXT GetTransformFeedbackVaryingEXT} */ + public static void glGetTransformFeedbackVaryingEXT(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLsizei *") int[] size, @NativeType("GLenum *") int[] type, @NativeType("GLchar *") ByteBuffer name) { + long __functionAddress = GL.getICD().glGetTransformFeedbackVaryingEXT; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + check(size, 1); + check(type, 1); + } + callPPPPV(program, index, name.remaining(), length, size, type, memAddress(name), __functionAddress); + } + + /** Array version of: {@link #glGetIntegerIndexedvEXT GetIntegerIndexedvEXT} */ + public static void glGetIntegerIndexedvEXT(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLint *") int[] data) { + EXTDrawBuffers2.glGetIntegerIndexedvEXT(target, index, data); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTVertexAttrib64bit.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTVertexAttrib64bit.java new file mode 100644 index 00000000..e5bd1011 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTVertexAttrib64bit.java @@ -0,0 +1,230 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the EXT_vertex_attrib_64bit extension. + * + *

This extension provides OpenGL shading language support for vertex shader inputs with 64-bit floating-point components and OpenGL API support for + * specifying the value of those inputs using vertex array or immediate mode entry points. This builds on the support for general-purpose support for + * 64-bit floating-point values in the ARB_gpu_shader_fp64 extension.

+ * + *

This extension provides a new class of vertex attribute functions, beginning with "VertexAttribL" ("L" for "long"), that can be used to specify + * attributes with 64-bit floating-point components. This extension provides no automatic type conversion between attribute and shader variables; + * single-precision attributes are not automatically converted to double-precision or vice versa. For shader variables with 64-bit component types, the + * "VertexAttribL" functions must be used to specify attribute values. For other shader variables, the "VertexAttribL" functions must not be used. If a + * vertex attribute is specified using the wrong attribute function, the values of the corresponding shader input are undefined. This approach requiring + * matching types is identical to that used for the "VertexAttribI" functions provided by OpenGL 3.0 and the EXT_gpu_shader4 extension.

+ * + *

Additionally, some vertex shader inputs using the wider 64-bit components may count double against the implementation-dependent limit on the number of + * vertex shader attribute vectors. A 64-bit scalar or a two-component vector consumes only a single generic vertex attribute; three- and four-component + * "long" may count as two. This approach is similar to the one used in the current GL where matrix attributes consume multiple attributes.

+ * + *

Note that 64-bit generic vertex attributes were nominally supported beginning with the introduction of vertex shaders in OpenGL 2.0. However, the + * OpenGL Shading Language at the time had no support for 64-bit data types, so any such values were automatically converted to 32-bit.

+ * + *

Support for 64-bit floating-point vertex attributes in this extension can be combined with other extensions. In particular, this extension provides an + * entry point that can be used with EXT_direct_state_access to directly set state for any vertex array object. Also, the related + * NV_vertex_attrib_integer_64bit extension provides an entry point to specify bindless vertex attribute arrays with 64-bit components, integer or + * floating-point.

+ * + *

Requires {@link GL30 OpenGL 3.0} and {@link ARBGPUShaderFP64 ARB_gpu_shader_fp64} (or equivalent functionality).

+ */ +public class EXTVertexAttrib64bit { + + /** Returned in the {@code type} parameter of GetActiveAttrib. */ + public static final int + GL_DOUBLE_VEC2_EXT = 0x8FFC, + GL_DOUBLE_VEC3_EXT = 0x8FFD, + GL_DOUBLE_VEC4_EXT = 0x8FFE, + GL_DOUBLE_MAT2_EXT = 0x8F46, + GL_DOUBLE_MAT3_EXT = 0x8F47, + GL_DOUBLE_MAT4_EXT = 0x8F48, + GL_DOUBLE_MAT2x3_EXT = 0x8F49, + GL_DOUBLE_MAT2x4_EXT = 0x8F4A, + GL_DOUBLE_MAT3x2_EXT = 0x8F4B, + GL_DOUBLE_MAT3x4_EXT = 0x8F4C, + GL_DOUBLE_MAT4x2_EXT = 0x8F4D, + GL_DOUBLE_MAT4x3_EXT = 0x8F4E; + + static { GL.initialize(); } + + protected EXTVertexAttrib64bit() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glVertexAttribL1dEXT, caps.glVertexAttribL2dEXT, caps.glVertexAttribL3dEXT, caps.glVertexAttribL4dEXT, caps.glVertexAttribL1dvEXT, + caps.glVertexAttribL2dvEXT, caps.glVertexAttribL3dvEXT, caps.glVertexAttribL4dvEXT, caps.glVertexAttribLPointerEXT, caps.glGetVertexAttribLdvEXT, + ext.contains("GL_EXT_direct_state_access") ? caps.glVertexArrayVertexAttribLOffsetEXT : -1L + ); + } + + // --- [ glVertexAttribL1dEXT ] --- + + public static native void glVertexAttribL1dEXT(@NativeType("GLuint") int index, @NativeType("GLdouble") double x); + + // --- [ glVertexAttribL2dEXT ] --- + + public static native void glVertexAttribL2dEXT(@NativeType("GLuint") int index, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y); + + // --- [ glVertexAttribL3dEXT ] --- + + public static native void glVertexAttribL3dEXT(@NativeType("GLuint") int index, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z); + + // --- [ glVertexAttribL4dEXT ] --- + + public static native void glVertexAttribL4dEXT(@NativeType("GLuint") int index, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z, @NativeType("GLdouble") double w); + + // --- [ glVertexAttribL1dvEXT ] --- + + public static native void nglVertexAttribL1dvEXT(int index, long v); + + public static void glVertexAttribL1dvEXT(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglVertexAttribL1dvEXT(index, memAddress(v)); + } + + // --- [ glVertexAttribL2dvEXT ] --- + + public static native void nglVertexAttribL2dvEXT(int index, long v); + + public static void glVertexAttribL2dvEXT(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglVertexAttribL2dvEXT(index, memAddress(v)); + } + + // --- [ glVertexAttribL3dvEXT ] --- + + public static native void nglVertexAttribL3dvEXT(int index, long v); + + public static void glVertexAttribL3dvEXT(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglVertexAttribL3dvEXT(index, memAddress(v)); + } + + // --- [ glVertexAttribL4dvEXT ] --- + + public static native void nglVertexAttribL4dvEXT(int index, long v); + + public static void glVertexAttribL4dvEXT(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttribL4dvEXT(index, memAddress(v)); + } + + // --- [ glVertexAttribLPointerEXT ] --- + + public static native void nglVertexAttribLPointerEXT(int index, int size, int type, int stride, long pointer); + + public static void glVertexAttribLPointerEXT(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + nglVertexAttribLPointerEXT(index, size, type, stride, memAddress(pointer)); + } + + public static void glVertexAttribLPointerEXT(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + nglVertexAttribLPointerEXT(index, size, type, stride, pointer); + } + + public static void glVertexAttribLPointerEXT(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLsizei") int stride, @NativeType("void const *") DoubleBuffer pointer) { + nglVertexAttribLPointerEXT(index, size, GL11.GL_DOUBLE, stride, memAddress(pointer)); + } + + // --- [ glGetVertexAttribLdvEXT ] --- + + public static native void nglGetVertexAttribLdvEXT(int index, int pname, long params); + + public static void glGetVertexAttribLdvEXT(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLdouble *") DoubleBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglGetVertexAttribLdvEXT(index, pname, memAddress(params)); + } + + // --- [ glVertexArrayVertexAttribLOffsetEXT ] --- + + /** + * DSA version of {@link ARBVertexAttrib64Bit#glVertexAttribLPointer VertexAttribLPointer}. + * + * @param vaobj the vertex array object + * @param buffer the buffer object + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. Must be:
{@link GL11#GL_DOUBLE DOUBLE}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param offset the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer. The initial value is 0. + */ + public static void glVertexArrayVertexAttribLOffsetEXT(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int buffer, @NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("GLintptr") long offset) { + ARBVertexAttrib64Bit.glVertexArrayVertexAttribLOffsetEXT(vaobj, buffer, index, size, type, stride, offset); + } + + /** Array version of: {@link #glVertexAttribL1dvEXT VertexAttribL1dvEXT} */ + public static void glVertexAttribL1dvEXT(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glVertexAttribL1dvEXT; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribL2dvEXT VertexAttribL2dvEXT} */ + public static void glVertexAttribL2dvEXT(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glVertexAttribL2dvEXT; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribL3dvEXT VertexAttribL3dvEXT} */ + public static void glVertexAttribL3dvEXT(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glVertexAttribL3dvEXT; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribL4dvEXT VertexAttribL4dvEXT} */ + public static void glVertexAttribL4dvEXT(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glVertexAttribL4dvEXT; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glGetVertexAttribLdvEXT GetVertexAttribLdvEXT} */ + public static void glGetVertexAttribLdvEXT(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLdouble *") double[] params) { + long __functionAddress = GL.getICD().glGetVertexAttribLdvEXT; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(index, pname, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTWin32KeyedMutex.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTWin32KeyedMutex.java new file mode 100644 index 00000000..980817b1 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTWin32KeyedMutex.java @@ -0,0 +1,58 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_win32_keyed_mutex extension. + * + *

Direct3D image objects may have a built-in synchronization primitive associated with them that can be used to synchronize access to their contents + * across process and API boundaries. This extension provides access to that synchronization primitive via two new commands that operate on GL memory + * objects.

+ * + *

Requires {@link EXTMemoryObject EXT_memory_object}.

+ */ +public class EXTWin32KeyedMutex { + + static { GL.initialize(); } + + protected EXTWin32KeyedMutex() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glAcquireKeyedMutexWin32EXT, caps.glReleaseKeyedMutexWin32EXT + ); + } + + // --- [ glAcquireKeyedMutexWin32EXT ] --- + + /** + * Blocks GL command processing until a keyed mutex is acquired. + * + * @param memory identifies which keyed mutex to acquire + * @param key is the mutex value to wait for + * @param timeout the time, in milliseconds, to wait before failing the acquire operation + */ + @NativeType("GLboolean") + public static native boolean glAcquireKeyedMutexWin32EXT(@NativeType("GLuint") int memory, @NativeType("GLuint64") long key, @NativeType("GLuint") int timeout); + + // --- [ glReleaseKeyedMutexWin32EXT ] --- + + /** + * Releases a keyed mutex after all prior GL command processing has completed. + * + * @param memory identifies the keyed mutex to release + * @param key the mutex value set by the release operation + */ + @NativeType("GLboolean") + public static native boolean glReleaseKeyedMutexWin32EXT(@NativeType("GLuint") int memory, @NativeType("GLuint64") long key); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTWindowRectangles.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTWindowRectangles.java new file mode 100644 index 00000000..29f052e9 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTWindowRectangles.java @@ -0,0 +1,122 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the EXT_window_rectangles extension. + * + *

This extension provides additional orthogonally aligned "window rectangles" specified in window-space coordinates that restrict rasterization of all + * primitive types (geometry, images, paths) and framebuffer clears.

+ * + *

When rendering to the framebuffer of an on-screen window, these window rectangles are ignored so these window rectangles apply to rendering to non-zero + * framebuffer objects only.

+ * + *

From zero to an implementation-dependent limit (specified by {@link #GL_MAX_WINDOW_RECTANGLES_EXT MAX_WINDOW_RECTANGLES_EXT}) number of window rectangles can be operational at once. When + * one or more window rectangles are active, rasterized fragments can either survive if the fragment is within any of the operational window rectangles + * ({@link #GL_INCLUSIVE_EXT INCLUSIVE_EXT} mode) or be rejected if the fragment is within any of the operational window rectangles ({@link #GL_EXCLUSIVE_EXT EXCLUSIVE_EXT} mode).

+ * + *

These window rectangles operate orthogonally to the existing scissor test functionality.

+ * + *

This extension has specification language for both OpenGL and ES so {@code EXT_window_rectangles} can be implemented and advertised for either or both + * API contexts.

+ * + *

Requires {@link GL30 GL30} or {@link EXTDrawBuffers2 EXT_draw_buffers2}.

+ */ +public class EXTWindowRectangles { + + /** Accepted by the {@code mode} parameter of {@link #glWindowRectanglesEXT WindowRectanglesEXT}. */ + public static final int + GL_INCLUSIVE_EXT = 0x8F10, + GL_EXCLUSIVE_EXT = 0x8F11; + + /** + * Accepted by the {@code pname} parameter of GetIntegeri_v, GetInteger64i_v, GetBooleani_v, GetFloati_v, GetDoublei_v, GetIntegerIndexedvEXT, + * GetFloatIndexedvEXT, GetDoubleIndexedvEXT, GetBooleanIndexedvEXT, and GetIntegeri_vEXT. + */ + public static final int GL_WINDOW_RECTANGLE_EXT = 0x8F12; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int + GL_WINDOW_RECTANGLE_MODE_EXT = 0x8F13, + GL_MAX_WINDOW_RECTANGLES_EXT = 0x8F14, + GL_NUM_WINDOW_RECTANGLES_EXT = 0x8F15; + + static { GL.initialize(); } + + protected EXTWindowRectangles() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glWindowRectanglesEXT + ); + } + + // --- [ glWindowRectanglesEXT ] --- + + /** + * Unsafe version of: {@link #glWindowRectanglesEXT WindowRectanglesEXT} + * + * @param count the number of active window rectangles. Must be between zero and the value of {@link #GL_MAX_WINDOW_RECTANGLES_EXT MAX_WINDOW_RECTANGLES_EXT}. + */ + public static native void nglWindowRectanglesEXT(int mode, int count, long box); + + /** + * Sets the active window rectangles. + * + *

When the {@code WindowRectanglesEXT} command is processed without error, the ith window rectangle box is set to the corresponding four + * parameters for values of {@code i} less then {@code n}. For values of {@code i} greater than {@code n}, each window rectangle box is set to (0,0,0,0).

+ * + *

Each four elements corresponds to the ith window rectangle indicating a box of pixels specified with window-space coordinates. Each window + * rectangle box {@code i} has a lower-left origin at {@code (x_i,y_i)} and upper-right corner at {@code (x_i+w_i,y_i+h_i)}.

+ * + *

The {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error is generated if any element {@code w_i} or {@code h_i}, corresponding to each box's respective width and height, is negative.

+ * + *

Each rasterized or cleared fragment with a window-space position {@code (xw,yw)} is within the ith window rectangle box when both of these + * equations are satisfied for all {@code i} less than {@code n}:

+ * + *

+     * x_i <= xw < x_i+w_i
+     * y_i <= yw < y_i+h_i
+ * + *

When the window rectangles mode is {@link #GL_INCLUSIVE_EXT INCLUSIVE_EXT} mode and the bound framebuffer object is non-zero, a fragment passes the window rectangles test if + * the fragment's window-space position is within at least one of the current {@code n} active window rectangles; otherwise the window rectangles test + * fails and the fragment is discarded.

+ * + *

When the window rectangles mode is {@link #GL_EXCLUSIVE_EXT EXCLUSIVE_EXT} mode and the bound framebuffer object is non-zero, a fragment fails the window rectangles test and is + * discarded if the fragment's window-space position is within at least one of the current {@code n} active window rectangles; otherwise the window + * rectangles test passes and the fragment passes the window rectangles test.

+ * + *

When the bound framebuffer object is zero, the window rectangles test always passes.

+ * + * @param mode the rectangle mode. One of:
{@link #GL_INCLUSIVE_EXT INCLUSIVE_EXT}{@link #GL_EXCLUSIVE_EXT EXCLUSIVE_EXT}
+ * @param box an array of {@code 4*count} window rectangle coordinates + */ + public static void glWindowRectanglesEXT(@NativeType("GLenum") int mode, @Nullable @NativeType("GLint const *") IntBuffer box) { + nglWindowRectanglesEXT(mode, remainingSafe(box) >> 2, memAddressSafe(box)); + } + + /** Array version of: {@link #glWindowRectanglesEXT WindowRectanglesEXT} */ + public static void glWindowRectanglesEXT(@NativeType("GLenum") int mode, @Nullable @NativeType("GLint const *") int[] box) { + long __functionAddress = GL.getICD().glWindowRectanglesEXT; + if (CHECKS) { + check(__functionAddress); + } + callPV(mode, lengthSafe(box) >> 2, box, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTX11SyncObject.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTX11SyncObject.java new file mode 100644 index 00000000..17e38a39 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/EXTX11SyncObject.java @@ -0,0 +1,61 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the EXT_x11_sync_object extension. + * + *

Synchronization objects added the ability to better coordinate operations between multiple GL command streams. However, it is desirable to have the + * same level of coordination between GL command streams and external rendering APIs. This extension introduces two new concepts to build upon the + * synchronization infrastructure provided by {@link ARBSync ARB_sync}:

+ * + *
    + *
  1. A means to import an X Synchronization Fence object into the GL and use it as a sync object.
  2. + *
  3. The concept of a reusable sync object.
  4. + *
+ * + *

The latter is necessary because the import operation is expensive and performing it every time a synchronization point was reached would make the + * synchronization prohibitively slow.

+ * + *

This extension stops short of allowing the GL to change the state of imported/reusable sync objects, but does not add any language that would prohibit + * such functionality from being added in a subsequent extension.

+ * + *

Requires {@link GL32 OpenGL 3.2} or {@link ARBSync ARB_sync}.

+ */ +public class EXTX11SyncObject { + + /** Accepted by the {@code external_sync_type} parameter of ImportSyncEXT. */ + public static final int GL_SYNC_X11_FENCE_EXT = 0x90E1; + + static { GL.initialize(); } + + protected EXTX11SyncObject() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glImportSyncEXT + ); + } + + // --- [ glImportSyncEXT ] --- + + /** + * Creates a GL sync object of the type {@code external_sync_type} based on the object referred to by {@code external_sync}. + * + * @param external_sync_type the external sync object type. Must be:
{@link #GL_SYNC_X11_FENCE_EXT SYNC_X11_FENCE_EXT}
+ * @param external_sync the external sync object. Must be the XID of a valid X11 Synchronization Fence object + * @param flags Must be 0. + */ + @NativeType("GLsync") + public static native long glImportSyncEXT(@NativeType("GLenum") int external_sync_type, @NativeType("GLintptr") long external_sync, @NativeType("GLbitfield") int flags); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL.java new file mode 100644 index 00000000..440ee770 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL.java @@ -0,0 +1,728 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; +import org.lwjgl.system.macosx.*; +import org.lwjgl.system.windows.*; + +import javax.annotation.*; +import java.nio.*; +import java.util.*; + +import static java.lang.Math.*; +import static org.lwjgl.opengl.GL32C.*; +import static org.lwjgl.opengl.GLX.*; +import static org.lwjgl.opengl.GLX11.*; +import static org.lwjgl.opengl.WGL.*; +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.linux.X11.*; +import static org.lwjgl.system.windows.GDI32.*; +import static org.lwjgl.system.windows.User32.*; +import static org.lwjgl.system.windows.WindowsUtil.*; + +/** + * This class must be used before any OpenGL function is called. It has the following responsibilities: + *
    + *
  • Loads the OpenGL native library into the JVM process.
  • + *
  • Creates instances of {@link GLCapabilities} classes. A {@code GLCapabilities} instance contains flags for functionality that is available in an OpenGL + * context. Internally, it also contains function pointers that are only valid in that specific OpenGL context.
  • + *
  • Maintains thread-local state for {@code GLCapabilities} instances, corresponding to OpenGL contexts that are current in those threads.
  • + *
+ * + *

Library lifecycle

+ *

The OpenGL library is loaded automatically when this class is initialized. Set the {@link Configuration#OPENGL_EXPLICIT_INIT} option to override this + * behavior. Manual loading/unloading can be achieved with the {@link #create} and {@link #destroy} functions. The name of the library loaded can be overridden + * with the {@link Configuration#OPENGL_LIBRARY_NAME} option. The maximum OpenGL version loaded can be set with the {@link Configuration#OPENGL_MAXVERSION} + * option. This can be useful to ensure that no functionality above a specific version is used during development.

+ * + *

GLCapabilities creation

+ *

Instances of {@code GLCapabilities} can be created with the {@link #createCapabilities} method. An OpenGL context must be current in the current thread + * before it is called. Calling this method is expensive, so the {@code GLCapabilities} instance should be associated with the OpenGL context and reused as + * necessary.

+ * + *

Thread-local state

+ *

Before a function for a given OpenGL context can be called, the corresponding {@code GLCapabilities} instance must be passed to the + * {@link #setCapabilities} method. The user is also responsible for clearing the current {@code GLCapabilities} instance when the context is destroyed or made + * current in another thread.

+ * + *

Note that the {@link #createCapabilities} method implicitly calls {@link #setCapabilities} with the newly created instance.

+ */ +public final class GL { + + @Nullable + private static final APIVersion MAX_VERSION; + + @Nullable + private static FunctionProvider functionProvider; + + private static final ThreadLocal capabilitiesTLS = new ThreadLocal<>(); + + private static ICD icd = new ICDStatic(); + + @Nullable + private static WGLCapabilities capabilitiesWGL; + + @Nullable + private static GLXCapabilities capabilitiesGLXClient; + @Nullable + private static GLXCapabilities capabilitiesGLX; + + static { + Library.loadSystem(System::load, System::loadLibrary, GL.class, "org.lwjgl.opengl", Platform.mapLibraryNameBundled("lwjgl")); + + MAX_VERSION = apiParseVersion(Configuration.OPENGL_MAXVERSION); + + if (!Configuration.OPENGL_EXPLICIT_INIT.get(false)) { + create(); + } + } + + private GL() {} + + /** Ensures that the lwjgl_opengl shared library has been loaded. */ + static void initialize() { + // intentionally empty to trigger static initializer + } + + /** Loads the OpenGL native library, using the default library name. */ + public static void create() { + SharedLibrary GL; + switch (Platform.get()) { + case FCL: + case LINUX: + GL = Library.loadNative(GL.class, "org.lwjgl.opengl", Configuration.OPENGL_LIBRARY_NAME, "libGL.so.1", "libGL.so"); + break; + case MACOSX: + String override = Configuration.OPENGL_LIBRARY_NAME.get(); + GL = override != null + ? Library.loadNative(GL.class, "org.lwjgl.opengl", override) + : MacOSXLibrary.getWithIdentifier("com.apple.opengl"); + break; + case WINDOWS: + GL = Library.loadNative(GL.class, "org.lwjgl.opengl", Configuration.OPENGL_LIBRARY_NAME, "opengl32"); + break; + default: + throw new IllegalStateException(); + } + create(GL); + } + + /** + * Loads the OpenGL native library, using the specified library name. + * + * @param libName the native library name + */ + public static void create(String libName) { + create(Library.loadNative(GL.class, "org.lwjgl.opengl", libName)); + } + + private abstract static class SharedLibraryGL extends SharedLibrary.Delegate { + + SharedLibraryGL(SharedLibrary library) { + super(library); + } + abstract long getExtensionAddress(long name); + + @Override + public long getFunctionAddress(ByteBuffer functionName) { + long address = getExtensionAddress(memAddress(functionName)); + if (address == NULL) { + address = library.getFunctionAddress(functionName); + if (address == NULL && DEBUG_FUNCTIONS) { + apiLog("Failed to locate address for GL function " + memASCII(functionName)); + } + } + + return address; + } + + } + + private static void create(SharedLibrary OPENGL) { + FunctionProvider functionProvider; + try { + switch (Platform.get()) { + case WINDOWS: + functionProvider = new SharedLibraryGL(OPENGL) { + private final long wglGetProcAddress = library.getFunctionAddress("wglGetProcAddress"); + + @Override + long getExtensionAddress(long name) { + return callPP(name, wglGetProcAddress); + } + }; + break; + case FCL: + case LINUX: + functionProvider = new SharedLibraryGL(OPENGL) { + private final long glXGetProcAddress; + + { + long GetProcAddress = library.getFunctionAddress("glXGetProcAddress"); + if (GetProcAddress == NULL) { + GetProcAddress = library.getFunctionAddress("glXGetProcAddressARB"); + } + + glXGetProcAddress = GetProcAddress; + } + + @Override + long getExtensionAddress(long name) { + return glXGetProcAddress == NULL ? NULL : callPP(name, glXGetProcAddress); + } + }; + break; + case MACOSX: + functionProvider = new SharedLibraryGL(OPENGL) { + @Override + long getExtensionAddress(long name) { + return NULL; + } + }; + break; + default: + throw new IllegalStateException(); + } + create(functionProvider); + } catch (RuntimeException e) { + OPENGL.free(); + throw e; + } + } + + /** + * Initializes OpenGL with the specified {@link FunctionProvider}. This method can be used to implement custom OpenGL library loading. + * + * @param functionProvider the provider of OpenGL function addresses + */ + public static void create(FunctionProvider functionProvider) { + if (GL.functionProvider != null) { + throw new IllegalStateException("OpenGL library has already been loaded."); + } + + GL.functionProvider = functionProvider; + ThreadLocalUtil.setFunctionMissingAddresses(GLCapabilities.class, 3); + } + + /** Unloads the OpenGL native library. */ + public static void destroy() { + if (functionProvider == null) { + return; + } + + ThreadLocalUtil.setFunctionMissingAddresses(null, 3); + + capabilitiesWGL = null; + capabilitiesGLX = null; + + if (functionProvider instanceof NativeResource) { + ((NativeResource)functionProvider).free(); + } + functionProvider = null; + } + + /** Returns the {@link FunctionProvider} for the OpenGL native library. */ + @Nullable + public static FunctionProvider getFunctionProvider() { + return functionProvider; + } + + /** + * Sets the {@link GLCapabilities} of the OpenGL context that is current in the current thread. + * + *

This {@code GLCapabilities} instance will be used by any OpenGL call in the current thread, until {@code setCapabilities} is called again with a + * different value.

+ */ + public static void setCapabilities(@Nullable GLCapabilities caps) { + capabilitiesTLS.set(caps); + ThreadLocalUtil.setEnv(caps == null ? NULL : memAddress(caps.addresses), 3); + icd.set(caps); + } + + /** + * Returns the {@link GLCapabilities} of the OpenGL context that is current in the current thread. + * + * @throws IllegalStateException if {@link #setCapabilities} has never been called in the current thread or was last called with a {@code null} value + */ + public static GLCapabilities getCapabilities() { + return checkCapabilities(capabilitiesTLS.get()); + } + + private static GLCapabilities checkCapabilities(@Nullable GLCapabilities caps) { + if (CHECKS && caps == null) { + throw new IllegalStateException( + "No GLCapabilities instance set for the current thread. Possible solutions:\n" + + "\ta) Call GL.createCapabilities() after making a context current in the current thread.\n" + + "\tb) Call GL.setCapabilities() if a GLCapabilities instance already exists for the current context." + ); + } + //noinspection ConstantConditions + return caps; + } + + /** + * Returns the WGL capabilities. + * + *

This method may only be used on Windows.

+ */ + public static WGLCapabilities getCapabilitiesWGL() { + if (capabilitiesWGL == null) { + capabilitiesWGL = createCapabilitiesWGLDummy(); + } + + return capabilitiesWGL; + } + + /** Returns the GLX client capabilities. */ + static GLXCapabilities getCapabilitiesGLXClient() { + if (capabilitiesGLXClient == null) { + capabilitiesGLXClient = initCapabilitiesGLX(true); + } + + return capabilitiesGLXClient; + } + + /** + * Returns the GLX capabilities. + * + *

This method may only be used on Linux.

+ */ + public static GLXCapabilities getCapabilitiesGLX() { + if (capabilitiesGLX == null) { + capabilitiesGLX = initCapabilitiesGLX(false); + } + + return capabilitiesGLX; + } + + private static GLXCapabilities initCapabilitiesGLX(boolean client) { + long display = nXOpenDisplay(NULL); + try { + return createCapabilitiesGLX(display, client ? -1 : XDefaultScreen(display)); + } finally { + XCloseDisplay(display); + } + } + + /** + * Creates a new {@link GLCapabilities} instance for the OpenGL context that is current in the current thread. + * + *

Depending on the current context, the instance returned may or may not contain the deprecated functionality removed since OpenGL version 3.1.

+ * + *

This method calls {@link #setCapabilities(GLCapabilities)} with the new instance before returning.

+ * + * @return the GLCapabilities instance + */ + public static GLCapabilities createCapabilities() { + return createCapabilities(false); + } + + /** + * Creates a new {@link GLCapabilities} instance for the OpenGL context that is current in the current thread. + * + *

Depending on the current context, the instance returned may or may not contain the deprecated functionality removed since OpenGL version 3.1. The + * {@code forwardCompatible} flag will force LWJGL to not load the deprecated functions, even if the current context exposes them.

+ * + *

This method calls {@link #setCapabilities(GLCapabilities)} with the new instance before returning.

+ * + * @param forwardCompatible if true, LWJGL will create forward compatible capabilities + * + * @return the GLCapabilities instance + */ + @SuppressWarnings("AssignmentToMethodParameter") + public static GLCapabilities createCapabilities(boolean forwardCompatible) { + FunctionProvider functionProvider = GL.functionProvider; + if (functionProvider == null) { + throw new IllegalStateException("OpenGL library has not been loaded."); + } + + GLCapabilities caps = null; + + try { + // We don't have a current ContextCapabilities when this method is called + // so we have to use the native bindings directly. + long GetError = functionProvider.getFunctionAddress("glGetError"); + long GetString = functionProvider.getFunctionAddress("glGetString"); + long GetIntegerv = functionProvider.getFunctionAddress("glGetIntegerv"); + + if (GetError == NULL || GetString == NULL || GetIntegerv == NULL) { + throw new IllegalStateException("Core OpenGL functions could not be found. Make sure that the OpenGL library has been loaded correctly."); + } + + int errorCode = callI(GetError); + if (errorCode != GL_NO_ERROR) { + apiLog(String.format("An OpenGL context was in an error state before the creation of its capabilities instance. Error: 0x%X", errorCode)); + } + + int majorVersion; + int minorVersion; + + try (MemoryStack stack = stackPush()) { + IntBuffer version = stack.ints(0); + + // Try the 3.0+ version query first + callPV(GL_MAJOR_VERSION, memAddress(version), GetIntegerv); + if (callI(GetError) == GL_NO_ERROR && 3 <= (majorVersion = version.get(0))) { + // We're on an 3.0+ context. + callPV(GL_MINOR_VERSION, memAddress(version), GetIntegerv); + minorVersion = version.get(0); + } else { + // Fallback to the string query. + String versionString = memUTF8Safe(callP(GL_VERSION, GetString)); + if (versionString == null || callI(GetError) != GL_NO_ERROR) { + throw new IllegalStateException("There is no OpenGL context current in the current thread."); + } + + APIVersion apiVersion = apiParseVersion(versionString); + + majorVersion = apiVersion.major; + minorVersion = apiVersion.minor; + } + } + + if (majorVersion < 1 || (majorVersion == 1 && minorVersion < 1)) { + throw new IllegalStateException("OpenGL 1.1 is required."); + } + + int[] GL_VERSIONS = { + 5, // OpenGL 1.1 to 1.5 + 1, // OpenGL 2.0 to 2.1 + 3, // OpenGL 3.0 to 3.3 + 6, // OpenGL 4.0 to 4.6 + }; + + Set supportedExtensions = new HashSet<>(512); + + int maxMajor = min(majorVersion, GL_VERSIONS.length); + if (MAX_VERSION != null) { + maxMajor = min(MAX_VERSION.major, maxMajor); + } + for (int M = 1; M <= maxMajor; M++) { + int maxMinor = GL_VERSIONS[M - 1]; + if (M == majorVersion) { + maxMinor = min(minorVersion, maxMinor); + } + if (MAX_VERSION != null && M == MAX_VERSION.major) { + maxMinor = min(MAX_VERSION.minor, maxMinor); + } + + for (int m = M == 1 ? 1 : 0; m <= maxMinor; m++) { + supportedExtensions.add(String.format("OpenGL%d%d", M, m)); + } + } + + if (majorVersion < 3) { + // Parse EXTENSIONS string + String extensionsString = memASCIISafe(callP(GL_EXTENSIONS, GetString)); + if (extensionsString != null) { + StringTokenizer tokenizer = new StringTokenizer(extensionsString); + while (tokenizer.hasMoreTokens()) { + supportedExtensions.add(tokenizer.nextToken()); + } + } + } else { + // Use indexed EXTENSIONS + try (MemoryStack stack = stackPush()) { + IntBuffer pi = stack.ints(0); + + callPV(GL_NUM_EXTENSIONS, memAddress(pi), GetIntegerv); + int extensionCount = pi.get(0); + + long GetStringi = apiGetFunctionAddress(functionProvider, "glGetStringi"); + for (int i = 0; i < extensionCount; i++) { + supportedExtensions.add(memASCII(callP(GL_EXTENSIONS, i, GetStringi))); + } + + // In real drivers, we may encounter the following weird scenarios: + // - 3.1 context without GL_ARB_compatibility but with deprecated functionality exposed and working. + // - Core or forward-compatible context with GL_ARB_compatibility exposed, but not working when used. + // We ignore these and go by the spec. + + // Force forwardCompatible to true if the context is a forward-compatible context. + callPV(GL_CONTEXT_FLAGS, memAddress(pi), GetIntegerv); + if ((pi.get(0) & GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT) != 0) { + forwardCompatible = true; + } else { + // Force forwardCompatible to true if the context is a core profile context. + if ((3 < majorVersion || 1 <= minorVersion)) { // OpenGL 3.1+ + if (3 < majorVersion || 2 <= minorVersion) { // OpenGL 3.2+ + callPV(GL_CONTEXT_PROFILE_MASK, memAddress(pi), GetIntegerv); + if ((pi.get(0) & GL_CONTEXT_CORE_PROFILE_BIT) != 0) { + forwardCompatible = true; + } + } else { + forwardCompatible = !supportedExtensions.contains("GL_ARB_compatibility"); + } + } + } + } + } + + return caps = new GLCapabilities(functionProvider, supportedExtensions, forwardCompatible); + } finally { + setCapabilities(caps); + } + } + + /** Creates a dummy context and retrieves the WGL capabilities. */ + private static WGLCapabilities createCapabilitiesWGLDummy() { + long hdc = wglGetCurrentDC(); // just use the current context if one exists + if (hdc != NULL) { + return createCapabilitiesWGL(hdc); + } + + short classAtom = 0; + long hwnd = NULL; + long hglrc = NULL; + try (MemoryStack stack = stackPush()) { + WNDCLASSEX wc = WNDCLASSEX.callocStack(stack) + .cbSize(WNDCLASSEX.SIZEOF) + .style(CS_HREDRAW | CS_VREDRAW) + .hInstance(WindowsLibrary.HINSTANCE) + .lpszClassName(stack.UTF16("WGL")); + + memPutAddress( + wc.address() + WNDCLASSEX.LPFNWNDPROC, + User32.Functions.DefWindowProc + ); + + classAtom = RegisterClassEx(wc); + if (classAtom == 0) { + throw new IllegalStateException("Failed to register WGL window class"); + } + + hwnd = check(nCreateWindowEx( + 0, classAtom & 0xFFFF, NULL, + WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN | WS_CLIPSIBLINGS, + 0, 0, 1, 1, + NULL, NULL, NULL, NULL + )); + + hdc = check(GetDC(hwnd)); + + PIXELFORMATDESCRIPTOR pfd = PIXELFORMATDESCRIPTOR.callocStack(stack) + .nSize((short)PIXELFORMATDESCRIPTOR.SIZEOF) + .nVersion((short)1) + .dwFlags(PFD_SUPPORT_OPENGL); // we don't care about anything else + + int pixelFormat = ChoosePixelFormat(hdc, pfd); + if (pixelFormat == 0) { + windowsThrowException("Failed to choose an OpenGL-compatible pixel format"); + } + + if (DescribePixelFormat(hdc, pixelFormat, pfd) == 0) { + windowsThrowException("Failed to obtain pixel format information"); + } + + if (!SetPixelFormat(hdc, pixelFormat, pfd)) { + windowsThrowException("Failed to set the pixel format"); + } + + hglrc = check(wglCreateContext(hdc)); + wglMakeCurrent(hdc, hglrc); + + return createCapabilitiesWGL(hdc); + } finally { + if (hglrc != NULL) { + wglMakeCurrent(NULL, NULL); + wglDeleteContext(hglrc); + } + + if (hwnd != NULL) { + DestroyWindow(hwnd); + } + + if (classAtom != 0) { + nUnregisterClass(classAtom & 0xFFFF, WindowsLibrary.HINSTANCE); + } + } + } + + /** + * Creates a {@link WGLCapabilities} instance for the context that is current in the current thread. + * + *

This method may only be used on Windows.

+ */ + public static WGLCapabilities createCapabilitiesWGL() { + long hdc = wglGetCurrentDC(); + if (hdc == NULL) { + throw new IllegalStateException("Failed to retrieve the device context of the current OpenGL context"); + } + + return createCapabilitiesWGL(hdc); + } + + /** + * Creates a {@link WGLCapabilities} instance for the specified device context. + * + * @param hdc the device context handle ({@code HDC}) + */ + private static WGLCapabilities createCapabilitiesWGL(long hdc) { + FunctionProvider functionProvider = GL.functionProvider; + if (functionProvider == null) { + throw new IllegalStateException("OpenGL library has not been loaded."); + } + + String extensionsString = null; + + long wglGetExtensionsString = functionProvider.getFunctionAddress("wglGetExtensionsStringARB"); + if (wglGetExtensionsString != NULL) { + extensionsString = memASCII(callPP(hdc, wglGetExtensionsString)); + } else { + wglGetExtensionsString = functionProvider.getFunctionAddress("wglGetExtensionsStringEXT"); + if (wglGetExtensionsString != NULL) { + extensionsString = memASCII(callP(wglGetExtensionsString)); + } + } + + Set supportedExtensions = new HashSet<>(32); + + if (extensionsString != null) { + StringTokenizer tokenizer = new StringTokenizer(extensionsString); + while (tokenizer.hasMoreTokens()) { + supportedExtensions.add(tokenizer.nextToken()); + } + } + + return new WGLCapabilities(functionProvider, supportedExtensions); + } + + /** + * Creates a {@link GLXCapabilities} instance for the default screen of the specified X connection. + * + *

This method may only be used on Linux.

+ * + * @param display the X connection handle ({@code DISPLAY}) + */ + public static GLXCapabilities createCapabilitiesGLX(long display) { + return createCapabilitiesGLX(display, XDefaultScreen(display)); + } + + /** + * Creates a {@link GLXCapabilities} instance for the specified screen of the specified X connection. + * + *

This method may only be used on Linux.

+ * + * @param display the X connection handle ({@code DISPLAY}) + * @param screen the screen index + */ + public static GLXCapabilities createCapabilitiesGLX(long display, int screen) { + FunctionProvider functionProvider = GL.functionProvider; + if (functionProvider == null) { + throw new IllegalStateException("OpenGL library has not been loaded."); + } + + int majorVersion; + int minorVersion; + + try (MemoryStack stack = stackPush()) { + IntBuffer piMajor = stack.ints(0); + IntBuffer piMinor = stack.ints(0); + + if (!glXQueryVersion(display, piMajor, piMinor)) { + throw new IllegalStateException("Failed to query GLX version"); + } + + majorVersion = piMajor.get(0); + minorVersion = piMinor.get(0); + if (majorVersion != 1) { + throw new IllegalStateException("Invalid GLX major version: " + majorVersion); + } + } + + Set supportedExtensions = new HashSet<>(32); + + int[][] GLX_VERSIONS = { + {1, 2, 3, 4} + }; + + for (int major = 1; major <= GLX_VERSIONS.length; major++) { + int[] minors = GLX_VERSIONS[major - 1]; + for (int minor : minors) { + if (major < majorVersion || (major == majorVersion && minor <= minorVersion)) { + supportedExtensions.add("GLX" + major + minor); + } + } + } + + if (1 <= minorVersion) { + String extensionsString; + + if (screen == -1) { + long glXGetClientString = functionProvider.getFunctionAddress("glXGetClientString"); + extensionsString = memASCIISafe(callPP(display, GLX_EXTENSIONS, glXGetClientString)); + } else { + long glXQueryExtensionsString = functionProvider.getFunctionAddress("glXQueryExtensionsString"); + extensionsString = memASCIISafe(callPP(display, screen, glXQueryExtensionsString)); + } + + if (extensionsString != null) { + StringTokenizer tokenizer = new StringTokenizer(extensionsString); + while (tokenizer.hasMoreTokens()) { + supportedExtensions.add(tokenizer.nextToken()); + } + } + } + + return new GLXCapabilities(functionProvider, supportedExtensions); + } + + // Only used by array overloads + static GLCapabilities getICD() { + return checkCapabilities(icd.get()); + } + + /** Function pointer provider. */ + private interface ICD { + default void set(@Nullable GLCapabilities caps) {} + @Nullable GLCapabilities get(); + } + + /** + * Write-once {@link ICD}. + * + *

This is the default implementation that skips the thread-local lookup. When a new GLCapabilities is set, we compare it to the write-once capabilities. + * If different function pointers are found, we fall back to the expensive lookup.

+ */ + private static class ICDStatic implements ICD { + + @Nullable + private static GLCapabilities tempCaps; + + @Override + public void set(@Nullable GLCapabilities caps) { + if (tempCaps == null) { + tempCaps = caps; + } else if (caps != null && caps != tempCaps && ThreadLocalUtil.areCapabilitiesDifferent(tempCaps.addresses, caps.addresses)) { + apiLog("[WARNING] Incompatible context detected. Falling back to thread-local lookup for GL contexts."); + icd = GL::getCapabilities; // fall back to thread/process lookup + } + } + + @Override + public GLCapabilities get() { + return WriteOnce.caps; + } + + private static final class WriteOnce { + // This will be initialized the first time get() above is called + @Nullable + static final GLCapabilities caps = ICDStatic.tempCaps; + + static { + if (caps == null) { + throw new IllegalStateException("No GLCapabilities instance has been set"); + } + } + } + + } + +} diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL11.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL11.java new file mode 100644 index 00000000..1a8e6ae4 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL11.java @@ -0,0 +1,10003 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality up to version 1.1. Includes the deprecated symbols of the Compatibility Profile. + * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL11 { + + /** AccumOp */ + public static final int + GL_ACCUM = 0x100, + GL_LOAD = 0x101, + GL_RETURN = 0x102, + GL_MULT = 0x103, + GL_ADD = 0x104; + + /** AlphaFunction */ + public static final int + GL_NEVER = 0x200, + GL_LESS = 0x201, + GL_EQUAL = 0x202, + GL_LEQUAL = 0x203, + GL_GREATER = 0x204, + GL_NOTEQUAL = 0x205, + GL_GEQUAL = 0x206, + GL_ALWAYS = 0x207; + + /** AttribMask */ + public static final int + GL_CURRENT_BIT = 0x1, + GL_POINT_BIT = 0x2, + GL_LINE_BIT = 0x4, + GL_POLYGON_BIT = 0x8, + GL_POLYGON_STIPPLE_BIT = 0x10, + GL_PIXEL_MODE_BIT = 0x20, + GL_LIGHTING_BIT = 0x40, + GL_FOG_BIT = 0x80, + GL_DEPTH_BUFFER_BIT = 0x100, + GL_ACCUM_BUFFER_BIT = 0x200, + GL_STENCIL_BUFFER_BIT = 0x400, + GL_VIEWPORT_BIT = 0x800, + GL_TRANSFORM_BIT = 0x1000, + GL_ENABLE_BIT = 0x2000, + GL_COLOR_BUFFER_BIT = 0x4000, + GL_HINT_BIT = 0x8000, + GL_EVAL_BIT = 0x10000, + GL_LIST_BIT = 0x20000, + GL_TEXTURE_BIT = 0x40000, + GL_SCISSOR_BIT = 0x80000, + GL_ALL_ATTRIB_BITS = 0xFFFFF; + + /** BeginMode */ + public static final int + GL_POINTS = 0x0, + GL_LINES = 0x1, + GL_LINE_LOOP = 0x2, + GL_LINE_STRIP = 0x3, + GL_TRIANGLES = 0x4, + GL_TRIANGLE_STRIP = 0x5, + GL_TRIANGLE_FAN = 0x6, + GL_QUADS = 0x7, + GL_QUAD_STRIP = 0x8, + GL_POLYGON = 0x9; + + /** BlendingFactorDest */ + public static final int + GL_ZERO = 0, + GL_ONE = 1, + GL_SRC_COLOR = 0x300, + GL_ONE_MINUS_SRC_COLOR = 0x301, + GL_SRC_ALPHA = 0x302, + GL_ONE_MINUS_SRC_ALPHA = 0x303, + GL_DST_ALPHA = 0x304, + GL_ONE_MINUS_DST_ALPHA = 0x305; + + /** BlendingFactorSrc */ + public static final int + GL_DST_COLOR = 0x306, + GL_ONE_MINUS_DST_COLOR = 0x307, + GL_SRC_ALPHA_SATURATE = 0x308; + + /** Boolean */ + public static final int + GL_TRUE = 1, + GL_FALSE = 0; + + /** ClipPlaneName */ + public static final int + GL_CLIP_PLANE0 = 0x3000, + GL_CLIP_PLANE1 = 0x3001, + GL_CLIP_PLANE2 = 0x3002, + GL_CLIP_PLANE3 = 0x3003, + GL_CLIP_PLANE4 = 0x3004, + GL_CLIP_PLANE5 = 0x3005; + + /** DataType */ + public static final int + GL_BYTE = 0x1400, + GL_UNSIGNED_BYTE = 0x1401, + GL_SHORT = 0x1402, + GL_UNSIGNED_SHORT = 0x1403, + GL_INT = 0x1404, + GL_UNSIGNED_INT = 0x1405, + GL_FLOAT = 0x1406, + GL_2_BYTES = 0x1407, + GL_3_BYTES = 0x1408, + GL_4_BYTES = 0x1409, + GL_DOUBLE = 0x140A; + + /** DrawBufferMode */ + public static final int + GL_NONE = 0, + GL_FRONT_LEFT = 0x400, + GL_FRONT_RIGHT = 0x401, + GL_BACK_LEFT = 0x402, + GL_BACK_RIGHT = 0x403, + GL_FRONT = 0x404, + GL_BACK = 0x405, + GL_LEFT = 0x406, + GL_RIGHT = 0x407, + GL_FRONT_AND_BACK = 0x408, + GL_AUX0 = 0x409, + GL_AUX1 = 0x40A, + GL_AUX2 = 0x40B, + GL_AUX3 = 0x40C; + + /** ErrorCode */ + public static final int + GL_NO_ERROR = 0, + GL_INVALID_ENUM = 0x500, + GL_INVALID_VALUE = 0x501, + GL_INVALID_OPERATION = 0x502, + GL_STACK_OVERFLOW = 0x503, + GL_STACK_UNDERFLOW = 0x504, + GL_OUT_OF_MEMORY = 0x505; + + /** FeedBackMode */ + public static final int + GL_2D = 0x600, + GL_3D = 0x601, + GL_3D_COLOR = 0x602, + GL_3D_COLOR_TEXTURE = 0x603, + GL_4D_COLOR_TEXTURE = 0x604; + + /** FeedBackToken */ + public static final int + GL_PASS_THROUGH_TOKEN = 0x700, + GL_POINT_TOKEN = 0x701, + GL_LINE_TOKEN = 0x702, + GL_POLYGON_TOKEN = 0x703, + GL_BITMAP_TOKEN = 0x704, + GL_DRAW_PIXEL_TOKEN = 0x705, + GL_COPY_PIXEL_TOKEN = 0x706, + GL_LINE_RESET_TOKEN = 0x707; + + /** FogMode */ + public static final int + GL_EXP = 0x800, + GL_EXP2 = 0x801; + + /** FrontFaceDirection */ + public static final int + GL_CW = 0x900, + GL_CCW = 0x901; + + /** GetMapTarget */ + public static final int + GL_COEFF = 0xA00, + GL_ORDER = 0xA01, + GL_DOMAIN = 0xA02; + + /** GetTarget */ + public static final int + GL_CURRENT_COLOR = 0xB00, + GL_CURRENT_INDEX = 0xB01, + GL_CURRENT_NORMAL = 0xB02, + GL_CURRENT_TEXTURE_COORDS = 0xB03, + GL_CURRENT_RASTER_COLOR = 0xB04, + GL_CURRENT_RASTER_INDEX = 0xB05, + GL_CURRENT_RASTER_TEXTURE_COORDS = 0xB06, + GL_CURRENT_RASTER_POSITION = 0xB07, + GL_CURRENT_RASTER_POSITION_VALID = 0xB08, + GL_CURRENT_RASTER_DISTANCE = 0xB09, + GL_POINT_SMOOTH = 0xB10, + GL_POINT_SIZE = 0xB11, + GL_POINT_SIZE_RANGE = 0xB12, + GL_POINT_SIZE_GRANULARITY = 0xB13, + GL_LINE_SMOOTH = 0xB20, + GL_LINE_WIDTH = 0xB21, + GL_LINE_WIDTH_RANGE = 0xB22, + GL_LINE_WIDTH_GRANULARITY = 0xB23, + GL_LINE_STIPPLE = 0xB24, + GL_LINE_STIPPLE_PATTERN = 0xB25, + GL_LINE_STIPPLE_REPEAT = 0xB26, + GL_LIST_MODE = 0xB30, + GL_MAX_LIST_NESTING = 0xB31, + GL_LIST_BASE = 0xB32, + GL_LIST_INDEX = 0xB33, + GL_POLYGON_MODE = 0xB40, + GL_POLYGON_SMOOTH = 0xB41, + GL_POLYGON_STIPPLE = 0xB42, + GL_EDGE_FLAG = 0xB43, + GL_CULL_FACE = 0xB44, + GL_CULL_FACE_MODE = 0xB45, + GL_FRONT_FACE = 0xB46, + GL_LIGHTING = 0xB50, + GL_LIGHT_MODEL_LOCAL_VIEWER = 0xB51, + GL_LIGHT_MODEL_TWO_SIDE = 0xB52, + GL_LIGHT_MODEL_AMBIENT = 0xB53, + GL_SHADE_MODEL = 0xB54, + GL_COLOR_MATERIAL_FACE = 0xB55, + GL_COLOR_MATERIAL_PARAMETER = 0xB56, + GL_COLOR_MATERIAL = 0xB57, + GL_FOG = 0xB60, + GL_FOG_INDEX = 0xB61, + GL_FOG_DENSITY = 0xB62, + GL_FOG_START = 0xB63, + GL_FOG_END = 0xB64, + GL_FOG_MODE = 0xB65, + GL_FOG_COLOR = 0xB66, + GL_DEPTH_RANGE = 0xB70, + GL_DEPTH_TEST = 0xB71, + GL_DEPTH_WRITEMASK = 0xB72, + GL_DEPTH_CLEAR_VALUE = 0xB73, + GL_DEPTH_FUNC = 0xB74, + GL_ACCUM_CLEAR_VALUE = 0xB80, + GL_STENCIL_TEST = 0xB90, + GL_STENCIL_CLEAR_VALUE = 0xB91, + GL_STENCIL_FUNC = 0xB92, + GL_STENCIL_VALUE_MASK = 0xB93, + GL_STENCIL_FAIL = 0xB94, + GL_STENCIL_PASS_DEPTH_FAIL = 0xB95, + GL_STENCIL_PASS_DEPTH_PASS = 0xB96, + GL_STENCIL_REF = 0xB97, + GL_STENCIL_WRITEMASK = 0xB98, + GL_MATRIX_MODE = 0xBA0, + GL_NORMALIZE = 0xBA1, + GL_VIEWPORT = 0xBA2, + GL_MODELVIEW_STACK_DEPTH = 0xBA3, + GL_PROJECTION_STACK_DEPTH = 0xBA4, + GL_TEXTURE_STACK_DEPTH = 0xBA5, + GL_MODELVIEW_MATRIX = 0xBA6, + GL_PROJECTION_MATRIX = 0xBA7, + GL_TEXTURE_MATRIX = 0xBA8, + GL_ATTRIB_STACK_DEPTH = 0xBB0, + GL_CLIENT_ATTRIB_STACK_DEPTH = 0xBB1, + GL_ALPHA_TEST = 0xBC0, + GL_ALPHA_TEST_FUNC = 0xBC1, + GL_ALPHA_TEST_REF = 0xBC2, + GL_DITHER = 0xBD0, + GL_BLEND_DST = 0xBE0, + GL_BLEND_SRC = 0xBE1, + GL_BLEND = 0xBE2, + GL_LOGIC_OP_MODE = 0xBF0, + GL_INDEX_LOGIC_OP = 0xBF1, + GL_LOGIC_OP = 0xBF1, + GL_COLOR_LOGIC_OP = 0xBF2, + GL_AUX_BUFFERS = 0xC00, + GL_DRAW_BUFFER = 0xC01, + GL_READ_BUFFER = 0xC02, + GL_SCISSOR_BOX = 0xC10, + GL_SCISSOR_TEST = 0xC11, + GL_INDEX_CLEAR_VALUE = 0xC20, + GL_INDEX_WRITEMASK = 0xC21, + GL_COLOR_CLEAR_VALUE = 0xC22, + GL_COLOR_WRITEMASK = 0xC23, + GL_INDEX_MODE = 0xC30, + GL_RGBA_MODE = 0xC31, + GL_DOUBLEBUFFER = 0xC32, + GL_STEREO = 0xC33, + GL_RENDER_MODE = 0xC40, + GL_PERSPECTIVE_CORRECTION_HINT = 0xC50, + GL_POINT_SMOOTH_HINT = 0xC51, + GL_LINE_SMOOTH_HINT = 0xC52, + GL_POLYGON_SMOOTH_HINT = 0xC53, + GL_FOG_HINT = 0xC54, + GL_TEXTURE_GEN_S = 0xC60, + GL_TEXTURE_GEN_T = 0xC61, + GL_TEXTURE_GEN_R = 0xC62, + GL_TEXTURE_GEN_Q = 0xC63, + GL_PIXEL_MAP_I_TO_I = 0xC70, + GL_PIXEL_MAP_S_TO_S = 0xC71, + GL_PIXEL_MAP_I_TO_R = 0xC72, + GL_PIXEL_MAP_I_TO_G = 0xC73, + GL_PIXEL_MAP_I_TO_B = 0xC74, + GL_PIXEL_MAP_I_TO_A = 0xC75, + GL_PIXEL_MAP_R_TO_R = 0xC76, + GL_PIXEL_MAP_G_TO_G = 0xC77, + GL_PIXEL_MAP_B_TO_B = 0xC78, + GL_PIXEL_MAP_A_TO_A = 0xC79, + GL_PIXEL_MAP_I_TO_I_SIZE = 0xCB0, + GL_PIXEL_MAP_S_TO_S_SIZE = 0xCB1, + GL_PIXEL_MAP_I_TO_R_SIZE = 0xCB2, + GL_PIXEL_MAP_I_TO_G_SIZE = 0xCB3, + GL_PIXEL_MAP_I_TO_B_SIZE = 0xCB4, + GL_PIXEL_MAP_I_TO_A_SIZE = 0xCB5, + GL_PIXEL_MAP_R_TO_R_SIZE = 0xCB6, + GL_PIXEL_MAP_G_TO_G_SIZE = 0xCB7, + GL_PIXEL_MAP_B_TO_B_SIZE = 0xCB8, + GL_PIXEL_MAP_A_TO_A_SIZE = 0xCB9, + GL_UNPACK_SWAP_BYTES = 0xCF0, + GL_UNPACK_LSB_FIRST = 0xCF1, + GL_UNPACK_ROW_LENGTH = 0xCF2, + GL_UNPACK_SKIP_ROWS = 0xCF3, + GL_UNPACK_SKIP_PIXELS = 0xCF4, + GL_UNPACK_ALIGNMENT = 0xCF5, + GL_PACK_SWAP_BYTES = 0xD00, + GL_PACK_LSB_FIRST = 0xD01, + GL_PACK_ROW_LENGTH = 0xD02, + GL_PACK_SKIP_ROWS = 0xD03, + GL_PACK_SKIP_PIXELS = 0xD04, + GL_PACK_ALIGNMENT = 0xD05, + GL_MAP_COLOR = 0xD10, + GL_MAP_STENCIL = 0xD11, + GL_INDEX_SHIFT = 0xD12, + GL_INDEX_OFFSET = 0xD13, + GL_RED_SCALE = 0xD14, + GL_RED_BIAS = 0xD15, + GL_ZOOM_X = 0xD16, + GL_ZOOM_Y = 0xD17, + GL_GREEN_SCALE = 0xD18, + GL_GREEN_BIAS = 0xD19, + GL_BLUE_SCALE = 0xD1A, + GL_BLUE_BIAS = 0xD1B, + GL_ALPHA_SCALE = 0xD1C, + GL_ALPHA_BIAS = 0xD1D, + GL_DEPTH_SCALE = 0xD1E, + GL_DEPTH_BIAS = 0xD1F, + GL_MAX_EVAL_ORDER = 0xD30, + GL_MAX_LIGHTS = 0xD31, + GL_MAX_CLIP_PLANES = 0xD32, + GL_MAX_TEXTURE_SIZE = 0xD33, + GL_MAX_PIXEL_MAP_TABLE = 0xD34, + GL_MAX_ATTRIB_STACK_DEPTH = 0xD35, + GL_MAX_MODELVIEW_STACK_DEPTH = 0xD36, + GL_MAX_NAME_STACK_DEPTH = 0xD37, + GL_MAX_PROJECTION_STACK_DEPTH = 0xD38, + GL_MAX_TEXTURE_STACK_DEPTH = 0xD39, + GL_MAX_VIEWPORT_DIMS = 0xD3A, + GL_MAX_CLIENT_ATTRIB_STACK_DEPTH = 0xD3B, + GL_SUBPIXEL_BITS = 0xD50, + GL_INDEX_BITS = 0xD51, + GL_RED_BITS = 0xD52, + GL_GREEN_BITS = 0xD53, + GL_BLUE_BITS = 0xD54, + GL_ALPHA_BITS = 0xD55, + GL_DEPTH_BITS = 0xD56, + GL_STENCIL_BITS = 0xD57, + GL_ACCUM_RED_BITS = 0xD58, + GL_ACCUM_GREEN_BITS = 0xD59, + GL_ACCUM_BLUE_BITS = 0xD5A, + GL_ACCUM_ALPHA_BITS = 0xD5B, + GL_NAME_STACK_DEPTH = 0xD70, + GL_AUTO_NORMAL = 0xD80, + GL_MAP1_COLOR_4 = 0xD90, + GL_MAP1_INDEX = 0xD91, + GL_MAP1_NORMAL = 0xD92, + GL_MAP1_TEXTURE_COORD_1 = 0xD93, + GL_MAP1_TEXTURE_COORD_2 = 0xD94, + GL_MAP1_TEXTURE_COORD_3 = 0xD95, + GL_MAP1_TEXTURE_COORD_4 = 0xD96, + GL_MAP1_VERTEX_3 = 0xD97, + GL_MAP1_VERTEX_4 = 0xD98, + GL_MAP2_COLOR_4 = 0xDB0, + GL_MAP2_INDEX = 0xDB1, + GL_MAP2_NORMAL = 0xDB2, + GL_MAP2_TEXTURE_COORD_1 = 0xDB3, + GL_MAP2_TEXTURE_COORD_2 = 0xDB4, + GL_MAP2_TEXTURE_COORD_3 = 0xDB5, + GL_MAP2_TEXTURE_COORD_4 = 0xDB6, + GL_MAP2_VERTEX_3 = 0xDB7, + GL_MAP2_VERTEX_4 = 0xDB8, + GL_MAP1_GRID_DOMAIN = 0xDD0, + GL_MAP1_GRID_SEGMENTS = 0xDD1, + GL_MAP2_GRID_DOMAIN = 0xDD2, + GL_MAP2_GRID_SEGMENTS = 0xDD3, + GL_TEXTURE_1D = 0xDE0, + GL_TEXTURE_2D = 0xDE1, + GL_FEEDBACK_BUFFER_POINTER = 0xDF0, + GL_FEEDBACK_BUFFER_SIZE = 0xDF1, + GL_FEEDBACK_BUFFER_TYPE = 0xDF2, + GL_SELECTION_BUFFER_POINTER = 0xDF3, + GL_SELECTION_BUFFER_SIZE = 0xDF4; + + /** GetTextureParameter */ + public static final int + GL_TEXTURE_WIDTH = 0x1000, + GL_TEXTURE_HEIGHT = 0x1001, + GL_TEXTURE_INTERNAL_FORMAT = 0x1003, + GL_TEXTURE_COMPONENTS = 0x1003, + GL_TEXTURE_BORDER_COLOR = 0x1004, + GL_TEXTURE_BORDER = 0x1005; + + /** HintMode */ + public static final int + GL_DONT_CARE = 0x1100, + GL_FASTEST = 0x1101, + GL_NICEST = 0x1102; + + /** LightName */ + public static final int + GL_LIGHT0 = 0x4000, + GL_LIGHT1 = 0x4001, + GL_LIGHT2 = 0x4002, + GL_LIGHT3 = 0x4003, + GL_LIGHT4 = 0x4004, + GL_LIGHT5 = 0x4005, + GL_LIGHT6 = 0x4006, + GL_LIGHT7 = 0x4007; + + /** LightParameter */ + public static final int + GL_AMBIENT = 0x1200, + GL_DIFFUSE = 0x1201, + GL_SPECULAR = 0x1202, + GL_POSITION = 0x1203, + GL_SPOT_DIRECTION = 0x1204, + GL_SPOT_EXPONENT = 0x1205, + GL_SPOT_CUTOFF = 0x1206, + GL_CONSTANT_ATTENUATION = 0x1207, + GL_LINEAR_ATTENUATION = 0x1208, + GL_QUADRATIC_ATTENUATION = 0x1209; + + /** ListMode */ + public static final int + GL_COMPILE = 0x1300, + GL_COMPILE_AND_EXECUTE = 0x1301; + + /** LogicOp */ + public static final int + GL_CLEAR = 0x1500, + GL_AND = 0x1501, + GL_AND_REVERSE = 0x1502, + GL_COPY = 0x1503, + GL_AND_INVERTED = 0x1504, + GL_NOOP = 0x1505, + GL_XOR = 0x1506, + GL_OR = 0x1507, + GL_NOR = 0x1508, + GL_EQUIV = 0x1509, + GL_INVERT = 0x150A, + GL_OR_REVERSE = 0x150B, + GL_COPY_INVERTED = 0x150C, + GL_OR_INVERTED = 0x150D, + GL_NAND = 0x150E, + GL_SET = 0x150F; + + /** MaterialParameter */ + public static final int + GL_EMISSION = 0x1600, + GL_SHININESS = 0x1601, + GL_AMBIENT_AND_DIFFUSE = 0x1602, + GL_COLOR_INDEXES = 0x1603; + + /** MatrixMode */ + public static final int + GL_MODELVIEW = 0x1700, + GL_PROJECTION = 0x1701, + GL_TEXTURE = 0x1702; + + /** PixelCopyType */ + public static final int + GL_COLOR = 0x1800, + GL_DEPTH = 0x1801, + GL_STENCIL = 0x1802; + + /** PixelFormat */ + public static final int + GL_COLOR_INDEX = 0x1900, + GL_STENCIL_INDEX = 0x1901, + GL_DEPTH_COMPONENT = 0x1902, + GL_RED = 0x1903, + GL_GREEN = 0x1904, + GL_BLUE = 0x1905, + GL_ALPHA = 0x1906, + GL_RGB = 0x1907, + GL_RGBA = 0x1908, + GL_LUMINANCE = 0x1909, + GL_LUMINANCE_ALPHA = 0x190A; + + /** PixelType */ + public static final int GL_BITMAP = 0x1A00; + + /** PolygonMode */ + public static final int + GL_POINT = 0x1B00, + GL_LINE = 0x1B01, + GL_FILL = 0x1B02; + + /** RenderingMode */ + public static final int + GL_RENDER = 0x1C00, + GL_FEEDBACK = 0x1C01, + GL_SELECT = 0x1C02; + + /** ShadingModel */ + public static final int + GL_FLAT = 0x1D00, + GL_SMOOTH = 0x1D01; + + /** StencilOp */ + public static final int + GL_KEEP = 0x1E00, + GL_REPLACE = 0x1E01, + GL_INCR = 0x1E02, + GL_DECR = 0x1E03; + + /** StringName */ + public static final int + GL_VENDOR = 0x1F00, + GL_RENDERER = 0x1F01, + GL_VERSION = 0x1F02, + GL_EXTENSIONS = 0x1F03; + + /** TextureCoordName */ + public static final int + GL_S = 0x2000, + GL_T = 0x2001, + GL_R = 0x2002, + GL_Q = 0x2003; + + /** TextureEnvMode */ + public static final int + GL_MODULATE = 0x2100, + GL_DECAL = 0x2101; + + /** TextureEnvParameter */ + public static final int + GL_TEXTURE_ENV_MODE = 0x2200, + GL_TEXTURE_ENV_COLOR = 0x2201; + + /** TextureEnvTarget */ + public static final int GL_TEXTURE_ENV = 0x2300; + + /** TextureGenMode */ + public static final int + GL_EYE_LINEAR = 0x2400, + GL_OBJECT_LINEAR = 0x2401, + GL_SPHERE_MAP = 0x2402; + + /** TextureGenParameter */ + public static final int + GL_TEXTURE_GEN_MODE = 0x2500, + GL_OBJECT_PLANE = 0x2501, + GL_EYE_PLANE = 0x2502; + + /** TextureMagFilter */ + public static final int + GL_NEAREST = 0x2600, + GL_LINEAR = 0x2601; + + /** TextureMinFilter */ + public static final int + GL_NEAREST_MIPMAP_NEAREST = 0x2700, + GL_LINEAR_MIPMAP_NEAREST = 0x2701, + GL_NEAREST_MIPMAP_LINEAR = 0x2702, + GL_LINEAR_MIPMAP_LINEAR = 0x2703; + + /** TextureParameterName */ + public static final int + GL_TEXTURE_MAG_FILTER = 0x2800, + GL_TEXTURE_MIN_FILTER = 0x2801, + GL_TEXTURE_WRAP_S = 0x2802, + GL_TEXTURE_WRAP_T = 0x2803; + + /** TextureWrapMode */ + public static final int + GL_CLAMP = 0x2900, + GL_REPEAT = 0x2901; + + /** ClientAttribMask */ + public static final int + GL_CLIENT_PIXEL_STORE_BIT = 0x1, + GL_CLIENT_VERTEX_ARRAY_BIT = 0x2, + GL_CLIENT_ALL_ATTRIB_BITS = 0xFFFFFFFF; + + /** polygon_offset */ + public static final int + GL_POLYGON_OFFSET_FACTOR = 0x8038, + GL_POLYGON_OFFSET_UNITS = 0x2A00, + GL_POLYGON_OFFSET_POINT = 0x2A01, + GL_POLYGON_OFFSET_LINE = 0x2A02, + GL_POLYGON_OFFSET_FILL = 0x8037; + + /** texture */ + public static final int + GL_ALPHA4 = 0x803B, + GL_ALPHA8 = 0x803C, + GL_ALPHA12 = 0x803D, + GL_ALPHA16 = 0x803E, + GL_LUMINANCE4 = 0x803F, + GL_LUMINANCE8 = 0x8040, + GL_LUMINANCE12 = 0x8041, + GL_LUMINANCE16 = 0x8042, + GL_LUMINANCE4_ALPHA4 = 0x8043, + GL_LUMINANCE6_ALPHA2 = 0x8044, + GL_LUMINANCE8_ALPHA8 = 0x8045, + GL_LUMINANCE12_ALPHA4 = 0x8046, + GL_LUMINANCE12_ALPHA12 = 0x8047, + GL_LUMINANCE16_ALPHA16 = 0x8048, + GL_INTENSITY = 0x8049, + GL_INTENSITY4 = 0x804A, + GL_INTENSITY8 = 0x804B, + GL_INTENSITY12 = 0x804C, + GL_INTENSITY16 = 0x804D, + GL_R3_G3_B2 = 0x2A10, + GL_RGB4 = 0x804F, + GL_RGB5 = 0x8050, + GL_RGB8 = 0x8051, + GL_RGB10 = 0x8052, + GL_RGB12 = 0x8053, + GL_RGB16 = 0x8054, + GL_RGBA2 = 0x8055, + GL_RGBA4 = 0x8056, + GL_RGB5_A1 = 0x8057, + GL_RGBA8 = 0x8058, + GL_RGB10_A2 = 0x8059, + GL_RGBA12 = 0x805A, + GL_RGBA16 = 0x805B, + GL_TEXTURE_RED_SIZE = 0x805C, + GL_TEXTURE_GREEN_SIZE = 0x805D, + GL_TEXTURE_BLUE_SIZE = 0x805E, + GL_TEXTURE_ALPHA_SIZE = 0x805F, + GL_TEXTURE_LUMINANCE_SIZE = 0x8060, + GL_TEXTURE_INTENSITY_SIZE = 0x8061, + GL_PROXY_TEXTURE_1D = 0x8063, + GL_PROXY_TEXTURE_2D = 0x8064; + + /** texture_object */ + public static final int + GL_TEXTURE_PRIORITY = 0x8066, + GL_TEXTURE_RESIDENT = 0x8067, + GL_TEXTURE_BINDING_1D = 0x8068, + GL_TEXTURE_BINDING_2D = 0x8069; + + /** vertex_array */ + public static final int + GL_VERTEX_ARRAY = 0x8074, + GL_NORMAL_ARRAY = 0x8075, + GL_COLOR_ARRAY = 0x8076, + GL_INDEX_ARRAY = 0x8077, + GL_TEXTURE_COORD_ARRAY = 0x8078, + GL_EDGE_FLAG_ARRAY = 0x8079, + GL_VERTEX_ARRAY_SIZE = 0x807A, + GL_VERTEX_ARRAY_TYPE = 0x807B, + GL_VERTEX_ARRAY_STRIDE = 0x807C, + GL_NORMAL_ARRAY_TYPE = 0x807E, + GL_NORMAL_ARRAY_STRIDE = 0x807F, + GL_COLOR_ARRAY_SIZE = 0x8081, + GL_COLOR_ARRAY_TYPE = 0x8082, + GL_COLOR_ARRAY_STRIDE = 0x8083, + GL_INDEX_ARRAY_TYPE = 0x8085, + GL_INDEX_ARRAY_STRIDE = 0x8086, + GL_TEXTURE_COORD_ARRAY_SIZE = 0x8088, + GL_TEXTURE_COORD_ARRAY_TYPE = 0x8089, + GL_TEXTURE_COORD_ARRAY_STRIDE = 0x808A, + GL_EDGE_FLAG_ARRAY_STRIDE = 0x808C, + GL_VERTEX_ARRAY_POINTER = 0x808E, + GL_NORMAL_ARRAY_POINTER = 0x808F, + GL_COLOR_ARRAY_POINTER = 0x8090, + GL_INDEX_ARRAY_POINTER = 0x8091, + GL_TEXTURE_COORD_ARRAY_POINTER = 0x8092, + GL_EDGE_FLAG_ARRAY_POINTER = 0x8093, + GL_V2F = 0x2A20, + GL_V3F = 0x2A21, + GL_C4UB_V2F = 0x2A22, + GL_C4UB_V3F = 0x2A23, + GL_C3F_V3F = 0x2A24, + GL_N3F_V3F = 0x2A25, + GL_C4F_N3F_V3F = 0x2A26, + GL_T2F_V3F = 0x2A27, + GL_T4F_V4F = 0x2A28, + GL_T2F_C4UB_V3F = 0x2A29, + GL_T2F_C3F_V3F = 0x2A2A, + GL_T2F_N3F_V3F = 0x2A2B, + GL_T2F_C4F_N3F_V3F = 0x2A2C, + GL_T4F_C4F_N3F_V4F = 0x2A2D; + + static { GL.initialize(); } + + protected GL11() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext, boolean fc) { + return (fc || checkFunctions( + caps.glAccum, caps.glAlphaFunc, caps.glAreTexturesResident, caps.glArrayElement, caps.glBegin, caps.glBitmap, caps.glCallList, caps.glCallLists, + caps.glClearAccum, caps.glClearIndex, caps.glClipPlane, caps.glColor3b, caps.glColor3s, caps.glColor3i, caps.glColor3f, caps.glColor3d, + caps.glColor3ub, caps.glColor3us, caps.glColor3ui, caps.glColor3bv, caps.glColor3sv, caps.glColor3iv, caps.glColor3fv, caps.glColor3dv, + caps.glColor3ubv, caps.glColor3usv, caps.glColor3uiv, caps.glColor4b, caps.glColor4s, caps.glColor4i, caps.glColor4f, caps.glColor4d, + caps.glColor4ub, caps.glColor4us, caps.glColor4ui, caps.glColor4bv, caps.glColor4sv, caps.glColor4iv, caps.glColor4fv, caps.glColor4dv, + caps.glColor4ubv, caps.glColor4usv, caps.glColor4uiv, caps.glColorMaterial, caps.glColorPointer, caps.glCopyPixels, caps.glDeleteLists, + caps.glDrawPixels, caps.glEdgeFlag, caps.glEdgeFlagv, caps.glEdgeFlagPointer, caps.glEnd, caps.glEvalCoord1f, caps.glEvalCoord1fv, + caps.glEvalCoord1d, caps.glEvalCoord1dv, caps.glEvalCoord2f, caps.glEvalCoord2fv, caps.glEvalCoord2d, caps.glEvalCoord2dv, caps.glEvalMesh1, + caps.glEvalMesh2, caps.glEvalPoint1, caps.glEvalPoint2, caps.glFeedbackBuffer, caps.glFogi, caps.glFogiv, caps.glFogf, caps.glFogfv, + caps.glGenLists, caps.glGetClipPlane, caps.glGetLightiv, caps.glGetLightfv, caps.glGetMapiv, caps.glGetMapfv, caps.glGetMapdv, caps.glGetMaterialiv, + caps.glGetMaterialfv, caps.glGetPixelMapfv, caps.glGetPixelMapusv, caps.glGetPixelMapuiv, caps.glGetPolygonStipple, caps.glGetTexEnviv, + caps.glGetTexEnvfv, caps.glGetTexGeniv, caps.glGetTexGenfv, caps.glGetTexGendv, caps.glIndexi, caps.glIndexub, caps.glIndexs, caps.glIndexf, + caps.glIndexd, caps.glIndexiv, caps.glIndexubv, caps.glIndexsv, caps.glIndexfv, caps.glIndexdv, caps.glIndexMask, caps.glIndexPointer, + caps.glInitNames, caps.glInterleavedArrays, caps.glIsList, caps.glLightModeli, caps.glLightModelf, caps.glLightModeliv, caps.glLightModelfv, + caps.glLighti, caps.glLightf, caps.glLightiv, caps.glLightfv, caps.glLineStipple, caps.glListBase, caps.glLoadMatrixf, caps.glLoadMatrixd, + caps.glLoadIdentity, caps.glLoadName, caps.glMap1f, caps.glMap1d, caps.glMap2f, caps.glMap2d, caps.glMapGrid1f, caps.glMapGrid1d, caps.glMapGrid2f, + caps.glMapGrid2d, caps.glMateriali, caps.glMaterialf, caps.glMaterialiv, caps.glMaterialfv, caps.glMatrixMode, caps.glMultMatrixf, + caps.glMultMatrixd, caps.glFrustum, caps.glNewList, caps.glEndList, caps.glNormal3f, caps.glNormal3b, caps.glNormal3s, caps.glNormal3i, + caps.glNormal3d, caps.glNormal3fv, caps.glNormal3bv, caps.glNormal3sv, caps.glNormal3iv, caps.glNormal3dv, caps.glNormalPointer, caps.glOrtho, + caps.glPassThrough, caps.glPixelMapfv, caps.glPixelMapusv, caps.glPixelMapuiv, caps.glPixelTransferi, caps.glPixelTransferf, caps.glPixelZoom, + caps.glPolygonStipple, caps.glPushAttrib, caps.glPushClientAttrib, caps.glPopAttrib, caps.glPopClientAttrib, caps.glPopMatrix, caps.glPopName, + caps.glPrioritizeTextures, caps.glPushMatrix, caps.glPushName, caps.glRasterPos2i, caps.glRasterPos2s, caps.glRasterPos2f, caps.glRasterPos2d, + caps.glRasterPos2iv, caps.glRasterPos2sv, caps.glRasterPos2fv, caps.glRasterPos2dv, caps.glRasterPos3i, caps.glRasterPos3s, caps.glRasterPos3f, + caps.glRasterPos3d, caps.glRasterPos3iv, caps.glRasterPos3sv, caps.glRasterPos3fv, caps.glRasterPos3dv, caps.glRasterPos4i, caps.glRasterPos4s, + caps.glRasterPos4f, caps.glRasterPos4d, caps.glRasterPos4iv, caps.glRasterPos4sv, caps.glRasterPos4fv, caps.glRasterPos4dv, caps.glRecti, + caps.glRects, caps.glRectf, caps.glRectd, caps.glRectiv, caps.glRectsv, caps.glRectfv, caps.glRectdv, caps.glRenderMode, caps.glRotatef, + caps.glRotated, caps.glScalef, caps.glScaled, caps.glSelectBuffer, caps.glShadeModel, caps.glTexCoord1f, caps.glTexCoord1s, caps.glTexCoord1i, + caps.glTexCoord1d, caps.glTexCoord1fv, caps.glTexCoord1sv, caps.glTexCoord1iv, caps.glTexCoord1dv, caps.glTexCoord2f, caps.glTexCoord2s, + caps.glTexCoord2i, caps.glTexCoord2d, caps.glTexCoord2fv, caps.glTexCoord2sv, caps.glTexCoord2iv, caps.glTexCoord2dv, caps.glTexCoord3f, + caps.glTexCoord3s, caps.glTexCoord3i, caps.glTexCoord3d, caps.glTexCoord3fv, caps.glTexCoord3sv, caps.glTexCoord3iv, caps.glTexCoord3dv, + caps.glTexCoord4f, caps.glTexCoord4s, caps.glTexCoord4i, caps.glTexCoord4d, caps.glTexCoord4fv, caps.glTexCoord4sv, caps.glTexCoord4iv, + caps.glTexCoord4dv, caps.glTexCoordPointer, caps.glTexEnvi, caps.glTexEnviv, caps.glTexEnvf, caps.glTexEnvfv, caps.glTexGeni, caps.glTexGeniv, + caps.glTexGenf, caps.glTexGenfv, caps.glTexGend, caps.glTexGendv, caps.glTranslatef, caps.glTranslated, caps.glVertex2f, caps.glVertex2s, + caps.glVertex2i, caps.glVertex2d, caps.glVertex2fv, caps.glVertex2sv, caps.glVertex2iv, caps.glVertex2dv, caps.glVertex3f, caps.glVertex3s, + caps.glVertex3i, caps.glVertex3d, caps.glVertex3fv, caps.glVertex3sv, caps.glVertex3iv, caps.glVertex3dv, caps.glVertex4f, caps.glVertex4s, + caps.glVertex4i, caps.glVertex4d, caps.glVertex4fv, caps.glVertex4sv, caps.glVertex4iv, caps.glVertex4dv, caps.glVertexPointer + )) && checkFunctions( + caps.glEnable, caps.glDisable, caps.glBindTexture, caps.glBlendFunc, caps.glClear, caps.glClearColor, caps.glClearDepth, caps.glClearStencil, + caps.glColorMask, caps.glCullFace, caps.glDepthFunc, caps.glDepthMask, caps.glDepthRange, + ext.contains("GL_NV_vertex_buffer_unified_memory") ? caps.glDisableClientState : -1L, caps.glDrawArrays, caps.glDrawBuffer, caps.glDrawElements, + ext.contains("GL_NV_vertex_buffer_unified_memory") ? caps.glEnableClientState : -1L, caps.glFinish, caps.glFlush, caps.glFrontFace, + caps.glGenTextures, caps.glDeleteTextures, caps.glGetBooleanv, caps.glGetFloatv, caps.glGetIntegerv, caps.glGetDoublev, caps.glGetError, + caps.glGetPointerv, caps.glGetString, caps.glGetTexImage, caps.glGetTexLevelParameteriv, caps.glGetTexLevelParameterfv, caps.glGetTexParameteriv, + caps.glGetTexParameterfv, caps.glHint, caps.glIsEnabled, caps.glIsTexture, caps.glLineWidth, caps.glLogicOp, caps.glPixelStorei, caps.glPixelStoref, + caps.glPointSize, caps.glPolygonMode, caps.glPolygonOffset, caps.glReadBuffer, caps.glReadPixels, caps.glScissor, caps.glStencilFunc, + caps.glStencilMask, caps.glStencilOp, caps.glTexImage1D, caps.glTexImage2D, caps.glCopyTexImage1D, caps.glCopyTexImage2D, caps.glCopyTexSubImage1D, + caps.glCopyTexSubImage2D, caps.glTexParameteri, caps.glTexParameteriv, caps.glTexParameterf, caps.glTexParameterfv, caps.glTexSubImage1D, + caps.glTexSubImage2D, caps.glViewport + ); + } + + // --- [ glEnable ] --- + + /** + * Enables the specified OpenGL state. + * + * @param target the OpenGL state to enable + * + * @see Reference Page + */ + public static void glEnable(@NativeType("GLenum") int target) { + GL11C.glEnable(target); + } + + // --- [ glDisable ] --- + + /** + * Disables the specified OpenGL state. + * + * @param target the OpenGL state to disable + * + * @see Reference Page + */ + public static void glDisable(@NativeType("GLenum") int target) { + GL11C.glDisable(target); + } + + // --- [ glAccum ] --- + + /** + * Each portion of a pixel in the accumulation buffer consists of four values: one for each of R, G, B, and A. The accumulation buffer is controlled + * exclusively through the use of this method (except for clearing it). + * + * @param op a symbolic constant indicating an accumulation buffer operation + * @param value a floating-point value to be used in that operation. One of:
{@link #GL_ACCUM ACCUM}{@link #GL_LOAD LOAD}{@link #GL_RETURN RETURN}{@link #GL_MULT MULT}{@link #GL_ADD ADD}
+ * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glAccum(@NativeType("GLenum") int op, @NativeType("GLfloat") float value); + + // --- [ glAlphaFunc ] --- + + /** + * The alpha test discards a fragment conditionally based on the outcome of a comparison between the incoming fragment’s alpha value and a constant value. + * The comparison is enabled or disabled with the generic {@link #glEnable Enable} and {@link #glDisable Disable} commands using the symbolic constant {@link #GL_ALPHA_TEST ALPHA_TEST}. + * When disabled, it is as if the comparison always passes. The test is controlled with this method. + * + * @param func a symbolic constant indicating the alpha test function. One of:
{@link #GL_NEVER NEVER}{@link #GL_ALWAYS ALWAYS}{@link #GL_LESS LESS}{@link #GL_LEQUAL LEQUAL}{@link #GL_EQUAL EQUAL}{@link #GL_GEQUAL GEQUAL}{@link #GL_GREATER GREATER}{@link #GL_NOTEQUAL NOTEQUAL}
+ * @param ref a reference value clamped to the range [0, 1]. When performing the alpha test, the GL will convert the reference value to the same representation as the fragment's alpha value (floating-point or fixed-point). + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glAlphaFunc(@NativeType("GLenum") int func, @NativeType("GLfloat") float ref); + + // --- [ glAreTexturesResident ] --- + + /** + * Unsafe version of: {@link #glAreTexturesResident AreTexturesResident} + * + * @param n the number of texture objects in {@code textures} + */ + public static native boolean nglAreTexturesResident(int n, long textures, long residences); + + /** + * Returns {@link #GL_TRUE TRUE} if all of the texture objects named in textures are resident, or if the implementation does not distinguish a working set. If + * at least one of the texture objects named in textures is not resident, then {@link #GL_FALSE FALSE} is returned, and the residence of each texture object is + * returned in residences. Otherwise the contents of residences are not changed. + * + * @param textures an array of texture objects + * @param residences returns the residences of each texture object + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + @NativeType("GLboolean") + public static boolean glAreTexturesResident(@NativeType("GLuint const *") IntBuffer textures, @NativeType("GLboolean *") ByteBuffer residences) { + if (CHECKS) { + check(residences, textures.remaining()); + } + return nglAreTexturesResident(textures.remaining(), memAddress(textures), memAddress(residences)); + } + + /** + * Returns {@link #GL_TRUE TRUE} if all of the texture objects named in textures are resident, or if the implementation does not distinguish a working set. If + * at least one of the texture objects named in textures is not resident, then {@link #GL_FALSE FALSE} is returned, and the residence of each texture object is + * returned in residences. Otherwise the contents of residences are not changed. + * + * @param residences returns the residences of each texture object + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + @NativeType("GLboolean") + public static boolean glAreTexturesResident(@NativeType("GLuint const *") int texture, @NativeType("GLboolean *") ByteBuffer residences) { + if (CHECKS) { + check(residences, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer textures = stack.ints(texture); + return nglAreTexturesResident(1, memAddress(textures), memAddress(residences)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glArrayElement ] --- + + /** + * Transfers the ith element of every enabled, non-instanced array, and the first element of every enabled, instanced array to the GL. + * + * @param i the element to transfer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glArrayElement(@NativeType("GLint") int i); + + // --- [ glBegin ] --- + + /** + * Begins the definition of vertex attributes of a sequence of primitives to be transferred to the GL. + * + * @param mode the primitive type being defined. One of:
{@link #GL_POINTS POINTS}{@link #GL_LINE_STRIP LINE_STRIP}{@link #GL_LINE_LOOP LINE_LOOP}{@link #GL_LINES LINES}{@link #GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link #GL_TRIANGLE_FAN TRIANGLE_FAN}{@link #GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link #GL_POLYGON POLYGON}{@link #GL_QUADS QUADS}
{@link #GL_QUAD_STRIP QUAD_STRIP}
+ * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glBegin(@NativeType("GLenum") int mode); + + // --- [ glBindTexture ] --- + + /** + * Binds the a texture to a texture target. + * + *

While a texture object is bound, GL operations on the target to which it is bound affect the bound object, and queries of the target to which it is + * bound return state from the bound object. If texture mapping of the dimensionality of the target to which a texture object is bound is enabled, the + * state of the bound texture object directs the texturing operation.

+ * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param texture the texture object to bind + * + * @see Reference Page + */ + public static void glBindTexture(@NativeType("GLenum") int target, @NativeType("GLuint") int texture) { + GL11C.glBindTexture(target, texture); + } + + // --- [ glBitmap ] --- + + /** Unsafe version of: {@link #glBitmap Bitmap} */ + public static native void nglBitmap(int w, int h, float xOrig, float yOrig, float xInc, float yInc, long data); + + /** + * Sents a bitmap to the GL. Bitmaps are rectangles of zeros and ones specifying a particular pattern of fragments to be produced. Each of these fragments + * has the same associated data. These data are those associated with the current raster position. + * + * @param w the bitmap width + * @param h the bitmap width + * @param xOrig the bitmap origin x coordinate + * @param yOrig the bitmap origin y coordinate + * @param xInc the x increment added to the raster position + * @param yInc the y increment added to the raster position + * @param data the buffer containing the bitmap data. + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glBitmap(@NativeType("GLsizei") int w, @NativeType("GLsizei") int h, @NativeType("GLfloat") float xOrig, @NativeType("GLfloat") float yOrig, @NativeType("GLfloat") float xInc, @NativeType("GLfloat") float yInc, @Nullable @NativeType("GLubyte const *") ByteBuffer data) { + if (CHECKS) { + checkSafe(data, ((w + 7) >> 3) * h); + } + nglBitmap(w, h, xOrig, yOrig, xInc, yInc, memAddressSafe(data)); + } + + /** + * Sents a bitmap to the GL. Bitmaps are rectangles of zeros and ones specifying a particular pattern of fragments to be produced. Each of these fragments + * has the same associated data. These data are those associated with the current raster position. + * + * @param w the bitmap width + * @param h the bitmap width + * @param xOrig the bitmap origin x coordinate + * @param yOrig the bitmap origin y coordinate + * @param xInc the x increment added to the raster position + * @param yInc the y increment added to the raster position + * @param data the buffer containing the bitmap data. + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glBitmap(@NativeType("GLsizei") int w, @NativeType("GLsizei") int h, @NativeType("GLfloat") float xOrig, @NativeType("GLfloat") float yOrig, @NativeType("GLfloat") float xInc, @NativeType("GLfloat") float yInc, @Nullable @NativeType("GLubyte const *") long data) { + nglBitmap(w, h, xOrig, yOrig, xInc, yInc, data); + } + + // --- [ glBlendFunc ] --- + + /** + * Specifies the weighting factors used by the blend equation, for both RGB and alpha functions and for all draw buffers. + * + * @param sfactor the source weighting factor. One of:
{@link GL11C#GL_ZERO ZERO}{@link GL11C#GL_ONE ONE}{@link GL11C#GL_SRC_COLOR SRC_COLOR}{@link GL11C#GL_ONE_MINUS_SRC_COLOR ONE_MINUS_SRC_COLOR}{@link GL11C#GL_DST_COLOR DST_COLOR}
{@link GL11C#GL_ONE_MINUS_DST_COLOR ONE_MINUS_DST_COLOR}{@link GL11C#GL_SRC_ALPHA SRC_ALPHA}{@link GL11C#GL_ONE_MINUS_SRC_ALPHA ONE_MINUS_SRC_ALPHA}{@link GL11C#GL_DST_ALPHA DST_ALPHA}{@link GL11C#GL_ONE_MINUS_DST_ALPHA ONE_MINUS_DST_ALPHA}
{@link GL14#GL_CONSTANT_COLOR CONSTANT_COLOR}{@link GL14#GL_ONE_MINUS_CONSTANT_COLOR ONE_MINUS_CONSTANT_COLOR}{@link GL14#GL_CONSTANT_ALPHA CONSTANT_ALPHA}{@link GL14#GL_ONE_MINUS_CONSTANT_ALPHA ONE_MINUS_CONSTANT_ALPHA}{@link GL11C#GL_SRC_ALPHA_SATURATE SRC_ALPHA_SATURATE}
{@link GL33#GL_SRC1_COLOR SRC1_COLOR}{@link GL33#GL_ONE_MINUS_SRC1_COLOR ONE_MINUS_SRC1_COLOR}{@link GL15#GL_SRC1_ALPHA SRC1_ALPHA}{@link GL33#GL_ONE_MINUS_SRC1_ALPHA ONE_MINUS_SRC1_ALPHA}
+ * @param dfactor the destination weighting factor + * + * @see Reference Page + */ + public static void glBlendFunc(@NativeType("GLenum") int sfactor, @NativeType("GLenum") int dfactor) { + GL11C.glBlendFunc(sfactor, dfactor); + } + + // --- [ glCallList ] --- + + /** + * Executes a display list. Causes the commands saved in the display list to be executed, in order, just as if they were issued without using a display list. + * + * @param list the index of the display list to be called + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glCallList(@NativeType("GLuint") int list); + + // --- [ glCallLists ] --- + + /** + * Unsafe version of: {@link #glCallLists CallLists} + * + * @param n the number of display lists to be called + * @param type the data type of each element in {@code lists}. One of:
{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_SHORT SHORT}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_INT INT}{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_FLOAT FLOAT}{@link #GL_2_BYTES 2_BYTES}{@link #GL_3_BYTES 3_BYTES}{@link #GL_4_BYTES 4_BYTES}
+ */ + public static native void nglCallLists(int n, int type, long lists); + + /** + * Provides an efficient means for executing a number of display lists. + * + * @param type the data type of each element in {@code lists}. One of:
{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_SHORT SHORT}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_INT INT}{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_FLOAT FLOAT}{@link #GL_2_BYTES 2_BYTES}{@link #GL_3_BYTES 3_BYTES}{@link #GL_4_BYTES 4_BYTES}
+ * @param lists an array of offsets. Each offset is added to the display list base to obtain the display list number. + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glCallLists(@NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer lists) { + nglCallLists(lists.remaining() / GLChecks.typeToBytes(type), type, memAddress(lists)); + } + + /** + * Provides an efficient means for executing a number of display lists. + * + * @param lists an array of offsets. Each offset is added to the display list base to obtain the display list number. + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glCallLists(@NativeType("void const *") ByteBuffer lists) { + nglCallLists(lists.remaining(), GL11.GL_UNSIGNED_BYTE, memAddress(lists)); + } + + /** + * Provides an efficient means for executing a number of display lists. + * + * @param lists an array of offsets. Each offset is added to the display list base to obtain the display list number. + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glCallLists(@NativeType("void const *") ShortBuffer lists) { + nglCallLists(lists.remaining(), GL11.GL_UNSIGNED_SHORT, memAddress(lists)); + } + + /** + * Provides an efficient means for executing a number of display lists. + * + * @param lists an array of offsets. Each offset is added to the display list base to obtain the display list number. + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glCallLists(@NativeType("void const *") IntBuffer lists) { + nglCallLists(lists.remaining(), GL11.GL_UNSIGNED_INT, memAddress(lists)); + } + + // --- [ glClear ] --- + + /** + * Sets portions of every pixel in a particular buffer to the same value. The value to which each buffer is cleared depends on the setting of the clear + * value for that buffer. + * + * @param mask Zero or the bitwise OR of one or more values indicating which buffers are to be cleared. One or more of:
{@link GL11C#GL_COLOR_BUFFER_BIT COLOR_BUFFER_BIT}{@link GL11C#GL_DEPTH_BUFFER_BIT DEPTH_BUFFER_BIT}{@link GL11C#GL_STENCIL_BUFFER_BIT STENCIL_BUFFER_BIT}
+ * + * @see Reference Page + */ + public static void glClear(@NativeType("GLbitfield") int mask) { + GL11C.glClear(mask); + } + + // --- [ glClearAccum ] --- + + /** + * Sets the clear values for the accumulation buffer. These values are clamped to the range [-1,1] when they are specified. + * + * @param red the value to which to clear the R values of the accumulation buffer + * @param green the value to which to clear the G values of the accumulation buffer + * @param blue the value to which to clear the B values of the accumulation buffer + * @param alpha the value to which to clear the A values of the accumulation buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glClearAccum(@NativeType("GLfloat") float red, @NativeType("GLfloat") float green, @NativeType("GLfloat") float blue, @NativeType("GLfloat") float alpha); + + // --- [ glClearColor ] --- + + /** + * Sets the clear value for fixed-point and floating-point color buffers in RGBA mode. The specified components are stored as floating-point values. + * + * @param red the value to which to clear the R channel of the color buffer + * @param green the value to which to clear the G channel of the color buffer + * @param blue the value to which to clear the B channel of the color buffer + * @param alpha the value to which to clear the A channel of the color buffer + * + * @see Reference Page + */ + public static void glClearColor(@NativeType("GLfloat") float red, @NativeType("GLfloat") float green, @NativeType("GLfloat") float blue, @NativeType("GLfloat") float alpha) { + GL11C.glClearColor(red, green, blue, alpha); + } + + // --- [ glClearDepth ] --- + + /** + * Sets the depth value used when clearing the depth buffer. When clearing a fixedpoint depth buffer, {@code depth} is clamped to the range [0,1] and + * converted to fixed-point. No conversion is applied when clearing a floating-point depth buffer. + * + * @param depth the value to which to clear the depth buffer + * + * @see Reference Page + */ + public static void glClearDepth(@NativeType("GLdouble") double depth) { + GL11C.glClearDepth(depth); + } + + // --- [ glClearIndex ] --- + + /** + * sets the clear color index. index is converted to a fixed-point value with unspecified precision to the left of the binary point; the integer part of + * this value is then masked with 2m – 1, where {@code m} is the number of bits in a color index value stored in the + * framebuffer. + * + * @param index the value to which to clear the color buffer in color index mode + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glClearIndex(@NativeType("GLfloat") float index); + + // --- [ glClearStencil ] --- + + /** + * Sets the value to which to clear the stencil buffer. {@code s} is masked to the number of bitplanes in the stencil buffer. + * + * @param s the value to which to clear the stencil buffer + * + * @see Reference Page + */ + public static void glClearStencil(@NativeType("GLint") int s) { + GL11C.glClearStencil(s); + } + + // --- [ glClipPlane ] --- + + /** Unsafe version of: {@link #glClipPlane ClipPlane} */ + public static native void nglClipPlane(int plane, long equation); + + /** + * Specifies a client-defined clip plane. + * + *

The value of the first argument, {@code plane}, is a symbolic constant, CLIP_PLANEi, where i is an integer between 0 and n – 1, indicating one of + * n client-defined clip planes. {@code equation} is an array of four double-precision floating-point values. These are the coefficients of a plane + * equation in object coordinates: p1, p2, p3, and p4 (in that order).

+ * + * @param plane the clip plane to define + * @param equation the clip plane coefficients + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glClipPlane(@NativeType("GLenum") int plane, @NativeType("GLdouble const *") DoubleBuffer equation) { + if (CHECKS) { + check(equation, 4); + } + nglClipPlane(plane, memAddress(equation)); + } + + // --- [ glColor3b ] --- + + /** + * Sets the R, G, and B components of the current color. The alpha component is set to 1.0. + * + * @param red the red component of the current color + * @param green the green component of the current color + * @param blue the blue component of the current color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glColor3b(@NativeType("GLbyte") byte red, @NativeType("GLbyte") byte green, @NativeType("GLbyte") byte blue); + + // --- [ glColor3s ] --- + + /** + * Short version of {@link #glColor3b Color3b} + * + * @param red the red component of the current color + * @param green the green component of the current color + * @param blue the blue component of the current color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glColor3s(@NativeType("GLshort") short red, @NativeType("GLshort") short green, @NativeType("GLshort") short blue); + + // --- [ glColor3i ] --- + + /** + * Integer version of {@link #glColor3b Color3b} + * + * @param red the red component of the current color + * @param green the green component of the current color + * @param blue the blue component of the current color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glColor3i(@NativeType("GLint") int red, @NativeType("GLint") int green, @NativeType("GLint") int blue); + + // --- [ glColor3f ] --- + + /** + * Float version of {@link #glColor3b Color3b} + * + * @param red the red component of the current color + * @param green the green component of the current color + * @param blue the blue component of the current color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glColor3f(@NativeType("GLfloat") float red, @NativeType("GLfloat") float green, @NativeType("GLfloat") float blue); + + // --- [ glColor3d ] --- + + /** + * Double version of {@link #glColor3b Color3b} + * + * @param red the red component of the current color + * @param green the green component of the current color + * @param blue the blue component of the current color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glColor3d(@NativeType("GLdouble") double red, @NativeType("GLdouble") double green, @NativeType("GLdouble") double blue); + + // --- [ glColor3ub ] --- + + /** + * Unsigned version of {@link #glColor3b Color3b} + * + * @param red the red component of the current color + * @param green the green component of the current color + * @param blue the blue component of the current color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glColor3ub(@NativeType("GLubyte") byte red, @NativeType("GLubyte") byte green, @NativeType("GLubyte") byte blue); + + // --- [ glColor3us ] --- + + /** + * Unsigned short version of {@link #glColor3b Color3b} + * + * @param red the red component of the current color + * @param green the green component of the current color + * @param blue the blue component of the current color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glColor3us(@NativeType("GLushort") short red, @NativeType("GLushort") short green, @NativeType("GLushort") short blue); + + // --- [ glColor3ui ] --- + + /** + * Unsigned int version of {@link #glColor3b Color3b} + * + * @param red the red component of the current color + * @param green the green component of the current color + * @param blue the blue component of the current color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glColor3ui(@NativeType("GLint") int red, @NativeType("GLint") int green, @NativeType("GLint") int blue); + + // --- [ glColor3bv ] --- + + /** Unsafe version of: {@link #glColor3bv Color3bv} */ + public static native void nglColor3bv(long v); + + /** + * Byte pointer version of {@link #glColor3b Color3b}. + * + * @param v the color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor3bv(@NativeType("GLbyte const *") ByteBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglColor3bv(memAddress(v)); + } + + // --- [ glColor3sv ] --- + + /** Unsafe version of: {@link #glColor3sv Color3sv} */ + public static native void nglColor3sv(long v); + + /** + * Pointer version of {@link #glColor3s Color3s}. + * + * @param v the color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor3sv(@NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglColor3sv(memAddress(v)); + } + + // --- [ glColor3iv ] --- + + /** Unsafe version of: {@link #glColor3iv Color3iv} */ + public static native void nglColor3iv(long v); + + /** + * Pointer version of {@link #glColor3i Color3i}. + * + * @param v the color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor3iv(@NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglColor3iv(memAddress(v)); + } + + // --- [ glColor3fv ] --- + + /** Unsafe version of: {@link #glColor3fv Color3fv} */ + public static native void nglColor3fv(long v); + + /** + * Pointer version of {@link #glColor3f Color3f}. + * + * @param v the color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor3fv(@NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglColor3fv(memAddress(v)); + } + + // --- [ glColor3dv ] --- + + /** Unsafe version of: {@link #glColor3dv Color3dv} */ + public static native void nglColor3dv(long v); + + /** + * Pointer version of {@link #glColor3d Color3d}. + * + * @param v the color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor3dv(@NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglColor3dv(memAddress(v)); + } + + // --- [ glColor3ubv ] --- + + /** Unsafe version of: {@link #glColor3ubv Color3ubv} */ + public static native void nglColor3ubv(long v); + + /** + * Pointer version of {@link #glColor3ub Color3ub}. + * + * @param v the color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor3ubv(@NativeType("GLubyte const *") ByteBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglColor3ubv(memAddress(v)); + } + + // --- [ glColor3usv ] --- + + /** Unsafe version of: {@link #glColor3usv Color3usv} */ + public static native void nglColor3usv(long v); + + /** + * Pointer version of {@link #glColor3us Color3us}. + * + * @param v the color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor3usv(@NativeType("GLushort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglColor3usv(memAddress(v)); + } + + // --- [ glColor3uiv ] --- + + /** Unsafe version of: {@link #glColor3uiv Color3uiv} */ + public static native void nglColor3uiv(long v); + + /** + * Pointer version of {@link #glColor3ui Color3ui}. + * + * @param v the color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor3uiv(@NativeType("GLuint const *") IntBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglColor3uiv(memAddress(v)); + } + + // --- [ glColor4b ] --- + + /** + * Sets the current color. + * + * @param red the red component of the current color + * @param green the green component of the current color + * @param blue the blue component of the current color + * @param alpha the alpha component of the current color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glColor4b(@NativeType("GLbyte") byte red, @NativeType("GLbyte") byte green, @NativeType("GLbyte") byte blue, @NativeType("GLbyte") byte alpha); + + // --- [ glColor4s ] --- + + /** + * Short version of {@link #glColor4b Color4b} + * + * @param red the red component of the current color + * @param green the green component of the current color + * @param blue the blue component of the current color + * @param alpha the alpha component of the current color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glColor4s(@NativeType("GLshort") short red, @NativeType("GLshort") short green, @NativeType("GLshort") short blue, @NativeType("GLshort") short alpha); + + // --- [ glColor4i ] --- + + /** + * Integer version of {@link #glColor4b Color4b} + * + * @param red the red component of the current color + * @param green the green component of the current color + * @param blue the blue component of the current color + * @param alpha the alpha component of the current color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glColor4i(@NativeType("GLint") int red, @NativeType("GLint") int green, @NativeType("GLint") int blue, @NativeType("GLint") int alpha); + + // --- [ glColor4f ] --- + + /** + * Float version of {@link #glColor4b Color4b} + * + * @param red the red component of the current color + * @param green the green component of the current color + * @param blue the blue component of the current color + * @param alpha the alpha component of the current color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glColor4f(@NativeType("GLfloat") float red, @NativeType("GLfloat") float green, @NativeType("GLfloat") float blue, @NativeType("GLfloat") float alpha); + + // --- [ glColor4d ] --- + + /** + * Double version of {@link #glColor4b Color4b} + * + * @param red the red component of the current color + * @param green the green component of the current color + * @param blue the blue component of the current color + * @param alpha the alpha component of the current color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glColor4d(@NativeType("GLdouble") double red, @NativeType("GLdouble") double green, @NativeType("GLdouble") double blue, @NativeType("GLdouble") double alpha); + + // --- [ glColor4ub ] --- + + /** + * Unsigned version of {@link #glColor4b Color4b} + * + * @param red the red component of the current color + * @param green the green component of the current color + * @param blue the blue component of the current color + * @param alpha the alpha component of the current color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glColor4ub(@NativeType("GLubyte") byte red, @NativeType("GLubyte") byte green, @NativeType("GLubyte") byte blue, @NativeType("GLubyte") byte alpha); + + // --- [ glColor4us ] --- + + /** + * Unsigned short version of {@link #glColor4b Color4b} + * + * @param red the red component of the current color + * @param green the green component of the current color + * @param blue the blue component of the current color + * @param alpha the alpha component of the current color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glColor4us(@NativeType("GLushort") short red, @NativeType("GLushort") short green, @NativeType("GLushort") short blue, @NativeType("GLushort") short alpha); + + // --- [ glColor4ui ] --- + + /** + * Unsigned int version of {@link #glColor4b Color4b} + * + * @param red the red component of the current color + * @param green the green component of the current color + * @param blue the blue component of the current color + * @param alpha the alpha component of the current color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glColor4ui(@NativeType("GLint") int red, @NativeType("GLint") int green, @NativeType("GLint") int blue, @NativeType("GLint") int alpha); + + // --- [ glColor4bv ] --- + + /** Unsafe version of: {@link #glColor4bv Color4bv} */ + public static native void nglColor4bv(long v); + + /** + * Pointer version of {@link #glColor4b Color4b}. + * + * @param v the color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor4bv(@NativeType("GLbyte const *") ByteBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglColor4bv(memAddress(v)); + } + + // --- [ glColor4sv ] --- + + /** Unsafe version of: {@link #glColor4sv Color4sv} */ + public static native void nglColor4sv(long v); + + /** + * Pointer version of {@link #glColor4s Color4s}. + * + * @param v the color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor4sv(@NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglColor4sv(memAddress(v)); + } + + // --- [ glColor4iv ] --- + + /** Unsafe version of: {@link #glColor4iv Color4iv} */ + public static native void nglColor4iv(long v); + + /** + * Pointer version of {@link #glColor4i Color4i}. + * + * @param v the color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor4iv(@NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglColor4iv(memAddress(v)); + } + + // --- [ glColor4fv ] --- + + /** Unsafe version of: {@link #glColor4fv Color4fv} */ + public static native void nglColor4fv(long v); + + /** + * Pointer version of {@link #glColor4f Color4f}. + * + * @param v the color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor4fv(@NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglColor4fv(memAddress(v)); + } + + // --- [ glColor4dv ] --- + + /** Unsafe version of: {@link #glColor4dv Color4dv} */ + public static native void nglColor4dv(long v); + + /** + * Pointer version of {@link #glColor4d Color4d}. + * + * @param v the color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor4dv(@NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglColor4dv(memAddress(v)); + } + + // --- [ glColor4ubv ] --- + + /** Unsafe version of: {@link #glColor4ubv Color4ubv} */ + public static native void nglColor4ubv(long v); + + /** + * Pointer version of {@link #glColor4ub Color4ub}. + * + * @param v the color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor4ubv(@NativeType("GLubyte const *") ByteBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglColor4ubv(memAddress(v)); + } + + // --- [ glColor4usv ] --- + + /** Unsafe version of: {@link #glColor4usv Color4usv} */ + public static native void nglColor4usv(long v); + + /** + * Pointer version of {@link #glColor4us Color4us}. + * + * @param v the color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor4usv(@NativeType("GLushort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglColor4usv(memAddress(v)); + } + + // --- [ glColor4uiv ] --- + + /** Unsafe version of: {@link #glColor4uiv Color4uiv} */ + public static native void nglColor4uiv(long v); + + /** + * Pointer version of {@link #glColor4ui Color4ui}. + * + * @param v the color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor4uiv(@NativeType("GLuint const *") IntBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglColor4uiv(memAddress(v)); + } + + // --- [ glColorMask ] --- + + /** + * Masks the writing of R, G, B and A values to all draw buffers. In the initial state, all color values are enabled for writing for all draw buffers. + * + * @param red whether R values are written or not + * @param green whether G values are written or not + * @param blue whether B values are written or not + * @param alpha whether A values are written or not + * + * @see Reference Page + */ + public static void glColorMask(@NativeType("GLboolean") boolean red, @NativeType("GLboolean") boolean green, @NativeType("GLboolean") boolean blue, @NativeType("GLboolean") boolean alpha) { + GL11C.glColorMask(red, green, blue, alpha); + } + + // --- [ glColorMaterial ] --- + + /** + * It is possible to attach one or more material properties to the current color, so that they continuously track its component values. This behavior is + * enabled and disabled by calling {@link #glEnable Enable} or {@link #glDisable Disable} with the symbolic value {@link #GL_COLOR_MATERIAL COLOR_MATERIAL}. This function controls which + * of these modes is selected. + * + * @param face specifies which material face is affected by the current color. One of:
{@link #GL_FRONT FRONT}{@link #GL_BACK BACK}{@link #GL_FRONT_AND_BACK FRONT_AND_BACK}
+ * @param mode specifies which material property or properties track the current color. One of:
{@link #GL_EMISSION EMISSION}{@link #GL_AMBIENT AMBIENT}{@link #GL_DIFFUSE DIFFUSE}{@link #GL_SPECULAR SPECULAR}{@link #GL_AMBIENT_AND_DIFFUSE AMBIENT_AND_DIFFUSE}
+ * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glColorMaterial(@NativeType("GLenum") int face, @NativeType("GLenum") int mode); + + // --- [ glColorPointer ] --- + + /** Unsafe version of: {@link #glColorPointer ColorPointer} */ + public static native void nglColorPointer(int size, int type, int stride, long pointer); + + /** + * Specifies the location and organization of a color array. + * + * @param size the number of values per vertex that are stored in the array, as well as their component ordering. One of:
34{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of the values stored in the array. One of:
{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_SHORT SHORT}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_INT INT}{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}
{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the color array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColorPointer(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + nglColorPointer(size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a color array. + * + * @param size the number of values per vertex that are stored in the array, as well as their component ordering. One of:
34{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of the values stored in the array. One of:
{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_SHORT SHORT}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_INT INT}{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}
{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the color array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColorPointer(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + nglColorPointer(size, type, stride, pointer); + } + + /** + * Specifies the location and organization of a color array. + * + * @param size the number of values per vertex that are stored in the array, as well as their component ordering. One of:
34{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of the values stored in the array. One of:
{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_SHORT SHORT}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_INT INT}{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}
{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the color array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColorPointer(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ShortBuffer pointer) { + nglColorPointer(size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a color array. + * + * @param size the number of values per vertex that are stored in the array, as well as their component ordering. One of:
34{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of the values stored in the array. One of:
{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_SHORT SHORT}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_INT INT}{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}
{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the color array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColorPointer(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") IntBuffer pointer) { + nglColorPointer(size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a color array. + * + * @param size the number of values per vertex that are stored in the array, as well as their component ordering. One of:
34{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of the values stored in the array. One of:
{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_SHORT SHORT}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_INT INT}{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}
{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the color array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColorPointer(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") FloatBuffer pointer) { + nglColorPointer(size, type, stride, memAddress(pointer)); + } + + // --- [ glCopyPixels ] --- + + /** + * Transfers a rectangle of pixel values from one region of the read framebuffer to another in the draw framebuffer + * + * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the rectangle width + * @param height the rectangle height + * @param type Indicates the type of values to be transfered. One of:
{@link #GL_COLOR COLOR}{@link #GL_STENCIL STENCIL}{@link #GL_DEPTH DEPTH}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glCopyPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int type); + + // --- [ glCullFace ] --- + + /** + * Specifies which polygon faces are culled if {@link GL11C#GL_CULL_FACE CULL_FACE} is enabled. Front-facing polygons are rasterized if either culling is disabled or the + * CullFace mode is {@link GL11C#GL_BACK BACK} while back-facing polygons are rasterized only if either culling is disabled or the CullFace mode is + * {@link GL11C#GL_FRONT FRONT}. The initial setting of the CullFace mode is {@link GL11C#GL_BACK BACK}. Initially, culling is disabled. + * + * @param mode the CullFace mode. One of:
{@link GL11C#GL_FRONT FRONT}{@link GL11C#GL_BACK BACK}{@link GL11C#GL_FRONT_AND_BACK FRONT_AND_BACK}
+ * + * @see Reference Page + */ + public static void glCullFace(@NativeType("GLenum") int mode) { + GL11C.glCullFace(mode); + } + + // --- [ glDeleteLists ] --- + + /** + * Deletes a contiguous group of display lists. All information about the display lists is lost, and the indices become unused. Indices to which no display + * list corresponds are ignored. If {@code range} is zero, nothing happens. + * + * @param list the index of the first display list to be deleted + * @param range the number of display lists to be deleted + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glDeleteLists(@NativeType("GLuint") int list, @NativeType("GLsizei") int range); + + // --- [ glDepthFunc ] --- + + /** + * Specifies the comparison that takes place during the depth buffer test (when {@link GL11C#GL_DEPTH_TEST DEPTH_TEST} is enabled). + * + * @param func the depth test comparison. One of:
{@link GL11C#GL_NEVER NEVER}{@link GL11C#GL_ALWAYS ALWAYS}{@link GL11C#GL_LESS LESS}{@link GL11C#GL_LEQUAL LEQUAL}{@link GL11C#GL_EQUAL EQUAL}{@link GL11C#GL_GREATER GREATER}{@link GL11C#GL_GEQUAL GEQUAL}{@link GL11C#GL_NOTEQUAL NOTEQUAL}
+ * + * @see Reference Page + */ + public static void glDepthFunc(@NativeType("GLenum") int func) { + GL11C.glDepthFunc(func); + } + + // --- [ glDepthMask ] --- + + /** + * Masks the writing of depth values to the depth buffer. In the initial state, the depth buffer is enabled for writing. + * + * @param flag whether depth values are written or not. + * + * @see Reference Page + */ + public static void glDepthMask(@NativeType("GLboolean") boolean flag) { + GL11C.glDepthMask(flag); + } + + // --- [ glDepthRange ] --- + + /** + * Sets the depth range for all viewports to the same values. + * + * @param zNear the near depth range + * @param zFar the far depth range + * + * @see Reference Page + */ + public static void glDepthRange(@NativeType("GLdouble") double zNear, @NativeType("GLdouble") double zFar) { + GL11C.glDepthRange(zNear, zFar); + } + + // --- [ glDisableClientState ] --- + + /** + * Disables a client-side capability. + * + *

If the {@link NVVertexBufferUnifiedMemory} extension is supported, this function is available even in a core profile context.

+ * + * @param cap the capability to disable. One of:
{@link #GL_COLOR_ARRAY COLOR_ARRAY}{@link #GL_EDGE_FLAG_ARRAY EDGE_FLAG_ARRAY}{@link GL15#GL_FOG_COORD_ARRAY FOG_COORD_ARRAY}{@link #GL_INDEX_ARRAY INDEX_ARRAY}
{@link #GL_NORMAL_ARRAY NORMAL_ARRAY}{@link GL14#GL_SECONDARY_COLOR_ARRAY SECONDARY_COLOR_ARRAY}{@link #GL_TEXTURE_COORD_ARRAY TEXTURE_COORD_ARRAY}{@link #GL_VERTEX_ARRAY VERTEX_ARRAY}
{@link NVVertexBufferUnifiedMemory#GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV VERTEX_ATTRIB_ARRAY_UNIFIED_NV}{@link NVVertexBufferUnifiedMemory#GL_ELEMENT_ARRAY_UNIFIED_NV ELEMENT_ARRAY_UNIFIED_NV}
+ * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glDisableClientState(@NativeType("GLenum") int cap); + + // --- [ glDrawArrays ] --- + + /** + * Constructs a sequence of geometric primitives by successively transferring elements for {@code count} vertices. Elements {@code first} through + * first + count – 1 of each enabled non-instanced array are transferred to the GL. + * + *

If an array corresponding to an attribute required by a vertex shader is not enabled, then the corresponding element is taken from the current attribute + * state. If an array is enabled, the corresponding current vertex attribute value is unaffected by the execution of this function.

+ * + * @param mode the kind of primitives being constructed + * @param first the first vertex to transfer to the GL + * @param count the number of vertices after {@code first} to transfer to the GL + * + * @see Reference Page + */ + public static void glDrawArrays(@NativeType("GLenum") int mode, @NativeType("GLint") int first, @NativeType("GLsizei") int count) { + GL11C.glDrawArrays(mode, first, count); + } + + // --- [ glDrawBuffer ] --- + + /** + * Defines the color buffer to which fragment color zero is written. + * + *

Acceptable values for {@code buf} depend on whether the GL is using the default framebuffer (i.e., {@link GL30#GL_DRAW_FRAMEBUFFER_BINDING DRAW_FRAMEBUFFER_BINDING} is zero), or + * a framebuffer object (i.e., {@link GL30#GL_DRAW_FRAMEBUFFER_BINDING DRAW_FRAMEBUFFER_BINDING} is non-zero). In the initial state, the GL is bound to the default framebuffer.

+ * + * @param buf the color buffer to draw to. One of:
{@link GL11C#GL_NONE NONE}{@link GL11C#GL_FRONT_LEFT FRONT_LEFT}{@link GL11C#GL_FRONT_RIGHT FRONT_RIGHT}{@link GL11C#GL_BACK_LEFT BACK_LEFT}{@link GL11C#GL_BACK_RIGHT BACK_RIGHT}{@link GL11C#GL_FRONT FRONT}{@link GL11C#GL_BACK BACK}{@link GL11C#GL_LEFT LEFT}
{@link GL11C#GL_RIGHT RIGHT}{@link GL11C#GL_FRONT_AND_BACK FRONT_AND_BACK}{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}GL30.GL_COLOR_ATTACHMENT[1-15]
+ * + * @see Reference Page + */ + public static void glDrawBuffer(@NativeType("GLenum") int buf) { + GL11C.glDrawBuffer(buf); + } + + // --- [ glDrawElements ] --- + + /** + * Unsafe version of: {@link #glDrawElements DrawElements} + * + * @param count the number of vertices to transfer to the GL + * @param type indicates the type of index values in {@code indices}. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static void nglDrawElements(int mode, int count, int type, long indices) { + GL11C.nglDrawElements(mode, count, type, indices); + } + + /** + * Constructs a sequence of geometric primitives by successively transferring elements for {@code count} vertices to the GL. + * The ith element transferred by {@code DrawElements} will be taken from element {@code indices[i]} (if no element array buffer is bound), or + * from the element whose index is stored in the currently bound element array buffer at offset {@code indices + i}. + * + * @param mode the kind of primitives being constructed. One of:
{@link GL11C#GL_POINTS POINTS}{@link GL11C#GL_LINE_STRIP LINE_STRIP}{@link GL11C#GL_LINE_LOOP LINE_LOOP}{@link GL11C#GL_LINES LINES}{@link GL11C#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11C#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11C#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param count the number of vertices to transfer to the GL + * @param type indicates the type of index values in {@code indices}. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices the index values + * + * @see Reference Page + */ + public static void glDrawElements(@NativeType("GLenum") int mode, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices) { + GL11C.glDrawElements(mode, count, type, indices); + } + + /** + * Constructs a sequence of geometric primitives by successively transferring elements for {@code count} vertices to the GL. + * The ith element transferred by {@code DrawElements} will be taken from element {@code indices[i]} (if no element array buffer is bound), or + * from the element whose index is stored in the currently bound element array buffer at offset {@code indices + i}. + * + * @param mode the kind of primitives being constructed. One of:
{@link GL11C#GL_POINTS POINTS}{@link GL11C#GL_LINE_STRIP LINE_STRIP}{@link GL11C#GL_LINE_LOOP LINE_LOOP}{@link GL11C#GL_LINES LINES}{@link GL11C#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11C#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11C#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param type indicates the type of index values in {@code indices}. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices the index values + * + * @see Reference Page + */ + public static void glDrawElements(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices) { + GL11C.glDrawElements(mode, type, indices); + } + + /** + * Constructs a sequence of geometric primitives by successively transferring elements for {@code count} vertices to the GL. + * The ith element transferred by {@code DrawElements} will be taken from element {@code indices[i]} (if no element array buffer is bound), or + * from the element whose index is stored in the currently bound element array buffer at offset {@code indices + i}. + * + * @param mode the kind of primitives being constructed. One of:
{@link GL11C#GL_POINTS POINTS}{@link GL11C#GL_LINE_STRIP LINE_STRIP}{@link GL11C#GL_LINE_LOOP LINE_LOOP}{@link GL11C#GL_LINES LINES}{@link GL11C#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11C#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11C#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param indices the index values + * + * @see Reference Page + */ + public static void glDrawElements(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indices) { + GL11C.glDrawElements(mode, indices); + } + + /** + * Constructs a sequence of geometric primitives by successively transferring elements for {@code count} vertices to the GL. + * The ith element transferred by {@code DrawElements} will be taken from element {@code indices[i]} (if no element array buffer is bound), or + * from the element whose index is stored in the currently bound element array buffer at offset {@code indices + i}. + * + * @param mode the kind of primitives being constructed. One of:
{@link GL11C#GL_POINTS POINTS}{@link GL11C#GL_LINE_STRIP LINE_STRIP}{@link GL11C#GL_LINE_LOOP LINE_LOOP}{@link GL11C#GL_LINES LINES}{@link GL11C#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11C#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11C#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param indices the index values + * + * @see Reference Page + */ + public static void glDrawElements(@NativeType("GLenum") int mode, @NativeType("void const *") ShortBuffer indices) { + GL11C.glDrawElements(mode, indices); + } + + /** + * Constructs a sequence of geometric primitives by successively transferring elements for {@code count} vertices to the GL. + * The ith element transferred by {@code DrawElements} will be taken from element {@code indices[i]} (if no element array buffer is bound), or + * from the element whose index is stored in the currently bound element array buffer at offset {@code indices + i}. + * + * @param mode the kind of primitives being constructed. One of:
{@link GL11C#GL_POINTS POINTS}{@link GL11C#GL_LINE_STRIP LINE_STRIP}{@link GL11C#GL_LINE_LOOP LINE_LOOP}{@link GL11C#GL_LINES LINES}{@link GL11C#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11C#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11C#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param indices the index values + * + * @see Reference Page + */ + public static void glDrawElements(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indices) { + GL11C.glDrawElements(mode, indices); + } + + // --- [ glDrawPixels ] --- + + /** Unsafe version of: {@link #glDrawPixels DrawPixels} */ + public static native void nglDrawPixels(int width, int height, int format, int type, long pixels); + + /** + * Draws a pixel rectangle to the active draw buffers. + * + * @param width the pixel rectangle width + * @param height the pixel rectangle height + * @param format the pixel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link #GL_LUMINANCE LUMINANCE}{@link #GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link #GL_BITMAP BITMAP}
+ * @param pixels the pixel data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glDrawPixels(@NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer pixels) { + nglDrawPixels(width, height, format, type, memAddress(pixels)); + } + + /** + * Draws a pixel rectangle to the active draw buffers. + * + * @param width the pixel rectangle width + * @param height the pixel rectangle height + * @param format the pixel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link #GL_LUMINANCE LUMINANCE}{@link #GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link #GL_BITMAP BITMAP}
+ * @param pixels the pixel data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glDrawPixels(@NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long pixels) { + nglDrawPixels(width, height, format, type, pixels); + } + + /** + * Draws a pixel rectangle to the active draw buffers. + * + * @param width the pixel rectangle width + * @param height the pixel rectangle height + * @param format the pixel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link #GL_LUMINANCE LUMINANCE}{@link #GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link #GL_BITMAP BITMAP}
+ * @param pixels the pixel data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glDrawPixels(@NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer pixels) { + nglDrawPixels(width, height, format, type, memAddress(pixels)); + } + + /** + * Draws a pixel rectangle to the active draw buffers. + * + * @param width the pixel rectangle width + * @param height the pixel rectangle height + * @param format the pixel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link #GL_LUMINANCE LUMINANCE}{@link #GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link #GL_BITMAP BITMAP}
+ * @param pixels the pixel data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glDrawPixels(@NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer pixels) { + nglDrawPixels(width, height, format, type, memAddress(pixels)); + } + + /** + * Draws a pixel rectangle to the active draw buffers. + * + * @param width the pixel rectangle width + * @param height the pixel rectangle height + * @param format the pixel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link #GL_LUMINANCE LUMINANCE}{@link #GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link #GL_BITMAP BITMAP}
+ * @param pixels the pixel data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glDrawPixels(@NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer pixels) { + nglDrawPixels(width, height, format, type, memAddress(pixels)); + } + + // --- [ glEdgeFlag ] --- + + /** + * Each edge of each polygon primitive generated is flagged as either boundary or non-boundary. These classifications are used during polygon + * rasterization; some modes affect the interpretation of polygon boundary edges. By default, all edges are boundary edges, but the flagging of polygons, + * separate triangles, or separate quadrilaterals may be altered by calling this function. + * + *

When a primitive of type {@link #GL_POLYGON POLYGON}, {@link #GL_TRIANGLES TRIANGLES}, or {@link #GL_QUADS QUADS} is drawn, each vertex transferred begins an edge. If the edge + * flag bit is TRUE, then each specified vertex begins an edge that is flagged as boundary. If the bit is FALSE, then induced edges are flagged as + * non-boundary.

+ * + * @param flag the edge flag bit + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glEdgeFlag(@NativeType("GLboolean") boolean flag); + + // --- [ glEdgeFlagv ] --- + + /** Unsafe version of: {@link #glEdgeFlagv EdgeFlagv} */ + public static native void nglEdgeFlagv(long flag); + + /** + * Pointer version of {@link #glEdgeFlag EdgeFlag}. + * + * @param flag the edge flag buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glEdgeFlagv(@NativeType("GLboolean const *") ByteBuffer flag) { + if (CHECKS) { + check(flag, 1); + } + nglEdgeFlagv(memAddress(flag)); + } + + // --- [ glEdgeFlagPointer ] --- + + /** Unsafe version of: {@link #glEdgeFlagPointer EdgeFlagPointer} */ + public static native void nglEdgeFlagPointer(int stride, long pointer); + + /** + * Specifies the location and organization of an edge flag array. + * + * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the edge flag array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glEdgeFlagPointer(@NativeType("GLsizei") int stride, @NativeType("GLboolean const *") ByteBuffer pointer) { + nglEdgeFlagPointer(stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of an edge flag array. + * + * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the edge flag array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glEdgeFlagPointer(@NativeType("GLsizei") int stride, @NativeType("GLboolean const *") long pointer) { + nglEdgeFlagPointer(stride, pointer); + } + + // --- [ glEnableClientState ] --- + + /** + * Enables a client-side capability. + * + *

If the {@link NVVertexBufferUnifiedMemory} extension is supported, this function is available even in a core profile context.

+ * + * @param cap the capability to enable. One of:
{@link #GL_COLOR_ARRAY COLOR_ARRAY}{@link #GL_EDGE_FLAG_ARRAY EDGE_FLAG_ARRAY}{@link GL15#GL_FOG_COORD_ARRAY FOG_COORD_ARRAY}{@link #GL_INDEX_ARRAY INDEX_ARRAY}
{@link #GL_NORMAL_ARRAY NORMAL_ARRAY}{@link GL14#GL_SECONDARY_COLOR_ARRAY SECONDARY_COLOR_ARRAY}{@link #GL_TEXTURE_COORD_ARRAY TEXTURE_COORD_ARRAY}{@link #GL_VERTEX_ARRAY VERTEX_ARRAY}
{@link NVVertexBufferUnifiedMemory#GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV VERTEX_ATTRIB_ARRAY_UNIFIED_NV}{@link NVVertexBufferUnifiedMemory#GL_ELEMENT_ARRAY_UNIFIED_NV ELEMENT_ARRAY_UNIFIED_NV}
+ * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glEnableClientState(@NativeType("GLenum") int cap); + + // --- [ glEnd ] --- + + /** + * Ends the definition of vertex attributes of a sequence of primitives to be transferred to the GL. + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glEnd(); + + // --- [ glEvalCoord1f ] --- + + /** + * Causes evaluation of the enabled one-dimensional evaluator maps. + * + * @param u the domain coordinate u + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glEvalCoord1f(@NativeType("GLfloat") float u); + + // --- [ glEvalCoord1fv ] --- + + /** Unsafe version of: {@link #glEvalCoord1fv EvalCoord1fv} */ + public static native void nglEvalCoord1fv(long u); + + /** + * Pointer version of {@link #glEvalCoord1f EvalCoord1f}. + * + * @param u the domain coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glEvalCoord1fv(@NativeType("GLfloat const *") FloatBuffer u) { + if (CHECKS) { + check(u, 1); + } + nglEvalCoord1fv(memAddress(u)); + } + + // --- [ glEvalCoord1d ] --- + + /** + * Double version of {@link #glEvalCoord1f EvalCoord1f}. + * + * @param u the domain coordinate u + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glEvalCoord1d(@NativeType("GLdouble") double u); + + // --- [ glEvalCoord1dv ] --- + + /** Unsafe version of: {@link #glEvalCoord1dv EvalCoord1dv} */ + public static native void nglEvalCoord1dv(long u); + + /** + * Pointer version of {@link #glEvalCoord1d EvalCoord1d}. + * + * @param u the domain coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glEvalCoord1dv(@NativeType("GLdouble const *") DoubleBuffer u) { + if (CHECKS) { + check(u, 1); + } + nglEvalCoord1dv(memAddress(u)); + } + + // --- [ glEvalCoord2f ] --- + + /** + * Causes evaluation of the enabled two-dimensional evaluator maps. + * + * @param u the domain coordinate u + * @param v the domain coordinate v + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glEvalCoord2f(@NativeType("GLfloat") float u, @NativeType("GLfloat") float v); + + // --- [ glEvalCoord2fv ] --- + + /** Unsafe version of: {@link #glEvalCoord2fv EvalCoord2fv} */ + public static native void nglEvalCoord2fv(long u); + + /** + * Pointer version of {@link #glEvalCoord2f EvalCoord2f}. + * + * @param u the domain coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glEvalCoord2fv(@NativeType("GLfloat const *") FloatBuffer u) { + if (CHECKS) { + check(u, 2); + } + nglEvalCoord2fv(memAddress(u)); + } + + // --- [ glEvalCoord2d ] --- + + /** + * Double version of {@link #glEvalCoord2f EvalCoord2f}. + * + * @param u the domain coordinate u + * @param v the domain coordinate v + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glEvalCoord2d(@NativeType("GLdouble") double u, @NativeType("GLdouble") double v); + + // --- [ glEvalCoord2dv ] --- + + /** Unsafe version of: {@link #glEvalCoord2dv EvalCoord2dv} */ + public static native void nglEvalCoord2dv(long u); + + /** + * Pointer version of {@link #glEvalCoord2d EvalCoord2d}. + * + * @param u the domain coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glEvalCoord2dv(@NativeType("GLdouble const *") DoubleBuffer u) { + if (CHECKS) { + check(u, 2); + } + nglEvalCoord2dv(memAddress(u)); + } + + // --- [ glEvalMesh1 ] --- + + /** + * Carries out an evaluation on a subset of the one-dimensional map grid. + * + * @param mode the mesh type. One of:
{@link #GL_POINT POINT}{@link #GL_LINE LINE}
+ * @param i1 the start index + * @param i2 the end index + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glEvalMesh1(@NativeType("GLenum") int mode, @NativeType("GLint") int i1, @NativeType("GLint") int i2); + + // --- [ glEvalMesh2 ] --- + + /** + * Carries out an evaluation on a rectangular subset of the two-dimensional map grid. + * + * @param mode the mesh type. One of:
{@link #GL_FILL FILL}{@link #GL_LINE LINE}{@link #GL_POINT POINT}
+ * @param i1 the u-dimension start index + * @param i2 the u-dimension end index + * @param j1 the v-dimension start index + * @param j2 the v-dimension end index + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glEvalMesh2(@NativeType("GLenum") int mode, @NativeType("GLint") int i1, @NativeType("GLint") int i2, @NativeType("GLint") int j1, @NativeType("GLint") int j2); + + // --- [ glEvalPoint1 ] --- + + /** + * Carries out an evalutation of a single point on the one-dimensional map grid. + * + * @param i the grid index + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glEvalPoint1(@NativeType("GLint") int i); + + // --- [ glEvalPoint2 ] --- + + /** + * Carries out an evalutation of a single point on the two-dimensional map grid. + * + * @param i the u-dimension grid index + * @param j the v-dimension grid index + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glEvalPoint2(@NativeType("GLint") int i, @NativeType("GLint") int j); + + // --- [ glFeedbackBuffer ] --- + + /** + * Unsafe version of: {@link #glFeedbackBuffer FeedbackBuffer} + * + * @param size the maximum number of values that can be written to {@code buffer} + */ + public static native void nglFeedbackBuffer(int size, int type, long buffer); + + /** + * Returns information about primitives when the GL is in feedback mode. + * + * @param type the type of information to feed back for each vertex. One of:
{@link #GL_2D 2D}{@link #GL_3D 3D}{@link #GL_3D_COLOR 3D_COLOR}{@link #GL_3D_COLOR_TEXTURE 3D_COLOR_TEXTURE}{@link #GL_4D_COLOR_TEXTURE 4D_COLOR_TEXTURE}
+ * @param buffer an array of floating-point values into which feedback information will be placed + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glFeedbackBuffer(@NativeType("GLenum") int type, @NativeType("GLfloat *") FloatBuffer buffer) { + nglFeedbackBuffer(buffer.remaining(), type, memAddress(buffer)); + } + + // --- [ glFinish ] --- + + /** + * Forces all previously issued GL commands to complete. {@code Finish} does not return until all effects from such commands on GL client and server + * state and the framebuffer are fully realized. + * + * @see Reference Page + */ + public static void glFinish() { + GL11C.glFinish(); + } + + // --- [ glFlush ] --- + + /** + * Causes all previously issued GL commands to complete in finite time (although such commands may still be executing when {@code Flush} returns). + * + * @see Reference Page + */ + public static void glFlush() { + GL11C.glFlush(); + } + + // --- [ glFogi ] --- + + /** + * Sets the integer value of a fog parameter. + * + * @param pname the fog parameter. One of:
{@link #GL_FOG_MODE FOG_MODE}{@link GL15#GL_FOG_COORD_SRC FOG_COORD_SRC}
+ * @param param the fog parameter value. One of:
{@link #GL_EXP EXP}{@link #GL_EXP2 EXP2}{@link #GL_LINEAR LINEAR}{@link GL14#GL_FRAGMENT_DEPTH FRAGMENT_DEPTH}{@link GL15#GL_FOG_COORD FOG_COORD}
+ * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glFogi(@NativeType("GLenum") int pname, @NativeType("GLint") int param); + + // --- [ glFogiv ] --- + + /** Unsafe version of: {@link #glFogiv Fogiv} */ + public static native void nglFogiv(int pname, long params); + + /** + * Pointer version of {@link #glFogi Fogi}. + * + * @param pname the fog parameter. One of:
{@link #GL_FOG_MODE FOG_MODE}{@link GL15#GL_FOG_COORD_SRC FOG_COORD_SRC}
+ * @param params the fog parameter buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glFogiv(@NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglFogiv(pname, memAddress(params)); + } + + // --- [ glFogf ] --- + + /** + * Sets the float value of a fog parameter. + * + * @param pname the fog parameter. One of:
{@link #GL_FOG_DENSITY FOG_DENSITY}{@link #GL_FOG_START FOG_START}{@link #GL_FOG_END FOG_END}
+ * @param param the fog parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glFogf(@NativeType("GLenum") int pname, @NativeType("GLfloat") float param); + + // --- [ glFogfv ] --- + + /** Unsafe version of: {@link #glFogfv Fogfv} */ + public static native void nglFogfv(int pname, long params); + + /** + * Pointer version of {@link #glFogf Fogf}. + * + * @param pname the fog parameter. One of:
{@link #GL_FOG_DENSITY FOG_DENSITY}{@link #GL_FOG_START FOG_START}{@link #GL_FOG_END FOG_END}
+ * @param params the fog parameter buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glFogfv(@NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglFogfv(pname, memAddress(params)); + } + + // --- [ glFrontFace ] --- + + /** + * The first step of polygon rasterization is to determine if the polygon is back-facing or front-facing. This determination is made based on the sign of + * the (clipped or unclipped) polygon's area computed in window coordinates. The interpretation of the sign of this value is controlled with this function. + * In the initial state, the front face direction is set to {@link GL11C#GL_CCW CCW}. + * + * @param dir the front face direction. One of:
{@link GL11C#GL_CCW CCW}{@link GL11C#GL_CW CW}
+ * + * @see Reference Page + */ + public static void glFrontFace(@NativeType("GLenum") int dir) { + GL11C.glFrontFace(dir); + } + + // --- [ glGenLists ] --- + + /** + * Returns an integer n such that the indices {@code n,..., n + s - 1} are previously unused (i.e. there are {@code s} previously unused display list + * indices starting at n). {@code GenLists} also has the effect of creating an empty display list for each of the indices {@code n,..., n + s - 1}, so + * that these indices all become used. {@code GenLists} returns zero if there is no group of {@code s} contiguous previously unused display list indices, + * or if {@code s = 0}. + * + * @param s the number of display lists to create + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + @NativeType("GLuint") + public static native int glGenLists(@NativeType("GLsizei") int s); + + // --- [ glGenTextures ] --- + + /** + * Unsafe version of: {@link #glGenTextures GenTextures} + * + * @param n the number of textures to create + */ + public static void nglGenTextures(int n, long textures) { + GL11C.nglGenTextures(n, textures); + } + + /** + * Returns n previously unused texture names in textures. These names are marked as used, for the purposes of GenTextures only, but they acquire texture + * state and a dimensionality only when they are first bound, just as if they were unused. + * + * @param textures a scalar or buffer in which to place the returned texture names + * + * @see Reference Page + */ + public static void glGenTextures(@NativeType("GLuint *") IntBuffer textures) { + GL11C.glGenTextures(textures); + } + + /** + * Returns n previously unused texture names in textures. These names are marked as used, for the purposes of GenTextures only, but they acquire texture + * state and a dimensionality only when they are first bound, just as if they were unused. + * + * @see Reference Page + */ + @NativeType("void") + public static int glGenTextures() { + return GL11C.glGenTextures(); + } + + // --- [ glDeleteTextures ] --- + + /** + * Unsafe version of: {@link #glDeleteTextures DeleteTextures} + * + * @param n the number of texture names in the {@code textures} parameter + */ + public static void nglDeleteTextures(int n, long textures) { + GL11C.nglDeleteTextures(n, textures); + } + + /** + * Deletes texture objects. After a texture object is deleted, it has no contents or dimensionality, and its name is again unused. If a texture that is + * currently bound to any of the target bindings of {@link #glBindTexture BindTexture} is deleted, it is as though {@link #glBindTexture BindTexture} had been executed with the + * same target and texture zero. Additionally, special care must be taken when deleting a texture if any of the images of the texture are attached to a + * framebuffer object. + * + *

Unused names in textures that have been marked as used for the purposes of {@link #glGenTextures GenTextures} are marked as unused again. Unused names in textures are + * silently ignored, as is the name zero.

+ * + * @param textures contains {@code n} names of texture objects to be deleted + * + * @see Reference Page + */ + public static void glDeleteTextures(@NativeType("GLuint const *") IntBuffer textures) { + GL11C.glDeleteTextures(textures); + } + + /** + * Deletes texture objects. After a texture object is deleted, it has no contents or dimensionality, and its name is again unused. If a texture that is + * currently bound to any of the target bindings of {@link #glBindTexture BindTexture} is deleted, it is as though {@link #glBindTexture BindTexture} had been executed with the + * same target and texture zero. Additionally, special care must be taken when deleting a texture if any of the images of the texture are attached to a + * framebuffer object. + * + *

Unused names in textures that have been marked as used for the purposes of {@link #glGenTextures GenTextures} are marked as unused again. Unused names in textures are + * silently ignored, as is the name zero.

+ * + * @see Reference Page + */ + public static void glDeleteTextures(@NativeType("GLuint const *") int texture) { + GL11C.glDeleteTextures(texture); + } + + // --- [ glGetClipPlane ] --- + + /** Unsafe version of: {@link #glGetClipPlane GetClipPlane} */ + public static native void nglGetClipPlane(int plane, long equation); + + /** + * Returns four double-precision values in {@code equation}; these are the coefficients of the plane equation of plane in eye coordinates (these + * coordinates are those that were computed when the plane was specified). + * + * @param plane the clip plane + * @param equation a buffer in which to place the returned values + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetClipPlane(@NativeType("GLenum") int plane, @NativeType("GLdouble *") DoubleBuffer equation) { + if (CHECKS) { + check(equation, 4); + } + nglGetClipPlane(plane, memAddress(equation)); + } + + // --- [ glGetBooleanv ] --- + + /** Unsafe version of: {@link #glGetBooleanv GetBooleanv} */ + public static void nglGetBooleanv(int pname, long params) { + GL11C.nglGetBooleanv(pname, params); + } + + /** + * Returns the current boolean value of the specified state variable. + * + *

LWJGL note: The state that corresponds to the state variable may be a single value or an array of values. In the case of an array of values, + * LWJGL will not validate if {@code params} has enough space to store that array. Doing so would introduce significant overhead, as the + * OpenGL state variables are too many. It is the user's responsibility to avoid JVM crashes by ensuring enough space for the returned values.

+ * + * @param pname the state variable + * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetBooleanv(@NativeType("GLenum") int pname, @NativeType("GLboolean *") ByteBuffer params) { + GL11C.glGetBooleanv(pname, params); + } + + /** + * Returns the current boolean value of the specified state variable. + * + *

LWJGL note: The state that corresponds to the state variable may be a single value or an array of values. In the case of an array of values, + * LWJGL will not validate if {@code params} has enough space to store that array. Doing so would introduce significant overhead, as the + * OpenGL state variables are too many. It is the user's responsibility to avoid JVM crashes by ensuring enough space for the returned values.

+ * + * @param pname the state variable + * + * @see Reference Page + */ + @NativeType("void") + public static boolean glGetBoolean(@NativeType("GLenum") int pname) { + return GL11C.glGetBoolean(pname); + } + + // --- [ glGetFloatv ] --- + + /** Unsafe version of: {@link #glGetFloatv GetFloatv} */ + public static void nglGetFloatv(int pname, long params) { + GL11C.nglGetFloatv(pname, params); + } + + /** + * Returns the current float value of the specified state variable. + * + *

LWJGL note: The state that corresponds to the state variable may be a single value or an array of values. In the case of an array of values, + * LWJGL will not validate if {@code params} has enough space to store that array. Doing so would introduce significant overhead, as the + * OpenGL state variables are too many. It is the user's responsibility to avoid JVM crashes by ensuring enough space for the returned values.

+ * + * @param pname the state variable + * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetFloatv(@NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + GL11C.glGetFloatv(pname, params); + } + + /** + * Returns the current float value of the specified state variable. + * + *

LWJGL note: The state that corresponds to the state variable may be a single value or an array of values. In the case of an array of values, + * LWJGL will not validate if {@code params} has enough space to store that array. Doing so would introduce significant overhead, as the + * OpenGL state variables are too many. It is the user's responsibility to avoid JVM crashes by ensuring enough space for the returned values.

+ * + * @param pname the state variable + * + * @see Reference Page + */ + @NativeType("void") + public static float glGetFloat(@NativeType("GLenum") int pname) { + return GL11C.glGetFloat(pname); + } + + // --- [ glGetIntegerv ] --- + + /** Unsafe version of: {@link #glGetIntegerv GetIntegerv} */ + public static void nglGetIntegerv(int pname, long params) { + GL11C.nglGetIntegerv(pname, params); + } + + /** + * Returns the current integer value of the specified state variable. + * + *

LWJGL note: The state that corresponds to the state variable may be a single value or an array of values. In the case of an array of values, + * LWJGL will not validate if {@code params} has enough space to store that array. Doing so would introduce significant overhead, as the + * OpenGL state variables are too many. It is the user's responsibility to avoid JVM crashes by ensuring enough space for the returned values.

+ * + * @param pname the state variable + * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetIntegerv(@NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL11C.glGetIntegerv(pname, params); + } + + /** + * Returns the current integer value of the specified state variable. + * + *

LWJGL note: The state that corresponds to the state variable may be a single value or an array of values. In the case of an array of values, + * LWJGL will not validate if {@code params} has enough space to store that array. Doing so would introduce significant overhead, as the + * OpenGL state variables are too many. It is the user's responsibility to avoid JVM crashes by ensuring enough space for the returned values.

+ * + * @param pname the state variable + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetInteger(@NativeType("GLenum") int pname) { + return GL11C.glGetInteger(pname); + } + + // --- [ glGetDoublev ] --- + + /** Unsafe version of: {@link #glGetDoublev GetDoublev} */ + public static void nglGetDoublev(int pname, long params) { + GL11C.nglGetDoublev(pname, params); + } + + /** + * Returns the current double value of the specified state variable. + * + *

LWJGL note: The state that corresponds to the state variable may be a single value or an array of values. In the case of an array of values, + * LWJGL will not validate if {@code params} has enough space to store that array. Doing so would introduce significant overhead, as the + * OpenGL state variables are too many. It is the user's responsibility to avoid JVM crashes by ensuring enough space for the returned values.

+ * + * @param pname the state variable + * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetDoublev(@NativeType("GLenum") int pname, @NativeType("GLdouble *") DoubleBuffer params) { + GL11C.glGetDoublev(pname, params); + } + + /** + * Returns the current double value of the specified state variable. + * + *

LWJGL note: The state that corresponds to the state variable may be a single value or an array of values. In the case of an array of values, + * LWJGL will not validate if {@code params} has enough space to store that array. Doing so would introduce significant overhead, as the + * OpenGL state variables are too many. It is the user's responsibility to avoid JVM crashes by ensuring enough space for the returned values.

+ * + * @param pname the state variable + * + * @see Reference Page + */ + @NativeType("void") + public static double glGetDouble(@NativeType("GLenum") int pname) { + return GL11C.glGetDouble(pname); + } + + // --- [ glGetError ] --- + + /** + * Returns error information. + * + *

Each detectable error is assigned a numeric code. When an error is detected, a flag is set and the code is recorded. Further errors, if they occur, do + * not affect this recorded code. When {@code 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 {@code GetError} returns {@link GL11C#GL_NO_ERROR NO_ERROR}, then there has been no detectable error since the last call to {@code GetError} (or since + * the GL was initialized).

+ * + * @see Reference Page + */ + @NativeType("GLenum") + public static int glGetError() { + return GL11C.glGetError(); + } + + // --- [ glGetLightiv ] --- + + /** Unsafe version of: {@link #glGetLightiv GetLightiv} */ + public static native void nglGetLightiv(int light, int pname, long data); + + /** + * Returns integer information about light parameter {@code pname} for {@code light} in {@code data}. + * + * @param light the light for which to return information. One of:
{@link #GL_LIGHT0 LIGHT0}GL_LIGHT[1-7]
+ * @param pname the light parameter to query. One of:
{@link #GL_AMBIENT AMBIENT}{@link #GL_DIFFUSE DIFFUSE}{@link #GL_SPECULAR SPECULAR}{@link #GL_POSITION POSITION}{@link #GL_CONSTANT_ATTENUATION CONSTANT_ATTENUATION}{@link #GL_LINEAR_ATTENUATION LINEAR_ATTENUATION}
{@link #GL_QUADRATIC_ATTENUATION QUADRATIC_ATTENUATION}{@link #GL_SPOT_DIRECTION SPOT_DIRECTION}{@link #GL_SPOT_EXPONENT SPOT_EXPONENT}{@link #GL_SPOT_CUTOFF SPOT_CUTOFF}
+ * @param data a scalar or buffer in which to place the returned data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetLightiv(@NativeType("GLenum") int light, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer data) { + if (CHECKS) { + check(data, 4); + } + nglGetLightiv(light, pname, memAddress(data)); + } + + /** + * Returns integer information about light parameter {@code pname} for {@code light} in {@code data}. + * + * @param light the light for which to return information. One of:
{@link #GL_LIGHT0 LIGHT0}GL_LIGHT[1-7]
+ * @param pname the light parameter to query. One of:
{@link #GL_AMBIENT AMBIENT}{@link #GL_DIFFUSE DIFFUSE}{@link #GL_SPECULAR SPECULAR}{@link #GL_POSITION POSITION}{@link #GL_CONSTANT_ATTENUATION CONSTANT_ATTENUATION}{@link #GL_LINEAR_ATTENUATION LINEAR_ATTENUATION}
{@link #GL_QUADRATIC_ATTENUATION QUADRATIC_ATTENUATION}{@link #GL_SPOT_DIRECTION SPOT_DIRECTION}{@link #GL_SPOT_EXPONENT SPOT_EXPONENT}{@link #GL_SPOT_CUTOFF SPOT_CUTOFF}
+ * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + @NativeType("void") + public static int glGetLighti(@NativeType("GLenum") int light, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer data = stack.callocInt(1); + nglGetLightiv(light, pname, memAddress(data)); + return data.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetLightfv ] --- + + /** Unsafe version of: {@link #glGetLightfv GetLightfv} */ + public static native void nglGetLightfv(int light, int pname, long data); + + /** + * Float version of {@link #glGetLightiv GetLightiv}. + * + * @param light the light for which to return information + * @param pname the light parameter to query + * @param data a scalar or buffer in which to place the returned data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetLightfv(@NativeType("GLenum") int light, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer data) { + if (CHECKS) { + check(data, 4); + } + nglGetLightfv(light, pname, memAddress(data)); + } + + /** + * Float version of {@link #glGetLightiv GetLightiv}. + * + * @param light the light for which to return information + * @param pname the light parameter to query + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + @NativeType("void") + public static float glGetLightf(@NativeType("GLenum") int light, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer data = stack.callocFloat(1); + nglGetLightfv(light, pname, memAddress(data)); + return data.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetMapiv ] --- + + /** Unsafe version of: {@link #glGetMapiv GetMapiv} */ + public static native void nglGetMapiv(int target, int query, long data); + + /** + * Returns integer information about {@code query} for evaluator map {@code target} in {@code data}. + * + * @param target the evaluator target. One of:
{@link #GL_MAP1_VERTEX_3 MAP1_VERTEX_3}{@link #GL_MAP1_VERTEX_4 MAP1_VERTEX_4}{@link #GL_MAP1_COLOR_4 MAP1_COLOR_4}{@link #GL_MAP1_NORMAL MAP1_NORMAL}{@link #GL_MAP1_TEXTURE_COORD_1 MAP1_TEXTURE_COORD_1}
{@link #GL_MAP1_TEXTURE_COORD_2 MAP1_TEXTURE_COORD_2}{@link #GL_MAP1_TEXTURE_COORD_3 MAP1_TEXTURE_COORD_3}{@link #GL_MAP1_TEXTURE_COORD_4 MAP1_TEXTURE_COORD_4}{@link #GL_MAP2_VERTEX_3 MAP2_VERTEX_3}{@link #GL_MAP2_VERTEX_4 MAP2_VERTEX_4}
{@link #GL_MAP2_COLOR_4 MAP2_COLOR_4}{@link #GL_MAP2_NORMAL MAP2_NORMAL}{@link #GL_MAP2_TEXTURE_COORD_1 MAP2_TEXTURE_COORD_1}{@link #GL_MAP2_TEXTURE_COORD_2 MAP2_TEXTURE_COORD_2}{@link #GL_MAP2_TEXTURE_COORD_3 MAP2_TEXTURE_COORD_3}
{@link #GL_MAP2_TEXTURE_COORD_4 MAP2_TEXTURE_COORD_4}
+ * @param query the information to query. One of:
{@link #GL_ORDER ORDER}{@link #GL_COEFF COEFF}{@link #GL_DOMAIN DOMAIN}
+ * @param data a scalar or buffer in which to place the returned data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetMapiv(@NativeType("GLenum") int target, @NativeType("GLenum") int query, @NativeType("GLint *") IntBuffer data) { + if (CHECKS) { + check(data, 4); + } + nglGetMapiv(target, query, memAddress(data)); + } + + /** + * Returns integer information about {@code query} for evaluator map {@code target} in {@code data}. + * + * @param target the evaluator target. One of:
{@link #GL_MAP1_VERTEX_3 MAP1_VERTEX_3}{@link #GL_MAP1_VERTEX_4 MAP1_VERTEX_4}{@link #GL_MAP1_COLOR_4 MAP1_COLOR_4}{@link #GL_MAP1_NORMAL MAP1_NORMAL}{@link #GL_MAP1_TEXTURE_COORD_1 MAP1_TEXTURE_COORD_1}
{@link #GL_MAP1_TEXTURE_COORD_2 MAP1_TEXTURE_COORD_2}{@link #GL_MAP1_TEXTURE_COORD_3 MAP1_TEXTURE_COORD_3}{@link #GL_MAP1_TEXTURE_COORD_4 MAP1_TEXTURE_COORD_4}{@link #GL_MAP2_VERTEX_3 MAP2_VERTEX_3}{@link #GL_MAP2_VERTEX_4 MAP2_VERTEX_4}
{@link #GL_MAP2_COLOR_4 MAP2_COLOR_4}{@link #GL_MAP2_NORMAL MAP2_NORMAL}{@link #GL_MAP2_TEXTURE_COORD_1 MAP2_TEXTURE_COORD_1}{@link #GL_MAP2_TEXTURE_COORD_2 MAP2_TEXTURE_COORD_2}{@link #GL_MAP2_TEXTURE_COORD_3 MAP2_TEXTURE_COORD_3}
{@link #GL_MAP2_TEXTURE_COORD_4 MAP2_TEXTURE_COORD_4}
+ * @param query the information to query. One of:
{@link #GL_ORDER ORDER}{@link #GL_COEFF COEFF}{@link #GL_DOMAIN DOMAIN}
+ * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + @NativeType("void") + public static int glGetMapi(@NativeType("GLenum") int target, @NativeType("GLenum") int query) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer data = stack.callocInt(1); + nglGetMapiv(target, query, memAddress(data)); + return data.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetMapfv ] --- + + /** Unsafe version of: {@link #glGetMapfv GetMapfv} */ + public static native void nglGetMapfv(int target, int query, long data); + + /** + * Float version of {@link #glGetMapiv GetMapiv}. + * + * @param target the evaluator map + * @param query the information to query + * @param data a scalar or buffer in which to place the returned data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetMapfv(@NativeType("GLenum") int target, @NativeType("GLenum") int query, @NativeType("GLfloat *") FloatBuffer data) { + if (CHECKS) { + check(data, 4); + } + nglGetMapfv(target, query, memAddress(data)); + } + + /** + * Float version of {@link #glGetMapiv GetMapiv}. + * + * @param target the evaluator map + * @param query the information to query + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + @NativeType("void") + public static float glGetMapf(@NativeType("GLenum") int target, @NativeType("GLenum") int query) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer data = stack.callocFloat(1); + nglGetMapfv(target, query, memAddress(data)); + return data.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetMapdv ] --- + + /** Unsafe version of: {@link #glGetMapdv GetMapdv} */ + public static native void nglGetMapdv(int target, int query, long data); + + /** + * Double version of {@link #glGetMapiv GetMapiv}. + * + * @param target the evaluator map + * @param query the information to query + * @param data a scalar or buffer in which to place the returned data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetMapdv(@NativeType("GLenum") int target, @NativeType("GLenum") int query, @NativeType("GLdouble *") DoubleBuffer data) { + if (CHECKS) { + check(data, 4); + } + nglGetMapdv(target, query, memAddress(data)); + } + + /** + * Double version of {@link #glGetMapiv GetMapiv}. + * + * @param target the evaluator map + * @param query the information to query + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + @NativeType("void") + public static double glGetMapd(@NativeType("GLenum") int target, @NativeType("GLenum") int query) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + DoubleBuffer data = stack.callocDouble(1); + nglGetMapdv(target, query, memAddress(data)); + return data.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetMaterialiv ] --- + + /** Unsafe version of: {@link #glGetMaterialiv GetMaterialiv} */ + public static native void nglGetMaterialiv(int face, int pname, long data); + + /** + * Returns integer information about material property {@code pname} for {@code face} in {@code data}. + * + * @param face the material face for which to return information. One of:
{@link #GL_FRONT FRONT}{@link #GL_BACK BACK}
+ * @param pname the information to query. One of:
{@link #GL_AMBIENT AMBIENT}{@link #GL_DIFFUSE DIFFUSE}{@link #GL_SPECULAR SPECULAR}{@link #GL_EMISSION EMISSION}{@link #GL_SHININESS SHININESS}
+ * @param data a scalar or buffer in which to place the returned data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetMaterialiv(@NativeType("GLenum") int face, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer data) { + if (CHECKS) { + check(data, 1); + } + nglGetMaterialiv(face, pname, memAddress(data)); + } + + // --- [ glGetMaterialfv ] --- + + /** Unsafe version of: {@link #glGetMaterialfv GetMaterialfv} */ + public static native void nglGetMaterialfv(int face, int pname, long data); + + /** + * Float version of {@link #glGetMaterialiv GetMaterialiv}. + * + * @param face the material face for which to return information + * @param pname the information to query + * @param data a scalar or buffer in which to place the returned data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetMaterialfv(@NativeType("GLenum") int face, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer data) { + if (CHECKS) { + check(data, 1); + } + nglGetMaterialfv(face, pname, memAddress(data)); + } + + // --- [ glGetPixelMapfv ] --- + + /** Unsafe version of: {@link #glGetPixelMapfv GetPixelMapfv} */ + public static native void nglGetPixelMapfv(int map, long data); + + /** + * Returns all float values in the pixel map {@code map} in {@code data}. + * + * @param map the pixel map parameter to query. One of:
{@link #GL_PIXEL_MAP_I_TO_I PIXEL_MAP_I_TO_I}{@link #GL_PIXEL_MAP_S_TO_S PIXEL_MAP_S_TO_S}{@link #GL_PIXEL_MAP_I_TO_R PIXEL_MAP_I_TO_R}{@link #GL_PIXEL_MAP_I_TO_G PIXEL_MAP_I_TO_G}{@link #GL_PIXEL_MAP_I_TO_B PIXEL_MAP_I_TO_B}
{@link #GL_PIXEL_MAP_I_TO_A PIXEL_MAP_I_TO_A}{@link #GL_PIXEL_MAP_R_TO_R PIXEL_MAP_R_TO_R}{@link #GL_PIXEL_MAP_G_TO_G PIXEL_MAP_G_TO_G}{@link #GL_PIXEL_MAP_B_TO_B PIXEL_MAP_B_TO_B}{@link #GL_PIXEL_MAP_A_TO_A PIXEL_MAP_A_TO_A}
+ * @param data a buffer in which to place the returned data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetPixelMapfv(@NativeType("GLenum") int map, @NativeType("GLfloat *") FloatBuffer data) { + if (CHECKS) { + check(data, 32); + } + nglGetPixelMapfv(map, memAddress(data)); + } + + /** + * Returns all float values in the pixel map {@code map} in {@code data}. + * + * @param map the pixel map parameter to query. One of:
{@link #GL_PIXEL_MAP_I_TO_I PIXEL_MAP_I_TO_I}{@link #GL_PIXEL_MAP_S_TO_S PIXEL_MAP_S_TO_S}{@link #GL_PIXEL_MAP_I_TO_R PIXEL_MAP_I_TO_R}{@link #GL_PIXEL_MAP_I_TO_G PIXEL_MAP_I_TO_G}{@link #GL_PIXEL_MAP_I_TO_B PIXEL_MAP_I_TO_B}
{@link #GL_PIXEL_MAP_I_TO_A PIXEL_MAP_I_TO_A}{@link #GL_PIXEL_MAP_R_TO_R PIXEL_MAP_R_TO_R}{@link #GL_PIXEL_MAP_G_TO_G PIXEL_MAP_G_TO_G}{@link #GL_PIXEL_MAP_B_TO_B PIXEL_MAP_B_TO_B}{@link #GL_PIXEL_MAP_A_TO_A PIXEL_MAP_A_TO_A}
+ * @param data a buffer in which to place the returned data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetPixelMapfv(@NativeType("GLenum") int map, @NativeType("GLfloat *") long data) { + nglGetPixelMapfv(map, data); + } + + // --- [ glGetPixelMapusv ] --- + + /** Unsafe version of: {@link #glGetPixelMapusv GetPixelMapusv} */ + public static native void nglGetPixelMapusv(int map, long data); + + /** + * Unsigned short version of {@link #glGetPixelMapfv GetPixelMapfv}. + * + * @param map the pixel map parameter to query + * @param data a buffer in which to place the returned data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetPixelMapusv(@NativeType("GLenum") int map, @NativeType("GLushort *") ShortBuffer data) { + if (CHECKS) { + check(data, 32); + } + nglGetPixelMapusv(map, memAddress(data)); + } + + /** + * Unsigned short version of {@link #glGetPixelMapfv GetPixelMapfv}. + * + * @param map the pixel map parameter to query + * @param data a buffer in which to place the returned data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetPixelMapusv(@NativeType("GLenum") int map, @NativeType("GLushort *") long data) { + nglGetPixelMapusv(map, data); + } + + // --- [ glGetPixelMapuiv ] --- + + /** Unsafe version of: {@link #glGetPixelMapuiv GetPixelMapuiv} */ + public static native void nglGetPixelMapuiv(int map, long data); + + /** + * Unsigned integer version of {@link #glGetPixelMapfv GetPixelMapfv}. + * + * @param map the pixel map parameter to query + * @param data a buffer in which to place the returned data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetPixelMapuiv(@NativeType("GLenum") int map, @NativeType("GLuint *") IntBuffer data) { + if (CHECKS) { + check(data, 32); + } + nglGetPixelMapuiv(map, memAddress(data)); + } + + /** + * Unsigned integer version of {@link #glGetPixelMapfv GetPixelMapfv}. + * + * @param map the pixel map parameter to query + * @param data a buffer in which to place the returned data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetPixelMapuiv(@NativeType("GLenum") int map, @NativeType("GLuint *") long data) { + nglGetPixelMapuiv(map, data); + } + + // --- [ glGetPointerv ] --- + + /** Unsafe version of: {@link #glGetPointerv GetPointerv} */ + public static void nglGetPointerv(int pname, long params) { + GL11C.nglGetPointerv(pname, params); + } + + /** + * Returns a pointer in the current GL context. + * + * @param pname the pointer to return. One of:
{@link GL43#GL_DEBUG_CALLBACK_FUNCTION DEBUG_CALLBACK_FUNCTION}{@link GL43#GL_DEBUG_CALLBACK_USER_PARAM DEBUG_CALLBACK_USER_PARAM}
+ * @param params a buffer in which to place the returned pointer + * + * @see Reference Page + */ + public static void glGetPointerv(@NativeType("GLenum") int pname, @NativeType("void **") PointerBuffer params) { + GL11C.glGetPointerv(pname, params); + } + + /** + * Returns a pointer in the current GL context. + * + * @param pname the pointer to return. One of:
{@link GL43#GL_DEBUG_CALLBACK_FUNCTION DEBUG_CALLBACK_FUNCTION}{@link GL43#GL_DEBUG_CALLBACK_USER_PARAM DEBUG_CALLBACK_USER_PARAM}
+ * + * @see Reference Page + */ + @NativeType("void") + public static long glGetPointer(@NativeType("GLenum") int pname) { + return GL11C.glGetPointer(pname); + } + + // --- [ glGetPolygonStipple ] --- + + /** Unsafe version of: {@link #glGetPolygonStipple GetPolygonStipple} */ + public static native void nglGetPolygonStipple(long pattern); + + /** + * Obtains the polygon stipple. + * + * @param pattern a buffer in which to place the returned data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetPolygonStipple(@NativeType("void *") ByteBuffer pattern) { + if (CHECKS) { + check(pattern, 128); + } + nglGetPolygonStipple(memAddress(pattern)); + } + + /** + * Obtains the polygon stipple. + * + * @param pattern a buffer in which to place the returned data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetPolygonStipple(@NativeType("void *") long pattern) { + nglGetPolygonStipple(pattern); + } + + // --- [ glGetString ] --- + + /** Unsafe version of: {@link #glGetString GetString} */ + public static long nglGetString(int name) { + return GL11C.nglGetString(name); + } + + /** + * Return strings describing properties of the current GL context. + * + * @param name the property to query. One of:
{@link GL11C#GL_RENDERER RENDERER}{@link GL11C#GL_VENDOR VENDOR}{@link GL11C#GL_EXTENSIONS EXTENSIONS}{@link GL11C#GL_VERSION VERSION}{@link GL20#GL_SHADING_LANGUAGE_VERSION SHADING_LANGUAGE_VERSION}
+ * + * @see Reference Page + */ + @Nullable + @NativeType("GLubyte const *") + public static String glGetString(@NativeType("GLenum") int name) { + return GL11C.glGetString(name); + } + + // --- [ glGetTexEnviv ] --- + + /** Unsafe version of: {@link #glGetTexEnviv GetTexEnviv} */ + public static native void nglGetTexEnviv(int env, int pname, long data); + + /** + * Returns integer information about {@code pname} for {@code env} in {@code data}. + * + * @param env the texture environment to query. One of:
{@link GL20#GL_POINT_SPRITE POINT_SPRITE}{@link #GL_TEXTURE_ENV TEXTURE_ENV}{@link GL14#GL_TEXTURE_FILTER_CONTROL TEXTURE_FILTER_CONTROL}
+ * @param pname the parameter to query. One of:
{@link GL20#GL_COORD_REPLACE COORD_REPLACE}{@link #GL_TEXTURE_ENV_MODE TEXTURE_ENV_MODE}{@link #GL_TEXTURE_ENV_COLOR TEXTURE_ENV_COLOR}{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL13#GL_COMBINE_RGB COMBINE_RGB}{@link GL13#GL_COMBINE_ALPHA COMBINE_ALPHA}
{@link GL15#GL_SRC0_RGB SRC0_RGB}{@link GL15#GL_SRC1_RGB SRC1_RGB}{@link GL15#GL_SRC2_RGB SRC2_RGB}{@link GL15#GL_SRC0_ALPHA SRC0_ALPHA}{@link GL15#GL_SRC1_ALPHA SRC1_ALPHA}{@link GL15#GL_SRC2_ALPHA SRC2_ALPHA}
{@link GL13#GL_OPERAND0_RGB OPERAND0_RGB}{@link GL13#GL_OPERAND1_RGB OPERAND1_RGB}{@link GL13#GL_OPERAND2_RGB OPERAND2_RGB}{@link GL13#GL_OPERAND0_ALPHA OPERAND0_ALPHA}{@link GL13#GL_OPERAND1_ALPHA OPERAND1_ALPHA}{@link GL13#GL_OPERAND2_ALPHA OPERAND2_ALPHA}
{@link GL13#GL_RGB_SCALE RGB_SCALE}{@link #GL_ALPHA_SCALE ALPHA_SCALE}
+ * @param data a scalar or buffer in which to place the returned data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetTexEnviv(@NativeType("GLenum") int env, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer data) { + if (CHECKS) { + check(data, 1); + } + nglGetTexEnviv(env, pname, memAddress(data)); + } + + /** + * Returns integer information about {@code pname} for {@code env} in {@code data}. + * + * @param env the texture environment to query. One of:
{@link GL20#GL_POINT_SPRITE POINT_SPRITE}{@link #GL_TEXTURE_ENV TEXTURE_ENV}{@link GL14#GL_TEXTURE_FILTER_CONTROL TEXTURE_FILTER_CONTROL}
+ * @param pname the parameter to query. One of:
{@link GL20#GL_COORD_REPLACE COORD_REPLACE}{@link #GL_TEXTURE_ENV_MODE TEXTURE_ENV_MODE}{@link #GL_TEXTURE_ENV_COLOR TEXTURE_ENV_COLOR}{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL13#GL_COMBINE_RGB COMBINE_RGB}{@link GL13#GL_COMBINE_ALPHA COMBINE_ALPHA}
{@link GL15#GL_SRC0_RGB SRC0_RGB}{@link GL15#GL_SRC1_RGB SRC1_RGB}{@link GL15#GL_SRC2_RGB SRC2_RGB}{@link GL15#GL_SRC0_ALPHA SRC0_ALPHA}{@link GL15#GL_SRC1_ALPHA SRC1_ALPHA}{@link GL15#GL_SRC2_ALPHA SRC2_ALPHA}
{@link GL13#GL_OPERAND0_RGB OPERAND0_RGB}{@link GL13#GL_OPERAND1_RGB OPERAND1_RGB}{@link GL13#GL_OPERAND2_RGB OPERAND2_RGB}{@link GL13#GL_OPERAND0_ALPHA OPERAND0_ALPHA}{@link GL13#GL_OPERAND1_ALPHA OPERAND1_ALPHA}{@link GL13#GL_OPERAND2_ALPHA OPERAND2_ALPHA}
{@link GL13#GL_RGB_SCALE RGB_SCALE}{@link #GL_ALPHA_SCALE ALPHA_SCALE}
+ * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + @NativeType("void") + public static int glGetTexEnvi(@NativeType("GLenum") int env, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer data = stack.callocInt(1); + nglGetTexEnviv(env, pname, memAddress(data)); + return data.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTexEnvfv ] --- + + /** Unsafe version of: {@link #glGetTexEnvfv GetTexEnvfv} */ + public static native void nglGetTexEnvfv(int env, int pname, long data); + + /** + * Float version of {@link #glGetTexEnviv GetTexEnviv}. + * + * @param env the texture environment to query + * @param pname the parameter to query + * @param data a scalar or buffer in which to place the returned data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetTexEnvfv(@NativeType("GLenum") int env, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer data) { + if (CHECKS) { + check(data, 1); + } + nglGetTexEnvfv(env, pname, memAddress(data)); + } + + /** + * Float version of {@link #glGetTexEnviv GetTexEnviv}. + * + * @param env the texture environment to query + * @param pname the parameter to query + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + @NativeType("void") + public static float glGetTexEnvf(@NativeType("GLenum") int env, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer data = stack.callocFloat(1); + nglGetTexEnvfv(env, pname, memAddress(data)); + return data.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTexGeniv ] --- + + /** Unsafe version of: {@link #glGetTexGeniv GetTexGeniv} */ + public static native void nglGetTexGeniv(int coord, int pname, long data); + + /** + * Returns integer information about {@code pname} for {@code coord} in {@code data}. + * + * @param coord the coord to query. One of:
{@link #GL_S S}{@link #GL_T T}{@link #GL_R R}{@link #GL_Q Q}
+ * @param pname the parameter to query. One of:
{@link #GL_EYE_PLANE EYE_PLANE}{@link #GL_OBJECT_PLANE OBJECT_PLANE}{@link #GL_TEXTURE_GEN_MODE TEXTURE_GEN_MODE}
+ * @param data a scalar or buffer in which to place the returned data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetTexGeniv(@NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer data) { + if (CHECKS) { + check(data, 1); + } + nglGetTexGeniv(coord, pname, memAddress(data)); + } + + /** + * Returns integer information about {@code pname} for {@code coord} in {@code data}. + * + * @param coord the coord to query. One of:
{@link #GL_S S}{@link #GL_T T}{@link #GL_R R}{@link #GL_Q Q}
+ * @param pname the parameter to query. One of:
{@link #GL_EYE_PLANE EYE_PLANE}{@link #GL_OBJECT_PLANE OBJECT_PLANE}{@link #GL_TEXTURE_GEN_MODE TEXTURE_GEN_MODE}
+ * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + @NativeType("void") + public static int glGetTexGeni(@NativeType("GLenum") int coord, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer data = stack.callocInt(1); + nglGetTexGeniv(coord, pname, memAddress(data)); + return data.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTexGenfv ] --- + + /** Unsafe version of: {@link #glGetTexGenfv GetTexGenfv} */ + public static native void nglGetTexGenfv(int coord, int pname, long data); + + /** + * Float version of {@link #glGetTexGeniv GetTexGeniv}. + * + * @param coord the coord to query + * @param pname the parameter to query + * @param data a scalar or buffer in which to place the returned data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetTexGenfv(@NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer data) { + if (CHECKS) { + check(data, 4); + } + nglGetTexGenfv(coord, pname, memAddress(data)); + } + + /** + * Float version of {@link #glGetTexGeniv GetTexGeniv}. + * + * @param coord the coord to query + * @param pname the parameter to query + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + @NativeType("void") + public static float glGetTexGenf(@NativeType("GLenum") int coord, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer data = stack.callocFloat(1); + nglGetTexGenfv(coord, pname, memAddress(data)); + return data.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTexGendv ] --- + + /** Unsafe version of: {@link #glGetTexGendv GetTexGendv} */ + public static native void nglGetTexGendv(int coord, int pname, long data); + + /** + * Double version of {@link #glGetTexGeniv GetTexGeniv}. + * + * @param coord the coord to query + * @param pname the parameter to query + * @param data a scalar or buffer in which to place the returned data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetTexGendv(@NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLdouble *") DoubleBuffer data) { + if (CHECKS) { + check(data, 4); + } + nglGetTexGendv(coord, pname, memAddress(data)); + } + + /** + * Double version of {@link #glGetTexGeniv GetTexGeniv}. + * + * @param coord the coord to query + * @param pname the parameter to query + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + @NativeType("void") + public static double glGetTexGend(@NativeType("GLenum") int coord, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + DoubleBuffer data = stack.callocDouble(1); + nglGetTexGendv(coord, pname, memAddress(data)); + return data.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTexImage ] --- + + /** Unsafe version of: {@link #glGetTexImage GetTexImage} */ + public static void nglGetTexImage(int tex, int level, int format, int type, long pixels) { + GL11C.nglGetTexImage(tex, level, format, type, pixels); + } + + /** + * Obtains texture images. + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer pixels) { + GL11C.glGetTexImage(tex, level, format, type, pixels); + } + + /** + * Obtains texture images. + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") long pixels) { + GL11C.glGetTexImage(tex, level, format, type, pixels); + } + + /** + * Obtains texture images. + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ShortBuffer pixels) { + GL11C.glGetTexImage(tex, level, format, type, pixels); + } + + /** + * Obtains texture images. + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") IntBuffer pixels) { + GL11C.glGetTexImage(tex, level, format, type, pixels); + } + + /** + * Obtains texture images. + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") FloatBuffer pixels) { + GL11C.glGetTexImage(tex, level, format, type, pixels); + } + + /** + * Obtains texture images. + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") DoubleBuffer pixels) { + GL11C.glGetTexImage(tex, level, format, type, pixels); + } + + // --- [ glGetTexLevelParameteriv ] --- + + /** Unsafe version of: {@link #glGetTexLevelParameteriv GetTexLevelParameteriv} */ + public static void nglGetTexLevelParameteriv(int target, int level, int pname, long params) { + GL11C.nglGetTexLevelParameteriv(target, level, pname, params); + } + + /** + * Places integer information about texture image parameter {@code pname} for level-of-detail {@code level} of the specified {@code target} into {@code params}. + * + * @param target the texture image target. One of:
{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL11C#GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}{@link GL11C#GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}{@link GL12#GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}{@link GL32#GL_PROXY_TEXTURE_2D_MULTISAMPLE PROXY_TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param level the level-of-detail number + * @param pname the parameter to query. One of:
{@link GL11C#GL_TEXTURE_WIDTH TEXTURE_WIDTH}{@link GL11C#GL_TEXTURE_HEIGHT TEXTURE_HEIGHT}{@link GL12#GL_TEXTURE_DEPTH TEXTURE_DEPTH}{@link GL32#GL_TEXTURE_SAMPLES TEXTURE_SAMPLES}
{@link GL32#GL_TEXTURE_FIXED_SAMPLE_LOCATIONS TEXTURE_FIXED_SAMPLE_LOCATIONS}{@link GL11C#GL_TEXTURE_INTERNAL_FORMAT TEXTURE_INTERNAL_FORMAT}{@link GL11C#GL_TEXTURE_RED_SIZE TEXTURE_RED_SIZE}{@link GL11C#GL_TEXTURE_GREEN_SIZE TEXTURE_GREEN_SIZE}
{@link GL11C#GL_TEXTURE_BLUE_SIZE TEXTURE_BLUE_SIZE}{@link GL11C#GL_TEXTURE_ALPHA_SIZE TEXTURE_ALPHA_SIZE}{@link GL14#GL_TEXTURE_DEPTH_SIZE TEXTURE_DEPTH_SIZE}{@link GL30#GL_TEXTURE_STENCIL_SIZE TEXTURE_STENCIL_SIZE}
{@link GL30#GL_TEXTURE_SHARED_SIZE TEXTURE_SHARED_SIZE}{@link GL30#GL_TEXTURE_ALPHA_TYPE TEXTURE_ALPHA_TYPE}{@link GL30#GL_TEXTURE_DEPTH_TYPE TEXTURE_DEPTH_TYPE}{@link GL13#GL_TEXTURE_COMPRESSED TEXTURE_COMPRESSED}
{@link GL13#GL_TEXTURE_COMPRESSED_IMAGE_SIZE TEXTURE_COMPRESSED_IMAGE_SIZE}{@link GL31#GL_TEXTURE_BUFFER_DATA_STORE_BINDING TEXTURE_BUFFER_DATA_STORE_BINDING}{@link GL43#GL_TEXTURE_BUFFER_OFFSET TEXTURE_BUFFER_OFFSET}{@link GL43#GL_TEXTURE_BUFFER_SIZE TEXTURE_BUFFER_SIZE}
+ * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTexLevelParameteriv(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL11C.glGetTexLevelParameteriv(target, level, pname, params); + } + + /** + * Places integer information about texture image parameter {@code pname} for level-of-detail {@code level} of the specified {@code target} into {@code params}. + * + * @param target the texture image target. One of:
{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL11C#GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}{@link GL11C#GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}{@link GL12#GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}{@link GL32#GL_PROXY_TEXTURE_2D_MULTISAMPLE PROXY_TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param level the level-of-detail number + * @param pname the parameter to query. One of:
{@link GL11C#GL_TEXTURE_WIDTH TEXTURE_WIDTH}{@link GL11C#GL_TEXTURE_HEIGHT TEXTURE_HEIGHT}{@link GL12#GL_TEXTURE_DEPTH TEXTURE_DEPTH}{@link GL32#GL_TEXTURE_SAMPLES TEXTURE_SAMPLES}
{@link GL32#GL_TEXTURE_FIXED_SAMPLE_LOCATIONS TEXTURE_FIXED_SAMPLE_LOCATIONS}{@link GL11C#GL_TEXTURE_INTERNAL_FORMAT TEXTURE_INTERNAL_FORMAT}{@link GL11C#GL_TEXTURE_RED_SIZE TEXTURE_RED_SIZE}{@link GL11C#GL_TEXTURE_GREEN_SIZE TEXTURE_GREEN_SIZE}
{@link GL11C#GL_TEXTURE_BLUE_SIZE TEXTURE_BLUE_SIZE}{@link GL11C#GL_TEXTURE_ALPHA_SIZE TEXTURE_ALPHA_SIZE}{@link GL14#GL_TEXTURE_DEPTH_SIZE TEXTURE_DEPTH_SIZE}{@link GL30#GL_TEXTURE_STENCIL_SIZE TEXTURE_STENCIL_SIZE}
{@link GL30#GL_TEXTURE_SHARED_SIZE TEXTURE_SHARED_SIZE}{@link GL30#GL_TEXTURE_ALPHA_TYPE TEXTURE_ALPHA_TYPE}{@link GL30#GL_TEXTURE_DEPTH_TYPE TEXTURE_DEPTH_TYPE}{@link GL13#GL_TEXTURE_COMPRESSED TEXTURE_COMPRESSED}
{@link GL13#GL_TEXTURE_COMPRESSED_IMAGE_SIZE TEXTURE_COMPRESSED_IMAGE_SIZE}{@link GL31#GL_TEXTURE_BUFFER_DATA_STORE_BINDING TEXTURE_BUFFER_DATA_STORE_BINDING}{@link GL43#GL_TEXTURE_BUFFER_OFFSET TEXTURE_BUFFER_OFFSET}{@link GL43#GL_TEXTURE_BUFFER_SIZE TEXTURE_BUFFER_SIZE}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetTexLevelParameteri(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname) { + return GL11C.glGetTexLevelParameteri(target, level, pname); + } + + // --- [ glGetTexLevelParameterfv ] --- + + /** Unsafe version of: {@link #glGetTexLevelParameterfv GetTexLevelParameterfv} */ + public static void nglGetTexLevelParameterfv(int target, int level, int pname, long params) { + GL11C.nglGetTexLevelParameterfv(target, level, pname, params); + } + + /** + * Float version of {@link #glGetTexLevelParameteriv GetTexLevelParameteriv}. + * + * @param target the texture image target + * @param level the level-of-detail number + * @param pname the parameter to query + * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTexLevelParameterfv(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + GL11C.glGetTexLevelParameterfv(target, level, pname, params); + } + + /** + * Float version of {@link #glGetTexLevelParameteriv GetTexLevelParameteriv}. + * + * @param target the texture image target + * @param level the level-of-detail number + * @param pname the parameter to query + * + * @see Reference Page + */ + @NativeType("void") + public static float glGetTexLevelParameterf(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname) { + return GL11C.glGetTexLevelParameterf(target, level, pname); + } + + // --- [ glGetTexParameteriv ] --- + + /** Unsafe version of: {@link #glGetTexParameteriv GetTexParameteriv} */ + public static void nglGetTexParameteriv(int target, int pname, long params) { + GL11C.nglGetTexParameteriv(target, pname, params); + } + + /** + * Place integer information about texture parameter {@code pname} for the specified {@code target} into {@code params}. + * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param pname the parameter to query. One of:
{@link GL12#GL_TEXTURE_BASE_LEVEL TEXTURE_BASE_LEVEL}{@link GL11C#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL11C#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}{@link GL12#GL_TEXTURE_MAX_LEVEL TEXTURE_MAX_LEVEL}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}
{@link GL11C#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL33#GL_TEXTURE_SWIZZLE_R TEXTURE_SWIZZLE_R}{@link GL33#GL_TEXTURE_SWIZZLE_G TEXTURE_SWIZZLE_G}
{@link GL33#GL_TEXTURE_SWIZZLE_B TEXTURE_SWIZZLE_B}{@link GL33#GL_TEXTURE_SWIZZLE_A TEXTURE_SWIZZLE_A}{@link GL33#GL_TEXTURE_SWIZZLE_RGBA TEXTURE_SWIZZLE_RGBA}{@link GL11C#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}
{@link GL11C#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL14#GL_DEPTH_TEXTURE_MODE DEPTH_TEXTURE_MODE}{@link GL14#GL_GENERATE_MIPMAP GENERATE_MIPMAP}
{@link GL42#GL_IMAGE_FORMAT_COMPATIBILITY_TYPE IMAGE_FORMAT_COMPATIBILITY_TYPE}{@link GL42#GL_TEXTURE_IMMUTABLE_FORMAT TEXTURE_IMMUTABLE_FORMAT}{@link GL43#GL_TEXTURE_IMMUTABLE_LEVELS TEXTURE_IMMUTABLE_LEVELS}{@link GL43#GL_TEXTURE_VIEW_MIN_LEVEL TEXTURE_VIEW_MIN_LEVEL}
{@link GL43#GL_TEXTURE_VIEW_NUM_LEVELS TEXTURE_VIEW_NUM_LEVELS}{@link GL43#GL_TEXTURE_VIEW_MIN_LAYER TEXTURE_VIEW_MIN_LAYER}{@link GL43#GL_TEXTURE_VIEW_NUM_LAYERS TEXTURE_VIEW_NUM_LAYERS}
+ * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTexParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL11C.glGetTexParameteriv(target, pname, params); + } + + /** + * Place integer information about texture parameter {@code pname} for the specified {@code target} into {@code params}. + * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param pname the parameter to query. One of:
{@link GL12#GL_TEXTURE_BASE_LEVEL TEXTURE_BASE_LEVEL}{@link GL11C#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL11C#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}{@link GL12#GL_TEXTURE_MAX_LEVEL TEXTURE_MAX_LEVEL}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}
{@link GL11C#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL33#GL_TEXTURE_SWIZZLE_R TEXTURE_SWIZZLE_R}{@link GL33#GL_TEXTURE_SWIZZLE_G TEXTURE_SWIZZLE_G}
{@link GL33#GL_TEXTURE_SWIZZLE_B TEXTURE_SWIZZLE_B}{@link GL33#GL_TEXTURE_SWIZZLE_A TEXTURE_SWIZZLE_A}{@link GL33#GL_TEXTURE_SWIZZLE_RGBA TEXTURE_SWIZZLE_RGBA}{@link GL11C#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}
{@link GL11C#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL14#GL_DEPTH_TEXTURE_MODE DEPTH_TEXTURE_MODE}{@link GL14#GL_GENERATE_MIPMAP GENERATE_MIPMAP}
{@link GL42#GL_IMAGE_FORMAT_COMPATIBILITY_TYPE IMAGE_FORMAT_COMPATIBILITY_TYPE}{@link GL42#GL_TEXTURE_IMMUTABLE_FORMAT TEXTURE_IMMUTABLE_FORMAT}{@link GL43#GL_TEXTURE_IMMUTABLE_LEVELS TEXTURE_IMMUTABLE_LEVELS}{@link GL43#GL_TEXTURE_VIEW_MIN_LEVEL TEXTURE_VIEW_MIN_LEVEL}
{@link GL43#GL_TEXTURE_VIEW_NUM_LEVELS TEXTURE_VIEW_NUM_LEVELS}{@link GL43#GL_TEXTURE_VIEW_MIN_LAYER TEXTURE_VIEW_MIN_LAYER}{@link GL43#GL_TEXTURE_VIEW_NUM_LAYERS TEXTURE_VIEW_NUM_LAYERS}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetTexParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + return GL11C.glGetTexParameteri(target, pname); + } + + // --- [ glGetTexParameterfv ] --- + + /** Unsafe version of: {@link #glGetTexParameterfv GetTexParameterfv} */ + public static void nglGetTexParameterfv(int target, int pname, long params) { + GL11C.nglGetTexParameterfv(target, pname, params); + } + + /** + * Float version of {@link #glGetTexParameteriv GetTexParameteriv}. + * + * @param target the texture target + * @param pname the parameter to query + * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTexParameterfv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + GL11C.glGetTexParameterfv(target, pname, params); + } + + /** + * Float version of {@link #glGetTexParameteriv GetTexParameteriv}. + * + * @param target the texture target + * @param pname the parameter to query + * + * @see Reference Page + */ + @NativeType("void") + public static float glGetTexParameterf(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + return GL11C.glGetTexParameterf(target, pname); + } + + // --- [ glHint ] --- + + /** + * Certain aspects of GL behavior, when there is room for variation, may be controlled with this function. The initial value for all hints is + * {@link GL11C#GL_DONT_CARE DONT_CARE}. + * + * @param target the behavior to control. One of:
{@link GL11C#GL_LINE_SMOOTH_HINT LINE_SMOOTH_HINT}{@link GL11C#GL_POLYGON_SMOOTH_HINT POLYGON_SMOOTH_HINT}{@link GL13#GL_TEXTURE_COMPRESSION_HINT TEXTURE_COMPRESSION_HINT}
{@link GL20#GL_FRAGMENT_SHADER_DERIVATIVE_HINT FRAGMENT_SHADER_DERIVATIVE_HINT}
+ * @param hint the behavior hint. One of:
{@link GL11C#GL_FASTEST FASTEST}{@link GL11C#GL_NICEST NICEST}{@link GL11C#GL_DONT_CARE DONT_CARE}
+ * + * @see Reference Page + */ + public static void glHint(@NativeType("GLenum") int target, @NativeType("GLenum") int hint) { + GL11C.glHint(target, hint); + } + + // --- [ glIndexi ] --- + + /** + * Updates the current (single-valued) color index. + * + * @param index the value to which the current color index should be set + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glIndexi(@NativeType("GLint") int index); + + // --- [ glIndexub ] --- + + /** + * Unsigned byte version of {@link #glIndexi Indexi}. + * + * @param index the value to which the current color index should be set + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glIndexub(@NativeType("GLubyte") byte index); + + // --- [ glIndexs ] --- + + /** + * Short version of {@link #glIndexi Indexi}. + * + * @param index the value to which the current color index should be set + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glIndexs(@NativeType("GLshort") short index); + + // --- [ glIndexf ] --- + + /** + * Float version of {@link #glIndexi Indexi}. + * + * @param index the value to which the current color index should be set + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glIndexf(@NativeType("GLfloat") float index); + + // --- [ glIndexd ] --- + + /** + * Double version of {@link #glIndexi Indexi}. + * + * @param index the value to which the current color index should be set + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glIndexd(@NativeType("GLdouble") double index); + + // --- [ glIndexiv ] --- + + /** Unsafe version of: {@link #glIndexiv Indexiv} */ + public static native void nglIndexiv(long index); + + /** + * Pointer version of {@link #glIndexi Indexi} + * + * @param index the value to which the current color index should be set + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glIndexiv(@NativeType("GLint const *") IntBuffer index) { + if (CHECKS) { + check(index, 1); + } + nglIndexiv(memAddress(index)); + } + + // --- [ glIndexubv ] --- + + /** Unsafe version of: {@link #glIndexubv Indexubv} */ + public static native void nglIndexubv(long index); + + /** + * Pointer version of {@link #glIndexub Indexub}. + * + * @param index the value to which the current color index should be set + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glIndexubv(@NativeType("GLubyte const *") ByteBuffer index) { + if (CHECKS) { + check(index, 1); + } + nglIndexubv(memAddress(index)); + } + + // --- [ glIndexsv ] --- + + /** Unsafe version of: {@link #glIndexsv Indexsv} */ + public static native void nglIndexsv(long index); + + /** + * Pointer version of {@link #glIndexs Indexs}. + * + * @param index the value to which the current color index should be set + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glIndexsv(@NativeType("GLshort const *") ShortBuffer index) { + if (CHECKS) { + check(index, 1); + } + nglIndexsv(memAddress(index)); + } + + // --- [ glIndexfv ] --- + + /** Unsafe version of: {@link #glIndexfv Indexfv} */ + public static native void nglIndexfv(long index); + + /** + * Pointer version of {@link #glIndexf Indexf}. + * + * @param index the value to which the current color index should be set + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glIndexfv(@NativeType("GLfloat const *") FloatBuffer index) { + if (CHECKS) { + check(index, 1); + } + nglIndexfv(memAddress(index)); + } + + // --- [ glIndexdv ] --- + + /** Unsafe version of: {@link #glIndexdv Indexdv} */ + public static native void nglIndexdv(long index); + + /** + * Pointer version of {@link #glIndexd Indexd}. + * + * @param index the value to which the current color index should be set + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glIndexdv(@NativeType("GLdouble const *") DoubleBuffer index) { + if (CHECKS) { + check(index, 1); + } + nglIndexdv(memAddress(index)); + } + + // --- [ glIndexMask ] --- + + /** + * The least significant n bits of mask, where n is the number of bits in a color index buffer, specify a mask. Where a 1 appears in this mask, the + * corresponding bit in the color index buffer (or buffers) is written; where a 0 appears, the bit is not written. This mask applies only in color index + * mode. + * + * @param mask the color index mask value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glIndexMask(@NativeType("GLuint") int mask); + + // --- [ glIndexPointer ] --- + + /** + * Unsafe version of: {@link #glIndexPointer IndexPointer} + * + * @param type the data type of the values stored in the array. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_SHORT SHORT}{@link #GL_INT INT}{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}
+ */ + public static native void nglIndexPointer(int type, int stride, long pointer); + + /** + * Specifies the location and organization of a color index array. + * + * @param type the data type of the values stored in the array. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_SHORT SHORT}{@link #GL_INT INT}{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the color index array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glIndexPointer(@NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + nglIndexPointer(type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a color index array. + * + * @param type the data type of the values stored in the array. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_SHORT SHORT}{@link #GL_INT INT}{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the color index array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glIndexPointer(@NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + nglIndexPointer(type, stride, pointer); + } + + /** + * Specifies the location and organization of a color index array. + * + * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the color index array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glIndexPointer(@NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + nglIndexPointer(GL11.GL_UNSIGNED_BYTE, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a color index array. + * + * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the color index array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glIndexPointer(@NativeType("GLsizei") int stride, @NativeType("void const *") ShortBuffer pointer) { + nglIndexPointer(GL11.GL_SHORT, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a color index array. + * + * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the color index array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glIndexPointer(@NativeType("GLsizei") int stride, @NativeType("void const *") IntBuffer pointer) { + nglIndexPointer(GL11.GL_INT, stride, memAddress(pointer)); + } + + // --- [ glInitNames ] --- + + /** + * Clears the selection name stack. + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glInitNames(); + + // --- [ glInterleavedArrays ] --- + + /** Unsafe version of: {@link #glInterleavedArrays InterleavedArrays} */ + public static native void nglInterleavedArrays(int format, int stride, long pointer); + + /** + * Efficiently initializes the six vertex arrays and their enables to one of 14 configurations. + * + * @param format the interleaved array format. One of:
{@link #GL_V2F V2F}{@link #GL_V3F V3F}{@link #GL_C4UB_V2F C4UB_V2F}{@link #GL_C4UB_V3F C4UB_V3F}{@link #GL_C3F_V3F C3F_V3F}{@link #GL_N3F_V3F N3F_V3F}{@link #GL_C4F_N3F_V3F C4F_N3F_V3F}{@link #GL_T2F_V3F T2F_V3F}
{@link #GL_T4F_V4F T4F_V4F}{@link #GL_T2F_C4UB_V3F T2F_C4UB_V3F}{@link #GL_T2F_C3F_V3F T2F_C3F_V3F}{@link #GL_T2F_N3F_V3F T2F_N3F_V3F}{@link #GL_T2F_C4F_N3F_V3F T2F_C4F_N3F_V3F}{@link #GL_T4F_C4F_N3F_V4F T4F_C4F_N3F_V4F}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the vertex array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glInterleavedArrays(@NativeType("GLenum") int format, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + nglInterleavedArrays(format, stride, memAddress(pointer)); + } + + /** + * Efficiently initializes the six vertex arrays and their enables to one of 14 configurations. + * + * @param format the interleaved array format. One of:
{@link #GL_V2F V2F}{@link #GL_V3F V3F}{@link #GL_C4UB_V2F C4UB_V2F}{@link #GL_C4UB_V3F C4UB_V3F}{@link #GL_C3F_V3F C3F_V3F}{@link #GL_N3F_V3F N3F_V3F}{@link #GL_C4F_N3F_V3F C4F_N3F_V3F}{@link #GL_T2F_V3F T2F_V3F}
{@link #GL_T4F_V4F T4F_V4F}{@link #GL_T2F_C4UB_V3F T2F_C4UB_V3F}{@link #GL_T2F_C3F_V3F T2F_C3F_V3F}{@link #GL_T2F_N3F_V3F T2F_N3F_V3F}{@link #GL_T2F_C4F_N3F_V3F T2F_C4F_N3F_V3F}{@link #GL_T4F_C4F_N3F_V4F T4F_C4F_N3F_V4F}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the vertex array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glInterleavedArrays(@NativeType("GLenum") int format, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + nglInterleavedArrays(format, stride, pointer); + } + + /** + * Efficiently initializes the six vertex arrays and their enables to one of 14 configurations. + * + * @param format the interleaved array format. One of:
{@link #GL_V2F V2F}{@link #GL_V3F V3F}{@link #GL_C4UB_V2F C4UB_V2F}{@link #GL_C4UB_V3F C4UB_V3F}{@link #GL_C3F_V3F C3F_V3F}{@link #GL_N3F_V3F N3F_V3F}{@link #GL_C4F_N3F_V3F C4F_N3F_V3F}{@link #GL_T2F_V3F T2F_V3F}
{@link #GL_T4F_V4F T4F_V4F}{@link #GL_T2F_C4UB_V3F T2F_C4UB_V3F}{@link #GL_T2F_C3F_V3F T2F_C3F_V3F}{@link #GL_T2F_N3F_V3F T2F_N3F_V3F}{@link #GL_T2F_C4F_N3F_V3F T2F_C4F_N3F_V3F}{@link #GL_T4F_C4F_N3F_V4F T4F_C4F_N3F_V4F}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the vertex array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glInterleavedArrays(@NativeType("GLenum") int format, @NativeType("GLsizei") int stride, @NativeType("void const *") ShortBuffer pointer) { + nglInterleavedArrays(format, stride, memAddress(pointer)); + } + + /** + * Efficiently initializes the six vertex arrays and their enables to one of 14 configurations. + * + * @param format the interleaved array format. One of:
{@link #GL_V2F V2F}{@link #GL_V3F V3F}{@link #GL_C4UB_V2F C4UB_V2F}{@link #GL_C4UB_V3F C4UB_V3F}{@link #GL_C3F_V3F C3F_V3F}{@link #GL_N3F_V3F N3F_V3F}{@link #GL_C4F_N3F_V3F C4F_N3F_V3F}{@link #GL_T2F_V3F T2F_V3F}
{@link #GL_T4F_V4F T4F_V4F}{@link #GL_T2F_C4UB_V3F T2F_C4UB_V3F}{@link #GL_T2F_C3F_V3F T2F_C3F_V3F}{@link #GL_T2F_N3F_V3F T2F_N3F_V3F}{@link #GL_T2F_C4F_N3F_V3F T2F_C4F_N3F_V3F}{@link #GL_T4F_C4F_N3F_V4F T4F_C4F_N3F_V4F}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the vertex array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glInterleavedArrays(@NativeType("GLenum") int format, @NativeType("GLsizei") int stride, @NativeType("void const *") IntBuffer pointer) { + nglInterleavedArrays(format, stride, memAddress(pointer)); + } + + /** + * Efficiently initializes the six vertex arrays and their enables to one of 14 configurations. + * + * @param format the interleaved array format. One of:
{@link #GL_V2F V2F}{@link #GL_V3F V3F}{@link #GL_C4UB_V2F C4UB_V2F}{@link #GL_C4UB_V3F C4UB_V3F}{@link #GL_C3F_V3F C3F_V3F}{@link #GL_N3F_V3F N3F_V3F}{@link #GL_C4F_N3F_V3F C4F_N3F_V3F}{@link #GL_T2F_V3F T2F_V3F}
{@link #GL_T4F_V4F T4F_V4F}{@link #GL_T2F_C4UB_V3F T2F_C4UB_V3F}{@link #GL_T2F_C3F_V3F T2F_C3F_V3F}{@link #GL_T2F_N3F_V3F T2F_N3F_V3F}{@link #GL_T2F_C4F_N3F_V3F T2F_C4F_N3F_V3F}{@link #GL_T4F_C4F_N3F_V4F T4F_C4F_N3F_V4F}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the vertex array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glInterleavedArrays(@NativeType("GLenum") int format, @NativeType("GLsizei") int stride, @NativeType("void const *") FloatBuffer pointer) { + nglInterleavedArrays(format, stride, memAddress(pointer)); + } + + /** + * Efficiently initializes the six vertex arrays and their enables to one of 14 configurations. + * + * @param format the interleaved array format. One of:
{@link #GL_V2F V2F}{@link #GL_V3F V3F}{@link #GL_C4UB_V2F C4UB_V2F}{@link #GL_C4UB_V3F C4UB_V3F}{@link #GL_C3F_V3F C3F_V3F}{@link #GL_N3F_V3F N3F_V3F}{@link #GL_C4F_N3F_V3F C4F_N3F_V3F}{@link #GL_T2F_V3F T2F_V3F}
{@link #GL_T4F_V4F T4F_V4F}{@link #GL_T2F_C4UB_V3F T2F_C4UB_V3F}{@link #GL_T2F_C3F_V3F T2F_C3F_V3F}{@link #GL_T2F_N3F_V3F T2F_N3F_V3F}{@link #GL_T2F_C4F_N3F_V3F T2F_C4F_N3F_V3F}{@link #GL_T4F_C4F_N3F_V4F T4F_C4F_N3F_V4F}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the vertex array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glInterleavedArrays(@NativeType("GLenum") int format, @NativeType("GLsizei") int stride, @NativeType("void const *") DoubleBuffer pointer) { + nglInterleavedArrays(format, stride, memAddress(pointer)); + } + + // --- [ glIsEnabled ] --- + + /** + * Determines if {@code cap} is currently enabled (as with {@link #glEnable Enable}) or disabled. + * + * @param cap the enable state to query + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static boolean glIsEnabled(@NativeType("GLenum") int cap) { + return GL11C.glIsEnabled(cap); + } + + // --- [ glIsList ] --- + + /** + * Returns true if the {@code list} is the index of some display list. + * + * @param list the list index to query + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + @NativeType("GLboolean") + public static native boolean glIsList(@NativeType("GLuint") int list); + + // --- [ glIsTexture ] --- + + /** + * Returns true if {@code texture} is the name of a texture object. + * + * @param texture the texture name to query + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static boolean glIsTexture(@NativeType("GLuint") int texture) { + return GL11C.glIsTexture(texture); + } + + // --- [ glLightModeli ] --- + + /** + * Set the integer value of a lighting model parameter. + * + * @param pname the lighting model parameter to set. One of:
{@link #GL_LIGHT_MODEL_AMBIENT LIGHT_MODEL_AMBIENT}{@link #GL_LIGHT_MODEL_LOCAL_VIEWER LIGHT_MODEL_LOCAL_VIEWER}{@link #GL_LIGHT_MODEL_TWO_SIDE LIGHT_MODEL_TWO_SIDE}
{@link GL12#GL_LIGHT_MODEL_COLOR_CONTROL LIGHT_MODEL_COLOR_CONTROL}
+ * @param param the parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glLightModeli(@NativeType("GLenum") int pname, @NativeType("GLint") int param); + + // --- [ glLightModelf ] --- + + /** + * Float version of {@link #glLightModeli LightModeli}. + * + * @param pname the lighting model parameter to set + * @param param the parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glLightModelf(@NativeType("GLenum") int pname, @NativeType("GLfloat") float param); + + // --- [ glLightModeliv ] --- + + /** Unsafe version of: {@link #glLightModeliv LightModeliv} */ + public static native void nglLightModeliv(int pname, long params); + + /** + * Pointer version of {@link #glLightModeli LightModeli}. + * + * @param pname the lighting model parameter to set + * @param params the parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glLightModeliv(@NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglLightModeliv(pname, memAddress(params)); + } + + // --- [ glLightModelfv ] --- + + /** Unsafe version of: {@link #glLightModelfv LightModelfv} */ + public static native void nglLightModelfv(int pname, long params); + + /** + * Pointer version of {@link #glLightModelf LightModelf}. + * + * @param pname the lighting model parameter to set + * @param params the parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glLightModelfv(@NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglLightModelfv(pname, memAddress(params)); + } + + // --- [ glLighti ] --- + + /** + * Sets the integer value of a light parameter. + * + * @param light the light for which to set the parameter. One of:
{@link #GL_LIGHT0 LIGHT0}GL_LIGHT[1-7]
+ * @param pname the parameter to set. One of:
{@link #GL_AMBIENT AMBIENT}{@link #GL_DIFFUSE DIFFUSE}{@link #GL_SPECULAR SPECULAR}{@link #GL_POSITION POSITION}{@link #GL_CONSTANT_ATTENUATION CONSTANT_ATTENUATION}{@link #GL_LINEAR_ATTENUATION LINEAR_ATTENUATION}
{@link #GL_QUADRATIC_ATTENUATION QUADRATIC_ATTENUATION}{@link #GL_SPOT_DIRECTION SPOT_DIRECTION}{@link #GL_SPOT_EXPONENT SPOT_EXPONENT}{@link #GL_SPOT_CUTOFF SPOT_CUTOFF}
+ * @param param the parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glLighti(@NativeType("GLenum") int light, @NativeType("GLenum") int pname, @NativeType("GLint") int param); + + // --- [ glLightf ] --- + + /** + * Float version of {@link #glLighti Lighti}. + * + * @param light the light for which to set the parameter + * @param pname the parameter to set + * @param param the parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glLightf(@NativeType("GLenum") int light, @NativeType("GLenum") int pname, @NativeType("GLfloat") float param); + + // --- [ glLightiv ] --- + + /** Unsafe version of: {@link #glLightiv Lightiv} */ + public static native void nglLightiv(int light, int pname, long params); + + /** + * Pointer version of {@link #glLighti Lighti}. + * + * @param light the light for which to set the parameter + * @param pname the parameter to set + * @param params the parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glLightiv(@NativeType("GLenum") int light, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglLightiv(light, pname, memAddress(params)); + } + + // --- [ glLightfv ] --- + + /** Unsafe version of: {@link #glLightfv Lightfv} */ + public static native void nglLightfv(int light, int pname, long params); + + /** + * Pointer version of {@link #glLightf Lightf}. + * + * @param light the light for which to set the parameter + * @param pname the parameter to set + * @param params the parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glLightfv(@NativeType("GLenum") int light, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglLightfv(light, pname, memAddress(params)); + } + + // --- [ glLineStipple ] --- + + /** + * Defines a line stipple. It determines those fragments that are to be drawn when the line is rasterized. Line stippling may be enabled or disabled using + * {@link #glEnable Enable} or {@link #glDisable Disable} with the constant {@link #GL_LINE_STIPPLE LINE_STIPPLE}. When disabled, it is as if the line stipple has its default value. + * + * @param factor a count that is used to modify the effective line stipple by causing each bit in pattern to be used {@code factor} times. {@code factor} is clamped + * to the range [1, 256]. + * @param pattern an unsigned short integer whose 16 bits define the stipple pattern + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glLineStipple(@NativeType("GLint") int factor, @NativeType("GLushort") short pattern); + + // --- [ glLineWidth ] --- + + /** + * Sets the width of rasterized line segments. The default width is 1.0. + * + * @param width the line width + * + * @see Reference Page + */ + public static void glLineWidth(@NativeType("GLfloat") float width) { + GL11C.glLineWidth(width); + } + + // --- [ glListBase ] --- + + /** + * Sets the display list base. + * + * @param base the display list base offset + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glListBase(@NativeType("GLuint") int base); + + // --- [ glLoadMatrixf ] --- + + /** Unsafe version of: {@link #glLoadMatrixf LoadMatrixf} */ + public static native void nglLoadMatrixf(long m); + + /** + * Sets the current matrix to a 4 × 4 matrix in column-major order. + * + *

The matrix is stored as 16 consecutive values, i.e. as:

+ * + * + * + * + * + * + *
a1a5a9a13
a2a6a10a14
a3a7a11a15
a4a8a12a16
+ * + *

This differs from the standard row-major ordering for matrix elements. If the standard ordering is used, all of the subsequent transformation equations + * are transposed, and the columns representing vectors become rows.

+ * + * @param m the matrix data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glLoadMatrixf(@NativeType("GLfloat const *") FloatBuffer m) { + if (CHECKS) { + check(m, 16); + } + nglLoadMatrixf(memAddress(m)); + } + + // --- [ glLoadMatrixd ] --- + + /** Unsafe version of: {@link #glLoadMatrixd LoadMatrixd} */ + public static native void nglLoadMatrixd(long m); + + /** + * Double version of {@link #glLoadMatrixf LoadMatrixf}. + * + * @param m the matrix data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glLoadMatrixd(@NativeType("GLdouble const *") DoubleBuffer m) { + if (CHECKS) { + check(m, 16); + } + nglLoadMatrixd(memAddress(m)); + } + + // --- [ glLoadIdentity ] --- + + /** + * Sets the current matrix to the identity matrix. + * + *

Calling this function is equivalent to calling {@link #glLoadMatrixf LoadMatrixf} with the following matrix:

+ * + * + * + * + * + * + *
1000
0100
0010
0001
+ * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glLoadIdentity(); + + // --- [ glLoadName ] --- + + /** + * Replaces the value on the top of the selection stack with {@code name}. + * + * @param name the name to load + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glLoadName(@NativeType("GLuint") int name); + + // --- [ glLogicOp ] --- + + /** + * Sets the logical framebuffer operation. + * + * @param op the operation to set. One of:
{@link GL11C#GL_CLEAR CLEAR}{@link GL11C#GL_AND AND}{@link GL11C#GL_AND_REVERSE AND_REVERSE}{@link GL11C#GL_COPY COPY}{@link GL11C#GL_AND_INVERTED AND_INVERTED}{@link GL11C#GL_NOOP NOOP}{@link GL11C#GL_XOR XOR}{@link GL11C#GL_OR OR}{@link GL11C#GL_NOR NOR}{@link GL11C#GL_EQUIV EQUIV}{@link GL11C#GL_INVERT INVERT}{@link GL11C#GL_OR_REVERSE OR_REVERSE}{@link GL11C#GL_COPY_INVERTED COPY_INVERTED}
{@link GL11C#GL_OR_INVERTED OR_INVERTED}{@link GL11C#GL_NAND NAND}{@link GL11C#GL_SET SET}
+ * + * @see Reference Page + */ + public static void glLogicOp(@NativeType("GLenum") int op) { + GL11C.glLogicOp(op); + } + + // --- [ glMap1f ] --- + + /** Unsafe version of: {@link #glMap1f Map1f} */ + public static native void nglMap1f(int target, float u1, float u2, int stride, int order, long points); + + /** + * Defines a polynomial or rational polynomial mapping to produce vertex, normal, texture coordinates and colors. The values so produced are sent on to + * further stages of the GL as if they had been provided directly by the client. + * + * @param target the evaluator target. One of:
{@link #GL_MAP1_VERTEX_3 MAP1_VERTEX_3}{@link #GL_MAP1_VERTEX_4 MAP1_VERTEX_4}{@link #GL_MAP1_COLOR_4 MAP1_COLOR_4}{@link #GL_MAP1_NORMAL MAP1_NORMAL}{@link #GL_MAP1_TEXTURE_COORD_1 MAP1_TEXTURE_COORD_1}
{@link #GL_MAP1_TEXTURE_COORD_2 MAP1_TEXTURE_COORD_2}{@link #GL_MAP1_TEXTURE_COORD_3 MAP1_TEXTURE_COORD_3}{@link #GL_MAP1_TEXTURE_COORD_4 MAP1_TEXTURE_COORD_4}
+ * @param u1 the first endpoint of the pre-image of the map + * @param u2 the second endpoint of the pre-image of the map + * @param stride the number of values in each block of storage + * @param order the polynomial order + * @param points a set of {@code order} blocks of storage containing control points + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMap1f(@NativeType("GLenum") int target, @NativeType("GLfloat") float u1, @NativeType("GLfloat") float u2, @NativeType("GLint") int stride, @NativeType("GLint") int order, @NativeType("GLfloat const *") FloatBuffer points) { + if (CHECKS) { + check(points, order * stride); + } + nglMap1f(target, u1, u2, stride, order, memAddress(points)); + } + + // --- [ glMap1d ] --- + + /** Unsafe version of: {@link #glMap1d Map1d} */ + public static native void nglMap1d(int target, double u1, double u2, int stride, int order, long points); + + /** + * Double version of {@link #glMap1f Map1f}. + * + * @param target the evaluator target + * @param u1 the first endpoint of the pre-image of the map + * @param u2 the second endpoint of the pre-image of the map + * @param stride the number of values in each block of storage + * @param order the polynomial order + * @param points a set of {@code order} blocks of storage containing control points + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMap1d(@NativeType("GLenum") int target, @NativeType("GLdouble") double u1, @NativeType("GLdouble") double u2, @NativeType("GLint") int stride, @NativeType("GLint") int order, @NativeType("GLdouble const *") DoubleBuffer points) { + if (CHECKS) { + check(points, stride * order); + } + nglMap1d(target, u1, u2, stride, order, memAddress(points)); + } + + // --- [ glMap2f ] --- + + /** Unsafe version of: {@link #glMap2f Map2f} */ + public static native void nglMap2f(int target, float u1, float u2, int ustride, int uorder, float v1, float v2, int vstride, int vorder, long points); + + /** + * Bivariate version of {@link #glMap1f Map1f}. + * + * @param target the evaluator target + * @param u1 the first u-dimension endpoint of the pre-image rectangle of the map + * @param u2 the second u-dimension endpoint of the pre-image rectangle of the map + * @param ustride the number of values in the u-dimension in each block of storage + * @param uorder the polynomial order in the u-dimension + * @param v1 the first v-dimension endpoint of the pre-image rectangle of the map + * @param v2 the second v-dimension endpoint of the pre-image rectangle of the map + * @param vstride the number of values in the v-dimension in each block of storage + * @param vorder the polynomial order in the v-dimension + * @param points a set of uorder × vorder blocks of storage containing control points + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMap2f(@NativeType("GLenum") int target, @NativeType("GLfloat") float u1, @NativeType("GLfloat") float u2, @NativeType("GLint") int ustride, @NativeType("GLint") int uorder, @NativeType("GLfloat") float v1, @NativeType("GLfloat") float v2, @NativeType("GLint") int vstride, @NativeType("GLint") int vorder, @NativeType("GLfloat const *") FloatBuffer points) { + if (CHECKS) { + check(points, ustride * uorder * vstride * vorder); + } + nglMap2f(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, memAddress(points)); + } + + // --- [ glMap2d ] --- + + /** Unsafe version of: {@link #glMap2d Map2d} */ + public static native void nglMap2d(int target, double u1, double u2, int ustride, int uorder, double v1, double v2, int vstride, int vorder, long points); + + /** + * Double version of {@link #glMap2f Map2f}. + * + * @param target the evaluator target + * @param u1 the first u-dimension endpoint of the pre-image rectangle of the map + * @param u2 the second u-dimension endpoint of the pre-image rectangle of the map + * @param ustride the number of values in the u-dimension in each block of storage + * @param uorder the polynomial order in the u-dimension + * @param v1 the first v-dimension endpoint of the pre-image rectangle of the map + * @param v2 the second v-dimension endpoint of the pre-image rectangle of the map + * @param vstride the number of values in the v-dimension in each block of storage + * @param vorder the polynomial order in the v-dimension + * @param points a set of uorder × vorder blocks of storage containing control points + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMap2d(@NativeType("GLenum") int target, @NativeType("GLdouble") double u1, @NativeType("GLdouble") double u2, @NativeType("GLint") int ustride, @NativeType("GLint") int uorder, @NativeType("GLdouble") double v1, @NativeType("GLdouble") double v2, @NativeType("GLint") int vstride, @NativeType("GLint") int vorder, @NativeType("GLdouble const *") DoubleBuffer points) { + if (CHECKS) { + check(points, ustride * uorder * vstride * vorder); + } + nglMap2d(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, memAddress(points)); + } + + // --- [ glMapGrid1f ] --- + + /** + * Defines a one-dimensional grid in the map evaluator domain. + * + * @param n the number of partitions of the interval + * @param u1 the first interval endpoint + * @param u2 the second interval endpoint + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMapGrid1f(@NativeType("GLint") int n, @NativeType("GLfloat") float u1, @NativeType("GLfloat") float u2); + + // --- [ glMapGrid1d ] --- + + /** + * Double version of {@link #glMapGrid1f MapGrid1f}. + * + * @param n the number of partitions of the interval + * @param u1 the first interval endpoint + * @param u2 the second interval endpoint + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMapGrid1d(@NativeType("GLint") int n, @NativeType("GLdouble") double u1, @NativeType("GLdouble") double u2); + + // --- [ glMapGrid2f ] --- + + /** + * Defines a two-dimensional grid in the map evaluator domain. + * + * @param un the number of partitions of the interval in the u-dimension + * @param u1 the first u-dimension interval endpoint + * @param u2 the second u-dimension interval endpoint + * @param vn the number of partitions of the interval in the v-dimension + * @param v1 the first v-dimension interval endpoint + * @param v2 the second v-dimension interval endpoint + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMapGrid2f(@NativeType("GLint") int un, @NativeType("GLfloat") float u1, @NativeType("GLfloat") float u2, @NativeType("GLint") int vn, @NativeType("GLfloat") float v1, @NativeType("GLfloat") float v2); + + // --- [ glMapGrid2d ] --- + + /** + * Double version of {@link #glMapGrid2f MapGrid2f}. + * + * @param un the number of partitions of the interval in the u-dimension + * @param u1 the first u-dimension interval endpoint + * @param u2 the second u-dimension interval endpoint + * @param vn the number of partitions of the interval in the v-dimension + * @param v1 the first v-dimension interval endpoint + * @param v2 the second v-dimension interval endpoint + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMapGrid2d(@NativeType("GLint") int un, @NativeType("GLdouble") double u1, @NativeType("GLdouble") double u2, @NativeType("GLint") int vn, @NativeType("GLdouble") double v1, @NativeType("GLdouble") double v2); + + // --- [ glMateriali ] --- + + /** + * Sets the integer value of a material parameter. + * + * @param face the material face for which to set the parameter. One of:
{@link #GL_FRONT FRONT}{@link #GL_BACK BACK}{@link #GL_FRONT_AND_BACK FRONT_AND_BACK}
+ * @param pname the parameter to set. Must be:
{@link #GL_SHININESS SHININESS}
+ * @param param the parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMateriali(@NativeType("GLenum") int face, @NativeType("GLenum") int pname, @NativeType("GLint") int param); + + // --- [ glMaterialf ] --- + + /** + * Float version of {@link #glMateriali Materiali}. + * + * @param face the material face for which to set the parameter + * @param pname the parameter to set + * @param param the parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMaterialf(@NativeType("GLenum") int face, @NativeType("GLenum") int pname, @NativeType("GLfloat") float param); + + // --- [ glMaterialiv ] --- + + /** Unsafe version of: {@link #glMaterialiv Materialiv} */ + public static native void nglMaterialiv(int face, int pname, long params); + + /** + * Pointer version of {@link #glMateriali Materiali}. + * + * @param face the material face for which to set the parameter + * @param pname the parameter to set. One of:
{@link #GL_AMBIENT AMBIENT}{@link #GL_DIFFUSE DIFFUSE}{@link #GL_AMBIENT_AND_DIFFUSE AMBIENT_AND_DIFFUSE}{@link #GL_SPECULAR SPECULAR}{@link #GL_EMISSION EMISSION}
+ * @param params the parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMaterialiv(@NativeType("GLenum") int face, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglMaterialiv(face, pname, memAddress(params)); + } + + // --- [ glMaterialfv ] --- + + /** Unsafe version of: {@link #glMaterialfv Materialfv} */ + public static native void nglMaterialfv(int face, int pname, long params); + + /** + * Pointer version of {@link #glMaterialf Materialf}. + * + * @param face the material face for which to set the parameter + * @param pname the parameter to set + * @param params the parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMaterialfv(@NativeType("GLenum") int face, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglMaterialfv(face, pname, memAddress(params)); + } + + // --- [ glMatrixMode ] --- + + /** + * Set the current matrix mode. + * + * @param mode the matrix mode. One of:
{@link #GL_MODELVIEW MODELVIEW}{@link #GL_PROJECTION PROJECTION}{@link #GL_TEXTURE TEXTURE}{@link #GL_COLOR COLOR}
+ * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMatrixMode(@NativeType("GLenum") int mode); + + // --- [ glMultMatrixf ] --- + + /** Unsafe version of: {@link #glMultMatrixf MultMatrixf} */ + public static native void nglMultMatrixf(long m); + + /** + * Multiplies the current matrix with a 4 × 4 matrix in column-major order. See {@link #glLoadMatrixf LoadMatrixf} for details. + * + * @param m the matrix data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultMatrixf(@NativeType("GLfloat const *") FloatBuffer m) { + if (CHECKS) { + check(m, 16); + } + nglMultMatrixf(memAddress(m)); + } + + // --- [ glMultMatrixd ] --- + + /** Unsafe version of: {@link #glMultMatrixd MultMatrixd} */ + public static native void nglMultMatrixd(long m); + + /** + * Double version of {@link #glMultMatrixf MultMatrixf}. + * + * @param m the matrix data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultMatrixd(@NativeType("GLdouble const *") DoubleBuffer m) { + if (CHECKS) { + check(m, 16); + } + nglMultMatrixd(memAddress(m)); + } + + // --- [ glFrustum ] --- + + /** + * Manipulates the current matrix with a matrix that produces perspective projection, in such a way that the coordinates (lb – n)T + * and (rt – n)T specify the points on the near clipping plane that are mapped to the lower left and upper right corners of the + * window, respectively (assuming that the eye is located at (0 0 0)T). {@code f} gives the distance from the eye to the far clipping + * plane. + * + *

Calling this function is equivalent to calling {@link #glMultMatrixf MultMatrixf} with the following matrix:

+ * + * + * + * + * + * + *
2n / (r - l)0(r + l) / (r - l)0
02n / (t - b)(t + b) / (t - b)0
00- (f + n) / (f - n)- (2fn) / (f - n)
00-10
+ * + * @param l the left frustum plane + * @param r the right frustum plane + * @param b the bottom frustum plane + * @param t the top frustum plane + * @param n the near frustum plane + * @param f the far frustum plane + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glFrustum(@NativeType("GLdouble") double l, @NativeType("GLdouble") double r, @NativeType("GLdouble") double b, @NativeType("GLdouble") double t, @NativeType("GLdouble") double n, @NativeType("GLdouble") double f); + + // --- [ glNewList ] --- + + /** + * Begins the definition of a display list. + * + * @param n a positive integer to which the display list that follows is assigned + * @param mode a symbolic constant that controls the behavior of the GL during display list creation. One of:
{@link #GL_COMPILE COMPILE}{@link #GL_COMPILE_AND_EXECUTE COMPILE_AND_EXECUTE}
+ * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glNewList(@NativeType("GLuint") int n, @NativeType("GLenum") int mode); + + // --- [ glEndList ] --- + + /** + * Ends the definition of GL commands to be placed in a display list. It is only when {@code EndList} occurs that the specified display list is actually + * associated with the index indicated with {@link #glNewList NewList}. + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glEndList(); + + // --- [ glNormal3f ] --- + + /** + * Sets the current normal. + * + * @param nx the x coordinate of the current normal + * @param ny the y coordinate of the current normal + * @param nz the z coordinate of the current normal + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glNormal3f(@NativeType("GLfloat") float nx, @NativeType("GLfloat") float ny, @NativeType("GLfloat") float nz); + + // --- [ glNormal3b ] --- + + /** + * Byte version of {@link #glNormal3f Normal3f}. + * + * @param nx the x coordinate of the current normal + * @param ny the y coordinate of the current normal + * @param nz the z coordinate of the current normal + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glNormal3b(@NativeType("GLbyte") byte nx, @NativeType("GLbyte") byte ny, @NativeType("GLbyte") byte nz); + + // --- [ glNormal3s ] --- + + /** + * Short version of {@link #glNormal3f Normal3f}. + * + * @param nx the x coordinate of the current normal + * @param ny the y coordinate of the current normal + * @param nz the z coordinate of the current normal + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glNormal3s(@NativeType("GLshort") short nx, @NativeType("GLshort") short ny, @NativeType("GLshort") short nz); + + // --- [ glNormal3i ] --- + + /** + * Integer version of {@link #glNormal3f Normal3f}. + * + * @param nx the x coordinate of the current normal + * @param ny the y coordinate of the current normal + * @param nz the z coordinate of the current normal + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glNormal3i(@NativeType("GLint") int nx, @NativeType("GLint") int ny, @NativeType("GLint") int nz); + + // --- [ glNormal3d ] --- + + /** + * Double version of {@link #glNormal3f Normal3f}. + * + * @param nx the x coordinate of the current normal + * @param ny the y coordinate of the current normal + * @param nz the z coordinate of the current normal + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glNormal3d(@NativeType("GLdouble") double nx, @NativeType("GLdouble") double ny, @NativeType("GLdouble") double nz); + + // --- [ glNormal3fv ] --- + + /** Unsafe version of: {@link #glNormal3fv Normal3fv} */ + public static native void nglNormal3fv(long v); + + /** + * Pointer version of {@link #glNormal3f Normal3f}. + * + * @param v the normal buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glNormal3fv(@NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglNormal3fv(memAddress(v)); + } + + // --- [ glNormal3bv ] --- + + /** Unsafe version of: {@link #glNormal3bv Normal3bv} */ + public static native void nglNormal3bv(long v); + + /** + * Pointer version of {@link #glNormal3b Normal3b}. + * + * @param v the normal buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glNormal3bv(@NativeType("GLbyte const *") ByteBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglNormal3bv(memAddress(v)); + } + + // --- [ glNormal3sv ] --- + + /** Unsafe version of: {@link #glNormal3sv Normal3sv} */ + public static native void nglNormal3sv(long v); + + /** + * Pointer version of {@link #glNormal3s Normal3s}. + * + * @param v the normal buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glNormal3sv(@NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglNormal3sv(memAddress(v)); + } + + // --- [ glNormal3iv ] --- + + /** Unsafe version of: {@link #glNormal3iv Normal3iv} */ + public static native void nglNormal3iv(long v); + + /** + * Pointer version of {@link #glNormal3i Normal3i}. + * + * @param v the normal buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glNormal3iv(@NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglNormal3iv(memAddress(v)); + } + + // --- [ glNormal3dv ] --- + + /** Unsafe version of: {@link #glNormal3dv Normal3dv} */ + public static native void nglNormal3dv(long v); + + /** + * Pointer version of {@link #glNormal3d Normal3d}. + * + * @param v the normal buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glNormal3dv(@NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglNormal3dv(memAddress(v)); + } + + // --- [ glNormalPointer ] --- + + /** Unsafe version of: {@link #glNormalPointer NormalPointer} */ + public static native void nglNormalPointer(int type, int stride, long pointer); + + /** + * Specifies the location and organization of a normal array. + * + * @param type the data type of the values stored in the array. One of:
{@link #GL_BYTE BYTE}{@link #GL_SHORT SHORT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the normal array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glNormalPointer(@NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + nglNormalPointer(type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a normal array. + * + * @param type the data type of the values stored in the array. One of:
{@link #GL_BYTE BYTE}{@link #GL_SHORT SHORT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the normal array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glNormalPointer(@NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + nglNormalPointer(type, stride, pointer); + } + + /** + * Specifies the location and organization of a normal array. + * + * @param type the data type of the values stored in the array. One of:
{@link #GL_BYTE BYTE}{@link #GL_SHORT SHORT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the normal array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glNormalPointer(@NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ShortBuffer pointer) { + nglNormalPointer(type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a normal array. + * + * @param type the data type of the values stored in the array. One of:
{@link #GL_BYTE BYTE}{@link #GL_SHORT SHORT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the normal array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glNormalPointer(@NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") IntBuffer pointer) { + nglNormalPointer(type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a normal array. + * + * @param type the data type of the values stored in the array. One of:
{@link #GL_BYTE BYTE}{@link #GL_SHORT SHORT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the normal array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glNormalPointer(@NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") FloatBuffer pointer) { + nglNormalPointer(type, stride, memAddress(pointer)); + } + + // --- [ glOrtho ] --- + + /** + * Manipulates the current matrix with a matrix that produces parallel projection, in such a way that the coordinates (lb – n)T + * and (rt – n)T specify the points on the near clipping plane that are mapped to the lower left and upper right corners of the + * window, respectively (assuming that the eye is located at (0 0 0)T). {@code f} gives the distance from the eye to the far clipping + * plane. + * + *

Calling this function is equivalent to calling {@link #glMultMatrixf MultMatrixf} with the following matrix:

+ * + * + * + * + * + * + *
2 / (r - l)00- (r + l) / (r - l)
02 / (t - b)0- (t + b) / (t - b)
00- 2 / (f - n)- (f + n) / (f - n)
0001
+ * + * @param l the left frustum plane + * @param r the right frustum plane + * @param b the bottom frustum plane + * @param t the top frustum plane + * @param n the near frustum plane + * @param f the far frustum plane + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glOrtho(@NativeType("GLdouble") double l, @NativeType("GLdouble") double r, @NativeType("GLdouble") double b, @NativeType("GLdouble") double t, @NativeType("GLdouble") double n, @NativeType("GLdouble") double f); + + // --- [ glPassThrough ] --- + + /** + * Inserts a marker when the GL is in feeback mode. {@code token} is returned as if it were a primitive; it is indicated with its own unique identifying + * value. The ordering of any {@code PassThrough} commands with respect to primitive specification is maintained by feedback. {@code PassThrough} may + * not occur between {@link #glBegin Begin} and {@link #glEnd End}. + * + * @param token the marker value to insert + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glPassThrough(@NativeType("GLfloat") float token); + + // --- [ glPixelMapfv ] --- + + /** + * Unsafe version of: {@link #glPixelMapfv PixelMapfv} + * + * @param size the map size + */ + public static native void nglPixelMapfv(int map, int size, long values); + + /** + * Sets a pixel map lookup table. + * + * @param map the map to set. One of:
{@link #GL_PIXEL_MAP_I_TO_I PIXEL_MAP_I_TO_I}{@link #GL_PIXEL_MAP_S_TO_S PIXEL_MAP_S_TO_S}{@link #GL_PIXEL_MAP_I_TO_R PIXEL_MAP_I_TO_R}{@link #GL_PIXEL_MAP_I_TO_G PIXEL_MAP_I_TO_G}{@link #GL_PIXEL_MAP_I_TO_B PIXEL_MAP_I_TO_B}
{@link #GL_PIXEL_MAP_I_TO_A PIXEL_MAP_I_TO_A}{@link #GL_PIXEL_MAP_R_TO_R PIXEL_MAP_R_TO_R}{@link #GL_PIXEL_MAP_G_TO_G PIXEL_MAP_G_TO_G}{@link #GL_PIXEL_MAP_B_TO_B PIXEL_MAP_B_TO_B}{@link #GL_PIXEL_MAP_A_TO_A PIXEL_MAP_A_TO_A}
+ * @param size the map size + * @param values the map values + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glPixelMapfv(@NativeType("GLenum") int map, @NativeType("GLsizei") int size, @NativeType("GLfloat const *") long values) { + nglPixelMapfv(map, size, values); + } + + /** + * Sets a pixel map lookup table. + * + * @param map the map to set. One of:
{@link #GL_PIXEL_MAP_I_TO_I PIXEL_MAP_I_TO_I}{@link #GL_PIXEL_MAP_S_TO_S PIXEL_MAP_S_TO_S}{@link #GL_PIXEL_MAP_I_TO_R PIXEL_MAP_I_TO_R}{@link #GL_PIXEL_MAP_I_TO_G PIXEL_MAP_I_TO_G}{@link #GL_PIXEL_MAP_I_TO_B PIXEL_MAP_I_TO_B}
{@link #GL_PIXEL_MAP_I_TO_A PIXEL_MAP_I_TO_A}{@link #GL_PIXEL_MAP_R_TO_R PIXEL_MAP_R_TO_R}{@link #GL_PIXEL_MAP_G_TO_G PIXEL_MAP_G_TO_G}{@link #GL_PIXEL_MAP_B_TO_B PIXEL_MAP_B_TO_B}{@link #GL_PIXEL_MAP_A_TO_A PIXEL_MAP_A_TO_A}
+ * @param values the map values + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glPixelMapfv(@NativeType("GLenum") int map, @NativeType("GLfloat const *") FloatBuffer values) { + nglPixelMapfv(map, values.remaining(), memAddress(values)); + } + + // --- [ glPixelMapusv ] --- + + /** + * Unsafe version of: {@link #glPixelMapusv PixelMapusv} + * + * @param size the map size + */ + public static native void nglPixelMapusv(int map, int size, long values); + + /** + * Unsigned short version of {@link #glPixelMapfv PixelMapfv}. + * + * @param map the map to set + * @param size the map size + * @param values the map values + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glPixelMapusv(@NativeType("GLenum") int map, @NativeType("GLsizei") int size, @NativeType("GLushort const *") long values) { + nglPixelMapusv(map, size, values); + } + + /** + * Unsigned short version of {@link #glPixelMapfv PixelMapfv}. + * + * @param map the map to set + * @param values the map values + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glPixelMapusv(@NativeType("GLenum") int map, @NativeType("GLushort const *") ShortBuffer values) { + nglPixelMapusv(map, values.remaining(), memAddress(values)); + } + + // --- [ glPixelMapuiv ] --- + + /** + * Unsafe version of: {@link #glPixelMapuiv PixelMapuiv} + * + * @param size the map size + */ + public static native void nglPixelMapuiv(int map, int size, long values); + + /** + * Unsigned integer version of {@link #glPixelMapfv PixelMapfv}. + * + * @param map the map to set + * @param size the map size + * @param values the map values + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glPixelMapuiv(@NativeType("GLenum") int map, @NativeType("GLsizei") int size, @NativeType("GLuint const *") long values) { + nglPixelMapuiv(map, size, values); + } + + /** + * Unsigned integer version of {@link #glPixelMapfv PixelMapfv}. + * + * @param map the map to set + * @param values the map values + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glPixelMapuiv(@NativeType("GLenum") int map, @NativeType("GLuint const *") IntBuffer values) { + nglPixelMapuiv(map, values.remaining(), memAddress(values)); + } + + // --- [ glPixelStorei ] --- + + /** + * Sets the integer value of a pixel store parameter. + * + * @param pname the pixel store parameter to set. One of:
{@link GL11C#GL_UNPACK_SWAP_BYTES UNPACK_SWAP_BYTES}{@link GL11C#GL_UNPACK_LSB_FIRST UNPACK_LSB_FIRST}{@link GL11C#GL_UNPACK_ROW_LENGTH UNPACK_ROW_LENGTH}
{@link GL11C#GL_UNPACK_SKIP_ROWS UNPACK_SKIP_ROWS}{@link GL11C#GL_UNPACK_SKIP_PIXELS UNPACK_SKIP_PIXELS}{@link GL11C#GL_UNPACK_ALIGNMENT UNPACK_ALIGNMENT}
{@link GL12#GL_UNPACK_IMAGE_HEIGHT UNPACK_IMAGE_HEIGHT}{@link GL12#GL_UNPACK_SKIP_IMAGES UNPACK_SKIP_IMAGES}{@link GL42#GL_UNPACK_COMPRESSED_BLOCK_WIDTH UNPACK_COMPRESSED_BLOCK_WIDTH}
{@link GL42#GL_UNPACK_COMPRESSED_BLOCK_HEIGHT UNPACK_COMPRESSED_BLOCK_HEIGHT}{@link GL42#GL_UNPACK_COMPRESSED_BLOCK_DEPTH UNPACK_COMPRESSED_BLOCK_DEPTH}{@link GL42#GL_UNPACK_COMPRESSED_BLOCK_SIZE UNPACK_COMPRESSED_BLOCK_SIZE}
+ * @param param the parameter value + * + * @see Reference Page + */ + public static void glPixelStorei(@NativeType("GLenum") int pname, @NativeType("GLint") int param) { + GL11C.glPixelStorei(pname, param); + } + + // --- [ glPixelStoref ] --- + + /** + * Float version of {@link #glPixelStorei PixelStorei}. + * + * @param pname the pixel store parameter to set + * @param param the parameter value + * + * @see Reference Page + */ + public static void glPixelStoref(@NativeType("GLenum") int pname, @NativeType("GLfloat") float param) { + GL11C.glPixelStoref(pname, param); + } + + // --- [ glPixelTransferi ] --- + + /** + * Sets the integer value of a pixel transfer parameter. + * + * @param pname the pixel transfer parameter to set. One of:
{@link #GL_MAP_COLOR MAP_COLOR}{@link #GL_MAP_STENCIL MAP_STENCIL}{@link #GL_INDEX_SHIFT INDEX_SHIFT}{@link #GL_INDEX_OFFSET INDEX_OFFSET}
{@link #GL_RED_SCALE RED_SCALE}{@link #GL_GREEN_SCALE GREEN_SCALE}{@link #GL_BLUE_SCALE BLUE_SCALE}{@link #GL_ALPHA_SCALE ALPHA_SCALE}
{@link #GL_DEPTH_SCALE DEPTH_SCALE}{@link #GL_RED_BIAS RED_BIAS}{@link #GL_GREEN_BIAS GREEN_BIAS}{@link #GL_BLUE_BIAS BLUE_BIAS}
{@link #GL_ALPHA_BIAS ALPHA_BIAS}{@link #GL_DEPTH_BIAS DEPTH_BIAS}{@link ARBImaging#GL_POST_CONVOLUTION_RED_SCALE POST_CONVOLUTION_RED_SCALE}{@link ARBImaging#GL_POST_CONVOLUTION_RED_BIAS POST_CONVOLUTION_RED_BIAS}
{@link ARBImaging#GL_POST_COLOR_MATRIX_RED_SCALE POST_COLOR_MATRIX_RED_SCALE}{@link ARBImaging#GL_POST_COLOR_MATRIX_RED_BIAS POST_COLOR_MATRIX_RED_BIAS}{@link ARBImaging#GL_POST_CONVOLUTION_GREEN_SCALE POST_CONVOLUTION_GREEN_SCALE}{@link ARBImaging#GL_POST_CONVOLUTION_GREEN_BIAS POST_CONVOLUTION_GREEN_BIAS}
{@link ARBImaging#GL_POST_COLOR_MATRIX_GREEN_SCALE POST_COLOR_MATRIX_GREEN_SCALE}{@link ARBImaging#GL_POST_COLOR_MATRIX_GREEN_BIAS POST_COLOR_MATRIX_GREEN_BIAS}{@link ARBImaging#GL_POST_CONVOLUTION_BLUE_SCALE POST_CONVOLUTION_BLUE_SCALE}{@link ARBImaging#GL_POST_CONVOLUTION_BLUE_BIAS POST_CONVOLUTION_BLUE_BIAS}
{@link ARBImaging#GL_POST_COLOR_MATRIX_BLUE_SCALE POST_COLOR_MATRIX_BLUE_SCALE}{@link ARBImaging#GL_POST_COLOR_MATRIX_BLUE_BIAS POST_COLOR_MATRIX_BLUE_BIAS}{@link ARBImaging#GL_POST_CONVOLUTION_ALPHA_SCALE POST_CONVOLUTION_ALPHA_SCALE}{@link ARBImaging#GL_POST_CONVOLUTION_ALPHA_BIAS POST_CONVOLUTION_ALPHA_BIAS}
{@link ARBImaging#GL_POST_COLOR_MATRIX_ALPHA_SCALE POST_COLOR_MATRIX_ALPHA_SCALE}{@link ARBImaging#GL_POST_COLOR_MATRIX_ALPHA_BIAS POST_COLOR_MATRIX_ALPHA_BIAS}
+ * @param param the parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glPixelTransferi(@NativeType("GLenum") int pname, @NativeType("GLint") int param); + + // --- [ glPixelTransferf ] --- + + /** + * Float version of {@link #glPixelTransferi PixelTransferi}. + * + * @param pname the pixel transfer parameter to set + * @param param the parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glPixelTransferf(@NativeType("GLenum") int pname, @NativeType("GLfloat") float param); + + // --- [ glPixelZoom ] --- + + /** + * Controls the conversion of a group of fragments. + * + *

Let (xrp, yrp) be the current raster position. If a particular group is the nth in a row and belongs to the + * mth row, consider the region in window coordinates bounded by the rectangle with corners

+ * + *

(xrp + zxn, yrp + zym) and (xrp + zx(n + 1), yrp + zy(m + 1))

+ * + *

(either zx or zy may be negative). A fragment representing group {@code (n, m)} is produced for each framebuffer pixel inside, or + * on the bottom or left boundary, of this rectangle.

+ * + * @param xfactor the zx factor + * @param yfactor the zy factor + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glPixelZoom(@NativeType("GLfloat") float xfactor, @NativeType("GLfloat") float yfactor); + + // --- [ glPointSize ] --- + + /** + * Controls the rasterization of points if no vertex, tessellation control, tessellation evaluation, or geometry shader is active. The default point size is 1.0. + * + * @param size the request size of a point + * + * @see Reference Page + */ + public static void glPointSize(@NativeType("GLfloat") float size) { + GL11C.glPointSize(size); + } + + // --- [ glPolygonMode ] --- + + /** + * Controls the interpretation of polygons for rasterization. + * + *

{@link GL11C#GL_FILL FILL} is the default mode of polygon rasterization. Note that these modes affect only the final rasterization of polygons: in particular, a + * polygon's vertices are lit, and the polygon is clipped and possibly culled before these modes are applied. Polygon antialiasing applies only to the + * {@link GL11C#GL_FILL FILL} state of PolygonMode. For {@link GL11C#GL_POINT POINT} or {@link GL11C#GL_LINE LINE}, point antialiasing or line segment antialiasing, respectively, apply.

+ * + * @param face the face for which to set the rasterizing method. One of:
{@link GL11C#GL_FRONT FRONT}{@link GL11C#GL_BACK BACK}{@link GL11C#GL_FRONT_AND_BACK FRONT_AND_BACK}
+ * @param mode the rasterization mode. One of:
{@link GL11C#GL_POINT POINT}{@link GL11C#GL_LINE LINE}{@link GL11C#GL_FILL FILL}
+ * + * @see Reference Page + */ + public static void glPolygonMode(@NativeType("GLenum") int face, @NativeType("GLenum") int mode) { + GL11C.glPolygonMode(face, mode); + } + + // --- [ glPolygonOffset ] --- + + /** + * The depth values of all fragments generated by the rasterization of a polygon may be offset by a single value that is computed for that polygon. This + * function determines that value. + * + *

{@code factor} scales the maximum depth slope of the polygon, and {@code units} scales an implementation-dependent constant that relates to the usable + * resolution of the depth buffer. The resulting values are summed to produce the polygon offset value.

+ * + * @param factor the maximum depth slope factor + * @param units the constant scale + * + * @see Reference Page + */ + public static void glPolygonOffset(@NativeType("GLfloat") float factor, @NativeType("GLfloat") float units) { + GL11C.glPolygonOffset(factor, units); + } + + // --- [ glPolygonStipple ] --- + + /** Unsafe version of: {@link #glPolygonStipple PolygonStipple} */ + public static native void nglPolygonStipple(long pattern); + + /** + * Defines a polygon stipple. It works much the same way as {@link #glLineStipple LineStipple}, masking out certain fragments produced by rasterization so that they + * are not sent to the next stage of the GL. This is the case regardless of the state of polygon antialiasing. + * + *

If xw and yw are the window coordinates of a rasterized polygon fragment, then that fragment is sent to the next stage of the GL + * if and only if the bit of the pattern (xw mod 32, yw mod 32) is 1.

+ * + *

Polygon stippling may be enabled or disabled with {@link #glEnable Enable} or {@link #glDisable Disable} using the constant {@link #GL_POLYGON_STIPPLE POLYGON_STIPPLE}. When disabled, + * it is as if the stipple pattern were all ones.

+ * + * @param pattern a pointer to memory into which a 32 × 32 pattern is packed + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glPolygonStipple(@NativeType("GLubyte const *") ByteBuffer pattern) { + if (CHECKS) { + check(pattern, 128); + } + nglPolygonStipple(memAddress(pattern)); + } + + /** + * Defines a polygon stipple. It works much the same way as {@link #glLineStipple LineStipple}, masking out certain fragments produced by rasterization so that they + * are not sent to the next stage of the GL. This is the case regardless of the state of polygon antialiasing. + * + *

If xw and yw are the window coordinates of a rasterized polygon fragment, then that fragment is sent to the next stage of the GL + * if and only if the bit of the pattern (xw mod 32, yw mod 32) is 1.

+ * + *

Polygon stippling may be enabled or disabled with {@link #glEnable Enable} or {@link #glDisable Disable} using the constant {@link #GL_POLYGON_STIPPLE POLYGON_STIPPLE}. When disabled, + * it is as if the stipple pattern were all ones.

+ * + * @param pattern a pointer to memory into which a 32 × 32 pattern is packed + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glPolygonStipple(@NativeType("GLubyte const *") long pattern) { + nglPolygonStipple(pattern); + } + + // --- [ glPushAttrib ] --- + + /** + * Takes a bitwise OR of symbolic constants indicating which groups of state variables to push onto the server attribute stack. Each constant refers to a + * group of state variables. + * + *

Bits set in mask that do not correspond to an attribute group are ignored. The special mask value {@link #GL_ALL_ATTRIB_BITS ALL_ATTRIB_BITS} may be used to push all + * stackable server state.

+ * + *

A {@link #GL_STACK_OVERFLOW STACK_OVERFLOW} error is generated if {@code PushAttrib} is called and the attribute stack depth is equal to the value of + * {@link #GL_MAX_ATTRIB_STACK_DEPTH MAX_ATTRIB_STACK_DEPTH}.

+ * + * @param mask the state variables to push. One or more of:
{@link #GL_ACCUM_BUFFER_BIT ACCUM_BUFFER_BIT}{@link #GL_COLOR_BUFFER_BIT COLOR_BUFFER_BIT}{@link #GL_CURRENT_BIT CURRENT_BIT}{@link #GL_DEPTH_BUFFER_BIT DEPTH_BUFFER_BIT}{@link #GL_ENABLE_BIT ENABLE_BIT}{@link #GL_EVAL_BIT EVAL_BIT}
{@link #GL_FOG_BIT FOG_BIT}{@link #GL_HINT_BIT HINT_BIT}{@link #GL_LIGHTING_BIT LIGHTING_BIT}{@link #GL_LINE_BIT LINE_BIT}{@link #GL_LIST_BIT LIST_BIT}{@link GL13#GL_MULTISAMPLE_BIT MULTISAMPLE_BIT}
{@link #GL_PIXEL_MODE_BIT PIXEL_MODE_BIT}{@link #GL_POINT_BIT POINT_BIT}{@link #GL_POLYGON_BIT POLYGON_BIT}{@link #GL_POLYGON_STIPPLE_BIT POLYGON_STIPPLE_BIT}{@link #GL_SCISSOR_BIT SCISSOR_BIT}{@link #GL_STENCIL_BUFFER_BIT STENCIL_BUFFER_BIT}
{@link #GL_TEXTURE_BIT TEXTURE_BIT}{@link #GL_TRANSFORM_BIT TRANSFORM_BIT}{@link #GL_VIEWPORT_BIT VIEWPORT_BIT}{@link #GL_ALL_ATTRIB_BITS ALL_ATTRIB_BITS}
+ * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glPushAttrib(@NativeType("GLbitfield") int mask); + + // --- [ glPushClientAttrib ] --- + + /** + * Takes a bitwise OR of symbolic constants indicating which groups of state variables to push onto the client attribute stack. Each constant refers to a + * group of state variables. + * + *

Bits set in mask that do not correspond to an attribute group are ignored. The special mask value {@link #GL_CLIENT_ALL_ATTRIB_BITS CLIENT_ALL_ATTRIB_BITS} may be used to push + * all stackable client state.

+ * + *

A {@link #GL_STACK_OVERFLOW STACK_OVERFLOW} error is generated if {@code PushAttrib} is called and the client attribute stack depth is equal to the value of + * {@link #GL_MAX_CLIENT_ATTRIB_STACK_DEPTH MAX_CLIENT_ATTRIB_STACK_DEPTH}.

+ * + * @param mask the state variables to push. One or more of:
{@link #GL_CLIENT_VERTEX_ARRAY_BIT CLIENT_VERTEX_ARRAY_BIT}{@link #GL_CLIENT_PIXEL_STORE_BIT CLIENT_PIXEL_STORE_BIT}{@link #GL_CLIENT_ALL_ATTRIB_BITS CLIENT_ALL_ATTRIB_BITS}
+ * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glPushClientAttrib(@NativeType("GLbitfield") int mask); + + // --- [ glPopAttrib ] --- + + /** + * Resets the values of those state variables that were saved with the last {@link #glPushAttrib PushAttrib}. Those not saved remain unchanged. + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glPopAttrib(); + + // --- [ glPopClientAttrib ] --- + + /** + * Resets the values of those state variables that were saved with the last {@link #glPushClientAttrib PushClientAttrib}. Those not saved remain unchanged. + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glPopClientAttrib(); + + // --- [ glPopMatrix ] --- + + /** + * Pops the top entry off the current matrix stack, replacing the current matrix with the matrix that was the second entry in the stack. + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glPopMatrix(); + + // --- [ glPopName ] --- + + /** + * Pops one name off the top of the selection name stack. + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glPopName(); + + // --- [ glPrioritizeTextures ] --- + + /** + * Unsafe version of: {@link #glPrioritizeTextures PrioritizeTextures} + * + * @param n the number of texture object priorities to set + */ + public static native void nglPrioritizeTextures(int n, long textures, long priorities); + + /** + * Sets the priority of texture objects. Each priority value is clamped to the range [0, 1] before it is assigned. Zero indicates the lowest priority, with + * the least likelihood of being resident. One indicates the highest priority, with the greatest likelihood of being resident. + * + * @param textures an array of texture object names + * @param priorities an array of texture object priorities + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glPrioritizeTextures(@NativeType("GLuint const *") IntBuffer textures, @NativeType("GLfloat const *") FloatBuffer priorities) { + if (CHECKS) { + check(priorities, textures.remaining()); + } + nglPrioritizeTextures(textures.remaining(), memAddress(textures), memAddress(priorities)); + } + + // --- [ glPushMatrix ] --- + + /** + * Pushes the current matrix stack down by one, duplicating the current matrix in both the top of the stack and the entry below it. + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glPushMatrix(); + + // --- [ glPushName ] --- + + /** + * Causes {@code name} to be pushed onto the selection name stack. + * + * @param name the name to push + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glPushName(@NativeType("GLuint") int name); + + // --- [ glRasterPos2i ] --- + + /** + * Sets the two-dimensional current raster position. {@code z} is implicitly set to 0 and {@code w} implicitly set to 1. + * + *

The coordinates are treated as if they were specified in a Vertex command. If a vertex shader is active, this vertex shader is executed using the x, y, + * z, and w coordinates as the object coordinates of the vertex. Otherwise, the x, y, z, and w coordinates are transformed by the current model-view and + * projection matrices. These coordinates, along with current values, are used to generate primary and secondary colors and texture coordinates just as is + * done for a vertex. The colors and texture coordinates so produced replace the colors and texture coordinates stored in the current raster position's + * associated data.

+ * + * @param x the {@code x} raster coordinate + * @param y the {@code y} raster coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glRasterPos2i(@NativeType("GLint") int x, @NativeType("GLint") int y); + + // --- [ glRasterPos2s ] --- + + /** + * Short version of {@link #glRasterPos2i RasterPos2i}. + * + * @param x the {@code x} raster coordinate + * @param y the {@code y} raster coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glRasterPos2s(@NativeType("GLshort") short x, @NativeType("GLshort") short y); + + // --- [ glRasterPos2f ] --- + + /** + * Float version of {@link #glRasterPos2i RasterPos2i}. + * + * @param x the {@code x} raster coordinate + * @param y the {@code y} raster coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glRasterPos2f(@NativeType("GLfloat") float x, @NativeType("GLfloat") float y); + + // --- [ glRasterPos2d ] --- + + /** + * Double version of {@link #glRasterPos2i RasterPos2i}. + * + * @param x the {@code x} raster coordinate + * @param y the {@code y} raster coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glRasterPos2d(@NativeType("GLdouble") double x, @NativeType("GLdouble") double y); + + // --- [ glRasterPos2iv ] --- + + /** Unsafe version of: {@link #glRasterPos2iv RasterPos2iv} */ + public static native void nglRasterPos2iv(long coords); + + /** + * Pointer version of {@link #glRasterPos2i RasterPos2i}. + * + * @param coords the raster position buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos2iv(@NativeType("GLint const *") IntBuffer coords) { + if (CHECKS) { + check(coords, 2); + } + nglRasterPos2iv(memAddress(coords)); + } + + // --- [ glRasterPos2sv ] --- + + /** Unsafe version of: {@link #glRasterPos2sv RasterPos2sv} */ + public static native void nglRasterPos2sv(long coords); + + /** + * Pointer version of {@link #glRasterPos2s RasterPos2s}. + * + * @param coords the raster position buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos2sv(@NativeType("GLshort const *") ShortBuffer coords) { + if (CHECKS) { + check(coords, 2); + } + nglRasterPos2sv(memAddress(coords)); + } + + // --- [ glRasterPos2fv ] --- + + /** Unsafe version of: {@link #glRasterPos2fv RasterPos2fv} */ + public static native void nglRasterPos2fv(long coords); + + /** + * Pointer version of {@link #glRasterPos2f RasterPos2f}. + * + * @param coords the raster position buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos2fv(@NativeType("GLfloat const *") FloatBuffer coords) { + if (CHECKS) { + check(coords, 2); + } + nglRasterPos2fv(memAddress(coords)); + } + + // --- [ glRasterPos2dv ] --- + + /** Unsafe version of: {@link #glRasterPos2dv RasterPos2dv} */ + public static native void nglRasterPos2dv(long coords); + + /** + * Pointer version of {@link #glRasterPos2d RasterPos2d}. + * + * @param coords the raster position buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos2dv(@NativeType("GLdouble const *") DoubleBuffer coords) { + if (CHECKS) { + check(coords, 2); + } + nglRasterPos2dv(memAddress(coords)); + } + + // --- [ glRasterPos3i ] --- + + /** + * Sets the three-dimensional current raster position. {@code w} is implicitly set to 1. See {@link #glRasterPos2i RasterPos2i} for more details. + * + * @param x the {@code x} raster coordinate + * @param y the {@code y} raster coordinate + * @param z the {@code z} raster coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glRasterPos3i(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z); + + // --- [ glRasterPos3s ] --- + + /** + * Short version of {@link #glRasterPos3i RasterPos3i}. + * + * @param x the {@code x} raster coordinate + * @param y the {@code y} raster coordinate + * @param z the {@code z} raster coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glRasterPos3s(@NativeType("GLshort") short x, @NativeType("GLshort") short y, @NativeType("GLshort") short z); + + // --- [ glRasterPos3f ] --- + + /** + * Float version of {@link #glRasterPos3i RasterPos3i}. + * + * @param x the {@code x} raster coordinate + * @param y the {@code y} raster coordinate + * @param z the {@code z} raster coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glRasterPos3f(@NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z); + + // --- [ glRasterPos3d ] --- + + /** + * Double version of {@link #glRasterPos3i RasterPos3i}. + * + * @param x the {@code x} raster coordinate + * @param y the {@code y} raster coordinate + * @param z the {@code z} raster coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glRasterPos3d(@NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z); + + // --- [ glRasterPos3iv ] --- + + /** Unsafe version of: {@link #glRasterPos3iv RasterPos3iv} */ + public static native void nglRasterPos3iv(long coords); + + /** + * Pointer version of {@link #glRasterPos3i RasterPos3i}. + * + * @param coords the raster position buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos3iv(@NativeType("GLint const *") IntBuffer coords) { + if (CHECKS) { + check(coords, 3); + } + nglRasterPos3iv(memAddress(coords)); + } + + // --- [ glRasterPos3sv ] --- + + /** Unsafe version of: {@link #glRasterPos3sv RasterPos3sv} */ + public static native void nglRasterPos3sv(long coords); + + /** + * Pointer version of {@link #glRasterPos3s RasterPos3s}. + * + * @param coords the raster position buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos3sv(@NativeType("GLshort const *") ShortBuffer coords) { + if (CHECKS) { + check(coords, 3); + } + nglRasterPos3sv(memAddress(coords)); + } + + // --- [ glRasterPos3fv ] --- + + /** Unsafe version of: {@link #glRasterPos3fv RasterPos3fv} */ + public static native void nglRasterPos3fv(long coords); + + /** + * Pointer version of {@link #glRasterPos3f RasterPos3f}. + * + * @param coords the raster position buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos3fv(@NativeType("GLfloat const *") FloatBuffer coords) { + if (CHECKS) { + check(coords, 3); + } + nglRasterPos3fv(memAddress(coords)); + } + + // --- [ glRasterPos3dv ] --- + + /** Unsafe version of: {@link #glRasterPos3dv RasterPos3dv} */ + public static native void nglRasterPos3dv(long coords); + + /** + * Pointer version of {@link #glRasterPos3d RasterPos3d}. + * + * @param coords the raster position buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos3dv(@NativeType("GLdouble const *") DoubleBuffer coords) { + if (CHECKS) { + check(coords, 3); + } + nglRasterPos3dv(memAddress(coords)); + } + + // --- [ glRasterPos4i ] --- + + /** + * Sets the four-dimensional current raster position. See {@link #glRasterPos2i RasterPos2i} for more details. + * + * @param x the {@code x} raster coordinate + * @param y the {@code y} raster coordinate + * @param z the {@code z} raster coordinate + * @param w the {@code w} raster coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glRasterPos4i(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z, @NativeType("GLint") int w); + + // --- [ glRasterPos4s ] --- + + /** + * Short version of {@link #glRasterPos4i RasterPos4i}. + * + * @param x the {@code x} raster coordinate + * @param y the {@code y} raster coordinate + * @param z the {@code z} raster coordinate + * @param w the {@code w} raster coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glRasterPos4s(@NativeType("GLshort") short x, @NativeType("GLshort") short y, @NativeType("GLshort") short z, @NativeType("GLshort") short w); + + // --- [ glRasterPos4f ] --- + + /** + * Float version of RasterPos4i. + * + * @param x the {@code x} raster coordinate + * @param y the {@code y} raster coordinate + * @param z the {@code z} raster coordinate + * @param w the {@code w} raster coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glRasterPos4f(@NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z, @NativeType("GLfloat") float w); + + // --- [ glRasterPos4d ] --- + + /** + * Double version of {@link #glRasterPos4i RasterPos4i}. + * + * @param x the {@code x} raster coordinate + * @param y the {@code y} raster coordinate + * @param z the {@code z} raster coordinate + * @param w the {@code w} raster coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glRasterPos4d(@NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z, @NativeType("GLdouble") double w); + + // --- [ glRasterPos4iv ] --- + + /** Unsafe version of: {@link #glRasterPos4iv RasterPos4iv} */ + public static native void nglRasterPos4iv(long coords); + + /** + * Pointer version of {@link #glRasterPos4i RasterPos4i}. + * + * @param coords the raster position buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos4iv(@NativeType("GLint const *") IntBuffer coords) { + if (CHECKS) { + check(coords, 4); + } + nglRasterPos4iv(memAddress(coords)); + } + + // --- [ glRasterPos4sv ] --- + + /** Unsafe version of: {@link #glRasterPos4sv RasterPos4sv} */ + public static native void nglRasterPos4sv(long coords); + + /** + * Pointer version of {@link #glRasterPos4s RasterPos4s}. + * + * @param coords the raster position buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos4sv(@NativeType("GLshort const *") ShortBuffer coords) { + if (CHECKS) { + check(coords, 4); + } + nglRasterPos4sv(memAddress(coords)); + } + + // --- [ glRasterPos4fv ] --- + + /** Unsafe version of: {@link #glRasterPos4fv RasterPos4fv} */ + public static native void nglRasterPos4fv(long coords); + + /** + * Pointer version of {@link #glRasterPos4f RasterPos4f}. + * + * @param coords the raster position buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos4fv(@NativeType("GLfloat const *") FloatBuffer coords) { + if (CHECKS) { + check(coords, 4); + } + nglRasterPos4fv(memAddress(coords)); + } + + // --- [ glRasterPos4dv ] --- + + /** Unsafe version of: {@link #glRasterPos4dv RasterPos4dv} */ + public static native void nglRasterPos4dv(long coords); + + /** + * Pointer version of {@link #glRasterPos4d RasterPos4d}. + * + * @param coords the raster position buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos4dv(@NativeType("GLdouble const *") DoubleBuffer coords) { + if (CHECKS) { + check(coords, 4); + } + nglRasterPos4dv(memAddress(coords)); + } + + // --- [ glReadBuffer ] --- + + /** + * Defines the color buffer from which values are obtained. + * + *

Acceptable values for {@code src} depend on whether the GL is using the default framebuffer (i.e., {@link GL30#GL_DRAW_FRAMEBUFFER_BINDING DRAW_FRAMEBUFFER_BINDING} is zero), or + * a framebuffer object (i.e., {@link GL30#GL_DRAW_FRAMEBUFFER_BINDING DRAW_FRAMEBUFFER_BINDING} is non-zero). In the initial state, the GL is bound to the default framebuffer.

+ * + * @param src the color buffer to read from. One of:
{@link GL11C#GL_NONE NONE}{@link GL11C#GL_FRONT_LEFT FRONT_LEFT}{@link GL11C#GL_FRONT_RIGHT FRONT_RIGHT}{@link GL11C#GL_BACK_LEFT BACK_LEFT}{@link GL11C#GL_BACK_RIGHT BACK_RIGHT}{@link GL11C#GL_FRONT FRONT}{@link GL11C#GL_BACK BACK}{@link GL11C#GL_LEFT LEFT}
{@link GL11C#GL_RIGHT RIGHT}{@link GL11C#GL_FRONT_AND_BACK FRONT_AND_BACK}{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}GL30.GL_COLOR_ATTACHMENT[1-15]
+ * + * @see Reference Page + */ + public static void glReadBuffer(@NativeType("GLenum") int src) { + GL11C.glReadBuffer(src); + } + + // --- [ glReadPixels ] --- + + /** Unsafe version of: {@link #glReadPixels ReadPixels} */ + public static void nglReadPixels(int x, int y, int width, int height, int format, int type, long pixels) { + GL11C.nglReadPixels(x, y, width, height, format, type, pixels); + } + + /** + * ReadPixels obtains values from the selected read buffer from each pixel with lower left hand corner at {@code (x + i, y + j)} for {@code 0 <= i < width} + * and {@code 0 <= j < height}; this pixel is said to be the ith pixel in the jth row. If any of these pixels lies outside of the + * window allocated to the current GL context, or outside of the image attached to the currently bound read framebuffer object, then the values obtained + * for those pixels are undefined. When {@link GL30#GL_READ_FRAMEBUFFER_BINDING READ_FRAMEBUFFER_BINDING} is zero, values are also undefined for individual pixels that are not owned by + * the current context. Otherwise, {@code ReadPixels} obtains values from the selected buffer, regardless of how those values were placed there. + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels a buffer in which to place the returned pixel data + * + * @see Reference Page + */ + public static void glReadPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer pixels) { + GL11C.glReadPixels(x, y, width, height, format, type, pixels); + } + + /** + * ReadPixels obtains values from the selected read buffer from each pixel with lower left hand corner at {@code (x + i, y + j)} for {@code 0 <= i < width} + * and {@code 0 <= j < height}; this pixel is said to be the ith pixel in the jth row. If any of these pixels lies outside of the + * window allocated to the current GL context, or outside of the image attached to the currently bound read framebuffer object, then the values obtained + * for those pixels are undefined. When {@link GL30#GL_READ_FRAMEBUFFER_BINDING READ_FRAMEBUFFER_BINDING} is zero, values are also undefined for individual pixels that are not owned by + * the current context. Otherwise, {@code ReadPixels} obtains values from the selected buffer, regardless of how those values were placed there. + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels a buffer in which to place the returned pixel data + * + * @see Reference Page + */ + public static void glReadPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") long pixels) { + GL11C.glReadPixels(x, y, width, height, format, type, pixels); + } + + /** + * ReadPixels obtains values from the selected read buffer from each pixel with lower left hand corner at {@code (x + i, y + j)} for {@code 0 <= i < width} + * and {@code 0 <= j < height}; this pixel is said to be the ith pixel in the jth row. If any of these pixels lies outside of the + * window allocated to the current GL context, or outside of the image attached to the currently bound read framebuffer object, then the values obtained + * for those pixels are undefined. When {@link GL30#GL_READ_FRAMEBUFFER_BINDING READ_FRAMEBUFFER_BINDING} is zero, values are also undefined for individual pixels that are not owned by + * the current context. Otherwise, {@code ReadPixels} obtains values from the selected buffer, regardless of how those values were placed there. + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels a buffer in which to place the returned pixel data + * + * @see Reference Page + */ + public static void glReadPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ShortBuffer pixels) { + GL11C.glReadPixels(x, y, width, height, format, type, pixels); + } + + /** + * ReadPixels obtains values from the selected read buffer from each pixel with lower left hand corner at {@code (x + i, y + j)} for {@code 0 <= i < width} + * and {@code 0 <= j < height}; this pixel is said to be the ith pixel in the jth row. If any of these pixels lies outside of the + * window allocated to the current GL context, or outside of the image attached to the currently bound read framebuffer object, then the values obtained + * for those pixels are undefined. When {@link GL30#GL_READ_FRAMEBUFFER_BINDING READ_FRAMEBUFFER_BINDING} is zero, values are also undefined for individual pixels that are not owned by + * the current context. Otherwise, {@code ReadPixels} obtains values from the selected buffer, regardless of how those values were placed there. + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels a buffer in which to place the returned pixel data + * + * @see Reference Page + */ + public static void glReadPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") IntBuffer pixels) { + GL11C.glReadPixels(x, y, width, height, format, type, pixels); + } + + /** + * ReadPixels obtains values from the selected read buffer from each pixel with lower left hand corner at {@code (x + i, y + j)} for {@code 0 <= i < width} + * and {@code 0 <= j < height}; this pixel is said to be the ith pixel in the jth row. If any of these pixels lies outside of the + * window allocated to the current GL context, or outside of the image attached to the currently bound read framebuffer object, then the values obtained + * for those pixels are undefined. When {@link GL30#GL_READ_FRAMEBUFFER_BINDING READ_FRAMEBUFFER_BINDING} is zero, values are also undefined for individual pixels that are not owned by + * the current context. Otherwise, {@code ReadPixels} obtains values from the selected buffer, regardless of how those values were placed there. + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels a buffer in which to place the returned pixel data + * + * @see Reference Page + */ + public static void glReadPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") FloatBuffer pixels) { + GL11C.glReadPixels(x, y, width, height, format, type, pixels); + } + + // --- [ glRecti ] --- + + /** + * Specifies a rectangle as two corner vertices. The effect of the Rect command + * + *

{@code Rect(x1, y1, x2, y2);}

+ * + *

is exactly the same as the following sequence of commands: + * {@code + * Begin(POLYGON); + * Vertex2(x1, y1); + * Vertex2(x2, y1); + * Vertex2(x2, y2); + * Vertex2(x1, y2); + * End();}

+ * + *

The appropriate Vertex2 command would be invoked depending on which of the Rect commands is issued.

+ * + * @param x1 the x coordinate of the first corner vertex + * @param y1 the y coordinate of the first corner vertex + * @param x2 the x coordinate of the second corner vertex + * @param y2 the y coordinate of the second corner vertex + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glRecti(@NativeType("GLint") int x1, @NativeType("GLint") int y1, @NativeType("GLint") int x2, @NativeType("GLint") int y2); + + // --- [ glRects ] --- + + /** + * Short version of {@link #glRecti Recti}. + * + * @param x1 the x coordinate of the first corner vertex + * @param y1 the y coordinate of the first corner vertex + * @param x2 the x coordinate of the second corner vertex + * @param y2 the y coordinate of the second corner vertex + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glRects(@NativeType("GLshort") short x1, @NativeType("GLshort") short y1, @NativeType("GLshort") short x2, @NativeType("GLshort") short y2); + + // --- [ glRectf ] --- + + /** + * Float version of {@link #glRecti Recti}. + * + * @param x1 the x coordinate of the first corner vertex + * @param y1 the y coordinate of the first corner vertex + * @param x2 the x coordinate of the second corner vertex + * @param y2 the y coordinate of the second corner vertex + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glRectf(@NativeType("GLfloat") float x1, @NativeType("GLfloat") float y1, @NativeType("GLfloat") float x2, @NativeType("GLfloat") float y2); + + // --- [ glRectd ] --- + + /** + * Double version of {@link #glRecti Recti}. + * + * @param x1 the x coordinate of the first corner vertex + * @param y1 the y coordinate of the first corner vertex + * @param x2 the x coordinate of the second corner vertex + * @param y2 the y coordinate of the second corner vertex + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glRectd(@NativeType("GLdouble") double x1, @NativeType("GLdouble") double y1, @NativeType("GLdouble") double x2, @NativeType("GLdouble") double y2); + + // --- [ glRectiv ] --- + + /** Unsafe version of: {@link #glRectiv Rectiv} */ + public static native void nglRectiv(long v1, long v2); + + /** + * Pointer version of {@link #glRecti Recti}. + * + * @param v1 the first vertex buffer + * @param v2 the second vertex buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRectiv(@NativeType("GLint const *") IntBuffer v1, @NativeType("GLint const *") IntBuffer v2) { + if (CHECKS) { + check(v1, 2); + check(v2, 2); + } + nglRectiv(memAddress(v1), memAddress(v2)); + } + + // --- [ glRectsv ] --- + + /** Unsafe version of: {@link #glRectsv Rectsv} */ + public static native void nglRectsv(long v1, long v2); + + /** + * Pointer version of {@link #glRects Rects}. + * + * @param v1 the first vertex buffer + * @param v2 the second vertex buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRectsv(@NativeType("GLshort const *") ShortBuffer v1, @NativeType("GLshort const *") ShortBuffer v2) { + if (CHECKS) { + check(v1, 2); + check(v2, 2); + } + nglRectsv(memAddress(v1), memAddress(v2)); + } + + // --- [ glRectfv ] --- + + /** Unsafe version of: {@link #glRectfv Rectfv} */ + public static native void nglRectfv(long v1, long v2); + + /** + * Pointer version of {@link #glRectf Rectf}. + * + * @param v1 the first vertex buffer + * @param v2 the second vertex buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRectfv(@NativeType("GLfloat const *") FloatBuffer v1, @NativeType("GLfloat const *") FloatBuffer v2) { + if (CHECKS) { + check(v1, 2); + check(v2, 2); + } + nglRectfv(memAddress(v1), memAddress(v2)); + } + + // --- [ glRectdv ] --- + + /** Unsafe version of: {@link #glRectdv Rectdv} */ + public static native void nglRectdv(long v1, long v2); + + /** + * Pointer version of {@link #glRectd Rectd}. + * + * @param v1 the first vertex buffer + * @param v2 the second vertex buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRectdv(@NativeType("GLdouble const *") DoubleBuffer v1, @NativeType("GLdouble const *") DoubleBuffer v2) { + if (CHECKS) { + check(v1, 2); + check(v2, 2); + } + nglRectdv(memAddress(v1), memAddress(v2)); + } + + // --- [ glRenderMode ] --- + + /** + * Sets the current render mode. The default is {@link #GL_RENDER RENDER}. + * + * @param mode the render mode. One of:
{@link #GL_RENDER RENDER}{@link #GL_SELECT SELECT}{@link #GL_FEEDBACK FEEDBACK}
+ * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + @NativeType("GLint") + public static native int glRenderMode(@NativeType("GLenum") int mode); + + // --- [ glRotatef ] --- + + /** + * Manipulates the current matrix with a rotation matrix. + * + *

{@code angle} gives an angle of rotation in degrees; the coordinates of a vector v are given by v = (x y z)T. The computed matrix + * is a counter-clockwise rotation about the line through the origin with the specified axis when that axis is pointing up (i.e. the right-hand rule + * determines the sense of the rotation angle). The matrix is thus

+ * + * + * + * + * + * + *
R0
0
0
0001
+ * + *

Let u = v / ||v|| = (x' y' z')T. If S =

+ * + * + * + * + * + *
0-z'y'
z'0-x'
-y'x'0
+ * + *

then R = uuT + cos(angle)(I - uuT) + sin(angle)S

+ * + * @param angle the angle of rotation in degrees + * @param x the x coordinate of the rotation vector + * @param y the y coordinate of the rotation vector + * @param z the z coordinate of the rotation vector + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glRotatef(@NativeType("GLfloat") float angle, @NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z); + + // --- [ glRotated ] --- + + /** + * Double version of {@link #glRotatef Rotatef}. + * + * @param angle the angle of rotation in degrees + * @param x the x coordinate of the rotation vector + * @param y the y coordinate of the rotation vector + * @param z the z coordinate of the rotation vector + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glRotated(@NativeType("GLdouble") double angle, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z); + + // --- [ glScalef ] --- + + /** + * Manipulates the current matrix with a general scaling matrix along the x-, y- and z- axes. + * + *

Calling this function is equivalent to calling {@link #glMultMatrixf MultMatrixf} with the following matrix:

+ * + * + * + * + * + * + *
x000
0y00
00z0
0001
+ * + * @param x the x-axis scaling factor + * @param y the y-axis scaling factor + * @param z the z-axis scaling factor + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glScalef(@NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z); + + // --- [ glScaled ] --- + + /** + * Double version of {@link #glScalef Scalef}. + * + * @param x the x-axis scaling factor + * @param y the y-axis scaling factor + * @param z the z-axis scaling factor + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glScaled(@NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z); + + // --- [ glScissor ] --- + + /** + * Defines the scissor rectangle for all viewports. The scissor test is enabled or disabled for all viewports using {@link #glEnable Enable} or {@link #glDisable Disable} + * with the symbolic constant {@link GL11C#GL_SCISSOR_TEST SCISSOR_TEST}. When disabled, it is as if the scissor test always passes. When enabled, if + * left ≤ xw < left + width and bottom ≤ yw < bottom + height for the scissor rectangle, then the scissor + * test passes. Otherwise, the test fails and the fragment is discarded. + * + * @param x the left scissor rectangle coordinate + * @param y the bottom scissor rectangle coordinate + * @param width the scissor rectangle width + * @param height the scissor rectangle height + * + * @see Reference Page + */ + public static void glScissor(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL11C.glScissor(x, y, width, height); + } + + // --- [ glSelectBuffer ] --- + + /** + * Unsafe version of: {@link #glSelectBuffer SelectBuffer} + * + * @param size the maximum number of values that can be stored in {@code buffer} + */ + public static native void nglSelectBuffer(int size, long buffer); + + /** + * Sets the selection array. + * + * @param buffer an array of unsigned integers to be potentially filled names + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSelectBuffer(@NativeType("GLuint *") IntBuffer buffer) { + nglSelectBuffer(buffer.remaining(), memAddress(buffer)); + } + + // --- [ glShadeModel ] --- + + /** + * Sets the current shade mode. The initial value of the shade mode is {@link #GL_SMOOTH SMOOTH}. + * + *

If mode is {@link #GL_SMOOTH SMOOTH}, vertex colors are treated individually. If mode is {@link #GL_FLAT FLAT}, flatshading is enabled and colors are taken from the + * provoking vertex of the primitive. The colors selected are those derived from current values, generated by lighting, or generated by vertex shading, if + * lighting is disabled, enabled, or a vertex shader is in use, respectively.

+ * + * @param mode the shade mode. One of:
{@link #GL_SMOOTH SMOOTH}{@link #GL_FLAT FLAT}
+ * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glShadeModel(@NativeType("GLenum") int mode); + + // --- [ glStencilFunc ] --- + + /** + * Controls the stencil test. + * + *

{@code ref} is an integer reference value that is used in the unsigned stencil comparison. Stencil comparison operations and queries of {@code ref} + * clamp its value to the range [0, 2s – 1], where s is the number of bits in the stencil buffer attached to the draw framebuffer. The s + * least significant bits of {@code mask} are bitwise ANDed with both the reference and the stored stencil value, and the resulting masked values are those that + * participate in the comparison controlled by {@code func}.

+ * + * @param func the stencil comparison function. One of:
{@link GL11C#GL_NEVER NEVER}{@link GL11C#GL_ALWAYS ALWAYS}{@link GL11C#GL_LESS LESS}{@link GL11C#GL_LEQUAL LEQUAL}{@link GL11C#GL_EQUAL EQUAL}{@link GL11C#GL_GEQUAL GEQUAL}{@link GL11C#GL_GREATER GREATER}{@link GL11C#GL_NOTEQUAL NOTEQUAL}
+ * @param ref the reference value + * @param mask the stencil comparison mask + * + * @see Reference Page + */ + public static void glStencilFunc(@NativeType("GLenum") int func, @NativeType("GLint") int ref, @NativeType("GLuint") int mask) { + GL11C.glStencilFunc(func, ref, mask); + } + + // --- [ glStencilMask ] --- + + /** + * Masks the writing of particular bits into the stencil plans. + * + *

The least significant s bits of {@code mask}, where s is the number of bits in the stencil buffer, specify an integer mask. Where a 1 appears in this + * mask, the corresponding bit in the stencil buffer is written; where a 0 appears, the bit is not written.

+ * + * @param mask the stencil mask + * + * @see Reference Page + */ + public static void glStencilMask(@NativeType("GLuint") int mask) { + GL11C.glStencilMask(mask); + } + + // --- [ glStencilOp ] --- + + /** + * Indicates what happens to the stored stencil value if this or certain subsequent tests fail or pass. + * + *

The supported actions are {@link GL11C#GL_KEEP KEEP}, {@link GL11C#GL_ZERO ZERO}, {@link GL11C#GL_REPLACE REPLACE}, {@link GL11C#GL_INCR INCR}, {@link GL11C#GL_DECR DECR}, {@link GL11C#GL_INVERT INVERT}, + * {@link GL14#GL_INCR_WRAP INCR_WRAP} and {@link GL14#GL_DECR_WRAP DECR_WRAP}. These correspond to keeping the current value, setting to zero, replacing with the reference value, + * incrementing with saturation, decrementing with saturation, bitwise inverting it, incrementing without saturation, and decrementing without saturation.

+ * + *

For purposes of increment and decrement, the stencil bits are considered as an unsigned integer. Incrementing or decrementing with saturation clamps + * the stencil value at 0 and the maximum representable value. Incrementing or decrementing without saturation will wrap such that incrementing the maximum + * representable value results in 0, and decrementing 0 results in the maximum representable value.

+ * + * @param sfail the action to take if the stencil test fails + * @param dpfail the action to take if the depth buffer test fails + * @param dppass the action to take if the depth buffer test passes + * + * @see Reference Page + */ + public static void glStencilOp(@NativeType("GLenum") int sfail, @NativeType("GLenum") int dpfail, @NativeType("GLenum") int dppass) { + GL11C.glStencilOp(sfail, dpfail, dppass); + } + + // --- [ glTexCoord1f ] --- + + /** + * Sets the current one-dimensional texture coordinate. {@code t} and {@code r} are implicitly set to 0 and {@code q} to 1. + * + * @param s the s component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexCoord1f(@NativeType("GLfloat") float s); + + // --- [ glTexCoord1s ] --- + + /** + * Short version of {@link #glTexCoord1f TexCoord1f}. + * + * @param s the s component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexCoord1s(@NativeType("GLshort") short s); + + // --- [ glTexCoord1i ] --- + + /** + * Integer version of {@link #glTexCoord1f TexCoord1f}. + * + * @param s the s component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexCoord1i(@NativeType("GLint") int s); + + // --- [ glTexCoord1d ] --- + + /** + * Double version of {@link #glTexCoord1f TexCoord1f}. + * + * @param s the s component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexCoord1d(@NativeType("GLdouble") double s); + + // --- [ glTexCoord1fv ] --- + + /** Unsafe version of: {@link #glTexCoord1fv TexCoord1fv} */ + public static native void nglTexCoord1fv(long v); + + /** + * Pointer version of {@link #glTexCoord1f TexCoord1f}. + * + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord1fv(@NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglTexCoord1fv(memAddress(v)); + } + + // --- [ glTexCoord1sv ] --- + + /** Unsafe version of: {@link #glTexCoord1sv TexCoord1sv} */ + public static native void nglTexCoord1sv(long v); + + /** + * Pointer version of {@link #glTexCoord1s TexCoord1s}. + * + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord1sv(@NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglTexCoord1sv(memAddress(v)); + } + + // --- [ glTexCoord1iv ] --- + + /** Unsafe version of: {@link #glTexCoord1iv TexCoord1iv} */ + public static native void nglTexCoord1iv(long v); + + /** + * Pointer version of {@link #glTexCoord1i TexCoord1i}. + * + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord1iv(@NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglTexCoord1iv(memAddress(v)); + } + + // --- [ glTexCoord1dv ] --- + + /** Unsafe version of: {@link #glTexCoord1dv TexCoord1dv} */ + public static native void nglTexCoord1dv(long v); + + /** + * Pointer version of {@link #glTexCoord1d TexCoord1d}. + * + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord1dv(@NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglTexCoord1dv(memAddress(v)); + } + + // --- [ glTexCoord2f ] --- + + /** + * Sets the current two-dimensional texture coordinate. {@code r} is implicitly set to 0 and {@code q} to 1. + * + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexCoord2f(@NativeType("GLfloat") float s, @NativeType("GLfloat") float t); + + // --- [ glTexCoord2s ] --- + + /** + * Short version of {@link #glTexCoord2f TexCoord2f}. + * + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexCoord2s(@NativeType("GLshort") short s, @NativeType("GLshort") short t); + + // --- [ glTexCoord2i ] --- + + /** + * Integer version of {@link #glTexCoord2f TexCoord2f}. + * + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexCoord2i(@NativeType("GLint") int s, @NativeType("GLint") int t); + + // --- [ glTexCoord2d ] --- + + /** + * Double version of {@link #glTexCoord2f TexCoord2f}. + * + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexCoord2d(@NativeType("GLdouble") double s, @NativeType("GLdouble") double t); + + // --- [ glTexCoord2fv ] --- + + /** Unsafe version of: {@link #glTexCoord2fv TexCoord2fv} */ + public static native void nglTexCoord2fv(long v); + + /** + * Pointer version of {@link #glTexCoord2f TexCoord2f}. + * + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord2fv(@NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglTexCoord2fv(memAddress(v)); + } + + // --- [ glTexCoord2sv ] --- + + /** Unsafe version of: {@link #glTexCoord2sv TexCoord2sv} */ + public static native void nglTexCoord2sv(long v); + + /** + * Pointer version of {@link #glTexCoord2s TexCoord2s}. + * + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord2sv(@NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglTexCoord2sv(memAddress(v)); + } + + // --- [ glTexCoord2iv ] --- + + /** Unsafe version of: {@link #glTexCoord2iv TexCoord2iv} */ + public static native void nglTexCoord2iv(long v); + + /** + * Pointer version of {@link #glTexCoord2i TexCoord2i}. + * + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord2iv(@NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglTexCoord2iv(memAddress(v)); + } + + // --- [ glTexCoord2dv ] --- + + /** Unsafe version of: {@link #glTexCoord2dv TexCoord2dv} */ + public static native void nglTexCoord2dv(long v); + + /** + * Pointer version of {@link #glTexCoord2d TexCoord2d}. + * + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord2dv(@NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglTexCoord2dv(memAddress(v)); + } + + // --- [ glTexCoord3f ] --- + + /** + * Sets the current three-dimensional texture coordinate. {@code q} is implicitly set to 1. + * + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexCoord3f(@NativeType("GLfloat") float s, @NativeType("GLfloat") float t, @NativeType("GLfloat") float r); + + // --- [ glTexCoord3s ] --- + + /** + * Short version of {@link #glTexCoord3f TexCoord3f}. + * + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexCoord3s(@NativeType("GLshort") short s, @NativeType("GLshort") short t, @NativeType("GLshort") short r); + + // --- [ glTexCoord3i ] --- + + /** + * Integer version of {@link #glTexCoord3f TexCoord3f}. + * + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexCoord3i(@NativeType("GLint") int s, @NativeType("GLint") int t, @NativeType("GLint") int r); + + // --- [ glTexCoord3d ] --- + + /** + * Double version of {@link #glTexCoord3f TexCoord3f}. + * + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexCoord3d(@NativeType("GLdouble") double s, @NativeType("GLdouble") double t, @NativeType("GLdouble") double r); + + // --- [ glTexCoord3fv ] --- + + /** Unsafe version of: {@link #glTexCoord3fv TexCoord3fv} */ + public static native void nglTexCoord3fv(long v); + + /** + * Pointer version of {@link #glTexCoord3f TexCoord3f}. + * + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord3fv(@NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglTexCoord3fv(memAddress(v)); + } + + // --- [ glTexCoord3sv ] --- + + /** Unsafe version of: {@link #glTexCoord3sv TexCoord3sv} */ + public static native void nglTexCoord3sv(long v); + + /** + * Pointer version of {@link #glTexCoord3s TexCoord3s}. + * + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord3sv(@NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglTexCoord3sv(memAddress(v)); + } + + // --- [ glTexCoord3iv ] --- + + /** Unsafe version of: {@link #glTexCoord3iv TexCoord3iv} */ + public static native void nglTexCoord3iv(long v); + + /** + * Pointer version of {@link #glTexCoord3i TexCoord3i}. + * + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord3iv(@NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglTexCoord3iv(memAddress(v)); + } + + // --- [ glTexCoord3dv ] --- + + /** Unsafe version of: {@link #glTexCoord3dv TexCoord3dv} */ + public static native void nglTexCoord3dv(long v); + + /** + * Pointer version of {@link #glTexCoord3d TexCoord3d}. + * + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord3dv(@NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglTexCoord3dv(memAddress(v)); + } + + // --- [ glTexCoord4f ] --- + + /** + * Sets the current four-dimensional texture coordinate. + * + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + * @param q the q component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexCoord4f(@NativeType("GLfloat") float s, @NativeType("GLfloat") float t, @NativeType("GLfloat") float r, @NativeType("GLfloat") float q); + + // --- [ glTexCoord4s ] --- + + /** + * Short version of {@link #glTexCoord4f TexCoord4f}. + * + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + * @param q the q component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexCoord4s(@NativeType("GLshort") short s, @NativeType("GLshort") short t, @NativeType("GLshort") short r, @NativeType("GLshort") short q); + + // --- [ glTexCoord4i ] --- + + /** + * Integer version of {@link #glTexCoord4f TexCoord4f}. + * + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + * @param q the q component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexCoord4i(@NativeType("GLint") int s, @NativeType("GLint") int t, @NativeType("GLint") int r, @NativeType("GLint") int q); + + // --- [ glTexCoord4d ] --- + + /** + * Double version of {@link #glTexCoord4f TexCoord4f}. + * + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + * @param q the q component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexCoord4d(@NativeType("GLdouble") double s, @NativeType("GLdouble") double t, @NativeType("GLdouble") double r, @NativeType("GLdouble") double q); + + // --- [ glTexCoord4fv ] --- + + /** Unsafe version of: {@link #glTexCoord4fv TexCoord4fv} */ + public static native void nglTexCoord4fv(long v); + + /** + * Pointer version of {@link #glTexCoord4f TexCoord4f}. + * + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord4fv(@NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglTexCoord4fv(memAddress(v)); + } + + // --- [ glTexCoord4sv ] --- + + /** Unsafe version of: {@link #glTexCoord4sv TexCoord4sv} */ + public static native void nglTexCoord4sv(long v); + + /** + * Pointer version of {@link #glTexCoord4s TexCoord4s}. + * + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord4sv(@NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglTexCoord4sv(memAddress(v)); + } + + // --- [ glTexCoord4iv ] --- + + /** Unsafe version of: {@link #glTexCoord4iv TexCoord4iv} */ + public static native void nglTexCoord4iv(long v); + + /** + * Pointer version of {@link #glTexCoord4i TexCoord4i}. + * + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord4iv(@NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglTexCoord4iv(memAddress(v)); + } + + // --- [ glTexCoord4dv ] --- + + /** Unsafe version of: {@link #glTexCoord4dv TexCoord4dv} */ + public static native void nglTexCoord4dv(long v); + + /** + * Pointer version of {@link #glTexCoord4d TexCoord4d}. + * + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord4dv(@NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglTexCoord4dv(memAddress(v)); + } + + // --- [ glTexCoordPointer ] --- + + /** Unsafe version of: {@link #glTexCoordPointer TexCoordPointer} */ + public static native void nglTexCoordPointer(int size, int type, int stride, long pointer); + + /** + * Specifies the location and organization of a texture coordinate array. + * + * @param size the number of values per vertex that are stored in the array. One of:
1234
+ * @param type the data type of the values stored in the array. One of:
{@link #GL_SHORT SHORT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the texture coordinate array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoordPointer(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + nglTexCoordPointer(size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a texture coordinate array. + * + * @param size the number of values per vertex that are stored in the array. One of:
1234
+ * @param type the data type of the values stored in the array. One of:
{@link #GL_SHORT SHORT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the texture coordinate array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoordPointer(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + nglTexCoordPointer(size, type, stride, pointer); + } + + /** + * Specifies the location and organization of a texture coordinate array. + * + * @param size the number of values per vertex that are stored in the array. One of:
1234
+ * @param type the data type of the values stored in the array. One of:
{@link #GL_SHORT SHORT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the texture coordinate array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoordPointer(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ShortBuffer pointer) { + nglTexCoordPointer(size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a texture coordinate array. + * + * @param size the number of values per vertex that are stored in the array. One of:
1234
+ * @param type the data type of the values stored in the array. One of:
{@link #GL_SHORT SHORT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the texture coordinate array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoordPointer(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") IntBuffer pointer) { + nglTexCoordPointer(size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a texture coordinate array. + * + * @param size the number of values per vertex that are stored in the array. One of:
1234
+ * @param type the data type of the values stored in the array. One of:
{@link #GL_SHORT SHORT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the texture coordinate array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoordPointer(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") FloatBuffer pointer) { + nglTexCoordPointer(size, type, stride, memAddress(pointer)); + } + + // --- [ glTexEnvi ] --- + + /** + * Sets parameters of the texture environment that specifies how texture values are interpreted when texturing a fragment, or sets per-texture-unit + * filtering parameters. + * + * @param target the texture environment target. One of:
{@link #GL_TEXTURE_ENV TEXTURE_ENV}{@link GL14#GL_TEXTURE_FILTER_CONTROL TEXTURE_FILTER_CONTROL}{@link GL20#GL_POINT_SPRITE POINT_SPRITE}
+ * @param pname the parameter to set. One of:
{@link GL20#GL_COORD_REPLACE COORD_REPLACE}{@link #GL_TEXTURE_ENV_MODE TEXTURE_ENV_MODE}{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL13#GL_COMBINE_RGB COMBINE_RGB}{@link GL13#GL_COMBINE_ALPHA COMBINE_ALPHA}{@link GL15#GL_SRC0_RGB SRC0_RGB}
{@link GL15#GL_SRC1_RGB SRC1_RGB}{@link GL15#GL_SRC2_RGB SRC2_RGB}{@link GL15#GL_SRC0_ALPHA SRC0_ALPHA}{@link GL15#GL_SRC1_ALPHA SRC1_ALPHA}{@link GL15#GL_SRC2_ALPHA SRC2_ALPHA}{@link GL13#GL_OPERAND0_RGB OPERAND0_RGB}
{@link GL13#GL_OPERAND1_RGB OPERAND1_RGB}{@link GL13#GL_OPERAND2_RGB OPERAND2_RGB}{@link GL13#GL_OPERAND0_ALPHA OPERAND0_ALPHA}{@link GL13#GL_OPERAND1_ALPHA OPERAND1_ALPHA}{@link GL13#GL_OPERAND2_ALPHA OPERAND2_ALPHA}{@link GL13#GL_RGB_SCALE RGB_SCALE}
{@link #GL_ALPHA_SCALE ALPHA_SCALE}
+ * @param param the parameter value. Scalar value or one of:
{@link #GL_REPLACE REPLACE}{@link #GL_MODULATE MODULATE}{@link #GL_DECAL DECAL}{@link #GL_BLEND BLEND}{@link #GL_ADD ADD}{@link GL13#GL_COMBINE COMBINE}{@link GL13#GL_ADD_SIGNED ADD_SIGNED}{@link GL13#GL_INTERPOLATE INTERPOLATE}
{@link GL13#GL_SUBTRACT SUBTRACT}{@link GL13#GL_DOT3_RGB DOT3_RGB}{@link GL13#GL_DOT3_RGBA DOT3_RGBA}{@link #GL_TEXTURE TEXTURE}{@link GL13#GL_TEXTURE0 TEXTURE0}GL13.GL_TEXTURE[1-31]{@link GL13#GL_CONSTANT CONSTANT}{@link GL13#GL_PRIMARY_COLOR PRIMARY_COLOR}
{@link GL13#GL_PREVIOUS PREVIOUS}
+ * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexEnvi(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint") int param); + + // --- [ glTexEnviv ] --- + + /** Unsafe version of: {@link #glTexEnviv TexEnviv} */ + public static native void nglTexEnviv(int target, int pname, long params); + + /** + * Pointer version of {@link #glTexEnvi TexEnvi}. + * + * @param target the texture environment target. Must be:
{@link #GL_TEXTURE_ENV TEXTURE_ENV}
+ * @param pname the parameter to set. Must be:
{@link #GL_TEXTURE_ENV_COLOR TEXTURE_ENV_COLOR}
+ * @param params the parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexEnviv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglTexEnviv(target, pname, memAddress(params)); + } + + // --- [ glTexEnvf ] --- + + /** + * Float version of {@link #glTexEnvi TexEnvi}. + * + * @param target the texture environment target + * @param pname the parameter to set + * @param param the parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexEnvf(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat") float param); + + // --- [ glTexEnvfv ] --- + + /** Unsafe version of: {@link #glTexEnvfv TexEnvfv} */ + public static native void nglTexEnvfv(int target, int pname, long params); + + /** + * Pointer version of {@link #glTexEnvf TexEnvf}. + * + * @param target the texture environment target. Must be:
{@link #GL_TEXTURE_ENV TEXTURE_ENV}
+ * @param pname the parameter to set. Must be:
{@link #GL_TEXTURE_ENV_COLOR TEXTURE_ENV_COLOR}
+ * @param params the parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexEnvfv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglTexEnvfv(target, pname, memAddress(params)); + } + + // --- [ glTexGeni ] --- + + /** + * Sets an integer texture coordinate generation parameter. + * + *

A texture coordinate generation function is enabled or disabled using {@link #glEnable Enable} and {@link #glDisable Disable} with an argument of + * {@link #GL_TEXTURE_GEN_S TEXTURE_GEN_S}, {@link #GL_TEXTURE_GEN_T TEXTURE_GEN_T}, {@link #GL_TEXTURE_GEN_R TEXTURE_GEN_R}, or {@link #GL_TEXTURE_GEN_Q TEXTURE_GEN_Q} (each indicates the corresponding texture + * coordinate). When enabled, the specified texture coordinate is computed according to the current {@link #GL_EYE_LINEAR EYE_LINEAR}, {@link #GL_OBJECT_LINEAR OBJECT_LINEAR} or + * {@link #GL_SPHERE_MAP SPHERE_MAP} specification, depending on the current setting of {@link #GL_TEXTURE_GEN_MODE TEXTURE_GEN_MODE} for that coordinate. When disabled, subsequent + * vertices will take the indicated texture coordinate from the current texture coordinates.

+ * + *

The initial state has the texture generation function disabled for all texture coordinates. Initially all texture generation modes are EYE_LINEAR.

+ * + * @param coord the coordinate for which to set the parameter. One of:
{@link #GL_S S}{@link #GL_T T}{@link #GL_R R}{@link #GL_Q Q}
+ * @param pname the parameter to set. Must be:
{@link #GL_TEXTURE_GEN_MODE TEXTURE_GEN_MODE}
+ * @param param the parameter value. One of:
{@link #GL_OBJECT_LINEAR OBJECT_LINEAR}{@link #GL_EYE_LINEAR EYE_LINEAR}{@link #GL_SPHERE_MAP SPHERE_MAP}{@link GL13#GL_REFLECTION_MAP REFLECTION_MAP}{@link GL13#GL_NORMAL_MAP NORMAL_MAP}
+ * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexGeni(@NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLint") int param); + + // --- [ glTexGeniv ] --- + + /** Unsafe version of: {@link #glTexGeniv TexGeniv} */ + public static native void nglTexGeniv(int coord, int pname, long params); + + /** + * Pointer version of {@link #glTexGeni TexGeni}. + * + * @param coord the coordinate for which to set the parameter + * @param pname the parameter to set. One of:
{@link #GL_OBJECT_PLANE OBJECT_PLANE}{@link #GL_EYE_PLANE EYE_PLANE}
+ * @param params the parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexGeniv(@NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglTexGeniv(coord, pname, memAddress(params)); + } + + // --- [ glTexGenf ] --- + + /** + * Float version of {@link #glTexGeni TexGeni}. + * + * @param coord the coordinate for which to set the parameter + * @param pname the parameter to set + * @param param the parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexGenf(@NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLfloat") float param); + + // --- [ glTexGenfv ] --- + + /** Unsafe version of: {@link #glTexGenfv TexGenfv} */ + public static native void nglTexGenfv(int coord, int pname, long params); + + /** + * Pointer version of {@link #glTexGenf TexGenf}. + * + * @param coord the coordinate for which to set the parameter + * @param pname the parameter to set. One of:
{@link #GL_OBJECT_PLANE OBJECT_PLANE}{@link #GL_EYE_PLANE EYE_PLANE}
+ * @param params the parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexGenfv(@NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglTexGenfv(coord, pname, memAddress(params)); + } + + // --- [ glTexGend ] --- + + /** + * Double version of {@link #glTexGeni TexGeni}. + * + * @param coord the coordinate for which to set the parameter + * @param pname the parameter to set + * @param param the parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexGend(@NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLdouble") double param); + + // --- [ glTexGendv ] --- + + /** Unsafe version of: {@link #glTexGendv TexGendv} */ + public static native void nglTexGendv(int coord, int pname, long params); + + /** + * Pointer version of {@link #glTexGend TexGend}. + * + * @param coord the coordinate for which to set the parameter + * @param pname the parameter to set + * @param params the parameter value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexGendv(@NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLdouble const *") DoubleBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglTexGendv(coord, pname, memAddress(params)); + } + + // --- [ glTexImage1D ] --- + + /** Unsafe version of: {@link #glTexImage1D TexImage1D} */ + public static void nglTexImage1D(int target, int level, int internalformat, int width, int border, int format, int type, long pixels) { + GL11C.nglTexImage1D(target, level, internalformat, width, border, format, type, pixels); + } + + /** + * One-dimensional version of {@link #glTexImage2D TexImage2D}}. + * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}{@link GL11C#GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format + * @param width the texture width + * @param border the texture border width + * @param format the texel data format + * @param type the texel data type + * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer pixels) { + GL11C.glTexImage1D(target, level, internalformat, width, border, format, type, pixels); + } + + /** + * One-dimensional version of {@link #glTexImage2D TexImage2D}}. + * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}{@link GL11C#GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format + * @param width the texture width + * @param border the texture border width + * @param format the texel data format + * @param type the texel data type + * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") long pixels) { + GL11C.glTexImage1D(target, level, internalformat, width, border, format, type, pixels); + } + + /** + * One-dimensional version of {@link #glTexImage2D TexImage2D}}. + * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}{@link GL11C#GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format + * @param width the texture width + * @param border the texture border width + * @param format the texel data format + * @param type the texel data type + * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer pixels) { + GL11C.glTexImage1D(target, level, internalformat, width, border, format, type, pixels); + } + + /** + * One-dimensional version of {@link #glTexImage2D TexImage2D}}. + * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}{@link GL11C#GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format + * @param width the texture width + * @param border the texture border width + * @param format the texel data format + * @param type the texel data type + * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer pixels) { + GL11C.glTexImage1D(target, level, internalformat, width, border, format, type, pixels); + } + + /** + * One-dimensional version of {@link #glTexImage2D TexImage2D}}. + * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}{@link GL11C#GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format + * @param width the texture width + * @param border the texture border width + * @param format the texel data format + * @param type the texel data type + * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer pixels) { + GL11C.glTexImage1D(target, level, internalformat, width, border, format, type, pixels); + } + + /** + * One-dimensional version of {@link #glTexImage2D TexImage2D}}. + * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}{@link GL11C#GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format + * @param width the texture width + * @param border the texture border width + * @param format the texel data format + * @param type the texel data type + * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") DoubleBuffer pixels) { + GL11C.glTexImage1D(target, level, internalformat, width, border, format, type, pixels); + } + + // --- [ glTexImage2D ] --- + + /** Unsafe version of: {@link #glTexImage2D TexImage2D} */ + public static void nglTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, long pixels) { + GL11C.nglTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); + } + + /** + * Specifies a two-dimensional texture image. + * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL11C#GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link GL11C#GL_RED RED}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link GL11C#GL_R3_G3_B2 R3_G3_B2}{@link GL11C#GL_RGB4 RGB4}{@link GL11C#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11C#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11C#GL_RGB10 RGB10}{@link GL11C#GL_RGB12 RGB12}{@link GL11C#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link GL11C#GL_RGBA2 RGBA2}{@link GL11C#GL_RGBA4 RGBA4}{@link GL11C#GL_RGB5_A1 RGB5_A1}{@link GL11C#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11C#GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link GL11C#GL_RGBA12 RGBA12}{@link GL11C#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param border the texture border width + * @param format the texel data format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer pixels) { + GL11C.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); + } + + /** + * Specifies a two-dimensional texture image. + * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL11C#GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link GL11C#GL_RED RED}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link GL11C#GL_R3_G3_B2 R3_G3_B2}{@link GL11C#GL_RGB4 RGB4}{@link GL11C#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11C#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11C#GL_RGB10 RGB10}{@link GL11C#GL_RGB12 RGB12}{@link GL11C#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link GL11C#GL_RGBA2 RGBA2}{@link GL11C#GL_RGBA4 RGBA4}{@link GL11C#GL_RGB5_A1 RGB5_A1}{@link GL11C#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11C#GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link GL11C#GL_RGBA12 RGBA12}{@link GL11C#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param border the texture border width + * @param format the texel data format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") long pixels) { + GL11C.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); + } + + /** + * Specifies a two-dimensional texture image. + * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL11C#GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link GL11C#GL_RED RED}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link GL11C#GL_R3_G3_B2 R3_G3_B2}{@link GL11C#GL_RGB4 RGB4}{@link GL11C#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11C#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11C#GL_RGB10 RGB10}{@link GL11C#GL_RGB12 RGB12}{@link GL11C#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link GL11C#GL_RGBA2 RGBA2}{@link GL11C#GL_RGBA4 RGBA4}{@link GL11C#GL_RGB5_A1 RGB5_A1}{@link GL11C#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11C#GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link GL11C#GL_RGBA12 RGBA12}{@link GL11C#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param border the texture border width + * @param format the texel data format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer pixels) { + GL11C.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); + } + + /** + * Specifies a two-dimensional texture image. + * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL11C#GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link GL11C#GL_RED RED}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link GL11C#GL_R3_G3_B2 R3_G3_B2}{@link GL11C#GL_RGB4 RGB4}{@link GL11C#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11C#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11C#GL_RGB10 RGB10}{@link GL11C#GL_RGB12 RGB12}{@link GL11C#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link GL11C#GL_RGBA2 RGBA2}{@link GL11C#GL_RGBA4 RGBA4}{@link GL11C#GL_RGB5_A1 RGB5_A1}{@link GL11C#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11C#GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link GL11C#GL_RGBA12 RGBA12}{@link GL11C#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param border the texture border width + * @param format the texel data format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer pixels) { + GL11C.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); + } + + /** + * Specifies a two-dimensional texture image. + * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL11C#GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link GL11C#GL_RED RED}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link GL11C#GL_R3_G3_B2 R3_G3_B2}{@link GL11C#GL_RGB4 RGB4}{@link GL11C#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11C#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11C#GL_RGB10 RGB10}{@link GL11C#GL_RGB12 RGB12}{@link GL11C#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link GL11C#GL_RGBA2 RGBA2}{@link GL11C#GL_RGBA4 RGBA4}{@link GL11C#GL_RGB5_A1 RGB5_A1}{@link GL11C#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11C#GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link GL11C#GL_RGBA12 RGBA12}{@link GL11C#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param border the texture border width + * @param format the texel data format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer pixels) { + GL11C.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); + } + + /** + * Specifies a two-dimensional texture image. + * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL11C#GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link GL11C#GL_RED RED}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link GL11C#GL_R3_G3_B2 R3_G3_B2}{@link GL11C#GL_RGB4 RGB4}{@link GL11C#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11C#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11C#GL_RGB10 RGB10}{@link GL11C#GL_RGB12 RGB12}{@link GL11C#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link GL11C#GL_RGBA2 RGBA2}{@link GL11C#GL_RGBA4 RGBA4}{@link GL11C#GL_RGB5_A1 RGB5_A1}{@link GL11C#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11C#GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link GL11C#GL_RGBA12 RGBA12}{@link GL11C#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param border the texture border width + * @param format the texel data format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") DoubleBuffer pixels) { + GL11C.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); + } + + // --- [ glCopyTexImage1D ] --- + + /** + * Defines a one-dimensional texel array in exactly the manner of {@link #glTexImage1D TexImage1D}, except that the image data are taken from the framebuffer rather + * than from client memory. For the purposes of decoding the texture image, {@code CopyTexImage1D} is equivalent to calling {@link #glCopyTexImage2D CopyTexImage2D} + * with corresponding arguments and height of 1, except that the height of the image is always 1, regardless of the value of border. level, internalformat, + * and border are specified using the same values, with the same meanings, as the corresponding arguments of {@link #glTexImage1D TexImage1D}. The constraints on + * width and border are exactly those of the corresponding arguments of {@link #glTexImage1D TexImage1D}. + * + * @param target the texture target. Must be:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}
+ * @param level the level-of-detail number + * @param internalFormat the texture internal format. See {@link #glTexImage2D TexImage2D} for a list of supported formats. + * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the texture width + * @param border the texture border width + * + * @see Reference Page + */ + public static void glCopyTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalFormat, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLint") int border) { + GL11C.glCopyTexImage1D(target, level, internalFormat, x, y, width, border); + } + + // --- [ glCopyTexImage2D ] --- + + /** + * Defines a two-dimensional texel array in exactly the manner of {@link #glTexImage2D TexImage2D}, except that the image data are taken from the framebuffer rather + * than from client memory. + * + *

{@code x}, {@code y}, {@code width}, and {@code height} correspond precisely to the corresponding arguments to {@link #glReadPixels ReadPixels}; they specify the + * image's width and height, and the lower left (x, y) coordinates of the framebuffer region to be copied.

+ * + *

The image is taken from the framebuffer exactly as if these arguments were passed to {@link GL11#glCopyPixels CopyPixels} with argument type set to {@link GL11C#GL_COLOR COLOR}, + * {@link GL11C#GL_DEPTH DEPTH}, or {@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}, depending on {@code internalformat}. RGBA data is taken from the current color buffer, while depth + * component and stencil index data are taken from the depth and stencil buffers, respectively.

+ * + *

Subsequent processing is identical to that described for {@link #glTexImage2D TexImage2D}, beginning with clamping of the R, G, B, A, or depth values, and masking + * of the stencil index values from the resulting pixel groups. Parameters {@code level}, {@code internalformat}, and {@code border} are specified using + * the same values, with the same meanings, as the corresponding arguments of {@link #glTexImage2D TexImage2D}.

+ * + *

The constraints on width, height, and border are exactly those for the corresponding arguments of {@link #glTexImage2D TexImage2D}.

+ * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number + * @param internalFormat the texture internal format. See {@link #glTexImage2D TexImage2D} for a list of supported formats. + * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the texture width + * @param height the texture height + * @param border the texture border width + * + * @see Reference Page + */ + public static void glCopyTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalFormat, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border) { + GL11C.glCopyTexImage2D(target, level, internalFormat, x, y, width, height, border); + } + + // --- [ glCopyTexSubImage1D ] --- + + /** + * Respecifies a rectangular subregion of an existing texel array. No change is made to the {@code internalformat}, {@code width} or {@code border} + * parameters of the specified texel array, nor is any change made to texel values outside the specified subregion. See {@link #glCopyTexImage1D CopyTexImage1D} for more + * details. + * + * @param target the texture target. Must be:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}
+ * @param level the level-of-detail number + * @param xoffset the left texel coordinate of the texture subregion to update + * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the texture subregion width + * + * @see Reference Page + */ + public static void glCopyTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width) { + GL11C.glCopyTexSubImage1D(target, level, xoffset, x, y, width); + } + + // --- [ glCopyTexSubImage2D ] --- + + /** + * Respecifies a rectangular subregion of an existing texel array. No change is made to the {@code internalformat}, {@code width}, {@code height}, + * or {@code border} parameters of the specified texel array, nor is any change made to texel values outside the specified subregion. See + * {@link #glCopyTexImage2D CopyTexImage2D} for more details. + * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number + * @param xoffset the left texel coordinate of the texture subregion to update + * @param yoffset the lower texel coordinate of the texture subregion to update + * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the texture subregion width + * @param height the texture subregion height + * + * @see Reference Page + */ + public static void glCopyTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL11C.glCopyTexSubImage2D(target, level, xoffset, yoffset, x, y, width, height); + } + + // --- [ glTexParameteri ] --- + + /** + * Sets the integer value of a texture parameter, which controls how the texel array is treated when specified or changed, and when applied to a fragment. + * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param pname the parameter to set. One of:
{@link GL12#GL_TEXTURE_BASE_LEVEL TEXTURE_BASE_LEVEL}{@link GL11C#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL11C#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}{@link GL12#GL_TEXTURE_MAX_LEVEL TEXTURE_MAX_LEVEL}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}
{@link GL11C#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL33#GL_TEXTURE_SWIZZLE_R TEXTURE_SWIZZLE_R}{@link GL33#GL_TEXTURE_SWIZZLE_G TEXTURE_SWIZZLE_G}
{@link GL33#GL_TEXTURE_SWIZZLE_B TEXTURE_SWIZZLE_B}{@link GL33#GL_TEXTURE_SWIZZLE_A TEXTURE_SWIZZLE_A}{@link GL33#GL_TEXTURE_SWIZZLE_RGBA TEXTURE_SWIZZLE_RGBA}{@link GL11C#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}
{@link GL11C#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL14#GL_DEPTH_TEXTURE_MODE DEPTH_TEXTURE_MODE}{@link GL14#GL_GENERATE_MIPMAP GENERATE_MIPMAP}
+ * @param param the parameter value + * + * @see Reference Page + */ + public static void glTexParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint") int param) { + GL11C.glTexParameteri(target, pname, param); + } + + // --- [ glTexParameteriv ] --- + + /** Unsafe version of: {@link #glTexParameteriv TexParameteriv} */ + public static void nglTexParameteriv(int target, int pname, long params) { + GL11C.nglTexParameteriv(target, pname, params); + } + + /** + * Pointer version of {@link #glTexParameteri TexParameteri}. + * + * @param target the texture target + * @param pname the parameter to set + * @param params the parameter value + * + * @see Reference Page + */ + public static void glTexParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + GL11C.glTexParameteriv(target, pname, params); + } + + // --- [ glTexParameterf ] --- + + /** + * Float version of {@link #glTexParameteri TexParameteri}. + * + * @param target the texture target + * @param pname the parameter to set + * @param param the parameter value + * + * @see Reference Page + */ + public static void glTexParameterf(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat") float param) { + GL11C.glTexParameterf(target, pname, param); + } + + // --- [ glTexParameterfv ] --- + + /** Unsafe version of: {@link #glTexParameterfv TexParameterfv} */ + public static void nglTexParameterfv(int target, int pname, long params) { + GL11C.nglTexParameterfv(target, pname, params); + } + + /** + * Pointer version of {@link #glTexParameterf TexParameterf}. + * + * @param target the texture target + * @param pname the parameter to set + * @param params the parameter value + * + * @see Reference Page + */ + public static void glTexParameterfv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer params) { + GL11C.glTexParameterfv(target, pname, params); + } + + // --- [ glTexSubImage1D ] --- + + /** Unsafe version of: {@link #glTexSubImage1D TexSubImage1D} */ + public static void nglTexSubImage1D(int target, int level, int xoffset, int width, int format, int type, long pixels) { + GL11C.nglTexSubImage1D(target, level, xoffset, width, format, type, pixels); + } + + /** + * One-dimensional version of {@link #glTexSubImage2D TexSubImage2D}. + * + * @param target the texture target. Must be:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer pixels) { + GL11C.glTexSubImage1D(target, level, xoffset, width, format, type, pixels); + } + + /** + * One-dimensional version of {@link #glTexSubImage2D TexSubImage2D}. + * + * @param target the texture target. Must be:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long pixels) { + GL11C.glTexSubImage1D(target, level, xoffset, width, format, type, pixels); + } + + /** + * One-dimensional version of {@link #glTexSubImage2D TexSubImage2D}. + * + * @param target the texture target. Must be:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer pixels) { + GL11C.glTexSubImage1D(target, level, xoffset, width, format, type, pixels); + } + + /** + * One-dimensional version of {@link #glTexSubImage2D TexSubImage2D}. + * + * @param target the texture target. Must be:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer pixels) { + GL11C.glTexSubImage1D(target, level, xoffset, width, format, type, pixels); + } + + /** + * One-dimensional version of {@link #glTexSubImage2D TexSubImage2D}. + * + * @param target the texture target. Must be:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer pixels) { + GL11C.glTexSubImage1D(target, level, xoffset, width, format, type, pixels); + } + + /** + * One-dimensional version of {@link #glTexSubImage2D TexSubImage2D}. + * + * @param target the texture target. Must be:
{@link GL11C#GL_TEXTURE_1D TEXTURE_1D}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") DoubleBuffer pixels) { + GL11C.glTexSubImage1D(target, level, xoffset, width, format, type, pixels); + } + + // --- [ glTexSubImage2D ] --- + + /** Unsafe version of: {@link #glTexSubImage2D TexSubImage2D} */ + public static void nglTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, long pixels) { + GL11C.nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * Respecifies a rectangular subregion of an existing texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer pixels) { + GL11C.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * Respecifies a rectangular subregion of an existing texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long pixels) { + GL11C.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * Respecifies a rectangular subregion of an existing texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer pixels) { + GL11C.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * Respecifies a rectangular subregion of an existing texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer pixels) { + GL11C.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * Respecifies a rectangular subregion of an existing texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer pixels) { + GL11C.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * Respecifies a rectangular subregion of an existing texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link GL11C#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11C#GL_RED RED}{@link GL11C#GL_GREEN GREEN}{@link GL11C#GL_BLUE BLUE}{@link GL11C#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11C#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11C#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11C#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11C#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11C#GL_BYTE BYTE}{@link GL11C#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11C#GL_SHORT SHORT}
{@link GL11C#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11C#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11C#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") DoubleBuffer pixels) { + GL11C.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); + } + + // --- [ glTranslatef ] --- + + /** + * Manipulates the current matrix with a translation matrix along the x-, y- and z- axes. + * + *

Calling this function is equivalent to calling {@link #glMultMatrixf MultMatrixf} with the following matrix:

+ * + * + * + * + * + * + *
100x
010y
001z
0001
+ * + * @param x the x-axis translation + * @param y the y-axis translation + * @param z the z-axis translation + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTranslatef(@NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z); + + // --- [ glTranslated ] --- + + /** + * Double version of {@link #glTranslatef Translatef}. + * + * @param x the x-axis translation + * @param y the y-axis translation + * @param z the z-axis translation + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTranslated(@NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z); + + // --- [ glVertex2f ] --- + + /** + * Specifies a single vertex between {@link #glBegin Begin} and {@link #glEnd End} by giving its coordinates in two dimensions. The z coordinate is implicitly set + * to zero and the w coordinate to one. + * + * @param x the vertex x coordinate + * @param y the vertex y coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glVertex2f(@NativeType("GLfloat") float x, @NativeType("GLfloat") float y); + + // --- [ glVertex2s ] --- + + /** + * Short version of {@link #glVertex2f Vertex2f}. + * + * @param x the vertex x coordinate + * @param y the vertex y coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glVertex2s(@NativeType("GLshort") short x, @NativeType("GLshort") short y); + + // --- [ glVertex2i ] --- + + /** + * Integer version of {@link #glVertex2f Vertex2f}. + * + * @param x the vertex x coordinate + * @param y the vertex y coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glVertex2i(@NativeType("GLint") int x, @NativeType("GLint") int y); + + // --- [ glVertex2d ] --- + + /** + * Double version of {@link #glVertex2f Vertex2f}. + * + * @param x the vertex x coordinate + * @param y the vertex y coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glVertex2d(@NativeType("GLdouble") double x, @NativeType("GLdouble") double y); + + // --- [ glVertex2fv ] --- + + /** Unsafe version of: {@link #glVertex2fv Vertex2fv} */ + public static native void nglVertex2fv(long coords); + + /** + * Pointer version of {@link #glVertex2f Vertex2f}. + * + * @param coords the vertex buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex2fv(@NativeType("GLfloat const *") FloatBuffer coords) { + if (CHECKS) { + check(coords, 2); + } + nglVertex2fv(memAddress(coords)); + } + + // --- [ glVertex2sv ] --- + + /** Unsafe version of: {@link #glVertex2sv Vertex2sv} */ + public static native void nglVertex2sv(long coords); + + /** + * Pointer version of {@link #glVertex2s Vertex2s}. + * + * @param coords the vertex buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex2sv(@NativeType("GLshort const *") ShortBuffer coords) { + if (CHECKS) { + check(coords, 2); + } + nglVertex2sv(memAddress(coords)); + } + + // --- [ glVertex2iv ] --- + + /** Unsafe version of: {@link #glVertex2iv Vertex2iv} */ + public static native void nglVertex2iv(long coords); + + /** + * Pointer version of {@link #glVertex2i Vertex2i}. + * + * @param coords the vertex buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex2iv(@NativeType("GLint const *") IntBuffer coords) { + if (CHECKS) { + check(coords, 2); + } + nglVertex2iv(memAddress(coords)); + } + + // --- [ glVertex2dv ] --- + + /** Unsafe version of: {@link #glVertex2dv Vertex2dv} */ + public static native void nglVertex2dv(long coords); + + /** + * Pointer version of {@link #glVertex2d Vertex2d}. + * + * @param coords the vertex buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex2dv(@NativeType("GLdouble const *") DoubleBuffer coords) { + if (CHECKS) { + check(coords, 2); + } + nglVertex2dv(memAddress(coords)); + } + + // --- [ glVertex3f ] --- + + /** + * Specifies a single vertex between {@link #glBegin Begin} and {@link #glEnd End} by giving its coordinates in three dimensions. The w coordinate is implicitly set + * to one. + * + * @param x the vertex x coordinate + * @param y the vertex y coordinate + * @param z the vertex z coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glVertex3f(@NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z); + + // --- [ glVertex3s ] --- + + /** + * Short version of {@link #glVertex3f Vertex3f}. + * + * @param x the vertex x coordinate + * @param y the vertex y coordinate + * @param z the vertex z coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glVertex3s(@NativeType("GLshort") short x, @NativeType("GLshort") short y, @NativeType("GLshort") short z); + + // --- [ glVertex3i ] --- + + /** + * Integer version of {@link #glVertex3f Vertex3f}. + * + * @param x the vertex x coordinate + * @param y the vertex y coordinate + * @param z the vertex z coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glVertex3i(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z); + + // --- [ glVertex3d ] --- + + /** + * Double version of {@link #glVertex3f Vertex3f}. + * + * @param x the vertex x coordinate + * @param y the vertex y coordinate + * @param z the vertex z coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glVertex3d(@NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z); + + // --- [ glVertex3fv ] --- + + /** Unsafe version of: {@link #glVertex3fv Vertex3fv} */ + public static native void nglVertex3fv(long coords); + + /** + * Pointer version of {@link #glVertex3f Vertex3f}. + * + * @param coords the vertex buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex3fv(@NativeType("GLfloat const *") FloatBuffer coords) { + if (CHECKS) { + check(coords, 3); + } + nglVertex3fv(memAddress(coords)); + } + + // --- [ glVertex3sv ] --- + + /** Unsafe version of: {@link #glVertex3sv Vertex3sv} */ + public static native void nglVertex3sv(long coords); + + /** + * Pointer version of {@link #glVertex3s Vertex3s}. + * + * @param coords the vertex buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex3sv(@NativeType("GLshort const *") ShortBuffer coords) { + if (CHECKS) { + check(coords, 3); + } + nglVertex3sv(memAddress(coords)); + } + + // --- [ glVertex3iv ] --- + + /** Unsafe version of: {@link #glVertex3iv Vertex3iv} */ + public static native void nglVertex3iv(long coords); + + /** + * Pointer version of {@link #glVertex3i Vertex3i}. + * + * @param coords the vertex buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex3iv(@NativeType("GLint const *") IntBuffer coords) { + if (CHECKS) { + check(coords, 3); + } + nglVertex3iv(memAddress(coords)); + } + + // --- [ glVertex3dv ] --- + + /** Unsafe version of: {@link #glVertex3dv Vertex3dv} */ + public static native void nglVertex3dv(long coords); + + /** + * Pointer version of {@link #glVertex3d Vertex3d}. + * + * @param coords the vertex buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex3dv(@NativeType("GLdouble const *") DoubleBuffer coords) { + if (CHECKS) { + check(coords, 3); + } + nglVertex3dv(memAddress(coords)); + } + + // --- [ glVertex4f ] --- + + /** + * Specifies a single vertex between {@link #glBegin Begin} and {@link #glEnd End} by giving its coordinates in four dimensions. + * + * @param x the vertex x coordinate + * @param y the vertex y coordinate + * @param z the vertex z coordinate + * @param w the vertex w coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glVertex4f(@NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z, @NativeType("GLfloat") float w); + + // --- [ glVertex4s ] --- + + /** + * Short version of {@link #glVertex4f Vertex4f}. + * + * @param x the vertex x coordinate + * @param y the vertex y coordinate + * @param z the vertex z coordinate + * @param w the vertex w coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glVertex4s(@NativeType("GLshort") short x, @NativeType("GLshort") short y, @NativeType("GLshort") short z, @NativeType("GLshort") short w); + + // --- [ glVertex4i ] --- + + /** + * Integer version of {@link #glVertex4f Vertex4f}. + * + * @param x the vertex x coordinate + * @param y the vertex y coordinate + * @param z the vertex z coordinate + * @param w the vertex w coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glVertex4i(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z, @NativeType("GLint") int w); + + // --- [ glVertex4d ] --- + + /** + * Double version of {@link #glVertex4f Vertex4f}. + * + * @param x the vertex x coordinate + * @param y the vertex y coordinate + * @param z the vertex z coordinate + * @param w the vertex w coordinate + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glVertex4d(@NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z, @NativeType("GLdouble") double w); + + // --- [ glVertex4fv ] --- + + /** Unsafe version of: {@link #glVertex4fv Vertex4fv} */ + public static native void nglVertex4fv(long coords); + + /** + * Pointer version of {@link #glVertex4f Vertex4f}. + * + * @param coords the vertex buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex4fv(@NativeType("GLfloat const *") FloatBuffer coords) { + if (CHECKS) { + check(coords, 4); + } + nglVertex4fv(memAddress(coords)); + } + + // --- [ glVertex4sv ] --- + + /** Unsafe version of: {@link #glVertex4sv Vertex4sv} */ + public static native void nglVertex4sv(long coords); + + /** + * Pointer version of {@link #glVertex4s Vertex4s}. + * + * @param coords the vertex buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex4sv(@NativeType("GLshort const *") ShortBuffer coords) { + if (CHECKS) { + check(coords, 4); + } + nglVertex4sv(memAddress(coords)); + } + + // --- [ glVertex4iv ] --- + + /** Unsafe version of: {@link #glVertex4iv Vertex4iv} */ + public static native void nglVertex4iv(long coords); + + /** + * Pointer version of {@link #glVertex4i Vertex4i}. + * + * @param coords the vertex buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex4iv(@NativeType("GLint const *") IntBuffer coords) { + if (CHECKS) { + check(coords, 4); + } + nglVertex4iv(memAddress(coords)); + } + + // --- [ glVertex4dv ] --- + + /** Unsafe version of: {@link #glVertex4dv Vertex4dv} */ + public static native void nglVertex4dv(long coords); + + /** + * Pointer version of {@link #glVertex4d Vertex4d}. + * + * @param coords the vertex buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex4dv(@NativeType("GLdouble const *") DoubleBuffer coords) { + if (CHECKS) { + check(coords, 4); + } + nglVertex4dv(memAddress(coords)); + } + + // --- [ glVertexPointer ] --- + + /** Unsafe version of: {@link #glVertexPointer VertexPointer} */ + public static native void nglVertexPointer(int size, int type, int stride, long pointer); + + /** + * Specifies the location and organization of a vertex array. + * + * @param size the number of values per vertex that are stored in the array. One of:
234
+ * @param type the data type of the values stored in the array. One of:
{@link #GL_SHORT SHORT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the vertex array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertexPointer(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + nglVertexPointer(size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a vertex array. + * + * @param size the number of values per vertex that are stored in the array. One of:
234
+ * @param type the data type of the values stored in the array. One of:
{@link #GL_SHORT SHORT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the vertex array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertexPointer(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + nglVertexPointer(size, type, stride, pointer); + } + + /** + * Specifies the location and organization of a vertex array. + * + * @param size the number of values per vertex that are stored in the array. One of:
234
+ * @param type the data type of the values stored in the array. One of:
{@link #GL_SHORT SHORT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the vertex array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertexPointer(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ShortBuffer pointer) { + nglVertexPointer(size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a vertex array. + * + * @param size the number of values per vertex that are stored in the array. One of:
234
+ * @param type the data type of the values stored in the array. One of:
{@link #GL_SHORT SHORT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the vertex array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertexPointer(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") IntBuffer pointer) { + nglVertexPointer(size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a vertex array. + * + * @param size the number of values per vertex that are stored in the array. One of:
234
+ * @param type the data type of the values stored in the array. One of:
{@link #GL_SHORT SHORT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}{@link #GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the vertex array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertexPointer(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") FloatBuffer pointer) { + nglVertexPointer(size, type, stride, memAddress(pointer)); + } + + // --- [ glViewport ] --- + + /** + * Specifies the viewport transformation parameters for all viewports. + * + *

The location of the viewport's bottom-left corner, given by {@code (x, y)}, are clamped to be within the implementation-dependent viewport bounds range. + * The viewport bounds range {@code [min, max]} tuple may be determined by calling {@link #glGetFloatv GetFloatv} with the symbolic + * constant {@link GL41#GL_VIEWPORT_BOUNDS_RANGE VIEWPORT_BOUNDS_RANGE}. Viewport width and height are clamped to implementation-dependent maximums when specified. The maximum + * width and height may be found by calling {@link #glGetFloatv GetFloatv} with the symbolic constant {@link GL11C#GL_MAX_VIEWPORT_DIMS MAX_VIEWPORT_DIMS}. The + * maximum viewport dimensions must be greater than or equal to the larger of the visible dimensions of the display being rendered to (if a display + * exists), and the largest renderbuffer image which can be successfully created and attached to a framebuffer object.

+ * + *

In the initial state, {@code w} and {@code h} for each viewport are set to the width and height, respectively, of the window into which the GL is to do + * its rendering. If the default framebuffer is bound but no default framebuffer is associated with the GL context, then {@code w} and {@code h} are + * initially set to zero.

+ * + * @param x the left viewport coordinate + * @param y the bottom viewport coordinate + * @param w the viewport width + * @param h the viewport height + * + * @see Reference Page + */ + public static void glViewport(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int w, @NativeType("GLsizei") int h) { + GL11C.glViewport(x, y, w, h); + } + + /** + * Array version of: {@link #glAreTexturesResident AreTexturesResident} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + @NativeType("GLboolean") + public static boolean glAreTexturesResident(@NativeType("GLuint const *") int[] textures, @NativeType("GLboolean *") ByteBuffer residences) { + long __functionAddress = GL.getICD().glAreTexturesResident; + if (CHECKS) { + check(__functionAddress); + check(residences, textures.length); + } + return callPPZ(textures.length, textures, memAddress(residences), __functionAddress); + } + + /** + * Array version of: {@link #glClipPlane ClipPlane} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glClipPlane(@NativeType("GLenum") int plane, @NativeType("GLdouble const *") double[] equation) { + long __functionAddress = GL.getICD().glClipPlane; + if (CHECKS) { + check(__functionAddress); + check(equation, 4); + } + callPV(plane, equation, __functionAddress); + } + + /** + * Array version of: {@link #glColor3sv Color3sv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor3sv(@NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glColor3sv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glColor3iv Color3iv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor3iv(@NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glColor3iv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glColor3fv Color3fv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor3fv(@NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glColor3fv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glColor3dv Color3dv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor3dv(@NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glColor3dv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glColor3usv Color3usv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor3usv(@NativeType("GLushort const *") short[] v) { + long __functionAddress = GL.getICD().glColor3usv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glColor3uiv Color3uiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor3uiv(@NativeType("GLuint const *") int[] v) { + long __functionAddress = GL.getICD().glColor3uiv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glColor4sv Color4sv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor4sv(@NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glColor4sv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glColor4iv Color4iv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor4iv(@NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glColor4iv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glColor4fv Color4fv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor4fv(@NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glColor4fv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glColor4dv Color4dv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor4dv(@NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glColor4dv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glColor4usv Color4usv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor4usv(@NativeType("GLushort const *") short[] v) { + long __functionAddress = GL.getICD().glColor4usv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glColor4uiv Color4uiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColor4uiv(@NativeType("GLuint const *") int[] v) { + long __functionAddress = GL.getICD().glColor4uiv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glDrawPixels DrawPixels} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glDrawPixels(@NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] pixels) { + long __functionAddress = GL.getICD().glDrawPixels; + if (CHECKS) { + check(__functionAddress); + } + callPV(width, height, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glDrawPixels DrawPixels} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glDrawPixels(@NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] pixels) { + long __functionAddress = GL.getICD().glDrawPixels; + if (CHECKS) { + check(__functionAddress); + } + callPV(width, height, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glDrawPixels DrawPixels} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glDrawPixels(@NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] pixels) { + long __functionAddress = GL.getICD().glDrawPixels; + if (CHECKS) { + check(__functionAddress); + } + callPV(width, height, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glEvalCoord1fv EvalCoord1fv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glEvalCoord1fv(@NativeType("GLfloat const *") float[] u) { + long __functionAddress = GL.getICD().glEvalCoord1fv; + if (CHECKS) { + check(__functionAddress); + check(u, 1); + } + callPV(u, __functionAddress); + } + + /** + * Array version of: {@link #glEvalCoord1dv EvalCoord1dv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glEvalCoord1dv(@NativeType("GLdouble const *") double[] u) { + long __functionAddress = GL.getICD().glEvalCoord1dv; + if (CHECKS) { + check(__functionAddress); + check(u, 1); + } + callPV(u, __functionAddress); + } + + /** + * Array version of: {@link #glEvalCoord2fv EvalCoord2fv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glEvalCoord2fv(@NativeType("GLfloat const *") float[] u) { + long __functionAddress = GL.getICD().glEvalCoord2fv; + if (CHECKS) { + check(__functionAddress); + check(u, 2); + } + callPV(u, __functionAddress); + } + + /** + * Array version of: {@link #glEvalCoord2dv EvalCoord2dv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glEvalCoord2dv(@NativeType("GLdouble const *") double[] u) { + long __functionAddress = GL.getICD().glEvalCoord2dv; + if (CHECKS) { + check(__functionAddress); + check(u, 2); + } + callPV(u, __functionAddress); + } + + /** + * Array version of: {@link #glFeedbackBuffer FeedbackBuffer} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glFeedbackBuffer(@NativeType("GLenum") int type, @NativeType("GLfloat *") float[] buffer) { + long __functionAddress = GL.getICD().glFeedbackBuffer; + if (CHECKS) { + check(__functionAddress); + } + callPV(buffer.length, type, buffer, __functionAddress); + } + + /** + * Array version of: {@link #glFogiv Fogiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glFogiv(@NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glFogiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glFogfv Fogfv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glFogfv(@NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] params) { + long __functionAddress = GL.getICD().glFogfv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGenTextures GenTextures} + * + * @see Reference Page + */ + public static void glGenTextures(@NativeType("GLuint *") int[] textures) { + GL11C.glGenTextures(textures); + } + + /** + * Array version of: {@link #glDeleteTextures DeleteTextures} + * + * @see Reference Page + */ + public static void glDeleteTextures(@NativeType("GLuint const *") int[] textures) { + GL11C.glDeleteTextures(textures); + } + + /** + * Array version of: {@link #glGetClipPlane GetClipPlane} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetClipPlane(@NativeType("GLenum") int plane, @NativeType("GLdouble *") double[] equation) { + long __functionAddress = GL.getICD().glGetClipPlane; + if (CHECKS) { + check(__functionAddress); + check(equation, 4); + } + callPV(plane, equation, __functionAddress); + } + + /** + * Array version of: {@link #glGetFloatv GetFloatv} + * + * @see Reference Page + */ + public static void glGetFloatv(@NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + GL11C.glGetFloatv(pname, params); + } + + /** + * Array version of: {@link #glGetIntegerv GetIntegerv} + * + * @see Reference Page + */ + public static void glGetIntegerv(@NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL11C.glGetIntegerv(pname, params); + } + + /** + * Array version of: {@link #glGetDoublev GetDoublev} + * + * @see Reference Page + */ + public static void glGetDoublev(@NativeType("GLenum") int pname, @NativeType("GLdouble *") double[] params) { + GL11C.glGetDoublev(pname, params); + } + + /** + * Array version of: {@link #glGetLightiv GetLightiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetLightiv(@NativeType("GLenum") int light, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] data) { + long __functionAddress = GL.getICD().glGetLightiv; + if (CHECKS) { + check(__functionAddress); + check(data, 4); + } + callPV(light, pname, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetLightfv GetLightfv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetLightfv(@NativeType("GLenum") int light, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] data) { + long __functionAddress = GL.getICD().glGetLightfv; + if (CHECKS) { + check(__functionAddress); + check(data, 4); + } + callPV(light, pname, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetMapiv GetMapiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetMapiv(@NativeType("GLenum") int target, @NativeType("GLenum") int query, @NativeType("GLint *") int[] data) { + long __functionAddress = GL.getICD().glGetMapiv; + if (CHECKS) { + check(__functionAddress); + check(data, 4); + } + callPV(target, query, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetMapfv GetMapfv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetMapfv(@NativeType("GLenum") int target, @NativeType("GLenum") int query, @NativeType("GLfloat *") float[] data) { + long __functionAddress = GL.getICD().glGetMapfv; + if (CHECKS) { + check(__functionAddress); + check(data, 4); + } + callPV(target, query, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetMapdv GetMapdv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetMapdv(@NativeType("GLenum") int target, @NativeType("GLenum") int query, @NativeType("GLdouble *") double[] data) { + long __functionAddress = GL.getICD().glGetMapdv; + if (CHECKS) { + check(__functionAddress); + check(data, 4); + } + callPV(target, query, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetMaterialiv GetMaterialiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetMaterialiv(@NativeType("GLenum") int face, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] data) { + long __functionAddress = GL.getICD().glGetMaterialiv; + if (CHECKS) { + check(__functionAddress); + check(data, 1); + } + callPV(face, pname, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetMaterialfv GetMaterialfv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetMaterialfv(@NativeType("GLenum") int face, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] data) { + long __functionAddress = GL.getICD().glGetMaterialfv; + if (CHECKS) { + check(__functionAddress); + check(data, 1); + } + callPV(face, pname, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetPixelMapfv GetPixelMapfv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetPixelMapfv(@NativeType("GLenum") int map, @NativeType("GLfloat *") float[] data) { + long __functionAddress = GL.getICD().glGetPixelMapfv; + if (CHECKS) { + check(__functionAddress); + check(data, 32); + } + callPV(map, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetPixelMapusv GetPixelMapusv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetPixelMapusv(@NativeType("GLenum") int map, @NativeType("GLushort *") short[] data) { + long __functionAddress = GL.getICD().glGetPixelMapusv; + if (CHECKS) { + check(__functionAddress); + check(data, 32); + } + callPV(map, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetPixelMapuiv GetPixelMapuiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetPixelMapuiv(@NativeType("GLenum") int map, @NativeType("GLuint *") int[] data) { + long __functionAddress = GL.getICD().glGetPixelMapuiv; + if (CHECKS) { + check(__functionAddress); + check(data, 32); + } + callPV(map, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetTexEnviv GetTexEnviv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetTexEnviv(@NativeType("GLenum") int env, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] data) { + long __functionAddress = GL.getICD().glGetTexEnviv; + if (CHECKS) { + check(__functionAddress); + check(data, 1); + } + callPV(env, pname, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetTexEnvfv GetTexEnvfv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetTexEnvfv(@NativeType("GLenum") int env, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] data) { + long __functionAddress = GL.getICD().glGetTexEnvfv; + if (CHECKS) { + check(__functionAddress); + check(data, 1); + } + callPV(env, pname, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetTexGeniv GetTexGeniv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetTexGeniv(@NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] data) { + long __functionAddress = GL.getICD().glGetTexGeniv; + if (CHECKS) { + check(__functionAddress); + check(data, 1); + } + callPV(coord, pname, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetTexGenfv GetTexGenfv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetTexGenfv(@NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] data) { + long __functionAddress = GL.getICD().glGetTexGenfv; + if (CHECKS) { + check(__functionAddress); + check(data, 4); + } + callPV(coord, pname, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetTexGendv GetTexGendv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glGetTexGendv(@NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLdouble *") double[] data) { + long __functionAddress = GL.getICD().glGetTexGendv; + if (CHECKS) { + check(__functionAddress); + check(data, 4); + } + callPV(coord, pname, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetTexImage GetTexImage} + * + * @see Reference Page + */ + public static void glGetTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") short[] pixels) { + GL11C.glGetTexImage(tex, level, format, type, pixels); + } + + /** + * Array version of: {@link #glGetTexImage GetTexImage} + * + * @see Reference Page + */ + public static void glGetTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") int[] pixels) { + GL11C.glGetTexImage(tex, level, format, type, pixels); + } + + /** + * Array version of: {@link #glGetTexImage GetTexImage} + * + * @see Reference Page + */ + public static void glGetTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") float[] pixels) { + GL11C.glGetTexImage(tex, level, format, type, pixels); + } + + /** + * Array version of: {@link #glGetTexImage GetTexImage} + * + * @see Reference Page + */ + public static void glGetTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") double[] pixels) { + GL11C.glGetTexImage(tex, level, format, type, pixels); + } + + /** + * Array version of: {@link #glGetTexLevelParameteriv GetTexLevelParameteriv} + * + * @see Reference Page + */ + public static void glGetTexLevelParameteriv(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL11C.glGetTexLevelParameteriv(target, level, pname, params); + } + + /** + * Array version of: {@link #glGetTexLevelParameterfv GetTexLevelParameterfv} + * + * @see Reference Page + */ + public static void glGetTexLevelParameterfv(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + GL11C.glGetTexLevelParameterfv(target, level, pname, params); + } + + /** + * Array version of: {@link #glGetTexParameteriv GetTexParameteriv} + * + * @see Reference Page + */ + public static void glGetTexParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL11C.glGetTexParameteriv(target, pname, params); + } + + /** + * Array version of: {@link #glGetTexParameterfv GetTexParameterfv} + * + * @see Reference Page + */ + public static void glGetTexParameterfv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + GL11C.glGetTexParameterfv(target, pname, params); + } + + /** + * Array version of: {@link #glIndexiv Indexiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glIndexiv(@NativeType("GLint const *") int[] index) { + long __functionAddress = GL.getICD().glIndexiv; + if (CHECKS) { + check(__functionAddress); + check(index, 1); + } + callPV(index, __functionAddress); + } + + /** + * Array version of: {@link #glIndexsv Indexsv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glIndexsv(@NativeType("GLshort const *") short[] index) { + long __functionAddress = GL.getICD().glIndexsv; + if (CHECKS) { + check(__functionAddress); + check(index, 1); + } + callPV(index, __functionAddress); + } + + /** + * Array version of: {@link #glIndexfv Indexfv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glIndexfv(@NativeType("GLfloat const *") float[] index) { + long __functionAddress = GL.getICD().glIndexfv; + if (CHECKS) { + check(__functionAddress); + check(index, 1); + } + callPV(index, __functionAddress); + } + + /** + * Array version of: {@link #glIndexdv Indexdv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glIndexdv(@NativeType("GLdouble const *") double[] index) { + long __functionAddress = GL.getICD().glIndexdv; + if (CHECKS) { + check(__functionAddress); + check(index, 1); + } + callPV(index, __functionAddress); + } + + /** + * Array version of: {@link #glInterleavedArrays InterleavedArrays} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glInterleavedArrays(@NativeType("GLenum") int format, @NativeType("GLsizei") int stride, @NativeType("void const *") short[] pointer) { + long __functionAddress = GL.getICD().glInterleavedArrays; + if (CHECKS) { + check(__functionAddress); + } + callPV(format, stride, pointer, __functionAddress); + } + + /** + * Array version of: {@link #glInterleavedArrays InterleavedArrays} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glInterleavedArrays(@NativeType("GLenum") int format, @NativeType("GLsizei") int stride, @NativeType("void const *") int[] pointer) { + long __functionAddress = GL.getICD().glInterleavedArrays; + if (CHECKS) { + check(__functionAddress); + } + callPV(format, stride, pointer, __functionAddress); + } + + /** + * Array version of: {@link #glInterleavedArrays InterleavedArrays} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glInterleavedArrays(@NativeType("GLenum") int format, @NativeType("GLsizei") int stride, @NativeType("void const *") float[] pointer) { + long __functionAddress = GL.getICD().glInterleavedArrays; + if (CHECKS) { + check(__functionAddress); + } + callPV(format, stride, pointer, __functionAddress); + } + + /** + * Array version of: {@link #glInterleavedArrays InterleavedArrays} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glInterleavedArrays(@NativeType("GLenum") int format, @NativeType("GLsizei") int stride, @NativeType("void const *") double[] pointer) { + long __functionAddress = GL.getICD().glInterleavedArrays; + if (CHECKS) { + check(__functionAddress); + } + callPV(format, stride, pointer, __functionAddress); + } + + /** + * Array version of: {@link #glLightModeliv LightModeliv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glLightModeliv(@NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glLightModeliv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glLightModelfv LightModelfv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glLightModelfv(@NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] params) { + long __functionAddress = GL.getICD().glLightModelfv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glLightiv Lightiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glLightiv(@NativeType("GLenum") int light, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glLightiv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(light, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glLightfv Lightfv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glLightfv(@NativeType("GLenum") int light, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] params) { + long __functionAddress = GL.getICD().glLightfv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(light, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glLoadMatrixf LoadMatrixf} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glLoadMatrixf(@NativeType("GLfloat const *") float[] m) { + long __functionAddress = GL.getICD().glLoadMatrixf; + if (CHECKS) { + check(__functionAddress); + check(m, 16); + } + callPV(m, __functionAddress); + } + + /** + * Array version of: {@link #glLoadMatrixd LoadMatrixd} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glLoadMatrixd(@NativeType("GLdouble const *") double[] m) { + long __functionAddress = GL.getICD().glLoadMatrixd; + if (CHECKS) { + check(__functionAddress); + check(m, 16); + } + callPV(m, __functionAddress); + } + + /** + * Array version of: {@link #glMap1f Map1f} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMap1f(@NativeType("GLenum") int target, @NativeType("GLfloat") float u1, @NativeType("GLfloat") float u2, @NativeType("GLint") int stride, @NativeType("GLint") int order, @NativeType("GLfloat const *") float[] points) { + long __functionAddress = GL.getICD().glMap1f; + if (CHECKS) { + check(__functionAddress); + check(points, order * stride); + } + callPV(target, u1, u2, stride, order, points, __functionAddress); + } + + /** + * Array version of: {@link #glMap1d Map1d} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMap1d(@NativeType("GLenum") int target, @NativeType("GLdouble") double u1, @NativeType("GLdouble") double u2, @NativeType("GLint") int stride, @NativeType("GLint") int order, @NativeType("GLdouble const *") double[] points) { + long __functionAddress = GL.getICD().glMap1d; + if (CHECKS) { + check(__functionAddress); + check(points, stride * order); + } + callPV(target, u1, u2, stride, order, points, __functionAddress); + } + + /** + * Array version of: {@link #glMap2f Map2f} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMap2f(@NativeType("GLenum") int target, @NativeType("GLfloat") float u1, @NativeType("GLfloat") float u2, @NativeType("GLint") int ustride, @NativeType("GLint") int uorder, @NativeType("GLfloat") float v1, @NativeType("GLfloat") float v2, @NativeType("GLint") int vstride, @NativeType("GLint") int vorder, @NativeType("GLfloat const *") float[] points) { + long __functionAddress = GL.getICD().glMap2f; + if (CHECKS) { + check(__functionAddress); + check(points, ustride * uorder * vstride * vorder); + } + callPV(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points, __functionAddress); + } + + /** + * Array version of: {@link #glMap2d Map2d} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMap2d(@NativeType("GLenum") int target, @NativeType("GLdouble") double u1, @NativeType("GLdouble") double u2, @NativeType("GLint") int ustride, @NativeType("GLint") int uorder, @NativeType("GLdouble") double v1, @NativeType("GLdouble") double v2, @NativeType("GLint") int vstride, @NativeType("GLint") int vorder, @NativeType("GLdouble const *") double[] points) { + long __functionAddress = GL.getICD().glMap2d; + if (CHECKS) { + check(__functionAddress); + check(points, ustride * uorder * vstride * vorder); + } + callPV(target, u1, u2, ustride, uorder, v1, v2, vstride, vorder, points, __functionAddress); + } + + /** + * Array version of: {@link #glMaterialiv Materialiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMaterialiv(@NativeType("GLenum") int face, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glMaterialiv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(face, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glMaterialfv Materialfv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMaterialfv(@NativeType("GLenum") int face, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] params) { + long __functionAddress = GL.getICD().glMaterialfv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(face, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glMultMatrixf MultMatrixf} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultMatrixf(@NativeType("GLfloat const *") float[] m) { + long __functionAddress = GL.getICD().glMultMatrixf; + if (CHECKS) { + check(__functionAddress); + check(m, 16); + } + callPV(m, __functionAddress); + } + + /** + * Array version of: {@link #glMultMatrixd MultMatrixd} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultMatrixd(@NativeType("GLdouble const *") double[] m) { + long __functionAddress = GL.getICD().glMultMatrixd; + if (CHECKS) { + check(__functionAddress); + check(m, 16); + } + callPV(m, __functionAddress); + } + + /** + * Array version of: {@link #glNormal3fv Normal3fv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glNormal3fv(@NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glNormal3fv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glNormal3sv Normal3sv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glNormal3sv(@NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glNormal3sv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glNormal3iv Normal3iv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glNormal3iv(@NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glNormal3iv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glNormal3dv Normal3dv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glNormal3dv(@NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glNormal3dv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glPixelMapfv PixelMapfv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glPixelMapfv(@NativeType("GLenum") int map, @NativeType("GLfloat const *") float[] values) { + long __functionAddress = GL.getICD().glPixelMapfv; + if (CHECKS) { + check(__functionAddress); + } + callPV(map, values.length, values, __functionAddress); + } + + /** + * Array version of: {@link #glPixelMapusv PixelMapusv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glPixelMapusv(@NativeType("GLenum") int map, @NativeType("GLushort const *") short[] values) { + long __functionAddress = GL.getICD().glPixelMapusv; + if (CHECKS) { + check(__functionAddress); + } + callPV(map, values.length, values, __functionAddress); + } + + /** + * Array version of: {@link #glPixelMapuiv PixelMapuiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glPixelMapuiv(@NativeType("GLenum") int map, @NativeType("GLuint const *") int[] values) { + long __functionAddress = GL.getICD().glPixelMapuiv; + if (CHECKS) { + check(__functionAddress); + } + callPV(map, values.length, values, __functionAddress); + } + + /** + * Array version of: {@link #glPrioritizeTextures PrioritizeTextures} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glPrioritizeTextures(@NativeType("GLuint const *") int[] textures, @NativeType("GLfloat const *") float[] priorities) { + long __functionAddress = GL.getICD().glPrioritizeTextures; + if (CHECKS) { + check(__functionAddress); + check(priorities, textures.length); + } + callPPV(textures.length, textures, priorities, __functionAddress); + } + + /** + * Array version of: {@link #glRasterPos2iv RasterPos2iv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos2iv(@NativeType("GLint const *") int[] coords) { + long __functionAddress = GL.getICD().glRasterPos2iv; + if (CHECKS) { + check(__functionAddress); + check(coords, 2); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glRasterPos2sv RasterPos2sv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos2sv(@NativeType("GLshort const *") short[] coords) { + long __functionAddress = GL.getICD().glRasterPos2sv; + if (CHECKS) { + check(__functionAddress); + check(coords, 2); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glRasterPos2fv RasterPos2fv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos2fv(@NativeType("GLfloat const *") float[] coords) { + long __functionAddress = GL.getICD().glRasterPos2fv; + if (CHECKS) { + check(__functionAddress); + check(coords, 2); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glRasterPos2dv RasterPos2dv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos2dv(@NativeType("GLdouble const *") double[] coords) { + long __functionAddress = GL.getICD().glRasterPos2dv; + if (CHECKS) { + check(__functionAddress); + check(coords, 2); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glRasterPos3iv RasterPos3iv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos3iv(@NativeType("GLint const *") int[] coords) { + long __functionAddress = GL.getICD().glRasterPos3iv; + if (CHECKS) { + check(__functionAddress); + check(coords, 3); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glRasterPos3sv RasterPos3sv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos3sv(@NativeType("GLshort const *") short[] coords) { + long __functionAddress = GL.getICD().glRasterPos3sv; + if (CHECKS) { + check(__functionAddress); + check(coords, 3); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glRasterPos3fv RasterPos3fv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos3fv(@NativeType("GLfloat const *") float[] coords) { + long __functionAddress = GL.getICD().glRasterPos3fv; + if (CHECKS) { + check(__functionAddress); + check(coords, 3); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glRasterPos3dv RasterPos3dv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos3dv(@NativeType("GLdouble const *") double[] coords) { + long __functionAddress = GL.getICD().glRasterPos3dv; + if (CHECKS) { + check(__functionAddress); + check(coords, 3); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glRasterPos4iv RasterPos4iv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos4iv(@NativeType("GLint const *") int[] coords) { + long __functionAddress = GL.getICD().glRasterPos4iv; + if (CHECKS) { + check(__functionAddress); + check(coords, 4); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glRasterPos4sv RasterPos4sv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos4sv(@NativeType("GLshort const *") short[] coords) { + long __functionAddress = GL.getICD().glRasterPos4sv; + if (CHECKS) { + check(__functionAddress); + check(coords, 4); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glRasterPos4fv RasterPos4fv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos4fv(@NativeType("GLfloat const *") float[] coords) { + long __functionAddress = GL.getICD().glRasterPos4fv; + if (CHECKS) { + check(__functionAddress); + check(coords, 4); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glRasterPos4dv RasterPos4dv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRasterPos4dv(@NativeType("GLdouble const *") double[] coords) { + long __functionAddress = GL.getICD().glRasterPos4dv; + if (CHECKS) { + check(__functionAddress); + check(coords, 4); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glReadPixels ReadPixels} + * + * @see Reference Page + */ + public static void glReadPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") short[] pixels) { + GL11C.glReadPixels(x, y, width, height, format, type, pixels); + } + + /** + * Array version of: {@link #glReadPixels ReadPixels} + * + * @see Reference Page + */ + public static void glReadPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") int[] pixels) { + GL11C.glReadPixels(x, y, width, height, format, type, pixels); + } + + /** + * Array version of: {@link #glReadPixels ReadPixels} + * + * @see Reference Page + */ + public static void glReadPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") float[] pixels) { + GL11C.glReadPixels(x, y, width, height, format, type, pixels); + } + + /** + * Array version of: {@link #glRectiv Rectiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRectiv(@NativeType("GLint const *") int[] v1, @NativeType("GLint const *") int[] v2) { + long __functionAddress = GL.getICD().glRectiv; + if (CHECKS) { + check(__functionAddress); + check(v1, 2); + check(v2, 2); + } + callPPV(v1, v2, __functionAddress); + } + + /** + * Array version of: {@link #glRectsv Rectsv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRectsv(@NativeType("GLshort const *") short[] v1, @NativeType("GLshort const *") short[] v2) { + long __functionAddress = GL.getICD().glRectsv; + if (CHECKS) { + check(__functionAddress); + check(v1, 2); + check(v2, 2); + } + callPPV(v1, v2, __functionAddress); + } + + /** + * Array version of: {@link #glRectfv Rectfv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRectfv(@NativeType("GLfloat const *") float[] v1, @NativeType("GLfloat const *") float[] v2) { + long __functionAddress = GL.getICD().glRectfv; + if (CHECKS) { + check(__functionAddress); + check(v1, 2); + check(v2, 2); + } + callPPV(v1, v2, __functionAddress); + } + + /** + * Array version of: {@link #glRectdv Rectdv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glRectdv(@NativeType("GLdouble const *") double[] v1, @NativeType("GLdouble const *") double[] v2) { + long __functionAddress = GL.getICD().glRectdv; + if (CHECKS) { + check(__functionAddress); + check(v1, 2); + check(v2, 2); + } + callPPV(v1, v2, __functionAddress); + } + + /** + * Array version of: {@link #glSelectBuffer SelectBuffer} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSelectBuffer(@NativeType("GLuint *") int[] buffer) { + long __functionAddress = GL.getICD().glSelectBuffer; + if (CHECKS) { + check(__functionAddress); + } + callPV(buffer.length, buffer, __functionAddress); + } + + /** + * Array version of: {@link #glTexCoord1fv TexCoord1fv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord1fv(@NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glTexCoord1fv; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glTexCoord1sv TexCoord1sv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord1sv(@NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glTexCoord1sv; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glTexCoord1iv TexCoord1iv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord1iv(@NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glTexCoord1iv; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glTexCoord1dv TexCoord1dv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord1dv(@NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glTexCoord1dv; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glTexCoord2fv TexCoord2fv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord2fv(@NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glTexCoord2fv; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glTexCoord2sv TexCoord2sv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord2sv(@NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glTexCoord2sv; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glTexCoord2iv TexCoord2iv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord2iv(@NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glTexCoord2iv; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glTexCoord2dv TexCoord2dv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord2dv(@NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glTexCoord2dv; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glTexCoord3fv TexCoord3fv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord3fv(@NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glTexCoord3fv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glTexCoord3sv TexCoord3sv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord3sv(@NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glTexCoord3sv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glTexCoord3iv TexCoord3iv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord3iv(@NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glTexCoord3iv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glTexCoord3dv TexCoord3dv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord3dv(@NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glTexCoord3dv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glTexCoord4fv TexCoord4fv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord4fv(@NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glTexCoord4fv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glTexCoord4sv TexCoord4sv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord4sv(@NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glTexCoord4sv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glTexCoord4iv TexCoord4iv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord4iv(@NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glTexCoord4iv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glTexCoord4dv TexCoord4dv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoord4dv(@NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glTexCoord4dv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glTexEnviv TexEnviv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexEnviv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glTexEnviv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(target, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glTexEnvfv TexEnvfv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexEnvfv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] params) { + long __functionAddress = GL.getICD().glTexEnvfv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(target, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glTexGeniv TexGeniv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexGeniv(@NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glTexGeniv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(coord, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glTexGenfv TexGenfv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexGenfv(@NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] params) { + long __functionAddress = GL.getICD().glTexGenfv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(coord, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glTexGendv TexGendv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexGendv(@NativeType("GLenum") int coord, @NativeType("GLenum") int pname, @NativeType("GLdouble const *") double[] params) { + long __functionAddress = GL.getICD().glTexGendv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(coord, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glTexImage1D TexImage1D} + * + * @see Reference Page + */ + public static void glTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] pixels) { + GL11C.glTexImage1D(target, level, internalformat, width, border, format, type, pixels); + } + + /** + * Array version of: {@link #glTexImage1D TexImage1D} + * + * @see Reference Page + */ + public static void glTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] pixels) { + GL11C.glTexImage1D(target, level, internalformat, width, border, format, type, pixels); + } + + /** + * Array version of: {@link #glTexImage1D TexImage1D} + * + * @see Reference Page + */ + public static void glTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] pixels) { + GL11C.glTexImage1D(target, level, internalformat, width, border, format, type, pixels); + } + + /** + * Array version of: {@link #glTexImage1D TexImage1D} + * + * @see Reference Page + */ + public static void glTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") double[] pixels) { + GL11C.glTexImage1D(target, level, internalformat, width, border, format, type, pixels); + } + + /** + * Array version of: {@link #glTexImage2D TexImage2D} + * + * @see Reference Page + */ + public static void glTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] pixels) { + GL11C.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); + } + + /** + * Array version of: {@link #glTexImage2D TexImage2D} + * + * @see Reference Page + */ + public static void glTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] pixels) { + GL11C.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); + } + + /** + * Array version of: {@link #glTexImage2D TexImage2D} + * + * @see Reference Page + */ + public static void glTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] pixels) { + GL11C.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); + } + + /** + * Array version of: {@link #glTexImage2D TexImage2D} + * + * @see Reference Page + */ + public static void glTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") double[] pixels) { + GL11C.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); + } + + /** + * Array version of: {@link #glTexParameteriv TexParameteriv} + * + * @see Reference Page + */ + public static void glTexParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + GL11C.glTexParameteriv(target, pname, params); + } + + /** + * Array version of: {@link #glTexParameterfv TexParameterfv} + * + * @see Reference Page + */ + public static void glTexParameterfv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] params) { + GL11C.glTexParameterfv(target, pname, params); + } + + /** + * Array version of: {@link #glTexSubImage1D TexSubImage1D} + * + * @see Reference Page + */ + public static void glTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] pixels) { + GL11C.glTexSubImage1D(target, level, xoffset, width, format, type, pixels); + } + + /** + * Array version of: {@link #glTexSubImage1D TexSubImage1D} + * + * @see Reference Page + */ + public static void glTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] pixels) { + GL11C.glTexSubImage1D(target, level, xoffset, width, format, type, pixels); + } + + /** + * Array version of: {@link #glTexSubImage1D TexSubImage1D} + * + * @see Reference Page + */ + public static void glTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] pixels) { + GL11C.glTexSubImage1D(target, level, xoffset, width, format, type, pixels); + } + + /** + * Array version of: {@link #glTexSubImage1D TexSubImage1D} + * + * @see Reference Page + */ + public static void glTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") double[] pixels) { + GL11C.glTexSubImage1D(target, level, xoffset, width, format, type, pixels); + } + + /** + * Array version of: {@link #glTexSubImage2D TexSubImage2D} + * + * @see Reference Page + */ + public static void glTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] pixels) { + GL11C.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * Array version of: {@link #glTexSubImage2D TexSubImage2D} + * + * @see Reference Page + */ + public static void glTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] pixels) { + GL11C.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * Array version of: {@link #glTexSubImage2D TexSubImage2D} + * + * @see Reference Page + */ + public static void glTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] pixels) { + GL11C.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * Array version of: {@link #glTexSubImage2D TexSubImage2D} + * + * @see Reference Page + */ + public static void glTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") double[] pixels) { + GL11C.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * Array version of: {@link #glVertex2fv Vertex2fv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex2fv(@NativeType("GLfloat const *") float[] coords) { + long __functionAddress = GL.getICD().glVertex2fv; + if (CHECKS) { + check(__functionAddress); + check(coords, 2); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glVertex2sv Vertex2sv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex2sv(@NativeType("GLshort const *") short[] coords) { + long __functionAddress = GL.getICD().glVertex2sv; + if (CHECKS) { + check(__functionAddress); + check(coords, 2); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glVertex2iv Vertex2iv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex2iv(@NativeType("GLint const *") int[] coords) { + long __functionAddress = GL.getICD().glVertex2iv; + if (CHECKS) { + check(__functionAddress); + check(coords, 2); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glVertex2dv Vertex2dv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex2dv(@NativeType("GLdouble const *") double[] coords) { + long __functionAddress = GL.getICD().glVertex2dv; + if (CHECKS) { + check(__functionAddress); + check(coords, 2); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glVertex3fv Vertex3fv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex3fv(@NativeType("GLfloat const *") float[] coords) { + long __functionAddress = GL.getICD().glVertex3fv; + if (CHECKS) { + check(__functionAddress); + check(coords, 3); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glVertex3sv Vertex3sv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex3sv(@NativeType("GLshort const *") short[] coords) { + long __functionAddress = GL.getICD().glVertex3sv; + if (CHECKS) { + check(__functionAddress); + check(coords, 3); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glVertex3iv Vertex3iv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex3iv(@NativeType("GLint const *") int[] coords) { + long __functionAddress = GL.getICD().glVertex3iv; + if (CHECKS) { + check(__functionAddress); + check(coords, 3); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glVertex3dv Vertex3dv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex3dv(@NativeType("GLdouble const *") double[] coords) { + long __functionAddress = GL.getICD().glVertex3dv; + if (CHECKS) { + check(__functionAddress); + check(coords, 3); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glVertex4fv Vertex4fv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex4fv(@NativeType("GLfloat const *") float[] coords) { + long __functionAddress = GL.getICD().glVertex4fv; + if (CHECKS) { + check(__functionAddress); + check(coords, 4); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glVertex4sv Vertex4sv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex4sv(@NativeType("GLshort const *") short[] coords) { + long __functionAddress = GL.getICD().glVertex4sv; + if (CHECKS) { + check(__functionAddress); + check(coords, 4); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glVertex4iv Vertex4iv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex4iv(@NativeType("GLint const *") int[] coords) { + long __functionAddress = GL.getICD().glVertex4iv; + if (CHECKS) { + check(__functionAddress); + check(coords, 4); + } + callPV(coords, __functionAddress); + } + + /** + * Array version of: {@link #glVertex4dv Vertex4dv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertex4dv(@NativeType("GLdouble const *") double[] coords) { + long __functionAddress = GL.getICD().glVertex4dv; + if (CHECKS) { + check(__functionAddress); + check(coords, 4); + } + callPV(coords, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL11C.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL11C.java new file mode 100644 index 00000000..62389e83 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL11C.java @@ -0,0 +1,2661 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality of a forward compatible context, up to version 1.1. + * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL11C { + + /** AlphaFunction */ + public static final int + GL_NEVER = 0x200, + GL_LESS = 0x201, + GL_EQUAL = 0x202, + GL_LEQUAL = 0x203, + GL_GREATER = 0x204, + GL_NOTEQUAL = 0x205, + GL_GEQUAL = 0x206, + GL_ALWAYS = 0x207; + + /** AttribMask */ + public static final int + GL_DEPTH_BUFFER_BIT = 0x100, + GL_STENCIL_BUFFER_BIT = 0x400, + GL_COLOR_BUFFER_BIT = 0x4000; + + /** BeginMode */ + public static final int + GL_POINTS = 0x0, + GL_LINES = 0x1, + GL_LINE_LOOP = 0x2, + GL_LINE_STRIP = 0x3, + GL_TRIANGLES = 0x4, + GL_TRIANGLE_STRIP = 0x5, + GL_TRIANGLE_FAN = 0x6, + GL_QUADS = 0x7; + + /** BlendingFactorDest */ + public static final int + GL_ZERO = 0, + GL_ONE = 1, + GL_SRC_COLOR = 0x300, + GL_ONE_MINUS_SRC_COLOR = 0x301, + GL_SRC_ALPHA = 0x302, + GL_ONE_MINUS_SRC_ALPHA = 0x303, + GL_DST_ALPHA = 0x304, + GL_ONE_MINUS_DST_ALPHA = 0x305; + + /** BlendingFactorSrc */ + public static final int + GL_DST_COLOR = 0x306, + GL_ONE_MINUS_DST_COLOR = 0x307, + GL_SRC_ALPHA_SATURATE = 0x308; + + /** Boolean */ + public static final int + GL_TRUE = 1, + GL_FALSE = 0; + + /** DataType */ + public static final int + GL_BYTE = 0x1400, + GL_UNSIGNED_BYTE = 0x1401, + GL_SHORT = 0x1402, + GL_UNSIGNED_SHORT = 0x1403, + GL_INT = 0x1404, + GL_UNSIGNED_INT = 0x1405, + GL_FLOAT = 0x1406, + GL_DOUBLE = 0x140A; + + /** DrawBufferMode */ + public static final int + GL_NONE = 0, + GL_FRONT_LEFT = 0x400, + GL_FRONT_RIGHT = 0x401, + GL_BACK_LEFT = 0x402, + GL_BACK_RIGHT = 0x403, + GL_FRONT = 0x404, + GL_BACK = 0x405, + GL_LEFT = 0x406, + GL_RIGHT = 0x407, + GL_FRONT_AND_BACK = 0x408; + + /** ErrorCode */ + public static final int + GL_NO_ERROR = 0, + GL_INVALID_ENUM = 0x500, + GL_INVALID_VALUE = 0x501, + GL_INVALID_OPERATION = 0x502, + GL_STACK_OVERFLOW = 0x503, + GL_STACK_UNDERFLOW = 0x504, + GL_OUT_OF_MEMORY = 0x505; + + /** FrontFaceDirection */ + public static final int + GL_CW = 0x900, + GL_CCW = 0x901; + + /** GetTarget */ + public static final int + GL_POINT_SIZE = 0xB11, + GL_POINT_SIZE_RANGE = 0xB12, + GL_POINT_SIZE_GRANULARITY = 0xB13, + GL_LINE_SMOOTH = 0xB20, + GL_LINE_WIDTH = 0xB21, + GL_LINE_WIDTH_RANGE = 0xB22, + GL_LINE_WIDTH_GRANULARITY = 0xB23, + GL_POLYGON_MODE = 0xB40, + GL_POLYGON_SMOOTH = 0xB41, + GL_CULL_FACE = 0xB44, + GL_CULL_FACE_MODE = 0xB45, + GL_FRONT_FACE = 0xB46, + GL_DEPTH_RANGE = 0xB70, + GL_DEPTH_TEST = 0xB71, + GL_DEPTH_WRITEMASK = 0xB72, + GL_DEPTH_CLEAR_VALUE = 0xB73, + GL_DEPTH_FUNC = 0xB74, + GL_STENCIL_TEST = 0xB90, + GL_STENCIL_CLEAR_VALUE = 0xB91, + GL_STENCIL_FUNC = 0xB92, + GL_STENCIL_VALUE_MASK = 0xB93, + GL_STENCIL_FAIL = 0xB94, + GL_STENCIL_PASS_DEPTH_FAIL = 0xB95, + GL_STENCIL_PASS_DEPTH_PASS = 0xB96, + GL_STENCIL_REF = 0xB97, + GL_STENCIL_WRITEMASK = 0xB98, + GL_VIEWPORT = 0xBA2, + GL_DITHER = 0xBD0, + GL_BLEND_DST = 0xBE0, + GL_BLEND_SRC = 0xBE1, + GL_BLEND = 0xBE2, + GL_LOGIC_OP_MODE = 0xBF0, + GL_COLOR_LOGIC_OP = 0xBF2, + GL_DRAW_BUFFER = 0xC01, + GL_READ_BUFFER = 0xC02, + GL_SCISSOR_BOX = 0xC10, + GL_SCISSOR_TEST = 0xC11, + GL_COLOR_CLEAR_VALUE = 0xC22, + GL_COLOR_WRITEMASK = 0xC23, + GL_DOUBLEBUFFER = 0xC32, + GL_STEREO = 0xC33, + GL_LINE_SMOOTH_HINT = 0xC52, + GL_POLYGON_SMOOTH_HINT = 0xC53, + GL_UNPACK_SWAP_BYTES = 0xCF0, + GL_UNPACK_LSB_FIRST = 0xCF1, + GL_UNPACK_ROW_LENGTH = 0xCF2, + GL_UNPACK_SKIP_ROWS = 0xCF3, + GL_UNPACK_SKIP_PIXELS = 0xCF4, + GL_UNPACK_ALIGNMENT = 0xCF5, + GL_PACK_SWAP_BYTES = 0xD00, + GL_PACK_LSB_FIRST = 0xD01, + GL_PACK_ROW_LENGTH = 0xD02, + GL_PACK_SKIP_ROWS = 0xD03, + GL_PACK_SKIP_PIXELS = 0xD04, + GL_PACK_ALIGNMENT = 0xD05, + GL_MAX_TEXTURE_SIZE = 0xD33, + GL_MAX_VIEWPORT_DIMS = 0xD3A, + GL_SUBPIXEL_BITS = 0xD50, + GL_TEXTURE_1D = 0xDE0, + GL_TEXTURE_2D = 0xDE1; + + /** GetTextureParameter */ + public static final int + GL_TEXTURE_WIDTH = 0x1000, + GL_TEXTURE_HEIGHT = 0x1001, + GL_TEXTURE_INTERNAL_FORMAT = 0x1003, + GL_TEXTURE_BORDER_COLOR = 0x1004; + + /** HintMode */ + public static final int + GL_DONT_CARE = 0x1100, + GL_FASTEST = 0x1101, + GL_NICEST = 0x1102; + + /** LogicOp */ + public static final int + GL_CLEAR = 0x1500, + GL_AND = 0x1501, + GL_AND_REVERSE = 0x1502, + GL_COPY = 0x1503, + GL_AND_INVERTED = 0x1504, + GL_NOOP = 0x1505, + GL_XOR = 0x1506, + GL_OR = 0x1507, + GL_NOR = 0x1508, + GL_EQUIV = 0x1509, + GL_INVERT = 0x150A, + GL_OR_REVERSE = 0x150B, + GL_COPY_INVERTED = 0x150C, + GL_OR_INVERTED = 0x150D, + GL_NAND = 0x150E, + GL_SET = 0x150F; + + /** PixelCopyType */ + public static final int + GL_COLOR = 0x1800, + GL_DEPTH = 0x1801, + GL_STENCIL = 0x1802; + + /** PixelFormat */ + public static final int + GL_STENCIL_INDEX = 0x1901, + GL_DEPTH_COMPONENT = 0x1902, + GL_RED = 0x1903, + GL_GREEN = 0x1904, + GL_BLUE = 0x1905, + GL_ALPHA = 0x1906, + GL_RGB = 0x1907, + GL_RGBA = 0x1908; + + /** PolygonMode */ + public static final int + GL_POINT = 0x1B00, + GL_LINE = 0x1B01, + GL_FILL = 0x1B02; + + /** StencilOp */ + public static final int + GL_KEEP = 0x1E00, + GL_REPLACE = 0x1E01, + GL_INCR = 0x1E02, + GL_DECR = 0x1E03; + + /** StringName */ + public static final int + GL_VENDOR = 0x1F00, + GL_RENDERER = 0x1F01, + GL_VERSION = 0x1F02, + GL_EXTENSIONS = 0x1F03; + + /** TextureMagFilter */ + public static final int + GL_NEAREST = 0x2600, + GL_LINEAR = 0x2601; + + /** TextureMinFilter */ + public static final int + GL_NEAREST_MIPMAP_NEAREST = 0x2700, + GL_LINEAR_MIPMAP_NEAREST = 0x2701, + GL_NEAREST_MIPMAP_LINEAR = 0x2702, + GL_LINEAR_MIPMAP_LINEAR = 0x2703; + + /** TextureParameterName */ + public static final int + GL_TEXTURE_MAG_FILTER = 0x2800, + GL_TEXTURE_MIN_FILTER = 0x2801, + GL_TEXTURE_WRAP_S = 0x2802, + GL_TEXTURE_WRAP_T = 0x2803; + + /** TextureWrapMode */ + public static final int GL_REPEAT = 0x2901; + + /** polygon_offset */ + public static final int + GL_POLYGON_OFFSET_FACTOR = 0x8038, + GL_POLYGON_OFFSET_UNITS = 0x2A00, + GL_POLYGON_OFFSET_POINT = 0x2A01, + GL_POLYGON_OFFSET_LINE = 0x2A02, + GL_POLYGON_OFFSET_FILL = 0x8037; + + /** texture */ + public static final int + GL_R3_G3_B2 = 0x2A10, + GL_RGB4 = 0x804F, + GL_RGB5 = 0x8050, + GL_RGB8 = 0x8051, + GL_RGB10 = 0x8052, + GL_RGB12 = 0x8053, + GL_RGB16 = 0x8054, + GL_RGBA2 = 0x8055, + GL_RGBA4 = 0x8056, + GL_RGB5_A1 = 0x8057, + GL_RGBA8 = 0x8058, + GL_RGB10_A2 = 0x8059, + GL_RGBA12 = 0x805A, + GL_RGBA16 = 0x805B, + GL_TEXTURE_RED_SIZE = 0x805C, + GL_TEXTURE_GREEN_SIZE = 0x805D, + GL_TEXTURE_BLUE_SIZE = 0x805E, + GL_TEXTURE_ALPHA_SIZE = 0x805F, + GL_PROXY_TEXTURE_1D = 0x8063, + GL_PROXY_TEXTURE_2D = 0x8064; + + /** texture_object */ + public static final int + GL_TEXTURE_BINDING_1D = 0x8068, + GL_TEXTURE_BINDING_2D = 0x8069; + + /** vertex_array */ + public static final int GL_VERTEX_ARRAY = 0x8074; + + static { GL.initialize(); } + + protected GL11C() { + throw new UnsupportedOperationException(); + } + + // --- [ glEnable ] --- + + /** + * Enables the specified OpenGL state. + * + * @param target the OpenGL state to enable + * + * @see Reference Page + */ + public static native void glEnable(@NativeType("GLenum") int target); + + // --- [ glDisable ] --- + + /** + * Disables the specified OpenGL state. + * + * @param target the OpenGL state to disable + * + * @see Reference Page + */ + public static native void glDisable(@NativeType("GLenum") int target); + + // --- [ glBindTexture ] --- + + /** + * Binds the a texture to a texture target. + * + *

While a texture object is bound, GL operations on the target to which it is bound affect the bound object, and queries of the target to which it is + * bound return state from the bound object. If texture mapping of the dimensionality of the target to which a texture object is bound is enabled, the + * state of the bound texture object directs the texturing operation.

+ * + * @param target the texture target. One of:
{@link #GL_TEXTURE_1D TEXTURE_1D}{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param texture the texture object to bind + * + * @see Reference Page + */ + public static native void glBindTexture(@NativeType("GLenum") int target, @NativeType("GLuint") int texture); + + // --- [ glBlendFunc ] --- + + /** + * Specifies the weighting factors used by the blend equation, for both RGB and alpha functions and for all draw buffers. + * + * @param sfactor the source weighting factor. One of:
{@link #GL_ZERO ZERO}{@link #GL_ONE ONE}{@link #GL_SRC_COLOR SRC_COLOR}{@link #GL_ONE_MINUS_SRC_COLOR ONE_MINUS_SRC_COLOR}{@link #GL_DST_COLOR DST_COLOR}
{@link #GL_ONE_MINUS_DST_COLOR ONE_MINUS_DST_COLOR}{@link #GL_SRC_ALPHA SRC_ALPHA}{@link #GL_ONE_MINUS_SRC_ALPHA ONE_MINUS_SRC_ALPHA}{@link #GL_DST_ALPHA DST_ALPHA}{@link #GL_ONE_MINUS_DST_ALPHA ONE_MINUS_DST_ALPHA}
{@link GL14#GL_CONSTANT_COLOR CONSTANT_COLOR}{@link GL14#GL_ONE_MINUS_CONSTANT_COLOR ONE_MINUS_CONSTANT_COLOR}{@link GL14#GL_CONSTANT_ALPHA CONSTANT_ALPHA}{@link GL14#GL_ONE_MINUS_CONSTANT_ALPHA ONE_MINUS_CONSTANT_ALPHA}{@link #GL_SRC_ALPHA_SATURATE SRC_ALPHA_SATURATE}
{@link GL33#GL_SRC1_COLOR SRC1_COLOR}{@link GL33#GL_ONE_MINUS_SRC1_COLOR ONE_MINUS_SRC1_COLOR}{@link GL15#GL_SRC1_ALPHA SRC1_ALPHA}{@link GL33#GL_ONE_MINUS_SRC1_ALPHA ONE_MINUS_SRC1_ALPHA}
+ * @param dfactor the destination weighting factor + * + * @see Reference Page + */ + public static native void glBlendFunc(@NativeType("GLenum") int sfactor, @NativeType("GLenum") int dfactor); + + // --- [ glClear ] --- + + /** + * Sets portions of every pixel in a particular buffer to the same value. The value to which each buffer is cleared depends on the setting of the clear + * value for that buffer. + * + * @param mask Zero or the bitwise OR of one or more values indicating which buffers are to be cleared. One or more of:
{@link #GL_COLOR_BUFFER_BIT COLOR_BUFFER_BIT}{@link #GL_DEPTH_BUFFER_BIT DEPTH_BUFFER_BIT}{@link #GL_STENCIL_BUFFER_BIT STENCIL_BUFFER_BIT}
+ * + * @see Reference Page + */ + public static native void glClear(@NativeType("GLbitfield") int mask); + + // --- [ glClearColor ] --- + + /** + * Sets the clear value for fixed-point and floating-point color buffers in RGBA mode. The specified components are stored as floating-point values. + * + * @param red the value to which to clear the R channel of the color buffer + * @param green the value to which to clear the G channel of the color buffer + * @param blue the value to which to clear the B channel of the color buffer + * @param alpha the value to which to clear the A channel of the color buffer + * + * @see Reference Page + */ + public static native void glClearColor(@NativeType("GLfloat") float red, @NativeType("GLfloat") float green, @NativeType("GLfloat") float blue, @NativeType("GLfloat") float alpha); + + // --- [ glClearDepth ] --- + + /** + * Sets the depth value used when clearing the depth buffer. When clearing a fixedpoint depth buffer, {@code depth} is clamped to the range [0,1] and + * converted to fixed-point. No conversion is applied when clearing a floating-point depth buffer. + * + * @param depth the value to which to clear the depth buffer + * + * @see Reference Page + */ + public static native void glClearDepth(@NativeType("GLdouble") double depth); + + // --- [ glClearStencil ] --- + + /** + * Sets the value to which to clear the stencil buffer. {@code s} is masked to the number of bitplanes in the stencil buffer. + * + * @param s the value to which to clear the stencil buffer + * + * @see Reference Page + */ + public static native void glClearStencil(@NativeType("GLint") int s); + + // --- [ glColorMask ] --- + + /** + * Masks the writing of R, G, B and A values to all draw buffers. In the initial state, all color values are enabled for writing for all draw buffers. + * + * @param red whether R values are written or not + * @param green whether G values are written or not + * @param blue whether B values are written or not + * @param alpha whether A values are written or not + * + * @see Reference Page + */ + public static native void glColorMask(@NativeType("GLboolean") boolean red, @NativeType("GLboolean") boolean green, @NativeType("GLboolean") boolean blue, @NativeType("GLboolean") boolean alpha); + + // --- [ glCullFace ] --- + + /** + * Specifies which polygon faces are culled if {@link #GL_CULL_FACE CULL_FACE} is enabled. Front-facing polygons are rasterized if either culling is disabled or the + * CullFace mode is {@link #GL_BACK BACK} while back-facing polygons are rasterized only if either culling is disabled or the CullFace mode is + * {@link #GL_FRONT FRONT}. The initial setting of the CullFace mode is {@link #GL_BACK BACK}. Initially, culling is disabled. + * + * @param mode the CullFace mode. One of:
{@link #GL_FRONT FRONT}{@link #GL_BACK BACK}{@link #GL_FRONT_AND_BACK FRONT_AND_BACK}
+ * + * @see Reference Page + */ + public static native void glCullFace(@NativeType("GLenum") int mode); + + // --- [ glDepthFunc ] --- + + /** + * Specifies the comparison that takes place during the depth buffer test (when {@link #GL_DEPTH_TEST DEPTH_TEST} is enabled). + * + * @param func the depth test comparison. One of:
{@link #GL_NEVER NEVER}{@link #GL_ALWAYS ALWAYS}{@link #GL_LESS LESS}{@link #GL_LEQUAL LEQUAL}{@link #GL_EQUAL EQUAL}{@link #GL_GREATER GREATER}{@link #GL_GEQUAL GEQUAL}{@link #GL_NOTEQUAL NOTEQUAL}
+ * + * @see Reference Page + */ + public static native void glDepthFunc(@NativeType("GLenum") int func); + + // --- [ glDepthMask ] --- + + /** + * Masks the writing of depth values to the depth buffer. In the initial state, the depth buffer is enabled for writing. + * + * @param flag whether depth values are written or not. + * + * @see Reference Page + */ + public static native void glDepthMask(@NativeType("GLboolean") boolean flag); + + // --- [ glDepthRange ] --- + + /** + * Sets the depth range for all viewports to the same values. + * + * @param zNear the near depth range + * @param zFar the far depth range + * + * @see Reference Page + */ + public static native void glDepthRange(@NativeType("GLdouble") double zNear, @NativeType("GLdouble") double zFar); + + // --- [ glDrawArrays ] --- + + /** + * Constructs a sequence of geometric primitives by successively transferring elements for {@code count} vertices. Elements {@code first} through + * first + count – 1 of each enabled non-instanced array are transferred to the GL. + * + *

If an array corresponding to an attribute required by a vertex shader is not enabled, then the corresponding element is taken from the current attribute + * state. If an array is enabled, the corresponding current vertex attribute value is unaffected by the execution of this function.

+ * + * @param mode the kind of primitives being constructed + * @param first the first vertex to transfer to the GL + * @param count the number of vertices after {@code first} to transfer to the GL + * + * @see Reference Page + */ + public static native void glDrawArrays(@NativeType("GLenum") int mode, @NativeType("GLint") int first, @NativeType("GLsizei") int count); + + // --- [ glDrawBuffer ] --- + + /** + * Defines the color buffer to which fragment color zero is written. + * + *

Acceptable values for {@code buf} depend on whether the GL is using the default framebuffer (i.e., {@link GL30#GL_DRAW_FRAMEBUFFER_BINDING DRAW_FRAMEBUFFER_BINDING} is zero), or + * a framebuffer object (i.e., {@link GL30#GL_DRAW_FRAMEBUFFER_BINDING DRAW_FRAMEBUFFER_BINDING} is non-zero). In the initial state, the GL is bound to the default framebuffer.

+ * + * @param buf the color buffer to draw to. One of:
{@link #GL_NONE NONE}{@link #GL_FRONT_LEFT FRONT_LEFT}{@link #GL_FRONT_RIGHT FRONT_RIGHT}{@link #GL_BACK_LEFT BACK_LEFT}{@link #GL_BACK_RIGHT BACK_RIGHT}{@link #GL_FRONT FRONT}{@link #GL_BACK BACK}{@link #GL_LEFT LEFT}
{@link #GL_RIGHT RIGHT}{@link #GL_FRONT_AND_BACK FRONT_AND_BACK}{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}GL30.GL_COLOR_ATTACHMENT[1-15]
+ * + * @see Reference Page + */ + public static native void glDrawBuffer(@NativeType("GLenum") int buf); + + // --- [ glDrawElements ] --- + + /** + * Unsafe version of: {@link #glDrawElements DrawElements} + * + * @param count the number of vertices to transfer to the GL + * @param type indicates the type of index values in {@code indices}. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static native void nglDrawElements(int mode, int count, int type, long indices); + + /** + * Constructs a sequence of geometric primitives by successively transferring elements for {@code count} vertices to the GL. + * The ith element transferred by {@code DrawElements} will be taken from element {@code indices[i]} (if no element array buffer is bound), or + * from the element whose index is stored in the currently bound element array buffer at offset {@code indices + i}. + * + * @param mode the kind of primitives being constructed. One of:
{@link #GL_POINTS POINTS}{@link #GL_LINE_STRIP LINE_STRIP}{@link #GL_LINE_LOOP LINE_LOOP}{@link #GL_LINES LINES}{@link #GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link #GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link #GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param count the number of vertices to transfer to the GL + * @param type indicates the type of index values in {@code indices}. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices the index values + * + * @see Reference Page + */ + public static void glDrawElements(@NativeType("GLenum") int mode, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices) { + nglDrawElements(mode, count, type, indices); + } + + /** + * Constructs a sequence of geometric primitives by successively transferring elements for {@code count} vertices to the GL. + * The ith element transferred by {@code DrawElements} will be taken from element {@code indices[i]} (if no element array buffer is bound), or + * from the element whose index is stored in the currently bound element array buffer at offset {@code indices + i}. + * + * @param mode the kind of primitives being constructed. One of:
{@link #GL_POINTS POINTS}{@link #GL_LINE_STRIP LINE_STRIP}{@link #GL_LINE_LOOP LINE_LOOP}{@link #GL_LINES LINES}{@link #GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link #GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link #GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param type indicates the type of index values in {@code indices}. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices the index values + * + * @see Reference Page + */ + public static void glDrawElements(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices) { + nglDrawElements(mode, indices.remaining() >> GLChecks.typeToByteShift(type), type, memAddress(indices)); + } + + /** + * Constructs a sequence of geometric primitives by successively transferring elements for {@code count} vertices to the GL. + * The ith element transferred by {@code DrawElements} will be taken from element {@code indices[i]} (if no element array buffer is bound), or + * from the element whose index is stored in the currently bound element array buffer at offset {@code indices + i}. + * + * @param mode the kind of primitives being constructed. One of:
{@link #GL_POINTS POINTS}{@link #GL_LINE_STRIP LINE_STRIP}{@link #GL_LINE_LOOP LINE_LOOP}{@link #GL_LINES LINES}{@link #GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link #GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link #GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param indices the index values + * + * @see Reference Page + */ + public static void glDrawElements(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indices) { + nglDrawElements(mode, indices.remaining(), GL11.GL_UNSIGNED_BYTE, memAddress(indices)); + } + + /** + * Constructs a sequence of geometric primitives by successively transferring elements for {@code count} vertices to the GL. + * The ith element transferred by {@code DrawElements} will be taken from element {@code indices[i]} (if no element array buffer is bound), or + * from the element whose index is stored in the currently bound element array buffer at offset {@code indices + i}. + * + * @param mode the kind of primitives being constructed. One of:
{@link #GL_POINTS POINTS}{@link #GL_LINE_STRIP LINE_STRIP}{@link #GL_LINE_LOOP LINE_LOOP}{@link #GL_LINES LINES}{@link #GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link #GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link #GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param indices the index values + * + * @see Reference Page + */ + public static void glDrawElements(@NativeType("GLenum") int mode, @NativeType("void const *") ShortBuffer indices) { + nglDrawElements(mode, indices.remaining(), GL11.GL_UNSIGNED_SHORT, memAddress(indices)); + } + + /** + * Constructs a sequence of geometric primitives by successively transferring elements for {@code count} vertices to the GL. + * The ith element transferred by {@code DrawElements} will be taken from element {@code indices[i]} (if no element array buffer is bound), or + * from the element whose index is stored in the currently bound element array buffer at offset {@code indices + i}. + * + * @param mode the kind of primitives being constructed. One of:
{@link #GL_POINTS POINTS}{@link #GL_LINE_STRIP LINE_STRIP}{@link #GL_LINE_LOOP LINE_LOOP}{@link #GL_LINES LINES}{@link #GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link #GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link #GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param indices the index values + * + * @see Reference Page + */ + public static void glDrawElements(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indices) { + nglDrawElements(mode, indices.remaining(), GL11.GL_UNSIGNED_INT, memAddress(indices)); + } + + // --- [ glFinish ] --- + + /** + * Forces all previously issued GL commands to complete. {@code Finish} does not return until all effects from such commands on GL client and server + * state and the framebuffer are fully realized. + * + * @see Reference Page + */ + public static native void glFinish(); + + // --- [ glFlush ] --- + + /** + * Causes all previously issued GL commands to complete in finite time (although such commands may still be executing when {@code Flush} returns). + * + * @see Reference Page + */ + public static native void glFlush(); + + // --- [ glFrontFace ] --- + + /** + * The first step of polygon rasterization is to determine if the polygon is back-facing or front-facing. This determination is made based on the sign of + * the (clipped or unclipped) polygon's area computed in window coordinates. The interpretation of the sign of this value is controlled with this function. + * In the initial state, the front face direction is set to {@link #GL_CCW CCW}. + * + * @param dir the front face direction. One of:
{@link #GL_CCW CCW}{@link #GL_CW CW}
+ * + * @see Reference Page + */ + public static native void glFrontFace(@NativeType("GLenum") int dir); + + // --- [ glGenTextures ] --- + + /** + * Unsafe version of: {@link #glGenTextures GenTextures} + * + * @param n the number of textures to create + */ + public static native void nglGenTextures(int n, long textures); + + /** + * Returns n previously unused texture names in textures. These names are marked as used, for the purposes of GenTextures only, but they acquire texture + * state and a dimensionality only when they are first bound, just as if they were unused. + * + * @param textures a scalar or buffer in which to place the returned texture names + * + * @see Reference Page + */ + public static void glGenTextures(@NativeType("GLuint *") IntBuffer textures) { + nglGenTextures(textures.remaining(), memAddress(textures)); + } + + /** + * Returns n previously unused texture names in textures. These names are marked as used, for the purposes of GenTextures only, but they acquire texture + * state and a dimensionality only when they are first bound, just as if they were unused. + * + * @see Reference Page + */ + @NativeType("void") + public static int glGenTextures() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer textures = stack.callocInt(1); + nglGenTextures(1, memAddress(textures)); + return textures.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glDeleteTextures ] --- + + /** + * Unsafe version of: {@link #glDeleteTextures DeleteTextures} + * + * @param n the number of texture names in the {@code textures} parameter + */ + public static native void nglDeleteTextures(int n, long textures); + + /** + * Deletes texture objects. After a texture object is deleted, it has no contents or dimensionality, and its name is again unused. If a texture that is + * currently bound to any of the target bindings of {@link #glBindTexture BindTexture} is deleted, it is as though {@link #glBindTexture BindTexture} had been executed with the + * same target and texture zero. Additionally, special care must be taken when deleting a texture if any of the images of the texture are attached to a + * framebuffer object. + * + *

Unused names in textures that have been marked as used for the purposes of {@link #glGenTextures GenTextures} are marked as unused again. Unused names in textures are + * silently ignored, as is the name zero.

+ * + * @param textures contains {@code n} names of texture objects to be deleted + * + * @see Reference Page + */ + public static void glDeleteTextures(@NativeType("GLuint const *") IntBuffer textures) { + nglDeleteTextures(textures.remaining(), memAddress(textures)); + } + + /** + * Deletes texture objects. After a texture object is deleted, it has no contents or dimensionality, and its name is again unused. If a texture that is + * currently bound to any of the target bindings of {@link #glBindTexture BindTexture} is deleted, it is as though {@link #glBindTexture BindTexture} had been executed with the + * same target and texture zero. Additionally, special care must be taken when deleting a texture if any of the images of the texture are attached to a + * framebuffer object. + * + *

Unused names in textures that have been marked as used for the purposes of {@link #glGenTextures GenTextures} are marked as unused again. Unused names in textures are + * silently ignored, as is the name zero.

+ * + * @see Reference Page + */ + public static void glDeleteTextures(@NativeType("GLuint const *") int texture) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer textures = stack.ints(texture); + nglDeleteTextures(1, memAddress(textures)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetBooleanv ] --- + + /** Unsafe version of: {@link #glGetBooleanv GetBooleanv} */ + public static native void nglGetBooleanv(int pname, long params); + + /** + * Returns the current boolean value of the specified state variable. + * + *

LWJGL note: The state that corresponds to the state variable may be a single value or an array of values. In the case of an array of values, + * LWJGL will not validate if {@code params} has enough space to store that array. Doing so would introduce significant overhead, as the + * OpenGL state variables are too many. It is the user's responsibility to avoid JVM crashes by ensuring enough space for the returned values.

+ * + * @param pname the state variable + * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetBooleanv(@NativeType("GLenum") int pname, @NativeType("GLboolean *") ByteBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetBooleanv(pname, memAddress(params)); + } + + /** + * Returns the current boolean value of the specified state variable. + * + *

LWJGL note: The state that corresponds to the state variable may be a single value or an array of values. In the case of an array of values, + * LWJGL will not validate if {@code params} has enough space to store that array. Doing so would introduce significant overhead, as the + * OpenGL state variables are too many. It is the user's responsibility to avoid JVM crashes by ensuring enough space for the returned values.

+ * + * @param pname the state variable + * + * @see Reference Page + */ + @NativeType("void") + public static boolean glGetBoolean(@NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + ByteBuffer params = stack.calloc(1); + nglGetBooleanv(pname, memAddress(params)); + return params.get(0) != 0; + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetFloatv ] --- + + /** Unsafe version of: {@link #glGetFloatv GetFloatv} */ + public static native void nglGetFloatv(int pname, long params); + + /** + * Returns the current float value of the specified state variable. + * + *

LWJGL note: The state that corresponds to the state variable may be a single value or an array of values. In the case of an array of values, + * LWJGL will not validate if {@code params} has enough space to store that array. Doing so would introduce significant overhead, as the + * OpenGL state variables are too many. It is the user's responsibility to avoid JVM crashes by ensuring enough space for the returned values.

+ * + * @param pname the state variable + * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetFloatv(@NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetFloatv(pname, memAddress(params)); + } + + /** + * Returns the current float value of the specified state variable. + * + *

LWJGL note: The state that corresponds to the state variable may be a single value or an array of values. In the case of an array of values, + * LWJGL will not validate if {@code params} has enough space to store that array. Doing so would introduce significant overhead, as the + * OpenGL state variables are too many. It is the user's responsibility to avoid JVM crashes by ensuring enough space for the returned values.

+ * + * @param pname the state variable + * + * @see Reference Page + */ + @NativeType("void") + public static float glGetFloat(@NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer params = stack.callocFloat(1); + nglGetFloatv(pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetIntegerv ] --- + + /** Unsafe version of: {@link #glGetIntegerv GetIntegerv} */ + public static native void nglGetIntegerv(int pname, long params); + + /** + * Returns the current integer value of the specified state variable. + * + *

LWJGL note: The state that corresponds to the state variable may be a single value or an array of values. In the case of an array of values, + * LWJGL will not validate if {@code params} has enough space to store that array. Doing so would introduce significant overhead, as the + * OpenGL state variables are too many. It is the user's responsibility to avoid JVM crashes by ensuring enough space for the returned values.

+ * + * @param pname the state variable + * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetIntegerv(@NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetIntegerv(pname, memAddress(params)); + } + + /** + * Returns the current integer value of the specified state variable. + * + *

LWJGL note: The state that corresponds to the state variable may be a single value or an array of values. In the case of an array of values, + * LWJGL will not validate if {@code params} has enough space to store that array. Doing so would introduce significant overhead, as the + * OpenGL state variables are too many. It is the user's responsibility to avoid JVM crashes by ensuring enough space for the returned values.

+ * + * @param pname the state variable + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetInteger(@NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetIntegerv(pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetDoublev ] --- + + /** Unsafe version of: {@link #glGetDoublev GetDoublev} */ + public static native void nglGetDoublev(int pname, long params); + + /** + * Returns the current double value of the specified state variable. + * + *

LWJGL note: The state that corresponds to the state variable may be a single value or an array of values. In the case of an array of values, + * LWJGL will not validate if {@code params} has enough space to store that array. Doing so would introduce significant overhead, as the + * OpenGL state variables are too many. It is the user's responsibility to avoid JVM crashes by ensuring enough space for the returned values.

+ * + * @param pname the state variable + * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetDoublev(@NativeType("GLenum") int pname, @NativeType("GLdouble *") DoubleBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetDoublev(pname, memAddress(params)); + } + + /** + * Returns the current double value of the specified state variable. + * + *

LWJGL note: The state that corresponds to the state variable may be a single value or an array of values. In the case of an array of values, + * LWJGL will not validate if {@code params} has enough space to store that array. Doing so would introduce significant overhead, as the + * OpenGL state variables are too many. It is the user's responsibility to avoid JVM crashes by ensuring enough space for the returned values.

+ * + * @param pname the state variable + * + * @see Reference Page + */ + @NativeType("void") + public static double glGetDouble(@NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + DoubleBuffer params = stack.callocDouble(1); + nglGetDoublev(pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetError ] --- + + /** + * Returns error information. + * + *

Each detectable error is assigned a numeric code. When an error is detected, a flag is set and the code is recorded. Further errors, if they occur, do + * not affect this recorded code. When {@code 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 {@code GetError} returns {@link #GL_NO_ERROR NO_ERROR}, then there has been no detectable error since the last call to {@code GetError} (or since + * the GL was initialized).

+ * + * @see Reference Page + */ + @NativeType("GLenum") + public static native int glGetError(); + + // --- [ glGetPointerv ] --- + + /** Unsafe version of: {@link #glGetPointerv GetPointerv} */ + public static native void nglGetPointerv(int pname, long params); + + /** + * Returns a pointer in the current GL context. + * + * @param pname the pointer to return. One of:
{@link GL43#GL_DEBUG_CALLBACK_FUNCTION DEBUG_CALLBACK_FUNCTION}{@link GL43#GL_DEBUG_CALLBACK_USER_PARAM DEBUG_CALLBACK_USER_PARAM}
+ * @param params a buffer in which to place the returned pointer + * + * @see Reference Page + */ + public static void glGetPointerv(@NativeType("GLenum") int pname, @NativeType("void **") PointerBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetPointerv(pname, memAddress(params)); + } + + /** + * Returns a pointer in the current GL context. + * + * @param pname the pointer to return. One of:
{@link GL43#GL_DEBUG_CALLBACK_FUNCTION DEBUG_CALLBACK_FUNCTION}{@link GL43#GL_DEBUG_CALLBACK_USER_PARAM DEBUG_CALLBACK_USER_PARAM}
+ * + * @see Reference Page + */ + @NativeType("void") + public static long glGetPointer(@NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + PointerBuffer params = stack.callocPointer(1); + nglGetPointerv(pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetString ] --- + + /** Unsafe version of: {@link #glGetString GetString} */ + public static native long nglGetString(int name); + + /** + * Return strings describing properties of the current GL context. + * + * @param name the property to query. One of:
{@link #GL_RENDERER RENDERER}{@link #GL_VENDOR VENDOR}{@link #GL_EXTENSIONS EXTENSIONS}{@link #GL_VERSION VERSION}{@link GL20#GL_SHADING_LANGUAGE_VERSION SHADING_LANGUAGE_VERSION}
+ * + * @see Reference Page + */ + @Nullable + @NativeType("GLubyte const *") + public static String glGetString(@NativeType("GLenum") int name) { + long __result = nglGetString(name); + return memUTF8Safe(__result); + } + + // --- [ glGetTexImage ] --- + + /** Unsafe version of: {@link #glGetTexImage GetTexImage} */ + public static native void nglGetTexImage(int tex, int level, int format, int type, long pixels); + + /** + * Obtains texture images. + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link #GL_TEXTURE_1D TEXTURE_1D}{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer pixels) { + nglGetTexImage(tex, level, format, type, memAddress(pixels)); + } + + /** + * Obtains texture images. + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link #GL_TEXTURE_1D TEXTURE_1D}{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") long pixels) { + nglGetTexImage(tex, level, format, type, pixels); + } + + /** + * Obtains texture images. + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link #GL_TEXTURE_1D TEXTURE_1D}{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ShortBuffer pixels) { + nglGetTexImage(tex, level, format, type, memAddress(pixels)); + } + + /** + * Obtains texture images. + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link #GL_TEXTURE_1D TEXTURE_1D}{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") IntBuffer pixels) { + nglGetTexImage(tex, level, format, type, memAddress(pixels)); + } + + /** + * Obtains texture images. + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link #GL_TEXTURE_1D TEXTURE_1D}{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") FloatBuffer pixels) { + nglGetTexImage(tex, level, format, type, memAddress(pixels)); + } + + /** + * Obtains texture images. + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link #GL_TEXTURE_1D TEXTURE_1D}{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") DoubleBuffer pixels) { + nglGetTexImage(tex, level, format, type, memAddress(pixels)); + } + + // --- [ glGetTexLevelParameteriv ] --- + + /** Unsafe version of: {@link #glGetTexLevelParameteriv GetTexLevelParameteriv} */ + public static native void nglGetTexLevelParameteriv(int target, int level, int pname, long params); + + /** + * Places integer information about texture image parameter {@code pname} for level-of-detail {@code level} of the specified {@code target} into {@code params}. + * + * @param target the texture image target. One of:
{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link #GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
{@link #GL_TEXTURE_1D TEXTURE_1D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}{@link #GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}{@link GL12#GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}{@link GL32#GL_PROXY_TEXTURE_2D_MULTISAMPLE PROXY_TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param level the level-of-detail number + * @param pname the parameter to query. One of:
{@link #GL_TEXTURE_WIDTH TEXTURE_WIDTH}{@link #GL_TEXTURE_HEIGHT TEXTURE_HEIGHT}{@link GL12#GL_TEXTURE_DEPTH TEXTURE_DEPTH}{@link GL32#GL_TEXTURE_SAMPLES TEXTURE_SAMPLES}
{@link GL32#GL_TEXTURE_FIXED_SAMPLE_LOCATIONS TEXTURE_FIXED_SAMPLE_LOCATIONS}{@link #GL_TEXTURE_INTERNAL_FORMAT TEXTURE_INTERNAL_FORMAT}{@link #GL_TEXTURE_RED_SIZE TEXTURE_RED_SIZE}{@link #GL_TEXTURE_GREEN_SIZE TEXTURE_GREEN_SIZE}
{@link #GL_TEXTURE_BLUE_SIZE TEXTURE_BLUE_SIZE}{@link #GL_TEXTURE_ALPHA_SIZE TEXTURE_ALPHA_SIZE}{@link GL14#GL_TEXTURE_DEPTH_SIZE TEXTURE_DEPTH_SIZE}{@link GL30#GL_TEXTURE_STENCIL_SIZE TEXTURE_STENCIL_SIZE}
{@link GL30#GL_TEXTURE_SHARED_SIZE TEXTURE_SHARED_SIZE}{@link GL30#GL_TEXTURE_ALPHA_TYPE TEXTURE_ALPHA_TYPE}{@link GL30#GL_TEXTURE_DEPTH_TYPE TEXTURE_DEPTH_TYPE}{@link GL13#GL_TEXTURE_COMPRESSED TEXTURE_COMPRESSED}
{@link GL13#GL_TEXTURE_COMPRESSED_IMAGE_SIZE TEXTURE_COMPRESSED_IMAGE_SIZE}{@link GL31#GL_TEXTURE_BUFFER_DATA_STORE_BINDING TEXTURE_BUFFER_DATA_STORE_BINDING}{@link GL43#GL_TEXTURE_BUFFER_OFFSET TEXTURE_BUFFER_OFFSET}{@link GL43#GL_TEXTURE_BUFFER_SIZE TEXTURE_BUFFER_SIZE}
+ * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTexLevelParameteriv(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetTexLevelParameteriv(target, level, pname, memAddress(params)); + } + + /** + * Places integer information about texture image parameter {@code pname} for level-of-detail {@code level} of the specified {@code target} into {@code params}. + * + * @param target the texture image target. One of:
{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link #GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
{@link #GL_TEXTURE_1D TEXTURE_1D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}{@link #GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}{@link GL12#GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}{@link GL32#GL_PROXY_TEXTURE_2D_MULTISAMPLE PROXY_TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param level the level-of-detail number + * @param pname the parameter to query. One of:
{@link #GL_TEXTURE_WIDTH TEXTURE_WIDTH}{@link #GL_TEXTURE_HEIGHT TEXTURE_HEIGHT}{@link GL12#GL_TEXTURE_DEPTH TEXTURE_DEPTH}{@link GL32#GL_TEXTURE_SAMPLES TEXTURE_SAMPLES}
{@link GL32#GL_TEXTURE_FIXED_SAMPLE_LOCATIONS TEXTURE_FIXED_SAMPLE_LOCATIONS}{@link #GL_TEXTURE_INTERNAL_FORMAT TEXTURE_INTERNAL_FORMAT}{@link #GL_TEXTURE_RED_SIZE TEXTURE_RED_SIZE}{@link #GL_TEXTURE_GREEN_SIZE TEXTURE_GREEN_SIZE}
{@link #GL_TEXTURE_BLUE_SIZE TEXTURE_BLUE_SIZE}{@link #GL_TEXTURE_ALPHA_SIZE TEXTURE_ALPHA_SIZE}{@link GL14#GL_TEXTURE_DEPTH_SIZE TEXTURE_DEPTH_SIZE}{@link GL30#GL_TEXTURE_STENCIL_SIZE TEXTURE_STENCIL_SIZE}
{@link GL30#GL_TEXTURE_SHARED_SIZE TEXTURE_SHARED_SIZE}{@link GL30#GL_TEXTURE_ALPHA_TYPE TEXTURE_ALPHA_TYPE}{@link GL30#GL_TEXTURE_DEPTH_TYPE TEXTURE_DEPTH_TYPE}{@link GL13#GL_TEXTURE_COMPRESSED TEXTURE_COMPRESSED}
{@link GL13#GL_TEXTURE_COMPRESSED_IMAGE_SIZE TEXTURE_COMPRESSED_IMAGE_SIZE}{@link GL31#GL_TEXTURE_BUFFER_DATA_STORE_BINDING TEXTURE_BUFFER_DATA_STORE_BINDING}{@link GL43#GL_TEXTURE_BUFFER_OFFSET TEXTURE_BUFFER_OFFSET}{@link GL43#GL_TEXTURE_BUFFER_SIZE TEXTURE_BUFFER_SIZE}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetTexLevelParameteri(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetTexLevelParameteriv(target, level, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTexLevelParameterfv ] --- + + /** Unsafe version of: {@link #glGetTexLevelParameterfv GetTexLevelParameterfv} */ + public static native void nglGetTexLevelParameterfv(int target, int level, int pname, long params); + + /** + * Float version of {@link #glGetTexLevelParameteriv GetTexLevelParameteriv}. + * + * @param target the texture image target + * @param level the level-of-detail number + * @param pname the parameter to query + * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTexLevelParameterfv(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetTexLevelParameterfv(target, level, pname, memAddress(params)); + } + + /** + * Float version of {@link #glGetTexLevelParameteriv GetTexLevelParameteriv}. + * + * @param target the texture image target + * @param level the level-of-detail number + * @param pname the parameter to query + * + * @see Reference Page + */ + @NativeType("void") + public static float glGetTexLevelParameterf(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer params = stack.callocFloat(1); + nglGetTexLevelParameterfv(target, level, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTexParameteriv ] --- + + /** Unsafe version of: {@link #glGetTexParameteriv GetTexParameteriv} */ + public static native void nglGetTexParameteriv(int target, int pname, long params); + + /** + * Place integer information about texture parameter {@code pname} for the specified {@code target} into {@code params}. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_1D TEXTURE_1D}{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param pname the parameter to query. One of:
{@link GL12#GL_TEXTURE_BASE_LEVEL TEXTURE_BASE_LEVEL}{@link #GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link #GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}{@link GL12#GL_TEXTURE_MAX_LEVEL TEXTURE_MAX_LEVEL}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}
{@link #GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL33#GL_TEXTURE_SWIZZLE_R TEXTURE_SWIZZLE_R}{@link GL33#GL_TEXTURE_SWIZZLE_G TEXTURE_SWIZZLE_G}
{@link GL33#GL_TEXTURE_SWIZZLE_B TEXTURE_SWIZZLE_B}{@link GL33#GL_TEXTURE_SWIZZLE_A TEXTURE_SWIZZLE_A}{@link GL33#GL_TEXTURE_SWIZZLE_RGBA TEXTURE_SWIZZLE_RGBA}{@link #GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}
{@link #GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL14#GL_DEPTH_TEXTURE_MODE DEPTH_TEXTURE_MODE}{@link GL14#GL_GENERATE_MIPMAP GENERATE_MIPMAP}
{@link GL42#GL_IMAGE_FORMAT_COMPATIBILITY_TYPE IMAGE_FORMAT_COMPATIBILITY_TYPE}{@link GL42#GL_TEXTURE_IMMUTABLE_FORMAT TEXTURE_IMMUTABLE_FORMAT}{@link GL43#GL_TEXTURE_IMMUTABLE_LEVELS TEXTURE_IMMUTABLE_LEVELS}{@link GL43#GL_TEXTURE_VIEW_MIN_LEVEL TEXTURE_VIEW_MIN_LEVEL}
{@link GL43#GL_TEXTURE_VIEW_NUM_LEVELS TEXTURE_VIEW_NUM_LEVELS}{@link GL43#GL_TEXTURE_VIEW_MIN_LAYER TEXTURE_VIEW_MIN_LAYER}{@link GL43#GL_TEXTURE_VIEW_NUM_LAYERS TEXTURE_VIEW_NUM_LAYERS}
+ * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTexParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetTexParameteriv(target, pname, memAddress(params)); + } + + /** + * Place integer information about texture parameter {@code pname} for the specified {@code target} into {@code params}. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_1D TEXTURE_1D}{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param pname the parameter to query. One of:
{@link GL12#GL_TEXTURE_BASE_LEVEL TEXTURE_BASE_LEVEL}{@link #GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link #GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}{@link GL12#GL_TEXTURE_MAX_LEVEL TEXTURE_MAX_LEVEL}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}
{@link #GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL33#GL_TEXTURE_SWIZZLE_R TEXTURE_SWIZZLE_R}{@link GL33#GL_TEXTURE_SWIZZLE_G TEXTURE_SWIZZLE_G}
{@link GL33#GL_TEXTURE_SWIZZLE_B TEXTURE_SWIZZLE_B}{@link GL33#GL_TEXTURE_SWIZZLE_A TEXTURE_SWIZZLE_A}{@link GL33#GL_TEXTURE_SWIZZLE_RGBA TEXTURE_SWIZZLE_RGBA}{@link #GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}
{@link #GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL14#GL_DEPTH_TEXTURE_MODE DEPTH_TEXTURE_MODE}{@link GL14#GL_GENERATE_MIPMAP GENERATE_MIPMAP}
{@link GL42#GL_IMAGE_FORMAT_COMPATIBILITY_TYPE IMAGE_FORMAT_COMPATIBILITY_TYPE}{@link GL42#GL_TEXTURE_IMMUTABLE_FORMAT TEXTURE_IMMUTABLE_FORMAT}{@link GL43#GL_TEXTURE_IMMUTABLE_LEVELS TEXTURE_IMMUTABLE_LEVELS}{@link GL43#GL_TEXTURE_VIEW_MIN_LEVEL TEXTURE_VIEW_MIN_LEVEL}
{@link GL43#GL_TEXTURE_VIEW_NUM_LEVELS TEXTURE_VIEW_NUM_LEVELS}{@link GL43#GL_TEXTURE_VIEW_MIN_LAYER TEXTURE_VIEW_MIN_LAYER}{@link GL43#GL_TEXTURE_VIEW_NUM_LAYERS TEXTURE_VIEW_NUM_LAYERS}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetTexParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetTexParameteriv(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTexParameterfv ] --- + + /** Unsafe version of: {@link #glGetTexParameterfv GetTexParameterfv} */ + public static native void nglGetTexParameterfv(int target, int pname, long params); + + /** + * Float version of {@link #glGetTexParameteriv GetTexParameteriv}. + * + * @param target the texture target + * @param pname the parameter to query + * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTexParameterfv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetTexParameterfv(target, pname, memAddress(params)); + } + + /** + * Float version of {@link #glGetTexParameteriv GetTexParameteriv}. + * + * @param target the texture target + * @param pname the parameter to query + * + * @see Reference Page + */ + @NativeType("void") + public static float glGetTexParameterf(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer params = stack.callocFloat(1); + nglGetTexParameterfv(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glHint ] --- + + /** + * Certain aspects of GL behavior, when there is room for variation, may be controlled with this function. The initial value for all hints is + * {@link #GL_DONT_CARE DONT_CARE}. + * + * @param target the behavior to control. One of:
{@link #GL_LINE_SMOOTH_HINT LINE_SMOOTH_HINT}{@link #GL_POLYGON_SMOOTH_HINT POLYGON_SMOOTH_HINT}{@link GL13#GL_TEXTURE_COMPRESSION_HINT TEXTURE_COMPRESSION_HINT}
{@link GL20#GL_FRAGMENT_SHADER_DERIVATIVE_HINT FRAGMENT_SHADER_DERIVATIVE_HINT}
+ * @param hint the behavior hint. One of:
{@link #GL_FASTEST FASTEST}{@link #GL_NICEST NICEST}{@link #GL_DONT_CARE DONT_CARE}
+ * + * @see Reference Page + */ + public static native void glHint(@NativeType("GLenum") int target, @NativeType("GLenum") int hint); + + // --- [ glIsEnabled ] --- + + /** + * Determines if {@code cap} is currently enabled (as with {@link #glEnable Enable}) or disabled. + * + * @param cap the enable state to query + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static native boolean glIsEnabled(@NativeType("GLenum") int cap); + + // --- [ glIsTexture ] --- + + /** + * Returns true if {@code texture} is the name of a texture object. + * + * @param texture the texture name to query + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static native boolean glIsTexture(@NativeType("GLuint") int texture); + + // --- [ glLineWidth ] --- + + /** + * Sets the width of rasterized line segments. The default width is 1.0. + * + * @param width the line width + * + * @see Reference Page + */ + public static native void glLineWidth(@NativeType("GLfloat") float width); + + // --- [ glLogicOp ] --- + + /** + * Sets the logical framebuffer operation. + * + * @param op the operation to set. One of:
{@link #GL_CLEAR CLEAR}{@link #GL_AND AND}{@link #GL_AND_REVERSE AND_REVERSE}{@link #GL_COPY COPY}{@link #GL_AND_INVERTED AND_INVERTED}{@link #GL_NOOP NOOP}{@link #GL_XOR XOR}{@link #GL_OR OR}{@link #GL_NOR NOR}{@link #GL_EQUIV EQUIV}{@link #GL_INVERT INVERT}{@link #GL_OR_REVERSE OR_REVERSE}{@link #GL_COPY_INVERTED COPY_INVERTED}
{@link #GL_OR_INVERTED OR_INVERTED}{@link #GL_NAND NAND}{@link #GL_SET SET}
+ * + * @see Reference Page + */ + public static native void glLogicOp(@NativeType("GLenum") int op); + + // --- [ glPixelStorei ] --- + + /** + * Sets the integer value of a pixel store parameter. + * + * @param pname the pixel store parameter to set. One of:
{@link #GL_UNPACK_SWAP_BYTES UNPACK_SWAP_BYTES}{@link #GL_UNPACK_LSB_FIRST UNPACK_LSB_FIRST}{@link #GL_UNPACK_ROW_LENGTH UNPACK_ROW_LENGTH}
{@link #GL_UNPACK_SKIP_ROWS UNPACK_SKIP_ROWS}{@link #GL_UNPACK_SKIP_PIXELS UNPACK_SKIP_PIXELS}{@link #GL_UNPACK_ALIGNMENT UNPACK_ALIGNMENT}
{@link GL12#GL_UNPACK_IMAGE_HEIGHT UNPACK_IMAGE_HEIGHT}{@link GL12#GL_UNPACK_SKIP_IMAGES UNPACK_SKIP_IMAGES}{@link GL42#GL_UNPACK_COMPRESSED_BLOCK_WIDTH UNPACK_COMPRESSED_BLOCK_WIDTH}
{@link GL42#GL_UNPACK_COMPRESSED_BLOCK_HEIGHT UNPACK_COMPRESSED_BLOCK_HEIGHT}{@link GL42#GL_UNPACK_COMPRESSED_BLOCK_DEPTH UNPACK_COMPRESSED_BLOCK_DEPTH}{@link GL42#GL_UNPACK_COMPRESSED_BLOCK_SIZE UNPACK_COMPRESSED_BLOCK_SIZE}
+ * @param param the parameter value + * + * @see Reference Page + */ + public static native void glPixelStorei(@NativeType("GLenum") int pname, @NativeType("GLint") int param); + + // --- [ glPixelStoref ] --- + + /** + * Float version of {@link #glPixelStorei PixelStorei}. + * + * @param pname the pixel store parameter to set + * @param param the parameter value + * + * @see Reference Page + */ + public static native void glPixelStoref(@NativeType("GLenum") int pname, @NativeType("GLfloat") float param); + + // --- [ glPointSize ] --- + + /** + * Controls the rasterization of points if no vertex, tessellation control, tessellation evaluation, or geometry shader is active. The default point size is 1.0. + * + * @param size the request size of a point + * + * @see Reference Page + */ + public static native void glPointSize(@NativeType("GLfloat") float size); + + // --- [ glPolygonMode ] --- + + /** + * Controls the interpretation of polygons for rasterization. + * + *

{@link #GL_FILL FILL} is the default mode of polygon rasterization. Note that these modes affect only the final rasterization of polygons: in particular, a + * polygon's vertices are lit, and the polygon is clipped and possibly culled before these modes are applied. Polygon antialiasing applies only to the + * {@link #GL_FILL FILL} state of PolygonMode. For {@link #GL_POINT POINT} or {@link #GL_LINE LINE}, point antialiasing or line segment antialiasing, respectively, apply.

+ * + * @param face the face for which to set the rasterizing method. One of:
{@link #GL_FRONT FRONT}{@link #GL_BACK BACK}{@link #GL_FRONT_AND_BACK FRONT_AND_BACK}
+ * @param mode the rasterization mode. One of:
{@link #GL_POINT POINT}{@link #GL_LINE LINE}{@link #GL_FILL FILL}
+ * + * @see Reference Page + */ + public static native void glPolygonMode(@NativeType("GLenum") int face, @NativeType("GLenum") int mode); + + // --- [ glPolygonOffset ] --- + + /** + * The depth values of all fragments generated by the rasterization of a polygon may be offset by a single value that is computed for that polygon. This + * function determines that value. + * + *

{@code factor} scales the maximum depth slope of the polygon, and {@code units} scales an implementation-dependent constant that relates to the usable + * resolution of the depth buffer. The resulting values are summed to produce the polygon offset value.

+ * + * @param factor the maximum depth slope factor + * @param units the constant scale + * + * @see Reference Page + */ + public static native void glPolygonOffset(@NativeType("GLfloat") float factor, @NativeType("GLfloat") float units); + + // --- [ glReadBuffer ] --- + + /** + * Defines the color buffer from which values are obtained. + * + *

Acceptable values for {@code src} depend on whether the GL is using the default framebuffer (i.e., {@link GL30#GL_DRAW_FRAMEBUFFER_BINDING DRAW_FRAMEBUFFER_BINDING} is zero), or + * a framebuffer object (i.e., {@link GL30#GL_DRAW_FRAMEBUFFER_BINDING DRAW_FRAMEBUFFER_BINDING} is non-zero). In the initial state, the GL is bound to the default framebuffer.

+ * + * @param src the color buffer to read from. One of:
{@link #GL_NONE NONE}{@link #GL_FRONT_LEFT FRONT_LEFT}{@link #GL_FRONT_RIGHT FRONT_RIGHT}{@link #GL_BACK_LEFT BACK_LEFT}{@link #GL_BACK_RIGHT BACK_RIGHT}{@link #GL_FRONT FRONT}{@link #GL_BACK BACK}{@link #GL_LEFT LEFT}
{@link #GL_RIGHT RIGHT}{@link #GL_FRONT_AND_BACK FRONT_AND_BACK}{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}GL30.GL_COLOR_ATTACHMENT[1-15]
+ * + * @see Reference Page + */ + public static native void glReadBuffer(@NativeType("GLenum") int src); + + // --- [ glReadPixels ] --- + + /** Unsafe version of: {@link #glReadPixels ReadPixels} */ + public static native void nglReadPixels(int x, int y, int width, int height, int format, int type, long pixels); + + /** + * ReadPixels obtains values from the selected read buffer from each pixel with lower left hand corner at {@code (x + i, y + j)} for {@code 0 <= i < width} + * and {@code 0 <= j < height}; this pixel is said to be the ith pixel in the jth row. If any of these pixels lies outside of the + * window allocated to the current GL context, or outside of the image attached to the currently bound read framebuffer object, then the values obtained + * for those pixels are undefined. When {@link GL30#GL_READ_FRAMEBUFFER_BINDING READ_FRAMEBUFFER_BINDING} is zero, values are also undefined for individual pixels that are not owned by + * the current context. Otherwise, {@code ReadPixels} obtains values from the selected buffer, regardless of how those values were placed there. + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels a buffer in which to place the returned pixel data + * + * @see Reference Page + */ + public static void glReadPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer pixels) { + nglReadPixels(x, y, width, height, format, type, memAddress(pixels)); + } + + /** + * ReadPixels obtains values from the selected read buffer from each pixel with lower left hand corner at {@code (x + i, y + j)} for {@code 0 <= i < width} + * and {@code 0 <= j < height}; this pixel is said to be the ith pixel in the jth row. If any of these pixels lies outside of the + * window allocated to the current GL context, or outside of the image attached to the currently bound read framebuffer object, then the values obtained + * for those pixels are undefined. When {@link GL30#GL_READ_FRAMEBUFFER_BINDING READ_FRAMEBUFFER_BINDING} is zero, values are also undefined for individual pixels that are not owned by + * the current context. Otherwise, {@code ReadPixels} obtains values from the selected buffer, regardless of how those values were placed there. + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels a buffer in which to place the returned pixel data + * + * @see Reference Page + */ + public static void glReadPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") long pixels) { + nglReadPixels(x, y, width, height, format, type, pixels); + } + + /** + * ReadPixels obtains values from the selected read buffer from each pixel with lower left hand corner at {@code (x + i, y + j)} for {@code 0 <= i < width} + * and {@code 0 <= j < height}; this pixel is said to be the ith pixel in the jth row. If any of these pixels lies outside of the + * window allocated to the current GL context, or outside of the image attached to the currently bound read framebuffer object, then the values obtained + * for those pixels are undefined. When {@link GL30#GL_READ_FRAMEBUFFER_BINDING READ_FRAMEBUFFER_BINDING} is zero, values are also undefined for individual pixels that are not owned by + * the current context. Otherwise, {@code ReadPixels} obtains values from the selected buffer, regardless of how those values were placed there. + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels a buffer in which to place the returned pixel data + * + * @see Reference Page + */ + public static void glReadPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ShortBuffer pixels) { + nglReadPixels(x, y, width, height, format, type, memAddress(pixels)); + } + + /** + * ReadPixels obtains values from the selected read buffer from each pixel with lower left hand corner at {@code (x + i, y + j)} for {@code 0 <= i < width} + * and {@code 0 <= j < height}; this pixel is said to be the ith pixel in the jth row. If any of these pixels lies outside of the + * window allocated to the current GL context, or outside of the image attached to the currently bound read framebuffer object, then the values obtained + * for those pixels are undefined. When {@link GL30#GL_READ_FRAMEBUFFER_BINDING READ_FRAMEBUFFER_BINDING} is zero, values are also undefined for individual pixels that are not owned by + * the current context. Otherwise, {@code ReadPixels} obtains values from the selected buffer, regardless of how those values were placed there. + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels a buffer in which to place the returned pixel data + * + * @see Reference Page + */ + public static void glReadPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") IntBuffer pixels) { + nglReadPixels(x, y, width, height, format, type, memAddress(pixels)); + } + + /** + * ReadPixels obtains values from the selected read buffer from each pixel with lower left hand corner at {@code (x + i, y + j)} for {@code 0 <= i < width} + * and {@code 0 <= j < height}; this pixel is said to be the ith pixel in the jth row. If any of these pixels lies outside of the + * window allocated to the current GL context, or outside of the image attached to the currently bound read framebuffer object, then the values obtained + * for those pixels are undefined. When {@link GL30#GL_READ_FRAMEBUFFER_BINDING READ_FRAMEBUFFER_BINDING} is zero, values are also undefined for individual pixels that are not owned by + * the current context. Otherwise, {@code ReadPixels} obtains values from the selected buffer, regardless of how those values were placed there. + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels a buffer in which to place the returned pixel data + * + * @see Reference Page + */ + public static void glReadPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") FloatBuffer pixels) { + nglReadPixels(x, y, width, height, format, type, memAddress(pixels)); + } + + // --- [ glScissor ] --- + + /** + * Defines the scissor rectangle for all viewports. The scissor test is enabled or disabled for all viewports using {@link #glEnable Enable} or {@link #glDisable Disable} + * with the symbolic constant {@link #GL_SCISSOR_TEST SCISSOR_TEST}. When disabled, it is as if the scissor test always passes. When enabled, if + * left ≤ xw < left + width and bottom ≤ yw < bottom + height for the scissor rectangle, then the scissor + * test passes. Otherwise, the test fails and the fragment is discarded. + * + * @param x the left scissor rectangle coordinate + * @param y the bottom scissor rectangle coordinate + * @param width the scissor rectangle width + * @param height the scissor rectangle height + * + * @see Reference Page + */ + public static native void glScissor(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glStencilFunc ] --- + + /** + * Controls the stencil test. + * + *

{@code ref} is an integer reference value that is used in the unsigned stencil comparison. Stencil comparison operations and queries of {@code ref} + * clamp its value to the range [0, 2s – 1], where s is the number of bits in the stencil buffer attached to the draw framebuffer. The s + * least significant bits of {@code mask} are bitwise ANDed with both the reference and the stored stencil value, and the resulting masked values are those that + * participate in the comparison controlled by {@code func}.

+ * + * @param func the stencil comparison function. One of:
{@link #GL_NEVER NEVER}{@link #GL_ALWAYS ALWAYS}{@link #GL_LESS LESS}{@link #GL_LEQUAL LEQUAL}{@link #GL_EQUAL EQUAL}{@link #GL_GEQUAL GEQUAL}{@link #GL_GREATER GREATER}{@link #GL_NOTEQUAL NOTEQUAL}
+ * @param ref the reference value + * @param mask the stencil comparison mask + * + * @see Reference Page + */ + public static native void glStencilFunc(@NativeType("GLenum") int func, @NativeType("GLint") int ref, @NativeType("GLuint") int mask); + + // --- [ glStencilMask ] --- + + /** + * Masks the writing of particular bits into the stencil plans. + * + *

The least significant s bits of {@code mask}, where s is the number of bits in the stencil buffer, specify an integer mask. Where a 1 appears in this + * mask, the corresponding bit in the stencil buffer is written; where a 0 appears, the bit is not written.

+ * + * @param mask the stencil mask + * + * @see Reference Page + */ + public static native void glStencilMask(@NativeType("GLuint") int mask); + + // --- [ glStencilOp ] --- + + /** + * Indicates what happens to the stored stencil value if this or certain subsequent tests fail or pass. + * + *

The supported actions are {@link #GL_KEEP KEEP}, {@link #GL_ZERO ZERO}, {@link #GL_REPLACE REPLACE}, {@link #GL_INCR INCR}, {@link #GL_DECR DECR}, {@link #GL_INVERT INVERT}, + * {@link GL14#GL_INCR_WRAP INCR_WRAP} and {@link GL14#GL_DECR_WRAP DECR_WRAP}. These correspond to keeping the current value, setting to zero, replacing with the reference value, + * incrementing with saturation, decrementing with saturation, bitwise inverting it, incrementing without saturation, and decrementing without saturation.

+ * + *

For purposes of increment and decrement, the stencil bits are considered as an unsigned integer. Incrementing or decrementing with saturation clamps + * the stencil value at 0 and the maximum representable value. Incrementing or decrementing without saturation will wrap such that incrementing the maximum + * representable value results in 0, and decrementing 0 results in the maximum representable value.

+ * + * @param sfail the action to take if the stencil test fails + * @param dpfail the action to take if the depth buffer test fails + * @param dppass the action to take if the depth buffer test passes + * + * @see Reference Page + */ + public static native void glStencilOp(@NativeType("GLenum") int sfail, @NativeType("GLenum") int dpfail, @NativeType("GLenum") int dppass); + + // --- [ glTexImage1D ] --- + + /** Unsafe version of: {@link #glTexImage1D TexImage1D} */ + public static native void nglTexImage1D(int target, int level, int internalformat, int width, int border, int format, int type, long pixels); + + /** + * One-dimensional version of {@link #glTexImage2D TexImage2D}}. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_1D TEXTURE_1D}{@link #GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format + * @param width the texture width + * @param border the texture border width + * @param format the texel data format + * @param type the texel data type + * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer pixels) { + nglTexImage1D(target, level, internalformat, width, border, format, type, memAddressSafe(pixels)); + } + + /** + * One-dimensional version of {@link #glTexImage2D TexImage2D}}. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_1D TEXTURE_1D}{@link #GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format + * @param width the texture width + * @param border the texture border width + * @param format the texel data format + * @param type the texel data type + * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") long pixels) { + nglTexImage1D(target, level, internalformat, width, border, format, type, pixels); + } + + /** + * One-dimensional version of {@link #glTexImage2D TexImage2D}}. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_1D TEXTURE_1D}{@link #GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format + * @param width the texture width + * @param border the texture border width + * @param format the texel data format + * @param type the texel data type + * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer pixels) { + nglTexImage1D(target, level, internalformat, width, border, format, type, memAddressSafe(pixels)); + } + + /** + * One-dimensional version of {@link #glTexImage2D TexImage2D}}. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_1D TEXTURE_1D}{@link #GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format + * @param width the texture width + * @param border the texture border width + * @param format the texel data format + * @param type the texel data type + * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer pixels) { + nglTexImage1D(target, level, internalformat, width, border, format, type, memAddressSafe(pixels)); + } + + /** + * One-dimensional version of {@link #glTexImage2D TexImage2D}}. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_1D TEXTURE_1D}{@link #GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format + * @param width the texture width + * @param border the texture border width + * @param format the texel data format + * @param type the texel data type + * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer pixels) { + nglTexImage1D(target, level, internalformat, width, border, format, type, memAddressSafe(pixels)); + } + + /** + * One-dimensional version of {@link #glTexImage2D TexImage2D}}. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_1D TEXTURE_1D}{@link #GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format + * @param width the texture width + * @param border the texture border width + * @param format the texel data format + * @param type the texel data type + * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") DoubleBuffer pixels) { + nglTexImage1D(target, level, internalformat, width, border, format, type, memAddressSafe(pixels)); + } + + // --- [ glTexImage2D ] --- + + /** Unsafe version of: {@link #glTexImage2D TexImage2D} */ + public static native void nglTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, long pixels); + + /** + * Specifies a two-dimensional texture image. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link #GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link #GL_RED RED}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link #GL_R3_G3_B2 R3_G3_B2}{@link #GL_RGB4 RGB4}{@link #GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link #GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link #GL_RGB10 RGB10}{@link #GL_RGB12 RGB12}{@link #GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link #GL_RGBA2 RGBA2}{@link #GL_RGBA4 RGBA4}{@link #GL_RGB5_A1 RGB5_A1}{@link #GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link #GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link #GL_RGBA12 RGBA12}{@link #GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param border the texture border width + * @param format the texel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer pixels) { + nglTexImage2D(target, level, internalformat, width, height, border, format, type, memAddressSafe(pixels)); + } + + /** + * Specifies a two-dimensional texture image. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link #GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link #GL_RED RED}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link #GL_R3_G3_B2 R3_G3_B2}{@link #GL_RGB4 RGB4}{@link #GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link #GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link #GL_RGB10 RGB10}{@link #GL_RGB12 RGB12}{@link #GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link #GL_RGBA2 RGBA2}{@link #GL_RGBA4 RGBA4}{@link #GL_RGB5_A1 RGB5_A1}{@link #GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link #GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link #GL_RGBA12 RGBA12}{@link #GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param border the texture border width + * @param format the texel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") long pixels) { + nglTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); + } + + /** + * Specifies a two-dimensional texture image. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link #GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link #GL_RED RED}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link #GL_R3_G3_B2 R3_G3_B2}{@link #GL_RGB4 RGB4}{@link #GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link #GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link #GL_RGB10 RGB10}{@link #GL_RGB12 RGB12}{@link #GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link #GL_RGBA2 RGBA2}{@link #GL_RGBA4 RGBA4}{@link #GL_RGB5_A1 RGB5_A1}{@link #GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link #GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link #GL_RGBA12 RGBA12}{@link #GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param border the texture border width + * @param format the texel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer pixels) { + nglTexImage2D(target, level, internalformat, width, height, border, format, type, memAddressSafe(pixels)); + } + + /** + * Specifies a two-dimensional texture image. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link #GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link #GL_RED RED}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link #GL_R3_G3_B2 R3_G3_B2}{@link #GL_RGB4 RGB4}{@link #GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link #GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link #GL_RGB10 RGB10}{@link #GL_RGB12 RGB12}{@link #GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link #GL_RGBA2 RGBA2}{@link #GL_RGBA4 RGBA4}{@link #GL_RGB5_A1 RGB5_A1}{@link #GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link #GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link #GL_RGBA12 RGBA12}{@link #GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param border the texture border width + * @param format the texel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer pixels) { + nglTexImage2D(target, level, internalformat, width, height, border, format, type, memAddressSafe(pixels)); + } + + /** + * Specifies a two-dimensional texture image. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link #GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link #GL_RED RED}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link #GL_R3_G3_B2 R3_G3_B2}{@link #GL_RGB4 RGB4}{@link #GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link #GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link #GL_RGB10 RGB10}{@link #GL_RGB12 RGB12}{@link #GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link #GL_RGBA2 RGBA2}{@link #GL_RGBA4 RGBA4}{@link #GL_RGB5_A1 RGB5_A1}{@link #GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link #GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link #GL_RGBA12 RGBA12}{@link #GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param border the texture border width + * @param format the texel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer pixels) { + nglTexImage2D(target, level, internalformat, width, height, border, format, type, memAddressSafe(pixels)); + } + + /** + * Specifies a two-dimensional texture image. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link #GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link #GL_RED RED}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link #GL_R3_G3_B2 R3_G3_B2}{@link #GL_RGB4 RGB4}{@link #GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link #GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link #GL_RGB10 RGB10}{@link #GL_RGB12 RGB12}{@link #GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link #GL_RGBA2 RGBA2}{@link #GL_RGBA4 RGBA4}{@link #GL_RGB5_A1 RGB5_A1}{@link #GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link #GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link #GL_RGBA12 RGBA12}{@link #GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param border the texture border width + * @param format the texel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") DoubleBuffer pixels) { + nglTexImage2D(target, level, internalformat, width, height, border, format, type, memAddressSafe(pixels)); + } + + // --- [ glCopyTexImage1D ] --- + + /** + * Defines a one-dimensional texel array in exactly the manner of {@link #glTexImage1D TexImage1D}, except that the image data are taken from the framebuffer rather + * than from client memory. For the purposes of decoding the texture image, {@code CopyTexImage1D} is equivalent to calling {@link #glCopyTexImage2D CopyTexImage2D} + * with corresponding arguments and height of 1, except that the height of the image is always 1, regardless of the value of border. level, internalformat, + * and border are specified using the same values, with the same meanings, as the corresponding arguments of {@link #glTexImage1D TexImage1D}. The constraints on + * width and border are exactly those of the corresponding arguments of {@link #glTexImage1D TexImage1D}. + * + * @param target the texture target. Must be:
{@link #GL_TEXTURE_1D TEXTURE_1D}
+ * @param level the level-of-detail number + * @param internalFormat the texture internal format. See {@link #glTexImage2D TexImage2D} for a list of supported formats. + * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the texture width + * @param border the texture border width + * + * @see Reference Page + */ + public static native void glCopyTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalFormat, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLint") int border); + + // --- [ glCopyTexImage2D ] --- + + /** + * Defines a two-dimensional texel array in exactly the manner of {@link #glTexImage2D TexImage2D}, except that the image data are taken from the framebuffer rather + * than from client memory. + * + *

{@code x}, {@code y}, {@code width}, and {@code height} correspond precisely to the corresponding arguments to {@link #glReadPixels ReadPixels}; they specify the + * image's width and height, and the lower left (x, y) coordinates of the framebuffer region to be copied.

+ * + *

The image is taken from the framebuffer exactly as if these arguments were passed to {@link GL11#glCopyPixels CopyPixels} with argument type set to {@link #GL_COLOR COLOR}, + * {@link #GL_DEPTH DEPTH}, or {@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}, depending on {@code internalformat}. RGBA data is taken from the current color buffer, while depth + * component and stencil index data are taken from the depth and stencil buffers, respectively.

+ * + *

Subsequent processing is identical to that described for {@link #glTexImage2D TexImage2D}, beginning with clamping of the R, G, B, A, or depth values, and masking + * of the stencil index values from the resulting pixel groups. Parameters {@code level}, {@code internalformat}, and {@code border} are specified using + * the same values, with the same meanings, as the corresponding arguments of {@link #glTexImage2D TexImage2D}.

+ * + *

The constraints on width, height, and border are exactly those for the corresponding arguments of {@link #glTexImage2D TexImage2D}.

+ * + * @param target the texture target. One of:
{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number + * @param internalFormat the texture internal format. See {@link #glTexImage2D TexImage2D} for a list of supported formats. + * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the texture width + * @param height the texture height + * @param border the texture border width + * + * @see Reference Page + */ + public static native void glCopyTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalFormat, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border); + + // --- [ glCopyTexSubImage1D ] --- + + /** + * Respecifies a rectangular subregion of an existing texel array. No change is made to the {@code internalformat}, {@code width} or {@code border} + * parameters of the specified texel array, nor is any change made to texel values outside the specified subregion. See {@link #glCopyTexImage1D CopyTexImage1D} for more + * details. + * + * @param target the texture target. Must be:
{@link #GL_TEXTURE_1D TEXTURE_1D}
+ * @param level the level-of-detail number + * @param xoffset the left texel coordinate of the texture subregion to update + * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the texture subregion width + * + * @see Reference Page + */ + public static native void glCopyTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width); + + // --- [ glCopyTexSubImage2D ] --- + + /** + * Respecifies a rectangular subregion of an existing texel array. No change is made to the {@code internalformat}, {@code width}, {@code height}, + * or {@code border} parameters of the specified texel array, nor is any change made to texel values outside the specified subregion. See + * {@link #glCopyTexImage2D CopyTexImage2D} for more details. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number + * @param xoffset the left texel coordinate of the texture subregion to update + * @param yoffset the lower texel coordinate of the texture subregion to update + * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the texture subregion width + * @param height the texture subregion height + * + * @see Reference Page + */ + public static native void glCopyTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glTexParameteri ] --- + + /** + * Sets the integer value of a texture parameter, which controls how the texel array is treated when specified or changed, and when applied to a fragment. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_1D TEXTURE_1D}{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param pname the parameter to set. One of:
{@link GL12#GL_TEXTURE_BASE_LEVEL TEXTURE_BASE_LEVEL}{@link #GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link #GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}{@link GL12#GL_TEXTURE_MAX_LEVEL TEXTURE_MAX_LEVEL}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}
{@link #GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL33#GL_TEXTURE_SWIZZLE_R TEXTURE_SWIZZLE_R}{@link GL33#GL_TEXTURE_SWIZZLE_G TEXTURE_SWIZZLE_G}
{@link GL33#GL_TEXTURE_SWIZZLE_B TEXTURE_SWIZZLE_B}{@link GL33#GL_TEXTURE_SWIZZLE_A TEXTURE_SWIZZLE_A}{@link GL33#GL_TEXTURE_SWIZZLE_RGBA TEXTURE_SWIZZLE_RGBA}{@link #GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}
{@link #GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL14#GL_DEPTH_TEXTURE_MODE DEPTH_TEXTURE_MODE}{@link GL14#GL_GENERATE_MIPMAP GENERATE_MIPMAP}
+ * @param param the parameter value + * + * @see Reference Page + */ + public static native void glTexParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint") int param); + + // --- [ glTexParameteriv ] --- + + /** Unsafe version of: {@link #glTexParameteriv TexParameteriv} */ + public static native void nglTexParameteriv(int target, int pname, long params); + + /** + * Pointer version of {@link #glTexParameteri TexParameteri}. + * + * @param target the texture target + * @param pname the parameter to set + * @param params the parameter value + * + * @see Reference Page + */ + public static void glTexParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglTexParameteriv(target, pname, memAddress(params)); + } + + // --- [ glTexParameterf ] --- + + /** + * Float version of {@link #glTexParameteri TexParameteri}. + * + * @param target the texture target + * @param pname the parameter to set + * @param param the parameter value + * + * @see Reference Page + */ + public static native void glTexParameterf(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat") float param); + + // --- [ glTexParameterfv ] --- + + /** Unsafe version of: {@link #glTexParameterfv TexParameterfv} */ + public static native void nglTexParameterfv(int target, int pname, long params); + + /** + * Pointer version of {@link #glTexParameterf TexParameterf}. + * + * @param target the texture target + * @param pname the parameter to set + * @param params the parameter value + * + * @see Reference Page + */ + public static void glTexParameterfv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglTexParameterfv(target, pname, memAddress(params)); + } + + // --- [ glTexSubImage1D ] --- + + /** Unsafe version of: {@link #glTexSubImage1D TexSubImage1D} */ + public static native void nglTexSubImage1D(int target, int level, int xoffset, int width, int format, int type, long pixels); + + /** + * One-dimensional version of {@link #glTexSubImage2D TexSubImage2D}. + * + * @param target the texture target. Must be:
{@link #GL_TEXTURE_1D TEXTURE_1D}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer pixels) { + nglTexSubImage1D(target, level, xoffset, width, format, type, memAddress(pixels)); + } + + /** + * One-dimensional version of {@link #glTexSubImage2D TexSubImage2D}. + * + * @param target the texture target. Must be:
{@link #GL_TEXTURE_1D TEXTURE_1D}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long pixels) { + nglTexSubImage1D(target, level, xoffset, width, format, type, pixels); + } + + /** + * One-dimensional version of {@link #glTexSubImage2D TexSubImage2D}. + * + * @param target the texture target. Must be:
{@link #GL_TEXTURE_1D TEXTURE_1D}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer pixels) { + nglTexSubImage1D(target, level, xoffset, width, format, type, memAddress(pixels)); + } + + /** + * One-dimensional version of {@link #glTexSubImage2D TexSubImage2D}. + * + * @param target the texture target. Must be:
{@link #GL_TEXTURE_1D TEXTURE_1D}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer pixels) { + nglTexSubImage1D(target, level, xoffset, width, format, type, memAddress(pixels)); + } + + /** + * One-dimensional version of {@link #glTexSubImage2D TexSubImage2D}. + * + * @param target the texture target. Must be:
{@link #GL_TEXTURE_1D TEXTURE_1D}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer pixels) { + nglTexSubImage1D(target, level, xoffset, width, format, type, memAddress(pixels)); + } + + /** + * One-dimensional version of {@link #glTexSubImage2D TexSubImage2D}. + * + * @param target the texture target. Must be:
{@link #GL_TEXTURE_1D TEXTURE_1D}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") DoubleBuffer pixels) { + nglTexSubImage1D(target, level, xoffset, width, format, type, memAddress(pixels)); + } + + // --- [ glTexSubImage2D ] --- + + /** Unsafe version of: {@link #glTexSubImage2D TexSubImage2D} */ + public static native void nglTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, long pixels); + + /** + * Respecifies a rectangular subregion of an existing texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer pixels) { + nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, memAddress(pixels)); + } + + /** + * Respecifies a rectangular subregion of an existing texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long pixels) { + nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * Respecifies a rectangular subregion of an existing texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer pixels) { + nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, memAddress(pixels)); + } + + /** + * Respecifies a rectangular subregion of an existing texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer pixels) { + nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, memAddress(pixels)); + } + + /** + * Respecifies a rectangular subregion of an existing texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer pixels) { + nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, memAddress(pixels)); + } + + /** + * Respecifies a rectangular subregion of an existing texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link #GL_RED RED}{@link #GL_GREEN GREEN}{@link #GL_BLUE BLUE}{@link #GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link #GL_RGB RGB}{@link #GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link #GL_STENCIL_INDEX STENCIL_INDEX}{@link #GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link #GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link #GL_BYTE BYTE}{@link #GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link #GL_SHORT SHORT}
{@link #GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link #GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") DoubleBuffer pixels) { + nglTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, memAddress(pixels)); + } + + // --- [ glViewport ] --- + + /** + * Specifies the viewport transformation parameters for all viewports. + * + *

The location of the viewport's bottom-left corner, given by {@code (x, y)}, are clamped to be within the implementation-dependent viewport bounds range. + * The viewport bounds range {@code [min, max]} tuple may be determined by calling {@link #glGetFloatv GetFloatv} with the symbolic + * constant {@link GL41#GL_VIEWPORT_BOUNDS_RANGE VIEWPORT_BOUNDS_RANGE}. Viewport width and height are clamped to implementation-dependent maximums when specified. The maximum + * width and height may be found by calling {@link #glGetFloatv GetFloatv} with the symbolic constant {@link #GL_MAX_VIEWPORT_DIMS MAX_VIEWPORT_DIMS}. The + * maximum viewport dimensions must be greater than or equal to the larger of the visible dimensions of the display being rendered to (if a display + * exists), and the largest renderbuffer image which can be successfully created and attached to a framebuffer object.

+ * + *

In the initial state, {@code w} and {@code h} for each viewport are set to the width and height, respectively, of the window into which the GL is to do + * its rendering. If the default framebuffer is bound but no default framebuffer is associated with the GL context, then {@code w} and {@code h} are + * initially set to zero.

+ * + * @param x the left viewport coordinate + * @param y the bottom viewport coordinate + * @param w the viewport width + * @param h the viewport height + * + * @see Reference Page + */ + public static native void glViewport(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int w, @NativeType("GLsizei") int h); + + /** + * Array version of: {@link #glGenTextures GenTextures} + * + * @see Reference Page + */ + public static void glGenTextures(@NativeType("GLuint *") int[] textures) { + long __functionAddress = GL.getICD().glGenTextures; + if (CHECKS) { + check(__functionAddress); + } + callPV(textures.length, textures, __functionAddress); + } + + /** + * Array version of: {@link #glDeleteTextures DeleteTextures} + * + * @see Reference Page + */ + public static void glDeleteTextures(@NativeType("GLuint const *") int[] textures) { + long __functionAddress = GL.getICD().glDeleteTextures; + if (CHECKS) { + check(__functionAddress); + } + callPV(textures.length, textures, __functionAddress); + } + + /** + * Array version of: {@link #glGetFloatv GetFloatv} + * + * @see Reference Page + */ + public static void glGetFloatv(@NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetFloatv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetIntegerv GetIntegerv} + * + * @see Reference Page + */ + public static void glGetIntegerv(@NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetIntegerv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetDoublev GetDoublev} + * + * @see Reference Page + */ + public static void glGetDoublev(@NativeType("GLenum") int pname, @NativeType("GLdouble *") double[] params) { + long __functionAddress = GL.getICD().glGetDoublev; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetTexImage GetTexImage} + * + * @see Reference Page + */ + public static void glGetTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") short[] pixels) { + long __functionAddress = GL.getICD().glGetTexImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(tex, level, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glGetTexImage GetTexImage} + * + * @see Reference Page + */ + public static void glGetTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") int[] pixels) { + long __functionAddress = GL.getICD().glGetTexImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(tex, level, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glGetTexImage GetTexImage} + * + * @see Reference Page + */ + public static void glGetTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") float[] pixels) { + long __functionAddress = GL.getICD().glGetTexImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(tex, level, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glGetTexImage GetTexImage} + * + * @see Reference Page + */ + public static void glGetTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") double[] pixels) { + long __functionAddress = GL.getICD().glGetTexImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(tex, level, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glGetTexLevelParameteriv GetTexLevelParameteriv} + * + * @see Reference Page + */ + public static void glGetTexLevelParameteriv(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetTexLevelParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, level, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetTexLevelParameterfv GetTexLevelParameterfv} + * + * @see Reference Page + */ + public static void glGetTexLevelParameterfv(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetTexLevelParameterfv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, level, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetTexParameteriv GetTexParameteriv} + * + * @see Reference Page + */ + public static void glGetTexParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetTexParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetTexParameterfv GetTexParameterfv} + * + * @see Reference Page + */ + public static void glGetTexParameterfv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetTexParameterfv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glReadPixels ReadPixels} + * + * @see Reference Page + */ + public static void glReadPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") short[] pixels) { + long __functionAddress = GL.getICD().glReadPixels; + if (CHECKS) { + check(__functionAddress); + } + callPV(x, y, width, height, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glReadPixels ReadPixels} + * + * @see Reference Page + */ + public static void glReadPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") int[] pixels) { + long __functionAddress = GL.getICD().glReadPixels; + if (CHECKS) { + check(__functionAddress); + } + callPV(x, y, width, height, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glReadPixels ReadPixels} + * + * @see Reference Page + */ + public static void glReadPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") float[] pixels) { + long __functionAddress = GL.getICD().glReadPixels; + if (CHECKS) { + check(__functionAddress); + } + callPV(x, y, width, height, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexImage1D TexImage1D} + * + * @see Reference Page + */ + public static void glTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] pixels) { + long __functionAddress = GL.getICD().glTexImage1D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, internalformat, width, border, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexImage1D TexImage1D} + * + * @see Reference Page + */ + public static void glTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] pixels) { + long __functionAddress = GL.getICD().glTexImage1D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, internalformat, width, border, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexImage1D TexImage1D} + * + * @see Reference Page + */ + public static void glTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] pixels) { + long __functionAddress = GL.getICD().glTexImage1D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, internalformat, width, border, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexImage1D TexImage1D} + * + * @see Reference Page + */ + public static void glTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") double[] pixels) { + long __functionAddress = GL.getICD().glTexImage1D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, internalformat, width, border, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexImage2D TexImage2D} + * + * @see Reference Page + */ + public static void glTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] pixels) { + long __functionAddress = GL.getICD().glTexImage2D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, internalformat, width, height, border, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexImage2D TexImage2D} + * + * @see Reference Page + */ + public static void glTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] pixels) { + long __functionAddress = GL.getICD().glTexImage2D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, internalformat, width, height, border, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexImage2D TexImage2D} + * + * @see Reference Page + */ + public static void glTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] pixels) { + long __functionAddress = GL.getICD().glTexImage2D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, internalformat, width, height, border, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexImage2D TexImage2D} + * + * @see Reference Page + */ + public static void glTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") double[] pixels) { + long __functionAddress = GL.getICD().glTexImage2D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, internalformat, width, height, border, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexParameteriv TexParameteriv} + * + * @see Reference Page + */ + public static void glTexParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glTexParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(target, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glTexParameterfv TexParameterfv} + * + * @see Reference Page + */ + public static void glTexParameterfv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] params) { + long __functionAddress = GL.getICD().glTexParameterfv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(target, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glTexSubImage1D TexSubImage1D} + * + * @see Reference Page + */ + public static void glTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] pixels) { + long __functionAddress = GL.getICD().glTexSubImage1D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, xoffset, width, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexSubImage1D TexSubImage1D} + * + * @see Reference Page + */ + public static void glTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] pixels) { + long __functionAddress = GL.getICD().glTexSubImage1D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, xoffset, width, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexSubImage1D TexSubImage1D} + * + * @see Reference Page + */ + public static void glTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] pixels) { + long __functionAddress = GL.getICD().glTexSubImage1D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, xoffset, width, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexSubImage1D TexSubImage1D} + * + * @see Reference Page + */ + public static void glTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") double[] pixels) { + long __functionAddress = GL.getICD().glTexSubImage1D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, xoffset, width, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexSubImage2D TexSubImage2D} + * + * @see Reference Page + */ + public static void glTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] pixels) { + long __functionAddress = GL.getICD().glTexSubImage2D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, xoffset, yoffset, width, height, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexSubImage2D TexSubImage2D} + * + * @see Reference Page + */ + public static void glTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] pixels) { + long __functionAddress = GL.getICD().glTexSubImage2D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, xoffset, yoffset, width, height, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexSubImage2D TexSubImage2D} + * + * @see Reference Page + */ + public static void glTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] pixels) { + long __functionAddress = GL.getICD().glTexSubImage2D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, xoffset, yoffset, width, height, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexSubImage2D TexSubImage2D} + * + * @see Reference Page + */ + public static void glTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") double[] pixels) { + long __functionAddress = GL.getICD().glTexSubImage2D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, xoffset, yoffset, width, height, format, type, pixels, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL12.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL12.java new file mode 100644 index 00000000..e86ac6e8 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL12.java @@ -0,0 +1,742 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * The OpenGL functionality up to version 1.2. Includes the deprecated symbols of the Compatibility Profile. + * + *

Extensions promoted to core in this release:

+ * + * + * + *

Extensions part of the imaging subset:

+ * + * + */ +public class GL12 extends GL11 { + + /** Aliases for smooth points and lines. */ + public static final int + GL_ALIASED_POINT_SIZE_RANGE = 0x846D, + GL_ALIASED_LINE_WIDTH_RANGE = 0x846E, + GL_SMOOTH_POINT_SIZE_RANGE = 0xB12, + GL_SMOOTH_POINT_SIZE_GRANULARITY = 0xB13, + GL_SMOOTH_LINE_WIDTH_RANGE = 0xB22, + GL_SMOOTH_LINE_WIDTH_GRANULARITY = 0xB23; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_TEXTURE_BINDING_3D = 0x806A; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev, and by the {@code pname} parameter of PixelStore. */ + public static final int + GL_PACK_SKIP_IMAGES = 0x806B, + GL_PACK_IMAGE_HEIGHT = 0x806C, + GL_UNPACK_SKIP_IMAGES = 0x806D, + GL_UNPACK_IMAGE_HEIGHT = 0x806E; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev, and by the {@code target} parameter of TexImage3D, GetTexImage, GetTexLevelParameteriv, GetTexLevelParameterfv, GetTexParameteriv, and + * GetTexParameterfv. + */ + public static final int GL_TEXTURE_3D = 0x806F; + + /** Accepted by the {@code target} parameter of TexImage3D, GetTexLevelParameteriv, and GetTexLevelParameterfv. */ + public static final int GL_PROXY_TEXTURE_3D = 0x8070; + + /** Accepted by the {@code pname} parameter of GetTexLevelParameteriv and GetTexLevelParameterfv. */ + public static final int GL_TEXTURE_DEPTH = 0x8071; + + /** Accepted by the {@code pname} parameter of TexParameteriv, TexParameterfv, GetTexParameteriv, and GetTexParameterfv. */ + public static final int GL_TEXTURE_WRAP_R = 0x8072; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_MAX_3D_TEXTURE_SIZE = 0x8073; + + /** Accepted by the {@code format} parameter of DrawPixels, GetTexImage, ReadPixels, TexImage1D, and TexImage2D. */ + public static final int + GL_BGR = 0x80E0, + GL_BGRA = 0x80E1; + + /** + * Accepted by the {@code type} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, GetTexImage, TexImage3D, TexSubImage1D, TexSubImage2D, + * TexSubImage3D, GetHistogram, GetMinmax, ConvolutionFilter1D, ConvolutionFilter2D, ConvolutionFilter3D, GetConvolutionFilter, SeparableFilter2D, + * SeparableFilter3D, GetSeparableFilter, ColorTable, GetColorTable, TexImage4D, and TexSubImage4D. + */ + public static final int + GL_UNSIGNED_BYTE_3_3_2 = 0x8032, + GL_UNSIGNED_BYTE_2_3_3_REV = 0x8362, + GL_UNSIGNED_SHORT_5_6_5 = 0x8363, + GL_UNSIGNED_SHORT_5_6_5_REV = 0x8364, + GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033, + GL_UNSIGNED_SHORT_4_4_4_4_REV = 0x8365, + GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034, + GL_UNSIGNED_SHORT_1_5_5_5_REV = 0x8366, + GL_UNSIGNED_INT_8_8_8_8 = 0x8035, + GL_UNSIGNED_INT_8_8_8_8_REV = 0x8367, + GL_UNSIGNED_INT_10_10_10_2 = 0x8036, + GL_UNSIGNED_INT_2_10_10_10_REV = 0x8368; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_RESCALE_NORMAL = 0x803A; + + /** Accepted by the {@code pname} parameter of LightModel*, and also by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_LIGHT_MODEL_COLOR_CONTROL = 0x81F8; + + /** Accepted by the {@code param} parameter of LightModel* when {@code pname} is LIGHT_MODEL_COLOR_CONTROL. */ + public static final int + GL_SINGLE_COLOR = 0x81F9, + GL_SEPARATE_SPECULAR_COLOR = 0x81FA; + + /** + * Accepted by the {@code param} parameter of TexParameteri and TexParameterf, and by the {@code params} parameter of TexParameteriv and TexParameterfv, + * when their {@code pname} parameter is TEXTURE_WRAP_S, TEXTURE_WRAP_T, or TEXTURE_WRAP_R. + */ + public static final int GL_CLAMP_TO_EDGE = 0x812F; + + /** Accepted by the {@code pname} parameter of TexParameteri, TexParameterf, TexParameteriv, TexParameterfv, GetTexParameteriv, and GetTexParameterfv. */ + public static final int + GL_TEXTURE_MIN_LOD = 0x813A, + GL_TEXTURE_MAX_LOD = 0x813B, + GL_TEXTURE_BASE_LEVEL = 0x813C, + GL_TEXTURE_MAX_LEVEL = 0x813D; + + /** Recommended maximum amounts of vertex and index data. */ + public static final int + GL_MAX_ELEMENTS_VERTICES = 0x80E8, + GL_MAX_ELEMENTS_INDICES = 0x80E9; + + static { GL.initialize(); } + + protected GL12() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glTexImage3D, caps.glTexSubImage3D, caps.glCopyTexSubImage3D, caps.glDrawRangeElements + ); + } + + // --- [ glTexImage3D ] --- + + /** Unsafe version of: {@link #glTexImage3D TexImage3D} */ + public static void nglTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int format, int type, long pixels) { + GL12C.nglTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels); + } + + /** + * Specifies a three-dimensional texture image. + * + * @param target the texture target. One of:
{@link GL12C#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL12C#GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link GL11#GL_RED RED}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param depth the texture depth + * @param border the texture border width + * @param format the texel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12C#GL_BGR BGR}
{@link GL12C#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12C#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12C#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12C#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12C#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12C#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12C#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12C#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer pixels) { + GL12C.glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels); + } + + /** + * Specifies a three-dimensional texture image. + * + * @param target the texture target. One of:
{@link GL12C#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL12C#GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link GL11#GL_RED RED}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param depth the texture depth + * @param border the texture border width + * @param format the texel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12C#GL_BGR BGR}
{@link GL12C#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12C#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12C#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12C#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12C#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12C#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12C#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12C#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") long pixels) { + GL12C.glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels); + } + + /** + * Specifies a three-dimensional texture image. + * + * @param target the texture target. One of:
{@link GL12C#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL12C#GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link GL11#GL_RED RED}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param depth the texture depth + * @param border the texture border width + * @param format the texel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12C#GL_BGR BGR}
{@link GL12C#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12C#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12C#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12C#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12C#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12C#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12C#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12C#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer pixels) { + GL12C.glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels); + } + + /** + * Specifies a three-dimensional texture image. + * + * @param target the texture target. One of:
{@link GL12C#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL12C#GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link GL11#GL_RED RED}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param depth the texture depth + * @param border the texture border width + * @param format the texel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12C#GL_BGR BGR}
{@link GL12C#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12C#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12C#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12C#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12C#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12C#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12C#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12C#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer pixels) { + GL12C.glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels); + } + + /** + * Specifies a three-dimensional texture image. + * + * @param target the texture target. One of:
{@link GL12C#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL12C#GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link GL11#GL_RED RED}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param depth the texture depth + * @param border the texture border width + * @param format the texel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12C#GL_BGR BGR}
{@link GL12C#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12C#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12C#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12C#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12C#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12C#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12C#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12C#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer pixels) { + GL12C.glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels); + } + + /** + * Specifies a three-dimensional texture image. + * + * @param target the texture target. One of:
{@link GL12C#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL12C#GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link GL11#GL_RED RED}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param depth the texture depth + * @param border the texture border width + * @param format the texel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12C#GL_BGR BGR}
{@link GL12C#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12C#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12C#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12C#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12C#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12C#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12C#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12C#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") DoubleBuffer pixels) { + GL12C.glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels); + } + + // --- [ glTexSubImage3D ] --- + + /** Unsafe version of: {@link #glTexSubImage3D TexSubImage3D} */ + public static void nglTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, long pixels) { + GL12C.nglTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Respecifies a cubic subregion of an existing 3D texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link GL12C#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12C#GL_BGR BGR}
{@link GL12C#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12C#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12C#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12C#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12C#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12C#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12C#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12C#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer pixels) { + GL12C.glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Respecifies a cubic subregion of an existing 3D texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link GL12C#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12C#GL_BGR BGR}
{@link GL12C#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12C#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12C#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12C#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12C#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12C#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12C#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12C#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long pixels) { + GL12C.glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Respecifies a cubic subregion of an existing 3D texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link GL12C#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12C#GL_BGR BGR}
{@link GL12C#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12C#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12C#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12C#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12C#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12C#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12C#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12C#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer pixels) { + GL12C.glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Respecifies a cubic subregion of an existing 3D texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link GL12C#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12C#GL_BGR BGR}
{@link GL12C#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12C#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12C#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12C#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12C#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12C#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12C#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12C#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer pixels) { + GL12C.glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Respecifies a cubic subregion of an existing 3D texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link GL12C#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12C#GL_BGR BGR}
{@link GL12C#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12C#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12C#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12C#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12C#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12C#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12C#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12C#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer pixels) { + GL12C.glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Respecifies a cubic subregion of an existing 3D texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link GL12C#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12C#GL_BGR BGR}
{@link GL12C#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12C#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12C#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12C#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12C#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12C#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12C#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12C#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12C#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12C#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12C#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") DoubleBuffer pixels) { + GL12C.glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + // --- [ glCopyTexSubImage3D ] --- + + /** + * Respecifies a rectangular subregion of a slice of an existing 3D texel array. No change is made to the {@code internalformat}, {@code width}, + * {@code height}, or {@code border} parameters of the specified texel array, nor is any change made to texel values outside the specified subregion. See + * {@link GL11C#glCopyTexImage2D CopyTexImage2D} for more details. + * + * @param target the texture target. One of:
{@link GL12C#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number + * @param xoffset the x coordinate of the texture subregion to update + * @param yoffset the y coordinate of the texture subregion to update + * @param zoffset the z coordinate of the texture subregion to update + * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the texture subregion width + * @param height the texture subregion height + * + * @see Reference Page + */ + public static void glCopyTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL12C.glCopyTexSubImage3D(target, level, xoffset, yoffset, zoffset, x, y, width, height); + } + + // --- [ glDrawRangeElements ] --- + + /** + * Unsafe version of: {@link #glDrawRangeElements DrawRangeElements} + * + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static void nglDrawRangeElements(int mode, int start, int end, int count, int type, long indices) { + GL12C.nglDrawRangeElements(mode, start, end, count, type, indices); + } + + /** + * A restricted form of {@link GL11C#glDrawElements DrawElements}. mode, start, end, and count match the corresponding arguments to glDrawElements, with the additional + * constraint that all values in the arrays count must lie between start and end, inclusive. + * + *

Implementations denote recommended maximum amounts of vertex and index data, which may be queried by calling glGet with argument + * {@link GL12C#GL_MAX_ELEMENTS_VERTICES MAX_ELEMENTS_VERTICES} and {@link GL12C#GL_MAX_ELEMENTS_INDICES MAX_ELEMENTS_INDICES}. If end - start + 1 is greater than the value of GL_MAX_ELEMENTS_VERTICES, or if + * count is greater than the value of GL_MAX_ELEMENTS_INDICES, then the call may operate at reduced performance. There is no requirement that all vertices + * in the range start end be referenced. However, the implementation may partially process unused vertices, reducing performance from what could be + * achieved with an optimal index set.

+ * + *

When glDrawRangeElements is called, it uses count sequential elements from an enabled array, starting at start to construct a sequence of geometric + * primitives. mode specifies what kind of primitives are constructed, and how the array elements construct these primitives. If more than one array is + * enabled, each is used.

+ * + *

Vertex attributes that are modified by glDrawRangeElements have an unspecified value after glDrawRangeElements returns. Attributes that aren't modified + * maintain their previous values.

+ * + *
Errors
+ * + *

It is an error for indices to lie outside the range start end, but implementations may not check for this situation. Such indices cause + * implementation-dependent behavior.

+ * + *
    + *
  • GL_INVALID_ENUM is generated if mode is not an accepted value.
  • + *
  • GL_INVALID_VALUE is generated if count is negative.
  • + *
  • GL_INVALID_VALUE is generated if end < start.
  • + *
  • GL_INVALID_OPERATION is generated if a geometry shader is active and mode is incompatible with the input primitive type of the geometry shader in the + * currently installed program object.
  • + *
  • GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array or the element array and the buffer object's data + * store is currently mapped.
  • + *
+ * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * + * @see Reference Page + */ + public static void glDrawRangeElements(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices) { + GL12C.glDrawRangeElements(mode, start, end, count, type, indices); + } + + /** + * A restricted form of {@link GL11C#glDrawElements DrawElements}. mode, start, end, and count match the corresponding arguments to glDrawElements, with the additional + * constraint that all values in the arrays count must lie between start and end, inclusive. + * + *

Implementations denote recommended maximum amounts of vertex and index data, which may be queried by calling glGet with argument + * {@link GL12C#GL_MAX_ELEMENTS_VERTICES MAX_ELEMENTS_VERTICES} and {@link GL12C#GL_MAX_ELEMENTS_INDICES MAX_ELEMENTS_INDICES}. If end - start + 1 is greater than the value of GL_MAX_ELEMENTS_VERTICES, or if + * count is greater than the value of GL_MAX_ELEMENTS_INDICES, then the call may operate at reduced performance. There is no requirement that all vertices + * in the range start end be referenced. However, the implementation may partially process unused vertices, reducing performance from what could be + * achieved with an optimal index set.

+ * + *

When glDrawRangeElements is called, it uses count sequential elements from an enabled array, starting at start to construct a sequence of geometric + * primitives. mode specifies what kind of primitives are constructed, and how the array elements construct these primitives. If more than one array is + * enabled, each is used.

+ * + *

Vertex attributes that are modified by glDrawRangeElements have an unspecified value after glDrawRangeElements returns. Attributes that aren't modified + * maintain their previous values.

+ * + *
Errors
+ * + *

It is an error for indices to lie outside the range start end, but implementations may not check for this situation. Such indices cause + * implementation-dependent behavior.

+ * + *
    + *
  • GL_INVALID_ENUM is generated if mode is not an accepted value.
  • + *
  • GL_INVALID_VALUE is generated if count is negative.
  • + *
  • GL_INVALID_VALUE is generated if end < start.
  • + *
  • GL_INVALID_OPERATION is generated if a geometry shader is active and mode is incompatible with the input primitive type of the geometry shader in the + * currently installed program object.
  • + *
  • GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array or the element array and the buffer object's data + * store is currently mapped.
  • + *
+ * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * + * @see Reference Page + */ + public static void glDrawRangeElements(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices) { + GL12C.glDrawRangeElements(mode, start, end, type, indices); + } + + /** + * A restricted form of {@link GL11C#glDrawElements DrawElements}. mode, start, end, and count match the corresponding arguments to glDrawElements, with the additional + * constraint that all values in the arrays count must lie between start and end, inclusive. + * + *

Implementations denote recommended maximum amounts of vertex and index data, which may be queried by calling glGet with argument + * {@link GL12C#GL_MAX_ELEMENTS_VERTICES MAX_ELEMENTS_VERTICES} and {@link GL12C#GL_MAX_ELEMENTS_INDICES MAX_ELEMENTS_INDICES}. If end - start + 1 is greater than the value of GL_MAX_ELEMENTS_VERTICES, or if + * count is greater than the value of GL_MAX_ELEMENTS_INDICES, then the call may operate at reduced performance. There is no requirement that all vertices + * in the range start end be referenced. However, the implementation may partially process unused vertices, reducing performance from what could be + * achieved with an optimal index set.

+ * + *

When glDrawRangeElements is called, it uses count sequential elements from an enabled array, starting at start to construct a sequence of geometric + * primitives. mode specifies what kind of primitives are constructed, and how the array elements construct these primitives. If more than one array is + * enabled, each is used.

+ * + *

Vertex attributes that are modified by glDrawRangeElements have an unspecified value after glDrawRangeElements returns. Attributes that aren't modified + * maintain their previous values.

+ * + *
Errors
+ * + *

It is an error for indices to lie outside the range start end, but implementations may not check for this situation. Such indices cause + * implementation-dependent behavior.

+ * + *
    + *
  • GL_INVALID_ENUM is generated if mode is not an accepted value.
  • + *
  • GL_INVALID_VALUE is generated if count is negative.
  • + *
  • GL_INVALID_VALUE is generated if end < start.
  • + *
  • GL_INVALID_OPERATION is generated if a geometry shader is active and mode is incompatible with the input primitive type of the geometry shader in the + * currently installed program object.
  • + *
  • GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array or the element array and the buffer object's data + * store is currently mapped.
  • + *
+ * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param indices a pointer to the location where the indices are stored + * + * @see Reference Page + */ + public static void glDrawRangeElements(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("void const *") ByteBuffer indices) { + GL12C.glDrawRangeElements(mode, start, end, indices); + } + + /** + * A restricted form of {@link GL11C#glDrawElements DrawElements}. mode, start, end, and count match the corresponding arguments to glDrawElements, with the additional + * constraint that all values in the arrays count must lie between start and end, inclusive. + * + *

Implementations denote recommended maximum amounts of vertex and index data, which may be queried by calling glGet with argument + * {@link GL12C#GL_MAX_ELEMENTS_VERTICES MAX_ELEMENTS_VERTICES} and {@link GL12C#GL_MAX_ELEMENTS_INDICES MAX_ELEMENTS_INDICES}. If end - start + 1 is greater than the value of GL_MAX_ELEMENTS_VERTICES, or if + * count is greater than the value of GL_MAX_ELEMENTS_INDICES, then the call may operate at reduced performance. There is no requirement that all vertices + * in the range start end be referenced. However, the implementation may partially process unused vertices, reducing performance from what could be + * achieved with an optimal index set.

+ * + *

When glDrawRangeElements is called, it uses count sequential elements from an enabled array, starting at start to construct a sequence of geometric + * primitives. mode specifies what kind of primitives are constructed, and how the array elements construct these primitives. If more than one array is + * enabled, each is used.

+ * + *

Vertex attributes that are modified by glDrawRangeElements have an unspecified value after glDrawRangeElements returns. Attributes that aren't modified + * maintain their previous values.

+ * + *
Errors
+ * + *

It is an error for indices to lie outside the range start end, but implementations may not check for this situation. Such indices cause + * implementation-dependent behavior.

+ * + *
    + *
  • GL_INVALID_ENUM is generated if mode is not an accepted value.
  • + *
  • GL_INVALID_VALUE is generated if count is negative.
  • + *
  • GL_INVALID_VALUE is generated if end < start.
  • + *
  • GL_INVALID_OPERATION is generated if a geometry shader is active and mode is incompatible with the input primitive type of the geometry shader in the + * currently installed program object.
  • + *
  • GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array or the element array and the buffer object's data + * store is currently mapped.
  • + *
+ * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param indices a pointer to the location where the indices are stored + * + * @see Reference Page + */ + public static void glDrawRangeElements(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("void const *") ShortBuffer indices) { + GL12C.glDrawRangeElements(mode, start, end, indices); + } + + /** + * A restricted form of {@link GL11C#glDrawElements DrawElements}. mode, start, end, and count match the corresponding arguments to glDrawElements, with the additional + * constraint that all values in the arrays count must lie between start and end, inclusive. + * + *

Implementations denote recommended maximum amounts of vertex and index data, which may be queried by calling glGet with argument + * {@link GL12C#GL_MAX_ELEMENTS_VERTICES MAX_ELEMENTS_VERTICES} and {@link GL12C#GL_MAX_ELEMENTS_INDICES MAX_ELEMENTS_INDICES}. If end - start + 1 is greater than the value of GL_MAX_ELEMENTS_VERTICES, or if + * count is greater than the value of GL_MAX_ELEMENTS_INDICES, then the call may operate at reduced performance. There is no requirement that all vertices + * in the range start end be referenced. However, the implementation may partially process unused vertices, reducing performance from what could be + * achieved with an optimal index set.

+ * + *

When glDrawRangeElements is called, it uses count sequential elements from an enabled array, starting at start to construct a sequence of geometric + * primitives. mode specifies what kind of primitives are constructed, and how the array elements construct these primitives. If more than one array is + * enabled, each is used.

+ * + *

Vertex attributes that are modified by glDrawRangeElements have an unspecified value after glDrawRangeElements returns. Attributes that aren't modified + * maintain their previous values.

+ * + *
Errors
+ * + *

It is an error for indices to lie outside the range start end, but implementations may not check for this situation. Such indices cause + * implementation-dependent behavior.

+ * + *
    + *
  • GL_INVALID_ENUM is generated if mode is not an accepted value.
  • + *
  • GL_INVALID_VALUE is generated if count is negative.
  • + *
  • GL_INVALID_VALUE is generated if end < start.
  • + *
  • GL_INVALID_OPERATION is generated if a geometry shader is active and mode is incompatible with the input primitive type of the geometry shader in the + * currently installed program object.
  • + *
  • GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array or the element array and the buffer object's data + * store is currently mapped.
  • + *
+ * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param indices a pointer to the location where the indices are stored + * + * @see Reference Page + */ + public static void glDrawRangeElements(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("void const *") IntBuffer indices) { + GL12C.glDrawRangeElements(mode, start, end, indices); + } + + /** + * Array version of: {@link #glTexImage3D TexImage3D} + * + * @see Reference Page + */ + public static void glTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] pixels) { + GL12C.glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels); + } + + /** + * Array version of: {@link #glTexImage3D TexImage3D} + * + * @see Reference Page + */ + public static void glTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] pixels) { + GL12C.glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels); + } + + /** + * Array version of: {@link #glTexImage3D TexImage3D} + * + * @see Reference Page + */ + public static void glTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] pixels) { + GL12C.glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels); + } + + /** + * Array version of: {@link #glTexImage3D TexImage3D} + * + * @see Reference Page + */ + public static void glTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") double[] pixels) { + GL12C.glTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels); + } + + /** + * Array version of: {@link #glTexSubImage3D TexSubImage3D} + * + * @see Reference Page + */ + public static void glTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] pixels) { + GL12C.glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Array version of: {@link #glTexSubImage3D TexSubImage3D} + * + * @see Reference Page + */ + public static void glTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] pixels) { + GL12C.glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Array version of: {@link #glTexSubImage3D TexSubImage3D} + * + * @see Reference Page + */ + public static void glTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] pixels) { + GL12C.glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Array version of: {@link #glTexSubImage3D TexSubImage3D} + * + * @see Reference Page + */ + public static void glTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") double[] pixels) { + GL12C.glTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL12C.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL12C.java new file mode 100644 index 00000000..5c68a240 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL12C.java @@ -0,0 +1,745 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality of a forward compatible context, up to version 1.2. + * + *

Extensions promoted to core in this release:

+ * + * + * + *

Extensions part of the imaging subset:

+ * + * + */ +public class GL12C extends GL11C { + + /** Aliases for smooth points and lines. */ + public static final int + GL_ALIASED_LINE_WIDTH_RANGE = 0x846E, + GL_SMOOTH_POINT_SIZE_RANGE = 0xB12, + GL_SMOOTH_POINT_SIZE_GRANULARITY = 0xB13, + GL_SMOOTH_LINE_WIDTH_RANGE = 0xB22, + GL_SMOOTH_LINE_WIDTH_GRANULARITY = 0xB23; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_TEXTURE_BINDING_3D = 0x806A; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev, and by the {@code pname} parameter of PixelStore. */ + public static final int + GL_PACK_SKIP_IMAGES = 0x806B, + GL_PACK_IMAGE_HEIGHT = 0x806C, + GL_UNPACK_SKIP_IMAGES = 0x806D, + GL_UNPACK_IMAGE_HEIGHT = 0x806E; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev, and by the {@code target} parameter of TexImage3D, GetTexImage, GetTexLevelParameteriv, GetTexLevelParameterfv, GetTexParameteriv, and + * GetTexParameterfv. + */ + public static final int GL_TEXTURE_3D = 0x806F; + + /** Accepted by the {@code target} parameter of TexImage3D, GetTexLevelParameteriv, and GetTexLevelParameterfv. */ + public static final int GL_PROXY_TEXTURE_3D = 0x8070; + + /** Accepted by the {@code pname} parameter of GetTexLevelParameteriv and GetTexLevelParameterfv. */ + public static final int GL_TEXTURE_DEPTH = 0x8071; + + /** Accepted by the {@code pname} parameter of TexParameteriv, TexParameterfv, GetTexParameteriv, and GetTexParameterfv. */ + public static final int GL_TEXTURE_WRAP_R = 0x8072; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_MAX_3D_TEXTURE_SIZE = 0x8073; + + /** Accepted by the {@code format} parameter of DrawPixels, GetTexImage, ReadPixels, TexImage1D, and TexImage2D. */ + public static final int + GL_BGR = 0x80E0, + GL_BGRA = 0x80E1; + + /** + * Accepted by the {@code type} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, GetTexImage, TexImage3D, TexSubImage1D, TexSubImage2D, + * TexSubImage3D, GetHistogram, GetMinmax, ConvolutionFilter1D, ConvolutionFilter2D, ConvolutionFilter3D, GetConvolutionFilter, SeparableFilter2D, + * SeparableFilter3D, GetSeparableFilter, ColorTable, GetColorTable, TexImage4D, and TexSubImage4D. + */ + public static final int + GL_UNSIGNED_BYTE_3_3_2 = 0x8032, + GL_UNSIGNED_BYTE_2_3_3_REV = 0x8362, + GL_UNSIGNED_SHORT_5_6_5 = 0x8363, + GL_UNSIGNED_SHORT_5_6_5_REV = 0x8364, + GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033, + GL_UNSIGNED_SHORT_4_4_4_4_REV = 0x8365, + GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034, + GL_UNSIGNED_SHORT_1_5_5_5_REV = 0x8366, + GL_UNSIGNED_INT_8_8_8_8 = 0x8035, + GL_UNSIGNED_INT_8_8_8_8_REV = 0x8367, + GL_UNSIGNED_INT_10_10_10_2 = 0x8036, + GL_UNSIGNED_INT_2_10_10_10_REV = 0x8368; + + /** + * Accepted by the {@code param} parameter of TexParameteri and TexParameterf, and by the {@code params} parameter of TexParameteriv and TexParameterfv, + * when their {@code pname} parameter is TEXTURE_WRAP_S, TEXTURE_WRAP_T, or TEXTURE_WRAP_R. + */ + public static final int GL_CLAMP_TO_EDGE = 0x812F; + + /** Accepted by the {@code pname} parameter of TexParameteri, TexParameterf, TexParameteriv, TexParameterfv, GetTexParameteriv, and GetTexParameterfv. */ + public static final int + GL_TEXTURE_MIN_LOD = 0x813A, + GL_TEXTURE_MAX_LOD = 0x813B, + GL_TEXTURE_BASE_LEVEL = 0x813C, + GL_TEXTURE_MAX_LEVEL = 0x813D; + + /** Recommended maximum amounts of vertex and index data. */ + public static final int + GL_MAX_ELEMENTS_VERTICES = 0x80E8, + GL_MAX_ELEMENTS_INDICES = 0x80E9; + + static { GL.initialize(); } + + protected GL12C() { + throw new UnsupportedOperationException(); + } + + // --- [ glTexImage3D ] --- + + /** Unsafe version of: {@link #glTexImage3D TexImage3D} */ + public static native void nglTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int format, int type, long pixels); + + /** + * Specifies a three-dimensional texture image. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link #GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link GL11#GL_RED RED}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param depth the texture depth + * @param border the texture border width + * @param format the texel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link #GL_BGR BGR}
{@link #GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link #GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link #GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link #GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link #GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link #GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link #GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link #GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link #GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link #GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link #GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link #GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link #GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer pixels) { + nglTexImage3D(target, level, internalformat, width, height, depth, border, format, type, memAddressSafe(pixels)); + } + + /** + * Specifies a three-dimensional texture image. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link #GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link GL11#GL_RED RED}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param depth the texture depth + * @param border the texture border width + * @param format the texel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link #GL_BGR BGR}
{@link #GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link #GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link #GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link #GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link #GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link #GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link #GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link #GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link #GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link #GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link #GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link #GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link #GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") long pixels) { + nglTexImage3D(target, level, internalformat, width, height, depth, border, format, type, pixels); + } + + /** + * Specifies a three-dimensional texture image. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link #GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link GL11#GL_RED RED}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param depth the texture depth + * @param border the texture border width + * @param format the texel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link #GL_BGR BGR}
{@link #GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link #GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link #GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link #GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link #GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link #GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link #GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link #GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link #GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link #GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link #GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link #GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link #GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer pixels) { + nglTexImage3D(target, level, internalformat, width, height, depth, border, format, type, memAddressSafe(pixels)); + } + + /** + * Specifies a three-dimensional texture image. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link #GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link GL11#GL_RED RED}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param depth the texture depth + * @param border the texture border width + * @param format the texel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link #GL_BGR BGR}
{@link #GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link #GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link #GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link #GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link #GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link #GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link #GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link #GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link #GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link #GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link #GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link #GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link #GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer pixels) { + nglTexImage3D(target, level, internalformat, width, height, depth, border, format, type, memAddressSafe(pixels)); + } + + /** + * Specifies a three-dimensional texture image. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link #GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link GL11#GL_RED RED}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param depth the texture depth + * @param border the texture border width + * @param format the texel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link #GL_BGR BGR}
{@link #GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link #GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link #GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link #GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link #GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link #GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link #GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link #GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link #GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link #GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link #GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link #GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link #GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer pixels) { + nglTexImage3D(target, level, internalformat, width, height, depth, border, format, type, memAddressSafe(pixels)); + } + + /** + * Specifies a three-dimensional texture image. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link #GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number + * @param internalformat the texture internal format. One of:
{@link GL11#GL_RED RED}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
{@link GL30#GL_R8 R8}{@link GL31#GL_R8_SNORM R8_SNORM}{@link GL30#GL_R16 R16}{@link GL31#GL_R16_SNORM R16_SNORM}{@link GL30#GL_RG8 RG8}{@link GL31#GL_RG8_SNORM RG8_SNORM}
{@link GL30#GL_RG16 RG16}{@link GL31#GL_RG16_SNORM RG16_SNORM}{@link GL11#GL_R3_G3_B2 R3_G3_B2}{@link GL11#GL_RGB4 RGB4}{@link GL11#GL_RGB5 RGB5}{@link GL41#GL_RGB565 RGB565}
{@link GL11#GL_RGB8 RGB8}{@link GL31#GL_RGB8_SNORM RGB8_SNORM}{@link GL11#GL_RGB10 RGB10}{@link GL11#GL_RGB12 RGB12}{@link GL11#GL_RGB16 RGB16}{@link GL31#GL_RGB16_SNORM RGB16_SNORM}
{@link GL11#GL_RGBA2 RGBA2}{@link GL11#GL_RGBA4 RGBA4}{@link GL11#GL_RGB5_A1 RGB5_A1}{@link GL11#GL_RGBA8 RGBA8}{@link GL31#GL_RGBA8_SNORM RGBA8_SNORM}{@link GL11#GL_RGB10_A2 RGB10_A2}
{@link GL33#GL_RGB10_A2UI RGB10_A2UI}{@link GL11#GL_RGBA12 RGBA12}{@link GL11#GL_RGBA16 RGBA16}{@link GL31#GL_RGBA16_SNORM RGBA16_SNORM}{@link GL21#GL_SRGB8 SRGB8}{@link GL21#GL_SRGB8_ALPHA8 SRGB8_ALPHA8}
{@link GL30#GL_R16F R16F}{@link GL30#GL_RG16F RG16F}{@link GL30#GL_RGB16F RGB16F}{@link GL30#GL_RGBA16F RGBA16F}{@link GL30#GL_R32F R32F}{@link GL30#GL_RG32F RG32F}
{@link GL30#GL_RGB32F RGB32F}{@link GL30#GL_RGBA32F RGBA32F}{@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F}{@link GL30#GL_RGB9_E5 RGB9_E5}{@link GL30#GL_R8I R8I}{@link GL30#GL_R8UI R8UI}
{@link GL30#GL_R16I R16I}{@link GL30#GL_R16UI R16UI}{@link GL30#GL_R32I R32I}{@link GL30#GL_R32UI R32UI}{@link GL30#GL_RG8I RG8I}{@link GL30#GL_RG8UI RG8UI}
{@link GL30#GL_RG16I RG16I}{@link GL30#GL_RG16UI RG16UI}{@link GL30#GL_RG32I RG32I}{@link GL30#GL_RG32UI RG32UI}{@link GL30#GL_RGB8I RGB8I}{@link GL30#GL_RGB8UI RGB8UI}
{@link GL30#GL_RGB16I RGB16I}{@link GL30#GL_RGB16UI RGB16UI}{@link GL30#GL_RGB32I RGB32I}{@link GL30#GL_RGB32UI RGB32UI}{@link GL30#GL_RGBA8I RGBA8I}{@link GL30#GL_RGBA8UI RGBA8UI}
{@link GL30#GL_RGBA16I RGBA16I}{@link GL30#GL_RGBA16UI RGBA16UI}{@link GL30#GL_RGBA32I RGBA32I}{@link GL30#GL_RGBA32UI RGBA32UI}{@link GL14#GL_DEPTH_COMPONENT16 DEPTH_COMPONENT16}{@link GL14#GL_DEPTH_COMPONENT24 DEPTH_COMPONENT24}
{@link GL14#GL_DEPTH_COMPONENT32 DEPTH_COMPONENT32}{@link GL30#GL_DEPTH24_STENCIL8 DEPTH24_STENCIL8}{@link GL30#GL_DEPTH_COMPONENT32F DEPTH_COMPONENT32F}{@link GL30#GL_DEPTH32F_STENCIL8 DEPTH32F_STENCIL8}{@link GL30#GL_COMPRESSED_RED COMPRESSED_RED}{@link GL30#GL_COMPRESSED_RG COMPRESSED_RG}
{@link GL13#GL_COMPRESSED_RGB COMPRESSED_RGB}{@link GL13#GL_COMPRESSED_RGBA COMPRESSED_RGBA}{@link GL21#GL_COMPRESSED_SRGB COMPRESSED_SRGB}{@link GL21#GL_COMPRESSED_SRGB_ALPHA COMPRESSED_SRGB_ALPHA}{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}
+ * @param width the texture width + * @param height the texture height + * @param depth the texture depth + * @param border the texture border width + * @param format the texel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link #GL_BGR BGR}
{@link #GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the texel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link #GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link #GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link #GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link #GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link #GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link #GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link #GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link #GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link #GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link #GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link #GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link #GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the texel data + * + * @see Reference Page + */ + public static void glTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") DoubleBuffer pixels) { + nglTexImage3D(target, level, internalformat, width, height, depth, border, format, type, memAddressSafe(pixels)); + } + + // --- [ glTexSubImage3D ] --- + + /** Unsafe version of: {@link #glTexSubImage3D TexSubImage3D} */ + public static native void nglTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, long pixels); + + /** + * Respecifies a cubic subregion of an existing 3D texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link #GL_BGR BGR}
{@link #GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link #GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link #GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link #GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link #GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link #GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link #GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link #GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link #GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link #GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link #GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link #GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link #GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer pixels) { + nglTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddress(pixels)); + } + + /** + * Respecifies a cubic subregion of an existing 3D texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link #GL_BGR BGR}
{@link #GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link #GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link #GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link #GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link #GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link #GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link #GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link #GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link #GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link #GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link #GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link #GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link #GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long pixels) { + nglTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Respecifies a cubic subregion of an existing 3D texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link #GL_BGR BGR}
{@link #GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link #GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link #GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link #GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link #GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link #GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link #GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link #GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link #GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link #GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link #GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link #GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link #GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer pixels) { + nglTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddress(pixels)); + } + + /** + * Respecifies a cubic subregion of an existing 3D texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link #GL_BGR BGR}
{@link #GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link #GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link #GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link #GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link #GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link #GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link #GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link #GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link #GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link #GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link #GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link #GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link #GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer pixels) { + nglTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddress(pixels)); + } + + /** + * Respecifies a cubic subregion of an existing 3D texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link #GL_BGR BGR}
{@link #GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link #GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link #GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link #GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link #GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link #GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link #GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link #GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link #GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link #GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link #GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link #GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link #GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer pixels) { + nglTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddress(pixels)); + } + + /** + * Respecifies a cubic subregion of an existing 3D texel array. No change is made to the internalformat, width, height, depth, or border parameters of + * the specified texel array, nor is any change made to texel values outside the specified subregion. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link #GL_BGR BGR}
{@link #GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link #GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link #GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link #GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link #GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link #GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link #GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link #GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link #GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link #GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link #GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link #GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link #GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") DoubleBuffer pixels) { + nglTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddress(pixels)); + } + + // --- [ glCopyTexSubImage3D ] --- + + /** + * Respecifies a rectangular subregion of a slice of an existing 3D texel array. No change is made to the {@code internalformat}, {@code width}, + * {@code height}, or {@code border} parameters of the specified texel array, nor is any change made to texel values outside the specified subregion. See + * {@link GL11C#glCopyTexImage2D CopyTexImage2D} for more details. + * + * @param target the texture target. One of:
{@link #GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number + * @param xoffset the x coordinate of the texture subregion to update + * @param yoffset the y coordinate of the texture subregion to update + * @param zoffset the z coordinate of the texture subregion to update + * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the texture subregion width + * @param height the texture subregion height + * + * @see Reference Page + */ + public static native void glCopyTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glDrawRangeElements ] --- + + /** + * Unsafe version of: {@link #glDrawRangeElements DrawRangeElements} + * + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static native void nglDrawRangeElements(int mode, int start, int end, int count, int type, long indices); + + /** + * A restricted form of {@link GL11C#glDrawElements DrawElements}. mode, start, end, and count match the corresponding arguments to glDrawElements, with the additional + * constraint that all values in the arrays count must lie between start and end, inclusive. + * + *

Implementations denote recommended maximum amounts of vertex and index data, which may be queried by calling glGet with argument + * {@link #GL_MAX_ELEMENTS_VERTICES MAX_ELEMENTS_VERTICES} and {@link #GL_MAX_ELEMENTS_INDICES MAX_ELEMENTS_INDICES}. If end - start + 1 is greater than the value of GL_MAX_ELEMENTS_VERTICES, or if + * count is greater than the value of GL_MAX_ELEMENTS_INDICES, then the call may operate at reduced performance. There is no requirement that all vertices + * in the range start end be referenced. However, the implementation may partially process unused vertices, reducing performance from what could be + * achieved with an optimal index set.

+ * + *

When glDrawRangeElements is called, it uses count sequential elements from an enabled array, starting at start to construct a sequence of geometric + * primitives. mode specifies what kind of primitives are constructed, and how the array elements construct these primitives. If more than one array is + * enabled, each is used.

+ * + *

Vertex attributes that are modified by glDrawRangeElements have an unspecified value after glDrawRangeElements returns. Attributes that aren't modified + * maintain their previous values.

+ * + *
Errors
+ * + *

It is an error for indices to lie outside the range start end, but implementations may not check for this situation. Such indices cause + * implementation-dependent behavior.

+ * + *
    + *
  • GL_INVALID_ENUM is generated if mode is not an accepted value.
  • + *
  • GL_INVALID_VALUE is generated if count is negative.
  • + *
  • GL_INVALID_VALUE is generated if end < start.
  • + *
  • GL_INVALID_OPERATION is generated if a geometry shader is active and mode is incompatible with the input primitive type of the geometry shader in the + * currently installed program object.
  • + *
  • GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array or the element array and the buffer object's data + * store is currently mapped.
  • + *
+ * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * + * @see Reference Page + */ + public static void glDrawRangeElements(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices) { + nglDrawRangeElements(mode, start, end, count, type, indices); + } + + /** + * A restricted form of {@link GL11C#glDrawElements DrawElements}. mode, start, end, and count match the corresponding arguments to glDrawElements, with the additional + * constraint that all values in the arrays count must lie between start and end, inclusive. + * + *

Implementations denote recommended maximum amounts of vertex and index data, which may be queried by calling glGet with argument + * {@link #GL_MAX_ELEMENTS_VERTICES MAX_ELEMENTS_VERTICES} and {@link #GL_MAX_ELEMENTS_INDICES MAX_ELEMENTS_INDICES}. If end - start + 1 is greater than the value of GL_MAX_ELEMENTS_VERTICES, or if + * count is greater than the value of GL_MAX_ELEMENTS_INDICES, then the call may operate at reduced performance. There is no requirement that all vertices + * in the range start end be referenced. However, the implementation may partially process unused vertices, reducing performance from what could be + * achieved with an optimal index set.

+ * + *

When glDrawRangeElements is called, it uses count sequential elements from an enabled array, starting at start to construct a sequence of geometric + * primitives. mode specifies what kind of primitives are constructed, and how the array elements construct these primitives. If more than one array is + * enabled, each is used.

+ * + *

Vertex attributes that are modified by glDrawRangeElements have an unspecified value after glDrawRangeElements returns. Attributes that aren't modified + * maintain their previous values.

+ * + *
Errors
+ * + *

It is an error for indices to lie outside the range start end, but implementations may not check for this situation. Such indices cause + * implementation-dependent behavior.

+ * + *
    + *
  • GL_INVALID_ENUM is generated if mode is not an accepted value.
  • + *
  • GL_INVALID_VALUE is generated if count is negative.
  • + *
  • GL_INVALID_VALUE is generated if end < start.
  • + *
  • GL_INVALID_OPERATION is generated if a geometry shader is active and mode is incompatible with the input primitive type of the geometry shader in the + * currently installed program object.
  • + *
  • GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array or the element array and the buffer object's data + * store is currently mapped.
  • + *
+ * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * + * @see Reference Page + */ + public static void glDrawRangeElements(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices) { + nglDrawRangeElements(mode, start, end, indices.remaining() >> GLChecks.typeToByteShift(type), type, memAddress(indices)); + } + + /** + * A restricted form of {@link GL11C#glDrawElements DrawElements}. mode, start, end, and count match the corresponding arguments to glDrawElements, with the additional + * constraint that all values in the arrays count must lie between start and end, inclusive. + * + *

Implementations denote recommended maximum amounts of vertex and index data, which may be queried by calling glGet with argument + * {@link #GL_MAX_ELEMENTS_VERTICES MAX_ELEMENTS_VERTICES} and {@link #GL_MAX_ELEMENTS_INDICES MAX_ELEMENTS_INDICES}. If end - start + 1 is greater than the value of GL_MAX_ELEMENTS_VERTICES, or if + * count is greater than the value of GL_MAX_ELEMENTS_INDICES, then the call may operate at reduced performance. There is no requirement that all vertices + * in the range start end be referenced. However, the implementation may partially process unused vertices, reducing performance from what could be + * achieved with an optimal index set.

+ * + *

When glDrawRangeElements is called, it uses count sequential elements from an enabled array, starting at start to construct a sequence of geometric + * primitives. mode specifies what kind of primitives are constructed, and how the array elements construct these primitives. If more than one array is + * enabled, each is used.

+ * + *

Vertex attributes that are modified by glDrawRangeElements have an unspecified value after glDrawRangeElements returns. Attributes that aren't modified + * maintain their previous values.

+ * + *
Errors
+ * + *

It is an error for indices to lie outside the range start end, but implementations may not check for this situation. Such indices cause + * implementation-dependent behavior.

+ * + *
    + *
  • GL_INVALID_ENUM is generated if mode is not an accepted value.
  • + *
  • GL_INVALID_VALUE is generated if count is negative.
  • + *
  • GL_INVALID_VALUE is generated if end < start.
  • + *
  • GL_INVALID_OPERATION is generated if a geometry shader is active and mode is incompatible with the input primitive type of the geometry shader in the + * currently installed program object.
  • + *
  • GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array or the element array and the buffer object's data + * store is currently mapped.
  • + *
+ * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param indices a pointer to the location where the indices are stored + * + * @see Reference Page + */ + public static void glDrawRangeElements(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("void const *") ByteBuffer indices) { + nglDrawRangeElements(mode, start, end, indices.remaining(), GL11.GL_UNSIGNED_BYTE, memAddress(indices)); + } + + /** + * A restricted form of {@link GL11C#glDrawElements DrawElements}. mode, start, end, and count match the corresponding arguments to glDrawElements, with the additional + * constraint that all values in the arrays count must lie between start and end, inclusive. + * + *

Implementations denote recommended maximum amounts of vertex and index data, which may be queried by calling glGet with argument + * {@link #GL_MAX_ELEMENTS_VERTICES MAX_ELEMENTS_VERTICES} and {@link #GL_MAX_ELEMENTS_INDICES MAX_ELEMENTS_INDICES}. If end - start + 1 is greater than the value of GL_MAX_ELEMENTS_VERTICES, or if + * count is greater than the value of GL_MAX_ELEMENTS_INDICES, then the call may operate at reduced performance. There is no requirement that all vertices + * in the range start end be referenced. However, the implementation may partially process unused vertices, reducing performance from what could be + * achieved with an optimal index set.

+ * + *

When glDrawRangeElements is called, it uses count sequential elements from an enabled array, starting at start to construct a sequence of geometric + * primitives. mode specifies what kind of primitives are constructed, and how the array elements construct these primitives. If more than one array is + * enabled, each is used.

+ * + *

Vertex attributes that are modified by glDrawRangeElements have an unspecified value after glDrawRangeElements returns. Attributes that aren't modified + * maintain their previous values.

+ * + *
Errors
+ * + *

It is an error for indices to lie outside the range start end, but implementations may not check for this situation. Such indices cause + * implementation-dependent behavior.

+ * + *
    + *
  • GL_INVALID_ENUM is generated if mode is not an accepted value.
  • + *
  • GL_INVALID_VALUE is generated if count is negative.
  • + *
  • GL_INVALID_VALUE is generated if end < start.
  • + *
  • GL_INVALID_OPERATION is generated if a geometry shader is active and mode is incompatible with the input primitive type of the geometry shader in the + * currently installed program object.
  • + *
  • GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array or the element array and the buffer object's data + * store is currently mapped.
  • + *
+ * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param indices a pointer to the location where the indices are stored + * + * @see Reference Page + */ + public static void glDrawRangeElements(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("void const *") ShortBuffer indices) { + nglDrawRangeElements(mode, start, end, indices.remaining(), GL11.GL_UNSIGNED_SHORT, memAddress(indices)); + } + + /** + * A restricted form of {@link GL11C#glDrawElements DrawElements}. mode, start, end, and count match the corresponding arguments to glDrawElements, with the additional + * constraint that all values in the arrays count must lie between start and end, inclusive. + * + *

Implementations denote recommended maximum amounts of vertex and index data, which may be queried by calling glGet with argument + * {@link #GL_MAX_ELEMENTS_VERTICES MAX_ELEMENTS_VERTICES} and {@link #GL_MAX_ELEMENTS_INDICES MAX_ELEMENTS_INDICES}. If end - start + 1 is greater than the value of GL_MAX_ELEMENTS_VERTICES, or if + * count is greater than the value of GL_MAX_ELEMENTS_INDICES, then the call may operate at reduced performance. There is no requirement that all vertices + * in the range start end be referenced. However, the implementation may partially process unused vertices, reducing performance from what could be + * achieved with an optimal index set.

+ * + *

When glDrawRangeElements is called, it uses count sequential elements from an enabled array, starting at start to construct a sequence of geometric + * primitives. mode specifies what kind of primitives are constructed, and how the array elements construct these primitives. If more than one array is + * enabled, each is used.

+ * + *

Vertex attributes that are modified by glDrawRangeElements have an unspecified value after glDrawRangeElements returns. Attributes that aren't modified + * maintain their previous values.

+ * + *
Errors
+ * + *

It is an error for indices to lie outside the range start end, but implementations may not check for this situation. Such indices cause + * implementation-dependent behavior.

+ * + *
    + *
  • GL_INVALID_ENUM is generated if mode is not an accepted value.
  • + *
  • GL_INVALID_VALUE is generated if count is negative.
  • + *
  • GL_INVALID_VALUE is generated if end < start.
  • + *
  • GL_INVALID_OPERATION is generated if a geometry shader is active and mode is incompatible with the input primitive type of the geometry shader in the + * currently installed program object.
  • + *
  • GL_INVALID_OPERATION is generated if a non-zero buffer object name is bound to an enabled array or the element array and the buffer object's data + * store is currently mapped.
  • + *
+ * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param indices a pointer to the location where the indices are stored + * + * @see Reference Page + */ + public static void glDrawRangeElements(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("void const *") IntBuffer indices) { + nglDrawRangeElements(mode, start, end, indices.remaining(), GL11.GL_UNSIGNED_INT, memAddress(indices)); + } + + /** + * Array version of: {@link #glTexImage3D TexImage3D} + * + * @see Reference Page + */ + public static void glTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] pixels) { + long __functionAddress = GL.getICD().glTexImage3D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, internalformat, width, height, depth, border, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexImage3D TexImage3D} + * + * @see Reference Page + */ + public static void glTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] pixels) { + long __functionAddress = GL.getICD().glTexImage3D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, internalformat, width, height, depth, border, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexImage3D TexImage3D} + * + * @see Reference Page + */ + public static void glTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] pixels) { + long __functionAddress = GL.getICD().glTexImage3D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, internalformat, width, height, depth, border, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexImage3D TexImage3D} + * + * @see Reference Page + */ + public static void glTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") double[] pixels) { + long __functionAddress = GL.getICD().glTexImage3D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, internalformat, width, height, depth, border, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexSubImage3D TexSubImage3D} + * + * @see Reference Page + */ + public static void glTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] pixels) { + long __functionAddress = GL.getICD().glTexSubImage3D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexSubImage3D TexSubImage3D} + * + * @see Reference Page + */ + public static void glTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] pixels) { + long __functionAddress = GL.getICD().glTexSubImage3D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexSubImage3D TexSubImage3D} + * + * @see Reference Page + */ + public static void glTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] pixels) { + long __functionAddress = GL.getICD().glTexSubImage3D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTexSubImage3D TexSubImage3D} + * + * @see Reference Page + */ + public static void glTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") double[] pixels) { + long __functionAddress = GL.getICD().glTexSubImage3D; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL13.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL13.java new file mode 100644 index 00000000..4e3c7110 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL13.java @@ -0,0 +1,1501 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality up to version 1.3. Includes the deprecated symbols of the Compatibility Profile. + * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL13 extends GL12 { + + /** Accepted by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, and CopyTexImage2D. */ + public static final int + GL_COMPRESSED_ALPHA = 0x84E9, + GL_COMPRESSED_LUMINANCE = 0x84EA, + GL_COMPRESSED_LUMINANCE_ALPHA = 0x84EB, + GL_COMPRESSED_INTENSITY = 0x84EC, + GL_COMPRESSED_RGB = 0x84ED, + GL_COMPRESSED_RGBA = 0x84EE; + + /** Accepted by the {@code target} parameter of Hint and the {@code value} parameter of GetIntegerv, GetBooleanv, GetFloatv, and GetDoublev. */ + public static final int GL_TEXTURE_COMPRESSION_HINT = 0x84EF; + + /** Accepted by the {@code value} parameter of GetTexLevelParameter. */ + public static final int + GL_TEXTURE_COMPRESSED_IMAGE_SIZE = 0x86A0, + GL_TEXTURE_COMPRESSED = 0x86A1; + + /** Accepted by the {@code value} parameter of GetIntegerv, GetBooleanv, GetFloatv, and GetDoublev. */ + public static final int + GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2, + GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3; + + /** Accepted by the {@code param} parameters of TexGend, TexGenf, and TexGeni when {@code pname} parameter is TEXTURE_GEN_MODE. */ + public static final int + GL_NORMAL_MAP = 0x8511, + GL_REFLECTION_MAP = 0x8512; + + /** + * When the {@code pname} parameter of TexGendv, TexGenfv, and TexGeniv is TEXTURE_GEN_MODE, then the array {@code params} may also contain NORMAL_MAP + * or REFLECTION_MAP. Accepted by the {@code cap} parameter of Enable, Disable, IsEnabled, and by the {@code pname} parameter of GetBooleanv, + * GetIntegerv, GetFloatv, and GetDoublev, and by the {@code target} parameter of BindTexture, GetTexParameterfv, GetTexParameteriv, TexParameterf, + * TexParameteri, TexParameterfv, and TexParameteriv. + */ + public static final int GL_TEXTURE_CUBE_MAP = 0x8513; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_TEXTURE_BINDING_CUBE_MAP = 0x8514; + + /** + * Accepted by the {@code target} parameter of GetTexImage, GetTexLevelParameteriv, GetTexLevelParameterfv, TexImage2D, CopyTexImage2D, TexSubImage2D, and + * CopySubTexImage2D. + */ + public static final int + GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515, + GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516, + GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517, + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518, + GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519, + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A; + + /** Accepted by the {@code target} parameter of GetTexLevelParameteriv, GetTexLevelParameterfv, GetTexParameteriv, and TexImage2D. */ + public static final int GL_PROXY_TEXTURE_CUBE_MAP = 0x851B; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int + GL_MULTISAMPLE = 0x809D, + GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E, + GL_SAMPLE_ALPHA_TO_ONE = 0x809F, + GL_SAMPLE_COVERAGE = 0x80A0; + + /** Accepted by the {@code mask} parameter of PushAttrib. */ + public static final int GL_MULTISAMPLE_BIT = 0x20000000; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_SAMPLE_BUFFERS = 0x80A8, + GL_SAMPLES = 0x80A9, + GL_SAMPLE_COVERAGE_VALUE = 0x80AA, + GL_SAMPLE_COVERAGE_INVERT = 0x80AB; + + /** Accepted by the {@code texture} parameter of ActiveTexture and MultiTexCoord. */ + public static final int + GL_TEXTURE0 = 0x84C0, + GL_TEXTURE1 = 0x84C1, + GL_TEXTURE2 = 0x84C2, + GL_TEXTURE3 = 0x84C3, + GL_TEXTURE4 = 0x84C4, + GL_TEXTURE5 = 0x84C5, + GL_TEXTURE6 = 0x84C6, + GL_TEXTURE7 = 0x84C7, + GL_TEXTURE8 = 0x84C8, + GL_TEXTURE9 = 0x84C9, + GL_TEXTURE10 = 0x84CA, + GL_TEXTURE11 = 0x84CB, + GL_TEXTURE12 = 0x84CC, + GL_TEXTURE13 = 0x84CD, + GL_TEXTURE14 = 0x84CE, + GL_TEXTURE15 = 0x84CF, + GL_TEXTURE16 = 0x84D0, + GL_TEXTURE17 = 0x84D1, + GL_TEXTURE18 = 0x84D2, + GL_TEXTURE19 = 0x84D3, + GL_TEXTURE20 = 0x84D4, + GL_TEXTURE21 = 0x84D5, + GL_TEXTURE22 = 0x84D6, + GL_TEXTURE23 = 0x84D7, + GL_TEXTURE24 = 0x84D8, + GL_TEXTURE25 = 0x84D9, + GL_TEXTURE26 = 0x84DA, + GL_TEXTURE27 = 0x84DB, + GL_TEXTURE28 = 0x84DC, + GL_TEXTURE29 = 0x84DD, + GL_TEXTURE30 = 0x84DE, + GL_TEXTURE31 = 0x84DF; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_ACTIVE_TEXTURE = 0x84E0, + GL_CLIENT_ACTIVE_TEXTURE = 0x84E1, + GL_MAX_TEXTURE_UNITS = 0x84E2; + + /** Accepted by the {@code params} parameter of TexEnvf, TexEnvi, TexEnvfv, and TexEnviv when the {@code pname} parameter value is TEXTURE_ENV_MODE. */ + public static final int GL_COMBINE = 0x8570; + + /** Accepted by the {@code pname} parameter of TexEnvf, TexEnvi, TexEnvfv, and TexEnviv when the {@code target} parameter value is TEXTURE_ENV. */ + public static final int + GL_COMBINE_RGB = 0x8571, + GL_COMBINE_ALPHA = 0x8572, + GL_SOURCE0_RGB = 0x8580, + GL_SOURCE1_RGB = 0x8581, + GL_SOURCE2_RGB = 0x8582, + GL_SOURCE0_ALPHA = 0x8588, + GL_SOURCE1_ALPHA = 0x8589, + GL_SOURCE2_ALPHA = 0x858A, + GL_OPERAND0_RGB = 0x8590, + GL_OPERAND1_RGB = 0x8591, + GL_OPERAND2_RGB = 0x8592, + GL_OPERAND0_ALPHA = 0x8598, + GL_OPERAND1_ALPHA = 0x8599, + GL_OPERAND2_ALPHA = 0x859A, + GL_RGB_SCALE = 0x8573; + + /** + * Accepted by the {@code params} parameter of TexEnvf, TexEnvi, TexEnvfv, and TexEnviv when the {@code pname} parameter value is COMBINE_RGB or + * COMBINE_ALPHA. + */ + public static final int + GL_ADD_SIGNED = 0x8574, + GL_INTERPOLATE = 0x8575, + GL_SUBTRACT = 0x84E7; + + /** + * Accepted by the {@code params} parameter of TexEnvf, TexEnvi, TexEnvfv, and TexEnviv when the {@code pname} parameter value is SOURCE0_RGB, + * SOURCE1_RGB, SOURCE2_RGB, SOURCE0_ALPHA, SOURCE1_ALPHA, or SOURCE2_ALPHA. + */ + public static final int + GL_CONSTANT = 0x8576, + GL_PRIMARY_COLOR = 0x8577, + GL_PREVIOUS = 0x8578; + + /** Accepted by the {@code params} parameter of TexEnvf, TexEnvi, TexEnvfv, and TexEnviv when the {@code pname} parameter value is COMBINE_RGB_ARB. */ + public static final int + GL_DOT3_RGB = 0x86AE, + GL_DOT3_RGBA = 0x86AF; + + /** + * Accepted by the {@code param} parameter of TexParameteri and TexParameterf, and by the {@code params} parameter of TexParameteriv and TexParameterfv, + * when their {@code pname} parameter is TEXTURE_WRAP_S, TEXTURE_WRAP_T, or TEXTURE_WRAP_R. + */ + public static final int GL_CLAMP_TO_BORDER = 0x812D; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_TRANSPOSE_MODELVIEW_MATRIX = 0x84E3, + GL_TRANSPOSE_PROJECTION_MATRIX = 0x84E4, + GL_TRANSPOSE_TEXTURE_MATRIX = 0x84E5, + GL_TRANSPOSE_COLOR_MATRIX = 0x84E6; + + static { GL.initialize(); } + + protected GL13() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, boolean fc) { + return (fc || checkFunctions( + caps.glClientActiveTexture, caps.glMultiTexCoord1f, caps.glMultiTexCoord1s, caps.glMultiTexCoord1i, caps.glMultiTexCoord1d, caps.glMultiTexCoord1fv, + caps.glMultiTexCoord1sv, caps.glMultiTexCoord1iv, caps.glMultiTexCoord1dv, caps.glMultiTexCoord2f, caps.glMultiTexCoord2s, caps.glMultiTexCoord2i, + caps.glMultiTexCoord2d, caps.glMultiTexCoord2fv, caps.glMultiTexCoord2sv, caps.glMultiTexCoord2iv, caps.glMultiTexCoord2dv, caps.glMultiTexCoord3f, + caps.glMultiTexCoord3s, caps.glMultiTexCoord3i, caps.glMultiTexCoord3d, caps.glMultiTexCoord3fv, caps.glMultiTexCoord3sv, caps.glMultiTexCoord3iv, + caps.glMultiTexCoord3dv, caps.glMultiTexCoord4f, caps.glMultiTexCoord4s, caps.glMultiTexCoord4i, caps.glMultiTexCoord4d, caps.glMultiTexCoord4fv, + caps.glMultiTexCoord4sv, caps.glMultiTexCoord4iv, caps.glMultiTexCoord4dv, caps.glLoadTransposeMatrixf, caps.glLoadTransposeMatrixd, + caps.glMultTransposeMatrixf, caps.glMultTransposeMatrixd + )) && checkFunctions( + caps.glCompressedTexImage3D, caps.glCompressedTexImage2D, caps.glCompressedTexImage1D, caps.glCompressedTexSubImage3D, + caps.glCompressedTexSubImage2D, caps.glCompressedTexSubImage1D, caps.glGetCompressedTexImage, caps.glSampleCoverage, caps.glActiveTexture + ); + } + + // --- [ glCompressedTexImage3D ] --- + + /** + * Unsafe version of: {@link #glCompressedTexImage3D CompressedTexImage3D} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static void nglCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, long data) { + GL13C.nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data); + } + + /** + * Specifies a three-dimensional texture image in a compressed format. + * + * @param target the target texture. One of:
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL12#GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param internalformat the format of the compressed image data. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param width the width of the texture image + * @param height the height of the texture image + * @param depth the depth of the texture image + * @param border must be 0 + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLsizei") int imageSize, @Nullable @NativeType("void const *") long data) { + GL13C.glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data); + } + + /** + * Specifies a three-dimensional texture image in a compressed format. + * + * @param target the target texture. One of:
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL12#GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param internalformat the format of the compressed image data. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param width the width of the texture image + * @param height the height of the texture image + * @param depth the depth of the texture image + * @param border must be 0 + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @Nullable @NativeType("void const *") ByteBuffer data) { + GL13C.glCompressedTexImage3D(target, level, internalformat, width, height, depth, border, data); + } + + // --- [ glCompressedTexImage2D ] --- + + /** + * Unsafe version of: {@link #glCompressedTexImage2D CompressedTexImage2D} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static void nglCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, long data) { + GL13C.nglCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data); + } + + /** + * Specifies a two-dimensional texture image in a compressed format. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13C#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL11#GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13C#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param internalformat the format of the compressed image data. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param width the width of the texture image + * @param height the height of the texture image + * @param border must be 0 + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLsizei") int imageSize, @Nullable @NativeType("void const *") long data) { + GL13C.glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data); + } + + /** + * Specifies a two-dimensional texture image in a compressed format. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13C#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL11#GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13C#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param internalformat the format of the compressed image data. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param width the width of the texture image + * @param height the height of the texture image + * @param border must be 0 + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @Nullable @NativeType("void const *") ByteBuffer data) { + GL13C.glCompressedTexImage2D(target, level, internalformat, width, height, border, data); + } + + // --- [ glCompressedTexImage1D ] --- + + /** + * Unsafe version of: {@link #glCompressedTexImage1D CompressedTexImage1D} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static void nglCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, long data) { + GL13C.nglCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data); + } + + /** + * Specifies a one-dimensional texture image in a compressed format. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param internalformat the format of the compressed image data. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param width the width of the texture image + * @param border must be 0 + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLsizei") int imageSize, @Nullable @NativeType("void const *") long data) { + GL13C.glCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data); + } + + /** + * Specifies a one-dimensional texture image in a compressed format. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param internalformat the format of the compressed image data. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param width the width of the texture image + * @param border must be 0 + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @Nullable @NativeType("void const *") ByteBuffer data) { + GL13C.glCompressedTexImage1D(target, level, internalformat, width, border, data); + } + + // --- [ glCompressedTexSubImage3D ] --- + + /** + * Unsafe version of: {@link #glCompressedTexSubImage3D CompressedTexSubImage3D} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static void nglCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, long data) { + GL13C.nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); + } + + /** + * Respecifies only a cubic subregion of an existing 3D texel array, with incoming data stored in a specific compressed image format. + * + * @param target the target texture. One of:
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param zoffset a texel offset in the z direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param depth the depth of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + GL13C.glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); + } + + /** + * Respecifies only a cubic subregion of an existing 3D texel array, with incoming data stored in a specific compressed image format. + * + * @param target the target texture. One of:
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param zoffset a texel offset in the z direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param depth the depth of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + GL13C.glCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, data); + } + + // --- [ glCompressedTexSubImage2D ] --- + + /** + * Unsafe version of: {@link #glCompressedTexSubImage2D CompressedTexSubImage2D} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static void nglCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, long data) { + GL13C.nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data); + } + + /** + * Respecifies only a rectangular subregion of an existing 2D texel array, with incoming data stored in a specific compressed image format. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13C#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + GL13C.glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data); + } + + /** + * Respecifies only a rectangular subregion of an existing 2D texel array, with incoming data stored in a specific compressed image format. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13C#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + GL13C.glCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, data); + } + + // --- [ glCompressedTexSubImage1D ] --- + + /** + * Unsafe version of: {@link #glCompressedTexSubImage1D CompressedTexSubImage1D} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static void nglCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, long data) { + GL13C.nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data); + } + + /** + * Respecifies only a subregion of an existing 1D texel array, with incoming data stored in a specific compressed image format. + * + * @param target the target texture. Must be:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param width the width of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + GL13C.glCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data); + } + + /** + * Respecifies only a subregion of an existing 1D texel array, with incoming data stored in a specific compressed image format. + * + * @param target the target texture. Must be:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param width the width of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + GL13C.glCompressedTexSubImage1D(target, level, xoffset, width, format, data); + } + + // --- [ glGetCompressedTexImage ] --- + + /** Unsafe version of: {@link #glGetCompressedTexImage GetCompressedTexImage} */ + public static void nglGetCompressedTexImage(int target, int level, long pixels) { + GL13C.nglGetCompressedTexImage(target, level, pixels); + } + + /** + * Returns a compressed texture image. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL13C#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13C#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}{@link GL13C#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}
{@link GL13C#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13C#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13C#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param pixels a buffer in which to return the compressed texture image + * + * @see Reference Page + */ + public static void glGetCompressedTexImage(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("void *") ByteBuffer pixels) { + GL13C.glGetCompressedTexImage(target, level, pixels); + } + + /** + * Returns a compressed texture image. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL13C#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13C#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}{@link GL13C#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}
{@link GL13C#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13C#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13C#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param pixels a buffer in which to return the compressed texture image + * + * @see Reference Page + */ + public static void glGetCompressedTexImage(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("void *") long pixels) { + GL13C.glGetCompressedTexImage(target, level, pixels); + } + + // --- [ glSampleCoverage ] --- + + /** + * Specifies multisample coverage parameters. + * + *

Multisampling samples a pixel multiple times at various implementation-dependent subpixel locations to generate antialiasing effects. Multisampling + * transparently antialiases points, lines, polygons, and images if it is enabled.

+ * + *

{@code value} is used in constructing a temporary mask used in determining which samples will be used in resolving the final fragment color. This mask + * is bitwise-ANDed with the coverage mask generated from the multisampling computation. If the {@code invert} flag is set, the temporary mask is inverted + * (all bits flipped) and then the bitwise-AND is computed.

+ * + *

If an implementation does not have any multisample buffers available, or multisampling is disabled, rasterization occurs with only a single sample + * computing a pixel's final RGB color.

+ * + *

Provided an implementation supports multisample buffers, and multisampling is enabled, then a pixel's final color is generated by combining several + * samples per pixel. Each sample contains color, depth, and stencil information, allowing those operations to be performed on each sample.

+ * + * @param value a sample coverage value. The value is clamped to the range [0, 1]. The initial value is 1.0. + * @param invert if the coverage masks should be inverted. The initial value is false. + * + * @see Reference Page + */ + public static void glSampleCoverage(@NativeType("GLfloat") float value, @NativeType("GLboolean") boolean invert) { + GL13C.glSampleCoverage(value, invert); + } + + // --- [ glActiveTexture ] --- + + /** + * Selects which texture unit subsequent texture state calls will affect. The number of texture units an implementation supports is implementation + * dependent. + * + * @param texture which texture unit to make active. One of:
{@link GL13C#GL_TEXTURE0 TEXTURE0}GL_TEXTURE[1-31]
+ * + * @see Reference Page + */ + public static void glActiveTexture(@NativeType("GLenum") int texture) { + GL13C.glActiveTexture(texture); + } + + // --- [ glClientActiveTexture ] --- + + /** + * Selects the vertex array client state parameters to be modified by the TexCoordPointer command and the array affected by EnableClientState and + * DisableClientState with parameter TEXTURE_COORD_ARRAY. + * + * @param texture which texture coordinate array to make active. One of:
{@link #GL_TEXTURE0 TEXTURE0}GL_TEXTURE[1-31]
+ * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glClientActiveTexture(@NativeType("GLenum") int texture); + + // --- [ glMultiTexCoord1f ] --- + + /** + * Sets the current one-dimensional texture coordinate for the specified texture coordinate set. {@code t} and {@code r} are implicitly set to 0 and {@code q} to 1. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMultiTexCoord1f(@NativeType("GLenum") int texture, @NativeType("GLfloat") float s); + + // --- [ glMultiTexCoord1s ] --- + + /** + * Short version of {@link #glMultiTexCoord1f MultiTexCoord1f}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMultiTexCoord1s(@NativeType("GLenum") int texture, @NativeType("GLshort") short s); + + // --- [ glMultiTexCoord1i ] --- + + /** + * Integer version of {@link #glMultiTexCoord1f MultiTexCoord1f}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMultiTexCoord1i(@NativeType("GLenum") int texture, @NativeType("GLint") int s); + + // --- [ glMultiTexCoord1d ] --- + + /** + * Double version of {@link #glMultiTexCoord1f MultiTexCoord1f}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMultiTexCoord1d(@NativeType("GLenum") int texture, @NativeType("GLdouble") double s); + + // --- [ glMultiTexCoord1fv ] --- + + /** Unsafe version of: {@link #glMultiTexCoord1fv MultiTexCoord1fv} */ + public static native void nglMultiTexCoord1fv(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord1f MultiTexCoord1f}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord1fv(@NativeType("GLenum") int texture, @NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglMultiTexCoord1fv(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord1sv ] --- + + /** Unsafe version of: {@link #glMultiTexCoord1sv MultiTexCoord1sv} */ + public static native void nglMultiTexCoord1sv(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord1s MultiTexCoord1s}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord1sv(@NativeType("GLenum") int texture, @NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglMultiTexCoord1sv(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord1iv ] --- + + /** Unsafe version of: {@link #glMultiTexCoord1iv MultiTexCoord1iv} */ + public static native void nglMultiTexCoord1iv(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord1i MultiTexCoord1i}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord1iv(@NativeType("GLenum") int texture, @NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglMultiTexCoord1iv(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord1dv ] --- + + /** Unsafe version of: {@link #glMultiTexCoord1dv MultiTexCoord1dv} */ + public static native void nglMultiTexCoord1dv(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord1d MultiTexCoord1d}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord1dv(@NativeType("GLenum") int texture, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglMultiTexCoord1dv(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord2f ] --- + + /** + * Sets the current two-dimensional texture coordinate for the specified texture coordinate set. {@code r} is implicitly set to 0 and {@code q} to 1. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMultiTexCoord2f(@NativeType("GLenum") int texture, @NativeType("GLfloat") float s, @NativeType("GLfloat") float t); + + // --- [ glMultiTexCoord2s ] --- + + /** + * Short version of {@link #glMultiTexCoord2f MultiTexCoord2f}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMultiTexCoord2s(@NativeType("GLenum") int texture, @NativeType("GLshort") short s, @NativeType("GLshort") short t); + + // --- [ glMultiTexCoord2i ] --- + + /** + * Integer version of {@link #glMultiTexCoord2f MultiTexCoord2f}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMultiTexCoord2i(@NativeType("GLenum") int texture, @NativeType("GLint") int s, @NativeType("GLint") int t); + + // --- [ glMultiTexCoord2d ] --- + + /** + * Double version of {@link #glMultiTexCoord2f MultiTexCoord2f}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMultiTexCoord2d(@NativeType("GLenum") int texture, @NativeType("GLdouble") double s, @NativeType("GLdouble") double t); + + // --- [ glMultiTexCoord2fv ] --- + + /** Unsafe version of: {@link #glMultiTexCoord2fv MultiTexCoord2fv} */ + public static native void nglMultiTexCoord2fv(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord2f MultiTexCoord2f}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord2fv(@NativeType("GLenum") int texture, @NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglMultiTexCoord2fv(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord2sv ] --- + + /** Unsafe version of: {@link #glMultiTexCoord2sv MultiTexCoord2sv} */ + public static native void nglMultiTexCoord2sv(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord2s MultiTexCoord2s}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord2sv(@NativeType("GLenum") int texture, @NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglMultiTexCoord2sv(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord2iv ] --- + + /** Unsafe version of: {@link #glMultiTexCoord2iv MultiTexCoord2iv} */ + public static native void nglMultiTexCoord2iv(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord2i MultiTexCoord2i}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord2iv(@NativeType("GLenum") int texture, @NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglMultiTexCoord2iv(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord2dv ] --- + + /** Unsafe version of: {@link #glMultiTexCoord2dv MultiTexCoord2dv} */ + public static native void nglMultiTexCoord2dv(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord2d MultiTexCoord2d}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord2dv(@NativeType("GLenum") int texture, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglMultiTexCoord2dv(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord3f ] --- + + /** + * Sets the current three-dimensional texture coordinate for the specified texture coordinate set. {@code q} is implicitly set to 1. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMultiTexCoord3f(@NativeType("GLenum") int texture, @NativeType("GLfloat") float s, @NativeType("GLfloat") float t, @NativeType("GLfloat") float r); + + // --- [ glMultiTexCoord3s ] --- + + /** + * Short version of {@link #glMultiTexCoord3f MultiTexCoord3f}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMultiTexCoord3s(@NativeType("GLenum") int texture, @NativeType("GLshort") short s, @NativeType("GLshort") short t, @NativeType("GLshort") short r); + + // --- [ glMultiTexCoord3i ] --- + + /** + * Integer version of {@link #glMultiTexCoord3f MultiTexCoord3f}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMultiTexCoord3i(@NativeType("GLenum") int texture, @NativeType("GLint") int s, @NativeType("GLint") int t, @NativeType("GLint") int r); + + // --- [ glMultiTexCoord3d ] --- + + /** + * Double version of {@link #glMultiTexCoord3f MultiTexCoord3f}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMultiTexCoord3d(@NativeType("GLenum") int texture, @NativeType("GLdouble") double s, @NativeType("GLdouble") double t, @NativeType("GLdouble") double r); + + // --- [ glMultiTexCoord3fv ] --- + + /** Unsafe version of: {@link #glMultiTexCoord3fv MultiTexCoord3fv} */ + public static native void nglMultiTexCoord3fv(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord3f MultiTexCoord3f}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord3fv(@NativeType("GLenum") int texture, @NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglMultiTexCoord3fv(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord3sv ] --- + + /** Unsafe version of: {@link #glMultiTexCoord3sv MultiTexCoord3sv} */ + public static native void nglMultiTexCoord3sv(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord3s MultiTexCoord3s}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord3sv(@NativeType("GLenum") int texture, @NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglMultiTexCoord3sv(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord3iv ] --- + + /** Unsafe version of: {@link #glMultiTexCoord3iv MultiTexCoord3iv} */ + public static native void nglMultiTexCoord3iv(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord3i MultiTexCoord3i}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord3iv(@NativeType("GLenum") int texture, @NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglMultiTexCoord3iv(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord3dv ] --- + + /** Unsafe version of: {@link #glMultiTexCoord3dv MultiTexCoord3dv} */ + public static native void nglMultiTexCoord3dv(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord3d MultiTexCoord3d}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord3dv(@NativeType("GLenum") int texture, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglMultiTexCoord3dv(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord4f ] --- + + /** + * Sets the current four-dimensional texture coordinate for the specified texture coordinate set. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + * @param q the q component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMultiTexCoord4f(@NativeType("GLenum") int texture, @NativeType("GLfloat") float s, @NativeType("GLfloat") float t, @NativeType("GLfloat") float r, @NativeType("GLfloat") float q); + + // --- [ glMultiTexCoord4s ] --- + + /** + * Short version of {@link #glMultiTexCoord4f MultiTexCoord4f}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + * @param q the q component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMultiTexCoord4s(@NativeType("GLenum") int texture, @NativeType("GLshort") short s, @NativeType("GLshort") short t, @NativeType("GLshort") short r, @NativeType("GLshort") short q); + + // --- [ glMultiTexCoord4i ] --- + + /** + * Integer version of {@link #glMultiTexCoord4f MultiTexCoord4f}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + * @param q the q component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMultiTexCoord4i(@NativeType("GLenum") int texture, @NativeType("GLint") int s, @NativeType("GLint") int t, @NativeType("GLint") int r, @NativeType("GLint") int q); + + // --- [ glMultiTexCoord4d ] --- + + /** + * Double version of {@link #glMultiTexCoord4f MultiTexCoord4f}. + * + * @param texture the coordinate set to be modified + * @param s the s component of the current texture coordinates + * @param t the t component of the current texture coordinates + * @param r the r component of the current texture coordinates + * @param q the q component of the current texture coordinates + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMultiTexCoord4d(@NativeType("GLenum") int texture, @NativeType("GLdouble") double s, @NativeType("GLdouble") double t, @NativeType("GLdouble") double r, @NativeType("GLdouble") double q); + + // --- [ glMultiTexCoord4fv ] --- + + /** Unsafe version of: {@link #glMultiTexCoord4fv MultiTexCoord4fv} */ + public static native void nglMultiTexCoord4fv(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord4f MultiTexCoord4f}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord4fv(@NativeType("GLenum") int texture, @NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglMultiTexCoord4fv(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord4sv ] --- + + /** Unsafe version of: {@link #glMultiTexCoord4sv MultiTexCoord4sv} */ + public static native void nglMultiTexCoord4sv(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord4s MultiTexCoord4s}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord4sv(@NativeType("GLenum") int texture, @NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglMultiTexCoord4sv(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord4iv ] --- + + /** Unsafe version of: {@link #glMultiTexCoord4iv MultiTexCoord4iv} */ + public static native void nglMultiTexCoord4iv(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord4i MultiTexCoord4i}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord4iv(@NativeType("GLenum") int texture, @NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglMultiTexCoord4iv(texture, memAddress(v)); + } + + // --- [ glMultiTexCoord4dv ] --- + + /** Unsafe version of: {@link #glMultiTexCoord4dv MultiTexCoord4dv} */ + public static native void nglMultiTexCoord4dv(int texture, long v); + + /** + * Pointer version of {@link #glMultiTexCoord4d MultiTexCoord4d}. + * + * @param texture the coordinate set to be modified + * @param v the texture coordinate buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord4dv(@NativeType("GLenum") int texture, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglMultiTexCoord4dv(texture, memAddress(v)); + } + + // --- [ glLoadTransposeMatrixf ] --- + + /** Unsafe version of: {@link #glLoadTransposeMatrixf LoadTransposeMatrixf} */ + public static native void nglLoadTransposeMatrixf(long m); + + /** + * Sets the current matrix to a 4 × 4 matrix in row-major order. + * + *

The matrix is stored as 16 consecutive values, i.e. as:

+ * + * + * + * + * + * + *
a1a2a3a4
a5a6a7a8
a9a10a11a12
a13a14a15a16
+ * + * @param m the matrix data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glLoadTransposeMatrixf(@NativeType("GLfloat const *") FloatBuffer m) { + if (CHECKS) { + check(m, 16); + } + nglLoadTransposeMatrixf(memAddress(m)); + } + + // --- [ glLoadTransposeMatrixd ] --- + + /** Unsafe version of: {@link #glLoadTransposeMatrixd LoadTransposeMatrixd} */ + public static native void nglLoadTransposeMatrixd(long m); + + /** + * Double version of {@link #glLoadTransposeMatrixf LoadTransposeMatrixf}. + * + * @param m the matrix data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glLoadTransposeMatrixd(@NativeType("GLdouble const *") DoubleBuffer m) { + if (CHECKS) { + check(m, 16); + } + nglLoadTransposeMatrixd(memAddress(m)); + } + + // --- [ glMultTransposeMatrixf ] --- + + /** Unsafe version of: {@link #glMultTransposeMatrixf MultTransposeMatrixf} */ + public static native void nglMultTransposeMatrixf(long m); + + /** + * Multiplies the current matrix with a 4 × 4 matrix in row-major order. See {@link #glLoadTransposeMatrixf LoadTransposeMatrixf} for details. + * + * @param m the matrix data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultTransposeMatrixf(@NativeType("GLfloat const *") FloatBuffer m) { + if (CHECKS) { + check(m, 16); + } + nglMultTransposeMatrixf(memAddress(m)); + } + + // --- [ glMultTransposeMatrixd ] --- + + /** Unsafe version of: {@link #glMultTransposeMatrixd MultTransposeMatrixd} */ + public static native void nglMultTransposeMatrixd(long m); + + /** + * Double version of {@link #glMultTransposeMatrixf MultTransposeMatrixf}. + * + * @param m the matrix data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultTransposeMatrixd(@NativeType("GLdouble const *") DoubleBuffer m) { + if (CHECKS) { + check(m, 16); + } + nglMultTransposeMatrixd(memAddress(m)); + } + + /** + * Array version of: {@link #glMultiTexCoord1fv MultiTexCoord1fv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord1fv(@NativeType("GLenum") int texture, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord1fv; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(texture, v, __functionAddress); + } + + /** + * Array version of: {@link #glMultiTexCoord1sv MultiTexCoord1sv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord1sv(@NativeType("GLenum") int texture, @NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord1sv; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(texture, v, __functionAddress); + } + + /** + * Array version of: {@link #glMultiTexCoord1iv MultiTexCoord1iv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord1iv(@NativeType("GLenum") int texture, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord1iv; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(texture, v, __functionAddress); + } + + /** + * Array version of: {@link #glMultiTexCoord1dv MultiTexCoord1dv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord1dv(@NativeType("GLenum") int texture, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord1dv; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(texture, v, __functionAddress); + } + + /** + * Array version of: {@link #glMultiTexCoord2fv MultiTexCoord2fv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord2fv(@NativeType("GLenum") int texture, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord2fv; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(texture, v, __functionAddress); + } + + /** + * Array version of: {@link #glMultiTexCoord2sv MultiTexCoord2sv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord2sv(@NativeType("GLenum") int texture, @NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord2sv; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(texture, v, __functionAddress); + } + + /** + * Array version of: {@link #glMultiTexCoord2iv MultiTexCoord2iv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord2iv(@NativeType("GLenum") int texture, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord2iv; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(texture, v, __functionAddress); + } + + /** + * Array version of: {@link #glMultiTexCoord2dv MultiTexCoord2dv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord2dv(@NativeType("GLenum") int texture, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord2dv; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(texture, v, __functionAddress); + } + + /** + * Array version of: {@link #glMultiTexCoord3fv MultiTexCoord3fv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord3fv(@NativeType("GLenum") int texture, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord3fv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(texture, v, __functionAddress); + } + + /** + * Array version of: {@link #glMultiTexCoord3sv MultiTexCoord3sv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord3sv(@NativeType("GLenum") int texture, @NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord3sv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(texture, v, __functionAddress); + } + + /** + * Array version of: {@link #glMultiTexCoord3iv MultiTexCoord3iv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord3iv(@NativeType("GLenum") int texture, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord3iv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(texture, v, __functionAddress); + } + + /** + * Array version of: {@link #glMultiTexCoord3dv MultiTexCoord3dv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord3dv(@NativeType("GLenum") int texture, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord3dv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(texture, v, __functionAddress); + } + + /** + * Array version of: {@link #glMultiTexCoord4fv MultiTexCoord4fv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord4fv(@NativeType("GLenum") int texture, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord4fv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(texture, v, __functionAddress); + } + + /** + * Array version of: {@link #glMultiTexCoord4sv MultiTexCoord4sv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord4sv(@NativeType("GLenum") int texture, @NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord4sv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(texture, v, __functionAddress); + } + + /** + * Array version of: {@link #glMultiTexCoord4iv MultiTexCoord4iv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord4iv(@NativeType("GLenum") int texture, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord4iv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(texture, v, __functionAddress); + } + + /** + * Array version of: {@link #glMultiTexCoord4dv MultiTexCoord4dv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoord4dv(@NativeType("GLenum") int texture, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord4dv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(texture, v, __functionAddress); + } + + /** + * Array version of: {@link #glLoadTransposeMatrixf LoadTransposeMatrixf} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glLoadTransposeMatrixf(@NativeType("GLfloat const *") float[] m) { + long __functionAddress = GL.getICD().glLoadTransposeMatrixf; + if (CHECKS) { + check(__functionAddress); + check(m, 16); + } + callPV(m, __functionAddress); + } + + /** + * Array version of: {@link #glLoadTransposeMatrixd LoadTransposeMatrixd} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glLoadTransposeMatrixd(@NativeType("GLdouble const *") double[] m) { + long __functionAddress = GL.getICD().glLoadTransposeMatrixd; + if (CHECKS) { + check(__functionAddress); + check(m, 16); + } + callPV(m, __functionAddress); + } + + /** + * Array version of: {@link #glMultTransposeMatrixf MultTransposeMatrixf} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultTransposeMatrixf(@NativeType("GLfloat const *") float[] m) { + long __functionAddress = GL.getICD().glMultTransposeMatrixf; + if (CHECKS) { + check(__functionAddress); + check(m, 16); + } + callPV(m, __functionAddress); + } + + /** + * Array version of: {@link #glMultTransposeMatrixd MultTransposeMatrixd} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultTransposeMatrixd(@NativeType("GLdouble const *") double[] m) { + long __functionAddress = GL.getICD().glMultTransposeMatrixd; + if (CHECKS) { + check(__functionAddress); + check(m, 16); + } + callPV(m, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL13C.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL13C.java new file mode 100644 index 00000000..e5e18e46 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL13C.java @@ -0,0 +1,489 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality of a forward compatible context, up to version 1.3. + * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL13C extends GL12C { + + /** Accepted by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, and CopyTexImage2D. */ + public static final int + GL_COMPRESSED_RGB = 0x84ED, + GL_COMPRESSED_RGBA = 0x84EE; + + /** Accepted by the {@code target} parameter of Hint and the {@code value} parameter of GetIntegerv, GetBooleanv, GetFloatv, and GetDoublev. */ + public static final int GL_TEXTURE_COMPRESSION_HINT = 0x84EF; + + /** Accepted by the {@code value} parameter of GetTexLevelParameter. */ + public static final int + GL_TEXTURE_COMPRESSED_IMAGE_SIZE = 0x86A0, + GL_TEXTURE_COMPRESSED = 0x86A1; + + /** Accepted by the {@code value} parameter of GetIntegerv, GetBooleanv, GetFloatv, and GetDoublev. */ + public static final int + GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2, + GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3; + + /** + * When the {@code pname} parameter of TexGendv, TexGenfv, and TexGeniv is TEXTURE_GEN_MODE, then the array {@code params} may also contain NORMAL_MAP + * or REFLECTION_MAP. Accepted by the {@code cap} parameter of Enable, Disable, IsEnabled, and by the {@code pname} parameter of GetBooleanv, + * GetIntegerv, GetFloatv, and GetDoublev, and by the {@code target} parameter of BindTexture, GetTexParameterfv, GetTexParameteriv, TexParameterf, + * TexParameteri, TexParameterfv, and TexParameteriv. + */ + public static final int GL_TEXTURE_CUBE_MAP = 0x8513; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_TEXTURE_BINDING_CUBE_MAP = 0x8514; + + /** + * Accepted by the {@code target} parameter of GetTexImage, GetTexLevelParameteriv, GetTexLevelParameterfv, TexImage2D, CopyTexImage2D, TexSubImage2D, and + * CopySubTexImage2D. + */ + public static final int + GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515, + GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516, + GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517, + GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518, + GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519, + GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A; + + /** Accepted by the {@code target} parameter of GetTexLevelParameteriv, GetTexLevelParameterfv, GetTexParameteriv, and TexImage2D. */ + public static final int GL_PROXY_TEXTURE_CUBE_MAP = 0x851B; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int + GL_MULTISAMPLE = 0x809D, + GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E, + GL_SAMPLE_ALPHA_TO_ONE = 0x809F, + GL_SAMPLE_COVERAGE = 0x80A0; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_SAMPLE_BUFFERS = 0x80A8, + GL_SAMPLES = 0x80A9, + GL_SAMPLE_COVERAGE_VALUE = 0x80AA, + GL_SAMPLE_COVERAGE_INVERT = 0x80AB; + + /** Accepted by the {@code texture} parameter of ActiveTexture and MultiTexCoord. */ + public static final int + GL_TEXTURE0 = 0x84C0, + GL_TEXTURE1 = 0x84C1, + GL_TEXTURE2 = 0x84C2, + GL_TEXTURE3 = 0x84C3, + GL_TEXTURE4 = 0x84C4, + GL_TEXTURE5 = 0x84C5, + GL_TEXTURE6 = 0x84C6, + GL_TEXTURE7 = 0x84C7, + GL_TEXTURE8 = 0x84C8, + GL_TEXTURE9 = 0x84C9, + GL_TEXTURE10 = 0x84CA, + GL_TEXTURE11 = 0x84CB, + GL_TEXTURE12 = 0x84CC, + GL_TEXTURE13 = 0x84CD, + GL_TEXTURE14 = 0x84CE, + GL_TEXTURE15 = 0x84CF, + GL_TEXTURE16 = 0x84D0, + GL_TEXTURE17 = 0x84D1, + GL_TEXTURE18 = 0x84D2, + GL_TEXTURE19 = 0x84D3, + GL_TEXTURE20 = 0x84D4, + GL_TEXTURE21 = 0x84D5, + GL_TEXTURE22 = 0x84D6, + GL_TEXTURE23 = 0x84D7, + GL_TEXTURE24 = 0x84D8, + GL_TEXTURE25 = 0x84D9, + GL_TEXTURE26 = 0x84DA, + GL_TEXTURE27 = 0x84DB, + GL_TEXTURE28 = 0x84DC, + GL_TEXTURE29 = 0x84DD, + GL_TEXTURE30 = 0x84DE, + GL_TEXTURE31 = 0x84DF; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int GL_ACTIVE_TEXTURE = 0x84E0; + + /** + * Accepted by the {@code param} parameter of TexParameteri and TexParameterf, and by the {@code params} parameter of TexParameteriv and TexParameterfv, + * when their {@code pname} parameter is TEXTURE_WRAP_S, TEXTURE_WRAP_T, or TEXTURE_WRAP_R. + */ + public static final int GL_CLAMP_TO_BORDER = 0x812D; + + static { GL.initialize(); } + + protected GL13C() { + throw new UnsupportedOperationException(); + } + + // --- [ glCompressedTexImage3D ] --- + + /** + * Unsafe version of: {@link #glCompressedTexImage3D CompressedTexImage3D} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static native void nglCompressedTexImage3D(int target, int level, int internalformat, int width, int height, int depth, int border, int imageSize, long data); + + /** + * Specifies a three-dimensional texture image in a compressed format. + * + * @param target the target texture. One of:
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL12#GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param internalformat the format of the compressed image data. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param width the width of the texture image + * @param height the height of the texture image + * @param depth the depth of the texture image + * @param border must be 0 + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @NativeType("GLsizei") int imageSize, @Nullable @NativeType("void const *") long data) { + nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, imageSize, data); + } + + /** + * Specifies a three-dimensional texture image in a compressed format. + * + * @param target the target texture. One of:
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL12#GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param internalformat the format of the compressed image data. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param width the width of the texture image + * @param height the height of the texture image + * @param depth the depth of the texture image + * @param border must be 0 + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLint") int border, @Nullable @NativeType("void const *") ByteBuffer data) { + nglCompressedTexImage3D(target, level, internalformat, width, height, depth, border, remainingSafe(data), memAddressSafe(data)); + } + + // --- [ glCompressedTexImage2D ] --- + + /** + * Unsafe version of: {@link #glCompressedTexImage2D CompressedTexImage2D} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static native void nglCompressedTexImage2D(int target, int level, int internalformat, int width, int height, int border, int imageSize, long data); + + /** + * Specifies a two-dimensional texture image in a compressed format. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link #GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL11#GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link #GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param internalformat the format of the compressed image data. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param width the width of the texture image + * @param height the height of the texture image + * @param border must be 0 + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @NativeType("GLsizei") int imageSize, @Nullable @NativeType("void const *") long data) { + nglCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data); + } + + /** + * Specifies a two-dimensional texture image in a compressed format. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link #GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL11#GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link #GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param internalformat the format of the compressed image data. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param width the width of the texture image + * @param height the height of the texture image + * @param border must be 0 + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLint") int border, @Nullable @NativeType("void const *") ByteBuffer data) { + nglCompressedTexImage2D(target, level, internalformat, width, height, border, remainingSafe(data), memAddressSafe(data)); + } + + // --- [ glCompressedTexImage1D ] --- + + /** + * Unsafe version of: {@link #glCompressedTexImage1D CompressedTexImage1D} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static native void nglCompressedTexImage1D(int target, int level, int internalformat, int width, int border, int imageSize, long data); + + /** + * Specifies a one-dimensional texture image in a compressed format. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param internalformat the format of the compressed image data. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param width the width of the texture image + * @param border must be 0 + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @NativeType("GLsizei") int imageSize, @Nullable @NativeType("void const *") long data) { + nglCompressedTexImage1D(target, level, internalformat, width, border, imageSize, data); + } + + /** + * Specifies a one-dimensional texture image in a compressed format. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param internalformat the format of the compressed image data. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param width the width of the texture image + * @param border must be 0 + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLint") int border, @Nullable @NativeType("void const *") ByteBuffer data) { + nglCompressedTexImage1D(target, level, internalformat, width, border, remainingSafe(data), memAddressSafe(data)); + } + + // --- [ glCompressedTexSubImage3D ] --- + + /** + * Unsafe version of: {@link #glCompressedTexSubImage3D CompressedTexSubImage3D} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static native void nglCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, long data); + + /** + * Respecifies only a cubic subregion of an existing 3D texel array, with incoming data stored in a specific compressed image format. + * + * @param target the target texture. One of:
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param zoffset a texel offset in the z direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param depth the depth of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); + } + + /** + * Respecifies only a cubic subregion of an existing 3D texel array, with incoming data stored in a specific compressed image format. + * + * @param target the target texture. One of:
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param zoffset a texel offset in the z direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param depth the depth of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexSubImage3D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, data.remaining(), memAddress(data)); + } + + // --- [ glCompressedTexSubImage2D ] --- + + /** + * Unsafe version of: {@link #glCompressedTexSubImage2D CompressedTexSubImage2D} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static native void nglCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, long data); + + /** + * Respecifies only a rectangular subregion of an existing 2D texel array, with incoming data stored in a specific compressed image format. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link #GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data); + } + + /** + * Respecifies only a rectangular subregion of an existing 2D texel array, with incoming data stored in a specific compressed image format. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link #GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexSubImage2D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, data.remaining(), memAddress(data)); + } + + // --- [ glCompressedTexSubImage1D ] --- + + /** + * Unsafe version of: {@link #glCompressedTexSubImage1D CompressedTexSubImage1D} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static native void nglCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, long data); + + /** + * Respecifies only a subregion of an existing 1D texel array, with incoming data stored in a specific compressed image format. + * + * @param target the target texture. Must be:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param width the width of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data); + } + + /** + * Respecifies only a subregion of an existing 1D texel array, with incoming data stored in a specific compressed image format. + * + * @param target the target texture. Must be:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param width the width of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTexSubImage1D(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + nglCompressedTexSubImage1D(target, level, xoffset, width, format, data.remaining(), memAddress(data)); + } + + // --- [ glGetCompressedTexImage ] --- + + /** Unsafe version of: {@link #glGetCompressedTexImage GetCompressedTexImage} */ + public static native void nglGetCompressedTexImage(int target, int level, long pixels); + + /** + * Returns a compressed texture image. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link #GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link #GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}{@link #GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}
{@link #GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link #GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link #GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param pixels a buffer in which to return the compressed texture image + * + * @see Reference Page + */ + public static void glGetCompressedTexImage(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("void *") ByteBuffer pixels) { + if (CHECKS) { + if (DEBUG) { + check(pixels, GL11.glGetTexLevelParameteri(target, level, GL_TEXTURE_COMPRESSED_IMAGE_SIZE)); + } + } + nglGetCompressedTexImage(target, level, memAddress(pixels)); + } + + /** + * Returns a compressed texture image. + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link #GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link #GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}{@link #GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}
{@link #GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link #GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link #GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param pixels a buffer in which to return the compressed texture image + * + * @see Reference Page + */ + public static void glGetCompressedTexImage(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("void *") long pixels) { + nglGetCompressedTexImage(target, level, pixels); + } + + // --- [ glSampleCoverage ] --- + + /** + * Specifies multisample coverage parameters. + * + *

Multisampling samples a pixel multiple times at various implementation-dependent subpixel locations to generate antialiasing effects. Multisampling + * transparently antialiases points, lines, polygons, and images if it is enabled.

+ * + *

{@code value} is used in constructing a temporary mask used in determining which samples will be used in resolving the final fragment color. This mask + * is bitwise-ANDed with the coverage mask generated from the multisampling computation. If the {@code invert} flag is set, the temporary mask is inverted + * (all bits flipped) and then the bitwise-AND is computed.

+ * + *

If an implementation does not have any multisample buffers available, or multisampling is disabled, rasterization occurs with only a single sample + * computing a pixel's final RGB color.

+ * + *

Provided an implementation supports multisample buffers, and multisampling is enabled, then a pixel's final color is generated by combining several + * samples per pixel. Each sample contains color, depth, and stencil information, allowing those operations to be performed on each sample.

+ * + * @param value a sample coverage value. The value is clamped to the range [0, 1]. The initial value is 1.0. + * @param invert if the coverage masks should be inverted. The initial value is false. + * + * @see Reference Page + */ + public static native void glSampleCoverage(@NativeType("GLfloat") float value, @NativeType("GLboolean") boolean invert); + + // --- [ glActiveTexture ] --- + + /** + * Selects which texture unit subsequent texture state calls will affect. The number of texture units an implementation supports is implementation + * dependent. + * + * @param texture which texture unit to make active. One of:
{@link #GL_TEXTURE0 TEXTURE0}GL_TEXTURE[1-31]
+ * + * @see Reference Page + */ + public static native void glActiveTexture(@NativeType("GLenum") int texture); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL14.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL14.java new file mode 100644 index 00000000..9f0e344a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL14.java @@ -0,0 +1,1307 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality up to version 1.4. Includes the deprecated symbols of the Compatibility Profile. + * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL14 extends GL13 { + + /** Accepted by the {@code pname} parameter of TexParameteri, TexParameterf, TexParameteriv, TexParameterfv, GetTexParameteriv, and GetTexParameterfv. */ + public static final int GL_GENERATE_MIPMAP = 0x8191; + + /** Accepted by the {@code target} parameter of Hint, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_GENERATE_MIPMAP_HINT = 0x8192; + + /** Accepted by the {@code sfactor} and {@code dfactor} parameters of BlendFunc. */ + public static final int + GL_CONSTANT_COLOR = 0x8001, + GL_ONE_MINUS_CONSTANT_COLOR = 0x8002, + GL_CONSTANT_ALPHA = 0x8003, + GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004; + + /** Accepted by the {@code mode} parameter of BlendEquation. */ + public static final int + GL_FUNC_ADD = 0x8006, + GL_MIN = 0x8007, + GL_MAX = 0x8008; + + /** Accepted by the {@code mode} parameter of BlendEquation. */ + public static final int + GL_FUNC_SUBTRACT = 0x800A, + GL_FUNC_REVERSE_SUBTRACT = 0x800B; + + /** Accepted by the {@code internalFormat} parameter of TexImage1D, TexImage2D, CopyTexImage1D and CopyTexImage2D. */ + public static final int + GL_DEPTH_COMPONENT16 = 0x81A5, + GL_DEPTH_COMPONENT24 = 0x81A6, + GL_DEPTH_COMPONENT32 = 0x81A7; + + /** Accepted by the {@code pname} parameter of GetTexLevelParameterfv and GetTexLevelParameteriv. */ + public static final int GL_TEXTURE_DEPTH_SIZE = 0x884A; + + /** Accepted by the {@code pname} parameter of TexParameterf, TexParameteri, TexParameterfv, TexParameteriv, GetTexParameterfv, and GetTexParameteriv. */ + public static final int GL_DEPTH_TEXTURE_MODE = 0x884B; + + /** Accepted by the {@code pname} parameter of TexParameterf, TexParameteri, TexParameterfv, TexParameteriv, GetTexParameterfv, and GetTexParameteriv. */ + public static final int + GL_TEXTURE_COMPARE_MODE = 0x884C, + GL_TEXTURE_COMPARE_FUNC = 0x884D; + + /** + * Accepted by the {@code param} parameter of TexParameterf, TexParameteri, TexParameterfv, and TexParameteriv when the {@code pname} parameter is + * TEXTURE_COMPARE_MODE. + */ + public static final int GL_COMPARE_R_TO_TEXTURE = 0x884E; + + /** Accepted by the {@code pname} parameter of Fogi and Fogf. */ + public static final int GL_FOG_COORDINATE_SOURCE = 0x8450; + + /** Accepted by the {@code param} parameter of Fogi and Fogf. */ + public static final int + GL_FOG_COORDINATE = 0x8451, + GL_FRAGMENT_DEPTH = 0x8452; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_CURRENT_FOG_COORDINATE = 0x8453, + GL_FOG_COORDINATE_ARRAY_TYPE = 0x8454, + GL_FOG_COORDINATE_ARRAY_STRIDE = 0x8455; + + /** Accepted by the {@code pname} parameter of GetPointerv. */ + public static final int GL_FOG_COORDINATE_ARRAY_POINTER = 0x8456; + + /** Accepted by the {@code array} parameter of EnableClientState and DisableClientState. */ + public static final int GL_FOG_COORDINATE_ARRAY = 0x8457; + + /** Accepted by the {@code pname} parameter of PointParameterfARB, and the {@code pname} of Get. */ + public static final int + GL_POINT_SIZE_MIN = 0x8126, + GL_POINT_SIZE_MAX = 0x8127, + GL_POINT_FADE_THRESHOLD_SIZE = 0x8128, + GL_POINT_DISTANCE_ATTENUATION = 0x8129; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_COLOR_SUM = 0x8458; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_CURRENT_SECONDARY_COLOR = 0x8459, + GL_SECONDARY_COLOR_ARRAY_SIZE = 0x845A, + GL_SECONDARY_COLOR_ARRAY_TYPE = 0x845B, + GL_SECONDARY_COLOR_ARRAY_STRIDE = 0x845C; + + /** Accepted by the {@code pname} parameter of GetPointerv. */ + public static final int GL_SECONDARY_COLOR_ARRAY_POINTER = 0x845D; + + /** Accepted by the {@code array} parameter of EnableClientState and DisableClientState. */ + public static final int GL_SECONDARY_COLOR_ARRAY = 0x845E; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_BLEND_DST_RGB = 0x80C8, + GL_BLEND_SRC_RGB = 0x80C9, + GL_BLEND_DST_ALPHA = 0x80CA, + GL_BLEND_SRC_ALPHA = 0x80CB; + + /** Accepted by the {@code sfail}, {@code dpfail}, and {@code dppass} parameter of StencilOp. */ + public static final int + GL_INCR_WRAP = 0x8507, + GL_DECR_WRAP = 0x8508; + + /** Accepted by the {@code target} parameters of GetTexEnvfv, GetTexEnviv, TexEnvi, TexEnvf, Texenviv, and TexEnvfv. */ + public static final int GL_TEXTURE_FILTER_CONTROL = 0x8500; + + /** + * When the {@code target} parameter of GetTexEnvfv, GetTexEnviv, TexEnvi, TexEnvf, TexEnviv, and TexEnvfv is TEXTURE_FILTER_CONTROL, then the value of + * {@code pname} may be. + */ + public static final int GL_TEXTURE_LOD_BIAS = 0x8501; + + /** Accepted by the {@code pname} parameters of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_MAX_TEXTURE_LOD_BIAS = 0x84FD; + + /** + * Accepted by the {@code param} parameter of TexParameteri and TexParameterf, and by the {@code params} parameter of TexParameteriv and TexParameterfv, + * when their {@code pname} parameter is TEXTURE_WRAP_S, TEXTURE_WRAP_T, or TEXTURE_WRAP_R. + */ + public static final int GL_MIRRORED_REPEAT = 0x8370; + + static { GL.initialize(); } + + protected GL14() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, boolean fc) { + return (fc || checkFunctions( + caps.glFogCoordf, caps.glFogCoordd, caps.glFogCoordfv, caps.glFogCoorddv, caps.glFogCoordPointer, caps.glSecondaryColor3b, caps.glSecondaryColor3s, + caps.glSecondaryColor3i, caps.glSecondaryColor3f, caps.glSecondaryColor3d, caps.glSecondaryColor3ub, caps.glSecondaryColor3us, + caps.glSecondaryColor3ui, caps.glSecondaryColor3bv, caps.glSecondaryColor3sv, caps.glSecondaryColor3iv, caps.glSecondaryColor3fv, + caps.glSecondaryColor3dv, caps.glSecondaryColor3ubv, caps.glSecondaryColor3usv, caps.glSecondaryColor3uiv, caps.glSecondaryColorPointer, + caps.glWindowPos2i, caps.glWindowPos2s, caps.glWindowPos2f, caps.glWindowPos2d, caps.glWindowPos2iv, caps.glWindowPos2sv, caps.glWindowPos2fv, + caps.glWindowPos2dv, caps.glWindowPos3i, caps.glWindowPos3s, caps.glWindowPos3f, caps.glWindowPos3d, caps.glWindowPos3iv, caps.glWindowPos3sv, + caps.glWindowPos3fv, caps.glWindowPos3dv + )) && checkFunctions( + caps.glBlendColor, caps.glBlendEquation, caps.glMultiDrawArrays, caps.glMultiDrawElements, caps.glPointParameterf, caps.glPointParameteri, + caps.glPointParameterfv, caps.glPointParameteriv, caps.glBlendFuncSeparate + ); + } + + // --- [ glBlendColor ] --- + + /** + * Specifies the constant color Cc to be used in blending. + * + * @param red the red color component + * @param green the green color component + * @param blue the blue color component + * @param alpha the alpha color component + * + * @see Reference Page + */ + public static void glBlendColor(@NativeType("GLfloat") float red, @NativeType("GLfloat") float green, @NativeType("GLfloat") float blue, @NativeType("GLfloat") float alpha) { + GL14C.glBlendColor(red, green, blue, alpha); + } + + // --- [ glBlendEquation ] --- + + /** + * Controls the blend equations used for per-fragment blending. + * + * @param mode the blend equation. One of:
{@link GL14C#GL_FUNC_ADD FUNC_ADD}{@link GL14C#GL_FUNC_SUBTRACT FUNC_SUBTRACT}{@link GL14C#GL_FUNC_REVERSE_SUBTRACT FUNC_REVERSE_SUBTRACT}{@link GL14C#GL_MIN MIN}{@link GL14C#GL_MAX MAX}
+ * + * @see Reference Page + */ + public static void glBlendEquation(@NativeType("GLenum") int mode) { + GL14C.glBlendEquation(mode); + } + + // --- [ glFogCoordf ] --- + + /** + * Sets the current fog coordinate. + * + * @param coord the fog coordinate value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glFogCoordf(@NativeType("GLfloat") float coord); + + // --- [ glFogCoordd ] --- + + /** + * Double version of {@link #glFogCoordf FogCoordf}. + * + * @param coord the fog coordinate value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glFogCoordd(@NativeType("GLdouble") double coord); + + // --- [ glFogCoordfv ] --- + + /** Unsafe version of: {@link #glFogCoordfv FogCoordfv} */ + public static native void nglFogCoordfv(long coord); + + /** + * Pointer version of {@link #glFogCoordf FogCoordf}. + * + * @param coord the fog coordinate value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glFogCoordfv(@NativeType("GLfloat const *") FloatBuffer coord) { + if (CHECKS) { + check(coord, 1); + } + nglFogCoordfv(memAddress(coord)); + } + + // --- [ glFogCoorddv ] --- + + /** Unsafe version of: {@link #glFogCoorddv FogCoorddv} */ + public static native void nglFogCoorddv(long coord); + + /** + * Pointer version of {@link #glFogCoordd FogCoordd}. + * + * @param coord the fog coordinate value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glFogCoorddv(@NativeType("GLdouble const *") DoubleBuffer coord) { + if (CHECKS) { + check(coord, 1); + } + nglFogCoorddv(memAddress(coord)); + } + + // --- [ glFogCoordPointer ] --- + + /** Unsafe version of: {@link #glFogCoordPointer FogCoordPointer} */ + public static native void nglFogCoordPointer(int type, int stride, long pointer); + + /** + * Specifies the location and organization of a fog coordinate array. + * + * @param type the data type of the values stored in the array. One of:
{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}{@link GL11#GL_DOUBLE DOUBLE}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the fog coordinate array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glFogCoordPointer(@NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + nglFogCoordPointer(type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a fog coordinate array. + * + * @param type the data type of the values stored in the array. One of:
{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}{@link GL11#GL_DOUBLE DOUBLE}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the fog coordinate array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glFogCoordPointer(@NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + nglFogCoordPointer(type, stride, pointer); + } + + /** + * Specifies the location and organization of a fog coordinate array. + * + * @param type the data type of the values stored in the array. One of:
{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}{@link GL11#GL_DOUBLE DOUBLE}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the fog coordinate array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glFogCoordPointer(@NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ShortBuffer pointer) { + nglFogCoordPointer(type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a fog coordinate array. + * + * @param type the data type of the values stored in the array. One of:
{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}{@link GL11#GL_DOUBLE DOUBLE}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the fog coordinate array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glFogCoordPointer(@NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") FloatBuffer pointer) { + nglFogCoordPointer(type, stride, memAddress(pointer)); + } + + // --- [ glMultiDrawArrays ] --- + + /** + * Unsafe version of: {@link #glMultiDrawArrays MultiDrawArrays} + * + * @param drawcount the size of {@code first} and {@code count} + */ + public static void nglMultiDrawArrays(int mode, long first, long count, int drawcount) { + GL14C.nglMultiDrawArrays(mode, first, count, drawcount); + } + + /** + * Renders multiple sets of primitives from array data. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param first an array of starting indices in the enabled arrays + * @param count an array of the number of indices to be rendered + * + * @see Reference Page + */ + public static void glMultiDrawArrays(@NativeType("GLenum") int mode, @NativeType("GLint const *") IntBuffer first, @NativeType("GLsizei const *") IntBuffer count) { + GL14C.glMultiDrawArrays(mode, first, count); + } + + // --- [ glMultiDrawElements ] --- + + /** + * Unsafe version of: {@link #glMultiDrawElements MultiDrawElements} + * + * @param drawcount the size of the {@code count} array + */ + public static void nglMultiDrawElements(int mode, long count, int type, long indices, int drawcount) { + GL14C.nglMultiDrawElements(mode, count, type, indices, drawcount); + } + + /** + * Renders multiple sets of primitives by specifying indices of array data elements. + * + *

LWJGL note: Use {@link org.lwjgl.system.MemoryUtil#memAddress} to retrieve pointers to the index buffers.

+ * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param count an array of the elements counts + * @param type the type of the values in indices. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * + * @see Reference Page + */ + public static void glMultiDrawElements(@NativeType("GLenum") int mode, @NativeType("GLsizei *") IntBuffer count, @NativeType("GLenum") int type, @NativeType("void const **") PointerBuffer indices) { + GL14C.glMultiDrawElements(mode, count, type, indices); + } + + // --- [ glPointParameterf ] --- + + /** + * Sets the float value of a pointer parameter. + * + * @param pname the parameter to set. Must be:
{@link GL14C#GL_POINT_FADE_THRESHOLD_SIZE POINT_FADE_THRESHOLD_SIZE}
+ * @param param the parameter value + * + * @see Reference Page + */ + public static void glPointParameterf(@NativeType("GLenum") int pname, @NativeType("GLfloat") float param) { + GL14C.glPointParameterf(pname, param); + } + + // --- [ glPointParameteri ] --- + + /** + * Integer version of {@link #glPointParameterf PointParameterf}. + * + * @param pname the parameter to set. Must be:
{@link GL14C#GL_POINT_FADE_THRESHOLD_SIZE POINT_FADE_THRESHOLD_SIZE}
+ * @param param the parameter value + * + * @see Reference Page + */ + public static void glPointParameteri(@NativeType("GLenum") int pname, @NativeType("GLint") int param) { + GL14C.glPointParameteri(pname, param); + } + + // --- [ glPointParameterfv ] --- + + /** Unsafe version of: {@link #glPointParameterfv PointParameterfv} */ + public static void nglPointParameterfv(int pname, long params) { + GL14C.nglPointParameterfv(pname, params); + } + + /** + * Pointer version of {@link #glPointParameterf PointParameterf}. + * + * @param pname the parameter to set + * @param params the parameter value + * + * @see Reference Page + */ + public static void glPointParameterfv(@NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer params) { + GL14C.glPointParameterfv(pname, params); + } + + // --- [ glPointParameteriv ] --- + + /** Unsafe version of: {@link #glPointParameteriv PointParameteriv} */ + public static void nglPointParameteriv(int pname, long params) { + GL14C.nglPointParameteriv(pname, params); + } + + /** + * Pointer version of {@link #glPointParameteri PointParameteri}. + * + * @param pname the parameter to set + * @param params the parameter value + * + * @see Reference Page + */ + public static void glPointParameteriv(@NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + GL14C.glPointParameteriv(pname, params); + } + + // --- [ glSecondaryColor3b ] --- + + /** + * Sets the R, G, and B components of the current secondary color. The alpha component is set to 1.0. + * + * @param red the red component of the current secondary color + * @param green the green component of the current secondary color + * @param blue the blue component of the current secondary color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glSecondaryColor3b(@NativeType("GLbyte") byte red, @NativeType("GLbyte") byte green, @NativeType("GLbyte") byte blue); + + // --- [ glSecondaryColor3s ] --- + + /** + * Short version of {@link #glSecondaryColor3b SecondaryColor3b} + * + * @param red the red component of the current secondary color + * @param green the green component of the current secondary color + * @param blue the blue component of the current secondary color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glSecondaryColor3s(@NativeType("GLshort") short red, @NativeType("GLshort") short green, @NativeType("GLshort") short blue); + + // --- [ glSecondaryColor3i ] --- + + /** + * Integer version of {@link #glSecondaryColor3b SecondaryColor3b} + * + * @param red the red component of the current secondary color + * @param green the green component of the current secondary color + * @param blue the blue component of the current secondary color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glSecondaryColor3i(@NativeType("GLint") int red, @NativeType("GLint") int green, @NativeType("GLint") int blue); + + // --- [ glSecondaryColor3f ] --- + + /** + * Float version of {@link #glSecondaryColor3b SecondaryColor3b} + * + * @param red the red component of the current secondary color + * @param green the green component of the current secondary color + * @param blue the blue component of the current secondary color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glSecondaryColor3f(@NativeType("GLfloat") float red, @NativeType("GLfloat") float green, @NativeType("GLfloat") float blue); + + // --- [ glSecondaryColor3d ] --- + + /** + * Double version of {@link #glSecondaryColor3b SecondaryColor3b} + * + * @param red the red component of the current secondary color + * @param green the green component of the current secondary color + * @param blue the blue component of the current secondary color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glSecondaryColor3d(@NativeType("GLdouble") double red, @NativeType("GLdouble") double green, @NativeType("GLdouble") double blue); + + // --- [ glSecondaryColor3ub ] --- + + /** + * Unsigned version of {@link #glSecondaryColor3b SecondaryColor3b} + * + * @param red the red component of the current secondary color + * @param green the green component of the current secondary color + * @param blue the blue component of the current secondary color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glSecondaryColor3ub(@NativeType("GLubyte") byte red, @NativeType("GLubyte") byte green, @NativeType("GLubyte") byte blue); + + // --- [ glSecondaryColor3us ] --- + + /** + * Unsigned short version of {@link #glSecondaryColor3b SecondaryColor3b} + * + * @param red the red component of the current secondary color + * @param green the green component of the current secondary color + * @param blue the blue component of the current secondary color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glSecondaryColor3us(@NativeType("GLushort") short red, @NativeType("GLushort") short green, @NativeType("GLushort") short blue); + + // --- [ glSecondaryColor3ui ] --- + + /** + * Unsigned int version of {@link #glSecondaryColor3b SecondaryColor3b} + * + * @param red the red component of the current secondary color + * @param green the green component of the current secondary color + * @param blue the blue component of the current secondary color + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glSecondaryColor3ui(@NativeType("GLint") int red, @NativeType("GLint") int green, @NativeType("GLint") int blue); + + // --- [ glSecondaryColor3bv ] --- + + /** Unsafe version of: {@link #glSecondaryColor3bv SecondaryColor3bv} */ + public static native void nglSecondaryColor3bv(long v); + + /** + * Byte pointer version of {@link #glSecondaryColor3b SecondaryColor3b}. + * + * @param v the secondary color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSecondaryColor3bv(@NativeType("GLbyte const *") ByteBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglSecondaryColor3bv(memAddress(v)); + } + + // --- [ glSecondaryColor3sv ] --- + + /** Unsafe version of: {@link #glSecondaryColor3sv SecondaryColor3sv} */ + public static native void nglSecondaryColor3sv(long v); + + /** + * Pointer version of {@link #glSecondaryColor3s SecondaryColor3s}. + * + * @param v the secondary color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSecondaryColor3sv(@NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglSecondaryColor3sv(memAddress(v)); + } + + // --- [ glSecondaryColor3iv ] --- + + /** Unsafe version of: {@link #glSecondaryColor3iv SecondaryColor3iv} */ + public static native void nglSecondaryColor3iv(long v); + + /** + * Pointer version of {@link #glSecondaryColor3i SecondaryColor3i}. + * + * @param v the secondary color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSecondaryColor3iv(@NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglSecondaryColor3iv(memAddress(v)); + } + + // --- [ glSecondaryColor3fv ] --- + + /** Unsafe version of: {@link #glSecondaryColor3fv SecondaryColor3fv} */ + public static native void nglSecondaryColor3fv(long v); + + /** + * Pointer version of {@link #glSecondaryColor3f SecondaryColor3f}. + * + * @param v the secondary color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSecondaryColor3fv(@NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglSecondaryColor3fv(memAddress(v)); + } + + // --- [ glSecondaryColor3dv ] --- + + /** Unsafe version of: {@link #glSecondaryColor3dv SecondaryColor3dv} */ + public static native void nglSecondaryColor3dv(long v); + + /** + * Pointer version of {@link #glSecondaryColor3d SecondaryColor3d}. + * + * @param v the secondary color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSecondaryColor3dv(@NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglSecondaryColor3dv(memAddress(v)); + } + + // --- [ glSecondaryColor3ubv ] --- + + /** Unsafe version of: {@link #glSecondaryColor3ubv SecondaryColor3ubv} */ + public static native void nglSecondaryColor3ubv(long v); + + /** + * Pointer version of {@link #glSecondaryColor3ub SecondaryColor3ub}. + * + * @param v the secondary color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSecondaryColor3ubv(@NativeType("GLubyte const *") ByteBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglSecondaryColor3ubv(memAddress(v)); + } + + // --- [ glSecondaryColor3usv ] --- + + /** Unsafe version of: {@link #glSecondaryColor3usv SecondaryColor3usv} */ + public static native void nglSecondaryColor3usv(long v); + + /** + * Pointer version of {@link #glSecondaryColor3us SecondaryColor3us}. + * + * @param v the secondary color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSecondaryColor3usv(@NativeType("GLushort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglSecondaryColor3usv(memAddress(v)); + } + + // --- [ glSecondaryColor3uiv ] --- + + /** Unsafe version of: {@link #glSecondaryColor3uiv SecondaryColor3uiv} */ + public static native void nglSecondaryColor3uiv(long v); + + /** + * Pointer version of {@link #glSecondaryColor3ui SecondaryColor3ui}. + * + * @param v the secondary color buffer + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSecondaryColor3uiv(@NativeType("GLuint const *") IntBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglSecondaryColor3uiv(memAddress(v)); + } + + // --- [ glSecondaryColorPointer ] --- + + /** Unsafe version of: {@link #glSecondaryColorPointer SecondaryColorPointer} */ + public static native void nglSecondaryColorPointer(int size, int type, int stride, long pointer); + + /** + * Specifies the location and organization of a secondary color array. + * + * @param size the number of values per vertex that are stored in the array, as well as their component ordering. Must be:
3
+ * @param type the data type of the values stored in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}
{@link GL11#GL_FLOAT FLOAT}{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the secondary color array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSecondaryColorPointer(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + nglSecondaryColorPointer(size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a secondary color array. + * + * @param size the number of values per vertex that are stored in the array, as well as their component ordering. Must be:
3
+ * @param type the data type of the values stored in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}
{@link GL11#GL_FLOAT FLOAT}{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the secondary color array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSecondaryColorPointer(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + nglSecondaryColorPointer(size, type, stride, pointer); + } + + /** + * Specifies the location and organization of a secondary color array. + * + * @param size the number of values per vertex that are stored in the array, as well as their component ordering. Must be:
3
+ * @param type the data type of the values stored in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}
{@link GL11#GL_FLOAT FLOAT}{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the secondary color array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSecondaryColorPointer(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ShortBuffer pointer) { + nglSecondaryColorPointer(size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a secondary color array. + * + * @param size the number of values per vertex that are stored in the array, as well as their component ordering. Must be:
3
+ * @param type the data type of the values stored in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}
{@link GL11#GL_FLOAT FLOAT}{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the secondary color array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSecondaryColorPointer(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") IntBuffer pointer) { + nglSecondaryColorPointer(size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a secondary color array. + * + * @param size the number of values per vertex that are stored in the array, as well as their component ordering. Must be:
3
+ * @param type the data type of the values stored in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}
{@link GL11#GL_FLOAT FLOAT}{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}
+ * @param stride the vertex stride in bytes. If specified as zero, then array elements are stored sequentially + * @param pointer the secondary color array data + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSecondaryColorPointer(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") FloatBuffer pointer) { + nglSecondaryColorPointer(size, type, stride, memAddress(pointer)); + } + + // --- [ glBlendFuncSeparate ] --- + + /** + * Specifies pixel arithmetic for RGB and alpha components separately. + * + * @param sfactorRGB how the red, green, and blue blending factors are computed. The initial value is GL_ONE. + * @param dfactorRGB how the red, green, and blue destination blending factors are computed. The initial value is GL_ZERO. + * @param sfactorAlpha how the alpha source blending factor is computed. The initial value is GL_ONE. + * @param dfactorAlpha how the alpha destination blending factor is computed. The initial value is GL_ZERO. + * + * @see Reference Page + */ + public static void glBlendFuncSeparate(@NativeType("GLenum") int sfactorRGB, @NativeType("GLenum") int dfactorRGB, @NativeType("GLenum") int sfactorAlpha, @NativeType("GLenum") int dfactorAlpha) { + GL14C.glBlendFuncSeparate(sfactorRGB, dfactorRGB, sfactorAlpha, dfactorAlpha); + } + + // --- [ glWindowPos2i ] --- + + /** + * Alternate way to set the current raster position. {@code z} is implictly set to 0. + * + * @param x the x value + * @param y the y value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glWindowPos2i(@NativeType("GLint") int x, @NativeType("GLint") int y); + + // --- [ glWindowPos2s ] --- + + /** + * Short version of {@link #glWindowPos2i WindowPos2i}. + * + * @param x the x value + * @param y the y value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glWindowPos2s(@NativeType("GLshort") short x, @NativeType("GLshort") short y); + + // --- [ glWindowPos2f ] --- + + /** + * Float version of {@link #glWindowPos2i WindowPos2i}. + * + * @param x the x value + * @param y the y value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glWindowPos2f(@NativeType("GLfloat") float x, @NativeType("GLfloat") float y); + + // --- [ glWindowPos2d ] --- + + /** + * Double version of {@link #glWindowPos2i WindowPos2i}. + * + * @param x the x value + * @param y the y value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glWindowPos2d(@NativeType("GLdouble") double x, @NativeType("GLdouble") double y); + + // --- [ glWindowPos2iv ] --- + + /** Unsafe version of: {@link #glWindowPos2iv WindowPos2iv} */ + public static native void nglWindowPos2iv(long p); + + /** + * Pointer version of {@link #glWindowPos2i WindowPos2i}. + * + * @param p the position value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glWindowPos2iv(@NativeType("GLint const *") IntBuffer p) { + if (CHECKS) { + check(p, 2); + } + nglWindowPos2iv(memAddress(p)); + } + + // --- [ glWindowPos2sv ] --- + + /** Unsafe version of: {@link #glWindowPos2sv WindowPos2sv} */ + public static native void nglWindowPos2sv(long p); + + /** + * Pointer version of {@link #glWindowPos2s WindowPos2s}. + * + * @param p the position value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glWindowPos2sv(@NativeType("GLshort const *") ShortBuffer p) { + if (CHECKS) { + check(p, 2); + } + nglWindowPos2sv(memAddress(p)); + } + + // --- [ glWindowPos2fv ] --- + + /** Unsafe version of: {@link #glWindowPos2fv WindowPos2fv} */ + public static native void nglWindowPos2fv(long p); + + /** + * Pointer version of {@link #glWindowPos2f WindowPos2f}. + * + * @param p the position value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glWindowPos2fv(@NativeType("GLfloat const *") FloatBuffer p) { + if (CHECKS) { + check(p, 2); + } + nglWindowPos2fv(memAddress(p)); + } + + // --- [ glWindowPos2dv ] --- + + /** Unsafe version of: {@link #glWindowPos2dv WindowPos2dv} */ + public static native void nglWindowPos2dv(long p); + + /** + * Pointer version of {@link #glWindowPos2d WindowPos2d}. + * + * @param p the position value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glWindowPos2dv(@NativeType("GLdouble const *") DoubleBuffer p) { + if (CHECKS) { + check(p, 2); + } + nglWindowPos2dv(memAddress(p)); + } + + // --- [ glWindowPos3i ] --- + + /** + * Alternate way to set the current raster position. + * + * @param x the x value + * @param y the y value + * @param z the z value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glWindowPos3i(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z); + + // --- [ glWindowPos3s ] --- + + /** + * Short version of {@link #glWindowPos3i WindowPos3i}. + * + * @param x the x value + * @param y the y value + * @param z the z value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glWindowPos3s(@NativeType("GLshort") short x, @NativeType("GLshort") short y, @NativeType("GLshort") short z); + + // --- [ glWindowPos3f ] --- + + /** + * Float version of {@link #glWindowPos3i WindowPos3i}. + * + * @param x the x value + * @param y the y value + * @param z the z value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glWindowPos3f(@NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z); + + // --- [ glWindowPos3d ] --- + + /** + * Double version of {@link #glWindowPos3i WindowPos3i}. + * + * @param x the x value + * @param y the y value + * @param z the z value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glWindowPos3d(@NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z); + + // --- [ glWindowPos3iv ] --- + + /** Unsafe version of: {@link #glWindowPos3iv WindowPos3iv} */ + public static native void nglWindowPos3iv(long p); + + /** + * Pointer version of {@link #glWindowPos3i WindowPos3i}. + * + * @param p the position value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glWindowPos3iv(@NativeType("GLint const *") IntBuffer p) { + if (CHECKS) { + check(p, 3); + } + nglWindowPos3iv(memAddress(p)); + } + + // --- [ glWindowPos3sv ] --- + + /** Unsafe version of: {@link #glWindowPos3sv WindowPos3sv} */ + public static native void nglWindowPos3sv(long p); + + /** + * Pointer version of {@link #glWindowPos3s WindowPos3s}. + * + * @param p the position value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glWindowPos3sv(@NativeType("GLshort const *") ShortBuffer p) { + if (CHECKS) { + check(p, 3); + } + nglWindowPos3sv(memAddress(p)); + } + + // --- [ glWindowPos3fv ] --- + + /** Unsafe version of: {@link #glWindowPos3fv WindowPos3fv} */ + public static native void nglWindowPos3fv(long p); + + /** + * Pointer version of {@link #glWindowPos3f WindowPos3f}. + * + * @param p the position value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glWindowPos3fv(@NativeType("GLfloat const *") FloatBuffer p) { + if (CHECKS) { + check(p, 3); + } + nglWindowPos3fv(memAddress(p)); + } + + // --- [ glWindowPos3dv ] --- + + /** Unsafe version of: {@link #glWindowPos3dv WindowPos3dv} */ + public static native void nglWindowPos3dv(long p); + + /** + * Pointer version of {@link #glWindowPos3d WindowPos3d}. + * + * @param p the position value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glWindowPos3dv(@NativeType("GLdouble const *") DoubleBuffer p) { + if (CHECKS) { + check(p, 3); + } + nglWindowPos3dv(memAddress(p)); + } + + /** + * Array version of: {@link #glFogCoordfv FogCoordfv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glFogCoordfv(@NativeType("GLfloat const *") float[] coord) { + long __functionAddress = GL.getICD().glFogCoordfv; + if (CHECKS) { + check(__functionAddress); + check(coord, 1); + } + callPV(coord, __functionAddress); + } + + /** + * Array version of: {@link #glFogCoorddv FogCoorddv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glFogCoorddv(@NativeType("GLdouble const *") double[] coord) { + long __functionAddress = GL.getICD().glFogCoorddv; + if (CHECKS) { + check(__functionAddress); + check(coord, 1); + } + callPV(coord, __functionAddress); + } + + /** + * Array version of: {@link #glMultiDrawArrays MultiDrawArrays} + * + * @see Reference Page + */ + public static void glMultiDrawArrays(@NativeType("GLenum") int mode, @NativeType("GLint const *") int[] first, @NativeType("GLsizei const *") int[] count) { + GL14C.glMultiDrawArrays(mode, first, count); + } + + /** + * Array version of: {@link #glMultiDrawElements MultiDrawElements} + * + * @see Reference Page + */ + public static void glMultiDrawElements(@NativeType("GLenum") int mode, @NativeType("GLsizei *") int[] count, @NativeType("GLenum") int type, @NativeType("void const **") PointerBuffer indices) { + GL14C.glMultiDrawElements(mode, count, type, indices); + } + + /** + * Array version of: {@link #glPointParameterfv PointParameterfv} + * + * @see Reference Page + */ + public static void glPointParameterfv(@NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] params) { + GL14C.glPointParameterfv(pname, params); + } + + /** + * Array version of: {@link #glPointParameteriv PointParameteriv} + * + * @see Reference Page + */ + public static void glPointParameteriv(@NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + GL14C.glPointParameteriv(pname, params); + } + + /** + * Array version of: {@link #glSecondaryColor3sv SecondaryColor3sv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSecondaryColor3sv(@NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glSecondaryColor3sv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glSecondaryColor3iv SecondaryColor3iv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSecondaryColor3iv(@NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glSecondaryColor3iv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glSecondaryColor3fv SecondaryColor3fv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSecondaryColor3fv(@NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glSecondaryColor3fv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glSecondaryColor3dv SecondaryColor3dv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSecondaryColor3dv(@NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glSecondaryColor3dv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glSecondaryColor3usv SecondaryColor3usv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSecondaryColor3usv(@NativeType("GLushort const *") short[] v) { + long __functionAddress = GL.getICD().glSecondaryColor3usv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glSecondaryColor3uiv SecondaryColor3uiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSecondaryColor3uiv(@NativeType("GLuint const *") int[] v) { + long __functionAddress = GL.getICD().glSecondaryColor3uiv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** + * Array version of: {@link #glWindowPos2iv WindowPos2iv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glWindowPos2iv(@NativeType("GLint const *") int[] p) { + long __functionAddress = GL.getICD().glWindowPos2iv; + if (CHECKS) { + check(__functionAddress); + check(p, 2); + } + callPV(p, __functionAddress); + } + + /** + * Array version of: {@link #glWindowPos2sv WindowPos2sv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glWindowPos2sv(@NativeType("GLshort const *") short[] p) { + long __functionAddress = GL.getICD().glWindowPos2sv; + if (CHECKS) { + check(__functionAddress); + check(p, 2); + } + callPV(p, __functionAddress); + } + + /** + * Array version of: {@link #glWindowPos2fv WindowPos2fv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glWindowPos2fv(@NativeType("GLfloat const *") float[] p) { + long __functionAddress = GL.getICD().glWindowPos2fv; + if (CHECKS) { + check(__functionAddress); + check(p, 2); + } + callPV(p, __functionAddress); + } + + /** + * Array version of: {@link #glWindowPos2dv WindowPos2dv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glWindowPos2dv(@NativeType("GLdouble const *") double[] p) { + long __functionAddress = GL.getICD().glWindowPos2dv; + if (CHECKS) { + check(__functionAddress); + check(p, 2); + } + callPV(p, __functionAddress); + } + + /** + * Array version of: {@link #glWindowPos3iv WindowPos3iv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glWindowPos3iv(@NativeType("GLint const *") int[] p) { + long __functionAddress = GL.getICD().glWindowPos3iv; + if (CHECKS) { + check(__functionAddress); + check(p, 3); + } + callPV(p, __functionAddress); + } + + /** + * Array version of: {@link #glWindowPos3sv WindowPos3sv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glWindowPos3sv(@NativeType("GLshort const *") short[] p) { + long __functionAddress = GL.getICD().glWindowPos3sv; + if (CHECKS) { + check(__functionAddress); + check(p, 3); + } + callPV(p, __functionAddress); + } + + /** + * Array version of: {@link #glWindowPos3fv WindowPos3fv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glWindowPos3fv(@NativeType("GLfloat const *") float[] p) { + long __functionAddress = GL.getICD().glWindowPos3fv; + if (CHECKS) { + check(__functionAddress); + check(p, 3); + } + callPV(p, __functionAddress); + } + + /** + * Array version of: {@link #glWindowPos3dv WindowPos3dv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glWindowPos3dv(@NativeType("GLdouble const *") double[] p) { + long __functionAddress = GL.getICD().glWindowPos3dv; + if (CHECKS) { + check(__functionAddress); + check(p, 3); + } + callPV(p, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL14C.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL14C.java new file mode 100644 index 00000000..ac6efbb7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL14C.java @@ -0,0 +1,318 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality of a forward compatible context, up to version 1.4. + * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL14C extends GL13C { + + /** Accepted by the {@code sfactor} and {@code dfactor} parameters of BlendFunc. */ + public static final int + GL_CONSTANT_COLOR = 0x8001, + GL_ONE_MINUS_CONSTANT_COLOR = 0x8002, + GL_CONSTANT_ALPHA = 0x8003, + GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004; + + /** Accepted by the {@code mode} parameter of BlendEquation. */ + public static final int + GL_FUNC_ADD = 0x8006, + GL_MIN = 0x8007, + GL_MAX = 0x8008; + + /** Accepted by the {@code mode} parameter of BlendEquation. */ + public static final int + GL_FUNC_SUBTRACT = 0x800A, + GL_FUNC_REVERSE_SUBTRACT = 0x800B; + + /** Accepted by the {@code internalFormat} parameter of TexImage1D, TexImage2D, CopyTexImage1D and CopyTexImage2D. */ + public static final int + GL_DEPTH_COMPONENT16 = 0x81A5, + GL_DEPTH_COMPONENT24 = 0x81A6, + GL_DEPTH_COMPONENT32 = 0x81A7; + + /** Accepted by the {@code pname} parameter of GetTexLevelParameterfv and GetTexLevelParameteriv. */ + public static final int GL_TEXTURE_DEPTH_SIZE = 0x884A; + + /** Accepted by the {@code pname} parameter of TexParameterf, TexParameteri, TexParameterfv, TexParameteriv, GetTexParameterfv, and GetTexParameteriv. */ + public static final int + GL_TEXTURE_COMPARE_MODE = 0x884C, + GL_TEXTURE_COMPARE_FUNC = 0x884D; + + /** Accepted by the {@code pname} parameter of PointParameterfARB, and the {@code pname} of Get. */ + public static final int GL_POINT_FADE_THRESHOLD_SIZE = 0x8128; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_BLEND_DST_RGB = 0x80C8, + GL_BLEND_SRC_RGB = 0x80C9, + GL_BLEND_DST_ALPHA = 0x80CA, + GL_BLEND_SRC_ALPHA = 0x80CB; + + /** Accepted by the {@code sfail}, {@code dpfail}, and {@code dppass} parameter of StencilOp. */ + public static final int + GL_INCR_WRAP = 0x8507, + GL_DECR_WRAP = 0x8508; + + /** + * When the {@code target} parameter of GetTexEnvfv, GetTexEnviv, TexEnvi, TexEnvf, TexEnviv, and TexEnvfv is TEXTURE_FILTER_CONTROL, then the value of + * {@code pname} may be. + */ + public static final int GL_TEXTURE_LOD_BIAS = 0x8501; + + /** Accepted by the {@code pname} parameters of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_MAX_TEXTURE_LOD_BIAS = 0x84FD; + + /** + * Accepted by the {@code param} parameter of TexParameteri and TexParameterf, and by the {@code params} parameter of TexParameteriv and TexParameterfv, + * when their {@code pname} parameter is TEXTURE_WRAP_S, TEXTURE_WRAP_T, or TEXTURE_WRAP_R. + */ + public static final int GL_MIRRORED_REPEAT = 0x8370; + + static { GL.initialize(); } + + protected GL14C() { + throw new UnsupportedOperationException(); + } + + // --- [ glBlendColor ] --- + + /** + * Specifies the constant color Cc to be used in blending. + * + * @param red the red color component + * @param green the green color component + * @param blue the blue color component + * @param alpha the alpha color component + * + * @see Reference Page + */ + public static native void glBlendColor(@NativeType("GLfloat") float red, @NativeType("GLfloat") float green, @NativeType("GLfloat") float blue, @NativeType("GLfloat") float alpha); + + // --- [ glBlendEquation ] --- + + /** + * Controls the blend equations used for per-fragment blending. + * + * @param mode the blend equation. One of:
{@link #GL_FUNC_ADD FUNC_ADD}{@link #GL_FUNC_SUBTRACT FUNC_SUBTRACT}{@link #GL_FUNC_REVERSE_SUBTRACT FUNC_REVERSE_SUBTRACT}{@link #GL_MIN MIN}{@link #GL_MAX MAX}
+ * + * @see Reference Page + */ + public static native void glBlendEquation(@NativeType("GLenum") int mode); + + // --- [ glMultiDrawArrays ] --- + + /** + * Unsafe version of: {@link #glMultiDrawArrays MultiDrawArrays} + * + * @param drawcount the size of {@code first} and {@code count} + */ + public static native void nglMultiDrawArrays(int mode, long first, long count, int drawcount); + + /** + * Renders multiple sets of primitives from array data. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param first an array of starting indices in the enabled arrays + * @param count an array of the number of indices to be rendered + * + * @see Reference Page + */ + public static void glMultiDrawArrays(@NativeType("GLenum") int mode, @NativeType("GLint const *") IntBuffer first, @NativeType("GLsizei const *") IntBuffer count) { + if (CHECKS) { + check(count, first.remaining()); + } + nglMultiDrawArrays(mode, memAddress(first), memAddress(count), first.remaining()); + } + + // --- [ glMultiDrawElements ] --- + + /** + * Unsafe version of: {@link #glMultiDrawElements MultiDrawElements} + * + * @param drawcount the size of the {@code count} array + */ + public static native void nglMultiDrawElements(int mode, long count, int type, long indices, int drawcount); + + /** + * Renders multiple sets of primitives by specifying indices of array data elements. + * + *

LWJGL note: Use {@link org.lwjgl.system.MemoryUtil#memAddress} to retrieve pointers to the index buffers.

+ * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param count an array of the elements counts + * @param type the type of the values in indices. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * + * @see Reference Page + */ + public static void glMultiDrawElements(@NativeType("GLenum") int mode, @NativeType("GLsizei *") IntBuffer count, @NativeType("GLenum") int type, @NativeType("void const **") PointerBuffer indices) { + if (CHECKS) { + check(indices, count.remaining()); + } + nglMultiDrawElements(mode, memAddress(count), type, memAddress(indices), count.remaining()); + } + + // --- [ glPointParameterf ] --- + + /** + * Sets the float value of a pointer parameter. + * + * @param pname the parameter to set. Must be:
{@link #GL_POINT_FADE_THRESHOLD_SIZE POINT_FADE_THRESHOLD_SIZE}
+ * @param param the parameter value + * + * @see Reference Page + */ + public static native void glPointParameterf(@NativeType("GLenum") int pname, @NativeType("GLfloat") float param); + + // --- [ glPointParameteri ] --- + + /** + * Integer version of {@link #glPointParameterf PointParameterf}. + * + * @param pname the parameter to set. Must be:
{@link #GL_POINT_FADE_THRESHOLD_SIZE POINT_FADE_THRESHOLD_SIZE}
+ * @param param the parameter value + * + * @see Reference Page + */ + public static native void glPointParameteri(@NativeType("GLenum") int pname, @NativeType("GLint") int param); + + // --- [ glPointParameterfv ] --- + + /** Unsafe version of: {@link #glPointParameterfv PointParameterfv} */ + public static native void nglPointParameterfv(int pname, long params); + + /** + * Pointer version of {@link #glPointParameterf PointParameterf}. + * + * @param pname the parameter to set + * @param params the parameter value + * + * @see Reference Page + */ + public static void glPointParameterfv(@NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer params) { + if (CHECKS) { + check(params, 3); + } + nglPointParameterfv(pname, memAddress(params)); + } + + // --- [ glPointParameteriv ] --- + + /** Unsafe version of: {@link #glPointParameteriv PointParameteriv} */ + public static native void nglPointParameteriv(int pname, long params); + + /** + * Pointer version of {@link #glPointParameteri PointParameteri}. + * + * @param pname the parameter to set + * @param params the parameter value + * + * @see Reference Page + */ + public static void glPointParameteriv(@NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 3); + } + nglPointParameteriv(pname, memAddress(params)); + } + + // --- [ glBlendFuncSeparate ] --- + + /** + * Specifies pixel arithmetic for RGB and alpha components separately. + * + * @param sfactorRGB how the red, green, and blue blending factors are computed. The initial value is GL_ONE. + * @param dfactorRGB how the red, green, and blue destination blending factors are computed. The initial value is GL_ZERO. + * @param sfactorAlpha how the alpha source blending factor is computed. The initial value is GL_ONE. + * @param dfactorAlpha how the alpha destination blending factor is computed. The initial value is GL_ZERO. + * + * @see Reference Page + */ + public static native void glBlendFuncSeparate(@NativeType("GLenum") int sfactorRGB, @NativeType("GLenum") int dfactorRGB, @NativeType("GLenum") int sfactorAlpha, @NativeType("GLenum") int dfactorAlpha); + + /** + * Array version of: {@link #glMultiDrawArrays MultiDrawArrays} + * + * @see Reference Page + */ + public static void glMultiDrawArrays(@NativeType("GLenum") int mode, @NativeType("GLint const *") int[] first, @NativeType("GLsizei const *") int[] count) { + long __functionAddress = GL.getICD().glMultiDrawArrays; + if (CHECKS) { + check(__functionAddress); + check(count, first.length); + } + callPPV(mode, first, count, first.length, __functionAddress); + } + + /** + * Array version of: {@link #glMultiDrawElements MultiDrawElements} + * + * @see Reference Page + */ + public static void glMultiDrawElements(@NativeType("GLenum") int mode, @NativeType("GLsizei *") int[] count, @NativeType("GLenum") int type, @NativeType("void const **") PointerBuffer indices) { + long __functionAddress = GL.getICD().glMultiDrawElements; + if (CHECKS) { + check(__functionAddress); + check(indices, count.length); + } + callPPV(mode, count, type, memAddress(indices), count.length, __functionAddress); + } + + /** + * Array version of: {@link #glPointParameterfv PointParameterfv} + * + * @see Reference Page + */ + public static void glPointParameterfv(@NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] params) { + long __functionAddress = GL.getICD().glPointParameterfv; + if (CHECKS) { + check(__functionAddress); + check(params, 3); + } + callPV(pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glPointParameteriv PointParameteriv} + * + * @see Reference Page + */ + public static void glPointParameteriv(@NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glPointParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 3); + } + callPV(pname, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL15.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL15.java new file mode 100644 index 00000000..192fd3cd --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL15.java @@ -0,0 +1,1200 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * The OpenGL functionality up to version 1.5. Includes the deprecated symbols of the Compatibility Profile. + * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL15 extends GL14 { + + /** New token names. */ + public static final int + GL_FOG_COORD_SRC = 0x8450, + GL_FOG_COORD = 0x8451, + GL_CURRENT_FOG_COORD = 0x8453, + GL_FOG_COORD_ARRAY_TYPE = 0x8454, + GL_FOG_COORD_ARRAY_STRIDE = 0x8455, + GL_FOG_COORD_ARRAY_POINTER = 0x8456, + GL_FOG_COORD_ARRAY = 0x8457, + GL_FOG_COORD_ARRAY_BUFFER_BINDING = 0x889D, + GL_SRC0_RGB = 0x8580, + GL_SRC1_RGB = 0x8581, + GL_SRC2_RGB = 0x8582, + GL_SRC0_ALPHA = 0x8588, + GL_SRC1_ALPHA = 0x8589, + GL_SRC2_ALPHA = 0x858A; + + /** + * Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, + * GetBufferParameteriv, and GetBufferPointerv. + */ + public static final int + GL_ARRAY_BUFFER = 0x8892, + GL_ELEMENT_ARRAY_BUFFER = 0x8893; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_ARRAY_BUFFER_BINDING = 0x8894, + GL_ELEMENT_ARRAY_BUFFER_BINDING = 0x8895, + GL_VERTEX_ARRAY_BUFFER_BINDING = 0x8896, + GL_NORMAL_ARRAY_BUFFER_BINDING = 0x8897, + GL_COLOR_ARRAY_BUFFER_BINDING = 0x8898, + GL_INDEX_ARRAY_BUFFER_BINDING = 0x8899, + GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING = 0x889A, + GL_EDGE_FLAG_ARRAY_BUFFER_BINDING = 0x889B, + GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING = 0x889C, + GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING = 0x889D, + GL_WEIGHT_ARRAY_BUFFER_BINDING = 0x889E; + + /** Accepted by the {@code pname} parameter of GetVertexAttribiv. */ + public static final int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F; + + /** Accepted by the {@code usage} parameter of BufferData. */ + public static final int + GL_STREAM_DRAW = 0x88E0, + GL_STREAM_READ = 0x88E1, + GL_STREAM_COPY = 0x88E2, + GL_STATIC_DRAW = 0x88E4, + GL_STATIC_READ = 0x88E5, + GL_STATIC_COPY = 0x88E6, + GL_DYNAMIC_DRAW = 0x88E8, + GL_DYNAMIC_READ = 0x88E9, + GL_DYNAMIC_COPY = 0x88EA; + + /** Accepted by the {@code access} parameter of MapBuffer. */ + public static final int + GL_READ_ONLY = 0x88B8, + GL_WRITE_ONLY = 0x88B9, + GL_READ_WRITE = 0x88BA; + + /** Accepted by the {@code pname} parameter of GetBufferParameteriv. */ + public static final int + GL_BUFFER_SIZE = 0x8764, + GL_BUFFER_USAGE = 0x8765, + GL_BUFFER_ACCESS = 0x88BB, + GL_BUFFER_MAPPED = 0x88BC; + + /** Accepted by the {@code pname} parameter of GetBufferPointerv. */ + public static final int GL_BUFFER_MAP_POINTER = 0x88BD; + + /** Accepted by the {@code target} parameter of BeginQuery, EndQuery, and GetQueryiv. */ + public static final int GL_SAMPLES_PASSED = 0x8914; + + /** Accepted by the {@code pname} parameter of GetQueryiv. */ + public static final int + GL_QUERY_COUNTER_BITS = 0x8864, + GL_CURRENT_QUERY = 0x8865; + + /** Accepted by the {@code pname} parameter of GetQueryObjectiv and GetQueryObjectuiv. */ + public static final int + GL_QUERY_RESULT = 0x8866, + GL_QUERY_RESULT_AVAILABLE = 0x8867; + + static { GL.initialize(); } + + protected GL15() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBindBuffer, caps.glDeleteBuffers, caps.glGenBuffers, caps.glIsBuffer, caps.glBufferData, caps.glBufferSubData, caps.glGetBufferSubData, + caps.glMapBuffer, caps.glUnmapBuffer, caps.glGetBufferParameteriv, caps.glGetBufferPointerv, caps.glGenQueries, caps.glDeleteQueries, + caps.glIsQuery, caps.glBeginQuery, caps.glEndQuery, caps.glGetQueryiv, caps.glGetQueryObjectiv, caps.glGetQueryObjectuiv + ); + } + + // --- [ glBindBuffer ] --- + + /** + * Binds a named buffer object. + * + * @param target the target to which the buffer object is bound. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param buffer the name of a buffer object + * + * @see Reference Page + */ + public static void glBindBuffer(@NativeType("GLenum") int target, @NativeType("GLuint") int buffer) { + GL15C.glBindBuffer(target, buffer); + } + + // --- [ glDeleteBuffers ] --- + + /** + * Unsafe version of: {@link #glDeleteBuffers DeleteBuffers} + * + * @param n the number of buffer objects to be deleted + */ + public static void nglDeleteBuffers(int n, long buffers) { + GL15C.nglDeleteBuffers(n, buffers); + } + + /** + * Deletes named buffer objects. + * + * @param buffers an array of buffer objects to be deleted + * + * @see Reference Page + */ + public static void glDeleteBuffers(@NativeType("GLuint const *") IntBuffer buffers) { + GL15C.glDeleteBuffers(buffers); + } + + /** + * Deletes named buffer objects. + * + * @see Reference Page + */ + public static void glDeleteBuffers(@NativeType("GLuint const *") int buffer) { + GL15C.glDeleteBuffers(buffer); + } + + // --- [ glGenBuffers ] --- + + /** + * Unsafe version of: {@link #glGenBuffers GenBuffers} + * + * @param n the number of buffer object names to be generated + */ + public static void nglGenBuffers(int n, long buffers) { + GL15C.nglGenBuffers(n, buffers); + } + + /** + * Generates buffer object names. + * + * @param buffers a buffer in which the generated buffer object names are stored + * + * @see Reference Page + */ + public static void glGenBuffers(@NativeType("GLuint *") IntBuffer buffers) { + GL15C.glGenBuffers(buffers); + } + + /** + * Generates buffer object names. + * + * @see Reference Page + */ + @NativeType("void") + public static int glGenBuffers() { + return GL15C.glGenBuffers(); + } + + // --- [ glIsBuffer ] --- + + /** + * Determines if a name corresponds to a buffer object. + * + * @param buffer a value that may be the name of a buffer object + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static boolean glIsBuffer(@NativeType("GLuint") int buffer) { + return GL15C.glIsBuffer(buffer); + } + + // --- [ glBufferData ] --- + + /** + * Unsafe version of: {@link #glBufferData BufferData} + * + * @param size the size in bytes of the buffer object's new data store + */ + public static void nglBufferData(int target, long size, long data, int usage) { + GL15C.nglBufferData(target, size, data, usage); + } + + /** + * Creates and initializes a buffer object's data store. + * + *

{@code usage} is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make + * more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store. + * {@code usage} can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The + * frequency of access may be one of these:

+ * + *
    + *
  • STREAM - The data store contents will be modified once and used at most a few times.
  • + *
  • STATIC - The data store contents will be modified once and used many times.
  • + *
  • DYNAMIC - The data store contents will be modified repeatedly and used many times.
  • + *
+ * + *

The nature of access may be one of these:

+ * + *
    + *
  • DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
  • + *
  • READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
  • + *
  • COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
  • + *
+ * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param size the size in bytes of the buffer object's new data store + * @param usage the expected usage pattern of the data store. One of:
{@link GL15C#GL_STREAM_DRAW STREAM_DRAW}{@link GL15C#GL_STREAM_READ STREAM_READ}{@link GL15C#GL_STREAM_COPY STREAM_COPY}{@link GL15C#GL_STATIC_DRAW STATIC_DRAW}{@link GL15C#GL_STATIC_READ STATIC_READ}{@link GL15C#GL_STATIC_COPY STATIC_COPY}{@link GL15C#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15C#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15C#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int usage) { + GL15C.glBufferData(target, size, usage); + } + + /** + * Creates and initializes a buffer object's data store. + * + *

{@code usage} is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make + * more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store. + * {@code usage} can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The + * frequency of access may be one of these:

+ * + *
    + *
  • STREAM - The data store contents will be modified once and used at most a few times.
  • + *
  • STATIC - The data store contents will be modified once and used many times.
  • + *
  • DYNAMIC - The data store contents will be modified repeatedly and used many times.
  • + *
+ * + *

The nature of access may be one of these:

+ * + *
    + *
  • DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
  • + *
  • READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
  • + *
  • COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
  • + *
+ * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15C#GL_STREAM_DRAW STREAM_DRAW}{@link GL15C#GL_STREAM_READ STREAM_READ}{@link GL15C#GL_STREAM_COPY STREAM_COPY}{@link GL15C#GL_STATIC_DRAW STATIC_DRAW}{@link GL15C#GL_STATIC_READ STATIC_READ}{@link GL15C#GL_STATIC_COPY STATIC_COPY}{@link GL15C#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15C#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15C#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("void const *") ByteBuffer data, @NativeType("GLenum") int usage) { + GL15C.glBufferData(target, data, usage); + } + + /** + * Creates and initializes a buffer object's data store. + * + *

{@code usage} is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make + * more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store. + * {@code usage} can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The + * frequency of access may be one of these:

+ * + *
    + *
  • STREAM - The data store contents will be modified once and used at most a few times.
  • + *
  • STATIC - The data store contents will be modified once and used many times.
  • + *
  • DYNAMIC - The data store contents will be modified repeatedly and used many times.
  • + *
+ * + *

The nature of access may be one of these:

+ * + *
    + *
  • DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
  • + *
  • READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
  • + *
  • COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
  • + *
+ * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15C#GL_STREAM_DRAW STREAM_DRAW}{@link GL15C#GL_STREAM_READ STREAM_READ}{@link GL15C#GL_STREAM_COPY STREAM_COPY}{@link GL15C#GL_STATIC_DRAW STATIC_DRAW}{@link GL15C#GL_STATIC_READ STATIC_READ}{@link GL15C#GL_STATIC_COPY STATIC_COPY}{@link GL15C#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15C#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15C#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("void const *") ShortBuffer data, @NativeType("GLenum") int usage) { + GL15C.glBufferData(target, data, usage); + } + + /** + * Creates and initializes a buffer object's data store. + * + *

{@code usage} is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make + * more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store. + * {@code usage} can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The + * frequency of access may be one of these:

+ * + *
    + *
  • STREAM - The data store contents will be modified once and used at most a few times.
  • + *
  • STATIC - The data store contents will be modified once and used many times.
  • + *
  • DYNAMIC - The data store contents will be modified repeatedly and used many times.
  • + *
+ * + *

The nature of access may be one of these:

+ * + *
    + *
  • DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
  • + *
  • READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
  • + *
  • COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
  • + *
+ * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15C#GL_STREAM_DRAW STREAM_DRAW}{@link GL15C#GL_STREAM_READ STREAM_READ}{@link GL15C#GL_STREAM_COPY STREAM_COPY}{@link GL15C#GL_STATIC_DRAW STATIC_DRAW}{@link GL15C#GL_STATIC_READ STATIC_READ}{@link GL15C#GL_STATIC_COPY STATIC_COPY}{@link GL15C#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15C#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15C#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("void const *") IntBuffer data, @NativeType("GLenum") int usage) { + GL15C.glBufferData(target, data, usage); + } + + /** + * Creates and initializes a buffer object's data store. + * + *

{@code usage} is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make + * more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store. + * {@code usage} can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The + * frequency of access may be one of these:

+ * + *
    + *
  • STREAM - The data store contents will be modified once and used at most a few times.
  • + *
  • STATIC - The data store contents will be modified once and used many times.
  • + *
  • DYNAMIC - The data store contents will be modified repeatedly and used many times.
  • + *
+ * + *

The nature of access may be one of these:

+ * + *
    + *
  • DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
  • + *
  • READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
  • + *
  • COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
  • + *
+ * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15C#GL_STREAM_DRAW STREAM_DRAW}{@link GL15C#GL_STREAM_READ STREAM_READ}{@link GL15C#GL_STREAM_COPY STREAM_COPY}{@link GL15C#GL_STATIC_DRAW STATIC_DRAW}{@link GL15C#GL_STATIC_READ STATIC_READ}{@link GL15C#GL_STATIC_COPY STATIC_COPY}{@link GL15C#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15C#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15C#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("void const *") LongBuffer data, @NativeType("GLenum") int usage) { + GL15C.glBufferData(target, data, usage); + } + + /** + * Creates and initializes a buffer object's data store. + * + *

{@code usage} is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make + * more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store. + * {@code usage} can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The + * frequency of access may be one of these:

+ * + *
    + *
  • STREAM - The data store contents will be modified once and used at most a few times.
  • + *
  • STATIC - The data store contents will be modified once and used many times.
  • + *
  • DYNAMIC - The data store contents will be modified repeatedly and used many times.
  • + *
+ * + *

The nature of access may be one of these:

+ * + *
    + *
  • DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
  • + *
  • READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
  • + *
  • COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
  • + *
+ * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15C#GL_STREAM_DRAW STREAM_DRAW}{@link GL15C#GL_STREAM_READ STREAM_READ}{@link GL15C#GL_STREAM_COPY STREAM_COPY}{@link GL15C#GL_STATIC_DRAW STATIC_DRAW}{@link GL15C#GL_STATIC_READ STATIC_READ}{@link GL15C#GL_STATIC_COPY STATIC_COPY}{@link GL15C#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15C#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15C#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("void const *") FloatBuffer data, @NativeType("GLenum") int usage) { + GL15C.glBufferData(target, data, usage); + } + + /** + * Creates and initializes a buffer object's data store. + * + *

{@code usage} is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make + * more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store. + * {@code usage} can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The + * frequency of access may be one of these:

+ * + *
    + *
  • STREAM - The data store contents will be modified once and used at most a few times.
  • + *
  • STATIC - The data store contents will be modified once and used many times.
  • + *
  • DYNAMIC - The data store contents will be modified repeatedly and used many times.
  • + *
+ * + *

The nature of access may be one of these:

+ * + *
    + *
  • DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
  • + *
  • READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
  • + *
  • COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
  • + *
+ * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15C#GL_STREAM_DRAW STREAM_DRAW}{@link GL15C#GL_STREAM_READ STREAM_READ}{@link GL15C#GL_STREAM_COPY STREAM_COPY}{@link GL15C#GL_STATIC_DRAW STATIC_DRAW}{@link GL15C#GL_STATIC_READ STATIC_READ}{@link GL15C#GL_STATIC_COPY STATIC_COPY}{@link GL15C#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15C#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15C#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("void const *") DoubleBuffer data, @NativeType("GLenum") int usage) { + GL15C.glBufferData(target, data, usage); + } + + // --- [ glBufferSubData ] --- + + /** + * Unsafe version of: {@link #glBufferSubData BufferSubData} + * + * @param size the size in bytes of the data store region being replaced + */ + public static void nglBufferSubData(int target, long offset, long size, long data) { + GL15C.nglBufferSubData(target, offset, size, data); + } + + /** + * Updates a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void const *") ByteBuffer data) { + GL15C.glBufferSubData(target, offset, data); + } + + /** + * Updates a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void const *") ShortBuffer data) { + GL15C.glBufferSubData(target, offset, data); + } + + /** + * Updates a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void const *") IntBuffer data) { + GL15C.glBufferSubData(target, offset, data); + } + + /** + * Updates a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void const *") LongBuffer data) { + GL15C.glBufferSubData(target, offset, data); + } + + /** + * Updates a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void const *") FloatBuffer data) { + GL15C.glBufferSubData(target, offset, data); + } + + /** + * Updates a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void const *") DoubleBuffer data) { + GL15C.glBufferSubData(target, offset, data); + } + + // --- [ glGetBufferSubData ] --- + + /** + * Unsafe version of: {@link #glGetBufferSubData GetBufferSubData} + * + * @param size the size in bytes of the data store region being returned + */ + public static void nglGetBufferSubData(int target, long offset, long size, long data) { + GL15C.nglGetBufferSubData(target, offset, size, data); + } + + /** + * Returns a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void *") ByteBuffer data) { + GL15C.glGetBufferSubData(target, offset, data); + } + + /** + * Returns a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void *") ShortBuffer data) { + GL15C.glGetBufferSubData(target, offset, data); + } + + /** + * Returns a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void *") IntBuffer data) { + GL15C.glGetBufferSubData(target, offset, data); + } + + /** + * Returns a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void *") LongBuffer data) { + GL15C.glGetBufferSubData(target, offset, data); + } + + /** + * Returns a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void *") FloatBuffer data) { + GL15C.glGetBufferSubData(target, offset, data); + } + + /** + * Returns a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void *") DoubleBuffer data) { + GL15C.glGetBufferSubData(target, offset, data); + } + + // --- [ glMapBuffer ] --- + + /** Unsafe version of: {@link #glMapBuffer MapBuffer} */ + public static long nglMapBuffer(int target, int access) { + return GL15C.nglMapBuffer(target, access); + } + + /** + * Maps a buffer object's data store. + * + *

LWJGL note: This method comes in 3 flavors:

+ * + *
    + *
  1. {@link #glMapBuffer(int, int)} - Calls {@link #glGetBufferParameteriv GetBufferParameteriv} to retrieve the buffer size and a new ByteBuffer instance is always returned.
  2. + *
  3. {@link #glMapBuffer(int, int, ByteBuffer)} - Calls {@link #glGetBufferParameteriv GetBufferParameteriv} to retrieve the buffer size and the {@code old_buffer} parameter is reused if not null.
  4. + *
  5. {@link #glMapBuffer(int, int, long, ByteBuffer)} - The buffer size is explicitly specified and the {@code old_buffer} parameter is reused if not null. This is the most efficient method.
  6. + *
+ * + * @param target the target buffer object being mapped. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param access the access policy, indicating whether it will be possible to read from, write to, or both read from and write to the buffer object's mapped data store. One of:
{@link GL15C#GL_READ_ONLY READ_ONLY}{@link GL15C#GL_WRITE_ONLY WRITE_ONLY}{@link GL15C#GL_READ_WRITE READ_WRITE}
+ * + * @see Reference Page + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapBuffer(@NativeType("GLenum") int target, @NativeType("GLenum") int access) { + return GL15C.glMapBuffer(target, access); + } + + /** + * Maps a buffer object's data store. + * + *

LWJGL note: This method comes in 3 flavors:

+ * + *
    + *
  1. {@link #glMapBuffer(int, int)} - Calls {@link #glGetBufferParameteriv GetBufferParameteriv} to retrieve the buffer size and a new ByteBuffer instance is always returned.
  2. + *
  3. {@link #glMapBuffer(int, int, ByteBuffer)} - Calls {@link #glGetBufferParameteriv GetBufferParameteriv} to retrieve the buffer size and the {@code old_buffer} parameter is reused if not null.
  4. + *
  5. {@link #glMapBuffer(int, int, long, ByteBuffer)} - The buffer size is explicitly specified and the {@code old_buffer} parameter is reused if not null. This is the most efficient method.
  6. + *
+ * + * @param target the target buffer object being mapped. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param access the access policy, indicating whether it will be possible to read from, write to, or both read from and write to the buffer object's mapped data store. One of:
{@link GL15C#GL_READ_ONLY READ_ONLY}{@link GL15C#GL_WRITE_ONLY WRITE_ONLY}{@link GL15C#GL_READ_WRITE READ_WRITE}
+ * + * @see Reference Page + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapBuffer(@NativeType("GLenum") int target, @NativeType("GLenum") int access, @Nullable ByteBuffer old_buffer) { + return GL15C.glMapBuffer(target, access, old_buffer); + } + + /** + * Maps a buffer object's data store. + * + *

LWJGL note: This method comes in 3 flavors:

+ * + *
    + *
  1. {@link #glMapBuffer(int, int)} - Calls {@link #glGetBufferParameteriv GetBufferParameteriv} to retrieve the buffer size and a new ByteBuffer instance is always returned.
  2. + *
  3. {@link #glMapBuffer(int, int, ByteBuffer)} - Calls {@link #glGetBufferParameteriv GetBufferParameteriv} to retrieve the buffer size and the {@code old_buffer} parameter is reused if not null.
  4. + *
  5. {@link #glMapBuffer(int, int, long, ByteBuffer)} - The buffer size is explicitly specified and the {@code old_buffer} parameter is reused if not null. This is the most efficient method.
  6. + *
+ * + * @param target the target buffer object being mapped. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param access the access policy, indicating whether it will be possible to read from, write to, or both read from and write to the buffer object's mapped data store. One of:
{@link GL15C#GL_READ_ONLY READ_ONLY}{@link GL15C#GL_WRITE_ONLY WRITE_ONLY}{@link GL15C#GL_READ_WRITE READ_WRITE}
+ * + * @see Reference Page + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapBuffer(@NativeType("GLenum") int target, @NativeType("GLenum") int access, long length, @Nullable ByteBuffer old_buffer) { + return GL15C.glMapBuffer(target, access, length, old_buffer); + } + + // --- [ glUnmapBuffer ] --- + + /** + * Relinquishes the mapping of a buffer object and invalidates the pointer to its data store. + * + *

Returns TRUE unless data values in the buffer’s data store have become corrupted during the period that the buffer was mapped. Such corruption can be + * the result of a screen resolution change or other window system-dependent event that causes system heaps such as those for high-performance graphics + * memory to be discarded. GL implementations must guarantee that such corruption can occur only during the periods that a buffer’s data store is mapped. + * If such corruption has occurred, UnmapBuffer returns FALSE, and the contents of the buffer’s data store become undefined.

+ * + * @param target the target buffer object being unmapped. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * + * @see Reference Page + */ + @NativeType("GLboolean") + public static boolean glUnmapBuffer(@NativeType("GLenum") int target) { + return GL15C.glUnmapBuffer(target); + } + + // --- [ glGetBufferParameteriv ] --- + + /** Unsafe version of: {@link #glGetBufferParameteriv GetBufferParameteriv} */ + public static void nglGetBufferParameteriv(int target, int pname, long params) { + GL15C.nglGetBufferParameteriv(target, pname, params); + } + + /** + * Returns the value of a buffer object parameter. + * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param pname the symbolic name of a buffer object parameter. One of:
{@link GL15#GL_BUFFER_SIZE BUFFER_SIZE}{@link GL15C#GL_BUFFER_USAGE BUFFER_USAGE}{@link GL15C#GL_BUFFER_ACCESS BUFFER_ACCESS}{@link GL15C#GL_BUFFER_MAPPED BUFFER_MAPPED}
{@link GL30#GL_BUFFER_ACCESS_FLAGS BUFFER_ACCESS_FLAGS}{@link GL30#GL_BUFFER_MAP_LENGTH BUFFER_MAP_LENGTH}{@link GL30#GL_BUFFER_MAP_OFFSET BUFFER_MAP_OFFSET}{@link GL44#GL_BUFFER_IMMUTABLE_STORAGE BUFFER_IMMUTABLE_STORAGE}
{@link GL44#GL_BUFFER_STORAGE_FLAGS BUFFER_STORAGE_FLAGS}
+ * @param params the requested parameter + * + * @see Reference Page + */ + public static void glGetBufferParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL15C.glGetBufferParameteriv(target, pname, params); + } + + /** + * Returns the value of a buffer object parameter. + * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param pname the symbolic name of a buffer object parameter. One of:
{@link GL15#GL_BUFFER_SIZE BUFFER_SIZE}{@link GL15C#GL_BUFFER_USAGE BUFFER_USAGE}{@link GL15C#GL_BUFFER_ACCESS BUFFER_ACCESS}{@link GL15C#GL_BUFFER_MAPPED BUFFER_MAPPED}
{@link GL30#GL_BUFFER_ACCESS_FLAGS BUFFER_ACCESS_FLAGS}{@link GL30#GL_BUFFER_MAP_LENGTH BUFFER_MAP_LENGTH}{@link GL30#GL_BUFFER_MAP_OFFSET BUFFER_MAP_OFFSET}{@link GL44#GL_BUFFER_IMMUTABLE_STORAGE BUFFER_IMMUTABLE_STORAGE}
{@link GL44#GL_BUFFER_STORAGE_FLAGS BUFFER_STORAGE_FLAGS}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetBufferParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + return GL15C.glGetBufferParameteri(target, pname); + } + + // --- [ glGetBufferPointerv ] --- + + /** Unsafe version of: {@link #glGetBufferPointerv GetBufferPointerv} */ + public static void nglGetBufferPointerv(int target, int pname, long params) { + GL15C.nglGetBufferPointerv(target, pname, params); + } + + /** + * Returns the pointer to a mapped buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param pname the pointer to be returned. Must be:
{@link GL15C#GL_BUFFER_MAP_POINTER BUFFER_MAP_POINTER}
+ * @param params the pointer value specified by {@code pname} + * + * @see Reference Page + */ + public static void glGetBufferPointerv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("void **") PointerBuffer params) { + GL15C.glGetBufferPointerv(target, pname, params); + } + + /** + * Returns the pointer to a mapped buffer object's data store. + * + * @param target the target buffer object. One of:
{@link GL15C#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15C#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param pname the pointer to be returned. Must be:
{@link GL15C#GL_BUFFER_MAP_POINTER BUFFER_MAP_POINTER}
+ * + * @see Reference Page + */ + @NativeType("void") + public static long glGetBufferPointer(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + return GL15C.glGetBufferPointer(target, pname); + } + + // --- [ glGenQueries ] --- + + /** + * Unsafe version of: {@link #glGenQueries GenQueries} + * + * @param n the number of query object names to be generated + */ + public static void nglGenQueries(int n, long ids) { + GL15C.nglGenQueries(n, ids); + } + + /** + * Generates query object names. + * + * @param ids a buffer in which the generated query object names are stored + * + * @see Reference Page + */ + public static void glGenQueries(@NativeType("GLuint *") IntBuffer ids) { + GL15C.glGenQueries(ids); + } + + /** + * Generates query object names. + * + * @see Reference Page + */ + @NativeType("void") + public static int glGenQueries() { + return GL15C.glGenQueries(); + } + + // --- [ glDeleteQueries ] --- + + /** + * Unsafe version of: {@link #glDeleteQueries DeleteQueries} + * + * @param n the number of query objects to be deleted + */ + public static void nglDeleteQueries(int n, long ids) { + GL15C.nglDeleteQueries(n, ids); + } + + /** + * Deletes named query objects. + * + * @param ids an array of query objects to be deleted + * + * @see Reference Page + */ + public static void glDeleteQueries(@NativeType("GLuint const *") IntBuffer ids) { + GL15C.glDeleteQueries(ids); + } + + /** + * Deletes named query objects. + * + * @see Reference Page + */ + public static void glDeleteQueries(@NativeType("GLuint const *") int id) { + GL15C.glDeleteQueries(id); + } + + // --- [ glIsQuery ] --- + + /** + * Determine if a name corresponds to a query object. + * + * @param id a value that may be the name of a query object + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static boolean glIsQuery(@NativeType("GLuint") int id) { + return GL15C.glIsQuery(id); + } + + // --- [ glBeginQuery ] --- + + /** + * Creates a query object and makes it active. + * + * @param target the target type of query object established. One of:
{@link GL15C#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param id the name of a query object + * + * @see Reference Page + */ + public static void glBeginQuery(@NativeType("GLenum") int target, @NativeType("GLuint") int id) { + GL15C.glBeginQuery(target, id); + } + + // --- [ glEndQuery ] --- + + /** + * Marks the end of the sequence of commands to be tracked for the active query specified by {@code target}. + * + * @param target the query object target. One of:
{@link GL15C#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * + * @see Reference Page + */ + public static void glEndQuery(@NativeType("GLenum") int target) { + GL15C.glEndQuery(target); + } + + // --- [ glGetQueryiv ] --- + + /** Unsafe version of: {@link #glGetQueryiv GetQueryiv} */ + public static void nglGetQueryiv(int target, int pname, long params) { + GL15C.nglGetQueryiv(target, pname, params); + } + + /** + * Returns parameters of a query object target. + * + * @param target the query object target. One of:
{@link GL15C#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param pname the symbolic name of a query object target parameter. One of:
{@link GL15C#GL_QUERY_COUNTER_BITS QUERY_COUNTER_BITS}{@link GL15C#GL_CURRENT_QUERY CURRENT_QUERY}
+ * @param params the requested data + * + * @see Reference Page + */ + public static void glGetQueryiv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL15C.glGetQueryiv(target, pname, params); + } + + /** + * Returns parameters of a query object target. + * + * @param target the query object target. One of:
{@link GL15C#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param pname the symbolic name of a query object target parameter. One of:
{@link GL15C#GL_QUERY_COUNTER_BITS QUERY_COUNTER_BITS}{@link GL15C#GL_CURRENT_QUERY CURRENT_QUERY}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetQueryi(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + return GL15C.glGetQueryi(target, pname); + } + + // --- [ glGetQueryObjectiv ] --- + + /** Unsafe version of: {@link #glGetQueryObjectiv GetQueryObjectiv} */ + public static void nglGetQueryObjectiv(int id, int pname, long params) { + GL15C.nglGetQueryObjectiv(id, pname, params); + } + + /** + * Returns the integer value of a query object parameter. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter. One of:
{@link GL15C#GL_QUERY_RESULT QUERY_RESULT}{@link GL15C#GL_QUERY_RESULT_AVAILABLE QUERY_RESULT_AVAILABLE}
+ * @param params the requested data + * + * @see Reference Page + */ + public static void glGetQueryObjectiv(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL15C.glGetQueryObjectiv(id, pname, params); + } + + /** + * Returns the integer value of a query object parameter. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter. One of:
{@link GL15C#GL_QUERY_RESULT QUERY_RESULT}{@link GL15C#GL_QUERY_RESULT_AVAILABLE QUERY_RESULT_AVAILABLE}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetQueryObjecti(@NativeType("GLuint") int id, @NativeType("GLenum") int pname) { + return GL15C.glGetQueryObjecti(id, pname); + } + + // --- [ glGetQueryObjectuiv ] --- + + /** Unsafe version of: {@link #glGetQueryObjectuiv GetQueryObjectuiv} */ + public static void nglGetQueryObjectuiv(int id, int pname, long params) { + GL15C.nglGetQueryObjectuiv(id, pname, params); + } + + /** + * Unsigned version of {@link #glGetQueryObjectiv GetQueryObjectiv}. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter. One of:
{@link GL15C#GL_QUERY_RESULT QUERY_RESULT}{@link GL15C#GL_QUERY_RESULT_AVAILABLE QUERY_RESULT_AVAILABLE}
+ * @param params the requested data + * + * @see Reference Page + */ + public static void glGetQueryObjectuiv(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLuint *") IntBuffer params) { + GL15C.glGetQueryObjectuiv(id, pname, params); + } + + /** + * Unsigned version of {@link #glGetQueryObjectiv GetQueryObjectiv}. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter. One of:
{@link GL15C#GL_QUERY_RESULT QUERY_RESULT}{@link GL15C#GL_QUERY_RESULT_AVAILABLE QUERY_RESULT_AVAILABLE}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetQueryObjectui(@NativeType("GLuint") int id, @NativeType("GLenum") int pname) { + return GL15C.glGetQueryObjectui(id, pname); + } + + /** + * Array version of: {@link #glDeleteBuffers DeleteBuffers} + * + * @see Reference Page + */ + public static void glDeleteBuffers(@NativeType("GLuint const *") int[] buffers) { + GL15C.glDeleteBuffers(buffers); + } + + /** + * Array version of: {@link #glGenBuffers GenBuffers} + * + * @see Reference Page + */ + public static void glGenBuffers(@NativeType("GLuint *") int[] buffers) { + GL15C.glGenBuffers(buffers); + } + + /** + * Array version of: {@link #glBufferData BufferData} + * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("void const *") short[] data, @NativeType("GLenum") int usage) { + GL15C.glBufferData(target, data, usage); + } + + /** + * Array version of: {@link #glBufferData BufferData} + * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("void const *") int[] data, @NativeType("GLenum") int usage) { + GL15C.glBufferData(target, data, usage); + } + + /** + * Array version of: {@link #glBufferData BufferData} + * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("void const *") long[] data, @NativeType("GLenum") int usage) { + GL15C.glBufferData(target, data, usage); + } + + /** + * Array version of: {@link #glBufferData BufferData} + * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("void const *") float[] data, @NativeType("GLenum") int usage) { + GL15C.glBufferData(target, data, usage); + } + + /** + * Array version of: {@link #glBufferData BufferData} + * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("void const *") double[] data, @NativeType("GLenum") int usage) { + GL15C.glBufferData(target, data, usage); + } + + /** + * Array version of: {@link #glBufferSubData BufferSubData} + * + * @see Reference Page + */ + public static void glBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void const *") short[] data) { + GL15C.glBufferSubData(target, offset, data); + } + + /** + * Array version of: {@link #glBufferSubData BufferSubData} + * + * @see Reference Page + */ + public static void glBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void const *") int[] data) { + GL15C.glBufferSubData(target, offset, data); + } + + /** + * Array version of: {@link #glBufferSubData BufferSubData} + * + * @see Reference Page + */ + public static void glBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void const *") long[] data) { + GL15C.glBufferSubData(target, offset, data); + } + + /** + * Array version of: {@link #glBufferSubData BufferSubData} + * + * @see Reference Page + */ + public static void glBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void const *") float[] data) { + GL15C.glBufferSubData(target, offset, data); + } + + /** + * Array version of: {@link #glBufferSubData BufferSubData} + * + * @see Reference Page + */ + public static void glBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void const *") double[] data) { + GL15C.glBufferSubData(target, offset, data); + } + + /** + * Array version of: {@link #glGetBufferSubData GetBufferSubData} + * + * @see Reference Page + */ + public static void glGetBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void *") short[] data) { + GL15C.glGetBufferSubData(target, offset, data); + } + + /** + * Array version of: {@link #glGetBufferSubData GetBufferSubData} + * + * @see Reference Page + */ + public static void glGetBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void *") int[] data) { + GL15C.glGetBufferSubData(target, offset, data); + } + + /** + * Array version of: {@link #glGetBufferSubData GetBufferSubData} + * + * @see Reference Page + */ + public static void glGetBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void *") long[] data) { + GL15C.glGetBufferSubData(target, offset, data); + } + + /** + * Array version of: {@link #glGetBufferSubData GetBufferSubData} + * + * @see Reference Page + */ + public static void glGetBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void *") float[] data) { + GL15C.glGetBufferSubData(target, offset, data); + } + + /** + * Array version of: {@link #glGetBufferSubData GetBufferSubData} + * + * @see Reference Page + */ + public static void glGetBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void *") double[] data) { + GL15C.glGetBufferSubData(target, offset, data); + } + + /** + * Array version of: {@link #glGetBufferParameteriv GetBufferParameteriv} + * + * @see Reference Page + */ + public static void glGetBufferParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL15C.glGetBufferParameteriv(target, pname, params); + } + + /** + * Array version of: {@link #glGenQueries GenQueries} + * + * @see Reference Page + */ + public static void glGenQueries(@NativeType("GLuint *") int[] ids) { + GL15C.glGenQueries(ids); + } + + /** + * Array version of: {@link #glDeleteQueries DeleteQueries} + * + * @see Reference Page + */ + public static void glDeleteQueries(@NativeType("GLuint const *") int[] ids) { + GL15C.glDeleteQueries(ids); + } + + /** + * Array version of: {@link #glGetQueryiv GetQueryiv} + * + * @see Reference Page + */ + public static void glGetQueryiv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL15C.glGetQueryiv(target, pname, params); + } + + /** + * Array version of: {@link #glGetQueryObjectiv GetQueryObjectiv} + * + * @see Reference Page + */ + public static void glGetQueryObjectiv(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL15C.glGetQueryObjectiv(id, pname, params); + } + + /** + * Array version of: {@link #glGetQueryObjectuiv GetQueryObjectuiv} + * + * @see Reference Page + */ + public static void glGetQueryObjectuiv(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLuint *") int[] params) { + GL15C.glGetQueryObjectuiv(id, pname, params); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL15C.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL15C.java new file mode 100644 index 00000000..f0c99cc0 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL15C.java @@ -0,0 +1,1311 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality of a forward compatible context, up to version 1.5. + * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL15C extends GL14C { + + /** New token names. */ + public static final int GL_SRC1_ALPHA = 0x8589; + + /** + * Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, + * GetBufferParameteriv, and GetBufferPointerv. + */ + public static final int + GL_ARRAY_BUFFER = 0x8892, + GL_ELEMENT_ARRAY_BUFFER = 0x8893; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_ARRAY_BUFFER_BINDING = 0x8894, + GL_ELEMENT_ARRAY_BUFFER_BINDING = 0x8895; + + /** Accepted by the {@code pname} parameter of GetVertexAttribiv. */ + public static final int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F; + + /** Accepted by the {@code usage} parameter of BufferData. */ + public static final int + GL_STREAM_DRAW = 0x88E0, + GL_STREAM_READ = 0x88E1, + GL_STREAM_COPY = 0x88E2, + GL_STATIC_DRAW = 0x88E4, + GL_STATIC_READ = 0x88E5, + GL_STATIC_COPY = 0x88E6, + GL_DYNAMIC_DRAW = 0x88E8, + GL_DYNAMIC_READ = 0x88E9, + GL_DYNAMIC_COPY = 0x88EA; + + /** Accepted by the {@code access} parameter of MapBuffer. */ + public static final int + GL_READ_ONLY = 0x88B8, + GL_WRITE_ONLY = 0x88B9, + GL_READ_WRITE = 0x88BA; + + /** Accepted by the {@code pname} parameter of GetBufferParameteriv. */ + public static final int + GL_BUFFER_SIZE = 0x8764, + GL_BUFFER_USAGE = 0x8765, + GL_BUFFER_ACCESS = 0x88BB, + GL_BUFFER_MAPPED = 0x88BC; + + /** Accepted by the {@code pname} parameter of GetBufferPointerv. */ + public static final int GL_BUFFER_MAP_POINTER = 0x88BD; + + /** Accepted by the {@code target} parameter of BeginQuery, EndQuery, and GetQueryiv. */ + public static final int GL_SAMPLES_PASSED = 0x8914; + + /** Accepted by the {@code pname} parameter of GetQueryiv. */ + public static final int + GL_QUERY_COUNTER_BITS = 0x8864, + GL_CURRENT_QUERY = 0x8865; + + /** Accepted by the {@code pname} parameter of GetQueryObjectiv and GetQueryObjectuiv. */ + public static final int + GL_QUERY_RESULT = 0x8866, + GL_QUERY_RESULT_AVAILABLE = 0x8867; + + static { GL.initialize(); } + + protected GL15C() { + throw new UnsupportedOperationException(); + } + + // --- [ glBindBuffer ] --- + + /** + * Binds a named buffer object. + * + * @param target the target to which the buffer object is bound. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param buffer the name of a buffer object + * + * @see Reference Page + */ + public static native void glBindBuffer(@NativeType("GLenum") int target, @NativeType("GLuint") int buffer); + + // --- [ glDeleteBuffers ] --- + + /** + * Unsafe version of: {@link #glDeleteBuffers DeleteBuffers} + * + * @param n the number of buffer objects to be deleted + */ + public static native void nglDeleteBuffers(int n, long buffers); + + /** + * Deletes named buffer objects. + * + * @param buffers an array of buffer objects to be deleted + * + * @see Reference Page + */ + public static void glDeleteBuffers(@NativeType("GLuint const *") IntBuffer buffers) { + nglDeleteBuffers(buffers.remaining(), memAddress(buffers)); + } + + /** + * Deletes named buffer objects. + * + * @see Reference Page + */ + public static void glDeleteBuffers(@NativeType("GLuint const *") int buffer) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer buffers = stack.ints(buffer); + nglDeleteBuffers(1, memAddress(buffers)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGenBuffers ] --- + + /** + * Unsafe version of: {@link #glGenBuffers GenBuffers} + * + * @param n the number of buffer object names to be generated + */ + public static native void nglGenBuffers(int n, long buffers); + + /** + * Generates buffer object names. + * + * @param buffers a buffer in which the generated buffer object names are stored + * + * @see Reference Page + */ + public static void glGenBuffers(@NativeType("GLuint *") IntBuffer buffers) { + nglGenBuffers(buffers.remaining(), memAddress(buffers)); + } + + /** + * Generates buffer object names. + * + * @see Reference Page + */ + @NativeType("void") + public static int glGenBuffers() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer buffers = stack.callocInt(1); + nglGenBuffers(1, memAddress(buffers)); + return buffers.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glIsBuffer ] --- + + /** + * Determines if a name corresponds to a buffer object. + * + * @param buffer a value that may be the name of a buffer object + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static native boolean glIsBuffer(@NativeType("GLuint") int buffer); + + // --- [ glBufferData ] --- + + /** + * Unsafe version of: {@link #glBufferData BufferData} + * + * @param size the size in bytes of the buffer object's new data store + */ + public static native void nglBufferData(int target, long size, long data, int usage); + + /** + * Creates and initializes a buffer object's data store. + * + *

{@code usage} is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make + * more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store. + * {@code usage} can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The + * frequency of access may be one of these:

+ * + *
    + *
  • STREAM - The data store contents will be modified once and used at most a few times.
  • + *
  • STATIC - The data store contents will be modified once and used many times.
  • + *
  • DYNAMIC - The data store contents will be modified repeatedly and used many times.
  • + *
+ * + *

The nature of access may be one of these:

+ * + *
    + *
  • DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
  • + *
  • READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
  • + *
  • COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
  • + *
+ * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param size the size in bytes of the buffer object's new data store + * @param usage the expected usage pattern of the data store. One of:
{@link #GL_STREAM_DRAW STREAM_DRAW}{@link #GL_STREAM_READ STREAM_READ}{@link #GL_STREAM_COPY STREAM_COPY}{@link #GL_STATIC_DRAW STATIC_DRAW}{@link #GL_STATIC_READ STATIC_READ}{@link #GL_STATIC_COPY STATIC_COPY}{@link #GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link #GL_DYNAMIC_READ DYNAMIC_READ}{@link #GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int usage) { + nglBufferData(target, size, NULL, usage); + } + + /** + * Creates and initializes a buffer object's data store. + * + *

{@code usage} is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make + * more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store. + * {@code usage} can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The + * frequency of access may be one of these:

+ * + *
    + *
  • STREAM - The data store contents will be modified once and used at most a few times.
  • + *
  • STATIC - The data store contents will be modified once and used many times.
  • + *
  • DYNAMIC - The data store contents will be modified repeatedly and used many times.
  • + *
+ * + *

The nature of access may be one of these:

+ * + *
    + *
  • DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
  • + *
  • READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
  • + *
  • COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
  • + *
+ * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link #GL_STREAM_DRAW STREAM_DRAW}{@link #GL_STREAM_READ STREAM_READ}{@link #GL_STREAM_COPY STREAM_COPY}{@link #GL_STATIC_DRAW STATIC_DRAW}{@link #GL_STATIC_READ STATIC_READ}{@link #GL_STATIC_COPY STATIC_COPY}{@link #GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link #GL_DYNAMIC_READ DYNAMIC_READ}{@link #GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("void const *") ByteBuffer data, @NativeType("GLenum") int usage) { + nglBufferData(target, data.remaining(), memAddress(data), usage); + } + + /** + * Creates and initializes a buffer object's data store. + * + *

{@code usage} is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make + * more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store. + * {@code usage} can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The + * frequency of access may be one of these:

+ * + *
    + *
  • STREAM - The data store contents will be modified once and used at most a few times.
  • + *
  • STATIC - The data store contents will be modified once and used many times.
  • + *
  • DYNAMIC - The data store contents will be modified repeatedly and used many times.
  • + *
+ * + *

The nature of access may be one of these:

+ * + *
    + *
  • DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
  • + *
  • READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
  • + *
  • COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
  • + *
+ * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link #GL_STREAM_DRAW STREAM_DRAW}{@link #GL_STREAM_READ STREAM_READ}{@link #GL_STREAM_COPY STREAM_COPY}{@link #GL_STATIC_DRAW STATIC_DRAW}{@link #GL_STATIC_READ STATIC_READ}{@link #GL_STATIC_COPY STATIC_COPY}{@link #GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link #GL_DYNAMIC_READ DYNAMIC_READ}{@link #GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("void const *") ShortBuffer data, @NativeType("GLenum") int usage) { + nglBufferData(target, Integer.toUnsignedLong(data.remaining()) << 1, memAddress(data), usage); + } + + /** + * Creates and initializes a buffer object's data store. + * + *

{@code usage} is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make + * more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store. + * {@code usage} can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The + * frequency of access may be one of these:

+ * + *
    + *
  • STREAM - The data store contents will be modified once and used at most a few times.
  • + *
  • STATIC - The data store contents will be modified once and used many times.
  • + *
  • DYNAMIC - The data store contents will be modified repeatedly and used many times.
  • + *
+ * + *

The nature of access may be one of these:

+ * + *
    + *
  • DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
  • + *
  • READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
  • + *
  • COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
  • + *
+ * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link #GL_STREAM_DRAW STREAM_DRAW}{@link #GL_STREAM_READ STREAM_READ}{@link #GL_STREAM_COPY STREAM_COPY}{@link #GL_STATIC_DRAW STATIC_DRAW}{@link #GL_STATIC_READ STATIC_READ}{@link #GL_STATIC_COPY STATIC_COPY}{@link #GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link #GL_DYNAMIC_READ DYNAMIC_READ}{@link #GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("void const *") IntBuffer data, @NativeType("GLenum") int usage) { + nglBufferData(target, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data), usage); + } + + /** + * Creates and initializes a buffer object's data store. + * + *

{@code usage} is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make + * more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store. + * {@code usage} can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The + * frequency of access may be one of these:

+ * + *
    + *
  • STREAM - The data store contents will be modified once and used at most a few times.
  • + *
  • STATIC - The data store contents will be modified once and used many times.
  • + *
  • DYNAMIC - The data store contents will be modified repeatedly and used many times.
  • + *
+ * + *

The nature of access may be one of these:

+ * + *
    + *
  • DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
  • + *
  • READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
  • + *
  • COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
  • + *
+ * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link #GL_STREAM_DRAW STREAM_DRAW}{@link #GL_STREAM_READ STREAM_READ}{@link #GL_STREAM_COPY STREAM_COPY}{@link #GL_STATIC_DRAW STATIC_DRAW}{@link #GL_STATIC_READ STATIC_READ}{@link #GL_STATIC_COPY STATIC_COPY}{@link #GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link #GL_DYNAMIC_READ DYNAMIC_READ}{@link #GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("void const *") LongBuffer data, @NativeType("GLenum") int usage) { + nglBufferData(target, Integer.toUnsignedLong(data.remaining()) << 3, memAddress(data), usage); + } + + /** + * Creates and initializes a buffer object's data store. + * + *

{@code usage} is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make + * more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store. + * {@code usage} can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The + * frequency of access may be one of these:

+ * + *
    + *
  • STREAM - The data store contents will be modified once and used at most a few times.
  • + *
  • STATIC - The data store contents will be modified once and used many times.
  • + *
  • DYNAMIC - The data store contents will be modified repeatedly and used many times.
  • + *
+ * + *

The nature of access may be one of these:

+ * + *
    + *
  • DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
  • + *
  • READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
  • + *
  • COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
  • + *
+ * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link #GL_STREAM_DRAW STREAM_DRAW}{@link #GL_STREAM_READ STREAM_READ}{@link #GL_STREAM_COPY STREAM_COPY}{@link #GL_STATIC_DRAW STATIC_DRAW}{@link #GL_STATIC_READ STATIC_READ}{@link #GL_STATIC_COPY STATIC_COPY}{@link #GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link #GL_DYNAMIC_READ DYNAMIC_READ}{@link #GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("void const *") FloatBuffer data, @NativeType("GLenum") int usage) { + nglBufferData(target, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data), usage); + } + + /** + * Creates and initializes a buffer object's data store. + * + *

{@code usage} is a hint to the GL implementation as to how a buffer object's data store will be accessed. This enables the GL implementation to make + * more intelligent decisions that may significantly impact buffer object performance. It does not, however, constrain the actual usage of the data store. + * {@code usage} can be broken down into two parts: first, the frequency of access (modification and usage), and second, the nature of that access. The + * frequency of access may be one of these:

+ * + *
    + *
  • STREAM - The data store contents will be modified once and used at most a few times.
  • + *
  • STATIC - The data store contents will be modified once and used many times.
  • + *
  • DYNAMIC - The data store contents will be modified repeatedly and used many times.
  • + *
+ * + *

The nature of access may be one of these:

+ * + *
    + *
  • DRAW - The data store contents are modified by the application, and used as the source for GL drawing and image specification commands.
  • + *
  • READ - The data store contents are modified by reading data from the GL, and used to return that data when queried by the application.
  • + *
  • COPY - The data store contents are modified by reading data from the GL, and used as the source for GL drawing and image specification commands.
  • + *
+ * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link #GL_STREAM_DRAW STREAM_DRAW}{@link #GL_STREAM_READ STREAM_READ}{@link #GL_STREAM_COPY STREAM_COPY}{@link #GL_STATIC_DRAW STATIC_DRAW}{@link #GL_STATIC_READ STATIC_READ}{@link #GL_STATIC_COPY STATIC_COPY}{@link #GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link #GL_DYNAMIC_READ DYNAMIC_READ}{@link #GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("void const *") DoubleBuffer data, @NativeType("GLenum") int usage) { + nglBufferData(target, Integer.toUnsignedLong(data.remaining()) << 3, memAddress(data), usage); + } + + // --- [ glBufferSubData ] --- + + /** + * Unsafe version of: {@link #glBufferSubData BufferSubData} + * + * @param size the size in bytes of the data store region being replaced + */ + public static native void nglBufferSubData(int target, long offset, long size, long data); + + /** + * Updates a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void const *") ByteBuffer data) { + nglBufferSubData(target, offset, data.remaining(), memAddress(data)); + } + + /** + * Updates a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void const *") ShortBuffer data) { + nglBufferSubData(target, offset, Integer.toUnsignedLong(data.remaining()) << 1, memAddress(data)); + } + + /** + * Updates a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void const *") IntBuffer data) { + nglBufferSubData(target, offset, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data)); + } + + /** + * Updates a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void const *") LongBuffer data) { + nglBufferSubData(target, offset, Integer.toUnsignedLong(data.remaining()) << 3, memAddress(data)); + } + + /** + * Updates a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void const *") FloatBuffer data) { + nglBufferSubData(target, offset, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data)); + } + + /** + * Updates a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void const *") DoubleBuffer data) { + nglBufferSubData(target, offset, Integer.toUnsignedLong(data.remaining()) << 3, memAddress(data)); + } + + // --- [ glGetBufferSubData ] --- + + /** + * Unsafe version of: {@link #glGetBufferSubData GetBufferSubData} + * + * @param size the size in bytes of the data store region being returned + */ + public static native void nglGetBufferSubData(int target, long offset, long size, long data); + + /** + * Returns a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void *") ByteBuffer data) { + nglGetBufferSubData(target, offset, data.remaining(), memAddress(data)); + } + + /** + * Returns a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void *") ShortBuffer data) { + nglGetBufferSubData(target, offset, Integer.toUnsignedLong(data.remaining()) << 1, memAddress(data)); + } + + /** + * Returns a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void *") IntBuffer data) { + nglGetBufferSubData(target, offset, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data)); + } + + /** + * Returns a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void *") LongBuffer data) { + nglGetBufferSubData(target, offset, Integer.toUnsignedLong(data.remaining()) << 3, memAddress(data)); + } + + /** + * Returns a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void *") FloatBuffer data) { + nglGetBufferSubData(target, offset, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data)); + } + + /** + * Returns a subset of a buffer object's data store. + * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void *") DoubleBuffer data) { + nglGetBufferSubData(target, offset, Integer.toUnsignedLong(data.remaining()) << 3, memAddress(data)); + } + + // --- [ glMapBuffer ] --- + + /** Unsafe version of: {@link #glMapBuffer MapBuffer} */ + public static native long nglMapBuffer(int target, int access); + + /** + * Maps a buffer object's data store. + * + *

LWJGL note: This method comes in 3 flavors:

+ * + *
    + *
  1. {@link #glMapBuffer(int, int)} - Calls {@link #glGetBufferParameteriv GetBufferParameteriv} to retrieve the buffer size and a new ByteBuffer instance is always returned.
  2. + *
  3. {@link #glMapBuffer(int, int, ByteBuffer)} - Calls {@link #glGetBufferParameteriv GetBufferParameteriv} to retrieve the buffer size and the {@code old_buffer} parameter is reused if not null.
  4. + *
  5. {@link #glMapBuffer(int, int, long, ByteBuffer)} - The buffer size is explicitly specified and the {@code old_buffer} parameter is reused if not null. This is the most efficient method.
  6. + *
+ * + * @param target the target buffer object being mapped. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param access the access policy, indicating whether it will be possible to read from, write to, or both read from and write to the buffer object's mapped data store. One of:
{@link #GL_READ_ONLY READ_ONLY}{@link #GL_WRITE_ONLY WRITE_ONLY}{@link #GL_READ_WRITE READ_WRITE}
+ * + * @see Reference Page + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapBuffer(@NativeType("GLenum") int target, @NativeType("GLenum") int access) { + long __result = nglMapBuffer(target, access); + return memByteBufferSafe(__result, glGetBufferParameteri(target, GL_BUFFER_SIZE)); + } + + /** + * Maps a buffer object's data store. + * + *

LWJGL note: This method comes in 3 flavors:

+ * + *
    + *
  1. {@link #glMapBuffer(int, int)} - Calls {@link #glGetBufferParameteriv GetBufferParameteriv} to retrieve the buffer size and a new ByteBuffer instance is always returned.
  2. + *
  3. {@link #glMapBuffer(int, int, ByteBuffer)} - Calls {@link #glGetBufferParameteriv GetBufferParameteriv} to retrieve the buffer size and the {@code old_buffer} parameter is reused if not null.
  4. + *
  5. {@link #glMapBuffer(int, int, long, ByteBuffer)} - The buffer size is explicitly specified and the {@code old_buffer} parameter is reused if not null. This is the most efficient method.
  6. + *
+ * + * @param target the target buffer object being mapped. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param access the access policy, indicating whether it will be possible to read from, write to, or both read from and write to the buffer object's mapped data store. One of:
{@link #GL_READ_ONLY READ_ONLY}{@link #GL_WRITE_ONLY WRITE_ONLY}{@link #GL_READ_WRITE READ_WRITE}
+ * + * @see Reference Page + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapBuffer(@NativeType("GLenum") int target, @NativeType("GLenum") int access, @Nullable ByteBuffer old_buffer) { + long __result = nglMapBuffer(target, access); + int length = glGetBufferParameteri(target, GL_BUFFER_SIZE); + return apiGetMappedBuffer(old_buffer, __result, length); + } + + /** + * Maps a buffer object's data store. + * + *

LWJGL note: This method comes in 3 flavors:

+ * + *
    + *
  1. {@link #glMapBuffer(int, int)} - Calls {@link #glGetBufferParameteriv GetBufferParameteriv} to retrieve the buffer size and a new ByteBuffer instance is always returned.
  2. + *
  3. {@link #glMapBuffer(int, int, ByteBuffer)} - Calls {@link #glGetBufferParameteriv GetBufferParameteriv} to retrieve the buffer size and the {@code old_buffer} parameter is reused if not null.
  4. + *
  5. {@link #glMapBuffer(int, int, long, ByteBuffer)} - The buffer size is explicitly specified and the {@code old_buffer} parameter is reused if not null. This is the most efficient method.
  6. + *
+ * + * @param target the target buffer object being mapped. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param access the access policy, indicating whether it will be possible to read from, write to, or both read from and write to the buffer object's mapped data store. One of:
{@link #GL_READ_ONLY READ_ONLY}{@link #GL_WRITE_ONLY WRITE_ONLY}{@link #GL_READ_WRITE READ_WRITE}
+ * + * @see Reference Page + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapBuffer(@NativeType("GLenum") int target, @NativeType("GLenum") int access, long length, @Nullable ByteBuffer old_buffer) { + long __result = nglMapBuffer(target, access); + return apiGetMappedBuffer(old_buffer, __result, (int)length); + } + + // --- [ glUnmapBuffer ] --- + + /** + * Relinquishes the mapping of a buffer object and invalidates the pointer to its data store. + * + *

Returns TRUE unless data values in the buffer’s data store have become corrupted during the period that the buffer was mapped. Such corruption can be + * the result of a screen resolution change or other window system-dependent event that causes system heaps such as those for high-performance graphics + * memory to be discarded. GL implementations must guarantee that such corruption can occur only during the periods that a buffer’s data store is mapped. + * If such corruption has occurred, UnmapBuffer returns FALSE, and the contents of the buffer’s data store become undefined.

+ * + * @param target the target buffer object being unmapped. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * + * @see Reference Page + */ + @NativeType("GLboolean") + public static native boolean glUnmapBuffer(@NativeType("GLenum") int target); + + // --- [ glGetBufferParameteriv ] --- + + /** Unsafe version of: {@link #glGetBufferParameteriv GetBufferParameteriv} */ + public static native void nglGetBufferParameteriv(int target, int pname, long params); + + /** + * Returns the value of a buffer object parameter. + * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param pname the symbolic name of a buffer object parameter. One of:
{@link GL15#GL_BUFFER_SIZE BUFFER_SIZE}{@link #GL_BUFFER_USAGE BUFFER_USAGE}{@link #GL_BUFFER_ACCESS BUFFER_ACCESS}{@link #GL_BUFFER_MAPPED BUFFER_MAPPED}
{@link GL30#GL_BUFFER_ACCESS_FLAGS BUFFER_ACCESS_FLAGS}{@link GL30#GL_BUFFER_MAP_LENGTH BUFFER_MAP_LENGTH}{@link GL30#GL_BUFFER_MAP_OFFSET BUFFER_MAP_OFFSET}{@link GL44#GL_BUFFER_IMMUTABLE_STORAGE BUFFER_IMMUTABLE_STORAGE}
{@link GL44#GL_BUFFER_STORAGE_FLAGS BUFFER_STORAGE_FLAGS}
+ * @param params the requested parameter + * + * @see Reference Page + */ + public static void glGetBufferParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetBufferParameteriv(target, pname, memAddress(params)); + } + + /** + * Returns the value of a buffer object parameter. + * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param pname the symbolic name of a buffer object parameter. One of:
{@link GL15#GL_BUFFER_SIZE BUFFER_SIZE}{@link #GL_BUFFER_USAGE BUFFER_USAGE}{@link #GL_BUFFER_ACCESS BUFFER_ACCESS}{@link #GL_BUFFER_MAPPED BUFFER_MAPPED}
{@link GL30#GL_BUFFER_ACCESS_FLAGS BUFFER_ACCESS_FLAGS}{@link GL30#GL_BUFFER_MAP_LENGTH BUFFER_MAP_LENGTH}{@link GL30#GL_BUFFER_MAP_OFFSET BUFFER_MAP_OFFSET}{@link GL44#GL_BUFFER_IMMUTABLE_STORAGE BUFFER_IMMUTABLE_STORAGE}
{@link GL44#GL_BUFFER_STORAGE_FLAGS BUFFER_STORAGE_FLAGS}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetBufferParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetBufferParameteriv(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetBufferPointerv ] --- + + /** Unsafe version of: {@link #glGetBufferPointerv GetBufferPointerv} */ + public static native void nglGetBufferPointerv(int target, int pname, long params); + + /** + * Returns the pointer to a mapped buffer object's data store. + * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param pname the pointer to be returned. Must be:
{@link #GL_BUFFER_MAP_POINTER BUFFER_MAP_POINTER}
+ * @param params the pointer value specified by {@code pname} + * + * @see Reference Page + */ + public static void glGetBufferPointerv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("void **") PointerBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetBufferPointerv(target, pname, memAddress(params)); + } + + /** + * Returns the pointer to a mapped buffer object's data store. + * + * @param target the target buffer object. One of:
{@link #GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param pname the pointer to be returned. Must be:
{@link #GL_BUFFER_MAP_POINTER BUFFER_MAP_POINTER}
+ * + * @see Reference Page + */ + @NativeType("void") + public static long glGetBufferPointer(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + PointerBuffer params = stack.callocPointer(1); + nglGetBufferPointerv(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGenQueries ] --- + + /** + * Unsafe version of: {@link #glGenQueries GenQueries} + * + * @param n the number of query object names to be generated + */ + public static native void nglGenQueries(int n, long ids); + + /** + * Generates query object names. + * + * @param ids a buffer in which the generated query object names are stored + * + * @see Reference Page + */ + public static void glGenQueries(@NativeType("GLuint *") IntBuffer ids) { + nglGenQueries(ids.remaining(), memAddress(ids)); + } + + /** + * Generates query object names. + * + * @see Reference Page + */ + @NativeType("void") + public static int glGenQueries() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer ids = stack.callocInt(1); + nglGenQueries(1, memAddress(ids)); + return ids.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glDeleteQueries ] --- + + /** + * Unsafe version of: {@link #glDeleteQueries DeleteQueries} + * + * @param n the number of query objects to be deleted + */ + public static native void nglDeleteQueries(int n, long ids); + + /** + * Deletes named query objects. + * + * @param ids an array of query objects to be deleted + * + * @see Reference Page + */ + public static void glDeleteQueries(@NativeType("GLuint const *") IntBuffer ids) { + nglDeleteQueries(ids.remaining(), memAddress(ids)); + } + + /** + * Deletes named query objects. + * + * @see Reference Page + */ + public static void glDeleteQueries(@NativeType("GLuint const *") int id) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer ids = stack.ints(id); + nglDeleteQueries(1, memAddress(ids)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glIsQuery ] --- + + /** + * Determine if a name corresponds to a query object. + * + * @param id a value that may be the name of a query object + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static native boolean glIsQuery(@NativeType("GLuint") int id); + + // --- [ glBeginQuery ] --- + + /** + * Creates a query object and makes it active. + * + * @param target the target type of query object established. One of:
{@link #GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param id the name of a query object + * + * @see Reference Page + */ + public static native void glBeginQuery(@NativeType("GLenum") int target, @NativeType("GLuint") int id); + + // --- [ glEndQuery ] --- + + /** + * Marks the end of the sequence of commands to be tracked for the active query specified by {@code target}. + * + * @param target the query object target. One of:
{@link #GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * + * @see Reference Page + */ + public static native void glEndQuery(@NativeType("GLenum") int target); + + // --- [ glGetQueryiv ] --- + + /** Unsafe version of: {@link #glGetQueryiv GetQueryiv} */ + public static native void nglGetQueryiv(int target, int pname, long params); + + /** + * Returns parameters of a query object target. + * + * @param target the query object target. One of:
{@link #GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param pname the symbolic name of a query object target parameter. One of:
{@link #GL_QUERY_COUNTER_BITS QUERY_COUNTER_BITS}{@link #GL_CURRENT_QUERY CURRENT_QUERY}
+ * @param params the requested data + * + * @see Reference Page + */ + public static void glGetQueryiv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetQueryiv(target, pname, memAddress(params)); + } + + /** + * Returns parameters of a query object target. + * + * @param target the query object target. One of:
{@link #GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param pname the symbolic name of a query object target parameter. One of:
{@link #GL_QUERY_COUNTER_BITS QUERY_COUNTER_BITS}{@link #GL_CURRENT_QUERY CURRENT_QUERY}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetQueryi(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetQueryiv(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetQueryObjectiv ] --- + + /** Unsafe version of: {@link #glGetQueryObjectiv GetQueryObjectiv} */ + public static native void nglGetQueryObjectiv(int id, int pname, long params); + + /** + * Returns the integer value of a query object parameter. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter. One of:
{@link #GL_QUERY_RESULT QUERY_RESULT}{@link #GL_QUERY_RESULT_AVAILABLE QUERY_RESULT_AVAILABLE}
+ * @param params the requested data + * + * @see Reference Page + */ + public static void glGetQueryObjectiv(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetQueryObjectiv(id, pname, memAddress(params)); + } + + /** + * Returns the integer value of a query object parameter. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter. One of:
{@link #GL_QUERY_RESULT QUERY_RESULT}{@link #GL_QUERY_RESULT_AVAILABLE QUERY_RESULT_AVAILABLE}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetQueryObjecti(@NativeType("GLuint") int id, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetQueryObjectiv(id, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetQueryObjectuiv ] --- + + /** Unsafe version of: {@link #glGetQueryObjectuiv GetQueryObjectuiv} */ + public static native void nglGetQueryObjectuiv(int id, int pname, long params); + + /** + * Unsigned version of {@link #glGetQueryObjectiv GetQueryObjectiv}. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter. One of:
{@link #GL_QUERY_RESULT QUERY_RESULT}{@link #GL_QUERY_RESULT_AVAILABLE QUERY_RESULT_AVAILABLE}
+ * @param params the requested data + * + * @see Reference Page + */ + public static void glGetQueryObjectuiv(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLuint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetQueryObjectuiv(id, pname, memAddress(params)); + } + + /** + * Unsigned version of {@link #glGetQueryObjectiv GetQueryObjectiv}. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter. One of:
{@link #GL_QUERY_RESULT QUERY_RESULT}{@link #GL_QUERY_RESULT_AVAILABLE QUERY_RESULT_AVAILABLE}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetQueryObjectui(@NativeType("GLuint") int id, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetQueryObjectuiv(id, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Array version of: {@link #glDeleteBuffers DeleteBuffers} + * + * @see Reference Page + */ + public static void glDeleteBuffers(@NativeType("GLuint const *") int[] buffers) { + long __functionAddress = GL.getICD().glDeleteBuffers; + if (CHECKS) { + check(__functionAddress); + } + callPV(buffers.length, buffers, __functionAddress); + } + + /** + * Array version of: {@link #glGenBuffers GenBuffers} + * + * @see Reference Page + */ + public static void glGenBuffers(@NativeType("GLuint *") int[] buffers) { + long __functionAddress = GL.getICD().glGenBuffers; + if (CHECKS) { + check(__functionAddress); + } + callPV(buffers.length, buffers, __functionAddress); + } + + /** + * Array version of: {@link #glBufferData BufferData} + * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("void const *") short[] data, @NativeType("GLenum") int usage) { + long __functionAddress = GL.getICD().glBufferData; + if (CHECKS) { + check(__functionAddress); + } + callPPV(target, Integer.toUnsignedLong(data.length) << 1, data, usage, __functionAddress); + } + + /** + * Array version of: {@link #glBufferData BufferData} + * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("void const *") int[] data, @NativeType("GLenum") int usage) { + long __functionAddress = GL.getICD().glBufferData; + if (CHECKS) { + check(__functionAddress); + } + callPPV(target, Integer.toUnsignedLong(data.length) << 2, data, usage, __functionAddress); + } + + /** + * Array version of: {@link #glBufferData BufferData} + * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("void const *") long[] data, @NativeType("GLenum") int usage) { + long __functionAddress = GL.getICD().glBufferData; + if (CHECKS) { + check(__functionAddress); + } + callPPV(target, Integer.toUnsignedLong(data.length) << 3, data, usage, __functionAddress); + } + + /** + * Array version of: {@link #glBufferData BufferData} + * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("void const *") float[] data, @NativeType("GLenum") int usage) { + long __functionAddress = GL.getICD().glBufferData; + if (CHECKS) { + check(__functionAddress); + } + callPPV(target, Integer.toUnsignedLong(data.length) << 2, data, usage, __functionAddress); + } + + /** + * Array version of: {@link #glBufferData BufferData} + * + * @see Reference Page + */ + public static void glBufferData(@NativeType("GLenum") int target, @NativeType("void const *") double[] data, @NativeType("GLenum") int usage) { + long __functionAddress = GL.getICD().glBufferData; + if (CHECKS) { + check(__functionAddress); + } + callPPV(target, Integer.toUnsignedLong(data.length) << 3, data, usage, __functionAddress); + } + + /** + * Array version of: {@link #glBufferSubData BufferSubData} + * + * @see Reference Page + */ + public static void glBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void const *") short[] data) { + long __functionAddress = GL.getICD().glBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(target, offset, Integer.toUnsignedLong(data.length) << 1, data, __functionAddress); + } + + /** + * Array version of: {@link #glBufferSubData BufferSubData} + * + * @see Reference Page + */ + public static void glBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void const *") int[] data) { + long __functionAddress = GL.getICD().glBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(target, offset, Integer.toUnsignedLong(data.length) << 2, data, __functionAddress); + } + + /** + * Array version of: {@link #glBufferSubData BufferSubData} + * + * @see Reference Page + */ + public static void glBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void const *") long[] data) { + long __functionAddress = GL.getICD().glBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(target, offset, Integer.toUnsignedLong(data.length) << 3, data, __functionAddress); + } + + /** + * Array version of: {@link #glBufferSubData BufferSubData} + * + * @see Reference Page + */ + public static void glBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void const *") float[] data) { + long __functionAddress = GL.getICD().glBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(target, offset, Integer.toUnsignedLong(data.length) << 2, data, __functionAddress); + } + + /** + * Array version of: {@link #glBufferSubData BufferSubData} + * + * @see Reference Page + */ + public static void glBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void const *") double[] data) { + long __functionAddress = GL.getICD().glBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(target, offset, Integer.toUnsignedLong(data.length) << 3, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetBufferSubData GetBufferSubData} + * + * @see Reference Page + */ + public static void glGetBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void *") short[] data) { + long __functionAddress = GL.getICD().glGetBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(target, offset, Integer.toUnsignedLong(data.length) << 1, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetBufferSubData GetBufferSubData} + * + * @see Reference Page + */ + public static void glGetBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void *") int[] data) { + long __functionAddress = GL.getICD().glGetBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(target, offset, Integer.toUnsignedLong(data.length) << 2, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetBufferSubData GetBufferSubData} + * + * @see Reference Page + */ + public static void glGetBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void *") long[] data) { + long __functionAddress = GL.getICD().glGetBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(target, offset, Integer.toUnsignedLong(data.length) << 3, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetBufferSubData GetBufferSubData} + * + * @see Reference Page + */ + public static void glGetBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void *") float[] data) { + long __functionAddress = GL.getICD().glGetBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(target, offset, Integer.toUnsignedLong(data.length) << 2, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetBufferSubData GetBufferSubData} + * + * @see Reference Page + */ + public static void glGetBufferSubData(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("void *") double[] data) { + long __functionAddress = GL.getICD().glGetBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(target, offset, Integer.toUnsignedLong(data.length) << 3, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetBufferParameteriv GetBufferParameteriv} + * + * @see Reference Page + */ + public static void glGetBufferParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetBufferParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGenQueries GenQueries} + * + * @see Reference Page + */ + public static void glGenQueries(@NativeType("GLuint *") int[] ids) { + long __functionAddress = GL.getICD().glGenQueries; + if (CHECKS) { + check(__functionAddress); + } + callPV(ids.length, ids, __functionAddress); + } + + /** + * Array version of: {@link #glDeleteQueries DeleteQueries} + * + * @see Reference Page + */ + public static void glDeleteQueries(@NativeType("GLuint const *") int[] ids) { + long __functionAddress = GL.getICD().glDeleteQueries; + if (CHECKS) { + check(__functionAddress); + } + callPV(ids.length, ids, __functionAddress); + } + + /** + * Array version of: {@link #glGetQueryiv GetQueryiv} + * + * @see Reference Page + */ + public static void glGetQueryiv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetQueryiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetQueryObjectiv GetQueryObjectiv} + * + * @see Reference Page + */ + public static void glGetQueryObjectiv(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetQueryObjectiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(id, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetQueryObjectuiv GetQueryObjectuiv} + * + * @see Reference Page + */ + public static void glGetQueryObjectuiv(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLuint *") int[] params) { + long __functionAddress = GL.getICD().glGetQueryObjectuiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(id, pname, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL20.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL20.java new file mode 100644 index 00000000..5b815016 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL20.java @@ -0,0 +1,2703 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * The OpenGL functionality up to version 2.0. Includes the deprecated symbols of the Compatibility Profile. + * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL20 extends GL15 { + + /** Accepted by the {@code name} parameter of GetString. */ + public static final int GL_SHADING_LANGUAGE_VERSION = 0x8B8C; + + /** Accepted by the {@code pname} parameter of GetInteger. */ + public static final int GL_CURRENT_PROGRAM = 0x8B8D; + + /** Accepted by the {@code pname} parameter of GetShaderiv. */ + public static final int + GL_SHADER_TYPE = 0x8B4F, + GL_DELETE_STATUS = 0x8B80, + GL_COMPILE_STATUS = 0x8B81, + GL_LINK_STATUS = 0x8B82, + GL_VALIDATE_STATUS = 0x8B83, + GL_INFO_LOG_LENGTH = 0x8B84, + GL_ATTACHED_SHADERS = 0x8B85, + GL_ACTIVE_UNIFORMS = 0x8B86, + GL_ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87, + GL_ACTIVE_ATTRIBUTES = 0x8B89, + GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A, + GL_SHADER_SOURCE_LENGTH = 0x8B88; + + /** Returned by the {@code type} parameter of GetActiveUniform. */ + public static final int + GL_FLOAT_VEC2 = 0x8B50, + GL_FLOAT_VEC3 = 0x8B51, + GL_FLOAT_VEC4 = 0x8B52, + GL_INT_VEC2 = 0x8B53, + GL_INT_VEC3 = 0x8B54, + GL_INT_VEC4 = 0x8B55, + GL_BOOL = 0x8B56, + GL_BOOL_VEC2 = 0x8B57, + GL_BOOL_VEC3 = 0x8B58, + GL_BOOL_VEC4 = 0x8B59, + GL_FLOAT_MAT2 = 0x8B5A, + GL_FLOAT_MAT3 = 0x8B5B, + GL_FLOAT_MAT4 = 0x8B5C, + GL_SAMPLER_1D = 0x8B5D, + GL_SAMPLER_2D = 0x8B5E, + GL_SAMPLER_3D = 0x8B5F, + GL_SAMPLER_CUBE = 0x8B60, + GL_SAMPLER_1D_SHADOW = 0x8B61, + GL_SAMPLER_2D_SHADOW = 0x8B62; + + /** Accepted by the {@code type} argument of CreateShader and returned by the {@code params} parameter of GetShaderiv. */ + public static final int GL_VERTEX_SHADER = 0x8B31; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A, + GL_MAX_VARYING_FLOATS = 0x8B4B, + GL_MAX_VERTEX_ATTRIBS = 0x8869, + GL_MAX_TEXTURE_IMAGE_UNITS = 0x8872, + GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C, + GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D, + GL_MAX_TEXTURE_COORDS = 0x8871; + + /** + * Accepted by the {@code cap} parameter of Disable, Enable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int + GL_VERTEX_PROGRAM_POINT_SIZE = 0x8642, + GL_VERTEX_PROGRAM_TWO_SIDE = 0x8643; + + /** Accepted by the {@code pname} parameter of GetVertexAttrib{dfi}v. */ + public static final int + GL_VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622, + GL_VERTEX_ATTRIB_ARRAY_SIZE = 0x8623, + GL_VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624, + GL_VERTEX_ATTRIB_ARRAY_TYPE = 0x8625, + GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A, + GL_CURRENT_VERTEX_ATTRIB = 0x8626; + + /** Accepted by the {@code pname} parameter of GetVertexAttribPointerv. */ + public static final int GL_VERTEX_ATTRIB_ARRAY_POINTER = 0x8645; + + /** Accepted by the {@code type} argument of CreateShader and returned by the {@code params} parameter of GetShaderiv. */ + public static final int GL_FRAGMENT_SHADER = 0x8B30; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49; + + /** Accepted by the {@code target} parameter of Hint and the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B; + + /** Accepted by the {@code pname} parameters of GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_DRAW_BUFFERS = 0x8824, + GL_DRAW_BUFFER0 = 0x8825, + GL_DRAW_BUFFER1 = 0x8826, + GL_DRAW_BUFFER2 = 0x8827, + GL_DRAW_BUFFER3 = 0x8828, + GL_DRAW_BUFFER4 = 0x8829, + GL_DRAW_BUFFER5 = 0x882A, + GL_DRAW_BUFFER6 = 0x882B, + GL_DRAW_BUFFER7 = 0x882C, + GL_DRAW_BUFFER8 = 0x882D, + GL_DRAW_BUFFER9 = 0x882E, + GL_DRAW_BUFFER10 = 0x882F, + GL_DRAW_BUFFER11 = 0x8830, + GL_DRAW_BUFFER12 = 0x8831, + GL_DRAW_BUFFER13 = 0x8832, + GL_DRAW_BUFFER14 = 0x8833, + GL_DRAW_BUFFER15 = 0x8834; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev, and by the {@code target} parameter of TexEnvi, TexEnviv, TexEnvf, TexEnvfv, GetTexEnviv, and GetTexEnvfv. + */ + public static final int GL_POINT_SPRITE = 0x8861; + + /** + * When the {@code target} parameter of TexEnvf, TexEnvfv, TexEnvi, TexEnviv, GetTexEnvfv, or GetTexEnviv is POINT_SPRITE, then the value of + * {@code pname} may be. + */ + public static final int GL_COORD_REPLACE = 0x8862; + + /** Accepted by the {@code pname} parameter of PointParameter{if}v. */ + public static final int GL_POINT_SPRITE_COORD_ORIGIN = 0x8CA0; + + /** Accepted by the {@code param} parameter of PointParameter{if}v. */ + public static final int + GL_LOWER_LEFT = 0x8CA1, + GL_UPPER_LEFT = 0x8CA2; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_BLEND_EQUATION_RGB = 0x8009, + GL_BLEND_EQUATION_ALPHA = 0x883D; + + /** Accepted by the {@code pname} parameter of GetIntegerv. */ + public static final int + GL_STENCIL_BACK_FUNC = 0x8800, + GL_STENCIL_BACK_FAIL = 0x8801, + GL_STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802, + GL_STENCIL_BACK_PASS_DEPTH_PASS = 0x8803, + GL_STENCIL_BACK_REF = 0x8CA3, + GL_STENCIL_BACK_VALUE_MASK = 0x8CA4, + GL_STENCIL_BACK_WRITEMASK = 0x8CA5; + + static { GL.initialize(); } + + protected GL20() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glCreateProgram, caps.glDeleteProgram, caps.glIsProgram, caps.glCreateShader, caps.glDeleteShader, caps.glIsShader, caps.glAttachShader, + caps.glDetachShader, caps.glShaderSource, caps.glCompileShader, caps.glLinkProgram, caps.glUseProgram, caps.glValidateProgram, caps.glUniform1f, + caps.glUniform2f, caps.glUniform3f, caps.glUniform4f, caps.glUniform1i, caps.glUniform2i, caps.glUniform3i, caps.glUniform4i, caps.glUniform1fv, + caps.glUniform2fv, caps.glUniform3fv, caps.glUniform4fv, caps.glUniform1iv, caps.glUniform2iv, caps.glUniform3iv, caps.glUniform4iv, + caps.glUniformMatrix2fv, caps.glUniformMatrix3fv, caps.glUniformMatrix4fv, caps.glGetShaderiv, caps.glGetProgramiv, caps.glGetShaderInfoLog, + caps.glGetProgramInfoLog, caps.glGetAttachedShaders, caps.glGetUniformLocation, caps.glGetActiveUniform, caps.glGetUniformfv, caps.glGetUniformiv, + caps.glGetShaderSource, caps.glVertexAttrib1f, caps.glVertexAttrib1s, caps.glVertexAttrib1d, caps.glVertexAttrib2f, caps.glVertexAttrib2s, + caps.glVertexAttrib2d, caps.glVertexAttrib3f, caps.glVertexAttrib3s, caps.glVertexAttrib3d, caps.glVertexAttrib4f, caps.glVertexAttrib4s, + caps.glVertexAttrib4d, caps.glVertexAttrib4Nub, caps.glVertexAttrib1fv, caps.glVertexAttrib1sv, caps.glVertexAttrib1dv, caps.glVertexAttrib2fv, + caps.glVertexAttrib2sv, caps.glVertexAttrib2dv, caps.glVertexAttrib3fv, caps.glVertexAttrib3sv, caps.glVertexAttrib3dv, caps.glVertexAttrib4fv, + caps.glVertexAttrib4sv, caps.glVertexAttrib4dv, caps.glVertexAttrib4iv, caps.glVertexAttrib4bv, caps.glVertexAttrib4ubv, caps.glVertexAttrib4usv, + caps.glVertexAttrib4uiv, caps.glVertexAttrib4Nbv, caps.glVertexAttrib4Nsv, caps.glVertexAttrib4Niv, caps.glVertexAttrib4Nubv, + caps.glVertexAttrib4Nusv, caps.glVertexAttrib4Nuiv, caps.glVertexAttribPointer, caps.glEnableVertexAttribArray, caps.glDisableVertexAttribArray, + caps.glBindAttribLocation, caps.glGetActiveAttrib, caps.glGetAttribLocation, caps.glGetVertexAttribiv, caps.glGetVertexAttribfv, + caps.glGetVertexAttribdv, caps.glGetVertexAttribPointerv, caps.glDrawBuffers, caps.glBlendEquationSeparate, caps.glStencilOpSeparate, + caps.glStencilFuncSeparate, caps.glStencilMaskSeparate + ); + } + + // --- [ glCreateProgram ] --- + + /** + * Creates a program object. + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glCreateProgram() { + return GL20C.glCreateProgram(); + } + + // --- [ glDeleteProgram ] --- + + /** + * Deletes a program object. + * + * @param program the program object to be deleted + * + * @see Reference Page + */ + public static void glDeleteProgram(@NativeType("GLuint") int program) { + GL20C.glDeleteProgram(program); + } + + // --- [ glIsProgram ] --- + + /** + * Returns {@link GL11#GL_TRUE TRUE} if {@code program} is the name of a program object. If {@code program} is zero, or a non-zero value that is not the name of a program + * object, IsProgram returns {@link GL11#GL_FALSE FALSE}. No error is generated if program is not a valid program object name. + * + * @param program the program object name to query + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static boolean glIsProgram(@NativeType("GLuint") int program) { + return GL20C.glIsProgram(program); + } + + // --- [ glCreateShader ] --- + + /** + * Creates a shader object. + * + * @param type the type of shader to be created. One of:
{@link GL20C#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20C#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glCreateShader(@NativeType("GLenum") int type) { + return GL20C.glCreateShader(type); + } + + // --- [ glDeleteShader ] --- + + /** + * Deletes a shader object. + * + * @param shader the shader object to be deleted + * + * @see Reference Page + */ + public static void glDeleteShader(@NativeType("GLuint") int shader) { + GL20C.glDeleteShader(shader); + } + + // --- [ glIsShader ] --- + + /** + * Returns {@link GL11#GL_TRUE TRUE} if {@code shader} is the name of a shader object. If {@code shader} is zero, or a nonzero value that is not the name of a shader + * object, IsShader returns {@link GL11#GL_FALSE FALSE}. No error is generated if shader is not a valid shader object name. + * + * @param shader the shader object name to query + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static boolean glIsShader(@NativeType("GLuint") int shader) { + return GL20C.glIsShader(shader); + } + + // --- [ glAttachShader ] --- + + /** + * Attaches a shader object to a program object. + * + *

In order to create a complete shader program, there must be a way to specify the list of things that will be linked together. Program objects provide + * this mechanism. Shaders that are to be linked together in a program object must first be attached to that program object. glAttachShader attaches the + * shader object specified by shader to the program object specified by program. This indicates that shader will be included in link operations that will + * be performed on program.

+ * + *

All operations that can be performed on a shader object are valid whether or not the shader object is attached to a program object. It is permissible to + * attach a shader object to a program object before source code has been loaded into the shader object or before the shader object has been compiled. It + * is permissible to attach multiple shader objects of the same type because each may contain a portion of the complete shader. It is also permissible to + * attach a shader object to more than one program object. If a shader object is deleted while it is attached to a program object, it will be flagged for + * deletion, and deletion will not occur until glDetachShader is called to detach it from all program objects to which it is attached.

+ * + * @param program the program object to which a shader object will be attached + * @param shader the shader object that is to be attached + * + * @see Reference Page + */ + public static void glAttachShader(@NativeType("GLuint") int program, @NativeType("GLuint") int shader) { + GL20C.glAttachShader(program, shader); + } + + // --- [ glDetachShader ] --- + + /** + * Detaches a shader object from a program object to which it is attached. + * + * @param program the program object from which to detach the shader object + * @param shader the shader object to be detached + * + * @see Reference Page + */ + public static void glDetachShader(@NativeType("GLuint") int program, @NativeType("GLuint") int shader) { + GL20C.glDetachShader(program, shader); + } + + // --- [ glShaderSource ] --- + + /** + * Unsafe version of: {@link #glShaderSource ShaderSource} + * + * @param count the number of elements in the string and length arrays + */ + public static void nglShaderSource(int shader, int count, long strings, long length) { + GL20C.nglShaderSource(shader, count, strings, length); + } + + /** + * Sets the source code in {@code shader} to the source code in the array of strings specified by {@code strings}. Any source code previously stored in the + * shader object is completely replaced. The number of strings in the array is specified by {@code count}. If {@code length} is {@code NULL}, each string is + * assumed to be null terminated. If {@code length} is a value other than {@code NULL}, it points to an array containing a string length for each of the + * corresponding elements of {@code strings}. Each element in the length array may contain the length of the corresponding string (the null character is not + * counted as part of the string length) or a value less than 0 to indicate that the string is null terminated. The source code strings are not scanned or + * parsed at this time; they are simply copied into the specified shader object. + * + * @param shader the shader object whose source code is to be replaced + * @param strings an array of pointers to strings containing the source code to be loaded into the shader + * @param length an array of string lengths + * + * @see Reference Page + */ + public static void glShaderSource(@NativeType("GLuint") int shader, @NativeType("GLchar const **") PointerBuffer strings, @Nullable @NativeType("GLint const *") IntBuffer length) { + GL20C.glShaderSource(shader, strings, length); + } + + /** + * Sets the source code in {@code shader} to the source code in the array of strings specified by {@code strings}. Any source code previously stored in the + * shader object is completely replaced. The number of strings in the array is specified by {@code count}. If {@code length} is {@code NULL}, each string is + * assumed to be null terminated. If {@code length} is a value other than {@code NULL}, it points to an array containing a string length for each of the + * corresponding elements of {@code strings}. Each element in the length array may contain the length of the corresponding string (the null character is not + * counted as part of the string length) or a value less than 0 to indicate that the string is null terminated. The source code strings are not scanned or + * parsed at this time; they are simply copied into the specified shader object. + * + * @param shader the shader object whose source code is to be replaced + * @param strings an array of pointers to strings containing the source code to be loaded into the shader + * + * @see Reference Page + */ + public static void glShaderSource(@NativeType("GLuint") int shader, @NativeType("GLchar const **") CharSequence... strings) { + GL20C.glShaderSource(shader, strings); + } + + /** + * Sets the source code in {@code shader} to the source code in the array of strings specified by {@code strings}. Any source code previously stored in the + * shader object is completely replaced. The number of strings in the array is specified by {@code count}. If {@code length} is {@code NULL}, each string is + * assumed to be null terminated. If {@code length} is a value other than {@code NULL}, it points to an array containing a string length for each of the + * corresponding elements of {@code strings}. Each element in the length array may contain the length of the corresponding string (the null character is not + * counted as part of the string length) or a value less than 0 to indicate that the string is null terminated. The source code strings are not scanned or + * parsed at this time; they are simply copied into the specified shader object. + * + * @param shader the shader object whose source code is to be replaced + * + * @see Reference Page + */ + public static void glShaderSource(@NativeType("GLuint") int shader, @NativeType("GLchar const **") CharSequence string) { + GL20C.glShaderSource(shader, string); + } + + // --- [ glCompileShader ] --- + + /** + * Compiles a shader object. + * + * @param shader the shader object to be compiled + * + * @see Reference Page + */ + public static void glCompileShader(@NativeType("GLuint") int shader) { + GL20C.glCompileShader(shader); + } + + // --- [ glLinkProgram ] --- + + /** + * Links a program object. + * + * @param program the program object to be linked + * + * @see Reference Page + */ + public static void glLinkProgram(@NativeType("GLuint") int program) { + GL20C.glLinkProgram(program); + } + + // --- [ glUseProgram ] --- + + /** + * Installs a program object as part of current rendering state. + * + * @param program the program object whose executables are to be used as part of current rendering state + * + * @see Reference Page + */ + public static void glUseProgram(@NativeType("GLuint") int program) { + GL20C.glUseProgram(program); + } + + // --- [ glValidateProgram ] --- + + /** + * Validates a program object. + * + * @param program the program object to be validated + * + * @see Reference Page + */ + public static void glValidateProgram(@NativeType("GLuint") int program) { + GL20C.glValidateProgram(program); + } + + // --- [ glUniform1f ] --- + + /** + * Specifies the value of a float uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform value + * + * @see Reference Page + */ + public static void glUniform1f(@NativeType("GLint") int location, @NativeType("GLfloat") float v0) { + GL20C.glUniform1f(location, v0); + } + + // --- [ glUniform2f ] --- + + /** + * Specifies the value of a vec2 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform x value + * @param v1 the uniform y value + * + * @see Reference Page + */ + public static void glUniform2f(@NativeType("GLint") int location, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1) { + GL20C.glUniform2f(location, v0, v1); + } + + // --- [ glUniform3f ] --- + + /** + * Specifies the value of a vec3 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform x value + * @param v1 the uniform y value + * @param v2 the uniform z value + * + * @see Reference Page + */ + public static void glUniform3f(@NativeType("GLint") int location, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1, @NativeType("GLfloat") float v2) { + GL20C.glUniform3f(location, v0, v1, v2); + } + + // --- [ glUniform4f ] --- + + /** + * Specifies the value of a vec4 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform x value + * @param v1 the uniform y value + * @param v2 the uniform z value + * @param v3 the uniform w value + * + * @see Reference Page + */ + public static void glUniform4f(@NativeType("GLint") int location, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1, @NativeType("GLfloat") float v2, @NativeType("GLfloat") float v3) { + GL20C.glUniform4f(location, v0, v1, v2, v3); + } + + // --- [ glUniform1i ] --- + + /** + * Specifies the value of an int uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform value + * + * @see Reference Page + */ + public static void glUniform1i(@NativeType("GLint") int location, @NativeType("GLint") int v0) { + GL20C.glUniform1i(location, v0); + } + + // --- [ glUniform2i ] --- + + /** + * Specifies the value of an ivec2 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform x value + * @param v1 the uniform y value + * + * @see Reference Page + */ + public static void glUniform2i(@NativeType("GLint") int location, @NativeType("GLint") int v0, @NativeType("GLint") int v1) { + GL20C.glUniform2i(location, v0, v1); + } + + // --- [ glUniform3i ] --- + + /** + * Specifies the value of an ivec3 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform x value + * @param v1 the uniform y value + * @param v2 the uniform z value + * + * @see Reference Page + */ + public static void glUniform3i(@NativeType("GLint") int location, @NativeType("GLint") int v0, @NativeType("GLint") int v1, @NativeType("GLint") int v2) { + GL20C.glUniform3i(location, v0, v1, v2); + } + + // --- [ glUniform4i ] --- + + /** + * Specifies the value of an ivec4 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform x value + * @param v1 the uniform y value + * @param v2 the uniform z value + * @param v3 the uniform w value + * + * @see Reference Page + */ + public static void glUniform4i(@NativeType("GLint") int location, @NativeType("GLint") int v0, @NativeType("GLint") int v1, @NativeType("GLint") int v2, @NativeType("GLint") int v3) { + GL20C.glUniform4i(location, v0, v1, v2, v3); + } + + // --- [ glUniform1fv ] --- + + /** + * Unsafe version of: {@link #glUniform1fv Uniform1fv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglUniform1fv(int location, int count, long value) { + GL20C.nglUniform1fv(location, count, value); + } + + /** + * Specifies the value of a single float uniform variable or a float uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform1fv(@NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + GL20C.glUniform1fv(location, value); + } + + // --- [ glUniform2fv ] --- + + /** + * Unsafe version of: {@link #glUniform2fv Uniform2fv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglUniform2fv(int location, int count, long value) { + GL20C.nglUniform2fv(location, count, value); + } + + /** + * Specifies the value of a single vec2 uniform variable or a vec2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform2fv(@NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + GL20C.glUniform2fv(location, value); + } + + // --- [ glUniform3fv ] --- + + /** + * Unsafe version of: {@link #glUniform3fv Uniform3fv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglUniform3fv(int location, int count, long value) { + GL20C.nglUniform3fv(location, count, value); + } + + /** + * Specifies the value of a single vec3 uniform variable or a vec3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform3fv(@NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + GL20C.glUniform3fv(location, value); + } + + // --- [ glUniform4fv ] --- + + /** + * Unsafe version of: {@link #glUniform4fv Uniform4fv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglUniform4fv(int location, int count, long value) { + GL20C.nglUniform4fv(location, count, value); + } + + /** + * Specifies the value of a single vec4 uniform variable or a vec4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform4fv(@NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + GL20C.glUniform4fv(location, value); + } + + // --- [ glUniform1iv ] --- + + /** + * Unsafe version of: {@link #glUniform1iv Uniform1iv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglUniform1iv(int location, int count, long value) { + GL20C.nglUniform1iv(location, count, value); + } + + /** + * Specifies the value of a single int uniform variable or a int uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform1iv(@NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + GL20C.glUniform1iv(location, value); + } + + // --- [ glUniform2iv ] --- + + /** + * Unsafe version of: {@link #glUniform2iv Uniform2iv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglUniform2iv(int location, int count, long value) { + GL20C.nglUniform2iv(location, count, value); + } + + /** + * Specifies the value of a single ivec2 uniform variable or an ivec2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform2iv(@NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + GL20C.glUniform2iv(location, value); + } + + // --- [ glUniform3iv ] --- + + /** + * Unsafe version of: {@link #glUniform3iv Uniform3iv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglUniform3iv(int location, int count, long value) { + GL20C.nglUniform3iv(location, count, value); + } + + /** + * Specifies the value of a single ivec3 uniform variable or an ivec3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform3iv(@NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + GL20C.glUniform3iv(location, value); + } + + // --- [ glUniform4iv ] --- + + /** + * Unsafe version of: {@link #glUniform4iv Uniform4iv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglUniform4iv(int location, int count, long value) { + GL20C.nglUniform4iv(location, count, value); + } + + /** + * Specifies the value of a single ivec4 uniform variable or an ivec4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform4iv(@NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + GL20C.glUniform4iv(location, value); + } + + // --- [ glUniformMatrix2fv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix2fv UniformMatrix2fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix2fv(int location, int count, boolean transpose, long value) { + GL20C.nglUniformMatrix2fv(location, count, transpose, value); + } + + /** + * Specifies the value of a single mat2 uniform variable or a mat2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniformMatrix2fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL20C.glUniformMatrix2fv(location, transpose, value); + } + + // --- [ glUniformMatrix3fv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix3fv UniformMatrix3fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix3fv(int location, int count, boolean transpose, long value) { + GL20C.nglUniformMatrix3fv(location, count, transpose, value); + } + + /** + * Specifies the value of a single mat3 uniform variable or a mat3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniformMatrix3fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL20C.glUniformMatrix3fv(location, transpose, value); + } + + // --- [ glUniformMatrix4fv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix4fv UniformMatrix4fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix4fv(int location, int count, boolean transpose, long value) { + GL20C.nglUniformMatrix4fv(location, count, transpose, value); + } + + /** + * Specifies the value of a single mat4 uniform variable or a mat4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniformMatrix4fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL20C.glUniformMatrix4fv(location, transpose, value); + } + + // --- [ glGetShaderiv ] --- + + /** Unsafe version of: {@link #glGetShaderiv GetShaderiv} */ + public static void nglGetShaderiv(int shader, int pname, long params) { + GL20C.nglGetShaderiv(shader, pname, params); + } + + /** + * Returns a parameter from a shader object. + * + * @param shader the shader object to be queried + * @param pname the object parameter. One of:
{@link GL20C#GL_SHADER_TYPE SHADER_TYPE}{@link GL20C#GL_DELETE_STATUS DELETE_STATUS}{@link GL20C#GL_COMPILE_STATUS COMPILE_STATUS}{@link GL20C#GL_INFO_LOG_LENGTH INFO_LOG_LENGTH}{@link GL20C#GL_SHADER_SOURCE_LENGTH SHADER_SOURCE_LENGTH}
+ * @param params the requested object parameter + * + * @see Reference Page + */ + public static void glGetShaderiv(@NativeType("GLuint") int shader, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL20C.glGetShaderiv(shader, pname, params); + } + + /** + * Returns a parameter from a shader object. + * + * @param shader the shader object to be queried + * @param pname the object parameter. One of:
{@link GL20C#GL_SHADER_TYPE SHADER_TYPE}{@link GL20C#GL_DELETE_STATUS DELETE_STATUS}{@link GL20C#GL_COMPILE_STATUS COMPILE_STATUS}{@link GL20C#GL_INFO_LOG_LENGTH INFO_LOG_LENGTH}{@link GL20C#GL_SHADER_SOURCE_LENGTH SHADER_SOURCE_LENGTH}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetShaderi(@NativeType("GLuint") int shader, @NativeType("GLenum") int pname) { + return GL20C.glGetShaderi(shader, pname); + } + + // --- [ glGetProgramiv ] --- + + /** Unsafe version of: {@link #glGetProgramiv GetProgramiv} */ + public static void nglGetProgramiv(int program, int pname, long params) { + GL20C.nglGetProgramiv(program, pname, params); + } + + /** + * Returns a parameter from a program object. + * + * @param program the program object to be queried + * @param pname the object parameter. One of:
{@link GL20C#GL_DELETE_STATUS DELETE_STATUS}{@link GL20C#GL_LINK_STATUS LINK_STATUS}{@link GL20C#GL_VALIDATE_STATUS VALIDATE_STATUS}
{@link GL20C#GL_INFO_LOG_LENGTH INFO_LOG_LENGTH}{@link GL20C#GL_ATTACHED_SHADERS ATTACHED_SHADERS}{@link GL20C#GL_ACTIVE_ATTRIBUTES ACTIVE_ATTRIBUTES}
{@link GL20C#GL_ACTIVE_ATTRIBUTE_MAX_LENGTH ACTIVE_ATTRIBUTE_MAX_LENGTH}{@link GL20C#GL_ACTIVE_UNIFORMS ACTIVE_UNIFORMS}{@link GL20C#GL_ACTIVE_UNIFORM_MAX_LENGTH ACTIVE_UNIFORM_MAX_LENGTH}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER_MODE TRANSFORM_FEEDBACK_BUFFER_MODE}{@link GL30#GL_TRANSFORM_FEEDBACK_VARYINGS TRANSFORM_FEEDBACK_VARYINGS}{@link GL30#GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH}
{@link GL31#GL_ACTIVE_UNIFORM_BLOCKS ACTIVE_UNIFORM_BLOCKS}{@link GL31#GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH}{@link GL32#GL_GEOMETRY_VERTICES_OUT GEOMETRY_VERTICES_OUT}
{@link GL32#GL_GEOMETRY_INPUT_TYPE GEOMETRY_INPUT_TYPE}{@link GL32#GL_GEOMETRY_OUTPUT_TYPE GEOMETRY_OUTPUT_TYPE}{@link GL41#GL_PROGRAM_BINARY_LENGTH PROGRAM_BINARY_LENGTH}
{@link GL42#GL_ACTIVE_ATOMIC_COUNTER_BUFFERS ACTIVE_ATOMIC_COUNTER_BUFFERS}{@link GL43#GL_COMPUTE_WORK_GROUP_SIZE COMPUTE_WORK_GROUP_SIZE}
+ * @param params the requested object parameter + * + * @see Reference Page + */ + public static void glGetProgramiv(@NativeType("GLuint") int program, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL20C.glGetProgramiv(program, pname, params); + } + + /** + * Returns a parameter from a program object. + * + * @param program the program object to be queried + * @param pname the object parameter. One of:
{@link GL20C#GL_DELETE_STATUS DELETE_STATUS}{@link GL20C#GL_LINK_STATUS LINK_STATUS}{@link GL20C#GL_VALIDATE_STATUS VALIDATE_STATUS}
{@link GL20C#GL_INFO_LOG_LENGTH INFO_LOG_LENGTH}{@link GL20C#GL_ATTACHED_SHADERS ATTACHED_SHADERS}{@link GL20C#GL_ACTIVE_ATTRIBUTES ACTIVE_ATTRIBUTES}
{@link GL20C#GL_ACTIVE_ATTRIBUTE_MAX_LENGTH ACTIVE_ATTRIBUTE_MAX_LENGTH}{@link GL20C#GL_ACTIVE_UNIFORMS ACTIVE_UNIFORMS}{@link GL20C#GL_ACTIVE_UNIFORM_MAX_LENGTH ACTIVE_UNIFORM_MAX_LENGTH}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER_MODE TRANSFORM_FEEDBACK_BUFFER_MODE}{@link GL30#GL_TRANSFORM_FEEDBACK_VARYINGS TRANSFORM_FEEDBACK_VARYINGS}{@link GL30#GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH}
{@link GL31#GL_ACTIVE_UNIFORM_BLOCKS ACTIVE_UNIFORM_BLOCKS}{@link GL31#GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH}{@link GL32#GL_GEOMETRY_VERTICES_OUT GEOMETRY_VERTICES_OUT}
{@link GL32#GL_GEOMETRY_INPUT_TYPE GEOMETRY_INPUT_TYPE}{@link GL32#GL_GEOMETRY_OUTPUT_TYPE GEOMETRY_OUTPUT_TYPE}{@link GL41#GL_PROGRAM_BINARY_LENGTH PROGRAM_BINARY_LENGTH}
{@link GL42#GL_ACTIVE_ATOMIC_COUNTER_BUFFERS ACTIVE_ATOMIC_COUNTER_BUFFERS}{@link GL43#GL_COMPUTE_WORK_GROUP_SIZE COMPUTE_WORK_GROUP_SIZE}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetProgrami(@NativeType("GLuint") int program, @NativeType("GLenum") int pname) { + return GL20C.glGetProgrami(program, pname); + } + + // --- [ glGetShaderInfoLog ] --- + + /** + * Unsafe version of: {@link #glGetShaderInfoLog GetShaderInfoLog} + * + * @param maxLength the size of the character buffer for storing the returned information log + */ + public static void nglGetShaderInfoLog(int shader, int maxLength, long length, long infoLog) { + GL20C.nglGetShaderInfoLog(shader, maxLength, length, infoLog); + } + + /** + * Returns the information log for a shader object. + * + * @param shader the shader object whose information log is to be queried + * @param length the length of the string returned in {@code infoLog} (excluding the null terminator) + * @param infoLog an array of characters that is used to return the information log + * + * @see Reference Page + */ + public static void glGetShaderInfoLog(@NativeType("GLuint") int shader, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer infoLog) { + GL20C.glGetShaderInfoLog(shader, length, infoLog); + } + + /** + * Returns the information log for a shader object. + * + * @param shader the shader object whose information log is to be queried + * @param maxLength the size of the character buffer for storing the returned information log + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetShaderInfoLog(@NativeType("GLuint") int shader, @NativeType("GLsizei") int maxLength) { + return GL20C.glGetShaderInfoLog(shader, maxLength); + } + + /** + * Returns the information log for a shader object. + * + * @param shader the shader object whose information log is to be queried + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetShaderInfoLog(@NativeType("GLuint") int shader) { + return glGetShaderInfoLog(shader, glGetShaderi(shader, GL_INFO_LOG_LENGTH)); + } + + // --- [ glGetProgramInfoLog ] --- + + /** + * Unsafe version of: {@link #glGetProgramInfoLog GetProgramInfoLog} + * + * @param maxLength the size of the character buffer for storing the returned information log + */ + public static void nglGetProgramInfoLog(int program, int maxLength, long length, long infoLog) { + GL20C.nglGetProgramInfoLog(program, maxLength, length, infoLog); + } + + /** + * Returns the information log for a program object. + * + * @param program the program object whose information log is to be queried + * @param length the length of the string returned in {@code infoLog} (excluding the null terminator) + * @param infoLog an array of characters that is used to return the information log + * + * @see Reference Page + */ + public static void glGetProgramInfoLog(@NativeType("GLuint") int program, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer infoLog) { + GL20C.glGetProgramInfoLog(program, length, infoLog); + } + + /** + * Returns the information log for a program object. + * + * @param program the program object whose information log is to be queried + * @param maxLength the size of the character buffer for storing the returned information log + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetProgramInfoLog(@NativeType("GLuint") int program, @NativeType("GLsizei") int maxLength) { + return GL20C.glGetProgramInfoLog(program, maxLength); + } + + /** + * Returns the information log for a program object. + * + * @param program the program object whose information log is to be queried + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetProgramInfoLog(@NativeType("GLuint") int program) { + return glGetProgramInfoLog(program, glGetProgrami(program, GL_INFO_LOG_LENGTH)); + } + + // --- [ glGetAttachedShaders ] --- + + /** + * Unsafe version of: {@link #glGetAttachedShaders GetAttachedShaders} + * + * @param maxCount the size of the array for storing the returned object names + */ + public static void nglGetAttachedShaders(int program, int maxCount, long count, long shaders) { + GL20C.nglGetAttachedShaders(program, maxCount, count, shaders); + } + + /** + * Returns the shader objects attached to a program object. + * + * @param program the program object to be queried + * @param count the number of names actually returned in {@code shaders} + * @param shaders an array that is used to return the names of attached shader objects + * + * @see Reference Page + */ + public static void glGetAttachedShaders(@NativeType("GLuint") int program, @Nullable @NativeType("GLsizei *") IntBuffer count, @NativeType("GLuint *") IntBuffer shaders) { + GL20C.glGetAttachedShaders(program, count, shaders); + } + + // --- [ glGetUniformLocation ] --- + + /** Unsafe version of: {@link #glGetUniformLocation GetUniformLocation} */ + public static int nglGetUniformLocation(int program, long name) { + return GL20C.nglGetUniformLocation(program, name); + } + + /** + * Returns the location of a uniform variable. + * + * @param program the program object to be queried + * @param name a null terminated string containing the name of the uniform variable whose location is to be queried + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetUniformLocation(@NativeType("GLuint") int program, @NativeType("GLchar const *") ByteBuffer name) { + return GL20C.glGetUniformLocation(program, name); + } + + /** + * Returns the location of a uniform variable. + * + * @param program the program object to be queried + * @param name a null terminated string containing the name of the uniform variable whose location is to be queried + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetUniformLocation(@NativeType("GLuint") int program, @NativeType("GLchar const *") CharSequence name) { + return GL20C.glGetUniformLocation(program, name); + } + + // --- [ glGetActiveUniform ] --- + + /** + * Unsafe version of: {@link #glGetActiveUniform GetActiveUniform} + * + * @param maxLength the maximum number of characters OpenGL is allowed to write in the character buffer indicated by {@code name} + */ + public static void nglGetActiveUniform(int program, int index, int maxLength, long length, long size, long type, long name) { + GL20C.nglGetActiveUniform(program, index, maxLength, length, size, type, name); + } + + /** + * Returns information about an active uniform variable for the specified program object. + * + * @param program the program object to be queried + * @param index the index of the uniform variable to be queried + * @param length the number of characters actually written by OpenGL in the string indicated by {@code name} (excluding the null terminator) if a value other than NULL is passed + * @param size the size of the uniform variable + * @param type the data type of the uniform variable + * @param name a null terminated string containing the name of the uniform variable + * + * @see Reference Page + */ + public static void glGetActiveUniform(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLint *") IntBuffer size, @NativeType("GLenum *") IntBuffer type, @NativeType("GLchar *") ByteBuffer name) { + GL20C.glGetActiveUniform(program, index, length, size, type, name); + } + + /** + * Returns information about an active uniform variable for the specified program object. + * + * @param program the program object to be queried + * @param index the index of the uniform variable to be queried + * @param maxLength the maximum number of characters OpenGL is allowed to write in the character buffer indicated by {@code name} + * @param size the size of the uniform variable + * @param type the data type of the uniform variable + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveUniform(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @NativeType("GLsizei") int maxLength, @NativeType("GLint *") IntBuffer size, @NativeType("GLenum *") IntBuffer type) { + return GL20C.glGetActiveUniform(program, index, maxLength, size, type); + } + + /** + * Returns information about an active uniform variable for the specified program object. + * + * @param program the program object to be queried + * @param index the index of the uniform variable to be queried + * @param size the size of the uniform variable + * @param type the data type of the uniform variable + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveUniform(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @NativeType("GLint *") IntBuffer size, @NativeType("GLenum *") IntBuffer type) { + return glGetActiveUniform(program, index, glGetProgrami(program, GL_ACTIVE_UNIFORM_MAX_LENGTH), size, type); + } + + // --- [ glGetUniformfv ] --- + + /** Unsafe version of: {@link #glGetUniformfv GetUniformfv} */ + public static void nglGetUniformfv(int program, int location, long params) { + GL20C.nglGetUniformfv(program, location, params); + } + + /** + * Returns the float value(s) of a uniform variable. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * @param params the value of the specified uniform variable + * + * @see Reference Page + */ + public static void glGetUniformfv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat *") FloatBuffer params) { + GL20C.glGetUniformfv(program, location, params); + } + + /** + * Returns the float value(s) of a uniform variable. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * + * @see Reference Page + */ + @NativeType("void") + public static float glGetUniformf(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + return GL20C.glGetUniformf(program, location); + } + + // --- [ glGetUniformiv ] --- + + /** Unsafe version of: {@link #glGetUniformiv GetUniformiv} */ + public static void nglGetUniformiv(int program, int location, long params) { + GL20C.nglGetUniformiv(program, location, params); + } + + /** + * Returns the int value(s) of a uniform variable. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * @param params the value of the specified uniform variable + * + * @see Reference Page + */ + public static void glGetUniformiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint *") IntBuffer params) { + GL20C.glGetUniformiv(program, location, params); + } + + /** + * Returns the int value(s) of a uniform variable. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetUniformi(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + return GL20C.glGetUniformi(program, location); + } + + // --- [ glGetShaderSource ] --- + + /** + * Unsafe version of: {@link #glGetShaderSource GetShaderSource} + * + * @param maxLength the size of the character buffer for storing the returned source code string + */ + public static void nglGetShaderSource(int shader, int maxLength, long length, long source) { + GL20C.nglGetShaderSource(shader, maxLength, length, source); + } + + /** + * Returns the source code string from a shader object. + * + * @param shader the shader object to be queried + * @param length the length of the string returned in source (excluding the null terminator) + * @param source an array of characters that is used to return the source code string + * + * @see Reference Page + */ + public static void glGetShaderSource(@NativeType("GLuint") int shader, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer source) { + GL20C.glGetShaderSource(shader, length, source); + } + + /** + * Returns the source code string from a shader object. + * + * @param shader the shader object to be queried + * @param maxLength the size of the character buffer for storing the returned source code string + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetShaderSource(@NativeType("GLuint") int shader, @NativeType("GLsizei") int maxLength) { + return GL20C.glGetShaderSource(shader, maxLength); + } + + /** + * Returns the source code string from a shader object. + * + * @param shader the shader object to be queried + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetShaderSource(@NativeType("GLuint") int shader) { + return glGetShaderSource(shader, glGetShaderi(shader, GL_SHADER_SOURCE_LENGTH)); + } + + // --- [ glVertexAttrib1f ] --- + + /** + * Specifies the value of a generic vertex attribute. The y and z components are implicitly set to 0.0f and w to 1.0f. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * + * @see Reference Page + */ + public static void glVertexAttrib1f(@NativeType("GLuint") int index, @NativeType("GLfloat") float v0) { + GL20C.glVertexAttrib1f(index, v0); + } + + // --- [ glVertexAttrib1s ] --- + + /** + * Short version of {@link #glVertexAttrib1f VertexAttrib1f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * + * @see Reference Page + */ + public static void glVertexAttrib1s(@NativeType("GLuint") int index, @NativeType("GLshort") short v0) { + GL20C.glVertexAttrib1s(index, v0); + } + + // --- [ glVertexAttrib1d ] --- + + /** + * Double version of {@link #glVertexAttrib1f VertexAttrib1f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * + * @see Reference Page + */ + public static void glVertexAttrib1d(@NativeType("GLuint") int index, @NativeType("GLdouble") double v0) { + GL20C.glVertexAttrib1d(index, v0); + } + + // --- [ glVertexAttrib2f ] --- + + /** + * Specifies the value of a generic vertex attribute. The y component is implicitly set to 0.0f and w to 1.0f. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * + * @see Reference Page + */ + public static void glVertexAttrib2f(@NativeType("GLuint") int index, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1) { + GL20C.glVertexAttrib2f(index, v0, v1); + } + + // --- [ glVertexAttrib2s ] --- + + /** + * Short version of {@link #glVertexAttrib2f VertexAttrib2f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * + * @see Reference Page + */ + public static void glVertexAttrib2s(@NativeType("GLuint") int index, @NativeType("GLshort") short v0, @NativeType("GLshort") short v1) { + GL20C.glVertexAttrib2s(index, v0, v1); + } + + // --- [ glVertexAttrib2d ] --- + + /** + * Double version of {@link #glVertexAttrib2f VertexAttrib2f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * + * @see Reference Page + */ + public static void glVertexAttrib2d(@NativeType("GLuint") int index, @NativeType("GLdouble") double v0, @NativeType("GLdouble") double v1) { + GL20C.glVertexAttrib2d(index, v0, v1); + } + + // --- [ glVertexAttrib3f ] --- + + /** + * Specifies the value of a generic vertex attribute. The w is implicitly set to 1.0f. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + * + * @see Reference Page + */ + public static void glVertexAttrib3f(@NativeType("GLuint") int index, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1, @NativeType("GLfloat") float v2) { + GL20C.glVertexAttrib3f(index, v0, v1, v2); + } + + // --- [ glVertexAttrib3s ] --- + + /** + * Short version of {@link #glVertexAttrib3f VertexAttrib3f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + * + * @see Reference Page + */ + public static void glVertexAttrib3s(@NativeType("GLuint") int index, @NativeType("GLshort") short v0, @NativeType("GLshort") short v1, @NativeType("GLshort") short v2) { + GL20C.glVertexAttrib3s(index, v0, v1, v2); + } + + // --- [ glVertexAttrib3d ] --- + + /** + * Double version of {@link #glVertexAttrib3f VertexAttrib3f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + * + * @see Reference Page + */ + public static void glVertexAttrib3d(@NativeType("GLuint") int index, @NativeType("GLdouble") double v0, @NativeType("GLdouble") double v1, @NativeType("GLdouble") double v2) { + GL20C.glVertexAttrib3d(index, v0, v1, v2); + } + + // --- [ glVertexAttrib4f ] --- + + /** + * Specifies the value of a generic vertex attribute. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + * @param v3 the vertex attribute w component + * + * @see Reference Page + */ + public static void glVertexAttrib4f(@NativeType("GLuint") int index, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1, @NativeType("GLfloat") float v2, @NativeType("GLfloat") float v3) { + GL20C.glVertexAttrib4f(index, v0, v1, v2, v3); + } + + // --- [ glVertexAttrib4s ] --- + + /** + * Short version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + * @param v3 the vertex attribute w component + * + * @see Reference Page + */ + public static void glVertexAttrib4s(@NativeType("GLuint") int index, @NativeType("GLshort") short v0, @NativeType("GLshort") short v1, @NativeType("GLshort") short v2, @NativeType("GLshort") short v3) { + GL20C.glVertexAttrib4s(index, v0, v1, v2, v3); + } + + // --- [ glVertexAttrib4d ] --- + + /** + * Double version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + * @param v3 the vertex attribute w component + * + * @see Reference Page + */ + public static void glVertexAttrib4d(@NativeType("GLuint") int index, @NativeType("GLdouble") double v0, @NativeType("GLdouble") double v1, @NativeType("GLdouble") double v2, @NativeType("GLdouble") double v3) { + GL20C.glVertexAttrib4d(index, v0, v1, v2, v3); + } + + // --- [ glVertexAttrib4Nub ] --- + + /** + * Normalized unsigned byte version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * @param z the vertex attribute z component + * @param w the vertex attribute w component + * + * @see Reference Page + */ + public static void glVertexAttrib4Nub(@NativeType("GLuint") int index, @NativeType("GLubyte") byte x, @NativeType("GLubyte") byte y, @NativeType("GLubyte") byte z, @NativeType("GLubyte") byte w) { + GL20C.glVertexAttrib4Nub(index, x, y, z, w); + } + + // --- [ glVertexAttrib1fv ] --- + + /** Unsafe version of: {@link #glVertexAttrib1fv VertexAttrib1fv} */ + public static void nglVertexAttrib1fv(int index, long v) { + GL20C.nglVertexAttrib1fv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib1f VertexAttrib1f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib1fv(@NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer v) { + GL20C.glVertexAttrib1fv(index, v); + } + + // --- [ glVertexAttrib1sv ] --- + + /** Unsafe version of: {@link #glVertexAttrib1sv VertexAttrib1sv} */ + public static void nglVertexAttrib1sv(int index, long v) { + GL20C.nglVertexAttrib1sv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib1s VertexAttrib1s}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib1sv(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + GL20C.glVertexAttrib1sv(index, v); + } + + // --- [ glVertexAttrib1dv ] --- + + /** Unsafe version of: {@link #glVertexAttrib1dv VertexAttrib1dv} */ + public static void nglVertexAttrib1dv(int index, long v) { + GL20C.nglVertexAttrib1dv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib1d VertexAttrib1d}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib1dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + GL20C.glVertexAttrib1dv(index, v); + } + + // --- [ glVertexAttrib2fv ] --- + + /** Unsafe version of: {@link #glVertexAttrib2fv VertexAttrib2fv} */ + public static void nglVertexAttrib2fv(int index, long v) { + GL20C.nglVertexAttrib2fv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib2f VertexAttrib2f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib2fv(@NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer v) { + GL20C.glVertexAttrib2fv(index, v); + } + + // --- [ glVertexAttrib2sv ] --- + + /** Unsafe version of: {@link #glVertexAttrib2sv VertexAttrib2sv} */ + public static void nglVertexAttrib2sv(int index, long v) { + GL20C.nglVertexAttrib2sv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib2s VertexAttrib2s}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib2sv(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + GL20C.glVertexAttrib2sv(index, v); + } + + // --- [ glVertexAttrib2dv ] --- + + /** Unsafe version of: {@link #glVertexAttrib2dv VertexAttrib2dv} */ + public static void nglVertexAttrib2dv(int index, long v) { + GL20C.nglVertexAttrib2dv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib2d VertexAttrib2d}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib2dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + GL20C.glVertexAttrib2dv(index, v); + } + + // --- [ glVertexAttrib3fv ] --- + + /** Unsafe version of: {@link #glVertexAttrib3fv VertexAttrib3fv} */ + public static void nglVertexAttrib3fv(int index, long v) { + GL20C.nglVertexAttrib3fv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib3f VertexAttrib3f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib3fv(@NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer v) { + GL20C.glVertexAttrib3fv(index, v); + } + + // --- [ glVertexAttrib3sv ] --- + + /** Unsafe version of: {@link #glVertexAttrib3sv VertexAttrib3sv} */ + public static void nglVertexAttrib3sv(int index, long v) { + GL20C.nglVertexAttrib3sv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib3s VertexAttrib3s}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib3sv(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + GL20C.glVertexAttrib3sv(index, v); + } + + // --- [ glVertexAttrib3dv ] --- + + /** Unsafe version of: {@link #glVertexAttrib3dv VertexAttrib3dv} */ + public static void nglVertexAttrib3dv(int index, long v) { + GL20C.nglVertexAttrib3dv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib3d VertexAttrib3d}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib3dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + GL20C.glVertexAttrib3dv(index, v); + } + + // --- [ glVertexAttrib4fv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4fv VertexAttrib4fv} */ + public static void nglVertexAttrib4fv(int index, long v) { + GL20C.nglVertexAttrib4fv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4fv(@NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer v) { + GL20C.glVertexAttrib4fv(index, v); + } + + // --- [ glVertexAttrib4sv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4sv VertexAttrib4sv} */ + public static void nglVertexAttrib4sv(int index, long v) { + GL20C.nglVertexAttrib4sv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib4s VertexAttrib4s}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4sv(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + GL20C.glVertexAttrib4sv(index, v); + } + + // --- [ glVertexAttrib4dv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4dv VertexAttrib4dv} */ + public static void nglVertexAttrib4dv(int index, long v) { + GL20C.nglVertexAttrib4dv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib4d VertexAttrib4d}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + GL20C.glVertexAttrib4dv(index, v); + } + + // --- [ glVertexAttrib4iv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4iv VertexAttrib4iv} */ + public static void nglVertexAttrib4iv(int index, long v) { + GL20C.nglVertexAttrib4iv(index, v); + } + + /** + * Integer pointer version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4iv(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + GL20C.glVertexAttrib4iv(index, v); + } + + // --- [ glVertexAttrib4bv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4bv VertexAttrib4bv} */ + public static void nglVertexAttrib4bv(int index, long v) { + GL20C.nglVertexAttrib4bv(index, v); + } + + /** + * Byte pointer version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4bv(@NativeType("GLuint") int index, @NativeType("GLbyte const *") ByteBuffer v) { + GL20C.glVertexAttrib4bv(index, v); + } + + // --- [ glVertexAttrib4ubv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4ubv VertexAttrib4ubv} */ + public static void nglVertexAttrib4ubv(int index, long v) { + GL20C.nglVertexAttrib4ubv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttrib4Nub VertexAttrib4Nub}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4ubv(@NativeType("GLuint") int index, @NativeType("GLubyte const *") ByteBuffer v) { + GL20C.glVertexAttrib4ubv(index, v); + } + + // --- [ glVertexAttrib4usv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4usv VertexAttrib4usv} */ + public static void nglVertexAttrib4usv(int index, long v) { + GL20C.nglVertexAttrib4usv(index, v); + } + + /** + * Unsigned short pointer version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4usv(@NativeType("GLuint") int index, @NativeType("GLushort const *") ShortBuffer v) { + GL20C.glVertexAttrib4usv(index, v); + } + + // --- [ glVertexAttrib4uiv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4uiv VertexAttrib4uiv} */ + public static void nglVertexAttrib4uiv(int index, long v) { + GL20C.nglVertexAttrib4uiv(index, v); + } + + /** + * Unsigned int pointer version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4uiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") IntBuffer v) { + GL20C.glVertexAttrib4uiv(index, v); + } + + // --- [ glVertexAttrib4Nbv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4Nbv VertexAttrib4Nbv} */ + public static void nglVertexAttrib4Nbv(int index, long v) { + GL20C.nglVertexAttrib4Nbv(index, v); + } + + /** + * Normalized byte pointer version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4Nbv(@NativeType("GLuint") int index, @NativeType("GLbyte const *") ByteBuffer v) { + GL20C.glVertexAttrib4Nbv(index, v); + } + + // --- [ glVertexAttrib4Nsv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4Nsv VertexAttrib4Nsv} */ + public static void nglVertexAttrib4Nsv(int index, long v) { + GL20C.nglVertexAttrib4Nsv(index, v); + } + + /** + * Normalized short pointer version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4Nsv(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + GL20C.glVertexAttrib4Nsv(index, v); + } + + // --- [ glVertexAttrib4Niv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4Niv VertexAttrib4Niv} */ + public static void nglVertexAttrib4Niv(int index, long v) { + GL20C.nglVertexAttrib4Niv(index, v); + } + + /** + * Normalized int pointer version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4Niv(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + GL20C.glVertexAttrib4Niv(index, v); + } + + // --- [ glVertexAttrib4Nubv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4Nubv VertexAttrib4Nubv} */ + public static void nglVertexAttrib4Nubv(int index, long v) { + GL20C.nglVertexAttrib4Nubv(index, v); + } + + /** + * Normalized unsigned byte pointer version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4Nubv(@NativeType("GLuint") int index, @NativeType("GLubyte const *") ByteBuffer v) { + GL20C.glVertexAttrib4Nubv(index, v); + } + + // --- [ glVertexAttrib4Nusv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4Nusv VertexAttrib4Nusv} */ + public static void nglVertexAttrib4Nusv(int index, long v) { + GL20C.nglVertexAttrib4Nusv(index, v); + } + + /** + * Normalized unsigned short pointer version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4Nusv(@NativeType("GLuint") int index, @NativeType("GLushort const *") ShortBuffer v) { + GL20C.glVertexAttrib4Nusv(index, v); + } + + // --- [ glVertexAttrib4Nuiv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4Nuiv VertexAttrib4Nuiv} */ + public static void nglVertexAttrib4Nuiv(int index, long v) { + GL20C.nglVertexAttrib4Nuiv(index, v); + } + + /** + * Normalized unsigned int pointer version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4Nuiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") IntBuffer v) { + GL20C.glVertexAttrib4Nuiv(index, v); + } + + // --- [ glVertexAttribPointer ] --- + + /** Unsafe version of: {@link #glVertexAttribPointer VertexAttribPointer} */ + public static void nglVertexAttribPointer(int index, int size, int type, boolean normalized, int stride, long pointer) { + GL20C.nglVertexAttribPointer(index, size, type, normalized, stride, pointer); + } + + /** + * Specifies the location and organization of a vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. The initial value is GL_FLOAT. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL41#GL_FIXED FIXED}
+ * @param normalized whether fixed-point data values should be normalized or converted directly as fixed-point values when they are accessed + * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + GL20C.glVertexAttribPointer(index, size, type, normalized, stride, pointer); + } + + /** + * Specifies the location and organization of a vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. The initial value is GL_FLOAT. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL41#GL_FIXED FIXED}
+ * @param normalized whether fixed-point data values should be normalized or converted directly as fixed-point values when they are accessed + * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + GL20C.glVertexAttribPointer(index, size, type, normalized, stride, pointer); + } + + /** + * Specifies the location and organization of a vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. The initial value is GL_FLOAT. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL41#GL_FIXED FIXED}
+ * @param normalized whether fixed-point data values should be normalized or converted directly as fixed-point values when they are accessed + * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") ShortBuffer pointer) { + GL20C.glVertexAttribPointer(index, size, type, normalized, stride, pointer); + } + + /** + * Specifies the location and organization of a vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. The initial value is GL_FLOAT. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL41#GL_FIXED FIXED}
+ * @param normalized whether fixed-point data values should be normalized or converted directly as fixed-point values when they are accessed + * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") IntBuffer pointer) { + GL20C.glVertexAttribPointer(index, size, type, normalized, stride, pointer); + } + + /** + * Specifies the location and organization of a vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. The initial value is GL_FLOAT. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL41#GL_FIXED FIXED}
+ * @param normalized whether fixed-point data values should be normalized or converted directly as fixed-point values when they are accessed + * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") FloatBuffer pointer) { + GL20C.glVertexAttribPointer(index, size, type, normalized, stride, pointer); + } + + // --- [ glEnableVertexAttribArray ] --- + + /** + * Enables a generic vertex attribute array. + * + * @param index the index of the generic vertex attribute to be enabled + * + * @see Reference Page + */ + public static void glEnableVertexAttribArray(@NativeType("GLuint") int index) { + GL20C.glEnableVertexAttribArray(index); + } + + // --- [ glDisableVertexAttribArray ] --- + + /** + * Disables a generic vertex attribute array. + * + * @param index the index of the generic vertex attribute to be disabled + * + * @see Reference Page + */ + public static void glDisableVertexAttribArray(@NativeType("GLuint") int index) { + GL20C.glDisableVertexAttribArray(index); + } + + // --- [ glBindAttribLocation ] --- + + /** Unsafe version of: {@link #glBindAttribLocation BindAttribLocation} */ + public static void nglBindAttribLocation(int program, int index, long name) { + GL20C.nglBindAttribLocation(program, index, name); + } + + /** + * Associates a generic vertex attribute index with a named attribute variable. + * + * @param program the program object in which the association is to be made + * @param index the index of the generic vertex attribute to be bound + * @param name a null terminated string containing the name of the vertex shader attribute variable to which {@code index} is to be bound + * + * @see Reference Page + */ + public static void glBindAttribLocation(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @NativeType("GLchar const *") ByteBuffer name) { + GL20C.glBindAttribLocation(program, index, name); + } + + /** + * Associates a generic vertex attribute index with a named attribute variable. + * + * @param program the program object in which the association is to be made + * @param index the index of the generic vertex attribute to be bound + * @param name a null terminated string containing the name of the vertex shader attribute variable to which {@code index} is to be bound + * + * @see Reference Page + */ + public static void glBindAttribLocation(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @NativeType("GLchar const *") CharSequence name) { + GL20C.glBindAttribLocation(program, index, name); + } + + // --- [ glGetActiveAttrib ] --- + + /** + * Unsafe version of: {@link #glGetActiveAttrib GetActiveAttrib} + * + * @param maxLength the maximum number of characters OpenGL is allowed to write in the character buffer indicated by {@code name} + */ + public static void nglGetActiveAttrib(int program, int index, int maxLength, long length, long size, long type, long name) { + GL20C.nglGetActiveAttrib(program, index, maxLength, length, size, type, name); + } + + /** + * Returns information about an active attribute variable for the specified program object. + * + * @param program the program object to be queried + * @param index the index of the attribute variable to be queried + * @param length the number of characters actually written by OpenGL in the string indicated by {@code name} (excluding the null terminator) if a value other than + * {@code NULL} is passed + * @param size the size of the attribute variable + * @param type the data type of the attribute variable + * @param name a null terminated string containing the name of the attribute variable + * + * @see Reference Page + */ + public static void glGetActiveAttrib(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLint *") IntBuffer size, @NativeType("GLenum *") IntBuffer type, @NativeType("GLchar *") ByteBuffer name) { + GL20C.glGetActiveAttrib(program, index, length, size, type, name); + } + + /** + * Returns information about an active attribute variable for the specified program object. + * + * @param program the program object to be queried + * @param index the index of the attribute variable to be queried + * @param maxLength the maximum number of characters OpenGL is allowed to write in the character buffer indicated by {@code name} + * @param size the size of the attribute variable + * @param type the data type of the attribute variable + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveAttrib(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @NativeType("GLsizei") int maxLength, @NativeType("GLint *") IntBuffer size, @NativeType("GLenum *") IntBuffer type) { + return GL20C.glGetActiveAttrib(program, index, maxLength, size, type); + } + + /** + * Returns information about an active attribute variable for the specified program object. + * + * @param program the program object to be queried + * @param index the index of the attribute variable to be queried + * @param size the size of the attribute variable + * @param type the data type of the attribute variable + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveAttrib(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @NativeType("GLint *") IntBuffer size, @NativeType("GLenum *") IntBuffer type) { + return glGetActiveAttrib(program, index, glGetProgrami(program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH), size, type); + } + + // --- [ glGetAttribLocation ] --- + + /** Unsafe version of: {@link #glGetAttribLocation GetAttribLocation} */ + public static int nglGetAttribLocation(int program, long name) { + return GL20C.nglGetAttribLocation(program, name); + } + + /** + * Returns the location of an attribute variable. + * + * @param program the program object to be queried + * @param name a null terminated string containing the name of the attribute variable whose location is to be queried + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetAttribLocation(@NativeType("GLuint") int program, @NativeType("GLchar const *") ByteBuffer name) { + return GL20C.glGetAttribLocation(program, name); + } + + /** + * Returns the location of an attribute variable. + * + * @param program the program object to be queried + * @param name a null terminated string containing the name of the attribute variable whose location is to be queried + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetAttribLocation(@NativeType("GLuint") int program, @NativeType("GLchar const *") CharSequence name) { + return GL20C.glGetAttribLocation(program, name); + } + + // --- [ glGetVertexAttribiv ] --- + + /** Unsafe version of: {@link #glGetVertexAttribiv GetVertexAttribiv} */ + public static void nglGetVertexAttribiv(int index, int pname, long params) { + GL20C.nglGetVertexAttribiv(index, pname, params); + } + + /** + * Returns the integer value of a generic vertex attribute parameter. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the vertex attribute parameter to be queried. One of:
{@link GL15#GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING VERTEX_ATTRIB_ARRAY_BUFFER_BINDING}{@link GL20C#GL_VERTEX_ATTRIB_ARRAY_ENABLED VERTEX_ATTRIB_ARRAY_ENABLED}
{@link GL20C#GL_VERTEX_ATTRIB_ARRAY_SIZE VERTEX_ATTRIB_ARRAY_SIZE}{@link GL20C#GL_VERTEX_ATTRIB_ARRAY_STRIDE VERTEX_ATTRIB_ARRAY_STRIDE}
{@link GL20C#GL_VERTEX_ATTRIB_ARRAY_TYPE VERTEX_ATTRIB_ARRAY_TYPE}{@link GL20C#GL_VERTEX_ATTRIB_ARRAY_NORMALIZED VERTEX_ATTRIB_ARRAY_NORMALIZED}
{@link GL20C#GL_CURRENT_VERTEX_ATTRIB CURRENT_VERTEX_ATTRIB}{@link GL30#GL_VERTEX_ATTRIB_ARRAY_INTEGER VERTEX_ATTRIB_ARRAY_INTEGER}
{@link GL33#GL_VERTEX_ATTRIB_ARRAY_DIVISOR VERTEX_ATTRIB_ARRAY_DIVISOR}
+ * @param params returns the requested data + * + * @see Reference Page + */ + public static void glGetVertexAttribiv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL20C.glGetVertexAttribiv(index, pname, params); + } + + /** + * Returns the integer value of a generic vertex attribute parameter. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the vertex attribute parameter to be queried. One of:
{@link GL15#GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING VERTEX_ATTRIB_ARRAY_BUFFER_BINDING}{@link GL20C#GL_VERTEX_ATTRIB_ARRAY_ENABLED VERTEX_ATTRIB_ARRAY_ENABLED}
{@link GL20C#GL_VERTEX_ATTRIB_ARRAY_SIZE VERTEX_ATTRIB_ARRAY_SIZE}{@link GL20C#GL_VERTEX_ATTRIB_ARRAY_STRIDE VERTEX_ATTRIB_ARRAY_STRIDE}
{@link GL20C#GL_VERTEX_ATTRIB_ARRAY_TYPE VERTEX_ATTRIB_ARRAY_TYPE}{@link GL20C#GL_VERTEX_ATTRIB_ARRAY_NORMALIZED VERTEX_ATTRIB_ARRAY_NORMALIZED}
{@link GL20C#GL_CURRENT_VERTEX_ATTRIB CURRENT_VERTEX_ATTRIB}{@link GL30#GL_VERTEX_ATTRIB_ARRAY_INTEGER VERTEX_ATTRIB_ARRAY_INTEGER}
{@link GL33#GL_VERTEX_ATTRIB_ARRAY_DIVISOR VERTEX_ATTRIB_ARRAY_DIVISOR}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetVertexAttribi(@NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + return GL20C.glGetVertexAttribi(index, pname); + } + + // --- [ glGetVertexAttribfv ] --- + + /** Unsafe version of: {@link #glGetVertexAttribfv GetVertexAttribfv} */ + public static void nglGetVertexAttribfv(int index, int pname, long params) { + GL20C.nglGetVertexAttribfv(index, pname, params); + } + + /** + * Float version of {@link #glGetVertexAttribiv GetVertexAttribiv}. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the vertex attribute parameter to be queried + * @param params returns the requested data + * + * @see Reference Page + */ + public static void glGetVertexAttribfv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + GL20C.glGetVertexAttribfv(index, pname, params); + } + + // --- [ glGetVertexAttribdv ] --- + + /** Unsafe version of: {@link #glGetVertexAttribdv GetVertexAttribdv} */ + public static void nglGetVertexAttribdv(int index, int pname, long params) { + GL20C.nglGetVertexAttribdv(index, pname, params); + } + + /** + * Double version of {@link #glGetVertexAttribiv GetVertexAttribiv}. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the vertex attribute parameter to be queried + * @param params returns the requested data + * + * @see Reference Page + */ + public static void glGetVertexAttribdv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLdouble *") DoubleBuffer params) { + GL20C.glGetVertexAttribdv(index, pname, params); + } + + // --- [ glGetVertexAttribPointerv ] --- + + /** Unsafe version of: {@link #glGetVertexAttribPointerv GetVertexAttribPointerv} */ + public static void nglGetVertexAttribPointerv(int index, int pname, long pointer) { + GL20C.nglGetVertexAttribPointerv(index, pname, pointer); + } + + /** + * Returns the address of the specified generic vertex attribute pointer. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the generic vertex attribute parameter to be returned. Must be:
{@link GL20C#GL_VERTEX_ATTRIB_ARRAY_POINTER VERTEX_ATTRIB_ARRAY_POINTER}
+ * @param pointer the pointer value + * + * @see Reference Page + */ + public static void glGetVertexAttribPointerv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("void **") PointerBuffer pointer) { + GL20C.glGetVertexAttribPointerv(index, pname, pointer); + } + + /** + * Returns the address of the specified generic vertex attribute pointer. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the generic vertex attribute parameter to be returned. Must be:
{@link GL20C#GL_VERTEX_ATTRIB_ARRAY_POINTER VERTEX_ATTRIB_ARRAY_POINTER}
+ * + * @see Reference Page + */ + @NativeType("void") + public static long glGetVertexAttribPointer(@NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + return GL20C.glGetVertexAttribPointer(index, pname); + } + + // --- [ glDrawBuffers ] --- + + /** + * Unsafe version of: {@link #glDrawBuffers DrawBuffers} + * + * @param n the number of buffers in {@code bufs} + */ + public static void nglDrawBuffers(int n, long bufs) { + GL20C.nglDrawBuffers(n, bufs); + } + + /** + * Specifies a list of color buffers to be drawn into. + * + * @param bufs an array of symbolic constants specifying the buffers into which fragment colors or data values will be written. One of:
{@link GL11#GL_NONE NONE}{@link GL11#GL_FRONT_LEFT FRONT_LEFT}{@link GL11#GL_FRONT_RIGHT FRONT_RIGHT}{@link GL11#GL_BACK_LEFT BACK_LEFT}{@link GL11#GL_BACK_RIGHT BACK_RIGHT}{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}
GL30.GL_COLOR_ATTACHMENT[1-15]
+ * + * @see Reference Page + */ + public static void glDrawBuffers(@NativeType("GLenum const *") IntBuffer bufs) { + GL20C.glDrawBuffers(bufs); + } + + /** + * Specifies a list of color buffers to be drawn into. + * + * @see Reference Page + */ + public static void glDrawBuffers(@NativeType("GLenum const *") int buf) { + GL20C.glDrawBuffers(buf); + } + + // --- [ glBlendEquationSeparate ] --- + + /** + * Sets the RGB blend equation and the alpha blend equation separately. + * + * @param modeRGB the RGB blend equation, how the red, green, and blue components of the source and destination colors are combined. One of:
{@link GL14#GL_FUNC_ADD FUNC_ADD}{@link GL14#GL_FUNC_SUBTRACT FUNC_SUBTRACT}{@link GL14#GL_FUNC_REVERSE_SUBTRACT FUNC_REVERSE_SUBTRACT}{@link GL14#GL_MIN MIN}{@link GL14#GL_MAX MAX}
+ * @param modeAlpha the alpha blend equation, how the alpha component of the source and destination colors are combined + * + * @see Reference Page + */ + public static void glBlendEquationSeparate(@NativeType("GLenum") int modeRGB, @NativeType("GLenum") int modeAlpha) { + GL20C.glBlendEquationSeparate(modeRGB, modeAlpha); + } + + // --- [ glStencilOpSeparate ] --- + + /** + * Sets front and/or back stencil test actions. + * + * @param face whether front and/or back stencil state is updated. One of:
{@link GL11#GL_FRONT FRONT}{@link GL11#GL_BACK BACK}{@link GL11#GL_FRONT_AND_BACK FRONT_AND_BACK}
+ * @param sfail the action to take when the stencil test fails. The initial value is GL_KEEP. One of:
{@link GL11#GL_KEEP KEEP}{@link GL11#GL_ZERO ZERO}{@link GL11#GL_REPLACE REPLACE}{@link GL11#GL_INCR INCR}{@link GL14#GL_INCR_WRAP INCR_WRAP}{@link GL11#GL_DECR DECR}{@link GL14#GL_DECR_WRAP DECR_WRAP}{@link GL11#GL_INVERT INVERT}
+ * @param dpfail the stencil action when the stencil test passes, but the depth test fails. The initial value is GL_KEEP + * @param dppass the stencil action when both the stencil test and the depth test pass, or when the stencil test passes and either there is no depth buffer or depth + * testing is not enabled. The initial value is GL_KEEP + * + * @see Reference Page + */ + public static void glStencilOpSeparate(@NativeType("GLenum") int face, @NativeType("GLenum") int sfail, @NativeType("GLenum") int dpfail, @NativeType("GLenum") int dppass) { + GL20C.glStencilOpSeparate(face, sfail, dpfail, dppass); + } + + // --- [ glStencilFuncSeparate ] --- + + /** + * Sets front and/or back function and reference value for stencil testing. + * + * @param face whether front and/or back stencil state is updated. One of:
{@link GL11#GL_FRONT FRONT}{@link GL11#GL_BACK BACK}{@link GL11#GL_FRONT_AND_BACK FRONT_AND_BACK}
+ * @param func the test function. The initial value is GL_ALWAYS. One of:
{@link GL11#GL_NEVER NEVER}{@link GL11#GL_LESS LESS}{@link GL11#GL_LEQUAL LEQUAL}{@link GL11#GL_GREATER GREATER}{@link GL11#GL_GEQUAL GEQUAL}{@link GL11#GL_EQUAL EQUAL}{@link GL11#GL_NOTEQUAL NOTEQUAL}{@link GL11#GL_ALWAYS ALWAYS}
+ * @param ref the reference value for the stencil test. {@code ref} is clamped to the range [0, 2n – 1], where {@code n} is the number of bitplanes in the stencil + * buffer. The initial value is 0. + * @param mask a mask that is ANDed with both the reference value and the stored stencil value when the test is done. The initial value is all 1's. + * + * @see Reference Page + */ + public static void glStencilFuncSeparate(@NativeType("GLenum") int face, @NativeType("GLenum") int func, @NativeType("GLint") int ref, @NativeType("GLuint") int mask) { + GL20C.glStencilFuncSeparate(face, func, ref, mask); + } + + // --- [ glStencilMaskSeparate ] --- + + /** + * Controls the front and/or back writing of individual bits in the stencil planes. + * + * @param face whether front and/or back stencil writemask is updated. One of:
{@link GL11#GL_FRONT FRONT}{@link GL11#GL_BACK BACK}{@link GL11#GL_FRONT_AND_BACK FRONT_AND_BACK}
+ * @param mask a bit mask to enable and disable writing of individual bits in the stencil planes. Initially, the mask is all 1's. + * + * @see Reference Page + */ + public static void glStencilMaskSeparate(@NativeType("GLenum") int face, @NativeType("GLuint") int mask) { + GL20C.glStencilMaskSeparate(face, mask); + } + + /** + * Array version of: {@link #glShaderSource ShaderSource} + * + * @see Reference Page + */ + public static void glShaderSource(@NativeType("GLuint") int shader, @NativeType("GLchar const **") PointerBuffer strings, @Nullable @NativeType("GLint const *") int[] length) { + GL20C.glShaderSource(shader, strings, length); + } + + /** + * Array version of: {@link #glUniform1fv Uniform1fv} + * + * @see Reference Page + */ + public static void glUniform1fv(@NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + GL20C.glUniform1fv(location, value); + } + + /** + * Array version of: {@link #glUniform2fv Uniform2fv} + * + * @see Reference Page + */ + public static void glUniform2fv(@NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + GL20C.glUniform2fv(location, value); + } + + /** + * Array version of: {@link #glUniform3fv Uniform3fv} + * + * @see Reference Page + */ + public static void glUniform3fv(@NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + GL20C.glUniform3fv(location, value); + } + + /** + * Array version of: {@link #glUniform4fv Uniform4fv} + * + * @see Reference Page + */ + public static void glUniform4fv(@NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + GL20C.glUniform4fv(location, value); + } + + /** + * Array version of: {@link #glUniform1iv Uniform1iv} + * + * @see Reference Page + */ + public static void glUniform1iv(@NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + GL20C.glUniform1iv(location, value); + } + + /** + * Array version of: {@link #glUniform2iv Uniform2iv} + * + * @see Reference Page + */ + public static void glUniform2iv(@NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + GL20C.glUniform2iv(location, value); + } + + /** + * Array version of: {@link #glUniform3iv Uniform3iv} + * + * @see Reference Page + */ + public static void glUniform3iv(@NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + GL20C.glUniform3iv(location, value); + } + + /** + * Array version of: {@link #glUniform4iv Uniform4iv} + * + * @see Reference Page + */ + public static void glUniform4iv(@NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + GL20C.glUniform4iv(location, value); + } + + /** + * Array version of: {@link #glUniformMatrix2fv UniformMatrix2fv} + * + * @see Reference Page + */ + public static void glUniformMatrix2fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL20C.glUniformMatrix2fv(location, transpose, value); + } + + /** + * Array version of: {@link #glUniformMatrix3fv UniformMatrix3fv} + * + * @see Reference Page + */ + public static void glUniformMatrix3fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL20C.glUniformMatrix3fv(location, transpose, value); + } + + /** + * Array version of: {@link #glUniformMatrix4fv UniformMatrix4fv} + * + * @see Reference Page + */ + public static void glUniformMatrix4fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL20C.glUniformMatrix4fv(location, transpose, value); + } + + /** + * Array version of: {@link #glGetShaderiv GetShaderiv} + * + * @see Reference Page + */ + public static void glGetShaderiv(@NativeType("GLuint") int shader, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL20C.glGetShaderiv(shader, pname, params); + } + + /** + * Array version of: {@link #glGetProgramiv GetProgramiv} + * + * @see Reference Page + */ + public static void glGetProgramiv(@NativeType("GLuint") int program, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL20C.glGetProgramiv(program, pname, params); + } + + /** + * Array version of: {@link #glGetShaderInfoLog GetShaderInfoLog} + * + * @see Reference Page + */ + public static void glGetShaderInfoLog(@NativeType("GLuint") int shader, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer infoLog) { + GL20C.glGetShaderInfoLog(shader, length, infoLog); + } + + /** + * Array version of: {@link #glGetProgramInfoLog GetProgramInfoLog} + * + * @see Reference Page + */ + public static void glGetProgramInfoLog(@NativeType("GLuint") int program, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer infoLog) { + GL20C.glGetProgramInfoLog(program, length, infoLog); + } + + /** + * Array version of: {@link #glGetAttachedShaders GetAttachedShaders} + * + * @see Reference Page + */ + public static void glGetAttachedShaders(@NativeType("GLuint") int program, @Nullable @NativeType("GLsizei *") int[] count, @NativeType("GLuint *") int[] shaders) { + GL20C.glGetAttachedShaders(program, count, shaders); + } + + /** + * Array version of: {@link #glGetActiveUniform GetActiveUniform} + * + * @see Reference Page + */ + public static void glGetActiveUniform(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLint *") int[] size, @NativeType("GLenum *") int[] type, @NativeType("GLchar *") ByteBuffer name) { + GL20C.glGetActiveUniform(program, index, length, size, type, name); + } + + /** + * Array version of: {@link #glGetUniformfv GetUniformfv} + * + * @see Reference Page + */ + public static void glGetUniformfv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat *") float[] params) { + GL20C.glGetUniformfv(program, location, params); + } + + /** + * Array version of: {@link #glGetUniformiv GetUniformiv} + * + * @see Reference Page + */ + public static void glGetUniformiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint *") int[] params) { + GL20C.glGetUniformiv(program, location, params); + } + + /** + * Array version of: {@link #glGetShaderSource GetShaderSource} + * + * @see Reference Page + */ + public static void glGetShaderSource(@NativeType("GLuint") int shader, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer source) { + GL20C.glGetShaderSource(shader, length, source); + } + + /** + * Array version of: {@link #glVertexAttrib1fv VertexAttrib1fv} + * + * @see Reference Page + */ + public static void glVertexAttrib1fv(@NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] v) { + GL20C.glVertexAttrib1fv(index, v); + } + + /** + * Array version of: {@link #glVertexAttrib1sv VertexAttrib1sv} + * + * @see Reference Page + */ + public static void glVertexAttrib1sv(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + GL20C.glVertexAttrib1sv(index, v); + } + + /** + * Array version of: {@link #glVertexAttrib1dv VertexAttrib1dv} + * + * @see Reference Page + */ + public static void glVertexAttrib1dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + GL20C.glVertexAttrib1dv(index, v); + } + + /** + * Array version of: {@link #glVertexAttrib2fv VertexAttrib2fv} + * + * @see Reference Page + */ + public static void glVertexAttrib2fv(@NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] v) { + GL20C.glVertexAttrib2fv(index, v); + } + + /** + * Array version of: {@link #glVertexAttrib2sv VertexAttrib2sv} + * + * @see Reference Page + */ + public static void glVertexAttrib2sv(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + GL20C.glVertexAttrib2sv(index, v); + } + + /** + * Array version of: {@link #glVertexAttrib2dv VertexAttrib2dv} + * + * @see Reference Page + */ + public static void glVertexAttrib2dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + GL20C.glVertexAttrib2dv(index, v); + } + + /** + * Array version of: {@link #glVertexAttrib3fv VertexAttrib3fv} + * + * @see Reference Page + */ + public static void glVertexAttrib3fv(@NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] v) { + GL20C.glVertexAttrib3fv(index, v); + } + + /** + * Array version of: {@link #glVertexAttrib3sv VertexAttrib3sv} + * + * @see Reference Page + */ + public static void glVertexAttrib3sv(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + GL20C.glVertexAttrib3sv(index, v); + } + + /** + * Array version of: {@link #glVertexAttrib3dv VertexAttrib3dv} + * + * @see Reference Page + */ + public static void glVertexAttrib3dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + GL20C.glVertexAttrib3dv(index, v); + } + + /** + * Array version of: {@link #glVertexAttrib4fv VertexAttrib4fv} + * + * @see Reference Page + */ + public static void glVertexAttrib4fv(@NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] v) { + GL20C.glVertexAttrib4fv(index, v); + } + + /** + * Array version of: {@link #glVertexAttrib4sv VertexAttrib4sv} + * + * @see Reference Page + */ + public static void glVertexAttrib4sv(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + GL20C.glVertexAttrib4sv(index, v); + } + + /** + * Array version of: {@link #glVertexAttrib4dv VertexAttrib4dv} + * + * @see Reference Page + */ + public static void glVertexAttrib4dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + GL20C.glVertexAttrib4dv(index, v); + } + + /** + * Array version of: {@link #glVertexAttrib4iv VertexAttrib4iv} + * + * @see Reference Page + */ + public static void glVertexAttrib4iv(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + GL20C.glVertexAttrib4iv(index, v); + } + + /** + * Array version of: {@link #glVertexAttrib4usv VertexAttrib4usv} + * + * @see Reference Page + */ + public static void glVertexAttrib4usv(@NativeType("GLuint") int index, @NativeType("GLushort const *") short[] v) { + GL20C.glVertexAttrib4usv(index, v); + } + + /** + * Array version of: {@link #glVertexAttrib4uiv VertexAttrib4uiv} + * + * @see Reference Page + */ + public static void glVertexAttrib4uiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") int[] v) { + GL20C.glVertexAttrib4uiv(index, v); + } + + /** + * Array version of: {@link #glVertexAttrib4Nsv VertexAttrib4Nsv} + * + * @see Reference Page + */ + public static void glVertexAttrib4Nsv(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + GL20C.glVertexAttrib4Nsv(index, v); + } + + /** + * Array version of: {@link #glVertexAttrib4Niv VertexAttrib4Niv} + * + * @see Reference Page + */ + public static void glVertexAttrib4Niv(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + GL20C.glVertexAttrib4Niv(index, v); + } + + /** + * Array version of: {@link #glVertexAttrib4Nusv VertexAttrib4Nusv} + * + * @see Reference Page + */ + public static void glVertexAttrib4Nusv(@NativeType("GLuint") int index, @NativeType("GLushort const *") short[] v) { + GL20C.glVertexAttrib4Nusv(index, v); + } + + /** + * Array version of: {@link #glVertexAttrib4Nuiv VertexAttrib4Nuiv} + * + * @see Reference Page + */ + public static void glVertexAttrib4Nuiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") int[] v) { + GL20C.glVertexAttrib4Nuiv(index, v); + } + + /** + * Array version of: {@link #glGetActiveAttrib GetActiveAttrib} + * + * @see Reference Page + */ + public static void glGetActiveAttrib(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLint *") int[] size, @NativeType("GLenum *") int[] type, @NativeType("GLchar *") ByteBuffer name) { + GL20C.glGetActiveAttrib(program, index, length, size, type, name); + } + + /** + * Array version of: {@link #glGetVertexAttribiv GetVertexAttribiv} + * + * @see Reference Page + */ + public static void glGetVertexAttribiv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL20C.glGetVertexAttribiv(index, pname, params); + } + + /** + * Array version of: {@link #glGetVertexAttribfv GetVertexAttribfv} + * + * @see Reference Page + */ + public static void glGetVertexAttribfv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + GL20C.glGetVertexAttribfv(index, pname, params); + } + + /** + * Array version of: {@link #glGetVertexAttribdv GetVertexAttribdv} + * + * @see Reference Page + */ + public static void glGetVertexAttribdv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLdouble *") double[] params) { + GL20C.glGetVertexAttribdv(index, pname, params); + } + + /** + * Array version of: {@link #glDrawBuffers DrawBuffers} + * + * @see Reference Page + */ + public static void glDrawBuffers(@NativeType("GLenum const *") int[] bufs) { + GL20C.glDrawBuffers(bufs); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL20C.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL20C.java new file mode 100644 index 00000000..f5b51c83 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL20C.java @@ -0,0 +1,2962 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality of a forward compatible context, up to version 2.0. + * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL20C extends GL15C { + + /** Accepted by the {@code name} parameter of GetString. */ + public static final int GL_SHADING_LANGUAGE_VERSION = 0x8B8C; + + /** Accepted by the {@code pname} parameter of GetInteger. */ + public static final int GL_CURRENT_PROGRAM = 0x8B8D; + + /** Accepted by the {@code pname} parameter of GetShaderiv. */ + public static final int + GL_SHADER_TYPE = 0x8B4F, + GL_DELETE_STATUS = 0x8B80, + GL_COMPILE_STATUS = 0x8B81, + GL_LINK_STATUS = 0x8B82, + GL_VALIDATE_STATUS = 0x8B83, + GL_INFO_LOG_LENGTH = 0x8B84, + GL_ATTACHED_SHADERS = 0x8B85, + GL_ACTIVE_UNIFORMS = 0x8B86, + GL_ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87, + GL_ACTIVE_ATTRIBUTES = 0x8B89, + GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A, + GL_SHADER_SOURCE_LENGTH = 0x8B88; + + /** Returned by the {@code type} parameter of GetActiveUniform. */ + public static final int + GL_FLOAT_VEC2 = 0x8B50, + GL_FLOAT_VEC3 = 0x8B51, + GL_FLOAT_VEC4 = 0x8B52, + GL_INT_VEC2 = 0x8B53, + GL_INT_VEC3 = 0x8B54, + GL_INT_VEC4 = 0x8B55, + GL_BOOL = 0x8B56, + GL_BOOL_VEC2 = 0x8B57, + GL_BOOL_VEC3 = 0x8B58, + GL_BOOL_VEC4 = 0x8B59, + GL_FLOAT_MAT2 = 0x8B5A, + GL_FLOAT_MAT3 = 0x8B5B, + GL_FLOAT_MAT4 = 0x8B5C, + GL_SAMPLER_1D = 0x8B5D, + GL_SAMPLER_2D = 0x8B5E, + GL_SAMPLER_3D = 0x8B5F, + GL_SAMPLER_CUBE = 0x8B60, + GL_SAMPLER_1D_SHADOW = 0x8B61, + GL_SAMPLER_2D_SHADOW = 0x8B62; + + /** Accepted by the {@code type} argument of CreateShader and returned by the {@code params} parameter of GetShaderiv. */ + public static final int GL_VERTEX_SHADER = 0x8B31; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A, + GL_MAX_VARYING_FLOATS = 0x8B4B, + GL_MAX_VERTEX_ATTRIBS = 0x8869, + GL_MAX_TEXTURE_IMAGE_UNITS = 0x8872, + GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C, + GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D; + + /** + * Accepted by the {@code cap} parameter of Disable, Enable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_VERTEX_PROGRAM_POINT_SIZE = 0x8642; + + /** Accepted by the {@code pname} parameter of GetVertexAttrib{dfi}v. */ + public static final int + GL_VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622, + GL_VERTEX_ATTRIB_ARRAY_SIZE = 0x8623, + GL_VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624, + GL_VERTEX_ATTRIB_ARRAY_TYPE = 0x8625, + GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A, + GL_CURRENT_VERTEX_ATTRIB = 0x8626; + + /** Accepted by the {@code pname} parameter of GetVertexAttribPointerv. */ + public static final int GL_VERTEX_ATTRIB_ARRAY_POINTER = 0x8645; + + /** Accepted by the {@code type} argument of CreateShader and returned by the {@code params} parameter of GetShaderiv. */ + public static final int GL_FRAGMENT_SHADER = 0x8B30; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49; + + /** Accepted by the {@code target} parameter of Hint and the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B; + + /** Accepted by the {@code pname} parameters of GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_DRAW_BUFFERS = 0x8824, + GL_DRAW_BUFFER0 = 0x8825, + GL_DRAW_BUFFER1 = 0x8826, + GL_DRAW_BUFFER2 = 0x8827, + GL_DRAW_BUFFER3 = 0x8828, + GL_DRAW_BUFFER4 = 0x8829, + GL_DRAW_BUFFER5 = 0x882A, + GL_DRAW_BUFFER6 = 0x882B, + GL_DRAW_BUFFER7 = 0x882C, + GL_DRAW_BUFFER8 = 0x882D, + GL_DRAW_BUFFER9 = 0x882E, + GL_DRAW_BUFFER10 = 0x882F, + GL_DRAW_BUFFER11 = 0x8830, + GL_DRAW_BUFFER12 = 0x8831, + GL_DRAW_BUFFER13 = 0x8832, + GL_DRAW_BUFFER14 = 0x8833, + GL_DRAW_BUFFER15 = 0x8834; + + /** Accepted by the {@code pname} parameter of PointParameter{if}v. */ + public static final int GL_POINT_SPRITE_COORD_ORIGIN = 0x8CA0; + + /** Accepted by the {@code param} parameter of PointParameter{if}v. */ + public static final int + GL_LOWER_LEFT = 0x8CA1, + GL_UPPER_LEFT = 0x8CA2; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_BLEND_EQUATION_RGB = 0x8009, + GL_BLEND_EQUATION_ALPHA = 0x883D; + + /** Accepted by the {@code pname} parameter of GetIntegerv. */ + public static final int + GL_STENCIL_BACK_FUNC = 0x8800, + GL_STENCIL_BACK_FAIL = 0x8801, + GL_STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802, + GL_STENCIL_BACK_PASS_DEPTH_PASS = 0x8803, + GL_STENCIL_BACK_REF = 0x8CA3, + GL_STENCIL_BACK_VALUE_MASK = 0x8CA4, + GL_STENCIL_BACK_WRITEMASK = 0x8CA5; + + static { GL.initialize(); } + + protected GL20C() { + throw new UnsupportedOperationException(); + } + + // --- [ glCreateProgram ] --- + + /** + * Creates a program object. + * + * @see Reference Page + */ + @NativeType("GLuint") + public static native int glCreateProgram(); + + // --- [ glDeleteProgram ] --- + + /** + * Deletes a program object. + * + * @param program the program object to be deleted + * + * @see Reference Page + */ + public static native void glDeleteProgram(@NativeType("GLuint") int program); + + // --- [ glIsProgram ] --- + + /** + * Returns {@link GL11#GL_TRUE TRUE} if {@code program} is the name of a program object. If {@code program} is zero, or a non-zero value that is not the name of a program + * object, IsProgram returns {@link GL11#GL_FALSE FALSE}. No error is generated if program is not a valid program object name. + * + * @param program the program object name to query + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static native boolean glIsProgram(@NativeType("GLuint") int program); + + // --- [ glCreateShader ] --- + + /** + * Creates a shader object. + * + * @param type the type of shader to be created. One of:
{@link #GL_VERTEX_SHADER VERTEX_SHADER}{@link #GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * + * @see Reference Page + */ + @NativeType("GLuint") + public static native int glCreateShader(@NativeType("GLenum") int type); + + // --- [ glDeleteShader ] --- + + /** + * Deletes a shader object. + * + * @param shader the shader object to be deleted + * + * @see Reference Page + */ + public static native void glDeleteShader(@NativeType("GLuint") int shader); + + // --- [ glIsShader ] --- + + /** + * Returns {@link GL11#GL_TRUE TRUE} if {@code shader} is the name of a shader object. If {@code shader} is zero, or a nonzero value that is not the name of a shader + * object, IsShader returns {@link GL11#GL_FALSE FALSE}. No error is generated if shader is not a valid shader object name. + * + * @param shader the shader object name to query + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static native boolean glIsShader(@NativeType("GLuint") int shader); + + // --- [ glAttachShader ] --- + + /** + * Attaches a shader object to a program object. + * + *

In order to create a complete shader program, there must be a way to specify the list of things that will be linked together. Program objects provide + * this mechanism. Shaders that are to be linked together in a program object must first be attached to that program object. glAttachShader attaches the + * shader object specified by shader to the program object specified by program. This indicates that shader will be included in link operations that will + * be performed on program.

+ * + *

All operations that can be performed on a shader object are valid whether or not the shader object is attached to a program object. It is permissible to + * attach a shader object to a program object before source code has been loaded into the shader object or before the shader object has been compiled. It + * is permissible to attach multiple shader objects of the same type because each may contain a portion of the complete shader. It is also permissible to + * attach a shader object to more than one program object. If a shader object is deleted while it is attached to a program object, it will be flagged for + * deletion, and deletion will not occur until glDetachShader is called to detach it from all program objects to which it is attached.

+ * + * @param program the program object to which a shader object will be attached + * @param shader the shader object that is to be attached + * + * @see Reference Page + */ + public static native void glAttachShader(@NativeType("GLuint") int program, @NativeType("GLuint") int shader); + + // --- [ glDetachShader ] --- + + /** + * Detaches a shader object from a program object to which it is attached. + * + * @param program the program object from which to detach the shader object + * @param shader the shader object to be detached + * + * @see Reference Page + */ + public static native void glDetachShader(@NativeType("GLuint") int program, @NativeType("GLuint") int shader); + + // --- [ glShaderSource ] --- + + /** + * Unsafe version of: {@link #glShaderSource ShaderSource} + * + * @param count the number of elements in the string and length arrays + */ + public static native void nglShaderSource(int shader, int count, long strings, long length); + + /** + * Sets the source code in {@code shader} to the source code in the array of strings specified by {@code strings}. Any source code previously stored in the + * shader object is completely replaced. The number of strings in the array is specified by {@code count}. If {@code length} is {@code NULL}, each string is + * assumed to be null terminated. If {@code length} is a value other than {@code NULL}, it points to an array containing a string length for each of the + * corresponding elements of {@code strings}. Each element in the length array may contain the length of the corresponding string (the null character is not + * counted as part of the string length) or a value less than 0 to indicate that the string is null terminated. The source code strings are not scanned or + * parsed at this time; they are simply copied into the specified shader object. + * + * @param shader the shader object whose source code is to be replaced + * @param strings an array of pointers to strings containing the source code to be loaded into the shader + * @param length an array of string lengths + * + * @see Reference Page + */ + public static void glShaderSource(@NativeType("GLuint") int shader, @NativeType("GLchar const **") PointerBuffer strings, @Nullable @NativeType("GLint const *") IntBuffer length) { + if (CHECKS) { + checkSafe(length, strings.remaining()); + } + nglShaderSource(shader, strings.remaining(), memAddress(strings), memAddressSafe(length)); + } + + /** + * Sets the source code in {@code shader} to the source code in the array of strings specified by {@code strings}. Any source code previously stored in the + * shader object is completely replaced. The number of strings in the array is specified by {@code count}. If {@code length} is {@code NULL}, each string is + * assumed to be null terminated. If {@code length} is a value other than {@code NULL}, it points to an array containing a string length for each of the + * corresponding elements of {@code strings}. Each element in the length array may contain the length of the corresponding string (the null character is not + * counted as part of the string length) or a value less than 0 to indicate that the string is null terminated. The source code strings are not scanned or + * parsed at this time; they are simply copied into the specified shader object. + * + * @param shader the shader object whose source code is to be replaced + * @param strings an array of pointers to strings containing the source code to be loaded into the shader + * + * @see Reference Page + */ + public static void glShaderSource(@NativeType("GLuint") int shader, @NativeType("GLchar const **") CharSequence... strings) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + long stringsAddress = org.lwjgl.system.APIUtil.apiArrayi(stack, MemoryUtil::memUTF8, strings); + nglShaderSource(shader, strings.length, stringsAddress, stringsAddress - (strings.length << 2)); + org.lwjgl.system.APIUtil.apiArrayFree(stringsAddress, strings.length); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Sets the source code in {@code shader} to the source code in the array of strings specified by {@code strings}. Any source code previously stored in the + * shader object is completely replaced. The number of strings in the array is specified by {@code count}. If {@code length} is {@code NULL}, each string is + * assumed to be null terminated. If {@code length} is a value other than {@code NULL}, it points to an array containing a string length for each of the + * corresponding elements of {@code strings}. Each element in the length array may contain the length of the corresponding string (the null character is not + * counted as part of the string length) or a value less than 0 to indicate that the string is null terminated. The source code strings are not scanned or + * parsed at this time; they are simply copied into the specified shader object. + * + * @param shader the shader object whose source code is to be replaced + * + * @see Reference Page + */ + public static void glShaderSource(@NativeType("GLuint") int shader, @NativeType("GLchar const **") CharSequence string) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + long stringsAddress = org.lwjgl.system.APIUtil.apiArrayi(stack, MemoryUtil::memUTF8, string); + nglShaderSource(shader, 1, stringsAddress, stringsAddress - 4); + org.lwjgl.system.APIUtil.apiArrayFree(stringsAddress, 1); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glCompileShader ] --- + + /** + * Compiles a shader object. + * + * @param shader the shader object to be compiled + * + * @see Reference Page + */ + public static native void glCompileShader(@NativeType("GLuint") int shader); + + // --- [ glLinkProgram ] --- + + /** + * Links a program object. + * + * @param program the program object to be linked + * + * @see Reference Page + */ + public static native void glLinkProgram(@NativeType("GLuint") int program); + + // --- [ glUseProgram ] --- + + /** + * Installs a program object as part of current rendering state. + * + * @param program the program object whose executables are to be used as part of current rendering state + * + * @see Reference Page + */ + public static native void glUseProgram(@NativeType("GLuint") int program); + + // --- [ glValidateProgram ] --- + + /** + * Validates a program object. + * + * @param program the program object to be validated + * + * @see Reference Page + */ + public static native void glValidateProgram(@NativeType("GLuint") int program); + + // --- [ glUniform1f ] --- + + /** + * Specifies the value of a float uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform value + * + * @see Reference Page + */ + public static native void glUniform1f(@NativeType("GLint") int location, @NativeType("GLfloat") float v0); + + // --- [ glUniform2f ] --- + + /** + * Specifies the value of a vec2 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform x value + * @param v1 the uniform y value + * + * @see Reference Page + */ + public static native void glUniform2f(@NativeType("GLint") int location, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1); + + // --- [ glUniform3f ] --- + + /** + * Specifies the value of a vec3 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform x value + * @param v1 the uniform y value + * @param v2 the uniform z value + * + * @see Reference Page + */ + public static native void glUniform3f(@NativeType("GLint") int location, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1, @NativeType("GLfloat") float v2); + + // --- [ glUniform4f ] --- + + /** + * Specifies the value of a vec4 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform x value + * @param v1 the uniform y value + * @param v2 the uniform z value + * @param v3 the uniform w value + * + * @see Reference Page + */ + public static native void glUniform4f(@NativeType("GLint") int location, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1, @NativeType("GLfloat") float v2, @NativeType("GLfloat") float v3); + + // --- [ glUniform1i ] --- + + /** + * Specifies the value of an int uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform value + * + * @see Reference Page + */ + public static native void glUniform1i(@NativeType("GLint") int location, @NativeType("GLint") int v0); + + // --- [ glUniform2i ] --- + + /** + * Specifies the value of an ivec2 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform x value + * @param v1 the uniform y value + * + * @see Reference Page + */ + public static native void glUniform2i(@NativeType("GLint") int location, @NativeType("GLint") int v0, @NativeType("GLint") int v1); + + // --- [ glUniform3i ] --- + + /** + * Specifies the value of an ivec3 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform x value + * @param v1 the uniform y value + * @param v2 the uniform z value + * + * @see Reference Page + */ + public static native void glUniform3i(@NativeType("GLint") int location, @NativeType("GLint") int v0, @NativeType("GLint") int v1, @NativeType("GLint") int v2); + + // --- [ glUniform4i ] --- + + /** + * Specifies the value of an ivec4 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform x value + * @param v1 the uniform y value + * @param v2 the uniform z value + * @param v3 the uniform w value + * + * @see Reference Page + */ + public static native void glUniform4i(@NativeType("GLint") int location, @NativeType("GLint") int v0, @NativeType("GLint") int v1, @NativeType("GLint") int v2, @NativeType("GLint") int v3); + + // --- [ glUniform1fv ] --- + + /** + * Unsafe version of: {@link #glUniform1fv Uniform1fv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform1fv(int location, int count, long value); + + /** + * Specifies the value of a single float uniform variable or a float uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform1fv(@NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + nglUniform1fv(location, value.remaining(), memAddress(value)); + } + + // --- [ glUniform2fv ] --- + + /** + * Unsafe version of: {@link #glUniform2fv Uniform2fv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform2fv(int location, int count, long value); + + /** + * Specifies the value of a single vec2 uniform variable or a vec2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform2fv(@NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + nglUniform2fv(location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glUniform3fv ] --- + + /** + * Unsafe version of: {@link #glUniform3fv Uniform3fv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform3fv(int location, int count, long value); + + /** + * Specifies the value of a single vec3 uniform variable or a vec3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform3fv(@NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + nglUniform3fv(location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glUniform4fv ] --- + + /** + * Unsafe version of: {@link #glUniform4fv Uniform4fv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform4fv(int location, int count, long value); + + /** + * Specifies the value of a single vec4 uniform variable or a vec4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform4fv(@NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + nglUniform4fv(location, value.remaining() >> 2, memAddress(value)); + } + + // --- [ glUniform1iv ] --- + + /** + * Unsafe version of: {@link #glUniform1iv Uniform1iv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform1iv(int location, int count, long value); + + /** + * Specifies the value of a single int uniform variable or a int uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform1iv(@NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + nglUniform1iv(location, value.remaining(), memAddress(value)); + } + + // --- [ glUniform2iv ] --- + + /** + * Unsafe version of: {@link #glUniform2iv Uniform2iv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform2iv(int location, int count, long value); + + /** + * Specifies the value of a single ivec2 uniform variable or an ivec2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform2iv(@NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + nglUniform2iv(location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glUniform3iv ] --- + + /** + * Unsafe version of: {@link #glUniform3iv Uniform3iv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform3iv(int location, int count, long value); + + /** + * Specifies the value of a single ivec3 uniform variable or an ivec3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform3iv(@NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + nglUniform3iv(location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glUniform4iv ] --- + + /** + * Unsafe version of: {@link #glUniform4iv Uniform4iv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform4iv(int location, int count, long value); + + /** + * Specifies the value of a single ivec4 uniform variable or an ivec4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform4iv(@NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + nglUniform4iv(location, value.remaining() >> 2, memAddress(value)); + } + + // --- [ glUniformMatrix2fv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix2fv UniformMatrix2fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglUniformMatrix2fv(int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single mat2 uniform variable or a mat2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniformMatrix2fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglUniformMatrix2fv(location, value.remaining() >> 2, transpose, memAddress(value)); + } + + // --- [ glUniformMatrix3fv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix3fv UniformMatrix3fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglUniformMatrix3fv(int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single mat3 uniform variable or a mat3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniformMatrix3fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglUniformMatrix3fv(location, value.remaining() / 9, transpose, memAddress(value)); + } + + // --- [ glUniformMatrix4fv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix4fv UniformMatrix4fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglUniformMatrix4fv(int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single mat4 uniform variable or a mat4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniformMatrix4fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglUniformMatrix4fv(location, value.remaining() >> 4, transpose, memAddress(value)); + } + + // --- [ glGetShaderiv ] --- + + /** Unsafe version of: {@link #glGetShaderiv GetShaderiv} */ + public static native void nglGetShaderiv(int shader, int pname, long params); + + /** + * Returns a parameter from a shader object. + * + * @param shader the shader object to be queried + * @param pname the object parameter. One of:
{@link #GL_SHADER_TYPE SHADER_TYPE}{@link #GL_DELETE_STATUS DELETE_STATUS}{@link #GL_COMPILE_STATUS COMPILE_STATUS}{@link #GL_INFO_LOG_LENGTH INFO_LOG_LENGTH}{@link #GL_SHADER_SOURCE_LENGTH SHADER_SOURCE_LENGTH}
+ * @param params the requested object parameter + * + * @see Reference Page + */ + public static void glGetShaderiv(@NativeType("GLuint") int shader, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetShaderiv(shader, pname, memAddress(params)); + } + + /** + * Returns a parameter from a shader object. + * + * @param shader the shader object to be queried + * @param pname the object parameter. One of:
{@link #GL_SHADER_TYPE SHADER_TYPE}{@link #GL_DELETE_STATUS DELETE_STATUS}{@link #GL_COMPILE_STATUS COMPILE_STATUS}{@link #GL_INFO_LOG_LENGTH INFO_LOG_LENGTH}{@link #GL_SHADER_SOURCE_LENGTH SHADER_SOURCE_LENGTH}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetShaderi(@NativeType("GLuint") int shader, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetShaderiv(shader, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetProgramiv ] --- + + /** Unsafe version of: {@link #glGetProgramiv GetProgramiv} */ + public static native void nglGetProgramiv(int program, int pname, long params); + + /** + * Returns a parameter from a program object. + * + * @param program the program object to be queried + * @param pname the object parameter. One of:
{@link #GL_DELETE_STATUS DELETE_STATUS}{@link #GL_LINK_STATUS LINK_STATUS}{@link #GL_VALIDATE_STATUS VALIDATE_STATUS}
{@link #GL_INFO_LOG_LENGTH INFO_LOG_LENGTH}{@link #GL_ATTACHED_SHADERS ATTACHED_SHADERS}{@link #GL_ACTIVE_ATTRIBUTES ACTIVE_ATTRIBUTES}
{@link #GL_ACTIVE_ATTRIBUTE_MAX_LENGTH ACTIVE_ATTRIBUTE_MAX_LENGTH}{@link #GL_ACTIVE_UNIFORMS ACTIVE_UNIFORMS}{@link #GL_ACTIVE_UNIFORM_MAX_LENGTH ACTIVE_UNIFORM_MAX_LENGTH}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER_MODE TRANSFORM_FEEDBACK_BUFFER_MODE}{@link GL30#GL_TRANSFORM_FEEDBACK_VARYINGS TRANSFORM_FEEDBACK_VARYINGS}{@link GL30#GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH}
{@link GL31#GL_ACTIVE_UNIFORM_BLOCKS ACTIVE_UNIFORM_BLOCKS}{@link GL31#GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH}{@link GL32#GL_GEOMETRY_VERTICES_OUT GEOMETRY_VERTICES_OUT}
{@link GL32#GL_GEOMETRY_INPUT_TYPE GEOMETRY_INPUT_TYPE}{@link GL32#GL_GEOMETRY_OUTPUT_TYPE GEOMETRY_OUTPUT_TYPE}{@link GL41#GL_PROGRAM_BINARY_LENGTH PROGRAM_BINARY_LENGTH}
{@link GL42#GL_ACTIVE_ATOMIC_COUNTER_BUFFERS ACTIVE_ATOMIC_COUNTER_BUFFERS}{@link GL43#GL_COMPUTE_WORK_GROUP_SIZE COMPUTE_WORK_GROUP_SIZE}
+ * @param params the requested object parameter + * + * @see Reference Page + */ + public static void glGetProgramiv(@NativeType("GLuint") int program, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetProgramiv(program, pname, memAddress(params)); + } + + /** + * Returns a parameter from a program object. + * + * @param program the program object to be queried + * @param pname the object parameter. One of:
{@link #GL_DELETE_STATUS DELETE_STATUS}{@link #GL_LINK_STATUS LINK_STATUS}{@link #GL_VALIDATE_STATUS VALIDATE_STATUS}
{@link #GL_INFO_LOG_LENGTH INFO_LOG_LENGTH}{@link #GL_ATTACHED_SHADERS ATTACHED_SHADERS}{@link #GL_ACTIVE_ATTRIBUTES ACTIVE_ATTRIBUTES}
{@link #GL_ACTIVE_ATTRIBUTE_MAX_LENGTH ACTIVE_ATTRIBUTE_MAX_LENGTH}{@link #GL_ACTIVE_UNIFORMS ACTIVE_UNIFORMS}{@link #GL_ACTIVE_UNIFORM_MAX_LENGTH ACTIVE_UNIFORM_MAX_LENGTH}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER_MODE TRANSFORM_FEEDBACK_BUFFER_MODE}{@link GL30#GL_TRANSFORM_FEEDBACK_VARYINGS TRANSFORM_FEEDBACK_VARYINGS}{@link GL30#GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH}
{@link GL31#GL_ACTIVE_UNIFORM_BLOCKS ACTIVE_UNIFORM_BLOCKS}{@link GL31#GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH}{@link GL32#GL_GEOMETRY_VERTICES_OUT GEOMETRY_VERTICES_OUT}
{@link GL32#GL_GEOMETRY_INPUT_TYPE GEOMETRY_INPUT_TYPE}{@link GL32#GL_GEOMETRY_OUTPUT_TYPE GEOMETRY_OUTPUT_TYPE}{@link GL41#GL_PROGRAM_BINARY_LENGTH PROGRAM_BINARY_LENGTH}
{@link GL42#GL_ACTIVE_ATOMIC_COUNTER_BUFFERS ACTIVE_ATOMIC_COUNTER_BUFFERS}{@link GL43#GL_COMPUTE_WORK_GROUP_SIZE COMPUTE_WORK_GROUP_SIZE}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetProgrami(@NativeType("GLuint") int program, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetProgramiv(program, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetShaderInfoLog ] --- + + /** + * Unsafe version of: {@link #glGetShaderInfoLog GetShaderInfoLog} + * + * @param maxLength the size of the character buffer for storing the returned information log + */ + public static native void nglGetShaderInfoLog(int shader, int maxLength, long length, long infoLog); + + /** + * Returns the information log for a shader object. + * + * @param shader the shader object whose information log is to be queried + * @param length the length of the string returned in {@code infoLog} (excluding the null terminator) + * @param infoLog an array of characters that is used to return the information log + * + * @see Reference Page + */ + public static void glGetShaderInfoLog(@NativeType("GLuint") int shader, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer infoLog) { + if (CHECKS) { + checkSafe(length, 1); + } + nglGetShaderInfoLog(shader, infoLog.remaining(), memAddressSafe(length), memAddress(infoLog)); + } + + /** + * Returns the information log for a shader object. + * + * @param shader the shader object whose information log is to be queried + * @param maxLength the size of the character buffer for storing the returned information log + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetShaderInfoLog(@NativeType("GLuint") int shader, @NativeType("GLsizei") int maxLength) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + ByteBuffer infoLog = memAlloc(maxLength); + try { + IntBuffer length = stack.ints(0); + nglGetShaderInfoLog(shader, maxLength, memAddress(length), memAddress(infoLog)); + return memUTF8(infoLog, length.get(0)); + } finally { + memFree(infoLog); + stack.setPointer(stackPointer); + } + } + + /** + * Returns the information log for a shader object. + * + * @param shader the shader object whose information log is to be queried + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetShaderInfoLog(@NativeType("GLuint") int shader) { + return glGetShaderInfoLog(shader, glGetShaderi(shader, GL_INFO_LOG_LENGTH)); + } + + // --- [ glGetProgramInfoLog ] --- + + /** + * Unsafe version of: {@link #glGetProgramInfoLog GetProgramInfoLog} + * + * @param maxLength the size of the character buffer for storing the returned information log + */ + public static native void nglGetProgramInfoLog(int program, int maxLength, long length, long infoLog); + + /** + * Returns the information log for a program object. + * + * @param program the program object whose information log is to be queried + * @param length the length of the string returned in {@code infoLog} (excluding the null terminator) + * @param infoLog an array of characters that is used to return the information log + * + * @see Reference Page + */ + public static void glGetProgramInfoLog(@NativeType("GLuint") int program, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer infoLog) { + if (CHECKS) { + checkSafe(length, 1); + } + nglGetProgramInfoLog(program, infoLog.remaining(), memAddressSafe(length), memAddress(infoLog)); + } + + /** + * Returns the information log for a program object. + * + * @param program the program object whose information log is to be queried + * @param maxLength the size of the character buffer for storing the returned information log + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetProgramInfoLog(@NativeType("GLuint") int program, @NativeType("GLsizei") int maxLength) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + ByteBuffer infoLog = memAlloc(maxLength); + try { + IntBuffer length = stack.ints(0); + nglGetProgramInfoLog(program, maxLength, memAddress(length), memAddress(infoLog)); + return memUTF8(infoLog, length.get(0)); + } finally { + memFree(infoLog); + stack.setPointer(stackPointer); + } + } + + /** + * Returns the information log for a program object. + * + * @param program the program object whose information log is to be queried + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetProgramInfoLog(@NativeType("GLuint") int program) { + return glGetProgramInfoLog(program, glGetProgrami(program, GL_INFO_LOG_LENGTH)); + } + + // --- [ glGetAttachedShaders ] --- + + /** + * Unsafe version of: {@link #glGetAttachedShaders GetAttachedShaders} + * + * @param maxCount the size of the array for storing the returned object names + */ + public static native void nglGetAttachedShaders(int program, int maxCount, long count, long shaders); + + /** + * Returns the shader objects attached to a program object. + * + * @param program the program object to be queried + * @param count the number of names actually returned in {@code shaders} + * @param shaders an array that is used to return the names of attached shader objects + * + * @see Reference Page + */ + public static void glGetAttachedShaders(@NativeType("GLuint") int program, @Nullable @NativeType("GLsizei *") IntBuffer count, @NativeType("GLuint *") IntBuffer shaders) { + if (CHECKS) { + checkSafe(count, 1); + } + nglGetAttachedShaders(program, shaders.remaining(), memAddressSafe(count), memAddress(shaders)); + } + + // --- [ glGetUniformLocation ] --- + + /** Unsafe version of: {@link #glGetUniformLocation GetUniformLocation} */ + public static native int nglGetUniformLocation(int program, long name); + + /** + * Returns the location of a uniform variable. + * + * @param program the program object to be queried + * @param name a null terminated string containing the name of the uniform variable whose location is to be queried + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetUniformLocation(@NativeType("GLuint") int program, @NativeType("GLchar const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nglGetUniformLocation(program, memAddress(name)); + } + + /** + * Returns the location of a uniform variable. + * + * @param program the program object to be queried + * @param name a null terminated string containing the name of the uniform variable whose location is to be queried + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetUniformLocation(@NativeType("GLuint") int program, @NativeType("GLchar const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + return nglGetUniformLocation(program, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetActiveUniform ] --- + + /** + * Unsafe version of: {@link #glGetActiveUniform GetActiveUniform} + * + * @param maxLength the maximum number of characters OpenGL is allowed to write in the character buffer indicated by {@code name} + */ + public static native void nglGetActiveUniform(int program, int index, int maxLength, long length, long size, long type, long name); + + /** + * Returns information about an active uniform variable for the specified program object. + * + * @param program the program object to be queried + * @param index the index of the uniform variable to be queried + * @param length the number of characters actually written by OpenGL in the string indicated by {@code name} (excluding the null terminator) if a value other than NULL is passed + * @param size the size of the uniform variable + * @param type the data type of the uniform variable + * @param name a null terminated string containing the name of the uniform variable + * + * @see Reference Page + */ + public static void glGetActiveUniform(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLint *") IntBuffer size, @NativeType("GLenum *") IntBuffer type, @NativeType("GLchar *") ByteBuffer name) { + if (CHECKS) { + checkSafe(length, 1); + check(size, 1); + check(type, 1); + } + nglGetActiveUniform(program, index, name.remaining(), memAddressSafe(length), memAddress(size), memAddress(type), memAddress(name)); + } + + /** + * Returns information about an active uniform variable for the specified program object. + * + * @param program the program object to be queried + * @param index the index of the uniform variable to be queried + * @param maxLength the maximum number of characters OpenGL is allowed to write in the character buffer indicated by {@code name} + * @param size the size of the uniform variable + * @param type the data type of the uniform variable + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveUniform(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @NativeType("GLsizei") int maxLength, @NativeType("GLint *") IntBuffer size, @NativeType("GLenum *") IntBuffer type) { + if (CHECKS) { + check(size, 1); + check(type, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer length = stack.ints(0); + ByteBuffer name = stack.malloc(maxLength); + nglGetActiveUniform(program, index, maxLength, memAddress(length), memAddress(size), memAddress(type), memAddress(name)); + return memASCII(name, length.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Returns information about an active uniform variable for the specified program object. + * + * @param program the program object to be queried + * @param index the index of the uniform variable to be queried + * @param size the size of the uniform variable + * @param type the data type of the uniform variable + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveUniform(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @NativeType("GLint *") IntBuffer size, @NativeType("GLenum *") IntBuffer type) { + return glGetActiveUniform(program, index, glGetProgrami(program, GL_ACTIVE_UNIFORM_MAX_LENGTH), size, type); + } + + // --- [ glGetUniformfv ] --- + + /** Unsafe version of: {@link #glGetUniformfv GetUniformfv} */ + public static native void nglGetUniformfv(int program, int location, long params); + + /** + * Returns the float value(s) of a uniform variable. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * @param params the value of the specified uniform variable + * + * @see Reference Page + */ + public static void glGetUniformfv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetUniformfv(program, location, memAddress(params)); + } + + /** + * Returns the float value(s) of a uniform variable. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * + * @see Reference Page + */ + @NativeType("void") + public static float glGetUniformf(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer params = stack.callocFloat(1); + nglGetUniformfv(program, location, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetUniformiv ] --- + + /** Unsafe version of: {@link #glGetUniformiv GetUniformiv} */ + public static native void nglGetUniformiv(int program, int location, long params); + + /** + * Returns the int value(s) of a uniform variable. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * @param params the value of the specified uniform variable + * + * @see Reference Page + */ + public static void glGetUniformiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetUniformiv(program, location, memAddress(params)); + } + + /** + * Returns the int value(s) of a uniform variable. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetUniformi(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetUniformiv(program, location, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetShaderSource ] --- + + /** + * Unsafe version of: {@link #glGetShaderSource GetShaderSource} + * + * @param maxLength the size of the character buffer for storing the returned source code string + */ + public static native void nglGetShaderSource(int shader, int maxLength, long length, long source); + + /** + * Returns the source code string from a shader object. + * + * @param shader the shader object to be queried + * @param length the length of the string returned in source (excluding the null terminator) + * @param source an array of characters that is used to return the source code string + * + * @see Reference Page + */ + public static void glGetShaderSource(@NativeType("GLuint") int shader, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer source) { + if (CHECKS) { + checkSafe(length, 1); + } + nglGetShaderSource(shader, source.remaining(), memAddressSafe(length), memAddress(source)); + } + + /** + * Returns the source code string from a shader object. + * + * @param shader the shader object to be queried + * @param maxLength the size of the character buffer for storing the returned source code string + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetShaderSource(@NativeType("GLuint") int shader, @NativeType("GLsizei") int maxLength) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + ByteBuffer source = memAlloc(maxLength); + try { + IntBuffer length = stack.ints(0); + nglGetShaderSource(shader, maxLength, memAddress(length), memAddress(source)); + return memUTF8(source, length.get(0)); + } finally { + memFree(source); + stack.setPointer(stackPointer); + } + } + + /** + * Returns the source code string from a shader object. + * + * @param shader the shader object to be queried + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetShaderSource(@NativeType("GLuint") int shader) { + return glGetShaderSource(shader, glGetShaderi(shader, GL_SHADER_SOURCE_LENGTH)); + } + + // --- [ glVertexAttrib1f ] --- + + /** + * Specifies the value of a generic vertex attribute. The y and z components are implicitly set to 0.0f and w to 1.0f. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * + * @see Reference Page + */ + public static native void glVertexAttrib1f(@NativeType("GLuint") int index, @NativeType("GLfloat") float v0); + + // --- [ glVertexAttrib1s ] --- + + /** + * Short version of {@link #glVertexAttrib1f VertexAttrib1f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * + * @see Reference Page + */ + public static native void glVertexAttrib1s(@NativeType("GLuint") int index, @NativeType("GLshort") short v0); + + // --- [ glVertexAttrib1d ] --- + + /** + * Double version of {@link #glVertexAttrib1f VertexAttrib1f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * + * @see Reference Page + */ + public static native void glVertexAttrib1d(@NativeType("GLuint") int index, @NativeType("GLdouble") double v0); + + // --- [ glVertexAttrib2f ] --- + + /** + * Specifies the value of a generic vertex attribute. The y component is implicitly set to 0.0f and w to 1.0f. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * + * @see Reference Page + */ + public static native void glVertexAttrib2f(@NativeType("GLuint") int index, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1); + + // --- [ glVertexAttrib2s ] --- + + /** + * Short version of {@link #glVertexAttrib2f VertexAttrib2f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * + * @see Reference Page + */ + public static native void glVertexAttrib2s(@NativeType("GLuint") int index, @NativeType("GLshort") short v0, @NativeType("GLshort") short v1); + + // --- [ glVertexAttrib2d ] --- + + /** + * Double version of {@link #glVertexAttrib2f VertexAttrib2f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * + * @see Reference Page + */ + public static native void glVertexAttrib2d(@NativeType("GLuint") int index, @NativeType("GLdouble") double v0, @NativeType("GLdouble") double v1); + + // --- [ glVertexAttrib3f ] --- + + /** + * Specifies the value of a generic vertex attribute. The w is implicitly set to 1.0f. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + * + * @see Reference Page + */ + public static native void glVertexAttrib3f(@NativeType("GLuint") int index, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1, @NativeType("GLfloat") float v2); + + // --- [ glVertexAttrib3s ] --- + + /** + * Short version of {@link #glVertexAttrib3f VertexAttrib3f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + * + * @see Reference Page + */ + public static native void glVertexAttrib3s(@NativeType("GLuint") int index, @NativeType("GLshort") short v0, @NativeType("GLshort") short v1, @NativeType("GLshort") short v2); + + // --- [ glVertexAttrib3d ] --- + + /** + * Double version of {@link #glVertexAttrib3f VertexAttrib3f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + * + * @see Reference Page + */ + public static native void glVertexAttrib3d(@NativeType("GLuint") int index, @NativeType("GLdouble") double v0, @NativeType("GLdouble") double v1, @NativeType("GLdouble") double v2); + + // --- [ glVertexAttrib4f ] --- + + /** + * Specifies the value of a generic vertex attribute. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + * @param v3 the vertex attribute w component + * + * @see Reference Page + */ + public static native void glVertexAttrib4f(@NativeType("GLuint") int index, @NativeType("GLfloat") float v0, @NativeType("GLfloat") float v1, @NativeType("GLfloat") float v2, @NativeType("GLfloat") float v3); + + // --- [ glVertexAttrib4s ] --- + + /** + * Short version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + * @param v3 the vertex attribute w component + * + * @see Reference Page + */ + public static native void glVertexAttrib4s(@NativeType("GLuint") int index, @NativeType("GLshort") short v0, @NativeType("GLshort") short v1, @NativeType("GLshort") short v2, @NativeType("GLshort") short v3); + + // --- [ glVertexAttrib4d ] --- + + /** + * Double version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v0 the vertex attribute x component + * @param v1 the vertex attribute y component + * @param v2 the vertex attribute z component + * @param v3 the vertex attribute w component + * + * @see Reference Page + */ + public static native void glVertexAttrib4d(@NativeType("GLuint") int index, @NativeType("GLdouble") double v0, @NativeType("GLdouble") double v1, @NativeType("GLdouble") double v2, @NativeType("GLdouble") double v3); + + // --- [ glVertexAttrib4Nub ] --- + + /** + * Normalized unsigned byte version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * @param z the vertex attribute z component + * @param w the vertex attribute w component + * + * @see Reference Page + */ + public static native void glVertexAttrib4Nub(@NativeType("GLuint") int index, @NativeType("GLubyte") byte x, @NativeType("GLubyte") byte y, @NativeType("GLubyte") byte z, @NativeType("GLubyte") byte w); + + // --- [ glVertexAttrib1fv ] --- + + /** Unsafe version of: {@link #glVertexAttrib1fv VertexAttrib1fv} */ + public static native void nglVertexAttrib1fv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib1f VertexAttrib1f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib1fv(@NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglVertexAttrib1fv(index, memAddress(v)); + } + + // --- [ glVertexAttrib1sv ] --- + + /** Unsafe version of: {@link #glVertexAttrib1sv VertexAttrib1sv} */ + public static native void nglVertexAttrib1sv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib1s VertexAttrib1s}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib1sv(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglVertexAttrib1sv(index, memAddress(v)); + } + + // --- [ glVertexAttrib1dv ] --- + + /** Unsafe version of: {@link #glVertexAttrib1dv VertexAttrib1dv} */ + public static native void nglVertexAttrib1dv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib1d VertexAttrib1d}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib1dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglVertexAttrib1dv(index, memAddress(v)); + } + + // --- [ glVertexAttrib2fv ] --- + + /** Unsafe version of: {@link #glVertexAttrib2fv VertexAttrib2fv} */ + public static native void nglVertexAttrib2fv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib2f VertexAttrib2f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib2fv(@NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglVertexAttrib2fv(index, memAddress(v)); + } + + // --- [ glVertexAttrib2sv ] --- + + /** Unsafe version of: {@link #glVertexAttrib2sv VertexAttrib2sv} */ + public static native void nglVertexAttrib2sv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib2s VertexAttrib2s}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib2sv(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglVertexAttrib2sv(index, memAddress(v)); + } + + // --- [ glVertexAttrib2dv ] --- + + /** Unsafe version of: {@link #glVertexAttrib2dv VertexAttrib2dv} */ + public static native void nglVertexAttrib2dv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib2d VertexAttrib2d}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib2dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglVertexAttrib2dv(index, memAddress(v)); + } + + // --- [ glVertexAttrib3fv ] --- + + /** Unsafe version of: {@link #glVertexAttrib3fv VertexAttrib3fv} */ + public static native void nglVertexAttrib3fv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib3f VertexAttrib3f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib3fv(@NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglVertexAttrib3fv(index, memAddress(v)); + } + + // --- [ glVertexAttrib3sv ] --- + + /** Unsafe version of: {@link #glVertexAttrib3sv VertexAttrib3sv} */ + public static native void nglVertexAttrib3sv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib3s VertexAttrib3s}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib3sv(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglVertexAttrib3sv(index, memAddress(v)); + } + + // --- [ glVertexAttrib3dv ] --- + + /** Unsafe version of: {@link #glVertexAttrib3dv VertexAttrib3dv} */ + public static native void nglVertexAttrib3dv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib3d VertexAttrib3d}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib3dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglVertexAttrib3dv(index, memAddress(v)); + } + + // --- [ glVertexAttrib4fv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4fv VertexAttrib4fv} */ + public static native void nglVertexAttrib4fv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4fv(@NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4fv(index, memAddress(v)); + } + + // --- [ glVertexAttrib4sv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4sv VertexAttrib4sv} */ + public static native void nglVertexAttrib4sv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib4s VertexAttrib4s}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4sv(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4sv(index, memAddress(v)); + } + + // --- [ glVertexAttrib4dv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4dv VertexAttrib4dv} */ + public static native void nglVertexAttrib4dv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib4d VertexAttrib4d}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4dv(index, memAddress(v)); + } + + // --- [ glVertexAttrib4iv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4iv VertexAttrib4iv} */ + public static native void nglVertexAttrib4iv(int index, long v); + + /** + * Integer pointer version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4iv(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4iv(index, memAddress(v)); + } + + // --- [ glVertexAttrib4bv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4bv VertexAttrib4bv} */ + public static native void nglVertexAttrib4bv(int index, long v); + + /** + * Byte pointer version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4bv(@NativeType("GLuint") int index, @NativeType("GLbyte const *") ByteBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4bv(index, memAddress(v)); + } + + // --- [ glVertexAttrib4ubv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4ubv VertexAttrib4ubv} */ + public static native void nglVertexAttrib4ubv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttrib4Nub VertexAttrib4Nub}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4ubv(@NativeType("GLuint") int index, @NativeType("GLubyte const *") ByteBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4ubv(index, memAddress(v)); + } + + // --- [ glVertexAttrib4usv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4usv VertexAttrib4usv} */ + public static native void nglVertexAttrib4usv(int index, long v); + + /** + * Unsigned short pointer version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4usv(@NativeType("GLuint") int index, @NativeType("GLushort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4usv(index, memAddress(v)); + } + + // --- [ glVertexAttrib4uiv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4uiv VertexAttrib4uiv} */ + public static native void nglVertexAttrib4uiv(int index, long v); + + /** + * Unsigned int pointer version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4uiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") IntBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4uiv(index, memAddress(v)); + } + + // --- [ glVertexAttrib4Nbv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4Nbv VertexAttrib4Nbv} */ + public static native void nglVertexAttrib4Nbv(int index, long v); + + /** + * Normalized byte pointer version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4Nbv(@NativeType("GLuint") int index, @NativeType("GLbyte const *") ByteBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4Nbv(index, memAddress(v)); + } + + // --- [ glVertexAttrib4Nsv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4Nsv VertexAttrib4Nsv} */ + public static native void nglVertexAttrib4Nsv(int index, long v); + + /** + * Normalized short pointer version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4Nsv(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4Nsv(index, memAddress(v)); + } + + // --- [ glVertexAttrib4Niv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4Niv VertexAttrib4Niv} */ + public static native void nglVertexAttrib4Niv(int index, long v); + + /** + * Normalized int pointer version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4Niv(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4Niv(index, memAddress(v)); + } + + // --- [ glVertexAttrib4Nubv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4Nubv VertexAttrib4Nubv} */ + public static native void nglVertexAttrib4Nubv(int index, long v); + + /** + * Normalized unsigned byte pointer version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4Nubv(@NativeType("GLuint") int index, @NativeType("GLubyte const *") ByteBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4Nubv(index, memAddress(v)); + } + + // --- [ glVertexAttrib4Nusv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4Nusv VertexAttrib4Nusv} */ + public static native void nglVertexAttrib4Nusv(int index, long v); + + /** + * Normalized unsigned short pointer version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4Nusv(@NativeType("GLuint") int index, @NativeType("GLushort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4Nusv(index, memAddress(v)); + } + + // --- [ glVertexAttrib4Nuiv ] --- + + /** Unsafe version of: {@link #glVertexAttrib4Nuiv VertexAttrib4Nuiv} */ + public static native void nglVertexAttrib4Nuiv(int index, long v); + + /** + * Normalized unsigned int pointer version of {@link #glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttrib4Nuiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") IntBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4Nuiv(index, memAddress(v)); + } + + // --- [ glVertexAttribPointer ] --- + + /** Unsafe version of: {@link #glVertexAttribPointer VertexAttribPointer} */ + public static native void nglVertexAttribPointer(int index, int size, int type, boolean normalized, int stride, long pointer); + + /** + * Specifies the location and organization of a vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. The initial value is GL_FLOAT. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL41#GL_FIXED FIXED}
+ * @param normalized whether fixed-point data values should be normalized or converted directly as fixed-point values when they are accessed + * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + nglVertexAttribPointer(index, size, type, normalized, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. The initial value is GL_FLOAT. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL41#GL_FIXED FIXED}
+ * @param normalized whether fixed-point data values should be normalized or converted directly as fixed-point values when they are accessed + * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + nglVertexAttribPointer(index, size, type, normalized, stride, pointer); + } + + /** + * Specifies the location and organization of a vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. The initial value is GL_FLOAT. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL41#GL_FIXED FIXED}
+ * @param normalized whether fixed-point data values should be normalized or converted directly as fixed-point values when they are accessed + * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") ShortBuffer pointer) { + nglVertexAttribPointer(index, size, type, normalized, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. The initial value is GL_FLOAT. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL41#GL_FIXED FIXED}
+ * @param normalized whether fixed-point data values should be normalized or converted directly as fixed-point values when they are accessed + * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") IntBuffer pointer) { + nglVertexAttribPointer(index, size, type, normalized, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. The initial value is GL_FLOAT. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL11#GL_DOUBLE DOUBLE}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}{@link GL33#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL41#GL_FIXED FIXED}
+ * @param normalized whether fixed-point data values should be normalized or converted directly as fixed-point values when they are accessed + * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride, @NativeType("void const *") FloatBuffer pointer) { + nglVertexAttribPointer(index, size, type, normalized, stride, memAddress(pointer)); + } + + // --- [ glEnableVertexAttribArray ] --- + + /** + * Enables a generic vertex attribute array. + * + * @param index the index of the generic vertex attribute to be enabled + * + * @see Reference Page + */ + public static native void glEnableVertexAttribArray(@NativeType("GLuint") int index); + + // --- [ glDisableVertexAttribArray ] --- + + /** + * Disables a generic vertex attribute array. + * + * @param index the index of the generic vertex attribute to be disabled + * + * @see Reference Page + */ + public static native void glDisableVertexAttribArray(@NativeType("GLuint") int index); + + // --- [ glBindAttribLocation ] --- + + /** Unsafe version of: {@link #glBindAttribLocation BindAttribLocation} */ + public static native void nglBindAttribLocation(int program, int index, long name); + + /** + * Associates a generic vertex attribute index with a named attribute variable. + * + * @param program the program object in which the association is to be made + * @param index the index of the generic vertex attribute to be bound + * @param name a null terminated string containing the name of the vertex shader attribute variable to which {@code index} is to be bound + * + * @see Reference Page + */ + public static void glBindAttribLocation(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @NativeType("GLchar const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + nglBindAttribLocation(program, index, memAddress(name)); + } + + /** + * Associates a generic vertex attribute index with a named attribute variable. + * + * @param program the program object in which the association is to be made + * @param index the index of the generic vertex attribute to be bound + * @param name a null terminated string containing the name of the vertex shader attribute variable to which {@code index} is to be bound + * + * @see Reference Page + */ + public static void glBindAttribLocation(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @NativeType("GLchar const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + nglBindAttribLocation(program, index, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetActiveAttrib ] --- + + /** + * Unsafe version of: {@link #glGetActiveAttrib GetActiveAttrib} + * + * @param maxLength the maximum number of characters OpenGL is allowed to write in the character buffer indicated by {@code name} + */ + public static native void nglGetActiveAttrib(int program, int index, int maxLength, long length, long size, long type, long name); + + /** + * Returns information about an active attribute variable for the specified program object. + * + * @param program the program object to be queried + * @param index the index of the attribute variable to be queried + * @param length the number of characters actually written by OpenGL in the string indicated by {@code name} (excluding the null terminator) if a value other than + * {@code NULL} is passed + * @param size the size of the attribute variable + * @param type the data type of the attribute variable + * @param name a null terminated string containing the name of the attribute variable + * + * @see Reference Page + */ + public static void glGetActiveAttrib(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLint *") IntBuffer size, @NativeType("GLenum *") IntBuffer type, @NativeType("GLchar *") ByteBuffer name) { + if (CHECKS) { + checkSafe(length, 1); + check(size, 1); + check(type, 1); + } + nglGetActiveAttrib(program, index, name.remaining(), memAddressSafe(length), memAddress(size), memAddress(type), memAddress(name)); + } + + /** + * Returns information about an active attribute variable for the specified program object. + * + * @param program the program object to be queried + * @param index the index of the attribute variable to be queried + * @param maxLength the maximum number of characters OpenGL is allowed to write in the character buffer indicated by {@code name} + * @param size the size of the attribute variable + * @param type the data type of the attribute variable + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveAttrib(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @NativeType("GLsizei") int maxLength, @NativeType("GLint *") IntBuffer size, @NativeType("GLenum *") IntBuffer type) { + if (CHECKS) { + check(size, 1); + check(type, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer length = stack.ints(0); + ByteBuffer name = stack.malloc(maxLength); + nglGetActiveAttrib(program, index, maxLength, memAddress(length), memAddress(size), memAddress(type), memAddress(name)); + return memASCII(name, length.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Returns information about an active attribute variable for the specified program object. + * + * @param program the program object to be queried + * @param index the index of the attribute variable to be queried + * @param size the size of the attribute variable + * @param type the data type of the attribute variable + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveAttrib(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @NativeType("GLint *") IntBuffer size, @NativeType("GLenum *") IntBuffer type) { + return glGetActiveAttrib(program, index, glGetProgrami(program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH), size, type); + } + + // --- [ glGetAttribLocation ] --- + + /** Unsafe version of: {@link #glGetAttribLocation GetAttribLocation} */ + public static native int nglGetAttribLocation(int program, long name); + + /** + * Returns the location of an attribute variable. + * + * @param program the program object to be queried + * @param name a null terminated string containing the name of the attribute variable whose location is to be queried + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetAttribLocation(@NativeType("GLuint") int program, @NativeType("GLchar const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nglGetAttribLocation(program, memAddress(name)); + } + + /** + * Returns the location of an attribute variable. + * + * @param program the program object to be queried + * @param name a null terminated string containing the name of the attribute variable whose location is to be queried + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetAttribLocation(@NativeType("GLuint") int program, @NativeType("GLchar const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + return nglGetAttribLocation(program, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetVertexAttribiv ] --- + + /** Unsafe version of: {@link #glGetVertexAttribiv GetVertexAttribiv} */ + public static native void nglGetVertexAttribiv(int index, int pname, long params); + + /** + * Returns the integer value of a generic vertex attribute parameter. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the vertex attribute parameter to be queried. One of:
{@link GL15#GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING VERTEX_ATTRIB_ARRAY_BUFFER_BINDING}{@link #GL_VERTEX_ATTRIB_ARRAY_ENABLED VERTEX_ATTRIB_ARRAY_ENABLED}
{@link #GL_VERTEX_ATTRIB_ARRAY_SIZE VERTEX_ATTRIB_ARRAY_SIZE}{@link #GL_VERTEX_ATTRIB_ARRAY_STRIDE VERTEX_ATTRIB_ARRAY_STRIDE}
{@link #GL_VERTEX_ATTRIB_ARRAY_TYPE VERTEX_ATTRIB_ARRAY_TYPE}{@link #GL_VERTEX_ATTRIB_ARRAY_NORMALIZED VERTEX_ATTRIB_ARRAY_NORMALIZED}
{@link #GL_CURRENT_VERTEX_ATTRIB CURRENT_VERTEX_ATTRIB}{@link GL30#GL_VERTEX_ATTRIB_ARRAY_INTEGER VERTEX_ATTRIB_ARRAY_INTEGER}
{@link GL33#GL_VERTEX_ATTRIB_ARRAY_DIVISOR VERTEX_ATTRIB_ARRAY_DIVISOR}
+ * @param params returns the requested data + * + * @see Reference Page + */ + public static void glGetVertexAttribiv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetVertexAttribiv(index, pname, memAddress(params)); + } + + /** + * Returns the integer value of a generic vertex attribute parameter. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the vertex attribute parameter to be queried. One of:
{@link GL15#GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING VERTEX_ATTRIB_ARRAY_BUFFER_BINDING}{@link #GL_VERTEX_ATTRIB_ARRAY_ENABLED VERTEX_ATTRIB_ARRAY_ENABLED}
{@link #GL_VERTEX_ATTRIB_ARRAY_SIZE VERTEX_ATTRIB_ARRAY_SIZE}{@link #GL_VERTEX_ATTRIB_ARRAY_STRIDE VERTEX_ATTRIB_ARRAY_STRIDE}
{@link #GL_VERTEX_ATTRIB_ARRAY_TYPE VERTEX_ATTRIB_ARRAY_TYPE}{@link #GL_VERTEX_ATTRIB_ARRAY_NORMALIZED VERTEX_ATTRIB_ARRAY_NORMALIZED}
{@link #GL_CURRENT_VERTEX_ATTRIB CURRENT_VERTEX_ATTRIB}{@link GL30#GL_VERTEX_ATTRIB_ARRAY_INTEGER VERTEX_ATTRIB_ARRAY_INTEGER}
{@link GL33#GL_VERTEX_ATTRIB_ARRAY_DIVISOR VERTEX_ATTRIB_ARRAY_DIVISOR}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetVertexAttribi(@NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetVertexAttribiv(index, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetVertexAttribfv ] --- + + /** Unsafe version of: {@link #glGetVertexAttribfv GetVertexAttribfv} */ + public static native void nglGetVertexAttribfv(int index, int pname, long params); + + /** + * Float version of {@link #glGetVertexAttribiv GetVertexAttribiv}. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the vertex attribute parameter to be queried + * @param params returns the requested data + * + * @see Reference Page + */ + public static void glGetVertexAttribfv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglGetVertexAttribfv(index, pname, memAddress(params)); + } + + // --- [ glGetVertexAttribdv ] --- + + /** Unsafe version of: {@link #glGetVertexAttribdv GetVertexAttribdv} */ + public static native void nglGetVertexAttribdv(int index, int pname, long params); + + /** + * Double version of {@link #glGetVertexAttribiv GetVertexAttribiv}. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the vertex attribute parameter to be queried + * @param params returns the requested data + * + * @see Reference Page + */ + public static void glGetVertexAttribdv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLdouble *") DoubleBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglGetVertexAttribdv(index, pname, memAddress(params)); + } + + // --- [ glGetVertexAttribPointerv ] --- + + /** Unsafe version of: {@link #glGetVertexAttribPointerv GetVertexAttribPointerv} */ + public static native void nglGetVertexAttribPointerv(int index, int pname, long pointer); + + /** + * Returns the address of the specified generic vertex attribute pointer. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the generic vertex attribute parameter to be returned. Must be:
{@link #GL_VERTEX_ATTRIB_ARRAY_POINTER VERTEX_ATTRIB_ARRAY_POINTER}
+ * @param pointer the pointer value + * + * @see Reference Page + */ + public static void glGetVertexAttribPointerv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("void **") PointerBuffer pointer) { + if (CHECKS) { + check(pointer, 1); + } + nglGetVertexAttribPointerv(index, pname, memAddress(pointer)); + } + + /** + * Returns the address of the specified generic vertex attribute pointer. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the generic vertex attribute parameter to be returned. Must be:
{@link #GL_VERTEX_ATTRIB_ARRAY_POINTER VERTEX_ATTRIB_ARRAY_POINTER}
+ * + * @see Reference Page + */ + @NativeType("void") + public static long glGetVertexAttribPointer(@NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + PointerBuffer pointer = stack.callocPointer(1); + nglGetVertexAttribPointerv(index, pname, memAddress(pointer)); + return pointer.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glDrawBuffers ] --- + + /** + * Unsafe version of: {@link #glDrawBuffers DrawBuffers} + * + * @param n the number of buffers in {@code bufs} + */ + public static native void nglDrawBuffers(int n, long bufs); + + /** + * Specifies a list of color buffers to be drawn into. + * + * @param bufs an array of symbolic constants specifying the buffers into which fragment colors or data values will be written. One of:
{@link GL11#GL_NONE NONE}{@link GL11#GL_FRONT_LEFT FRONT_LEFT}{@link GL11#GL_FRONT_RIGHT FRONT_RIGHT}{@link GL11#GL_BACK_LEFT BACK_LEFT}{@link GL11#GL_BACK_RIGHT BACK_RIGHT}{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}
GL30.GL_COLOR_ATTACHMENT[1-15]
+ * + * @see Reference Page + */ + public static void glDrawBuffers(@NativeType("GLenum const *") IntBuffer bufs) { + nglDrawBuffers(bufs.remaining(), memAddress(bufs)); + } + + /** + * Specifies a list of color buffers to be drawn into. + * + * @see Reference Page + */ + public static void glDrawBuffers(@NativeType("GLenum const *") int buf) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer bufs = stack.ints(buf); + nglDrawBuffers(1, memAddress(bufs)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glBlendEquationSeparate ] --- + + /** + * Sets the RGB blend equation and the alpha blend equation separately. + * + * @param modeRGB the RGB blend equation, how the red, green, and blue components of the source and destination colors are combined. One of:
{@link GL14#GL_FUNC_ADD FUNC_ADD}{@link GL14#GL_FUNC_SUBTRACT FUNC_SUBTRACT}{@link GL14#GL_FUNC_REVERSE_SUBTRACT FUNC_REVERSE_SUBTRACT}{@link GL14#GL_MIN MIN}{@link GL14#GL_MAX MAX}
+ * @param modeAlpha the alpha blend equation, how the alpha component of the source and destination colors are combined + * + * @see Reference Page + */ + public static native void glBlendEquationSeparate(@NativeType("GLenum") int modeRGB, @NativeType("GLenum") int modeAlpha); + + // --- [ glStencilOpSeparate ] --- + + /** + * Sets front and/or back stencil test actions. + * + * @param face whether front and/or back stencil state is updated. One of:
{@link GL11#GL_FRONT FRONT}{@link GL11#GL_BACK BACK}{@link GL11#GL_FRONT_AND_BACK FRONT_AND_BACK}
+ * @param sfail the action to take when the stencil test fails. The initial value is GL_KEEP. One of:
{@link GL11#GL_KEEP KEEP}{@link GL11#GL_ZERO ZERO}{@link GL11#GL_REPLACE REPLACE}{@link GL11#GL_INCR INCR}{@link GL14#GL_INCR_WRAP INCR_WRAP}{@link GL11#GL_DECR DECR}{@link GL14#GL_DECR_WRAP DECR_WRAP}{@link GL11#GL_INVERT INVERT}
+ * @param dpfail the stencil action when the stencil test passes, but the depth test fails. The initial value is GL_KEEP + * @param dppass the stencil action when both the stencil test and the depth test pass, or when the stencil test passes and either there is no depth buffer or depth + * testing is not enabled. The initial value is GL_KEEP + * + * @see Reference Page + */ + public static native void glStencilOpSeparate(@NativeType("GLenum") int face, @NativeType("GLenum") int sfail, @NativeType("GLenum") int dpfail, @NativeType("GLenum") int dppass); + + // --- [ glStencilFuncSeparate ] --- + + /** + * Sets front and/or back function and reference value for stencil testing. + * + * @param face whether front and/or back stencil state is updated. One of:
{@link GL11#GL_FRONT FRONT}{@link GL11#GL_BACK BACK}{@link GL11#GL_FRONT_AND_BACK FRONT_AND_BACK}
+ * @param func the test function. The initial value is GL_ALWAYS. One of:
{@link GL11#GL_NEVER NEVER}{@link GL11#GL_LESS LESS}{@link GL11#GL_LEQUAL LEQUAL}{@link GL11#GL_GREATER GREATER}{@link GL11#GL_GEQUAL GEQUAL}{@link GL11#GL_EQUAL EQUAL}{@link GL11#GL_NOTEQUAL NOTEQUAL}{@link GL11#GL_ALWAYS ALWAYS}
+ * @param ref the reference value for the stencil test. {@code ref} is clamped to the range [0, 2n – 1], where {@code n} is the number of bitplanes in the stencil + * buffer. The initial value is 0. + * @param mask a mask that is ANDed with both the reference value and the stored stencil value when the test is done. The initial value is all 1's. + * + * @see Reference Page + */ + public static native void glStencilFuncSeparate(@NativeType("GLenum") int face, @NativeType("GLenum") int func, @NativeType("GLint") int ref, @NativeType("GLuint") int mask); + + // --- [ glStencilMaskSeparate ] --- + + /** + * Controls the front and/or back writing of individual bits in the stencil planes. + * + * @param face whether front and/or back stencil writemask is updated. One of:
{@link GL11#GL_FRONT FRONT}{@link GL11#GL_BACK BACK}{@link GL11#GL_FRONT_AND_BACK FRONT_AND_BACK}
+ * @param mask a bit mask to enable and disable writing of individual bits in the stencil planes. Initially, the mask is all 1's. + * + * @see Reference Page + */ + public static native void glStencilMaskSeparate(@NativeType("GLenum") int face, @NativeType("GLuint") int mask); + + /** + * Array version of: {@link #glShaderSource ShaderSource} + * + * @see Reference Page + */ + public static void glShaderSource(@NativeType("GLuint") int shader, @NativeType("GLchar const **") PointerBuffer strings, @Nullable @NativeType("GLint const *") int[] length) { + long __functionAddress = GL.getICD().glShaderSource; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, strings.remaining()); + } + callPPV(shader, strings.remaining(), memAddress(strings), length, __functionAddress); + } + + /** + * Array version of: {@link #glUniform1fv Uniform1fv} + * + * @see Reference Page + */ + public static void glUniform1fv(@NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glUniform1fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniform2fv Uniform2fv} + * + * @see Reference Page + */ + public static void glUniform2fv(@NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glUniform2fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 1, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniform3fv Uniform3fv} + * + * @see Reference Page + */ + public static void glUniform3fv(@NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glUniform3fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length / 3, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniform4fv Uniform4fv} + * + * @see Reference Page + */ + public static void glUniform4fv(@NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glUniform4fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 2, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniform1iv Uniform1iv} + * + * @see Reference Page + */ + public static void glUniform1iv(@NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + long __functionAddress = GL.getICD().glUniform1iv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniform2iv Uniform2iv} + * + * @see Reference Page + */ + public static void glUniform2iv(@NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + long __functionAddress = GL.getICD().glUniform2iv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 1, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniform3iv Uniform3iv} + * + * @see Reference Page + */ + public static void glUniform3iv(@NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + long __functionAddress = GL.getICD().glUniform3iv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length / 3, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniform4iv Uniform4iv} + * + * @see Reference Page + */ + public static void glUniform4iv(@NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + long __functionAddress = GL.getICD().glUniform4iv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 2, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniformMatrix2fv UniformMatrix2fv} + * + * @see Reference Page + */ + public static void glUniformMatrix2fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glUniformMatrix2fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 2, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniformMatrix3fv UniformMatrix3fv} + * + * @see Reference Page + */ + public static void glUniformMatrix3fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glUniformMatrix3fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length / 9, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniformMatrix4fv UniformMatrix4fv} + * + * @see Reference Page + */ + public static void glUniformMatrix4fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glUniformMatrix4fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 4, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glGetShaderiv GetShaderiv} + * + * @see Reference Page + */ + public static void glGetShaderiv(@NativeType("GLuint") int shader, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetShaderiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(shader, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetProgramiv GetProgramiv} + * + * @see Reference Page + */ + public static void glGetProgramiv(@NativeType("GLuint") int program, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetProgramiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(program, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetShaderInfoLog GetShaderInfoLog} + * + * @see Reference Page + */ + public static void glGetShaderInfoLog(@NativeType("GLuint") int shader, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer infoLog) { + long __functionAddress = GL.getICD().glGetShaderInfoLog; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + } + callPPV(shader, infoLog.remaining(), length, memAddress(infoLog), __functionAddress); + } + + /** + * Array version of: {@link #glGetProgramInfoLog GetProgramInfoLog} + * + * @see Reference Page + */ + public static void glGetProgramInfoLog(@NativeType("GLuint") int program, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer infoLog) { + long __functionAddress = GL.getICD().glGetProgramInfoLog; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + } + callPPV(program, infoLog.remaining(), length, memAddress(infoLog), __functionAddress); + } + + /** + * Array version of: {@link #glGetAttachedShaders GetAttachedShaders} + * + * @see Reference Page + */ + public static void glGetAttachedShaders(@NativeType("GLuint") int program, @Nullable @NativeType("GLsizei *") int[] count, @NativeType("GLuint *") int[] shaders) { + long __functionAddress = GL.getICD().glGetAttachedShaders; + if (CHECKS) { + check(__functionAddress); + checkSafe(count, 1); + } + callPPV(program, shaders.length, count, shaders, __functionAddress); + } + + /** + * Array version of: {@link #glGetActiveUniform GetActiveUniform} + * + * @see Reference Page + */ + public static void glGetActiveUniform(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLint *") int[] size, @NativeType("GLenum *") int[] type, @NativeType("GLchar *") ByteBuffer name) { + long __functionAddress = GL.getICD().glGetActiveUniform; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + check(size, 1); + check(type, 1); + } + callPPPPV(program, index, name.remaining(), length, size, type, memAddress(name), __functionAddress); + } + + /** + * Array version of: {@link #glGetUniformfv GetUniformfv} + * + * @see Reference Page + */ + public static void glGetUniformfv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetUniformfv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(program, location, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetUniformiv GetUniformiv} + * + * @see Reference Page + */ + public static void glGetUniformiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetUniformiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(program, location, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetShaderSource GetShaderSource} + * + * @see Reference Page + */ + public static void glGetShaderSource(@NativeType("GLuint") int shader, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer source) { + long __functionAddress = GL.getICD().glGetShaderSource; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + } + callPPV(shader, source.remaining(), length, memAddress(source), __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttrib1fv VertexAttrib1fv} + * + * @see Reference Page + */ + public static void glVertexAttrib1fv(@NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glVertexAttrib1fv; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttrib1sv VertexAttrib1sv} + * + * @see Reference Page + */ + public static void glVertexAttrib1sv(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttrib1sv; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttrib1dv VertexAttrib1dv} + * + * @see Reference Page + */ + public static void glVertexAttrib1dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glVertexAttrib1dv; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttrib2fv VertexAttrib2fv} + * + * @see Reference Page + */ + public static void glVertexAttrib2fv(@NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glVertexAttrib2fv; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttrib2sv VertexAttrib2sv} + * + * @see Reference Page + */ + public static void glVertexAttrib2sv(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttrib2sv; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttrib2dv VertexAttrib2dv} + * + * @see Reference Page + */ + public static void glVertexAttrib2dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glVertexAttrib2dv; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttrib3fv VertexAttrib3fv} + * + * @see Reference Page + */ + public static void glVertexAttrib3fv(@NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glVertexAttrib3fv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttrib3sv VertexAttrib3sv} + * + * @see Reference Page + */ + public static void glVertexAttrib3sv(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttrib3sv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttrib3dv VertexAttrib3dv} + * + * @see Reference Page + */ + public static void glVertexAttrib3dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glVertexAttrib3dv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttrib4fv VertexAttrib4fv} + * + * @see Reference Page + */ + public static void glVertexAttrib4fv(@NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glVertexAttrib4fv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttrib4sv VertexAttrib4sv} + * + * @see Reference Page + */ + public static void glVertexAttrib4sv(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttrib4sv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttrib4dv VertexAttrib4dv} + * + * @see Reference Page + */ + public static void glVertexAttrib4dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glVertexAttrib4dv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttrib4iv VertexAttrib4iv} + * + * @see Reference Page + */ + public static void glVertexAttrib4iv(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttrib4iv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttrib4usv VertexAttrib4usv} + * + * @see Reference Page + */ + public static void glVertexAttrib4usv(@NativeType("GLuint") int index, @NativeType("GLushort const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttrib4usv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttrib4uiv VertexAttrib4uiv} + * + * @see Reference Page + */ + public static void glVertexAttrib4uiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttrib4uiv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttrib4Nsv VertexAttrib4Nsv} + * + * @see Reference Page + */ + public static void glVertexAttrib4Nsv(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttrib4Nsv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttrib4Niv VertexAttrib4Niv} + * + * @see Reference Page + */ + public static void glVertexAttrib4Niv(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttrib4Niv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttrib4Nusv VertexAttrib4Nusv} + * + * @see Reference Page + */ + public static void glVertexAttrib4Nusv(@NativeType("GLuint") int index, @NativeType("GLushort const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttrib4Nusv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttrib4Nuiv VertexAttrib4Nuiv} + * + * @see Reference Page + */ + public static void glVertexAttrib4Nuiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttrib4Nuiv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glGetActiveAttrib GetActiveAttrib} + * + * @see Reference Page + */ + public static void glGetActiveAttrib(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLint *") int[] size, @NativeType("GLenum *") int[] type, @NativeType("GLchar *") ByteBuffer name) { + long __functionAddress = GL.getICD().glGetActiveAttrib; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + check(size, 1); + check(type, 1); + } + callPPPPV(program, index, name.remaining(), length, size, type, memAddress(name), __functionAddress); + } + + /** + * Array version of: {@link #glGetVertexAttribiv GetVertexAttribiv} + * + * @see Reference Page + */ + public static void glGetVertexAttribiv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetVertexAttribiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(index, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetVertexAttribfv GetVertexAttribfv} + * + * @see Reference Page + */ + public static void glGetVertexAttribfv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetVertexAttribfv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(index, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetVertexAttribdv GetVertexAttribdv} + * + * @see Reference Page + */ + public static void glGetVertexAttribdv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLdouble *") double[] params) { + long __functionAddress = GL.getICD().glGetVertexAttribdv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(index, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glDrawBuffers DrawBuffers} + * + * @see Reference Page + */ + public static void glDrawBuffers(@NativeType("GLenum const *") int[] bufs) { + long __functionAddress = GL.getICD().glDrawBuffers; + if (CHECKS) { + check(__functionAddress); + } + callPV(bufs.length, bufs, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL21.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL21.java new file mode 100644 index 00000000..e1a7276f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL21.java @@ -0,0 +1,279 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * The OpenGL functionality up to version 2.1. Includes the deprecated symbols of the Compatibility Profile. + * + *

OpenGL 2.1 implementations must support at least revision 1.20 of the OpenGL Shading Language.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL21 extends GL20 { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_CURRENT_RASTER_SECONDARY_COLOR = 0x845F; + + /** Returned by the {@code type} parameter of GetActiveUniform. */ + public static final int + GL_FLOAT_MAT2x3 = 0x8B65, + GL_FLOAT_MAT2x4 = 0x8B66, + GL_FLOAT_MAT3x2 = 0x8B67, + GL_FLOAT_MAT3x4 = 0x8B68, + GL_FLOAT_MAT4x2 = 0x8B69, + GL_FLOAT_MAT4x3 = 0x8B6A; + + /** + * Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferParameteriv, and + * GetBufferPointerv. + */ + public static final int + GL_PIXEL_PACK_BUFFER = 0x88EB, + GL_PIXEL_UNPACK_BUFFER = 0x88EC; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_PIXEL_PACK_BUFFER_BINDING = 0x88ED, + GL_PIXEL_UNPACK_BUFFER_BINDING = 0x88EF; + + /** Accepted by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D. */ + public static final int + GL_SRGB = 0x8C40, + GL_SRGB8 = 0x8C41, + GL_SRGB_ALPHA = 0x8C42, + GL_SRGB8_ALPHA8 = 0x8C43, + GL_SLUMINANCE_ALPHA = 0x8C44, + GL_SLUMINANCE8_ALPHA8 = 0x8C45, + GL_SLUMINANCE = 0x8C46, + GL_SLUMINANCE8 = 0x8C47, + GL_COMPRESSED_SRGB = 0x8C48, + GL_COMPRESSED_SRGB_ALPHA = 0x8C49, + GL_COMPRESSED_SLUMINANCE = 0x8C4A, + GL_COMPRESSED_SLUMINANCE_ALPHA = 0x8C4B; + + static { GL.initialize(); } + + protected GL21() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glUniformMatrix2x3fv, caps.glUniformMatrix3x2fv, caps.glUniformMatrix2x4fv, caps.glUniformMatrix4x2fv, caps.glUniformMatrix3x4fv, + caps.glUniformMatrix4x3fv + ); + } + + // --- [ glUniformMatrix2x3fv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix2x3fv UniformMatrix2x3fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix2x3fv(int location, int count, boolean transpose, long value) { + GL21C.nglUniformMatrix2x3fv(location, count, transpose, value); + } + + /** + * Specifies the value of a single mat2x3 uniform variable or a mat2x3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniformMatrix2x3fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL21C.glUniformMatrix2x3fv(location, transpose, value); + } + + // --- [ glUniformMatrix3x2fv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix3x2fv UniformMatrix3x2fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix3x2fv(int location, int count, boolean transpose, long value) { + GL21C.nglUniformMatrix3x2fv(location, count, transpose, value); + } + + /** + * Specifies the value of a single mat3x2 uniform variable or a mat3x2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniformMatrix3x2fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL21C.glUniformMatrix3x2fv(location, transpose, value); + } + + // --- [ glUniformMatrix2x4fv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix2x4fv UniformMatrix2x4fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix2x4fv(int location, int count, boolean transpose, long value) { + GL21C.nglUniformMatrix2x4fv(location, count, transpose, value); + } + + /** + * Specifies the value of a single mat2x4 uniform variable or a mat2x4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniformMatrix2x4fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL21C.glUniformMatrix2x4fv(location, transpose, value); + } + + // --- [ glUniformMatrix4x2fv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix4x2fv UniformMatrix4x2fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix4x2fv(int location, int count, boolean transpose, long value) { + GL21C.nglUniformMatrix4x2fv(location, count, transpose, value); + } + + /** + * Specifies the value of a single mat4x2 uniform variable or a mat4x2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniformMatrix4x2fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL21C.glUniformMatrix4x2fv(location, transpose, value); + } + + // --- [ glUniformMatrix3x4fv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix3x4fv UniformMatrix3x4fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix3x4fv(int location, int count, boolean transpose, long value) { + GL21C.nglUniformMatrix3x4fv(location, count, transpose, value); + } + + /** + * Specifies the value of a single mat3x4 uniform variable or a mat3x4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniformMatrix3x4fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL21C.glUniformMatrix3x4fv(location, transpose, value); + } + + // --- [ glUniformMatrix4x3fv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix4x3fv UniformMatrix4x3fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix4x3fv(int location, int count, boolean transpose, long value) { + GL21C.nglUniformMatrix4x3fv(location, count, transpose, value); + } + + /** + * Specifies the value of a single mat4x3 uniform variable or a mat4x3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniformMatrix4x3fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL21C.glUniformMatrix4x3fv(location, transpose, value); + } + + /** + * Array version of: {@link #glUniformMatrix2x3fv UniformMatrix2x3fv} + * + * @see Reference Page + */ + public static void glUniformMatrix2x3fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL21C.glUniformMatrix2x3fv(location, transpose, value); + } + + /** + * Array version of: {@link #glUniformMatrix3x2fv UniformMatrix3x2fv} + * + * @see Reference Page + */ + public static void glUniformMatrix3x2fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL21C.glUniformMatrix3x2fv(location, transpose, value); + } + + /** + * Array version of: {@link #glUniformMatrix2x4fv UniformMatrix2x4fv} + * + * @see Reference Page + */ + public static void glUniformMatrix2x4fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL21C.glUniformMatrix2x4fv(location, transpose, value); + } + + /** + * Array version of: {@link #glUniformMatrix4x2fv UniformMatrix4x2fv} + * + * @see Reference Page + */ + public static void glUniformMatrix4x2fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL21C.glUniformMatrix4x2fv(location, transpose, value); + } + + /** + * Array version of: {@link #glUniformMatrix3x4fv UniformMatrix3x4fv} + * + * @see Reference Page + */ + public static void glUniformMatrix3x4fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL21C.glUniformMatrix3x4fv(location, transpose, value); + } + + /** + * Array version of: {@link #glUniformMatrix4x3fv UniformMatrix4x3fv} + * + * @see Reference Page + */ + public static void glUniformMatrix4x3fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL21C.glUniformMatrix4x3fv(location, transpose, value); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL21C.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL21C.java new file mode 100644 index 00000000..b5ae7b39 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL21C.java @@ -0,0 +1,277 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality of a forward compatible context, up to version 2.1. + * + *

OpenGL 2.1 implementations must support at least revision 1.20 of the OpenGL Shading Language.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL21C extends GL20C { + + /** Returned by the {@code type} parameter of GetActiveUniform. */ + public static final int + GL_FLOAT_MAT2x3 = 0x8B65, + GL_FLOAT_MAT2x4 = 0x8B66, + GL_FLOAT_MAT3x2 = 0x8B67, + GL_FLOAT_MAT3x4 = 0x8B68, + GL_FLOAT_MAT4x2 = 0x8B69, + GL_FLOAT_MAT4x3 = 0x8B6A; + + /** + * Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferParameteriv, and + * GetBufferPointerv. + */ + public static final int + GL_PIXEL_PACK_BUFFER = 0x88EB, + GL_PIXEL_UNPACK_BUFFER = 0x88EC; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_PIXEL_PACK_BUFFER_BINDING = 0x88ED, + GL_PIXEL_UNPACK_BUFFER_BINDING = 0x88EF; + + /** Accepted by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D. */ + public static final int + GL_SRGB = 0x8C40, + GL_SRGB8 = 0x8C41, + GL_SRGB_ALPHA = 0x8C42, + GL_SRGB8_ALPHA8 = 0x8C43, + GL_COMPRESSED_SRGB = 0x8C48, + GL_COMPRESSED_SRGB_ALPHA = 0x8C49; + + static { GL.initialize(); } + + protected GL21C() { + throw new UnsupportedOperationException(); + } + + // --- [ glUniformMatrix2x3fv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix2x3fv UniformMatrix2x3fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglUniformMatrix2x3fv(int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single mat2x3 uniform variable or a mat2x3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniformMatrix2x3fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglUniformMatrix2x3fv(location, value.remaining() / 6, transpose, memAddress(value)); + } + + // --- [ glUniformMatrix3x2fv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix3x2fv UniformMatrix3x2fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglUniformMatrix3x2fv(int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single mat3x2 uniform variable or a mat3x2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniformMatrix3x2fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglUniformMatrix3x2fv(location, value.remaining() / 6, transpose, memAddress(value)); + } + + // --- [ glUniformMatrix2x4fv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix2x4fv UniformMatrix2x4fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglUniformMatrix2x4fv(int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single mat2x4 uniform variable or a mat2x4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniformMatrix2x4fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglUniformMatrix2x4fv(location, value.remaining() >> 3, transpose, memAddress(value)); + } + + // --- [ glUniformMatrix4x2fv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix4x2fv UniformMatrix4x2fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglUniformMatrix4x2fv(int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single mat4x2 uniform variable or a mat4x2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniformMatrix4x2fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglUniformMatrix4x2fv(location, value.remaining() >> 3, transpose, memAddress(value)); + } + + // --- [ glUniformMatrix3x4fv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix3x4fv UniformMatrix3x4fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglUniformMatrix3x4fv(int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single mat3x4 uniform variable or a mat3x4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniformMatrix3x4fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglUniformMatrix3x4fv(location, value.remaining() / 12, transpose, memAddress(value)); + } + + // --- [ glUniformMatrix4x3fv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix4x3fv UniformMatrix4x3fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglUniformMatrix4x3fv(int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single mat4x3 uniform variable or a mat4x3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniformMatrix4x3fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglUniformMatrix4x3fv(location, value.remaining() / 12, transpose, memAddress(value)); + } + + /** + * Array version of: {@link #glUniformMatrix2x3fv UniformMatrix2x3fv} + * + * @see Reference Page + */ + public static void glUniformMatrix2x3fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glUniformMatrix2x3fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length / 6, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniformMatrix3x2fv UniformMatrix3x2fv} + * + * @see Reference Page + */ + public static void glUniformMatrix3x2fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glUniformMatrix3x2fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length / 6, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniformMatrix2x4fv UniformMatrix2x4fv} + * + * @see Reference Page + */ + public static void glUniformMatrix2x4fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glUniformMatrix2x4fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 3, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniformMatrix4x2fv UniformMatrix4x2fv} + * + * @see Reference Page + */ + public static void glUniformMatrix4x2fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glUniformMatrix4x2fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 3, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniformMatrix3x4fv UniformMatrix3x4fv} + * + * @see Reference Page + */ + public static void glUniformMatrix3x4fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glUniformMatrix3x4fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length / 12, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniformMatrix4x3fv UniformMatrix4x3fv} + * + * @see Reference Page + */ + public static void glUniformMatrix4x3fv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glUniformMatrix4x3fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length / 12, transpose, value, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL30.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL30.java new file mode 100644 index 00000000..143e7c93 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL30.java @@ -0,0 +1,2692 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * The OpenGL functionality up to version 3.0. Includes the deprecated symbols of the Compatibility Profile. + * + *

OpenGL 3.0 implementations are guaranteed to support at least versions 1.10, 1.20 and 1.30 of the shading language, although versions 1.10 and 1.20 are + * deprecated in a forward-compatible context.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL30 extends GL21 { + + /** GetTarget */ + public static final int + GL_MAJOR_VERSION = 0x821B, + GL_MINOR_VERSION = 0x821C, + GL_NUM_EXTENSIONS = 0x821D, + GL_CONTEXT_FLAGS = 0x821E, + GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = 0x1; + + /** Renamed tokens. */ + public static final int + GL_COMPARE_REF_TO_TEXTURE = GL14.GL_COMPARE_R_TO_TEXTURE, + GL_CLIP_DISTANCE0 = GL11.GL_CLIP_PLANE0, + GL_CLIP_DISTANCE1 = GL11.GL_CLIP_PLANE1, + GL_CLIP_DISTANCE2 = GL11.GL_CLIP_PLANE2, + GL_CLIP_DISTANCE3 = GL11.GL_CLIP_PLANE3, + GL_CLIP_DISTANCE4 = GL11.GL_CLIP_PLANE4, + GL_CLIP_DISTANCE5 = GL11.GL_CLIP_PLANE5, + GL_CLIP_DISTANCE6 = 0x3006, + GL_CLIP_DISTANCE7 = 0x3007, + GL_MAX_CLIP_DISTANCES = GL11.GL_MAX_CLIP_PLANES, + GL_MAX_VARYING_COMPONENTS = GL20.GL_MAX_VARYING_FLOATS; + + /** Accepted by the {@code pname} parameters of GetVertexAttribdv, GetVertexAttribfv, GetVertexAttribiv, GetVertexAttribIuiv and GetVertexAttribIiv. */ + public static final int GL_VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD; + + /** Returned by the {@code type} parameter of GetActiveUniform. */ + public static final int + GL_SAMPLER_1D_ARRAY = 0x8DC0, + GL_SAMPLER_2D_ARRAY = 0x8DC1, + GL_SAMPLER_1D_ARRAY_SHADOW = 0x8DC3, + GL_SAMPLER_2D_ARRAY_SHADOW = 0x8DC4, + GL_SAMPLER_CUBE_SHADOW = 0x8DC5, + GL_UNSIGNED_INT_VEC2 = 0x8DC6, + GL_UNSIGNED_INT_VEC3 = 0x8DC7, + GL_UNSIGNED_INT_VEC4 = 0x8DC8, + GL_INT_SAMPLER_1D = 0x8DC9, + GL_INT_SAMPLER_2D = 0x8DCA, + GL_INT_SAMPLER_3D = 0x8DCB, + GL_INT_SAMPLER_CUBE = 0x8DCC, + GL_INT_SAMPLER_1D_ARRAY = 0x8DCE, + GL_INT_SAMPLER_2D_ARRAY = 0x8DCF, + GL_UNSIGNED_INT_SAMPLER_1D = 0x8DD1, + GL_UNSIGNED_INT_SAMPLER_2D = 0x8DD2, + GL_UNSIGNED_INT_SAMPLER_3D = 0x8DD3, + GL_UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4, + GL_UNSIGNED_INT_SAMPLER_1D_ARRAY = 0x8DD6, + GL_UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MIN_PROGRAM_TEXEL_OFFSET = 0x8904, + GL_MAX_PROGRAM_TEXEL_OFFSET = 0x8905; + + /** Accepted by the {@code mode} parameter of BeginConditionalRender. */ + public static final int + GL_QUERY_WAIT = 0x8E13, + GL_QUERY_NO_WAIT = 0x8E14, + GL_QUERY_BY_REGION_WAIT = 0x8E15, + GL_QUERY_BY_REGION_NO_WAIT = 0x8E16; + + /** Accepted by the {@code access} parameter of MapBufferRange. */ + public static final int + GL_MAP_READ_BIT = 0x1, + GL_MAP_WRITE_BIT = 0x2, + GL_MAP_INVALIDATE_RANGE_BIT = 0x4, + GL_MAP_INVALIDATE_BUFFER_BIT = 0x8, + GL_MAP_FLUSH_EXPLICIT_BIT = 0x10, + GL_MAP_UNSYNCHRONIZED_BIT = 0x20; + + /** Accepted by the {@code pname} parameter of GetBufferParameteriv. */ + public static final int + GL_BUFFER_ACCESS_FLAGS = 0x911F, + GL_BUFFER_MAP_LENGTH = 0x9120, + GL_BUFFER_MAP_OFFSET = 0x9121; + + /** Accepted by the {@code target} parameter of ClampColor and the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_CLAMP_VERTEX_COLOR = 0x891A, + GL_CLAMP_FRAGMENT_COLOR = 0x891B, + GL_CLAMP_READ_COLOR = 0x891C; + + /** Accepted by the {@code clamp} parameter of ClampColor. */ + public static final int GL_FIXED_ONLY = 0x891D; + + /** + * Accepted by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and RenderbufferStorage, and + * returned in the {@code data} parameter of GetTexLevelParameter and GetRenderbufferParameteriv. + */ + public static final int + GL_DEPTH_COMPONENT32F = 0x8CAC, + GL_DEPTH32F_STENCIL8 = 0x8CAD; + + /** + * Accepted by the {@code type} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, and + * GetTexImage. + */ + public static final int GL_FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD; + + /** Accepted by the {@code value} parameter of GetTexLevelParameter. */ + public static final int + GL_TEXTURE_RED_TYPE = 0x8C10, + GL_TEXTURE_GREEN_TYPE = 0x8C11, + GL_TEXTURE_BLUE_TYPE = 0x8C12, + GL_TEXTURE_ALPHA_TYPE = 0x8C13, + GL_TEXTURE_LUMINANCE_TYPE = 0x8C14, + GL_TEXTURE_INTENSITY_TYPE = 0x8C15, + GL_TEXTURE_DEPTH_TYPE = 0x8C16; + + /** Returned by the {@code params} parameter of GetTexLevelParameter. */ + public static final int GL_UNSIGNED_NORMALIZED = 0x8C17; + + /** Accepted by the {@code internalFormat} parameter of TexImage1D, TexImage2D, and TexImage3D. */ + public static final int + GL_RGBA32F = 0x8814, + GL_RGB32F = 0x8815, + GL_RGBA16F = 0x881A, + GL_RGB16F = 0x881B; + + /** Accepted by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and RenderbufferStorage. */ + public static final int GL_R11F_G11F_B10F = 0x8C3A; + + /** + * Accepted by the {@code type} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, GetTexImage, TexImage3D, TexSubImage1D, TexSubImage2D, + * TexSubImage3D, GetHistogram, GetMinmax, ConvolutionFilter1D, ConvolutionFilter2D, ConvolutionFilter3D, GetConvolutionFilter, SeparableFilter2D, + * GetSeparableFilter, ColorTable, ColorSubTable, and GetColorTable. + */ + public static final int GL_UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B; + + /** Accepted by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and RenderbufferStorage. */ + public static final int GL_RGB9_E5 = 0x8C3D; + + /** + * Accepted by the {@code type} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, GetTexImage, TexImage3D, TexSubImage1D, TexSubImage2D, + * TexSubImage3D, GetHistogram, GetMinmax, ConvolutionFilter1D, ConvolutionFilter2D, ConvolutionFilter3D, GetConvolutionFilter, SeparableFilter2D, + * GetSeparableFilter, ColorTable, ColorSubTable, and GetColorTable. + */ + public static final int GL_UNSIGNED_INT_5_9_9_9_REV = 0x8C3E; + + /** Accepted by the {@code pname} parameter of GetTexLevelParameterfv and GetTexLevelParameteriv. */ + public static final int GL_TEXTURE_SHARED_SIZE = 0x8C3F; + + /** + * Accepted by the {@code target} parameter of BindFramebuffer, CheckFramebufferStatus, FramebufferTexture{1D|2D|3D}, FramebufferRenderbuffer, and + * GetFramebufferAttachmentParameteriv. + */ + public static final int + GL_FRAMEBUFFER = 0x8D40, + GL_READ_FRAMEBUFFER = 0x8CA8, + GL_DRAW_FRAMEBUFFER = 0x8CA9; + + /** + * Accepted by the {@code target} parameter of BindRenderbuffer, RenderbufferStorage, and GetRenderbufferParameteriv, and returned by + * GetFramebufferAttachmentParameteriv. + */ + public static final int GL_RENDERBUFFER = 0x8D41; + + /** Accepted by the {@code internalformat} parameter of RenderbufferStorage. */ + public static final int + GL_STENCIL_INDEX1 = 0x8D46, + GL_STENCIL_INDEX4 = 0x8D47, + GL_STENCIL_INDEX8 = 0x8D48, + GL_STENCIL_INDEX16 = 0x8D49; + + /** Accepted by the {@code pname} parameter of GetRenderbufferParameteriv. */ + public static final int + GL_RENDERBUFFER_WIDTH = 0x8D42, + GL_RENDERBUFFER_HEIGHT = 0x8D43, + GL_RENDERBUFFER_INTERNAL_FORMAT = 0x8D44, + GL_RENDERBUFFER_RED_SIZE = 0x8D50, + GL_RENDERBUFFER_GREEN_SIZE = 0x8D51, + GL_RENDERBUFFER_BLUE_SIZE = 0x8D52, + GL_RENDERBUFFER_ALPHA_SIZE = 0x8D53, + GL_RENDERBUFFER_DEPTH_SIZE = 0x8D54, + GL_RENDERBUFFER_STENCIL_SIZE = 0x8D55, + GL_RENDERBUFFER_SAMPLES = 0x8CAB; + + /** Accepted by the {@code pname} parameter of GetFramebufferAttachmentParameteriv. */ + public static final int + GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0, + GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1, + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2, + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3, + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4, + GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210, + GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211, + GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212, + GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213, + GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214, + GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215, + GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216, + GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217; + + /** Returned in {@code params} by GetFramebufferAttachmentParameteriv. */ + public static final int + GL_FRAMEBUFFER_DEFAULT = 0x8218, + GL_INDEX = 0x8222; + + /** Accepted by the {@code attachment} parameter of FramebufferTexture{1D|2D|3D}, FramebufferRenderbuffer, and GetFramebufferAttachmentParameteriv. */ + public static final int + GL_COLOR_ATTACHMENT0 = 0x8CE0, + GL_COLOR_ATTACHMENT1 = 0x8CE1, + GL_COLOR_ATTACHMENT2 = 0x8CE2, + GL_COLOR_ATTACHMENT3 = 0x8CE3, + GL_COLOR_ATTACHMENT4 = 0x8CE4, + GL_COLOR_ATTACHMENT5 = 0x8CE5, + GL_COLOR_ATTACHMENT6 = 0x8CE6, + GL_COLOR_ATTACHMENT7 = 0x8CE7, + GL_COLOR_ATTACHMENT8 = 0x8CE8, + GL_COLOR_ATTACHMENT9 = 0x8CE9, + GL_COLOR_ATTACHMENT10 = 0x8CEA, + GL_COLOR_ATTACHMENT11 = 0x8CEB, + GL_COLOR_ATTACHMENT12 = 0x8CEC, + GL_COLOR_ATTACHMENT13 = 0x8CED, + GL_COLOR_ATTACHMENT14 = 0x8CEE, + GL_COLOR_ATTACHMENT15 = 0x8CEF, + GL_COLOR_ATTACHMENT16 = 0x8CF0, + GL_COLOR_ATTACHMENT17 = 0x8CF1, + GL_COLOR_ATTACHMENT18 = 0x8CF2, + GL_COLOR_ATTACHMENT19 = 0x8CF3, + GL_COLOR_ATTACHMENT20 = 0x8CF4, + GL_COLOR_ATTACHMENT21 = 0x8CF5, + GL_COLOR_ATTACHMENT22 = 0x8CF6, + GL_COLOR_ATTACHMENT23 = 0x8CF7, + GL_COLOR_ATTACHMENT24 = 0x8CF8, + GL_COLOR_ATTACHMENT25 = 0x8CF9, + GL_COLOR_ATTACHMENT26 = 0x8CFA, + GL_COLOR_ATTACHMENT27 = 0x8CFB, + GL_COLOR_ATTACHMENT28 = 0x8CFC, + GL_COLOR_ATTACHMENT29 = 0x8CFD, + GL_COLOR_ATTACHMENT30 = 0x8CFE, + GL_COLOR_ATTACHMENT31 = 0x8CFF, + GL_DEPTH_ATTACHMENT = 0x8D00, + GL_STENCIL_ATTACHMENT = 0x8D20, + GL_DEPTH_STENCIL_ATTACHMENT = 0x821A; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_MAX_SAMPLES = 0x8D57; + + /** Returned by CheckFramebufferStatus(). */ + public static final int + GL_FRAMEBUFFER_COMPLETE = 0x8CD5, + GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6, + GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7, + GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0x8CDB, + GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC, + GL_FRAMEBUFFER_UNSUPPORTED = 0x8CDD, + GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56, + GL_FRAMEBUFFER_UNDEFINED = 0x8219; + + /** Accepted by the {@code pname} parameters of GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_FRAMEBUFFER_BINDING = 0x8CA6, + GL_DRAW_FRAMEBUFFER_BINDING = 0x8CA6, + GL_READ_FRAMEBUFFER_BINDING = 0x8CAA, + GL_RENDERBUFFER_BINDING = 0x8CA7, + GL_MAX_COLOR_ATTACHMENTS = 0x8CDF, + GL_MAX_RENDERBUFFER_SIZE = 0x84E8; + + /** Returned by GetError(). */ + public static final int GL_INVALID_FRAMEBUFFER_OPERATION = 0x506; + + /** + * Accepted by the {@code format} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, and + * GetTexImage, by the {@code type} parameter of CopyPixels, by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, + * CopyTexImage2D, and RenderbufferStorage, and returned in the {@code data} parameter of GetTexLevelParameter and GetRenderbufferParameteriv. + */ + public static final int GL_DEPTH_STENCIL = 0x84F9; + + /** + * Accepted by the {@code type} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, and + * GetTexImage. + */ + public static final int GL_UNSIGNED_INT_24_8 = 0x84FA; + + /** + * Accepted by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and RenderbufferStorage, and + * returned in the {@code data} parameter of GetTexLevelParameter and GetRenderbufferParameteriv. + */ + public static final int GL_DEPTH24_STENCIL8 = 0x88F0; + + /** Accepted by the {@code value} parameter of GetTexLevelParameter. */ + public static final int GL_TEXTURE_STENCIL_SIZE = 0x88F1; + + /** + * Accepted by the {@code type} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, TexImage3D, GetTexImage, TexSubImage1D, TexSubImage2D, + * TexSubImage3D, GetHistogram, GetMinmax, ConvolutionFilter1D, ConvolutionFilter2D, GetConvolutionFilter, SeparableFilter2D, GetSeparableFilter, + * ColorTable, ColorSubTable, and GetColorTable. + * + *

Accepted by the {@code type} argument of VertexPointer, NormalPointer, ColorPointer, SecondaryColorPointer, FogCoordPointer, TexCoordPointer, and + * VertexAttribPointer.

+ */ + public static final int GL_HALF_FLOAT = 0x140B; + + /** Accepted by the {@code internalFormat} parameter of TexImage1D, TexImage2D, and TexImage3D. */ + public static final int + GL_RGBA32UI = 0x8D70, + GL_RGB32UI = 0x8D71, + GL_RGBA16UI = 0x8D76, + GL_RGB16UI = 0x8D77, + GL_RGBA8UI = 0x8D7C, + GL_RGB8UI = 0x8D7D, + GL_RGBA32I = 0x8D82, + GL_RGB32I = 0x8D83, + GL_RGBA16I = 0x8D88, + GL_RGB16I = 0x8D89, + GL_RGBA8I = 0x8D8E, + GL_RGB8I = 0x8D8F; + + /** Accepted by the {@code format} parameter of TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, DrawPixels and ReadPixels. */ + public static final int + GL_RED_INTEGER = 0x8D94, + GL_GREEN_INTEGER = 0x8D95, + GL_BLUE_INTEGER = 0x8D96, + GL_ALPHA_INTEGER = 0x8D97, + GL_RGB_INTEGER = 0x8D98, + GL_RGBA_INTEGER = 0x8D99, + GL_BGR_INTEGER = 0x8D9A, + GL_BGRA_INTEGER = 0x8D9B; + + /** Accepted by the {@code target} parameter of TexParameteri, TexParameteriv, TexParameterf, TexParameterfv, GenerateMipmap, and BindTexture. */ + public static final int + GL_TEXTURE_1D_ARRAY = 0x8C18, + GL_TEXTURE_2D_ARRAY = 0x8C1A; + + /** Accepted by the {@code target} parameter of TexImage3D, TexSubImage3D, CopyTexSubImage3D, CompressedTexImage3D, and CompressedTexSubImage3D. */ + public static final int GL_PROXY_TEXTURE_2D_ARRAY = 0x8C1B; + + /** + * Accepted by the {@code target} parameter of TexImage2D, TexSubImage2D, CopyTexImage2D, CopyTexSubImage2D, CompressedTexImage2D, and + * CompressedTexSubImage2D. + */ + public static final int GL_PROXY_TEXTURE_1D_ARRAY = 0x8C19; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv and GetFloatv. */ + public static final int + GL_TEXTURE_BINDING_1D_ARRAY = 0x8C1C, + GL_TEXTURE_BINDING_2D_ARRAY = 0x8C1D, + GL_MAX_ARRAY_TEXTURE_LAYERS = 0x88FF; + + /** + * Accepted by the {@code internalformat} parameter of TexImage2D, CopyTexImage2D, and CompressedTexImage2D and the {@code format} parameter of + * CompressedTexSubImage2D. + */ + public static final int + GL_COMPRESSED_RED_RGTC1 = 0x8DBB, + GL_COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC, + GL_COMPRESSED_RG_RGTC2 = 0x8DBD, + GL_COMPRESSED_SIGNED_RG_RGTC2 = 0x8DBE; + + /** Accepted by the {@code internalFormat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, and CopyTexImage2D. */ + public static final int + GL_R8 = 0x8229, + GL_R16 = 0x822A, + GL_RG8 = 0x822B, + GL_RG16 = 0x822C, + GL_R16F = 0x822D, + GL_R32F = 0x822E, + GL_RG16F = 0x822F, + GL_RG32F = 0x8230, + GL_R8I = 0x8231, + GL_R8UI = 0x8232, + GL_R16I = 0x8233, + GL_R16UI = 0x8234, + GL_R32I = 0x8235, + GL_R32UI = 0x8236, + GL_RG8I = 0x8237, + GL_RG8UI = 0x8238, + GL_RG16I = 0x8239, + GL_RG16UI = 0x823A, + GL_RG32I = 0x823B, + GL_RG32UI = 0x823C, + GL_RG = 0x8227, + GL_COMPRESSED_RED = 0x8225, + GL_COMPRESSED_RG = 0x8226; + + /** Accepted by the {@code format} parameter of TexImage3D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, and ReadPixels. */ + public static final int GL_RG_INTEGER = 0x8228; + + /** + * Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferPointerv, + * BindBufferRange, BindBufferOffset and BindBufferBase. + */ + public static final int GL_TRANSFORM_FEEDBACK_BUFFER = 0x8C8E; + + /** Accepted by the {@code param} parameter of GetIntegeri_v and GetBooleani_v. */ + public static final int + GL_TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84, + GL_TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85; + + /** + * Accepted by the {@code param} parameter of GetIntegeri_v and GetBooleani_v, and by the {@code pname} parameter of GetBooleanv, + * GetDoublev, GetIntegerv, and GetFloatv. + */ + public static final int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F; + + /** Accepted by the {@code bufferMode} parameter of TransformFeedbackVaryings. */ + public static final int + GL_INTERLEAVED_ATTRIBS = 0x8C8C, + GL_SEPARATE_ATTRIBS = 0x8C8D; + + /** Accepted by the {@code target} parameter of BeginQuery, EndQuery, and GetQueryiv. */ + public static final int + GL_PRIMITIVES_GENERATED = 0x8C87, + GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_RASTERIZER_DISCARD = 0x8C89; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A, + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B, + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80; + + /** Accepted by the {@code pname} parameter of GetProgramiv. */ + public static final int + GL_TRANSFORM_FEEDBACK_VARYINGS = 0x8C83, + GL_TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F, + GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_VERTEX_ARRAY_BINDING = 0x85B5; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_FRAMEBUFFER_SRGB = 0x8DB9; + + static { GL.initialize(); } + + protected GL30() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glGetStringi, caps.glClearBufferiv, caps.glClearBufferuiv, caps.glClearBufferfv, caps.glClearBufferfi, caps.glVertexAttribI1i, + caps.glVertexAttribI2i, caps.glVertexAttribI3i, caps.glVertexAttribI4i, caps.glVertexAttribI1ui, caps.glVertexAttribI2ui, caps.glVertexAttribI3ui, + caps.glVertexAttribI4ui, caps.glVertexAttribI1iv, caps.glVertexAttribI2iv, caps.glVertexAttribI3iv, caps.glVertexAttribI4iv, + caps.glVertexAttribI1uiv, caps.glVertexAttribI2uiv, caps.glVertexAttribI3uiv, caps.glVertexAttribI4uiv, caps.glVertexAttribI4bv, + caps.glVertexAttribI4sv, caps.glVertexAttribI4ubv, caps.glVertexAttribI4usv, caps.glVertexAttribIPointer, caps.glGetVertexAttribIiv, + caps.glGetVertexAttribIuiv, caps.glUniform1ui, caps.glUniform2ui, caps.glUniform3ui, caps.glUniform4ui, caps.glUniform1uiv, caps.glUniform2uiv, + caps.glUniform3uiv, caps.glUniform4uiv, caps.glGetUniformuiv, caps.glBindFragDataLocation, caps.glGetFragDataLocation, + caps.glBeginConditionalRender, caps.glEndConditionalRender, caps.glMapBufferRange, caps.glFlushMappedBufferRange, caps.glClampColor, + caps.glIsRenderbuffer, caps.glBindRenderbuffer, caps.glDeleteRenderbuffers, caps.glGenRenderbuffers, caps.glRenderbufferStorage, + caps.glRenderbufferStorageMultisample, caps.glGetRenderbufferParameteriv, caps.glIsFramebuffer, caps.glBindFramebuffer, caps.glDeleteFramebuffers, + caps.glGenFramebuffers, caps.glCheckFramebufferStatus, caps.glFramebufferTexture1D, caps.glFramebufferTexture2D, caps.glFramebufferTexture3D, + caps.glFramebufferTextureLayer, caps.glFramebufferRenderbuffer, caps.glGetFramebufferAttachmentParameteriv, caps.glBlitFramebuffer, + caps.glGenerateMipmap, caps.glTexParameterIiv, caps.glTexParameterIuiv, caps.glGetTexParameterIiv, caps.glGetTexParameterIuiv, caps.glColorMaski, + caps.glGetBooleani_v, caps.glGetIntegeri_v, caps.glEnablei, caps.glDisablei, caps.glIsEnabledi, caps.glBindBufferRange, caps.glBindBufferBase, + caps.glBeginTransformFeedback, caps.glEndTransformFeedback, caps.glTransformFeedbackVaryings, caps.glGetTransformFeedbackVarying, + caps.glBindVertexArray, caps.glDeleteVertexArrays, caps.glGenVertexArrays, caps.glIsVertexArray + ); + } + + // --- [ glGetStringi ] --- + + /** Unsafe version of: {@link #glGetStringi GetStringi} */ + public static long nglGetStringi(int name, int index) { + return GL30C.nglGetStringi(name, index); + } + + /** + * Queries indexed string state. + * + * @param name the indexed state to query. One of:
{@link GL11#GL_EXTENSIONS EXTENSIONS}{@link GL20#GL_SHADING_LANGUAGE_VERSION SHADING_LANGUAGE_VERSION}
+ * @param index the index of the particular element being queried + * + * @see Reference Page + */ + @Nullable + @NativeType("GLubyte const *") + public static String glGetStringi(@NativeType("GLenum") int name, @NativeType("GLuint") int index) { + return GL30C.glGetStringi(name, index); + } + + // --- [ glClearBufferiv ] --- + + /** Unsafe version of: {@link #glClearBufferiv ClearBufferiv} */ + public static void nglClearBufferiv(int buffer, int drawbuffer, long value) { + GL30C.nglClearBufferiv(buffer, drawbuffer, value); + } + + /** + * Clears an individual buffer of the currently bound framebuffer object to the {@link GL30C#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER} binding. + * + * @param buffer the buffer to clear. One of:
{@link GL11#GL_COLOR COLOR}{@link GL11#GL_STENCIL STENCIL}
+ * @param drawbuffer the draw buffer to clear + * @param value for color buffers, a pointer to a four-element vector specifying R, G, B and A values to clear the buffer to. For stencil buffers, a pointer to a + * single stencil value to clear the buffer to. + * + * @see Reference Page + */ + public static void glClearBufferiv(@NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLint *") IntBuffer value) { + GL30C.glClearBufferiv(buffer, drawbuffer, value); + } + + // --- [ glClearBufferuiv ] --- + + /** Unsafe version of: {@link #glClearBufferuiv ClearBufferuiv} */ + public static void nglClearBufferuiv(int buffer, int drawbuffer, long value) { + GL30C.nglClearBufferuiv(buffer, drawbuffer, value); + } + + /** + * Clears an individual buffer of the currently bound framebuffer object to the {@link GL30C#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER} binding. + * + * @param buffer the buffer to clear. Must be:
{@link GL11#GL_COLOR COLOR}
+ * @param drawbuffer the draw buffer to clear + * @param value a pointer to a four-element vector specifying R, G, B and A values to clear the buffer to + * + * @see Reference Page + */ + public static void glClearBufferuiv(@NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLint *") IntBuffer value) { + GL30C.glClearBufferuiv(buffer, drawbuffer, value); + } + + // --- [ glClearBufferfv ] --- + + /** Unsafe version of: {@link #glClearBufferfv ClearBufferfv} */ + public static void nglClearBufferfv(int buffer, int drawbuffer, long value) { + GL30C.nglClearBufferfv(buffer, drawbuffer, value); + } + + /** + * Clears an individual buffer of the currently bound framebuffer object to the {@link GL30C#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER} binding. + * + * @param buffer the buffer to clear. One of:
{@link GL11#GL_COLOR COLOR}{@link GL11#GL_DEPTH DEPTH}
+ * @param drawbuffer the draw buffer to clear + * @param value for color buffers, a pointer to a four-element vector specifying R, G, B and A values to clear the buffer to. For depth buffers, a pointer to a + * single depth value to clear the buffer to. + * + * @see Reference Page + */ + public static void glClearBufferfv(@NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLfloat *") FloatBuffer value) { + GL30C.glClearBufferfv(buffer, drawbuffer, value); + } + + // --- [ glClearBufferfi ] --- + + /** + * Clears an individual buffer of the currently bound framebuffer object to the {@link GL30C#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER} binding. + * + * @param buffer the buffer to clear. Must be:
{@link GL30C#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param drawbuffer the draw buffer to clear + * @param depth the depth value to clear the buffer to + * @param stencil the stencil value to clear the buffer to + * + * @see Reference Page + */ + public static void glClearBufferfi(@NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLfloat") float depth, @NativeType("GLint") int stencil) { + GL30C.glClearBufferfi(buffer, drawbuffer, depth, stencil); + } + + // --- [ glVertexAttribI1i ] --- + + /** + * Specifies the value of a pure integer generic vertex attribute. The y and z components are implicitly set to 0 and w to 1. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + * + * @see Reference Page + */ + public static void glVertexAttribI1i(@NativeType("GLuint") int index, @NativeType("GLint") int x) { + GL30C.glVertexAttribI1i(index, x); + } + + // --- [ glVertexAttribI2i ] --- + + /** + * Specifies the value of a pure integer generic vertex attribute. The z component is implicitly set to 0 and w to 1. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * + * @see Reference Page + */ + public static void glVertexAttribI2i(@NativeType("GLuint") int index, @NativeType("GLint") int x, @NativeType("GLint") int y) { + GL30C.glVertexAttribI2i(index, x, y); + } + + // --- [ glVertexAttribI3i ] --- + + /** + * Specifies the value of a pure integer generic vertex attribute. The w component is implicitly set to 1. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * @param z the vertex attribute z component + * + * @see Reference Page + */ + public static void glVertexAttribI3i(@NativeType("GLuint") int index, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z) { + GL30C.glVertexAttribI3i(index, x, y, z); + } + + // --- [ glVertexAttribI4i ] --- + + /** + * Specifies the value of a pure integer generic vertex attribute. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * @param z the vertex attribute z component + * @param w the vertex attribute w component + * + * @see Reference Page + */ + public static void glVertexAttribI4i(@NativeType("GLuint") int index, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z, @NativeType("GLint") int w) { + GL30C.glVertexAttribI4i(index, x, y, z, w); + } + + // --- [ glVertexAttribI1ui ] --- + + /** + * Specifies the value of an unsigned pure integer generic vertex attribute. The y and z components are implicitly set to 0 and w to 1. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + * + * @see Reference Page + */ + public static void glVertexAttribI1ui(@NativeType("GLuint") int index, @NativeType("GLuint") int x) { + GL30C.glVertexAttribI1ui(index, x); + } + + // --- [ glVertexAttribI2ui ] --- + + /** + * Specifies the value of an unsigned pure integer generic vertex attribute. The z component is implicitly set to 0 and w to 1. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * + * @see Reference Page + */ + public static void glVertexAttribI2ui(@NativeType("GLuint") int index, @NativeType("GLuint") int x, @NativeType("GLuint") int y) { + GL30C.glVertexAttribI2ui(index, x, y); + } + + // --- [ glVertexAttribI3ui ] --- + + /** + * Specifies the value of an unsigned pure integer generic vertex attribute. The w component is implicitly set to 1. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * @param z the vertex attribute z component + * + * @see Reference Page + */ + public static void glVertexAttribI3ui(@NativeType("GLuint") int index, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z) { + GL30C.glVertexAttribI3ui(index, x, y, z); + } + + // --- [ glVertexAttribI4ui ] --- + + /** + * Specifies the value of an unsigned pure integer generic vertex attribute. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * @param z the vertex attribute z component + * @param w the vertex attribute w component + * + * @see Reference Page + */ + public static void glVertexAttribI4ui(@NativeType("GLuint") int index, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z, @NativeType("GLint") int w) { + GL30C.glVertexAttribI4ui(index, x, y, z, w); + } + + // --- [ glVertexAttribI1iv ] --- + + /** Unsafe version of: {@link #glVertexAttribI1iv VertexAttribI1iv} */ + public static void nglVertexAttribI1iv(int index, long v) { + GL30C.nglVertexAttribI1iv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttribI1i VertexAttribI1i}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI1iv(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + GL30C.glVertexAttribI1iv(index, v); + } + + // --- [ glVertexAttribI2iv ] --- + + /** Unsafe version of: {@link #glVertexAttribI2iv VertexAttribI2iv} */ + public static void nglVertexAttribI2iv(int index, long v) { + GL30C.nglVertexAttribI2iv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttribI2i VertexAttribI2i}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI2iv(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + GL30C.glVertexAttribI2iv(index, v); + } + + // --- [ glVertexAttribI3iv ] --- + + /** Unsafe version of: {@link #glVertexAttribI3iv VertexAttribI3iv} */ + public static void nglVertexAttribI3iv(int index, long v) { + GL30C.nglVertexAttribI3iv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttribI3i VertexAttribI3i}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI3iv(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + GL30C.glVertexAttribI3iv(index, v); + } + + // --- [ glVertexAttribI4iv ] --- + + /** Unsafe version of: {@link #glVertexAttribI4iv VertexAttribI4iv} */ + public static void nglVertexAttribI4iv(int index, long v) { + GL30C.nglVertexAttribI4iv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttribI4i VertexAttribI4i}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI4iv(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + GL30C.glVertexAttribI4iv(index, v); + } + + // --- [ glVertexAttribI1uiv ] --- + + /** Unsafe version of: {@link #glVertexAttribI1uiv VertexAttribI1uiv} */ + public static void nglVertexAttribI1uiv(int index, long v) { + GL30C.nglVertexAttribI1uiv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttribI1ui VertexAttribI1ui}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI1uiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") IntBuffer v) { + GL30C.glVertexAttribI1uiv(index, v); + } + + // --- [ glVertexAttribI2uiv ] --- + + /** Unsafe version of: {@link #glVertexAttribI2uiv VertexAttribI2uiv} */ + public static void nglVertexAttribI2uiv(int index, long v) { + GL30C.nglVertexAttribI2uiv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttribI2ui VertexAttribI2ui}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI2uiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") IntBuffer v) { + GL30C.glVertexAttribI2uiv(index, v); + } + + // --- [ glVertexAttribI3uiv ] --- + + /** Unsafe version of: {@link #glVertexAttribI3uiv VertexAttribI3uiv} */ + public static void nglVertexAttribI3uiv(int index, long v) { + GL30C.nglVertexAttribI3uiv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttribI3ui VertexAttribI3ui}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI3uiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") IntBuffer v) { + GL30C.glVertexAttribI3uiv(index, v); + } + + // --- [ glVertexAttribI4uiv ] --- + + /** Unsafe version of: {@link #glVertexAttribI4uiv VertexAttribI4uiv} */ + public static void nglVertexAttribI4uiv(int index, long v) { + GL30C.nglVertexAttribI4uiv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttribI4ui VertexAttribI4ui}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI4uiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") IntBuffer v) { + GL30C.glVertexAttribI4uiv(index, v); + } + + // --- [ glVertexAttribI4bv ] --- + + /** Unsafe version of: {@link #glVertexAttribI4bv VertexAttribI4bv} */ + public static void nglVertexAttribI4bv(int index, long v) { + GL30C.nglVertexAttribI4bv(index, v); + } + + /** + * Byte version of {@link #glVertexAttribI4iv VertexAttribI4iv}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI4bv(@NativeType("GLuint") int index, @NativeType("GLbyte const *") ByteBuffer v) { + GL30C.glVertexAttribI4bv(index, v); + } + + // --- [ glVertexAttribI4sv ] --- + + /** Unsafe version of: {@link #glVertexAttribI4sv VertexAttribI4sv} */ + public static void nglVertexAttribI4sv(int index, long v) { + GL30C.nglVertexAttribI4sv(index, v); + } + + /** + * Short version of {@link #glVertexAttribI4iv VertexAttribI4iv}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI4sv(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + GL30C.glVertexAttribI4sv(index, v); + } + + // --- [ glVertexAttribI4ubv ] --- + + /** Unsafe version of: {@link #glVertexAttribI4ubv VertexAttribI4ubv} */ + public static void nglVertexAttribI4ubv(int index, long v) { + GL30C.nglVertexAttribI4ubv(index, v); + } + + /** + * Byte version of {@link #glVertexAttribI4uiv VertexAttribI4uiv}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI4ubv(@NativeType("GLuint") int index, @NativeType("GLbyte const *") ByteBuffer v) { + GL30C.glVertexAttribI4ubv(index, v); + } + + // --- [ glVertexAttribI4usv ] --- + + /** Unsafe version of: {@link #glVertexAttribI4usv VertexAttribI4usv} */ + public static void nglVertexAttribI4usv(int index, long v) { + GL30C.nglVertexAttribI4usv(index, v); + } + + /** + * Short version of {@link #glVertexAttribI4uiv VertexAttribI4uiv}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI4usv(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + GL30C.glVertexAttribI4usv(index, v); + } + + // --- [ glVertexAttribIPointer ] --- + + /** Unsafe version of: {@link #glVertexAttribIPointer VertexAttribIPointer} */ + public static void nglVertexAttribIPointer(int index, int size, int type, int stride, long pointer) { + GL30C.nglVertexAttribIPointer(index, size, type, stride, pointer); + } + + /** + * Specifies the location and organization of a pure integer vertex attribute array. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribIPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + GL30C.glVertexAttribIPointer(index, size, type, stride, pointer); + } + + /** + * Specifies the location and organization of a pure integer vertex attribute array. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribIPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + GL30C.glVertexAttribIPointer(index, size, type, stride, pointer); + } + + /** + * Specifies the location and organization of a pure integer vertex attribute array. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribIPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ShortBuffer pointer) { + GL30C.glVertexAttribIPointer(index, size, type, stride, pointer); + } + + /** + * Specifies the location and organization of a pure integer vertex attribute array. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribIPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") IntBuffer pointer) { + GL30C.glVertexAttribIPointer(index, size, type, stride, pointer); + } + + // --- [ glGetVertexAttribIiv ] --- + + /** Unsafe version of: {@link #glGetVertexAttribIiv GetVertexAttribIiv} */ + public static void nglGetVertexAttribIiv(int index, int pname, long params) { + GL30C.nglGetVertexAttribIiv(index, pname, params); + } + + /** + * Returns the value of a pure integer generic vertex attribute parameter. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param pname the symbolic name of the vertex attribute parameter to be queried. Must be:
{@link GL20#GL_CURRENT_VERTEX_ATTRIB CURRENT_VERTEX_ATTRIB}
+ * @param params returns the requested data + * + * @see Reference Page + */ + public static void glGetVertexAttribIiv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL30C.glGetVertexAttribIiv(index, pname, params); + } + + /** + * Returns the value of a pure integer generic vertex attribute parameter. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param pname the symbolic name of the vertex attribute parameter to be queried. Must be:
{@link GL20#GL_CURRENT_VERTEX_ATTRIB CURRENT_VERTEX_ATTRIB}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetVertexAttribIi(@NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + return GL30C.glGetVertexAttribIi(index, pname); + } + + // --- [ glGetVertexAttribIuiv ] --- + + /** Unsafe version of: {@link #glGetVertexAttribIuiv GetVertexAttribIuiv} */ + public static void nglGetVertexAttribIuiv(int index, int pname, long params) { + GL30C.nglGetVertexAttribIuiv(index, pname, params); + } + + /** + * Unsigned version of {@link #glGetVertexAttribIiv GetVertexAttribIiv}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param pname the symbolic name of the vertex attribute parameter to be queried. Must be:
{@link GL20#GL_CURRENT_VERTEX_ATTRIB CURRENT_VERTEX_ATTRIB}
+ * @param params returns the requested data + * + * @see Reference Page + */ + public static void glGetVertexAttribIuiv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLuint *") IntBuffer params) { + GL30C.glGetVertexAttribIuiv(index, pname, params); + } + + /** + * Unsigned version of {@link #glGetVertexAttribIiv GetVertexAttribIiv}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param pname the symbolic name of the vertex attribute parameter to be queried. Must be:
{@link GL20#GL_CURRENT_VERTEX_ATTRIB CURRENT_VERTEX_ATTRIB}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetVertexAttribIui(@NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + return GL30C.glGetVertexAttribIui(index, pname); + } + + // --- [ glUniform1ui ] --- + + /** + * Specifies the value of a uint uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform value + * + * @see Reference Page + */ + public static void glUniform1ui(@NativeType("GLint") int location, @NativeType("GLuint") int v0) { + GL30C.glUniform1ui(location, v0); + } + + // --- [ glUniform2ui ] --- + + /** + * Specifies the value of a uvec2 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform x value + * @param v1 the uniform y value + * + * @see Reference Page + */ + public static void glUniform2ui(@NativeType("GLint") int location, @NativeType("GLuint") int v0, @NativeType("GLuint") int v1) { + GL30C.glUniform2ui(location, v0, v1); + } + + // --- [ glUniform3ui ] --- + + /** + * Specifies the value of a uvec3 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform x value + * @param v1 the uniform y value + * @param v2 the uniform z value + * + * @see Reference Page + */ + public static void glUniform3ui(@NativeType("GLint") int location, @NativeType("GLuint") int v0, @NativeType("GLuint") int v1, @NativeType("GLuint") int v2) { + GL30C.glUniform3ui(location, v0, v1, v2); + } + + // --- [ glUniform4ui ] --- + + /** + * Specifies the value of a uvec4 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform x value + * @param v1 the uniform y value + * @param v2 the uniform z value + * @param v3 the uniform w value + * + * @see Reference Page + */ + public static void glUniform4ui(@NativeType("GLint") int location, @NativeType("GLuint") int v0, @NativeType("GLuint") int v1, @NativeType("GLuint") int v2, @NativeType("GLuint") int v3) { + GL30C.glUniform4ui(location, v0, v1, v2, v3); + } + + // --- [ glUniform1uiv ] --- + + /** + * Unsafe version of: {@link #glUniform1uiv Uniform1uiv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglUniform1uiv(int location, int count, long value) { + GL30C.nglUniform1uiv(location, count, value); + } + + /** + * Specifies the value of a single uint uniform variable or a uint uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform1uiv(@NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + GL30C.glUniform1uiv(location, value); + } + + // --- [ glUniform2uiv ] --- + + /** + * Unsafe version of: {@link #glUniform2uiv Uniform2uiv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglUniform2uiv(int location, int count, long value) { + GL30C.nglUniform2uiv(location, count, value); + } + + /** + * Specifies the value of a single uvec2 uniform variable or a uvec2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform2uiv(@NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + GL30C.glUniform2uiv(location, value); + } + + // --- [ glUniform3uiv ] --- + + /** + * Unsafe version of: {@link #glUniform3uiv Uniform3uiv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglUniform3uiv(int location, int count, long value) { + GL30C.nglUniform3uiv(location, count, value); + } + + /** + * Specifies the value of a single uvec3 uniform variable or a uvec3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform3uiv(@NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + GL30C.glUniform3uiv(location, value); + } + + // --- [ glUniform4uiv ] --- + + /** + * Unsafe version of: {@link #glUniform4uiv Uniform4uiv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglUniform4uiv(int location, int count, long value) { + GL30C.nglUniform4uiv(location, count, value); + } + + /** + * Specifies the value of a single uvec4 uniform variable or a uvec4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform4uiv(@NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + GL30C.glUniform4uiv(location, value); + } + + // --- [ glGetUniformuiv ] --- + + /** Unsafe version of: {@link #glGetUniformuiv GetUniformuiv} */ + public static void nglGetUniformuiv(int program, int location, long params) { + GL30C.nglGetUniformuiv(program, location, params); + } + + /** + * Returns the uint value(s) of a uniform variable. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * @param params the value of the specified uniform variable + * + * @see Reference Page + */ + public static void glGetUniformuiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint *") IntBuffer params) { + GL30C.glGetUniformuiv(program, location, params); + } + + /** + * Returns the uint value(s) of a uniform variable. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetUniformui(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + return GL30C.glGetUniformui(program, location); + } + + // --- [ glBindFragDataLocation ] --- + + /** Unsafe version of: {@link #glBindFragDataLocation BindFragDataLocation} */ + public static void nglBindFragDataLocation(int program, int colorNumber, long name) { + GL30C.nglBindFragDataLocation(program, colorNumber, name); + } + + /** + * Binds a user-defined varying out variable to a fragment shader color number. + * + * @param program the name of the program containing varying out variable whose binding to modify + * @param colorNumber the color number to bind the user-defined varying out variable to + * @param name the name of the user-defined varying out variable whose binding to modify + * + * @see Reference Page + */ + public static void glBindFragDataLocation(@NativeType("GLuint") int program, @NativeType("GLuint") int colorNumber, @NativeType("GLchar const *") ByteBuffer name) { + GL30C.glBindFragDataLocation(program, colorNumber, name); + } + + /** + * Binds a user-defined varying out variable to a fragment shader color number. + * + * @param program the name of the program containing varying out variable whose binding to modify + * @param colorNumber the color number to bind the user-defined varying out variable to + * @param name the name of the user-defined varying out variable whose binding to modify + * + * @see Reference Page + */ + public static void glBindFragDataLocation(@NativeType("GLuint") int program, @NativeType("GLuint") int colorNumber, @NativeType("GLchar const *") CharSequence name) { + GL30C.glBindFragDataLocation(program, colorNumber, name); + } + + // --- [ glGetFragDataLocation ] --- + + /** Unsafe version of: {@link #glGetFragDataLocation GetFragDataLocation} */ + public static int nglGetFragDataLocation(int program, long name) { + return GL30C.nglGetFragDataLocation(program, name); + } + + /** + * Queries the bindings of color numbers to user-defined varying out variables. + * + * @param program the name of the program containing varying out variable whose binding to query + * @param name the name of the user-defined varying out variable whose binding to query + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetFragDataLocation(@NativeType("GLuint") int program, @NativeType("GLchar const *") ByteBuffer name) { + return GL30C.glGetFragDataLocation(program, name); + } + + /** + * Queries the bindings of color numbers to user-defined varying out variables. + * + * @param program the name of the program containing varying out variable whose binding to query + * @param name the name of the user-defined varying out variable whose binding to query + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetFragDataLocation(@NativeType("GLuint") int program, @NativeType("GLchar const *") CharSequence name) { + return GL30C.glGetFragDataLocation(program, name); + } + + // --- [ glBeginConditionalRender ] --- + + /** + * Starts conditional rendering. + * + * @param id the name of an occlusion query object whose results are used to determine if the rendering commands are discarded + * @param mode how {@code glBeginConditionalRender} interprets the results of the occlusion query. One of:
{@link GL30C#GL_QUERY_WAIT QUERY_WAIT}{@link GL30C#GL_QUERY_NO_WAIT QUERY_NO_WAIT}{@link GL30C#GL_QUERY_BY_REGION_WAIT QUERY_BY_REGION_WAIT}
{@link GL30C#GL_QUERY_BY_REGION_NO_WAIT QUERY_BY_REGION_NO_WAIT}{@link GL45#GL_QUERY_WAIT_INVERTED QUERY_WAIT_INVERTED}{@link GL45#GL_QUERY_NO_WAIT_INVERTED QUERY_NO_WAIT_INVERTED}
{@link GL45#GL_QUERY_BY_REGION_WAIT_INVERTED QUERY_BY_REGION_WAIT_INVERTED}{@link GL45#GL_QUERY_BY_REGION_NO_WAIT_INVERTED QUERY_BY_REGION_NO_WAIT_INVERTED}
+ * + * @see Reference Page + */ + public static void glBeginConditionalRender(@NativeType("GLuint") int id, @NativeType("GLenum") int mode) { + GL30C.glBeginConditionalRender(id, mode); + } + + // --- [ glEndConditionalRender ] --- + + /** + * Ends conditional rendering. + * + * @see Reference Page + */ + public static void glEndConditionalRender() { + GL30C.glEndConditionalRender(); + } + + // --- [ glMapBufferRange ] --- + + /** Unsafe version of: {@link #glMapBufferRange MapBufferRange} */ + public static long nglMapBufferRange(int target, long offset, long length, int access) { + return GL30C.nglMapBufferRange(target, offset, length, access); + } + + /** + * Maps a section of a buffer object's data store. + * + *

LWJGL note: This method comes in 2 flavors:

+ * + *
    + *
  1. {@link #glMapBufferRange(int, long, long, int)} - Always returns a new ByteBuffer instance.
  2. + *
  3. {@link #glMapBufferRange(int, long, long, int, ByteBuffer)} - The {@code old_buffer} parameter is reused if not null.
  4. + *
+ * + * @param target a binding to which the target buffer is bound. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30C#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the starting offset within the buffer of the range to be mapped + * @param length the length of the range to be mapped + * @param access a combination of access flags indicating the desired access to the range. One or more of:
{@link GL30C#GL_MAP_READ_BIT MAP_READ_BIT}{@link GL30C#GL_MAP_WRITE_BIT MAP_WRITE_BIT}{@link GL30C#GL_MAP_INVALIDATE_RANGE_BIT MAP_INVALIDATE_RANGE_BIT}{@link GL30C#GL_MAP_INVALIDATE_BUFFER_BIT MAP_INVALIDATE_BUFFER_BIT}
{@link GL30C#GL_MAP_FLUSH_EXPLICIT_BIT MAP_FLUSH_EXPLICIT_BIT}{@link GL30C#GL_MAP_UNSYNCHRONIZED_BIT MAP_UNSYNCHRONIZED_BIT}
+ * + * @see Reference Page + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapBufferRange(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length, @NativeType("GLbitfield") int access) { + return GL30C.glMapBufferRange(target, offset, length, access); + } + + /** + * Maps a section of a buffer object's data store. + * + *

LWJGL note: This method comes in 2 flavors:

+ * + *
    + *
  1. {@link #glMapBufferRange(int, long, long, int)} - Always returns a new ByteBuffer instance.
  2. + *
  3. {@link #glMapBufferRange(int, long, long, int, ByteBuffer)} - The {@code old_buffer} parameter is reused if not null.
  4. + *
+ * + * @param target a binding to which the target buffer is bound. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30C#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the starting offset within the buffer of the range to be mapped + * @param length the length of the range to be mapped + * @param access a combination of access flags indicating the desired access to the range. One or more of:
{@link GL30C#GL_MAP_READ_BIT MAP_READ_BIT}{@link GL30C#GL_MAP_WRITE_BIT MAP_WRITE_BIT}{@link GL30C#GL_MAP_INVALIDATE_RANGE_BIT MAP_INVALIDATE_RANGE_BIT}{@link GL30C#GL_MAP_INVALIDATE_BUFFER_BIT MAP_INVALIDATE_BUFFER_BIT}
{@link GL30C#GL_MAP_FLUSH_EXPLICIT_BIT MAP_FLUSH_EXPLICIT_BIT}{@link GL30C#GL_MAP_UNSYNCHRONIZED_BIT MAP_UNSYNCHRONIZED_BIT}
+ * + * @see Reference Page + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapBufferRange(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length, @NativeType("GLbitfield") int access, @Nullable ByteBuffer old_buffer) { + return GL30C.glMapBufferRange(target, offset, length, access, old_buffer); + } + + // --- [ glFlushMappedBufferRange ] --- + + /** + * Indicates modifications to a range of a mapped buffer. + * + * @param target the target of the flush operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30C#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the start of the buffer subrange, in basic machine units + * @param length the length of the buffer subrange, in basic machine units + * + * @see Reference Page + */ + public static void glFlushMappedBufferRange(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length) { + GL30C.glFlushMappedBufferRange(target, offset, length); + } + + // --- [ glClampColor ] --- + + /** + * Controls color clamping. + * + * @param target target for color clamping. Must be:
{@link GL30C#GL_CLAMP_READ_COLOR CLAMP_READ_COLOR}
+ * @param clamp whether to apply color clamping. One of:
{@link GL11#GL_TRUE TRUE}{@link GL11#GL_FALSE FALSE}{@link GL30C#GL_FIXED_ONLY FIXED_ONLY}
+ * + * @see Reference Page + */ + public static void glClampColor(@NativeType("GLenum") int target, @NativeType("GLenum") int clamp) { + GL30C.glClampColor(target, clamp); + } + + // --- [ glIsRenderbuffer ] --- + + /** + * Determines if a name corresponds to a renderbuffer object. + * + * @param renderbuffer a value that may be the name of a renderbuffer object + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static boolean glIsRenderbuffer(@NativeType("GLuint") int renderbuffer) { + return GL30C.glIsRenderbuffer(renderbuffer); + } + + // --- [ glBindRenderbuffer ] --- + + /** + * Binds a renderbuffer to a renderbuffer target. + * + * @param target the renderbuffer target of the binding operation. Must be:
{@link GL30C#GL_RENDERBUFFER RENDERBUFFER}
+ * @param renderbuffer the name of the renderbuffer object to bind + * + * @see Reference Page + */ + public static void glBindRenderbuffer(@NativeType("GLenum") int target, @NativeType("GLuint") int renderbuffer) { + GL30C.glBindRenderbuffer(target, renderbuffer); + } + + // --- [ glDeleteRenderbuffers ] --- + + /** + * Unsafe version of: {@link #glDeleteRenderbuffers DeleteRenderbuffers} + * + * @param n the number of renderbuffer objects to be deleted + */ + public static void nglDeleteRenderbuffers(int n, long renderbuffers) { + GL30C.nglDeleteRenderbuffers(n, renderbuffers); + } + + /** + * Deletes renderbuffer objects. + * + * @param renderbuffers an array containing {@code n} renderbuffer objects to be deleted + * + * @see Reference Page + */ + public static void glDeleteRenderbuffers(@NativeType("GLuint const *") IntBuffer renderbuffers) { + GL30C.glDeleteRenderbuffers(renderbuffers); + } + + /** + * Deletes renderbuffer objects. + * + * @see Reference Page + */ + public static void glDeleteRenderbuffers(@NativeType("GLuint const *") int renderbuffer) { + GL30C.glDeleteRenderbuffers(renderbuffer); + } + + // --- [ glGenRenderbuffers ] --- + + /** + * Unsafe version of: {@link #glGenRenderbuffers GenRenderbuffers} + * + * @param n the number of renderbuffer object names to generate + */ + public static void nglGenRenderbuffers(int n, long renderbuffers) { + GL30C.nglGenRenderbuffers(n, renderbuffers); + } + + /** + * Generates renderbuffer object names. + * + * @param renderbuffers a buffer in which the generated renderbuffer object names are stored + * + * @see Reference Page + */ + public static void glGenRenderbuffers(@NativeType("GLuint *") IntBuffer renderbuffers) { + GL30C.glGenRenderbuffers(renderbuffers); + } + + /** + * Generates renderbuffer object names. + * + * @see Reference Page + */ + @NativeType("void") + public static int glGenRenderbuffers() { + return GL30C.glGenRenderbuffers(); + } + + // --- [ glRenderbufferStorage ] --- + + /** + * Establishes data storage, format and dimensions of a renderbuffer object's image. + * + * @param target the target of the allocation. Must be:
{@link GL30C#GL_RENDERBUFFER RENDERBUFFER}
+ * @param internalformat the internal format to use for the renderbuffer object's image. Must be a color-renderable, depth-renderable, or stencil-renderable format. + * @param width the width of the renderbuffer, in pixels + * @param height the height of the renderbuffer, in pixels + * + * @see Reference Page + */ + public static void glRenderbufferStorage(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL30C.glRenderbufferStorage(target, internalformat, width, height); + } + + // --- [ glRenderbufferStorageMultisample ] --- + + /** + * Establishes data storage, format, dimensions and sample count of a renderbuffer object's image. + * + *

{@link #glRenderbufferStorage RenderbufferStorage} is equivalent to calling this method with the samples set to zero.

+ * + * @param target the target of the allocation. Must be:
{@link GL30C#GL_RENDERBUFFER RENDERBUFFER}
+ * @param samples the number of samples to be used for the renderbuffer object's storage + * @param internalformat the internal format to use for the renderbuffer object's image. Must be a color-renderable, depth-renderable, or stencil-renderable format. + * @param width the width of the renderbuffer, in pixels + * @param height the height of the renderbuffer, in pixels + * + * @see Reference Page + */ + public static void glRenderbufferStorageMultisample(@NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL30C.glRenderbufferStorageMultisample(target, samples, internalformat, width, height); + } + + // --- [ glGetRenderbufferParameteriv ] --- + + /** Unsafe version of: {@link #glGetRenderbufferParameteriv GetRenderbufferParameteriv} */ + public static void nglGetRenderbufferParameteriv(int target, int pname, long params) { + GL30C.nglGetRenderbufferParameteriv(target, pname, params); + } + + /** + * Retrieves information about a bound renderbuffer object. + * + * @param target the target of the query operation. Must be:
{@link GL30C#GL_RENDERBUFFER RENDERBUFFER}
+ * @param pname the parameter whose value to retrieve from the renderbuffer bound to {@code target}. One of:
{@link GL30C#GL_RENDERBUFFER_WIDTH RENDERBUFFER_WIDTH}{@link GL30C#GL_RENDERBUFFER_HEIGHT RENDERBUFFER_HEIGHT}{@link GL30C#GL_RENDERBUFFER_INTERNAL_FORMAT RENDERBUFFER_INTERNAL_FORMAT}
{@link GL30C#GL_RENDERBUFFER_RED_SIZE RENDERBUFFER_RED_SIZE}{@link GL30C#GL_RENDERBUFFER_GREEN_SIZE RENDERBUFFER_GREEN_SIZE}{@link GL30C#GL_RENDERBUFFER_BLUE_SIZE RENDERBUFFER_BLUE_SIZE}
{@link GL30C#GL_RENDERBUFFER_ALPHA_SIZE RENDERBUFFER_ALPHA_SIZE}{@link GL30C#GL_RENDERBUFFER_DEPTH_SIZE RENDERBUFFER_DEPTH_SIZE}{@link GL30C#GL_RENDERBUFFER_STENCIL_SIZE RENDERBUFFER_STENCIL_SIZE}
{@link GL30C#GL_RENDERBUFFER_SAMPLES RENDERBUFFER_SAMPLES}
+ * @param params an array to receive the value of the queried parameter + * + * @see Reference Page + */ + public static void glGetRenderbufferParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL30C.glGetRenderbufferParameteriv(target, pname, params); + } + + /** + * Retrieves information about a bound renderbuffer object. + * + * @param target the target of the query operation. Must be:
{@link GL30C#GL_RENDERBUFFER RENDERBUFFER}
+ * @param pname the parameter whose value to retrieve from the renderbuffer bound to {@code target}. One of:
{@link GL30C#GL_RENDERBUFFER_WIDTH RENDERBUFFER_WIDTH}{@link GL30C#GL_RENDERBUFFER_HEIGHT RENDERBUFFER_HEIGHT}{@link GL30C#GL_RENDERBUFFER_INTERNAL_FORMAT RENDERBUFFER_INTERNAL_FORMAT}
{@link GL30C#GL_RENDERBUFFER_RED_SIZE RENDERBUFFER_RED_SIZE}{@link GL30C#GL_RENDERBUFFER_GREEN_SIZE RENDERBUFFER_GREEN_SIZE}{@link GL30C#GL_RENDERBUFFER_BLUE_SIZE RENDERBUFFER_BLUE_SIZE}
{@link GL30C#GL_RENDERBUFFER_ALPHA_SIZE RENDERBUFFER_ALPHA_SIZE}{@link GL30C#GL_RENDERBUFFER_DEPTH_SIZE RENDERBUFFER_DEPTH_SIZE}{@link GL30C#GL_RENDERBUFFER_STENCIL_SIZE RENDERBUFFER_STENCIL_SIZE}
{@link GL30C#GL_RENDERBUFFER_SAMPLES RENDERBUFFER_SAMPLES}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetRenderbufferParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + return GL30C.glGetRenderbufferParameteri(target, pname); + } + + // --- [ glIsFramebuffer ] --- + + /** + * Determines if a name corresponds to a framebuffer object. + * + * @param framebuffer a value that may be the name of a framebuffer object + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static boolean glIsFramebuffer(@NativeType("GLuint") int framebuffer) { + return GL30C.glIsFramebuffer(framebuffer); + } + + // --- [ glBindFramebuffer ] --- + + /** + * Binds a framebuffer to a framebuffer target. + * + * @param target the framebuffer target of the binding operation. One of:
{@link GL30C#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30C#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30C#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param framebuffer the name of the framebuffer object to bind + * + * @see Reference Page + */ + public static void glBindFramebuffer(@NativeType("GLenum") int target, @NativeType("GLuint") int framebuffer) { + GL30C.glBindFramebuffer(target, framebuffer); + } + + // --- [ glDeleteFramebuffers ] --- + + /** + * Unsafe version of: {@link #glDeleteFramebuffers DeleteFramebuffers} + * + * @param n the number of framebuffer objects to be deleted + */ + public static void nglDeleteFramebuffers(int n, long framebuffers) { + GL30C.nglDeleteFramebuffers(n, framebuffers); + } + + /** + * Deletes framebuffer objects. + * + * @param framebuffers an array containing {@code n} framebuffer objects to be deleted + * + * @see Reference Page + */ + public static void glDeleteFramebuffers(@NativeType("GLuint const *") IntBuffer framebuffers) { + GL30C.glDeleteFramebuffers(framebuffers); + } + + /** + * Deletes framebuffer objects. + * + * @see Reference Page + */ + public static void glDeleteFramebuffers(@NativeType("GLuint const *") int framebuffer) { + GL30C.glDeleteFramebuffers(framebuffer); + } + + // --- [ glGenFramebuffers ] --- + + /** + * Unsafe version of: {@link #glGenFramebuffers GenFramebuffers} + * + * @param n the number of framebuffer object names to generate + */ + public static void nglGenFramebuffers(int n, long framebuffers) { + GL30C.nglGenFramebuffers(n, framebuffers); + } + + /** + * Generates framebuffer object names. + * + * @param framebuffers a buffer in which the generated framebuffer object names are stored + * + * @see Reference Page + */ + public static void glGenFramebuffers(@NativeType("GLuint *") IntBuffer framebuffers) { + GL30C.glGenFramebuffers(framebuffers); + } + + /** + * Generates framebuffer object names. + * + * @see Reference Page + */ + @NativeType("void") + public static int glGenFramebuffers() { + return GL30C.glGenFramebuffers(); + } + + // --- [ glCheckFramebufferStatus ] --- + + /** + * Checks the completeness status of a framebuffer. + * + * @param target the target of the framebuffer completeness check. One of:
{@link GL30C#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30C#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30C#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * + * @see Reference Page + */ + @NativeType("GLenum") + public static int glCheckFramebufferStatus(@NativeType("GLenum") int target) { + return GL30C.glCheckFramebufferStatus(target); + } + + // --- [ glFramebufferTexture1D ] --- + + /** + * Attaches a level of a 1D texture object as a logical buffer to the currently bound framebuffer object. + * + * @param target the framebuffer target. One of:
{@link GL30C#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30C#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30C#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment point of the framebuffer. One of:
{@link GL30C#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30C#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30C#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30C#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30C#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30C#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30C#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30C#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30C#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30C#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30C#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30C#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30C#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30C#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30C#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30C#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30C#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30C#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30C#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30C#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30C#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30C#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30C#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30C#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30C#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30C#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30C#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30C#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30C#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30C#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30C#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30C#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30C#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30C#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30C#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param textarget the type of texture + * @param texture the texture object to attach to the framebuffer attachment point named by {@code attachment} + * @param level the mipmap level of {@code texture} to attach + * + * @see Reference Page + */ + public static void glFramebufferTexture1D(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int textarget, @NativeType("GLuint") int texture, @NativeType("GLint") int level) { + GL30C.glFramebufferTexture1D(target, attachment, textarget, texture, level); + } + + // --- [ glFramebufferTexture2D ] --- + + /** + * Attaches a level of a 2D texture object as a logical buffer to the currently bound framebuffer object. + * + * @param target the framebuffer target. One of:
{@link GL30C#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30C#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30C#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment point of the framebuffer. One of:
{@link GL30C#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30C#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30C#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30C#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30C#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30C#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30C#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30C#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30C#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30C#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30C#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30C#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30C#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30C#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30C#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30C#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30C#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30C#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30C#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30C#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30C#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30C#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30C#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30C#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30C#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30C#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30C#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30C#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30C#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30C#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30C#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30C#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30C#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30C#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30C#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param textarget the type of texture + * @param texture the texture object to attach to the framebuffer attachment point named by {@code attachment} + * @param level the mipmap level of {@code texture} to attach + * + * @see Reference Page + */ + public static void glFramebufferTexture2D(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int textarget, @NativeType("GLuint") int texture, @NativeType("GLint") int level) { + GL30C.glFramebufferTexture2D(target, attachment, textarget, texture, level); + } + + // --- [ glFramebufferTexture3D ] --- + + /** + * Attaches a layer of a 3D texture object as a logical buffer to the currently bound framebuffer object. + * + * @param target the framebuffer target. One of:
{@link GL30C#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30C#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30C#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment point of the framebuffer. One of:
{@link GL30C#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30C#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30C#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30C#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30C#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30C#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30C#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30C#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30C#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30C#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30C#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30C#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30C#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30C#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30C#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30C#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30C#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30C#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30C#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30C#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30C#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30C#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30C#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30C#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30C#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30C#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30C#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30C#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30C#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30C#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30C#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30C#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30C#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30C#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30C#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param textarget the type of texture + * @param texture the texture object to attach to the framebuffer attachment point named by {@code attachment} + * @param level the mipmap level of {@code texture} to attach + * @param layer the layer of a 2-dimensional image within the 3-dimensional texture. + * + * @see Reference Page + */ + public static void glFramebufferTexture3D(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int textarget, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int layer) { + GL30C.glFramebufferTexture3D(target, attachment, textarget, texture, level, layer); + } + + // --- [ glFramebufferTextureLayer ] --- + + /** + * Attaches a single layer of a texture to a framebuffer + * + * @param target the framebuffer target. One of:
{@link GL30C#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30C#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30C#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment point of the framebuffer. One of:
{@link GL30C#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30C#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30C#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30C#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30C#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30C#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30C#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30C#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30C#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30C#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30C#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30C#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30C#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30C#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30C#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30C#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30C#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30C#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30C#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30C#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30C#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30C#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30C#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30C#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30C#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30C#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30C#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30C#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30C#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30C#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30C#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30C#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30C#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30C#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30C#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param texture the texture object to attach to the framebuffer attachment point named by {@code attachment} + * @param level the mipmap level of {@code texture} to attach + * @param layer the layer of {@code texture} to attach. + * + * @see Reference Page + */ + public static void glFramebufferTextureLayer(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int layer) { + GL30C.glFramebufferTextureLayer(target, attachment, texture, level, layer); + } + + // --- [ glFramebufferRenderbuffer ] --- + + /** + * Attaches a renderbuffer as a logical buffer to the currently bound framebuffer object. + * + * @param target the framebuffer target. One of:
{@link GL30C#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30C#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30C#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment point of the framebuffer. One of:
{@link GL30C#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30C#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30C#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30C#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30C#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30C#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30C#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30C#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30C#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30C#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30C#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30C#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30C#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30C#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30C#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30C#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30C#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30C#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30C#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30C#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30C#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30C#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30C#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30C#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30C#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30C#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30C#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30C#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30C#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30C#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30C#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30C#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30C#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30C#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30C#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param renderbuffertarget the renderbuffer target. Must be:
{@link GL30C#GL_RENDERBUFFER RENDERBUFFER}
+ * @param renderbuffer the name of an existing renderbuffer object of type {@code renderbuffertarget} to attach + * + * @see Reference Page + */ + public static void glFramebufferRenderbuffer(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int renderbuffertarget, @NativeType("GLuint") int renderbuffer) { + GL30C.glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer); + } + + // --- [ glGetFramebufferAttachmentParameteriv ] --- + + /** Unsafe version of: {@link #glGetFramebufferAttachmentParameteriv GetFramebufferAttachmentParameteriv} */ + public static void nglGetFramebufferAttachmentParameteriv(int target, int attachment, int pname, long params) { + GL30C.nglGetFramebufferAttachmentParameteriv(target, attachment, pname, params); + } + + /** + * Retrievees information about attachments of a bound framebuffer object. + * + * @param target the target of the query operation. One of:
{@link GL30C#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30C#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30C#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment within {@code target}. One of:
{@link GL30C#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30C#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30C#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30C#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30C#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30C#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30C#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30C#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30C#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30C#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30C#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30C#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30C#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30C#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30C#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30C#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30C#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30C#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30C#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30C#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30C#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30C#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30C#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30C#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30C#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30C#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30C#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30C#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30C#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30C#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30C#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30C#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30C#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30C#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30C#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param pname the parameter of {@code attachment} to query. One of:
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME FRAMEBUFFER_ATTACHMENT_OBJECT_NAME}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE FRAMEBUFFER_ATTACHMENT_RED_SIZE}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE FRAMEBUFFER_ATTACHMENT_GREEN_SIZE}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE FRAMEBUFFER_ATTACHMENT_BLUE_SIZE}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE}
+ * @param params an array to receive the value of the queried parameter + * + * @see Reference Page + */ + public static void glGetFramebufferAttachmentParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL30C.glGetFramebufferAttachmentParameteriv(target, attachment, pname, params); + } + + /** + * Retrievees information about attachments of a bound framebuffer object. + * + * @param target the target of the query operation. One of:
{@link GL30C#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30C#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30C#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment within {@code target}. One of:
{@link GL30C#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30C#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30C#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30C#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30C#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30C#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30C#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30C#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30C#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30C#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30C#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30C#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30C#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30C#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30C#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30C#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30C#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30C#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30C#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30C#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30C#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30C#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30C#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30C#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30C#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30C#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30C#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30C#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30C#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30C#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30C#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30C#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30C#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30C#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30C#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param pname the parameter of {@code attachment} to query. One of:
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME FRAMEBUFFER_ATTACHMENT_OBJECT_NAME}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE FRAMEBUFFER_ATTACHMENT_RED_SIZE}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE FRAMEBUFFER_ATTACHMENT_GREEN_SIZE}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE FRAMEBUFFER_ATTACHMENT_BLUE_SIZE}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE}{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE}
{@link GL30C#GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetFramebufferAttachmentParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname) { + return GL30C.glGetFramebufferAttachmentParameteri(target, attachment, pname); + } + + // --- [ glBlitFramebuffer ] --- + + /** + * Copies a block of pixels from the read framebuffer to the draw framebuffer. + * + * @param srcX0 the lower-left coordinate of the source rectangle within the read buffer + * @param srcY0 the upper-left coordinate of the source rectangle within the read buffer + * @param srcX1 the lower-right coordinate of the source rectangle within the read buffer + * @param srcY1 the upper-right coordinate of the source rectangle within the read buffer + * @param dstX0 the lower-left coordinate of the destination rectangle within the write buffer + * @param dstY0 the upper-left coordinate of the destination rectangle within the write buffer + * @param dstX1 the lower-right coordinate of the destination rectangle within the write buffer + * @param dstY1 the upper-right coordinate of the destination rectangle within the write buffer + * @param mask the bitwise OR of the flags indicating which buffers are to be copied. One of:
{@link GL11#GL_COLOR_BUFFER_BIT COLOR_BUFFER_BIT}{@link GL11#GL_DEPTH_BUFFER_BIT DEPTH_BUFFER_BIT}{@link GL11#GL_STENCIL_BUFFER_BIT STENCIL_BUFFER_BIT}
+ * @param filter the interpolation to be applied if the image is stretched. One of:
{@link GL11#GL_NEAREST NEAREST}{@link GL11#GL_LINEAR LINEAR}
+ * + * @see Reference Page + */ + public static void glBlitFramebuffer(@NativeType("GLint") int srcX0, @NativeType("GLint") int srcY0, @NativeType("GLint") int srcX1, @NativeType("GLint") int srcY1, @NativeType("GLint") int dstX0, @NativeType("GLint") int dstY0, @NativeType("GLint") int dstX1, @NativeType("GLint") int dstY1, @NativeType("GLbitfield") int mask, @NativeType("GLenum") int filter) { + GL30C.glBlitFramebuffer(srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); + } + + // --- [ glGenerateMipmap ] --- + + /** + * Generate mipmaps for a specified texture target. + * + * @param target the target to which the texture whose mimaps to generate is bound. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30C#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL30C#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * + * @see Reference Page + */ + public static void glGenerateMipmap(@NativeType("GLenum") int target) { + GL30C.glGenerateMipmap(target); + } + + // --- [ glTexParameterIiv ] --- + + /** Unsafe version of: {@link #glTexParameterIiv TexParameterIiv} */ + public static void nglTexParameterIiv(int target, int pname, long params) { + GL30C.nglTexParameterIiv(target, pname, params); + } + + /** + * Sets the integer value of a texture parameter. + * + * @param target the texture target + * @param pname the symbolic name of a single-valued texture parameter + * @param params the value of {@code pname} + * + * @see Reference Page + */ + public static void glTexParameterIiv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + GL30C.glTexParameterIiv(target, pname, params); + } + + /** + * Sets the integer value of a texture parameter. + * + * @param target the texture target + * @param pname the symbolic name of a single-valued texture parameter + * + * @see Reference Page + */ + public static void glTexParameterIi(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") int param) { + GL30C.glTexParameterIi(target, pname, param); + } + + // --- [ glTexParameterIuiv ] --- + + /** Unsafe version of: {@link #glTexParameterIuiv TexParameterIuiv} */ + public static void nglTexParameterIuiv(int target, int pname, long params) { + GL30C.nglTexParameterIuiv(target, pname, params); + } + + /** + * Sets the unsigned integer value of a texture parameter. + * + * @param target the texture target + * @param pname the symbolic name of a single-valued texture parameter + * @param params the value of {@code pname} + * + * @see Reference Page + */ + public static void glTexParameterIuiv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint const *") IntBuffer params) { + GL30C.glTexParameterIuiv(target, pname, params); + } + + /** + * Sets the unsigned integer value of a texture parameter. + * + * @param target the texture target + * @param pname the symbolic name of a single-valued texture parameter + * + * @see Reference Page + */ + public static void glTexParameterIui(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint const *") int param) { + GL30C.glTexParameterIui(target, pname, param); + } + + // --- [ glGetTexParameterIiv ] --- + + /** Unsafe version of: {@link #glGetTexParameterIiv GetTexParameterIiv} */ + public static void nglGetTexParameterIiv(int target, int pname, long params) { + GL30C.nglGetTexParameterIiv(target, pname, params); + } + + /** + * Returns the integer value of a texture parameter. + * + * @param target the texture target + * @param pname the symbolic name of a texture parameter + * @param params returns the texture parameter value + * + * @see Reference Page + */ + public static void glGetTexParameterIiv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL30C.glGetTexParameterIiv(target, pname, params); + } + + /** + * Returns the integer value of a texture parameter. + * + * @param target the texture target + * @param pname the symbolic name of a texture parameter + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetTexParameterIi(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + return GL30C.glGetTexParameterIi(target, pname); + } + + // --- [ glGetTexParameterIuiv ] --- + + /** Unsafe version of: {@link #glGetTexParameterIuiv GetTexParameterIuiv} */ + public static void nglGetTexParameterIuiv(int target, int pname, long params) { + GL30C.nglGetTexParameterIuiv(target, pname, params); + } + + /** + * Returns the unsigned integer value of a texture parameter. + * + * @param target the texture target + * @param pname the symbolic name of a texture parameter + * @param params returns the texture parameter value + * + * @see Reference Page + */ + public static void glGetTexParameterIuiv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint *") IntBuffer params) { + GL30C.glGetTexParameterIuiv(target, pname, params); + } + + /** + * Returns the unsigned integer value of a texture parameter. + * + * @param target the texture target + * @param pname the symbolic name of a texture parameter + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetTexParameterIui(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + return GL30C.glGetTexParameterIui(target, pname); + } + + // --- [ glColorMaski ] --- + + /** + * Enables and disables writing of frame buffer color components. + * + * @param buf the index of the draw buffer whose color mask to set + * @param r whether R values are written or not + * @param g whether G values are written or not + * @param b whether B values are written or not + * @param a whether A values are written or not + * + * @see Reference Page + */ + public static void glColorMaski(@NativeType("GLuint") int buf, @NativeType("GLboolean") boolean r, @NativeType("GLboolean") boolean g, @NativeType("GLboolean") boolean b, @NativeType("GLboolean") boolean a) { + GL30C.glColorMaski(buf, r, g, b, a); + } + + // --- [ glGetBooleani_v ] --- + + /** Unsafe version of: {@link #glGetBooleani_v GetBooleani_v} */ + public static void nglGetBooleani_v(int target, int index, long data) { + GL30C.nglGetBooleani_v(target, index, data); + } + + /** + * Queries the boolean value of an indexed state variable. + * + * @param target the indexed state to query + * @param index the index of the element being queried + * @param data a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetBooleani_v(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLboolean *") ByteBuffer data) { + GL30C.glGetBooleani_v(target, index, data); + } + + /** + * Queries the boolean value of an indexed state variable. + * + * @param target the indexed state to query + * @param index the index of the element being queried + * + * @see Reference Page + */ + @NativeType("void") + public static boolean glGetBooleani(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + return GL30C.glGetBooleani(target, index); + } + + // --- [ glGetIntegeri_v ] --- + + /** Unsafe version of: {@link #glGetIntegeri_v GetIntegeri_v} */ + public static void nglGetIntegeri_v(int target, int index, long data) { + GL30C.nglGetIntegeri_v(target, index, data); + } + + /** + * Queries the integer value of an indexed state variable. + * + * @param target the indexed state to query + * @param index the index of the element being queried + * @param data a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetIntegeri_v(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLint *") IntBuffer data) { + GL30C.glGetIntegeri_v(target, index, data); + } + + /** + * Queries the integer value of an indexed state variable. + * + * @param target the indexed state to query + * @param index the index of the element being queried + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetIntegeri(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + return GL30C.glGetIntegeri(target, index); + } + + // --- [ glEnablei ] --- + + /** + * Enables an indexed capability. + * + * @param cap the indexed capability to enable + * @param index the index to enable + * + * @see Reference Page + */ + public static void glEnablei(@NativeType("GLenum") int cap, @NativeType("GLuint") int index) { + GL30C.glEnablei(cap, index); + } + + // --- [ glDisablei ] --- + + /** + * Disables an indexed capability. + * + * @param target the indexed capability to disable + * @param index the index to disable + * + * @see Reference Page + */ + public static void glDisablei(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + GL30C.glDisablei(target, index); + } + + // --- [ glIsEnabledi ] --- + + /** + * Tests whether an indexed capability is enabled. + * + * @param target the indexed capability to query + * @param index the index to query + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static boolean glIsEnabledi(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + return GL30C.glIsEnabledi(target, index); + } + + // --- [ glBindBufferRange ] --- + + /** + * Binds a range within a buffer object to an indexed buffer target. + * + * @param target the target of the bind operation. One of:
{@link GL30C#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}
+ * @param index the index of the binding point within the array specified by {@code target} + * @param buffer a buffer object to bind to the specified binding point + * @param offset the starting offset in basic machine units into the buffer object {@code buffer} + * @param size the amount of data in machine units that can be read from the buffer object while used as an indexed target + * + * @see Reference Page + */ + public static void glBindBufferRange(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size) { + GL30C.glBindBufferRange(target, index, buffer, offset, size); + } + + // --- [ glBindBufferBase ] --- + + /** + * Binds a buffer object to an indexed buffer target. + * + * @param target the target of the bind operation. One of:
{@link GL30C#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}
+ * @param index the index of the binding point within the array specified by {@code target} + * @param buffer a buffer object to bind to the specified binding point + * + * @see Reference Page + */ + public static void glBindBufferBase(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLuint") int buffer) { + GL30C.glBindBufferBase(target, index, buffer); + } + + // --- [ glBeginTransformFeedback ] --- + + /** + * Starts transform feedback operation. + * + * @param primitiveMode the output type of the primitives that will be recorded into the buffer objects that are bound for transform feedback. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLES TRIANGLES}
+ * + * @see Reference Page + */ + public static void glBeginTransformFeedback(@NativeType("GLenum") int primitiveMode) { + GL30C.glBeginTransformFeedback(primitiveMode); + } + + // --- [ glEndTransformFeedback ] --- + + /** + * Ends transform feedback operation. + * + * @see Reference Page + */ + public static void glEndTransformFeedback() { + GL30C.glEndTransformFeedback(); + } + + // --- [ glTransformFeedbackVaryings ] --- + + /** + * Unsafe version of: {@link #glTransformFeedbackVaryings TransformFeedbackVaryings} + * + * @param count the number of varying variables used for transform feedback + */ + public static void nglTransformFeedbackVaryings(int program, int count, long varyings, int bufferMode) { + GL30C.nglTransformFeedbackVaryings(program, count, varyings, bufferMode); + } + + /** + * Specifies values to record in transform feedback buffers. + * + * @param program the target program object + * @param varyings an array of {@code count} zero-terminated strings specifying the names of the varying variables to use for transform feedback + * @param bufferMode the mode used to capture the varying variables when transform feedback is active. One of:
{@link GL30C#GL_INTERLEAVED_ATTRIBS INTERLEAVED_ATTRIBS}{@link GL30C#GL_SEPARATE_ATTRIBS SEPARATE_ATTRIBS}
+ * + * @see Reference Page + */ + public static void glTransformFeedbackVaryings(@NativeType("GLuint") int program, @NativeType("GLchar const **") PointerBuffer varyings, @NativeType("GLenum") int bufferMode) { + GL30C.glTransformFeedbackVaryings(program, varyings, bufferMode); + } + + /** + * Specifies values to record in transform feedback buffers. + * + * @param program the target program object + * @param varyings an array of {@code count} zero-terminated strings specifying the names of the varying variables to use for transform feedback + * @param bufferMode the mode used to capture the varying variables when transform feedback is active. One of:
{@link GL30C#GL_INTERLEAVED_ATTRIBS INTERLEAVED_ATTRIBS}{@link GL30C#GL_SEPARATE_ATTRIBS SEPARATE_ATTRIBS}
+ * + * @see Reference Page + */ + public static void glTransformFeedbackVaryings(@NativeType("GLuint") int program, @NativeType("GLchar const **") CharSequence[] varyings, @NativeType("GLenum") int bufferMode) { + GL30C.glTransformFeedbackVaryings(program, varyings, bufferMode); + } + + /** + * Specifies values to record in transform feedback buffers. + * + * @param program the target program object + * @param bufferMode the mode used to capture the varying variables when transform feedback is active. One of:
{@link GL30C#GL_INTERLEAVED_ATTRIBS INTERLEAVED_ATTRIBS}{@link GL30C#GL_SEPARATE_ATTRIBS SEPARATE_ATTRIBS}
+ * + * @see Reference Page + */ + public static void glTransformFeedbackVaryings(@NativeType("GLuint") int program, @NativeType("GLchar const **") CharSequence varying, @NativeType("GLenum") int bufferMode) { + GL30C.glTransformFeedbackVaryings(program, varying, bufferMode); + } + + // --- [ glGetTransformFeedbackVarying ] --- + + /** + * Unsafe version of: {@link #glGetTransformFeedbackVarying GetTransformFeedbackVarying} + * + * @param bufSize the maximum number of characters, including the null terminator, that may be written into {@code name} + */ + public static void nglGetTransformFeedbackVarying(int program, int index, int bufSize, long length, long size, long type, long name) { + GL30C.nglGetTransformFeedbackVarying(program, index, bufSize, length, size, type, name); + } + + /** + * Retrieves information about varying variables selected for transform feedback. + * + * @param program the target program object + * @param index the index of the varying variable whose information to retrieve + * @param length a variable which will receive the number of characters written into {@code name}, excluding the null-terminator. If {@code length} is NULL no length is returned. + * @param size a variable that will receive the size of the varying + * @param type a variable that will receive the type of the varying + * @param name a buffer into which will be written the name of the varying + * + * @see Reference Page + */ + public static void glGetTransformFeedbackVarying(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLsizei *") IntBuffer size, @NativeType("GLenum *") IntBuffer type, @NativeType("GLchar *") ByteBuffer name) { + GL30C.glGetTransformFeedbackVarying(program, index, length, size, type, name); + } + + /** + * Retrieves information about varying variables selected for transform feedback. + * + * @param program the target program object + * @param index the index of the varying variable whose information to retrieve + * @param bufSize the maximum number of characters, including the null terminator, that may be written into {@code name} + * @param size a variable that will receive the size of the varying + * @param type a variable that will receive the type of the varying + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetTransformFeedbackVarying(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @NativeType("GLsizei") int bufSize, @NativeType("GLsizei *") IntBuffer size, @NativeType("GLenum *") IntBuffer type) { + return GL30C.glGetTransformFeedbackVarying(program, index, bufSize, size, type); + } + + /** + * Retrieves information about varying variables selected for transform feedback. + * + * @param program the target program object + * @param index the index of the varying variable whose information to retrieve + * @param size a variable that will receive the size of the varying + * @param type a variable that will receive the type of the varying + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetTransformFeedbackVarying(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @NativeType("GLsizei *") IntBuffer size, @NativeType("GLenum *") IntBuffer type) { + return glGetTransformFeedbackVarying(program, index, GL20.glGetProgrami(program, GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH), size, type); + } + + // --- [ glBindVertexArray ] --- + + /** + * Binds a vertex array object + * + * @param array the name of the vertex array to bind + * + * @see Reference Page + */ + public static void glBindVertexArray(@NativeType("GLuint") int array) { + GL30C.glBindVertexArray(array); + } + + // --- [ glDeleteVertexArrays ] --- + + /** + * Unsafe version of: {@link #glDeleteVertexArrays DeleteVertexArrays} + * + * @param n the number of vertex array objects to be deleted + */ + public static void nglDeleteVertexArrays(int n, long arrays) { + GL30C.nglDeleteVertexArrays(n, arrays); + } + + /** + * Deletes vertex array objects. + * + * @param arrays an array containing the n names of the objects to be deleted + * + * @see Reference Page + */ + public static void glDeleteVertexArrays(@NativeType("GLuint const *") IntBuffer arrays) { + GL30C.glDeleteVertexArrays(arrays); + } + + /** + * Deletes vertex array objects. + * + * @see Reference Page + */ + public static void glDeleteVertexArrays(@NativeType("GLuint const *") int array) { + GL30C.glDeleteVertexArrays(array); + } + + // --- [ glGenVertexArrays ] --- + + /** + * Unsafe version of: {@link #glGenVertexArrays GenVertexArrays} + * + * @param n the number of vertex array object names to generate + */ + public static void nglGenVertexArrays(int n, long arrays) { + GL30C.nglGenVertexArrays(n, arrays); + } + + /** + * Generates vertex array object names. + * + * @param arrays a buffer in which the generated vertex array object names are stored + * + * @see Reference Page + */ + public static void glGenVertexArrays(@NativeType("GLuint *") IntBuffer arrays) { + GL30C.glGenVertexArrays(arrays); + } + + /** + * Generates vertex array object names. + * + * @see Reference Page + */ + @NativeType("void") + public static int glGenVertexArrays() { + return GL30C.glGenVertexArrays(); + } + + // --- [ glIsVertexArray ] --- + + /** + * Determines if a name corresponds to a vertex array object. + * + * @param array a value that may be the name of a vertex array object + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static boolean glIsVertexArray(@NativeType("GLuint") int array) { + return GL30C.glIsVertexArray(array); + } + + /** + * Array version of: {@link #glClearBufferiv ClearBufferiv} + * + * @see Reference Page + */ + public static void glClearBufferiv(@NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLint *") int[] value) { + GL30C.glClearBufferiv(buffer, drawbuffer, value); + } + + /** + * Array version of: {@link #glClearBufferuiv ClearBufferuiv} + * + * @see Reference Page + */ + public static void glClearBufferuiv(@NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLint *") int[] value) { + GL30C.glClearBufferuiv(buffer, drawbuffer, value); + } + + /** + * Array version of: {@link #glClearBufferfv ClearBufferfv} + * + * @see Reference Page + */ + public static void glClearBufferfv(@NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLfloat *") float[] value) { + GL30C.glClearBufferfv(buffer, drawbuffer, value); + } + + /** + * Array version of: {@link #glVertexAttribI1iv VertexAttribI1iv} + * + * @see Reference Page + */ + public static void glVertexAttribI1iv(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + GL30C.glVertexAttribI1iv(index, v); + } + + /** + * Array version of: {@link #glVertexAttribI2iv VertexAttribI2iv} + * + * @see Reference Page + */ + public static void glVertexAttribI2iv(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + GL30C.glVertexAttribI2iv(index, v); + } + + /** + * Array version of: {@link #glVertexAttribI3iv VertexAttribI3iv} + * + * @see Reference Page + */ + public static void glVertexAttribI3iv(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + GL30C.glVertexAttribI3iv(index, v); + } + + /** + * Array version of: {@link #glVertexAttribI4iv VertexAttribI4iv} + * + * @see Reference Page + */ + public static void glVertexAttribI4iv(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + GL30C.glVertexAttribI4iv(index, v); + } + + /** + * Array version of: {@link #glVertexAttribI1uiv VertexAttribI1uiv} + * + * @see Reference Page + */ + public static void glVertexAttribI1uiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") int[] v) { + GL30C.glVertexAttribI1uiv(index, v); + } + + /** + * Array version of: {@link #glVertexAttribI2uiv VertexAttribI2uiv} + * + * @see Reference Page + */ + public static void glVertexAttribI2uiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") int[] v) { + GL30C.glVertexAttribI2uiv(index, v); + } + + /** + * Array version of: {@link #glVertexAttribI3uiv VertexAttribI3uiv} + * + * @see Reference Page + */ + public static void glVertexAttribI3uiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") int[] v) { + GL30C.glVertexAttribI3uiv(index, v); + } + + /** + * Array version of: {@link #glVertexAttribI4uiv VertexAttribI4uiv} + * + * @see Reference Page + */ + public static void glVertexAttribI4uiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") int[] v) { + GL30C.glVertexAttribI4uiv(index, v); + } + + /** + * Array version of: {@link #glVertexAttribI4sv VertexAttribI4sv} + * + * @see Reference Page + */ + public static void glVertexAttribI4sv(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + GL30C.glVertexAttribI4sv(index, v); + } + + /** + * Array version of: {@link #glVertexAttribI4usv VertexAttribI4usv} + * + * @see Reference Page + */ + public static void glVertexAttribI4usv(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + GL30C.glVertexAttribI4usv(index, v); + } + + /** + * Array version of: {@link #glGetVertexAttribIiv GetVertexAttribIiv} + * + * @see Reference Page + */ + public static void glGetVertexAttribIiv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL30C.glGetVertexAttribIiv(index, pname, params); + } + + /** + * Array version of: {@link #glGetVertexAttribIuiv GetVertexAttribIuiv} + * + * @see Reference Page + */ + public static void glGetVertexAttribIuiv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLuint *") int[] params) { + GL30C.glGetVertexAttribIuiv(index, pname, params); + } + + /** + * Array version of: {@link #glUniform1uiv Uniform1uiv} + * + * @see Reference Page + */ + public static void glUniform1uiv(@NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + GL30C.glUniform1uiv(location, value); + } + + /** + * Array version of: {@link #glUniform2uiv Uniform2uiv} + * + * @see Reference Page + */ + public static void glUniform2uiv(@NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + GL30C.glUniform2uiv(location, value); + } + + /** + * Array version of: {@link #glUniform3uiv Uniform3uiv} + * + * @see Reference Page + */ + public static void glUniform3uiv(@NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + GL30C.glUniform3uiv(location, value); + } + + /** + * Array version of: {@link #glUniform4uiv Uniform4uiv} + * + * @see Reference Page + */ + public static void glUniform4uiv(@NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + GL30C.glUniform4uiv(location, value); + } + + /** + * Array version of: {@link #glGetUniformuiv GetUniformuiv} + * + * @see Reference Page + */ + public static void glGetUniformuiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint *") int[] params) { + GL30C.glGetUniformuiv(program, location, params); + } + + /** + * Array version of: {@link #glDeleteRenderbuffers DeleteRenderbuffers} + * + * @see Reference Page + */ + public static void glDeleteRenderbuffers(@NativeType("GLuint const *") int[] renderbuffers) { + GL30C.glDeleteRenderbuffers(renderbuffers); + } + + /** + * Array version of: {@link #glGenRenderbuffers GenRenderbuffers} + * + * @see Reference Page + */ + public static void glGenRenderbuffers(@NativeType("GLuint *") int[] renderbuffers) { + GL30C.glGenRenderbuffers(renderbuffers); + } + + /** + * Array version of: {@link #glGetRenderbufferParameteriv GetRenderbufferParameteriv} + * + * @see Reference Page + */ + public static void glGetRenderbufferParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL30C.glGetRenderbufferParameteriv(target, pname, params); + } + + /** + * Array version of: {@link #glDeleteFramebuffers DeleteFramebuffers} + * + * @see Reference Page + */ + public static void glDeleteFramebuffers(@NativeType("GLuint const *") int[] framebuffers) { + GL30C.glDeleteFramebuffers(framebuffers); + } + + /** + * Array version of: {@link #glGenFramebuffers GenFramebuffers} + * + * @see Reference Page + */ + public static void glGenFramebuffers(@NativeType("GLuint *") int[] framebuffers) { + GL30C.glGenFramebuffers(framebuffers); + } + + /** + * Array version of: {@link #glGetFramebufferAttachmentParameteriv GetFramebufferAttachmentParameteriv} + * + * @see Reference Page + */ + public static void glGetFramebufferAttachmentParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL30C.glGetFramebufferAttachmentParameteriv(target, attachment, pname, params); + } + + /** + * Array version of: {@link #glTexParameterIiv TexParameterIiv} + * + * @see Reference Page + */ + public static void glTexParameterIiv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + GL30C.glTexParameterIiv(target, pname, params); + } + + /** + * Array version of: {@link #glTexParameterIuiv TexParameterIuiv} + * + * @see Reference Page + */ + public static void glTexParameterIuiv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint const *") int[] params) { + GL30C.glTexParameterIuiv(target, pname, params); + } + + /** + * Array version of: {@link #glGetTexParameterIiv GetTexParameterIiv} + * + * @see Reference Page + */ + public static void glGetTexParameterIiv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL30C.glGetTexParameterIiv(target, pname, params); + } + + /** + * Array version of: {@link #glGetTexParameterIuiv GetTexParameterIuiv} + * + * @see Reference Page + */ + public static void glGetTexParameterIuiv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint *") int[] params) { + GL30C.glGetTexParameterIuiv(target, pname, params); + } + + /** + * Array version of: {@link #glGetIntegeri_v GetIntegeri_v} + * + * @see Reference Page + */ + public static void glGetIntegeri_v(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLint *") int[] data) { + GL30C.glGetIntegeri_v(target, index, data); + } + + /** + * Array version of: {@link #glGetTransformFeedbackVarying GetTransformFeedbackVarying} + * + * @see Reference Page + */ + public static void glGetTransformFeedbackVarying(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLsizei *") int[] size, @NativeType("GLenum *") int[] type, @NativeType("GLchar *") ByteBuffer name) { + GL30C.glGetTransformFeedbackVarying(program, index, length, size, type, name); + } + + /** + * Array version of: {@link #glDeleteVertexArrays DeleteVertexArrays} + * + * @see Reference Page + */ + public static void glDeleteVertexArrays(@NativeType("GLuint const *") int[] arrays) { + GL30C.glDeleteVertexArrays(arrays); + } + + /** + * Array version of: {@link #glGenVertexArrays GenVertexArrays} + * + * @see Reference Page + */ + public static void glGenVertexArrays(@NativeType("GLuint *") int[] arrays) { + GL30C.glGenVertexArrays(arrays); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL30C.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL30C.java new file mode 100644 index 00000000..0466ae51 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL30C.java @@ -0,0 +1,2907 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality of a forward compatible context, up to version 3.0. + * + *

OpenGL 3.0 implementations are guaranteed to support at least versions 1.10, 1.20 and 1.30 of the shading language, + * although versions 1.10 and 1.20 are deprecated in a forward-compatible context.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL30C extends GL21C { + + /** GetTarget */ + public static final int + GL_MAJOR_VERSION = 0x821B, + GL_MINOR_VERSION = 0x821C, + GL_NUM_EXTENSIONS = 0x821D, + GL_CONTEXT_FLAGS = 0x821E, + GL_CONTEXT_FLAG_FORWARD_COMPATIBLE_BIT = 0x1; + + /** Renamed tokens. */ + public static final int + GL_COMPARE_REF_TO_TEXTURE = 0x884E, + GL_CLIP_DISTANCE0 = 0x3000, + GL_CLIP_DISTANCE1 = 0x3001, + GL_CLIP_DISTANCE2 = 0x3002, + GL_CLIP_DISTANCE3 = 0x3003, + GL_CLIP_DISTANCE4 = 0x3004, + GL_CLIP_DISTANCE5 = 0x3005, + GL_CLIP_DISTANCE6 = 0x3006, + GL_CLIP_DISTANCE7 = 0x3007, + GL_MAX_CLIP_DISTANCES = 0xD32, + GL_MAX_VARYING_COMPONENTS = 0x8B4B; + + /** Accepted by the {@code pname} parameters of GetVertexAttribdv, GetVertexAttribfv, GetVertexAttribiv, GetVertexAttribIuiv and GetVertexAttribIiv. */ + public static final int GL_VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD; + + /** Returned by the {@code type} parameter of GetActiveUniform. */ + public static final int + GL_SAMPLER_1D_ARRAY = 0x8DC0, + GL_SAMPLER_2D_ARRAY = 0x8DC1, + GL_SAMPLER_1D_ARRAY_SHADOW = 0x8DC3, + GL_SAMPLER_2D_ARRAY_SHADOW = 0x8DC4, + GL_SAMPLER_CUBE_SHADOW = 0x8DC5, + GL_UNSIGNED_INT_VEC2 = 0x8DC6, + GL_UNSIGNED_INT_VEC3 = 0x8DC7, + GL_UNSIGNED_INT_VEC4 = 0x8DC8, + GL_INT_SAMPLER_1D = 0x8DC9, + GL_INT_SAMPLER_2D = 0x8DCA, + GL_INT_SAMPLER_3D = 0x8DCB, + GL_INT_SAMPLER_CUBE = 0x8DCC, + GL_INT_SAMPLER_1D_ARRAY = 0x8DCE, + GL_INT_SAMPLER_2D_ARRAY = 0x8DCF, + GL_UNSIGNED_INT_SAMPLER_1D = 0x8DD1, + GL_UNSIGNED_INT_SAMPLER_2D = 0x8DD2, + GL_UNSIGNED_INT_SAMPLER_3D = 0x8DD3, + GL_UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4, + GL_UNSIGNED_INT_SAMPLER_1D_ARRAY = 0x8DD6, + GL_UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MIN_PROGRAM_TEXEL_OFFSET = 0x8904, + GL_MAX_PROGRAM_TEXEL_OFFSET = 0x8905; + + /** Accepted by the {@code mode} parameter of BeginConditionalRender. */ + public static final int + GL_QUERY_WAIT = 0x8E13, + GL_QUERY_NO_WAIT = 0x8E14, + GL_QUERY_BY_REGION_WAIT = 0x8E15, + GL_QUERY_BY_REGION_NO_WAIT = 0x8E16; + + /** Accepted by the {@code access} parameter of MapBufferRange. */ + public static final int + GL_MAP_READ_BIT = 0x1, + GL_MAP_WRITE_BIT = 0x2, + GL_MAP_INVALIDATE_RANGE_BIT = 0x4, + GL_MAP_INVALIDATE_BUFFER_BIT = 0x8, + GL_MAP_FLUSH_EXPLICIT_BIT = 0x10, + GL_MAP_UNSYNCHRONIZED_BIT = 0x20; + + /** Accepted by the {@code pname} parameter of GetBufferParameteriv. */ + public static final int + GL_BUFFER_ACCESS_FLAGS = 0x911F, + GL_BUFFER_MAP_LENGTH = 0x9120, + GL_BUFFER_MAP_OFFSET = 0x9121; + + /** Accepted by the {@code target} parameter of ClampColor and the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_CLAMP_READ_COLOR = 0x891C; + + /** Accepted by the {@code clamp} parameter of ClampColor. */ + public static final int GL_FIXED_ONLY = 0x891D; + + /** + * Accepted by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and RenderbufferStorage, and + * returned in the {@code data} parameter of GetTexLevelParameter and GetRenderbufferParameteriv. + */ + public static final int + GL_DEPTH_COMPONENT32F = 0x8CAC, + GL_DEPTH32F_STENCIL8 = 0x8CAD; + + /** + * Accepted by the {@code type} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, and + * GetTexImage. + */ + public static final int GL_FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD; + + /** Accepted by the {@code value} parameter of GetTexLevelParameter. */ + public static final int + GL_TEXTURE_RED_TYPE = 0x8C10, + GL_TEXTURE_GREEN_TYPE = 0x8C11, + GL_TEXTURE_BLUE_TYPE = 0x8C12, + GL_TEXTURE_ALPHA_TYPE = 0x8C13, + GL_TEXTURE_DEPTH_TYPE = 0x8C16; + + /** Returned by the {@code params} parameter of GetTexLevelParameter. */ + public static final int GL_UNSIGNED_NORMALIZED = 0x8C17; + + /** Accepted by the {@code internalFormat} parameter of TexImage1D, TexImage2D, and TexImage3D. */ + public static final int + GL_RGBA32F = 0x8814, + GL_RGB32F = 0x8815, + GL_RGBA16F = 0x881A, + GL_RGB16F = 0x881B; + + /** Accepted by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and RenderbufferStorage. */ + public static final int GL_R11F_G11F_B10F = 0x8C3A; + + /** + * Accepted by the {@code type} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, GetTexImage, TexImage3D, TexSubImage1D, TexSubImage2D, + * TexSubImage3D, GetHistogram, GetMinmax, ConvolutionFilter1D, ConvolutionFilter2D, ConvolutionFilter3D, GetConvolutionFilter, SeparableFilter2D, + * GetSeparableFilter, ColorTable, ColorSubTable, and GetColorTable. + */ + public static final int GL_UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B; + + /** Accepted by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and RenderbufferStorage. */ + public static final int GL_RGB9_E5 = 0x8C3D; + + /** + * Accepted by the {@code type} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, GetTexImage, TexImage3D, TexSubImage1D, TexSubImage2D, + * TexSubImage3D, GetHistogram, GetMinmax, ConvolutionFilter1D, ConvolutionFilter2D, ConvolutionFilter3D, GetConvolutionFilter, SeparableFilter2D, + * GetSeparableFilter, ColorTable, ColorSubTable, and GetColorTable. + */ + public static final int GL_UNSIGNED_INT_5_9_9_9_REV = 0x8C3E; + + /** Accepted by the {@code pname} parameter of GetTexLevelParameterfv and GetTexLevelParameteriv. */ + public static final int GL_TEXTURE_SHARED_SIZE = 0x8C3F; + + /** + * Accepted by the {@code target} parameter of BindFramebuffer, CheckFramebufferStatus, FramebufferTexture{1D|2D|3D}, FramebufferRenderbuffer, and + * GetFramebufferAttachmentParameteriv. + */ + public static final int + GL_FRAMEBUFFER = 0x8D40, + GL_READ_FRAMEBUFFER = 0x8CA8, + GL_DRAW_FRAMEBUFFER = 0x8CA9; + + /** + * Accepted by the {@code target} parameter of BindRenderbuffer, RenderbufferStorage, and GetRenderbufferParameteriv, and returned by + * GetFramebufferAttachmentParameteriv. + */ + public static final int GL_RENDERBUFFER = 0x8D41; + + /** Accepted by the {@code internalformat} parameter of RenderbufferStorage. */ + public static final int + GL_STENCIL_INDEX1 = 0x8D46, + GL_STENCIL_INDEX4 = 0x8D47, + GL_STENCIL_INDEX8 = 0x8D48, + GL_STENCIL_INDEX16 = 0x8D49; + + /** Accepted by the {@code pname} parameter of GetRenderbufferParameteriv. */ + public static final int + GL_RENDERBUFFER_WIDTH = 0x8D42, + GL_RENDERBUFFER_HEIGHT = 0x8D43, + GL_RENDERBUFFER_INTERNAL_FORMAT = 0x8D44, + GL_RENDERBUFFER_RED_SIZE = 0x8D50, + GL_RENDERBUFFER_GREEN_SIZE = 0x8D51, + GL_RENDERBUFFER_BLUE_SIZE = 0x8D52, + GL_RENDERBUFFER_ALPHA_SIZE = 0x8D53, + GL_RENDERBUFFER_DEPTH_SIZE = 0x8D54, + GL_RENDERBUFFER_STENCIL_SIZE = 0x8D55, + GL_RENDERBUFFER_SAMPLES = 0x8CAB; + + /** Accepted by the {@code pname} parameter of GetFramebufferAttachmentParameteriv. */ + public static final int + GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0, + GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1, + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2, + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3, + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4, + GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210, + GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211, + GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212, + GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213, + GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214, + GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215, + GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216, + GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217; + + /** Returned in {@code params} by GetFramebufferAttachmentParameteriv. */ + public static final int GL_FRAMEBUFFER_DEFAULT = 0x8218; + + /** Accepted by the {@code attachment} parameter of FramebufferTexture{1D|2D|3D}, FramebufferRenderbuffer, and GetFramebufferAttachmentParameteriv. */ + public static final int + GL_COLOR_ATTACHMENT0 = 0x8CE0, + GL_COLOR_ATTACHMENT1 = 0x8CE1, + GL_COLOR_ATTACHMENT2 = 0x8CE2, + GL_COLOR_ATTACHMENT3 = 0x8CE3, + GL_COLOR_ATTACHMENT4 = 0x8CE4, + GL_COLOR_ATTACHMENT5 = 0x8CE5, + GL_COLOR_ATTACHMENT6 = 0x8CE6, + GL_COLOR_ATTACHMENT7 = 0x8CE7, + GL_COLOR_ATTACHMENT8 = 0x8CE8, + GL_COLOR_ATTACHMENT9 = 0x8CE9, + GL_COLOR_ATTACHMENT10 = 0x8CEA, + GL_COLOR_ATTACHMENT11 = 0x8CEB, + GL_COLOR_ATTACHMENT12 = 0x8CEC, + GL_COLOR_ATTACHMENT13 = 0x8CED, + GL_COLOR_ATTACHMENT14 = 0x8CEE, + GL_COLOR_ATTACHMENT15 = 0x8CEF, + GL_COLOR_ATTACHMENT16 = 0x8CF0, + GL_COLOR_ATTACHMENT17 = 0x8CF1, + GL_COLOR_ATTACHMENT18 = 0x8CF2, + GL_COLOR_ATTACHMENT19 = 0x8CF3, + GL_COLOR_ATTACHMENT20 = 0x8CF4, + GL_COLOR_ATTACHMENT21 = 0x8CF5, + GL_COLOR_ATTACHMENT22 = 0x8CF6, + GL_COLOR_ATTACHMENT23 = 0x8CF7, + GL_COLOR_ATTACHMENT24 = 0x8CF8, + GL_COLOR_ATTACHMENT25 = 0x8CF9, + GL_COLOR_ATTACHMENT26 = 0x8CFA, + GL_COLOR_ATTACHMENT27 = 0x8CFB, + GL_COLOR_ATTACHMENT28 = 0x8CFC, + GL_COLOR_ATTACHMENT29 = 0x8CFD, + GL_COLOR_ATTACHMENT30 = 0x8CFE, + GL_COLOR_ATTACHMENT31 = 0x8CFF, + GL_DEPTH_ATTACHMENT = 0x8D00, + GL_STENCIL_ATTACHMENT = 0x8D20, + GL_DEPTH_STENCIL_ATTACHMENT = 0x821A; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_MAX_SAMPLES = 0x8D57; + + /** Returned by CheckFramebufferStatus(). */ + public static final int + GL_FRAMEBUFFER_COMPLETE = 0x8CD5, + GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6, + GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7, + GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER = 0x8CDB, + GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER = 0x8CDC, + GL_FRAMEBUFFER_UNSUPPORTED = 0x8CDD, + GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56, + GL_FRAMEBUFFER_UNDEFINED = 0x8219; + + /** Accepted by the {@code pname} parameters of GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_FRAMEBUFFER_BINDING = 0x8CA6, + GL_DRAW_FRAMEBUFFER_BINDING = 0x8CA6, + GL_READ_FRAMEBUFFER_BINDING = 0x8CAA, + GL_RENDERBUFFER_BINDING = 0x8CA7, + GL_MAX_COLOR_ATTACHMENTS = 0x8CDF, + GL_MAX_RENDERBUFFER_SIZE = 0x84E8; + + /** Returned by GetError(). */ + public static final int GL_INVALID_FRAMEBUFFER_OPERATION = 0x506; + + /** + * Accepted by the {@code format} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, and + * GetTexImage, by the {@code type} parameter of CopyPixels, by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, + * CopyTexImage2D, and RenderbufferStorage, and returned in the {@code data} parameter of GetTexLevelParameter and GetRenderbufferParameteriv. + */ + public static final int GL_DEPTH_STENCIL = 0x84F9; + + /** + * Accepted by the {@code type} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, and + * GetTexImage. + */ + public static final int GL_UNSIGNED_INT_24_8 = 0x84FA; + + /** + * Accepted by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and RenderbufferStorage, and + * returned in the {@code data} parameter of GetTexLevelParameter and GetRenderbufferParameteriv. + */ + public static final int GL_DEPTH24_STENCIL8 = 0x88F0; + + /** Accepted by the {@code value} parameter of GetTexLevelParameter. */ + public static final int GL_TEXTURE_STENCIL_SIZE = 0x88F1; + + /** + * Accepted by the {@code type} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, TexImage3D, GetTexImage, TexSubImage1D, TexSubImage2D, + * TexSubImage3D, GetHistogram, GetMinmax, ConvolutionFilter1D, ConvolutionFilter2D, GetConvolutionFilter, SeparableFilter2D, GetSeparableFilter, + * ColorTable, ColorSubTable, and GetColorTable. + * + *

Accepted by the {@code type} argument of VertexPointer, NormalPointer, ColorPointer, SecondaryColorPointer, FogCoordPointer, TexCoordPointer, and + * VertexAttribPointer.

+ */ + public static final int GL_HALF_FLOAT = 0x140B; + + /** Accepted by the {@code internalFormat} parameter of TexImage1D, TexImage2D, and TexImage3D. */ + public static final int + GL_RGBA32UI = 0x8D70, + GL_RGB32UI = 0x8D71, + GL_RGBA16UI = 0x8D76, + GL_RGB16UI = 0x8D77, + GL_RGBA8UI = 0x8D7C, + GL_RGB8UI = 0x8D7D, + GL_RGBA32I = 0x8D82, + GL_RGB32I = 0x8D83, + GL_RGBA16I = 0x8D88, + GL_RGB16I = 0x8D89, + GL_RGBA8I = 0x8D8E, + GL_RGB8I = 0x8D8F; + + /** Accepted by the {@code format} parameter of TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, DrawPixels and ReadPixels. */ + public static final int + GL_RED_INTEGER = 0x8D94, + GL_GREEN_INTEGER = 0x8D95, + GL_BLUE_INTEGER = 0x8D96, + GL_RGB_INTEGER = 0x8D98, + GL_RGBA_INTEGER = 0x8D99, + GL_BGR_INTEGER = 0x8D9A, + GL_BGRA_INTEGER = 0x8D9B; + + /** Accepted by the {@code target} parameter of TexParameteri, TexParameteriv, TexParameterf, TexParameterfv, GenerateMipmap, and BindTexture. */ + public static final int + GL_TEXTURE_1D_ARRAY = 0x8C18, + GL_TEXTURE_2D_ARRAY = 0x8C1A; + + /** Accepted by the {@code target} parameter of TexImage3D, TexSubImage3D, CopyTexSubImage3D, CompressedTexImage3D, and CompressedTexSubImage3D. */ + public static final int GL_PROXY_TEXTURE_2D_ARRAY = 0x8C1B; + + /** + * Accepted by the {@code target} parameter of TexImage2D, TexSubImage2D, CopyTexImage2D, CopyTexSubImage2D, CompressedTexImage2D, and + * CompressedTexSubImage2D. + */ + public static final int GL_PROXY_TEXTURE_1D_ARRAY = 0x8C19; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv and GetFloatv. */ + public static final int + GL_TEXTURE_BINDING_1D_ARRAY = 0x8C1C, + GL_TEXTURE_BINDING_2D_ARRAY = 0x8C1D, + GL_MAX_ARRAY_TEXTURE_LAYERS = 0x88FF; + + /** + * Accepted by the {@code internalformat} parameter of TexImage2D, CopyTexImage2D, and CompressedTexImage2D and the {@code format} parameter of + * CompressedTexSubImage2D. + */ + public static final int + GL_COMPRESSED_RED_RGTC1 = 0x8DBB, + GL_COMPRESSED_SIGNED_RED_RGTC1 = 0x8DBC, + GL_COMPRESSED_RG_RGTC2 = 0x8DBD, + GL_COMPRESSED_SIGNED_RG_RGTC2 = 0x8DBE; + + /** Accepted by the {@code internalFormat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, and CopyTexImage2D. */ + public static final int + GL_R8 = 0x8229, + GL_R16 = 0x822A, + GL_RG8 = 0x822B, + GL_RG16 = 0x822C, + GL_R16F = 0x822D, + GL_R32F = 0x822E, + GL_RG16F = 0x822F, + GL_RG32F = 0x8230, + GL_R8I = 0x8231, + GL_R8UI = 0x8232, + GL_R16I = 0x8233, + GL_R16UI = 0x8234, + GL_R32I = 0x8235, + GL_R32UI = 0x8236, + GL_RG8I = 0x8237, + GL_RG8UI = 0x8238, + GL_RG16I = 0x8239, + GL_RG16UI = 0x823A, + GL_RG32I = 0x823B, + GL_RG32UI = 0x823C, + GL_RG = 0x8227, + GL_COMPRESSED_RED = 0x8225, + GL_COMPRESSED_RG = 0x8226; + + /** Accepted by the {@code format} parameter of TexImage3D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, and ReadPixels. */ + public static final int GL_RG_INTEGER = 0x8228; + + /** + * Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferPointerv, + * BindBufferRange, BindBufferOffset and BindBufferBase. + */ + public static final int GL_TRANSFORM_FEEDBACK_BUFFER = 0x8C8E; + + /** Accepted by the {@code param} parameter of GetIntegeri_v and GetBooleani_v. */ + public static final int + GL_TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84, + GL_TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85; + + /** + * Accepted by the {@code param} parameter of GetIntegeri_v and GetBooleani_v, and by the {@code pname} parameter of GetBooleanv, + * GetDoublev, GetIntegerv, and GetFloatv. + */ + public static final int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F; + + /** Accepted by the {@code bufferMode} parameter of TransformFeedbackVaryings. */ + public static final int + GL_INTERLEAVED_ATTRIBS = 0x8C8C, + GL_SEPARATE_ATTRIBS = 0x8C8D; + + /** Accepted by the {@code target} parameter of BeginQuery, EndQuery, and GetQueryiv. */ + public static final int + GL_PRIMITIVES_GENERATED = 0x8C87, + GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_RASTERIZER_DISCARD = 0x8C89; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A, + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B, + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80; + + /** Accepted by the {@code pname} parameter of GetProgramiv. */ + public static final int + GL_TRANSFORM_FEEDBACK_VARYINGS = 0x8C83, + GL_TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F, + GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_VERTEX_ARRAY_BINDING = 0x85B5; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_FRAMEBUFFER_SRGB = 0x8DB9; + + static { GL.initialize(); } + + protected GL30C() { + throw new UnsupportedOperationException(); + } + + // --- [ glGetStringi ] --- + + /** Unsafe version of: {@link #glGetStringi GetStringi} */ + public static native long nglGetStringi(int name, int index); + + /** + * Queries indexed string state. + * + * @param name the indexed state to query. One of:
{@link GL11#GL_EXTENSIONS EXTENSIONS}{@link GL20#GL_SHADING_LANGUAGE_VERSION SHADING_LANGUAGE_VERSION}
+ * @param index the index of the particular element being queried + * + * @see Reference Page + */ + @Nullable + @NativeType("GLubyte const *") + public static String glGetStringi(@NativeType("GLenum") int name, @NativeType("GLuint") int index) { + long __result = nglGetStringi(name, index); + return memUTF8Safe(__result); + } + + // --- [ glClearBufferiv ] --- + + /** Unsafe version of: {@link #glClearBufferiv ClearBufferiv} */ + public static native void nglClearBufferiv(int buffer, int drawbuffer, long value); + + /** + * Clears an individual buffer of the currently bound framebuffer object to the {@link #GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER} binding. + * + * @param buffer the buffer to clear. One of:
{@link GL11#GL_COLOR COLOR}{@link GL11#GL_STENCIL STENCIL}
+ * @param drawbuffer the draw buffer to clear + * @param value for color buffers, a pointer to a four-element vector specifying R, G, B and A values to clear the buffer to. For stencil buffers, a pointer to a + * single stencil value to clear the buffer to. + * + * @see Reference Page + */ + public static void glClearBufferiv(@NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLint *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nglClearBufferiv(buffer, drawbuffer, memAddress(value)); + } + + // --- [ glClearBufferuiv ] --- + + /** Unsafe version of: {@link #glClearBufferuiv ClearBufferuiv} */ + public static native void nglClearBufferuiv(int buffer, int drawbuffer, long value); + + /** + * Clears an individual buffer of the currently bound framebuffer object to the {@link #GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER} binding. + * + * @param buffer the buffer to clear. Must be:
{@link GL11#GL_COLOR COLOR}
+ * @param drawbuffer the draw buffer to clear + * @param value a pointer to a four-element vector specifying R, G, B and A values to clear the buffer to + * + * @see Reference Page + */ + public static void glClearBufferuiv(@NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLint *") IntBuffer value) { + if (CHECKS) { + check(value, 4); + } + nglClearBufferuiv(buffer, drawbuffer, memAddress(value)); + } + + // --- [ glClearBufferfv ] --- + + /** Unsafe version of: {@link #glClearBufferfv ClearBufferfv} */ + public static native void nglClearBufferfv(int buffer, int drawbuffer, long value); + + /** + * Clears an individual buffer of the currently bound framebuffer object to the {@link #GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER} binding. + * + * @param buffer the buffer to clear. One of:
{@link GL11#GL_COLOR COLOR}{@link GL11#GL_DEPTH DEPTH}
+ * @param drawbuffer the draw buffer to clear + * @param value for color buffers, a pointer to a four-element vector specifying R, G, B and A values to clear the buffer to. For depth buffers, a pointer to a + * single depth value to clear the buffer to. + * + * @see Reference Page + */ + public static void glClearBufferfv(@NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLfloat *") FloatBuffer value) { + if (CHECKS) { + check(value, 1); + } + nglClearBufferfv(buffer, drawbuffer, memAddress(value)); + } + + // --- [ glClearBufferfi ] --- + + /** + * Clears an individual buffer of the currently bound framebuffer object to the {@link #GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER} binding. + * + * @param buffer the buffer to clear. Must be:
{@link #GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param drawbuffer the draw buffer to clear + * @param depth the depth value to clear the buffer to + * @param stencil the stencil value to clear the buffer to + * + * @see Reference Page + */ + public static native void glClearBufferfi(@NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLfloat") float depth, @NativeType("GLint") int stencil); + + // --- [ glVertexAttribI1i ] --- + + /** + * Specifies the value of a pure integer generic vertex attribute. The y and z components are implicitly set to 0 and w to 1. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + * + * @see Reference Page + */ + public static native void glVertexAttribI1i(@NativeType("GLuint") int index, @NativeType("GLint") int x); + + // --- [ glVertexAttribI2i ] --- + + /** + * Specifies the value of a pure integer generic vertex attribute. The z component is implicitly set to 0 and w to 1. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * + * @see Reference Page + */ + public static native void glVertexAttribI2i(@NativeType("GLuint") int index, @NativeType("GLint") int x, @NativeType("GLint") int y); + + // --- [ glVertexAttribI3i ] --- + + /** + * Specifies the value of a pure integer generic vertex attribute. The w component is implicitly set to 1. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * @param z the vertex attribute z component + * + * @see Reference Page + */ + public static native void glVertexAttribI3i(@NativeType("GLuint") int index, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z); + + // --- [ glVertexAttribI4i ] --- + + /** + * Specifies the value of a pure integer generic vertex attribute. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * @param z the vertex attribute z component + * @param w the vertex attribute w component + * + * @see Reference Page + */ + public static native void glVertexAttribI4i(@NativeType("GLuint") int index, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z, @NativeType("GLint") int w); + + // --- [ glVertexAttribI1ui ] --- + + /** + * Specifies the value of an unsigned pure integer generic vertex attribute. The y and z components are implicitly set to 0 and w to 1. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + * + * @see Reference Page + */ + public static native void glVertexAttribI1ui(@NativeType("GLuint") int index, @NativeType("GLuint") int x); + + // --- [ glVertexAttribI2ui ] --- + + /** + * Specifies the value of an unsigned pure integer generic vertex attribute. The z component is implicitly set to 0 and w to 1. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * + * @see Reference Page + */ + public static native void glVertexAttribI2ui(@NativeType("GLuint") int index, @NativeType("GLuint") int x, @NativeType("GLuint") int y); + + // --- [ glVertexAttribI3ui ] --- + + /** + * Specifies the value of an unsigned pure integer generic vertex attribute. The w component is implicitly set to 1. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * @param z the vertex attribute z component + * + * @see Reference Page + */ + public static native void glVertexAttribI3ui(@NativeType("GLuint") int index, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z); + + // --- [ glVertexAttribI4ui ] --- + + /** + * Specifies the value of an unsigned pure integer generic vertex attribute. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * @param z the vertex attribute z component + * @param w the vertex attribute w component + * + * @see Reference Page + */ + public static native void glVertexAttribI4ui(@NativeType("GLuint") int index, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z, @NativeType("GLint") int w); + + // --- [ glVertexAttribI1iv ] --- + + /** Unsafe version of: {@link #glVertexAttribI1iv VertexAttribI1iv} */ + public static native void nglVertexAttribI1iv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttribI1i VertexAttribI1i}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI1iv(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglVertexAttribI1iv(index, memAddress(v)); + } + + // --- [ glVertexAttribI2iv ] --- + + /** Unsafe version of: {@link #glVertexAttribI2iv VertexAttribI2iv} */ + public static native void nglVertexAttribI2iv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttribI2i VertexAttribI2i}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI2iv(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglVertexAttribI2iv(index, memAddress(v)); + } + + // --- [ glVertexAttribI3iv ] --- + + /** Unsafe version of: {@link #glVertexAttribI3iv VertexAttribI3iv} */ + public static native void nglVertexAttribI3iv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttribI3i VertexAttribI3i}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI3iv(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglVertexAttribI3iv(index, memAddress(v)); + } + + // --- [ glVertexAttribI4iv ] --- + + /** Unsafe version of: {@link #glVertexAttribI4iv VertexAttribI4iv} */ + public static native void nglVertexAttribI4iv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttribI4i VertexAttribI4i}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI4iv(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttribI4iv(index, memAddress(v)); + } + + // --- [ glVertexAttribI1uiv ] --- + + /** Unsafe version of: {@link #glVertexAttribI1uiv VertexAttribI1uiv} */ + public static native void nglVertexAttribI1uiv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttribI1ui VertexAttribI1ui}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI1uiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") IntBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglVertexAttribI1uiv(index, memAddress(v)); + } + + // --- [ glVertexAttribI2uiv ] --- + + /** Unsafe version of: {@link #glVertexAttribI2uiv VertexAttribI2uiv} */ + public static native void nglVertexAttribI2uiv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttribI2ui VertexAttribI2ui}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI2uiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") IntBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglVertexAttribI2uiv(index, memAddress(v)); + } + + // --- [ glVertexAttribI3uiv ] --- + + /** Unsafe version of: {@link #glVertexAttribI3uiv VertexAttribI3uiv} */ + public static native void nglVertexAttribI3uiv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttribI3ui VertexAttribI3ui}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI3uiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") IntBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglVertexAttribI3uiv(index, memAddress(v)); + } + + // --- [ glVertexAttribI4uiv ] --- + + /** Unsafe version of: {@link #glVertexAttribI4uiv VertexAttribI4uiv} */ + public static native void nglVertexAttribI4uiv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttribI4ui VertexAttribI4ui}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI4uiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") IntBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttribI4uiv(index, memAddress(v)); + } + + // --- [ glVertexAttribI4bv ] --- + + /** Unsafe version of: {@link #glVertexAttribI4bv VertexAttribI4bv} */ + public static native void nglVertexAttribI4bv(int index, long v); + + /** + * Byte version of {@link #glVertexAttribI4iv VertexAttribI4iv}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI4bv(@NativeType("GLuint") int index, @NativeType("GLbyte const *") ByteBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttribI4bv(index, memAddress(v)); + } + + // --- [ glVertexAttribI4sv ] --- + + /** Unsafe version of: {@link #glVertexAttribI4sv VertexAttribI4sv} */ + public static native void nglVertexAttribI4sv(int index, long v); + + /** + * Short version of {@link #glVertexAttribI4iv VertexAttribI4iv}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI4sv(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttribI4sv(index, memAddress(v)); + } + + // --- [ glVertexAttribI4ubv ] --- + + /** Unsafe version of: {@link #glVertexAttribI4ubv VertexAttribI4ubv} */ + public static native void nglVertexAttribI4ubv(int index, long v); + + /** + * Byte version of {@link #glVertexAttribI4uiv VertexAttribI4uiv}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI4ubv(@NativeType("GLuint") int index, @NativeType("GLbyte const *") ByteBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttribI4ubv(index, memAddress(v)); + } + + // --- [ glVertexAttribI4usv ] --- + + /** Unsafe version of: {@link #glVertexAttribI4usv VertexAttribI4usv} */ + public static native void nglVertexAttribI4usv(int index, long v); + + /** + * Short version of {@link #glVertexAttribI4uiv VertexAttribI4uiv}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param v the pure integer vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribI4usv(@NativeType("GLuint") int index, @NativeType("GLshort const *") ShortBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttribI4usv(index, memAddress(v)); + } + + // --- [ glVertexAttribIPointer ] --- + + /** Unsafe version of: {@link #glVertexAttribIPointer VertexAttribIPointer} */ + public static native void nglVertexAttribIPointer(int index, int size, int type, int stride, long pointer); + + /** + * Specifies the location and organization of a pure integer vertex attribute array. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribIPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + nglVertexAttribIPointer(index, size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a pure integer vertex attribute array. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribIPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + nglVertexAttribIPointer(index, size, type, stride, pointer); + } + + /** + * Specifies the location and organization of a pure integer vertex attribute array. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribIPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ShortBuffer pointer) { + nglVertexAttribIPointer(index, size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a pure integer vertex attribute array. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. One of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribIPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") IntBuffer pointer) { + nglVertexAttribIPointer(index, size, type, stride, memAddress(pointer)); + } + + // --- [ glGetVertexAttribIiv ] --- + + /** Unsafe version of: {@link #glGetVertexAttribIiv GetVertexAttribIiv} */ + public static native void nglGetVertexAttribIiv(int index, int pname, long params); + + /** + * Returns the value of a pure integer generic vertex attribute parameter. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param pname the symbolic name of the vertex attribute parameter to be queried. Must be:
{@link GL20#GL_CURRENT_VERTEX_ATTRIB CURRENT_VERTEX_ATTRIB}
+ * @param params returns the requested data + * + * @see Reference Page + */ + public static void glGetVertexAttribIiv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglGetVertexAttribIiv(index, pname, memAddress(params)); + } + + /** + * Returns the value of a pure integer generic vertex attribute parameter. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param pname the symbolic name of the vertex attribute parameter to be queried. Must be:
{@link GL20#GL_CURRENT_VERTEX_ATTRIB CURRENT_VERTEX_ATTRIB}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetVertexAttribIi(@NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetVertexAttribIiv(index, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetVertexAttribIuiv ] --- + + /** Unsafe version of: {@link #glGetVertexAttribIuiv GetVertexAttribIuiv} */ + public static native void nglGetVertexAttribIuiv(int index, int pname, long params); + + /** + * Unsigned version of {@link #glGetVertexAttribIiv GetVertexAttribIiv}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param pname the symbolic name of the vertex attribute parameter to be queried. Must be:
{@link GL20#GL_CURRENT_VERTEX_ATTRIB CURRENT_VERTEX_ATTRIB}
+ * @param params returns the requested data + * + * @see Reference Page + */ + public static void glGetVertexAttribIuiv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLuint *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglGetVertexAttribIuiv(index, pname, memAddress(params)); + } + + /** + * Unsigned version of {@link #glGetVertexAttribIiv GetVertexAttribIiv}. + * + * @param index the index of the pure integer generic vertex attribute to be modified + * @param pname the symbolic name of the vertex attribute parameter to be queried. Must be:
{@link GL20#GL_CURRENT_VERTEX_ATTRIB CURRENT_VERTEX_ATTRIB}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetVertexAttribIui(@NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetVertexAttribIuiv(index, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glUniform1ui ] --- + + /** + * Specifies the value of a uint uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform value + * + * @see Reference Page + */ + public static native void glUniform1ui(@NativeType("GLint") int location, @NativeType("GLuint") int v0); + + // --- [ glUniform2ui ] --- + + /** + * Specifies the value of a uvec2 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform x value + * @param v1 the uniform y value + * + * @see Reference Page + */ + public static native void glUniform2ui(@NativeType("GLint") int location, @NativeType("GLuint") int v0, @NativeType("GLuint") int v1); + + // --- [ glUniform3ui ] --- + + /** + * Specifies the value of a uvec3 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform x value + * @param v1 the uniform y value + * @param v2 the uniform z value + * + * @see Reference Page + */ + public static native void glUniform3ui(@NativeType("GLint") int location, @NativeType("GLuint") int v0, @NativeType("GLuint") int v1, @NativeType("GLuint") int v2); + + // --- [ glUniform4ui ] --- + + /** + * Specifies the value of a uvec4 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param v0 the uniform x value + * @param v1 the uniform y value + * @param v2 the uniform z value + * @param v3 the uniform w value + * + * @see Reference Page + */ + public static native void glUniform4ui(@NativeType("GLint") int location, @NativeType("GLuint") int v0, @NativeType("GLuint") int v1, @NativeType("GLuint") int v2, @NativeType("GLuint") int v3); + + // --- [ glUniform1uiv ] --- + + /** + * Unsafe version of: {@link #glUniform1uiv Uniform1uiv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform1uiv(int location, int count, long value); + + /** + * Specifies the value of a single uint uniform variable or a uint uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform1uiv(@NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + nglUniform1uiv(location, value.remaining(), memAddress(value)); + } + + // --- [ glUniform2uiv ] --- + + /** + * Unsafe version of: {@link #glUniform2uiv Uniform2uiv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform2uiv(int location, int count, long value); + + /** + * Specifies the value of a single uvec2 uniform variable or a uvec2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform2uiv(@NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + nglUniform2uiv(location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glUniform3uiv ] --- + + /** + * Unsafe version of: {@link #glUniform3uiv Uniform3uiv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform3uiv(int location, int count, long value); + + /** + * Specifies the value of a single uvec3 uniform variable or a uvec3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform3uiv(@NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + nglUniform3uiv(location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glUniform4uiv ] --- + + /** + * Unsafe version of: {@link #glUniform4uiv Uniform4uiv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform4uiv(int location, int count, long value); + + /** + * Specifies the value of a single uvec4 uniform variable or a uvec4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform4uiv(@NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + nglUniform4uiv(location, value.remaining() >> 2, memAddress(value)); + } + + // --- [ glGetUniformuiv ] --- + + /** Unsafe version of: {@link #glGetUniformuiv GetUniformuiv} */ + public static native void nglGetUniformuiv(int program, int location, long params); + + /** + * Returns the uint value(s) of a uniform variable. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * @param params the value of the specified uniform variable + * + * @see Reference Page + */ + public static void glGetUniformuiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetUniformuiv(program, location, memAddress(params)); + } + + /** + * Returns the uint value(s) of a uniform variable. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetUniformui(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetUniformuiv(program, location, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glBindFragDataLocation ] --- + + /** Unsafe version of: {@link #glBindFragDataLocation BindFragDataLocation} */ + public static native void nglBindFragDataLocation(int program, int colorNumber, long name); + + /** + * Binds a user-defined varying out variable to a fragment shader color number. + * + * @param program the name of the program containing varying out variable whose binding to modify + * @param colorNumber the color number to bind the user-defined varying out variable to + * @param name the name of the user-defined varying out variable whose binding to modify + * + * @see Reference Page + */ + public static void glBindFragDataLocation(@NativeType("GLuint") int program, @NativeType("GLuint") int colorNumber, @NativeType("GLchar const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + nglBindFragDataLocation(program, colorNumber, memAddress(name)); + } + + /** + * Binds a user-defined varying out variable to a fragment shader color number. + * + * @param program the name of the program containing varying out variable whose binding to modify + * @param colorNumber the color number to bind the user-defined varying out variable to + * @param name the name of the user-defined varying out variable whose binding to modify + * + * @see Reference Page + */ + public static void glBindFragDataLocation(@NativeType("GLuint") int program, @NativeType("GLuint") int colorNumber, @NativeType("GLchar const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + nglBindFragDataLocation(program, colorNumber, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetFragDataLocation ] --- + + /** Unsafe version of: {@link #glGetFragDataLocation GetFragDataLocation} */ + public static native int nglGetFragDataLocation(int program, long name); + + /** + * Queries the bindings of color numbers to user-defined varying out variables. + * + * @param program the name of the program containing varying out variable whose binding to query + * @param name the name of the user-defined varying out variable whose binding to query + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetFragDataLocation(@NativeType("GLuint") int program, @NativeType("GLchar const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nglGetFragDataLocation(program, memAddress(name)); + } + + /** + * Queries the bindings of color numbers to user-defined varying out variables. + * + * @param program the name of the program containing varying out variable whose binding to query + * @param name the name of the user-defined varying out variable whose binding to query + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetFragDataLocation(@NativeType("GLuint") int program, @NativeType("GLchar const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + return nglGetFragDataLocation(program, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glBeginConditionalRender ] --- + + /** + * Starts conditional rendering. + * + * @param id the name of an occlusion query object whose results are used to determine if the rendering commands are discarded + * @param mode how {@code glBeginConditionalRender} interprets the results of the occlusion query. One of:
{@link #GL_QUERY_WAIT QUERY_WAIT}{@link #GL_QUERY_NO_WAIT QUERY_NO_WAIT}{@link #GL_QUERY_BY_REGION_WAIT QUERY_BY_REGION_WAIT}
{@link #GL_QUERY_BY_REGION_NO_WAIT QUERY_BY_REGION_NO_WAIT}{@link GL45#GL_QUERY_WAIT_INVERTED QUERY_WAIT_INVERTED}{@link GL45#GL_QUERY_NO_WAIT_INVERTED QUERY_NO_WAIT_INVERTED}
{@link GL45#GL_QUERY_BY_REGION_WAIT_INVERTED QUERY_BY_REGION_WAIT_INVERTED}{@link GL45#GL_QUERY_BY_REGION_NO_WAIT_INVERTED QUERY_BY_REGION_NO_WAIT_INVERTED}
+ * + * @see Reference Page + */ + public static native void glBeginConditionalRender(@NativeType("GLuint") int id, @NativeType("GLenum") int mode); + + // --- [ glEndConditionalRender ] --- + + /** + * Ends conditional rendering. + * + * @see Reference Page + */ + public static native void glEndConditionalRender(); + + // --- [ glMapBufferRange ] --- + + /** Unsafe version of: {@link #glMapBufferRange MapBufferRange} */ + public static native long nglMapBufferRange(int target, long offset, long length, int access); + + /** + * Maps a section of a buffer object's data store. + * + *

LWJGL note: This method comes in 2 flavors:

+ * + *
    + *
  1. {@link #glMapBufferRange(int, long, long, int)} - Always returns a new ByteBuffer instance.
  2. + *
  3. {@link #glMapBufferRange(int, long, long, int, ByteBuffer)} - The {@code old_buffer} parameter is reused if not null.
  4. + *
+ * + * @param target a binding to which the target buffer is bound. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link #GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the starting offset within the buffer of the range to be mapped + * @param length the length of the range to be mapped + * @param access a combination of access flags indicating the desired access to the range. One or more of:
{@link #GL_MAP_READ_BIT MAP_READ_BIT}{@link #GL_MAP_WRITE_BIT MAP_WRITE_BIT}{@link #GL_MAP_INVALIDATE_RANGE_BIT MAP_INVALIDATE_RANGE_BIT}{@link #GL_MAP_INVALIDATE_BUFFER_BIT MAP_INVALIDATE_BUFFER_BIT}
{@link #GL_MAP_FLUSH_EXPLICIT_BIT MAP_FLUSH_EXPLICIT_BIT}{@link #GL_MAP_UNSYNCHRONIZED_BIT MAP_UNSYNCHRONIZED_BIT}
+ * + * @see Reference Page + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapBufferRange(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length, @NativeType("GLbitfield") int access) { + long __result = nglMapBufferRange(target, offset, length, access); + return memByteBufferSafe(__result, (int)length); + } + + /** + * Maps a section of a buffer object's data store. + * + *

LWJGL note: This method comes in 2 flavors:

+ * + *
    + *
  1. {@link #glMapBufferRange(int, long, long, int)} - Always returns a new ByteBuffer instance.
  2. + *
  3. {@link #glMapBufferRange(int, long, long, int, ByteBuffer)} - The {@code old_buffer} parameter is reused if not null.
  4. + *
+ * + * @param target a binding to which the target buffer is bound. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link #GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the starting offset within the buffer of the range to be mapped + * @param length the length of the range to be mapped + * @param access a combination of access flags indicating the desired access to the range. One or more of:
{@link #GL_MAP_READ_BIT MAP_READ_BIT}{@link #GL_MAP_WRITE_BIT MAP_WRITE_BIT}{@link #GL_MAP_INVALIDATE_RANGE_BIT MAP_INVALIDATE_RANGE_BIT}{@link #GL_MAP_INVALIDATE_BUFFER_BIT MAP_INVALIDATE_BUFFER_BIT}
{@link #GL_MAP_FLUSH_EXPLICIT_BIT MAP_FLUSH_EXPLICIT_BIT}{@link #GL_MAP_UNSYNCHRONIZED_BIT MAP_UNSYNCHRONIZED_BIT}
+ * + * @see Reference Page + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapBufferRange(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length, @NativeType("GLbitfield") int access, @Nullable ByteBuffer old_buffer) { + long __result = nglMapBufferRange(target, offset, length, access); + return apiGetMappedBuffer(old_buffer, __result, (int)length); + } + + // --- [ glFlushMappedBufferRange ] --- + + /** + * Indicates modifications to a range of a mapped buffer. + * + * @param target the target of the flush operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link #GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param offset the start of the buffer subrange, in basic machine units + * @param length the length of the buffer subrange, in basic machine units + * + * @see Reference Page + */ + public static native void glFlushMappedBufferRange(@NativeType("GLenum") int target, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length); + + // --- [ glClampColor ] --- + + /** + * Controls color clamping. + * + * @param target target for color clamping. Must be:
{@link #GL_CLAMP_READ_COLOR CLAMP_READ_COLOR}
+ * @param clamp whether to apply color clamping. One of:
{@link GL11#GL_TRUE TRUE}{@link GL11#GL_FALSE FALSE}{@link #GL_FIXED_ONLY FIXED_ONLY}
+ * + * @see Reference Page + */ + public static native void glClampColor(@NativeType("GLenum") int target, @NativeType("GLenum") int clamp); + + // --- [ glIsRenderbuffer ] --- + + /** + * Determines if a name corresponds to a renderbuffer object. + * + * @param renderbuffer a value that may be the name of a renderbuffer object + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static native boolean glIsRenderbuffer(@NativeType("GLuint") int renderbuffer); + + // --- [ glBindRenderbuffer ] --- + + /** + * Binds a renderbuffer to a renderbuffer target. + * + * @param target the renderbuffer target of the binding operation. Must be:
{@link #GL_RENDERBUFFER RENDERBUFFER}
+ * @param renderbuffer the name of the renderbuffer object to bind + * + * @see Reference Page + */ + public static native void glBindRenderbuffer(@NativeType("GLenum") int target, @NativeType("GLuint") int renderbuffer); + + // --- [ glDeleteRenderbuffers ] --- + + /** + * Unsafe version of: {@link #glDeleteRenderbuffers DeleteRenderbuffers} + * + * @param n the number of renderbuffer objects to be deleted + */ + public static native void nglDeleteRenderbuffers(int n, long renderbuffers); + + /** + * Deletes renderbuffer objects. + * + * @param renderbuffers an array containing {@code n} renderbuffer objects to be deleted + * + * @see Reference Page + */ + public static void glDeleteRenderbuffers(@NativeType("GLuint const *") IntBuffer renderbuffers) { + nglDeleteRenderbuffers(renderbuffers.remaining(), memAddress(renderbuffers)); + } + + /** + * Deletes renderbuffer objects. + * + * @see Reference Page + */ + public static void glDeleteRenderbuffers(@NativeType("GLuint const *") int renderbuffer) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer renderbuffers = stack.ints(renderbuffer); + nglDeleteRenderbuffers(1, memAddress(renderbuffers)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGenRenderbuffers ] --- + + /** + * Unsafe version of: {@link #glGenRenderbuffers GenRenderbuffers} + * + * @param n the number of renderbuffer object names to generate + */ + public static native void nglGenRenderbuffers(int n, long renderbuffers); + + /** + * Generates renderbuffer object names. + * + * @param renderbuffers a buffer in which the generated renderbuffer object names are stored + * + * @see Reference Page + */ + public static void glGenRenderbuffers(@NativeType("GLuint *") IntBuffer renderbuffers) { + nglGenRenderbuffers(renderbuffers.remaining(), memAddress(renderbuffers)); + } + + /** + * Generates renderbuffer object names. + * + * @see Reference Page + */ + @NativeType("void") + public static int glGenRenderbuffers() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer renderbuffers = stack.callocInt(1); + nglGenRenderbuffers(1, memAddress(renderbuffers)); + return renderbuffers.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glRenderbufferStorage ] --- + + /** + * Establishes data storage, format and dimensions of a renderbuffer object's image. + * + * @param target the target of the allocation. Must be:
{@link #GL_RENDERBUFFER RENDERBUFFER}
+ * @param internalformat the internal format to use for the renderbuffer object's image. Must be a color-renderable, depth-renderable, or stencil-renderable format. + * @param width the width of the renderbuffer, in pixels + * @param height the height of the renderbuffer, in pixels + * + * @see Reference Page + */ + public static native void glRenderbufferStorage(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glRenderbufferStorageMultisample ] --- + + /** + * Establishes data storage, format, dimensions and sample count of a renderbuffer object's image. + * + *

{@link #glRenderbufferStorage RenderbufferStorage} is equivalent to calling this method with the samples set to zero.

+ * + * @param target the target of the allocation. Must be:
{@link #GL_RENDERBUFFER RENDERBUFFER}
+ * @param samples the number of samples to be used for the renderbuffer object's storage + * @param internalformat the internal format to use for the renderbuffer object's image. Must be a color-renderable, depth-renderable, or stencil-renderable format. + * @param width the width of the renderbuffer, in pixels + * @param height the height of the renderbuffer, in pixels + * + * @see Reference Page + */ + public static native void glRenderbufferStorageMultisample(@NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glGetRenderbufferParameteriv ] --- + + /** Unsafe version of: {@link #glGetRenderbufferParameteriv GetRenderbufferParameteriv} */ + public static native void nglGetRenderbufferParameteriv(int target, int pname, long params); + + /** + * Retrieves information about a bound renderbuffer object. + * + * @param target the target of the query operation. Must be:
{@link #GL_RENDERBUFFER RENDERBUFFER}
+ * @param pname the parameter whose value to retrieve from the renderbuffer bound to {@code target}. One of:
{@link #GL_RENDERBUFFER_WIDTH RENDERBUFFER_WIDTH}{@link #GL_RENDERBUFFER_HEIGHT RENDERBUFFER_HEIGHT}{@link #GL_RENDERBUFFER_INTERNAL_FORMAT RENDERBUFFER_INTERNAL_FORMAT}
{@link #GL_RENDERBUFFER_RED_SIZE RENDERBUFFER_RED_SIZE}{@link #GL_RENDERBUFFER_GREEN_SIZE RENDERBUFFER_GREEN_SIZE}{@link #GL_RENDERBUFFER_BLUE_SIZE RENDERBUFFER_BLUE_SIZE}
{@link #GL_RENDERBUFFER_ALPHA_SIZE RENDERBUFFER_ALPHA_SIZE}{@link #GL_RENDERBUFFER_DEPTH_SIZE RENDERBUFFER_DEPTH_SIZE}{@link #GL_RENDERBUFFER_STENCIL_SIZE RENDERBUFFER_STENCIL_SIZE}
{@link #GL_RENDERBUFFER_SAMPLES RENDERBUFFER_SAMPLES}
+ * @param params an array to receive the value of the queried parameter + * + * @see Reference Page + */ + public static void glGetRenderbufferParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetRenderbufferParameteriv(target, pname, memAddress(params)); + } + + /** + * Retrieves information about a bound renderbuffer object. + * + * @param target the target of the query operation. Must be:
{@link #GL_RENDERBUFFER RENDERBUFFER}
+ * @param pname the parameter whose value to retrieve from the renderbuffer bound to {@code target}. One of:
{@link #GL_RENDERBUFFER_WIDTH RENDERBUFFER_WIDTH}{@link #GL_RENDERBUFFER_HEIGHT RENDERBUFFER_HEIGHT}{@link #GL_RENDERBUFFER_INTERNAL_FORMAT RENDERBUFFER_INTERNAL_FORMAT}
{@link #GL_RENDERBUFFER_RED_SIZE RENDERBUFFER_RED_SIZE}{@link #GL_RENDERBUFFER_GREEN_SIZE RENDERBUFFER_GREEN_SIZE}{@link #GL_RENDERBUFFER_BLUE_SIZE RENDERBUFFER_BLUE_SIZE}
{@link #GL_RENDERBUFFER_ALPHA_SIZE RENDERBUFFER_ALPHA_SIZE}{@link #GL_RENDERBUFFER_DEPTH_SIZE RENDERBUFFER_DEPTH_SIZE}{@link #GL_RENDERBUFFER_STENCIL_SIZE RENDERBUFFER_STENCIL_SIZE}
{@link #GL_RENDERBUFFER_SAMPLES RENDERBUFFER_SAMPLES}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetRenderbufferParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetRenderbufferParameteriv(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glIsFramebuffer ] --- + + /** + * Determines if a name corresponds to a framebuffer object. + * + * @param framebuffer a value that may be the name of a framebuffer object + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static native boolean glIsFramebuffer(@NativeType("GLuint") int framebuffer); + + // --- [ glBindFramebuffer ] --- + + /** + * Binds a framebuffer to a framebuffer target. + * + * @param target the framebuffer target of the binding operation. One of:
{@link #GL_FRAMEBUFFER FRAMEBUFFER}{@link #GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link #GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param framebuffer the name of the framebuffer object to bind + * + * @see Reference Page + */ + public static native void glBindFramebuffer(@NativeType("GLenum") int target, @NativeType("GLuint") int framebuffer); + + // --- [ glDeleteFramebuffers ] --- + + /** + * Unsafe version of: {@link #glDeleteFramebuffers DeleteFramebuffers} + * + * @param n the number of framebuffer objects to be deleted + */ + public static native void nglDeleteFramebuffers(int n, long framebuffers); + + /** + * Deletes framebuffer objects. + * + * @param framebuffers an array containing {@code n} framebuffer objects to be deleted + * + * @see Reference Page + */ + public static void glDeleteFramebuffers(@NativeType("GLuint const *") IntBuffer framebuffers) { + nglDeleteFramebuffers(framebuffers.remaining(), memAddress(framebuffers)); + } + + /** + * Deletes framebuffer objects. + * + * @see Reference Page + */ + public static void glDeleteFramebuffers(@NativeType("GLuint const *") int framebuffer) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer framebuffers = stack.ints(framebuffer); + nglDeleteFramebuffers(1, memAddress(framebuffers)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGenFramebuffers ] --- + + /** + * Unsafe version of: {@link #glGenFramebuffers GenFramebuffers} + * + * @param n the number of framebuffer object names to generate + */ + public static native void nglGenFramebuffers(int n, long framebuffers); + + /** + * Generates framebuffer object names. + * + * @param framebuffers a buffer in which the generated framebuffer object names are stored + * + * @see Reference Page + */ + public static void glGenFramebuffers(@NativeType("GLuint *") IntBuffer framebuffers) { + nglGenFramebuffers(framebuffers.remaining(), memAddress(framebuffers)); + } + + /** + * Generates framebuffer object names. + * + * @see Reference Page + */ + @NativeType("void") + public static int glGenFramebuffers() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer framebuffers = stack.callocInt(1); + nglGenFramebuffers(1, memAddress(framebuffers)); + return framebuffers.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glCheckFramebufferStatus ] --- + + /** + * Checks the completeness status of a framebuffer. + * + * @param target the target of the framebuffer completeness check. One of:
{@link #GL_FRAMEBUFFER FRAMEBUFFER}{@link #GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link #GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * + * @see Reference Page + */ + @NativeType("GLenum") + public static native int glCheckFramebufferStatus(@NativeType("GLenum") int target); + + // --- [ glFramebufferTexture1D ] --- + + /** + * Attaches a level of a 1D texture object as a logical buffer to the currently bound framebuffer object. + * + * @param target the framebuffer target. One of:
{@link #GL_FRAMEBUFFER FRAMEBUFFER}{@link #GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link #GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment point of the framebuffer. One of:
{@link #GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link #GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link #GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link #GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link #GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link #GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link #GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link #GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link #GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link #GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link #GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link #GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link #GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link #GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link #GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link #GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link #GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link #GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link #GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link #GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link #GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link #GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link #GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link #GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link #GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link #GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link #GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link #GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link #GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link #GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link #GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link #GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link #GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link #GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link #GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param textarget the type of texture + * @param texture the texture object to attach to the framebuffer attachment point named by {@code attachment} + * @param level the mipmap level of {@code texture} to attach + * + * @see Reference Page + */ + public static native void glFramebufferTexture1D(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int textarget, @NativeType("GLuint") int texture, @NativeType("GLint") int level); + + // --- [ glFramebufferTexture2D ] --- + + /** + * Attaches a level of a 2D texture object as a logical buffer to the currently bound framebuffer object. + * + * @param target the framebuffer target. One of:
{@link #GL_FRAMEBUFFER FRAMEBUFFER}{@link #GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link #GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment point of the framebuffer. One of:
{@link #GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link #GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link #GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link #GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link #GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link #GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link #GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link #GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link #GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link #GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link #GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link #GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link #GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link #GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link #GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link #GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link #GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link #GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link #GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link #GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link #GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link #GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link #GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link #GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link #GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link #GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link #GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link #GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link #GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link #GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link #GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link #GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link #GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link #GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link #GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param textarget the type of texture + * @param texture the texture object to attach to the framebuffer attachment point named by {@code attachment} + * @param level the mipmap level of {@code texture} to attach + * + * @see Reference Page + */ + public static native void glFramebufferTexture2D(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int textarget, @NativeType("GLuint") int texture, @NativeType("GLint") int level); + + // --- [ glFramebufferTexture3D ] --- + + /** + * Attaches a layer of a 3D texture object as a logical buffer to the currently bound framebuffer object. + * + * @param target the framebuffer target. One of:
{@link #GL_FRAMEBUFFER FRAMEBUFFER}{@link #GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link #GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment point of the framebuffer. One of:
{@link #GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link #GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link #GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link #GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link #GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link #GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link #GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link #GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link #GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link #GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link #GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link #GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link #GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link #GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link #GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link #GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link #GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link #GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link #GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link #GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link #GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link #GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link #GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link #GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link #GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link #GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link #GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link #GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link #GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link #GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link #GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link #GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link #GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link #GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link #GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param textarget the type of texture + * @param texture the texture object to attach to the framebuffer attachment point named by {@code attachment} + * @param level the mipmap level of {@code texture} to attach + * @param layer the layer of a 2-dimensional image within the 3-dimensional texture. + * + * @see Reference Page + */ + public static native void glFramebufferTexture3D(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int textarget, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int layer); + + // --- [ glFramebufferTextureLayer ] --- + + /** + * Attaches a single layer of a texture to a framebuffer + * + * @param target the framebuffer target. One of:
{@link #GL_FRAMEBUFFER FRAMEBUFFER}{@link #GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link #GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment point of the framebuffer. One of:
{@link #GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link #GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link #GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link #GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link #GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link #GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link #GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link #GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link #GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link #GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link #GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link #GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link #GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link #GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link #GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link #GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link #GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link #GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link #GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link #GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link #GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link #GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link #GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link #GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link #GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link #GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link #GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link #GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link #GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link #GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link #GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link #GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link #GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link #GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link #GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param texture the texture object to attach to the framebuffer attachment point named by {@code attachment} + * @param level the mipmap level of {@code texture} to attach + * @param layer the layer of {@code texture} to attach. + * + * @see Reference Page + */ + public static native void glFramebufferTextureLayer(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int layer); + + // --- [ glFramebufferRenderbuffer ] --- + + /** + * Attaches a renderbuffer as a logical buffer to the currently bound framebuffer object. + * + * @param target the framebuffer target. One of:
{@link #GL_FRAMEBUFFER FRAMEBUFFER}{@link #GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link #GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment point of the framebuffer. One of:
{@link #GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link #GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link #GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link #GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link #GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link #GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link #GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link #GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link #GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link #GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link #GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link #GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link #GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link #GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link #GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link #GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link #GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link #GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link #GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link #GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link #GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link #GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link #GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link #GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link #GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link #GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link #GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link #GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link #GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link #GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link #GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link #GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link #GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link #GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link #GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param renderbuffertarget the renderbuffer target. Must be:
{@link #GL_RENDERBUFFER RENDERBUFFER}
+ * @param renderbuffer the name of an existing renderbuffer object of type {@code renderbuffertarget} to attach + * + * @see Reference Page + */ + public static native void glFramebufferRenderbuffer(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int renderbuffertarget, @NativeType("GLuint") int renderbuffer); + + // --- [ glGetFramebufferAttachmentParameteriv ] --- + + /** Unsafe version of: {@link #glGetFramebufferAttachmentParameteriv GetFramebufferAttachmentParameteriv} */ + public static native void nglGetFramebufferAttachmentParameteriv(int target, int attachment, int pname, long params); + + /** + * Retrievees information about attachments of a bound framebuffer object. + * + * @param target the target of the query operation. One of:
{@link #GL_FRAMEBUFFER FRAMEBUFFER}{@link #GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link #GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment within {@code target}. One of:
{@link #GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link #GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link #GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link #GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link #GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link #GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link #GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link #GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link #GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link #GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link #GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link #GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link #GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link #GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link #GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link #GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link #GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link #GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link #GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link #GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link #GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link #GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link #GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link #GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link #GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link #GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link #GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link #GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link #GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link #GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link #GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link #GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link #GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link #GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link #GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param pname the parameter of {@code attachment} to query. One of:
{@link #GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE}{@link #GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME FRAMEBUFFER_ATTACHMENT_OBJECT_NAME}
{@link #GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL}{@link #GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE}
{@link #GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER}{@link #GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING}
{@link #GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE}{@link #GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE FRAMEBUFFER_ATTACHMENT_RED_SIZE}
{@link #GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE FRAMEBUFFER_ATTACHMENT_GREEN_SIZE}{@link #GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE FRAMEBUFFER_ATTACHMENT_BLUE_SIZE}
{@link #GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE}{@link #GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE}
{@link #GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE}
+ * @param params an array to receive the value of the queried parameter + * + * @see Reference Page + */ + public static void glGetFramebufferAttachmentParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetFramebufferAttachmentParameteriv(target, attachment, pname, memAddress(params)); + } + + /** + * Retrievees information about attachments of a bound framebuffer object. + * + * @param target the target of the query operation. One of:
{@link #GL_FRAMEBUFFER FRAMEBUFFER}{@link #GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link #GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment within {@code target}. One of:
{@link #GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link #GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link #GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link #GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link #GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link #GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link #GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link #GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link #GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link #GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link #GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link #GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link #GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link #GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link #GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link #GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link #GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link #GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link #GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link #GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link #GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link #GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link #GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link #GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link #GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link #GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link #GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link #GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link #GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link #GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link #GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link #GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link #GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link #GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link #GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param pname the parameter of {@code attachment} to query. One of:
{@link #GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE}{@link #GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME FRAMEBUFFER_ATTACHMENT_OBJECT_NAME}
{@link #GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL}{@link #GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE}
{@link #GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER}{@link #GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING}
{@link #GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE}{@link #GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE FRAMEBUFFER_ATTACHMENT_RED_SIZE}
{@link #GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE FRAMEBUFFER_ATTACHMENT_GREEN_SIZE}{@link #GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE FRAMEBUFFER_ATTACHMENT_BLUE_SIZE}
{@link #GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE}{@link #GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE}
{@link #GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetFramebufferAttachmentParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetFramebufferAttachmentParameteriv(target, attachment, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glBlitFramebuffer ] --- + + /** + * Copies a block of pixels from the read framebuffer to the draw framebuffer. + * + * @param srcX0 the lower-left coordinate of the source rectangle within the read buffer + * @param srcY0 the upper-left coordinate of the source rectangle within the read buffer + * @param srcX1 the lower-right coordinate of the source rectangle within the read buffer + * @param srcY1 the upper-right coordinate of the source rectangle within the read buffer + * @param dstX0 the lower-left coordinate of the destination rectangle within the write buffer + * @param dstY0 the upper-left coordinate of the destination rectangle within the write buffer + * @param dstX1 the lower-right coordinate of the destination rectangle within the write buffer + * @param dstY1 the upper-right coordinate of the destination rectangle within the write buffer + * @param mask the bitwise OR of the flags indicating which buffers are to be copied. One of:
{@link GL11#GL_COLOR_BUFFER_BIT COLOR_BUFFER_BIT}{@link GL11#GL_DEPTH_BUFFER_BIT DEPTH_BUFFER_BIT}{@link GL11#GL_STENCIL_BUFFER_BIT STENCIL_BUFFER_BIT}
+ * @param filter the interpolation to be applied if the image is stretched. One of:
{@link GL11#GL_NEAREST NEAREST}{@link GL11#GL_LINEAR LINEAR}
+ * + * @see Reference Page + */ + public static native void glBlitFramebuffer(@NativeType("GLint") int srcX0, @NativeType("GLint") int srcY0, @NativeType("GLint") int srcX1, @NativeType("GLint") int srcY1, @NativeType("GLint") int dstX0, @NativeType("GLint") int dstY0, @NativeType("GLint") int dstX1, @NativeType("GLint") int dstY1, @NativeType("GLbitfield") int mask, @NativeType("GLenum") int filter); + + // --- [ glGenerateMipmap ] --- + + /** + * Generate mipmaps for a specified texture target. + * + * @param target the target to which the texture whose mimaps to generate is bound. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link #GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link #GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
+ * + * @see Reference Page + */ + public static native void glGenerateMipmap(@NativeType("GLenum") int target); + + // --- [ glTexParameterIiv ] --- + + /** Unsafe version of: {@link #glTexParameterIiv TexParameterIiv} */ + public static native void nglTexParameterIiv(int target, int pname, long params); + + /** + * Sets the integer value of a texture parameter. + * + * @param target the texture target + * @param pname the symbolic name of a single-valued texture parameter + * @param params the value of {@code pname} + * + * @see Reference Page + */ + public static void glTexParameterIiv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglTexParameterIiv(target, pname, memAddress(params)); + } + + /** + * Sets the integer value of a texture parameter. + * + * @param target the texture target + * @param pname the symbolic name of a single-valued texture parameter + * + * @see Reference Page + */ + public static void glTexParameterIi(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") int param) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.ints(param); + nglTexParameterIiv(target, pname, memAddress(params)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glTexParameterIuiv ] --- + + /** Unsafe version of: {@link #glTexParameterIuiv TexParameterIuiv} */ + public static native void nglTexParameterIuiv(int target, int pname, long params); + + /** + * Sets the unsigned integer value of a texture parameter. + * + * @param target the texture target + * @param pname the symbolic name of a single-valued texture parameter + * @param params the value of {@code pname} + * + * @see Reference Page + */ + public static void glTexParameterIuiv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint const *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglTexParameterIuiv(target, pname, memAddress(params)); + } + + /** + * Sets the unsigned integer value of a texture parameter. + * + * @param target the texture target + * @param pname the symbolic name of a single-valued texture parameter + * + * @see Reference Page + */ + public static void glTexParameterIui(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint const *") int param) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.ints(param); + nglTexParameterIuiv(target, pname, memAddress(params)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTexParameterIiv ] --- + + /** Unsafe version of: {@link #glGetTexParameterIiv GetTexParameterIiv} */ + public static native void nglGetTexParameterIiv(int target, int pname, long params); + + /** + * Returns the integer value of a texture parameter. + * + * @param target the texture target + * @param pname the symbolic name of a texture parameter + * @param params returns the texture parameter value + * + * @see Reference Page + */ + public static void glGetTexParameterIiv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetTexParameterIiv(target, pname, memAddress(params)); + } + + /** + * Returns the integer value of a texture parameter. + * + * @param target the texture target + * @param pname the symbolic name of a texture parameter + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetTexParameterIi(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetTexParameterIiv(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTexParameterIuiv ] --- + + /** Unsafe version of: {@link #glGetTexParameterIuiv GetTexParameterIuiv} */ + public static native void nglGetTexParameterIuiv(int target, int pname, long params); + + /** + * Returns the unsigned integer value of a texture parameter. + * + * @param target the texture target + * @param pname the symbolic name of a texture parameter + * @param params returns the texture parameter value + * + * @see Reference Page + */ + public static void glGetTexParameterIuiv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetTexParameterIuiv(target, pname, memAddress(params)); + } + + /** + * Returns the unsigned integer value of a texture parameter. + * + * @param target the texture target + * @param pname the symbolic name of a texture parameter + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetTexParameterIui(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetTexParameterIuiv(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glColorMaski ] --- + + /** + * Enables and disables writing of frame buffer color components. + * + * @param buf the index of the draw buffer whose color mask to set + * @param r whether R values are written or not + * @param g whether G values are written or not + * @param b whether B values are written or not + * @param a whether A values are written or not + * + * @see Reference Page + */ + public static native void glColorMaski(@NativeType("GLuint") int buf, @NativeType("GLboolean") boolean r, @NativeType("GLboolean") boolean g, @NativeType("GLboolean") boolean b, @NativeType("GLboolean") boolean a); + + // --- [ glGetBooleani_v ] --- + + /** Unsafe version of: {@link #glGetBooleani_v GetBooleani_v} */ + public static native void nglGetBooleani_v(int target, int index, long data); + + /** + * Queries the boolean value of an indexed state variable. + * + * @param target the indexed state to query + * @param index the index of the element being queried + * @param data a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetBooleani_v(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLboolean *") ByteBuffer data) { + if (CHECKS) { + check(data, 1); + } + nglGetBooleani_v(target, index, memAddress(data)); + } + + /** + * Queries the boolean value of an indexed state variable. + * + * @param target the indexed state to query + * @param index the index of the element being queried + * + * @see Reference Page + */ + @NativeType("void") + public static boolean glGetBooleani(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + ByteBuffer data = stack.calloc(1); + nglGetBooleani_v(target, index, memAddress(data)); + return data.get(0) != 0; + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetIntegeri_v ] --- + + /** Unsafe version of: {@link #glGetIntegeri_v GetIntegeri_v} */ + public static native void nglGetIntegeri_v(int target, int index, long data); + + /** + * Queries the integer value of an indexed state variable. + * + * @param target the indexed state to query + * @param index the index of the element being queried + * @param data a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetIntegeri_v(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLint *") IntBuffer data) { + if (CHECKS) { + check(data, 1); + } + nglGetIntegeri_v(target, index, memAddress(data)); + } + + /** + * Queries the integer value of an indexed state variable. + * + * @param target the indexed state to query + * @param index the index of the element being queried + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetIntegeri(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer data = stack.callocInt(1); + nglGetIntegeri_v(target, index, memAddress(data)); + return data.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glEnablei ] --- + + /** + * Enables an indexed capability. + * + * @param cap the indexed capability to enable + * @param index the index to enable + * + * @see Reference Page + */ + public static native void glEnablei(@NativeType("GLenum") int cap, @NativeType("GLuint") int index); + + // --- [ glDisablei ] --- + + /** + * Disables an indexed capability. + * + * @param target the indexed capability to disable + * @param index the index to disable + * + * @see Reference Page + */ + public static native void glDisablei(@NativeType("GLenum") int target, @NativeType("GLuint") int index); + + // --- [ glIsEnabledi ] --- + + /** + * Tests whether an indexed capability is enabled. + * + * @param target the indexed capability to query + * @param index the index to query + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static native boolean glIsEnabledi(@NativeType("GLenum") int target, @NativeType("GLuint") int index); + + // --- [ glBindBufferRange ] --- + + /** + * Binds a range within a buffer object to an indexed buffer target. + * + * @param target the target of the bind operation. One of:
{@link #GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}
+ * @param index the index of the binding point within the array specified by {@code target} + * @param buffer a buffer object to bind to the specified binding point + * @param offset the starting offset in basic machine units into the buffer object {@code buffer} + * @param size the amount of data in machine units that can be read from the buffer object while used as an indexed target + * + * @see Reference Page + */ + public static native void glBindBufferRange(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size); + + // --- [ glBindBufferBase ] --- + + /** + * Binds a buffer object to an indexed buffer target. + * + * @param target the target of the bind operation. One of:
{@link #GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}
+ * @param index the index of the binding point within the array specified by {@code target} + * @param buffer a buffer object to bind to the specified binding point + * + * @see Reference Page + */ + public static native void glBindBufferBase(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLuint") int buffer); + + // --- [ glBeginTransformFeedback ] --- + + /** + * Starts transform feedback operation. + * + * @param primitiveMode the output type of the primitives that will be recorded into the buffer objects that are bound for transform feedback. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLES TRIANGLES}
+ * + * @see Reference Page + */ + public static native void glBeginTransformFeedback(@NativeType("GLenum") int primitiveMode); + + // --- [ glEndTransformFeedback ] --- + + /** + * Ends transform feedback operation. + * + * @see Reference Page + */ + public static native void glEndTransformFeedback(); + + // --- [ glTransformFeedbackVaryings ] --- + + /** + * Unsafe version of: {@link #glTransformFeedbackVaryings TransformFeedbackVaryings} + * + * @param count the number of varying variables used for transform feedback + */ + public static native void nglTransformFeedbackVaryings(int program, int count, long varyings, int bufferMode); + + /** + * Specifies values to record in transform feedback buffers. + * + * @param program the target program object + * @param varyings an array of {@code count} zero-terminated strings specifying the names of the varying variables to use for transform feedback + * @param bufferMode the mode used to capture the varying variables when transform feedback is active. One of:
{@link #GL_INTERLEAVED_ATTRIBS INTERLEAVED_ATTRIBS}{@link #GL_SEPARATE_ATTRIBS SEPARATE_ATTRIBS}
+ * + * @see Reference Page + */ + public static void glTransformFeedbackVaryings(@NativeType("GLuint") int program, @NativeType("GLchar const **") PointerBuffer varyings, @NativeType("GLenum") int bufferMode) { + nglTransformFeedbackVaryings(program, varyings.remaining(), memAddress(varyings), bufferMode); + } + + /** + * Specifies values to record in transform feedback buffers. + * + * @param program the target program object + * @param varyings an array of {@code count} zero-terminated strings specifying the names of the varying variables to use for transform feedback + * @param bufferMode the mode used to capture the varying variables when transform feedback is active. One of:
{@link #GL_INTERLEAVED_ATTRIBS INTERLEAVED_ATTRIBS}{@link #GL_SEPARATE_ATTRIBS SEPARATE_ATTRIBS}
+ * + * @see Reference Page + */ + public static void glTransformFeedbackVaryings(@NativeType("GLuint") int program, @NativeType("GLchar const **") CharSequence[] varyings, @NativeType("GLenum") int bufferMode) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + long varyingsAddress = org.lwjgl.system.APIUtil.apiArray(stack, MemoryUtil::memASCII, varyings); + nglTransformFeedbackVaryings(program, varyings.length, varyingsAddress, bufferMode); + org.lwjgl.system.APIUtil.apiArrayFree(varyingsAddress, varyings.length); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Specifies values to record in transform feedback buffers. + * + * @param program the target program object + * @param bufferMode the mode used to capture the varying variables when transform feedback is active. One of:
{@link #GL_INTERLEAVED_ATTRIBS INTERLEAVED_ATTRIBS}{@link #GL_SEPARATE_ATTRIBS SEPARATE_ATTRIBS}
+ * + * @see Reference Page + */ + public static void glTransformFeedbackVaryings(@NativeType("GLuint") int program, @NativeType("GLchar const **") CharSequence varying, @NativeType("GLenum") int bufferMode) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + long varyingsAddress = org.lwjgl.system.APIUtil.apiArray(stack, MemoryUtil::memASCII, varying); + nglTransformFeedbackVaryings(program, 1, varyingsAddress, bufferMode); + org.lwjgl.system.APIUtil.apiArrayFree(varyingsAddress, 1); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTransformFeedbackVarying ] --- + + /** + * Unsafe version of: {@link #glGetTransformFeedbackVarying GetTransformFeedbackVarying} + * + * @param bufSize the maximum number of characters, including the null terminator, that may be written into {@code name} + */ + public static native void nglGetTransformFeedbackVarying(int program, int index, int bufSize, long length, long size, long type, long name); + + /** + * Retrieves information about varying variables selected for transform feedback. + * + * @param program the target program object + * @param index the index of the varying variable whose information to retrieve + * @param length a variable which will receive the number of characters written into {@code name}, excluding the null-terminator. If {@code length} is NULL no length is returned. + * @param size a variable that will receive the size of the varying + * @param type a variable that will receive the type of the varying + * @param name a buffer into which will be written the name of the varying + * + * @see Reference Page + */ + public static void glGetTransformFeedbackVarying(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLsizei *") IntBuffer size, @NativeType("GLenum *") IntBuffer type, @NativeType("GLchar *") ByteBuffer name) { + if (CHECKS) { + checkSafe(length, 1); + check(size, 1); + check(type, 1); + } + nglGetTransformFeedbackVarying(program, index, name.remaining(), memAddressSafe(length), memAddress(size), memAddress(type), memAddress(name)); + } + + /** + * Retrieves information about varying variables selected for transform feedback. + * + * @param program the target program object + * @param index the index of the varying variable whose information to retrieve + * @param bufSize the maximum number of characters, including the null terminator, that may be written into {@code name} + * @param size a variable that will receive the size of the varying + * @param type a variable that will receive the type of the varying + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetTransformFeedbackVarying(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @NativeType("GLsizei") int bufSize, @NativeType("GLsizei *") IntBuffer size, @NativeType("GLenum *") IntBuffer type) { + if (CHECKS) { + check(size, 1); + check(type, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer length = stack.ints(0); + ByteBuffer name = stack.malloc(bufSize); + nglGetTransformFeedbackVarying(program, index, bufSize, memAddress(length), memAddress(size), memAddress(type), memAddress(name)); + return memASCII(name, length.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Retrieves information about varying variables selected for transform feedback. + * + * @param program the target program object + * @param index the index of the varying variable whose information to retrieve + * @param size a variable that will receive the size of the varying + * @param type a variable that will receive the type of the varying + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetTransformFeedbackVarying(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @NativeType("GLsizei *") IntBuffer size, @NativeType("GLenum *") IntBuffer type) { + return glGetTransformFeedbackVarying(program, index, GL20.glGetProgrami(program, GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH), size, type); + } + + // --- [ glBindVertexArray ] --- + + /** + * Binds a vertex array object + * + * @param array the name of the vertex array to bind + * + * @see Reference Page + */ + public static native void glBindVertexArray(@NativeType("GLuint") int array); + + // --- [ glDeleteVertexArrays ] --- + + /** + * Unsafe version of: {@link #glDeleteVertexArrays DeleteVertexArrays} + * + * @param n the number of vertex array objects to be deleted + */ + public static native void nglDeleteVertexArrays(int n, long arrays); + + /** + * Deletes vertex array objects. + * + * @param arrays an array containing the n names of the objects to be deleted + * + * @see Reference Page + */ + public static void glDeleteVertexArrays(@NativeType("GLuint const *") IntBuffer arrays) { + nglDeleteVertexArrays(arrays.remaining(), memAddress(arrays)); + } + + /** + * Deletes vertex array objects. + * + * @see Reference Page + */ + public static void glDeleteVertexArrays(@NativeType("GLuint const *") int array) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer arrays = stack.ints(array); + nglDeleteVertexArrays(1, memAddress(arrays)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGenVertexArrays ] --- + + /** + * Unsafe version of: {@link #glGenVertexArrays GenVertexArrays} + * + * @param n the number of vertex array object names to generate + */ + public static native void nglGenVertexArrays(int n, long arrays); + + /** + * Generates vertex array object names. + * + * @param arrays a buffer in which the generated vertex array object names are stored + * + * @see Reference Page + */ + public static void glGenVertexArrays(@NativeType("GLuint *") IntBuffer arrays) { + nglGenVertexArrays(arrays.remaining(), memAddress(arrays)); + } + + /** + * Generates vertex array object names. + * + * @see Reference Page + */ + @NativeType("void") + public static int glGenVertexArrays() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer arrays = stack.callocInt(1); + nglGenVertexArrays(1, memAddress(arrays)); + return arrays.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glIsVertexArray ] --- + + /** + * Determines if a name corresponds to a vertex array object. + * + * @param array a value that may be the name of a vertex array object + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static native boolean glIsVertexArray(@NativeType("GLuint") int array); + + /** + * Array version of: {@link #glClearBufferiv ClearBufferiv} + * + * @see Reference Page + */ + public static void glClearBufferiv(@NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLint *") int[] value) { + long __functionAddress = GL.getICD().glClearBufferiv; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + callPV(buffer, drawbuffer, value, __functionAddress); + } + + /** + * Array version of: {@link #glClearBufferuiv ClearBufferuiv} + * + * @see Reference Page + */ + public static void glClearBufferuiv(@NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLint *") int[] value) { + long __functionAddress = GL.getICD().glClearBufferuiv; + if (CHECKS) { + check(__functionAddress); + check(value, 4); + } + callPV(buffer, drawbuffer, value, __functionAddress); + } + + /** + * Array version of: {@link #glClearBufferfv ClearBufferfv} + * + * @see Reference Page + */ + public static void glClearBufferfv(@NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLfloat *") float[] value) { + long __functionAddress = GL.getICD().glClearBufferfv; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + callPV(buffer, drawbuffer, value, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttribI1iv VertexAttribI1iv} + * + * @see Reference Page + */ + public static void glVertexAttribI1iv(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttribI1iv; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttribI2iv VertexAttribI2iv} + * + * @see Reference Page + */ + public static void glVertexAttribI2iv(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttribI2iv; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttribI3iv VertexAttribI3iv} + * + * @see Reference Page + */ + public static void glVertexAttribI3iv(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttribI3iv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttribI4iv VertexAttribI4iv} + * + * @see Reference Page + */ + public static void glVertexAttribI4iv(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttribI4iv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttribI1uiv VertexAttribI1uiv} + * + * @see Reference Page + */ + public static void glVertexAttribI1uiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttribI1uiv; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttribI2uiv VertexAttribI2uiv} + * + * @see Reference Page + */ + public static void glVertexAttribI2uiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttribI2uiv; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttribI3uiv VertexAttribI3uiv} + * + * @see Reference Page + */ + public static void glVertexAttribI3uiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttribI3uiv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttribI4uiv VertexAttribI4uiv} + * + * @see Reference Page + */ + public static void glVertexAttribI4uiv(@NativeType("GLuint") int index, @NativeType("GLuint const *") int[] v) { + long __functionAddress = GL.getICD().glVertexAttribI4uiv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttribI4sv VertexAttribI4sv} + * + * @see Reference Page + */ + public static void glVertexAttribI4sv(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttribI4sv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttribI4usv VertexAttribI4usv} + * + * @see Reference Page + */ + public static void glVertexAttribI4usv(@NativeType("GLuint") int index, @NativeType("GLshort const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttribI4usv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glGetVertexAttribIiv GetVertexAttribIiv} + * + * @see Reference Page + */ + public static void glGetVertexAttribIiv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetVertexAttribIiv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(index, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetVertexAttribIuiv GetVertexAttribIuiv} + * + * @see Reference Page + */ + public static void glGetVertexAttribIuiv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLuint *") int[] params) { + long __functionAddress = GL.getICD().glGetVertexAttribIuiv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(index, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glUniform1uiv Uniform1uiv} + * + * @see Reference Page + */ + public static void glUniform1uiv(@NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glUniform1uiv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniform2uiv Uniform2uiv} + * + * @see Reference Page + */ + public static void glUniform2uiv(@NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glUniform2uiv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 1, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniform3uiv Uniform3uiv} + * + * @see Reference Page + */ + public static void glUniform3uiv(@NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glUniform3uiv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length / 3, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniform4uiv Uniform4uiv} + * + * @see Reference Page + */ + public static void glUniform4uiv(@NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glUniform4uiv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 2, value, __functionAddress); + } + + /** + * Array version of: {@link #glGetUniformuiv GetUniformuiv} + * + * @see Reference Page + */ + public static void glGetUniformuiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint *") int[] params) { + long __functionAddress = GL.getICD().glGetUniformuiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(program, location, params, __functionAddress); + } + + /** + * Array version of: {@link #glDeleteRenderbuffers DeleteRenderbuffers} + * + * @see Reference Page + */ + public static void glDeleteRenderbuffers(@NativeType("GLuint const *") int[] renderbuffers) { + long __functionAddress = GL.getICD().glDeleteRenderbuffers; + if (CHECKS) { + check(__functionAddress); + } + callPV(renderbuffers.length, renderbuffers, __functionAddress); + } + + /** + * Array version of: {@link #glGenRenderbuffers GenRenderbuffers} + * + * @see Reference Page + */ + public static void glGenRenderbuffers(@NativeType("GLuint *") int[] renderbuffers) { + long __functionAddress = GL.getICD().glGenRenderbuffers; + if (CHECKS) { + check(__functionAddress); + } + callPV(renderbuffers.length, renderbuffers, __functionAddress); + } + + /** + * Array version of: {@link #glGetRenderbufferParameteriv GetRenderbufferParameteriv} + * + * @see Reference Page + */ + public static void glGetRenderbufferParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetRenderbufferParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glDeleteFramebuffers DeleteFramebuffers} + * + * @see Reference Page + */ + public static void glDeleteFramebuffers(@NativeType("GLuint const *") int[] framebuffers) { + long __functionAddress = GL.getICD().glDeleteFramebuffers; + if (CHECKS) { + check(__functionAddress); + } + callPV(framebuffers.length, framebuffers, __functionAddress); + } + + /** + * Array version of: {@link #glGenFramebuffers GenFramebuffers} + * + * @see Reference Page + */ + public static void glGenFramebuffers(@NativeType("GLuint *") int[] framebuffers) { + long __functionAddress = GL.getICD().glGenFramebuffers; + if (CHECKS) { + check(__functionAddress); + } + callPV(framebuffers.length, framebuffers, __functionAddress); + } + + /** + * Array version of: {@link #glGetFramebufferAttachmentParameteriv GetFramebufferAttachmentParameteriv} + * + * @see Reference Page + */ + public static void glGetFramebufferAttachmentParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetFramebufferAttachmentParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, attachment, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glTexParameterIiv TexParameterIiv} + * + * @see Reference Page + */ + public static void glTexParameterIiv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glTexParameterIiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glTexParameterIuiv TexParameterIuiv} + * + * @see Reference Page + */ + public static void glTexParameterIuiv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint const *") int[] params) { + long __functionAddress = GL.getICD().glTexParameterIuiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetTexParameterIiv GetTexParameterIiv} + * + * @see Reference Page + */ + public static void glGetTexParameterIiv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetTexParameterIiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetTexParameterIuiv GetTexParameterIuiv} + * + * @see Reference Page + */ + public static void glGetTexParameterIuiv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint *") int[] params) { + long __functionAddress = GL.getICD().glGetTexParameterIuiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetIntegeri_v GetIntegeri_v} + * + * @see Reference Page + */ + public static void glGetIntegeri_v(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLint *") int[] data) { + long __functionAddress = GL.getICD().glGetIntegeri_v; + if (CHECKS) { + check(__functionAddress); + check(data, 1); + } + callPV(target, index, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetTransformFeedbackVarying GetTransformFeedbackVarying} + * + * @see Reference Page + */ + public static void glGetTransformFeedbackVarying(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLsizei *") int[] size, @NativeType("GLenum *") int[] type, @NativeType("GLchar *") ByteBuffer name) { + long __functionAddress = GL.getICD().glGetTransformFeedbackVarying; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + check(size, 1); + check(type, 1); + } + callPPPPV(program, index, name.remaining(), length, size, type, memAddress(name), __functionAddress); + } + + /** + * Array version of: {@link #glDeleteVertexArrays DeleteVertexArrays} + * + * @see Reference Page + */ + public static void glDeleteVertexArrays(@NativeType("GLuint const *") int[] arrays) { + long __functionAddress = GL.getICD().glDeleteVertexArrays; + if (CHECKS) { + check(__functionAddress); + } + callPV(arrays.length, arrays, __functionAddress); + } + + /** + * Array version of: {@link #glGenVertexArrays GenVertexArrays} + * + * @see Reference Page + */ + public static void glGenVertexArrays(@NativeType("GLuint *") int[] arrays) { + long __functionAddress = GL.getICD().glGenVertexArrays; + if (CHECKS) { + check(__functionAddress); + } + callPV(arrays.length, arrays, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL31.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL31.java new file mode 100644 index 00000000..d7f54f45 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL31.java @@ -0,0 +1,668 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * The OpenGL functionality up to version 3.1. Includes the deprecated symbols of the Compatibility Profile. + * + *

OpenGL 3.1 implementations support revision 1.40 of the OpenGL Shading Language.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL31 extends GL30 { + + /** Accepted by the {@code internalFormat} parameter of TexImage1D, TexImage2D, and TexImage3D. */ + public static final int + GL_R8_SNORM = 0x8F94, + GL_RG8_SNORM = 0x8F95, + GL_RGB8_SNORM = 0x8F96, + GL_RGBA8_SNORM = 0x8F97, + GL_R16_SNORM = 0x8F98, + GL_RG16_SNORM = 0x8F99, + GL_RGB16_SNORM = 0x8F9A, + GL_RGBA16_SNORM = 0x8F9B; + + /** Returned by GetTexLevelParameter and GetFramebufferAttachmentParameter. */ + public static final int GL_SIGNED_NORMALIZED = 0x8F9C; + + /** Returned by the {@code type} parameter of GetActiveUniform. */ + public static final int + GL_SAMPLER_BUFFER = 0x8DC2, + GL_INT_SAMPLER_2D_RECT = 0x8DCD, + GL_INT_SAMPLER_BUFFER = 0x8DD0, + GL_UNSIGNED_INT_SAMPLER_2D_RECT = 0x8DD5, + GL_UNSIGNED_INT_SAMPLER_BUFFER = 0x8DD8; + + /** + * Accepted by the target parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferPointerv, MapBufferRange, + * FlushMappedBufferRange, GetBufferParameteriv, BindBufferRange, BindBufferBase, and CopyBufferSubData. + */ + public static final int + GL_COPY_READ_BUFFER = 0x8F36, + GL_COPY_WRITE_BUFFER = 0x8F37; + + /** Accepted by the {@code cap} parameter of Enable, Disable and IsEnabled. */ + public static final int GL_PRIMITIVE_RESTART = 0x8F9D; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_PRIMITIVE_RESTART_INDEX = 0x8F9E; + + /** + * Accepted by the {@code target} parameter of BindBuffer, BufferData, BufferSubData, MapBuffer, MapBufferRange, BindTexture, UnmapBuffer, + * GetBufferSubData, GetBufferParameteriv, GetBufferPointerv, and TexBuffer, and the {@code pname} parameter of GetBooleanv, GetDoublev, GetFloatv, and + * GetIntegerv. + */ + public static final int GL_TEXTURE_BUFFER = 0x8C2A; + + /** Accepted by the {@code pname} parameters of GetBooleanv, GetDoublev, GetFloatv, and GetIntegerv. */ + public static final int + GL_MAX_TEXTURE_BUFFER_SIZE = 0x8C2B, + GL_TEXTURE_BINDING_BUFFER = 0x8C2C, + GL_TEXTURE_BUFFER_DATA_STORE_BINDING = 0x8C2D; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable and IsEnabled; by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv and + * GetDoublev; and by the {@code target} parameter of BindTexture, GetTexParameterfv, GetTexParameteriv, TexParameterf, TexParameteri, TexParameterfv and + * TexParameteriv. + */ + public static final int GL_TEXTURE_RECTANGLE = 0x84F5; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv and GetDoublev. */ + public static final int GL_TEXTURE_BINDING_RECTANGLE = 0x84F6; + + /** Accepted by the {@code target} parameter of GetTexLevelParameteriv, GetTexLevelParameterfv, GetTexParameteriv and TexImage2D. */ + public static final int GL_PROXY_TEXTURE_RECTANGLE = 0x84F7; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv and GetFloatv. */ + public static final int GL_MAX_RECTANGLE_TEXTURE_SIZE = 0x84F8; + + /** Returned by {@code type} parameter of GetActiveUniform when the location {@code index} for program object {@code program} is of type sampler2DRect. */ + public static final int GL_SAMPLER_2D_RECT = 0x8B63; + + /** + * Returned by {@code type} parameter of GetActiveUniform when the location {@code index} for program object {@code program} is of type + * sampler2DRectShadow. + */ + public static final int GL_SAMPLER_2D_RECT_SHADOW = 0x8B64; + + /** Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, and GetBufferPointerv. */ + public static final int GL_UNIFORM_BUFFER = 0x8A11; + + /** Accepted by the {@code pname} parameter of GetIntegeri_v, GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_UNIFORM_BUFFER_BINDING = 0x8A28; + + /** Accepted by the {@code pname} parameter of GetIntegeri_v. */ + public static final int + GL_UNIFORM_BUFFER_START = 0x8A29, + GL_UNIFORM_BUFFER_SIZE = 0x8A2A; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B, + GL_MAX_GEOMETRY_UNIFORM_BLOCKS = 0x8A2C, + GL_MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D, + GL_MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E, + GL_MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F, + GL_MAX_UNIFORM_BLOCK_SIZE = 0x8A30, + GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31, + GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 0x8A32, + GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33, + GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34; + + /** Accepted by the {@code pname} parameter of GetProgramiv. */ + public static final int + GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35, + GL_ACTIVE_UNIFORM_BLOCKS = 0x8A36; + + /** Accepted by the {@code pname} parameter of GetActiveUniformsiv. */ + public static final int + GL_UNIFORM_TYPE = 0x8A37, + GL_UNIFORM_SIZE = 0x8A38, + GL_UNIFORM_NAME_LENGTH = 0x8A39, + GL_UNIFORM_BLOCK_INDEX = 0x8A3A, + GL_UNIFORM_OFFSET = 0x8A3B, + GL_UNIFORM_ARRAY_STRIDE = 0x8A3C, + GL_UNIFORM_MATRIX_STRIDE = 0x8A3D, + GL_UNIFORM_IS_ROW_MAJOR = 0x8A3E; + + /** Accepted by the {@code pname} parameter of GetActiveUniformBlockiv. */ + public static final int + GL_UNIFORM_BLOCK_BINDING = 0x8A3F, + GL_UNIFORM_BLOCK_DATA_SIZE = 0x8A40, + GL_UNIFORM_BLOCK_NAME_LENGTH = 0x8A41, + GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42, + GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43, + GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44, + GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 0x8A45, + GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46; + + /** Returned by GetActiveUniformsiv and GetUniformBlockIndex. */ + public static final int GL_INVALID_INDEX = 0xFFFFFFFF; + + static { GL.initialize(); } + + protected GL31() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glDrawArraysInstanced, caps.glDrawElementsInstanced, caps.glCopyBufferSubData, caps.glPrimitiveRestartIndex, caps.glTexBuffer, + caps.glGetUniformIndices, caps.glGetActiveUniformsiv, caps.glGetActiveUniformName, caps.glGetUniformBlockIndex, caps.glGetActiveUniformBlockiv, + caps.glGetActiveUniformBlockName, caps.glUniformBlockBinding + ); + } + + // --- [ glDrawArraysInstanced ] --- + + /** + * Draw multiple instances of a range of elements. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param first the index of the first vertex to be rendered + * @param count the number of vertices to be rendered + * @param primcount the number of instances of the specified range of vertices to be rendered + * + * @see Reference Page + */ + public static void glDrawArraysInstanced(@NativeType("GLenum") int mode, @NativeType("GLint") int first, @NativeType("GLsizei") int count, @NativeType("GLsizei") int primcount) { + GL31C.glDrawArraysInstanced(mode, first, count, primcount); + } + + // --- [ glDrawElementsInstanced ] --- + + /** + * Unsafe version of: {@link #glDrawElementsInstanced DrawElementsInstanced} + * + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static void nglDrawElementsInstanced(int mode, int count, int type, long indices, int primcount) { + GL31C.nglDrawElementsInstanced(mode, count, type, indices, primcount); + } + + /** + * Draws multiple instances of a set of elements. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices the ByteBuffer containing the indices to be rendered + * @param primcount the number of instances of the specified range of indices to be rendered + * + * @see Reference Page + */ + public static void glDrawElementsInstanced(@NativeType("GLenum") int mode, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices, @NativeType("GLsizei") int primcount) { + GL31C.glDrawElementsInstanced(mode, count, type, indices, primcount); + } + + /** + * Draws multiple instances of a set of elements. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices the ByteBuffer containing the indices to be rendered + * @param primcount the number of instances of the specified range of indices to be rendered + * + * @see Reference Page + */ + public static void glDrawElementsInstanced(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount) { + GL31C.glDrawElementsInstanced(mode, type, indices, primcount); + } + + /** + * Draws multiple instances of a set of elements. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param indices the ByteBuffer containing the indices to be rendered + * @param primcount the number of instances of the specified range of indices to be rendered + * + * @see Reference Page + */ + public static void glDrawElementsInstanced(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount) { + GL31C.glDrawElementsInstanced(mode, indices, primcount); + } + + /** + * Draws multiple instances of a set of elements. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param indices the ByteBuffer containing the indices to be rendered + * @param primcount the number of instances of the specified range of indices to be rendered + * + * @see Reference Page + */ + public static void glDrawElementsInstanced(@NativeType("GLenum") int mode, @NativeType("void const *") ShortBuffer indices, @NativeType("GLsizei") int primcount) { + GL31C.glDrawElementsInstanced(mode, indices, primcount); + } + + /** + * Draws multiple instances of a set of elements. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param indices the ByteBuffer containing the indices to be rendered + * @param primcount the number of instances of the specified range of indices to be rendered + * + * @see Reference Page + */ + public static void glDrawElementsInstanced(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indices, @NativeType("GLsizei") int primcount) { + GL31C.glDrawElementsInstanced(mode, indices, primcount); + } + + // --- [ glCopyBufferSubData ] --- + + /** + * Copies all or part of one buffer object's data store to the data store of another buffer object. + * + *

An {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error is generated if any of readoffset, writeoffset, or size are negative, if readoffset+size exceeds the size of the buffer object + * bound to readtarget, or if writeoffset+size exceeds the size of the buffer object bound to writetarget.

+ * + *

An {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error is generated if the same buffer object is bound to both readtarget and writetarget, and the ranges [readoffset, readoffset+size) + * and [writeoffset, writeoffset+size) overlap.

+ * + *

An {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} error is generated if zero is bound to readtarget or writetarget.

+ * + *

An {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} error is generated if the buffer objects bound to either readtarget or writetarget are mapped.

+ * + * @param readTarget the source buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL31C#GL_COPY_READ_BUFFER COPY_READ_BUFFER}{@link GL31C#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}
{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31C#GL_TEXTURE_BUFFER TEXTURE_BUFFER}
{@link GL31C#GL_UNIFORM_BUFFER UNIFORM_BUFFER}
+ * @param writeTarget the destination buffer object target + * @param readOffset the source buffer object offset, in bytes + * @param writeOffset the destination buffer object offset, in bytes + * @param size the number of bytes to copy + * + * @see Reference Page + */ + public static void glCopyBufferSubData(@NativeType("GLenum") int readTarget, @NativeType("GLenum") int writeTarget, @NativeType("GLintptr") long readOffset, @NativeType("GLintptr") long writeOffset, @NativeType("GLsizeiptr") long size) { + GL31C.glCopyBufferSubData(readTarget, writeTarget, readOffset, writeOffset, size); + } + + // --- [ glPrimitiveRestartIndex ] --- + + /** + * Specifies the primitive restart index. + * + * @param index the value to be interpreted as the primitive restart index + * + * @see Reference Page + */ + public static void glPrimitiveRestartIndex(@NativeType("GLuint") int index) { + GL31C.glPrimitiveRestartIndex(index); + } + + // --- [ glTexBuffer ] --- + + /** + * Attaches the storage for the buffer object named {@code buffer} to the active buffer texture, and specifies an internal format for the texel array found + * in the attached buffer object. If {@code buffer} is zero, any buffer object attached to the buffer texture is detached, and no new buffer object is + * attached. If {@code buffer} is non-zero, but is not the name of an existing buffer object, the error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated. + * + *

When a buffer object is attached to a buffer texture, the buffer object's data store is taken as the texture's texel array. The number of texels in the + * buffer texture's texel array is given by

+ * + *

{@code floor(buffer_size / (components * sizeof(base_type))},

+ * + *

where {@code buffer_size} is the size of the buffer object, in basic machine units and {@code components} and {@code base_type} are the element count + * and base data type for elements. The number of texels in the texel array is then clamped to the implementation-dependent limit {@link GL31C#GL_MAX_TEXTURE_BUFFER_SIZE MAX_TEXTURE_BUFFER_SIZE}. + * When a buffer texture is accessed in a shader, the results of a texel fetch are undefined if the specified texel number is greater than or equal to the + * clamped number of texels in the texel array.

+ * + *

When a buffer texture is accessed in a shader, an integer is provided to indicate the texel number being accessed. If no buffer object is bound to the + * buffer texture, the results of the texel access are undefined. Otherwise, the attached buffer object's data store is interpreted as an array of elements + * of the GL data type corresponding to {@code internalformat}. Each texel consists of one to four elements that are mapped to texture components + * (R, G, B, A, L, and I). Element {@code m} of the texel numbered {@code n} is taken from element {@code n} * {@code components} + {@code m} of the + * attached buffer object's data store. Elements and texels are both numbered starting with zero. For texture formats with normalized components, the + * extracted values are converted to floating-point values. The components of the texture are then converted to an (R,G,B,A) vector, and returned to the + * shader as a four-component result vector with components of the appropriate data type for the texture's internal format.

+ * + * @param target the target of the operation. Must be:
{@link GL31C#GL_TEXTURE_BUFFER TEXTURE_BUFFER}
+ * @param internalformat the sized internal format of the data in the store belonging to {@code buffer} + * @param buffer the name of the buffer object whose storage to attach to the active buffer texture + * + * @see Reference Page + */ + public static void glTexBuffer(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLuint") int buffer) { + GL31C.glTexBuffer(target, internalformat, buffer); + } + + // --- [ glGetUniformIndices ] --- + + /** + * Unsafe version of: {@link #glGetUniformIndices GetUniformIndices} + * + * @param uniformCount the number of uniforms whose indices to query + */ + public static void nglGetUniformIndices(int program, int uniformCount, long uniformNames, long uniformIndices) { + GL31C.nglGetUniformIndices(program, uniformCount, uniformNames, uniformIndices); + } + + /** + * Retrieves the indices of a number of uniforms within a program object + * + * @param program the name of a program containing uniforms whose indices to query + * @param uniformNames an array of pointers to buffers containing the names of the queried uniforms + * @param uniformIndices an array that will receive the indices of the uniforms + * + * @see Reference Page + */ + public static void glGetUniformIndices(@NativeType("GLuint") int program, @NativeType("GLchar const **") PointerBuffer uniformNames, @NativeType("GLuint *") IntBuffer uniformIndices) { + GL31C.glGetUniformIndices(program, uniformNames, uniformIndices); + } + + /** + * Retrieves the indices of a number of uniforms within a program object + * + * @param program the name of a program containing uniforms whose indices to query + * @param uniformNames an array of pointers to buffers containing the names of the queried uniforms + * @param uniformIndices an array that will receive the indices of the uniforms + * + * @see Reference Page + */ + public static void glGetUniformIndices(@NativeType("GLuint") int program, @NativeType("GLchar const **") CharSequence[] uniformNames, @NativeType("GLuint *") IntBuffer uniformIndices) { + GL31C.glGetUniformIndices(program, uniformNames, uniformIndices); + } + + /** + * Retrieves the indices of a number of uniforms within a program object + * + * @param program the name of a program containing uniforms whose indices to query + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetUniformIndices(@NativeType("GLuint") int program, @NativeType("GLchar const **") CharSequence uniformName) { + return GL31C.glGetUniformIndices(program, uniformName); + } + + // --- [ glGetActiveUniformsiv ] --- + + /** + * Unsafe version of: {@link #glGetActiveUniformsiv GetActiveUniformsiv} + * + * @param uniformCount the number of elements in the array of indices {@code uniformIndices} and the number of parameters written to {@code params} upon successful return + */ + public static void nglGetActiveUniformsiv(int program, int uniformCount, long uniformIndices, int pname, long params) { + GL31C.nglGetActiveUniformsiv(program, uniformCount, uniformIndices, pname, params); + } + + /** + * Returns information about several active uniform variables for the specified program object. + * + * @param program the program object to be queried + * @param uniformIndices an array of {@code uniformCount} integers containing the indices of uniforms within {@code program} + * @param pname the property of the each uniform in {@code uniformIndices} that should be written into the corresponding element of {@code params} + * @param params an array of {@code uniformCount} integers which are to receive the value of {@code pname} for each uniform in {@code uniformIndices} + * + * @see Reference Page + */ + public static void glGetActiveUniformsiv(@NativeType("GLuint") int program, @NativeType("GLuint const *") IntBuffer uniformIndices, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL31C.glGetActiveUniformsiv(program, uniformIndices, pname, params); + } + + /** + * Returns information about several active uniform variables for the specified program object. + * + * @param program the program object to be queried + * @param pname the property of the each uniform in {@code uniformIndices} that should be written into the corresponding element of {@code params} + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetActiveUniformsi(@NativeType("GLuint") int program, @NativeType("GLuint const *") int uniformIndex, @NativeType("GLenum") int pname) { + return GL31C.glGetActiveUniformsi(program, uniformIndex, pname); + } + + // --- [ glGetActiveUniformName ] --- + + /** + * Unsafe version of: {@link #glGetActiveUniformName GetActiveUniformName} + * + * @param bufSize the size of the buffer, in units of {@code GLchar}, of the buffer whose address is specified in {@code uniformName} + */ + public static void nglGetActiveUniformName(int program, int uniformIndex, int bufSize, long length, long uniformName) { + GL31C.nglGetActiveUniformName(program, uniformIndex, bufSize, length, uniformName); + } + + /** + * Queries the name of an active uniform. + * + * @param program the program containing the active uniform index {@code uniformIndex} + * @param uniformIndex the index of the active uniform whose name to query + * @param length the address of a variable that will receive the number of characters that were or would have been written to the buffer addressed by {@code uniformName} + * @param uniformName the address of a buffer into which the GL will place the name of the active uniform at {@code uniformIndex} within {@code program} + * + * @see Reference Page + */ + public static void glGetActiveUniformName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformIndex, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer uniformName) { + GL31C.glGetActiveUniformName(program, uniformIndex, length, uniformName); + } + + /** + * Queries the name of an active uniform. + * + * @param program the program containing the active uniform index {@code uniformIndex} + * @param uniformIndex the index of the active uniform whose name to query + * @param bufSize the size of the buffer, in units of {@code GLchar}, of the buffer whose address is specified in {@code uniformName} + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveUniformName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformIndex, @NativeType("GLsizei") int bufSize) { + return GL31C.glGetActiveUniformName(program, uniformIndex, bufSize); + } + + /** + * Queries the name of an active uniform. + * + * @param program the program containing the active uniform index {@code uniformIndex} + * @param uniformIndex the index of the active uniform whose name to query + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveUniformName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformIndex) { + return glGetActiveUniformName(program, uniformIndex, glGetActiveUniformsi(program, uniformIndex, GL_UNIFORM_NAME_LENGTH)); + } + + // --- [ glGetUniformBlockIndex ] --- + + /** Unsafe version of: {@link #glGetUniformBlockIndex GetUniformBlockIndex} */ + public static int nglGetUniformBlockIndex(int program, long uniformBlockName) { + return GL31C.nglGetUniformBlockIndex(program, uniformBlockName); + } + + /** + * Retrieves the index of a named uniform block. + * + * @param program the name of a program containing the uniform block + * @param uniformBlockName an array of characters to containing the name of the uniform block whose index to retrieve + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glGetUniformBlockIndex(@NativeType("GLuint") int program, @NativeType("GLchar const *") ByteBuffer uniformBlockName) { + return GL31C.glGetUniformBlockIndex(program, uniformBlockName); + } + + /** + * Retrieves the index of a named uniform block. + * + * @param program the name of a program containing the uniform block + * @param uniformBlockName an array of characters to containing the name of the uniform block whose index to retrieve + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glGetUniformBlockIndex(@NativeType("GLuint") int program, @NativeType("GLchar const *") CharSequence uniformBlockName) { + return GL31C.glGetUniformBlockIndex(program, uniformBlockName); + } + + // --- [ glGetActiveUniformBlockiv ] --- + + /** Unsafe version of: {@link #glGetActiveUniformBlockiv GetActiveUniformBlockiv} */ + public static void nglGetActiveUniformBlockiv(int program, int uniformBlockIndex, int pname, long params) { + GL31C.nglGetActiveUniformBlockiv(program, uniformBlockIndex, pname, params); + } + + /** + * Queries information about an active uniform block. + * + * @param program the name of a program containing the uniform block + * @param uniformBlockIndex the index of the uniform block within {@code program} + * @param pname the name of the parameter to query. One of:
{@link GL31C#GL_UNIFORM_BLOCK_BINDING UNIFORM_BLOCK_BINDING}{@link GL31C#GL_UNIFORM_BLOCK_DATA_SIZE UNIFORM_BLOCK_DATA_SIZE}
{@link GL31C#GL_UNIFORM_BLOCK_NAME_LENGTH UNIFORM_BLOCK_NAME_LENGTH}{@link GL31C#GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS UNIFORM_BLOCK_ACTIVE_UNIFORMS}
{@link GL31C#GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES}{@link GL31C#GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER}
{@link GL31C#GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER}{@link GL31C#GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER}
+ * @param params the address of a variable to receive the result of the query + * + * @see Reference Page + */ + public static void glGetActiveUniformBlockiv(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL31C.glGetActiveUniformBlockiv(program, uniformBlockIndex, pname, params); + } + + /** + * Queries information about an active uniform block. + * + * @param program the name of a program containing the uniform block + * @param uniformBlockIndex the index of the uniform block within {@code program} + * @param pname the name of the parameter to query. One of:
{@link GL31C#GL_UNIFORM_BLOCK_BINDING UNIFORM_BLOCK_BINDING}{@link GL31C#GL_UNIFORM_BLOCK_DATA_SIZE UNIFORM_BLOCK_DATA_SIZE}
{@link GL31C#GL_UNIFORM_BLOCK_NAME_LENGTH UNIFORM_BLOCK_NAME_LENGTH}{@link GL31C#GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS UNIFORM_BLOCK_ACTIVE_UNIFORMS}
{@link GL31C#GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES}{@link GL31C#GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER}
{@link GL31C#GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER}{@link GL31C#GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetActiveUniformBlocki(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex, @NativeType("GLenum") int pname) { + return GL31C.glGetActiveUniformBlocki(program, uniformBlockIndex, pname); + } + + // --- [ glGetActiveUniformBlockName ] --- + + /** + * Unsafe version of: {@link #glGetActiveUniformBlockName GetActiveUniformBlockName} + * + * @param bufSize the size of the buffer addressed by {@code uniformBlockName} + */ + public static void nglGetActiveUniformBlockName(int program, int uniformBlockIndex, int bufSize, long length, long uniformBlockName) { + GL31C.nglGetActiveUniformBlockName(program, uniformBlockIndex, bufSize, length, uniformBlockName); + } + + /** + * Retrieves the name of an active uniform block. + * + * @param program the name of a program containing the uniform block + * @param uniformBlockIndex the index of the uniform block within {@code program} + * @param length the address of a variable to receive the number of characters that were written to {@code uniformBlockName} + * @param uniformBlockName an array of characters to receive the name of the uniform block at {@code uniformBlockIndex} + * + * @see Reference Page + */ + public static void glGetActiveUniformBlockName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer uniformBlockName) { + GL31C.glGetActiveUniformBlockName(program, uniformBlockIndex, length, uniformBlockName); + } + + /** + * Retrieves the name of an active uniform block. + * + * @param program the name of a program containing the uniform block + * @param uniformBlockIndex the index of the uniform block within {@code program} + * @param bufSize the size of the buffer addressed by {@code uniformBlockName} + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveUniformBlockName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex, @NativeType("GLsizei") int bufSize) { + return GL31C.glGetActiveUniformBlockName(program, uniformBlockIndex, bufSize); + } + + /** + * Retrieves the name of an active uniform block. + * + * @param program the name of a program containing the uniform block + * @param uniformBlockIndex the index of the uniform block within {@code program} + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveUniformBlockName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex) { + return glGetActiveUniformBlockName(program, uniformBlockIndex, glGetActiveUniformBlocki(program, uniformBlockIndex, GL_UNIFORM_BLOCK_NAME_LENGTH)); + } + + // --- [ glUniformBlockBinding ] --- + + /** + * Assigns a binding point to an active uniform block. + * + * @param program the name of a program object containing the active uniform block whose binding to assign + * @param uniformBlockIndex the index of the active uniform block within {@code program} whose binding to assign + * @param uniformBlockBinding the binding point to which to bind the uniform block with index {@code uniformBlockIndex} within {@code program} + * + * @see Reference Page + */ + public static void glUniformBlockBinding(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex, @NativeType("GLuint") int uniformBlockBinding) { + GL31C.glUniformBlockBinding(program, uniformBlockIndex, uniformBlockBinding); + } + + /** + * Array version of: {@link #glGetUniformIndices GetUniformIndices} + * + * @see Reference Page + */ + public static void glGetUniformIndices(@NativeType("GLuint") int program, @NativeType("GLchar const **") PointerBuffer uniformNames, @NativeType("GLuint *") int[] uniformIndices) { + GL31C.glGetUniformIndices(program, uniformNames, uniformIndices); + } + + /** + * Array version of: {@link #glGetActiveUniformsiv GetActiveUniformsiv} + * + * @see Reference Page + */ + public static void glGetActiveUniformsiv(@NativeType("GLuint") int program, @NativeType("GLuint const *") int[] uniformIndices, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL31C.glGetActiveUniformsiv(program, uniformIndices, pname, params); + } + + /** + * Array version of: {@link #glGetActiveUniformName GetActiveUniformName} + * + * @see Reference Page + */ + public static void glGetActiveUniformName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformIndex, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer uniformName) { + GL31C.glGetActiveUniformName(program, uniformIndex, length, uniformName); + } + + /** + * Array version of: {@link #glGetActiveUniformBlockiv GetActiveUniformBlockiv} + * + * @see Reference Page + */ + public static void glGetActiveUniformBlockiv(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL31C.glGetActiveUniformBlockiv(program, uniformBlockIndex, pname, params); + } + + /** + * Array version of: {@link #glGetActiveUniformBlockName GetActiveUniformBlockName} + * + * @see Reference Page + */ + public static void glGetActiveUniformBlockName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer uniformBlockName) { + GL31C.glGetActiveUniformBlockName(program, uniformBlockIndex, length, uniformBlockName); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL31C.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL31C.java new file mode 100644 index 00000000..054cf389 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL31C.java @@ -0,0 +1,739 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality of a forward compatible context, up to version 3.1. + * + *

OpenGL 3.1 implementations support revision 1.40 of the OpenGL Shading Language.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL31C extends GL30C { + + /** Accepted by the {@code internalFormat} parameter of TexImage1D, TexImage2D, and TexImage3D. */ + public static final int + GL_R8_SNORM = 0x8F94, + GL_RG8_SNORM = 0x8F95, + GL_RGB8_SNORM = 0x8F96, + GL_RGBA8_SNORM = 0x8F97, + GL_R16_SNORM = 0x8F98, + GL_RG16_SNORM = 0x8F99, + GL_RGB16_SNORM = 0x8F9A, + GL_RGBA16_SNORM = 0x8F9B; + + /** Returned by GetTexLevelParameter and GetFramebufferAttachmentParameter. */ + public static final int GL_SIGNED_NORMALIZED = 0x8F9C; + + /** Returned by the {@code type} parameter of GetActiveUniform. */ + public static final int + GL_SAMPLER_BUFFER = 0x8DC2, + GL_INT_SAMPLER_2D_RECT = 0x8DCD, + GL_INT_SAMPLER_BUFFER = 0x8DD0, + GL_UNSIGNED_INT_SAMPLER_2D_RECT = 0x8DD5, + GL_UNSIGNED_INT_SAMPLER_BUFFER = 0x8DD8; + + /** + * Accepted by the target parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferPointerv, MapBufferRange, + * FlushMappedBufferRange, GetBufferParameteriv, BindBufferRange, BindBufferBase, and CopyBufferSubData. + */ + public static final int + GL_COPY_READ_BUFFER = 0x8F36, + GL_COPY_WRITE_BUFFER = 0x8F37; + + /** Accepted by the {@code cap} parameter of Enable, Disable and IsEnabled. */ + public static final int GL_PRIMITIVE_RESTART = 0x8F9D; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_PRIMITIVE_RESTART_INDEX = 0x8F9E; + + /** + * Accepted by the {@code target} parameter of BindBuffer, BufferData, BufferSubData, MapBuffer, MapBufferRange, BindTexture, UnmapBuffer, + * GetBufferSubData, GetBufferParameteriv, GetBufferPointerv, and TexBuffer, and the {@code pname} parameter of GetBooleanv, GetDoublev, GetFloatv, and + * GetIntegerv. + */ + public static final int GL_TEXTURE_BUFFER = 0x8C2A; + + /** Accepted by the {@code pname} parameters of GetBooleanv, GetDoublev, GetFloatv, and GetIntegerv. */ + public static final int + GL_MAX_TEXTURE_BUFFER_SIZE = 0x8C2B, + GL_TEXTURE_BINDING_BUFFER = 0x8C2C, + GL_TEXTURE_BUFFER_DATA_STORE_BINDING = 0x8C2D; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable and IsEnabled; by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv and + * GetDoublev; and by the {@code target} parameter of BindTexture, GetTexParameterfv, GetTexParameteriv, TexParameterf, TexParameteri, TexParameterfv and + * TexParameteriv. + */ + public static final int GL_TEXTURE_RECTANGLE = 0x84F5; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv and GetDoublev. */ + public static final int GL_TEXTURE_BINDING_RECTANGLE = 0x84F6; + + /** Accepted by the {@code target} parameter of GetTexLevelParameteriv, GetTexLevelParameterfv, GetTexParameteriv and TexImage2D. */ + public static final int GL_PROXY_TEXTURE_RECTANGLE = 0x84F7; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv and GetFloatv. */ + public static final int GL_MAX_RECTANGLE_TEXTURE_SIZE = 0x84F8; + + /** Returned by {@code type} parameter of GetActiveUniform when the location {@code index} for program object {@code program} is of type sampler2DRect. */ + public static final int GL_SAMPLER_2D_RECT = 0x8B63; + + /** + * Returned by {@code type} parameter of GetActiveUniform when the location {@code index} for program object {@code program} is of type + * sampler2DRectShadow. + */ + public static final int GL_SAMPLER_2D_RECT_SHADOW = 0x8B64; + + /** Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, and GetBufferPointerv. */ + public static final int GL_UNIFORM_BUFFER = 0x8A11; + + /** Accepted by the {@code pname} parameter of GetIntegeri_v, GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_UNIFORM_BUFFER_BINDING = 0x8A28; + + /** Accepted by the {@code pname} parameter of GetIntegeri_v. */ + public static final int + GL_UNIFORM_BUFFER_START = 0x8A29, + GL_UNIFORM_BUFFER_SIZE = 0x8A2A; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B, + GL_MAX_GEOMETRY_UNIFORM_BLOCKS = 0x8A2C, + GL_MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D, + GL_MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E, + GL_MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F, + GL_MAX_UNIFORM_BLOCK_SIZE = 0x8A30, + GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31, + GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS = 0x8A32, + GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33, + GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34; + + /** Accepted by the {@code pname} parameter of GetProgramiv. */ + public static final int + GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35, + GL_ACTIVE_UNIFORM_BLOCKS = 0x8A36; + + /** Accepted by the {@code pname} parameter of GetActiveUniformsiv. */ + public static final int + GL_UNIFORM_TYPE = 0x8A37, + GL_UNIFORM_SIZE = 0x8A38, + GL_UNIFORM_NAME_LENGTH = 0x8A39, + GL_UNIFORM_BLOCK_INDEX = 0x8A3A, + GL_UNIFORM_OFFSET = 0x8A3B, + GL_UNIFORM_ARRAY_STRIDE = 0x8A3C, + GL_UNIFORM_MATRIX_STRIDE = 0x8A3D, + GL_UNIFORM_IS_ROW_MAJOR = 0x8A3E; + + /** Accepted by the {@code pname} parameter of GetActiveUniformBlockiv. */ + public static final int + GL_UNIFORM_BLOCK_BINDING = 0x8A3F, + GL_UNIFORM_BLOCK_DATA_SIZE = 0x8A40, + GL_UNIFORM_BLOCK_NAME_LENGTH = 0x8A41, + GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42, + GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43, + GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44, + GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER = 0x8A45, + GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46; + + /** Returned by GetActiveUniformsiv and GetUniformBlockIndex. */ + public static final int GL_INVALID_INDEX = 0xFFFFFFFF; + + static { GL.initialize(); } + + protected GL31C() { + throw new UnsupportedOperationException(); + } + + // --- [ glDrawArraysInstanced ] --- + + /** + * Draw multiple instances of a range of elements. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param first the index of the first vertex to be rendered + * @param count the number of vertices to be rendered + * @param primcount the number of instances of the specified range of vertices to be rendered + * + * @see Reference Page + */ + public static native void glDrawArraysInstanced(@NativeType("GLenum") int mode, @NativeType("GLint") int first, @NativeType("GLsizei") int count, @NativeType("GLsizei") int primcount); + + // --- [ glDrawElementsInstanced ] --- + + /** + * Unsafe version of: {@link #glDrawElementsInstanced DrawElementsInstanced} + * + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static native void nglDrawElementsInstanced(int mode, int count, int type, long indices, int primcount); + + /** + * Draws multiple instances of a set of elements. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices the ByteBuffer containing the indices to be rendered + * @param primcount the number of instances of the specified range of indices to be rendered + * + * @see Reference Page + */ + public static void glDrawElementsInstanced(@NativeType("GLenum") int mode, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices, @NativeType("GLsizei") int primcount) { + nglDrawElementsInstanced(mode, count, type, indices, primcount); + } + + /** + * Draws multiple instances of a set of elements. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices the ByteBuffer containing the indices to be rendered + * @param primcount the number of instances of the specified range of indices to be rendered + * + * @see Reference Page + */ + public static void glDrawElementsInstanced(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount) { + nglDrawElementsInstanced(mode, indices.remaining() >> GLChecks.typeToByteShift(type), type, memAddress(indices), primcount); + } + + /** + * Draws multiple instances of a set of elements. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param indices the ByteBuffer containing the indices to be rendered + * @param primcount the number of instances of the specified range of indices to be rendered + * + * @see Reference Page + */ + public static void glDrawElementsInstanced(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount) { + nglDrawElementsInstanced(mode, indices.remaining(), GL11.GL_UNSIGNED_BYTE, memAddress(indices), primcount); + } + + /** + * Draws multiple instances of a set of elements. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param indices the ByteBuffer containing the indices to be rendered + * @param primcount the number of instances of the specified range of indices to be rendered + * + * @see Reference Page + */ + public static void glDrawElementsInstanced(@NativeType("GLenum") int mode, @NativeType("void const *") ShortBuffer indices, @NativeType("GLsizei") int primcount) { + nglDrawElementsInstanced(mode, indices.remaining(), GL11.GL_UNSIGNED_SHORT, memAddress(indices), primcount); + } + + /** + * Draws multiple instances of a set of elements. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}
{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ * @param indices the ByteBuffer containing the indices to be rendered + * @param primcount the number of instances of the specified range of indices to be rendered + * + * @see Reference Page + */ + public static void glDrawElementsInstanced(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indices, @NativeType("GLsizei") int primcount) { + nglDrawElementsInstanced(mode, indices.remaining(), GL11.GL_UNSIGNED_INT, memAddress(indices), primcount); + } + + // --- [ glCopyBufferSubData ] --- + + /** + * Copies all or part of one buffer object's data store to the data store of another buffer object. + * + *

An {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error is generated if any of readoffset, writeoffset, or size are negative, if readoffset+size exceeds the size of the buffer object + * bound to readtarget, or if writeoffset+size exceeds the size of the buffer object bound to writetarget.

+ * + *

An {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error is generated if the same buffer object is bound to both readtarget and writetarget, and the ranges [readoffset, readoffset+size) + * and [writeoffset, writeoffset+size) overlap.

+ * + *

An {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} error is generated if zero is bound to readtarget or writetarget.

+ * + *

An {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} error is generated if the buffer objects bound to either readtarget or writetarget are mapped.

+ * + * @param readTarget the source buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link #GL_COPY_READ_BUFFER COPY_READ_BUFFER}{@link #GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}
{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link #GL_TEXTURE_BUFFER TEXTURE_BUFFER}
{@link #GL_UNIFORM_BUFFER UNIFORM_BUFFER}
+ * @param writeTarget the destination buffer object target + * @param readOffset the source buffer object offset, in bytes + * @param writeOffset the destination buffer object offset, in bytes + * @param size the number of bytes to copy + * + * @see Reference Page + */ + public static native void glCopyBufferSubData(@NativeType("GLenum") int readTarget, @NativeType("GLenum") int writeTarget, @NativeType("GLintptr") long readOffset, @NativeType("GLintptr") long writeOffset, @NativeType("GLsizeiptr") long size); + + // --- [ glPrimitiveRestartIndex ] --- + + /** + * Specifies the primitive restart index. + * + * @param index the value to be interpreted as the primitive restart index + * + * @see Reference Page + */ + public static native void glPrimitiveRestartIndex(@NativeType("GLuint") int index); + + // --- [ glTexBuffer ] --- + + /** + * Attaches the storage for the buffer object named {@code buffer} to the active buffer texture, and specifies an internal format for the texel array found + * in the attached buffer object. If {@code buffer} is zero, any buffer object attached to the buffer texture is detached, and no new buffer object is + * attached. If {@code buffer} is non-zero, but is not the name of an existing buffer object, the error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated. + * + *

When a buffer object is attached to a buffer texture, the buffer object's data store is taken as the texture's texel array. The number of texels in the + * buffer texture's texel array is given by

+ * + *

{@code floor(buffer_size / (components * sizeof(base_type))},

+ * + *

where {@code buffer_size} is the size of the buffer object, in basic machine units and {@code components} and {@code base_type} are the element count + * and base data type for elements. The number of texels in the texel array is then clamped to the implementation-dependent limit {@link #GL_MAX_TEXTURE_BUFFER_SIZE MAX_TEXTURE_BUFFER_SIZE}. + * When a buffer texture is accessed in a shader, the results of a texel fetch are undefined if the specified texel number is greater than or equal to the + * clamped number of texels in the texel array.

+ * + *

When a buffer texture is accessed in a shader, an integer is provided to indicate the texel number being accessed. If no buffer object is bound to the + * buffer texture, the results of the texel access are undefined. Otherwise, the attached buffer object's data store is interpreted as an array of elements + * of the GL data type corresponding to {@code internalformat}. Each texel consists of one to four elements that are mapped to texture components + * (R, G, B, A, L, and I). Element {@code m} of the texel numbered {@code n} is taken from element {@code n} * {@code components} + {@code m} of the + * attached buffer object's data store. Elements and texels are both numbered starting with zero. For texture formats with normalized components, the + * extracted values are converted to floating-point values. The components of the texture are then converted to an (R,G,B,A) vector, and returned to the + * shader as a four-component result vector with components of the appropriate data type for the texture's internal format.

+ * + * @param target the target of the operation. Must be:
{@link #GL_TEXTURE_BUFFER TEXTURE_BUFFER}
+ * @param internalformat the sized internal format of the data in the store belonging to {@code buffer} + * @param buffer the name of the buffer object whose storage to attach to the active buffer texture + * + * @see Reference Page + */ + public static native void glTexBuffer(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLuint") int buffer); + + // --- [ glGetUniformIndices ] --- + + /** + * Unsafe version of: {@link #glGetUniformIndices GetUniformIndices} + * + * @param uniformCount the number of uniforms whose indices to query + */ + public static native void nglGetUniformIndices(int program, int uniformCount, long uniformNames, long uniformIndices); + + /** + * Retrieves the indices of a number of uniforms within a program object + * + * @param program the name of a program containing uniforms whose indices to query + * @param uniformNames an array of pointers to buffers containing the names of the queried uniforms + * @param uniformIndices an array that will receive the indices of the uniforms + * + * @see Reference Page + */ + public static void glGetUniformIndices(@NativeType("GLuint") int program, @NativeType("GLchar const **") PointerBuffer uniformNames, @NativeType("GLuint *") IntBuffer uniformIndices) { + if (CHECKS) { + check(uniformIndices, uniformNames.remaining()); + } + nglGetUniformIndices(program, uniformNames.remaining(), memAddress(uniformNames), memAddress(uniformIndices)); + } + + /** + * Retrieves the indices of a number of uniforms within a program object + * + * @param program the name of a program containing uniforms whose indices to query + * @param uniformNames an array of pointers to buffers containing the names of the queried uniforms + * @param uniformIndices an array that will receive the indices of the uniforms + * + * @see Reference Page + */ + public static void glGetUniformIndices(@NativeType("GLuint") int program, @NativeType("GLchar const **") CharSequence[] uniformNames, @NativeType("GLuint *") IntBuffer uniformIndices) { + if (CHECKS) { + check(uniformIndices, uniformNames.length); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + long uniformNamesAddress = org.lwjgl.system.APIUtil.apiArray(stack, MemoryUtil::memASCII, uniformNames); + nglGetUniformIndices(program, uniformNames.length, uniformNamesAddress, memAddress(uniformIndices)); + org.lwjgl.system.APIUtil.apiArrayFree(uniformNamesAddress, uniformNames.length); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Retrieves the indices of a number of uniforms within a program object + * + * @param program the name of a program containing uniforms whose indices to query + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetUniformIndices(@NativeType("GLuint") int program, @NativeType("GLchar const **") CharSequence uniformName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + long uniformNamesAddress = org.lwjgl.system.APIUtil.apiArray(stack, MemoryUtil::memASCII, uniformName); + IntBuffer uniformIndices = stack.callocInt(1); + nglGetUniformIndices(program, 1, uniformNamesAddress, memAddress(uniformIndices)); + org.lwjgl.system.APIUtil.apiArrayFree(uniformNamesAddress, 1); + return uniformIndices.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetActiveUniformsiv ] --- + + /** + * Unsafe version of: {@link #glGetActiveUniformsiv GetActiveUniformsiv} + * + * @param uniformCount the number of elements in the array of indices {@code uniformIndices} and the number of parameters written to {@code params} upon successful return + */ + public static native void nglGetActiveUniformsiv(int program, int uniformCount, long uniformIndices, int pname, long params); + + /** + * Returns information about several active uniform variables for the specified program object. + * + * @param program the program object to be queried + * @param uniformIndices an array of {@code uniformCount} integers containing the indices of uniforms within {@code program} + * @param pname the property of the each uniform in {@code uniformIndices} that should be written into the corresponding element of {@code params} + * @param params an array of {@code uniformCount} integers which are to receive the value of {@code pname} for each uniform in {@code uniformIndices} + * + * @see Reference Page + */ + public static void glGetActiveUniformsiv(@NativeType("GLuint") int program, @NativeType("GLuint const *") IntBuffer uniformIndices, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, uniformIndices.remaining()); + } + nglGetActiveUniformsiv(program, uniformIndices.remaining(), memAddress(uniformIndices), pname, memAddress(params)); + } + + /** + * Returns information about several active uniform variables for the specified program object. + * + * @param program the program object to be queried + * @param pname the property of the each uniform in {@code uniformIndices} that should be written into the corresponding element of {@code params} + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetActiveUniformsi(@NativeType("GLuint") int program, @NativeType("GLuint const *") int uniformIndex, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + IntBuffer uniformIndices = stack.ints(uniformIndex); + nglGetActiveUniformsiv(program, 1, memAddress(uniformIndices), pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetActiveUniformName ] --- + + /** + * Unsafe version of: {@link #glGetActiveUniformName GetActiveUniformName} + * + * @param bufSize the size of the buffer, in units of {@code GLchar}, of the buffer whose address is specified in {@code uniformName} + */ + public static native void nglGetActiveUniformName(int program, int uniformIndex, int bufSize, long length, long uniformName); + + /** + * Queries the name of an active uniform. + * + * @param program the program containing the active uniform index {@code uniformIndex} + * @param uniformIndex the index of the active uniform whose name to query + * @param length the address of a variable that will receive the number of characters that were or would have been written to the buffer addressed by {@code uniformName} + * @param uniformName the address of a buffer into which the GL will place the name of the active uniform at {@code uniformIndex} within {@code program} + * + * @see Reference Page + */ + public static void glGetActiveUniformName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformIndex, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer uniformName) { + if (CHECKS) { + checkSafe(length, 1); + } + nglGetActiveUniformName(program, uniformIndex, uniformName.remaining(), memAddressSafe(length), memAddress(uniformName)); + } + + /** + * Queries the name of an active uniform. + * + * @param program the program containing the active uniform index {@code uniformIndex} + * @param uniformIndex the index of the active uniform whose name to query + * @param bufSize the size of the buffer, in units of {@code GLchar}, of the buffer whose address is specified in {@code uniformName} + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveUniformName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformIndex, @NativeType("GLsizei") int bufSize) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer length = stack.ints(0); + ByteBuffer uniformName = stack.malloc(bufSize); + nglGetActiveUniformName(program, uniformIndex, bufSize, memAddress(length), memAddress(uniformName)); + return memASCII(uniformName, length.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Queries the name of an active uniform. + * + * @param program the program containing the active uniform index {@code uniformIndex} + * @param uniformIndex the index of the active uniform whose name to query + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveUniformName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformIndex) { + return glGetActiveUniformName(program, uniformIndex, glGetActiveUniformsi(program, uniformIndex, GL_UNIFORM_NAME_LENGTH)); + } + + // --- [ glGetUniformBlockIndex ] --- + + /** Unsafe version of: {@link #glGetUniformBlockIndex GetUniformBlockIndex} */ + public static native int nglGetUniformBlockIndex(int program, long uniformBlockName); + + /** + * Retrieves the index of a named uniform block. + * + * @param program the name of a program containing the uniform block + * @param uniformBlockName an array of characters to containing the name of the uniform block whose index to retrieve + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glGetUniformBlockIndex(@NativeType("GLuint") int program, @NativeType("GLchar const *") ByteBuffer uniformBlockName) { + if (CHECKS) { + checkNT1(uniformBlockName); + } + return nglGetUniformBlockIndex(program, memAddress(uniformBlockName)); + } + + /** + * Retrieves the index of a named uniform block. + * + * @param program the name of a program containing the uniform block + * @param uniformBlockName an array of characters to containing the name of the uniform block whose index to retrieve + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glGetUniformBlockIndex(@NativeType("GLuint") int program, @NativeType("GLchar const *") CharSequence uniformBlockName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(uniformBlockName, true); + long uniformBlockNameEncoded = stack.getPointerAddress(); + return nglGetUniformBlockIndex(program, uniformBlockNameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetActiveUniformBlockiv ] --- + + /** Unsafe version of: {@link #glGetActiveUniformBlockiv GetActiveUniformBlockiv} */ + public static native void nglGetActiveUniformBlockiv(int program, int uniformBlockIndex, int pname, long params); + + /** + * Queries information about an active uniform block. + * + * @param program the name of a program containing the uniform block + * @param uniformBlockIndex the index of the uniform block within {@code program} + * @param pname the name of the parameter to query. One of:
{@link #GL_UNIFORM_BLOCK_BINDING UNIFORM_BLOCK_BINDING}{@link #GL_UNIFORM_BLOCK_DATA_SIZE UNIFORM_BLOCK_DATA_SIZE}
{@link #GL_UNIFORM_BLOCK_NAME_LENGTH UNIFORM_BLOCK_NAME_LENGTH}{@link #GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS UNIFORM_BLOCK_ACTIVE_UNIFORMS}
{@link #GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES}{@link #GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER}
{@link #GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER}{@link #GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER}
+ * @param params the address of a variable to receive the result of the query + * + * @see Reference Page + */ + public static void glGetActiveUniformBlockiv(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetActiveUniformBlockiv(program, uniformBlockIndex, pname, memAddress(params)); + } + + /** + * Queries information about an active uniform block. + * + * @param program the name of a program containing the uniform block + * @param uniformBlockIndex the index of the uniform block within {@code program} + * @param pname the name of the parameter to query. One of:
{@link #GL_UNIFORM_BLOCK_BINDING UNIFORM_BLOCK_BINDING}{@link #GL_UNIFORM_BLOCK_DATA_SIZE UNIFORM_BLOCK_DATA_SIZE}
{@link #GL_UNIFORM_BLOCK_NAME_LENGTH UNIFORM_BLOCK_NAME_LENGTH}{@link #GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS UNIFORM_BLOCK_ACTIVE_UNIFORMS}
{@link #GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES}{@link #GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER}
{@link #GL_UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER UNIFORM_BLOCK_REFERENCED_BY_GEOMETRY_SHADER}{@link #GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetActiveUniformBlocki(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetActiveUniformBlockiv(program, uniformBlockIndex, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetActiveUniformBlockName ] --- + + /** + * Unsafe version of: {@link #glGetActiveUniformBlockName GetActiveUniformBlockName} + * + * @param bufSize the size of the buffer addressed by {@code uniformBlockName} + */ + public static native void nglGetActiveUniformBlockName(int program, int uniformBlockIndex, int bufSize, long length, long uniformBlockName); + + /** + * Retrieves the name of an active uniform block. + * + * @param program the name of a program containing the uniform block + * @param uniformBlockIndex the index of the uniform block within {@code program} + * @param length the address of a variable to receive the number of characters that were written to {@code uniformBlockName} + * @param uniformBlockName an array of characters to receive the name of the uniform block at {@code uniformBlockIndex} + * + * @see Reference Page + */ + public static void glGetActiveUniformBlockName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer uniformBlockName) { + if (CHECKS) { + checkSafe(length, 1); + } + nglGetActiveUniformBlockName(program, uniformBlockIndex, uniformBlockName.remaining(), memAddressSafe(length), memAddress(uniformBlockName)); + } + + /** + * Retrieves the name of an active uniform block. + * + * @param program the name of a program containing the uniform block + * @param uniformBlockIndex the index of the uniform block within {@code program} + * @param bufSize the size of the buffer addressed by {@code uniformBlockName} + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveUniformBlockName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex, @NativeType("GLsizei") int bufSize) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer length = stack.ints(0); + ByteBuffer uniformBlockName = stack.malloc(bufSize); + nglGetActiveUniformBlockName(program, uniformBlockIndex, bufSize, memAddress(length), memAddress(uniformBlockName)); + return memASCII(uniformBlockName, length.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Retrieves the name of an active uniform block. + * + * @param program the name of a program containing the uniform block + * @param uniformBlockIndex the index of the uniform block within {@code program} + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveUniformBlockName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex) { + return glGetActiveUniformBlockName(program, uniformBlockIndex, glGetActiveUniformBlocki(program, uniformBlockIndex, GL_UNIFORM_BLOCK_NAME_LENGTH)); + } + + // --- [ glUniformBlockBinding ] --- + + /** + * Assigns a binding point to an active uniform block. + * + * @param program the name of a program object containing the active uniform block whose binding to assign + * @param uniformBlockIndex the index of the active uniform block within {@code program} whose binding to assign + * @param uniformBlockBinding the binding point to which to bind the uniform block with index {@code uniformBlockIndex} within {@code program} + * + * @see Reference Page + */ + public static native void glUniformBlockBinding(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex, @NativeType("GLuint") int uniformBlockBinding); + + /** + * Array version of: {@link #glGetUniformIndices GetUniformIndices} + * + * @see Reference Page + */ + public static void glGetUniformIndices(@NativeType("GLuint") int program, @NativeType("GLchar const **") PointerBuffer uniformNames, @NativeType("GLuint *") int[] uniformIndices) { + long __functionAddress = GL.getICD().glGetUniformIndices; + if (CHECKS) { + check(__functionAddress); + check(uniformIndices, uniformNames.remaining()); + } + callPPV(program, uniformNames.remaining(), memAddress(uniformNames), uniformIndices, __functionAddress); + } + + /** + * Array version of: {@link #glGetActiveUniformsiv GetActiveUniformsiv} + * + * @see Reference Page + */ + public static void glGetActiveUniformsiv(@NativeType("GLuint") int program, @NativeType("GLuint const *") int[] uniformIndices, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetActiveUniformsiv; + if (CHECKS) { + check(__functionAddress); + check(params, uniformIndices.length); + } + callPPV(program, uniformIndices.length, uniformIndices, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetActiveUniformName GetActiveUniformName} + * + * @see Reference Page + */ + public static void glGetActiveUniformName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformIndex, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer uniformName) { + long __functionAddress = GL.getICD().glGetActiveUniformName; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + } + callPPV(program, uniformIndex, uniformName.remaining(), length, memAddress(uniformName), __functionAddress); + } + + /** + * Array version of: {@link #glGetActiveUniformBlockiv GetActiveUniformBlockiv} + * + * @see Reference Page + */ + public static void glGetActiveUniformBlockiv(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetActiveUniformBlockiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(program, uniformBlockIndex, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetActiveUniformBlockName GetActiveUniformBlockName} + * + * @see Reference Page + */ + public static void glGetActiveUniformBlockName(@NativeType("GLuint") int program, @NativeType("GLuint") int uniformBlockIndex, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer uniformBlockName) { + long __functionAddress = GL.getICD().glGetActiveUniformBlockName; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + } + callPPV(program, uniformBlockIndex, uniformBlockName.remaining(), length, memAddress(uniformBlockName), __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL32.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL32.java new file mode 100644 index 00000000..3f8afcf4 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL32.java @@ -0,0 +1,907 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * The OpenGL functionality up to version 3.2. Includes the deprecated symbols of the Compatibility Profile. + * + *

OpenGL 3.2 implementations support revision 1.50 of the OpenGL Shading Language.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL32 extends GL31 { + + /** Accepted by the {@code pname} parameter of GetIntegerv. */ + public static final int GL_CONTEXT_PROFILE_MASK = 0x9126; + + /** Context profile bits. */ + public static final int + GL_CONTEXT_CORE_PROFILE_BIT = 0x1, + GL_CONTEXT_COMPATIBILITY_PROFILE_BIT = 0x2; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122, + GL_MAX_GEOMETRY_INPUT_COMPONENTS = 0x9123, + GL_MAX_GEOMETRY_OUTPUT_COMPONENTS = 0x9124, + GL_MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125; + + /** Accepted by the {@code mode} parameter of ProvokingVertex. */ + public static final int + GL_FIRST_VERTEX_CONVENTION = 0x8E4D, + GL_LAST_VERTEX_CONVENTION = 0x8E4E; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_PROVOKING_VERTEX = 0x8E4F, + GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION = 0x8E4C; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv and + * GetDoublev. + */ + public static final int GL_TEXTURE_CUBE_MAP_SEAMLESS = 0x884F; + + /** Accepted by the {@code pname} parameter of GetMultisamplefv. */ + public static final int GL_SAMPLE_POSITION = 0x8E50; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_SAMPLE_MASK = 0x8E51; + + /** Accepted by the {@code target} parameter of GetBooleani_v and GetIntegeri_v. */ + public static final int GL_SAMPLE_MASK_VALUE = 0x8E52; + + /** Accepted by the {@code target} parameter of BindTexture and TexImage2DMultisample. */ + public static final int GL_TEXTURE_2D_MULTISAMPLE = 0x9100; + + /** Accepted by the {@code target} parameter of TexImage2DMultisample. */ + public static final int GL_PROXY_TEXTURE_2D_MULTISAMPLE = 0x9101; + + /** Accepted by the {@code target} parameter of BindTexture and TexImage3DMultisample. */ + public static final int GL_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9102; + + /** Accepted by the {@code target} parameter of TexImage3DMultisample. */ + public static final int GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9103; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_MAX_SAMPLE_MASK_WORDS = 0x8E59, + GL_MAX_COLOR_TEXTURE_SAMPLES = 0x910E, + GL_MAX_DEPTH_TEXTURE_SAMPLES = 0x910F, + GL_MAX_INTEGER_SAMPLES = 0x9110, + GL_TEXTURE_BINDING_2D_MULTISAMPLE = 0x9104, + GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 0x9105; + + /** Accepted by the {@code pname} parameter of GetTexLevelParameter. */ + public static final int + GL_TEXTURE_SAMPLES = 0x9106, + GL_TEXTURE_FIXED_SAMPLE_LOCATIONS = 0x9107; + + /** Returned by the {@code type} parameter of GetActiveUniform. */ + public static final int + GL_SAMPLER_2D_MULTISAMPLE = 0x9108, + GL_INT_SAMPLER_2D_MULTISAMPLE = 0x9109, + GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 0x910A, + GL_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910B, + GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910C, + GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910D; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_DEPTH_CLAMP = 0x864F; + + /** Accepted by the {@code type} parameter of CreateShader and returned by the {@code params} parameter of GetShaderiv. */ + public static final int GL_GEOMETRY_SHADER = 0x8DD9; + + /** Accepted by the {@code pname} parameter of ProgramParameteri and GetProgramiv. */ + public static final int + GL_GEOMETRY_VERTICES_OUT = 0x8DDA, + GL_GEOMETRY_INPUT_TYPE = 0x8DDB, + GL_GEOMETRY_OUTPUT_TYPE = 0x8DDC; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS = 0x8C29, + GL_MAX_GEOMETRY_UNIFORM_COMPONENTS = 0x8DDF, + GL_MAX_GEOMETRY_OUTPUT_VERTICES = 0x8DE0, + GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS = 0x8DE1; + + /** Accepted by the {@code mode} parameter of Begin, DrawArrays, MultiDrawArrays, DrawElements, MultiDrawElements, and DrawRangeElements. */ + public static final int + GL_LINES_ADJACENCY = 0xA, + GL_LINE_STRIP_ADJACENCY = 0xB, + GL_TRIANGLES_ADJACENCY = 0xC, + GL_TRIANGLE_STRIP_ADJACENCY = 0xD; + + /** Returned by CheckFramebufferStatus. */ + public static final int GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = 0x8DA8; + + /** Accepted by the {@code pname} parameter of GetFramebufferAttachment- Parameteriv. */ + public static final int GL_FRAMEBUFFER_ATTACHMENT_LAYERED = 0x8DA7; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetIntegerv, GetFloatv, GetDoublev, and + * GetBooleanv. + */ + public static final int GL_PROGRAM_POINT_SIZE = 0x8642; + + /** Accepted as the {@code pname} parameter of GetInteger64v. */ + public static final int GL_MAX_SERVER_WAIT_TIMEOUT = 0x9111; + + /** Accepted as the {@code pname} parameter of GetSynciv. */ + public static final int + GL_OBJECT_TYPE = 0x9112, + GL_SYNC_CONDITION = 0x9113, + GL_SYNC_STATUS = 0x9114, + GL_SYNC_FLAGS = 0x9115; + + /** Returned in {@code values} for GetSynciv {@code pname} OBJECT_TYPE. */ + public static final int GL_SYNC_FENCE = 0x9116; + + /** Returned in {@code values} for GetSynciv {@code pname} SYNC_CONDITION. */ + public static final int GL_SYNC_GPU_COMMANDS_COMPLETE = 0x9117; + + /** Returned in {@code values} for GetSynciv {@code pname} SYNC_STATUS. */ + public static final int + GL_UNSIGNALED = 0x9118, + GL_SIGNALED = 0x9119; + + /** Accepted in the {@code flags} parameter of ClientWaitSync. */ + public static final int GL_SYNC_FLUSH_COMMANDS_BIT = 0x1; + + /** Accepted in the {@code timeout} parameter of WaitSync. */ + public static final long GL_TIMEOUT_IGNORED = 0xFFFFFFFFFFFFFFFFL; + + /** Returned by ClientWaitSync. */ + public static final int + GL_ALREADY_SIGNALED = 0x911A, + GL_TIMEOUT_EXPIRED = 0x911B, + GL_CONDITION_SATISFIED = 0x911C, + GL_WAIT_FAILED = 0x911D; + + static { GL.initialize(); } + + protected GL32() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glGetBufferParameteri64v, caps.glDrawElementsBaseVertex, caps.glDrawRangeElementsBaseVertex, caps.glDrawElementsInstancedBaseVertex, + caps.glMultiDrawElementsBaseVertex, caps.glProvokingVertex, caps.glTexImage2DMultisample, caps.glTexImage3DMultisample, caps.glGetMultisamplefv, + caps.glSampleMaski, caps.glFramebufferTexture, caps.glFenceSync, caps.glIsSync, caps.glDeleteSync, caps.glClientWaitSync, caps.glWaitSync, + caps.glGetInteger64v, caps.glGetInteger64i_v, caps.glGetSynciv + ); + } + + // --- [ glGetBufferParameteri64v ] --- + + /** Unsafe version of: {@link #glGetBufferParameteri64v GetBufferParameteri64v} */ + public static void nglGetBufferParameteri64v(int target, int pname, long params) { + GL32C.nglGetBufferParameteri64v(target, pname, params); + } + + /** + * Returns the value of a buffer object parameter. + * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param pname the symbolic name of a buffer object parameter. One of:
{@link GL15#GL_BUFFER_SIZE BUFFER_SIZE}{@link GL15#GL_BUFFER_USAGE BUFFER_USAGE}{@link GL15#GL_BUFFER_ACCESS BUFFER_ACCESS}{@link GL15#GL_BUFFER_MAPPED BUFFER_MAPPED}
{@link GL30#GL_BUFFER_ACCESS_FLAGS BUFFER_ACCESS_FLAGS}{@link GL30#GL_BUFFER_MAP_LENGTH BUFFER_MAP_LENGTH}{@link GL30#GL_BUFFER_MAP_OFFSET BUFFER_MAP_OFFSET}{@link GL44#GL_BUFFER_IMMUTABLE_STORAGE BUFFER_IMMUTABLE_STORAGE}
{@link GL44#GL_BUFFER_STORAGE_FLAGS BUFFER_STORAGE_FLAGS}
+ * @param params the requested parameter + * + * @see Reference Page + */ + public static void glGetBufferParameteri64v(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint64 *") LongBuffer params) { + GL32C.glGetBufferParameteri64v(target, pname, params); + } + + /** + * Returns the value of a buffer object parameter. + * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param pname the symbolic name of a buffer object parameter. One of:
{@link GL15#GL_BUFFER_SIZE BUFFER_SIZE}{@link GL15#GL_BUFFER_USAGE BUFFER_USAGE}{@link GL15#GL_BUFFER_ACCESS BUFFER_ACCESS}{@link GL15#GL_BUFFER_MAPPED BUFFER_MAPPED}
{@link GL30#GL_BUFFER_ACCESS_FLAGS BUFFER_ACCESS_FLAGS}{@link GL30#GL_BUFFER_MAP_LENGTH BUFFER_MAP_LENGTH}{@link GL30#GL_BUFFER_MAP_OFFSET BUFFER_MAP_OFFSET}{@link GL44#GL_BUFFER_IMMUTABLE_STORAGE BUFFER_IMMUTABLE_STORAGE}
{@link GL44#GL_BUFFER_STORAGE_FLAGS BUFFER_STORAGE_FLAGS}
+ * + * @see Reference Page + */ + @NativeType("void") + public static long glGetBufferParameteri64(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + return GL32C.glGetBufferParameteri64(target, pname); + } + + // --- [ glDrawElementsBaseVertex ] --- + + /** + * Unsafe version of: {@link #glDrawElementsBaseVertex DrawElementsBaseVertex} + * + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static void nglDrawElementsBaseVertex(int mode, int count, int type, long indices, int basevertex) { + GL32C.nglDrawElementsBaseVertex(mode, count, type, indices, basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices, @NativeType("GLint") int basevertex) { + GL32C.glDrawElementsBaseVertex(mode, count, type, indices, basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices, @NativeType("GLint") int basevertex) { + GL32C.glDrawElementsBaseVertex(mode, type, indices, basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indices, @NativeType("GLint") int basevertex) { + GL32C.glDrawElementsBaseVertex(mode, indices, basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("void const *") ShortBuffer indices, @NativeType("GLint") int basevertex) { + GL32C.glDrawElementsBaseVertex(mode, indices, basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indices, @NativeType("GLint") int basevertex) { + GL32C.glDrawElementsBaseVertex(mode, indices, basevertex); + } + + // --- [ glDrawRangeElementsBaseVertex ] --- + + /** + * Unsafe version of: {@link #glDrawRangeElementsBaseVertex DrawRangeElementsBaseVertex} + * + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static void nglDrawRangeElementsBaseVertex(int mode, int start, int end, int count, int type, long indices, int basevertex) { + GL32C.nglDrawRangeElementsBaseVertex(mode, start, end, count, type, indices, basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawRangeElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices, @NativeType("GLint") int basevertex) { + GL32C.glDrawRangeElementsBaseVertex(mode, start, end, count, type, indices, basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawRangeElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices, @NativeType("GLint") int basevertex) { + GL32C.glDrawRangeElementsBaseVertex(mode, start, end, type, indices, basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawRangeElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("void const *") ByteBuffer indices, @NativeType("GLint") int basevertex) { + GL32C.glDrawRangeElementsBaseVertex(mode, start, end, indices, basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawRangeElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("void const *") ShortBuffer indices, @NativeType("GLint") int basevertex) { + GL32C.glDrawRangeElementsBaseVertex(mode, start, end, indices, basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawRangeElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("void const *") IntBuffer indices, @NativeType("GLint") int basevertex) { + GL32C.glDrawRangeElementsBaseVertex(mode, start, end, indices, basevertex); + } + + // --- [ glDrawElementsInstancedBaseVertex ] --- + + /** + * Unsafe version of: {@link #glDrawElementsInstancedBaseVertex DrawElementsInstancedBaseVertex} + * + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static void nglDrawElementsInstancedBaseVertex(int mode, int count, int type, long indices, int primcount, int basevertex) { + GL32C.nglDrawElementsInstancedBaseVertex(mode, count, type, indices, primcount, basevertex); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex) { + GL32C.glDrawElementsInstancedBaseVertex(mode, count, type, indices, primcount, basevertex); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex) { + GL32C.glDrawElementsInstancedBaseVertex(mode, type, indices, primcount, basevertex); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseVertex(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex) { + GL32C.glDrawElementsInstancedBaseVertex(mode, indices, primcount, basevertex); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseVertex(@NativeType("GLenum") int mode, @NativeType("void const *") ShortBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex) { + GL32C.glDrawElementsInstancedBaseVertex(mode, indices, primcount, basevertex); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseVertex(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex) { + GL32C.glDrawElementsInstancedBaseVertex(mode, indices, primcount, basevertex); + } + + // --- [ glMultiDrawElementsBaseVertex ] --- + + /** + * Unsafe version of: {@link #glMultiDrawElementsBaseVertex MultiDrawElementsBaseVertex} + * + * @param drawcount the size of the {@code count} array + */ + public static void nglMultiDrawElementsBaseVertex(int mode, long count, int type, long indices, int drawcount, long basevertex) { + GL32C.nglMultiDrawElementsBaseVertex(mode, count, type, indices, drawcount, basevertex); + } + + /** + * Renders multiple sets of primitives by specifying indices of array data elements and an offset to apply to each index. + * + *

LWJGL note: Use {@link org.lwjgl.system.MemoryUtil#memAddress} to retrieve pointers to the index buffers.

+ * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32C#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32C#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32C#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32C#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param count an array of the elements counts + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a pointer to the location where the base vertices are stored + * + * @see Reference Page + */ + public static void glMultiDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLsizei const *") IntBuffer count, @NativeType("GLenum") int type, @NativeType("void const **") PointerBuffer indices, @NativeType("GLint *") IntBuffer basevertex) { + GL32C.glMultiDrawElementsBaseVertex(mode, count, type, indices, basevertex); + } + + // --- [ glProvokingVertex ] --- + + /** + * Specifies the vertex to be used as the source of data for flat shaded varyings. + * + * @param mode the provoking vertex mode. One of:
{@link GL32C#GL_FIRST_VERTEX_CONVENTION FIRST_VERTEX_CONVENTION}{@link GL32C#GL_LAST_VERTEX_CONVENTION LAST_VERTEX_CONVENTION}
+ * + * @see Reference Page + */ + public static void glProvokingVertex(@NativeType("GLenum") int mode) { + GL32C.glProvokingVertex(mode); + } + + // --- [ glTexImage2DMultisample ] --- + + /** + * Establishes the data storage, format, dimensions, and number of samples of a 2D multisample texture's image. + * + * @param target the target of the operation. One of:
{@link GL32C#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32C#GL_PROXY_TEXTURE_2D_MULTISAMPLE PROXY_TEXTURE_2D_MULTISAMPLE}
+ * @param samples the number of samples in the multisample texture's image + * @param internalformat the internal format to be used to store the multisample texture's image. {@code internalformat} must specify a color-renderable, depth-renderable, + * or stencil-renderable format. + * @param width the width of the multisample texture's image, in texels + * @param height the height of the multisample texture's image, in texels + * @param fixedsamplelocations whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not + * depend on the internal format or size of the image + * + * @see Reference Page + */ + public static void glTexImage2DMultisample(@NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLboolean") boolean fixedsamplelocations) { + GL32C.glTexImage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations); + } + + // --- [ glTexImage3DMultisample ] --- + + /** + * Establishes the data storage, format, dimensions, and number of samples of a 3D multisample texture's image. + * + * @param target the target of the operation. One of:
{@link GL32C#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}{@link GL32C#GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param samples the number of samples in the multisample texture's image + * @param internalformat the internal format to be used to store the multisample texture's image. {@code internalformat} must specify a color-renderable, depth-renderable, + * or stencil-renderable format. + * @param width the width of the multisample texture's image, in texels + * @param height the height of the multisample texture's image, in texels + * @param depth the depth of the multisample texture's image, in texels + * @param fixedsamplelocations whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not + * depend on the internal format or size of the image + * + * @see Reference Page + */ + public static void glTexImage3DMultisample(@NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLboolean") boolean fixedsamplelocations) { + GL32C.glTexImage3DMultisample(target, samples, internalformat, width, height, depth, fixedsamplelocations); + } + + // --- [ glGetMultisamplefv ] --- + + /** Unsafe version of: {@link #glGetMultisamplefv GetMultisamplefv} */ + public static void nglGetMultisamplefv(int pname, int index, long val) { + GL32C.nglGetMultisamplefv(pname, index, val); + } + + /** + * Retrieves the location of a sample. + * + * @param pname the sample parameter name. Must be:
{@link GL32C#GL_SAMPLE_POSITION SAMPLE_POSITION}
+ * @param index the index of the sample whose position to query + * @param val an array to receive the position of the sample + * + * @see Reference Page + */ + public static void glGetMultisamplefv(@NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLfloat *") FloatBuffer val) { + GL32C.glGetMultisamplefv(pname, index, val); + } + + /** + * Retrieves the location of a sample. + * + * @param pname the sample parameter name. Must be:
{@link GL32C#GL_SAMPLE_POSITION SAMPLE_POSITION}
+ * @param index the index of the sample whose position to query + * + * @see Reference Page + */ + @NativeType("void") + public static float glGetMultisamplef(@NativeType("GLenum") int pname, @NativeType("GLuint") int index) { + return GL32C.glGetMultisamplef(pname, index); + } + + // --- [ glSampleMaski ] --- + + /** + * Sets the value of a sub-word of the sample mask. + * + * @param index which 32-bit sub-word of the sample mask to update + * @param mask the new value of the mask sub-word + * + * @see Reference Page + */ + public static void glSampleMaski(@NativeType("GLuint") int index, @NativeType("GLbitfield") int mask) { + GL32C.glSampleMaski(index, mask); + } + + // --- [ glFramebufferTexture ] --- + + /** + * Attaches a level of a texture object as a logical buffer to the currently bound framebuffer object. + * + * @param target the framebuffer target. One of:
{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment point of the framebuffer + * @param texture the texture object to attach to the framebuffer attachment point named by {@code attachment} + * @param level the mipmap level of {@code texture} to attach + * + * @see Reference Page + */ + public static void glFramebufferTexture(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level) { + GL32C.glFramebufferTexture(target, attachment, texture, level); + } + + // --- [ glFenceSync ] --- + + /** + * Creates a new sync object and inserts it into the GL command stream. + * + * @param condition the condition that must be met to set the sync object's state to signaled. Must be:
{@link GL32C#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE}
+ * @param flags a bitwise combination of flags controlling the behavior of the sync object. No flags are presently defined for this operation and {@code flags} must + * be zero. + * + * @see Reference Page + */ + @NativeType("GLsync") + public static long glFenceSync(@NativeType("GLenum") int condition, @NativeType("GLbitfield") int flags) { + return GL32C.glFenceSync(condition, flags); + } + + // --- [ glIsSync ] --- + + /** Unsafe version of: {@link #glIsSync IsSync} */ + public static boolean nglIsSync(long sync) { + return GL32C.nglIsSync(sync); + } + + /** + * Determines if a name corresponds to a sync object. + * + * @param sync a value that may be the name of a sync object + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static boolean glIsSync(@NativeType("GLsync") long sync) { + return GL32C.glIsSync(sync); + } + + // --- [ glDeleteSync ] --- + + /** Unsafe version of: {@link #glDeleteSync DeleteSync} */ + public static void nglDeleteSync(long sync) { + GL32C.nglDeleteSync(sync); + } + + /** + * Deletes a sync object. + * + * @param sync the sync object to be deleted + * + * @see Reference Page + */ + public static void glDeleteSync(@NativeType("GLsync") long sync) { + GL32C.glDeleteSync(sync); + } + + // --- [ glClientWaitSync ] --- + + /** Unsafe version of: {@link #glClientWaitSync ClientWaitSync} */ + public static int nglClientWaitSync(long sync, int flags, long timeout) { + return GL32C.nglClientWaitSync(sync, flags, timeout); + } + + /** + * Causes the client to block and wait for a sync object to become signaled. If {@code sync} is signaled when {@code glClientWaitSync} is called, + * {@code glClientWaitSync} returns immediately, otherwise it will block and wait for up to timeout nanoseconds for {@code sync} to become signaled. + * + *

The return value is one of four status values:

+ * + *
    + *
  • {@link GL32C#GL_ALREADY_SIGNALED ALREADY_SIGNALED} indicates that sync was signaled at the time that glClientWaitSync was called.
  • + *
  • {@link GL32C#GL_TIMEOUT_EXPIRED TIMEOUT_EXPIRED} indicates that at least timeout nanoseconds passed and sync did not become signaled.
  • + *
  • {@link GL32C#GL_CONDITION_SATISFIED CONDITION_SATISFIED} indicates that sync was signaled before the timeout expired.
  • + *
  • {@link GL32C#GL_WAIT_FAILED WAIT_FAILED} indicates that an error occurred. Additionally, an OpenGL error will be generated.
  • + *
+ * + * @param sync the sync object whose status to wait on + * @param flags a bitfield controlling the command flushing behavior. One or more of:
0{@link GL32C#GL_SYNC_FLUSH_COMMANDS_BIT SYNC_FLUSH_COMMANDS_BIT}
+ * @param timeout the timeout, specified in nanoseconds, for which the implementation should wait for {@code sync} to become signaled + * + * @see Reference Page + */ + @NativeType("GLenum") + public static int glClientWaitSync(@NativeType("GLsync") long sync, @NativeType("GLbitfield") int flags, @NativeType("GLuint64") long timeout) { + return GL32C.glClientWaitSync(sync, flags, timeout); + } + + // --- [ glWaitSync ] --- + + /** Unsafe version of: {@link #glWaitSync WaitSync} */ + public static void nglWaitSync(long sync, int flags, long timeout) { + GL32C.nglWaitSync(sync, flags, timeout); + } + + /** + * Causes the GL server to block and wait for a sync object to become signaled. + * + *

{@code glWaitSync} will always wait no longer than an implementation-dependent timeout. The duration of this timeout in nanoseconds may be queried by + * with {@link GL32C#GL_MAX_SERVER_WAIT_TIMEOUT MAX_SERVER_WAIT_TIMEOUT}. There is currently no way to determine whether glWaitSync unblocked because the timeout expired or because the + * sync object being waited on was signaled.

+ * + *

If an error occurs, {@code glWaitSync} does not cause the GL server to block.

+ * + * @param sync the sync object whose status to wait on + * @param flags a bitfield controlling the command flushing behavior. Must be:
0
+ * @param timeout the timeout that the server should wait before continuing. Must be:
{@link GL32C#GL_TIMEOUT_IGNORED TIMEOUT_IGNORED}
+ * + * @see Reference Page + */ + public static void glWaitSync(@NativeType("GLsync") long sync, @NativeType("GLbitfield") int flags, @NativeType("GLuint64") long timeout) { + GL32C.glWaitSync(sync, flags, timeout); + } + + // --- [ glGetInteger64v ] --- + + /** Unsafe version of: {@link #glGetInteger64v GetInteger64v} */ + public static void nglGetInteger64v(int pname, long params) { + GL32C.nglGetInteger64v(pname, params); + } + + /** + * Returns the 64bit integer value or values of a selected parameter. + * + * @param pname the parameter value to be returned + * @param params the value or values of the specified parameter + * + * @see Reference Page + */ + public static void glGetInteger64v(@NativeType("GLenum") int pname, @NativeType("GLint64 *") LongBuffer params) { + GL32C.glGetInteger64v(pname, params); + } + + /** + * Returns the 64bit integer value or values of a selected parameter. + * + * @param pname the parameter value to be returned + * + * @see Reference Page + */ + @NativeType("void") + public static long glGetInteger64(@NativeType("GLenum") int pname) { + return GL32C.glGetInteger64(pname); + } + + // --- [ glGetInteger64i_v ] --- + + /** Unsafe version of: {@link #glGetInteger64i_v GetInteger64i_v} */ + public static void nglGetInteger64i_v(int pname, int index, long params) { + GL32C.nglGetInteger64i_v(pname, index, params); + } + + /** + * Queries the 64bit integer value of an indexed state variable. + * + * @param pname the indexed state to query + * @param index the index of the element being queried + * @param params the value or values of the specified parameter + * + * @see Reference Page + */ + public static void glGetInteger64i_v(@NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLint64 *") LongBuffer params) { + GL32C.glGetInteger64i_v(pname, index, params); + } + + /** + * Queries the 64bit integer value of an indexed state variable. + * + * @param pname the indexed state to query + * @param index the index of the element being queried + * + * @see Reference Page + */ + @NativeType("void") + public static long glGetInteger64i(@NativeType("GLenum") int pname, @NativeType("GLuint") int index) { + return GL32C.glGetInteger64i(pname, index); + } + + // --- [ glGetSynciv ] --- + + /** + * Unsafe version of: {@link #glGetSynciv GetSynciv} + * + * @param bufSize the size of the buffer whose address is given in {@code values} + */ + public static void nglGetSynciv(long sync, int pname, int bufSize, long length, long values) { + GL32C.nglGetSynciv(sync, pname, bufSize, length, values); + } + + /** + * Queries the properties of a sync object. + * + * @param sync the sync object whose properties to query + * @param pname the parameter whose value to retrieve from the sync object specified in {@code sync}. One of:
{@link GL32C#GL_OBJECT_TYPE OBJECT_TYPE}{@link GL32C#GL_SYNC_CONDITION SYNC_CONDITION}{@link GL32C#GL_SYNC_STATUS SYNC_STATUS}{@link GL32C#GL_SYNC_FLAGS SYNC_FLAGS}
+ * @param length the address of an variable to receive the number of integers placed in {@code values} + * @param values the address of an array to receive the values of the queried parameter + * + * @see Reference Page + */ + public static void glGetSynciv(@NativeType("GLsync") long sync, @NativeType("GLenum") int pname, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLint *") IntBuffer values) { + GL32C.glGetSynciv(sync, pname, length, values); + } + + /** + * Queries the properties of a sync object. + * + * @param sync the sync object whose properties to query + * @param pname the parameter whose value to retrieve from the sync object specified in {@code sync}. One of:
{@link GL32C#GL_OBJECT_TYPE OBJECT_TYPE}{@link GL32C#GL_SYNC_CONDITION SYNC_CONDITION}{@link GL32C#GL_SYNC_STATUS SYNC_STATUS}{@link GL32C#GL_SYNC_FLAGS SYNC_FLAGS}
+ * @param length the address of an variable to receive the number of integers placed in {@code values} + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetSynci(@NativeType("GLsync") long sync, @NativeType("GLenum") int pname, @Nullable @NativeType("GLsizei *") IntBuffer length) { + return GL32C.glGetSynci(sync, pname, length); + } + + /** + * Array version of: {@link #glGetBufferParameteri64v GetBufferParameteri64v} + * + * @see Reference Page + */ + public static void glGetBufferParameteri64v(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint64 *") long[] params) { + GL32C.glGetBufferParameteri64v(target, pname, params); + } + + /** + * Array version of: {@link #glMultiDrawElementsBaseVertex MultiDrawElementsBaseVertex} + * + * @see Reference Page + */ + public static void glMultiDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLsizei const *") int[] count, @NativeType("GLenum") int type, @NativeType("void const **") PointerBuffer indices, @NativeType("GLint *") int[] basevertex) { + GL32C.glMultiDrawElementsBaseVertex(mode, count, type, indices, basevertex); + } + + /** + * Array version of: {@link #glGetMultisamplefv GetMultisamplefv} + * + * @see Reference Page + */ + public static void glGetMultisamplefv(@NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLfloat *") float[] val) { + GL32C.glGetMultisamplefv(pname, index, val); + } + + /** + * Array version of: {@link #glGetInteger64v GetInteger64v} + * + * @see Reference Page + */ + public static void glGetInteger64v(@NativeType("GLenum") int pname, @NativeType("GLint64 *") long[] params) { + GL32C.glGetInteger64v(pname, params); + } + + /** + * Array version of: {@link #glGetInteger64i_v GetInteger64i_v} + * + * @see Reference Page + */ + public static void glGetInteger64i_v(@NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLint64 *") long[] params) { + GL32C.glGetInteger64i_v(pname, index, params); + } + + /** + * Array version of: {@link #glGetSynciv GetSynciv} + * + * @see Reference Page + */ + public static void glGetSynciv(@NativeType("GLsync") long sync, @NativeType("GLenum") int pname, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLint *") int[] values) { + GL32C.glGetSynciv(sync, pname, length, values); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL32C.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL32C.java new file mode 100644 index 00000000..874a1b72 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL32C.java @@ -0,0 +1,966 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality up to version 3.2. Includes only Core Profile symbols. + * + *

OpenGL 3.2 implementations support revision 1.50 of the OpenGL Shading Language.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL32C extends GL31C { + + /** Accepted by the {@code pname} parameter of GetIntegerv. */ + public static final int GL_CONTEXT_PROFILE_MASK = 0x9126; + + /** Context profile bits. */ + public static final int + GL_CONTEXT_CORE_PROFILE_BIT = 0x1, + GL_CONTEXT_COMPATIBILITY_PROFILE_BIT = 0x2; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122, + GL_MAX_GEOMETRY_INPUT_COMPONENTS = 0x9123, + GL_MAX_GEOMETRY_OUTPUT_COMPONENTS = 0x9124, + GL_MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125; + + /** Accepted by the {@code mode} parameter of ProvokingVertex. */ + public static final int + GL_FIRST_VERTEX_CONVENTION = 0x8E4D, + GL_LAST_VERTEX_CONVENTION = 0x8E4E; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_PROVOKING_VERTEX = 0x8E4F, + GL_QUADS_FOLLOW_PROVOKING_VERTEX_CONVENTION = 0x8E4C; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv and + * GetDoublev. + */ + public static final int GL_TEXTURE_CUBE_MAP_SEAMLESS = 0x884F; + + /** Accepted by the {@code pname} parameter of GetMultisamplefv. */ + public static final int GL_SAMPLE_POSITION = 0x8E50; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_SAMPLE_MASK = 0x8E51; + + /** Accepted by the {@code target} parameter of GetBooleani_v and GetIntegeri_v. */ + public static final int GL_SAMPLE_MASK_VALUE = 0x8E52; + + /** Accepted by the {@code target} parameter of BindTexture and TexImage2DMultisample. */ + public static final int GL_TEXTURE_2D_MULTISAMPLE = 0x9100; + + /** Accepted by the {@code target} parameter of TexImage2DMultisample. */ + public static final int GL_PROXY_TEXTURE_2D_MULTISAMPLE = 0x9101; + + /** Accepted by the {@code target} parameter of BindTexture and TexImage3DMultisample. */ + public static final int GL_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9102; + + /** Accepted by the {@code target} parameter of TexImage3DMultisample. */ + public static final int GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY = 0x9103; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_MAX_SAMPLE_MASK_WORDS = 0x8E59, + GL_MAX_COLOR_TEXTURE_SAMPLES = 0x910E, + GL_MAX_DEPTH_TEXTURE_SAMPLES = 0x910F, + GL_MAX_INTEGER_SAMPLES = 0x9110, + GL_TEXTURE_BINDING_2D_MULTISAMPLE = 0x9104, + GL_TEXTURE_BINDING_2D_MULTISAMPLE_ARRAY = 0x9105; + + /** Accepted by the {@code pname} parameter of GetTexLevelParameter. */ + public static final int + GL_TEXTURE_SAMPLES = 0x9106, + GL_TEXTURE_FIXED_SAMPLE_LOCATIONS = 0x9107; + + /** Returned by the {@code type} parameter of GetActiveUniform. */ + public static final int + GL_SAMPLER_2D_MULTISAMPLE = 0x9108, + GL_INT_SAMPLER_2D_MULTISAMPLE = 0x9109, + GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE = 0x910A, + GL_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910B, + GL_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910C, + GL_UNSIGNED_INT_SAMPLER_2D_MULTISAMPLE_ARRAY = 0x910D; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_DEPTH_CLAMP = 0x864F; + + /** Accepted by the {@code type} parameter of CreateShader and returned by the {@code params} parameter of GetShaderiv. */ + public static final int GL_GEOMETRY_SHADER = 0x8DD9; + + /** Accepted by the {@code pname} parameter of ProgramParameteri and GetProgramiv. */ + public static final int + GL_GEOMETRY_VERTICES_OUT = 0x8DDA, + GL_GEOMETRY_INPUT_TYPE = 0x8DDB, + GL_GEOMETRY_OUTPUT_TYPE = 0x8DDC; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS = 0x8C29, + GL_MAX_GEOMETRY_UNIFORM_COMPONENTS = 0x8DDF, + GL_MAX_GEOMETRY_OUTPUT_VERTICES = 0x8DE0, + GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS = 0x8DE1; + + /** Accepted by the {@code mode} parameter of Begin, DrawArrays, MultiDrawArrays, DrawElements, MultiDrawElements, and DrawRangeElements. */ + public static final int + GL_LINES_ADJACENCY = 0xA, + GL_LINE_STRIP_ADJACENCY = 0xB, + GL_TRIANGLES_ADJACENCY = 0xC, + GL_TRIANGLE_STRIP_ADJACENCY = 0xD; + + /** Returned by CheckFramebufferStatus. */ + public static final int GL_FRAMEBUFFER_INCOMPLETE_LAYER_TARGETS = 0x8DA8; + + /** Accepted by the {@code pname} parameter of GetFramebufferAttachment- Parameteriv. */ + public static final int GL_FRAMEBUFFER_ATTACHMENT_LAYERED = 0x8DA7; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetIntegerv, GetFloatv, GetDoublev, and + * GetBooleanv. + */ + public static final int GL_PROGRAM_POINT_SIZE = 0x8642; + + /** Accepted as the {@code pname} parameter of GetInteger64v. */ + public static final int GL_MAX_SERVER_WAIT_TIMEOUT = 0x9111; + + /** Accepted as the {@code pname} parameter of GetSynciv. */ + public static final int + GL_OBJECT_TYPE = 0x9112, + GL_SYNC_CONDITION = 0x9113, + GL_SYNC_STATUS = 0x9114, + GL_SYNC_FLAGS = 0x9115; + + /** Returned in {@code values} for GetSynciv {@code pname} OBJECT_TYPE. */ + public static final int GL_SYNC_FENCE = 0x9116; + + /** Returned in {@code values} for GetSynciv {@code pname} SYNC_CONDITION. */ + public static final int GL_SYNC_GPU_COMMANDS_COMPLETE = 0x9117; + + /** Returned in {@code values} for GetSynciv {@code pname} SYNC_STATUS. */ + public static final int + GL_UNSIGNALED = 0x9118, + GL_SIGNALED = 0x9119; + + /** Accepted in the {@code flags} parameter of ClientWaitSync. */ + public static final int GL_SYNC_FLUSH_COMMANDS_BIT = 0x1; + + /** Accepted in the {@code timeout} parameter of WaitSync. */ + public static final long GL_TIMEOUT_IGNORED = 0xFFFFFFFFFFFFFFFFL; + + /** Returned by ClientWaitSync. */ + public static final int + GL_ALREADY_SIGNALED = 0x911A, + GL_TIMEOUT_EXPIRED = 0x911B, + GL_CONDITION_SATISFIED = 0x911C, + GL_WAIT_FAILED = 0x911D; + + static { GL.initialize(); } + + protected GL32C() { + throw new UnsupportedOperationException(); + } + + // --- [ glGetBufferParameteri64v ] --- + + /** Unsafe version of: {@link #glGetBufferParameteri64v GetBufferParameteri64v} */ + public static native void nglGetBufferParameteri64v(int target, int pname, long params); + + /** + * Returns the value of a buffer object parameter. + * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param pname the symbolic name of a buffer object parameter. One of:
{@link GL15#GL_BUFFER_SIZE BUFFER_SIZE}{@link GL15#GL_BUFFER_USAGE BUFFER_USAGE}{@link GL15#GL_BUFFER_ACCESS BUFFER_ACCESS}{@link GL15#GL_BUFFER_MAPPED BUFFER_MAPPED}
{@link GL30#GL_BUFFER_ACCESS_FLAGS BUFFER_ACCESS_FLAGS}{@link GL30#GL_BUFFER_MAP_LENGTH BUFFER_MAP_LENGTH}{@link GL30#GL_BUFFER_MAP_OFFSET BUFFER_MAP_OFFSET}{@link GL44#GL_BUFFER_IMMUTABLE_STORAGE BUFFER_IMMUTABLE_STORAGE}
{@link GL44#GL_BUFFER_STORAGE_FLAGS BUFFER_STORAGE_FLAGS}
+ * @param params the requested parameter + * + * @see Reference Page + */ + public static void glGetBufferParameteri64v(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint64 *") LongBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetBufferParameteri64v(target, pname, memAddress(params)); + } + + /** + * Returns the value of a buffer object parameter. + * + * @param target the target buffer object. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param pname the symbolic name of a buffer object parameter. One of:
{@link GL15#GL_BUFFER_SIZE BUFFER_SIZE}{@link GL15#GL_BUFFER_USAGE BUFFER_USAGE}{@link GL15#GL_BUFFER_ACCESS BUFFER_ACCESS}{@link GL15#GL_BUFFER_MAPPED BUFFER_MAPPED}
{@link GL30#GL_BUFFER_ACCESS_FLAGS BUFFER_ACCESS_FLAGS}{@link GL30#GL_BUFFER_MAP_LENGTH BUFFER_MAP_LENGTH}{@link GL30#GL_BUFFER_MAP_OFFSET BUFFER_MAP_OFFSET}{@link GL44#GL_BUFFER_IMMUTABLE_STORAGE BUFFER_IMMUTABLE_STORAGE}
{@link GL44#GL_BUFFER_STORAGE_FLAGS BUFFER_STORAGE_FLAGS}
+ * + * @see Reference Page + */ + @NativeType("void") + public static long glGetBufferParameteri64(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglGetBufferParameteri64v(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glDrawElementsBaseVertex ] --- + + /** + * Unsafe version of: {@link #glDrawElementsBaseVertex DrawElementsBaseVertex} + * + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static native void nglDrawElementsBaseVertex(int mode, int count, int type, long indices, int basevertex); + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link #GL_LINES_ADJACENCY LINES_ADJACENCY}{@link #GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link #GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link #GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices, @NativeType("GLint") int basevertex) { + nglDrawElementsBaseVertex(mode, count, type, indices, basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link #GL_LINES_ADJACENCY LINES_ADJACENCY}{@link #GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link #GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link #GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices, @NativeType("GLint") int basevertex) { + nglDrawElementsBaseVertex(mode, indices.remaining() >> GLChecks.typeToByteShift(type), type, memAddress(indices), basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link #GL_LINES_ADJACENCY LINES_ADJACENCY}{@link #GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link #GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link #GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indices, @NativeType("GLint") int basevertex) { + nglDrawElementsBaseVertex(mode, indices.remaining(), GL11.GL_UNSIGNED_BYTE, memAddress(indices), basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link #GL_LINES_ADJACENCY LINES_ADJACENCY}{@link #GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link #GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link #GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("void const *") ShortBuffer indices, @NativeType("GLint") int basevertex) { + nglDrawElementsBaseVertex(mode, indices.remaining(), GL11.GL_UNSIGNED_SHORT, memAddress(indices), basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link #GL_LINES_ADJACENCY LINES_ADJACENCY}{@link #GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link #GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link #GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indices, @NativeType("GLint") int basevertex) { + nglDrawElementsBaseVertex(mode, indices.remaining(), GL11.GL_UNSIGNED_INT, memAddress(indices), basevertex); + } + + // --- [ glDrawRangeElementsBaseVertex ] --- + + /** + * Unsafe version of: {@link #glDrawRangeElementsBaseVertex DrawRangeElementsBaseVertex} + * + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static native void nglDrawRangeElementsBaseVertex(int mode, int start, int end, int count, int type, long indices, int basevertex); + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link #GL_LINES_ADJACENCY LINES_ADJACENCY}{@link #GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link #GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link #GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawRangeElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices, @NativeType("GLint") int basevertex) { + nglDrawRangeElementsBaseVertex(mode, start, end, count, type, indices, basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link #GL_LINES_ADJACENCY LINES_ADJACENCY}{@link #GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link #GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link #GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawRangeElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices, @NativeType("GLint") int basevertex) { + nglDrawRangeElementsBaseVertex(mode, start, end, indices.remaining() >> GLChecks.typeToByteShift(type), type, memAddress(indices), basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link #GL_LINES_ADJACENCY LINES_ADJACENCY}{@link #GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link #GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link #GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawRangeElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("void const *") ByteBuffer indices, @NativeType("GLint") int basevertex) { + nglDrawRangeElementsBaseVertex(mode, start, end, indices.remaining(), GL11.GL_UNSIGNED_BYTE, memAddress(indices), basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link #GL_LINES_ADJACENCY LINES_ADJACENCY}{@link #GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link #GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link #GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawRangeElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("void const *") ShortBuffer indices, @NativeType("GLint") int basevertex) { + nglDrawRangeElementsBaseVertex(mode, start, end, indices.remaining(), GL11.GL_UNSIGNED_SHORT, memAddress(indices), basevertex); + } + + /** + * Renders primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link #GL_LINES_ADJACENCY LINES_ADJACENCY}{@link #GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link #GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link #GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param start the minimum array index contained in {@code indices} + * @param end the maximum array index contained in {@code indices} + * @param indices a pointer to the location where the indices are stored + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawRangeElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLuint") int start, @NativeType("GLuint") int end, @NativeType("void const *") IntBuffer indices, @NativeType("GLint") int basevertex) { + nglDrawRangeElementsBaseVertex(mode, start, end, indices.remaining(), GL11.GL_UNSIGNED_INT, memAddress(indices), basevertex); + } + + // --- [ glDrawElementsInstancedBaseVertex ] --- + + /** + * Unsafe version of: {@link #glDrawElementsInstancedBaseVertex DrawElementsInstancedBaseVertex} + * + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static native void nglDrawElementsInstancedBaseVertex(int mode, int count, int type, long indices, int primcount, int basevertex); + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link #GL_LINES_ADJACENCY LINES_ADJACENCY}{@link #GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link #GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link #GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex) { + nglDrawElementsInstancedBaseVertex(mode, count, type, indices, primcount, basevertex); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link #GL_LINES_ADJACENCY LINES_ADJACENCY}{@link #GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link #GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link #GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex) { + nglDrawElementsInstancedBaseVertex(mode, indices.remaining() >> GLChecks.typeToByteShift(type), type, memAddress(indices), primcount, basevertex); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link #GL_LINES_ADJACENCY LINES_ADJACENCY}{@link #GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link #GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link #GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseVertex(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex) { + nglDrawElementsInstancedBaseVertex(mode, indices.remaining(), GL11.GL_UNSIGNED_BYTE, memAddress(indices), primcount, basevertex); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link #GL_LINES_ADJACENCY LINES_ADJACENCY}{@link #GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link #GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link #GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseVertex(@NativeType("GLenum") int mode, @NativeType("void const *") ShortBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex) { + nglDrawElementsInstancedBaseVertex(mode, indices.remaining(), GL11.GL_UNSIGNED_SHORT, memAddress(indices), primcount, basevertex); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link #GL_LINES_ADJACENCY LINES_ADJACENCY}{@link #GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link #GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link #GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of indices when chosing elements from the enabled vertex arrays + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseVertex(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex) { + nglDrawElementsInstancedBaseVertex(mode, indices.remaining(), GL11.GL_UNSIGNED_INT, memAddress(indices), primcount, basevertex); + } + + // --- [ glMultiDrawElementsBaseVertex ] --- + + /** + * Unsafe version of: {@link #glMultiDrawElementsBaseVertex MultiDrawElementsBaseVertex} + * + * @param drawcount the size of the {@code count} array + */ + public static native void nglMultiDrawElementsBaseVertex(int mode, long count, int type, long indices, int drawcount, long basevertex); + + /** + * Renders multiple sets of primitives by specifying indices of array data elements and an offset to apply to each index. + * + *

LWJGL note: Use {@link org.lwjgl.system.MemoryUtil#memAddress} to retrieve pointers to the index buffers.

+ * + * @param mode the kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link #GL_LINES_ADJACENCY LINES_ADJACENCY}{@link #GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link #GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link #GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param count an array of the elements counts + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param basevertex a pointer to the location where the base vertices are stored + * + * @see Reference Page + */ + public static void glMultiDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLsizei const *") IntBuffer count, @NativeType("GLenum") int type, @NativeType("void const **") PointerBuffer indices, @NativeType("GLint *") IntBuffer basevertex) { + if (CHECKS) { + check(indices, count.remaining()); + check(basevertex, count.remaining()); + } + nglMultiDrawElementsBaseVertex(mode, memAddress(count), type, memAddress(indices), count.remaining(), memAddress(basevertex)); + } + + // --- [ glProvokingVertex ] --- + + /** + * Specifies the vertex to be used as the source of data for flat shaded varyings. + * + * @param mode the provoking vertex mode. One of:
{@link #GL_FIRST_VERTEX_CONVENTION FIRST_VERTEX_CONVENTION}{@link #GL_LAST_VERTEX_CONVENTION LAST_VERTEX_CONVENTION}
+ * + * @see Reference Page + */ + public static native void glProvokingVertex(@NativeType("GLenum") int mode); + + // --- [ glTexImage2DMultisample ] --- + + /** + * Establishes the data storage, format, dimensions, and number of samples of a 2D multisample texture's image. + * + * @param target the target of the operation. One of:
{@link #GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link #GL_PROXY_TEXTURE_2D_MULTISAMPLE PROXY_TEXTURE_2D_MULTISAMPLE}
+ * @param samples the number of samples in the multisample texture's image + * @param internalformat the internal format to be used to store the multisample texture's image. {@code internalformat} must specify a color-renderable, depth-renderable, + * or stencil-renderable format. + * @param width the width of the multisample texture's image, in texels + * @param height the height of the multisample texture's image, in texels + * @param fixedsamplelocations whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not + * depend on the internal format or size of the image + * + * @see Reference Page + */ + public static native void glTexImage2DMultisample(@NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLboolean") boolean fixedsamplelocations); + + // --- [ glTexImage3DMultisample ] --- + + /** + * Establishes the data storage, format, dimensions, and number of samples of a 3D multisample texture's image. + * + * @param target the target of the operation. One of:
{@link #GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}{@link #GL_PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY PROXY_TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param samples the number of samples in the multisample texture's image + * @param internalformat the internal format to be used to store the multisample texture's image. {@code internalformat} must specify a color-renderable, depth-renderable, + * or stencil-renderable format. + * @param width the width of the multisample texture's image, in texels + * @param height the height of the multisample texture's image, in texels + * @param depth the depth of the multisample texture's image, in texels + * @param fixedsamplelocations whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not + * depend on the internal format or size of the image + * + * @see Reference Page + */ + public static native void glTexImage3DMultisample(@NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLint") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLboolean") boolean fixedsamplelocations); + + // --- [ glGetMultisamplefv ] --- + + /** Unsafe version of: {@link #glGetMultisamplefv GetMultisamplefv} */ + public static native void nglGetMultisamplefv(int pname, int index, long val); + + /** + * Retrieves the location of a sample. + * + * @param pname the sample parameter name. Must be:
{@link #GL_SAMPLE_POSITION SAMPLE_POSITION}
+ * @param index the index of the sample whose position to query + * @param val an array to receive the position of the sample + * + * @see Reference Page + */ + public static void glGetMultisamplefv(@NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLfloat *") FloatBuffer val) { + if (CHECKS) { + check(val, 1); + } + nglGetMultisamplefv(pname, index, memAddress(val)); + } + + /** + * Retrieves the location of a sample. + * + * @param pname the sample parameter name. Must be:
{@link #GL_SAMPLE_POSITION SAMPLE_POSITION}
+ * @param index the index of the sample whose position to query + * + * @see Reference Page + */ + @NativeType("void") + public static float glGetMultisamplef(@NativeType("GLenum") int pname, @NativeType("GLuint") int index) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer val = stack.callocFloat(1); + nglGetMultisamplefv(pname, index, memAddress(val)); + return val.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glSampleMaski ] --- + + /** + * Sets the value of a sub-word of the sample mask. + * + * @param index which 32-bit sub-word of the sample mask to update + * @param mask the new value of the mask sub-word + * + * @see Reference Page + */ + public static native void glSampleMaski(@NativeType("GLuint") int index, @NativeType("GLbitfield") int mask); + + // --- [ glFramebufferTexture ] --- + + /** + * Attaches a level of a texture object as a logical buffer to the currently bound framebuffer object. + * + * @param target the framebuffer target. One of:
{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment point of the framebuffer + * @param texture the texture object to attach to the framebuffer attachment point named by {@code attachment} + * @param level the mipmap level of {@code texture} to attach + * + * @see Reference Page + */ + public static native void glFramebufferTexture(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level); + + // --- [ glFenceSync ] --- + + /** + * Creates a new sync object and inserts it into the GL command stream. + * + * @param condition the condition that must be met to set the sync object's state to signaled. Must be:
{@link #GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE}
+ * @param flags a bitwise combination of flags controlling the behavior of the sync object. No flags are presently defined for this operation and {@code flags} must + * be zero. + * + * @see Reference Page + */ + @NativeType("GLsync") + public static native long glFenceSync(@NativeType("GLenum") int condition, @NativeType("GLbitfield") int flags); + + // --- [ glIsSync ] --- + + /** Unsafe version of: {@link #glIsSync IsSync} */ + public static native boolean nglIsSync(long sync); + + /** + * Determines if a name corresponds to a sync object. + * + * @param sync a value that may be the name of a sync object + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static boolean glIsSync(@NativeType("GLsync") long sync) { + if (CHECKS) { + check(sync); + } + return nglIsSync(sync); + } + + // --- [ glDeleteSync ] --- + + /** Unsafe version of: {@link #glDeleteSync DeleteSync} */ + public static native void nglDeleteSync(long sync); + + /** + * Deletes a sync object. + * + * @param sync the sync object to be deleted + * + * @see Reference Page + */ + public static void glDeleteSync(@NativeType("GLsync") long sync) { + if (CHECKS) { + check(sync); + } + nglDeleteSync(sync); + } + + // --- [ glClientWaitSync ] --- + + /** Unsafe version of: {@link #glClientWaitSync ClientWaitSync} */ + public static native int nglClientWaitSync(long sync, int flags, long timeout); + + /** + * Causes the client to block and wait for a sync object to become signaled. If {@code sync} is signaled when {@code glClientWaitSync} is called, + * {@code glClientWaitSync} returns immediately, otherwise it will block and wait for up to timeout nanoseconds for {@code sync} to become signaled. + * + *

The return value is one of four status values:

+ * + *
    + *
  • {@link #GL_ALREADY_SIGNALED ALREADY_SIGNALED} indicates that sync was signaled at the time that glClientWaitSync was called.
  • + *
  • {@link #GL_TIMEOUT_EXPIRED TIMEOUT_EXPIRED} indicates that at least timeout nanoseconds passed and sync did not become signaled.
  • + *
  • {@link #GL_CONDITION_SATISFIED CONDITION_SATISFIED} indicates that sync was signaled before the timeout expired.
  • + *
  • {@link #GL_WAIT_FAILED WAIT_FAILED} indicates that an error occurred. Additionally, an OpenGL error will be generated.
  • + *
+ * + * @param sync the sync object whose status to wait on + * @param flags a bitfield controlling the command flushing behavior. One or more of:
0{@link #GL_SYNC_FLUSH_COMMANDS_BIT SYNC_FLUSH_COMMANDS_BIT}
+ * @param timeout the timeout, specified in nanoseconds, for which the implementation should wait for {@code sync} to become signaled + * + * @see Reference Page + */ + @NativeType("GLenum") + public static int glClientWaitSync(@NativeType("GLsync") long sync, @NativeType("GLbitfield") int flags, @NativeType("GLuint64") long timeout) { + if (CHECKS) { + check(sync); + } + return nglClientWaitSync(sync, flags, timeout); + } + + // --- [ glWaitSync ] --- + + /** Unsafe version of: {@link #glWaitSync WaitSync} */ + public static native void nglWaitSync(long sync, int flags, long timeout); + + /** + * Causes the GL server to block and wait for a sync object to become signaled. + * + *

{@code glWaitSync} will always wait no longer than an implementation-dependent timeout. The duration of this timeout in nanoseconds may be queried by + * with {@link #GL_MAX_SERVER_WAIT_TIMEOUT MAX_SERVER_WAIT_TIMEOUT}. There is currently no way to determine whether glWaitSync unblocked because the timeout expired or because the + * sync object being waited on was signaled.

+ * + *

If an error occurs, {@code glWaitSync} does not cause the GL server to block.

+ * + * @param sync the sync object whose status to wait on + * @param flags a bitfield controlling the command flushing behavior. Must be:
0
+ * @param timeout the timeout that the server should wait before continuing. Must be:
{@link #GL_TIMEOUT_IGNORED TIMEOUT_IGNORED}
+ * + * @see Reference Page + */ + public static void glWaitSync(@NativeType("GLsync") long sync, @NativeType("GLbitfield") int flags, @NativeType("GLuint64") long timeout) { + if (CHECKS) { + check(sync); + } + nglWaitSync(sync, flags, timeout); + } + + // --- [ glGetInteger64v ] --- + + /** Unsafe version of: {@link #glGetInteger64v GetInteger64v} */ + public static native void nglGetInteger64v(int pname, long params); + + /** + * Returns the 64bit integer value or values of a selected parameter. + * + * @param pname the parameter value to be returned + * @param params the value or values of the specified parameter + * + * @see Reference Page + */ + public static void glGetInteger64v(@NativeType("GLenum") int pname, @NativeType("GLint64 *") LongBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetInteger64v(pname, memAddress(params)); + } + + /** + * Returns the 64bit integer value or values of a selected parameter. + * + * @param pname the parameter value to be returned + * + * @see Reference Page + */ + @NativeType("void") + public static long glGetInteger64(@NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglGetInteger64v(pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetInteger64i_v ] --- + + /** Unsafe version of: {@link #glGetInteger64i_v GetInteger64i_v} */ + public static native void nglGetInteger64i_v(int pname, int index, long params); + + /** + * Queries the 64bit integer value of an indexed state variable. + * + * @param pname the indexed state to query + * @param index the index of the element being queried + * @param params the value or values of the specified parameter + * + * @see Reference Page + */ + public static void glGetInteger64i_v(@NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLint64 *") LongBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetInteger64i_v(pname, index, memAddress(params)); + } + + /** + * Queries the 64bit integer value of an indexed state variable. + * + * @param pname the indexed state to query + * @param index the index of the element being queried + * + * @see Reference Page + */ + @NativeType("void") + public static long glGetInteger64i(@NativeType("GLenum") int pname, @NativeType("GLuint") int index) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglGetInteger64i_v(pname, index, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetSynciv ] --- + + /** + * Unsafe version of: {@link #glGetSynciv GetSynciv} + * + * @param bufSize the size of the buffer whose address is given in {@code values} + */ + public static native void nglGetSynciv(long sync, int pname, int bufSize, long length, long values); + + /** + * Queries the properties of a sync object. + * + * @param sync the sync object whose properties to query + * @param pname the parameter whose value to retrieve from the sync object specified in {@code sync}. One of:
{@link #GL_OBJECT_TYPE OBJECT_TYPE}{@link #GL_SYNC_CONDITION SYNC_CONDITION}{@link #GL_SYNC_STATUS SYNC_STATUS}{@link #GL_SYNC_FLAGS SYNC_FLAGS}
+ * @param length the address of an variable to receive the number of integers placed in {@code values} + * @param values the address of an array to receive the values of the queried parameter + * + * @see Reference Page + */ + public static void glGetSynciv(@NativeType("GLsync") long sync, @NativeType("GLenum") int pname, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLint *") IntBuffer values) { + if (CHECKS) { + check(sync); + checkSafe(length, 1); + } + nglGetSynciv(sync, pname, values.remaining(), memAddressSafe(length), memAddress(values)); + } + + /** + * Queries the properties of a sync object. + * + * @param sync the sync object whose properties to query + * @param pname the parameter whose value to retrieve from the sync object specified in {@code sync}. One of:
{@link #GL_OBJECT_TYPE OBJECT_TYPE}{@link #GL_SYNC_CONDITION SYNC_CONDITION}{@link #GL_SYNC_STATUS SYNC_STATUS}{@link #GL_SYNC_FLAGS SYNC_FLAGS}
+ * @param length the address of an variable to receive the number of integers placed in {@code values} + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetSynci(@NativeType("GLsync") long sync, @NativeType("GLenum") int pname, @Nullable @NativeType("GLsizei *") IntBuffer length) { + if (CHECKS) { + check(sync); + checkSafe(length, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer values = stack.callocInt(1); + nglGetSynciv(sync, pname, 1, memAddressSafe(length), memAddress(values)); + return values.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Array version of: {@link #glGetBufferParameteri64v GetBufferParameteri64v} + * + * @see Reference Page + */ + public static void glGetBufferParameteri64v(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint64 *") long[] params) { + long __functionAddress = GL.getICD().glGetBufferParameteri64v; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glMultiDrawElementsBaseVertex MultiDrawElementsBaseVertex} + * + * @see Reference Page + */ + public static void glMultiDrawElementsBaseVertex(@NativeType("GLenum") int mode, @NativeType("GLsizei const *") int[] count, @NativeType("GLenum") int type, @NativeType("void const **") PointerBuffer indices, @NativeType("GLint *") int[] basevertex) { + long __functionAddress = GL.getICD().glMultiDrawElementsBaseVertex; + if (CHECKS) { + check(__functionAddress); + check(indices, count.length); + check(basevertex, count.length); + } + callPPPV(mode, count, type, memAddress(indices), count.length, basevertex, __functionAddress); + } + + /** + * Array version of: {@link #glGetMultisamplefv GetMultisamplefv} + * + * @see Reference Page + */ + public static void glGetMultisamplefv(@NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLfloat *") float[] val) { + long __functionAddress = GL.getICD().glGetMultisamplefv; + if (CHECKS) { + check(__functionAddress); + check(val, 1); + } + callPV(pname, index, val, __functionAddress); + } + + /** + * Array version of: {@link #glGetInteger64v GetInteger64v} + * + * @see Reference Page + */ + public static void glGetInteger64v(@NativeType("GLenum") int pname, @NativeType("GLint64 *") long[] params) { + long __functionAddress = GL.getICD().glGetInteger64v; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetInteger64i_v GetInteger64i_v} + * + * @see Reference Page + */ + public static void glGetInteger64i_v(@NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLint64 *") long[] params) { + long __functionAddress = GL.getICD().glGetInteger64i_v; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(pname, index, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetSynciv GetSynciv} + * + * @see Reference Page + */ + public static void glGetSynciv(@NativeType("GLsync") long sync, @NativeType("GLenum") int pname, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLint *") int[] values) { + long __functionAddress = GL.getICD().glGetSynciv; + if (CHECKS) { + check(__functionAddress); + check(sync); + checkSafe(length, 1); + } + callPPPV(sync, pname, values.length, length, values, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL33.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL33.java new file mode 100644 index 00000000..fec77bed --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL33.java @@ -0,0 +1,1598 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality up to version 3.3. Includes the deprecated symbols of the Compatibility Profile. + * + *

OpenGL 3.3 implementations support revision 3.30 of the OpenGL Shading Language.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL33 extends GL32 { + + /** + * Accepted by the {@code src} and {@code dst} parameters of BlendFunc and BlendFunci, and by the {@code srcRGB}, {@code dstRGB}, {@code srcAlpha} and + * {@code dstAlpha} parameters of BlendFuncSeparate and BlendFuncSeparatei. + */ + public static final int + GL_SRC1_COLOR = 0x88F9, + GL_ONE_MINUS_SRC1_COLOR = 0x88FA, + GL_ONE_MINUS_SRC1_ALPHA = 0x88FB; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv and GetDoublev. */ + public static final int GL_MAX_DUAL_SOURCE_DRAW_BUFFERS = 0x88FC; + + /** Accepted by the {@code target} parameter of BeginQuery, EndQuery, and GetQueryiv. */ + public static final int GL_ANY_SAMPLES_PASSED = 0x8C2F; + + /** Accepted by the {@code value} parameter of the GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv and GetDoublev functions. */ + public static final int GL_SAMPLER_BINDING = 0x8919; + + /** + * Accepted by the {@code internalFormat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, RenderbufferStorage and + * RenderbufferStorageMultisample. + */ + public static final int GL_RGB10_A2UI = 0x906F; + + /** Accepted by the {@code pname} parameters of TexParameteri, TexParameterf, TexParameteriv, TexParameterfv, GetTexParameterfv, and GetTexParameteriv. */ + public static final int + GL_TEXTURE_SWIZZLE_R = 0x8E42, + GL_TEXTURE_SWIZZLE_G = 0x8E43, + GL_TEXTURE_SWIZZLE_B = 0x8E44, + GL_TEXTURE_SWIZZLE_A = 0x8E45; + + /** Accepted by the {@code pname} parameters of TexParameteriv, TexParameterfv, GetTexParameterfv, and GetTexParameteriv. */ + public static final int GL_TEXTURE_SWIZZLE_RGBA = 0x8E46; + + /** Accepted by the {@code target} parameter of BeginQuery, EndQuery, and GetQueryiv. */ + public static final int GL_TIME_ELAPSED = 0x88BF; + + /** + * Accepted by the {@code target} parameter of GetQueryiv and QueryCounter. Accepted by the {@code value} parameter of GetBooleanv, GetIntegerv, + * GetInteger64v, GetFloatv, and GetDoublev. + */ + public static final int GL_TIMESTAMP = 0x8E28; + + /** Accepted by the {@code pname} parameters of GetVertexAttribdv, GetVertexAttribfv, and GetVertexAttribiv. */ + public static final int GL_VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE; + + /** + * Accepted by the {@code type} parameter of VertexAttribPointer, VertexPointer, NormalPointer, ColorPointer, SecondaryColorPointer, TexCoordPointer, + * VertexAttribP{1234}ui, VertexP*, TexCoordP*, MultiTexCoordP*, NormalP3ui, ColorP*, SecondaryColorP* and VertexAttribP*. + */ + public static final int GL_INT_2_10_10_10_REV = 0x8D9F; + + static { GL.initialize(); } + + protected GL33() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, boolean fc) { + return (fc || checkFunctions( + caps.glVertexP2ui, caps.glVertexP3ui, caps.glVertexP4ui, caps.glVertexP2uiv, caps.glVertexP3uiv, caps.glVertexP4uiv, caps.glTexCoordP1ui, + caps.glTexCoordP2ui, caps.glTexCoordP3ui, caps.glTexCoordP4ui, caps.glTexCoordP1uiv, caps.glTexCoordP2uiv, caps.glTexCoordP3uiv, + caps.glTexCoordP4uiv, caps.glMultiTexCoordP1ui, caps.glMultiTexCoordP2ui, caps.glMultiTexCoordP3ui, caps.glMultiTexCoordP4ui, + caps.glMultiTexCoordP1uiv, caps.glMultiTexCoordP2uiv, caps.glMultiTexCoordP3uiv, caps.glMultiTexCoordP4uiv, caps.glNormalP3ui, caps.glNormalP3uiv, + caps.glColorP3ui, caps.glColorP4ui, caps.glColorP3uiv, caps.glColorP4uiv, caps.glSecondaryColorP3ui, caps.glSecondaryColorP3uiv + )) && checkFunctions( + caps.glBindFragDataLocationIndexed, caps.glGetFragDataIndex, caps.glGenSamplers, caps.glDeleteSamplers, caps.glIsSampler, caps.glBindSampler, + caps.glSamplerParameteri, caps.glSamplerParameterf, caps.glSamplerParameteriv, caps.glSamplerParameterfv, caps.glSamplerParameterIiv, + caps.glSamplerParameterIuiv, caps.glGetSamplerParameteriv, caps.glGetSamplerParameterfv, caps.glGetSamplerParameterIiv, + caps.glGetSamplerParameterIuiv, caps.glQueryCounter, caps.glGetQueryObjecti64v, caps.glGetQueryObjectui64v, caps.glVertexAttribDivisor, + caps.glVertexAttribP1ui, caps.glVertexAttribP2ui, caps.glVertexAttribP3ui, caps.glVertexAttribP4ui, caps.glVertexAttribP1uiv, + caps.glVertexAttribP2uiv, caps.glVertexAttribP3uiv, caps.glVertexAttribP4uiv + ); + } + + // --- [ glBindFragDataLocationIndexed ] --- + + /** Unsafe version of: {@link #glBindFragDataLocationIndexed BindFragDataLocationIndexed} */ + public static void nglBindFragDataLocationIndexed(int program, int colorNumber, int index, long name) { + GL33C.nglBindFragDataLocationIndexed(program, colorNumber, index, name); + } + + /** + * Binds a user-defined varying out variable to a fragment shader color number and index. + * + * @param program the name of the program containing varying out variable whose binding to modify + * @param colorNumber the color number to bind the user-defined varying out variable to + * @param index the index of the color input to bind the user-defined varying out variable to + * @param name the name of the user-defined varying out variable whose binding to modify + * + * @see Reference Page + */ + public static void glBindFragDataLocationIndexed(@NativeType("GLuint") int program, @NativeType("GLuint") int colorNumber, @NativeType("GLuint") int index, @NativeType("GLchar const *") ByteBuffer name) { + GL33C.glBindFragDataLocationIndexed(program, colorNumber, index, name); + } + + /** + * Binds a user-defined varying out variable to a fragment shader color number and index. + * + * @param program the name of the program containing varying out variable whose binding to modify + * @param colorNumber the color number to bind the user-defined varying out variable to + * @param index the index of the color input to bind the user-defined varying out variable to + * @param name the name of the user-defined varying out variable whose binding to modify + * + * @see Reference Page + */ + public static void glBindFragDataLocationIndexed(@NativeType("GLuint") int program, @NativeType("GLuint") int colorNumber, @NativeType("GLuint") int index, @NativeType("GLchar const *") CharSequence name) { + GL33C.glBindFragDataLocationIndexed(program, colorNumber, index, name); + } + + // --- [ glGetFragDataIndex ] --- + + /** Unsafe version of: {@link #glGetFragDataIndex GetFragDataIndex} */ + public static int nglGetFragDataIndex(int program, long name) { + return GL33C.nglGetFragDataIndex(program, name); + } + + /** + * Queries the bindings of color indices to user-defined varying out variables. + * + * @param program the name of the program containing varying out variable whose binding to query + * @param name the name of the user-defined varying out variable whose index to query + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetFragDataIndex(@NativeType("GLuint") int program, @NativeType("GLchar const *") ByteBuffer name) { + return GL33C.glGetFragDataIndex(program, name); + } + + /** + * Queries the bindings of color indices to user-defined varying out variables. + * + * @param program the name of the program containing varying out variable whose binding to query + * @param name the name of the user-defined varying out variable whose index to query + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetFragDataIndex(@NativeType("GLuint") int program, @NativeType("GLchar const *") CharSequence name) { + return GL33C.glGetFragDataIndex(program, name); + } + + // --- [ glGenSamplers ] --- + + /** + * Unsafe version of: {@link #glGenSamplers GenSamplers} + * + * @param count the number of sampler object names to generate + */ + public static void nglGenSamplers(int count, long samplers) { + GL33C.nglGenSamplers(count, samplers); + } + + /** + * Generates sampler object names. + * + * @param samplers a buffer in which the generated sampler object names are stored + * + * @see Reference Page + */ + public static void glGenSamplers(@NativeType("GLuint *") IntBuffer samplers) { + GL33C.glGenSamplers(samplers); + } + + /** + * Generates sampler object names. + * + * @see Reference Page + */ + @NativeType("void") + public static int glGenSamplers() { + return GL33C.glGenSamplers(); + } + + // --- [ glDeleteSamplers ] --- + + /** + * Unsafe version of: {@link #glDeleteSamplers DeleteSamplers} + * + * @param count the number of sampler objects to be deleted + */ + public static void nglDeleteSamplers(int count, long samplers) { + GL33C.nglDeleteSamplers(count, samplers); + } + + /** + * Deletes named sampler objects. + * + * @param samplers an array of sampler objects to be deleted + * + * @see Reference Page + */ + public static void glDeleteSamplers(@NativeType("GLuint const *") IntBuffer samplers) { + GL33C.glDeleteSamplers(samplers); + } + + /** + * Deletes named sampler objects. + * + * @see Reference Page + */ + public static void glDeleteSamplers(@NativeType("GLuint const *") int sampler) { + GL33C.glDeleteSamplers(sampler); + } + + // --- [ glIsSampler ] --- + + /** + * Determines if a name corresponds to a sampler object. + * + * @param sampler a value that may be the name of a sampler object + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static boolean glIsSampler(@NativeType("GLuint") int sampler) { + return GL33C.glIsSampler(sampler); + } + + // --- [ glBindSampler ] --- + + /** + * Binds a named sampler to a texturing target. + * + * @param unit the index of the texture unit to which the sampler is bound + * @param sampler the name of a sampler + * + * @see Reference Page + */ + public static void glBindSampler(@NativeType("GLuint") int unit, @NativeType("GLuint") int sampler) { + GL33C.glBindSampler(unit, sampler); + } + + // --- [ glSamplerParameteri ] --- + + /** + * Set the integer value of a sampler parameter. + * + * @param sampler the sampler object whose parameter to modify + * @param pname the symbolic name of a single-valued sampler parameter. One of:
{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}
{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
+ * @param param the value of {@code pname} + * + * @see Reference Page + */ + public static void glSamplerParameteri(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint") int param) { + GL33C.glSamplerParameteri(sampler, pname, param); + } + + // --- [ glSamplerParameterf ] --- + + /** + * Float version of {@link #glSamplerParameteri SamplerParameteri}. + * + * @param sampler the sampler object whose parameter to modify + * @param pname the symbolic name of a single-valued sampler parameter + * @param param the value of {@code pname} + * + * @see Reference Page + */ + public static void glSamplerParameterf(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLfloat") float param) { + GL33C.glSamplerParameterf(sampler, pname, param); + } + + // --- [ glSamplerParameteriv ] --- + + /** Unsafe version of: {@link #glSamplerParameteriv SamplerParameteriv} */ + public static void nglSamplerParameteriv(int sampler, int pname, long params) { + GL33C.nglSamplerParameteriv(sampler, pname, params); + } + + /** + * Pointer version of {@link #glSamplerParameteri SamplerParameteri}. + * + * @param sampler the sampler object whose parameter to modify + * @param pname the symbolic name of a sampler parameter. One of:
{@link GL11#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}
{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}
{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
+ * @param params an array where the value or values of {@code pname} are stored + * + * @see Reference Page + */ + public static void glSamplerParameteriv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + GL33C.glSamplerParameteriv(sampler, pname, params); + } + + // --- [ glSamplerParameterfv ] --- + + /** Unsafe version of: {@link #glSamplerParameterfv SamplerParameterfv} */ + public static void nglSamplerParameterfv(int sampler, int pname, long params) { + GL33C.nglSamplerParameterfv(sampler, pname, params); + } + + /** + * Float version of {@link #glSamplerParameteriv SamplerParameteriv}. + * + * @param sampler the sampler object whose parameter to modify + * @param pname the symbolic name of a sampler parameter + * @param params an array where the value or values of {@code pname} are stored + * + * @see Reference Page + */ + public static void glSamplerParameterfv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer params) { + GL33C.glSamplerParameterfv(sampler, pname, params); + } + + // --- [ glSamplerParameterIiv ] --- + + /** Unsafe version of: {@link #glSamplerParameterIiv SamplerParameterIiv} */ + public static void nglSamplerParameterIiv(int sampler, int pname, long params) { + GL33C.nglSamplerParameterIiv(sampler, pname, params); + } + + /** + * Pure integer version of {@link #glSamplerParameteriv SamplerParameteriv}. + * + * @param sampler the sampler object whose parameter to modify + * @param pname the symbolic name of a sampler parameter + * @param params an array where the value or values of {@code pname} are stored + * + * @see Reference Page + */ + public static void glSamplerParameterIiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + GL33C.glSamplerParameterIiv(sampler, pname, params); + } + + // --- [ glSamplerParameterIuiv ] --- + + /** Unsafe version of: {@link #glSamplerParameterIuiv SamplerParameterIuiv} */ + public static void nglSamplerParameterIuiv(int sampler, int pname, long params) { + GL33C.nglSamplerParameterIuiv(sampler, pname, params); + } + + /** + * Unsigned pure integer version of {@link #glSamplerParameteriv SamplerParameteriv}. + * + * @param sampler the sampler object whose parameter to modify + * @param pname the symbolic name of a sampler parameter + * @param params an array where the value or values of {@code pname} are stored + * + * @see Reference Page + */ + public static void glSamplerParameterIuiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLuint const *") IntBuffer params) { + GL33C.glSamplerParameterIuiv(sampler, pname, params); + } + + // --- [ glGetSamplerParameteriv ] --- + + /** Unsafe version of: {@link #glGetSamplerParameteriv GetSamplerParameteriv} */ + public static void nglGetSamplerParameteriv(int sampler, int pname, long params) { + GL33C.nglGetSamplerParameteriv(sampler, pname, params); + } + + /** + * Return the integer value(s) of a sampler parameter. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter. One of:
{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}
{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
,{@link GL11#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}
+ * @param params the sampler parameters + * + * @see Reference Page + */ + public static void glGetSamplerParameteriv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL33C.glGetSamplerParameteriv(sampler, pname, params); + } + + /** + * Return the integer value(s) of a sampler parameter. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter. One of:
{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}
{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
,{@link GL11#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetSamplerParameteri(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname) { + return GL33C.glGetSamplerParameteri(sampler, pname); + } + + // --- [ glGetSamplerParameterfv ] --- + + /** Unsafe version of: {@link #glGetSamplerParameterfv GetSamplerParameterfv} */ + public static void nglGetSamplerParameterfv(int sampler, int pname, long params) { + GL33C.nglGetSamplerParameterfv(sampler, pname, params); + } + + /** + * Float version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter + * @param params the sampler parameters + * + * @see Reference Page + */ + public static void glGetSamplerParameterfv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + GL33C.glGetSamplerParameterfv(sampler, pname, params); + } + + /** + * Float version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter + * + * @see Reference Page + */ + @NativeType("void") + public static float glGetSamplerParameterf(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname) { + return GL33C.glGetSamplerParameterf(sampler, pname); + } + + // --- [ glGetSamplerParameterIiv ] --- + + /** Unsafe version of: {@link #glGetSamplerParameterIiv GetSamplerParameterIiv} */ + public static void nglGetSamplerParameterIiv(int sampler, int pname, long params) { + GL33C.nglGetSamplerParameterIiv(sampler, pname, params); + } + + /** + * Pure integer version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter + * @param params the sampler parameters + * + * @see Reference Page + */ + public static void glGetSamplerParameterIiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL33C.glGetSamplerParameterIiv(sampler, pname, params); + } + + /** + * Pure integer version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetSamplerParameterIi(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname) { + return GL33C.glGetSamplerParameterIi(sampler, pname); + } + + // --- [ glGetSamplerParameterIuiv ] --- + + /** Unsafe version of: {@link #glGetSamplerParameterIuiv GetSamplerParameterIuiv} */ + public static void nglGetSamplerParameterIuiv(int sampler, int pname, long params) { + GL33C.nglGetSamplerParameterIuiv(sampler, pname, params); + } + + /** + * Unsigned pure integer version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter + * @param params the sampler parameters + * + * @see Reference Page + */ + public static void glGetSamplerParameterIuiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLuint *") IntBuffer params) { + GL33C.glGetSamplerParameterIuiv(sampler, pname, params); + } + + /** + * Unsigned pure integer version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetSamplerParameterIui(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname) { + return GL33C.glGetSamplerParameterIui(sampler, pname); + } + + // --- [ glQueryCounter ] --- + + /** + * Records the GL time into a query object after all previous commands have reached the GL server but have not yet necessarily executed. + * + * @param id the name of a query object into which to record the GL time + * @param target the counter to query. Must be:
{@link GL33C#GL_TIMESTAMP TIMESTAMP}
+ * + * @see Reference Page + */ + public static void glQueryCounter(@NativeType("GLuint") int id, @NativeType("GLenum") int target) { + GL33C.glQueryCounter(id, target); + } + + // --- [ glGetQueryObjecti64v ] --- + + /** Unsafe version of: {@link #glGetQueryObjecti64v GetQueryObjecti64v} */ + public static void nglGetQueryObjecti64v(int id, int pname, long params) { + GL33C.nglGetQueryObjecti64v(id, pname, params); + } + + /** + * Returns the 64bit integer value of query object parameter. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter. One of:
{@link GL15#GL_QUERY_RESULT QUERY_RESULT}{@link GL15#GL_QUERY_RESULT_AVAILABLE QUERY_RESULT_AVAILABLE}
+ * @param params the requested data + * + * @see Reference Page + */ + public static void glGetQueryObjecti64v(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLint64 *") LongBuffer params) { + GL33C.glGetQueryObjecti64v(id, pname, params); + } + + /** + * Returns the 64bit integer value of query object parameter. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter. One of:
{@link GL15#GL_QUERY_RESULT QUERY_RESULT}{@link GL15#GL_QUERY_RESULT_AVAILABLE QUERY_RESULT_AVAILABLE}
+ * + * @see Reference Page + */ + @NativeType("void") + public static long glGetQueryObjecti64(@NativeType("GLuint") int id, @NativeType("GLenum") int pname) { + return GL33C.glGetQueryObjecti64(id, pname); + } + + // --- [ glGetQueryObjectui64v ] --- + + /** Unsafe version of: {@link #glGetQueryObjectui64v GetQueryObjectui64v} */ + public static void nglGetQueryObjectui64v(int id, int pname, long params) { + GL33C.nglGetQueryObjectui64v(id, pname, params); + } + + /** + * Unsigned version of {@link #glGetQueryObjecti64v GetQueryObjecti64v}. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter + * @param params the requested data + * + * @see Reference Page + */ + public static void glGetQueryObjectui64v(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLuint64 *") LongBuffer params) { + GL33C.glGetQueryObjectui64v(id, pname, params); + } + + /** + * Unsigned version of {@link #glGetQueryObjecti64v GetQueryObjecti64v}. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter + * + * @see Reference Page + */ + @NativeType("void") + public static long glGetQueryObjectui64(@NativeType("GLuint") int id, @NativeType("GLenum") int pname) { + return GL33C.glGetQueryObjectui64(id, pname); + } + + // --- [ glVertexAttribDivisor ] --- + + /** + * Modifies the rate at which generic vertex attributes advance during instanced rendering. + * + * @param index the index of the generic vertex attribute + * @param divisor the number of instances that will pass between updates of the generic attribute at slot {@code index} + * + * @see Reference Page + */ + public static void glVertexAttribDivisor(@NativeType("GLuint") int index, @NativeType("GLuint") int divisor) { + GL33C.glVertexAttribDivisor(index, divisor); + } + + // --- [ glVertexP2ui ] --- + + /** + * Packed component version of {@link GL11#glVertex2f Vertex2f}. + * + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param value the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glVertexP2ui(@NativeType("GLenum") int type, @NativeType("GLuint") int value); + + // --- [ glVertexP3ui ] --- + + /** + * Packed component version of {@link GL11#glVertex3f Vertex3f}. + * + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param value the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glVertexP3ui(@NativeType("GLenum") int type, @NativeType("GLuint") int value); + + // --- [ glVertexP4ui ] --- + + /** + * Packed component version of {@link GL11#glVertex4f Vertex4f}. + * + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param value the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glVertexP4ui(@NativeType("GLenum") int type, @NativeType("GLuint") int value); + + // --- [ glVertexP2uiv ] --- + + /** Unsafe version of: {@link #glVertexP2uiv VertexP2uiv} */ + public static native void nglVertexP2uiv(int type, long value); + + /** + * Pointer version of {@link #glVertexP2ui VertexP2ui}. + * + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param value the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertexP2uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nglVertexP2uiv(type, memAddress(value)); + } + + // --- [ glVertexP3uiv ] --- + + /** Unsafe version of: {@link #glVertexP3uiv VertexP3uiv} */ + public static native void nglVertexP3uiv(int type, long value); + + /** + * Pointer version of {@link #glVertexP3ui VertexP3ui}. + * + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param value the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertexP3uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nglVertexP3uiv(type, memAddress(value)); + } + + // --- [ glVertexP4uiv ] --- + + /** Unsafe version of: {@link #glVertexP4uiv VertexP4uiv} */ + public static native void nglVertexP4uiv(int type, long value); + + /** + * Pointer version of {@link #glVertexP4ui VertexP4ui}. + * + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param value the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertexP4uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nglVertexP4uiv(type, memAddress(value)); + } + + // --- [ glTexCoordP1ui ] --- + + /** + * Packed component version of {@link GL11#glTexCoord1f TexCoord1f}. + * + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexCoordP1ui(@NativeType("GLenum") int type, @NativeType("GLuint") int coords); + + // --- [ glTexCoordP2ui ] --- + + /** + * Packed component version of {@link GL11#glTexCoord2f TexCoord2f}. + * + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexCoordP2ui(@NativeType("GLenum") int type, @NativeType("GLuint") int coords); + + // --- [ glTexCoordP3ui ] --- + + /** + * Packed component version of {@link GL11#glTexCoord3f TexCoord3f}. + * + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexCoordP3ui(@NativeType("GLenum") int type, @NativeType("GLuint") int coords); + + // --- [ glTexCoordP4ui ] --- + + /** + * Packed component version of {@link GL11#glTexCoord4f TexCoord4f}. + * + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glTexCoordP4ui(@NativeType("GLenum") int type, @NativeType("GLuint") int coords); + + // --- [ glTexCoordP1uiv ] --- + + /** Unsafe version of: {@link #glTexCoordP1uiv TexCoordP1uiv} */ + public static native void nglTexCoordP1uiv(int type, long coords); + + /** + * Pointer version of {@link #glTexCoordP1ui TexCoordP1ui}. + * + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoordP1uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer coords) { + if (CHECKS) { + check(coords, 1); + } + nglTexCoordP1uiv(type, memAddress(coords)); + } + + // --- [ glTexCoordP2uiv ] --- + + /** Unsafe version of: {@link #glTexCoordP2uiv TexCoordP2uiv} */ + public static native void nglTexCoordP2uiv(int type, long coords); + + /** + * Pointer version of {@link #glTexCoordP2ui TexCoordP2ui}. + * + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoordP2uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer coords) { + if (CHECKS) { + check(coords, 1); + } + nglTexCoordP2uiv(type, memAddress(coords)); + } + + // --- [ glTexCoordP3uiv ] --- + + /** Unsafe version of: {@link #glTexCoordP3uiv TexCoordP3uiv} */ + public static native void nglTexCoordP3uiv(int type, long coords); + + /** + * Pointer version of {@link #glTexCoordP3ui TexCoordP3ui}. + * + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoordP3uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer coords) { + if (CHECKS) { + check(coords, 1); + } + nglTexCoordP3uiv(type, memAddress(coords)); + } + + // --- [ glTexCoordP4uiv ] --- + + /** Unsafe version of: {@link #glTexCoordP4uiv TexCoordP4uiv} */ + public static native void nglTexCoordP4uiv(int type, long coords); + + /** + * Pointer version of {@link #glTexCoordP4ui TexCoordP4ui}. + * + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoordP4uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer coords) { + if (CHECKS) { + check(coords, 1); + } + nglTexCoordP4uiv(type, memAddress(coords)); + } + + // --- [ glMultiTexCoordP1ui ] --- + + /** + * Packed component version of {@link GL13#glMultiTexCoord1f MultiTexCoord1f}. + * + * @param texture the coordinate set to be modified + * @param type type of packing used on the data. One of:
typeofpackingusedonthedata
+ * @param coords the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMultiTexCoordP1ui(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint") int coords); + + // --- [ glMultiTexCoordP2ui ] --- + + /** + * Packed component version of {@link GL13#glMultiTexCoord2f MultiTexCoord2f}. + * + * @param texture the coordinate set to be modified + * @param type type of packing used on the data. One of:
typeofpackingusedonthedata
+ * @param coords the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMultiTexCoordP2ui(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint") int coords); + + // --- [ glMultiTexCoordP3ui ] --- + + /** + * Packed component version of {@link GL13#glMultiTexCoord3f MultiTexCoord3f}. + * + * @param texture the coordinate set to be modified + * @param type type of packing used on the data. One of:
typeofpackingusedonthedata
+ * @param coords the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMultiTexCoordP3ui(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint") int coords); + + // --- [ glMultiTexCoordP4ui ] --- + + /** + * Packed component version of {@link GL13#glMultiTexCoord4f MultiTexCoord4f}. + * + * @param texture the coordinate set to be modified + * @param type type of packing used on the data. One of:
typeofpackingusedonthedata
+ * @param coords the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glMultiTexCoordP4ui(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint") int coords); + + // --- [ glMultiTexCoordP1uiv ] --- + + /** Unsafe version of: {@link #glMultiTexCoordP1uiv MultiTexCoordP1uiv} */ + public static native void nglMultiTexCoordP1uiv(int texture, int type, long coords); + + /** + * Pointer version of {@link #glMultiTexCoordP1ui MultiTexCoordP1ui}. + * + * @param texture the coordinate set to be modified + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoordP1uiv(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer coords) { + if (CHECKS) { + check(coords, 1); + } + nglMultiTexCoordP1uiv(texture, type, memAddress(coords)); + } + + // --- [ glMultiTexCoordP2uiv ] --- + + /** Unsafe version of: {@link #glMultiTexCoordP2uiv MultiTexCoordP2uiv} */ + public static native void nglMultiTexCoordP2uiv(int texture, int type, long coords); + + /** + * Pointer version of {@link #glMultiTexCoordP2ui MultiTexCoordP2ui}. + * + * @param texture the coordinate set to be modified + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoordP2uiv(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer coords) { + if (CHECKS) { + check(coords, 1); + } + nglMultiTexCoordP2uiv(texture, type, memAddress(coords)); + } + + // --- [ glMultiTexCoordP3uiv ] --- + + /** Unsafe version of: {@link #glMultiTexCoordP3uiv MultiTexCoordP3uiv} */ + public static native void nglMultiTexCoordP3uiv(int texture, int type, long coords); + + /** + * Pointer version of {@link #glMultiTexCoordP3ui MultiTexCoordP3ui}. + * + * @param texture the coordinate set to be modified + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoordP3uiv(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer coords) { + if (CHECKS) { + check(coords, 1); + } + nglMultiTexCoordP3uiv(texture, type, memAddress(coords)); + } + + // --- [ glMultiTexCoordP4uiv ] --- + + /** Unsafe version of: {@link #glMultiTexCoordP4uiv MultiTexCoordP4uiv} */ + public static native void nglMultiTexCoordP4uiv(int texture, int type, long coords); + + /** + * Pointer version of {@link #glMultiTexCoordP4ui MultiTexCoordP4ui}. + * + * @param texture the coordinate set to be modified + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoordP4uiv(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer coords) { + if (CHECKS) { + check(coords, 1); + } + nglMultiTexCoordP4uiv(texture, type, memAddress(coords)); + } + + // --- [ glNormalP3ui ] --- + + /** + * Packed component version of {@link GL11#glNormal3f Normal3f}. + * + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glNormalP3ui(@NativeType("GLenum") int type, @NativeType("GLuint") int coords); + + // --- [ glNormalP3uiv ] --- + + /** Unsafe version of: {@link #glNormalP3uiv NormalP3uiv} */ + public static native void nglNormalP3uiv(int type, long coords); + + /** + * Pointer version {@link #glNormalP3ui NormalP3ui}. + * + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param coords the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glNormalP3uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer coords) { + if (CHECKS) { + check(coords, 1); + } + nglNormalP3uiv(type, memAddress(coords)); + } + + // --- [ glColorP3ui ] --- + + /** + * Packed component version of {@link GL11#glColor3f Color3f}. + * + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param color the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glColorP3ui(@NativeType("GLenum") int type, @NativeType("GLuint") int color); + + // --- [ glColorP4ui ] --- + + /** + * Packed component version of {@link GL11#glColor4f Color4f}. + * + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param color the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glColorP4ui(@NativeType("GLenum") int type, @NativeType("GLuint") int color); + + // --- [ glColorP3uiv ] --- + + /** Unsafe version of: {@link #glColorP3uiv ColorP3uiv} */ + public static native void nglColorP3uiv(int type, long color); + + /** + * Pointer version of {@link #glColorP3ui ColorP3ui}. + * + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param color the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColorP3uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer color) { + if (CHECKS) { + check(color, 1); + } + nglColorP3uiv(type, memAddress(color)); + } + + // --- [ glColorP4uiv ] --- + + /** Unsafe version of: {@link #glColorP4uiv ColorP4uiv} */ + public static native void nglColorP4uiv(int type, long color); + + /** + * Pointer version of {@link #glColorP4ui ColorP4ui}. + * + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param color the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColorP4uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer color) { + if (CHECKS) { + check(color, 1); + } + nglColorP4uiv(type, memAddress(color)); + } + + // --- [ glSecondaryColorP3ui ] --- + + /** + * Packed component version of {@link GL14#glSecondaryColor3f SecondaryColor3f}. + * + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param color the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static native void glSecondaryColorP3ui(@NativeType("GLenum") int type, @NativeType("GLuint") int color); + + // --- [ glSecondaryColorP3uiv ] --- + + /** Unsafe version of: {@link #glSecondaryColorP3uiv SecondaryColorP3uiv} */ + public static native void nglSecondaryColorP3uiv(int type, long color); + + /** + * Pointer version of {@link #glSecondaryColorP3ui SecondaryColorP3ui}. + * + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param color the packed value + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSecondaryColorP3uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") IntBuffer color) { + if (CHECKS) { + check(color, 1); + } + nglSecondaryColorP3uiv(type, memAddress(color)); + } + + // --- [ glVertexAttribP1ui ] --- + + /** + * Packed component version of {@link GL20C#glVertexAttrib1f VertexAttrib1f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link GL33C#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + * + * @see Reference Page + */ + public static void glVertexAttribP1ui(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint") int value) { + GL33C.glVertexAttribP1ui(index, type, normalized, value); + } + + // --- [ glVertexAttribP2ui ] --- + + /** + * Packed component version of {@link GL20C#glVertexAttrib2f VertexAttrib2f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link GL33C#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + * + * @see Reference Page + */ + public static void glVertexAttribP2ui(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint") int value) { + GL33C.glVertexAttribP2ui(index, type, normalized, value); + } + + // --- [ glVertexAttribP3ui ] --- + + /** + * Packed component version of {@link GL20C#glVertexAttrib3f VertexAttrib3f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link GL33C#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + * + * @see Reference Page + */ + public static void glVertexAttribP3ui(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint") int value) { + GL33C.glVertexAttribP3ui(index, type, normalized, value); + } + + // --- [ glVertexAttribP4ui ] --- + + /** + * Packed component version of {@link GL20C#glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link GL33C#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + * + * @see Reference Page + */ + public static void glVertexAttribP4ui(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint") int value) { + GL33C.glVertexAttribP4ui(index, type, normalized, value); + } + + // --- [ glVertexAttribP1uiv ] --- + + /** Unsafe version of: {@link #glVertexAttribP1uiv VertexAttribP1uiv} */ + public static void nglVertexAttribP1uiv(int index, int type, boolean normalized, long value) { + GL33C.nglVertexAttribP1uiv(index, type, normalized, value); + } + + /** + * Pointer version of {@link #glVertexAttribP1ui VertexAttribP1ui}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link GL33C#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + * + * @see Reference Page + */ + public static void glVertexAttribP1uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") IntBuffer value) { + GL33C.glVertexAttribP1uiv(index, type, normalized, value); + } + + // --- [ glVertexAttribP2uiv ] --- + + /** Unsafe version of: {@link #glVertexAttribP2uiv VertexAttribP2uiv} */ + public static void nglVertexAttribP2uiv(int index, int type, boolean normalized, long value) { + GL33C.nglVertexAttribP2uiv(index, type, normalized, value); + } + + /** + * Pointer version of {@link #glVertexAttribP2ui VertexAttribP2ui}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link GL33C#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + * + * @see Reference Page + */ + public static void glVertexAttribP2uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") IntBuffer value) { + GL33C.glVertexAttribP2uiv(index, type, normalized, value); + } + + // --- [ glVertexAttribP3uiv ] --- + + /** Unsafe version of: {@link #glVertexAttribP3uiv VertexAttribP3uiv} */ + public static void nglVertexAttribP3uiv(int index, int type, boolean normalized, long value) { + GL33C.nglVertexAttribP3uiv(index, type, normalized, value); + } + + /** + * Pointer version of {@link #glVertexAttribP3ui VertexAttribP3ui}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link GL33C#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + * + * @see Reference Page + */ + public static void glVertexAttribP3uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") IntBuffer value) { + GL33C.glVertexAttribP3uiv(index, type, normalized, value); + } + + // --- [ glVertexAttribP4uiv ] --- + + /** Unsafe version of: {@link #glVertexAttribP4uiv VertexAttribP4uiv} */ + public static void nglVertexAttribP4uiv(int index, int type, boolean normalized, long value) { + GL33C.nglVertexAttribP4uiv(index, type, normalized, value); + } + + /** + * Pointer version of {@link #glVertexAttribP4ui VertexAttribP4ui}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link GL33C#GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + * + * @see Reference Page + */ + public static void glVertexAttribP4uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") IntBuffer value) { + GL33C.glVertexAttribP4uiv(index, type, normalized, value); + } + + /** + * Array version of: {@link #glGenSamplers GenSamplers} + * + * @see Reference Page + */ + public static void glGenSamplers(@NativeType("GLuint *") int[] samplers) { + GL33C.glGenSamplers(samplers); + } + + /** + * Array version of: {@link #glDeleteSamplers DeleteSamplers} + * + * @see Reference Page + */ + public static void glDeleteSamplers(@NativeType("GLuint const *") int[] samplers) { + GL33C.glDeleteSamplers(samplers); + } + + /** + * Array version of: {@link #glSamplerParameteriv SamplerParameteriv} + * + * @see Reference Page + */ + public static void glSamplerParameteriv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + GL33C.glSamplerParameteriv(sampler, pname, params); + } + + /** + * Array version of: {@link #glSamplerParameterfv SamplerParameterfv} + * + * @see Reference Page + */ + public static void glSamplerParameterfv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] params) { + GL33C.glSamplerParameterfv(sampler, pname, params); + } + + /** + * Array version of: {@link #glSamplerParameterIiv SamplerParameterIiv} + * + * @see Reference Page + */ + public static void glSamplerParameterIiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + GL33C.glSamplerParameterIiv(sampler, pname, params); + } + + /** + * Array version of: {@link #glSamplerParameterIuiv SamplerParameterIuiv} + * + * @see Reference Page + */ + public static void glSamplerParameterIuiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLuint const *") int[] params) { + GL33C.glSamplerParameterIuiv(sampler, pname, params); + } + + /** + * Array version of: {@link #glGetSamplerParameteriv GetSamplerParameteriv} + * + * @see Reference Page + */ + public static void glGetSamplerParameteriv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL33C.glGetSamplerParameteriv(sampler, pname, params); + } + + /** + * Array version of: {@link #glGetSamplerParameterfv GetSamplerParameterfv} + * + * @see Reference Page + */ + public static void glGetSamplerParameterfv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + GL33C.glGetSamplerParameterfv(sampler, pname, params); + } + + /** + * Array version of: {@link #glGetSamplerParameterIiv GetSamplerParameterIiv} + * + * @see Reference Page + */ + public static void glGetSamplerParameterIiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL33C.glGetSamplerParameterIiv(sampler, pname, params); + } + + /** + * Array version of: {@link #glGetSamplerParameterIuiv GetSamplerParameterIuiv} + * + * @see Reference Page + */ + public static void glGetSamplerParameterIuiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLuint *") int[] params) { + GL33C.glGetSamplerParameterIuiv(sampler, pname, params); + } + + /** + * Array version of: {@link #glGetQueryObjecti64v GetQueryObjecti64v} + * + * @see Reference Page + */ + public static void glGetQueryObjecti64v(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLint64 *") long[] params) { + GL33C.glGetQueryObjecti64v(id, pname, params); + } + + /** + * Array version of: {@link #glGetQueryObjectui64v GetQueryObjectui64v} + * + * @see Reference Page + */ + public static void glGetQueryObjectui64v(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLuint64 *") long[] params) { + GL33C.glGetQueryObjectui64v(id, pname, params); + } + + /** + * Array version of: {@link #glVertexP2uiv VertexP2uiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertexP2uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glVertexP2uiv; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + callPV(type, value, __functionAddress); + } + + /** + * Array version of: {@link #glVertexP3uiv VertexP3uiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertexP3uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glVertexP3uiv; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + callPV(type, value, __functionAddress); + } + + /** + * Array version of: {@link #glVertexP4uiv VertexP4uiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glVertexP4uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glVertexP4uiv; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + callPV(type, value, __functionAddress); + } + + /** + * Array version of: {@link #glTexCoordP1uiv TexCoordP1uiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoordP1uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") int[] coords) { + long __functionAddress = GL.getICD().glTexCoordP1uiv; + if (CHECKS) { + check(__functionAddress); + check(coords, 1); + } + callPV(type, coords, __functionAddress); + } + + /** + * Array version of: {@link #glTexCoordP2uiv TexCoordP2uiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoordP2uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") int[] coords) { + long __functionAddress = GL.getICD().glTexCoordP2uiv; + if (CHECKS) { + check(__functionAddress); + check(coords, 1); + } + callPV(type, coords, __functionAddress); + } + + /** + * Array version of: {@link #glTexCoordP3uiv TexCoordP3uiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoordP3uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") int[] coords) { + long __functionAddress = GL.getICD().glTexCoordP3uiv; + if (CHECKS) { + check(__functionAddress); + check(coords, 1); + } + callPV(type, coords, __functionAddress); + } + + /** + * Array version of: {@link #glTexCoordP4uiv TexCoordP4uiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glTexCoordP4uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") int[] coords) { + long __functionAddress = GL.getICD().glTexCoordP4uiv; + if (CHECKS) { + check(__functionAddress); + check(coords, 1); + } + callPV(type, coords, __functionAddress); + } + + /** + * Array version of: {@link #glMultiTexCoordP1uiv MultiTexCoordP1uiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoordP1uiv(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint const *") int[] coords) { + long __functionAddress = GL.getICD().glMultiTexCoordP1uiv; + if (CHECKS) { + check(__functionAddress); + check(coords, 1); + } + callPV(texture, type, coords, __functionAddress); + } + + /** + * Array version of: {@link #glMultiTexCoordP2uiv MultiTexCoordP2uiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoordP2uiv(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint const *") int[] coords) { + long __functionAddress = GL.getICD().glMultiTexCoordP2uiv; + if (CHECKS) { + check(__functionAddress); + check(coords, 1); + } + callPV(texture, type, coords, __functionAddress); + } + + /** + * Array version of: {@link #glMultiTexCoordP3uiv MultiTexCoordP3uiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoordP3uiv(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint const *") int[] coords) { + long __functionAddress = GL.getICD().glMultiTexCoordP3uiv; + if (CHECKS) { + check(__functionAddress); + check(coords, 1); + } + callPV(texture, type, coords, __functionAddress); + } + + /** + * Array version of: {@link #glMultiTexCoordP4uiv MultiTexCoordP4uiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glMultiTexCoordP4uiv(@NativeType("GLenum") int texture, @NativeType("GLenum") int type, @NativeType("GLuint const *") int[] coords) { + long __functionAddress = GL.getICD().glMultiTexCoordP4uiv; + if (CHECKS) { + check(__functionAddress); + check(coords, 1); + } + callPV(texture, type, coords, __functionAddress); + } + + /** + * Array version of: {@link #glNormalP3uiv NormalP3uiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glNormalP3uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") int[] coords) { + long __functionAddress = GL.getICD().glNormalP3uiv; + if (CHECKS) { + check(__functionAddress); + check(coords, 1); + } + callPV(type, coords, __functionAddress); + } + + /** + * Array version of: {@link #glColorP3uiv ColorP3uiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColorP3uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") int[] color) { + long __functionAddress = GL.getICD().glColorP3uiv; + if (CHECKS) { + check(__functionAddress); + check(color, 1); + } + callPV(type, color, __functionAddress); + } + + /** + * Array version of: {@link #glColorP4uiv ColorP4uiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glColorP4uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") int[] color) { + long __functionAddress = GL.getICD().glColorP4uiv; + if (CHECKS) { + check(__functionAddress); + check(color, 1); + } + callPV(type, color, __functionAddress); + } + + /** + * Array version of: {@link #glSecondaryColorP3uiv SecondaryColorP3uiv} + * + * @see Reference Page - This function is deprecated and unavailable in the Core profile + */ + public static void glSecondaryColorP3uiv(@NativeType("GLenum") int type, @NativeType("GLuint const *") int[] color) { + long __functionAddress = GL.getICD().glSecondaryColorP3uiv; + if (CHECKS) { + check(__functionAddress); + check(color, 1); + } + callPV(type, color, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttribP1uiv VertexAttribP1uiv} + * + * @see Reference Page + */ + public static void glVertexAttribP1uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") int[] value) { + GL33C.glVertexAttribP1uiv(index, type, normalized, value); + } + + /** + * Array version of: {@link #glVertexAttribP2uiv VertexAttribP2uiv} + * + * @see Reference Page + */ + public static void glVertexAttribP2uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") int[] value) { + GL33C.glVertexAttribP2uiv(index, type, normalized, value); + } + + /** + * Array version of: {@link #glVertexAttribP3uiv VertexAttribP3uiv} + * + * @see Reference Page + */ + public static void glVertexAttribP3uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") int[] value) { + GL33C.glVertexAttribP3uiv(index, type, normalized, value); + } + + /** + * Array version of: {@link #glVertexAttribP4uiv VertexAttribP4uiv} + * + * @see Reference Page + */ + public static void glVertexAttribP4uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") int[] value) { + GL33C.glVertexAttribP4uiv(index, type, normalized, value); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL33C.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL33C.java new file mode 100644 index 00000000..e369aa80 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL33C.java @@ -0,0 +1,1023 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality up to version 3.3. Includes only Core Profile symbols. + * + *

OpenGL 3.3 implementations support revision 3.30 of the OpenGL Shading Language.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL33C extends GL32C { + + /** + * Accepted by the {@code src} and {@code dst} parameters of BlendFunc and BlendFunci, and by the {@code srcRGB}, {@code dstRGB}, {@code srcAlpha} and + * {@code dstAlpha} parameters of BlendFuncSeparate and BlendFuncSeparatei. + */ + public static final int + GL_SRC1_COLOR = 0x88F9, + GL_ONE_MINUS_SRC1_COLOR = 0x88FA, + GL_ONE_MINUS_SRC1_ALPHA = 0x88FB; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv and GetDoublev. */ + public static final int GL_MAX_DUAL_SOURCE_DRAW_BUFFERS = 0x88FC; + + /** Accepted by the {@code target} parameter of BeginQuery, EndQuery, and GetQueryiv. */ + public static final int GL_ANY_SAMPLES_PASSED = 0x8C2F; + + /** Accepted by the {@code value} parameter of the GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv and GetDoublev functions. */ + public static final int GL_SAMPLER_BINDING = 0x8919; + + /** + * Accepted by the {@code internalFormat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, RenderbufferStorage and + * RenderbufferStorageMultisample. + */ + public static final int GL_RGB10_A2UI = 0x906F; + + /** Accepted by the {@code pname} parameters of TexParameteri, TexParameterf, TexParameteriv, TexParameterfv, GetTexParameterfv, and GetTexParameteriv. */ + public static final int + GL_TEXTURE_SWIZZLE_R = 0x8E42, + GL_TEXTURE_SWIZZLE_G = 0x8E43, + GL_TEXTURE_SWIZZLE_B = 0x8E44, + GL_TEXTURE_SWIZZLE_A = 0x8E45; + + /** Accepted by the {@code pname} parameters of TexParameteriv, TexParameterfv, GetTexParameterfv, and GetTexParameteriv. */ + public static final int GL_TEXTURE_SWIZZLE_RGBA = 0x8E46; + + /** Accepted by the {@code target} parameter of BeginQuery, EndQuery, and GetQueryiv. */ + public static final int GL_TIME_ELAPSED = 0x88BF; + + /** + * Accepted by the {@code target} parameter of GetQueryiv and QueryCounter. Accepted by the {@code value} parameter of GetBooleanv, GetIntegerv, + * GetInteger64v, GetFloatv, and GetDoublev. + */ + public static final int GL_TIMESTAMP = 0x8E28; + + /** Accepted by the {@code pname} parameters of GetVertexAttribdv, GetVertexAttribfv, and GetVertexAttribiv. */ + public static final int GL_VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE; + + /** + * Accepted by the {@code type} parameter of VertexAttribPointer, VertexPointer, NormalPointer, ColorPointer, SecondaryColorPointer, TexCoordPointer, + * VertexAttribP{1234}ui, VertexP*, TexCoordP*, MultiTexCoordP*, NormalP3ui, ColorP*, SecondaryColorP* and VertexAttribP*. + */ + public static final int GL_INT_2_10_10_10_REV = 0x8D9F; + + static { GL.initialize(); } + + protected GL33C() { + throw new UnsupportedOperationException(); + } + + // --- [ glBindFragDataLocationIndexed ] --- + + /** Unsafe version of: {@link #glBindFragDataLocationIndexed BindFragDataLocationIndexed} */ + public static native void nglBindFragDataLocationIndexed(int program, int colorNumber, int index, long name); + + /** + * Binds a user-defined varying out variable to a fragment shader color number and index. + * + * @param program the name of the program containing varying out variable whose binding to modify + * @param colorNumber the color number to bind the user-defined varying out variable to + * @param index the index of the color input to bind the user-defined varying out variable to + * @param name the name of the user-defined varying out variable whose binding to modify + * + * @see Reference Page + */ + public static void glBindFragDataLocationIndexed(@NativeType("GLuint") int program, @NativeType("GLuint") int colorNumber, @NativeType("GLuint") int index, @NativeType("GLchar const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + nglBindFragDataLocationIndexed(program, colorNumber, index, memAddress(name)); + } + + /** + * Binds a user-defined varying out variable to a fragment shader color number and index. + * + * @param program the name of the program containing varying out variable whose binding to modify + * @param colorNumber the color number to bind the user-defined varying out variable to + * @param index the index of the color input to bind the user-defined varying out variable to + * @param name the name of the user-defined varying out variable whose binding to modify + * + * @see Reference Page + */ + public static void glBindFragDataLocationIndexed(@NativeType("GLuint") int program, @NativeType("GLuint") int colorNumber, @NativeType("GLuint") int index, @NativeType("GLchar const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + nglBindFragDataLocationIndexed(program, colorNumber, index, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetFragDataIndex ] --- + + /** Unsafe version of: {@link #glGetFragDataIndex GetFragDataIndex} */ + public static native int nglGetFragDataIndex(int program, long name); + + /** + * Queries the bindings of color indices to user-defined varying out variables. + * + * @param program the name of the program containing varying out variable whose binding to query + * @param name the name of the user-defined varying out variable whose index to query + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetFragDataIndex(@NativeType("GLuint") int program, @NativeType("GLchar const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nglGetFragDataIndex(program, memAddress(name)); + } + + /** + * Queries the bindings of color indices to user-defined varying out variables. + * + * @param program the name of the program containing varying out variable whose binding to query + * @param name the name of the user-defined varying out variable whose index to query + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetFragDataIndex(@NativeType("GLuint") int program, @NativeType("GLchar const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + return nglGetFragDataIndex(program, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGenSamplers ] --- + + /** + * Unsafe version of: {@link #glGenSamplers GenSamplers} + * + * @param count the number of sampler object names to generate + */ + public static native void nglGenSamplers(int count, long samplers); + + /** + * Generates sampler object names. + * + * @param samplers a buffer in which the generated sampler object names are stored + * + * @see Reference Page + */ + public static void glGenSamplers(@NativeType("GLuint *") IntBuffer samplers) { + nglGenSamplers(samplers.remaining(), memAddress(samplers)); + } + + /** + * Generates sampler object names. + * + * @see Reference Page + */ + @NativeType("void") + public static int glGenSamplers() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer samplers = stack.callocInt(1); + nglGenSamplers(1, memAddress(samplers)); + return samplers.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glDeleteSamplers ] --- + + /** + * Unsafe version of: {@link #glDeleteSamplers DeleteSamplers} + * + * @param count the number of sampler objects to be deleted + */ + public static native void nglDeleteSamplers(int count, long samplers); + + /** + * Deletes named sampler objects. + * + * @param samplers an array of sampler objects to be deleted + * + * @see Reference Page + */ + public static void glDeleteSamplers(@NativeType("GLuint const *") IntBuffer samplers) { + nglDeleteSamplers(samplers.remaining(), memAddress(samplers)); + } + + /** + * Deletes named sampler objects. + * + * @see Reference Page + */ + public static void glDeleteSamplers(@NativeType("GLuint const *") int sampler) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer samplers = stack.ints(sampler); + nglDeleteSamplers(1, memAddress(samplers)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glIsSampler ] --- + + /** + * Determines if a name corresponds to a sampler object. + * + * @param sampler a value that may be the name of a sampler object + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static native boolean glIsSampler(@NativeType("GLuint") int sampler); + + // --- [ glBindSampler ] --- + + /** + * Binds a named sampler to a texturing target. + * + * @param unit the index of the texture unit to which the sampler is bound + * @param sampler the name of a sampler + * + * @see Reference Page + */ + public static native void glBindSampler(@NativeType("GLuint") int unit, @NativeType("GLuint") int sampler); + + // --- [ glSamplerParameteri ] --- + + /** + * Set the integer value of a sampler parameter. + * + * @param sampler the sampler object whose parameter to modify + * @param pname the symbolic name of a single-valued sampler parameter. One of:
{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}
{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
+ * @param param the value of {@code pname} + * + * @see Reference Page + */ + public static native void glSamplerParameteri(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint") int param); + + // --- [ glSamplerParameterf ] --- + + /** + * Float version of {@link #glSamplerParameteri SamplerParameteri}. + * + * @param sampler the sampler object whose parameter to modify + * @param pname the symbolic name of a single-valued sampler parameter + * @param param the value of {@code pname} + * + * @see Reference Page + */ + public static native void glSamplerParameterf(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLfloat") float param); + + // --- [ glSamplerParameteriv ] --- + + /** Unsafe version of: {@link #glSamplerParameteriv SamplerParameteriv} */ + public static native void nglSamplerParameteriv(int sampler, int pname, long params); + + /** + * Pointer version of {@link #glSamplerParameteri SamplerParameteri}. + * + * @param sampler the sampler object whose parameter to modify + * @param pname the symbolic name of a sampler parameter. One of:
{@link GL11#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}
{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}
{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
+ * @param params an array where the value or values of {@code pname} are stored + * + * @see Reference Page + */ + public static void glSamplerParameteriv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglSamplerParameteriv(sampler, pname, memAddress(params)); + } + + // --- [ glSamplerParameterfv ] --- + + /** Unsafe version of: {@link #glSamplerParameterfv SamplerParameterfv} */ + public static native void nglSamplerParameterfv(int sampler, int pname, long params); + + /** + * Float version of {@link #glSamplerParameteriv SamplerParameteriv}. + * + * @param sampler the sampler object whose parameter to modify + * @param pname the symbolic name of a sampler parameter + * @param params an array where the value or values of {@code pname} are stored + * + * @see Reference Page + */ + public static void glSamplerParameterfv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglSamplerParameterfv(sampler, pname, memAddress(params)); + } + + // --- [ glSamplerParameterIiv ] --- + + /** Unsafe version of: {@link #glSamplerParameterIiv SamplerParameterIiv} */ + public static native void nglSamplerParameterIiv(int sampler, int pname, long params); + + /** + * Pure integer version of {@link #glSamplerParameteriv SamplerParameteriv}. + * + * @param sampler the sampler object whose parameter to modify + * @param pname the symbolic name of a sampler parameter + * @param params an array where the value or values of {@code pname} are stored + * + * @see Reference Page + */ + public static void glSamplerParameterIiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglSamplerParameterIiv(sampler, pname, memAddress(params)); + } + + // --- [ glSamplerParameterIuiv ] --- + + /** Unsafe version of: {@link #glSamplerParameterIuiv SamplerParameterIuiv} */ + public static native void nglSamplerParameterIuiv(int sampler, int pname, long params); + + /** + * Unsigned pure integer version of {@link #glSamplerParameteriv SamplerParameteriv}. + * + * @param sampler the sampler object whose parameter to modify + * @param pname the symbolic name of a sampler parameter + * @param params an array where the value or values of {@code pname} are stored + * + * @see Reference Page + */ + public static void glSamplerParameterIuiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLuint const *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglSamplerParameterIuiv(sampler, pname, memAddress(params)); + } + + // --- [ glGetSamplerParameteriv ] --- + + /** Unsafe version of: {@link #glGetSamplerParameteriv GetSamplerParameteriv} */ + public static native void nglGetSamplerParameteriv(int sampler, int pname, long params); + + /** + * Return the integer value(s) of a sampler parameter. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter. One of:
{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}
{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
,{@link GL11#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}
+ * @param params the sampler parameters + * + * @see Reference Page + */ + public static void glGetSamplerParameteriv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetSamplerParameteriv(sampler, pname, memAddress(params)); + } + + /** + * Return the integer value(s) of a sampler parameter. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter. One of:
{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}
{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
,{@link GL11#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetSamplerParameteri(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetSamplerParameteriv(sampler, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetSamplerParameterfv ] --- + + /** Unsafe version of: {@link #glGetSamplerParameterfv GetSamplerParameterfv} */ + public static native void nglGetSamplerParameterfv(int sampler, int pname, long params); + + /** + * Float version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter + * @param params the sampler parameters + * + * @see Reference Page + */ + public static void glGetSamplerParameterfv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetSamplerParameterfv(sampler, pname, memAddress(params)); + } + + /** + * Float version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter + * + * @see Reference Page + */ + @NativeType("void") + public static float glGetSamplerParameterf(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer params = stack.callocFloat(1); + nglGetSamplerParameterfv(sampler, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetSamplerParameterIiv ] --- + + /** Unsafe version of: {@link #glGetSamplerParameterIiv GetSamplerParameterIiv} */ + public static native void nglGetSamplerParameterIiv(int sampler, int pname, long params); + + /** + * Pure integer version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter + * @param params the sampler parameters + * + * @see Reference Page + */ + public static void glGetSamplerParameterIiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetSamplerParameterIiv(sampler, pname, memAddress(params)); + } + + /** + * Pure integer version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetSamplerParameterIi(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetSamplerParameterIiv(sampler, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetSamplerParameterIuiv ] --- + + /** Unsafe version of: {@link #glGetSamplerParameterIuiv GetSamplerParameterIuiv} */ + public static native void nglGetSamplerParameterIuiv(int sampler, int pname, long params); + + /** + * Unsigned pure integer version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter + * @param params the sampler parameters + * + * @see Reference Page + */ + public static void glGetSamplerParameterIuiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLuint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetSamplerParameterIuiv(sampler, pname, memAddress(params)); + } + + /** + * Unsigned pure integer version of {@link #glGetSamplerParameteriv GetSamplerParameteriv}. + * + * @param sampler the name of the sampler object from which to retrieve parameters + * @param pname the symbolic name of a sampler parameter + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetSamplerParameterIui(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetSamplerParameterIuiv(sampler, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glQueryCounter ] --- + + /** + * Records the GL time into a query object after all previous commands have reached the GL server but have not yet necessarily executed. + * + * @param id the name of a query object into which to record the GL time + * @param target the counter to query. Must be:
{@link #GL_TIMESTAMP TIMESTAMP}
+ * + * @see Reference Page + */ + public static native void glQueryCounter(@NativeType("GLuint") int id, @NativeType("GLenum") int target); + + // --- [ glGetQueryObjecti64v ] --- + + /** Unsafe version of: {@link #glGetQueryObjecti64v GetQueryObjecti64v} */ + public static native void nglGetQueryObjecti64v(int id, int pname, long params); + + /** + * Returns the 64bit integer value of query object parameter. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter. One of:
{@link GL15#GL_QUERY_RESULT QUERY_RESULT}{@link GL15#GL_QUERY_RESULT_AVAILABLE QUERY_RESULT_AVAILABLE}
+ * @param params the requested data + * + * @see Reference Page + */ + public static void glGetQueryObjecti64v(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLint64 *") LongBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetQueryObjecti64v(id, pname, memAddress(params)); + } + + /** + * Returns the 64bit integer value of query object parameter. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter. One of:
{@link GL15#GL_QUERY_RESULT QUERY_RESULT}{@link GL15#GL_QUERY_RESULT_AVAILABLE QUERY_RESULT_AVAILABLE}
+ * + * @see Reference Page + */ + @NativeType("void") + public static long glGetQueryObjecti64(@NativeType("GLuint") int id, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglGetQueryObjecti64v(id, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetQueryObjectui64v ] --- + + /** Unsafe version of: {@link #glGetQueryObjectui64v GetQueryObjectui64v} */ + public static native void nglGetQueryObjectui64v(int id, int pname, long params); + + /** + * Unsigned version of {@link #glGetQueryObjecti64v GetQueryObjecti64v}. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter + * @param params the requested data + * + * @see Reference Page + */ + public static void glGetQueryObjectui64v(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLuint64 *") LongBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetQueryObjectui64v(id, pname, memAddress(params)); + } + + /** + * Unsigned version of {@link #glGetQueryObjecti64v GetQueryObjecti64v}. + * + * @param id the name of a query object + * @param pname the symbolic name of a query object parameter + * + * @see Reference Page + */ + @NativeType("void") + public static long glGetQueryObjectui64(@NativeType("GLuint") int id, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglGetQueryObjectui64v(id, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glVertexAttribDivisor ] --- + + /** + * Modifies the rate at which generic vertex attributes advance during instanced rendering. + * + * @param index the index of the generic vertex attribute + * @param divisor the number of instances that will pass between updates of the generic attribute at slot {@code index} + * + * @see Reference Page + */ + public static native void glVertexAttribDivisor(@NativeType("GLuint") int index, @NativeType("GLuint") int divisor); + + // --- [ glVertexAttribP1ui ] --- + + /** + * Packed component version of {@link GL20C#glVertexAttrib1f VertexAttrib1f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + * + * @see Reference Page + */ + public static native void glVertexAttribP1ui(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint") int value); + + // --- [ glVertexAttribP2ui ] --- + + /** + * Packed component version of {@link GL20C#glVertexAttrib2f VertexAttrib2f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + * + * @see Reference Page + */ + public static native void glVertexAttribP2ui(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint") int value); + + // --- [ glVertexAttribP3ui ] --- + + /** + * Packed component version of {@link GL20C#glVertexAttrib3f VertexAttrib3f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + * + * @see Reference Page + */ + public static native void glVertexAttribP3ui(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint") int value); + + // --- [ glVertexAttribP4ui ] --- + + /** + * Packed component version of {@link GL20C#glVertexAttrib4f VertexAttrib4f}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + * + * @see Reference Page + */ + public static native void glVertexAttribP4ui(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint") int value); + + // --- [ glVertexAttribP1uiv ] --- + + /** Unsafe version of: {@link #glVertexAttribP1uiv VertexAttribP1uiv} */ + public static native void nglVertexAttribP1uiv(int index, int type, boolean normalized, long value); + + /** + * Pointer version of {@link #glVertexAttribP1ui VertexAttribP1ui}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + * + * @see Reference Page + */ + public static void glVertexAttribP1uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nglVertexAttribP1uiv(index, type, normalized, memAddress(value)); + } + + // --- [ glVertexAttribP2uiv ] --- + + /** Unsafe version of: {@link #glVertexAttribP2uiv VertexAttribP2uiv} */ + public static native void nglVertexAttribP2uiv(int index, int type, boolean normalized, long value); + + /** + * Pointer version of {@link #glVertexAttribP2ui VertexAttribP2ui}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + * + * @see Reference Page + */ + public static void glVertexAttribP2uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nglVertexAttribP2uiv(index, type, normalized, memAddress(value)); + } + + // --- [ glVertexAttribP3uiv ] --- + + /** Unsafe version of: {@link #glVertexAttribP3uiv VertexAttribP3uiv} */ + public static native void nglVertexAttribP3uiv(int index, int type, boolean normalized, long value); + + /** + * Pointer version of {@link #glVertexAttribP3ui VertexAttribP3ui}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + * + * @see Reference Page + */ + public static void glVertexAttribP3uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nglVertexAttribP3uiv(index, type, normalized, memAddress(value)); + } + + // --- [ glVertexAttribP4uiv ] --- + + /** Unsafe version of: {@link #glVertexAttribP4uiv VertexAttribP4uiv} */ + public static native void nglVertexAttribP4uiv(int index, int type, boolean normalized, long value); + + /** + * Pointer version of {@link #glVertexAttribP4ui VertexAttribP4ui}. + * + * @param index the index of the generic vertex attribute to be modified + * @param type type of packing used on the data. One of:
{@link #GL_INT_2_10_10_10_REV INT_2_10_10_10_REV}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param normalized whether values should be normalized or cast directly to floating-point + * @param value the packed value + * + * @see Reference Page + */ + public static void glVertexAttribP4uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nglVertexAttribP4uiv(index, type, normalized, memAddress(value)); + } + + /** + * Array version of: {@link #glGenSamplers GenSamplers} + * + * @see Reference Page + */ + public static void glGenSamplers(@NativeType("GLuint *") int[] samplers) { + long __functionAddress = GL.getICD().glGenSamplers; + if (CHECKS) { + check(__functionAddress); + } + callPV(samplers.length, samplers, __functionAddress); + } + + /** + * Array version of: {@link #glDeleteSamplers DeleteSamplers} + * + * @see Reference Page + */ + public static void glDeleteSamplers(@NativeType("GLuint const *") int[] samplers) { + long __functionAddress = GL.getICD().glDeleteSamplers; + if (CHECKS) { + check(__functionAddress); + } + callPV(samplers.length, samplers, __functionAddress); + } + + /** + * Array version of: {@link #glSamplerParameteriv SamplerParameteriv} + * + * @see Reference Page + */ + public static void glSamplerParameteriv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glSamplerParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(sampler, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glSamplerParameterfv SamplerParameterfv} + * + * @see Reference Page + */ + public static void glSamplerParameterfv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] params) { + long __functionAddress = GL.getICD().glSamplerParameterfv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(sampler, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glSamplerParameterIiv SamplerParameterIiv} + * + * @see Reference Page + */ + public static void glSamplerParameterIiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glSamplerParameterIiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(sampler, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glSamplerParameterIuiv SamplerParameterIuiv} + * + * @see Reference Page + */ + public static void glSamplerParameterIuiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLuint const *") int[] params) { + long __functionAddress = GL.getICD().glSamplerParameterIuiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(sampler, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetSamplerParameteriv GetSamplerParameteriv} + * + * @see Reference Page + */ + public static void glGetSamplerParameteriv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetSamplerParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(sampler, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetSamplerParameterfv GetSamplerParameterfv} + * + * @see Reference Page + */ + public static void glGetSamplerParameterfv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetSamplerParameterfv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(sampler, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetSamplerParameterIiv GetSamplerParameterIiv} + * + * @see Reference Page + */ + public static void glGetSamplerParameterIiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetSamplerParameterIiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(sampler, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetSamplerParameterIuiv GetSamplerParameterIuiv} + * + * @see Reference Page + */ + public static void glGetSamplerParameterIuiv(@NativeType("GLuint") int sampler, @NativeType("GLenum") int pname, @NativeType("GLuint *") int[] params) { + long __functionAddress = GL.getICD().glGetSamplerParameterIuiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(sampler, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetQueryObjecti64v GetQueryObjecti64v} + * + * @see Reference Page + */ + public static void glGetQueryObjecti64v(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLint64 *") long[] params) { + long __functionAddress = GL.getICD().glGetQueryObjecti64v; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(id, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetQueryObjectui64v GetQueryObjectui64v} + * + * @see Reference Page + */ + public static void glGetQueryObjectui64v(@NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLuint64 *") long[] params) { + long __functionAddress = GL.getICD().glGetQueryObjectui64v; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(id, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttribP1uiv VertexAttribP1uiv} + * + * @see Reference Page + */ + public static void glVertexAttribP1uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glVertexAttribP1uiv; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + callPV(index, type, normalized, value, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttribP2uiv VertexAttribP2uiv} + * + * @see Reference Page + */ + public static void glVertexAttribP2uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glVertexAttribP2uiv; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + callPV(index, type, normalized, value, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttribP3uiv VertexAttribP3uiv} + * + * @see Reference Page + */ + public static void glVertexAttribP3uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glVertexAttribP3uiv; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + callPV(index, type, normalized, value, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttribP4uiv VertexAttribP4uiv} + * + * @see Reference Page + */ + public static void glVertexAttribP4uiv(@NativeType("GLuint") int index, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glVertexAttribP4uiv; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + callPV(index, type, normalized, value, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL40.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL40.java new file mode 100644 index 00000000..0001d108 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL40.java @@ -0,0 +1,1721 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * The OpenGL functionality up to version 4.0. Includes the deprecated symbols of the Compatibility Profile. + * + *

OpenGL 4.0 implementations support revision 4.00 of the OpenGL Shading Language.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL40 extends GL33 { + + /** + * Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferPointerv, + * MapBufferRange, FlushMappedBufferRange, GetBufferParameteriv, and CopyBufferSubData. + */ + public static final int GL_DRAW_INDIRECT_BUFFER = 0x8F3F; + + /** Accepted by the {@code value} parameter of GetIntegerv, GetBooleanv, GetFloatv, and GetDoublev. */ + public static final int GL_DRAW_INDIRECT_BUFFER_BINDING = 0x8F43; + + /** Accepted by the {@code pname} parameter of GetProgramiv. */ + public static final int GL_GEOMETRY_SHADER_INVOCATIONS = 0x887F; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev, and GetInteger64v. */ + public static final int + GL_MAX_GEOMETRY_SHADER_INVOCATIONS = 0x8E5A, + GL_MIN_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5B, + GL_MAX_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5C, + GL_FRAGMENT_INTERPOLATION_OFFSET_BITS = 0x8E5D; + + /** Returned in the {@code type} parameter of GetActiveUniform, and GetTransformFeedbackVarying. */ + public static final int + GL_DOUBLE_VEC2 = 0x8FFC, + GL_DOUBLE_VEC3 = 0x8FFD, + GL_DOUBLE_VEC4 = 0x8FFE, + GL_DOUBLE_MAT2 = 0x8F46, + GL_DOUBLE_MAT3 = 0x8F47, + GL_DOUBLE_MAT4 = 0x8F48, + GL_DOUBLE_MAT2x3 = 0x8F49, + GL_DOUBLE_MAT2x4 = 0x8F4A, + GL_DOUBLE_MAT3x2 = 0x8F4B, + GL_DOUBLE_MAT3x4 = 0x8F4C, + GL_DOUBLE_MAT4x2 = 0x8F4D, + GL_DOUBLE_MAT4x3 = 0x8F4E; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_SAMPLE_SHADING = 0x8C36; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int GL_MIN_SAMPLE_SHADING_VALUE = 0x8C37; + + /** Accepted by the {@code pname} parameter of GetProgramStageiv. */ + public static final int + GL_ACTIVE_SUBROUTINES = 0x8DE5, + GL_ACTIVE_SUBROUTINE_UNIFORMS = 0x8DE6, + GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS = 0x8E47, + GL_ACTIVE_SUBROUTINE_MAX_LENGTH = 0x8E48, + GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH = 0x8E49; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev, and GetInteger64v. */ + public static final int + GL_MAX_SUBROUTINES = 0x8DE7, + GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS = 0x8DE8; + + /** Accepted by the {@code pname} parameter of GetActiveSubroutineUniformiv. */ + public static final int + GL_NUM_COMPATIBLE_SUBROUTINES = 0x8E4A, + GL_COMPATIBLE_SUBROUTINES = 0x8E4B; + + /** Accepted by the {@code mode} parameter of Begin and all vertex array functions that implicitly call Begin. */ + public static final int GL_PATCHES = 0xE; + + /** Accepted by the {@code pname} parameter of PatchParameteri, GetBooleanv, GetDoublev, GetFloatv, GetIntegerv, and GetInteger64v. */ + public static final int GL_PATCH_VERTICES = 0x8E72; + + /** Accepted by the {@code pname} parameter of PatchParameterfv, GetBooleanv, GetDoublev, GetFloatv, and GetIntegerv, and GetInteger64v. */ + public static final int + GL_PATCH_DEFAULT_INNER_LEVEL = 0x8E73, + GL_PATCH_DEFAULT_OUTER_LEVEL = 0x8E74; + + /** Accepted by the {@code pname} parameter of GetProgramiv. */ + public static final int + GL_TESS_CONTROL_OUTPUT_VERTICES = 0x8E75, + GL_TESS_GEN_MODE = 0x8E76, + GL_TESS_GEN_SPACING = 0x8E77, + GL_TESS_GEN_VERTEX_ORDER = 0x8E78, + GL_TESS_GEN_POINT_MODE = 0x8E79; + + /** Returned by GetProgramiv when {@code pname} is TESS_GEN_MODE. */ + public static final int GL_ISOLINES = 0x8E7A; + + /** Returned by GetProgramiv when {@code pname} is TESS_GEN_SPACING. */ + public static final int + GL_FRACTIONAL_ODD = 0x8E7B, + GL_FRACTIONAL_EVEN = 0x8E7C; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetFloatv, GetIntegerv, and GetInteger64v. */ + public static final int + GL_MAX_PATCH_VERTICES = 0x8E7D, + GL_MAX_TESS_GEN_LEVEL = 0x8E7E, + GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E7F, + GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E80, + GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS = 0x8E81, + GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS = 0x8E82, + GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS = 0x8E83, + GL_MAX_TESS_PATCH_COMPONENTS = 0x8E84, + GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS = 0x8E85, + GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS = 0x8E86, + GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS = 0x8E89, + GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS = 0x8E8A, + GL_MAX_TESS_CONTROL_INPUT_COMPONENTS = 0x886C, + GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS = 0x886D, + GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E1E, + GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E1F; + + /** Accepted by the {@code pname} parameter of GetActiveUniformBlockiv. */ + public static final int + GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER = 0x84F0, + GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x84F1; + + /** Accepted by the {@code type} parameter of CreateShader and returned by the {@code params} parameter of GetShaderiv. */ + public static final int + GL_TESS_EVALUATION_SHADER = 0x8E87, + GL_TESS_CONTROL_SHADER = 0x8E88; + + /** Accepted by the {@code target} parameter of TexParameteri, TexParameteriv, TexParameterf, TexParameterfv, BindTexture, and GenerateMipmap. */ + public static final int GL_TEXTURE_CUBE_MAP_ARRAY = 0x9009; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv and GetFloatv. */ + public static final int GL_TEXTURE_BINDING_CUBE_MAP_ARRAY = 0x900A; + + /** Accepted by the {@code target} parameter of TexImage3D, TexSubImage3D, CompressedTeximage3D, CompressedTexSubImage3D and CopyTexSubImage3D. */ + public static final int GL_PROXY_TEXTURE_CUBE_MAP_ARRAY = 0x900B; + + /** Returned by the {@code type} parameter of GetActiveUniform. */ + public static final int + GL_SAMPLER_CUBE_MAP_ARRAY = 0x900C, + GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW = 0x900D, + GL_INT_SAMPLER_CUBE_MAP_ARRAY = 0x900E, + GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY = 0x900F; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5E, + GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5F; + + /** Accepted by the {@code target} parameter of BindTransformFeedback. */ + public static final int GL_TRANSFORM_FEEDBACK = 0x8E22; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED = 0x8E23, + GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE = 0x8E24, + GL_TRANSFORM_FEEDBACK_BINDING = 0x8E25; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_MAX_TRANSFORM_FEEDBACK_BUFFERS = 0x8E70, + GL_MAX_VERTEX_STREAMS = 0x8E71; + + static { GL.initialize(); } + + protected GL40() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBlendEquationi, caps.glBlendEquationSeparatei, caps.glBlendFunci, caps.glBlendFuncSeparatei, caps.glDrawArraysIndirect, + caps.glDrawElementsIndirect, caps.glUniform1d, caps.glUniform2d, caps.glUniform3d, caps.glUniform4d, caps.glUniform1dv, caps.glUniform2dv, + caps.glUniform3dv, caps.glUniform4dv, caps.glUniformMatrix2dv, caps.glUniformMatrix3dv, caps.glUniformMatrix4dv, caps.glUniformMatrix2x3dv, + caps.glUniformMatrix2x4dv, caps.glUniformMatrix3x2dv, caps.glUniformMatrix3x4dv, caps.glUniformMatrix4x2dv, caps.glUniformMatrix4x3dv, + caps.glGetUniformdv, caps.glMinSampleShading, caps.glGetSubroutineUniformLocation, caps.glGetSubroutineIndex, caps.glGetActiveSubroutineUniformiv, + caps.glGetActiveSubroutineUniformName, caps.glGetActiveSubroutineName, caps.glUniformSubroutinesuiv, caps.glGetUniformSubroutineuiv, + caps.glGetProgramStageiv, caps.glPatchParameteri, caps.glPatchParameterfv, caps.glBindTransformFeedback, caps.glDeleteTransformFeedbacks, + caps.glGenTransformFeedbacks, caps.glIsTransformFeedback, caps.glPauseTransformFeedback, caps.glResumeTransformFeedback, + caps.glDrawTransformFeedback, caps.glDrawTransformFeedbackStream, caps.glBeginQueryIndexed, caps.glEndQueryIndexed, caps.glGetQueryIndexediv + ); + } + + // --- [ glBlendEquationi ] --- + + /** + * Specifies the equation used for both the RGB blend equation and the Alpha blend equation for the specified draw buffer. + * + * @param buf the index of the draw buffer for which to set the blend equation + * @param mode how source and destination colors are combined. One of:
{@link GL14#GL_FUNC_ADD FUNC_ADD}{@link GL14#GL_FUNC_SUBTRACT FUNC_SUBTRACT}{@link GL14#GL_FUNC_REVERSE_SUBTRACT FUNC_REVERSE_SUBTRACT}{@link GL14#GL_MIN MIN}{@link GL14#GL_MAX MAX}
+ * + * @see Reference Page + */ + public static void glBlendEquationi(@NativeType("GLuint") int buf, @NativeType("GLenum") int mode) { + GL40C.glBlendEquationi(buf, mode); + } + + // --- [ glBlendEquationSeparatei ] --- + + /** + * Sets the RGB blend equation and the alpha blend equation separately for the specified draw buffer. + * + * @param buf the index of the draw buffer for which to set the blend equations + * @param modeRGB the RGB blend equation, how the red, green, and blue components of the source and destination colors are combined. One of:
{@link GL14#GL_FUNC_ADD FUNC_ADD}{@link GL14#GL_FUNC_SUBTRACT FUNC_SUBTRACT}{@link GL14#GL_FUNC_REVERSE_SUBTRACT FUNC_REVERSE_SUBTRACT}{@link GL14#GL_MIN MIN}{@link GL14#GL_MAX MAX}
+ * @param modeAlpha the alpha blend equation, how the alpha component of the source and destination colors are combined. One of:
{@link GL14#GL_FUNC_ADD FUNC_ADD}{@link GL14#GL_FUNC_SUBTRACT FUNC_SUBTRACT}{@link GL14#GL_FUNC_REVERSE_SUBTRACT FUNC_REVERSE_SUBTRACT}{@link GL14#GL_MIN MIN}{@link GL14#GL_MAX MAX}
+ * + * @see Reference Page + */ + public static void glBlendEquationSeparatei(@NativeType("GLuint") int buf, @NativeType("GLenum") int modeRGB, @NativeType("GLenum") int modeAlpha) { + GL40C.glBlendEquationSeparatei(buf, modeRGB, modeAlpha); + } + + // --- [ glBlendFunci ] --- + + /** + * Specifies pixel arithmetic for the specified draw buffer. + * + * @param buf the index of the draw buffer for which to set the blend function + * @param sfactor how the red, green, blue, and alpha source blending factors are computed + * @param dfactor how the red, green, blue, and alpha destination blending factors are computed + * + * @see Reference Page + */ + public static void glBlendFunci(@NativeType("GLuint") int buf, @NativeType("GLenum") int sfactor, @NativeType("GLenum") int dfactor) { + GL40C.glBlendFunci(buf, sfactor, dfactor); + } + + // --- [ glBlendFuncSeparatei ] --- + + /** + * Specifies pixel arithmetic for RGB and alpha components separately for the specified draw buffer. + * + * @param buf the index of the draw buffer for which to set the blend functions + * @param srcRGB how the red, green, and blue blending factors are computed + * @param dstRGB how the red, green, and blue destination blending factors are computed + * @param srcAlpha how the alpha source blending factor is computed + * @param dstAlpha how the alpha destination blending factor is computed + * + * @see Reference Page + */ + public static void glBlendFuncSeparatei(@NativeType("GLuint") int buf, @NativeType("GLenum") int srcRGB, @NativeType("GLenum") int dstRGB, @NativeType("GLenum") int srcAlpha, @NativeType("GLenum") int dstAlpha) { + GL40C.glBlendFuncSeparatei(buf, srcRGB, dstRGB, srcAlpha, dstAlpha); + } + + // --- [ glDrawArraysIndirect ] --- + + /** Unsafe version of: {@link #glDrawArraysIndirect DrawArraysIndirect} */ + public static void nglDrawArraysIndirect(int mode, long indirect) { + GL40C.nglDrawArraysIndirect(mode, indirect); + } + + /** + * Renders primitives from array data, taking parameters from memory. + * + *

{@code glDrawArraysIndirect} behaves similarly to {@link GL42C#glDrawArraysInstancedBaseInstance DrawArraysInstancedBaseInstance}, except that the parameters to + * glDrawArraysInstancedBaseInstance are stored in memory at the address given by {@code indirect}.

+ * + *

The parameters addressed by {@code indirect} are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint first;
+     *     uint baseInstance; // must be 0 unless OpenGL 4.2 is supported
+     * } DrawArraysIndirectCommand;
+     * 
+     * const DrawArraysIndirectCommand *cmd = (const DrawArraysIndirectCommand *)indirect;
+     * glDrawArraysInstancedBaseInstance(mode, cmd->first, cmd->count, cmd->primCount, cmd->baseInstance);
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40C#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect a structure containing the draw parameters + * + * @see Reference Page + */ + public static void glDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indirect) { + GL40C.glDrawArraysIndirect(mode, indirect); + } + + /** + * Renders primitives from array data, taking parameters from memory. + * + *

{@code glDrawArraysIndirect} behaves similarly to {@link GL42C#glDrawArraysInstancedBaseInstance DrawArraysInstancedBaseInstance}, except that the parameters to + * glDrawArraysInstancedBaseInstance are stored in memory at the address given by {@code indirect}.

+ * + *

The parameters addressed by {@code indirect} are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint first;
+     *     uint baseInstance; // must be 0 unless OpenGL 4.2 is supported
+     * } DrawArraysIndirectCommand;
+     * 
+     * const DrawArraysIndirectCommand *cmd = (const DrawArraysIndirectCommand *)indirect;
+     * glDrawArraysInstancedBaseInstance(mode, cmd->first, cmd->count, cmd->primCount, cmd->baseInstance);
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40C#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect a structure containing the draw parameters + * + * @see Reference Page + */ + public static void glDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") long indirect) { + GL40C.glDrawArraysIndirect(mode, indirect); + } + + /** + * Renders primitives from array data, taking parameters from memory. + * + *

{@code glDrawArraysIndirect} behaves similarly to {@link GL42C#glDrawArraysInstancedBaseInstance DrawArraysInstancedBaseInstance}, except that the parameters to + * glDrawArraysInstancedBaseInstance are stored in memory at the address given by {@code indirect}.

+ * + *

The parameters addressed by {@code indirect} are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint first;
+     *     uint baseInstance; // must be 0 unless OpenGL 4.2 is supported
+     * } DrawArraysIndirectCommand;
+     * 
+     * const DrawArraysIndirectCommand *cmd = (const DrawArraysIndirectCommand *)indirect;
+     * glDrawArraysInstancedBaseInstance(mode, cmd->first, cmd->count, cmd->primCount, cmd->baseInstance);
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40C#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect a structure containing the draw parameters + * + * @see Reference Page + */ + public static void glDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indirect) { + GL40C.glDrawArraysIndirect(mode, indirect); + } + + // --- [ glDrawElementsIndirect ] --- + + /** Unsafe version of: {@link #glDrawElementsIndirect DrawElementsIndirect} */ + public static void nglDrawElementsIndirect(int mode, int type, long indirect) { + GL40C.nglDrawElementsIndirect(mode, type, indirect); + } + + /** + * Renders indexed primitives from array data, taking parameters from memory. + * + *

{@code glDrawElementsIndirect} behaves similarly to {@link GL42C#glDrawElementsInstancedBaseVertexBaseInstance DrawElementsInstancedBaseVertexBaseInstance}, execpt that the parameters to + * glDrawElementsInstancedBaseVertexBaseInstance are stored in memory at the address given by {@code indirect}.

+ * + *

The parameters addressed by {@code indirect} are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint firstIndex;
+     *     uint baseVertex;
+     *     uint baseInstance;
+     * } DrawElementsIndirectCommand;
+ * + *

{@code glDrawElementsIndirect} is equivalent to:

+ * + *

+     * void glDrawElementsIndirect(GLenum mode, GLenum type, const void *indirect) {
+     *     const DrawElementsIndirectCommand *cmd  = (const DrawElementsIndirectCommand *)indirect;
+     *     glDrawElementsInstancedBaseVertexBaseInstance(
+     *         mode,
+     *         cmd->count,
+     *         type,
+     *         cmd->firstIndex + size-of-type,
+     *         cmd->primCount,
+     *         cmd->baseVertex,
+     *         cmd->baseInstance
+     *     );
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40C#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the {@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER} binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect the address of a structure containing the draw parameters + * + * @see Reference Page + */ + public static void glDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indirect) { + GL40C.glDrawElementsIndirect(mode, type, indirect); + } + + /** + * Renders indexed primitives from array data, taking parameters from memory. + * + *

{@code glDrawElementsIndirect} behaves similarly to {@link GL42C#glDrawElementsInstancedBaseVertexBaseInstance DrawElementsInstancedBaseVertexBaseInstance}, execpt that the parameters to + * glDrawElementsInstancedBaseVertexBaseInstance are stored in memory at the address given by {@code indirect}.

+ * + *

The parameters addressed by {@code indirect} are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint firstIndex;
+     *     uint baseVertex;
+     *     uint baseInstance;
+     * } DrawElementsIndirectCommand;
+ * + *

{@code glDrawElementsIndirect} is equivalent to:

+ * + *

+     * void glDrawElementsIndirect(GLenum mode, GLenum type, const void *indirect) {
+     *     const DrawElementsIndirectCommand *cmd  = (const DrawElementsIndirectCommand *)indirect;
+     *     glDrawElementsInstancedBaseVertexBaseInstance(
+     *         mode,
+     *         cmd->count,
+     *         type,
+     *         cmd->firstIndex + size-of-type,
+     *         cmd->primCount,
+     *         cmd->baseVertex,
+     *         cmd->baseInstance
+     *     );
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40C#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the {@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER} binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect the address of a structure containing the draw parameters + * + * @see Reference Page + */ + public static void glDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") long indirect) { + GL40C.glDrawElementsIndirect(mode, type, indirect); + } + + /** + * Renders indexed primitives from array data, taking parameters from memory. + * + *

{@code glDrawElementsIndirect} behaves similarly to {@link GL42C#glDrawElementsInstancedBaseVertexBaseInstance DrawElementsInstancedBaseVertexBaseInstance}, execpt that the parameters to + * glDrawElementsInstancedBaseVertexBaseInstance are stored in memory at the address given by {@code indirect}.

+ * + *

The parameters addressed by {@code indirect} are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint firstIndex;
+     *     uint baseVertex;
+     *     uint baseInstance;
+     * } DrawElementsIndirectCommand;
+ * + *

{@code glDrawElementsIndirect} is equivalent to:

+ * + *

+     * void glDrawElementsIndirect(GLenum mode, GLenum type, const void *indirect) {
+     *     const DrawElementsIndirectCommand *cmd  = (const DrawElementsIndirectCommand *)indirect;
+     *     glDrawElementsInstancedBaseVertexBaseInstance(
+     *         mode,
+     *         cmd->count,
+     *         type,
+     *         cmd->firstIndex + size-of-type,
+     *         cmd->primCount,
+     *         cmd->baseVertex,
+     *         cmd->baseInstance
+     *     );
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40C#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the {@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER} binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect the address of a structure containing the draw parameters + * + * @see Reference Page + */ + public static void glDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer indirect) { + GL40C.glDrawElementsIndirect(mode, type, indirect); + } + + // --- [ glUniform1d ] --- + + /** + * Specifies the value of a double uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * + * @see Reference Page + */ + public static void glUniform1d(@NativeType("GLint") int location, @NativeType("GLdouble") double x) { + GL40C.glUniform1d(location, x); + } + + // --- [ glUniform2d ] --- + + /** + * Specifies the value of a dvec2 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * + * @see Reference Page + */ + public static void glUniform2d(@NativeType("GLint") int location, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y) { + GL40C.glUniform2d(location, x, y); + } + + // --- [ glUniform3d ] --- + + /** + * Specifies the value of a dvec3 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * + * @see Reference Page + */ + public static void glUniform3d(@NativeType("GLint") int location, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z) { + GL40C.glUniform3d(location, x, y, z); + } + + // --- [ glUniform4d ] --- + + /** + * Specifies the value of a dvec4 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * @param w the uniform w value + * + * @see Reference Page + */ + public static void glUniform4d(@NativeType("GLint") int location, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z, @NativeType("GLdouble") double w) { + GL40C.glUniform4d(location, x, y, z, w); + } + + // --- [ glUniform1dv ] --- + + /** + * Unsafe version of: {@link #glUniform1dv Uniform1dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglUniform1dv(int location, int count, long value) { + GL40C.nglUniform1dv(location, count, value); + } + + /** + * Specifies the value of a single double uniform variable or a double uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform1dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniform1dv(location, value); + } + + // --- [ glUniform2dv ] --- + + /** + * Unsafe version of: {@link #glUniform2dv Uniform2dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglUniform2dv(int location, int count, long value) { + GL40C.nglUniform2dv(location, count, value); + } + + /** + * Specifies the value of a single dvec2 uniform variable or a dvec2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform2dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniform2dv(location, value); + } + + // --- [ glUniform3dv ] --- + + /** + * Unsafe version of: {@link #glUniform3dv Uniform3dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglUniform3dv(int location, int count, long value) { + GL40C.nglUniform3dv(location, count, value); + } + + /** + * Specifies the value of a single dvec3 uniform variable or a dvec3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform3dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniform3dv(location, value); + } + + // --- [ glUniform4dv ] --- + + /** + * Unsafe version of: {@link #glUniform4dv Uniform4dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglUniform4dv(int location, int count, long value) { + GL40C.nglUniform4dv(location, count, value); + } + + /** + * Specifies the value of a single dvec4 uniform variable or a dvec4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform4dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniform4dv(location, value); + } + + // --- [ glUniformMatrix2dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix2dv UniformMatrix2dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix2dv(int location, int count, boolean transpose, long value) { + GL40C.nglUniformMatrix2dv(location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat2 uniform variable or a dmat2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glUniformMatrix2dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniformMatrix2dv(location, transpose, value); + } + + // --- [ glUniformMatrix3dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix3dv UniformMatrix3dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix3dv(int location, int count, boolean transpose, long value) { + GL40C.nglUniformMatrix3dv(location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat3 uniform variable or a dmat3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glUniformMatrix3dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniformMatrix3dv(location, transpose, value); + } + + // --- [ glUniformMatrix4dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix4dv UniformMatrix4dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix4dv(int location, int count, boolean transpose, long value) { + GL40C.nglUniformMatrix4dv(location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat4 uniform variable or a dmat4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glUniformMatrix4dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniformMatrix4dv(location, transpose, value); + } + + // --- [ glUniformMatrix2x3dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix2x3dv UniformMatrix2x3dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix2x3dv(int location, int count, boolean transpose, long value) { + GL40C.nglUniformMatrix2x3dv(location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat2x3 uniform variable or a dmat2x3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glUniformMatrix2x3dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniformMatrix2x3dv(location, transpose, value); + } + + // --- [ glUniformMatrix2x4dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix2x4dv UniformMatrix2x4dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix2x4dv(int location, int count, boolean transpose, long value) { + GL40C.nglUniformMatrix2x4dv(location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat2x4 uniform variable or a dmat2x4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glUniformMatrix2x4dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniformMatrix2x4dv(location, transpose, value); + } + + // --- [ glUniformMatrix3x2dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix3x2dv UniformMatrix3x2dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix3x2dv(int location, int count, boolean transpose, long value) { + GL40C.nglUniformMatrix3x2dv(location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat3x2 uniform variable or a dmat3x2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glUniformMatrix3x2dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniformMatrix3x2dv(location, transpose, value); + } + + // --- [ glUniformMatrix3x4dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix3x4dv UniformMatrix3x4dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix3x4dv(int location, int count, boolean transpose, long value) { + GL40C.nglUniformMatrix3x4dv(location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat3x4 uniform variable or a dmat3x4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glUniformMatrix3x4dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniformMatrix3x4dv(location, transpose, value); + } + + // --- [ glUniformMatrix4x2dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix4x2dv UniformMatrix4x2dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix4x2dv(int location, int count, boolean transpose, long value) { + GL40C.nglUniformMatrix4x2dv(location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat4x2 uniform variable or a dmat4x2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glUniformMatrix4x2dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniformMatrix4x2dv(location, transpose, value); + } + + // --- [ glUniformMatrix4x3dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix4x3dv UniformMatrix4x3dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglUniformMatrix4x3dv(int location, int count, boolean transpose, long value) { + GL40C.nglUniformMatrix4x3dv(location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat4x3 uniform variable or a dmat4x3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glUniformMatrix4x3dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL40C.glUniformMatrix4x3dv(location, transpose, value); + } + + // --- [ glGetUniformdv ] --- + + /** Unsafe version of: {@link #glGetUniformdv GetUniformdv} */ + public static void nglGetUniformdv(int program, int location, long params) { + GL40C.nglGetUniformdv(program, location, params); + } + + /** + * Returns the double value(s) of a uniform variable. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * @param params the value of the specified uniform variable + * + * @see Reference Page + */ + public static void glGetUniformdv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble *") DoubleBuffer params) { + GL40C.glGetUniformdv(program, location, params); + } + + /** + * Returns the double value(s) of a uniform variable. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * + * @see Reference Page + */ + @NativeType("void") + public static double glGetUniformd(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + return GL40C.glGetUniformd(program, location); + } + + // --- [ glMinSampleShading ] --- + + /** + * Specifies the minimum rate at which sample shading takes place. + * + * @param value the rate at which samples are shaded within each covered pixel + * + * @see Reference Page + */ + public static void glMinSampleShading(@NativeType("GLfloat") float value) { + GL40C.glMinSampleShading(value); + } + + // --- [ glGetSubroutineUniformLocation ] --- + + /** Unsafe version of: {@link #glGetSubroutineUniformLocation GetSubroutineUniformLocation} */ + public static int nglGetSubroutineUniformLocation(int program, int shadertype, long name) { + return GL40C.nglGetSubroutineUniformLocation(program, shadertype, name); + } + + /** + * Retrieves the location of a subroutine uniform of a given shader stage within a program. + * + * @param program the name of the program containing shader stage + * @param shadertype the shader stage from which to query for subroutine uniform index. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param name the name of the subroutine uniform whose index to query. + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetSubroutineUniformLocation(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLchar const *") ByteBuffer name) { + return GL40C.glGetSubroutineUniformLocation(program, shadertype, name); + } + + /** + * Retrieves the location of a subroutine uniform of a given shader stage within a program. + * + * @param program the name of the program containing shader stage + * @param shadertype the shader stage from which to query for subroutine uniform index. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param name the name of the subroutine uniform whose index to query. + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetSubroutineUniformLocation(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLchar const *") CharSequence name) { + return GL40C.glGetSubroutineUniformLocation(program, shadertype, name); + } + + // --- [ glGetSubroutineIndex ] --- + + /** Unsafe version of: {@link #glGetSubroutineIndex GetSubroutineIndex} */ + public static int nglGetSubroutineIndex(int program, int shadertype, long name) { + return GL40C.nglGetSubroutineIndex(program, shadertype, name); + } + + /** + * Retrieves the index of a subroutine function of a given shader stage within a program. + * + * @param program the name of the program containing shader stage + * @param shadertype the shader stage from which to query for subroutine function index. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param name the name of the subroutine function whose index to query + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glGetSubroutineIndex(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLchar const *") ByteBuffer name) { + return GL40C.glGetSubroutineIndex(program, shadertype, name); + } + + /** + * Retrieves the index of a subroutine function of a given shader stage within a program. + * + * @param program the name of the program containing shader stage + * @param shadertype the shader stage from which to query for subroutine function index. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param name the name of the subroutine function whose index to query + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glGetSubroutineIndex(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLchar const *") CharSequence name) { + return GL40C.glGetSubroutineIndex(program, shadertype, name); + } + + // --- [ glGetActiveSubroutineUniformiv ] --- + + /** Unsafe version of: {@link #glGetActiveSubroutineUniformiv GetActiveSubroutineUniformiv} */ + public static void nglGetActiveSubroutineUniformiv(int program, int shadertype, int index, int pname, long values) { + GL40C.nglGetActiveSubroutineUniformiv(program, shadertype, index, pname, values); + } + + /** + * Queries a property of an active shader subroutine uniform. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query for the subroutine parameter. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + * @param pname the parameter of the shader subroutine uniform to query. One of:
{@link GL40C#GL_NUM_COMPATIBLE_SUBROUTINES NUM_COMPATIBLE_SUBROUTINES}{@link GL40C#GL_COMPATIBLE_SUBROUTINES COMPATIBLE_SUBROUTINES}{@link GL31#GL_UNIFORM_SIZE UNIFORM_SIZE}{@link GL31#GL_UNIFORM_NAME_LENGTH UNIFORM_NAME_LENGTH}
+ * @param values the address of a buffer into which the queried value or values will be placed + * + * @see Reference Page + */ + public static void glGetActiveSubroutineUniformiv(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer values) { + GL40C.glGetActiveSubroutineUniformiv(program, shadertype, index, pname, values); + } + + /** + * Queries a property of an active shader subroutine uniform. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query for the subroutine parameter. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + * @param pname the parameter of the shader subroutine uniform to query. One of:
{@link GL40C#GL_NUM_COMPATIBLE_SUBROUTINES NUM_COMPATIBLE_SUBROUTINES}{@link GL40C#GL_COMPATIBLE_SUBROUTINES COMPATIBLE_SUBROUTINES}{@link GL31#GL_UNIFORM_SIZE UNIFORM_SIZE}{@link GL31#GL_UNIFORM_NAME_LENGTH UNIFORM_NAME_LENGTH}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetActiveSubroutineUniformi(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + return GL40C.glGetActiveSubroutineUniformi(program, shadertype, index, pname); + } + + // --- [ glGetActiveSubroutineUniformName ] --- + + /** + * Unsafe version of: {@link #glGetActiveSubroutineUniformName GetActiveSubroutineUniformName} + * + * @param bufsize the size of the buffer whose address is given in {@code name} + */ + public static void nglGetActiveSubroutineUniformName(int program, int shadertype, int index, int bufsize, long length, long name) { + GL40C.nglGetActiveSubroutineUniformName(program, shadertype, index, bufsize, length, name); + } + + /** + * Queries the name of an active shader subroutine uniform. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query for the subroutine parameter. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + * @param length the address of a variable into which is written the number of characters copied into {@code name} + * @param name the address of a buffer that will receive the name of the specified shader subroutine uniform + * + * @see Reference Page + */ + public static void glGetActiveSubroutineUniformName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer name) { + GL40C.glGetActiveSubroutineUniformName(program, shadertype, index, length, name); + } + + /** + * Queries the name of an active shader subroutine uniform. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query for the subroutine parameter. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + * @param bufsize the size of the buffer whose address is given in {@code name} + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveSubroutineUniformName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @NativeType("GLsizei") int bufsize) { + return GL40C.glGetActiveSubroutineUniformName(program, shadertype, index, bufsize); + } + + /** + * Queries the name of an active shader subroutine uniform. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query for the subroutine parameter. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveSubroutineUniformName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index) { + return glGetActiveSubroutineUniformName(program, shadertype, index, glGetActiveSubroutineUniformi(program, shadertype, index, GL31.GL_UNIFORM_NAME_LENGTH)); + } + + // --- [ glGetActiveSubroutineName ] --- + + /** + * Unsafe version of: {@link #glGetActiveSubroutineName GetActiveSubroutineName} + * + * @param bufsize the size of the buffer whose address is given in {@code name} + */ + public static void nglGetActiveSubroutineName(int program, int shadertype, int index, int bufsize, long length, long name) { + GL40C.nglGetActiveSubroutineName(program, shadertype, index, bufsize, length, name); + } + + /** + * Queries the name of an active shader subroutine. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query the subroutine name. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + * @param length a variable which is to receive the length of the shader subroutine uniform name + * @param name an array into which the name of the shader subroutine uniform will be written + * + * @see Reference Page + */ + public static void glGetActiveSubroutineName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer name) { + GL40C.glGetActiveSubroutineName(program, shadertype, index, length, name); + } + + /** + * Queries the name of an active shader subroutine. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query the subroutine name. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + * @param bufsize the size of the buffer whose address is given in {@code name} + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveSubroutineName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @NativeType("GLsizei") int bufsize) { + return GL40C.glGetActiveSubroutineName(program, shadertype, index, bufsize); + } + + /** + * Queries the name of an active shader subroutine. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query the subroutine name. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveSubroutineName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index) { + return glGetActiveSubroutineName(program, shadertype, index, glGetProgramStagei(program, shadertype, GL_ACTIVE_SUBROUTINE_MAX_LENGTH)); + } + + // --- [ glUniformSubroutinesuiv ] --- + + /** + * Unsafe version of: {@link #glUniformSubroutinesuiv UniformSubroutinesuiv} + * + * @param count the number of uniform indices stored in {@code indices} + */ + public static void nglUniformSubroutinesuiv(int shadertype, int count, long indices) { + GL40C.nglUniformSubroutinesuiv(shadertype, count, indices); + } + + /** + * Loads active subroutine uniforms. + * + * @param shadertype the shader stage to update. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param indices an array holding the indices to load into the shader subroutine variables + * + * @see Reference Page + */ + public static void glUniformSubroutinesuiv(@NativeType("GLenum") int shadertype, @NativeType("GLuint const *") IntBuffer indices) { + GL40C.glUniformSubroutinesuiv(shadertype, indices); + } + + /** + * Loads active subroutine uniforms. + * + * @param shadertype the shader stage to update. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * + * @see Reference Page + */ + public static void glUniformSubroutinesui(@NativeType("GLenum") int shadertype, @NativeType("GLuint const *") int index) { + GL40C.glUniformSubroutinesui(shadertype, index); + } + + // --- [ glGetUniformSubroutineuiv ] --- + + /** Unsafe version of: {@link #glGetUniformSubroutineuiv GetUniformSubroutineuiv} */ + public static void nglGetUniformSubroutineuiv(int shadertype, int location, long params) { + GL40C.nglGetUniformSubroutineuiv(shadertype, location, params); + } + + /** + * Retrieves the value of a subroutine uniform of a given shader stage of the current program. + * + * @param shadertype the shader stage from which to query for subroutine uniform index. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param location the location of the subroutine uniform + * @param params a variable to receive the value or values of the subroutine uniform + * + * @see Reference Page + */ + public static void glGetUniformSubroutineuiv(@NativeType("GLenum") int shadertype, @NativeType("GLint") int location, @NativeType("GLuint *") IntBuffer params) { + GL40C.glGetUniformSubroutineuiv(shadertype, location, params); + } + + /** + * Retrieves the value of a subroutine uniform of a given shader stage of the current program. + * + * @param shadertype the shader stage from which to query for subroutine uniform index. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param location the location of the subroutine uniform + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetUniformSubroutineui(@NativeType("GLenum") int shadertype, @NativeType("GLint") int location) { + return GL40C.glGetUniformSubroutineui(shadertype, location); + } + + // --- [ glGetProgramStageiv ] --- + + /** Unsafe version of: {@link #glGetProgramStageiv GetProgramStageiv} */ + public static void nglGetProgramStageiv(int program, int shadertype, int pname, long values) { + GL40C.nglGetProgramStageiv(program, shadertype, pname, values); + } + + /** + * Retrieves properties of a program object corresponding to a specified shader stage. + * + * @param program the name of the program containing shader stage + * @param shadertype the shader stage from which to query for the subroutine parameter. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param pname the parameter of the shader to query. One of:
{@link GL40C#GL_ACTIVE_SUBROUTINES ACTIVE_SUBROUTINES}{@link GL40C#GL_ACTIVE_SUBROUTINE_UNIFORMS ACTIVE_SUBROUTINE_UNIFORMS}
{@link GL40C#GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS}{@link GL40C#GL_ACTIVE_SUBROUTINE_MAX_LENGTH ACTIVE_SUBROUTINE_MAX_LENGTH}
{@link GL40C#GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH}
+ * @param values a variable into which the queried value or values will be placed + * + * @see Reference Page + */ + public static void glGetProgramStageiv(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer values) { + GL40C.glGetProgramStageiv(program, shadertype, pname, values); + } + + /** + * Retrieves properties of a program object corresponding to a specified shader stage. + * + * @param program the name of the program containing shader stage + * @param shadertype the shader stage from which to query for the subroutine parameter. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link GL40C#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link GL40C#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param pname the parameter of the shader to query. One of:
{@link GL40C#GL_ACTIVE_SUBROUTINES ACTIVE_SUBROUTINES}{@link GL40C#GL_ACTIVE_SUBROUTINE_UNIFORMS ACTIVE_SUBROUTINE_UNIFORMS}
{@link GL40C#GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS}{@link GL40C#GL_ACTIVE_SUBROUTINE_MAX_LENGTH ACTIVE_SUBROUTINE_MAX_LENGTH}
{@link GL40C#GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetProgramStagei(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLenum") int pname) { + return GL40C.glGetProgramStagei(program, shadertype, pname); + } + + // --- [ glPatchParameteri ] --- + + /** + * Specifies the integer value of the specified parameter for patch primitives. + * + * @param pname the name of the parameter to set. Must be:
{@link GL40C#GL_PATCH_VERTICES PATCH_VERTICES}
+ * @param value the new value for the parameter given by {@code pname} + * + * @see Reference Page + */ + public static void glPatchParameteri(@NativeType("GLenum") int pname, @NativeType("GLint") int value) { + GL40C.glPatchParameteri(pname, value); + } + + // --- [ glPatchParameterfv ] --- + + /** Unsafe version of: {@link #glPatchParameterfv PatchParameterfv} */ + public static void nglPatchParameterfv(int pname, long values) { + GL40C.nglPatchParameterfv(pname, values); + } + + /** + * Specifies an array of float values for the specified parameter for patch primitives. + * + * @param pname the name of the parameter to set. One of:
{@link GL40C#GL_PATCH_DEFAULT_OUTER_LEVEL PATCH_DEFAULT_OUTER_LEVEL}{@link GL40C#GL_PATCH_DEFAULT_INNER_LEVEL PATCH_DEFAULT_INNER_LEVEL}
+ * @param values an array containing the new values for the parameter given by {@code pname} + * + * @see Reference Page + */ + public static void glPatchParameterfv(@NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer values) { + GL40C.glPatchParameterfv(pname, values); + } + + // --- [ glBindTransformFeedback ] --- + + /** + * Binds a transform feedback object. + * + * @param target the target to which to bind the transform feedback object {@code id}. Must be:
{@link GL40C#GL_TRANSFORM_FEEDBACK TRANSFORM_FEEDBACK}
+ * @param id the name of a transform feedback object + * + * @see Reference Page + */ + public static void glBindTransformFeedback(@NativeType("GLenum") int target, @NativeType("GLuint") int id) { + GL40C.glBindTransformFeedback(target, id); + } + + // --- [ glDeleteTransformFeedbacks ] --- + + /** + * Unsafe version of: {@link #glDeleteTransformFeedbacks DeleteTransformFeedbacks} + * + * @param n the number of transform feedback objects to delete + */ + public static void nglDeleteTransformFeedbacks(int n, long ids) { + GL40C.nglDeleteTransformFeedbacks(n, ids); + } + + /** + * Deletes transform feedback objects. + * + * @param ids an array of names of transform feedback objects to delete + * + * @see Reference Page + */ + public static void glDeleteTransformFeedbacks(@NativeType("GLuint const *") IntBuffer ids) { + GL40C.glDeleteTransformFeedbacks(ids); + } + + /** + * Deletes transform feedback objects. + * + * @see Reference Page + */ + public static void glDeleteTransformFeedbacks(@NativeType("GLuint const *") int id) { + GL40C.glDeleteTransformFeedbacks(id); + } + + // --- [ glGenTransformFeedbacks ] --- + + /** + * Unsafe version of: {@link #glGenTransformFeedbacks GenTransformFeedbacks} + * + * @param n the number of transform feedback object names to reserve + */ + public static void nglGenTransformFeedbacks(int n, long ids) { + GL40C.nglGenTransformFeedbacks(n, ids); + } + + /** + * Reserves transform feedback object names. + * + * @param ids an array of into which the reserved names will be written + * + * @see Reference Page + */ + public static void glGenTransformFeedbacks(@NativeType("GLuint *") IntBuffer ids) { + GL40C.glGenTransformFeedbacks(ids); + } + + /** + * Reserves transform feedback object names. + * + * @see Reference Page + */ + @NativeType("void") + public static int glGenTransformFeedbacks() { + return GL40C.glGenTransformFeedbacks(); + } + + // --- [ glIsTransformFeedback ] --- + + /** + * Determines if a name corresponds to a transform feedback object. + * + * @param id a value that may be the name of a transform feedback object + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static boolean glIsTransformFeedback(@NativeType("GLuint") int id) { + return GL40C.glIsTransformFeedback(id); + } + + // --- [ glPauseTransformFeedback ] --- + + /** + * Pauses transform feedback operations for the currently bound transform feedback object. + * + *

When transform feedback operations are paused, transform feedback is still considered active and changing most transform feedback state related to the + * object results in an error. However, a new transform feedback object may be bound while transform feedback is paused. The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} + * is generated by PauseTransformFeedback if the currently bound transform feedback is not active or is paused.

+ * + *

When transform feedback is active and not paused, all geometric primitives generated must be compatible with the value of {@code primitiveMode} passed + * to {@link GL30C#glBeginTransformFeedback BeginTransformFeedback}. The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated by {@link GL11#glBegin Begin} or any operation that implicitly calls {@link GL11#glBegin Begin} + * (such as {@link GL11C#glDrawElements DrawElements}) if {@code mode} is not one of the allowed modes. If a geometry shader is active, its output primitive type is used instead + * of the {@code mode} parameter passed to {@link GL11#glBegin Begin} for the purposes of this error check. Any primitive type may be used while transform feedback is + * paused.

+ * + * @see Reference Page + */ + public static void glPauseTransformFeedback() { + GL40C.glPauseTransformFeedback(); + } + + // --- [ glResumeTransformFeedback ] --- + + /** + * Resumes transform feedback operations for the currently bound transform feedback object. + * + *

The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated by {@link #glResumeTransformFeedback ResumeTransformFeedback} if the currently bound transform feedback is not active or is not paused.

+ * + * @see Reference Page + */ + public static void glResumeTransformFeedback() { + GL40C.glResumeTransformFeedback(); + } + + // --- [ glDrawTransformFeedback ] --- + + /** + * Render primitives using a count derived from a transform feedback object. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40C#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param id the name of a transform feedback object from which to retrieve a primitive count + * + * @see Reference Page + */ + public static void glDrawTransformFeedback(@NativeType("GLenum") int mode, @NativeType("GLuint") int id) { + GL40C.glDrawTransformFeedback(mode, id); + } + + // --- [ glDrawTransformFeedbackStream ] --- + + /** + * Renders primitives using a count derived from a specifed stream of a transform feedback object. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40C#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param id the name of a transform feedback object from which to retrieve a primitive count + * @param stream the index of the transform feedback stream from which to retrieve a primitive count + * + * @see Reference Page + */ + public static void glDrawTransformFeedbackStream(@NativeType("GLenum") int mode, @NativeType("GLuint") int id, @NativeType("GLuint") int stream) { + GL40C.glDrawTransformFeedbackStream(mode, id, stream); + } + + // --- [ glBeginQueryIndexed ] --- + + /** + * Begins a query object on an indexed target + * + * @param target the target type of query object established between {@code glBeginQueryIndexed} and the subsequent {@link #glEndQueryIndexed EndQueryIndexed}. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param index the index of the query target upon which to begin the query + * @param id the name of a query object + * + * @see Reference Page + */ + public static void glBeginQueryIndexed(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLuint") int id) { + GL40C.glBeginQueryIndexed(target, index, id); + } + + // --- [ glEndQueryIndexed ] --- + + /** + * Ends a query object on an indexed target + * + * @param target the target type of query object to be concluded. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param index the index of the query target upon which to end the query + * + * @see Reference Page + */ + public static void glEndQueryIndexed(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + GL40C.glEndQueryIndexed(target, index); + } + + // --- [ glGetQueryIndexediv ] --- + + /** Unsafe version of: {@link #glGetQueryIndexediv GetQueryIndexediv} */ + public static void nglGetQueryIndexediv(int target, int index, int pname, long params) { + GL40C.nglGetQueryIndexediv(target, index, pname, params); + } + + /** + * Returns parameters of an indexed query object target. + * + * @param target a query object target. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param index the index of the query object target + * @param pname the symbolic name of a query object target parameter + * @param params the requested data + * + * @see Reference Page + */ + public static void glGetQueryIndexediv(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL40C.glGetQueryIndexediv(target, index, pname, params); + } + + /** + * Returns parameters of an indexed query object target. + * + * @param target a query object target. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param index the index of the query object target + * @param pname the symbolic name of a query object target parameter + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetQueryIndexedi(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + return GL40C.glGetQueryIndexedi(target, index, pname); + } + + /** + * Array version of: {@link #glDrawArraysIndirect DrawArraysIndirect} + * + * @see Reference Page + */ + public static void glDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") int[] indirect) { + GL40C.glDrawArraysIndirect(mode, indirect); + } + + /** + * Array version of: {@link #glDrawElementsIndirect DrawElementsIndirect} + * + * @see Reference Page + */ + public static void glDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") int[] indirect) { + GL40C.glDrawElementsIndirect(mode, type, indirect); + } + + /** + * Array version of: {@link #glUniform1dv Uniform1dv} + * + * @see Reference Page + */ + public static void glUniform1dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniform1dv(location, value); + } + + /** + * Array version of: {@link #glUniform2dv Uniform2dv} + * + * @see Reference Page + */ + public static void glUniform2dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniform2dv(location, value); + } + + /** + * Array version of: {@link #glUniform3dv Uniform3dv} + * + * @see Reference Page + */ + public static void glUniform3dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniform3dv(location, value); + } + + /** + * Array version of: {@link #glUniform4dv Uniform4dv} + * + * @see Reference Page + */ + public static void glUniform4dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniform4dv(location, value); + } + + /** + * Array version of: {@link #glUniformMatrix2dv UniformMatrix2dv} + * + * @see Reference Page + */ + public static void glUniformMatrix2dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniformMatrix2dv(location, transpose, value); + } + + /** + * Array version of: {@link #glUniformMatrix3dv UniformMatrix3dv} + * + * @see Reference Page + */ + public static void glUniformMatrix3dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniformMatrix3dv(location, transpose, value); + } + + /** + * Array version of: {@link #glUniformMatrix4dv UniformMatrix4dv} + * + * @see Reference Page + */ + public static void glUniformMatrix4dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniformMatrix4dv(location, transpose, value); + } + + /** + * Array version of: {@link #glUniformMatrix2x3dv UniformMatrix2x3dv} + * + * @see Reference Page + */ + public static void glUniformMatrix2x3dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniformMatrix2x3dv(location, transpose, value); + } + + /** + * Array version of: {@link #glUniformMatrix2x4dv UniformMatrix2x4dv} + * + * @see Reference Page + */ + public static void glUniformMatrix2x4dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniformMatrix2x4dv(location, transpose, value); + } + + /** + * Array version of: {@link #glUniformMatrix3x2dv UniformMatrix3x2dv} + * + * @see Reference Page + */ + public static void glUniformMatrix3x2dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniformMatrix3x2dv(location, transpose, value); + } + + /** + * Array version of: {@link #glUniformMatrix3x4dv UniformMatrix3x4dv} + * + * @see Reference Page + */ + public static void glUniformMatrix3x4dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniformMatrix3x4dv(location, transpose, value); + } + + /** + * Array version of: {@link #glUniformMatrix4x2dv UniformMatrix4x2dv} + * + * @see Reference Page + */ + public static void glUniformMatrix4x2dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniformMatrix4x2dv(location, transpose, value); + } + + /** + * Array version of: {@link #glUniformMatrix4x3dv UniformMatrix4x3dv} + * + * @see Reference Page + */ + public static void glUniformMatrix4x3dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL40C.glUniformMatrix4x3dv(location, transpose, value); + } + + /** + * Array version of: {@link #glGetUniformdv GetUniformdv} + * + * @see Reference Page + */ + public static void glGetUniformdv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble *") double[] params) { + GL40C.glGetUniformdv(program, location, params); + } + + /** + * Array version of: {@link #glGetActiveSubroutineUniformiv GetActiveSubroutineUniformiv} + * + * @see Reference Page + */ + public static void glGetActiveSubroutineUniformiv(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] values) { + GL40C.glGetActiveSubroutineUniformiv(program, shadertype, index, pname, values); + } + + /** + * Array version of: {@link #glGetActiveSubroutineUniformName GetActiveSubroutineUniformName} + * + * @see Reference Page + */ + public static void glGetActiveSubroutineUniformName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer name) { + GL40C.glGetActiveSubroutineUniformName(program, shadertype, index, length, name); + } + + /** + * Array version of: {@link #glGetActiveSubroutineName GetActiveSubroutineName} + * + * @see Reference Page + */ + public static void glGetActiveSubroutineName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer name) { + GL40C.glGetActiveSubroutineName(program, shadertype, index, length, name); + } + + /** + * Array version of: {@link #glUniformSubroutinesuiv UniformSubroutinesuiv} + * + * @see Reference Page + */ + public static void glUniformSubroutinesuiv(@NativeType("GLenum") int shadertype, @NativeType("GLuint const *") int[] indices) { + GL40C.glUniformSubroutinesuiv(shadertype, indices); + } + + /** + * Array version of: {@link #glGetUniformSubroutineuiv GetUniformSubroutineuiv} + * + * @see Reference Page + */ + public static void glGetUniformSubroutineuiv(@NativeType("GLenum") int shadertype, @NativeType("GLint") int location, @NativeType("GLuint *") int[] params) { + GL40C.glGetUniformSubroutineuiv(shadertype, location, params); + } + + /** + * Array version of: {@link #glGetProgramStageiv GetProgramStageiv} + * + * @see Reference Page + */ + public static void glGetProgramStageiv(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] values) { + GL40C.glGetProgramStageiv(program, shadertype, pname, values); + } + + /** + * Array version of: {@link #glPatchParameterfv PatchParameterfv} + * + * @see Reference Page + */ + public static void glPatchParameterfv(@NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] values) { + GL40C.glPatchParameterfv(pname, values); + } + + /** + * Array version of: {@link #glDeleteTransformFeedbacks DeleteTransformFeedbacks} + * + * @see Reference Page + */ + public static void glDeleteTransformFeedbacks(@NativeType("GLuint const *") int[] ids) { + GL40C.glDeleteTransformFeedbacks(ids); + } + + /** + * Array version of: {@link #glGenTransformFeedbacks GenTransformFeedbacks} + * + * @see Reference Page + */ + public static void glGenTransformFeedbacks(@NativeType("GLuint *") int[] ids) { + GL40C.glGenTransformFeedbacks(ids); + } + + /** + * Array version of: {@link #glGetQueryIndexediv GetQueryIndexediv} + * + * @see Reference Page + */ + public static void glGetQueryIndexediv(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL40C.glGetQueryIndexediv(target, index, pname, params); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL40C.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL40C.java new file mode 100644 index 00000000..b47ff465 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL40C.java @@ -0,0 +1,1862 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality up to version 4.0. Includes only Core Profile symbols. + * + *

OpenGL 4.0 implementations support revision 4.00 of the OpenGL Shading Language.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL40C extends GL33C { + + /** + * Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferPointerv, + * MapBufferRange, FlushMappedBufferRange, GetBufferParameteriv, and CopyBufferSubData. + */ + public static final int GL_DRAW_INDIRECT_BUFFER = 0x8F3F; + + /** Accepted by the {@code value} parameter of GetIntegerv, GetBooleanv, GetFloatv, and GetDoublev. */ + public static final int GL_DRAW_INDIRECT_BUFFER_BINDING = 0x8F43; + + /** Accepted by the {@code pname} parameter of GetProgramiv. */ + public static final int GL_GEOMETRY_SHADER_INVOCATIONS = 0x887F; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev, and GetInteger64v. */ + public static final int + GL_MAX_GEOMETRY_SHADER_INVOCATIONS = 0x8E5A, + GL_MIN_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5B, + GL_MAX_FRAGMENT_INTERPOLATION_OFFSET = 0x8E5C, + GL_FRAGMENT_INTERPOLATION_OFFSET_BITS = 0x8E5D; + + /** Returned in the {@code type} parameter of GetActiveUniform, and GetTransformFeedbackVarying. */ + public static final int + GL_DOUBLE_VEC2 = 0x8FFC, + GL_DOUBLE_VEC3 = 0x8FFD, + GL_DOUBLE_VEC4 = 0x8FFE, + GL_DOUBLE_MAT2 = 0x8F46, + GL_DOUBLE_MAT3 = 0x8F47, + GL_DOUBLE_MAT4 = 0x8F48, + GL_DOUBLE_MAT2x3 = 0x8F49, + GL_DOUBLE_MAT2x4 = 0x8F4A, + GL_DOUBLE_MAT3x2 = 0x8F4B, + GL_DOUBLE_MAT3x4 = 0x8F4C, + GL_DOUBLE_MAT4x2 = 0x8F4D, + GL_DOUBLE_MAT4x3 = 0x8F4E; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_SAMPLE_SHADING = 0x8C36; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int GL_MIN_SAMPLE_SHADING_VALUE = 0x8C37; + + /** Accepted by the {@code pname} parameter of GetProgramStageiv. */ + public static final int + GL_ACTIVE_SUBROUTINES = 0x8DE5, + GL_ACTIVE_SUBROUTINE_UNIFORMS = 0x8DE6, + GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS = 0x8E47, + GL_ACTIVE_SUBROUTINE_MAX_LENGTH = 0x8E48, + GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH = 0x8E49; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev, and GetInteger64v. */ + public static final int + GL_MAX_SUBROUTINES = 0x8DE7, + GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS = 0x8DE8; + + /** Accepted by the {@code pname} parameter of GetActiveSubroutineUniformiv. */ + public static final int + GL_NUM_COMPATIBLE_SUBROUTINES = 0x8E4A, + GL_COMPATIBLE_SUBROUTINES = 0x8E4B; + + /** Accepted by the {@code mode} parameter of Begin and all vertex array functions that implicitly call Begin. */ + public static final int GL_PATCHES = 0xE; + + /** Accepted by the {@code pname} parameter of PatchParameteri, GetBooleanv, GetDoublev, GetFloatv, GetIntegerv, and GetInteger64v. */ + public static final int GL_PATCH_VERTICES = 0x8E72; + + /** Accepted by the {@code pname} parameter of PatchParameterfv, GetBooleanv, GetDoublev, GetFloatv, and GetIntegerv, and GetInteger64v. */ + public static final int + GL_PATCH_DEFAULT_INNER_LEVEL = 0x8E73, + GL_PATCH_DEFAULT_OUTER_LEVEL = 0x8E74; + + /** Accepted by the {@code pname} parameter of GetProgramiv. */ + public static final int + GL_TESS_CONTROL_OUTPUT_VERTICES = 0x8E75, + GL_TESS_GEN_MODE = 0x8E76, + GL_TESS_GEN_SPACING = 0x8E77, + GL_TESS_GEN_VERTEX_ORDER = 0x8E78, + GL_TESS_GEN_POINT_MODE = 0x8E79; + + /** Returned by GetProgramiv when {@code pname} is TESS_GEN_MODE. */ + public static final int GL_ISOLINES = 0x8E7A; + + /** Returned by GetProgramiv when {@code pname} is TESS_GEN_SPACING. */ + public static final int + GL_FRACTIONAL_ODD = 0x8E7B, + GL_FRACTIONAL_EVEN = 0x8E7C; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetFloatv, GetIntegerv, and GetInteger64v. */ + public static final int + GL_MAX_PATCH_VERTICES = 0x8E7D, + GL_MAX_TESS_GEN_LEVEL = 0x8E7E, + GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E7F, + GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E80, + GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS = 0x8E81, + GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS = 0x8E82, + GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS = 0x8E83, + GL_MAX_TESS_PATCH_COMPONENTS = 0x8E84, + GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS = 0x8E85, + GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS = 0x8E86, + GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS = 0x8E89, + GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS = 0x8E8A, + GL_MAX_TESS_CONTROL_INPUT_COMPONENTS = 0x886C, + GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS = 0x886D, + GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS = 0x8E1E, + GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS = 0x8E1F; + + /** Accepted by the {@code pname} parameter of GetActiveUniformBlockiv. */ + public static final int + GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_CONTROL_SHADER = 0x84F0, + GL_UNIFORM_BLOCK_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x84F1; + + /** Accepted by the {@code type} parameter of CreateShader and returned by the {@code params} parameter of GetShaderiv. */ + public static final int + GL_TESS_EVALUATION_SHADER = 0x8E87, + GL_TESS_CONTROL_SHADER = 0x8E88; + + /** Accepted by the {@code target} parameter of TexParameteri, TexParameteriv, TexParameterf, TexParameterfv, BindTexture, and GenerateMipmap. */ + public static final int GL_TEXTURE_CUBE_MAP_ARRAY = 0x9009; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv and GetFloatv. */ + public static final int GL_TEXTURE_BINDING_CUBE_MAP_ARRAY = 0x900A; + + /** Accepted by the {@code target} parameter of TexImage3D, TexSubImage3D, CompressedTeximage3D, CompressedTexSubImage3D and CopyTexSubImage3D. */ + public static final int GL_PROXY_TEXTURE_CUBE_MAP_ARRAY = 0x900B; + + /** Returned by the {@code type} parameter of GetActiveUniform. */ + public static final int + GL_SAMPLER_CUBE_MAP_ARRAY = 0x900C, + GL_SAMPLER_CUBE_MAP_ARRAY_SHADOW = 0x900D, + GL_INT_SAMPLER_CUBE_MAP_ARRAY = 0x900E, + GL_UNSIGNED_INT_SAMPLER_CUBE_MAP_ARRAY = 0x900F; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5E, + GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET = 0x8E5F; + + /** Accepted by the {@code target} parameter of BindTransformFeedback. */ + public static final int GL_TRANSFORM_FEEDBACK = 0x8E22; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED = 0x8E23, + GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE = 0x8E24, + GL_TRANSFORM_FEEDBACK_BINDING = 0x8E25; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_MAX_TRANSFORM_FEEDBACK_BUFFERS = 0x8E70, + GL_MAX_VERTEX_STREAMS = 0x8E71; + + static { GL.initialize(); } + + protected GL40C() { + throw new UnsupportedOperationException(); + } + + // --- [ glBlendEquationi ] --- + + /** + * Specifies the equation used for both the RGB blend equation and the Alpha blend equation for the specified draw buffer. + * + * @param buf the index of the draw buffer for which to set the blend equation + * @param mode how source and destination colors are combined. One of:
{@link GL14#GL_FUNC_ADD FUNC_ADD}{@link GL14#GL_FUNC_SUBTRACT FUNC_SUBTRACT}{@link GL14#GL_FUNC_REVERSE_SUBTRACT FUNC_REVERSE_SUBTRACT}{@link GL14#GL_MIN MIN}{@link GL14#GL_MAX MAX}
+ * + * @see Reference Page + */ + public static native void glBlendEquationi(@NativeType("GLuint") int buf, @NativeType("GLenum") int mode); + + // --- [ glBlendEquationSeparatei ] --- + + /** + * Sets the RGB blend equation and the alpha blend equation separately for the specified draw buffer. + * + * @param buf the index of the draw buffer for which to set the blend equations + * @param modeRGB the RGB blend equation, how the red, green, and blue components of the source and destination colors are combined. One of:
{@link GL14#GL_FUNC_ADD FUNC_ADD}{@link GL14#GL_FUNC_SUBTRACT FUNC_SUBTRACT}{@link GL14#GL_FUNC_REVERSE_SUBTRACT FUNC_REVERSE_SUBTRACT}{@link GL14#GL_MIN MIN}{@link GL14#GL_MAX MAX}
+ * @param modeAlpha the alpha blend equation, how the alpha component of the source and destination colors are combined. One of:
{@link GL14#GL_FUNC_ADD FUNC_ADD}{@link GL14#GL_FUNC_SUBTRACT FUNC_SUBTRACT}{@link GL14#GL_FUNC_REVERSE_SUBTRACT FUNC_REVERSE_SUBTRACT}{@link GL14#GL_MIN MIN}{@link GL14#GL_MAX MAX}
+ * + * @see Reference Page + */ + public static native void glBlendEquationSeparatei(@NativeType("GLuint") int buf, @NativeType("GLenum") int modeRGB, @NativeType("GLenum") int modeAlpha); + + // --- [ glBlendFunci ] --- + + /** + * Specifies pixel arithmetic for the specified draw buffer. + * + * @param buf the index of the draw buffer for which to set the blend function + * @param sfactor how the red, green, blue, and alpha source blending factors are computed + * @param dfactor how the red, green, blue, and alpha destination blending factors are computed + * + * @see Reference Page + */ + public static native void glBlendFunci(@NativeType("GLuint") int buf, @NativeType("GLenum") int sfactor, @NativeType("GLenum") int dfactor); + + // --- [ glBlendFuncSeparatei ] --- + + /** + * Specifies pixel arithmetic for RGB and alpha components separately for the specified draw buffer. + * + * @param buf the index of the draw buffer for which to set the blend functions + * @param srcRGB how the red, green, and blue blending factors are computed + * @param dstRGB how the red, green, and blue destination blending factors are computed + * @param srcAlpha how the alpha source blending factor is computed + * @param dstAlpha how the alpha destination blending factor is computed + * + * @see Reference Page + */ + public static native void glBlendFuncSeparatei(@NativeType("GLuint") int buf, @NativeType("GLenum") int srcRGB, @NativeType("GLenum") int dstRGB, @NativeType("GLenum") int srcAlpha, @NativeType("GLenum") int dstAlpha); + + // --- [ glDrawArraysIndirect ] --- + + /** Unsafe version of: {@link #glDrawArraysIndirect DrawArraysIndirect} */ + public static native void nglDrawArraysIndirect(int mode, long indirect); + + /** + * Renders primitives from array data, taking parameters from memory. + * + *

{@code glDrawArraysIndirect} behaves similarly to {@link GL42C#glDrawArraysInstancedBaseInstance DrawArraysInstancedBaseInstance}, except that the parameters to + * glDrawArraysInstancedBaseInstance are stored in memory at the address given by {@code indirect}.

+ * + *

The parameters addressed by {@code indirect} are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint first;
+     *     uint baseInstance; // must be 0 unless OpenGL 4.2 is supported
+     * } DrawArraysIndirectCommand;
+     * 
+     * const DrawArraysIndirectCommand *cmd = (const DrawArraysIndirectCommand *)indirect;
+     * glDrawArraysInstancedBaseInstance(mode, cmd->first, cmd->count, cmd->primCount, cmd->baseInstance);
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link #GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect a structure containing the draw parameters + * + * @see Reference Page + */ + public static void glDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indirect) { + if (CHECKS) { + check(indirect, 4 * 4); + } + nglDrawArraysIndirect(mode, memAddress(indirect)); + } + + /** + * Renders primitives from array data, taking parameters from memory. + * + *

{@code glDrawArraysIndirect} behaves similarly to {@link GL42C#glDrawArraysInstancedBaseInstance DrawArraysInstancedBaseInstance}, except that the parameters to + * glDrawArraysInstancedBaseInstance are stored in memory at the address given by {@code indirect}.

+ * + *

The parameters addressed by {@code indirect} are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint first;
+     *     uint baseInstance; // must be 0 unless OpenGL 4.2 is supported
+     * } DrawArraysIndirectCommand;
+     * 
+     * const DrawArraysIndirectCommand *cmd = (const DrawArraysIndirectCommand *)indirect;
+     * glDrawArraysInstancedBaseInstance(mode, cmd->first, cmd->count, cmd->primCount, cmd->baseInstance);
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link #GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect a structure containing the draw parameters + * + * @see Reference Page + */ + public static void glDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") long indirect) { + nglDrawArraysIndirect(mode, indirect); + } + + /** + * Renders primitives from array data, taking parameters from memory. + * + *

{@code glDrawArraysIndirect} behaves similarly to {@link GL42C#glDrawArraysInstancedBaseInstance DrawArraysInstancedBaseInstance}, except that the parameters to + * glDrawArraysInstancedBaseInstance are stored in memory at the address given by {@code indirect}.

+ * + *

The parameters addressed by {@code indirect} are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint first;
+     *     uint baseInstance; // must be 0 unless OpenGL 4.2 is supported
+     * } DrawArraysIndirectCommand;
+     * 
+     * const DrawArraysIndirectCommand *cmd = (const DrawArraysIndirectCommand *)indirect;
+     * glDrawArraysInstancedBaseInstance(mode, cmd->first, cmd->count, cmd->primCount, cmd->baseInstance);
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link #GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect a structure containing the draw parameters + * + * @see Reference Page + */ + public static void glDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indirect) { + if (CHECKS) { + check(indirect, (4 * 4) >> 2); + } + nglDrawArraysIndirect(mode, memAddress(indirect)); + } + + // --- [ glDrawElementsIndirect ] --- + + /** Unsafe version of: {@link #glDrawElementsIndirect DrawElementsIndirect} */ + public static native void nglDrawElementsIndirect(int mode, int type, long indirect); + + /** + * Renders indexed primitives from array data, taking parameters from memory. + * + *

{@code glDrawElementsIndirect} behaves similarly to {@link GL42C#glDrawElementsInstancedBaseVertexBaseInstance DrawElementsInstancedBaseVertexBaseInstance}, execpt that the parameters to + * glDrawElementsInstancedBaseVertexBaseInstance are stored in memory at the address given by {@code indirect}.

+ * + *

The parameters addressed by {@code indirect} are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint firstIndex;
+     *     uint baseVertex;
+     *     uint baseInstance;
+     * } DrawElementsIndirectCommand;
+ * + *

{@code glDrawElementsIndirect} is equivalent to:

+ * + *

+     * void glDrawElementsIndirect(GLenum mode, GLenum type, const void *indirect) {
+     *     const DrawElementsIndirectCommand *cmd  = (const DrawElementsIndirectCommand *)indirect;
+     *     glDrawElementsInstancedBaseVertexBaseInstance(
+     *         mode,
+     *         cmd->count,
+     *         type,
+     *         cmd->firstIndex + size-of-type,
+     *         cmd->primCount,
+     *         cmd->baseVertex,
+     *         cmd->baseInstance
+     *     );
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link #GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the {@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER} binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect the address of a structure containing the draw parameters + * + * @see Reference Page + */ + public static void glDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indirect) { + if (CHECKS) { + check(indirect, 5 * 4); + } + nglDrawElementsIndirect(mode, type, memAddress(indirect)); + } + + /** + * Renders indexed primitives from array data, taking parameters from memory. + * + *

{@code glDrawElementsIndirect} behaves similarly to {@link GL42C#glDrawElementsInstancedBaseVertexBaseInstance DrawElementsInstancedBaseVertexBaseInstance}, execpt that the parameters to + * glDrawElementsInstancedBaseVertexBaseInstance are stored in memory at the address given by {@code indirect}.

+ * + *

The parameters addressed by {@code indirect} are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint firstIndex;
+     *     uint baseVertex;
+     *     uint baseInstance;
+     * } DrawElementsIndirectCommand;
+ * + *

{@code glDrawElementsIndirect} is equivalent to:

+ * + *

+     * void glDrawElementsIndirect(GLenum mode, GLenum type, const void *indirect) {
+     *     const DrawElementsIndirectCommand *cmd  = (const DrawElementsIndirectCommand *)indirect;
+     *     glDrawElementsInstancedBaseVertexBaseInstance(
+     *         mode,
+     *         cmd->count,
+     *         type,
+     *         cmd->firstIndex + size-of-type,
+     *         cmd->primCount,
+     *         cmd->baseVertex,
+     *         cmd->baseInstance
+     *     );
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link #GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the {@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER} binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect the address of a structure containing the draw parameters + * + * @see Reference Page + */ + public static void glDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") long indirect) { + nglDrawElementsIndirect(mode, type, indirect); + } + + /** + * Renders indexed primitives from array data, taking parameters from memory. + * + *

{@code glDrawElementsIndirect} behaves similarly to {@link GL42C#glDrawElementsInstancedBaseVertexBaseInstance DrawElementsInstancedBaseVertexBaseInstance}, execpt that the parameters to + * glDrawElementsInstancedBaseVertexBaseInstance are stored in memory at the address given by {@code indirect}.

+ * + *

The parameters addressed by {@code indirect} are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint firstIndex;
+     *     uint baseVertex;
+     *     uint baseInstance;
+     * } DrawElementsIndirectCommand;
+ * + *

{@code glDrawElementsIndirect} is equivalent to:

+ * + *

+     * void glDrawElementsIndirect(GLenum mode, GLenum type, const void *indirect) {
+     *     const DrawElementsIndirectCommand *cmd  = (const DrawElementsIndirectCommand *)indirect;
+     *     glDrawElementsInstancedBaseVertexBaseInstance(
+     *         mode,
+     *         cmd->count,
+     *         type,
+     *         cmd->firstIndex + size-of-type,
+     *         cmd->primCount,
+     *         cmd->baseVertex,
+     *         cmd->baseInstance
+     *     );
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link #GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the {@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER} binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect the address of a structure containing the draw parameters + * + * @see Reference Page + */ + public static void glDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer indirect) { + if (CHECKS) { + check(indirect, (5 * 4) >> 2); + } + nglDrawElementsIndirect(mode, type, memAddress(indirect)); + } + + // --- [ glUniform1d ] --- + + /** + * Specifies the value of a double uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * + * @see Reference Page + */ + public static native void glUniform1d(@NativeType("GLint") int location, @NativeType("GLdouble") double x); + + // --- [ glUniform2d ] --- + + /** + * Specifies the value of a dvec2 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * + * @see Reference Page + */ + public static native void glUniform2d(@NativeType("GLint") int location, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y); + + // --- [ glUniform3d ] --- + + /** + * Specifies the value of a dvec3 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * + * @see Reference Page + */ + public static native void glUniform3d(@NativeType("GLint") int location, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z); + + // --- [ glUniform4d ] --- + + /** + * Specifies the value of a dvec4 uniform variable for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * @param w the uniform w value + * + * @see Reference Page + */ + public static native void glUniform4d(@NativeType("GLint") int location, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z, @NativeType("GLdouble") double w); + + // --- [ glUniform1dv ] --- + + /** + * Unsafe version of: {@link #glUniform1dv Uniform1dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform1dv(int location, int count, long value); + + /** + * Specifies the value of a single double uniform variable or a double uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform1dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + nglUniform1dv(location, value.remaining(), memAddress(value)); + } + + // --- [ glUniform2dv ] --- + + /** + * Unsafe version of: {@link #glUniform2dv Uniform2dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform2dv(int location, int count, long value); + + /** + * Specifies the value of a single dvec2 uniform variable or a dvec2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform2dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + nglUniform2dv(location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glUniform3dv ] --- + + /** + * Unsafe version of: {@link #glUniform3dv Uniform3dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform3dv(int location, int count, long value); + + /** + * Specifies the value of a single dvec3 uniform variable or a dvec3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform3dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + nglUniform3dv(location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glUniform4dv ] --- + + /** + * Unsafe version of: {@link #glUniform4dv Uniform4dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglUniform4dv(int location, int count, long value); + + /** + * Specifies the value of a single dvec4 uniform variable or a dvec4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glUniform4dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + nglUniform4dv(location, value.remaining() >> 2, memAddress(value)); + } + + // --- [ glUniformMatrix2dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix2dv UniformMatrix2dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglUniformMatrix2dv(int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single dmat2 uniform variable or a dmat2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glUniformMatrix2dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglUniformMatrix2dv(location, value.remaining() >> 2, transpose, memAddress(value)); + } + + // --- [ glUniformMatrix3dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix3dv UniformMatrix3dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglUniformMatrix3dv(int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single dmat3 uniform variable or a dmat3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glUniformMatrix3dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglUniformMatrix3dv(location, value.remaining() / 9, transpose, memAddress(value)); + } + + // --- [ glUniformMatrix4dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix4dv UniformMatrix4dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglUniformMatrix4dv(int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single dmat4 uniform variable or a dmat4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glUniformMatrix4dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglUniformMatrix4dv(location, value.remaining() >> 4, transpose, memAddress(value)); + } + + // --- [ glUniformMatrix2x3dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix2x3dv UniformMatrix2x3dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglUniformMatrix2x3dv(int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single dmat2x3 uniform variable or a dmat2x3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glUniformMatrix2x3dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglUniformMatrix2x3dv(location, value.remaining() / 6, transpose, memAddress(value)); + } + + // --- [ glUniformMatrix2x4dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix2x4dv UniformMatrix2x4dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglUniformMatrix2x4dv(int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single dmat2x4 uniform variable or a dmat2x4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glUniformMatrix2x4dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglUniformMatrix2x4dv(location, value.remaining() >> 3, transpose, memAddress(value)); + } + + // --- [ glUniformMatrix3x2dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix3x2dv UniformMatrix3x2dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglUniformMatrix3x2dv(int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single dmat3x2 uniform variable or a dmat3x2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glUniformMatrix3x2dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglUniformMatrix3x2dv(location, value.remaining() / 6, transpose, memAddress(value)); + } + + // --- [ glUniformMatrix3x4dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix3x4dv UniformMatrix3x4dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglUniformMatrix3x4dv(int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single dmat3x4 uniform variable or a dmat3x4 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glUniformMatrix3x4dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglUniformMatrix3x4dv(location, value.remaining() / 12, transpose, memAddress(value)); + } + + // --- [ glUniformMatrix4x2dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix4x2dv UniformMatrix4x2dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglUniformMatrix4x2dv(int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single dmat4x2 uniform variable or a dmat4x2 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glUniformMatrix4x2dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglUniformMatrix4x2dv(location, value.remaining() >> 3, transpose, memAddress(value)); + } + + // --- [ glUniformMatrix4x3dv ] --- + + /** + * Unsafe version of: {@link #glUniformMatrix4x3dv UniformMatrix4x3dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglUniformMatrix4x3dv(int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single dmat4x3 uniform variable or a dmat4x3 uniform variable array for the current program object. + * + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value a pointer to an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glUniformMatrix4x3dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglUniformMatrix4x3dv(location, value.remaining() / 12, transpose, memAddress(value)); + } + + // --- [ glGetUniformdv ] --- + + /** Unsafe version of: {@link #glGetUniformdv GetUniformdv} */ + public static native void nglGetUniformdv(int program, int location, long params); + + /** + * Returns the double value(s) of a uniform variable. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * @param params the value of the specified uniform variable + * + * @see Reference Page + */ + public static void glGetUniformdv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble *") DoubleBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetUniformdv(program, location, memAddress(params)); + } + + /** + * Returns the double value(s) of a uniform variable. + * + * @param program the program object to be queried + * @param location the location of the uniform variable to be queried + * + * @see Reference Page + */ + @NativeType("void") + public static double glGetUniformd(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + DoubleBuffer params = stack.callocDouble(1); + nglGetUniformdv(program, location, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glMinSampleShading ] --- + + /** + * Specifies the minimum rate at which sample shading takes place. + * + * @param value the rate at which samples are shaded within each covered pixel + * + * @see Reference Page + */ + public static native void glMinSampleShading(@NativeType("GLfloat") float value); + + // --- [ glGetSubroutineUniformLocation ] --- + + /** Unsafe version of: {@link #glGetSubroutineUniformLocation GetSubroutineUniformLocation} */ + public static native int nglGetSubroutineUniformLocation(int program, int shadertype, long name); + + /** + * Retrieves the location of a subroutine uniform of a given shader stage within a program. + * + * @param program the name of the program containing shader stage + * @param shadertype the shader stage from which to query for subroutine uniform index. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link #GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link #GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param name the name of the subroutine uniform whose index to query. + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetSubroutineUniformLocation(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLchar const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nglGetSubroutineUniformLocation(program, shadertype, memAddress(name)); + } + + /** + * Retrieves the location of a subroutine uniform of a given shader stage within a program. + * + * @param program the name of the program containing shader stage + * @param shadertype the shader stage from which to query for subroutine uniform index. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link #GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link #GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param name the name of the subroutine uniform whose index to query. + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetSubroutineUniformLocation(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLchar const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + return nglGetSubroutineUniformLocation(program, shadertype, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetSubroutineIndex ] --- + + /** Unsafe version of: {@link #glGetSubroutineIndex GetSubroutineIndex} */ + public static native int nglGetSubroutineIndex(int program, int shadertype, long name); + + /** + * Retrieves the index of a subroutine function of a given shader stage within a program. + * + * @param program the name of the program containing shader stage + * @param shadertype the shader stage from which to query for subroutine function index. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link #GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link #GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param name the name of the subroutine function whose index to query + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glGetSubroutineIndex(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLchar const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nglGetSubroutineIndex(program, shadertype, memAddress(name)); + } + + /** + * Retrieves the index of a subroutine function of a given shader stage within a program. + * + * @param program the name of the program containing shader stage + * @param shadertype the shader stage from which to query for subroutine function index. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link #GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link #GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param name the name of the subroutine function whose index to query + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glGetSubroutineIndex(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLchar const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + return nglGetSubroutineIndex(program, shadertype, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetActiveSubroutineUniformiv ] --- + + /** Unsafe version of: {@link #glGetActiveSubroutineUniformiv GetActiveSubroutineUniformiv} */ + public static native void nglGetActiveSubroutineUniformiv(int program, int shadertype, int index, int pname, long values); + + /** + * Queries a property of an active shader subroutine uniform. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query for the subroutine parameter. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link #GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link #GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + * @param pname the parameter of the shader subroutine uniform to query. One of:
{@link #GL_NUM_COMPATIBLE_SUBROUTINES NUM_COMPATIBLE_SUBROUTINES}{@link #GL_COMPATIBLE_SUBROUTINES COMPATIBLE_SUBROUTINES}{@link GL31#GL_UNIFORM_SIZE UNIFORM_SIZE}{@link GL31#GL_UNIFORM_NAME_LENGTH UNIFORM_NAME_LENGTH}
+ * @param values the address of a buffer into which the queried value or values will be placed + * + * @see Reference Page + */ + public static void glGetActiveSubroutineUniformiv(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer values) { + if (CHECKS) { + check(values, 1); + } + nglGetActiveSubroutineUniformiv(program, shadertype, index, pname, memAddress(values)); + } + + /** + * Queries a property of an active shader subroutine uniform. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query for the subroutine parameter. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link #GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link #GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + * @param pname the parameter of the shader subroutine uniform to query. One of:
{@link #GL_NUM_COMPATIBLE_SUBROUTINES NUM_COMPATIBLE_SUBROUTINES}{@link #GL_COMPATIBLE_SUBROUTINES COMPATIBLE_SUBROUTINES}{@link GL31#GL_UNIFORM_SIZE UNIFORM_SIZE}{@link GL31#GL_UNIFORM_NAME_LENGTH UNIFORM_NAME_LENGTH}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetActiveSubroutineUniformi(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer values = stack.callocInt(1); + nglGetActiveSubroutineUniformiv(program, shadertype, index, pname, memAddress(values)); + return values.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetActiveSubroutineUniformName ] --- + + /** + * Unsafe version of: {@link #glGetActiveSubroutineUniformName GetActiveSubroutineUniformName} + * + * @param bufsize the size of the buffer whose address is given in {@code name} + */ + public static native void nglGetActiveSubroutineUniformName(int program, int shadertype, int index, int bufsize, long length, long name); + + /** + * Queries the name of an active shader subroutine uniform. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query for the subroutine parameter. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link #GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link #GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + * @param length the address of a variable into which is written the number of characters copied into {@code name} + * @param name the address of a buffer that will receive the name of the specified shader subroutine uniform + * + * @see Reference Page + */ + public static void glGetActiveSubroutineUniformName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer name) { + if (CHECKS) { + checkSafe(length, 1); + } + nglGetActiveSubroutineUniformName(program, shadertype, index, name.remaining(), memAddressSafe(length), memAddress(name)); + } + + /** + * Queries the name of an active shader subroutine uniform. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query for the subroutine parameter. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link #GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link #GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + * @param bufsize the size of the buffer whose address is given in {@code name} + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveSubroutineUniformName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @NativeType("GLsizei") int bufsize) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer length = stack.ints(0); + ByteBuffer name = stack.malloc(bufsize); + nglGetActiveSubroutineUniformName(program, shadertype, index, bufsize, memAddress(length), memAddress(name)); + return memASCII(name, length.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Queries the name of an active shader subroutine uniform. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query for the subroutine parameter. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link #GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link #GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveSubroutineUniformName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index) { + return glGetActiveSubroutineUniformName(program, shadertype, index, glGetActiveSubroutineUniformi(program, shadertype, index, GL31.GL_UNIFORM_NAME_LENGTH)); + } + + // --- [ glGetActiveSubroutineName ] --- + + /** + * Unsafe version of: {@link #glGetActiveSubroutineName GetActiveSubroutineName} + * + * @param bufsize the size of the buffer whose address is given in {@code name} + */ + public static native void nglGetActiveSubroutineName(int program, int shadertype, int index, int bufsize, long length, long name); + + /** + * Queries the name of an active shader subroutine. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query the subroutine name. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link #GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link #GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + * @param length a variable which is to receive the length of the shader subroutine uniform name + * @param name an array into which the name of the shader subroutine uniform will be written + * + * @see Reference Page + */ + public static void glGetActiveSubroutineName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer name) { + if (CHECKS) { + checkSafe(length, 1); + } + nglGetActiveSubroutineName(program, shadertype, index, name.remaining(), memAddressSafe(length), memAddress(name)); + } + + /** + * Queries the name of an active shader subroutine. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query the subroutine name. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link #GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link #GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + * @param bufsize the size of the buffer whose address is given in {@code name} + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveSubroutineName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @NativeType("GLsizei") int bufsize) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer length = stack.ints(0); + ByteBuffer name = stack.malloc(bufsize); + nglGetActiveSubroutineName(program, shadertype, index, bufsize, memAddress(length), memAddress(name)); + return memASCII(name, length.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Queries the name of an active shader subroutine. + * + * @param program the name of the program containing the subroutine + * @param shadertype the shader stage from which to query the subroutine name. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link #GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link #GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param index the index of the shader subroutine uniform + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetActiveSubroutineName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index) { + return glGetActiveSubroutineName(program, shadertype, index, glGetProgramStagei(program, shadertype, GL_ACTIVE_SUBROUTINE_MAX_LENGTH)); + } + + // --- [ glUniformSubroutinesuiv ] --- + + /** + * Unsafe version of: {@link #glUniformSubroutinesuiv UniformSubroutinesuiv} + * + * @param count the number of uniform indices stored in {@code indices} + */ + public static native void nglUniformSubroutinesuiv(int shadertype, int count, long indices); + + /** + * Loads active subroutine uniforms. + * + * @param shadertype the shader stage to update. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link #GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link #GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param indices an array holding the indices to load into the shader subroutine variables + * + * @see Reference Page + */ + public static void glUniformSubroutinesuiv(@NativeType("GLenum") int shadertype, @NativeType("GLuint const *") IntBuffer indices) { + nglUniformSubroutinesuiv(shadertype, indices.remaining(), memAddress(indices)); + } + + /** + * Loads active subroutine uniforms. + * + * @param shadertype the shader stage to update. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link #GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link #GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * + * @see Reference Page + */ + public static void glUniformSubroutinesui(@NativeType("GLenum") int shadertype, @NativeType("GLuint const *") int index) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer indices = stack.ints(index); + nglUniformSubroutinesuiv(shadertype, 1, memAddress(indices)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetUniformSubroutineuiv ] --- + + /** Unsafe version of: {@link #glGetUniformSubroutineuiv GetUniformSubroutineuiv} */ + public static native void nglGetUniformSubroutineuiv(int shadertype, int location, long params); + + /** + * Retrieves the value of a subroutine uniform of a given shader stage of the current program. + * + * @param shadertype the shader stage from which to query for subroutine uniform index. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link #GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link #GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param location the location of the subroutine uniform + * @param params a variable to receive the value or values of the subroutine uniform + * + * @see Reference Page + */ + public static void glGetUniformSubroutineuiv(@NativeType("GLenum") int shadertype, @NativeType("GLint") int location, @NativeType("GLuint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetUniformSubroutineuiv(shadertype, location, memAddress(params)); + } + + /** + * Retrieves the value of a subroutine uniform of a given shader stage of the current program. + * + * @param shadertype the shader stage from which to query for subroutine uniform index. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link #GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link #GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param location the location of the subroutine uniform + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetUniformSubroutineui(@NativeType("GLenum") int shadertype, @NativeType("GLint") int location) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetUniformSubroutineuiv(shadertype, location, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetProgramStageiv ] --- + + /** Unsafe version of: {@link #glGetProgramStageiv GetProgramStageiv} */ + public static native void nglGetProgramStageiv(int program, int shadertype, int pname, long values); + + /** + * Retrieves properties of a program object corresponding to a specified shader stage. + * + * @param program the name of the program containing shader stage + * @param shadertype the shader stage from which to query for the subroutine parameter. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link #GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link #GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param pname the parameter of the shader to query. One of:
{@link #GL_ACTIVE_SUBROUTINES ACTIVE_SUBROUTINES}{@link #GL_ACTIVE_SUBROUTINE_UNIFORMS ACTIVE_SUBROUTINE_UNIFORMS}
{@link #GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS}{@link #GL_ACTIVE_SUBROUTINE_MAX_LENGTH ACTIVE_SUBROUTINE_MAX_LENGTH}
{@link #GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH}
+ * @param values a variable into which the queried value or values will be placed + * + * @see Reference Page + */ + public static void glGetProgramStageiv(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer values) { + if (CHECKS) { + check(values, 1); + } + nglGetProgramStageiv(program, shadertype, pname, memAddress(values)); + } + + /** + * Retrieves properties of a program object corresponding to a specified shader stage. + * + * @param program the name of the program containing shader stage + * @param shadertype the shader stage from which to query for the subroutine parameter. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}{@link #GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}
{@link #GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param pname the parameter of the shader to query. One of:
{@link #GL_ACTIVE_SUBROUTINES ACTIVE_SUBROUTINES}{@link #GL_ACTIVE_SUBROUTINE_UNIFORMS ACTIVE_SUBROUTINE_UNIFORMS}
{@link #GL_ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS ACTIVE_SUBROUTINE_UNIFORM_LOCATIONS}{@link #GL_ACTIVE_SUBROUTINE_MAX_LENGTH ACTIVE_SUBROUTINE_MAX_LENGTH}
{@link #GL_ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH ACTIVE_SUBROUTINE_UNIFORM_MAX_LENGTH}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetProgramStagei(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer values = stack.callocInt(1); + nglGetProgramStageiv(program, shadertype, pname, memAddress(values)); + return values.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glPatchParameteri ] --- + + /** + * Specifies the integer value of the specified parameter for patch primitives. + * + * @param pname the name of the parameter to set. Must be:
{@link #GL_PATCH_VERTICES PATCH_VERTICES}
+ * @param value the new value for the parameter given by {@code pname} + * + * @see Reference Page + */ + public static native void glPatchParameteri(@NativeType("GLenum") int pname, @NativeType("GLint") int value); + + // --- [ glPatchParameterfv ] --- + + /** Unsafe version of: {@link #glPatchParameterfv PatchParameterfv} */ + public static native void nglPatchParameterfv(int pname, long values); + + /** + * Specifies an array of float values for the specified parameter for patch primitives. + * + * @param pname the name of the parameter to set. One of:
{@link #GL_PATCH_DEFAULT_OUTER_LEVEL PATCH_DEFAULT_OUTER_LEVEL}{@link #GL_PATCH_DEFAULT_INNER_LEVEL PATCH_DEFAULT_INNER_LEVEL}
+ * @param values an array containing the new values for the parameter given by {@code pname} + * + * @see Reference Page + */ + public static void glPatchParameterfv(@NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer values) { + if (CHECKS) { + if (DEBUG) { + check(values, GL11.glGetInteger(GL_PATCH_VERTICES)); + } + } + nglPatchParameterfv(pname, memAddress(values)); + } + + // --- [ glBindTransformFeedback ] --- + + /** + * Binds a transform feedback object. + * + * @param target the target to which to bind the transform feedback object {@code id}. Must be:
{@link #GL_TRANSFORM_FEEDBACK TRANSFORM_FEEDBACK}
+ * @param id the name of a transform feedback object + * + * @see Reference Page + */ + public static native void glBindTransformFeedback(@NativeType("GLenum") int target, @NativeType("GLuint") int id); + + // --- [ glDeleteTransformFeedbacks ] --- + + /** + * Unsafe version of: {@link #glDeleteTransformFeedbacks DeleteTransformFeedbacks} + * + * @param n the number of transform feedback objects to delete + */ + public static native void nglDeleteTransformFeedbacks(int n, long ids); + + /** + * Deletes transform feedback objects. + * + * @param ids an array of names of transform feedback objects to delete + * + * @see Reference Page + */ + public static void glDeleteTransformFeedbacks(@NativeType("GLuint const *") IntBuffer ids) { + nglDeleteTransformFeedbacks(ids.remaining(), memAddress(ids)); + } + + /** + * Deletes transform feedback objects. + * + * @see Reference Page + */ + public static void glDeleteTransformFeedbacks(@NativeType("GLuint const *") int id) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer ids = stack.ints(id); + nglDeleteTransformFeedbacks(1, memAddress(ids)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGenTransformFeedbacks ] --- + + /** + * Unsafe version of: {@link #glGenTransformFeedbacks GenTransformFeedbacks} + * + * @param n the number of transform feedback object names to reserve + */ + public static native void nglGenTransformFeedbacks(int n, long ids); + + /** + * Reserves transform feedback object names. + * + * @param ids an array of into which the reserved names will be written + * + * @see Reference Page + */ + public static void glGenTransformFeedbacks(@NativeType("GLuint *") IntBuffer ids) { + nglGenTransformFeedbacks(ids.remaining(), memAddress(ids)); + } + + /** + * Reserves transform feedback object names. + * + * @see Reference Page + */ + @NativeType("void") + public static int glGenTransformFeedbacks() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer ids = stack.callocInt(1); + nglGenTransformFeedbacks(1, memAddress(ids)); + return ids.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glIsTransformFeedback ] --- + + /** + * Determines if a name corresponds to a transform feedback object. + * + * @param id a value that may be the name of a transform feedback object + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static native boolean glIsTransformFeedback(@NativeType("GLuint") int id); + + // --- [ glPauseTransformFeedback ] --- + + /** + * Pauses transform feedback operations for the currently bound transform feedback object. + * + *

When transform feedback operations are paused, transform feedback is still considered active and changing most transform feedback state related to the + * object results in an error. However, a new transform feedback object may be bound while transform feedback is paused. The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} + * is generated by PauseTransformFeedback if the currently bound transform feedback is not active or is paused.

+ * + *

When transform feedback is active and not paused, all geometric primitives generated must be compatible with the value of {@code primitiveMode} passed + * to {@link GL30C#glBeginTransformFeedback BeginTransformFeedback}. The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated by {@link GL11#glBegin Begin} or any operation that implicitly calls {@link GL11#glBegin Begin} + * (such as {@link GL11C#glDrawElements DrawElements}) if {@code mode} is not one of the allowed modes. If a geometry shader is active, its output primitive type is used instead + * of the {@code mode} parameter passed to {@link GL11#glBegin Begin} for the purposes of this error check. Any primitive type may be used while transform feedback is + * paused.

+ * + * @see Reference Page + */ + public static native void glPauseTransformFeedback(); + + // --- [ glResumeTransformFeedback ] --- + + /** + * Resumes transform feedback operations for the currently bound transform feedback object. + * + *

The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated by {@link #glResumeTransformFeedback ResumeTransformFeedback} if the currently bound transform feedback is not active or is not paused.

+ * + * @see Reference Page + */ + public static native void glResumeTransformFeedback(); + + // --- [ glDrawTransformFeedback ] --- + + /** + * Render primitives using a count derived from a transform feedback object. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link #GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param id the name of a transform feedback object from which to retrieve a primitive count + * + * @see Reference Page + */ + public static native void glDrawTransformFeedback(@NativeType("GLenum") int mode, @NativeType("GLuint") int id); + + // --- [ glDrawTransformFeedbackStream ] --- + + /** + * Renders primitives using a count derived from a specifed stream of a transform feedback object. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link #GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param id the name of a transform feedback object from which to retrieve a primitive count + * @param stream the index of the transform feedback stream from which to retrieve a primitive count + * + * @see Reference Page + */ + public static native void glDrawTransformFeedbackStream(@NativeType("GLenum") int mode, @NativeType("GLuint") int id, @NativeType("GLuint") int stream); + + // --- [ glBeginQueryIndexed ] --- + + /** + * Begins a query object on an indexed target + * + * @param target the target type of query object established between {@code glBeginQueryIndexed} and the subsequent {@link #glEndQueryIndexed EndQueryIndexed}. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param index the index of the query target upon which to begin the query + * @param id the name of a query object + * + * @see Reference Page + */ + public static native void glBeginQueryIndexed(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLuint") int id); + + // --- [ glEndQueryIndexed ] --- + + /** + * Ends a query object on an indexed target + * + * @param target the target type of query object to be concluded. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param index the index of the query target upon which to end the query + * + * @see Reference Page + */ + public static native void glEndQueryIndexed(@NativeType("GLenum") int target, @NativeType("GLuint") int index); + + // --- [ glGetQueryIndexediv ] --- + + /** Unsafe version of: {@link #glGetQueryIndexediv GetQueryIndexediv} */ + public static native void nglGetQueryIndexediv(int target, int index, int pname, long params); + + /** + * Returns parameters of an indexed query object target. + * + * @param target a query object target. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param index the index of the query object target + * @param pname the symbolic name of a query object target parameter + * @param params the requested data + * + * @see Reference Page + */ + public static void glGetQueryIndexediv(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetQueryIndexediv(target, index, pname, memAddress(params)); + } + + /** + * Returns parameters of an indexed query object target. + * + * @param target a query object target. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param index the index of the query object target + * @param pname the symbolic name of a query object target parameter + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetQueryIndexedi(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetQueryIndexediv(target, index, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Array version of: {@link #glDrawArraysIndirect DrawArraysIndirect} + * + * @see Reference Page + */ + public static void glDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") int[] indirect) { + long __functionAddress = GL.getICD().glDrawArraysIndirect; + if (CHECKS) { + check(__functionAddress); + check(indirect, (4 * 4) >> 2); + } + callPV(mode, indirect, __functionAddress); + } + + /** + * Array version of: {@link #glDrawElementsIndirect DrawElementsIndirect} + * + * @see Reference Page + */ + public static void glDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") int[] indirect) { + long __functionAddress = GL.getICD().glDrawElementsIndirect; + if (CHECKS) { + check(__functionAddress); + check(indirect, (5 * 4) >> 2); + } + callPV(mode, type, indirect, __functionAddress); + } + + /** + * Array version of: {@link #glUniform1dv Uniform1dv} + * + * @see Reference Page + */ + public static void glUniform1dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glUniform1dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniform2dv Uniform2dv} + * + * @see Reference Page + */ + public static void glUniform2dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glUniform2dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 1, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniform3dv Uniform3dv} + * + * @see Reference Page + */ + public static void glUniform3dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glUniform3dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length / 3, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniform4dv Uniform4dv} + * + * @see Reference Page + */ + public static void glUniform4dv(@NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glUniform4dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 2, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniformMatrix2dv UniformMatrix2dv} + * + * @see Reference Page + */ + public static void glUniformMatrix2dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glUniformMatrix2dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 2, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniformMatrix3dv UniformMatrix3dv} + * + * @see Reference Page + */ + public static void glUniformMatrix3dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glUniformMatrix3dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length / 9, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniformMatrix4dv UniformMatrix4dv} + * + * @see Reference Page + */ + public static void glUniformMatrix4dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glUniformMatrix4dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 4, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniformMatrix2x3dv UniformMatrix2x3dv} + * + * @see Reference Page + */ + public static void glUniformMatrix2x3dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glUniformMatrix2x3dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length / 6, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniformMatrix2x4dv UniformMatrix2x4dv} + * + * @see Reference Page + */ + public static void glUniformMatrix2x4dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glUniformMatrix2x4dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 3, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniformMatrix3x2dv UniformMatrix3x2dv} + * + * @see Reference Page + */ + public static void glUniformMatrix3x2dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glUniformMatrix3x2dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length / 6, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniformMatrix3x4dv UniformMatrix3x4dv} + * + * @see Reference Page + */ + public static void glUniformMatrix3x4dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glUniformMatrix3x4dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length / 12, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniformMatrix4x2dv UniformMatrix4x2dv} + * + * @see Reference Page + */ + public static void glUniformMatrix4x2dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glUniformMatrix4x2dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 3, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glUniformMatrix4x3dv UniformMatrix4x3dv} + * + * @see Reference Page + */ + public static void glUniformMatrix4x3dv(@NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glUniformMatrix4x3dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length / 12, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glGetUniformdv GetUniformdv} + * + * @see Reference Page + */ + public static void glGetUniformdv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble *") double[] params) { + long __functionAddress = GL.getICD().glGetUniformdv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(program, location, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetActiveSubroutineUniformiv GetActiveSubroutineUniformiv} + * + * @see Reference Page + */ + public static void glGetActiveSubroutineUniformiv(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] values) { + long __functionAddress = GL.getICD().glGetActiveSubroutineUniformiv; + if (CHECKS) { + check(__functionAddress); + check(values, 1); + } + callPV(program, shadertype, index, pname, values, __functionAddress); + } + + /** + * Array version of: {@link #glGetActiveSubroutineUniformName GetActiveSubroutineUniformName} + * + * @see Reference Page + */ + public static void glGetActiveSubroutineUniformName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer name) { + long __functionAddress = GL.getICD().glGetActiveSubroutineUniformName; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + } + callPPV(program, shadertype, index, name.remaining(), length, memAddress(name), __functionAddress); + } + + /** + * Array version of: {@link #glGetActiveSubroutineName GetActiveSubroutineName} + * + * @see Reference Page + */ + public static void glGetActiveSubroutineName(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer name) { + long __functionAddress = GL.getICD().glGetActiveSubroutineName; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + } + callPPV(program, shadertype, index, name.remaining(), length, memAddress(name), __functionAddress); + } + + /** + * Array version of: {@link #glUniformSubroutinesuiv UniformSubroutinesuiv} + * + * @see Reference Page + */ + public static void glUniformSubroutinesuiv(@NativeType("GLenum") int shadertype, @NativeType("GLuint const *") int[] indices) { + long __functionAddress = GL.getICD().glUniformSubroutinesuiv; + if (CHECKS) { + check(__functionAddress); + } + callPV(shadertype, indices.length, indices, __functionAddress); + } + + /** + * Array version of: {@link #glGetUniformSubroutineuiv GetUniformSubroutineuiv} + * + * @see Reference Page + */ + public static void glGetUniformSubroutineuiv(@NativeType("GLenum") int shadertype, @NativeType("GLint") int location, @NativeType("GLuint *") int[] params) { + long __functionAddress = GL.getICD().glGetUniformSubroutineuiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(shadertype, location, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetProgramStageiv GetProgramStageiv} + * + * @see Reference Page + */ + public static void glGetProgramStageiv(@NativeType("GLuint") int program, @NativeType("GLenum") int shadertype, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] values) { + long __functionAddress = GL.getICD().glGetProgramStageiv; + if (CHECKS) { + check(__functionAddress); + check(values, 1); + } + callPV(program, shadertype, pname, values, __functionAddress); + } + + /** + * Array version of: {@link #glPatchParameterfv PatchParameterfv} + * + * @see Reference Page + */ + public static void glPatchParameterfv(@NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] values) { + long __functionAddress = GL.getICD().glPatchParameterfv; + if (CHECKS) { + check(__functionAddress); + if (DEBUG) { + check(values, GL11.glGetInteger(GL_PATCH_VERTICES)); + } + } + callPV(pname, values, __functionAddress); + } + + /** + * Array version of: {@link #glDeleteTransformFeedbacks DeleteTransformFeedbacks} + * + * @see Reference Page + */ + public static void glDeleteTransformFeedbacks(@NativeType("GLuint const *") int[] ids) { + long __functionAddress = GL.getICD().glDeleteTransformFeedbacks; + if (CHECKS) { + check(__functionAddress); + } + callPV(ids.length, ids, __functionAddress); + } + + /** + * Array version of: {@link #glGenTransformFeedbacks GenTransformFeedbacks} + * + * @see Reference Page + */ + public static void glGenTransformFeedbacks(@NativeType("GLuint *") int[] ids) { + long __functionAddress = GL.getICD().glGenTransformFeedbacks; + if (CHECKS) { + check(__functionAddress); + } + callPV(ids.length, ids, __functionAddress); + } + + /** + * Array version of: {@link #glGetQueryIndexediv GetQueryIndexediv} + * + * @see Reference Page + */ + public static void glGetQueryIndexediv(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetQueryIndexediv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, index, pname, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL41.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL41.java new file mode 100644 index 00000000..c758fb30 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL41.java @@ -0,0 +1,2653 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * The OpenGL functionality up to version 4.1. Includes the deprecated symbols of the Compatibility Profile. + * + *

OpenGL 4.1 implementations support revision 4.10 of the OpenGL Shading Language.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL41 extends GL40 { + + /** Accepted by the {@code value} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int + GL_SHADER_COMPILER = 0x8DFA, + GL_SHADER_BINARY_FORMATS = 0x8DF8, + GL_NUM_SHADER_BINARY_FORMATS = 0x8DF9, + GL_MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB, + GL_MAX_VARYING_VECTORS = 0x8DFC, + GL_MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD, + GL_IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A, + GL_IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B; + + /** Accepted by the {@code type} parameter of VertexAttribPointer. */ + public static final int GL_FIXED = 0x140C; + + /** Accepted by the {@code precisiontype} parameter of GetShaderPrecisionFormat. */ + public static final int + GL_LOW_FLOAT = 0x8DF0, + GL_MEDIUM_FLOAT = 0x8DF1, + GL_HIGH_FLOAT = 0x8DF2, + GL_LOW_INT = 0x8DF3, + GL_MEDIUM_INT = 0x8DF4, + GL_HIGH_INT = 0x8DF5; + + /** Accepted by the {@code format} parameter of most commands taking sized internal formats. */ + public static final int GL_RGB565 = 0x8D62; + + /** Accepted by the {@code pname} parameter of ProgramParameteri and GetProgramiv. */ + public static final int GL_PROGRAM_BINARY_RETRIEVABLE_HINT = 0x8257; + + /** Accepted by the {@code pname} parameter of GetProgramiv. */ + public static final int GL_PROGRAM_BINARY_LENGTH = 0x8741; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv and GetDoublev. */ + public static final int + GL_NUM_PROGRAM_BINARY_FORMATS = 0x87FE, + GL_PROGRAM_BINARY_FORMATS = 0x87FF; + + /** Accepted by {@code stages} parameter to UseProgramStages. */ + public static final int + GL_VERTEX_SHADER_BIT = 0x1, + GL_FRAGMENT_SHADER_BIT = 0x2, + GL_GEOMETRY_SHADER_BIT = 0x4, + GL_TESS_CONTROL_SHADER_BIT = 0x8, + GL_TESS_EVALUATION_SHADER_BIT = 0x10, + GL_ALL_SHADER_BITS = 0xFFFFFFFF; + + /** Accepted by the {@code pname} parameter of ProgramParameteri and GetProgramiv. */ + public static final int GL_PROGRAM_SEPARABLE = 0x8258; + + /** Accepted by {@code type} parameter to GetProgramPipelineiv. */ + public static final int GL_ACTIVE_PROGRAM = 0x8259; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int GL_PROGRAM_PIPELINE_BINDING = 0x825A; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v. */ + public static final int + GL_MAX_VIEWPORTS = 0x825B, + GL_VIEWPORT_SUBPIXEL_BITS = 0x825C, + GL_VIEWPORT_BOUNDS_RANGE = 0x825D, + GL_LAYER_PROVOKING_VERTEX = 0x825E, + GL_VIEWPORT_INDEX_PROVOKING_VERTEX = 0x825F; + + /** Returned in the {@code data} parameter from a Get query with a {@code pname} of LAYER_PROVOKING_VERTEX or VIEWPORT_INDEX_PROVOKING_VERTEX. */ + public static final int GL_UNDEFINED_VERTEX = 0x8260; + + static { GL.initialize(); } + + protected GL41() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glReleaseShaderCompiler, caps.glShaderBinary, caps.glGetShaderPrecisionFormat, caps.glDepthRangef, caps.glClearDepthf, caps.glGetProgramBinary, + caps.glProgramBinary, caps.glProgramParameteri, caps.glUseProgramStages, caps.glActiveShaderProgram, caps.glCreateShaderProgramv, + caps.glBindProgramPipeline, caps.glDeleteProgramPipelines, caps.glGenProgramPipelines, caps.glIsProgramPipeline, caps.glGetProgramPipelineiv, + caps.glProgramUniform1i, caps.glProgramUniform2i, caps.glProgramUniform3i, caps.glProgramUniform4i, caps.glProgramUniform1ui, + caps.glProgramUniform2ui, caps.glProgramUniform3ui, caps.glProgramUniform4ui, caps.glProgramUniform1f, caps.glProgramUniform2f, + caps.glProgramUniform3f, caps.glProgramUniform4f, caps.glProgramUniform1d, caps.glProgramUniform2d, caps.glProgramUniform3d, + caps.glProgramUniform4d, caps.glProgramUniform1iv, caps.glProgramUniform2iv, caps.glProgramUniform3iv, caps.glProgramUniform4iv, + caps.glProgramUniform1uiv, caps.glProgramUniform2uiv, caps.glProgramUniform3uiv, caps.glProgramUniform4uiv, caps.glProgramUniform1fv, + caps.glProgramUniform2fv, caps.glProgramUniform3fv, caps.glProgramUniform4fv, caps.glProgramUniform1dv, caps.glProgramUniform2dv, + caps.glProgramUniform3dv, caps.glProgramUniform4dv, caps.glProgramUniformMatrix2fv, caps.glProgramUniformMatrix3fv, caps.glProgramUniformMatrix4fv, + caps.glProgramUniformMatrix2dv, caps.glProgramUniformMatrix3dv, caps.glProgramUniformMatrix4dv, caps.glProgramUniformMatrix2x3fv, + caps.glProgramUniformMatrix3x2fv, caps.glProgramUniformMatrix2x4fv, caps.glProgramUniformMatrix4x2fv, caps.glProgramUniformMatrix3x4fv, + caps.glProgramUniformMatrix4x3fv, caps.glProgramUniformMatrix2x3dv, caps.glProgramUniformMatrix3x2dv, caps.glProgramUniformMatrix2x4dv, + caps.glProgramUniformMatrix4x2dv, caps.glProgramUniformMatrix3x4dv, caps.glProgramUniformMatrix4x3dv, caps.glValidateProgramPipeline, + caps.glGetProgramPipelineInfoLog, caps.glVertexAttribL1d, caps.glVertexAttribL2d, caps.glVertexAttribL3d, caps.glVertexAttribL4d, + caps.glVertexAttribL1dv, caps.glVertexAttribL2dv, caps.glVertexAttribL3dv, caps.glVertexAttribL4dv, caps.glVertexAttribLPointer, + caps.glGetVertexAttribLdv, caps.glViewportArrayv, caps.glViewportIndexedf, caps.glViewportIndexedfv, caps.glScissorArrayv, caps.glScissorIndexed, + caps.glScissorIndexedv, caps.glDepthRangeArrayv, caps.glDepthRangeIndexed, caps.glGetFloati_v, caps.glGetDoublei_v + ); + } + + // --- [ glReleaseShaderCompiler ] --- + + /** + * Releases resources allocated by the shader compiler. This is a hint from the application, and does not prevent later use of the shader compiler. + * + * @see Reference Page + */ + public static void glReleaseShaderCompiler() { + GL41C.glReleaseShaderCompiler(); + } + + // --- [ glShaderBinary ] --- + + /** + * Unsafe version of: {@link #glShaderBinary ShaderBinary} + * + * @param count the number of shader object handles contained in {@code shaders} + * @param length the length of the array whose address is given in binary + */ + public static void nglShaderBinary(int count, long shaders, int binaryformat, long binary, int length) { + GL41C.nglShaderBinary(count, shaders, binaryformat, binary, length); + } + + /** + * Loads pre-compiled shader binaries. + * + * @param shaders an array of shader handles into which to load pre-compiled shader binaries + * @param binaryformat the format of the shader binaries contained in {@code binary} + * @param binary an array of bytes containing pre-compiled binary shader code + * + * @see Reference Page + */ + public static void glShaderBinary(@NativeType("GLuint const *") IntBuffer shaders, @NativeType("GLenum") int binaryformat, @NativeType("void const *") ByteBuffer binary) { + GL41C.glShaderBinary(shaders, binaryformat, binary); + } + + // --- [ glGetShaderPrecisionFormat ] --- + + /** Unsafe version of: {@link #glGetShaderPrecisionFormat GetShaderPrecisionFormat} */ + public static void nglGetShaderPrecisionFormat(int shadertype, int precisiontype, long range, long precision) { + GL41C.nglGetShaderPrecisionFormat(shadertype, precisiontype, range, precision); + } + + /** + * Retrieves the range and precision for numeric formats supported by the shader compiler. + * + * @param shadertype the type of shader whose precision to query. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}
+ * @param precisiontype the numeric format whose precision and range to query + * @param range the address of array of two integers into which encodings of the implementation's numeric range are returned + * @param precision the address of an integer into which the numeric precision of the implementation is written + * + * @see Reference Page + */ + public static void glGetShaderPrecisionFormat(@NativeType("GLenum") int shadertype, @NativeType("GLenum") int precisiontype, @NativeType("GLint *") IntBuffer range, @NativeType("GLint *") IntBuffer precision) { + GL41C.glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision); + } + + /** + * Retrieves the range and precision for numeric formats supported by the shader compiler. + * + * @param shadertype the type of shader whose precision to query. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}
+ * @param precisiontype the numeric format whose precision and range to query + * @param range the address of array of two integers into which encodings of the implementation's numeric range are returned + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetShaderPrecisionFormat(@NativeType("GLenum") int shadertype, @NativeType("GLenum") int precisiontype, @NativeType("GLint *") IntBuffer range) { + return GL41C.glGetShaderPrecisionFormat(shadertype, precisiontype, range); + } + + // --- [ glDepthRangef ] --- + + /** + * Specifies mapping of depth values from normalized device coordinates to window coordinates + * + * @param zNear the mapping of the near clipping plane to window coordinates. The initial value is 0.0f. + * @param zFar the mapping of the far clipping plane to window coordinates. The initial value is 1.0f. + * + * @see Reference Page + */ + public static void glDepthRangef(@NativeType("GLfloat") float zNear, @NativeType("GLfloat") float zFar) { + GL41C.glDepthRangef(zNear, zFar); + } + + // --- [ glClearDepthf ] --- + + /** + * Specifies the clear value for the depth buffer + * + * @param depth the depth value used when the depth buffer is cleared. The initial value is 1.0f. + * + * @see Reference Page + */ + public static void glClearDepthf(@NativeType("GLfloat") float depth) { + GL41C.glClearDepthf(depth); + } + + // --- [ glGetProgramBinary ] --- + + /** + * Unsafe version of: {@link #glGetProgramBinary GetProgramBinary} + * + * @param bufSize the size of the buffer whose address is given by {@code binary} + */ + public static void nglGetProgramBinary(int program, int bufSize, long length, long binaryFormat, long binary) { + GL41C.nglGetProgramBinary(program, bufSize, length, binaryFormat, binary); + } + + /** + * Returns a binary representation of a program object's compiled and linked executable source. + * + * @param program the name of a program object whose binary representation to retrieve + * @param length the address of a variable to receive the number of bytes written into {@code binary} + * @param binaryFormat a variable to receive a token indicating the format of the binary data returned by the GL + * @param binary an array into which the GL will return {@code program}'s binary representation + * + * @see Reference Page + */ + public static void glGetProgramBinary(@NativeType("GLuint") int program, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLenum *") IntBuffer binaryFormat, @NativeType("void *") ByteBuffer binary) { + GL41C.glGetProgramBinary(program, length, binaryFormat, binary); + } + + // --- [ glProgramBinary ] --- + + /** + * Unsafe version of: {@link #glProgramBinary ProgramBinary} + * + * @param length the number of bytes contained in {@code binary} + */ + public static void nglProgramBinary(int program, int binaryFormat, long binary, int length) { + GL41C.nglProgramBinary(program, binaryFormat, binary, length); + } + + /** + * Loads a program object with a program binary. + * + * @param program the name of a program object into which to load a program binary + * @param binaryFormat the format of the binary data in binary + * @param binary an array containing the binary to be loaded into {@code program} + * + * @see Reference Page + */ + public static void glProgramBinary(@NativeType("GLuint") int program, @NativeType("GLenum") int binaryFormat, @NativeType("void const *") ByteBuffer binary) { + GL41C.glProgramBinary(program, binaryFormat, binary); + } + + // --- [ glProgramParameteri ] --- + + /** + * Specifies the integer value of a program object parameter. + * + * @param program the name of a program object whose parameter to modify + * @param pname the name of the parameter to modify. One of:
{@link GL41C#GL_PROGRAM_BINARY_RETRIEVABLE_HINT PROGRAM_BINARY_RETRIEVABLE_HINT}{@link GL41C#GL_PROGRAM_SEPARABLE PROGRAM_SEPARABLE}
+ * @param value the new value of the parameter specified by {@code pname} for {@code program} + * + * @see Reference Page + */ + public static void glProgramParameteri(@NativeType("GLuint") int program, @NativeType("GLenum") int pname, @NativeType("GLint") int value) { + GL41C.glProgramParameteri(program, pname, value); + } + + // --- [ glUseProgramStages ] --- + + /** + * Binds stages of a program object to a program pipeline. + * + * @param pipeline the program pipeline object to which to bind stages from {@code program} + * @param stages a set of program stages to bind to the program pipeline object + * @param program the program object containing the shader executables to use in {@code pipeline} + * + * @see Reference Page + */ + public static void glUseProgramStages(@NativeType("GLuint") int pipeline, @NativeType("GLbitfield") int stages, @NativeType("GLuint") int program) { + GL41C.glUseProgramStages(pipeline, stages, program); + } + + // --- [ glActiveShaderProgram ] --- + + /** + * Sets the active program object for a program pipeline object. + * + * @param pipeline the program pipeline object to set the active program object for + * @param program the program object to set as the active program pipeline object {@code pipeline} + * + * @see Reference Page + */ + public static void glActiveShaderProgram(@NativeType("GLuint") int pipeline, @NativeType("GLuint") int program) { + GL41C.glActiveShaderProgram(pipeline, program); + } + + // --- [ glCreateShaderProgramv ] --- + + /** + * Unsafe version of: {@link #glCreateShaderProgramv CreateShaderProgramv} + * + * @param count the number of source code strings in the array {@code strings} + */ + public static int nglCreateShaderProgramv(int type, int count, long strings) { + return GL41C.nglCreateShaderProgramv(type, count, strings); + } + + /** + * Creates a stand-alone program from an array of null-terminated source code strings. + * + *

{@code glCreateShaderProgram} is equivalent (assuming no errors are generated) to:

+ * + *

+     * const GLuint shader = glCreateShader(type);
+     * if (shader) {
+     *     glShaderSource(shader, count, strings, NULL);
+     *     glCompileShader(shader);
+     *     const GLuint program = glCreateProgram();
+     *     if (program) {
+     *         GLint compiled = GL_FALSE;
+     *         glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
+     *         glProgramParameteri(program, GL_PROGRAM_SEPARABLE, GL_TRUE);
+     *         if (compiled) {
+     *             glAttachShader(program, shader);
+     *             glLinkProgram(program);
+     *             glDetachShader(program, shader);
+     *         }
+     *         // append-shader-info-log-to-program-info-log
+     *     }
+     *     glDeleteShader(shader);
+     *     return program;
+     * } else {
+     *     return 0;
+     * }
+ * + *

The program object created by glCreateShaderProgram has its GL_PROGRAM_SEPARABLE status set to GL_TRUE.

+ * + * @param type the type of shader to create + * @param strings an array of pointers to source code strings from which to create the program object + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glCreateShaderProgramv(@NativeType("GLenum") int type, @NativeType("GLchar const **") PointerBuffer strings) { + return GL41C.glCreateShaderProgramv(type, strings); + } + + /** + * Creates a stand-alone program from an array of null-terminated source code strings. + * + *

{@code glCreateShaderProgram} is equivalent (assuming no errors are generated) to:

+ * + *

+     * const GLuint shader = glCreateShader(type);
+     * if (shader) {
+     *     glShaderSource(shader, count, strings, NULL);
+     *     glCompileShader(shader);
+     *     const GLuint program = glCreateProgram();
+     *     if (program) {
+     *         GLint compiled = GL_FALSE;
+     *         glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
+     *         glProgramParameteri(program, GL_PROGRAM_SEPARABLE, GL_TRUE);
+     *         if (compiled) {
+     *             glAttachShader(program, shader);
+     *             glLinkProgram(program);
+     *             glDetachShader(program, shader);
+     *         }
+     *         // append-shader-info-log-to-program-info-log
+     *     }
+     *     glDeleteShader(shader);
+     *     return program;
+     * } else {
+     *     return 0;
+     * }
+ * + *

The program object created by glCreateShaderProgram has its GL_PROGRAM_SEPARABLE status set to GL_TRUE.

+ * + * @param type the type of shader to create + * @param strings an array of pointers to source code strings from which to create the program object + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glCreateShaderProgramv(@NativeType("GLenum") int type, @NativeType("GLchar const **") CharSequence... strings) { + return GL41C.glCreateShaderProgramv(type, strings); + } + + /** + * Creates a stand-alone program from an array of null-terminated source code strings. + * + *

{@code glCreateShaderProgram} is equivalent (assuming no errors are generated) to:

+ * + *

+     * const GLuint shader = glCreateShader(type);
+     * if (shader) {
+     *     glShaderSource(shader, count, strings, NULL);
+     *     glCompileShader(shader);
+     *     const GLuint program = glCreateProgram();
+     *     if (program) {
+     *         GLint compiled = GL_FALSE;
+     *         glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
+     *         glProgramParameteri(program, GL_PROGRAM_SEPARABLE, GL_TRUE);
+     *         if (compiled) {
+     *             glAttachShader(program, shader);
+     *             glLinkProgram(program);
+     *             glDetachShader(program, shader);
+     *         }
+     *         // append-shader-info-log-to-program-info-log
+     *     }
+     *     glDeleteShader(shader);
+     *     return program;
+     * } else {
+     *     return 0;
+     * }
+ * + *

The program object created by glCreateShaderProgram has its GL_PROGRAM_SEPARABLE status set to GL_TRUE.

+ * + * @param type the type of shader to create + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glCreateShaderProgramv(@NativeType("GLenum") int type, @NativeType("GLchar const **") CharSequence string) { + return GL41C.glCreateShaderProgramv(type, string); + } + + // --- [ glBindProgramPipeline ] --- + + /** + * Binds a program pipeline to the current context. + * + * @param pipeline the name of the pipeline object to bind to the context + * + * @see Reference Page + */ + public static void glBindProgramPipeline(@NativeType("GLuint") int pipeline) { + GL41C.glBindProgramPipeline(pipeline); + } + + // --- [ glDeleteProgramPipelines ] --- + + /** + * Unsafe version of: {@link #glDeleteProgramPipelines DeleteProgramPipelines} + * + * @param n the number of program pipeline objects to delete + */ + public static void nglDeleteProgramPipelines(int n, long pipelines) { + GL41C.nglDeleteProgramPipelines(n, pipelines); + } + + /** + * Deletes program pipeline objects. + * + * @param pipelines an array of names of program pipeline objects to delete + * + * @see Reference Page + */ + public static void glDeleteProgramPipelines(@NativeType("GLuint const *") IntBuffer pipelines) { + GL41C.glDeleteProgramPipelines(pipelines); + } + + /** + * Deletes program pipeline objects. + * + * @see Reference Page + */ + public static void glDeleteProgramPipelines(@NativeType("GLuint const *") int pipeline) { + GL41C.glDeleteProgramPipelines(pipeline); + } + + // --- [ glGenProgramPipelines ] --- + + /** + * Unsafe version of: {@link #glGenProgramPipelines GenProgramPipelines} + * + * @param n the number of program pipeline object names to reserve + */ + public static void nglGenProgramPipelines(int n, long pipelines) { + GL41C.nglGenProgramPipelines(n, pipelines); + } + + /** + * Reserves program pipeline object names. + * + * @param pipelines an array of into which the reserved names will be written + * + * @see Reference Page + */ + public static void glGenProgramPipelines(@NativeType("GLuint *") IntBuffer pipelines) { + GL41C.glGenProgramPipelines(pipelines); + } + + /** + * Reserves program pipeline object names. + * + * @see Reference Page + */ + @NativeType("void") + public static int glGenProgramPipelines() { + return GL41C.glGenProgramPipelines(); + } + + // --- [ glIsProgramPipeline ] --- + + /** + * Determines if a name corresponds to a program pipeline object. + * + * @param pipeline a value that may be the name of a program pipeline object + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static boolean glIsProgramPipeline(@NativeType("GLuint") int pipeline) { + return GL41C.glIsProgramPipeline(pipeline); + } + + // --- [ glGetProgramPipelineiv ] --- + + /** Unsafe version of: {@link #glGetProgramPipelineiv GetProgramPipelineiv} */ + public static void nglGetProgramPipelineiv(int pipeline, int pname, long params) { + GL41C.nglGetProgramPipelineiv(pipeline, pname, params); + } + + /** + * Retrieves properties of a program pipeline object. + * + * @param pipeline the name of a program pipeline object whose parameter retrieve + * @param pname the name of the parameter to retrieve. One of:
{@link GL41C#GL_ACTIVE_PROGRAM ACTIVE_PROGRAM}{@link GL20#GL_INFO_LOG_LENGTH INFO_LOG_LENGTH}{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}
{@link GL40#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}{@link GL40#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param params a variable into which will be written the value or values of {@code pname} for {@code pipeline} + * + * @see Reference Page + */ + public static void glGetProgramPipelineiv(@NativeType("GLuint") int pipeline, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL41C.glGetProgramPipelineiv(pipeline, pname, params); + } + + /** + * Retrieves properties of a program pipeline object. + * + * @param pipeline the name of a program pipeline object whose parameter retrieve + * @param pname the name of the parameter to retrieve. One of:
{@link GL41C#GL_ACTIVE_PROGRAM ACTIVE_PROGRAM}{@link GL20#GL_INFO_LOG_LENGTH INFO_LOG_LENGTH}{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}
{@link GL40#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}{@link GL40#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetProgramPipelinei(@NativeType("GLuint") int pipeline, @NativeType("GLenum") int pname) { + return GL41C.glGetProgramPipelinei(pipeline, pname); + } + + // --- [ glProgramUniform1i ] --- + + /** + * Specifies the value of an int uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * + * @see Reference Page + */ + public static void glProgramUniform1i(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint") int x) { + GL41C.glProgramUniform1i(program, location, x); + } + + // --- [ glProgramUniform2i ] --- + + /** + * Specifies the value of an ivec2 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * + * @see Reference Page + */ + public static void glProgramUniform2i(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint") int x, @NativeType("GLint") int y) { + GL41C.glProgramUniform2i(program, location, x, y); + } + + // --- [ glProgramUniform3i ] --- + + /** + * Specifies the value of an ivec3 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * + * @see Reference Page + */ + public static void glProgramUniform3i(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z) { + GL41C.glProgramUniform3i(program, location, x, y, z); + } + + // --- [ glProgramUniform4i ] --- + + /** + * Specifies the value of an ivec4 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * @param w the uniform w value + * + * @see Reference Page + */ + public static void glProgramUniform4i(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z, @NativeType("GLint") int w) { + GL41C.glProgramUniform4i(program, location, x, y, z, w); + } + + // --- [ glProgramUniform1ui ] --- + + /** + * Specifies the value of a uint uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * + * @see Reference Page + */ + public static void glProgramUniform1ui(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint") int x) { + GL41C.glProgramUniform1ui(program, location, x); + } + + // --- [ glProgramUniform2ui ] --- + + /** + * Specifies the value of a uvec2 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * + * @see Reference Page + */ + public static void glProgramUniform2ui(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint") int x, @NativeType("GLuint") int y) { + GL41C.glProgramUniform2ui(program, location, x, y); + } + + // --- [ glProgramUniform3ui ] --- + + /** + * Specifies the value of a uvec3 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * + * @see Reference Page + */ + public static void glProgramUniform3ui(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint") int x, @NativeType("GLuint") int y, @NativeType("GLuint") int z) { + GL41C.glProgramUniform3ui(program, location, x, y, z); + } + + // --- [ glProgramUniform4ui ] --- + + /** + * Specifies the value of a uvec4 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * @param w the uniform w value + * + * @see Reference Page + */ + public static void glProgramUniform4ui(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint") int x, @NativeType("GLuint") int y, @NativeType("GLuint") int z, @NativeType("GLuint") int w) { + GL41C.glProgramUniform4ui(program, location, x, y, z, w); + } + + // --- [ glProgramUniform1f ] --- + + /** + * Specifies the value of a float uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * + * @see Reference Page + */ + public static void glProgramUniform1f(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat") float x) { + GL41C.glProgramUniform1f(program, location, x); + } + + // --- [ glProgramUniform2f ] --- + + /** + * Specifies the value of a vec2 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * + * @see Reference Page + */ + public static void glProgramUniform2f(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat") float x, @NativeType("GLfloat") float y) { + GL41C.glProgramUniform2f(program, location, x, y); + } + + // --- [ glProgramUniform3f ] --- + + /** + * Specifies the value of a vec3 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * + * @see Reference Page + */ + public static void glProgramUniform3f(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z) { + GL41C.glProgramUniform3f(program, location, x, y, z); + } + + // --- [ glProgramUniform4f ] --- + + /** + * Specifies the value of a vec4 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * @param w the uniform w value + * + * @see Reference Page + */ + public static void glProgramUniform4f(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z, @NativeType("GLfloat") float w) { + GL41C.glProgramUniform4f(program, location, x, y, z, w); + } + + // --- [ glProgramUniform1d ] --- + + /** + * Specifies the value of a double uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * + * @see Reference Page + */ + public static void glProgramUniform1d(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble") double x) { + GL41C.glProgramUniform1d(program, location, x); + } + + // --- [ glProgramUniform2d ] --- + + /** + * Specifies the value of a dvec2 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * + * @see Reference Page + */ + public static void glProgramUniform2d(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y) { + GL41C.glProgramUniform2d(program, location, x, y); + } + + // --- [ glProgramUniform3d ] --- + + /** + * Specifies the value of a dvec3 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * + * @see Reference Page + */ + public static void glProgramUniform3d(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z) { + GL41C.glProgramUniform3d(program, location, x, y, z); + } + + // --- [ glProgramUniform4d ] --- + + /** + * Specifies the value of a dvec4 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * @param w the uniform w value + * + * @see Reference Page + */ + public static void glProgramUniform4d(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z, @NativeType("GLdouble") double w) { + GL41C.glProgramUniform4d(program, location, x, y, z, w); + } + + // --- [ glProgramUniform1iv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform1iv ProgramUniform1iv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform1iv(int program, int location, int count, long value) { + GL41C.nglProgramUniform1iv(program, location, count, value); + } + + /** + * Specifies the value of a single float uniform variable or a float uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform1iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + GL41C.glProgramUniform1iv(program, location, value); + } + + // --- [ glProgramUniform2iv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform2iv ProgramUniform2iv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform2iv(int program, int location, int count, long value) { + GL41C.nglProgramUniform2iv(program, location, count, value); + } + + /** + * Specifies the value of a single ivec2 uniform variable or an ivec2 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform2iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + GL41C.glProgramUniform2iv(program, location, value); + } + + // --- [ glProgramUniform3iv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform3iv ProgramUniform3iv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform3iv(int program, int location, int count, long value) { + GL41C.nglProgramUniform3iv(program, location, count, value); + } + + /** + * Specifies the value of a single ivec3 uniform variable or an ivec3 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform3iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + GL41C.glProgramUniform3iv(program, location, value); + } + + // --- [ glProgramUniform4iv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform4iv ProgramUniform4iv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform4iv(int program, int location, int count, long value) { + GL41C.nglProgramUniform4iv(program, location, count, value); + } + + /** + * Specifies the value of a single ivec4 uniform variable or an ivec4 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform4iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + GL41C.glProgramUniform4iv(program, location, value); + } + + // --- [ glProgramUniform1uiv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform1uiv ProgramUniform1uiv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform1uiv(int program, int location, int count, long value) { + GL41C.nglProgramUniform1uiv(program, location, count, value); + } + + /** + * Specifies the value of a single uint uniform variable or a uint uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform1uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + GL41C.glProgramUniform1uiv(program, location, value); + } + + // --- [ glProgramUniform2uiv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform2uiv ProgramUniform2uiv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform2uiv(int program, int location, int count, long value) { + GL41C.nglProgramUniform2uiv(program, location, count, value); + } + + /** + * Specifies the value of a single uvec2 uniform variable or a uvec2 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform2uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + GL41C.glProgramUniform2uiv(program, location, value); + } + + // --- [ glProgramUniform3uiv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform3uiv ProgramUniform3uiv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform3uiv(int program, int location, int count, long value) { + GL41C.nglProgramUniform3uiv(program, location, count, value); + } + + /** + * Specifies the value of a single uvec3 uniform variable or a uvec3 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform3uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + GL41C.glProgramUniform3uiv(program, location, value); + } + + // --- [ glProgramUniform4uiv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform4uiv ProgramUniform4uiv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform4uiv(int program, int location, int count, long value) { + GL41C.nglProgramUniform4uiv(program, location, count, value); + } + + /** + * Specifies the value of a single uvec4 uniform variable or a uvec4 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform4uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + GL41C.glProgramUniform4uiv(program, location, value); + } + + // --- [ glProgramUniform1fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform1fv ProgramUniform1fv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform1fv(int program, int location, int count, long value) { + GL41C.nglProgramUniform1fv(program, location, count, value); + } + + /** + * Specifies the value of a single float uniform variable or a float uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform1fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniform1fv(program, location, value); + } + + // --- [ glProgramUniform2fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform2fv ProgramUniform2fv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform2fv(int program, int location, int count, long value) { + GL41C.nglProgramUniform2fv(program, location, count, value); + } + + /** + * Specifies the value of a single vec2 uniform variable or a vec2 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniform2fv(program, location, value); + } + + // --- [ glProgramUniform3fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform3fv ProgramUniform3fv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform3fv(int program, int location, int count, long value) { + GL41C.nglProgramUniform3fv(program, location, count, value); + } + + /** + * Specifies the value of a single vec3 uniform variable or a vec3 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniform3fv(program, location, value); + } + + // --- [ glProgramUniform4fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform4fv ProgramUniform4fv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform4fv(int program, int location, int count, long value) { + GL41C.nglProgramUniform4fv(program, location, count, value); + } + + /** + * Specifies the value of a single vec4 uniform variable or a vec4 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniform4fv(program, location, value); + } + + // --- [ glProgramUniform1dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform1dv ProgramUniform1dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform1dv(int program, int location, int count, long value) { + GL41C.nglProgramUniform1dv(program, location, count, value); + } + + /** + * Specifies the value of a single double uniform variable or a double uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform1dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniform1dv(program, location, value); + } + + // --- [ glProgramUniform2dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform2dv ProgramUniform2dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform2dv(int program, int location, int count, long value) { + GL41C.nglProgramUniform2dv(program, location, count, value); + } + + /** + * Specifies the value of a single dvec2 uniform variable or a dvec2 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniform2dv(program, location, value); + } + + // --- [ glProgramUniform3dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform3dv ProgramUniform3dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform3dv(int program, int location, int count, long value) { + GL41C.nglProgramUniform3dv(program, location, count, value); + } + + /** + * Specifies the value of a single dvec3 uniform variable or a dvec3 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniform3dv(program, location, value); + } + + // --- [ glProgramUniform4dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform4dv ProgramUniform4dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static void nglProgramUniform4dv(int program, int location, int count, long value) { + GL41C.nglProgramUniform4dv(program, location, count, value); + } + + /** + * Specifies the value of a single dvec4 uniform variable or a dvec4 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniform4dv(program, location, value); + } + + // --- [ glProgramUniformMatrix2fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix2fv ProgramUniformMatrix2fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix2fv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix2fv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single mat2 uniform variable or a mat2 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniformMatrix2fv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix3fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix3fv ProgramUniformMatrix3fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix3fv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix3fv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single mat3 uniform variable or a mat3 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniformMatrix3fv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix4fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix4fv ProgramUniformMatrix4fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix4fv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix4fv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single mat4 uniform variable or a mat4 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniformMatrix4fv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix2dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix2dv ProgramUniformMatrix2dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix2dv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix2dv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat2 uniform variable or a dmat2 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniformMatrix2dv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix3dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix3dv ProgramUniformMatrix3dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix3dv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix3dv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat3 uniform variable or a dmat3 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniformMatrix3dv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix4dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix4dv ProgramUniformMatrix4dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix4dv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix4dv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat4 uniform variable or a dmat4 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniformMatrix4dv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix2x3fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix2x3fv ProgramUniformMatrix2x3fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix2x3fv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix2x3fv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single mat2x3 uniform variable or a mat2x3 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2x3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniformMatrix2x3fv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix3x2fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix3x2fv ProgramUniformMatrix3x2fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix3x2fv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix3x2fv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single mat3x2 uniform variable or a mat3x2 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3x2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniformMatrix3x2fv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix2x4fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix2x4fv ProgramUniformMatrix2x4fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix2x4fv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix2x4fv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single mat2x4 uniform variable or a mat2x4 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2x4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniformMatrix2x4fv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix4x2fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix4x2fv ProgramUniformMatrix4x2fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix4x2fv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix4x2fv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single mat4x2 uniform variable or a mat4x2 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4x2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniformMatrix4x2fv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix3x4fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix3x4fv ProgramUniformMatrix3x4fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix3x4fv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix3x4fv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single mat3x4 uniform variable or a mat3x4 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3x4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniformMatrix3x4fv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix4x3fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix4x3fv ProgramUniformMatrix4x3fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix4x3fv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix4x3fv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single mat4x3 uniform variable or a mat4x3 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4x3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + GL41C.glProgramUniformMatrix4x3fv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix2x3dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix2x3dv ProgramUniformMatrix2x3dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix2x3dv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix2x3dv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat2x3 uniform variable or a dmat2x3 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2x3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniformMatrix2x3dv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix3x2dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix3x2dv ProgramUniformMatrix3x2dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix3x2dv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix3x2dv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat3x2 uniform variable or a dmat3x2 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3x2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniformMatrix3x2dv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix2x4dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix2x4dv ProgramUniformMatrix2x4dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix2x4dv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix2x4dv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat2x4 uniform variable or a dmat2x4 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2x4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniformMatrix2x4dv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix4x2dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix4x2dv ProgramUniformMatrix4x2dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix4x2dv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix4x2dv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat4x2 uniform variable or a dmat4x2 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4x2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniformMatrix4x2dv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix3x4dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix3x4dv ProgramUniformMatrix3x4dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix3x4dv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix3x4dv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat3x4 uniform variable or a dmat3x4 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3x4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniformMatrix3x4dv(program, location, transpose, value); + } + + // --- [ glProgramUniformMatrix4x3dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix4x3dv ProgramUniformMatrix4x3dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static void nglProgramUniformMatrix4x3dv(int program, int location, int count, boolean transpose, long value) { + GL41C.nglProgramUniformMatrix4x3dv(program, location, count, transpose, value); + } + + /** + * Specifies the value of a single dmat4x3 uniform variable or a dmat4x3 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4x3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + GL41C.glProgramUniformMatrix4x3dv(program, location, transpose, value); + } + + // --- [ glValidateProgramPipeline ] --- + + /** + * Validates a program pipeline object against current GL state. + * + * @param pipeline the name of a program pipeline object to validate + * + * @see Reference Page + */ + public static void glValidateProgramPipeline(@NativeType("GLuint") int pipeline) { + GL41C.glValidateProgramPipeline(pipeline); + } + + // --- [ glGetProgramPipelineInfoLog ] --- + + /** + * Unsafe version of: {@link #glGetProgramPipelineInfoLog GetProgramPipelineInfoLog} + * + * @param bufSize the maximum number of characters, including the null terminator, that may be written into {@code infoLog} + */ + public static void nglGetProgramPipelineInfoLog(int pipeline, int bufSize, long length, long infoLog) { + GL41C.nglGetProgramPipelineInfoLog(pipeline, bufSize, length, infoLog); + } + + /** + * Retrieves the info log string from a program pipeline object. + * + * @param pipeline the name of a program pipeline object from which to retrieve the info log + * @param length a variable into which will be written the number of characters written into {@code infoLog} + * @param infoLog an array of characters into which will be written the info log for {@code pipeline} + * + * @see Reference Page + */ + public static void glGetProgramPipelineInfoLog(@NativeType("GLuint") int pipeline, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer infoLog) { + GL41C.glGetProgramPipelineInfoLog(pipeline, length, infoLog); + } + + /** + * Retrieves the info log string from a program pipeline object. + * + * @param pipeline the name of a program pipeline object from which to retrieve the info log + * @param bufSize the maximum number of characters, including the null terminator, that may be written into {@code infoLog} + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetProgramPipelineInfoLog(@NativeType("GLuint") int pipeline, @NativeType("GLsizei") int bufSize) { + return GL41C.glGetProgramPipelineInfoLog(pipeline, bufSize); + } + + /** + * Retrieves the info log string from a program pipeline object. + * + * @param pipeline the name of a program pipeline object from which to retrieve the info log + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetProgramPipelineInfoLog(@NativeType("GLuint") int pipeline) { + return glGetProgramPipelineInfoLog(pipeline, glGetProgramPipelinei(pipeline, GL20.GL_INFO_LOG_LENGTH)); + } + + // --- [ glVertexAttribL1d ] --- + + /** + * Specifies the value of a generic vertex attribute. The y and z components are implicitly set to 0.0 and w to 1.0. + * + * @param index the index of the generic vertex attribute to be modified + * @param x the vertex attribute x component + * + * @see Reference Page + */ + public static void glVertexAttribL1d(@NativeType("GLuint") int index, @NativeType("GLdouble") double x) { + GL41C.glVertexAttribL1d(index, x); + } + + // --- [ glVertexAttribL2d ] --- + + /** + * Specifies the value of a generic vertex attribute. The y component is implicitly set to 0.0 and w to 1.0. + * + * @param index the index of the generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * + * @see Reference Page + */ + public static void glVertexAttribL2d(@NativeType("GLuint") int index, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y) { + GL41C.glVertexAttribL2d(index, x, y); + } + + // --- [ glVertexAttribL3d ] --- + + /** + * Specifies the value of a generic vertex attribute. The w is implicitly set to 1.0. + * + * @param index the index of the generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * @param z the vertex attribute z component + * + * @see Reference Page + */ + public static void glVertexAttribL3d(@NativeType("GLuint") int index, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z) { + GL41C.glVertexAttribL3d(index, x, y, z); + } + + // --- [ glVertexAttribL4d ] --- + + /** + * Specifies the value of a generic vertex attribute. + * + * @param index the index of the generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * @param z the vertex attribute z component + * @param w the vertex attribute w component + * + * @see Reference Page + */ + public static void glVertexAttribL4d(@NativeType("GLuint") int index, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z, @NativeType("GLdouble") double w) { + GL41C.glVertexAttribL4d(index, x, y, z, w); + } + + // --- [ glVertexAttribL1dv ] --- + + /** Unsafe version of: {@link #glVertexAttribL1dv VertexAttribL1dv} */ + public static void nglVertexAttribL1dv(int index, long v) { + GL41C.nglVertexAttribL1dv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttribL1d VertexAttribL1d}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribL1dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + GL41C.glVertexAttribL1dv(index, v); + } + + // --- [ glVertexAttribL2dv ] --- + + /** Unsafe version of: {@link #glVertexAttribL2dv VertexAttribL2dv} */ + public static void nglVertexAttribL2dv(int index, long v) { + GL41C.nglVertexAttribL2dv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttribL2d VertexAttribL2d}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribL2dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + GL41C.glVertexAttribL2dv(index, v); + } + + // --- [ glVertexAttribL3dv ] --- + + /** Unsafe version of: {@link #glVertexAttribL3dv VertexAttribL3dv} */ + public static void nglVertexAttribL3dv(int index, long v) { + GL41C.nglVertexAttribL3dv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttribL3d VertexAttribL3d}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribL3dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + GL41C.glVertexAttribL3dv(index, v); + } + + // --- [ glVertexAttribL4dv ] --- + + /** Unsafe version of: {@link #glVertexAttribL4dv VertexAttribL4dv} */ + public static void nglVertexAttribL4dv(int index, long v) { + GL41C.nglVertexAttribL4dv(index, v); + } + + /** + * Pointer version of {@link #glVertexAttribL4d VertexAttribL4d}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribL4dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + GL41C.glVertexAttribL4dv(index, v); + } + + // --- [ glVertexAttribLPointer ] --- + + /** + * Unsafe version of: {@link #glVertexAttribLPointer VertexAttribLPointer} + * + * @param type the data type of each component in the array. Must be:
{@link GL11#GL_DOUBLE DOUBLE}
+ */ + public static void nglVertexAttribLPointer(int index, int size, int type, int stride, long pointer) { + GL41C.nglVertexAttribLPointer(index, size, type, stride, pointer); + } + + /** + * Specifies the location and organization of a 64-bit vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. Must be:
{@link GL11#GL_DOUBLE DOUBLE}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribLPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + GL41C.glVertexAttribLPointer(index, size, type, stride, pointer); + } + + /** + * Specifies the location and organization of a 64-bit vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. Must be:
{@link GL11#GL_DOUBLE DOUBLE}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribLPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + GL41C.glVertexAttribLPointer(index, size, type, stride, pointer); + } + + /** + * Specifies the location and organization of a 64-bit vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribLPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLsizei") int stride, @NativeType("void const *") DoubleBuffer pointer) { + GL41C.glVertexAttribLPointer(index, size, stride, pointer); + } + + // --- [ glGetVertexAttribLdv ] --- + + /** Unsafe version of: {@link #glGetVertexAttribLdv GetVertexAttribLdv} */ + public static void nglGetVertexAttribLdv(int index, int pname, long params) { + GL41C.nglGetVertexAttribLdv(index, pname, params); + } + + /** + * Double version of {@link GL20C#glGetVertexAttribiv GetVertexAttribiv}. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the vertex attribute parameter to be queried + * @param params the requested data + * + * @see Reference Page + */ + public static void glGetVertexAttribLdv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLdouble *") DoubleBuffer params) { + GL41C.glGetVertexAttribLdv(index, pname, params); + } + + // --- [ glViewportArrayv ] --- + + /** + * Unsafe version of: {@link #glViewportArrayv ViewportArrayv} + * + * @param count the number of viewports to set + */ + public static void nglViewportArrayv(int first, int count, long v) { + GL41C.nglViewportArrayv(first, count, v); + } + + /** + * Sets multiple viewports. + * + * @param first the first viewport to set + * @param v an array containing the viewport parameters + * + * @see Reference Page + */ + public static void glViewportArrayv(@NativeType("GLuint") int first, @NativeType("GLfloat const *") FloatBuffer v) { + GL41C.glViewportArrayv(first, v); + } + + // --- [ glViewportIndexedf ] --- + + /** + * Sets a specified viewport. + * + * @param index the viewport to set + * @param x the left viewport coordinate + * @param y the bottom viewport coordinate + * @param w the viewport width + * @param h the viewport height + * + * @see Reference Page + */ + public static void glViewportIndexedf(@NativeType("GLuint") int index, @NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float w, @NativeType("GLfloat") float h) { + GL41C.glViewportIndexedf(index, x, y, w, h); + } + + // --- [ glViewportIndexedfv ] --- + + /** Unsafe version of: {@link #glViewportIndexedfv ViewportIndexedfv} */ + public static void nglViewportIndexedfv(int index, long v) { + GL41C.nglViewportIndexedfv(index, v); + } + + /** + * Pointer version of {@link #glViewportIndexedf ViewportIndexedf}. + * + * @param index the viewport to set + * @param v the viewport parameters + * + * @see Reference Page + */ + public static void glViewportIndexedfv(@NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer v) { + GL41C.glViewportIndexedfv(index, v); + } + + // --- [ glScissorArrayv ] --- + + /** + * Unsafe version of: {@link #glScissorArrayv ScissorArrayv} + * + * @param count the number of scissor boxes to modify + */ + public static void nglScissorArrayv(int first, int count, long v) { + GL41C.nglScissorArrayv(first, count, v); + } + + /** + * Defines the scissor box for multiple viewports. + * + * @param first the index of the first viewport whose scissor box to modify + * @param v an array containing the left, bottom, width and height of each scissor box, in that order + * + * @see Reference Page + */ + public static void glScissorArrayv(@NativeType("GLuint") int first, @NativeType("GLint const *") IntBuffer v) { + GL41C.glScissorArrayv(first, v); + } + + // --- [ glScissorIndexed ] --- + + /** + * Defines the scissor box for a specific viewport. + * + * @param index the index of the viewport whose scissor box to modify + * @param left the left scissor box coordinate + * @param bottom the bottom scissor box coordinate + * @param width the scissor box width + * @param height the scissor box height + * + * @see Reference Page + */ + public static void glScissorIndexed(@NativeType("GLuint") int index, @NativeType("GLint") int left, @NativeType("GLint") int bottom, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL41C.glScissorIndexed(index, left, bottom, width, height); + } + + // --- [ glScissorIndexedv ] --- + + /** Unsafe version of: {@link #glScissorIndexedv ScissorIndexedv} */ + public static void nglScissorIndexedv(int index, long v) { + GL41C.nglScissorIndexedv(index, v); + } + + /** + * Pointer version of {@link #glScissorIndexed ScissorIndexed}. + * + * @param index the index of the viewport whose scissor box to modify + * @param v an array containing the left, bottom, width and height of each scissor box, in that order + * + * @see Reference Page + */ + public static void glScissorIndexedv(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + GL41C.glScissorIndexedv(index, v); + } + + // --- [ glDepthRangeArrayv ] --- + + /** + * Unsafe version of: {@link #glDepthRangeArrayv DepthRangeArrayv} + * + * @param count the number of viewports whose depth range to update + */ + public static void nglDepthRangeArrayv(int first, int count, long v) { + GL41C.nglDepthRangeArrayv(first, count, v); + } + + /** + * Specifies mapping of depth values from normalized device coordinates to window coordinates for a specified set of viewports. + * + * @param first the index of the first viewport whose depth range to update + * @param v n array containing the near and far values for the depth range of each modified viewport + * + * @see Reference Page + */ + public static void glDepthRangeArrayv(@NativeType("GLuint") int first, @NativeType("GLdouble const *") DoubleBuffer v) { + GL41C.glDepthRangeArrayv(first, v); + } + + // --- [ glDepthRangeIndexed ] --- + + /** + * Specifies mapping of depth values from normalized device coordinates to window coordinates for a specified viewport. + * + * @param index the index of the viewport whose depth range to update + * @param zNear the mapping of the near clipping plane to window coordinates. The initial value is 0. + * @param zFar the mapping of the far clipping plane to window coordinates. The initial value is 1. + * + * @see Reference Page + */ + public static void glDepthRangeIndexed(@NativeType("GLuint") int index, @NativeType("GLdouble") double zNear, @NativeType("GLdouble") double zFar) { + GL41C.glDepthRangeIndexed(index, zNear, zFar); + } + + // --- [ glGetFloati_v ] --- + + /** Unsafe version of: {@link #glGetFloati_v GetFloati_v} */ + public static void nglGetFloati_v(int target, int index, long data) { + GL41C.nglGetFloati_v(target, index, data); + } + + /** + * Queries the float value of an indexed state variable. + * + * @param target the indexed state to query + * @param index the index of the element being queried + * @param data a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetFloati_v(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat *") FloatBuffer data) { + GL41C.glGetFloati_v(target, index, data); + } + + /** + * Queries the float value of an indexed state variable. + * + * @param target the indexed state to query + * @param index the index of the element being queried + * + * @see Reference Page + */ + @NativeType("void") + public static float glGetFloati(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + return GL41C.glGetFloati(target, index); + } + + // --- [ glGetDoublei_v ] --- + + /** Unsafe version of: {@link #glGetDoublei_v GetDoublei_v} */ + public static void nglGetDoublei_v(int target, int index, long data) { + GL41C.nglGetDoublei_v(target, index, data); + } + + /** + * Queries the double value of an indexed state variable. + * + * @param target the indexed state to query + * @param index the index of the element being queried + * @param data a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetDoublei_v(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble *") DoubleBuffer data) { + GL41C.glGetDoublei_v(target, index, data); + } + + /** + * Queries the double value of an indexed state variable. + * + * @param target the indexed state to query + * @param index the index of the element being queried + * + * @see Reference Page + */ + @NativeType("void") + public static double glGetDoublei(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + return GL41C.glGetDoublei(target, index); + } + + /** + * Array version of: {@link #glShaderBinary ShaderBinary} + * + * @see Reference Page + */ + public static void glShaderBinary(@NativeType("GLuint const *") int[] shaders, @NativeType("GLenum") int binaryformat, @NativeType("void const *") ByteBuffer binary) { + GL41C.glShaderBinary(shaders, binaryformat, binary); + } + + /** + * Array version of: {@link #glGetShaderPrecisionFormat GetShaderPrecisionFormat} + * + * @see Reference Page + */ + public static void glGetShaderPrecisionFormat(@NativeType("GLenum") int shadertype, @NativeType("GLenum") int precisiontype, @NativeType("GLint *") int[] range, @NativeType("GLint *") int[] precision) { + GL41C.glGetShaderPrecisionFormat(shadertype, precisiontype, range, precision); + } + + /** + * Array version of: {@link #glGetProgramBinary GetProgramBinary} + * + * @see Reference Page + */ + public static void glGetProgramBinary(@NativeType("GLuint") int program, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLenum *") int[] binaryFormat, @NativeType("void *") ByteBuffer binary) { + GL41C.glGetProgramBinary(program, length, binaryFormat, binary); + } + + /** + * Array version of: {@link #glDeleteProgramPipelines DeleteProgramPipelines} + * + * @see Reference Page + */ + public static void glDeleteProgramPipelines(@NativeType("GLuint const *") int[] pipelines) { + GL41C.glDeleteProgramPipelines(pipelines); + } + + /** + * Array version of: {@link #glGenProgramPipelines GenProgramPipelines} + * + * @see Reference Page + */ + public static void glGenProgramPipelines(@NativeType("GLuint *") int[] pipelines) { + GL41C.glGenProgramPipelines(pipelines); + } + + /** + * Array version of: {@link #glGetProgramPipelineiv GetProgramPipelineiv} + * + * @see Reference Page + */ + public static void glGetProgramPipelineiv(@NativeType("GLuint") int pipeline, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL41C.glGetProgramPipelineiv(pipeline, pname, params); + } + + /** + * Array version of: {@link #glProgramUniform1iv ProgramUniform1iv} + * + * @see Reference Page + */ + public static void glProgramUniform1iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + GL41C.glProgramUniform1iv(program, location, value); + } + + /** + * Array version of: {@link #glProgramUniform2iv ProgramUniform2iv} + * + * @see Reference Page + */ + public static void glProgramUniform2iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + GL41C.glProgramUniform2iv(program, location, value); + } + + /** + * Array version of: {@link #glProgramUniform3iv ProgramUniform3iv} + * + * @see Reference Page + */ + public static void glProgramUniform3iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + GL41C.glProgramUniform3iv(program, location, value); + } + + /** + * Array version of: {@link #glProgramUniform4iv ProgramUniform4iv} + * + * @see Reference Page + */ + public static void glProgramUniform4iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + GL41C.glProgramUniform4iv(program, location, value); + } + + /** + * Array version of: {@link #glProgramUniform1uiv ProgramUniform1uiv} + * + * @see Reference Page + */ + public static void glProgramUniform1uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + GL41C.glProgramUniform1uiv(program, location, value); + } + + /** + * Array version of: {@link #glProgramUniform2uiv ProgramUniform2uiv} + * + * @see Reference Page + */ + public static void glProgramUniform2uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + GL41C.glProgramUniform2uiv(program, location, value); + } + + /** + * Array version of: {@link #glProgramUniform3uiv ProgramUniform3uiv} + * + * @see Reference Page + */ + public static void glProgramUniform3uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + GL41C.glProgramUniform3uiv(program, location, value); + } + + /** + * Array version of: {@link #glProgramUniform4uiv ProgramUniform4uiv} + * + * @see Reference Page + */ + public static void glProgramUniform4uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + GL41C.glProgramUniform4uiv(program, location, value); + } + + /** + * Array version of: {@link #glProgramUniform1fv ProgramUniform1fv} + * + * @see Reference Page + */ + public static void glProgramUniform1fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniform1fv(program, location, value); + } + + /** + * Array version of: {@link #glProgramUniform2fv ProgramUniform2fv} + * + * @see Reference Page + */ + public static void glProgramUniform2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniform2fv(program, location, value); + } + + /** + * Array version of: {@link #glProgramUniform3fv ProgramUniform3fv} + * + * @see Reference Page + */ + public static void glProgramUniform3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniform3fv(program, location, value); + } + + /** + * Array version of: {@link #glProgramUniform4fv ProgramUniform4fv} + * + * @see Reference Page + */ + public static void glProgramUniform4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniform4fv(program, location, value); + } + + /** + * Array version of: {@link #glProgramUniform1dv ProgramUniform1dv} + * + * @see Reference Page + */ + public static void glProgramUniform1dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniform1dv(program, location, value); + } + + /** + * Array version of: {@link #glProgramUniform2dv ProgramUniform2dv} + * + * @see Reference Page + */ + public static void glProgramUniform2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniform2dv(program, location, value); + } + + /** + * Array version of: {@link #glProgramUniform3dv ProgramUniform3dv} + * + * @see Reference Page + */ + public static void glProgramUniform3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniform3dv(program, location, value); + } + + /** + * Array version of: {@link #glProgramUniform4dv ProgramUniform4dv} + * + * @see Reference Page + */ + public static void glProgramUniform4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniform4dv(program, location, value); + } + + /** + * Array version of: {@link #glProgramUniformMatrix2fv ProgramUniformMatrix2fv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniformMatrix2fv(program, location, transpose, value); + } + + /** + * Array version of: {@link #glProgramUniformMatrix3fv ProgramUniformMatrix3fv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniformMatrix3fv(program, location, transpose, value); + } + + /** + * Array version of: {@link #glProgramUniformMatrix4fv ProgramUniformMatrix4fv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniformMatrix4fv(program, location, transpose, value); + } + + /** + * Array version of: {@link #glProgramUniformMatrix2dv ProgramUniformMatrix2dv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniformMatrix2dv(program, location, transpose, value); + } + + /** + * Array version of: {@link #glProgramUniformMatrix3dv ProgramUniformMatrix3dv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniformMatrix3dv(program, location, transpose, value); + } + + /** + * Array version of: {@link #glProgramUniformMatrix4dv ProgramUniformMatrix4dv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniformMatrix4dv(program, location, transpose, value); + } + + /** + * Array version of: {@link #glProgramUniformMatrix2x3fv ProgramUniformMatrix2x3fv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2x3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniformMatrix2x3fv(program, location, transpose, value); + } + + /** + * Array version of: {@link #glProgramUniformMatrix3x2fv ProgramUniformMatrix3x2fv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3x2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniformMatrix3x2fv(program, location, transpose, value); + } + + /** + * Array version of: {@link #glProgramUniformMatrix2x4fv ProgramUniformMatrix2x4fv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2x4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniformMatrix2x4fv(program, location, transpose, value); + } + + /** + * Array version of: {@link #glProgramUniformMatrix4x2fv ProgramUniformMatrix4x2fv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4x2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniformMatrix4x2fv(program, location, transpose, value); + } + + /** + * Array version of: {@link #glProgramUniformMatrix3x4fv ProgramUniformMatrix3x4fv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3x4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniformMatrix3x4fv(program, location, transpose, value); + } + + /** + * Array version of: {@link #glProgramUniformMatrix4x3fv ProgramUniformMatrix4x3fv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4x3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + GL41C.glProgramUniformMatrix4x3fv(program, location, transpose, value); + } + + /** + * Array version of: {@link #glProgramUniformMatrix2x3dv ProgramUniformMatrix2x3dv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2x3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniformMatrix2x3dv(program, location, transpose, value); + } + + /** + * Array version of: {@link #glProgramUniformMatrix3x2dv ProgramUniformMatrix3x2dv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3x2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniformMatrix3x2dv(program, location, transpose, value); + } + + /** + * Array version of: {@link #glProgramUniformMatrix2x4dv ProgramUniformMatrix2x4dv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2x4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniformMatrix2x4dv(program, location, transpose, value); + } + + /** + * Array version of: {@link #glProgramUniformMatrix4x2dv ProgramUniformMatrix4x2dv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4x2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniformMatrix4x2dv(program, location, transpose, value); + } + + /** + * Array version of: {@link #glProgramUniformMatrix3x4dv ProgramUniformMatrix3x4dv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3x4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniformMatrix3x4dv(program, location, transpose, value); + } + + /** + * Array version of: {@link #glProgramUniformMatrix4x3dv ProgramUniformMatrix4x3dv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4x3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + GL41C.glProgramUniformMatrix4x3dv(program, location, transpose, value); + } + + /** + * Array version of: {@link #glGetProgramPipelineInfoLog GetProgramPipelineInfoLog} + * + * @see Reference Page + */ + public static void glGetProgramPipelineInfoLog(@NativeType("GLuint") int pipeline, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer infoLog) { + GL41C.glGetProgramPipelineInfoLog(pipeline, length, infoLog); + } + + /** + * Array version of: {@link #glVertexAttribL1dv VertexAttribL1dv} + * + * @see Reference Page + */ + public static void glVertexAttribL1dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + GL41C.glVertexAttribL1dv(index, v); + } + + /** + * Array version of: {@link #glVertexAttribL2dv VertexAttribL2dv} + * + * @see Reference Page + */ + public static void glVertexAttribL2dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + GL41C.glVertexAttribL2dv(index, v); + } + + /** + * Array version of: {@link #glVertexAttribL3dv VertexAttribL3dv} + * + * @see Reference Page + */ + public static void glVertexAttribL3dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + GL41C.glVertexAttribL3dv(index, v); + } + + /** + * Array version of: {@link #glVertexAttribL4dv VertexAttribL4dv} + * + * @see Reference Page + */ + public static void glVertexAttribL4dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + GL41C.glVertexAttribL4dv(index, v); + } + + /** + * Array version of: {@link #glGetVertexAttribLdv GetVertexAttribLdv} + * + * @see Reference Page + */ + public static void glGetVertexAttribLdv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLdouble *") double[] params) { + GL41C.glGetVertexAttribLdv(index, pname, params); + } + + /** + * Array version of: {@link #glViewportArrayv ViewportArrayv} + * + * @see Reference Page + */ + public static void glViewportArrayv(@NativeType("GLuint") int first, @NativeType("GLfloat const *") float[] v) { + GL41C.glViewportArrayv(first, v); + } + + /** + * Array version of: {@link #glViewportIndexedfv ViewportIndexedfv} + * + * @see Reference Page + */ + public static void glViewportIndexedfv(@NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] v) { + GL41C.glViewportIndexedfv(index, v); + } + + /** + * Array version of: {@link #glScissorArrayv ScissorArrayv} + * + * @see Reference Page + */ + public static void glScissorArrayv(@NativeType("GLuint") int first, @NativeType("GLint const *") int[] v) { + GL41C.glScissorArrayv(first, v); + } + + /** + * Array version of: {@link #glScissorIndexedv ScissorIndexedv} + * + * @see Reference Page + */ + public static void glScissorIndexedv(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + GL41C.glScissorIndexedv(index, v); + } + + /** + * Array version of: {@link #glDepthRangeArrayv DepthRangeArrayv} + * + * @see Reference Page + */ + public static void glDepthRangeArrayv(@NativeType("GLuint") int first, @NativeType("GLdouble const *") double[] v) { + GL41C.glDepthRangeArrayv(first, v); + } + + /** + * Array version of: {@link #glGetFloati_v GetFloati_v} + * + * @see Reference Page + */ + public static void glGetFloati_v(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat *") float[] data) { + GL41C.glGetFloati_v(target, index, data); + } + + /** + * Array version of: {@link #glGetDoublei_v GetDoublei_v} + * + * @see Reference Page + */ + public static void glGetDoublei_v(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble *") double[] data) { + GL41C.glGetDoublei_v(target, index, data); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL41C.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL41C.java new file mode 100644 index 00000000..8e3322be --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL41C.java @@ -0,0 +1,2794 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality up to version 4.1. Includes only Core Profile symbols. + * + *

OpenGL 4.1 implementations support revision 4.10 of the OpenGL Shading Language.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL41C extends GL40C { + + /** Accepted by the {@code value} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int + GL_SHADER_COMPILER = 0x8DFA, + GL_SHADER_BINARY_FORMATS = 0x8DF8, + GL_NUM_SHADER_BINARY_FORMATS = 0x8DF9, + GL_MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB, + GL_MAX_VARYING_VECTORS = 0x8DFC, + GL_MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD, + GL_IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A, + GL_IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B; + + /** Accepted by the {@code type} parameter of VertexAttribPointer. */ + public static final int GL_FIXED = 0x140C; + + /** Accepted by the {@code precisiontype} parameter of GetShaderPrecisionFormat. */ + public static final int + GL_LOW_FLOAT = 0x8DF0, + GL_MEDIUM_FLOAT = 0x8DF1, + GL_HIGH_FLOAT = 0x8DF2, + GL_LOW_INT = 0x8DF3, + GL_MEDIUM_INT = 0x8DF4, + GL_HIGH_INT = 0x8DF5; + + /** Accepted by the {@code format} parameter of most commands taking sized internal formats. */ + public static final int GL_RGB565 = 0x8D62; + + /** Accepted by the {@code pname} parameter of ProgramParameteri and GetProgramiv. */ + public static final int GL_PROGRAM_BINARY_RETRIEVABLE_HINT = 0x8257; + + /** Accepted by the {@code pname} parameter of GetProgramiv. */ + public static final int GL_PROGRAM_BINARY_LENGTH = 0x8741; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv and GetDoublev. */ + public static final int + GL_NUM_PROGRAM_BINARY_FORMATS = 0x87FE, + GL_PROGRAM_BINARY_FORMATS = 0x87FF; + + /** Accepted by {@code stages} parameter to UseProgramStages. */ + public static final int + GL_VERTEX_SHADER_BIT = 0x1, + GL_FRAGMENT_SHADER_BIT = 0x2, + GL_GEOMETRY_SHADER_BIT = 0x4, + GL_TESS_CONTROL_SHADER_BIT = 0x8, + GL_TESS_EVALUATION_SHADER_BIT = 0x10, + GL_ALL_SHADER_BITS = 0xFFFFFFFF; + + /** Accepted by the {@code pname} parameter of ProgramParameteri and GetProgramiv. */ + public static final int GL_PROGRAM_SEPARABLE = 0x8258; + + /** Accepted by {@code type} parameter to GetProgramPipelineiv. */ + public static final int GL_ACTIVE_PROGRAM = 0x8259; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int GL_PROGRAM_PIPELINE_BINDING = 0x825A; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v. */ + public static final int + GL_MAX_VIEWPORTS = 0x825B, + GL_VIEWPORT_SUBPIXEL_BITS = 0x825C, + GL_VIEWPORT_BOUNDS_RANGE = 0x825D, + GL_LAYER_PROVOKING_VERTEX = 0x825E, + GL_VIEWPORT_INDEX_PROVOKING_VERTEX = 0x825F; + + /** Returned in the {@code data} parameter from a Get query with a {@code pname} of LAYER_PROVOKING_VERTEX or VIEWPORT_INDEX_PROVOKING_VERTEX. */ + public static final int GL_UNDEFINED_VERTEX = 0x8260; + + static { GL.initialize(); } + + protected GL41C() { + throw new UnsupportedOperationException(); + } + + // --- [ glReleaseShaderCompiler ] --- + + /** + * Releases resources allocated by the shader compiler. This is a hint from the application, and does not prevent later use of the shader compiler. + * + * @see Reference Page + */ + public static native void glReleaseShaderCompiler(); + + // --- [ glShaderBinary ] --- + + /** + * Unsafe version of: {@link #glShaderBinary ShaderBinary} + * + * @param count the number of shader object handles contained in {@code shaders} + * @param length the length of the array whose address is given in binary + */ + public static native void nglShaderBinary(int count, long shaders, int binaryformat, long binary, int length); + + /** + * Loads pre-compiled shader binaries. + * + * @param shaders an array of shader handles into which to load pre-compiled shader binaries + * @param binaryformat the format of the shader binaries contained in {@code binary} + * @param binary an array of bytes containing pre-compiled binary shader code + * + * @see Reference Page + */ + public static void glShaderBinary(@NativeType("GLuint const *") IntBuffer shaders, @NativeType("GLenum") int binaryformat, @NativeType("void const *") ByteBuffer binary) { + nglShaderBinary(shaders.remaining(), memAddress(shaders), binaryformat, memAddress(binary), binary.remaining()); + } + + // --- [ glGetShaderPrecisionFormat ] --- + + /** Unsafe version of: {@link #glGetShaderPrecisionFormat GetShaderPrecisionFormat} */ + public static native void nglGetShaderPrecisionFormat(int shadertype, int precisiontype, long range, long precision); + + /** + * Retrieves the range and precision for numeric formats supported by the shader compiler. + * + * @param shadertype the type of shader whose precision to query. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}
+ * @param precisiontype the numeric format whose precision and range to query + * @param range the address of array of two integers into which encodings of the implementation's numeric range are returned + * @param precision the address of an integer into which the numeric precision of the implementation is written + * + * @see Reference Page + */ + public static void glGetShaderPrecisionFormat(@NativeType("GLenum") int shadertype, @NativeType("GLenum") int precisiontype, @NativeType("GLint *") IntBuffer range, @NativeType("GLint *") IntBuffer precision) { + if (CHECKS) { + check(range, 2); + check(precision, 1); + } + nglGetShaderPrecisionFormat(shadertype, precisiontype, memAddress(range), memAddress(precision)); + } + + /** + * Retrieves the range and precision for numeric formats supported by the shader compiler. + * + * @param shadertype the type of shader whose precision to query. One of:
{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}
+ * @param precisiontype the numeric format whose precision and range to query + * @param range the address of array of two integers into which encodings of the implementation's numeric range are returned + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetShaderPrecisionFormat(@NativeType("GLenum") int shadertype, @NativeType("GLenum") int precisiontype, @NativeType("GLint *") IntBuffer range) { + if (CHECKS) { + check(range, 2); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer precision = stack.callocInt(1); + nglGetShaderPrecisionFormat(shadertype, precisiontype, memAddress(range), memAddress(precision)); + return precision.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glDepthRangef ] --- + + /** + * Specifies mapping of depth values from normalized device coordinates to window coordinates + * + * @param zNear the mapping of the near clipping plane to window coordinates. The initial value is 0.0f. + * @param zFar the mapping of the far clipping plane to window coordinates. The initial value is 1.0f. + * + * @see Reference Page + */ + public static native void glDepthRangef(@NativeType("GLfloat") float zNear, @NativeType("GLfloat") float zFar); + + // --- [ glClearDepthf ] --- + + /** + * Specifies the clear value for the depth buffer + * + * @param depth the depth value used when the depth buffer is cleared. The initial value is 1.0f. + * + * @see Reference Page + */ + public static native void glClearDepthf(@NativeType("GLfloat") float depth); + + // --- [ glGetProgramBinary ] --- + + /** + * Unsafe version of: {@link #glGetProgramBinary GetProgramBinary} + * + * @param bufSize the size of the buffer whose address is given by {@code binary} + */ + public static native void nglGetProgramBinary(int program, int bufSize, long length, long binaryFormat, long binary); + + /** + * Returns a binary representation of a program object's compiled and linked executable source. + * + * @param program the name of a program object whose binary representation to retrieve + * @param length the address of a variable to receive the number of bytes written into {@code binary} + * @param binaryFormat a variable to receive a token indicating the format of the binary data returned by the GL + * @param binary an array into which the GL will return {@code program}'s binary representation + * + * @see Reference Page + */ + public static void glGetProgramBinary(@NativeType("GLuint") int program, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLenum *") IntBuffer binaryFormat, @NativeType("void *") ByteBuffer binary) { + if (CHECKS) { + checkSafe(length, 1); + check(binaryFormat, 1); + } + nglGetProgramBinary(program, binary.remaining(), memAddressSafe(length), memAddress(binaryFormat), memAddress(binary)); + } + + // --- [ glProgramBinary ] --- + + /** + * Unsafe version of: {@link #glProgramBinary ProgramBinary} + * + * @param length the number of bytes contained in {@code binary} + */ + public static native void nglProgramBinary(int program, int binaryFormat, long binary, int length); + + /** + * Loads a program object with a program binary. + * + * @param program the name of a program object into which to load a program binary + * @param binaryFormat the format of the binary data in binary + * @param binary an array containing the binary to be loaded into {@code program} + * + * @see Reference Page + */ + public static void glProgramBinary(@NativeType("GLuint") int program, @NativeType("GLenum") int binaryFormat, @NativeType("void const *") ByteBuffer binary) { + nglProgramBinary(program, binaryFormat, memAddress(binary), binary.remaining()); + } + + // --- [ glProgramParameteri ] --- + + /** + * Specifies the integer value of a program object parameter. + * + * @param program the name of a program object whose parameter to modify + * @param pname the name of the parameter to modify. One of:
{@link #GL_PROGRAM_BINARY_RETRIEVABLE_HINT PROGRAM_BINARY_RETRIEVABLE_HINT}{@link #GL_PROGRAM_SEPARABLE PROGRAM_SEPARABLE}
+ * @param value the new value of the parameter specified by {@code pname} for {@code program} + * + * @see Reference Page + */ + public static native void glProgramParameteri(@NativeType("GLuint") int program, @NativeType("GLenum") int pname, @NativeType("GLint") int value); + + // --- [ glUseProgramStages ] --- + + /** + * Binds stages of a program object to a program pipeline. + * + * @param pipeline the program pipeline object to which to bind stages from {@code program} + * @param stages a set of program stages to bind to the program pipeline object + * @param program the program object containing the shader executables to use in {@code pipeline} + * + * @see Reference Page + */ + public static native void glUseProgramStages(@NativeType("GLuint") int pipeline, @NativeType("GLbitfield") int stages, @NativeType("GLuint") int program); + + // --- [ glActiveShaderProgram ] --- + + /** + * Sets the active program object for a program pipeline object. + * + * @param pipeline the program pipeline object to set the active program object for + * @param program the program object to set as the active program pipeline object {@code pipeline} + * + * @see Reference Page + */ + public static native void glActiveShaderProgram(@NativeType("GLuint") int pipeline, @NativeType("GLuint") int program); + + // --- [ glCreateShaderProgramv ] --- + + /** + * Unsafe version of: {@link #glCreateShaderProgramv CreateShaderProgramv} + * + * @param count the number of source code strings in the array {@code strings} + */ + public static native int nglCreateShaderProgramv(int type, int count, long strings); + + /** + * Creates a stand-alone program from an array of null-terminated source code strings. + * + *

{@code glCreateShaderProgram} is equivalent (assuming no errors are generated) to:

+ * + *

+     * const GLuint shader = glCreateShader(type);
+     * if (shader) {
+     *     glShaderSource(shader, count, strings, NULL);
+     *     glCompileShader(shader);
+     *     const GLuint program = glCreateProgram();
+     *     if (program) {
+     *         GLint compiled = GL_FALSE;
+     *         glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
+     *         glProgramParameteri(program, GL_PROGRAM_SEPARABLE, GL_TRUE);
+     *         if (compiled) {
+     *             glAttachShader(program, shader);
+     *             glLinkProgram(program);
+     *             glDetachShader(program, shader);
+     *         }
+     *         // append-shader-info-log-to-program-info-log
+     *     }
+     *     glDeleteShader(shader);
+     *     return program;
+     * } else {
+     *     return 0;
+     * }
+ * + *

The program object created by glCreateShaderProgram has its GL_PROGRAM_SEPARABLE status set to GL_TRUE.

+ * + * @param type the type of shader to create + * @param strings an array of pointers to source code strings from which to create the program object + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glCreateShaderProgramv(@NativeType("GLenum") int type, @NativeType("GLchar const **") PointerBuffer strings) { + return nglCreateShaderProgramv(type, strings.remaining(), memAddress(strings)); + } + + /** + * Creates a stand-alone program from an array of null-terminated source code strings. + * + *

{@code glCreateShaderProgram} is equivalent (assuming no errors are generated) to:

+ * + *

+     * const GLuint shader = glCreateShader(type);
+     * if (shader) {
+     *     glShaderSource(shader, count, strings, NULL);
+     *     glCompileShader(shader);
+     *     const GLuint program = glCreateProgram();
+     *     if (program) {
+     *         GLint compiled = GL_FALSE;
+     *         glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
+     *         glProgramParameteri(program, GL_PROGRAM_SEPARABLE, GL_TRUE);
+     *         if (compiled) {
+     *             glAttachShader(program, shader);
+     *             glLinkProgram(program);
+     *             glDetachShader(program, shader);
+     *         }
+     *         // append-shader-info-log-to-program-info-log
+     *     }
+     *     glDeleteShader(shader);
+     *     return program;
+     * } else {
+     *     return 0;
+     * }
+ * + *

The program object created by glCreateShaderProgram has its GL_PROGRAM_SEPARABLE status set to GL_TRUE.

+ * + * @param type the type of shader to create + * @param strings an array of pointers to source code strings from which to create the program object + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glCreateShaderProgramv(@NativeType("GLenum") int type, @NativeType("GLchar const **") CharSequence... strings) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + long stringsAddress = org.lwjgl.system.APIUtil.apiArray(stack, MemoryUtil::memUTF8, strings); + int __result = nglCreateShaderProgramv(type, strings.length, stringsAddress); + org.lwjgl.system.APIUtil.apiArrayFree(stringsAddress, strings.length); + return __result; + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Creates a stand-alone program from an array of null-terminated source code strings. + * + *

{@code glCreateShaderProgram} is equivalent (assuming no errors are generated) to:

+ * + *

+     * const GLuint shader = glCreateShader(type);
+     * if (shader) {
+     *     glShaderSource(shader, count, strings, NULL);
+     *     glCompileShader(shader);
+     *     const GLuint program = glCreateProgram();
+     *     if (program) {
+     *         GLint compiled = GL_FALSE;
+     *         glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
+     *         glProgramParameteri(program, GL_PROGRAM_SEPARABLE, GL_TRUE);
+     *         if (compiled) {
+     *             glAttachShader(program, shader);
+     *             glLinkProgram(program);
+     *             glDetachShader(program, shader);
+     *         }
+     *         // append-shader-info-log-to-program-info-log
+     *     }
+     *     glDeleteShader(shader);
+     *     return program;
+     * } else {
+     *     return 0;
+     * }
+ * + *

The program object created by glCreateShaderProgram has its GL_PROGRAM_SEPARABLE status set to GL_TRUE.

+ * + * @param type the type of shader to create + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glCreateShaderProgramv(@NativeType("GLenum") int type, @NativeType("GLchar const **") CharSequence string) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + long stringsAddress = org.lwjgl.system.APIUtil.apiArray(stack, MemoryUtil::memUTF8, string); + int __result = nglCreateShaderProgramv(type, 1, stringsAddress); + org.lwjgl.system.APIUtil.apiArrayFree(stringsAddress, 1); + return __result; + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glBindProgramPipeline ] --- + + /** + * Binds a program pipeline to the current context. + * + * @param pipeline the name of the pipeline object to bind to the context + * + * @see Reference Page + */ + public static native void glBindProgramPipeline(@NativeType("GLuint") int pipeline); + + // --- [ glDeleteProgramPipelines ] --- + + /** + * Unsafe version of: {@link #glDeleteProgramPipelines DeleteProgramPipelines} + * + * @param n the number of program pipeline objects to delete + */ + public static native void nglDeleteProgramPipelines(int n, long pipelines); + + /** + * Deletes program pipeline objects. + * + * @param pipelines an array of names of program pipeline objects to delete + * + * @see Reference Page + */ + public static void glDeleteProgramPipelines(@NativeType("GLuint const *") IntBuffer pipelines) { + nglDeleteProgramPipelines(pipelines.remaining(), memAddress(pipelines)); + } + + /** + * Deletes program pipeline objects. + * + * @see Reference Page + */ + public static void glDeleteProgramPipelines(@NativeType("GLuint const *") int pipeline) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer pipelines = stack.ints(pipeline); + nglDeleteProgramPipelines(1, memAddress(pipelines)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGenProgramPipelines ] --- + + /** + * Unsafe version of: {@link #glGenProgramPipelines GenProgramPipelines} + * + * @param n the number of program pipeline object names to reserve + */ + public static native void nglGenProgramPipelines(int n, long pipelines); + + /** + * Reserves program pipeline object names. + * + * @param pipelines an array of into which the reserved names will be written + * + * @see Reference Page + */ + public static void glGenProgramPipelines(@NativeType("GLuint *") IntBuffer pipelines) { + nglGenProgramPipelines(pipelines.remaining(), memAddress(pipelines)); + } + + /** + * Reserves program pipeline object names. + * + * @see Reference Page + */ + @NativeType("void") + public static int glGenProgramPipelines() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer pipelines = stack.callocInt(1); + nglGenProgramPipelines(1, memAddress(pipelines)); + return pipelines.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glIsProgramPipeline ] --- + + /** + * Determines if a name corresponds to a program pipeline object. + * + * @param pipeline a value that may be the name of a program pipeline object + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static native boolean glIsProgramPipeline(@NativeType("GLuint") int pipeline); + + // --- [ glGetProgramPipelineiv ] --- + + /** Unsafe version of: {@link #glGetProgramPipelineiv GetProgramPipelineiv} */ + public static native void nglGetProgramPipelineiv(int pipeline, int pname, long params); + + /** + * Retrieves properties of a program pipeline object. + * + * @param pipeline the name of a program pipeline object whose parameter retrieve + * @param pname the name of the parameter to retrieve. One of:
{@link #GL_ACTIVE_PROGRAM ACTIVE_PROGRAM}{@link GL20#GL_INFO_LOG_LENGTH INFO_LOG_LENGTH}{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}
{@link GL40#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}{@link GL40#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * @param params a variable into which will be written the value or values of {@code pname} for {@code pipeline} + * + * @see Reference Page + */ + public static void glGetProgramPipelineiv(@NativeType("GLuint") int pipeline, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetProgramPipelineiv(pipeline, pname, memAddress(params)); + } + + /** + * Retrieves properties of a program pipeline object. + * + * @param pipeline the name of a program pipeline object whose parameter retrieve + * @param pname the name of the parameter to retrieve. One of:
{@link #GL_ACTIVE_PROGRAM ACTIVE_PROGRAM}{@link GL20#GL_INFO_LOG_LENGTH INFO_LOG_LENGTH}{@link GL20#GL_VERTEX_SHADER VERTEX_SHADER}{@link GL20#GL_FRAGMENT_SHADER FRAGMENT_SHADER}{@link GL32#GL_GEOMETRY_SHADER GEOMETRY_SHADER}
{@link GL40#GL_TESS_CONTROL_SHADER TESS_CONTROL_SHADER}{@link GL40#GL_TESS_EVALUATION_SHADER TESS_EVALUATION_SHADER}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetProgramPipelinei(@NativeType("GLuint") int pipeline, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetProgramPipelineiv(pipeline, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glProgramUniform1i ] --- + + /** + * Specifies the value of an int uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * + * @see Reference Page + */ + public static native void glProgramUniform1i(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint") int x); + + // --- [ glProgramUniform2i ] --- + + /** + * Specifies the value of an ivec2 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * + * @see Reference Page + */ + public static native void glProgramUniform2i(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint") int x, @NativeType("GLint") int y); + + // --- [ glProgramUniform3i ] --- + + /** + * Specifies the value of an ivec3 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * + * @see Reference Page + */ + public static native void glProgramUniform3i(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z); + + // --- [ glProgramUniform4i ] --- + + /** + * Specifies the value of an ivec4 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * @param w the uniform w value + * + * @see Reference Page + */ + public static native void glProgramUniform4i(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLint") int z, @NativeType("GLint") int w); + + // --- [ glProgramUniform1ui ] --- + + /** + * Specifies the value of a uint uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * + * @see Reference Page + */ + public static native void glProgramUniform1ui(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint") int x); + + // --- [ glProgramUniform2ui ] --- + + /** + * Specifies the value of a uvec2 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * + * @see Reference Page + */ + public static native void glProgramUniform2ui(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint") int x, @NativeType("GLuint") int y); + + // --- [ glProgramUniform3ui ] --- + + /** + * Specifies the value of a uvec3 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * + * @see Reference Page + */ + public static native void glProgramUniform3ui(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint") int x, @NativeType("GLuint") int y, @NativeType("GLuint") int z); + + // --- [ glProgramUniform4ui ] --- + + /** + * Specifies the value of a uvec4 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * @param w the uniform w value + * + * @see Reference Page + */ + public static native void glProgramUniform4ui(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint") int x, @NativeType("GLuint") int y, @NativeType("GLuint") int z, @NativeType("GLuint") int w); + + // --- [ glProgramUniform1f ] --- + + /** + * Specifies the value of a float uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * + * @see Reference Page + */ + public static native void glProgramUniform1f(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat") float x); + + // --- [ glProgramUniform2f ] --- + + /** + * Specifies the value of a vec2 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * + * @see Reference Page + */ + public static native void glProgramUniform2f(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat") float x, @NativeType("GLfloat") float y); + + // --- [ glProgramUniform3f ] --- + + /** + * Specifies the value of a vec3 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * + * @see Reference Page + */ + public static native void glProgramUniform3f(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z); + + // --- [ glProgramUniform4f ] --- + + /** + * Specifies the value of a vec4 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * @param w the uniform w value + * + * @see Reference Page + */ + public static native void glProgramUniform4f(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float z, @NativeType("GLfloat") float w); + + // --- [ glProgramUniform1d ] --- + + /** + * Specifies the value of a double uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * + * @see Reference Page + */ + public static native void glProgramUniform1d(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble") double x); + + // --- [ glProgramUniform2d ] --- + + /** + * Specifies the value of a dvec2 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * + * @see Reference Page + */ + public static native void glProgramUniform2d(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y); + + // --- [ glProgramUniform3d ] --- + + /** + * Specifies the value of a dvec3 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * + * @see Reference Page + */ + public static native void glProgramUniform3d(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z); + + // --- [ glProgramUniform4d ] --- + + /** + * Specifies the value of a dvec4 uniform variable for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param x the uniform x value + * @param y the uniform y value + * @param z the uniform z value + * @param w the uniform w value + * + * @see Reference Page + */ + public static native void glProgramUniform4d(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z, @NativeType("GLdouble") double w); + + // --- [ glProgramUniform1iv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform1iv ProgramUniform1iv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform1iv(int program, int location, int count, long value); + + /** + * Specifies the value of a single float uniform variable or a float uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform1iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + nglProgramUniform1iv(program, location, value.remaining(), memAddress(value)); + } + + // --- [ glProgramUniform2iv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform2iv ProgramUniform2iv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform2iv(int program, int location, int count, long value); + + /** + * Specifies the value of a single ivec2 uniform variable or an ivec2 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform2iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + nglProgramUniform2iv(program, location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glProgramUniform3iv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform3iv ProgramUniform3iv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform3iv(int program, int location, int count, long value); + + /** + * Specifies the value of a single ivec3 uniform variable or an ivec3 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform3iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + nglProgramUniform3iv(program, location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glProgramUniform4iv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform4iv ProgramUniform4iv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform4iv(int program, int location, int count, long value); + + /** + * Specifies the value of a single ivec4 uniform variable or an ivec4 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform4iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") IntBuffer value) { + nglProgramUniform4iv(program, location, value.remaining() >> 2, memAddress(value)); + } + + // --- [ glProgramUniform1uiv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform1uiv ProgramUniform1uiv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform1uiv(int program, int location, int count, long value); + + /** + * Specifies the value of a single uint uniform variable or a uint uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform1uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + nglProgramUniform1uiv(program, location, value.remaining(), memAddress(value)); + } + + // --- [ glProgramUniform2uiv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform2uiv ProgramUniform2uiv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform2uiv(int program, int location, int count, long value); + + /** + * Specifies the value of a single uvec2 uniform variable or a uvec2 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform2uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + nglProgramUniform2uiv(program, location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glProgramUniform3uiv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform3uiv ProgramUniform3uiv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform3uiv(int program, int location, int count, long value); + + /** + * Specifies the value of a single uvec3 uniform variable or a uvec3 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform3uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + nglProgramUniform3uiv(program, location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glProgramUniform4uiv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform4uiv ProgramUniform4uiv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform4uiv(int program, int location, int count, long value); + + /** + * Specifies the value of a single uvec4 uniform variable or a uvec4 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform4uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") IntBuffer value) { + nglProgramUniform4uiv(program, location, value.remaining() >> 2, memAddress(value)); + } + + // --- [ glProgramUniform1fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform1fv ProgramUniform1fv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform1fv(int program, int location, int count, long value); + + /** + * Specifies the value of a single float uniform variable or a float uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform1fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniform1fv(program, location, value.remaining(), memAddress(value)); + } + + // --- [ glProgramUniform2fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform2fv ProgramUniform2fv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform2fv(int program, int location, int count, long value); + + /** + * Specifies the value of a single vec2 uniform variable or a vec2 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniform2fv(program, location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glProgramUniform3fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform3fv ProgramUniform3fv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform3fv(int program, int location, int count, long value); + + /** + * Specifies the value of a single vec3 uniform variable or a vec3 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniform3fv(program, location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glProgramUniform4fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform4fv ProgramUniform4fv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform4fv(int program, int location, int count, long value); + + /** + * Specifies the value of a single vec4 uniform variable or a vec4 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniform4fv(program, location, value.remaining() >> 2, memAddress(value)); + } + + // --- [ glProgramUniform1dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform1dv ProgramUniform1dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform1dv(int program, int location, int count, long value); + + /** + * Specifies the value of a single double uniform variable or a double uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform1dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniform1dv(program, location, value.remaining(), memAddress(value)); + } + + // --- [ glProgramUniform2dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform2dv ProgramUniform2dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform2dv(int program, int location, int count, long value); + + /** + * Specifies the value of a single dvec2 uniform variable or a dvec2 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniform2dv(program, location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glProgramUniform3dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform3dv ProgramUniform3dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform3dv(int program, int location, int count, long value); + + /** + * Specifies the value of a single dvec3 uniform variable or a dvec3 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniform3dv(program, location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glProgramUniform4dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniform4dv ProgramUniform4dv} + * + * @param count the number of elements that are to be modified. This should be 1 if the targeted uniform variable is not an array, and 1 or more if it is an array. + */ + public static native void nglProgramUniform4dv(int program, int location, int count, long value); + + /** + * Specifies the value of a single dvec4 uniform variable or a dvec4 uniform variable array for a specified program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param value an array of {@code count} values that will be used to update the specified uniform variable + * + * @see Reference Page + */ + public static void glProgramUniform4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniform4dv(program, location, value.remaining() >> 2, memAddress(value)); + } + + // --- [ glProgramUniformMatrix2fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix2fv ProgramUniformMatrix2fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix2fv(int program, int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single mat2 uniform variable or a mat2 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniformMatrix2fv(program, location, value.remaining() >> 2, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix3fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix3fv ProgramUniformMatrix3fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix3fv(int program, int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single mat3 uniform variable or a mat3 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniformMatrix3fv(program, location, value.remaining() / 9, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix4fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix4fv ProgramUniformMatrix4fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix4fv(int program, int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single mat4 uniform variable or a mat4 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniformMatrix4fv(program, location, value.remaining() >> 4, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix2dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix2dv ProgramUniformMatrix2dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix2dv(int program, int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single dmat2 uniform variable or a dmat2 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniformMatrix2dv(program, location, value.remaining() >> 2, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix3dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix3dv ProgramUniformMatrix3dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix3dv(int program, int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single dmat3 uniform variable or a dmat3 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniformMatrix3dv(program, location, value.remaining() / 9, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix4dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix4dv ProgramUniformMatrix4dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix4dv(int program, int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single dmat4 uniform variable or a dmat4 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniformMatrix4dv(program, location, value.remaining() >> 4, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix2x3fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix2x3fv ProgramUniformMatrix2x3fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix2x3fv(int program, int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single mat2x3 uniform variable or a mat2x3 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2x3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniformMatrix2x3fv(program, location, value.remaining() / 6, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix3x2fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix3x2fv ProgramUniformMatrix3x2fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix3x2fv(int program, int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single mat3x2 uniform variable or a mat3x2 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3x2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniformMatrix3x2fv(program, location, value.remaining() / 6, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix2x4fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix2x4fv ProgramUniformMatrix2x4fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix2x4fv(int program, int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single mat2x4 uniform variable or a mat2x4 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2x4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniformMatrix2x4fv(program, location, value.remaining() >> 3, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix4x2fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix4x2fv ProgramUniformMatrix4x2fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix4x2fv(int program, int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single mat4x2 uniform variable or a mat4x2 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4x2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniformMatrix4x2fv(program, location, value.remaining() >> 3, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix3x4fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix3x4fv ProgramUniformMatrix3x4fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix3x4fv(int program, int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single mat3x4 uniform variable or a mat3x4 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3x4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniformMatrix3x4fv(program, location, value.remaining() / 12, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix4x3fv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix4x3fv ProgramUniformMatrix4x3fv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix4x3fv(int program, int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single mat4x3 uniform variable or a mat4x3 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4x3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") FloatBuffer value) { + nglProgramUniformMatrix4x3fv(program, location, value.remaining() / 12, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix2x3dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix2x3dv ProgramUniformMatrix2x3dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix2x3dv(int program, int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single dmat2x3 uniform variable or a dmat2x3 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2x3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniformMatrix2x3dv(program, location, value.remaining() / 6, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix3x2dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix3x2dv ProgramUniformMatrix3x2dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix3x2dv(int program, int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single dmat3x2 uniform variable or a dmat3x2 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3x2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniformMatrix3x2dv(program, location, value.remaining() / 6, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix2x4dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix2x4dv ProgramUniformMatrix2x4dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix2x4dv(int program, int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single dmat2x4 uniform variable or a dmat2x4 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2x4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniformMatrix2x4dv(program, location, value.remaining() >> 3, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix4x2dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix4x2dv ProgramUniformMatrix4x2dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix4x2dv(int program, int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single dmat4x2 uniform variable or a dmat4x2 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4x2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniformMatrix4x2dv(program, location, value.remaining() >> 3, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix3x4dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix3x4dv ProgramUniformMatrix3x4dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix3x4dv(int program, int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single dmat3x4 uniform variable or a dmat3x4 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3x4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniformMatrix3x4dv(program, location, value.remaining() / 12, transpose, memAddress(value)); + } + + // --- [ glProgramUniformMatrix4x3dv ] --- + + /** + * Unsafe version of: {@link #glProgramUniformMatrix4x3dv ProgramUniformMatrix4x3dv} + * + * @param count the number of matrices that are to be modified. This should be 1 if the targeted uniform variable is not an array of matrices, and 1 or more if it is an array of matrices. + */ + public static native void nglProgramUniformMatrix4x3dv(int program, int location, int count, boolean transpose, long value); + + /** + * Specifies the value of a single dmat4x3 uniform variable or a dmat4x3 uniform variable array for the current program object. + * + * @param program the handle of the program containing the uniform variable to be modified + * @param location the location of the uniform variable to be modified + * @param transpose whether to transpose the matrix as the values are loaded into the uniform variable + * @param value an array of {@code count} values that will be used to update the specified uniform matrix variable + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4x3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") DoubleBuffer value) { + nglProgramUniformMatrix4x3dv(program, location, value.remaining() / 12, transpose, memAddress(value)); + } + + // --- [ glValidateProgramPipeline ] --- + + /** + * Validates a program pipeline object against current GL state. + * + * @param pipeline the name of a program pipeline object to validate + * + * @see Reference Page + */ + public static native void glValidateProgramPipeline(@NativeType("GLuint") int pipeline); + + // --- [ glGetProgramPipelineInfoLog ] --- + + /** + * Unsafe version of: {@link #glGetProgramPipelineInfoLog GetProgramPipelineInfoLog} + * + * @param bufSize the maximum number of characters, including the null terminator, that may be written into {@code infoLog} + */ + public static native void nglGetProgramPipelineInfoLog(int pipeline, int bufSize, long length, long infoLog); + + /** + * Retrieves the info log string from a program pipeline object. + * + * @param pipeline the name of a program pipeline object from which to retrieve the info log + * @param length a variable into which will be written the number of characters written into {@code infoLog} + * @param infoLog an array of characters into which will be written the info log for {@code pipeline} + * + * @see Reference Page + */ + public static void glGetProgramPipelineInfoLog(@NativeType("GLuint") int pipeline, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer infoLog) { + if (CHECKS) { + checkSafe(length, 1); + } + nglGetProgramPipelineInfoLog(pipeline, infoLog.remaining(), memAddressSafe(length), memAddress(infoLog)); + } + + /** + * Retrieves the info log string from a program pipeline object. + * + * @param pipeline the name of a program pipeline object from which to retrieve the info log + * @param bufSize the maximum number of characters, including the null terminator, that may be written into {@code infoLog} + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetProgramPipelineInfoLog(@NativeType("GLuint") int pipeline, @NativeType("GLsizei") int bufSize) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + ByteBuffer infoLog = memAlloc(bufSize); + try { + IntBuffer length = stack.ints(0); + nglGetProgramPipelineInfoLog(pipeline, bufSize, memAddress(length), memAddress(infoLog)); + return memUTF8(infoLog, length.get(0)); + } finally { + memFree(infoLog); + stack.setPointer(stackPointer); + } + } + + /** + * Retrieves the info log string from a program pipeline object. + * + * @param pipeline the name of a program pipeline object from which to retrieve the info log + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetProgramPipelineInfoLog(@NativeType("GLuint") int pipeline) { + return glGetProgramPipelineInfoLog(pipeline, glGetProgramPipelinei(pipeline, GL20.GL_INFO_LOG_LENGTH)); + } + + // --- [ glVertexAttribL1d ] --- + + /** + * Specifies the value of a generic vertex attribute. The y and z components are implicitly set to 0.0 and w to 1.0. + * + * @param index the index of the generic vertex attribute to be modified + * @param x the vertex attribute x component + * + * @see Reference Page + */ + public static native void glVertexAttribL1d(@NativeType("GLuint") int index, @NativeType("GLdouble") double x); + + // --- [ glVertexAttribL2d ] --- + + /** + * Specifies the value of a generic vertex attribute. The y component is implicitly set to 0.0 and w to 1.0. + * + * @param index the index of the generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * + * @see Reference Page + */ + public static native void glVertexAttribL2d(@NativeType("GLuint") int index, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y); + + // --- [ glVertexAttribL3d ] --- + + /** + * Specifies the value of a generic vertex attribute. The w is implicitly set to 1.0. + * + * @param index the index of the generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * @param z the vertex attribute z component + * + * @see Reference Page + */ + public static native void glVertexAttribL3d(@NativeType("GLuint") int index, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z); + + // --- [ glVertexAttribL4d ] --- + + /** + * Specifies the value of a generic vertex attribute. + * + * @param index the index of the generic vertex attribute to be modified + * @param x the vertex attribute x component + * @param y the vertex attribute y component + * @param z the vertex attribute z component + * @param w the vertex attribute w component + * + * @see Reference Page + */ + public static native void glVertexAttribL4d(@NativeType("GLuint") int index, @NativeType("GLdouble") double x, @NativeType("GLdouble") double y, @NativeType("GLdouble") double z, @NativeType("GLdouble") double w); + + // --- [ glVertexAttribL1dv ] --- + + /** Unsafe version of: {@link #glVertexAttribL1dv VertexAttribL1dv} */ + public static native void nglVertexAttribL1dv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttribL1d VertexAttribL1d}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribL1dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglVertexAttribL1dv(index, memAddress(v)); + } + + // --- [ glVertexAttribL2dv ] --- + + /** Unsafe version of: {@link #glVertexAttribL2dv VertexAttribL2dv} */ + public static native void nglVertexAttribL2dv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttribL2d VertexAttribL2d}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribL2dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglVertexAttribL2dv(index, memAddress(v)); + } + + // --- [ glVertexAttribL3dv ] --- + + /** Unsafe version of: {@link #glVertexAttribL3dv VertexAttribL3dv} */ + public static native void nglVertexAttribL3dv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttribL3d VertexAttribL3d}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribL3dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglVertexAttribL3dv(index, memAddress(v)); + } + + // --- [ glVertexAttribL4dv ] --- + + /** Unsafe version of: {@link #glVertexAttribL4dv VertexAttribL4dv} */ + public static native void nglVertexAttribL4dv(int index, long v); + + /** + * Pointer version of {@link #glVertexAttribL4d VertexAttribL4d}. + * + * @param index the index of the generic vertex attribute to be modified + * @param v the vertex attribute buffer + * + * @see Reference Page + */ + public static void glVertexAttribL4dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") DoubleBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttribL4dv(index, memAddress(v)); + } + + // --- [ glVertexAttribLPointer ] --- + + /** + * Unsafe version of: {@link #glVertexAttribLPointer VertexAttribLPointer} + * + * @param type the data type of each component in the array. Must be:
{@link GL11#GL_DOUBLE DOUBLE}
+ */ + public static native void nglVertexAttribLPointer(int index, int size, int type, int stride, long pointer); + + /** + * Specifies the location and organization of a 64-bit vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. Must be:
{@link GL11#GL_DOUBLE DOUBLE}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribLPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") ByteBuffer pointer) { + nglVertexAttribLPointer(index, size, type, stride, memAddress(pointer)); + } + + /** + * Specifies the location and organization of a 64-bit vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the data type of each component in the array. Must be:
{@link GL11#GL_DOUBLE DOUBLE}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribLPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride, @NativeType("void const *") long pointer) { + nglVertexAttribLPointer(index, size, type, stride, pointer); + } + + /** + * Specifies the location and organization of a 64-bit vertex attribute array. + * + * @param index the index of the generic vertex attribute to be modified + * @param size the number of values per vertex that are stored in the array. The initial value is 4. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param stride the byte offset between consecutive generic vertex attributes. If stride is 0, the generic vertex attributes are understood to be tightly packed in + * the array. The initial value is 0. + * @param pointer the vertex attribute data or the offset of the first component of the first generic vertex attribute in the array in the data store of the buffer + * currently bound to the {@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER} target. The initial value is 0. + * + * @see Reference Page + */ + public static void glVertexAttribLPointer(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLsizei") int stride, @NativeType("void const *") DoubleBuffer pointer) { + nglVertexAttribLPointer(index, size, GL11.GL_DOUBLE, stride, memAddress(pointer)); + } + + // --- [ glGetVertexAttribLdv ] --- + + /** Unsafe version of: {@link #glGetVertexAttribLdv GetVertexAttribLdv} */ + public static native void nglGetVertexAttribLdv(int index, int pname, long params); + + /** + * Double version of {@link GL20C#glGetVertexAttribiv GetVertexAttribiv}. + * + * @param index the generic vertex attribute parameter to be queried + * @param pname the symbolic name of the vertex attribute parameter to be queried + * @param params the requested data + * + * @see Reference Page + */ + public static void glGetVertexAttribLdv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLdouble *") DoubleBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetVertexAttribLdv(index, pname, memAddress(params)); + } + + // --- [ glViewportArrayv ] --- + + /** + * Unsafe version of: {@link #glViewportArrayv ViewportArrayv} + * + * @param count the number of viewports to set + */ + public static native void nglViewportArrayv(int first, int count, long v); + + /** + * Sets multiple viewports. + * + * @param first the first viewport to set + * @param v an array containing the viewport parameters + * + * @see Reference Page + */ + public static void glViewportArrayv(@NativeType("GLuint") int first, @NativeType("GLfloat const *") FloatBuffer v) { + nglViewportArrayv(first, v.remaining() >> 2, memAddress(v)); + } + + // --- [ glViewportIndexedf ] --- + + /** + * Sets a specified viewport. + * + * @param index the viewport to set + * @param x the left viewport coordinate + * @param y the bottom viewport coordinate + * @param w the viewport width + * @param h the viewport height + * + * @see Reference Page + */ + public static native void glViewportIndexedf(@NativeType("GLuint") int index, @NativeType("GLfloat") float x, @NativeType("GLfloat") float y, @NativeType("GLfloat") float w, @NativeType("GLfloat") float h); + + // --- [ glViewportIndexedfv ] --- + + /** Unsafe version of: {@link #glViewportIndexedfv ViewportIndexedfv} */ + public static native void nglViewportIndexedfv(int index, long v); + + /** + * Pointer version of {@link #glViewportIndexedf ViewportIndexedf}. + * + * @param index the viewport to set + * @param v the viewport parameters + * + * @see Reference Page + */ + public static void glViewportIndexedfv(@NativeType("GLuint") int index, @NativeType("GLfloat const *") FloatBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglViewportIndexedfv(index, memAddress(v)); + } + + // --- [ glScissorArrayv ] --- + + /** + * Unsafe version of: {@link #glScissorArrayv ScissorArrayv} + * + * @param count the number of scissor boxes to modify + */ + public static native void nglScissorArrayv(int first, int count, long v); + + /** + * Defines the scissor box for multiple viewports. + * + * @param first the index of the first viewport whose scissor box to modify + * @param v an array containing the left, bottom, width and height of each scissor box, in that order + * + * @see Reference Page + */ + public static void glScissorArrayv(@NativeType("GLuint") int first, @NativeType("GLint const *") IntBuffer v) { + nglScissorArrayv(first, v.remaining() >> 2, memAddress(v)); + } + + // --- [ glScissorIndexed ] --- + + /** + * Defines the scissor box for a specific viewport. + * + * @param index the index of the viewport whose scissor box to modify + * @param left the left scissor box coordinate + * @param bottom the bottom scissor box coordinate + * @param width the scissor box width + * @param height the scissor box height + * + * @see Reference Page + */ + public static native void glScissorIndexed(@NativeType("GLuint") int index, @NativeType("GLint") int left, @NativeType("GLint") int bottom, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glScissorIndexedv ] --- + + /** Unsafe version of: {@link #glScissorIndexedv ScissorIndexedv} */ + public static native void nglScissorIndexedv(int index, long v); + + /** + * Pointer version of {@link #glScissorIndexed ScissorIndexed}. + * + * @param index the index of the viewport whose scissor box to modify + * @param v an array containing the left, bottom, width and height of each scissor box, in that order + * + * @see Reference Page + */ + public static void glScissorIndexedv(@NativeType("GLuint") int index, @NativeType("GLint const *") IntBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglScissorIndexedv(index, memAddress(v)); + } + + // --- [ glDepthRangeArrayv ] --- + + /** + * Unsafe version of: {@link #glDepthRangeArrayv DepthRangeArrayv} + * + * @param count the number of viewports whose depth range to update + */ + public static native void nglDepthRangeArrayv(int first, int count, long v); + + /** + * Specifies mapping of depth values from normalized device coordinates to window coordinates for a specified set of viewports. + * + * @param first the index of the first viewport whose depth range to update + * @param v n array containing the near and far values for the depth range of each modified viewport + * + * @see Reference Page + */ + public static void glDepthRangeArrayv(@NativeType("GLuint") int first, @NativeType("GLdouble const *") DoubleBuffer v) { + nglDepthRangeArrayv(first, v.remaining() >> 1, memAddress(v)); + } + + // --- [ glDepthRangeIndexed ] --- + + /** + * Specifies mapping of depth values from normalized device coordinates to window coordinates for a specified viewport. + * + * @param index the index of the viewport whose depth range to update + * @param zNear the mapping of the near clipping plane to window coordinates. The initial value is 0. + * @param zFar the mapping of the far clipping plane to window coordinates. The initial value is 1. + * + * @see Reference Page + */ + public static native void glDepthRangeIndexed(@NativeType("GLuint") int index, @NativeType("GLdouble") double zNear, @NativeType("GLdouble") double zFar); + + // --- [ glGetFloati_v ] --- + + /** Unsafe version of: {@link #glGetFloati_v GetFloati_v} */ + public static native void nglGetFloati_v(int target, int index, long data); + + /** + * Queries the float value of an indexed state variable. + * + * @param target the indexed state to query + * @param index the index of the element being queried + * @param data a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetFloati_v(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat *") FloatBuffer data) { + if (CHECKS) { + check(data, 1); + } + nglGetFloati_v(target, index, memAddress(data)); + } + + /** + * Queries the float value of an indexed state variable. + * + * @param target the indexed state to query + * @param index the index of the element being queried + * + * @see Reference Page + */ + @NativeType("void") + public static float glGetFloati(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer data = stack.callocFloat(1); + nglGetFloati_v(target, index, memAddress(data)); + return data.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetDoublei_v ] --- + + /** Unsafe version of: {@link #glGetDoublei_v GetDoublei_v} */ + public static native void nglGetDoublei_v(int target, int index, long data); + + /** + * Queries the double value of an indexed state variable. + * + * @param target the indexed state to query + * @param index the index of the element being queried + * @param data a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetDoublei_v(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble *") DoubleBuffer data) { + if (CHECKS) { + check(data, 1); + } + nglGetDoublei_v(target, index, memAddress(data)); + } + + /** + * Queries the double value of an indexed state variable. + * + * @param target the indexed state to query + * @param index the index of the element being queried + * + * @see Reference Page + */ + @NativeType("void") + public static double glGetDoublei(@NativeType("GLenum") int target, @NativeType("GLuint") int index) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + DoubleBuffer data = stack.callocDouble(1); + nglGetDoublei_v(target, index, memAddress(data)); + return data.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Array version of: {@link #glShaderBinary ShaderBinary} + * + * @see Reference Page + */ + public static void glShaderBinary(@NativeType("GLuint const *") int[] shaders, @NativeType("GLenum") int binaryformat, @NativeType("void const *") ByteBuffer binary) { + long __functionAddress = GL.getICD().glShaderBinary; + if (CHECKS) { + check(__functionAddress); + } + callPPV(shaders.length, shaders, binaryformat, memAddress(binary), binary.remaining(), __functionAddress); + } + + /** + * Array version of: {@link #glGetShaderPrecisionFormat GetShaderPrecisionFormat} + * + * @see Reference Page + */ + public static void glGetShaderPrecisionFormat(@NativeType("GLenum") int shadertype, @NativeType("GLenum") int precisiontype, @NativeType("GLint *") int[] range, @NativeType("GLint *") int[] precision) { + long __functionAddress = GL.getICD().glGetShaderPrecisionFormat; + if (CHECKS) { + check(__functionAddress); + check(range, 2); + check(precision, 1); + } + callPPV(shadertype, precisiontype, range, precision, __functionAddress); + } + + /** + * Array version of: {@link #glGetProgramBinary GetProgramBinary} + * + * @see Reference Page + */ + public static void glGetProgramBinary(@NativeType("GLuint") int program, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLenum *") int[] binaryFormat, @NativeType("void *") ByteBuffer binary) { + long __functionAddress = GL.getICD().glGetProgramBinary; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + check(binaryFormat, 1); + } + callPPPV(program, binary.remaining(), length, binaryFormat, memAddress(binary), __functionAddress); + } + + /** + * Array version of: {@link #glDeleteProgramPipelines DeleteProgramPipelines} + * + * @see Reference Page + */ + public static void glDeleteProgramPipelines(@NativeType("GLuint const *") int[] pipelines) { + long __functionAddress = GL.getICD().glDeleteProgramPipelines; + if (CHECKS) { + check(__functionAddress); + } + callPV(pipelines.length, pipelines, __functionAddress); + } + + /** + * Array version of: {@link #glGenProgramPipelines GenProgramPipelines} + * + * @see Reference Page + */ + public static void glGenProgramPipelines(@NativeType("GLuint *") int[] pipelines) { + long __functionAddress = GL.getICD().glGenProgramPipelines; + if (CHECKS) { + check(__functionAddress); + } + callPV(pipelines.length, pipelines, __functionAddress); + } + + /** + * Array version of: {@link #glGetProgramPipelineiv GetProgramPipelineiv} + * + * @see Reference Page + */ + public static void glGetProgramPipelineiv(@NativeType("GLuint") int pipeline, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetProgramPipelineiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(pipeline, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniform1iv ProgramUniform1iv} + * + * @see Reference Page + */ + public static void glProgramUniform1iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + long __functionAddress = GL.getICD().glProgramUniform1iv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniform2iv ProgramUniform2iv} + * + * @see Reference Page + */ + public static void glProgramUniform2iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + long __functionAddress = GL.getICD().glProgramUniform2iv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 1, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniform3iv ProgramUniform3iv} + * + * @see Reference Page + */ + public static void glProgramUniform3iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + long __functionAddress = GL.getICD().glProgramUniform3iv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 3, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniform4iv ProgramUniform4iv} + * + * @see Reference Page + */ + public static void glProgramUniform4iv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint const *") int[] value) { + long __functionAddress = GL.getICD().glProgramUniform4iv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 2, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniform1uiv ProgramUniform1uiv} + * + * @see Reference Page + */ + public static void glProgramUniform1uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glProgramUniform1uiv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniform2uiv ProgramUniform2uiv} + * + * @see Reference Page + */ + public static void glProgramUniform2uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glProgramUniform2uiv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 1, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniform3uiv ProgramUniform3uiv} + * + * @see Reference Page + */ + public static void glProgramUniform3uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glProgramUniform3uiv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 3, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniform4uiv ProgramUniform4uiv} + * + * @see Reference Page + */ + public static void glProgramUniform4uiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint const *") int[] value) { + long __functionAddress = GL.getICD().glProgramUniform4uiv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 2, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniform1fv ProgramUniform1fv} + * + * @see Reference Page + */ + public static void glProgramUniform1fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniform1fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniform2fv ProgramUniform2fv} + * + * @see Reference Page + */ + public static void glProgramUniform2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniform2fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 1, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniform3fv ProgramUniform3fv} + * + * @see Reference Page + */ + public static void glProgramUniform3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniform3fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 3, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniform4fv ProgramUniform4fv} + * + * @see Reference Page + */ + public static void glProgramUniform4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniform4fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 2, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniform1dv ProgramUniform1dv} + * + * @see Reference Page + */ + public static void glProgramUniform1dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniform1dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniform2dv ProgramUniform2dv} + * + * @see Reference Page + */ + public static void glProgramUniform2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniform2dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 1, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniform3dv ProgramUniform3dv} + * + * @see Reference Page + */ + public static void glProgramUniform3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniform3dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 3, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniform4dv ProgramUniform4dv} + * + * @see Reference Page + */ + public static void glProgramUniform4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniform4dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 2, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniformMatrix2fv ProgramUniformMatrix2fv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix2fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 2, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniformMatrix3fv ProgramUniformMatrix3fv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix3fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 9, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniformMatrix4fv ProgramUniformMatrix4fv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix4fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 4, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniformMatrix2dv ProgramUniformMatrix2dv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix2dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 2, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniformMatrix3dv ProgramUniformMatrix3dv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix3dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 9, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniformMatrix4dv ProgramUniformMatrix4dv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix4dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 4, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniformMatrix2x3fv ProgramUniformMatrix2x3fv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2x3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix2x3fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 6, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniformMatrix3x2fv ProgramUniformMatrix3x2fv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3x2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix3x2fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 6, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniformMatrix2x4fv ProgramUniformMatrix2x4fv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2x4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix2x4fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 3, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniformMatrix4x2fv ProgramUniformMatrix4x2fv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4x2fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix4x2fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 3, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniformMatrix3x4fv ProgramUniformMatrix3x4fv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3x4fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix3x4fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 12, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniformMatrix4x3fv ProgramUniformMatrix4x3fv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4x3fv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix4x3fv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 12, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniformMatrix2x3dv ProgramUniformMatrix2x3dv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2x3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix2x3dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 6, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniformMatrix3x2dv ProgramUniformMatrix3x2dv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3x2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix3x2dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 6, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniformMatrix2x4dv ProgramUniformMatrix2x4dv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix2x4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix2x4dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 3, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniformMatrix4x2dv ProgramUniformMatrix4x2dv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4x2dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix4x2dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 3, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniformMatrix3x4dv ProgramUniformMatrix3x4dv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix3x4dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix3x4dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 12, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glProgramUniformMatrix4x3dv ProgramUniformMatrix4x3dv} + * + * @see Reference Page + */ + public static void glProgramUniformMatrix4x3dv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLboolean") boolean transpose, @NativeType("GLdouble const *") double[] value) { + long __functionAddress = GL.getICD().glProgramUniformMatrix4x3dv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 12, transpose, value, __functionAddress); + } + + /** + * Array version of: {@link #glGetProgramPipelineInfoLog GetProgramPipelineInfoLog} + * + * @see Reference Page + */ + public static void glGetProgramPipelineInfoLog(@NativeType("GLuint") int pipeline, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer infoLog) { + long __functionAddress = GL.getICD().glGetProgramPipelineInfoLog; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + } + callPPV(pipeline, infoLog.remaining(), length, memAddress(infoLog), __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttribL1dv VertexAttribL1dv} + * + * @see Reference Page + */ + public static void glVertexAttribL1dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glVertexAttribL1dv; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttribL2dv VertexAttribL2dv} + * + * @see Reference Page + */ + public static void glVertexAttribL2dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glVertexAttribL2dv; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttribL3dv VertexAttribL3dv} + * + * @see Reference Page + */ + public static void glVertexAttribL3dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glVertexAttribL3dv; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glVertexAttribL4dv VertexAttribL4dv} + * + * @see Reference Page + */ + public static void glVertexAttribL4dv(@NativeType("GLuint") int index, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glVertexAttribL4dv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glGetVertexAttribLdv GetVertexAttribLdv} + * + * @see Reference Page + */ + public static void glGetVertexAttribLdv(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLdouble *") double[] params) { + long __functionAddress = GL.getICD().glGetVertexAttribLdv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(index, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glViewportArrayv ViewportArrayv} + * + * @see Reference Page + */ + public static void glViewportArrayv(@NativeType("GLuint") int first, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glViewportArrayv; + if (CHECKS) { + check(__functionAddress); + } + callPV(first, v.length >> 2, v, __functionAddress); + } + + /** + * Array version of: {@link #glViewportIndexedfv ViewportIndexedfv} + * + * @see Reference Page + */ + public static void glViewportIndexedfv(@NativeType("GLuint") int index, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glViewportIndexedfv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glScissorArrayv ScissorArrayv} + * + * @see Reference Page + */ + public static void glScissorArrayv(@NativeType("GLuint") int first, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glScissorArrayv; + if (CHECKS) { + check(__functionAddress); + } + callPV(first, v.length >> 2, v, __functionAddress); + } + + /** + * Array version of: {@link #glScissorIndexedv ScissorIndexedv} + * + * @see Reference Page + */ + public static void glScissorIndexedv(@NativeType("GLuint") int index, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glScissorIndexedv; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** + * Array version of: {@link #glDepthRangeArrayv DepthRangeArrayv} + * + * @see Reference Page + */ + public static void glDepthRangeArrayv(@NativeType("GLuint") int first, @NativeType("GLdouble const *") double[] v) { + long __functionAddress = GL.getICD().glDepthRangeArrayv; + if (CHECKS) { + check(__functionAddress); + } + callPV(first, v.length >> 1, v, __functionAddress); + } + + /** + * Array version of: {@link #glGetFloati_v GetFloati_v} + * + * @see Reference Page + */ + public static void glGetFloati_v(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLfloat *") float[] data) { + long __functionAddress = GL.getICD().glGetFloati_v; + if (CHECKS) { + check(__functionAddress); + check(data, 1); + } + callPV(target, index, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetDoublei_v GetDoublei_v} + * + * @see Reference Page + */ + public static void glGetDoublei_v(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLdouble *") double[] data) { + long __functionAddress = GL.getICD().glGetDoublei_v; + if (CHECKS) { + check(__functionAddress); + check(data, 1); + } + callPV(target, index, data, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL42.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL42.java new file mode 100644 index 00000000..ee8a302c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL42.java @@ -0,0 +1,620 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * The OpenGL functionality up to version 4.2. Includes the deprecated symbols of the Compatibility Profile. + * + *

OpenGL 4.2 implementations support revision 4.20 of the OpenGL Shading Language.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL42 extends GL41 { + + /** Renamed tokens. */ + public static final int + GL_COPY_READ_BUFFER_BINDING = GL31.GL_COPY_READ_BUFFER, + GL_COPY_WRITE_BUFFER_BINDING = GL31.GL_COPY_WRITE_BUFFER, + GL_TRANSFORM_FEEDBACK_ACTIVE = GL40.GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE, + GL_TRANSFORM_FEEDBACK_PAUSED = GL40.GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED; + + /** + * Accepted by the {@code internalformat} parameter of TexImage2D, TexImage3D, CopyTexImage2D, CopyTexImage3D, CompressedTexImage2D, and + * CompressedTexImage3D and the {@code format} parameter of CompressedTexSubImage2D and CompressedTexSubImage3D. + */ + public static final int + GL_COMPRESSED_RGBA_BPTC_UNORM = 0x8E8C, + GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM = 0x8E8D, + GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT = 0x8E8E, + GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 0x8E8F; + + /** Accepted by the {@code pname} parameter of PixelStore[fi], GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int + GL_UNPACK_COMPRESSED_BLOCK_WIDTH = 0x9127, + GL_UNPACK_COMPRESSED_BLOCK_HEIGHT = 0x9128, + GL_UNPACK_COMPRESSED_BLOCK_DEPTH = 0x9129, + GL_UNPACK_COMPRESSED_BLOCK_SIZE = 0x912A, + GL_PACK_COMPRESSED_BLOCK_WIDTH = 0x912B, + GL_PACK_COMPRESSED_BLOCK_HEIGHT = 0x912C, + GL_PACK_COMPRESSED_BLOCK_DEPTH = 0x912D, + GL_PACK_COMPRESSED_BLOCK_SIZE = 0x912E; + + /** Accepted by the {@code target} parameter of BindBufferBase and BindBufferRange. */ + public static final int GL_ATOMIC_COUNTER_BUFFER = 0x92C0; + + /** + * Accepted by the {@code pname} parameter of GetBooleani_v, GetIntegeri_v, GetFloati_v, GetDoublei_v, GetInteger64i_v, GetBooleanv, GetIntegerv, + * GetInteger64v, GetFloatv, GetDoublev, and GetActiveAtomicCounterBufferiv. + */ + public static final int GL_ATOMIC_COUNTER_BUFFER_BINDING = 0x92C1; + + /** Accepted by the {@code pname} parameter of GetIntegeri_64v. */ + public static final int + GL_ATOMIC_COUNTER_BUFFER_START = 0x92C2, + GL_ATOMIC_COUNTER_BUFFER_SIZE = 0x92C3; + + /** Accepted by the {@code pname} parameter of GetActiveAtomicCounterBufferiv. */ + public static final int + GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE = 0x92C4, + GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS = 0x92C5, + GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES = 0x92C6, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER = 0x92C7, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER = 0x92C8, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x92C9, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER = 0x92CA, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER = 0x92CB; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS = 0x92CC, + GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS = 0x92CD, + GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS = 0x92CE, + GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS = 0x92CF, + GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS = 0x92D0, + GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS = 0x92D1, + GL_MAX_VERTEX_ATOMIC_COUNTERS = 0x92D2, + GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS = 0x92D3, + GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS = 0x92D4, + GL_MAX_GEOMETRY_ATOMIC_COUNTERS = 0x92D5, + GL_MAX_FRAGMENT_ATOMIC_COUNTERS = 0x92D6, + GL_MAX_COMBINED_ATOMIC_COUNTERS = 0x92D7, + GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE = 0x92D8, + GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS = 0x92DC; + + /** Accepted by the {@code pname} parameter of GetProgramiv. */ + public static final int GL_ACTIVE_ATOMIC_COUNTER_BUFFERS = 0x92D9; + + /** Accepted by the {@code pname} parameter of GetActiveUniformsiv. */ + public static final int GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX = 0x92DA; + + /** Returned in {@code params} by GetActiveUniform and GetActiveUniformsiv. */ + public static final int GL_UNSIGNED_INT_ATOMIC_COUNTER = 0x92DB; + + /** Accepted by the {@code value} parameter of GetTexParameter{if}v. */ + public static final int GL_TEXTURE_IMMUTABLE_FORMAT = 0x912F; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev, and GetInteger64v. */ + public static final int + GL_MAX_IMAGE_UNITS = 0x8F38, + GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS = 0x8F39, + GL_MAX_IMAGE_SAMPLES = 0x906D, + GL_MAX_VERTEX_IMAGE_UNIFORMS = 0x90CA, + GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS = 0x90CB, + GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS = 0x90CC, + GL_MAX_GEOMETRY_IMAGE_UNIFORMS = 0x90CD, + GL_MAX_FRAGMENT_IMAGE_UNIFORMS = 0x90CE, + GL_MAX_COMBINED_IMAGE_UNIFORMS = 0x90CF; + + /** Accepted by the {@code target} parameter of GetIntegeri_v and GetBooleani_v. */ + public static final int + GL_IMAGE_BINDING_NAME = 0x8F3A, + GL_IMAGE_BINDING_LEVEL = 0x8F3B, + GL_IMAGE_BINDING_LAYERED = 0x8F3C, + GL_IMAGE_BINDING_LAYER = 0x8F3D, + GL_IMAGE_BINDING_ACCESS = 0x8F3E, + GL_IMAGE_BINDING_FORMAT = 0x906E; + + /** Accepted by the {@code barriers} parameter of MemoryBarrier. */ + public static final int + GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT = 0x1, + GL_ELEMENT_ARRAY_BARRIER_BIT = 0x2, + GL_UNIFORM_BARRIER_BIT = 0x4, + GL_TEXTURE_FETCH_BARRIER_BIT = 0x8, + GL_SHADER_IMAGE_ACCESS_BARRIER_BIT = 0x20, + GL_COMMAND_BARRIER_BIT = 0x40, + GL_PIXEL_BUFFER_BARRIER_BIT = 0x80, + GL_TEXTURE_UPDATE_BARRIER_BIT = 0x100, + GL_BUFFER_UPDATE_BARRIER_BIT = 0x200, + GL_FRAMEBUFFER_BARRIER_BIT = 0x400, + GL_TRANSFORM_FEEDBACK_BARRIER_BIT = 0x800, + GL_ATOMIC_COUNTER_BARRIER_BIT = 0x1000, + GL_ALL_BARRIER_BITS = 0xFFFFFFFF; + + /** Returned by the {@code type} parameter of GetActiveUniform. */ + public static final int + GL_IMAGE_1D = 0x904C, + GL_IMAGE_2D = 0x904D, + GL_IMAGE_3D = 0x904E, + GL_IMAGE_2D_RECT = 0x904F, + GL_IMAGE_CUBE = 0x9050, + GL_IMAGE_BUFFER = 0x9051, + GL_IMAGE_1D_ARRAY = 0x9052, + GL_IMAGE_2D_ARRAY = 0x9053, + GL_IMAGE_CUBE_MAP_ARRAY = 0x9054, + GL_IMAGE_2D_MULTISAMPLE = 0x9055, + GL_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9056, + GL_INT_IMAGE_1D = 0x9057, + GL_INT_IMAGE_2D = 0x9058, + GL_INT_IMAGE_3D = 0x9059, + GL_INT_IMAGE_2D_RECT = 0x905A, + GL_INT_IMAGE_CUBE = 0x905B, + GL_INT_IMAGE_BUFFER = 0x905C, + GL_INT_IMAGE_1D_ARRAY = 0x905D, + GL_INT_IMAGE_2D_ARRAY = 0x905E, + GL_INT_IMAGE_CUBE_MAP_ARRAY = 0x905F, + GL_INT_IMAGE_2D_MULTISAMPLE = 0x9060, + GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9061, + GL_UNSIGNED_INT_IMAGE_1D = 0x9062, + GL_UNSIGNED_INT_IMAGE_2D = 0x9063, + GL_UNSIGNED_INT_IMAGE_3D = 0x9064, + GL_UNSIGNED_INT_IMAGE_2D_RECT = 0x9065, + GL_UNSIGNED_INT_IMAGE_CUBE = 0x9066, + GL_UNSIGNED_INT_IMAGE_BUFFER = 0x9067, + GL_UNSIGNED_INT_IMAGE_1D_ARRAY = 0x9068, + GL_UNSIGNED_INT_IMAGE_2D_ARRAY = 0x9069, + GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY = 0x906A, + GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE = 0x906B, + GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x906C; + + /** Accepted by the {@code value} parameter of GetTexParameteriv, GetTexParameterfv, GetTexParameterIiv, and GetTexParameterIuiv. */ + public static final int GL_IMAGE_FORMAT_COMPATIBILITY_TYPE = 0x90C7; + + /** + * Returned in the {@code data} parameter of GetTexParameteriv, GetTexParameterfv, GetTexParameterIiv, and GetTexParameterIuiv when {@code value} is + * IMAGE_FORMAT_COMPATIBILITY_TYPE. + */ + public static final int + GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE = 0x90C8, + GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS = 0x90C9; + + /** Accepted by the {@code pname} parameter of GetInternalformativ. */ + public static final int GL_NUM_SAMPLE_COUNTS = 0x9380; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int GL_MIN_MAP_BUFFER_ALIGNMENT = 0x90BC; + + static { GL.initialize(); } + + protected GL42() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glGetActiveAtomicCounterBufferiv, caps.glTexStorage1D, caps.glTexStorage2D, caps.glTexStorage3D, caps.glDrawTransformFeedbackInstanced, + caps.glDrawTransformFeedbackStreamInstanced, caps.glDrawArraysInstancedBaseInstance, caps.glDrawElementsInstancedBaseInstance, + caps.glDrawElementsInstancedBaseVertexBaseInstance, caps.glBindImageTexture, caps.glMemoryBarrier, caps.glGetInternalformativ + ); + } + + // --- [ glGetActiveAtomicCounterBufferiv ] --- + + /** Unsafe version of: {@link #glGetActiveAtomicCounterBufferiv GetActiveAtomicCounterBufferiv} */ + public static void nglGetActiveAtomicCounterBufferiv(int program, int bufferIndex, int pname, long params) { + GL42C.nglGetActiveAtomicCounterBufferiv(program, bufferIndex, pname, params); + } + + /** + * Obtains information about the set of active atomic counter buffers for a program. + * + * @param program the name of a program object for which the command {@link GL20C#glLinkProgram LinkProgram} has been issued in the past + * @param bufferIndex the index of an active atomic counter buffer + * @param pname the parameter to query. One of:
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE ATOMIC_COUNTER_BUFFER_DATA_SIZE}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER}
+ * @param params a buffer in which to place the returned value + * + * @see Reference Page + */ + public static void glGetActiveAtomicCounterBufferiv(@NativeType("GLuint") int program, @NativeType("GLuint") int bufferIndex, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL42C.glGetActiveAtomicCounterBufferiv(program, bufferIndex, pname, params); + } + + /** + * Obtains information about the set of active atomic counter buffers for a program. + * + * @param program the name of a program object for which the command {@link GL20C#glLinkProgram LinkProgram} has been issued in the past + * @param bufferIndex the index of an active atomic counter buffer + * @param pname the parameter to query. One of:
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE ATOMIC_COUNTER_BUFFER_DATA_SIZE}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER}
{@link GL42C#GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetActiveAtomicCounterBufferi(@NativeType("GLuint") int program, @NativeType("GLuint") int bufferIndex, @NativeType("GLenum") int pname) { + return GL42C.glGetActiveAtomicCounterBufferi(program, bufferIndex, pname); + } + + // --- [ glTexStorage1D ] --- + + /** + * Simultaneously specifies storage for all levels of a one-dimensional texture. + * + * @param target the target of the operation. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}
+ * @param levels the number of texture levels + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * + * @see Reference Page + */ + public static void glTexStorage1D(@NativeType("GLenum") int target, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width) { + GL42C.glTexStorage1D(target, levels, internalformat, width); + } + + // --- [ glTexStorage2D ] --- + + /** + * Simultaneously specifies storage for all levels of a two-dimensional or one-dimensional array texture. + * + * @param target the target of the operation. One of:
{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL11#GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
+ * @param levels the number of texture levels + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * + * @see Reference Page + */ + public static void glTexStorage2D(@NativeType("GLenum") int target, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL42C.glTexStorage2D(target, levels, internalformat, width, height); + } + + // --- [ glTexStorage3D ] --- + + /** + * Simultaneously specifies storage for all levels of a three-dimensional, two-dimensional array or cube-map array texture. + * + * @param target the target of the operation. One of:
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL12#GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}
+ * @param levels the number of texture levels + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * @param depth the depth of the texture, in texels + * + * @see Reference Page + */ + public static void glTexStorage3D(@NativeType("GLenum") int target, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth) { + GL42C.glTexStorage3D(target, levels, internalformat, width, height, depth); + } + + // --- [ glDrawTransformFeedbackInstanced ] --- + + /** + * Renders multiple instances of primitives using a count derived from a transform feedback object. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param id the name of a transform feedback object from which to retrieve a primitive count + * @param primcount the number of instances of the geometry to render + * + * @see Reference Page + */ + public static void glDrawTransformFeedbackInstanced(@NativeType("GLenum") int mode, @NativeType("GLuint") int id, @NativeType("GLsizei") int primcount) { + GL42C.glDrawTransformFeedbackInstanced(mode, id, primcount); + } + + // --- [ glDrawTransformFeedbackStreamInstanced ] --- + + /** + * Renders multiple instances of primitives using a count derived from a specifed stream of a transform feedback object. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param id the name of a transform feedback object from which to retrieve a primitive count + * @param stream the index of the transform feedback stream from which to retrieve a primitive count + * @param primcount the number of instances of the geometry to render + * + * @see Reference Page + */ + public static void glDrawTransformFeedbackStreamInstanced(@NativeType("GLenum") int mode, @NativeType("GLuint") int id, @NativeType("GLuint") int stream, @NativeType("GLsizei") int primcount) { + GL42C.glDrawTransformFeedbackStreamInstanced(mode, id, stream, primcount); + } + + // --- [ glDrawArraysInstancedBaseInstance ] --- + + /** + * Draws multiple instances of a range of elements with an offset applied to instanced attributes. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param first the starting index in the enabled arrays + * @param count the number of indices to be rendered + * @param primcount the number of instances of the specified range of indices to be rendered + * @param baseinstance the base instance for use in fetching instanced vertex attributes + * + * @see Reference Page + */ + public static void glDrawArraysInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("GLint") int first, @NativeType("GLsizei") int count, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance) { + GL42C.glDrawArraysInstancedBaseInstance(mode, first, count, primcount, baseinstance); + } + + // --- [ glDrawElementsInstancedBaseInstance ] --- + + /** + * Unsafe version of: {@link #glDrawElementsInstancedBaseInstance DrawElementsInstancedBaseInstance} + * + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static void nglDrawElementsInstancedBaseInstance(int mode, int count, int type, long indices, int primcount, int baseinstance) { + GL42C.nglDrawElementsInstancedBaseInstance(mode, count, type, indices, primcount, baseinstance); + } + + /** + * Draws multiple instances of a set of elements with an offset applied to instanced attributes + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the specified range of indices to be rendered + * @param baseinstance the base instance for use in fetching instanced vertex attributes + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance) { + GL42C.glDrawElementsInstancedBaseInstance(mode, count, type, indices, primcount, baseinstance); + } + + /** + * Draws multiple instances of a set of elements with an offset applied to instanced attributes + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the specified range of indices to be rendered + * @param baseinstance the base instance for use in fetching instanced vertex attributes + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance) { + GL42C.glDrawElementsInstancedBaseInstance(mode, type, indices, primcount, baseinstance); + } + + /** + * Draws multiple instances of a set of elements with an offset applied to instanced attributes + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the specified range of indices to be rendered + * @param baseinstance the base instance for use in fetching instanced vertex attributes + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance) { + GL42C.glDrawElementsInstancedBaseInstance(mode, indices, primcount, baseinstance); + } + + /** + * Draws multiple instances of a set of elements with an offset applied to instanced attributes + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the specified range of indices to be rendered + * @param baseinstance the base instance for use in fetching instanced vertex attributes + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("void const *") ShortBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance) { + GL42C.glDrawElementsInstancedBaseInstance(mode, indices, primcount, baseinstance); + } + + /** + * Draws multiple instances of a set of elements with an offset applied to instanced attributes + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the specified range of indices to be rendered + * @param baseinstance the base instance for use in fetching instanced vertex attributes + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance) { + GL42C.glDrawElementsInstancedBaseInstance(mode, indices, primcount, baseinstance); + } + + // --- [ glDrawElementsInstancedBaseVertexBaseInstance ] --- + + /** + * Unsafe version of: {@link #glDrawElementsInstancedBaseVertexBaseInstance DrawElementsInstancedBaseVertexBaseInstance} + * + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static void nglDrawElementsInstancedBaseVertexBaseInstance(int mode, int count, int type, long indices, int primcount, int basevertex, int baseinstance) { + GL42C.nglDrawElementsInstancedBaseVertexBaseInstance(mode, count, type, indices, primcount, basevertex, baseinstance); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * @param baseinstance the base instance for use in fetching instanced vertex attributes + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseVertexBaseInstance(@NativeType("GLenum") int mode, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex, @NativeType("GLuint") int baseinstance) { + GL42C.glDrawElementsInstancedBaseVertexBaseInstance(mode, count, type, indices, primcount, basevertex, baseinstance); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * @param baseinstance the base instance for use in fetching instanced vertex attributes + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseVertexBaseInstance(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex, @NativeType("GLuint") int baseinstance) { + GL42C.glDrawElementsInstancedBaseVertexBaseInstance(mode, type, indices, primcount, basevertex, baseinstance); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * @param baseinstance the base instance for use in fetching instanced vertex attributes + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseVertexBaseInstance(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex, @NativeType("GLuint") int baseinstance) { + GL42C.glDrawElementsInstancedBaseVertexBaseInstance(mode, indices, primcount, basevertex, baseinstance); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * @param baseinstance the base instance for use in fetching instanced vertex attributes + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseVertexBaseInstance(@NativeType("GLenum") int mode, @NativeType("void const *") ShortBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex, @NativeType("GLuint") int baseinstance) { + GL42C.glDrawElementsInstancedBaseVertexBaseInstance(mode, indices, primcount, basevertex, baseinstance); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * @param baseinstance the base instance for use in fetching instanced vertex attributes + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseVertexBaseInstance(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex, @NativeType("GLuint") int baseinstance) { + GL42C.glDrawElementsInstancedBaseVertexBaseInstance(mode, indices, primcount, basevertex, baseinstance); + } + + // --- [ glBindImageTexture ] --- + + /** + * Binds a level of a texture to an image unit. + * + * @param unit the index of the image unit to which to bind the texture + * @param texture the name of the texture to bind to the image unit + * @param level the level of the texture that is to be bound + * @param layered whether a layered texture binding is to be established + * @param layer if {@code layered} is false, specifies the layer of texture to be bound to the image unit. Ignored otherwise. + * @param access a token indicating the type of access that will be performed on the image + * @param format the format that the elements of the image will be treated as for the purposes of formatted stores + * + * @see Reference Page + */ + public static void glBindImageTexture(@NativeType("GLuint") int unit, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLboolean") boolean layered, @NativeType("GLint") int layer, @NativeType("GLenum") int access, @NativeType("GLenum") int format) { + GL42C.glBindImageTexture(unit, texture, level, layered, layer, access, format); + } + + // --- [ glMemoryBarrier ] --- + + /** + * Defines a barrier ordering memory transactions. + * + * @param barriers the barriers to insert (bitwise combination). One or more of:
{@link GL42C#GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT VERTEX_ATTRIB_ARRAY_BARRIER_BIT}{@link GL42C#GL_ELEMENT_ARRAY_BARRIER_BIT ELEMENT_ARRAY_BARRIER_BIT}{@link GL42C#GL_UNIFORM_BARRIER_BIT UNIFORM_BARRIER_BIT}
{@link GL42C#GL_TEXTURE_FETCH_BARRIER_BIT TEXTURE_FETCH_BARRIER_BIT}{@link GL42C#GL_SHADER_IMAGE_ACCESS_BARRIER_BIT SHADER_IMAGE_ACCESS_BARRIER_BIT}{@link GL42C#GL_COMMAND_BARRIER_BIT COMMAND_BARRIER_BIT}
{@link GL42C#GL_PIXEL_BUFFER_BARRIER_BIT PIXEL_BUFFER_BARRIER_BIT}{@link GL42C#GL_TEXTURE_UPDATE_BARRIER_BIT TEXTURE_UPDATE_BARRIER_BIT}{@link GL42C#GL_BUFFER_UPDATE_BARRIER_BIT BUFFER_UPDATE_BARRIER_BIT}
{@link GL42C#GL_FRAMEBUFFER_BARRIER_BIT FRAMEBUFFER_BARRIER_BIT}{@link GL42C#GL_TRANSFORM_FEEDBACK_BARRIER_BIT TRANSFORM_FEEDBACK_BARRIER_BIT}{@link GL42C#GL_ATOMIC_COUNTER_BARRIER_BIT ATOMIC_COUNTER_BARRIER_BIT}
{@link GL42C#GL_ALL_BARRIER_BITS ALL_BARRIER_BITS}{@link GL43#GL_SHADER_STORAGE_BARRIER_BIT SHADER_STORAGE_BARRIER_BIT}
+ * + * @see Reference Page + */ + public static void glMemoryBarrier(@NativeType("GLbitfield") int barriers) { + GL42C.glMemoryBarrier(barriers); + } + + // --- [ glGetInternalformativ ] --- + + /** + * Unsafe version of: {@link #glGetInternalformativ GetInternalformativ} + * + * @param bufSize the maximum number of values that may be written to params by the function + */ + public static void nglGetInternalformativ(int target, int internalformat, int pname, int bufSize, long params) { + GL42C.nglGetInternalformativ(target, internalformat, pname, bufSize, params); + } + + /** + * Retrieves information about implementation-dependent support for internal formats. + * + * @param target the usage of the internal format. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param internalformat the internal format about which to retrieve information + * @param pname the type of information to query + * @param params a variable into which to write the retrieved information + * + * @see Reference Page + */ + public static void glGetInternalformativ(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL42C.glGetInternalformativ(target, internalformat, pname, params); + } + + /** + * Retrieves information about implementation-dependent support for internal formats. + * + * @param target the usage of the internal format. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param internalformat the internal format about which to retrieve information + * @param pname the type of information to query + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetInternalformati(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int pname) { + return GL42C.glGetInternalformati(target, internalformat, pname); + } + + /** + * Array version of: {@link #glGetActiveAtomicCounterBufferiv GetActiveAtomicCounterBufferiv} + * + * @see Reference Page + */ + public static void glGetActiveAtomicCounterBufferiv(@NativeType("GLuint") int program, @NativeType("GLuint") int bufferIndex, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL42C.glGetActiveAtomicCounterBufferiv(program, bufferIndex, pname, params); + } + + /** + * Array version of: {@link #glGetInternalformativ GetInternalformativ} + * + * @see Reference Page + */ + public static void glGetInternalformativ(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL42C.glGetInternalformativ(target, internalformat, pname, params); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL42C.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL42C.java new file mode 100644 index 00000000..1d55fc2c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL42C.java @@ -0,0 +1,617 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality up to version 4.2. Includes only Core Profile symbols. + * + *

OpenGL 4.2 implementations support revision 4.20 of the OpenGL Shading Language.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL42C extends GL41C { + + /** Renamed tokens. */ + public static final int + GL_COPY_READ_BUFFER_BINDING = GL31.GL_COPY_READ_BUFFER, + GL_COPY_WRITE_BUFFER_BINDING = GL31.GL_COPY_WRITE_BUFFER, + GL_TRANSFORM_FEEDBACK_ACTIVE = GL40.GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE, + GL_TRANSFORM_FEEDBACK_PAUSED = GL40.GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED; + + /** + * Accepted by the {@code internalformat} parameter of TexImage2D, TexImage3D, CopyTexImage2D, CopyTexImage3D, CompressedTexImage2D, and + * CompressedTexImage3D and the {@code format} parameter of CompressedTexSubImage2D and CompressedTexSubImage3D. + */ + public static final int + GL_COMPRESSED_RGBA_BPTC_UNORM = 0x8E8C, + GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM = 0x8E8D, + GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT = 0x8E8E, + GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT = 0x8E8F; + + /** Accepted by the {@code pname} parameter of PixelStore[fi], GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int + GL_UNPACK_COMPRESSED_BLOCK_WIDTH = 0x9127, + GL_UNPACK_COMPRESSED_BLOCK_HEIGHT = 0x9128, + GL_UNPACK_COMPRESSED_BLOCK_DEPTH = 0x9129, + GL_UNPACK_COMPRESSED_BLOCK_SIZE = 0x912A, + GL_PACK_COMPRESSED_BLOCK_WIDTH = 0x912B, + GL_PACK_COMPRESSED_BLOCK_HEIGHT = 0x912C, + GL_PACK_COMPRESSED_BLOCK_DEPTH = 0x912D, + GL_PACK_COMPRESSED_BLOCK_SIZE = 0x912E; + + /** Accepted by the {@code target} parameter of BindBufferBase and BindBufferRange. */ + public static final int GL_ATOMIC_COUNTER_BUFFER = 0x92C0; + + /** + * Accepted by the {@code pname} parameter of GetBooleani_v, GetIntegeri_v, GetFloati_v, GetDoublei_v, GetInteger64i_v, GetBooleanv, GetIntegerv, + * GetInteger64v, GetFloatv, GetDoublev, and GetActiveAtomicCounterBufferiv. + */ + public static final int GL_ATOMIC_COUNTER_BUFFER_BINDING = 0x92C1; + + /** Accepted by the {@code pname} parameter of GetIntegeri_64v. */ + public static final int + GL_ATOMIC_COUNTER_BUFFER_START = 0x92C2, + GL_ATOMIC_COUNTER_BUFFER_SIZE = 0x92C3; + + /** Accepted by the {@code pname} parameter of GetActiveAtomicCounterBufferiv. */ + public static final int + GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE = 0x92C4, + GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS = 0x92C5, + GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES = 0x92C6, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER = 0x92C7, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER = 0x92C8, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x92C9, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER = 0x92CA, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER = 0x92CB; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS = 0x92CC, + GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS = 0x92CD, + GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS = 0x92CE, + GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS = 0x92CF, + GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS = 0x92D0, + GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS = 0x92D1, + GL_MAX_VERTEX_ATOMIC_COUNTERS = 0x92D2, + GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS = 0x92D3, + GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS = 0x92D4, + GL_MAX_GEOMETRY_ATOMIC_COUNTERS = 0x92D5, + GL_MAX_FRAGMENT_ATOMIC_COUNTERS = 0x92D6, + GL_MAX_COMBINED_ATOMIC_COUNTERS = 0x92D7, + GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE = 0x92D8, + GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS = 0x92DC; + + /** Accepted by the {@code pname} parameter of GetProgramiv. */ + public static final int GL_ACTIVE_ATOMIC_COUNTER_BUFFERS = 0x92D9; + + /** Accepted by the {@code pname} parameter of GetActiveUniformsiv. */ + public static final int GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX = 0x92DA; + + /** Returned in {@code params} by GetActiveUniform and GetActiveUniformsiv. */ + public static final int GL_UNSIGNED_INT_ATOMIC_COUNTER = 0x92DB; + + /** Accepted by the {@code value} parameter of GetTexParameter{if}v. */ + public static final int GL_TEXTURE_IMMUTABLE_FORMAT = 0x912F; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev, and GetInteger64v. */ + public static final int + GL_MAX_IMAGE_UNITS = 0x8F38, + GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS = 0x8F39, + GL_MAX_IMAGE_SAMPLES = 0x906D, + GL_MAX_VERTEX_IMAGE_UNIFORMS = 0x90CA, + GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS = 0x90CB, + GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS = 0x90CC, + GL_MAX_GEOMETRY_IMAGE_UNIFORMS = 0x90CD, + GL_MAX_FRAGMENT_IMAGE_UNIFORMS = 0x90CE, + GL_MAX_COMBINED_IMAGE_UNIFORMS = 0x90CF; + + /** Accepted by the {@code target} parameter of GetIntegeri_v and GetBooleani_v. */ + public static final int + GL_IMAGE_BINDING_NAME = 0x8F3A, + GL_IMAGE_BINDING_LEVEL = 0x8F3B, + GL_IMAGE_BINDING_LAYERED = 0x8F3C, + GL_IMAGE_BINDING_LAYER = 0x8F3D, + GL_IMAGE_BINDING_ACCESS = 0x8F3E, + GL_IMAGE_BINDING_FORMAT = 0x906E; + + /** Accepted by the {@code barriers} parameter of MemoryBarrier. */ + public static final int + GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT = 0x1, + GL_ELEMENT_ARRAY_BARRIER_BIT = 0x2, + GL_UNIFORM_BARRIER_BIT = 0x4, + GL_TEXTURE_FETCH_BARRIER_BIT = 0x8, + GL_SHADER_IMAGE_ACCESS_BARRIER_BIT = 0x20, + GL_COMMAND_BARRIER_BIT = 0x40, + GL_PIXEL_BUFFER_BARRIER_BIT = 0x80, + GL_TEXTURE_UPDATE_BARRIER_BIT = 0x100, + GL_BUFFER_UPDATE_BARRIER_BIT = 0x200, + GL_FRAMEBUFFER_BARRIER_BIT = 0x400, + GL_TRANSFORM_FEEDBACK_BARRIER_BIT = 0x800, + GL_ATOMIC_COUNTER_BARRIER_BIT = 0x1000, + GL_ALL_BARRIER_BITS = 0xFFFFFFFF; + + /** Returned by the {@code type} parameter of GetActiveUniform. */ + public static final int + GL_IMAGE_1D = 0x904C, + GL_IMAGE_2D = 0x904D, + GL_IMAGE_3D = 0x904E, + GL_IMAGE_2D_RECT = 0x904F, + GL_IMAGE_CUBE = 0x9050, + GL_IMAGE_BUFFER = 0x9051, + GL_IMAGE_1D_ARRAY = 0x9052, + GL_IMAGE_2D_ARRAY = 0x9053, + GL_IMAGE_CUBE_MAP_ARRAY = 0x9054, + GL_IMAGE_2D_MULTISAMPLE = 0x9055, + GL_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9056, + GL_INT_IMAGE_1D = 0x9057, + GL_INT_IMAGE_2D = 0x9058, + GL_INT_IMAGE_3D = 0x9059, + GL_INT_IMAGE_2D_RECT = 0x905A, + GL_INT_IMAGE_CUBE = 0x905B, + GL_INT_IMAGE_BUFFER = 0x905C, + GL_INT_IMAGE_1D_ARRAY = 0x905D, + GL_INT_IMAGE_2D_ARRAY = 0x905E, + GL_INT_IMAGE_CUBE_MAP_ARRAY = 0x905F, + GL_INT_IMAGE_2D_MULTISAMPLE = 0x9060, + GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x9061, + GL_UNSIGNED_INT_IMAGE_1D = 0x9062, + GL_UNSIGNED_INT_IMAGE_2D = 0x9063, + GL_UNSIGNED_INT_IMAGE_3D = 0x9064, + GL_UNSIGNED_INT_IMAGE_2D_RECT = 0x9065, + GL_UNSIGNED_INT_IMAGE_CUBE = 0x9066, + GL_UNSIGNED_INT_IMAGE_BUFFER = 0x9067, + GL_UNSIGNED_INT_IMAGE_1D_ARRAY = 0x9068, + GL_UNSIGNED_INT_IMAGE_2D_ARRAY = 0x9069, + GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY = 0x906A, + GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE = 0x906B, + GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY = 0x906C; + + /** Accepted by the {@code value} parameter of GetTexParameteriv, GetTexParameterfv, GetTexParameterIiv, and GetTexParameterIuiv. */ + public static final int GL_IMAGE_FORMAT_COMPATIBILITY_TYPE = 0x90C7; + + /** + * Returned in the {@code data} parameter of GetTexParameteriv, GetTexParameterfv, GetTexParameterIiv, and GetTexParameterIuiv when {@code value} is + * IMAGE_FORMAT_COMPATIBILITY_TYPE. + */ + public static final int + GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE = 0x90C8, + GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS = 0x90C9; + + /** Accepted by the {@code pname} parameter of GetInternalformativ. */ + public static final int GL_NUM_SAMPLE_COUNTS = 0x9380; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int GL_MIN_MAP_BUFFER_ALIGNMENT = 0x90BC; + + static { GL.initialize(); } + + protected GL42C() { + throw new UnsupportedOperationException(); + } + + // --- [ glGetActiveAtomicCounterBufferiv ] --- + + /** Unsafe version of: {@link #glGetActiveAtomicCounterBufferiv GetActiveAtomicCounterBufferiv} */ + public static native void nglGetActiveAtomicCounterBufferiv(int program, int bufferIndex, int pname, long params); + + /** + * Obtains information about the set of active atomic counter buffers for a program. + * + * @param program the name of a program object for which the command {@link GL20C#glLinkProgram LinkProgram} has been issued in the past + * @param bufferIndex the index of an active atomic counter buffer + * @param pname the parameter to query. One of:
{@link #GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE ATOMIC_COUNTER_BUFFER_DATA_SIZE}
{@link #GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS}
{@link #GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES}
{@link #GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER}
{@link #GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER}
{@link #GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER}
{@link #GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER}
{@link #GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER}
+ * @param params a buffer in which to place the returned value + * + * @see Reference Page + */ + public static void glGetActiveAtomicCounterBufferiv(@NativeType("GLuint") int program, @NativeType("GLuint") int bufferIndex, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetActiveAtomicCounterBufferiv(program, bufferIndex, pname, memAddress(params)); + } + + /** + * Obtains information about the set of active atomic counter buffers for a program. + * + * @param program the name of a program object for which the command {@link GL20C#glLinkProgram LinkProgram} has been issued in the past + * @param bufferIndex the index of an active atomic counter buffer + * @param pname the parameter to query. One of:
{@link #GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE ATOMIC_COUNTER_BUFFER_DATA_SIZE}
{@link #GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS}
{@link #GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES}
{@link #GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER}
{@link #GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER}
{@link #GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER}
{@link #GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER}
{@link #GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetActiveAtomicCounterBufferi(@NativeType("GLuint") int program, @NativeType("GLuint") int bufferIndex, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetActiveAtomicCounterBufferiv(program, bufferIndex, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glTexStorage1D ] --- + + /** + * Simultaneously specifies storage for all levels of a one-dimensional texture. + * + * @param target the target of the operation. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_PROXY_TEXTURE_1D PROXY_TEXTURE_1D}
+ * @param levels the number of texture levels + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * + * @see Reference Page + */ + public static native void glTexStorage1D(@NativeType("GLenum") int target, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width); + + // --- [ glTexStorage2D ] --- + + /** + * Simultaneously specifies storage for all levels of a two-dimensional or one-dimensional array texture. + * + * @param target the target of the operation. One of:
{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL11#GL_PROXY_TEXTURE_2D PROXY_TEXTURE_2D}{@link GL30#GL_PROXY_TEXTURE_1D_ARRAY PROXY_TEXTURE_1D_ARRAY}{@link GL31#GL_PROXY_TEXTURE_RECTANGLE PROXY_TEXTURE_RECTANGLE}{@link GL13#GL_PROXY_TEXTURE_CUBE_MAP PROXY_TEXTURE_CUBE_MAP}
+ * @param levels the number of texture levels + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * + * @see Reference Page + */ + public static native void glTexStorage2D(@NativeType("GLenum") int target, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glTexStorage3D ] --- + + /** + * Simultaneously specifies storage for all levels of a three-dimensional, two-dimensional array or cube-map array texture. + * + * @param target the target of the operation. One of:
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL12#GL_PROXY_TEXTURE_3D PROXY_TEXTURE_3D}
{@link GL30#GL_PROXY_TEXTURE_2D_ARRAY PROXY_TEXTURE_2D_ARRAY}{@link GL40#GL_PROXY_TEXTURE_CUBE_MAP_ARRAY PROXY_TEXTURE_CUBE_MAP_ARRAY}
+ * @param levels the number of texture levels + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * @param depth the depth of the texture, in texels + * + * @see Reference Page + */ + public static native void glTexStorage3D(@NativeType("GLenum") int target, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth); + + // --- [ glDrawTransformFeedbackInstanced ] --- + + /** + * Renders multiple instances of primitives using a count derived from a transform feedback object. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param id the name of a transform feedback object from which to retrieve a primitive count + * @param primcount the number of instances of the geometry to render + * + * @see Reference Page + */ + public static native void glDrawTransformFeedbackInstanced(@NativeType("GLenum") int mode, @NativeType("GLuint") int id, @NativeType("GLsizei") int primcount); + + // --- [ glDrawTransformFeedbackStreamInstanced ] --- + + /** + * Renders multiple instances of primitives using a count derived from a specifed stream of a transform feedback object. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param id the name of a transform feedback object from which to retrieve a primitive count + * @param stream the index of the transform feedback stream from which to retrieve a primitive count + * @param primcount the number of instances of the geometry to render + * + * @see Reference Page + */ + public static native void glDrawTransformFeedbackStreamInstanced(@NativeType("GLenum") int mode, @NativeType("GLuint") int id, @NativeType("GLuint") int stream, @NativeType("GLsizei") int primcount); + + // --- [ glDrawArraysInstancedBaseInstance ] --- + + /** + * Draws multiple instances of a range of elements with an offset applied to instanced attributes. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param first the starting index in the enabled arrays + * @param count the number of indices to be rendered + * @param primcount the number of instances of the specified range of indices to be rendered + * @param baseinstance the base instance for use in fetching instanced vertex attributes + * + * @see Reference Page + */ + public static native void glDrawArraysInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("GLint") int first, @NativeType("GLsizei") int count, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance); + + // --- [ glDrawElementsInstancedBaseInstance ] --- + + /** + * Unsafe version of: {@link #glDrawElementsInstancedBaseInstance DrawElementsInstancedBaseInstance} + * + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static native void nglDrawElementsInstancedBaseInstance(int mode, int count, int type, long indices, int primcount, int baseinstance); + + /** + * Draws multiple instances of a set of elements with an offset applied to instanced attributes + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the specified range of indices to be rendered + * @param baseinstance the base instance for use in fetching instanced vertex attributes + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance) { + nglDrawElementsInstancedBaseInstance(mode, count, type, indices, primcount, baseinstance); + } + + /** + * Draws multiple instances of a set of elements with an offset applied to instanced attributes + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the specified range of indices to be rendered + * @param baseinstance the base instance for use in fetching instanced vertex attributes + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance) { + nglDrawElementsInstancedBaseInstance(mode, indices.remaining() >> GLChecks.typeToByteShift(type), type, memAddress(indices), primcount, baseinstance); + } + + /** + * Draws multiple instances of a set of elements with an offset applied to instanced attributes + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the specified range of indices to be rendered + * @param baseinstance the base instance for use in fetching instanced vertex attributes + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance) { + nglDrawElementsInstancedBaseInstance(mode, indices.remaining(), GL11.GL_UNSIGNED_BYTE, memAddress(indices), primcount, baseinstance); + } + + /** + * Draws multiple instances of a set of elements with an offset applied to instanced attributes + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the specified range of indices to be rendered + * @param baseinstance the base instance for use in fetching instanced vertex attributes + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("void const *") ShortBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance) { + nglDrawElementsInstancedBaseInstance(mode, indices.remaining(), GL11.GL_UNSIGNED_SHORT, memAddress(indices), primcount, baseinstance); + } + + /** + * Draws multiple instances of a set of elements with an offset applied to instanced attributes + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the specified range of indices to be rendered + * @param baseinstance the base instance for use in fetching instanced vertex attributes + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseInstance(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLuint") int baseinstance) { + nglDrawElementsInstancedBaseInstance(mode, indices.remaining(), GL11.GL_UNSIGNED_INT, memAddress(indices), primcount, baseinstance); + } + + // --- [ glDrawElementsInstancedBaseVertexBaseInstance ] --- + + /** + * Unsafe version of: {@link #glDrawElementsInstancedBaseVertexBaseInstance DrawElementsInstancedBaseVertexBaseInstance} + * + * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ */ + public static native void nglDrawElementsInstancedBaseVertexBaseInstance(int mode, int count, int type, long indices, int primcount, int basevertex, int baseinstance); + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param count the number of elements to be rendered + * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * @param baseinstance the base instance for use in fetching instanced vertex attributes + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseVertexBaseInstance(@NativeType("GLenum") int mode, @NativeType("GLsizei") int count, @NativeType("GLenum") int type, @NativeType("void const *") long indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex, @NativeType("GLuint") int baseinstance) { + nglDrawElementsInstancedBaseVertexBaseInstance(mode, count, type, indices, primcount, basevertex, baseinstance); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of the values in {@code indices}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * @param baseinstance the base instance for use in fetching instanced vertex attributes + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseVertexBaseInstance(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex, @NativeType("GLuint") int baseinstance) { + nglDrawElementsInstancedBaseVertexBaseInstance(mode, indices.remaining() >> GLChecks.typeToByteShift(type), type, memAddress(indices), primcount, basevertex, baseinstance); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * @param baseinstance the base instance for use in fetching instanced vertex attributes + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseVertexBaseInstance(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex, @NativeType("GLuint") int baseinstance) { + nglDrawElementsInstancedBaseVertexBaseInstance(mode, indices.remaining(), GL11.GL_UNSIGNED_BYTE, memAddress(indices), primcount, basevertex, baseinstance); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * @param baseinstance the base instance for use in fetching instanced vertex attributes + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseVertexBaseInstance(@NativeType("GLenum") int mode, @NativeType("void const *") ShortBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex, @NativeType("GLuint") int baseinstance) { + nglDrawElementsInstancedBaseVertexBaseInstance(mode, indices.remaining(), GL11.GL_UNSIGNED_SHORT, memAddress(indices), primcount, basevertex, baseinstance); + } + + /** + * Renders multiple instances of a set of primitives from array data with a per-element offset. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indices a pointer to the location where the indices are stored + * @param primcount the number of instances of the indexed geometry that should be drawn + * @param basevertex a constant that should be added to each element of {@code indices} when choosing elements from the enabled vertex arrays + * @param baseinstance the base instance for use in fetching instanced vertex attributes + * + * @see Reference Page + */ + public static void glDrawElementsInstancedBaseVertexBaseInstance(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indices, @NativeType("GLsizei") int primcount, @NativeType("GLint") int basevertex, @NativeType("GLuint") int baseinstance) { + nglDrawElementsInstancedBaseVertexBaseInstance(mode, indices.remaining(), GL11.GL_UNSIGNED_INT, memAddress(indices), primcount, basevertex, baseinstance); + } + + // --- [ glBindImageTexture ] --- + + /** + * Binds a level of a texture to an image unit. + * + * @param unit the index of the image unit to which to bind the texture + * @param texture the name of the texture to bind to the image unit + * @param level the level of the texture that is to be bound + * @param layered whether a layered texture binding is to be established + * @param layer if {@code layered} is false, specifies the layer of texture to be bound to the image unit. Ignored otherwise. + * @param access a token indicating the type of access that will be performed on the image + * @param format the format that the elements of the image will be treated as for the purposes of formatted stores + * + * @see Reference Page + */ + public static native void glBindImageTexture(@NativeType("GLuint") int unit, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLboolean") boolean layered, @NativeType("GLint") int layer, @NativeType("GLenum") int access, @NativeType("GLenum") int format); + + // --- [ glMemoryBarrier ] --- + + /** + * Defines a barrier ordering memory transactions. + * + * @param barriers the barriers to insert (bitwise combination). One or more of:
{@link #GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT VERTEX_ATTRIB_ARRAY_BARRIER_BIT}{@link #GL_ELEMENT_ARRAY_BARRIER_BIT ELEMENT_ARRAY_BARRIER_BIT}{@link #GL_UNIFORM_BARRIER_BIT UNIFORM_BARRIER_BIT}
{@link #GL_TEXTURE_FETCH_BARRIER_BIT TEXTURE_FETCH_BARRIER_BIT}{@link #GL_SHADER_IMAGE_ACCESS_BARRIER_BIT SHADER_IMAGE_ACCESS_BARRIER_BIT}{@link #GL_COMMAND_BARRIER_BIT COMMAND_BARRIER_BIT}
{@link #GL_PIXEL_BUFFER_BARRIER_BIT PIXEL_BUFFER_BARRIER_BIT}{@link #GL_TEXTURE_UPDATE_BARRIER_BIT TEXTURE_UPDATE_BARRIER_BIT}{@link #GL_BUFFER_UPDATE_BARRIER_BIT BUFFER_UPDATE_BARRIER_BIT}
{@link #GL_FRAMEBUFFER_BARRIER_BIT FRAMEBUFFER_BARRIER_BIT}{@link #GL_TRANSFORM_FEEDBACK_BARRIER_BIT TRANSFORM_FEEDBACK_BARRIER_BIT}{@link #GL_ATOMIC_COUNTER_BARRIER_BIT ATOMIC_COUNTER_BARRIER_BIT}
{@link #GL_ALL_BARRIER_BITS ALL_BARRIER_BITS}{@link GL43#GL_SHADER_STORAGE_BARRIER_BIT SHADER_STORAGE_BARRIER_BIT}
+ * + * @see Reference Page + */ + public static native void glMemoryBarrier(@NativeType("GLbitfield") int barriers); + + // --- [ glGetInternalformativ ] --- + + /** + * Unsafe version of: {@link #glGetInternalformativ GetInternalformativ} + * + * @param bufSize the maximum number of values that may be written to params by the function + */ + public static native void nglGetInternalformativ(int target, int internalformat, int pname, int bufSize, long params); + + /** + * Retrieves information about implementation-dependent support for internal formats. + * + * @param target the usage of the internal format. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param internalformat the internal format about which to retrieve information + * @param pname the type of information to query + * @param params a variable into which to write the retrieved information + * + * @see Reference Page + */ + public static void glGetInternalformativ(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + nglGetInternalformativ(target, internalformat, pname, params.remaining(), memAddress(params)); + } + + /** + * Retrieves information about implementation-dependent support for internal formats. + * + * @param target the usage of the internal format. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param internalformat the internal format about which to retrieve information + * @param pname the type of information to query + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetInternalformati(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetInternalformativ(target, internalformat, pname, 1, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Array version of: {@link #glGetActiveAtomicCounterBufferiv GetActiveAtomicCounterBufferiv} + * + * @see Reference Page + */ + public static void glGetActiveAtomicCounterBufferiv(@NativeType("GLuint") int program, @NativeType("GLuint") int bufferIndex, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetActiveAtomicCounterBufferiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(program, bufferIndex, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetInternalformativ GetInternalformativ} + * + * @see Reference Page + */ + public static void glGetInternalformativ(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetInternalformativ; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, internalformat, pname, params.length, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL43.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL43.java new file mode 100644 index 00000000..ad20b318 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL43.java @@ -0,0 +1,2223 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * The OpenGL functionality up to version 4.3. Includes the deprecated symbols of the Compatibility Profile. + * + *

OpenGL 4.3 implementations support revision 4.30 of the OpenGL Shading Language.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL43 extends GL42 { + + /** No. of supported Shading Language Versions. Accepted by the {@code pname} parameter of GetIntegerv. */ + public static final int GL_NUM_SHADING_LANGUAGE_VERSIONS = 0x82E9; + + /** Vertex attrib array has unconverted doubles. Accepted by the {@code pname} parameter of GetVertexAttribiv. */ + public static final int GL_VERTEX_ATTRIB_ARRAY_LONG = 0x874E; + + /** Accepted by the {@code internalformat} parameter of CompressedTexImage2D. */ + public static final int + GL_COMPRESSED_RGB8_ETC2 = 0x9274, + GL_COMPRESSED_SRGB8_ETC2 = 0x9275, + GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276, + GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277, + GL_COMPRESSED_RGBA8_ETC2_EAC = 0x9278, + GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279, + GL_COMPRESSED_R11_EAC = 0x9270, + GL_COMPRESSED_SIGNED_R11_EAC = 0x9271, + GL_COMPRESSED_RG11_EAC = 0x9272, + GL_COMPRESSED_SIGNED_RG11_EAC = 0x9273; + + /** Accepted by the {@code target} parameter of Enable and Disable. */ + public static final int GL_PRIMITIVE_RESTART_FIXED_INDEX = 0x8D69; + + /** Accepted by the {@code target} parameter of BeginQuery, EndQuery, GetQueryIndexediv and GetQueryiv. */ + public static final int GL_ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A; + + /** Accepted by the {@code value} parameter of the GetInteger* functions. */ + public static final int GL_MAX_ELEMENT_INDEX = 0x8D6B; + + /** Accepted by the {@code pname} parameters of GetTexParameterfv and GetTexParameteriv. */ + public static final int GL_TEXTURE_IMMUTABLE_LEVELS = 0x82DF; + + /** Accepted by the {@code type} parameter of CreateShader and returned in the {@code params} parameter by GetShaderiv. */ + public static final int GL_COMPUTE_SHADER = 0x91B9; + + /** Accepted by the {@code pname} parameter of GetIntegerv, GetBooleanv, GetFloatv, GetDoublev and GetInteger64v. */ + public static final int + GL_MAX_COMPUTE_UNIFORM_BLOCKS = 0x91BB, + GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS = 0x91BC, + GL_MAX_COMPUTE_IMAGE_UNIFORMS = 0x91BD, + GL_MAX_COMPUTE_SHARED_MEMORY_SIZE = 0x8262, + GL_MAX_COMPUTE_UNIFORM_COMPONENTS = 0x8263, + GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS = 0x8264, + GL_MAX_COMPUTE_ATOMIC_COUNTERS = 0x8265, + GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS = 0x8266, + GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS = 0x90EB; + + /** Accepted by the {@code pname} parameter of GetIntegeri_v, GetBooleani_v, GetFloati_v, GetDoublei_v and GetInteger64i_v. */ + public static final int + GL_MAX_COMPUTE_WORK_GROUP_COUNT = 0x91BE, + GL_MAX_COMPUTE_WORK_GROUP_SIZE = 0x91BF; + + /** Accepted by the {@code pname} parameter of GetProgramiv. */ + public static final int GL_COMPUTE_WORK_GROUP_SIZE = 0x8267; + + /** Accepted by the {@code pname} parameter of GetActiveUniformBlockiv. */ + public static final int GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER = 0x90EC; + + /** Accepted by the {@code pname} parameter of GetActiveAtomicCounterBufferiv. */ + public static final int GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER = 0x90ED; + + /** Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, and GetBufferPointerv. */ + public static final int GL_DISPATCH_INDIRECT_BUFFER = 0x90EE; + + /** Accepted by the {@code value} parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int GL_DISPATCH_INDIRECT_BUFFER_BINDING = 0x90EF; + + /** Accepted by the {@code stages} parameter of UseProgramStages. */ + public static final int GL_COMPUTE_SHADER_BIT = 0x20; + + /** Tokens accepted by the {@code target} parameters of Enable, Disable, and IsEnabled. */ + public static final int + GL_DEBUG_OUTPUT = 0x92E0, + GL_DEBUG_OUTPUT_SYNCHRONOUS = 0x8242; + + /** Returned by GetIntegerv when {@code pname} is CONTEXT_FLAGS. */ + public static final int GL_CONTEXT_FLAG_DEBUG_BIT = 0x2; + + /** Tokens accepted by the {@code value} parameters of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v. */ + public static final int + GL_MAX_DEBUG_MESSAGE_LENGTH = 0x9143, + GL_MAX_DEBUG_LOGGED_MESSAGES = 0x9144, + GL_DEBUG_LOGGED_MESSAGES = 0x9145, + GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = 0x8243, + GL_MAX_DEBUG_GROUP_STACK_DEPTH = 0x826C, + GL_DEBUG_GROUP_STACK_DEPTH = 0x826D, + GL_MAX_LABEL_LENGTH = 0x82E8; + + /** Tokens accepted by the {@code pname} parameter of GetPointerv. */ + public static final int + GL_DEBUG_CALLBACK_FUNCTION = 0x8244, + GL_DEBUG_CALLBACK_USER_PARAM = 0x8245; + + /** + * Tokens accepted or provided by the {@code source} parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC, and the {@code sources} parameter + * of GetDebugMessageLog. + */ + public static final int + GL_DEBUG_SOURCE_API = 0x8246, + GL_DEBUG_SOURCE_WINDOW_SYSTEM = 0x8247, + GL_DEBUG_SOURCE_SHADER_COMPILER = 0x8248, + GL_DEBUG_SOURCE_THIRD_PARTY = 0x8249, + GL_DEBUG_SOURCE_APPLICATION = 0x824A, + GL_DEBUG_SOURCE_OTHER = 0x824B; + + /** + * Tokens accepted or provided by the {@code type} parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC, and the {@code types} parameter of + * GetDebugMessageLog. + */ + public static final int + GL_DEBUG_TYPE_ERROR = 0x824C, + GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR = 0x824D, + GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR = 0x824E, + GL_DEBUG_TYPE_PORTABILITY = 0x824F, + GL_DEBUG_TYPE_PERFORMANCE = 0x8250, + GL_DEBUG_TYPE_OTHER = 0x8251, + GL_DEBUG_TYPE_MARKER = 0x8268; + + /** Tokens accepted or provided by the {@code type} parameters of DebugMessageControl and DEBUGPROC, and the {@code types} parameter of GetDebugMessageLog. */ + public static final int + GL_DEBUG_TYPE_PUSH_GROUP = 0x8269, + GL_DEBUG_TYPE_POP_GROUP = 0x826A; + + /** + * Tokens accepted or provided by the {@code severity} parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC callback functions, and the + * {@code severities} parameter of GetDebugMessageLog. + */ + public static final int + GL_DEBUG_SEVERITY_HIGH = 0x9146, + GL_DEBUG_SEVERITY_MEDIUM = 0x9147, + GL_DEBUG_SEVERITY_LOW = 0x9148, + GL_DEBUG_SEVERITY_NOTIFICATION = 0x826B; + + /** Tokens accepted or provided by the {@code identifier} parameters of ObjectLabel and GetObjectLabel. */ + public static final int + GL_BUFFER = 0x82E0, + GL_SHADER = 0x82E1, + GL_PROGRAM = 0x82E2, + GL_QUERY = 0x82E3, + GL_PROGRAM_PIPELINE = 0x82E4, + GL_SAMPLER = 0x82E6, + GL_DISPLAY_LIST = 0x82E7; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev, and GetInteger64v. */ + public static final int GL_MAX_UNIFORM_LOCATIONS = 0x826E; + + /** + * Accepted by the {@code pname} parameter of FramebufferParameteri, GetFramebufferParameteriv, NamedFramebufferParameteriEXT, and + * GetNamedFramebufferParameterivEXT. + */ + public static final int + GL_FRAMEBUFFER_DEFAULT_WIDTH = 0x9310, + GL_FRAMEBUFFER_DEFAULT_HEIGHT = 0x9311, + GL_FRAMEBUFFER_DEFAULT_LAYERS = 0x9312, + GL_FRAMEBUFFER_DEFAULT_SAMPLES = 0x9313, + GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS = 0x9314; + + /** Accepted by the {@code pname} parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_FRAMEBUFFER_WIDTH = 0x9315, + GL_MAX_FRAMEBUFFER_HEIGHT = 0x9316, + GL_MAX_FRAMEBUFFER_LAYERS = 0x9317, + GL_MAX_FRAMEBUFFER_SAMPLES = 0x9318; + + /** Accepted by the {@code pname} parameter of GetInternalformativ and GetInternalformati64v. */ + public static final int + GL_INTERNALFORMAT_SUPPORTED = 0x826F, + GL_INTERNALFORMAT_PREFERRED = 0x8270, + GL_INTERNALFORMAT_RED_SIZE = 0x8271, + GL_INTERNALFORMAT_GREEN_SIZE = 0x8272, + GL_INTERNALFORMAT_BLUE_SIZE = 0x8273, + GL_INTERNALFORMAT_ALPHA_SIZE = 0x8274, + GL_INTERNALFORMAT_DEPTH_SIZE = 0x8275, + GL_INTERNALFORMAT_STENCIL_SIZE = 0x8276, + GL_INTERNALFORMAT_SHARED_SIZE = 0x8277, + GL_INTERNALFORMAT_RED_TYPE = 0x8278, + GL_INTERNALFORMAT_GREEN_TYPE = 0x8279, + GL_INTERNALFORMAT_BLUE_TYPE = 0x827A, + GL_INTERNALFORMAT_ALPHA_TYPE = 0x827B, + GL_INTERNALFORMAT_DEPTH_TYPE = 0x827C, + GL_INTERNALFORMAT_STENCIL_TYPE = 0x827D, + GL_MAX_WIDTH = 0x827E, + GL_MAX_HEIGHT = 0x827F, + GL_MAX_DEPTH = 0x8280, + GL_MAX_LAYERS = 0x8281, + GL_MAX_COMBINED_DIMENSIONS = 0x8282, + GL_COLOR_COMPONENTS = 0x8283, + GL_DEPTH_COMPONENTS = 0x8284, + GL_STENCIL_COMPONENTS = 0x8285, + GL_COLOR_RENDERABLE = 0x8286, + GL_DEPTH_RENDERABLE = 0x8287, + GL_STENCIL_RENDERABLE = 0x8288, + GL_FRAMEBUFFER_RENDERABLE = 0x8289, + GL_FRAMEBUFFER_RENDERABLE_LAYERED = 0x828A, + GL_FRAMEBUFFER_BLEND = 0x828B, + GL_READ_PIXELS = 0x828C, + GL_READ_PIXELS_FORMAT = 0x828D, + GL_READ_PIXELS_TYPE = 0x828E, + GL_TEXTURE_IMAGE_FORMAT = 0x828F, + GL_TEXTURE_IMAGE_TYPE = 0x8290, + GL_GET_TEXTURE_IMAGE_FORMAT = 0x8291, + GL_GET_TEXTURE_IMAGE_TYPE = 0x8292, + GL_MIPMAP = 0x8293, + GL_MANUAL_GENERATE_MIPMAP = 0x8294, + GL_AUTO_GENERATE_MIPMAP = 0x8295, + GL_COLOR_ENCODING = 0x8296, + GL_SRGB_READ = 0x8297, + GL_SRGB_WRITE = 0x8298, + GL_FILTER = 0x829A, + GL_VERTEX_TEXTURE = 0x829B, + GL_TESS_CONTROL_TEXTURE = 0x829C, + GL_TESS_EVALUATION_TEXTURE = 0x829D, + GL_GEOMETRY_TEXTURE = 0x829E, + GL_FRAGMENT_TEXTURE = 0x829F, + GL_COMPUTE_TEXTURE = 0x82A0, + GL_TEXTURE_SHADOW = 0x82A1, + GL_TEXTURE_GATHER = 0x82A2, + GL_TEXTURE_GATHER_SHADOW = 0x82A3, + GL_SHADER_IMAGE_LOAD = 0x82A4, + GL_SHADER_IMAGE_STORE = 0x82A5, + GL_SHADER_IMAGE_ATOMIC = 0x82A6, + GL_IMAGE_TEXEL_SIZE = 0x82A7, + GL_IMAGE_COMPATIBILITY_CLASS = 0x82A8, + GL_IMAGE_PIXEL_FORMAT = 0x82A9, + GL_IMAGE_PIXEL_TYPE = 0x82AA, + GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST = 0x82AC, + GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST = 0x82AD, + GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE = 0x82AE, + GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE = 0x82AF, + GL_TEXTURE_COMPRESSED_BLOCK_WIDTH = 0x82B1, + GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT = 0x82B2, + GL_TEXTURE_COMPRESSED_BLOCK_SIZE = 0x82B3, + GL_CLEAR_BUFFER = 0x82B4, + GL_TEXTURE_VIEW = 0x82B5, + GL_VIEW_COMPATIBILITY_CLASS = 0x82B6; + + /** Returned as possible responses for various {@code pname} queries to GetInternalformativ and GetInternalformati64v. */ + public static final int + GL_FULL_SUPPORT = 0x82B7, + GL_CAVEAT_SUPPORT = 0x82B8, + GL_IMAGE_CLASS_4_X_32 = 0x82B9, + GL_IMAGE_CLASS_2_X_32 = 0x82BA, + GL_IMAGE_CLASS_1_X_32 = 0x82BB, + GL_IMAGE_CLASS_4_X_16 = 0x82BC, + GL_IMAGE_CLASS_2_X_16 = 0x82BD, + GL_IMAGE_CLASS_1_X_16 = 0x82BE, + GL_IMAGE_CLASS_4_X_8 = 0x82BF, + GL_IMAGE_CLASS_2_X_8 = 0x82C0, + GL_IMAGE_CLASS_1_X_8 = 0x82C1, + GL_IMAGE_CLASS_11_11_10 = 0x82C2, + GL_IMAGE_CLASS_10_10_10_2 = 0x82C3, + GL_VIEW_CLASS_128_BITS = 0x82C4, + GL_VIEW_CLASS_96_BITS = 0x82C5, + GL_VIEW_CLASS_64_BITS = 0x82C6, + GL_VIEW_CLASS_48_BITS = 0x82C7, + GL_VIEW_CLASS_32_BITS = 0x82C8, + GL_VIEW_CLASS_24_BITS = 0x82C9, + GL_VIEW_CLASS_16_BITS = 0x82CA, + GL_VIEW_CLASS_8_BITS = 0x82CB, + GL_VIEW_CLASS_S3TC_DXT1_RGB = 0x82CC, + GL_VIEW_CLASS_S3TC_DXT1_RGBA = 0x82CD, + GL_VIEW_CLASS_S3TC_DXT3_RGBA = 0x82CE, + GL_VIEW_CLASS_S3TC_DXT5_RGBA = 0x82CF, + GL_VIEW_CLASS_RGTC1_RED = 0x82D0, + GL_VIEW_CLASS_RGTC2_RG = 0x82D1, + GL_VIEW_CLASS_BPTC_UNORM = 0x82D2, + GL_VIEW_CLASS_BPTC_FLOAT = 0x82D3; + + /** + * Accepted by the {@code programInterface} parameter of GetProgramInterfaceiv, GetProgramResourceIndex, GetProgramResourceName, GetProgramResourceiv, + * GetProgramResourceLocation, and GetProgramResourceLocationIndex. + */ + public static final int + GL_UNIFORM = 0x92E1, + GL_UNIFORM_BLOCK = 0x92E2, + GL_PROGRAM_INPUT = 0x92E3, + GL_PROGRAM_OUTPUT = 0x92E4, + GL_BUFFER_VARIABLE = 0x92E5, + GL_SHADER_STORAGE_BLOCK = 0x92E6, + GL_VERTEX_SUBROUTINE = 0x92E8, + GL_TESS_CONTROL_SUBROUTINE = 0x92E9, + GL_TESS_EVALUATION_SUBROUTINE = 0x92EA, + GL_GEOMETRY_SUBROUTINE = 0x92EB, + GL_FRAGMENT_SUBROUTINE = 0x92EC, + GL_COMPUTE_SUBROUTINE = 0x92ED, + GL_VERTEX_SUBROUTINE_UNIFORM = 0x92EE, + GL_TESS_CONTROL_SUBROUTINE_UNIFORM = 0x92EF, + GL_TESS_EVALUATION_SUBROUTINE_UNIFORM = 0x92F0, + GL_GEOMETRY_SUBROUTINE_UNIFORM = 0x92F1, + GL_FRAGMENT_SUBROUTINE_UNIFORM = 0x92F2, + GL_COMPUTE_SUBROUTINE_UNIFORM = 0x92F3, + GL_TRANSFORM_FEEDBACK_VARYING = 0x92F4; + + /** Accepted by the {@code pname} parameter of GetProgramInterfaceiv. */ + public static final int + GL_ACTIVE_RESOURCES = 0x92F5, + GL_MAX_NAME_LENGTH = 0x92F6, + GL_MAX_NUM_ACTIVE_VARIABLES = 0x92F7, + GL_MAX_NUM_COMPATIBLE_SUBROUTINES = 0x92F8; + + /** Accepted in the {@code props} array of GetProgramResourceiv. */ + public static final int + GL_NAME_LENGTH = 0x92F9, + GL_TYPE = 0x92FA, + GL_ARRAY_SIZE = 0x92FB, + GL_OFFSET = 0x92FC, + GL_BLOCK_INDEX = 0x92FD, + GL_ARRAY_STRIDE = 0x92FE, + GL_MATRIX_STRIDE = 0x92FF, + GL_IS_ROW_MAJOR = 0x9300, + GL_ATOMIC_COUNTER_BUFFER_INDEX = 0x9301, + GL_BUFFER_BINDING = 0x9302, + GL_BUFFER_DATA_SIZE = 0x9303, + GL_NUM_ACTIVE_VARIABLES = 0x9304, + GL_ACTIVE_VARIABLES = 0x9305, + GL_REFERENCED_BY_VERTEX_SHADER = 0x9306, + GL_REFERENCED_BY_TESS_CONTROL_SHADER = 0x9307, + GL_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x9308, + GL_REFERENCED_BY_GEOMETRY_SHADER = 0x9309, + GL_REFERENCED_BY_FRAGMENT_SHADER = 0x930A, + GL_REFERENCED_BY_COMPUTE_SHADER = 0x930B, + GL_TOP_LEVEL_ARRAY_SIZE = 0x930C, + GL_TOP_LEVEL_ARRAY_STRIDE = 0x930D, + GL_LOCATION = 0x930E, + GL_LOCATION_INDEX = 0x930F, + GL_IS_PER_PATCH = 0x92E7; + + /** Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, and GetBufferPointerv. */ + public static final int GL_SHADER_STORAGE_BUFFER = 0x90D2; + + /** + * Accepted by the {@code pname} parameter of GetIntegerv, GetIntegeri_v, GetBooleanv, GetInteger64v, GetFloatv, GetDoublev, GetBooleani_v, GetIntegeri_v, + * GetFloati_v, GetDoublei_v, and GetInteger64i_v. + */ + public static final int GL_SHADER_STORAGE_BUFFER_BINDING = 0x90D3; + + /** Accepted by the {@code pname} parameter of GetIntegeri_v, GetBooleani_v, GetIntegeri_v, GetFloati_v, GetDoublei_v, and GetInteger64i_v. */ + public static final int + GL_SHADER_STORAGE_BUFFER_START = 0x90D4, + GL_SHADER_STORAGE_BUFFER_SIZE = 0x90D5; + + /** Accepted by the {@code pname} parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS = 0x90D6, + GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS = 0x90D7, + GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS = 0x90D8, + GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS = 0x90D9, + GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS = 0x90DA, + GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS = 0x90DB, + GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS = 0x90DC, + GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS = 0x90DD, + GL_MAX_SHADER_STORAGE_BLOCK_SIZE = 0x90DE, + GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT = 0x90DF; + + /** Accepted in the {@code barriers} bitfield in glMemoryBarrier. */ + public static final int GL_SHADER_STORAGE_BARRIER_BIT = 0x2000; + + /** Alias for the existing token MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS. */ + public static final int GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES = 0x8F39; + + /** Accepted by the {@code pname} parameter of TexParameter* and GetTexParameter*. */ + public static final int GL_DEPTH_STENCIL_TEXTURE_MODE = 0x90EA; + + /** Accepted by the {@code pname} parameter of GetTexLevelParameter. */ + public static final int + GL_TEXTURE_BUFFER_OFFSET = 0x919D, + GL_TEXTURE_BUFFER_SIZE = 0x919E; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT = 0x919F; + + /** Accepted by the {@code pname} parameters of GetTexParameterfv and GetTexParameteriv. */ + public static final int + GL_TEXTURE_VIEW_MIN_LEVEL = 0x82DB, + GL_TEXTURE_VIEW_NUM_LEVELS = 0x82DC, + GL_TEXTURE_VIEW_MIN_LAYER = 0x82DD, + GL_TEXTURE_VIEW_NUM_LAYERS = 0x82DE; + + /** Accepted by the {@code pname} parameter of GetVertexAttrib*v. */ + public static final int + GL_VERTEX_ATTRIB_BINDING = 0x82D4, + GL_VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D5; + + /** Accepted by the {@code target} parameter of GetBooleani_v, GetIntegeri_v, GetFloati_v, GetDoublei_v, and GetInteger64i_v. */ + public static final int + GL_VERTEX_BINDING_DIVISOR = 0x82D6, + GL_VERTEX_BINDING_OFFSET = 0x82D7, + GL_VERTEX_BINDING_STRIDE = 0x82D8, + GL_VERTEX_BINDING_BUFFER = 0x8F4F; + + /** Accepted by the {@code pname} parameter of GetIntegerv, .... */ + public static final int + GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D9, + GL_MAX_VERTEX_ATTRIB_BINDINGS = 0x82DA; + + static { GL.initialize(); } + + protected GL43() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glClearBufferData, caps.glClearBufferSubData, caps.glDispatchCompute, caps.glDispatchComputeIndirect, caps.glCopyImageSubData, + caps.glDebugMessageControl, caps.glDebugMessageInsert, caps.glDebugMessageCallback, caps.glGetDebugMessageLog, caps.glPushDebugGroup, + caps.glPopDebugGroup, caps.glObjectLabel, caps.glGetObjectLabel, caps.glObjectPtrLabel, caps.glGetObjectPtrLabel, caps.glFramebufferParameteri, + caps.glGetFramebufferParameteriv, caps.glGetInternalformati64v, caps.glInvalidateTexSubImage, caps.glInvalidateTexImage, + caps.glInvalidateBufferSubData, caps.glInvalidateBufferData, caps.glInvalidateFramebuffer, caps.glInvalidateSubFramebuffer, + caps.glMultiDrawArraysIndirect, caps.glMultiDrawElementsIndirect, caps.glGetProgramInterfaceiv, caps.glGetProgramResourceIndex, + caps.glGetProgramResourceName, caps.glGetProgramResourceiv, caps.glGetProgramResourceLocation, caps.glGetProgramResourceLocationIndex, + caps.glShaderStorageBlockBinding, caps.glTexBufferRange, caps.glTexStorage2DMultisample, caps.glTexStorage3DMultisample, caps.glTextureView, + caps.glBindVertexBuffer, caps.glVertexAttribFormat, caps.glVertexAttribIFormat, caps.glVertexAttribLFormat, caps.glVertexAttribBinding, + caps.glVertexBindingDivisor + ); + } + + // --- [ glClearBufferData ] --- + + /** Unsafe version of: {@link #glClearBufferData ClearBufferData} */ + public static void nglClearBufferData(int target, int internalformat, int format, int type, long data) { + GL43C.nglClearBufferData(target, internalformat, format, type, data); + } + + /** + * Fills a buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43C#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43C#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearBufferData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer data) { + GL43C.glClearBufferData(target, internalformat, format, type, data); + } + + /** + * Fills a buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43C#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43C#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearBufferData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer data) { + GL43C.glClearBufferData(target, internalformat, format, type, data); + } + + /** + * Fills a buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43C#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43C#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearBufferData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer data) { + GL43C.glClearBufferData(target, internalformat, format, type, data); + } + + /** + * Fills a buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43C#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43C#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearBufferData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer data) { + GL43C.glClearBufferData(target, internalformat, format, type, data); + } + + // --- [ glClearBufferSubData ] --- + + /** Unsafe version of: {@link #glClearBufferSubData ClearBufferSubData} */ + public static void nglClearBufferSubData(int target, int internalformat, long offset, long size, int format, int type, long data) { + GL43C.nglClearBufferSubData(target, internalformat, offset, size, format, type, data); + } + + /** + * Fills all or part of buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43C#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43C#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearBufferSubData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer data) { + GL43C.glClearBufferSubData(target, internalformat, offset, size, format, type, data); + } + + /** + * Fills all or part of buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43C#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43C#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearBufferSubData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer data) { + GL43C.glClearBufferSubData(target, internalformat, offset, size, format, type, data); + } + + /** + * Fills all or part of buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43C#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43C#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearBufferSubData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer data) { + GL43C.glClearBufferSubData(target, internalformat, offset, size, format, type, data); + } + + /** + * Fills all or part of buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43C#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43C#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearBufferSubData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer data) { + GL43C.glClearBufferSubData(target, internalformat, offset, size, format, type, data); + } + + // --- [ glDispatchCompute ] --- + + /** + * Launches one or more compute work groups. + * + * @param num_groups_x the number of work groups to be launched in the X dimension + * @param num_groups_y the number of work groups to be launched in the Y dimension + * @param num_groups_z the number of work groups to be launched in the Z dimension + * + * @see Reference Page + */ + public static void glDispatchCompute(@NativeType("GLuint") int num_groups_x, @NativeType("GLuint") int num_groups_y, @NativeType("GLuint") int num_groups_z) { + GL43C.glDispatchCompute(num_groups_x, num_groups_y, num_groups_z); + } + + // --- [ glDispatchComputeIndirect ] --- + + /** + * Launches one or more compute work groups using parameters stored in a buffer. + * + *

The parameters addressed by indirect are packed a structure, which takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint num_groups_x;
+     *     uint num_groups_y;
+     *     uint num_groups_z;
+     * } DispatchIndirectCommand;
+ * + *

A call to {@code glDispatchComputeIndirect} is equivalent, assuming no errors are generated, to:

+ * + *

+     * cmd = (const DispatchIndirectCommand *)indirect;
+     * glDispatchCompute(cmd->num_groups_x, cmd->num_groups_y, cmd->num_groups_z);
+ * + * @param indirect the offset into the buffer object currently bound to the {@link GL43C#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER} buffer target at which the dispatch parameters are + * stored. + * + * @see Reference Page + */ + public static void glDispatchComputeIndirect(@NativeType("GLintptr") long indirect) { + GL43C.glDispatchComputeIndirect(indirect); + } + + // --- [ glCopyImageSubData ] --- + + /** + * Performs a raw data copy between two images. + * + * @param srcName the name of a texture or renderbuffer object from which to copy + * @param srcTarget the target representing the namespace of the source name {@code srcName} + * @param srcLevel the mipmap level to read from the source + * @param srcX the X coordinate of the left edge of the souce region to copy + * @param srcY the Y coordinate of the top edge of the souce region to copy + * @param srcZ the Z coordinate of the near edge of the souce region to copy + * @param dstName the name of a texture or renderbuffer object to which to copy + * @param dstTarget the target representing the namespace of the destination name {@code dstName} + * @param dstLevel the mipmap level to write to the source + * @param dstX the X coordinate of the left edge of the destination region + * @param dstY the Y coordinate of the top edge of the destination region + * @param dstZ the Z coordinate of the near edge of the destination region + * @param srcWidth the width of the region to be copied + * @param srcHeight the height of the region to be copied + * @param srcDepth the depth of the region to be copied + * + * @see Reference Page + */ + public static void glCopyImageSubData(@NativeType("GLuint") int srcName, @NativeType("GLenum") int srcTarget, @NativeType("GLint") int srcLevel, @NativeType("GLint") int srcX, @NativeType("GLint") int srcY, @NativeType("GLint") int srcZ, @NativeType("GLuint") int dstName, @NativeType("GLenum") int dstTarget, @NativeType("GLint") int dstLevel, @NativeType("GLint") int dstX, @NativeType("GLint") int dstY, @NativeType("GLint") int dstZ, @NativeType("GLsizei") int srcWidth, @NativeType("GLsizei") int srcHeight, @NativeType("GLsizei") int srcDepth) { + GL43C.glCopyImageSubData(srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth); + } + + // --- [ glDebugMessageControl ] --- + + /** + * Unsafe version of: {@link #glDebugMessageControl DebugMessageControl} + * + * @param count the length of the array {@code ids} + */ + public static void nglDebugMessageControl(int source, int type, int severity, int count, long ids, boolean enabled) { + GL43C.nglDebugMessageControl(source, type, severity, count, ids, enabled); + } + + /** + * Controls the volume of debug output in the active debug group, by disabling specific or groups of messages. + * + *

If {@code enabled} is {@link GL11#GL_TRUE TRUE}, the referenced subset of messages will be enabled. If {@link GL11#GL_FALSE FALSE}, then those messages will be disabled.

+ * + *

This command can reference different subsets of messages by first considering the set of all messages, and filtering out messages based on the following + * ways:

+ * + *
    + *
  • If {@code source}, {@code type}, or {@code severity} is {@link GL11#GL_DONT_CARE DONT_CARE}, the messages from all sources, of all types, or of all severities are + * referenced respectively.
  • + *
  • When values other than {@link GL11#GL_DONT_CARE DONT_CARE} are specified, all messages whose source, type, or severity match the specified {@code source}, {@code type}, + * or {@code severity} respectively will be referenced.
  • + *
  • If {@code count} is greater than zero, then {@code ids} is an array of {@code count} message IDs for the specified combination of {@code source} and + * {@code type}. In this case, if {@code source} or {@code type} is {@link GL11#GL_DONT_CARE DONT_CARE}, or {@code severity} is not {@link GL11#GL_DONT_CARE DONT_CARE}, the error + * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated.
  • + *
+ * + *

Unrecognized message IDs in {@code ids} are ignored. If {@code count} is zero, the value if {@code ids} is ignored.

+ * + *

Although messages are grouped into an implicit hierarchy by their sources and types, there is no explicit per-source, per-type or per-severity enabled + * state. Instead, the enabled state is stored individually for each message. There is no difference between disabling all messages from one source in a + * single call, and individually disabling all messages from that source using their types and IDs.

+ * + *

If the {@link GL43C#GL_DEBUG_OUTPUT DEBUG_OUTPUT} state is disabled the GL operates the same as if messages of every {@code source}, {@code type} or {@code severity} are disabled.

+ * + * @param source the source of debug messages to enable or disable. One of:
{@link GL43C#GL_DEBUG_SOURCE_API DEBUG_SOURCE_API}{@link GL43C#GL_DEBUG_SOURCE_WINDOW_SYSTEM DEBUG_SOURCE_WINDOW_SYSTEM}{@link GL43C#GL_DEBUG_SOURCE_SHADER_COMPILER DEBUG_SOURCE_SHADER_COMPILER}
{@link GL43C#GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}{@link GL43C#GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION}{@link GL43C#GL_DEBUG_SOURCE_OTHER DEBUG_SOURCE_OTHER}
+ * @param type the type of debug messages to enable or disable. One of:
{@link GL43C#GL_DEBUG_TYPE_ERROR DEBUG_TYPE_ERROR}{@link GL43C#GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR DEBUG_TYPE_DEPRECATED_BEHAVIOR}{@link GL43C#GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR DEBUG_TYPE_UNDEFINED_BEHAVIOR}
{@link GL43C#GL_DEBUG_TYPE_PORTABILITY DEBUG_TYPE_PORTABILITY}{@link GL43C#GL_DEBUG_TYPE_PERFORMANCE DEBUG_TYPE_PERFORMANCE}{@link GL43C#GL_DEBUG_TYPE_OTHER DEBUG_TYPE_OTHER}
{@link GL43C#GL_DEBUG_TYPE_MARKER DEBUG_TYPE_MARKER}
+ * @param severity the severity of debug messages to enable or disable. One of:
{@link GL43C#GL_DEBUG_SEVERITY_HIGH DEBUG_SEVERITY_HIGH}{@link GL43C#GL_DEBUG_SEVERITY_MEDIUM DEBUG_SEVERITY_MEDIUM}{@link GL43C#GL_DEBUG_SEVERITY_LOW DEBUG_SEVERITY_LOW}
{@link GL43C#GL_DEBUG_SEVERITY_NOTIFICATION DEBUG_SEVERITY_NOTIFICATION}
+ * @param ids an array of unsigned integers containing the ids of the messages to enable or disable + * @param enabled whether the selected messages should be enabled or disabled + * + * @see Reference Page + */ + public static void glDebugMessageControl(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLenum") int severity, @Nullable @NativeType("GLuint const *") IntBuffer ids, @NativeType("GLboolean") boolean enabled) { + GL43C.glDebugMessageControl(source, type, severity, ids, enabled); + } + + /** + * Controls the volume of debug output in the active debug group, by disabling specific or groups of messages. + * + *

If {@code enabled} is {@link GL11#GL_TRUE TRUE}, the referenced subset of messages will be enabled. If {@link GL11#GL_FALSE FALSE}, then those messages will be disabled.

+ * + *

This command can reference different subsets of messages by first considering the set of all messages, and filtering out messages based on the following + * ways:

+ * + *
    + *
  • If {@code source}, {@code type}, or {@code severity} is {@link GL11#GL_DONT_CARE DONT_CARE}, the messages from all sources, of all types, or of all severities are + * referenced respectively.
  • + *
  • When values other than {@link GL11#GL_DONT_CARE DONT_CARE} are specified, all messages whose source, type, or severity match the specified {@code source}, {@code type}, + * or {@code severity} respectively will be referenced.
  • + *
  • If {@code count} is greater than zero, then {@code ids} is an array of {@code count} message IDs for the specified combination of {@code source} and + * {@code type}. In this case, if {@code source} or {@code type} is {@link GL11#GL_DONT_CARE DONT_CARE}, or {@code severity} is not {@link GL11#GL_DONT_CARE DONT_CARE}, the error + * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated.
  • + *
+ * + *

Unrecognized message IDs in {@code ids} are ignored. If {@code count} is zero, the value if {@code ids} is ignored.

+ * + *

Although messages are grouped into an implicit hierarchy by their sources and types, there is no explicit per-source, per-type or per-severity enabled + * state. Instead, the enabled state is stored individually for each message. There is no difference between disabling all messages from one source in a + * single call, and individually disabling all messages from that source using their types and IDs.

+ * + *

If the {@link GL43C#GL_DEBUG_OUTPUT DEBUG_OUTPUT} state is disabled the GL operates the same as if messages of every {@code source}, {@code type} or {@code severity} are disabled.

+ * + * @param source the source of debug messages to enable or disable. One of:
{@link GL43C#GL_DEBUG_SOURCE_API DEBUG_SOURCE_API}{@link GL43C#GL_DEBUG_SOURCE_WINDOW_SYSTEM DEBUG_SOURCE_WINDOW_SYSTEM}{@link GL43C#GL_DEBUG_SOURCE_SHADER_COMPILER DEBUG_SOURCE_SHADER_COMPILER}
{@link GL43C#GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}{@link GL43C#GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION}{@link GL43C#GL_DEBUG_SOURCE_OTHER DEBUG_SOURCE_OTHER}
+ * @param type the type of debug messages to enable or disable. One of:
{@link GL43C#GL_DEBUG_TYPE_ERROR DEBUG_TYPE_ERROR}{@link GL43C#GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR DEBUG_TYPE_DEPRECATED_BEHAVIOR}{@link GL43C#GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR DEBUG_TYPE_UNDEFINED_BEHAVIOR}
{@link GL43C#GL_DEBUG_TYPE_PORTABILITY DEBUG_TYPE_PORTABILITY}{@link GL43C#GL_DEBUG_TYPE_PERFORMANCE DEBUG_TYPE_PERFORMANCE}{@link GL43C#GL_DEBUG_TYPE_OTHER DEBUG_TYPE_OTHER}
{@link GL43C#GL_DEBUG_TYPE_MARKER DEBUG_TYPE_MARKER}
+ * @param severity the severity of debug messages to enable or disable. One of:
{@link GL43C#GL_DEBUG_SEVERITY_HIGH DEBUG_SEVERITY_HIGH}{@link GL43C#GL_DEBUG_SEVERITY_MEDIUM DEBUG_SEVERITY_MEDIUM}{@link GL43C#GL_DEBUG_SEVERITY_LOW DEBUG_SEVERITY_LOW}
{@link GL43C#GL_DEBUG_SEVERITY_NOTIFICATION DEBUG_SEVERITY_NOTIFICATION}
+ * @param enabled whether the selected messages should be enabled or disabled + * + * @see Reference Page + */ + public static void glDebugMessageControl(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLenum") int severity, @NativeType("GLuint const *") int id, @NativeType("GLboolean") boolean enabled) { + GL43C.glDebugMessageControl(source, type, severity, id, enabled); + } + + // --- [ glDebugMessageInsert ] --- + + /** + * Unsafe version of: {@link #glDebugMessageInsert DebugMessageInsert} + * + * @param length the length of the string contained in the character array whose address is given by {@code message} + */ + public static void nglDebugMessageInsert(int source, int type, int id, int severity, int length, long message) { + GL43C.nglDebugMessageInsert(source, type, id, severity, length, message); + } + + /** + * This function can be called by applications and third-party libraries to generate their own messages, such as ones containing timestamp information or + * signals about specific render system events. + * + *

The value of {@code id} specifies the ID for the message and {@code severity} indicates its severity level as defined by the caller. The string + * {@code buf} contains the string representation of the message. The parameter {@code length} contains the number of characters in {@code buf}. If + * {@code length} is negative, it is implied that {@code buf} contains a null terminated string. The error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} will be generated if the + * number of characters in {@code buf}, excluding the null terminator when {@code length} is negative, is not less than the value of + * {@link GL43C#GL_MAX_DEBUG_MESSAGE_LENGTH MAX_DEBUG_MESSAGE_LENGTH}.

+ * + *

If the {@link GL43C#GL_DEBUG_OUTPUT DEBUG_OUTPUT} state is disabled calls to DebugMessageInsert are discarded and do not generate an error.

+ * + * @param source the source of the debug message to insert. One of:
{@link GL43C#GL_DEBUG_SOURCE_API DEBUG_SOURCE_API}{@link GL43C#GL_DEBUG_SOURCE_WINDOW_SYSTEM DEBUG_SOURCE_WINDOW_SYSTEM}{@link GL43C#GL_DEBUG_SOURCE_SHADER_COMPILER DEBUG_SOURCE_SHADER_COMPILER}
{@link GL43C#GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}{@link GL43C#GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION}{@link GL43C#GL_DEBUG_SOURCE_OTHER DEBUG_SOURCE_OTHER}
+ * @param type the type of the debug message insert. One of:
{@link GL43C#GL_DEBUG_TYPE_ERROR DEBUG_TYPE_ERROR}{@link GL43C#GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR DEBUG_TYPE_DEPRECATED_BEHAVIOR}{@link GL43C#GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR DEBUG_TYPE_UNDEFINED_BEHAVIOR}
{@link GL43C#GL_DEBUG_TYPE_PORTABILITY DEBUG_TYPE_PORTABILITY}{@link GL43C#GL_DEBUG_TYPE_PERFORMANCE DEBUG_TYPE_PERFORMANCE}{@link GL43C#GL_DEBUG_TYPE_OTHER DEBUG_TYPE_OTHER}
{@link GL43C#GL_DEBUG_TYPE_MARKER DEBUG_TYPE_MARKER}
+ * @param id the user-supplied identifier of the message to insert. One of:
{@link GL43C#GL_DEBUG_SEVERITY_HIGH DEBUG_SEVERITY_HIGH}{@link GL43C#GL_DEBUG_SEVERITY_MEDIUM DEBUG_SEVERITY_MEDIUM}{@link GL43C#GL_DEBUG_SEVERITY_LOW DEBUG_SEVERITY_LOW}
{@link GL43C#GL_DEBUG_SEVERITY_NOTIFICATION DEBUG_SEVERITY_NOTIFICATION}
+ * @param severity the severity of the debug messages to insert + * @param message a character array containing the message to insert + * + * @see Reference Page + */ + public static void glDebugMessageInsert(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLuint") int id, @NativeType("GLenum") int severity, @NativeType("GLchar const *") ByteBuffer message) { + GL43C.glDebugMessageInsert(source, type, id, severity, message); + } + + /** + * This function can be called by applications and third-party libraries to generate their own messages, such as ones containing timestamp information or + * signals about specific render system events. + * + *

The value of {@code id} specifies the ID for the message and {@code severity} indicates its severity level as defined by the caller. The string + * {@code buf} contains the string representation of the message. The parameter {@code length} contains the number of characters in {@code buf}. If + * {@code length} is negative, it is implied that {@code buf} contains a null terminated string. The error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} will be generated if the + * number of characters in {@code buf}, excluding the null terminator when {@code length} is negative, is not less than the value of + * {@link GL43C#GL_MAX_DEBUG_MESSAGE_LENGTH MAX_DEBUG_MESSAGE_LENGTH}.

+ * + *

If the {@link GL43C#GL_DEBUG_OUTPUT DEBUG_OUTPUT} state is disabled calls to DebugMessageInsert are discarded and do not generate an error.

+ * + * @param source the source of the debug message to insert. One of:
{@link GL43C#GL_DEBUG_SOURCE_API DEBUG_SOURCE_API}{@link GL43C#GL_DEBUG_SOURCE_WINDOW_SYSTEM DEBUG_SOURCE_WINDOW_SYSTEM}{@link GL43C#GL_DEBUG_SOURCE_SHADER_COMPILER DEBUG_SOURCE_SHADER_COMPILER}
{@link GL43C#GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}{@link GL43C#GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION}{@link GL43C#GL_DEBUG_SOURCE_OTHER DEBUG_SOURCE_OTHER}
+ * @param type the type of the debug message insert. One of:
{@link GL43C#GL_DEBUG_TYPE_ERROR DEBUG_TYPE_ERROR}{@link GL43C#GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR DEBUG_TYPE_DEPRECATED_BEHAVIOR}{@link GL43C#GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR DEBUG_TYPE_UNDEFINED_BEHAVIOR}
{@link GL43C#GL_DEBUG_TYPE_PORTABILITY DEBUG_TYPE_PORTABILITY}{@link GL43C#GL_DEBUG_TYPE_PERFORMANCE DEBUG_TYPE_PERFORMANCE}{@link GL43C#GL_DEBUG_TYPE_OTHER DEBUG_TYPE_OTHER}
{@link GL43C#GL_DEBUG_TYPE_MARKER DEBUG_TYPE_MARKER}
+ * @param id the user-supplied identifier of the message to insert. One of:
{@link GL43C#GL_DEBUG_SEVERITY_HIGH DEBUG_SEVERITY_HIGH}{@link GL43C#GL_DEBUG_SEVERITY_MEDIUM DEBUG_SEVERITY_MEDIUM}{@link GL43C#GL_DEBUG_SEVERITY_LOW DEBUG_SEVERITY_LOW}
{@link GL43C#GL_DEBUG_SEVERITY_NOTIFICATION DEBUG_SEVERITY_NOTIFICATION}
+ * @param severity the severity of the debug messages to insert + * @param message a character array containing the message to insert + * + * @see Reference Page + */ + public static void glDebugMessageInsert(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLuint") int id, @NativeType("GLenum") int severity, @NativeType("GLchar const *") CharSequence message) { + GL43C.glDebugMessageInsert(source, type, id, severity, message); + } + + // --- [ glDebugMessageCallback ] --- + + /** Unsafe version of: {@link #glDebugMessageCallback DebugMessageCallback} */ + public static void nglDebugMessageCallback(long callback, long userParam) { + GL43C.nglDebugMessageCallback(callback, userParam); + } + + /** + * Specifies a callback to receive debugging messages from the GL. + * + *

The function's prototype must follow the type definition of DEBUGPROC including its platform-dependent calling convention. Anything else will result in + * undefined behavior. Only one debug callback can be specified for the current context, and further calls overwrite the previous callback. Specifying + * {@code NULL} as the value of {@code callback} clears the current callback and disables message output through callbacks. Applications can provide + * user-specified data through the pointer {@code userParam}. The context will store this pointer and will include it as one of the parameters in each call + * to the callback function.

+ * + *

If the application has specified a callback function for receiving debug output, the implementation will call that function whenever any enabled message + * is generated. The source, type, ID, and severity of the message are specified by the DEBUGPROC parameters {@code source}, {@code type}, {@code id}, and + * {@code severity}, respectively. The string representation of the message is stored in {@code message} and its length (excluding the null-terminator) is + * stored in {@code length}. The parameter {@code userParam} is the user-specified parameter that was given when calling DebugMessageCallback.

+ * + *

Applications can query the current callback function and the current user-specified parameter by obtaining the values of {@link GL43C#GL_DEBUG_CALLBACK_FUNCTION DEBUG_CALLBACK_FUNCTION} and + * {@link GL43C#GL_DEBUG_CALLBACK_USER_PARAM DEBUG_CALLBACK_USER_PARAM}, respectively.

+ * + *

Applications that specify a callback function must be aware of certain special conditions when executing code inside a callback when it is called by the + * GL, regardless of the debug source.

+ * + *

The memory for {@code message} is owned and managed by the GL, and should only be considered valid for the duration of the function call.

+ * + *

The behavior of calling any GL or window system function from within the callback function is undefined and may lead to program termination.

+ * + *

Care must also be taken in securing debug callbacks for use with asynchronous debug output by multi-threaded GL implementations.

+ * + *

If the {@link GL43C#GL_DEBUG_OUTPUT DEBUG_OUTPUT} state is disabled then the GL will not call the callback function.

+ * + * @param callback a callback function that will be called when a debug message is generated + * @param userParam a user supplied pointer that will be passed on each invocation of {@code callback} + * + * @see Reference Page + */ + public static void glDebugMessageCallback(@Nullable @NativeType("GLDEBUGPROC") GLDebugMessageCallbackI callback, @NativeType("void const *") long userParam) { + GL43C.glDebugMessageCallback(callback, userParam); + } + + // --- [ glGetDebugMessageLog ] --- + + /** + * Unsafe version of: {@link #glGetDebugMessageLog GetDebugMessageLog} + * + * @param bufsize the size of the buffer whose address is given by {@code messageLog} + */ + public static int nglGetDebugMessageLog(int count, int bufsize, long sources, long types, long ids, long severities, long lengths, long messageLog) { + return GL43C.nglGetDebugMessageLog(count, bufsize, sources, types, ids, severities, lengths, messageLog); + } + + /** + * Retrieves messages from the debug message log. + * + *

This function fetches a maximum of {@code count} messages from the message log, and will return the number of messages successfully fetched.

+ * + *

Messages will be fetched from the log in order of oldest to newest. Those messages that were fetched will be removed from the log.

+ * + *

The sources, types, severities, IDs, and string lengths of fetched messages will be stored in the application-provided arrays {@code sources}, + * {@code types}, {@code severities}, {@code ids}, and {@code lengths}, respectively. The application is responsible for allocating enough space for each + * array to hold up to {@code count} elements. The string representations of all fetched messages are stored in the {@code messageLog} array. If multiple + * messages are fetched, their strings are concatenated into the same {@code messageLog} array and will be separated by single null terminators. The last + * string in the array will also be null-terminated. The maximum size of {@code messageLog}, including the space used by all null terminators, is given by + * {@code bufSize}. If {@code bufSize} is less than zero and {@code messageLog} is not {@code NULL}, an {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error will be generated. If a message's + * string, including its null terminator, can not fully fit within the {@code messageLog} array's remaining space, then that message and any subsequent + * messages will not be fetched and will remain in the log. The string lengths stored in the array {@code lengths} include the space for the null + * terminator of each string.

+ * + *

Any or all of the arrays {@code sources}, {@code types}, {@code ids}, {@code severities}, {@code lengths} and {@code messageLog} can also be null + * pointers, which causes the attributes for such arrays to be discarded when messages are fetched, however those messages will still be removed from the + * log. Thus to simply delete up to {@code count} messages from the message log while ignoring their attributes, the application can call the function + * with null pointers for all attribute arrays.

+ * + *

If the context was created without the {@link GL43C#GL_CONTEXT_FLAG_DEBUG_BIT CONTEXT_FLAG_DEBUG_BIT} in the {@link GL30#GL_CONTEXT_FLAGS CONTEXT_FLAGS} state, then the GL can opt to never add messages to the + * message log so GetDebugMessageLog will always return zero.

+ * + * @param count the number of debug messages to retrieve from the log + * @param sources an array of variables to receive the sources of the retrieved messages + * @param types an array of variables to receive the types of the retrieved messages + * @param ids an array of unsigned integers to receive the ids of the retrieved messages + * @param severities an array of variables to receive the severites of the retrieved messages + * @param lengths an array of variables to receive the lengths of the received messages + * @param messageLog an array of characters that will receive the messages + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glGetDebugMessageLog(@NativeType("GLuint") int count, @Nullable @NativeType("GLenum *") IntBuffer sources, @Nullable @NativeType("GLenum *") IntBuffer types, @Nullable @NativeType("GLuint *") IntBuffer ids, @Nullable @NativeType("GLenum *") IntBuffer severities, @Nullable @NativeType("GLsizei *") IntBuffer lengths, @Nullable @NativeType("GLchar *") ByteBuffer messageLog) { + return GL43C.glGetDebugMessageLog(count, sources, types, ids, severities, lengths, messageLog); + } + + // --- [ glPushDebugGroup ] --- + + /** + * Unsafe version of: {@link #glPushDebugGroup PushDebugGroup} + * + * @param length the length of the message to be sent to the debug output stream + */ + public static void nglPushDebugGroup(int source, int id, int length, long message) { + GL43C.nglPushDebugGroup(source, id, length, message); + } + + /** + * Pushes a debug group described by the string {@code message} into the command stream. The value of {@code id} specifies the ID of messages generated. + * The parameter {@code length} contains the number of characters in {@code message}. If {@code length} is negative, it is implied that {@code message} + * contains a null terminated string. The message has the specified {@code source} and {@code id}, {@code type} {@link GL43C#GL_DEBUG_TYPE_PUSH_GROUP DEBUG_TYPE_PUSH_GROUP}, and + * {@code severity} {@link GL43C#GL_DEBUG_SEVERITY_NOTIFICATION DEBUG_SEVERITY_NOTIFICATION}. The GL will put a new debug group on top of the debug group stack which inherits the control of the + * volume of debug output of the debug group previously residing on the top of the debug group stack. Because debug groups are strictly hierarchical, any + * additional control of the debug output volume will only apply within the active debug group and the debug groups pushed on top of the active debug group. + * + *

An {@link GL11#GL_INVALID_ENUM INVALID_ENUM} error is generated if the value of {@code source} is neither {@link GL43C#GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION} nor {@link GL43C#GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}. An + * {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error is generated if {@code length} is negative and the number of characters in {@code message}, excluding the null-terminator, is + * not less than the value of {@link GL43C#GL_MAX_DEBUG_MESSAGE_LENGTH MAX_DEBUG_MESSAGE_LENGTH}.

+ * + * @param source the source of the debug message. One of:
{@link GL43C#GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION}{@link GL43C#GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}
+ * @param id the identifier of the message + * @param message a string containing the message to be sent to the debug output stream + * + * @see Reference Page + */ + public static void glPushDebugGroup(@NativeType("GLenum") int source, @NativeType("GLuint") int id, @NativeType("GLchar const *") ByteBuffer message) { + GL43C.glPushDebugGroup(source, id, message); + } + + /** + * Pushes a debug group described by the string {@code message} into the command stream. The value of {@code id} specifies the ID of messages generated. + * The parameter {@code length} contains the number of characters in {@code message}. If {@code length} is negative, it is implied that {@code message} + * contains a null terminated string. The message has the specified {@code source} and {@code id}, {@code type} {@link GL43C#GL_DEBUG_TYPE_PUSH_GROUP DEBUG_TYPE_PUSH_GROUP}, and + * {@code severity} {@link GL43C#GL_DEBUG_SEVERITY_NOTIFICATION DEBUG_SEVERITY_NOTIFICATION}. The GL will put a new debug group on top of the debug group stack which inherits the control of the + * volume of debug output of the debug group previously residing on the top of the debug group stack. Because debug groups are strictly hierarchical, any + * additional control of the debug output volume will only apply within the active debug group and the debug groups pushed on top of the active debug group. + * + *

An {@link GL11#GL_INVALID_ENUM INVALID_ENUM} error is generated if the value of {@code source} is neither {@link GL43C#GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION} nor {@link GL43C#GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}. An + * {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error is generated if {@code length} is negative and the number of characters in {@code message}, excluding the null-terminator, is + * not less than the value of {@link GL43C#GL_MAX_DEBUG_MESSAGE_LENGTH MAX_DEBUG_MESSAGE_LENGTH}.

+ * + * @param source the source of the debug message. One of:
{@link GL43C#GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION}{@link GL43C#GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}
+ * @param id the identifier of the message + * @param message a string containing the message to be sent to the debug output stream + * + * @see Reference Page + */ + public static void glPushDebugGroup(@NativeType("GLenum") int source, @NativeType("GLuint") int id, @NativeType("GLchar const *") CharSequence message) { + GL43C.glPushDebugGroup(source, id, message); + } + + // --- [ glPopDebugGroup ] --- + + /** + * Pops the active debug group. When a debug group is popped, the GL will also generate a debug output message describing its cause based on the + * {@code message} string, the source {@code source}, and an ID {@code id} submitted to the associated {@link #glPushDebugGroup PushDebugGroup} command. {@link GL43C#GL_DEBUG_TYPE_PUSH_GROUP DEBUG_TYPE_PUSH_GROUP} + * and {@link GL43C#GL_DEBUG_TYPE_POP_GROUP DEBUG_TYPE_POP_GROUP} share a single namespace for message {@code id}. {@code severity} has the value {@link GL43C#GL_DEBUG_SEVERITY_NOTIFICATION DEBUG_SEVERITY_NOTIFICATION}. The {@code type} + * has the value {@link GL43C#GL_DEBUG_TYPE_POP_GROUP DEBUG_TYPE_POP_GROUP}. Popping a debug group restores the debug output volume control of the parent debug group. + * + *

Attempting to pop the default debug group off the stack generates a {@link GL11#GL_STACK_UNDERFLOW STACK_UNDERFLOW} error; pushing a debug group onto a stack containing + * {@link GL43C#GL_MAX_DEBUG_GROUP_STACK_DEPTH MAX_DEBUG_GROUP_STACK_DEPTH} minus one elements will generate a {@link GL11#GL_STACK_OVERFLOW STACK_OVERFLOW} error.

+ * + * @see Reference Page + */ + public static void glPopDebugGroup() { + GL43C.glPopDebugGroup(); + } + + // --- [ glObjectLabel ] --- + + /** + * Unsafe version of: {@link #glObjectLabel ObjectLabel} + * + * @param length the length of the label to be used for the object + */ + public static void nglObjectLabel(int identifier, int name, int length, long label) { + GL43C.nglObjectLabel(identifier, name, length, label); + } + + /** + * Labels a named object identified within a namespace. + * + * @param identifier the namespace from which the name of the object is allocated. One of:
{@link GL43C#GL_BUFFER BUFFER}{@link GL43C#GL_SHADER SHADER}{@link GL43C#GL_PROGRAM PROGRAM}{@link GL43C#GL_QUERY QUERY}{@link GL43C#GL_PROGRAM_PIPELINE PROGRAM_PIPELINE}{@link GL43C#GL_SAMPLER SAMPLER}{@link GL11#GL_VERTEX_ARRAY VERTEX_ARRAY}{@link GL11#GL_TEXTURE TEXTURE}
{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL40#GL_TRANSFORM_FEEDBACK TRANSFORM_FEEDBACK}
+ * @param name the name of the object to label + * @param label a string containing the label to assign to the object + * + * @see Reference Page + */ + public static void glObjectLabel(@NativeType("GLenum") int identifier, @NativeType("GLuint") int name, @NativeType("GLchar const *") ByteBuffer label) { + GL43C.glObjectLabel(identifier, name, label); + } + + /** + * Labels a named object identified within a namespace. + * + * @param identifier the namespace from which the name of the object is allocated. One of:
{@link GL43C#GL_BUFFER BUFFER}{@link GL43C#GL_SHADER SHADER}{@link GL43C#GL_PROGRAM PROGRAM}{@link GL43C#GL_QUERY QUERY}{@link GL43C#GL_PROGRAM_PIPELINE PROGRAM_PIPELINE}{@link GL43C#GL_SAMPLER SAMPLER}{@link GL11#GL_VERTEX_ARRAY VERTEX_ARRAY}{@link GL11#GL_TEXTURE TEXTURE}
{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL40#GL_TRANSFORM_FEEDBACK TRANSFORM_FEEDBACK}
+ * @param name the name of the object to label + * @param label a string containing the label to assign to the object + * + * @see Reference Page + */ + public static void glObjectLabel(@NativeType("GLenum") int identifier, @NativeType("GLuint") int name, @NativeType("GLchar const *") CharSequence label) { + GL43C.glObjectLabel(identifier, name, label); + } + + // --- [ glGetObjectLabel ] --- + + /** + * Unsafe version of: {@link #glGetObjectLabel GetObjectLabel} + * + * @param bufSize the length of the buffer whose address is in {@code label} + */ + public static void nglGetObjectLabel(int identifier, int name, int bufSize, long length, long label) { + GL43C.nglGetObjectLabel(identifier, name, bufSize, length, label); + } + + /** + * Retrieves the label of a named object identified within a namespace. + * + * @param identifier the namespace from which the name of the object is allocated. One of:
{@link GL43C#GL_BUFFER BUFFER}{@link GL43C#GL_SHADER SHADER}{@link GL43C#GL_PROGRAM PROGRAM}{@link GL43C#GL_QUERY QUERY}{@link GL43C#GL_PROGRAM_PIPELINE PROGRAM_PIPELINE}{@link GL43C#GL_SAMPLER SAMPLER}{@link GL11#GL_VERTEX_ARRAY VERTEX_ARRAY}{@link GL11#GL_TEXTURE TEXTURE}
{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL40#GL_TRANSFORM_FEEDBACK TRANSFORM_FEEDBACK}
+ * @param name the name of the object whose label to retrieve + * @param length the address of a variable to receive the length of the object label + * @param label a string that will receive the object label + * + * @see Reference Page + */ + public static void glGetObjectLabel(@NativeType("GLenum") int identifier, @NativeType("GLuint") int name, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer label) { + GL43C.glGetObjectLabel(identifier, name, length, label); + } + + /** + * Retrieves the label of a named object identified within a namespace. + * + * @param identifier the namespace from which the name of the object is allocated. One of:
{@link GL43C#GL_BUFFER BUFFER}{@link GL43C#GL_SHADER SHADER}{@link GL43C#GL_PROGRAM PROGRAM}{@link GL43C#GL_QUERY QUERY}{@link GL43C#GL_PROGRAM_PIPELINE PROGRAM_PIPELINE}{@link GL43C#GL_SAMPLER SAMPLER}{@link GL11#GL_VERTEX_ARRAY VERTEX_ARRAY}{@link GL11#GL_TEXTURE TEXTURE}
{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL40#GL_TRANSFORM_FEEDBACK TRANSFORM_FEEDBACK}
+ * @param name the name of the object whose label to retrieve + * @param bufSize the length of the buffer whose address is in {@code label} + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetObjectLabel(@NativeType("GLenum") int identifier, @NativeType("GLuint") int name, @NativeType("GLsizei") int bufSize) { + return GL43C.glGetObjectLabel(identifier, name, bufSize); + } + + /** + * Retrieves the label of a named object identified within a namespace. + * + * @param identifier the namespace from which the name of the object is allocated. One of:
{@link GL43C#GL_BUFFER BUFFER}{@link GL43C#GL_SHADER SHADER}{@link GL43C#GL_PROGRAM PROGRAM}{@link GL43C#GL_QUERY QUERY}{@link GL43C#GL_PROGRAM_PIPELINE PROGRAM_PIPELINE}{@link GL43C#GL_SAMPLER SAMPLER}{@link GL11#GL_VERTEX_ARRAY VERTEX_ARRAY}{@link GL11#GL_TEXTURE TEXTURE}
{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL40#GL_TRANSFORM_FEEDBACK TRANSFORM_FEEDBACK}
+ * @param name the name of the object whose label to retrieve + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetObjectLabel(@NativeType("GLenum") int identifier, @NativeType("GLuint") int name) { + return glGetObjectLabel(identifier, name, GL11.glGetInteger(GL_MAX_LABEL_LENGTH)); + } + + // --- [ glObjectPtrLabel ] --- + + /** + * Unsafe version of: {@link #glObjectPtrLabel ObjectPtrLabel} + * + * @param length the length of the label to be used for the object + */ + public static void nglObjectPtrLabel(long ptr, int length, long label) { + GL43C.nglObjectPtrLabel(ptr, length, label); + } + + /** + * Labels a sync object identified by a pointer. + * + * @param ptr a pointer identifying a sync object + * @param label a string containing the label to assign to the object + * + * @see Reference Page + */ + public static void glObjectPtrLabel(@NativeType("void *") long ptr, @NativeType("GLchar const *") ByteBuffer label) { + GL43C.glObjectPtrLabel(ptr, label); + } + + /** + * Labels a sync object identified by a pointer. + * + * @param ptr a pointer identifying a sync object + * @param label a string containing the label to assign to the object + * + * @see Reference Page + */ + public static void glObjectPtrLabel(@NativeType("void *") long ptr, @NativeType("GLchar const *") CharSequence label) { + GL43C.glObjectPtrLabel(ptr, label); + } + + // --- [ glGetObjectPtrLabel ] --- + + /** + * Unsafe version of: {@link #glGetObjectPtrLabel GetObjectPtrLabel} + * + * @param bufSize the length of the buffer whose address is in {@code label} + */ + public static void nglGetObjectPtrLabel(long ptr, int bufSize, long length, long label) { + GL43C.nglGetObjectPtrLabel(ptr, bufSize, length, label); + } + + /** + * Retrieves the label of a sync object identified by a pointer. + * + * @param ptr the name of the sync object whose label to retrieve + * @param length a variable to receive the length of the object label + * @param label a string that will receive the object label + * + * @see Reference Page + */ + public static void glGetObjectPtrLabel(@NativeType("void *") long ptr, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer label) { + GL43C.glGetObjectPtrLabel(ptr, length, label); + } + + /** + * Retrieves the label of a sync object identified by a pointer. + * + * @param ptr the name of the sync object whose label to retrieve + * @param bufSize the length of the buffer whose address is in {@code label} + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetObjectPtrLabel(@NativeType("void *") long ptr, @NativeType("GLsizei") int bufSize) { + return GL43C.glGetObjectPtrLabel(ptr, bufSize); + } + + /** + * Retrieves the label of a sync object identified by a pointer. + * + * @param ptr the name of the sync object whose label to retrieve + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetObjectPtrLabel(@NativeType("void *") long ptr) { + return glGetObjectPtrLabel(ptr, GL11.glGetInteger(GL_MAX_LABEL_LENGTH)); + } + + // --- [ glFramebufferParameteri ] --- + + /** + * Sets a named parameter of a framebuffer. + * + * @param target target of the operation. One of:
{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}
+ * @param pname a token indicating the parameter to be modified. One of:
{@link GL43C#GL_FRAMEBUFFER_DEFAULT_WIDTH FRAMEBUFFER_DEFAULT_WIDTH}{@link GL43C#GL_FRAMEBUFFER_DEFAULT_HEIGHT FRAMEBUFFER_DEFAULT_HEIGHT}
{@link GL43C#GL_FRAMEBUFFER_DEFAULT_LAYERS FRAMEBUFFER_DEFAULT_LAYERS}{@link GL43C#GL_FRAMEBUFFER_DEFAULT_SAMPLES FRAMEBUFFER_DEFAULT_SAMPLES}
{@link GL43C#GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS}
+ * @param param the new value for the parameter named {@code pname} + * + * @see Reference Page + */ + public static void glFramebufferParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint") int param) { + GL43C.glFramebufferParameteri(target, pname, param); + } + + // --- [ glGetFramebufferParameteriv ] --- + + /** Unsafe version of: {@link #glGetFramebufferParameteriv GetFramebufferParameteriv} */ + public static void nglGetFramebufferParameteriv(int target, int pname, long params) { + GL43C.nglGetFramebufferParameteriv(target, pname, params); + } + + /** + * Retrieves a named parameter from a framebuffer. + * + * @param target target of the operation. One of:
{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}
+ * @param pname a token indicating the parameter to be retrieved. One of:
{@link GL43C#GL_FRAMEBUFFER_DEFAULT_WIDTH FRAMEBUFFER_DEFAULT_WIDTH}{@link GL43C#GL_FRAMEBUFFER_DEFAULT_HEIGHT FRAMEBUFFER_DEFAULT_HEIGHT}
{@link GL43C#GL_FRAMEBUFFER_DEFAULT_LAYERS FRAMEBUFFER_DEFAULT_LAYERS}{@link GL43C#GL_FRAMEBUFFER_DEFAULT_SAMPLES FRAMEBUFFER_DEFAULT_SAMPLES}
{@link GL43C#GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS}
+ * @param params a variable to receive the value of the parameter named {@code pname} + * + * @see Reference Page + */ + public static void glGetFramebufferParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL43C.glGetFramebufferParameteriv(target, pname, params); + } + + /** + * Retrieves a named parameter from a framebuffer. + * + * @param target target of the operation. One of:
{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}
+ * @param pname a token indicating the parameter to be retrieved. One of:
{@link GL43C#GL_FRAMEBUFFER_DEFAULT_WIDTH FRAMEBUFFER_DEFAULT_WIDTH}{@link GL43C#GL_FRAMEBUFFER_DEFAULT_HEIGHT FRAMEBUFFER_DEFAULT_HEIGHT}
{@link GL43C#GL_FRAMEBUFFER_DEFAULT_LAYERS FRAMEBUFFER_DEFAULT_LAYERS}{@link GL43C#GL_FRAMEBUFFER_DEFAULT_SAMPLES FRAMEBUFFER_DEFAULT_SAMPLES}
{@link GL43C#GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetFramebufferParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + return GL43C.glGetFramebufferParameteri(target, pname); + } + + // --- [ glGetInternalformati64v ] --- + + /** + * Unsafe version of: {@link #glGetInternalformati64v GetInternalformati64v} + * + * @param bufSize the maximum number of values that may be written to params by the function + */ + public static void nglGetInternalformati64v(int target, int internalformat, int pname, int bufSize, long params) { + GL43C.nglGetInternalformati64v(target, internalformat, pname, bufSize, params); + } + + /** + * Retrieves information about implementation-dependent support for internal formats. + * + * @param target the usage of the internal format. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param internalformat the internal format about which to retrieve information + * @param pname the type of information to query + * @param params a variable into which to write the retrieved information + * + * @see Reference Page + */ + public static void glGetInternalformati64v(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int pname, @NativeType("GLint64 *") LongBuffer params) { + GL43C.glGetInternalformati64v(target, internalformat, pname, params); + } + + /** + * Retrieves information about implementation-dependent support for internal formats. + * + * @param target the usage of the internal format. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param internalformat the internal format about which to retrieve information + * @param pname the type of information to query + * + * @see Reference Page + */ + @NativeType("void") + public static long glGetInternalformati64(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int pname) { + return GL43C.glGetInternalformati64(target, internalformat, pname); + } + + // --- [ glInvalidateTexSubImage ] --- + + /** + * Invalidates a region of a texture image. + * + * @param texture the name of a texture object a subregion of which to invalidate + * @param level the level of detail of the texture object within which the region resides + * @param xoffset the X offset of the region to be invalidated + * @param yoffset the Y offset of the region to be invalidated + * @param zoffset the Z offset of the region to be invalidated + * @param width the width of the region to be invalidated + * @param height the height of the region to be invalidated + * @param depth the depth of the region to be invalidated + * + * @see Reference Page + */ + public static void glInvalidateTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth) { + GL43C.glInvalidateTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth); + } + + // --- [ glInvalidateTexImage ] --- + + /** + * Invalidates the entirety of a texture image. + * + * @param texture the name of a texture object to invalidate + * @param level the level of detail of the texture object to invalidate + * + * @see Reference Page + */ + public static void glInvalidateTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level) { + GL43C.glInvalidateTexImage(texture, level); + } + + // --- [ glInvalidateBufferSubData ] --- + + /** + * Invalidates a region of a buffer object's data store. + * + * @param buffer the name of a buffer object, a subrange of whose data store to invalidate + * @param offset the offset within the buffer's data store of the start of the range to be invalidated + * @param length the length of the range within the buffer's data store to be invalidated + * + * @see Reference Page + */ + public static void glInvalidateBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length) { + GL43C.glInvalidateBufferSubData(buffer, offset, length); + } + + // --- [ glInvalidateBufferData ] --- + + /** + * Invalidates the content of a buffer object's data store. + * + * @param buffer the name of a buffer object whose data store to invalidate + * + * @see Reference Page + */ + public static void glInvalidateBufferData(@NativeType("GLuint") int buffer) { + GL43C.glInvalidateBufferData(buffer); + } + + // --- [ glInvalidateFramebuffer ] --- + + /** + * Unsafe version of: {@link #glInvalidateFramebuffer InvalidateFramebuffer} + * + * @param numAttachments the number of entries in the {@code attachments} array + */ + public static void nglInvalidateFramebuffer(int target, int numAttachments, long attachments) { + GL43C.nglInvalidateFramebuffer(target, numAttachments, attachments); + } + + /** + * Invalidate the content some or all of a framebuffer object's attachments. + * + * @param target the target to which the framebuffer is attached. One of:
{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}
+ * @param attachments the address of an array identifying the attachments to be invalidated + * + * @see Reference Page + */ + public static void glInvalidateFramebuffer(@NativeType("GLenum") int target, @NativeType("GLenum const *") IntBuffer attachments) { + GL43C.glInvalidateFramebuffer(target, attachments); + } + + /** + * Invalidate the content some or all of a framebuffer object's attachments. + * + * @param target the target to which the framebuffer is attached. One of:
{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}
+ * + * @see Reference Page + */ + public static void glInvalidateFramebuffer(@NativeType("GLenum") int target, @NativeType("GLenum const *") int attachment) { + GL43C.glInvalidateFramebuffer(target, attachment); + } + + // --- [ glInvalidateSubFramebuffer ] --- + + /** + * Unsafe version of: {@link #glInvalidateSubFramebuffer InvalidateSubFramebuffer} + * + * @param numAttachments the number of entries in the {@code attachments} array + */ + public static void nglInvalidateSubFramebuffer(int target, int numAttachments, long attachments, int x, int y, int width, int height) { + GL43C.nglInvalidateSubFramebuffer(target, numAttachments, attachments, x, y, width, height); + } + + /** + * Invalidates the content of a region of some or all of a framebuffer object's attachments. + * + * @param target the target to which the framebuffer is attached. One of:
{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}
+ * @param attachments an array identifying the attachments to be invalidated + * @param x the X offset of the region to be invalidated + * @param y the Y offset of the region to be invalidated + * @param width the width of the region to be invalidated + * @param height the height of the region to be invalidated + * + * @see Reference Page + */ + public static void glInvalidateSubFramebuffer(@NativeType("GLenum") int target, @NativeType("GLenum const *") IntBuffer attachments, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL43C.glInvalidateSubFramebuffer(target, attachments, x, y, width, height); + } + + /** + * Invalidates the content of a region of some or all of a framebuffer object's attachments. + * + * @param target the target to which the framebuffer is attached. One of:
{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}
+ * @param x the X offset of the region to be invalidated + * @param y the Y offset of the region to be invalidated + * @param width the width of the region to be invalidated + * @param height the height of the region to be invalidated + * + * @see Reference Page + */ + public static void glInvalidateSubFramebuffer(@NativeType("GLenum") int target, @NativeType("GLenum const *") int attachment, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL43C.glInvalidateSubFramebuffer(target, attachment, x, y, width, height); + } + + // --- [ glMultiDrawArraysIndirect ] --- + + /** Unsafe version of: {@link #glMultiDrawArraysIndirect MultiDrawArraysIndirect} */ + public static void nglMultiDrawArraysIndirect(int mode, long indirect, int drawcount, int stride) { + GL43C.nglMultiDrawArraysIndirect(mode, indirect, drawcount, stride); + } + + /** + * Renders multiple sets of primitives from array data, taking parameters from memory. + * + *

The parameters addressed by {@code indirect} are packed into an array of structures, each element of which takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint first;
+     *     uint baseInstance;
+     * } DrawArraysIndirectCommand;
+ * + *

A single call to {@code glMultiDrawArraysIndirect} is equivalent, assuming no errors are generated to:

+ * + *

+     * const ubyte *ptr = (const ubyte *)indirect;
+     * for ( i = 0; i < drawcount; i++ ) {
+     *     DrawArraysIndirect(mode, (DrawArraysIndirectCommand*)ptr);
+     *     if ( stride == 0 )
+     *         ptr += sizeof(DrawArraysIndirectCommand);
+     *     else
+     *         ptr += stride;
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect an array of structures containing the draw parameters + * @param drawcount the number of elements in the array of draw parameter structures + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + GL43C.glMultiDrawArraysIndirect(mode, indirect, drawcount, stride); + } + + /** + * Renders multiple sets of primitives from array data, taking parameters from memory. + * + *

The parameters addressed by {@code indirect} are packed into an array of structures, each element of which takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint first;
+     *     uint baseInstance;
+     * } DrawArraysIndirectCommand;
+ * + *

A single call to {@code glMultiDrawArraysIndirect} is equivalent, assuming no errors are generated to:

+ * + *

+     * const ubyte *ptr = (const ubyte *)indirect;
+     * for ( i = 0; i < drawcount; i++ ) {
+     *     DrawArraysIndirect(mode, (DrawArraysIndirectCommand*)ptr);
+     *     if ( stride == 0 )
+     *         ptr += sizeof(DrawArraysIndirectCommand);
+     *     else
+     *         ptr += stride;
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect an array of structures containing the draw parameters + * @param drawcount the number of elements in the array of draw parameter structures + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") long indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + GL43C.glMultiDrawArraysIndirect(mode, indirect, drawcount, stride); + } + + /** + * Renders multiple sets of primitives from array data, taking parameters from memory. + * + *

The parameters addressed by {@code indirect} are packed into an array of structures, each element of which takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint first;
+     *     uint baseInstance;
+     * } DrawArraysIndirectCommand;
+ * + *

A single call to {@code glMultiDrawArraysIndirect} is equivalent, assuming no errors are generated to:

+ * + *

+     * const ubyte *ptr = (const ubyte *)indirect;
+     * for ( i = 0; i < drawcount; i++ ) {
+     *     DrawArraysIndirect(mode, (DrawArraysIndirectCommand*)ptr);
+     *     if ( stride == 0 )
+     *         ptr += sizeof(DrawArraysIndirectCommand);
+     *     else
+     *         ptr += stride;
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect an array of structures containing the draw parameters + * @param drawcount the number of elements in the array of draw parameter structures + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + GL43C.glMultiDrawArraysIndirect(mode, indirect, drawcount, stride); + } + + // --- [ glMultiDrawElementsIndirect ] --- + + /** Unsafe version of: {@link #glMultiDrawElementsIndirect MultiDrawElementsIndirect} */ + public static void nglMultiDrawElementsIndirect(int mode, int type, long indirect, int drawcount, int stride) { + GL43C.nglMultiDrawElementsIndirect(mode, type, indirect, drawcount, stride); + } + + /** + * Renders multiple indexed primitives from array data, taking parameters from memory. + * + *

The parameters addressed by indirect are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint firstIndex;
+     *     uint baseVertex;
+     *     uint baseInstance;
+     * } DrawElementsIndirectCommand;
+ * + *

A single call to {@code glMultiDrawElementsIndirect} is equivalent, assuming no errors are generated to:

+ * + *

+     * const ubyte *ptr = (const ubyte *)indirect;
+     * for ( i = 0; i < drawcount; i++ ) {
+     *     DrawElementsIndirect(mode, type, (DrawElementsIndirectCommand *)ptr);
+     *     if ( stride == 0 )
+     *         ptr += sizeof(DrawElementsIndirectCommand);
+     *     else
+     *         ptr += stride;
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect a structure containing an array of draw parameters + * @param drawcount the number of elements in the array addressed by {@code indirect} + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + GL43C.glMultiDrawElementsIndirect(mode, type, indirect, drawcount, stride); + } + + /** + * Renders multiple indexed primitives from array data, taking parameters from memory. + * + *

The parameters addressed by indirect are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint firstIndex;
+     *     uint baseVertex;
+     *     uint baseInstance;
+     * } DrawElementsIndirectCommand;
+ * + *

A single call to {@code glMultiDrawElementsIndirect} is equivalent, assuming no errors are generated to:

+ * + *

+     * const ubyte *ptr = (const ubyte *)indirect;
+     * for ( i = 0; i < drawcount; i++ ) {
+     *     DrawElementsIndirect(mode, type, (DrawElementsIndirectCommand *)ptr);
+     *     if ( stride == 0 )
+     *         ptr += sizeof(DrawElementsIndirectCommand);
+     *     else
+     *         ptr += stride;
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect a structure containing an array of draw parameters + * @param drawcount the number of elements in the array addressed by {@code indirect} + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") long indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + GL43C.glMultiDrawElementsIndirect(mode, type, indirect, drawcount, stride); + } + + /** + * Renders multiple indexed primitives from array data, taking parameters from memory. + * + *

The parameters addressed by indirect are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint firstIndex;
+     *     uint baseVertex;
+     *     uint baseInstance;
+     * } DrawElementsIndirectCommand;
+ * + *

A single call to {@code glMultiDrawElementsIndirect} is equivalent, assuming no errors are generated to:

+ * + *

+     * const ubyte *ptr = (const ubyte *)indirect;
+     * for ( i = 0; i < drawcount; i++ ) {
+     *     DrawElementsIndirect(mode, type, (DrawElementsIndirectCommand *)ptr);
+     *     if ( stride == 0 )
+     *         ptr += sizeof(DrawElementsIndirectCommand);
+     *     else
+     *         ptr += stride;
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect a structure containing an array of draw parameters + * @param drawcount the number of elements in the array addressed by {@code indirect} + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + GL43C.glMultiDrawElementsIndirect(mode, type, indirect, drawcount, stride); + } + + // --- [ glGetProgramInterfaceiv ] --- + + /** Unsafe version of: {@link #glGetProgramInterfaceiv GetProgramInterfaceiv} */ + public static void nglGetProgramInterfaceiv(int program, int programInterface, int pname, long params) { + GL43C.nglGetProgramInterfaceiv(program, programInterface, pname, params); + } + + /** + * Queries a property of an interface in a program. + * + * @param program the name of a program object whose interface to query + * @param programInterface a token identifying the interface within {@code program} to query. One of:
{@link GL43C#GL_UNIFORM UNIFORM}{@link GL43C#GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link GL43C#GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link GL43C#GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link GL43C#GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link GL43C#GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link GL43C#GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link GL43C#GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link GL43C#GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link GL43C#GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link GL43C#GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link GL43C#GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link GL43C#GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link GL43C#GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link GL43C#GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param pname the name of the parameter within {@code programInterface} to query. One of:
{@link GL43C#GL_ACTIVE_RESOURCES ACTIVE_RESOURCES}{@link GL43C#GL_MAX_NAME_LENGTH MAX_NAME_LENGTH}{@link GL43C#GL_MAX_NUM_ACTIVE_VARIABLES MAX_NUM_ACTIVE_VARIABLES}
{@link GL43C#GL_MAX_NUM_COMPATIBLE_SUBROUTINES MAX_NUM_COMPATIBLE_SUBROUTINES}
+ * @param params a variable to retrieve the value of {@code pname} for the program interface + * + * @see Reference Page + */ + public static void glGetProgramInterfaceiv(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL43C.glGetProgramInterfaceiv(program, programInterface, pname, params); + } + + /** + * Queries a property of an interface in a program. + * + * @param program the name of a program object whose interface to query + * @param programInterface a token identifying the interface within {@code program} to query. One of:
{@link GL43C#GL_UNIFORM UNIFORM}{@link GL43C#GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link GL43C#GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link GL43C#GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link GL43C#GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link GL43C#GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link GL43C#GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link GL43C#GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link GL43C#GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link GL43C#GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link GL43C#GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link GL43C#GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link GL43C#GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link GL43C#GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link GL43C#GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param pname the name of the parameter within {@code programInterface} to query. One of:
{@link GL43C#GL_ACTIVE_RESOURCES ACTIVE_RESOURCES}{@link GL43C#GL_MAX_NAME_LENGTH MAX_NAME_LENGTH}{@link GL43C#GL_MAX_NUM_ACTIVE_VARIABLES MAX_NUM_ACTIVE_VARIABLES}
{@link GL43C#GL_MAX_NUM_COMPATIBLE_SUBROUTINES MAX_NUM_COMPATIBLE_SUBROUTINES}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetProgramInterfacei(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLenum") int pname) { + return GL43C.glGetProgramInterfacei(program, programInterface, pname); + } + + // --- [ glGetProgramResourceIndex ] --- + + /** Unsafe version of: {@link #glGetProgramResourceIndex GetProgramResourceIndex} */ + public static int nglGetProgramResourceIndex(int program, int programInterface, long name) { + return GL43C.nglGetProgramResourceIndex(program, programInterface, name); + } + + /** + * Queries the index of a named resource within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the resource named {Wcode name}. One of:
{@link GL43C#GL_UNIFORM UNIFORM}{@link GL43C#GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link GL43C#GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link GL43C#GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link GL43C#GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link GL43C#GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link GL43C#GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link GL43C#GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link GL43C#GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link GL43C#GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link GL43C#GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link GL43C#GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link GL43C#GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link GL43C#GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link GL43C#GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param name the name of the resource to query the index of + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glGetProgramResourceIndex(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLchar const *") ByteBuffer name) { + return GL43C.glGetProgramResourceIndex(program, programInterface, name); + } + + /** + * Queries the index of a named resource within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the resource named {Wcode name}. One of:
{@link GL43C#GL_UNIFORM UNIFORM}{@link GL43C#GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link GL43C#GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link GL43C#GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link GL43C#GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link GL43C#GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link GL43C#GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link GL43C#GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link GL43C#GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link GL43C#GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link GL43C#GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link GL43C#GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link GL43C#GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link GL43C#GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link GL43C#GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param name the name of the resource to query the index of + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glGetProgramResourceIndex(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLchar const *") CharSequence name) { + return GL43C.glGetProgramResourceIndex(program, programInterface, name); + } + + // --- [ glGetProgramResourceName ] --- + + /** + * Unsafe version of: {@link #glGetProgramResourceName GetProgramResourceName} + * + * @param bufSize the size of the character array whose address is given by {@code name} + */ + public static void nglGetProgramResourceName(int program, int programInterface, int index, int bufSize, long length, long name) { + GL43C.nglGetProgramResourceName(program, programInterface, index, bufSize, length, name); + } + + /** + * Queries the name of an indexed resource within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the indexed resource. One of:
{@link GL43C#GL_UNIFORM UNIFORM}{@link GL43C#GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link GL43C#GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link GL43C#GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link GL43C#GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link GL43C#GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link GL43C#GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link GL43C#GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link GL43C#GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link GL43C#GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link GL43C#GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link GL43C#GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link GL43C#GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link GL43C#GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link GL43C#GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param index the index of the resource within {@code programInterface} of {@code program} + * @param length a variable which will receive the length of the resource name + * @param name a character array into which will be written the name of the resource + * + * @see Reference Page + */ + public static void glGetProgramResourceName(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer name) { + GL43C.glGetProgramResourceName(program, programInterface, index, length, name); + } + + /** + * Queries the name of an indexed resource within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the indexed resource. One of:
{@link GL43C#GL_UNIFORM UNIFORM}{@link GL43C#GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link GL43C#GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link GL43C#GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link GL43C#GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link GL43C#GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link GL43C#GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link GL43C#GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link GL43C#GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link GL43C#GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link GL43C#GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link GL43C#GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link GL43C#GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link GL43C#GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link GL43C#GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param index the index of the resource within {@code programInterface} of {@code program} + * @param bufSize the size of the character array whose address is given by {@code name} + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetProgramResourceName(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLuint") int index, @NativeType("GLsizei") int bufSize) { + return GL43C.glGetProgramResourceName(program, programInterface, index, bufSize); + } + + /** + * Queries the name of an indexed resource within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the indexed resource. One of:
{@link GL43C#GL_UNIFORM UNIFORM}{@link GL43C#GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link GL43C#GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link GL43C#GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link GL43C#GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link GL43C#GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link GL43C#GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link GL43C#GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link GL43C#GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link GL43C#GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link GL43C#GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link GL43C#GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link GL43C#GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link GL43C#GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link GL43C#GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param index the index of the resource within {@code programInterface} of {@code program} + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetProgramResourceName(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLuint") int index) { + return glGetProgramResourceName(program, programInterface, index, glGetProgramInterfacei(program, programInterface, GL_MAX_NAME_LENGTH)); + } + + // --- [ glGetProgramResourceiv ] --- + + /** + * Unsafe version of: {@link #glGetProgramResourceiv GetProgramResourceiv} + * + * @param propCount the number of properties in {@code props} + * @param bufSize the size of the integer array whose address is given by {@code params} + */ + public static void nglGetProgramResourceiv(int program, int programInterface, int index, int propCount, long props, int bufSize, long length, long params) { + GL43C.nglGetProgramResourceiv(program, programInterface, index, propCount, props, bufSize, length, params); + } + + /** + * Retrieves values for multiple properties of a single active resource within a program object. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the resource named {@code name}. One of:
{@link GL43C#GL_UNIFORM UNIFORM}{@link GL43C#GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link GL43C#GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link GL43C#GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link GL43C#GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link GL43C#GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link GL43C#GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link GL43C#GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link GL43C#GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link GL43C#GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link GL43C#GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link GL43C#GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link GL43C#GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link GL43C#GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link GL43C#GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link GL43C#GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param index the active resource index + * @param props an array that will receive the active resource properties + * @param length a variable which will receive the number of values returned + * @param params an array that will receive the property values + * + * @see Reference Page + */ + public static void glGetProgramResourceiv(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLuint") int index, @NativeType("GLenum const *") IntBuffer props, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLint *") IntBuffer params) { + GL43C.glGetProgramResourceiv(program, programInterface, index, props, length, params); + } + + // --- [ glGetProgramResourceLocation ] --- + + /** Unsafe version of: {@link #glGetProgramResourceLocation GetProgramResourceLocation} */ + public static int nglGetProgramResourceLocation(int program, int programInterface, long name) { + return GL43C.nglGetProgramResourceLocation(program, programInterface, name); + } + + /** + * Queries the location of a named resource within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the resource named {@code name} + * @param name the name of the resource to query the location of + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetProgramResourceLocation(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLchar const *") ByteBuffer name) { + return GL43C.glGetProgramResourceLocation(program, programInterface, name); + } + + /** + * Queries the location of a named resource within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the resource named {@code name} + * @param name the name of the resource to query the location of + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetProgramResourceLocation(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLchar const *") CharSequence name) { + return GL43C.glGetProgramResourceLocation(program, programInterface, name); + } + + // --- [ glGetProgramResourceLocationIndex ] --- + + /** Unsafe version of: {@link #glGetProgramResourceLocationIndex GetProgramResourceLocationIndex} */ + public static int nglGetProgramResourceLocationIndex(int program, int programInterface, long name) { + return GL43C.nglGetProgramResourceLocationIndex(program, programInterface, name); + } + + /** + * Queries the fragment color index of a named variable within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the resource named {@code name}. Must be:
{@link GL43C#GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}
+ * @param name the name of the resource to query the location of + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetProgramResourceLocationIndex(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLchar const *") ByteBuffer name) { + return GL43C.glGetProgramResourceLocationIndex(program, programInterface, name); + } + + /** + * Queries the fragment color index of a named variable within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the resource named {@code name}. Must be:
{@link GL43C#GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}
+ * @param name the name of the resource to query the location of + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetProgramResourceLocationIndex(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLchar const *") CharSequence name) { + return GL43C.glGetProgramResourceLocationIndex(program, programInterface, name); + } + + // --- [ glShaderStorageBlockBinding ] --- + + /** + * Changes an active shader storage block binding. + * + * @param program the name of the program containing the block whose binding to change + * @param storageBlockIndex the index storage block within the program + * @param storageBlockBinding the index storage block binding to associate with the specified storage block + * + * @see Reference Page + */ + public static void glShaderStorageBlockBinding(@NativeType("GLuint") int program, @NativeType("GLuint") int storageBlockIndex, @NativeType("GLuint") int storageBlockBinding) { + GL43C.glShaderStorageBlockBinding(program, storageBlockIndex, storageBlockBinding); + } + + // --- [ glTexBufferRange ] --- + + /** + * Binds a range of a buffer's data store to a buffer texture. + * + * @param target the target of the operation. Must be:
{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}
+ * @param internalformat the internal format of the data in the store belonging to {@code buffer} + * @param buffer the name of the buffer object whose storage to attach to the active buffer texture + * @param offset the offset of the start of the range of the buffer's data store to attach + * @param size the size of the range of the buffer's data store to attach + * + * @see Reference Page + */ + public static void glTexBufferRange(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size) { + GL43C.glTexBufferRange(target, internalformat, buffer, offset, size); + } + + // --- [ glTexStorage2DMultisample ] --- + + /** + * Specifies storage for a two-dimensional multisample texture. + * + * @param target the target of the operation. One of:
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_PROXY_TEXTURE_2D_MULTISAMPLE PROXY_TEXTURE_2D_MULTISAMPLE}
+ * @param samples the number of samples in the texture + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * @param fixedsamplelocations whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not + * depend on the internal format or size of the image + * + * @see Reference Page + */ + public static void glTexStorage2DMultisample(@NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLboolean") boolean fixedsamplelocations) { + GL43C.glTexStorage2DMultisample(target, samples, internalformat, width, height, fixedsamplelocations); + } + + // --- [ glTexStorage3DMultisample ] --- + + /** + * Specifies storage for a two-dimensional multisample array texture. + * + * @param target the target of the operation. One of:
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}{@link GL32#GL_PROXY_TEXTURE_2D_MULTISAMPLE PROXY_TEXTURE_2D_MULTISAMPLE}
+ * @param samples the number of samples in the texture + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * @param depth the depth of the texture, in texels + * @param fixedsamplelocations whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not + * depend on the internal format or size of the image + * + * @see Reference Page + */ + public static void glTexStorage3DMultisample(@NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLboolean") boolean fixedsamplelocations) { + GL43C.glTexStorage3DMultisample(target, samples, internalformat, width, height, depth, fixedsamplelocations); + } + + // --- [ glTextureView ] --- + + /** + * Initializes a texture as a data alias of another texture's data store. + * + * @param texture the texture object to be initialized as a view + * @param target the target to be used for the newly initialized texture + * @param origtexture the name of a texture object of which to make a view + * @param internalformat the internal format for the newly created view + * @param minlevel the lowest level of detail of the view + * @param numlevels the number of levels of detail to include in the view + * @param minlayer the index of the first layer to include in the view + * @param numlayers the number of layers to include in the view + * + * @see Reference Page + */ + public static void glTextureView(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLuint") int origtexture, @NativeType("GLenum") int internalformat, @NativeType("GLuint") int minlevel, @NativeType("GLuint") int numlevels, @NativeType("GLuint") int minlayer, @NativeType("GLuint") int numlayers) { + GL43C.glTextureView(texture, target, origtexture, internalformat, minlevel, numlevels, minlayer, numlayers); + } + + // --- [ glBindVertexBuffer ] --- + + /** + * Binds a buffer to a vertex buffer bind point. + * + * @param bindingindex the index of the vertex buffer binding point to which to bind the buffer + * @param buffer the name of an existing buffer to bind to the vertex buffer binding point + * @param offset the offset of the first element of the buffer + * @param stride the distance between elements within the buffer + * + * @see Reference Page + */ + public static void glBindVertexBuffer(@NativeType("GLuint") int bindingindex, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizei") int stride) { + GL43C.glBindVertexBuffer(bindingindex, buffer, offset, stride); + } + + // --- [ glVertexAttribFormat ] --- + + /** + * Specifies the organization of data in vertex arrays. + * + * @param attribindex the generic vertex attribute array being described + * @param size the number of values per vertex that are stored in the array. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the type of the data stored in the array + * @param normalized if true then integer data is normalized to the range [-1, 1] or [0, 1] if it is signed or unsigned, respectively. If false then integer data is + * directly converted to floating point. + * @param relativeoffset the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from + * + * @see Reference Page + */ + public static void glVertexAttribFormat(@NativeType("GLuint") int attribindex, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint") int relativeoffset) { + GL43C.glVertexAttribFormat(attribindex, size, type, normalized, relativeoffset); + } + + // --- [ glVertexAttribIFormat ] --- + + /** + * Specifies the organization of pure integer data in vertex arrays. + * + * @param attribindex the generic vertex attribute array being described + * @param size the number of values per vertex that are stored in the array. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the type of the data stored in the array + * @param relativeoffset the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from + * + * @see Reference Page + */ + public static void glVertexAttribIFormat(@NativeType("GLuint") int attribindex, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLuint") int relativeoffset) { + GL43C.glVertexAttribIFormat(attribindex, size, type, relativeoffset); + } + + // --- [ glVertexAttribLFormat ] --- + + /** + * Specifies the organization of 64-bit double data in vertex arrays. + * + * @param attribindex the generic vertex attribute array being described + * @param size the number of values per vertex that are stored in the array. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the type of the data stored in the array + * @param relativeoffset the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from + * + * @see Reference Page + */ + public static void glVertexAttribLFormat(@NativeType("GLuint") int attribindex, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLuint") int relativeoffset) { + GL43C.glVertexAttribLFormat(attribindex, size, type, relativeoffset); + } + + // --- [ glVertexAttribBinding ] --- + + /** + * Associate a vertex attribute and a vertex buffer binding. + * + * @param attribindex the index of the attribute to associate with a vertex buffer binding + * @param bindingindex the index of the vertex buffer binding with which to associate the generic vertex attribute + * + * @see Reference Page + */ + public static void glVertexAttribBinding(@NativeType("GLuint") int attribindex, @NativeType("GLuint") int bindingindex) { + GL43C.glVertexAttribBinding(attribindex, bindingindex); + } + + // --- [ glVertexBindingDivisor ] --- + + /** + * Modifies the rate at which generic vertex attributes advance during instanced rendering. + * + * @param bindingindex the index of the generic vertex attribute + * @param divisor the number of instances that will pass between updates of the generic attribute at slot {@code index} + * + * @see Reference Page + */ + public static void glVertexBindingDivisor(@NativeType("GLuint") int bindingindex, @NativeType("GLuint") int divisor) { + GL43C.glVertexBindingDivisor(bindingindex, divisor); + } + + /** + * Array version of: {@link #glClearBufferData ClearBufferData} + * + * @see Reference Page + */ + public static void glClearBufferData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] data) { + GL43C.glClearBufferData(target, internalformat, format, type, data); + } + + /** + * Array version of: {@link #glClearBufferData ClearBufferData} + * + * @see Reference Page + */ + public static void glClearBufferData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] data) { + GL43C.glClearBufferData(target, internalformat, format, type, data); + } + + /** + * Array version of: {@link #glClearBufferData ClearBufferData} + * + * @see Reference Page + */ + public static void glClearBufferData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] data) { + GL43C.glClearBufferData(target, internalformat, format, type, data); + } + + /** + * Array version of: {@link #glClearBufferSubData ClearBufferSubData} + * + * @see Reference Page + */ + public static void glClearBufferSubData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] data) { + GL43C.glClearBufferSubData(target, internalformat, offset, size, format, type, data); + } + + /** + * Array version of: {@link #glClearBufferSubData ClearBufferSubData} + * + * @see Reference Page + */ + public static void glClearBufferSubData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] data) { + GL43C.glClearBufferSubData(target, internalformat, offset, size, format, type, data); + } + + /** + * Array version of: {@link #glClearBufferSubData ClearBufferSubData} + * + * @see Reference Page + */ + public static void glClearBufferSubData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] data) { + GL43C.glClearBufferSubData(target, internalformat, offset, size, format, type, data); + } + + /** + * Array version of: {@link #glDebugMessageControl DebugMessageControl} + * + * @see Reference Page + */ + public static void glDebugMessageControl(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLenum") int severity, @Nullable @NativeType("GLuint const *") int[] ids, @NativeType("GLboolean") boolean enabled) { + GL43C.glDebugMessageControl(source, type, severity, ids, enabled); + } + + /** + * Array version of: {@link #glGetDebugMessageLog GetDebugMessageLog} + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glGetDebugMessageLog(@NativeType("GLuint") int count, @Nullable @NativeType("GLenum *") int[] sources, @Nullable @NativeType("GLenum *") int[] types, @Nullable @NativeType("GLuint *") int[] ids, @Nullable @NativeType("GLenum *") int[] severities, @Nullable @NativeType("GLsizei *") int[] lengths, @Nullable @NativeType("GLchar *") ByteBuffer messageLog) { + return GL43C.glGetDebugMessageLog(count, sources, types, ids, severities, lengths, messageLog); + } + + /** + * Array version of: {@link #glGetObjectLabel GetObjectLabel} + * + * @see Reference Page + */ + public static void glGetObjectLabel(@NativeType("GLenum") int identifier, @NativeType("GLuint") int name, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer label) { + GL43C.glGetObjectLabel(identifier, name, length, label); + } + + /** + * Array version of: {@link #glGetObjectPtrLabel GetObjectPtrLabel} + * + * @see Reference Page + */ + public static void glGetObjectPtrLabel(@NativeType("void *") long ptr, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer label) { + GL43C.glGetObjectPtrLabel(ptr, length, label); + } + + /** + * Array version of: {@link #glGetFramebufferParameteriv GetFramebufferParameteriv} + * + * @see Reference Page + */ + public static void glGetFramebufferParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL43C.glGetFramebufferParameteriv(target, pname, params); + } + + /** + * Array version of: {@link #glGetInternalformati64v GetInternalformati64v} + * + * @see Reference Page + */ + public static void glGetInternalformati64v(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int pname, @NativeType("GLint64 *") long[] params) { + GL43C.glGetInternalformati64v(target, internalformat, pname, params); + } + + /** + * Array version of: {@link #glInvalidateFramebuffer InvalidateFramebuffer} + * + * @see Reference Page + */ + public static void glInvalidateFramebuffer(@NativeType("GLenum") int target, @NativeType("GLenum const *") int[] attachments) { + GL43C.glInvalidateFramebuffer(target, attachments); + } + + /** + * Array version of: {@link #glInvalidateSubFramebuffer InvalidateSubFramebuffer} + * + * @see Reference Page + */ + public static void glInvalidateSubFramebuffer(@NativeType("GLenum") int target, @NativeType("GLenum const *") int[] attachments, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL43C.glInvalidateSubFramebuffer(target, attachments, x, y, width, height); + } + + /** + * Array version of: {@link #glMultiDrawArraysIndirect MultiDrawArraysIndirect} + * + * @see Reference Page + */ + public static void glMultiDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") int[] indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + GL43C.glMultiDrawArraysIndirect(mode, indirect, drawcount, stride); + } + + /** + * Array version of: {@link #glMultiDrawElementsIndirect MultiDrawElementsIndirect} + * + * @see Reference Page + */ + public static void glMultiDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") int[] indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + GL43C.glMultiDrawElementsIndirect(mode, type, indirect, drawcount, stride); + } + + /** + * Array version of: {@link #glGetProgramInterfaceiv GetProgramInterfaceiv} + * + * @see Reference Page + */ + public static void glGetProgramInterfaceiv(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL43C.glGetProgramInterfaceiv(program, programInterface, pname, params); + } + + /** + * Array version of: {@link #glGetProgramResourceName GetProgramResourceName} + * + * @see Reference Page + */ + public static void glGetProgramResourceName(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer name) { + GL43C.glGetProgramResourceName(program, programInterface, index, length, name); + } + + /** + * Array version of: {@link #glGetProgramResourceiv GetProgramResourceiv} + * + * @see Reference Page + */ + public static void glGetProgramResourceiv(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLuint") int index, @NativeType("GLenum const *") int[] props, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLint *") int[] params) { + GL43C.glGetProgramResourceiv(program, programInterface, index, props, length, params); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL43C.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL43C.java new file mode 100644 index 00000000..e10e9ec7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL43C.java @@ -0,0 +1,2382 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality up to version 4.3. Includes only Core Profile symbols. + * + *

OpenGL 4.3 implementations support revision 4.30 of the OpenGL Shading Language.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL43C extends GL42C { + + /** No. of supported Shading Language Versions. Accepted by the {@code pname} parameter of GetIntegerv. */ + public static final int GL_NUM_SHADING_LANGUAGE_VERSIONS = 0x82E9; + + /** Vertex attrib array has unconverted doubles. Accepted by the {@code pname} parameter of GetVertexAttribiv. */ + public static final int GL_VERTEX_ATTRIB_ARRAY_LONG = 0x874E; + + /** Accepted by the {@code internalformat} parameter of CompressedTexImage2D. */ + public static final int + GL_COMPRESSED_RGB8_ETC2 = 0x9274, + GL_COMPRESSED_SRGB8_ETC2 = 0x9275, + GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276, + GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277, + GL_COMPRESSED_RGBA8_ETC2_EAC = 0x9278, + GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279, + GL_COMPRESSED_R11_EAC = 0x9270, + GL_COMPRESSED_SIGNED_R11_EAC = 0x9271, + GL_COMPRESSED_RG11_EAC = 0x9272, + GL_COMPRESSED_SIGNED_RG11_EAC = 0x9273; + + /** Accepted by the {@code target} parameter of Enable and Disable. */ + public static final int GL_PRIMITIVE_RESTART_FIXED_INDEX = 0x8D69; + + /** Accepted by the {@code target} parameter of BeginQuery, EndQuery, GetQueryIndexediv and GetQueryiv. */ + public static final int GL_ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A; + + /** Accepted by the {@code value} parameter of the GetInteger* functions. */ + public static final int GL_MAX_ELEMENT_INDEX = 0x8D6B; + + /** Accepted by the {@code pname} parameters of GetTexParameterfv and GetTexParameteriv. */ + public static final int GL_TEXTURE_IMMUTABLE_LEVELS = 0x82DF; + + /** Accepted by the {@code type} parameter of CreateShader and returned in the {@code params} parameter by GetShaderiv. */ + public static final int GL_COMPUTE_SHADER = 0x91B9; + + /** Accepted by the {@code pname} parameter of GetIntegerv, GetBooleanv, GetFloatv, GetDoublev and GetInteger64v. */ + public static final int + GL_MAX_COMPUTE_UNIFORM_BLOCKS = 0x91BB, + GL_MAX_COMPUTE_TEXTURE_IMAGE_UNITS = 0x91BC, + GL_MAX_COMPUTE_IMAGE_UNIFORMS = 0x91BD, + GL_MAX_COMPUTE_SHARED_MEMORY_SIZE = 0x8262, + GL_MAX_COMPUTE_UNIFORM_COMPONENTS = 0x8263, + GL_MAX_COMPUTE_ATOMIC_COUNTER_BUFFERS = 0x8264, + GL_MAX_COMPUTE_ATOMIC_COUNTERS = 0x8265, + GL_MAX_COMBINED_COMPUTE_UNIFORM_COMPONENTS = 0x8266, + GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS = 0x90EB; + + /** Accepted by the {@code pname} parameter of GetIntegeri_v, GetBooleani_v, GetFloati_v, GetDoublei_v and GetInteger64i_v. */ + public static final int + GL_MAX_COMPUTE_WORK_GROUP_COUNT = 0x91BE, + GL_MAX_COMPUTE_WORK_GROUP_SIZE = 0x91BF; + + /** Accepted by the {@code pname} parameter of GetProgramiv. */ + public static final int GL_COMPUTE_WORK_GROUP_SIZE = 0x8267; + + /** Accepted by the {@code pname} parameter of GetActiveUniformBlockiv. */ + public static final int GL_UNIFORM_BLOCK_REFERENCED_BY_COMPUTE_SHADER = 0x90EC; + + /** Accepted by the {@code pname} parameter of GetActiveAtomicCounterBufferiv. */ + public static final int GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_COMPUTE_SHADER = 0x90ED; + + /** Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, and GetBufferPointerv. */ + public static final int GL_DISPATCH_INDIRECT_BUFFER = 0x90EE; + + /** Accepted by the {@code value} parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int GL_DISPATCH_INDIRECT_BUFFER_BINDING = 0x90EF; + + /** Accepted by the {@code stages} parameter of UseProgramStages. */ + public static final int GL_COMPUTE_SHADER_BIT = 0x20; + + /** Tokens accepted by the {@code target} parameters of Enable, Disable, and IsEnabled. */ + public static final int + GL_DEBUG_OUTPUT = 0x92E0, + GL_DEBUG_OUTPUT_SYNCHRONOUS = 0x8242; + + /** Returned by GetIntegerv when {@code pname} is CONTEXT_FLAGS. */ + public static final int GL_CONTEXT_FLAG_DEBUG_BIT = 0x2; + + /** Tokens accepted by the {@code value} parameters of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v. */ + public static final int + GL_MAX_DEBUG_MESSAGE_LENGTH = 0x9143, + GL_MAX_DEBUG_LOGGED_MESSAGES = 0x9144, + GL_DEBUG_LOGGED_MESSAGES = 0x9145, + GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = 0x8243, + GL_MAX_DEBUG_GROUP_STACK_DEPTH = 0x826C, + GL_DEBUG_GROUP_STACK_DEPTH = 0x826D, + GL_MAX_LABEL_LENGTH = 0x82E8; + + /** Tokens accepted by the {@code pname} parameter of GetPointerv. */ + public static final int + GL_DEBUG_CALLBACK_FUNCTION = 0x8244, + GL_DEBUG_CALLBACK_USER_PARAM = 0x8245; + + /** + * Tokens accepted or provided by the {@code source} parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC, and the {@code sources} parameter + * of GetDebugMessageLog. + */ + public static final int + GL_DEBUG_SOURCE_API = 0x8246, + GL_DEBUG_SOURCE_WINDOW_SYSTEM = 0x8247, + GL_DEBUG_SOURCE_SHADER_COMPILER = 0x8248, + GL_DEBUG_SOURCE_THIRD_PARTY = 0x8249, + GL_DEBUG_SOURCE_APPLICATION = 0x824A, + GL_DEBUG_SOURCE_OTHER = 0x824B; + + /** + * Tokens accepted or provided by the {@code type} parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC, and the {@code types} parameter of + * GetDebugMessageLog. + */ + public static final int + GL_DEBUG_TYPE_ERROR = 0x824C, + GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR = 0x824D, + GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR = 0x824E, + GL_DEBUG_TYPE_PORTABILITY = 0x824F, + GL_DEBUG_TYPE_PERFORMANCE = 0x8250, + GL_DEBUG_TYPE_OTHER = 0x8251, + GL_DEBUG_TYPE_MARKER = 0x8268; + + /** Tokens accepted or provided by the {@code type} parameters of DebugMessageControl and DEBUGPROC, and the {@code types} parameter of GetDebugMessageLog. */ + public static final int + GL_DEBUG_TYPE_PUSH_GROUP = 0x8269, + GL_DEBUG_TYPE_POP_GROUP = 0x826A; + + /** + * Tokens accepted or provided by the {@code severity} parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC callback functions, and the + * {@code severities} parameter of GetDebugMessageLog. + */ + public static final int + GL_DEBUG_SEVERITY_HIGH = 0x9146, + GL_DEBUG_SEVERITY_MEDIUM = 0x9147, + GL_DEBUG_SEVERITY_LOW = 0x9148, + GL_DEBUG_SEVERITY_NOTIFICATION = 0x826B; + + /** Tokens accepted or provided by the {@code identifier} parameters of ObjectLabel and GetObjectLabel. */ + public static final int + GL_BUFFER = 0x82E0, + GL_SHADER = 0x82E1, + GL_PROGRAM = 0x82E2, + GL_QUERY = 0x82E3, + GL_PROGRAM_PIPELINE = 0x82E4, + GL_SAMPLER = 0x82E6; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev, and GetInteger64v. */ + public static final int GL_MAX_UNIFORM_LOCATIONS = 0x826E; + + /** + * Accepted by the {@code pname} parameter of FramebufferParameteri, GetFramebufferParameteriv, NamedFramebufferParameteriEXT, and + * GetNamedFramebufferParameterivEXT. + */ + public static final int + GL_FRAMEBUFFER_DEFAULT_WIDTH = 0x9310, + GL_FRAMEBUFFER_DEFAULT_HEIGHT = 0x9311, + GL_FRAMEBUFFER_DEFAULT_LAYERS = 0x9312, + GL_FRAMEBUFFER_DEFAULT_SAMPLES = 0x9313, + GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS = 0x9314; + + /** Accepted by the {@code pname} parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_FRAMEBUFFER_WIDTH = 0x9315, + GL_MAX_FRAMEBUFFER_HEIGHT = 0x9316, + GL_MAX_FRAMEBUFFER_LAYERS = 0x9317, + GL_MAX_FRAMEBUFFER_SAMPLES = 0x9318; + + /** Accepted by the {@code pname} parameter of GetInternalformativ and GetInternalformati64v. */ + public static final int + GL_INTERNALFORMAT_SUPPORTED = 0x826F, + GL_INTERNALFORMAT_PREFERRED = 0x8270, + GL_INTERNALFORMAT_RED_SIZE = 0x8271, + GL_INTERNALFORMAT_GREEN_SIZE = 0x8272, + GL_INTERNALFORMAT_BLUE_SIZE = 0x8273, + GL_INTERNALFORMAT_ALPHA_SIZE = 0x8274, + GL_INTERNALFORMAT_DEPTH_SIZE = 0x8275, + GL_INTERNALFORMAT_STENCIL_SIZE = 0x8276, + GL_INTERNALFORMAT_SHARED_SIZE = 0x8277, + GL_INTERNALFORMAT_RED_TYPE = 0x8278, + GL_INTERNALFORMAT_GREEN_TYPE = 0x8279, + GL_INTERNALFORMAT_BLUE_TYPE = 0x827A, + GL_INTERNALFORMAT_ALPHA_TYPE = 0x827B, + GL_INTERNALFORMAT_DEPTH_TYPE = 0x827C, + GL_INTERNALFORMAT_STENCIL_TYPE = 0x827D, + GL_MAX_WIDTH = 0x827E, + GL_MAX_HEIGHT = 0x827F, + GL_MAX_DEPTH = 0x8280, + GL_MAX_LAYERS = 0x8281, + GL_MAX_COMBINED_DIMENSIONS = 0x8282, + GL_COLOR_COMPONENTS = 0x8283, + GL_DEPTH_COMPONENTS = 0x8284, + GL_STENCIL_COMPONENTS = 0x8285, + GL_COLOR_RENDERABLE = 0x8286, + GL_DEPTH_RENDERABLE = 0x8287, + GL_STENCIL_RENDERABLE = 0x8288, + GL_FRAMEBUFFER_RENDERABLE = 0x8289, + GL_FRAMEBUFFER_RENDERABLE_LAYERED = 0x828A, + GL_FRAMEBUFFER_BLEND = 0x828B, + GL_READ_PIXELS = 0x828C, + GL_READ_PIXELS_FORMAT = 0x828D, + GL_READ_PIXELS_TYPE = 0x828E, + GL_TEXTURE_IMAGE_FORMAT = 0x828F, + GL_TEXTURE_IMAGE_TYPE = 0x8290, + GL_GET_TEXTURE_IMAGE_FORMAT = 0x8291, + GL_GET_TEXTURE_IMAGE_TYPE = 0x8292, + GL_MIPMAP = 0x8293, + GL_MANUAL_GENERATE_MIPMAP = 0x8294, + GL_AUTO_GENERATE_MIPMAP = 0x8295, + GL_COLOR_ENCODING = 0x8296, + GL_SRGB_READ = 0x8297, + GL_SRGB_WRITE = 0x8298, + GL_FILTER = 0x829A, + GL_VERTEX_TEXTURE = 0x829B, + GL_TESS_CONTROL_TEXTURE = 0x829C, + GL_TESS_EVALUATION_TEXTURE = 0x829D, + GL_GEOMETRY_TEXTURE = 0x829E, + GL_FRAGMENT_TEXTURE = 0x829F, + GL_COMPUTE_TEXTURE = 0x82A0, + GL_TEXTURE_SHADOW = 0x82A1, + GL_TEXTURE_GATHER = 0x82A2, + GL_TEXTURE_GATHER_SHADOW = 0x82A3, + GL_SHADER_IMAGE_LOAD = 0x82A4, + GL_SHADER_IMAGE_STORE = 0x82A5, + GL_SHADER_IMAGE_ATOMIC = 0x82A6, + GL_IMAGE_TEXEL_SIZE = 0x82A7, + GL_IMAGE_COMPATIBILITY_CLASS = 0x82A8, + GL_IMAGE_PIXEL_FORMAT = 0x82A9, + GL_IMAGE_PIXEL_TYPE = 0x82AA, + GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_TEST = 0x82AC, + GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_TEST = 0x82AD, + GL_SIMULTANEOUS_TEXTURE_AND_DEPTH_WRITE = 0x82AE, + GL_SIMULTANEOUS_TEXTURE_AND_STENCIL_WRITE = 0x82AF, + GL_TEXTURE_COMPRESSED_BLOCK_WIDTH = 0x82B1, + GL_TEXTURE_COMPRESSED_BLOCK_HEIGHT = 0x82B2, + GL_TEXTURE_COMPRESSED_BLOCK_SIZE = 0x82B3, + GL_CLEAR_BUFFER = 0x82B4, + GL_TEXTURE_VIEW = 0x82B5, + GL_VIEW_COMPATIBILITY_CLASS = 0x82B6; + + /** Returned as possible responses for various {@code pname} queries to GetInternalformativ and GetInternalformati64v. */ + public static final int + GL_FULL_SUPPORT = 0x82B7, + GL_CAVEAT_SUPPORT = 0x82B8, + GL_IMAGE_CLASS_4_X_32 = 0x82B9, + GL_IMAGE_CLASS_2_X_32 = 0x82BA, + GL_IMAGE_CLASS_1_X_32 = 0x82BB, + GL_IMAGE_CLASS_4_X_16 = 0x82BC, + GL_IMAGE_CLASS_2_X_16 = 0x82BD, + GL_IMAGE_CLASS_1_X_16 = 0x82BE, + GL_IMAGE_CLASS_4_X_8 = 0x82BF, + GL_IMAGE_CLASS_2_X_8 = 0x82C0, + GL_IMAGE_CLASS_1_X_8 = 0x82C1, + GL_IMAGE_CLASS_11_11_10 = 0x82C2, + GL_IMAGE_CLASS_10_10_10_2 = 0x82C3, + GL_VIEW_CLASS_128_BITS = 0x82C4, + GL_VIEW_CLASS_96_BITS = 0x82C5, + GL_VIEW_CLASS_64_BITS = 0x82C6, + GL_VIEW_CLASS_48_BITS = 0x82C7, + GL_VIEW_CLASS_32_BITS = 0x82C8, + GL_VIEW_CLASS_24_BITS = 0x82C9, + GL_VIEW_CLASS_16_BITS = 0x82CA, + GL_VIEW_CLASS_8_BITS = 0x82CB, + GL_VIEW_CLASS_S3TC_DXT1_RGB = 0x82CC, + GL_VIEW_CLASS_S3TC_DXT1_RGBA = 0x82CD, + GL_VIEW_CLASS_S3TC_DXT3_RGBA = 0x82CE, + GL_VIEW_CLASS_S3TC_DXT5_RGBA = 0x82CF, + GL_VIEW_CLASS_RGTC1_RED = 0x82D0, + GL_VIEW_CLASS_RGTC2_RG = 0x82D1, + GL_VIEW_CLASS_BPTC_UNORM = 0x82D2, + GL_VIEW_CLASS_BPTC_FLOAT = 0x82D3; + + /** + * Accepted by the {@code programInterface} parameter of GetProgramInterfaceiv, GetProgramResourceIndex, GetProgramResourceName, GetProgramResourceiv, + * GetProgramResourceLocation, and GetProgramResourceLocationIndex. + */ + public static final int + GL_UNIFORM = 0x92E1, + GL_UNIFORM_BLOCK = 0x92E2, + GL_PROGRAM_INPUT = 0x92E3, + GL_PROGRAM_OUTPUT = 0x92E4, + GL_BUFFER_VARIABLE = 0x92E5, + GL_SHADER_STORAGE_BLOCK = 0x92E6, + GL_VERTEX_SUBROUTINE = 0x92E8, + GL_TESS_CONTROL_SUBROUTINE = 0x92E9, + GL_TESS_EVALUATION_SUBROUTINE = 0x92EA, + GL_GEOMETRY_SUBROUTINE = 0x92EB, + GL_FRAGMENT_SUBROUTINE = 0x92EC, + GL_COMPUTE_SUBROUTINE = 0x92ED, + GL_VERTEX_SUBROUTINE_UNIFORM = 0x92EE, + GL_TESS_CONTROL_SUBROUTINE_UNIFORM = 0x92EF, + GL_TESS_EVALUATION_SUBROUTINE_UNIFORM = 0x92F0, + GL_GEOMETRY_SUBROUTINE_UNIFORM = 0x92F1, + GL_FRAGMENT_SUBROUTINE_UNIFORM = 0x92F2, + GL_COMPUTE_SUBROUTINE_UNIFORM = 0x92F3, + GL_TRANSFORM_FEEDBACK_VARYING = 0x92F4; + + /** Accepted by the {@code pname} parameter of GetProgramInterfaceiv. */ + public static final int + GL_ACTIVE_RESOURCES = 0x92F5, + GL_MAX_NAME_LENGTH = 0x92F6, + GL_MAX_NUM_ACTIVE_VARIABLES = 0x92F7, + GL_MAX_NUM_COMPATIBLE_SUBROUTINES = 0x92F8; + + /** Accepted in the {@code props} array of GetProgramResourceiv. */ + public static final int + GL_NAME_LENGTH = 0x92F9, + GL_TYPE = 0x92FA, + GL_ARRAY_SIZE = 0x92FB, + GL_OFFSET = 0x92FC, + GL_BLOCK_INDEX = 0x92FD, + GL_ARRAY_STRIDE = 0x92FE, + GL_MATRIX_STRIDE = 0x92FF, + GL_IS_ROW_MAJOR = 0x9300, + GL_ATOMIC_COUNTER_BUFFER_INDEX = 0x9301, + GL_BUFFER_BINDING = 0x9302, + GL_BUFFER_DATA_SIZE = 0x9303, + GL_NUM_ACTIVE_VARIABLES = 0x9304, + GL_ACTIVE_VARIABLES = 0x9305, + GL_REFERENCED_BY_VERTEX_SHADER = 0x9306, + GL_REFERENCED_BY_TESS_CONTROL_SHADER = 0x9307, + GL_REFERENCED_BY_TESS_EVALUATION_SHADER = 0x9308, + GL_REFERENCED_BY_GEOMETRY_SHADER = 0x9309, + GL_REFERENCED_BY_FRAGMENT_SHADER = 0x930A, + GL_REFERENCED_BY_COMPUTE_SHADER = 0x930B, + GL_TOP_LEVEL_ARRAY_SIZE = 0x930C, + GL_TOP_LEVEL_ARRAY_STRIDE = 0x930D, + GL_LOCATION = 0x930E, + GL_LOCATION_INDEX = 0x930F, + GL_IS_PER_PATCH = 0x92E7; + + /** Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, and GetBufferPointerv. */ + public static final int GL_SHADER_STORAGE_BUFFER = 0x90D2; + + /** + * Accepted by the {@code pname} parameter of GetIntegerv, GetIntegeri_v, GetBooleanv, GetInteger64v, GetFloatv, GetDoublev, GetBooleani_v, GetIntegeri_v, + * GetFloati_v, GetDoublei_v, and GetInteger64i_v. + */ + public static final int GL_SHADER_STORAGE_BUFFER_BINDING = 0x90D3; + + /** Accepted by the {@code pname} parameter of GetIntegeri_v, GetBooleani_v, GetIntegeri_v, GetFloati_v, GetDoublei_v, and GetInteger64i_v. */ + public static final int + GL_SHADER_STORAGE_BUFFER_START = 0x90D4, + GL_SHADER_STORAGE_BUFFER_SIZE = 0x90D5; + + /** Accepted by the {@code pname} parameter of GetIntegerv, GetBooleanv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int + GL_MAX_VERTEX_SHADER_STORAGE_BLOCKS = 0x90D6, + GL_MAX_GEOMETRY_SHADER_STORAGE_BLOCKS = 0x90D7, + GL_MAX_TESS_CONTROL_SHADER_STORAGE_BLOCKS = 0x90D8, + GL_MAX_TESS_EVALUATION_SHADER_STORAGE_BLOCKS = 0x90D9, + GL_MAX_FRAGMENT_SHADER_STORAGE_BLOCKS = 0x90DA, + GL_MAX_COMPUTE_SHADER_STORAGE_BLOCKS = 0x90DB, + GL_MAX_COMBINED_SHADER_STORAGE_BLOCKS = 0x90DC, + GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS = 0x90DD, + GL_MAX_SHADER_STORAGE_BLOCK_SIZE = 0x90DE, + GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT = 0x90DF; + + /** Accepted in the {@code barriers} bitfield in glMemoryBarrier. */ + public static final int GL_SHADER_STORAGE_BARRIER_BIT = 0x2000; + + /** Alias for the existing token MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS. */ + public static final int GL_MAX_COMBINED_SHADER_OUTPUT_RESOURCES = 0x8F39; + + /** Accepted by the {@code pname} parameter of TexParameter* and GetTexParameter*. */ + public static final int GL_DEPTH_STENCIL_TEXTURE_MODE = 0x90EA; + + /** Accepted by the {@code pname} parameter of GetTexLevelParameter. */ + public static final int + GL_TEXTURE_BUFFER_OFFSET = 0x919D, + GL_TEXTURE_BUFFER_SIZE = 0x919E; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_TEXTURE_BUFFER_OFFSET_ALIGNMENT = 0x919F; + + /** Accepted by the {@code pname} parameters of GetTexParameterfv and GetTexParameteriv. */ + public static final int + GL_TEXTURE_VIEW_MIN_LEVEL = 0x82DB, + GL_TEXTURE_VIEW_NUM_LEVELS = 0x82DC, + GL_TEXTURE_VIEW_MIN_LAYER = 0x82DD, + GL_TEXTURE_VIEW_NUM_LAYERS = 0x82DE; + + /** Accepted by the {@code pname} parameter of GetVertexAttrib*v. */ + public static final int + GL_VERTEX_ATTRIB_BINDING = 0x82D4, + GL_VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D5; + + /** Accepted by the {@code target} parameter of GetBooleani_v, GetIntegeri_v, GetFloati_v, GetDoublei_v, and GetInteger64i_v. */ + public static final int + GL_VERTEX_BINDING_DIVISOR = 0x82D6, + GL_VERTEX_BINDING_OFFSET = 0x82D7, + GL_VERTEX_BINDING_STRIDE = 0x82D8, + GL_VERTEX_BINDING_BUFFER = 0x8F4F; + + /** Accepted by the {@code pname} parameter of GetIntegerv, .... */ + public static final int + GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET = 0x82D9, + GL_MAX_VERTEX_ATTRIB_BINDINGS = 0x82DA; + + static { GL.initialize(); } + + protected GL43C() { + throw new UnsupportedOperationException(); + } + + // --- [ glClearBufferData ] --- + + /** Unsafe version of: {@link #glClearBufferData ClearBufferData} */ + public static native void nglClearBufferData(int target, int internalformat, int format, int type, long data); + + /** + * Fills a buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link #GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link #GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearBufferData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer data) { + nglClearBufferData(target, internalformat, format, type, memAddressSafe(data)); + } + + /** + * Fills a buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link #GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link #GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearBufferData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer data) { + nglClearBufferData(target, internalformat, format, type, memAddressSafe(data)); + } + + /** + * Fills a buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link #GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link #GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearBufferData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer data) { + nglClearBufferData(target, internalformat, format, type, memAddressSafe(data)); + } + + /** + * Fills a buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link #GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link #GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearBufferData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer data) { + nglClearBufferData(target, internalformat, format, type, memAddressSafe(data)); + } + + // --- [ glClearBufferSubData ] --- + + /** Unsafe version of: {@link #glClearBufferSubData ClearBufferSubData} */ + public static native void nglClearBufferSubData(int target, int internalformat, long offset, long size, int format, int type, long data); + + /** + * Fills all or part of buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link #GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link #GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearBufferSubData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer data) { + nglClearBufferSubData(target, internalformat, offset, size, format, type, memAddressSafe(data)); + } + + /** + * Fills all or part of buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link #GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link #GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearBufferSubData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer data) { + nglClearBufferSubData(target, internalformat, offset, size, format, type, memAddressSafe(data)); + } + + /** + * Fills all or part of buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link #GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link #GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearBufferSubData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer data) { + nglClearBufferSubData(target, internalformat, offset, size, format, type, memAddressSafe(data)); + } + + /** + * Fills all or part of buffer object's data store with a fixed value. + * + * @param target the target of the operation. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link #GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link #GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearBufferSubData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer data) { + nglClearBufferSubData(target, internalformat, offset, size, format, type, memAddressSafe(data)); + } + + // --- [ glDispatchCompute ] --- + + /** + * Launches one or more compute work groups. + * + * @param num_groups_x the number of work groups to be launched in the X dimension + * @param num_groups_y the number of work groups to be launched in the Y dimension + * @param num_groups_z the number of work groups to be launched in the Z dimension + * + * @see Reference Page + */ + public static native void glDispatchCompute(@NativeType("GLuint") int num_groups_x, @NativeType("GLuint") int num_groups_y, @NativeType("GLuint") int num_groups_z); + + // --- [ glDispatchComputeIndirect ] --- + + /** + * Launches one or more compute work groups using parameters stored in a buffer. + * + *

The parameters addressed by indirect are packed a structure, which takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint num_groups_x;
+     *     uint num_groups_y;
+     *     uint num_groups_z;
+     * } DispatchIndirectCommand;
+ * + *

A call to {@code glDispatchComputeIndirect} is equivalent, assuming no errors are generated, to:

+ * + *

+     * cmd = (const DispatchIndirectCommand *)indirect;
+     * glDispatchCompute(cmd->num_groups_x, cmd->num_groups_y, cmd->num_groups_z);
+ * + * @param indirect the offset into the buffer object currently bound to the {@link #GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER} buffer target at which the dispatch parameters are + * stored. + * + * @see Reference Page + */ + public static native void glDispatchComputeIndirect(@NativeType("GLintptr") long indirect); + + // --- [ glCopyImageSubData ] --- + + /** + * Performs a raw data copy between two images. + * + * @param srcName the name of a texture or renderbuffer object from which to copy + * @param srcTarget the target representing the namespace of the source name {@code srcName} + * @param srcLevel the mipmap level to read from the source + * @param srcX the X coordinate of the left edge of the souce region to copy + * @param srcY the Y coordinate of the top edge of the souce region to copy + * @param srcZ the Z coordinate of the near edge of the souce region to copy + * @param dstName the name of a texture or renderbuffer object to which to copy + * @param dstTarget the target representing the namespace of the destination name {@code dstName} + * @param dstLevel the mipmap level to write to the source + * @param dstX the X coordinate of the left edge of the destination region + * @param dstY the Y coordinate of the top edge of the destination region + * @param dstZ the Z coordinate of the near edge of the destination region + * @param srcWidth the width of the region to be copied + * @param srcHeight the height of the region to be copied + * @param srcDepth the depth of the region to be copied + * + * @see Reference Page + */ + public static native void glCopyImageSubData(@NativeType("GLuint") int srcName, @NativeType("GLenum") int srcTarget, @NativeType("GLint") int srcLevel, @NativeType("GLint") int srcX, @NativeType("GLint") int srcY, @NativeType("GLint") int srcZ, @NativeType("GLuint") int dstName, @NativeType("GLenum") int dstTarget, @NativeType("GLint") int dstLevel, @NativeType("GLint") int dstX, @NativeType("GLint") int dstY, @NativeType("GLint") int dstZ, @NativeType("GLsizei") int srcWidth, @NativeType("GLsizei") int srcHeight, @NativeType("GLsizei") int srcDepth); + + // --- [ glDebugMessageControl ] --- + + /** + * Unsafe version of: {@link #glDebugMessageControl DebugMessageControl} + * + * @param count the length of the array {@code ids} + */ + public static native void nglDebugMessageControl(int source, int type, int severity, int count, long ids, boolean enabled); + + /** + * Controls the volume of debug output in the active debug group, by disabling specific or groups of messages. + * + *

If {@code enabled} is {@link GL11#GL_TRUE TRUE}, the referenced subset of messages will be enabled. If {@link GL11#GL_FALSE FALSE}, then those messages will be disabled.

+ * + *

This command can reference different subsets of messages by first considering the set of all messages, and filtering out messages based on the following + * ways:

+ * + *
    + *
  • If {@code source}, {@code type}, or {@code severity} is {@link GL11#GL_DONT_CARE DONT_CARE}, the messages from all sources, of all types, or of all severities are + * referenced respectively.
  • + *
  • When values other than {@link GL11#GL_DONT_CARE DONT_CARE} are specified, all messages whose source, type, or severity match the specified {@code source}, {@code type}, + * or {@code severity} respectively will be referenced.
  • + *
  • If {@code count} is greater than zero, then {@code ids} is an array of {@code count} message IDs for the specified combination of {@code source} and + * {@code type}. In this case, if {@code source} or {@code type} is {@link GL11#GL_DONT_CARE DONT_CARE}, or {@code severity} is not {@link GL11#GL_DONT_CARE DONT_CARE}, the error + * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated.
  • + *
+ * + *

Unrecognized message IDs in {@code ids} are ignored. If {@code count} is zero, the value if {@code ids} is ignored.

+ * + *

Although messages are grouped into an implicit hierarchy by their sources and types, there is no explicit per-source, per-type or per-severity enabled + * state. Instead, the enabled state is stored individually for each message. There is no difference between disabling all messages from one source in a + * single call, and individually disabling all messages from that source using their types and IDs.

+ * + *

If the {@link #GL_DEBUG_OUTPUT DEBUG_OUTPUT} state is disabled the GL operates the same as if messages of every {@code source}, {@code type} or {@code severity} are disabled.

+ * + * @param source the source of debug messages to enable or disable. One of:
{@link #GL_DEBUG_SOURCE_API DEBUG_SOURCE_API}{@link #GL_DEBUG_SOURCE_WINDOW_SYSTEM DEBUG_SOURCE_WINDOW_SYSTEM}{@link #GL_DEBUG_SOURCE_SHADER_COMPILER DEBUG_SOURCE_SHADER_COMPILER}
{@link #GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}{@link #GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION}{@link #GL_DEBUG_SOURCE_OTHER DEBUG_SOURCE_OTHER}
+ * @param type the type of debug messages to enable or disable. One of:
{@link #GL_DEBUG_TYPE_ERROR DEBUG_TYPE_ERROR}{@link #GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR DEBUG_TYPE_DEPRECATED_BEHAVIOR}{@link #GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR DEBUG_TYPE_UNDEFINED_BEHAVIOR}
{@link #GL_DEBUG_TYPE_PORTABILITY DEBUG_TYPE_PORTABILITY}{@link #GL_DEBUG_TYPE_PERFORMANCE DEBUG_TYPE_PERFORMANCE}{@link #GL_DEBUG_TYPE_OTHER DEBUG_TYPE_OTHER}
{@link #GL_DEBUG_TYPE_MARKER DEBUG_TYPE_MARKER}
+ * @param severity the severity of debug messages to enable or disable. One of:
{@link #GL_DEBUG_SEVERITY_HIGH DEBUG_SEVERITY_HIGH}{@link #GL_DEBUG_SEVERITY_MEDIUM DEBUG_SEVERITY_MEDIUM}{@link #GL_DEBUG_SEVERITY_LOW DEBUG_SEVERITY_LOW}
{@link #GL_DEBUG_SEVERITY_NOTIFICATION DEBUG_SEVERITY_NOTIFICATION}
+ * @param ids an array of unsigned integers containing the ids of the messages to enable or disable + * @param enabled whether the selected messages should be enabled or disabled + * + * @see Reference Page + */ + public static void glDebugMessageControl(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLenum") int severity, @Nullable @NativeType("GLuint const *") IntBuffer ids, @NativeType("GLboolean") boolean enabled) { + nglDebugMessageControl(source, type, severity, remainingSafe(ids), memAddressSafe(ids), enabled); + } + + /** + * Controls the volume of debug output in the active debug group, by disabling specific or groups of messages. + * + *

If {@code enabled} is {@link GL11#GL_TRUE TRUE}, the referenced subset of messages will be enabled. If {@link GL11#GL_FALSE FALSE}, then those messages will be disabled.

+ * + *

This command can reference different subsets of messages by first considering the set of all messages, and filtering out messages based on the following + * ways:

+ * + *
    + *
  • If {@code source}, {@code type}, or {@code severity} is {@link GL11#GL_DONT_CARE DONT_CARE}, the messages from all sources, of all types, or of all severities are + * referenced respectively.
  • + *
  • When values other than {@link GL11#GL_DONT_CARE DONT_CARE} are specified, all messages whose source, type, or severity match the specified {@code source}, {@code type}, + * or {@code severity} respectively will be referenced.
  • + *
  • If {@code count} is greater than zero, then {@code ids} is an array of {@code count} message IDs for the specified combination of {@code source} and + * {@code type}. In this case, if {@code source} or {@code type} is {@link GL11#GL_DONT_CARE DONT_CARE}, or {@code severity} is not {@link GL11#GL_DONT_CARE DONT_CARE}, the error + * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated.
  • + *
+ * + *

Unrecognized message IDs in {@code ids} are ignored. If {@code count} is zero, the value if {@code ids} is ignored.

+ * + *

Although messages are grouped into an implicit hierarchy by their sources and types, there is no explicit per-source, per-type or per-severity enabled + * state. Instead, the enabled state is stored individually for each message. There is no difference between disabling all messages from one source in a + * single call, and individually disabling all messages from that source using their types and IDs.

+ * + *

If the {@link #GL_DEBUG_OUTPUT DEBUG_OUTPUT} state is disabled the GL operates the same as if messages of every {@code source}, {@code type} or {@code severity} are disabled.

+ * + * @param source the source of debug messages to enable or disable. One of:
{@link #GL_DEBUG_SOURCE_API DEBUG_SOURCE_API}{@link #GL_DEBUG_SOURCE_WINDOW_SYSTEM DEBUG_SOURCE_WINDOW_SYSTEM}{@link #GL_DEBUG_SOURCE_SHADER_COMPILER DEBUG_SOURCE_SHADER_COMPILER}
{@link #GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}{@link #GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION}{@link #GL_DEBUG_SOURCE_OTHER DEBUG_SOURCE_OTHER}
+ * @param type the type of debug messages to enable or disable. One of:
{@link #GL_DEBUG_TYPE_ERROR DEBUG_TYPE_ERROR}{@link #GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR DEBUG_TYPE_DEPRECATED_BEHAVIOR}{@link #GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR DEBUG_TYPE_UNDEFINED_BEHAVIOR}
{@link #GL_DEBUG_TYPE_PORTABILITY DEBUG_TYPE_PORTABILITY}{@link #GL_DEBUG_TYPE_PERFORMANCE DEBUG_TYPE_PERFORMANCE}{@link #GL_DEBUG_TYPE_OTHER DEBUG_TYPE_OTHER}
{@link #GL_DEBUG_TYPE_MARKER DEBUG_TYPE_MARKER}
+ * @param severity the severity of debug messages to enable or disable. One of:
{@link #GL_DEBUG_SEVERITY_HIGH DEBUG_SEVERITY_HIGH}{@link #GL_DEBUG_SEVERITY_MEDIUM DEBUG_SEVERITY_MEDIUM}{@link #GL_DEBUG_SEVERITY_LOW DEBUG_SEVERITY_LOW}
{@link #GL_DEBUG_SEVERITY_NOTIFICATION DEBUG_SEVERITY_NOTIFICATION}
+ * @param enabled whether the selected messages should be enabled or disabled + * + * @see Reference Page + */ + public static void glDebugMessageControl(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLenum") int severity, @NativeType("GLuint const *") int id, @NativeType("GLboolean") boolean enabled) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer ids = stack.ints(id); + nglDebugMessageControl(source, type, severity, 1, memAddress(ids), enabled); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glDebugMessageInsert ] --- + + /** + * Unsafe version of: {@link #glDebugMessageInsert DebugMessageInsert} + * + * @param length the length of the string contained in the character array whose address is given by {@code message} + */ + public static native void nglDebugMessageInsert(int source, int type, int id, int severity, int length, long message); + + /** + * This function can be called by applications and third-party libraries to generate their own messages, such as ones containing timestamp information or + * signals about specific render system events. + * + *

The value of {@code id} specifies the ID for the message and {@code severity} indicates its severity level as defined by the caller. The string + * {@code buf} contains the string representation of the message. The parameter {@code length} contains the number of characters in {@code buf}. If + * {@code length} is negative, it is implied that {@code buf} contains a null terminated string. The error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} will be generated if the + * number of characters in {@code buf}, excluding the null terminator when {@code length} is negative, is not less than the value of + * {@link #GL_MAX_DEBUG_MESSAGE_LENGTH MAX_DEBUG_MESSAGE_LENGTH}.

+ * + *

If the {@link #GL_DEBUG_OUTPUT DEBUG_OUTPUT} state is disabled calls to DebugMessageInsert are discarded and do not generate an error.

+ * + * @param source the source of the debug message to insert. One of:
{@link #GL_DEBUG_SOURCE_API DEBUG_SOURCE_API}{@link #GL_DEBUG_SOURCE_WINDOW_SYSTEM DEBUG_SOURCE_WINDOW_SYSTEM}{@link #GL_DEBUG_SOURCE_SHADER_COMPILER DEBUG_SOURCE_SHADER_COMPILER}
{@link #GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}{@link #GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION}{@link #GL_DEBUG_SOURCE_OTHER DEBUG_SOURCE_OTHER}
+ * @param type the type of the debug message insert. One of:
{@link #GL_DEBUG_TYPE_ERROR DEBUG_TYPE_ERROR}{@link #GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR DEBUG_TYPE_DEPRECATED_BEHAVIOR}{@link #GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR DEBUG_TYPE_UNDEFINED_BEHAVIOR}
{@link #GL_DEBUG_TYPE_PORTABILITY DEBUG_TYPE_PORTABILITY}{@link #GL_DEBUG_TYPE_PERFORMANCE DEBUG_TYPE_PERFORMANCE}{@link #GL_DEBUG_TYPE_OTHER DEBUG_TYPE_OTHER}
{@link #GL_DEBUG_TYPE_MARKER DEBUG_TYPE_MARKER}
+ * @param id the user-supplied identifier of the message to insert. One of:
{@link #GL_DEBUG_SEVERITY_HIGH DEBUG_SEVERITY_HIGH}{@link #GL_DEBUG_SEVERITY_MEDIUM DEBUG_SEVERITY_MEDIUM}{@link #GL_DEBUG_SEVERITY_LOW DEBUG_SEVERITY_LOW}
{@link #GL_DEBUG_SEVERITY_NOTIFICATION DEBUG_SEVERITY_NOTIFICATION}
+ * @param severity the severity of the debug messages to insert + * @param message a character array containing the message to insert + * + * @see Reference Page + */ + public static void glDebugMessageInsert(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLuint") int id, @NativeType("GLenum") int severity, @NativeType("GLchar const *") ByteBuffer message) { + nglDebugMessageInsert(source, type, id, severity, message.remaining(), memAddress(message)); + } + + /** + * This function can be called by applications and third-party libraries to generate their own messages, such as ones containing timestamp information or + * signals about specific render system events. + * + *

The value of {@code id} specifies the ID for the message and {@code severity} indicates its severity level as defined by the caller. The string + * {@code buf} contains the string representation of the message. The parameter {@code length} contains the number of characters in {@code buf}. If + * {@code length} is negative, it is implied that {@code buf} contains a null terminated string. The error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} will be generated if the + * number of characters in {@code buf}, excluding the null terminator when {@code length} is negative, is not less than the value of + * {@link #GL_MAX_DEBUG_MESSAGE_LENGTH MAX_DEBUG_MESSAGE_LENGTH}.

+ * + *

If the {@link #GL_DEBUG_OUTPUT DEBUG_OUTPUT} state is disabled calls to DebugMessageInsert are discarded and do not generate an error.

+ * + * @param source the source of the debug message to insert. One of:
{@link #GL_DEBUG_SOURCE_API DEBUG_SOURCE_API}{@link #GL_DEBUG_SOURCE_WINDOW_SYSTEM DEBUG_SOURCE_WINDOW_SYSTEM}{@link #GL_DEBUG_SOURCE_SHADER_COMPILER DEBUG_SOURCE_SHADER_COMPILER}
{@link #GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}{@link #GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION}{@link #GL_DEBUG_SOURCE_OTHER DEBUG_SOURCE_OTHER}
+ * @param type the type of the debug message insert. One of:
{@link #GL_DEBUG_TYPE_ERROR DEBUG_TYPE_ERROR}{@link #GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR DEBUG_TYPE_DEPRECATED_BEHAVIOR}{@link #GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR DEBUG_TYPE_UNDEFINED_BEHAVIOR}
{@link #GL_DEBUG_TYPE_PORTABILITY DEBUG_TYPE_PORTABILITY}{@link #GL_DEBUG_TYPE_PERFORMANCE DEBUG_TYPE_PERFORMANCE}{@link #GL_DEBUG_TYPE_OTHER DEBUG_TYPE_OTHER}
{@link #GL_DEBUG_TYPE_MARKER DEBUG_TYPE_MARKER}
+ * @param id the user-supplied identifier of the message to insert. One of:
{@link #GL_DEBUG_SEVERITY_HIGH DEBUG_SEVERITY_HIGH}{@link #GL_DEBUG_SEVERITY_MEDIUM DEBUG_SEVERITY_MEDIUM}{@link #GL_DEBUG_SEVERITY_LOW DEBUG_SEVERITY_LOW}
{@link #GL_DEBUG_SEVERITY_NOTIFICATION DEBUG_SEVERITY_NOTIFICATION}
+ * @param severity the severity of the debug messages to insert + * @param message a character array containing the message to insert + * + * @see Reference Page + */ + public static void glDebugMessageInsert(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLuint") int id, @NativeType("GLenum") int severity, @NativeType("GLchar const *") CharSequence message) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + int messageEncodedLength = stack.nUTF8(message, false); + long messageEncoded = stack.getPointerAddress(); + nglDebugMessageInsert(source, type, id, severity, messageEncodedLength, messageEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glDebugMessageCallback ] --- + + /** Unsafe version of: {@link #glDebugMessageCallback DebugMessageCallback} */ + public static native void nglDebugMessageCallback(long callback, long userParam); + + /** + * Specifies a callback to receive debugging messages from the GL. + * + *

The function's prototype must follow the type definition of DEBUGPROC including its platform-dependent calling convention. Anything else will result in + * undefined behavior. Only one debug callback can be specified for the current context, and further calls overwrite the previous callback. Specifying + * {@code NULL} as the value of {@code callback} clears the current callback and disables message output through callbacks. Applications can provide + * user-specified data through the pointer {@code userParam}. The context will store this pointer and will include it as one of the parameters in each call + * to the callback function.

+ * + *

If the application has specified a callback function for receiving debug output, the implementation will call that function whenever any enabled message + * is generated. The source, type, ID, and severity of the message are specified by the DEBUGPROC parameters {@code source}, {@code type}, {@code id}, and + * {@code severity}, respectively. The string representation of the message is stored in {@code message} and its length (excluding the null-terminator) is + * stored in {@code length}. The parameter {@code userParam} is the user-specified parameter that was given when calling DebugMessageCallback.

+ * + *

Applications can query the current callback function and the current user-specified parameter by obtaining the values of {@link #GL_DEBUG_CALLBACK_FUNCTION DEBUG_CALLBACK_FUNCTION} and + * {@link #GL_DEBUG_CALLBACK_USER_PARAM DEBUG_CALLBACK_USER_PARAM}, respectively.

+ * + *

Applications that specify a callback function must be aware of certain special conditions when executing code inside a callback when it is called by the + * GL, regardless of the debug source.

+ * + *

The memory for {@code message} is owned and managed by the GL, and should only be considered valid for the duration of the function call.

+ * + *

The behavior of calling any GL or window system function from within the callback function is undefined and may lead to program termination.

+ * + *

Care must also be taken in securing debug callbacks for use with asynchronous debug output by multi-threaded GL implementations.

+ * + *

If the {@link #GL_DEBUG_OUTPUT DEBUG_OUTPUT} state is disabled then the GL will not call the callback function.

+ * + * @param callback a callback function that will be called when a debug message is generated + * @param userParam a user supplied pointer that will be passed on each invocation of {@code callback} + * + * @see Reference Page + */ + public static void glDebugMessageCallback(@Nullable @NativeType("GLDEBUGPROC") GLDebugMessageCallbackI callback, @NativeType("void const *") long userParam) { + nglDebugMessageCallback(memAddressSafe(callback), userParam); + } + + // --- [ glGetDebugMessageLog ] --- + + /** + * Unsafe version of: {@link #glGetDebugMessageLog GetDebugMessageLog} + * + * @param bufsize the size of the buffer whose address is given by {@code messageLog} + */ + public static native int nglGetDebugMessageLog(int count, int bufsize, long sources, long types, long ids, long severities, long lengths, long messageLog); + + /** + * Retrieves messages from the debug message log. + * + *

This function fetches a maximum of {@code count} messages from the message log, and will return the number of messages successfully fetched.

+ * + *

Messages will be fetched from the log in order of oldest to newest. Those messages that were fetched will be removed from the log.

+ * + *

The sources, types, severities, IDs, and string lengths of fetched messages will be stored in the application-provided arrays {@code sources}, + * {@code types}, {@code severities}, {@code ids}, and {@code lengths}, respectively. The application is responsible for allocating enough space for each + * array to hold up to {@code count} elements. The string representations of all fetched messages are stored in the {@code messageLog} array. If multiple + * messages are fetched, their strings are concatenated into the same {@code messageLog} array and will be separated by single null terminators. The last + * string in the array will also be null-terminated. The maximum size of {@code messageLog}, including the space used by all null terminators, is given by + * {@code bufSize}. If {@code bufSize} is less than zero and {@code messageLog} is not {@code NULL}, an {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error will be generated. If a message's + * string, including its null terminator, can not fully fit within the {@code messageLog} array's remaining space, then that message and any subsequent + * messages will not be fetched and will remain in the log. The string lengths stored in the array {@code lengths} include the space for the null + * terminator of each string.

+ * + *

Any or all of the arrays {@code sources}, {@code types}, {@code ids}, {@code severities}, {@code lengths} and {@code messageLog} can also be null + * pointers, which causes the attributes for such arrays to be discarded when messages are fetched, however those messages will still be removed from the + * log. Thus to simply delete up to {@code count} messages from the message log while ignoring their attributes, the application can call the function + * with null pointers for all attribute arrays.

+ * + *

If the context was created without the {@link #GL_CONTEXT_FLAG_DEBUG_BIT CONTEXT_FLAG_DEBUG_BIT} in the {@link GL30#GL_CONTEXT_FLAGS CONTEXT_FLAGS} state, then the GL can opt to never add messages to the + * message log so GetDebugMessageLog will always return zero.

+ * + * @param count the number of debug messages to retrieve from the log + * @param sources an array of variables to receive the sources of the retrieved messages + * @param types an array of variables to receive the types of the retrieved messages + * @param ids an array of unsigned integers to receive the ids of the retrieved messages + * @param severities an array of variables to receive the severites of the retrieved messages + * @param lengths an array of variables to receive the lengths of the received messages + * @param messageLog an array of characters that will receive the messages + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glGetDebugMessageLog(@NativeType("GLuint") int count, @Nullable @NativeType("GLenum *") IntBuffer sources, @Nullable @NativeType("GLenum *") IntBuffer types, @Nullable @NativeType("GLuint *") IntBuffer ids, @Nullable @NativeType("GLenum *") IntBuffer severities, @Nullable @NativeType("GLsizei *") IntBuffer lengths, @Nullable @NativeType("GLchar *") ByteBuffer messageLog) { + if (CHECKS) { + checkSafe(sources, count); + checkSafe(types, count); + checkSafe(ids, count); + checkSafe(severities, count); + checkSafe(lengths, count); + } + return nglGetDebugMessageLog(count, remainingSafe(messageLog), memAddressSafe(sources), memAddressSafe(types), memAddressSafe(ids), memAddressSafe(severities), memAddressSafe(lengths), memAddressSafe(messageLog)); + } + + // --- [ glPushDebugGroup ] --- + + /** + * Unsafe version of: {@link #glPushDebugGroup PushDebugGroup} + * + * @param length the length of the message to be sent to the debug output stream + */ + public static native void nglPushDebugGroup(int source, int id, int length, long message); + + /** + * Pushes a debug group described by the string {@code message} into the command stream. The value of {@code id} specifies the ID of messages generated. + * The parameter {@code length} contains the number of characters in {@code message}. If {@code length} is negative, it is implied that {@code message} + * contains a null terminated string. The message has the specified {@code source} and {@code id}, {@code type} {@link #GL_DEBUG_TYPE_PUSH_GROUP DEBUG_TYPE_PUSH_GROUP}, and + * {@code severity} {@link #GL_DEBUG_SEVERITY_NOTIFICATION DEBUG_SEVERITY_NOTIFICATION}. The GL will put a new debug group on top of the debug group stack which inherits the control of the + * volume of debug output of the debug group previously residing on the top of the debug group stack. Because debug groups are strictly hierarchical, any + * additional control of the debug output volume will only apply within the active debug group and the debug groups pushed on top of the active debug group. + * + *

An {@link GL11#GL_INVALID_ENUM INVALID_ENUM} error is generated if the value of {@code source} is neither {@link #GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION} nor {@link #GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}. An + * {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error is generated if {@code length} is negative and the number of characters in {@code message}, excluding the null-terminator, is + * not less than the value of {@link #GL_MAX_DEBUG_MESSAGE_LENGTH MAX_DEBUG_MESSAGE_LENGTH}.

+ * + * @param source the source of the debug message. One of:
{@link #GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION}{@link #GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}
+ * @param id the identifier of the message + * @param message a string containing the message to be sent to the debug output stream + * + * @see Reference Page + */ + public static void glPushDebugGroup(@NativeType("GLenum") int source, @NativeType("GLuint") int id, @NativeType("GLchar const *") ByteBuffer message) { + nglPushDebugGroup(source, id, message.remaining(), memAddress(message)); + } + + /** + * Pushes a debug group described by the string {@code message} into the command stream. The value of {@code id} specifies the ID of messages generated. + * The parameter {@code length} contains the number of characters in {@code message}. If {@code length} is negative, it is implied that {@code message} + * contains a null terminated string. The message has the specified {@code source} and {@code id}, {@code type} {@link #GL_DEBUG_TYPE_PUSH_GROUP DEBUG_TYPE_PUSH_GROUP}, and + * {@code severity} {@link #GL_DEBUG_SEVERITY_NOTIFICATION DEBUG_SEVERITY_NOTIFICATION}. The GL will put a new debug group on top of the debug group stack which inherits the control of the + * volume of debug output of the debug group previously residing on the top of the debug group stack. Because debug groups are strictly hierarchical, any + * additional control of the debug output volume will only apply within the active debug group and the debug groups pushed on top of the active debug group. + * + *

An {@link GL11#GL_INVALID_ENUM INVALID_ENUM} error is generated if the value of {@code source} is neither {@link #GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION} nor {@link #GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}. An + * {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error is generated if {@code length} is negative and the number of characters in {@code message}, excluding the null-terminator, is + * not less than the value of {@link #GL_MAX_DEBUG_MESSAGE_LENGTH MAX_DEBUG_MESSAGE_LENGTH}.

+ * + * @param source the source of the debug message. One of:
{@link #GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION}{@link #GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}
+ * @param id the identifier of the message + * @param message a string containing the message to be sent to the debug output stream + * + * @see Reference Page + */ + public static void glPushDebugGroup(@NativeType("GLenum") int source, @NativeType("GLuint") int id, @NativeType("GLchar const *") CharSequence message) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + int messageEncodedLength = stack.nUTF8(message, false); + long messageEncoded = stack.getPointerAddress(); + nglPushDebugGroup(source, id, messageEncodedLength, messageEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glPopDebugGroup ] --- + + /** + * Pops the active debug group. When a debug group is popped, the GL will also generate a debug output message describing its cause based on the + * {@code message} string, the source {@code source}, and an ID {@code id} submitted to the associated {@link #glPushDebugGroup PushDebugGroup} command. {@link #GL_DEBUG_TYPE_PUSH_GROUP DEBUG_TYPE_PUSH_GROUP} + * and {@link #GL_DEBUG_TYPE_POP_GROUP DEBUG_TYPE_POP_GROUP} share a single namespace for message {@code id}. {@code severity} has the value {@link #GL_DEBUG_SEVERITY_NOTIFICATION DEBUG_SEVERITY_NOTIFICATION}. The {@code type} + * has the value {@link #GL_DEBUG_TYPE_POP_GROUP DEBUG_TYPE_POP_GROUP}. Popping a debug group restores the debug output volume control of the parent debug group. + * + *

Attempting to pop the default debug group off the stack generates a {@link GL11#GL_STACK_UNDERFLOW STACK_UNDERFLOW} error; pushing a debug group onto a stack containing + * {@link #GL_MAX_DEBUG_GROUP_STACK_DEPTH MAX_DEBUG_GROUP_STACK_DEPTH} minus one elements will generate a {@link GL11#GL_STACK_OVERFLOW STACK_OVERFLOW} error.

+ * + * @see Reference Page + */ + public static native void glPopDebugGroup(); + + // --- [ glObjectLabel ] --- + + /** + * Unsafe version of: {@link #glObjectLabel ObjectLabel} + * + * @param length the length of the label to be used for the object + */ + public static native void nglObjectLabel(int identifier, int name, int length, long label); + + /** + * Labels a named object identified within a namespace. + * + * @param identifier the namespace from which the name of the object is allocated. One of:
{@link #GL_BUFFER BUFFER}{@link #GL_SHADER SHADER}{@link #GL_PROGRAM PROGRAM}{@link #GL_QUERY QUERY}{@link #GL_PROGRAM_PIPELINE PROGRAM_PIPELINE}{@link #GL_SAMPLER SAMPLER}{@link GL11#GL_VERTEX_ARRAY VERTEX_ARRAY}{@link GL11#GL_TEXTURE TEXTURE}
{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL40#GL_TRANSFORM_FEEDBACK TRANSFORM_FEEDBACK}
+ * @param name the name of the object to label + * @param label a string containing the label to assign to the object + * + * @see Reference Page + */ + public static void glObjectLabel(@NativeType("GLenum") int identifier, @NativeType("GLuint") int name, @NativeType("GLchar const *") ByteBuffer label) { + nglObjectLabel(identifier, name, label.remaining(), memAddress(label)); + } + + /** + * Labels a named object identified within a namespace. + * + * @param identifier the namespace from which the name of the object is allocated. One of:
{@link #GL_BUFFER BUFFER}{@link #GL_SHADER SHADER}{@link #GL_PROGRAM PROGRAM}{@link #GL_QUERY QUERY}{@link #GL_PROGRAM_PIPELINE PROGRAM_PIPELINE}{@link #GL_SAMPLER SAMPLER}{@link GL11#GL_VERTEX_ARRAY VERTEX_ARRAY}{@link GL11#GL_TEXTURE TEXTURE}
{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL40#GL_TRANSFORM_FEEDBACK TRANSFORM_FEEDBACK}
+ * @param name the name of the object to label + * @param label a string containing the label to assign to the object + * + * @see Reference Page + */ + public static void glObjectLabel(@NativeType("GLenum") int identifier, @NativeType("GLuint") int name, @NativeType("GLchar const *") CharSequence label) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + int labelEncodedLength = stack.nUTF8(label, false); + long labelEncoded = stack.getPointerAddress(); + nglObjectLabel(identifier, name, labelEncodedLength, labelEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetObjectLabel ] --- + + /** + * Unsafe version of: {@link #glGetObjectLabel GetObjectLabel} + * + * @param bufSize the length of the buffer whose address is in {@code label} + */ + public static native void nglGetObjectLabel(int identifier, int name, int bufSize, long length, long label); + + /** + * Retrieves the label of a named object identified within a namespace. + * + * @param identifier the namespace from which the name of the object is allocated. One of:
{@link #GL_BUFFER BUFFER}{@link #GL_SHADER SHADER}{@link #GL_PROGRAM PROGRAM}{@link #GL_QUERY QUERY}{@link #GL_PROGRAM_PIPELINE PROGRAM_PIPELINE}{@link #GL_SAMPLER SAMPLER}{@link GL11#GL_VERTEX_ARRAY VERTEX_ARRAY}{@link GL11#GL_TEXTURE TEXTURE}
{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL40#GL_TRANSFORM_FEEDBACK TRANSFORM_FEEDBACK}
+ * @param name the name of the object whose label to retrieve + * @param length the address of a variable to receive the length of the object label + * @param label a string that will receive the object label + * + * @see Reference Page + */ + public static void glGetObjectLabel(@NativeType("GLenum") int identifier, @NativeType("GLuint") int name, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer label) { + if (CHECKS) { + checkSafe(length, 1); + } + nglGetObjectLabel(identifier, name, label.remaining(), memAddressSafe(length), memAddress(label)); + } + + /** + * Retrieves the label of a named object identified within a namespace. + * + * @param identifier the namespace from which the name of the object is allocated. One of:
{@link #GL_BUFFER BUFFER}{@link #GL_SHADER SHADER}{@link #GL_PROGRAM PROGRAM}{@link #GL_QUERY QUERY}{@link #GL_PROGRAM_PIPELINE PROGRAM_PIPELINE}{@link #GL_SAMPLER SAMPLER}{@link GL11#GL_VERTEX_ARRAY VERTEX_ARRAY}{@link GL11#GL_TEXTURE TEXTURE}
{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL40#GL_TRANSFORM_FEEDBACK TRANSFORM_FEEDBACK}
+ * @param name the name of the object whose label to retrieve + * @param bufSize the length of the buffer whose address is in {@code label} + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetObjectLabel(@NativeType("GLenum") int identifier, @NativeType("GLuint") int name, @NativeType("GLsizei") int bufSize) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer length = stack.ints(0); + ByteBuffer label = stack.malloc(bufSize); + nglGetObjectLabel(identifier, name, bufSize, memAddress(length), memAddress(label)); + return memUTF8(label, length.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Retrieves the label of a named object identified within a namespace. + * + * @param identifier the namespace from which the name of the object is allocated. One of:
{@link #GL_BUFFER BUFFER}{@link #GL_SHADER SHADER}{@link #GL_PROGRAM PROGRAM}{@link #GL_QUERY QUERY}{@link #GL_PROGRAM_PIPELINE PROGRAM_PIPELINE}{@link #GL_SAMPLER SAMPLER}{@link GL11#GL_VERTEX_ARRAY VERTEX_ARRAY}{@link GL11#GL_TEXTURE TEXTURE}
{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL40#GL_TRANSFORM_FEEDBACK TRANSFORM_FEEDBACK}
+ * @param name the name of the object whose label to retrieve + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetObjectLabel(@NativeType("GLenum") int identifier, @NativeType("GLuint") int name) { + return glGetObjectLabel(identifier, name, GL11.glGetInteger(GL_MAX_LABEL_LENGTH)); + } + + // --- [ glObjectPtrLabel ] --- + + /** + * Unsafe version of: {@link #glObjectPtrLabel ObjectPtrLabel} + * + * @param length the length of the label to be used for the object + */ + public static native void nglObjectPtrLabel(long ptr, int length, long label); + + /** + * Labels a sync object identified by a pointer. + * + * @param ptr a pointer identifying a sync object + * @param label a string containing the label to assign to the object + * + * @see Reference Page + */ + public static void glObjectPtrLabel(@NativeType("void *") long ptr, @NativeType("GLchar const *") ByteBuffer label) { + if (CHECKS) { + check(ptr); + } + nglObjectPtrLabel(ptr, label.remaining(), memAddress(label)); + } + + /** + * Labels a sync object identified by a pointer. + * + * @param ptr a pointer identifying a sync object + * @param label a string containing the label to assign to the object + * + * @see Reference Page + */ + public static void glObjectPtrLabel(@NativeType("void *") long ptr, @NativeType("GLchar const *") CharSequence label) { + if (CHECKS) { + check(ptr); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + int labelEncodedLength = stack.nUTF8(label, false); + long labelEncoded = stack.getPointerAddress(); + nglObjectPtrLabel(ptr, labelEncodedLength, labelEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetObjectPtrLabel ] --- + + /** + * Unsafe version of: {@link #glGetObjectPtrLabel GetObjectPtrLabel} + * + * @param bufSize the length of the buffer whose address is in {@code label} + */ + public static native void nglGetObjectPtrLabel(long ptr, int bufSize, long length, long label); + + /** + * Retrieves the label of a sync object identified by a pointer. + * + * @param ptr the name of the sync object whose label to retrieve + * @param length a variable to receive the length of the object label + * @param label a string that will receive the object label + * + * @see Reference Page + */ + public static void glGetObjectPtrLabel(@NativeType("void *") long ptr, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer label) { + if (CHECKS) { + check(ptr); + checkSafe(length, 1); + } + nglGetObjectPtrLabel(ptr, label.remaining(), memAddressSafe(length), memAddress(label)); + } + + /** + * Retrieves the label of a sync object identified by a pointer. + * + * @param ptr the name of the sync object whose label to retrieve + * @param bufSize the length of the buffer whose address is in {@code label} + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetObjectPtrLabel(@NativeType("void *") long ptr, @NativeType("GLsizei") int bufSize) { + if (CHECKS) { + check(ptr); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer length = stack.ints(0); + ByteBuffer label = stack.malloc(bufSize); + nglGetObjectPtrLabel(ptr, bufSize, memAddress(length), memAddress(label)); + return memUTF8(label, length.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Retrieves the label of a sync object identified by a pointer. + * + * @param ptr the name of the sync object whose label to retrieve + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetObjectPtrLabel(@NativeType("void *") long ptr) { + return glGetObjectPtrLabel(ptr, GL11.glGetInteger(GL_MAX_LABEL_LENGTH)); + } + + // --- [ glFramebufferParameteri ] --- + + /** + * Sets a named parameter of a framebuffer. + * + * @param target target of the operation. One of:
{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}
+ * @param pname a token indicating the parameter to be modified. One of:
{@link #GL_FRAMEBUFFER_DEFAULT_WIDTH FRAMEBUFFER_DEFAULT_WIDTH}{@link #GL_FRAMEBUFFER_DEFAULT_HEIGHT FRAMEBUFFER_DEFAULT_HEIGHT}
{@link #GL_FRAMEBUFFER_DEFAULT_LAYERS FRAMEBUFFER_DEFAULT_LAYERS}{@link #GL_FRAMEBUFFER_DEFAULT_SAMPLES FRAMEBUFFER_DEFAULT_SAMPLES}
{@link #GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS}
+ * @param param the new value for the parameter named {@code pname} + * + * @see Reference Page + */ + public static native void glFramebufferParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint") int param); + + // --- [ glGetFramebufferParameteriv ] --- + + /** Unsafe version of: {@link #glGetFramebufferParameteriv GetFramebufferParameteriv} */ + public static native void nglGetFramebufferParameteriv(int target, int pname, long params); + + /** + * Retrieves a named parameter from a framebuffer. + * + * @param target target of the operation. One of:
{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}
+ * @param pname a token indicating the parameter to be retrieved. One of:
{@link #GL_FRAMEBUFFER_DEFAULT_WIDTH FRAMEBUFFER_DEFAULT_WIDTH}{@link #GL_FRAMEBUFFER_DEFAULT_HEIGHT FRAMEBUFFER_DEFAULT_HEIGHT}
{@link #GL_FRAMEBUFFER_DEFAULT_LAYERS FRAMEBUFFER_DEFAULT_LAYERS}{@link #GL_FRAMEBUFFER_DEFAULT_SAMPLES FRAMEBUFFER_DEFAULT_SAMPLES}
{@link #GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS}
+ * @param params a variable to receive the value of the parameter named {@code pname} + * + * @see Reference Page + */ + public static void glGetFramebufferParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetFramebufferParameteriv(target, pname, memAddress(params)); + } + + /** + * Retrieves a named parameter from a framebuffer. + * + * @param target target of the operation. One of:
{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}
+ * @param pname a token indicating the parameter to be retrieved. One of:
{@link #GL_FRAMEBUFFER_DEFAULT_WIDTH FRAMEBUFFER_DEFAULT_WIDTH}{@link #GL_FRAMEBUFFER_DEFAULT_HEIGHT FRAMEBUFFER_DEFAULT_HEIGHT}
{@link #GL_FRAMEBUFFER_DEFAULT_LAYERS FRAMEBUFFER_DEFAULT_LAYERS}{@link #GL_FRAMEBUFFER_DEFAULT_SAMPLES FRAMEBUFFER_DEFAULT_SAMPLES}
{@link #GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetFramebufferParameteri(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetFramebufferParameteriv(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetInternalformati64v ] --- + + /** + * Unsafe version of: {@link #glGetInternalformati64v GetInternalformati64v} + * + * @param bufSize the maximum number of values that may be written to params by the function + */ + public static native void nglGetInternalformati64v(int target, int internalformat, int pname, int bufSize, long params); + + /** + * Retrieves information about implementation-dependent support for internal formats. + * + * @param target the usage of the internal format. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param internalformat the internal format about which to retrieve information + * @param pname the type of information to query + * @param params a variable into which to write the retrieved information + * + * @see Reference Page + */ + public static void glGetInternalformati64v(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int pname, @NativeType("GLint64 *") LongBuffer params) { + nglGetInternalformati64v(target, internalformat, pname, params.remaining(), memAddress(params)); + } + + /** + * Retrieves information about implementation-dependent support for internal formats. + * + * @param target the usage of the internal format. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param internalformat the internal format about which to retrieve information + * @param pname the type of information to query + * + * @see Reference Page + */ + @NativeType("void") + public static long glGetInternalformati64(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglGetInternalformati64v(target, internalformat, pname, 1, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glInvalidateTexSubImage ] --- + + /** + * Invalidates a region of a texture image. + * + * @param texture the name of a texture object a subregion of which to invalidate + * @param level the level of detail of the texture object within which the region resides + * @param xoffset the X offset of the region to be invalidated + * @param yoffset the Y offset of the region to be invalidated + * @param zoffset the Z offset of the region to be invalidated + * @param width the width of the region to be invalidated + * @param height the height of the region to be invalidated + * @param depth the depth of the region to be invalidated + * + * @see Reference Page + */ + public static native void glInvalidateTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth); + + // --- [ glInvalidateTexImage ] --- + + /** + * Invalidates the entirety of a texture image. + * + * @param texture the name of a texture object to invalidate + * @param level the level of detail of the texture object to invalidate + * + * @see Reference Page + */ + public static native void glInvalidateTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level); + + // --- [ glInvalidateBufferSubData ] --- + + /** + * Invalidates a region of a buffer object's data store. + * + * @param buffer the name of a buffer object, a subrange of whose data store to invalidate + * @param offset the offset within the buffer's data store of the start of the range to be invalidated + * @param length the length of the range within the buffer's data store to be invalidated + * + * @see Reference Page + */ + public static native void glInvalidateBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length); + + // --- [ glInvalidateBufferData ] --- + + /** + * Invalidates the content of a buffer object's data store. + * + * @param buffer the name of a buffer object whose data store to invalidate + * + * @see Reference Page + */ + public static native void glInvalidateBufferData(@NativeType("GLuint") int buffer); + + // --- [ glInvalidateFramebuffer ] --- + + /** + * Unsafe version of: {@link #glInvalidateFramebuffer InvalidateFramebuffer} + * + * @param numAttachments the number of entries in the {@code attachments} array + */ + public static native void nglInvalidateFramebuffer(int target, int numAttachments, long attachments); + + /** + * Invalidate the content some or all of a framebuffer object's attachments. + * + * @param target the target to which the framebuffer is attached. One of:
{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}
+ * @param attachments the address of an array identifying the attachments to be invalidated + * + * @see Reference Page + */ + public static void glInvalidateFramebuffer(@NativeType("GLenum") int target, @NativeType("GLenum const *") IntBuffer attachments) { + nglInvalidateFramebuffer(target, attachments.remaining(), memAddress(attachments)); + } + + /** + * Invalidate the content some or all of a framebuffer object's attachments. + * + * @param target the target to which the framebuffer is attached. One of:
{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}
+ * + * @see Reference Page + */ + public static void glInvalidateFramebuffer(@NativeType("GLenum") int target, @NativeType("GLenum const *") int attachment) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer attachments = stack.ints(attachment); + nglInvalidateFramebuffer(target, 1, memAddress(attachments)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glInvalidateSubFramebuffer ] --- + + /** + * Unsafe version of: {@link #glInvalidateSubFramebuffer InvalidateSubFramebuffer} + * + * @param numAttachments the number of entries in the {@code attachments} array + */ + public static native void nglInvalidateSubFramebuffer(int target, int numAttachments, long attachments, int x, int y, int width, int height); + + /** + * Invalidates the content of a region of some or all of a framebuffer object's attachments. + * + * @param target the target to which the framebuffer is attached. One of:
{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}
+ * @param attachments an array identifying the attachments to be invalidated + * @param x the X offset of the region to be invalidated + * @param y the Y offset of the region to be invalidated + * @param width the width of the region to be invalidated + * @param height the height of the region to be invalidated + * + * @see Reference Page + */ + public static void glInvalidateSubFramebuffer(@NativeType("GLenum") int target, @NativeType("GLenum const *") IntBuffer attachments, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + nglInvalidateSubFramebuffer(target, attachments.remaining(), memAddress(attachments), x, y, width, height); + } + + /** + * Invalidates the content of a region of some or all of a framebuffer object's attachments. + * + * @param target the target to which the framebuffer is attached. One of:
{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}
+ * @param x the X offset of the region to be invalidated + * @param y the Y offset of the region to be invalidated + * @param width the width of the region to be invalidated + * @param height the height of the region to be invalidated + * + * @see Reference Page + */ + public static void glInvalidateSubFramebuffer(@NativeType("GLenum") int target, @NativeType("GLenum const *") int attachment, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer attachments = stack.ints(attachment); + nglInvalidateSubFramebuffer(target, 1, memAddress(attachments), x, y, width, height); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glMultiDrawArraysIndirect ] --- + + /** Unsafe version of: {@link #glMultiDrawArraysIndirect MultiDrawArraysIndirect} */ + public static native void nglMultiDrawArraysIndirect(int mode, long indirect, int drawcount, int stride); + + /** + * Renders multiple sets of primitives from array data, taking parameters from memory. + * + *

The parameters addressed by {@code indirect} are packed into an array of structures, each element of which takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint first;
+     *     uint baseInstance;
+     * } DrawArraysIndirectCommand;
+ * + *

A single call to {@code glMultiDrawArraysIndirect} is equivalent, assuming no errors are generated to:

+ * + *

+     * const ubyte *ptr = (const ubyte *)indirect;
+     * for ( i = 0; i < drawcount; i++ ) {
+     *     DrawArraysIndirect(mode, (DrawArraysIndirectCommand*)ptr);
+     *     if ( stride == 0 )
+     *         ptr += sizeof(DrawArraysIndirectCommand);
+     *     else
+     *         ptr += stride;
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect an array of structures containing the draw parameters + * @param drawcount the number of elements in the array of draw parameter structures + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + if (CHECKS) { + check(indirect, drawcount * (stride == 0 ? (4 * 4) : stride)); + } + nglMultiDrawArraysIndirect(mode, memAddress(indirect), drawcount, stride); + } + + /** + * Renders multiple sets of primitives from array data, taking parameters from memory. + * + *

The parameters addressed by {@code indirect} are packed into an array of structures, each element of which takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint first;
+     *     uint baseInstance;
+     * } DrawArraysIndirectCommand;
+ * + *

A single call to {@code glMultiDrawArraysIndirect} is equivalent, assuming no errors are generated to:

+ * + *

+     * const ubyte *ptr = (const ubyte *)indirect;
+     * for ( i = 0; i < drawcount; i++ ) {
+     *     DrawArraysIndirect(mode, (DrawArraysIndirectCommand*)ptr);
+     *     if ( stride == 0 )
+     *         ptr += sizeof(DrawArraysIndirectCommand);
+     *     else
+     *         ptr += stride;
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect an array of structures containing the draw parameters + * @param drawcount the number of elements in the array of draw parameter structures + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") long indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + nglMultiDrawArraysIndirect(mode, indirect, drawcount, stride); + } + + /** + * Renders multiple sets of primitives from array data, taking parameters from memory. + * + *

The parameters addressed by {@code indirect} are packed into an array of structures, each element of which takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint first;
+     *     uint baseInstance;
+     * } DrawArraysIndirectCommand;
+ * + *

A single call to {@code glMultiDrawArraysIndirect} is equivalent, assuming no errors are generated to:

+ * + *

+     * const ubyte *ptr = (const ubyte *)indirect;
+     * for ( i = 0; i < drawcount; i++ ) {
+     *     DrawArraysIndirect(mode, (DrawArraysIndirectCommand*)ptr);
+     *     if ( stride == 0 )
+     *         ptr += sizeof(DrawArraysIndirectCommand);
+     *     else
+     *         ptr += stride;
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect an array of structures containing the draw parameters + * @param drawcount the number of elements in the array of draw parameter structures + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + if (CHECKS) { + check(indirect, (drawcount * (stride == 0 ? (4 * 4) : stride)) >> 2); + } + nglMultiDrawArraysIndirect(mode, memAddress(indirect), drawcount, stride); + } + + // --- [ glMultiDrawElementsIndirect ] --- + + /** Unsafe version of: {@link #glMultiDrawElementsIndirect MultiDrawElementsIndirect} */ + public static native void nglMultiDrawElementsIndirect(int mode, int type, long indirect, int drawcount, int stride); + + /** + * Renders multiple indexed primitives from array data, taking parameters from memory. + * + *

The parameters addressed by indirect are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint firstIndex;
+     *     uint baseVertex;
+     *     uint baseInstance;
+     * } DrawElementsIndirectCommand;
+ * + *

A single call to {@code glMultiDrawElementsIndirect} is equivalent, assuming no errors are generated to:

+ * + *

+     * const ubyte *ptr = (const ubyte *)indirect;
+     * for ( i = 0; i < drawcount; i++ ) {
+     *     DrawElementsIndirect(mode, type, (DrawElementsIndirectCommand *)ptr);
+     *     if ( stride == 0 )
+     *         ptr += sizeof(DrawElementsIndirectCommand);
+     *     else
+     *         ptr += stride;
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect a structure containing an array of draw parameters + * @param drawcount the number of elements in the array addressed by {@code indirect} + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + if (CHECKS) { + check(indirect, drawcount * (stride == 0 ? (5 * 4) : stride)); + } + nglMultiDrawElementsIndirect(mode, type, memAddress(indirect), drawcount, stride); + } + + /** + * Renders multiple indexed primitives from array data, taking parameters from memory. + * + *

The parameters addressed by indirect are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint firstIndex;
+     *     uint baseVertex;
+     *     uint baseInstance;
+     * } DrawElementsIndirectCommand;
+ * + *

A single call to {@code glMultiDrawElementsIndirect} is equivalent, assuming no errors are generated to:

+ * + *

+     * const ubyte *ptr = (const ubyte *)indirect;
+     * for ( i = 0; i < drawcount; i++ ) {
+     *     DrawElementsIndirect(mode, type, (DrawElementsIndirectCommand *)ptr);
+     *     if ( stride == 0 )
+     *         ptr += sizeof(DrawElementsIndirectCommand);
+     *     else
+     *         ptr += stride;
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect a structure containing an array of draw parameters + * @param drawcount the number of elements in the array addressed by {@code indirect} + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") long indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + nglMultiDrawElementsIndirect(mode, type, indirect, drawcount, stride); + } + + /** + * Renders multiple indexed primitives from array data, taking parameters from memory. + * + *

The parameters addressed by indirect are packed into a structure that takes the form (in C):

+ * + *

+     * typedef struct {
+     *     uint count;
+     *     uint primCount;
+     *     uint firstIndex;
+     *     uint baseVertex;
+     *     uint baseInstance;
+     * } DrawElementsIndirectCommand;
+ * + *

A single call to {@code glMultiDrawElementsIndirect} is equivalent, assuming no errors are generated to:

+ * + *

+     * const ubyte *ptr = (const ubyte *)indirect;
+     * for ( i = 0; i < drawcount; i++ ) {
+     *     DrawElementsIndirect(mode, type, (DrawElementsIndirectCommand *)ptr);
+     *     if ( stride == 0 )
+     *         ptr += sizeof(DrawElementsIndirectCommand);
+     *     else
+     *         ptr += stride;
+     * }
+ * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect a structure containing an array of draw parameters + * @param drawcount the number of elements in the array addressed by {@code indirect} + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + if (CHECKS) { + check(indirect, (drawcount * (stride == 0 ? (5 * 4) : stride)) >> 2); + } + nglMultiDrawElementsIndirect(mode, type, memAddress(indirect), drawcount, stride); + } + + // --- [ glGetProgramInterfaceiv ] --- + + /** Unsafe version of: {@link #glGetProgramInterfaceiv GetProgramInterfaceiv} */ + public static native void nglGetProgramInterfaceiv(int program, int programInterface, int pname, long params); + + /** + * Queries a property of an interface in a program. + * + * @param program the name of a program object whose interface to query + * @param programInterface a token identifying the interface within {@code program} to query. One of:
{@link #GL_UNIFORM UNIFORM}{@link #GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link #GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link #GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link #GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link #GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link #GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link #GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link #GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link #GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link #GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link #GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link #GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link #GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link #GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link #GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link #GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link #GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link #GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param pname the name of the parameter within {@code programInterface} to query. One of:
{@link #GL_ACTIVE_RESOURCES ACTIVE_RESOURCES}{@link #GL_MAX_NAME_LENGTH MAX_NAME_LENGTH}{@link #GL_MAX_NUM_ACTIVE_VARIABLES MAX_NUM_ACTIVE_VARIABLES}
{@link #GL_MAX_NUM_COMPATIBLE_SUBROUTINES MAX_NUM_COMPATIBLE_SUBROUTINES}
+ * @param params a variable to retrieve the value of {@code pname} for the program interface + * + * @see Reference Page + */ + public static void glGetProgramInterfaceiv(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetProgramInterfaceiv(program, programInterface, pname, memAddress(params)); + } + + /** + * Queries a property of an interface in a program. + * + * @param program the name of a program object whose interface to query + * @param programInterface a token identifying the interface within {@code program} to query. One of:
{@link #GL_UNIFORM UNIFORM}{@link #GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link #GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link #GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link #GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link #GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link #GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link #GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link #GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link #GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link #GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link #GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link #GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link #GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link #GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link #GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link #GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link #GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link #GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param pname the name of the parameter within {@code programInterface} to query. One of:
{@link #GL_ACTIVE_RESOURCES ACTIVE_RESOURCES}{@link #GL_MAX_NAME_LENGTH MAX_NAME_LENGTH}{@link #GL_MAX_NUM_ACTIVE_VARIABLES MAX_NUM_ACTIVE_VARIABLES}
{@link #GL_MAX_NUM_COMPATIBLE_SUBROUTINES MAX_NUM_COMPATIBLE_SUBROUTINES}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetProgramInterfacei(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetProgramInterfaceiv(program, programInterface, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetProgramResourceIndex ] --- + + /** Unsafe version of: {@link #glGetProgramResourceIndex GetProgramResourceIndex} */ + public static native int nglGetProgramResourceIndex(int program, int programInterface, long name); + + /** + * Queries the index of a named resource within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the resource named {Wcode name}. One of:
{@link #GL_UNIFORM UNIFORM}{@link #GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link #GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link #GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link #GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link #GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link #GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link #GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link #GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link #GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link #GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link #GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link #GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link #GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link #GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link #GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link #GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link #GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link #GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param name the name of the resource to query the index of + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glGetProgramResourceIndex(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLchar const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nglGetProgramResourceIndex(program, programInterface, memAddress(name)); + } + + /** + * Queries the index of a named resource within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the resource named {Wcode name}. One of:
{@link #GL_UNIFORM UNIFORM}{@link #GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link #GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link #GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link #GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link #GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link #GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link #GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link #GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link #GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link #GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link #GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link #GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link #GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link #GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link #GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link #GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link #GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link #GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param name the name of the resource to query the index of + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glGetProgramResourceIndex(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLchar const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(name, true); + long nameEncoded = stack.getPointerAddress(); + return nglGetProgramResourceIndex(program, programInterface, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetProgramResourceName ] --- + + /** + * Unsafe version of: {@link #glGetProgramResourceName GetProgramResourceName} + * + * @param bufSize the size of the character array whose address is given by {@code name} + */ + public static native void nglGetProgramResourceName(int program, int programInterface, int index, int bufSize, long length, long name); + + /** + * Queries the name of an indexed resource within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the indexed resource. One of:
{@link #GL_UNIFORM UNIFORM}{@link #GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link #GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link #GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link #GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link #GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link #GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link #GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link #GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link #GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link #GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link #GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link #GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link #GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link #GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link #GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link #GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link #GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link #GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param index the index of the resource within {@code programInterface} of {@code program} + * @param length a variable which will receive the length of the resource name + * @param name a character array into which will be written the name of the resource + * + * @see Reference Page + */ + public static void glGetProgramResourceName(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer name) { + if (CHECKS) { + checkSafe(length, 1); + } + nglGetProgramResourceName(program, programInterface, index, name.remaining(), memAddressSafe(length), memAddress(name)); + } + + /** + * Queries the name of an indexed resource within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the indexed resource. One of:
{@link #GL_UNIFORM UNIFORM}{@link #GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link #GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link #GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link #GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link #GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link #GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link #GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link #GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link #GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link #GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link #GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link #GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link #GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link #GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link #GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link #GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link #GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link #GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param index the index of the resource within {@code programInterface} of {@code program} + * @param bufSize the size of the character array whose address is given by {@code name} + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetProgramResourceName(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLuint") int index, @NativeType("GLsizei") int bufSize) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer length = stack.ints(0); + ByteBuffer name = stack.malloc(bufSize); + nglGetProgramResourceName(program, programInterface, index, bufSize, memAddress(length), memAddress(name)); + return memASCII(name, length.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Queries the name of an indexed resource within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the indexed resource. One of:
{@link #GL_UNIFORM UNIFORM}{@link #GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link #GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link #GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link #GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link #GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link #GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link #GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link #GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link #GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link #GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link #GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link #GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link #GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link #GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link #GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link #GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link #GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link #GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param index the index of the resource within {@code programInterface} of {@code program} + * + * @see Reference Page + */ + @NativeType("void") + public static String glGetProgramResourceName(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLuint") int index) { + return glGetProgramResourceName(program, programInterface, index, glGetProgramInterfacei(program, programInterface, GL_MAX_NAME_LENGTH)); + } + + // --- [ glGetProgramResourceiv ] --- + + /** + * Unsafe version of: {@link #glGetProgramResourceiv GetProgramResourceiv} + * + * @param propCount the number of properties in {@code props} + * @param bufSize the size of the integer array whose address is given by {@code params} + */ + public static native void nglGetProgramResourceiv(int program, int programInterface, int index, int propCount, long props, int bufSize, long length, long params); + + /** + * Retrieves values for multiple properties of a single active resource within a program object. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the resource named {@code name}. One of:
{@link #GL_UNIFORM UNIFORM}{@link #GL_UNIFORM_BLOCK UNIFORM_BLOCK}{@link #GL_PROGRAM_INPUT PROGRAM_INPUT}
{@link #GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}{@link #GL_BUFFER_VARIABLE BUFFER_VARIABLE}{@link #GL_SHADER_STORAGE_BLOCK SHADER_STORAGE_BLOCK}
{@link #GL_VERTEX_SUBROUTINE VERTEX_SUBROUTINE}{@link #GL_TESS_CONTROL_SUBROUTINE TESS_CONTROL_SUBROUTINE}{@link #GL_TESS_EVALUATION_SUBROUTINE TESS_EVALUATION_SUBROUTINE}
{@link #GL_GEOMETRY_SUBROUTINE GEOMETRY_SUBROUTINE}{@link #GL_FRAGMENT_SUBROUTINE FRAGMENT_SUBROUTINE}{@link #GL_COMPUTE_SUBROUTINE COMPUTE_SUBROUTINE}
{@link #GL_VERTEX_SUBROUTINE_UNIFORM VERTEX_SUBROUTINE_UNIFORM}{@link #GL_TESS_CONTROL_SUBROUTINE_UNIFORM TESS_CONTROL_SUBROUTINE_UNIFORM}{@link #GL_TESS_EVALUATION_SUBROUTINE_UNIFORM TESS_EVALUATION_SUBROUTINE_UNIFORM}
{@link #GL_GEOMETRY_SUBROUTINE_UNIFORM GEOMETRY_SUBROUTINE_UNIFORM}{@link #GL_FRAGMENT_SUBROUTINE_UNIFORM FRAGMENT_SUBROUTINE_UNIFORM}{@link #GL_COMPUTE_SUBROUTINE_UNIFORM COMPUTE_SUBROUTINE_UNIFORM}
{@link #GL_TRANSFORM_FEEDBACK_VARYING TRANSFORM_FEEDBACK_VARYING}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}
+ * @param index the active resource index + * @param props an array that will receive the active resource properties + * @param length a variable which will receive the number of values returned + * @param params an array that will receive the property values + * + * @see Reference Page + */ + public static void glGetProgramResourceiv(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLuint") int index, @NativeType("GLenum const *") IntBuffer props, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + checkSafe(length, 1); + } + nglGetProgramResourceiv(program, programInterface, index, props.remaining(), memAddress(props), params.remaining(), memAddressSafe(length), memAddress(params)); + } + + // --- [ glGetProgramResourceLocation ] --- + + /** Unsafe version of: {@link #glGetProgramResourceLocation GetProgramResourceLocation} */ + public static native int nglGetProgramResourceLocation(int program, int programInterface, long name); + + /** + * Queries the location of a named resource within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the resource named {@code name} + * @param name the name of the resource to query the location of + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetProgramResourceLocation(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLchar const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nglGetProgramResourceLocation(program, programInterface, memAddress(name)); + } + + /** + * Queries the location of a named resource within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the resource named {@code name} + * @param name the name of the resource to query the location of + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetProgramResourceLocation(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLchar const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + return nglGetProgramResourceLocation(program, programInterface, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetProgramResourceLocationIndex ] --- + + /** Unsafe version of: {@link #glGetProgramResourceLocationIndex GetProgramResourceLocationIndex} */ + public static native int nglGetProgramResourceLocationIndex(int program, int programInterface, long name); + + /** + * Queries the fragment color index of a named variable within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the resource named {@code name}. Must be:
{@link #GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}
+ * @param name the name of the resource to query the location of + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetProgramResourceLocationIndex(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLchar const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nglGetProgramResourceLocationIndex(program, programInterface, memAddress(name)); + } + + /** + * Queries the fragment color index of a named variable within a program. + * + * @param program the name of a program object whose resources to query + * @param programInterface a token identifying the interface within {@code program} containing the resource named {@code name}. Must be:
{@link #GL_PROGRAM_OUTPUT PROGRAM_OUTPUT}
+ * @param name the name of the resource to query the location of + * + * @see Reference Page + */ + @NativeType("GLint") + public static int glGetProgramResourceLocationIndex(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLchar const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + return nglGetProgramResourceLocationIndex(program, programInterface, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glShaderStorageBlockBinding ] --- + + /** + * Changes an active shader storage block binding. + * + * @param program the name of the program containing the block whose binding to change + * @param storageBlockIndex the index storage block within the program + * @param storageBlockBinding the index storage block binding to associate with the specified storage block + * + * @see Reference Page + */ + public static native void glShaderStorageBlockBinding(@NativeType("GLuint") int program, @NativeType("GLuint") int storageBlockIndex, @NativeType("GLuint") int storageBlockBinding); + + // --- [ glTexBufferRange ] --- + + /** + * Binds a range of a buffer's data store to a buffer texture. + * + * @param target the target of the operation. Must be:
{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}
+ * @param internalformat the internal format of the data in the store belonging to {@code buffer} + * @param buffer the name of the buffer object whose storage to attach to the active buffer texture + * @param offset the offset of the start of the range of the buffer's data store to attach + * @param size the size of the range of the buffer's data store to attach + * + * @see Reference Page + */ + public static native void glTexBufferRange(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size); + + // --- [ glTexStorage2DMultisample ] --- + + /** + * Specifies storage for a two-dimensional multisample texture. + * + * @param target the target of the operation. One of:
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}{@link GL32#GL_PROXY_TEXTURE_2D_MULTISAMPLE PROXY_TEXTURE_2D_MULTISAMPLE}
+ * @param samples the number of samples in the texture + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * @param fixedsamplelocations whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not + * depend on the internal format or size of the image + * + * @see Reference Page + */ + public static native void glTexStorage2DMultisample(@NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLboolean") boolean fixedsamplelocations); + + // --- [ glTexStorage3DMultisample ] --- + + /** + * Specifies storage for a two-dimensional multisample array texture. + * + * @param target the target of the operation. One of:
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}{@link GL32#GL_PROXY_TEXTURE_2D_MULTISAMPLE PROXY_TEXTURE_2D_MULTISAMPLE}
+ * @param samples the number of samples in the texture + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * @param depth the depth of the texture, in texels + * @param fixedsamplelocations whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not + * depend on the internal format or size of the image + * + * @see Reference Page + */ + public static native void glTexStorage3DMultisample(@NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLboolean") boolean fixedsamplelocations); + + // --- [ glTextureView ] --- + + /** + * Initializes a texture as a data alias of another texture's data store. + * + * @param texture the texture object to be initialized as a view + * @param target the target to be used for the newly initialized texture + * @param origtexture the name of a texture object of which to make a view + * @param internalformat the internal format for the newly created view + * @param minlevel the lowest level of detail of the view + * @param numlevels the number of levels of detail to include in the view + * @param minlayer the index of the first layer to include in the view + * @param numlayers the number of layers to include in the view + * + * @see Reference Page + */ + public static native void glTextureView(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLuint") int origtexture, @NativeType("GLenum") int internalformat, @NativeType("GLuint") int minlevel, @NativeType("GLuint") int numlevels, @NativeType("GLuint") int minlayer, @NativeType("GLuint") int numlayers); + + // --- [ glBindVertexBuffer ] --- + + /** + * Binds a buffer to a vertex buffer bind point. + * + * @param bindingindex the index of the vertex buffer binding point to which to bind the buffer + * @param buffer the name of an existing buffer to bind to the vertex buffer binding point + * @param offset the offset of the first element of the buffer + * @param stride the distance between elements within the buffer + * + * @see Reference Page + */ + public static native void glBindVertexBuffer(@NativeType("GLuint") int bindingindex, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizei") int stride); + + // --- [ glVertexAttribFormat ] --- + + /** + * Specifies the organization of data in vertex arrays. + * + * @param attribindex the generic vertex attribute array being described + * @param size the number of values per vertex that are stored in the array. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the type of the data stored in the array + * @param normalized if true then integer data is normalized to the range [-1, 1] or [0, 1] if it is signed or unsigned, respectively. If false then integer data is + * directly converted to floating point. + * @param relativeoffset the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from + * + * @see Reference Page + */ + public static native void glVertexAttribFormat(@NativeType("GLuint") int attribindex, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint") int relativeoffset); + + // --- [ glVertexAttribIFormat ] --- + + /** + * Specifies the organization of pure integer data in vertex arrays. + * + * @param attribindex the generic vertex attribute array being described + * @param size the number of values per vertex that are stored in the array. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the type of the data stored in the array + * @param relativeoffset the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from + * + * @see Reference Page + */ + public static native void glVertexAttribIFormat(@NativeType("GLuint") int attribindex, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLuint") int relativeoffset); + + // --- [ glVertexAttribLFormat ] --- + + /** + * Specifies the organization of 64-bit double data in vertex arrays. + * + * @param attribindex the generic vertex attribute array being described + * @param size the number of values per vertex that are stored in the array. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the type of the data stored in the array + * @param relativeoffset the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from + * + * @see Reference Page + */ + public static native void glVertexAttribLFormat(@NativeType("GLuint") int attribindex, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLuint") int relativeoffset); + + // --- [ glVertexAttribBinding ] --- + + /** + * Associate a vertex attribute and a vertex buffer binding. + * + * @param attribindex the index of the attribute to associate with a vertex buffer binding + * @param bindingindex the index of the vertex buffer binding with which to associate the generic vertex attribute + * + * @see Reference Page + */ + public static native void glVertexAttribBinding(@NativeType("GLuint") int attribindex, @NativeType("GLuint") int bindingindex); + + // --- [ glVertexBindingDivisor ] --- + + /** + * Modifies the rate at which generic vertex attributes advance during instanced rendering. + * + * @param bindingindex the index of the generic vertex attribute + * @param divisor the number of instances that will pass between updates of the generic attribute at slot {@code index} + * + * @see Reference Page + */ + public static native void glVertexBindingDivisor(@NativeType("GLuint") int bindingindex, @NativeType("GLuint") int divisor); + + /** + * Array version of: {@link #glClearBufferData ClearBufferData} + * + * @see Reference Page + */ + public static void glClearBufferData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] data) { + long __functionAddress = GL.getICD().glClearBufferData; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, internalformat, format, type, data, __functionAddress); + } + + /** + * Array version of: {@link #glClearBufferData ClearBufferData} + * + * @see Reference Page + */ + public static void glClearBufferData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] data) { + long __functionAddress = GL.getICD().glClearBufferData; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, internalformat, format, type, data, __functionAddress); + } + + /** + * Array version of: {@link #glClearBufferData ClearBufferData} + * + * @see Reference Page + */ + public static void glClearBufferData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] data) { + long __functionAddress = GL.getICD().glClearBufferData; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, internalformat, format, type, data, __functionAddress); + } + + /** + * Array version of: {@link #glClearBufferSubData ClearBufferSubData} + * + * @see Reference Page + */ + public static void glClearBufferSubData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] data) { + long __functionAddress = GL.getICD().glClearBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(target, internalformat, offset, size, format, type, data, __functionAddress); + } + + /** + * Array version of: {@link #glClearBufferSubData ClearBufferSubData} + * + * @see Reference Page + */ + public static void glClearBufferSubData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] data) { + long __functionAddress = GL.getICD().glClearBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(target, internalformat, offset, size, format, type, data, __functionAddress); + } + + /** + * Array version of: {@link #glClearBufferSubData ClearBufferSubData} + * + * @see Reference Page + */ + public static void glClearBufferSubData(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] data) { + long __functionAddress = GL.getICD().glClearBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(target, internalformat, offset, size, format, type, data, __functionAddress); + } + + /** + * Array version of: {@link #glDebugMessageControl DebugMessageControl} + * + * @see Reference Page + */ + public static void glDebugMessageControl(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLenum") int severity, @Nullable @NativeType("GLuint const *") int[] ids, @NativeType("GLboolean") boolean enabled) { + long __functionAddress = GL.getICD().glDebugMessageControl; + if (CHECKS) { + check(__functionAddress); + } + callPV(source, type, severity, lengthSafe(ids), ids, enabled, __functionAddress); + } + + /** + * Array version of: {@link #glGetDebugMessageLog GetDebugMessageLog} + * + * @see Reference Page + */ + @NativeType("GLuint") + public static int glGetDebugMessageLog(@NativeType("GLuint") int count, @Nullable @NativeType("GLenum *") int[] sources, @Nullable @NativeType("GLenum *") int[] types, @Nullable @NativeType("GLuint *") int[] ids, @Nullable @NativeType("GLenum *") int[] severities, @Nullable @NativeType("GLsizei *") int[] lengths, @Nullable @NativeType("GLchar *") ByteBuffer messageLog) { + long __functionAddress = GL.getICD().glGetDebugMessageLog; + if (CHECKS) { + check(__functionAddress); + checkSafe(sources, count); + checkSafe(types, count); + checkSafe(ids, count); + checkSafe(severities, count); + checkSafe(lengths, count); + } + return callPPPPPPI(count, remainingSafe(messageLog), sources, types, ids, severities, lengths, memAddressSafe(messageLog), __functionAddress); + } + + /** + * Array version of: {@link #glGetObjectLabel GetObjectLabel} + * + * @see Reference Page + */ + public static void glGetObjectLabel(@NativeType("GLenum") int identifier, @NativeType("GLuint") int name, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer label) { + long __functionAddress = GL.getICD().glGetObjectLabel; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + } + callPPV(identifier, name, label.remaining(), length, memAddress(label), __functionAddress); + } + + /** + * Array version of: {@link #glGetObjectPtrLabel GetObjectPtrLabel} + * + * @see Reference Page + */ + public static void glGetObjectPtrLabel(@NativeType("void *") long ptr, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer label) { + long __functionAddress = GL.getICD().glGetObjectPtrLabel; + if (CHECKS) { + check(__functionAddress); + check(ptr); + checkSafe(length, 1); + } + callPPPV(ptr, label.remaining(), length, memAddress(label), __functionAddress); + } + + /** + * Array version of: {@link #glGetFramebufferParameteriv GetFramebufferParameteriv} + * + * @see Reference Page + */ + public static void glGetFramebufferParameteriv(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetFramebufferParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetInternalformati64v GetInternalformati64v} + * + * @see Reference Page + */ + public static void glGetInternalformati64v(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int pname, @NativeType("GLint64 *") long[] params) { + long __functionAddress = GL.getICD().glGetInternalformati64v; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, internalformat, pname, params.length, params, __functionAddress); + } + + /** + * Array version of: {@link #glInvalidateFramebuffer InvalidateFramebuffer} + * + * @see Reference Page + */ + public static void glInvalidateFramebuffer(@NativeType("GLenum") int target, @NativeType("GLenum const *") int[] attachments) { + long __functionAddress = GL.getICD().glInvalidateFramebuffer; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, attachments.length, attachments, __functionAddress); + } + + /** + * Array version of: {@link #glInvalidateSubFramebuffer InvalidateSubFramebuffer} + * + * @see Reference Page + */ + public static void glInvalidateSubFramebuffer(@NativeType("GLenum") int target, @NativeType("GLenum const *") int[] attachments, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + long __functionAddress = GL.getICD().glInvalidateSubFramebuffer; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, attachments.length, attachments, x, y, width, height, __functionAddress); + } + + /** + * Array version of: {@link #glMultiDrawArraysIndirect MultiDrawArraysIndirect} + * + * @see Reference Page + */ + public static void glMultiDrawArraysIndirect(@NativeType("GLenum") int mode, @NativeType("void const *") int[] indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + long __functionAddress = GL.getICD().glMultiDrawArraysIndirect; + if (CHECKS) { + check(__functionAddress); + check(indirect, (drawcount * (stride == 0 ? (4 * 4) : stride)) >> 2); + } + callPV(mode, indirect, drawcount, stride, __functionAddress); + } + + /** + * Array version of: {@link #glMultiDrawElementsIndirect MultiDrawElementsIndirect} + * + * @see Reference Page + */ + public static void glMultiDrawElementsIndirect(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") int[] indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride) { + long __functionAddress = GL.getICD().glMultiDrawElementsIndirect; + if (CHECKS) { + check(__functionAddress); + check(indirect, (drawcount * (stride == 0 ? (5 * 4) : stride)) >> 2); + } + callPV(mode, type, indirect, drawcount, stride, __functionAddress); + } + + /** + * Array version of: {@link #glGetProgramInterfaceiv GetProgramInterfaceiv} + * + * @see Reference Page + */ + public static void glGetProgramInterfaceiv(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetProgramInterfaceiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(program, programInterface, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetProgramResourceName GetProgramResourceName} + * + * @see Reference Page + */ + public static void glGetProgramResourceName(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer name) { + long __functionAddress = GL.getICD().glGetProgramResourceName; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + } + callPPV(program, programInterface, index, name.remaining(), length, memAddress(name), __functionAddress); + } + + /** + * Array version of: {@link #glGetProgramResourceiv GetProgramResourceiv} + * + * @see Reference Page + */ + public static void glGetProgramResourceiv(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLuint") int index, @NativeType("GLenum const *") int[] props, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetProgramResourceiv; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + } + callPPPV(program, programInterface, index, props.length, props, params.length, length, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL44.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL44.java new file mode 100644 index 00000000..a43d0bc9 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL44.java @@ -0,0 +1,1178 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * The OpenGL functionality up to version 4.4. Includes the deprecated symbols of the Compatibility Profile. + * + *

OpenGL 4.4 implementations support revision 4.40 of the OpenGL Shading Language.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL44 extends GL43 { + + /** Implementation-dependent state which constrains the maximum value of stride parameters to vertex array pointer-setting commands. */ + public static final int GL_MAX_VERTEX_ATTRIB_STRIDE = 0x82E5; + + /** + * Implementations are not required to support primitive restart for separate patch primitives (primitive type PATCHES). Support can be queried by calling + * GetBooleanv with the symbolic constant PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED. A value of FALSE indicates that primitive restart is treated as + * disabled when drawing patches, no matter the value of the enables. A value of TRUE indicates that primitive restart behaves normally for patches. + */ + public static final int GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED = 0x8221; + + /** Equivalent to {@link ARBTextureBufferObject#GL_TEXTURE_BUFFER_ARB TEXTURE_BUFFER_ARB} query, but named more consistently. */ + public static final int GL_TEXTURE_BUFFER_BINDING = 0x8C2A; + + /** Accepted in the {@code flags} parameter of {@link #glBufferStorage BufferStorage} and {@link ARBBufferStorage#glNamedBufferStorageEXT NamedBufferStorageEXT}. */ + public static final int + GL_MAP_PERSISTENT_BIT = 0x40, + GL_MAP_COHERENT_BIT = 0x80, + GL_DYNAMIC_STORAGE_BIT = 0x100, + GL_CLIENT_STORAGE_BIT = 0x200; + + /** Accepted by the {@code pname} parameter of {@code GetBufferParameter{i|i64}v}. */ + public static final int + GL_BUFFER_IMMUTABLE_STORAGE = 0x821F, + GL_BUFFER_STORAGE_FLAGS = 0x8220; + + /** Accepted by the {@code barriers} parameter of {@link GL42C#glMemoryBarrier MemoryBarrier}. */ + public static final int GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT = 0x4000; + + /** Accepted by the {@code pname} parameter for {@link GL42C#glGetInternalformativ GetInternalformativ} and {@link GL43C#glGetInternalformati64v GetInternalformati64v}. */ + public static final int GL_CLEAR_TEXTURE = 0x9365; + + /** Accepted in the {@code props} array of {@link GL43C#glGetProgramResourceiv GetProgramResourceiv}. */ + public static final int + GL_LOCATION_COMPONENT = 0x934A, + GL_TRANSFORM_FEEDBACK_BUFFER_INDEX = 0x934B, + GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE = 0x934C; + + /** Accepted by the {@code pname} parameter of {@link GL15C#glGetQueryObjectiv GetQueryObjectiv}, {@link GL15C#glGetQueryObjectuiv GetQueryObjectuiv}, {@link GL33C#glGetQueryObjecti64v GetQueryObjecti64v} and {@link GL33C#glGetQueryObjectui64v GetQueryObjectui64v}. */ + public static final int GL_QUERY_RESULT_NO_WAIT = 0x9194; + + /** + * Accepted by the {@code target} parameter of {@link GL15C#glBindBuffer BindBuffer}, {@link GL15C#glBufferData BufferData}, {@link GL15C#glBufferSubData BufferSubData}, + * {@link GL15C#glMapBuffer MapBuffer}, {@link GL15C#glUnmapBuffer UnmapBuffer}, {@link GL30C#glMapBufferRange MapBufferRange}, {@link GL15C#glGetBufferSubData GetBufferSubData}, + * {@link GL15C#glGetBufferParameteriv GetBufferParameteriv}, {@link GL32C#glGetBufferParameteri64v GetBufferParameteri64v}, {@link GL15C#glGetBufferPointerv GetBufferPointerv}, + * {@link GL43C#glClearBufferSubData ClearBufferSubData}, and the {@code readtarget} and {@code writetarget} parameters of {@link GL31C#glCopyBufferSubData CopyBufferSubData}. + */ + public static final int GL_QUERY_BUFFER = 0x9192; + + /** + * Accepted by the {@code pname} parameter of {@link GL11C#glGetBooleanv GetBooleanv}, {@link GL11C#glGetIntegerv GetIntegerv}, {@link GL11C#glGetFloatv GetFloatv}, + * and {@link GL11C#glGetDoublev GetDoublev}. + */ + public static final int GL_QUERY_BUFFER_BINDING = 0x9193; + + /** Accepted in the {@code barriers} bitfield in {@link GL42C#glMemoryBarrier MemoryBarrier}. */ + public static final int GL_QUERY_BUFFER_BARRIER_BIT = 0x8000; + + /** + * Accepted by the {@code param} parameter of TexParameter{if}, SamplerParameter{if} and SamplerParameter{if}v, and by the {@code params} parameter of + * TexParameter{if}v, TexParameterI{i ui}v and SamplerParameterI{i ui}v when their {@code pname} parameter is {@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}, {@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}, or + * {@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}, + */ + public static final int GL_MIRROR_CLAMP_TO_EDGE = 0x8743; + + static { GL.initialize(); } + + protected GL44() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBufferStorage, caps.glClearTexSubImage, caps.glClearTexImage, caps.glBindBuffersBase, caps.glBindBuffersRange, caps.glBindTextures, + caps.glBindSamplers, caps.glBindImageTextures, caps.glBindVertexBuffers + ); + } + + // --- [ glBufferStorage ] --- + + /** + * Unsafe version of: {@link #glBufferStorage BufferStorage} + * + * @param size the size of the data store in basic machine units + */ + public static void nglBufferStorage(int target, long size, long data, int flags) { + GL44C.nglBufferStorage(target, size, data, flags); + } + + /** + * Creates the data store of a buffer object. + * + *

The data store of the buffer object bound to {@code target} is allocated as a result of a call to this function and cannot be de-allocated until the + * buffer is deleted with a call to {@link GL15C#glDeleteBuffers DeleteBuffers}. Such a store may not be re-allocated through further calls to {@code BufferStorage} + * or {@link GL15C#glBufferData BufferData}.

+ * + *

{@code BufferStorage} deletes any existing data store. If any portion of the buffer object is mapped in the current context or any context current to + * another thread, it is as though {@link GL15C#glUnmapBuffer UnmapBuffer} is executed in each such context prior to deleting the existing data store.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param size the size of the data store in basic machine units + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44C#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("GLsizeiptr") long size, @NativeType("GLbitfield") int flags) { + GL44C.glBufferStorage(target, size, flags); + } + + /** + * Creates the data store of a buffer object. + * + *

The data store of the buffer object bound to {@code target} is allocated as a result of a call to this function and cannot be de-allocated until the + * buffer is deleted with a call to {@link GL15C#glDeleteBuffers DeleteBuffers}. Such a store may not be re-allocated through further calls to {@code BufferStorage} + * or {@link GL15C#glBufferData BufferData}.

+ * + *

{@code BufferStorage} deletes any existing data store. If any portion of the buffer object is mapped in the current context or any context current to + * another thread, it is as though {@link GL15C#glUnmapBuffer UnmapBuffer} is executed in each such context prior to deleting the existing data store.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44C#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") ByteBuffer data, @NativeType("GLbitfield") int flags) { + GL44C.glBufferStorage(target, data, flags); + } + + /** + * Creates the data store of a buffer object. + * + *

The data store of the buffer object bound to {@code target} is allocated as a result of a call to this function and cannot be de-allocated until the + * buffer is deleted with a call to {@link GL15C#glDeleteBuffers DeleteBuffers}. Such a store may not be re-allocated through further calls to {@code BufferStorage} + * or {@link GL15C#glBufferData BufferData}.

+ * + *

{@code BufferStorage} deletes any existing data store. If any portion of the buffer object is mapped in the current context or any context current to + * another thread, it is as though {@link GL15C#glUnmapBuffer UnmapBuffer} is executed in each such context prior to deleting the existing data store.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44C#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") ShortBuffer data, @NativeType("GLbitfield") int flags) { + GL44C.glBufferStorage(target, data, flags); + } + + /** + * Creates the data store of a buffer object. + * + *

The data store of the buffer object bound to {@code target} is allocated as a result of a call to this function and cannot be de-allocated until the + * buffer is deleted with a call to {@link GL15C#glDeleteBuffers DeleteBuffers}. Such a store may not be re-allocated through further calls to {@code BufferStorage} + * or {@link GL15C#glBufferData BufferData}.

+ * + *

{@code BufferStorage} deletes any existing data store. If any portion of the buffer object is mapped in the current context or any context current to + * another thread, it is as though {@link GL15C#glUnmapBuffer UnmapBuffer} is executed in each such context prior to deleting the existing data store.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44C#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") IntBuffer data, @NativeType("GLbitfield") int flags) { + GL44C.glBufferStorage(target, data, flags); + } + + /** + * Creates the data store of a buffer object. + * + *

The data store of the buffer object bound to {@code target} is allocated as a result of a call to this function and cannot be de-allocated until the + * buffer is deleted with a call to {@link GL15C#glDeleteBuffers DeleteBuffers}. Such a store may not be re-allocated through further calls to {@code BufferStorage} + * or {@link GL15C#glBufferData BufferData}.

+ * + *

{@code BufferStorage} deletes any existing data store. If any portion of the buffer object is mapped in the current context or any context current to + * another thread, it is as though {@link GL15C#glUnmapBuffer UnmapBuffer} is executed in each such context prior to deleting the existing data store.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44C#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") FloatBuffer data, @NativeType("GLbitfield") int flags) { + GL44C.glBufferStorage(target, data, flags); + } + + /** + * Creates the data store of a buffer object. + * + *

The data store of the buffer object bound to {@code target} is allocated as a result of a call to this function and cannot be de-allocated until the + * buffer is deleted with a call to {@link GL15C#glDeleteBuffers DeleteBuffers}. Such a store may not be re-allocated through further calls to {@code BufferStorage} + * or {@link GL15C#glBufferData BufferData}.

+ * + *

{@code BufferStorage} deletes any existing data store. If any portion of the buffer object is mapped in the current context or any context current to + * another thread, it is as though {@link GL15C#glUnmapBuffer UnmapBuffer} is executed in each such context prior to deleting the existing data store.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44C#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44C#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44C#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44C#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44C#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") DoubleBuffer data, @NativeType("GLbitfield") int flags) { + GL44C.glBufferStorage(target, data, flags); + } + + // --- [ glClearTexSubImage ] --- + + /** Unsafe version of: {@link #glClearTexSubImage ClearTexSubImage} */ + public static void nglClearTexSubImage(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, long data) { + GL44C.nglClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); + } + + /** + * Fills all or part of a texture image with a constant value. + * + *

Arguments {@code xoffset}, {@code yoffset}, and {@code zoffset} specify the lower left texel coordinates of a {@code width}-wide by {@code height}-high + * by {@code depth}-deep rectangular subregion of the texel array and are interpreted as they are in {@link GL12C#glTexSubImage3D TexSubImage3D}.

+ * + *

For 1D array textures, {@code yoffset} is interpreted as the first layer to be cleared and {@code height} is the number of layers to clear. For 2D array + * textures, {@code zoffset} is interpreted as the first layer to be cleared and {@code depth} is the number of layers to clear. Cube map textures are + * treated as an array of six slices in the z-dimension, where the value of {@code zoffset} is interpreted as specifying the cube map face for the + * corresponding {@code layer} and {@code depth} is the number of faces to clear. For cube map array textures, {@code zoffset} is the first layer-face to + * clear, and {@code depth} is the number of layer-faces to clear. Each layer-face is translated into an array layer and a cube map face.

+ * + *

Negative values of {@code xoffset}, {@code yoffset}, and {@code zoffset} correspond to the coordinates of border texels.

+ * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + * + * @see Reference Page + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer data) { + GL44C.glClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); + } + + /** + * Fills all or part of a texture image with a constant value. + * + *

Arguments {@code xoffset}, {@code yoffset}, and {@code zoffset} specify the lower left texel coordinates of a {@code width}-wide by {@code height}-high + * by {@code depth}-deep rectangular subregion of the texel array and are interpreted as they are in {@link GL12C#glTexSubImage3D TexSubImage3D}.

+ * + *

For 1D array textures, {@code yoffset} is interpreted as the first layer to be cleared and {@code height} is the number of layers to clear. For 2D array + * textures, {@code zoffset} is interpreted as the first layer to be cleared and {@code depth} is the number of layers to clear. Cube map textures are + * treated as an array of six slices in the z-dimension, where the value of {@code zoffset} is interpreted as specifying the cube map face for the + * corresponding {@code layer} and {@code depth} is the number of faces to clear. For cube map array textures, {@code zoffset} is the first layer-face to + * clear, and {@code depth} is the number of layer-faces to clear. Each layer-face is translated into an array layer and a cube map face.

+ * + *

Negative values of {@code xoffset}, {@code yoffset}, and {@code zoffset} correspond to the coordinates of border texels.

+ * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + * + * @see Reference Page + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer data) { + GL44C.glClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); + } + + /** + * Fills all or part of a texture image with a constant value. + * + *

Arguments {@code xoffset}, {@code yoffset}, and {@code zoffset} specify the lower left texel coordinates of a {@code width}-wide by {@code height}-high + * by {@code depth}-deep rectangular subregion of the texel array and are interpreted as they are in {@link GL12C#glTexSubImage3D TexSubImage3D}.

+ * + *

For 1D array textures, {@code yoffset} is interpreted as the first layer to be cleared and {@code height} is the number of layers to clear. For 2D array + * textures, {@code zoffset} is interpreted as the first layer to be cleared and {@code depth} is the number of layers to clear. Cube map textures are + * treated as an array of six slices in the z-dimension, where the value of {@code zoffset} is interpreted as specifying the cube map face for the + * corresponding {@code layer} and {@code depth} is the number of faces to clear. For cube map array textures, {@code zoffset} is the first layer-face to + * clear, and {@code depth} is the number of layer-faces to clear. Each layer-face is translated into an array layer and a cube map face.

+ * + *

Negative values of {@code xoffset}, {@code yoffset}, and {@code zoffset} correspond to the coordinates of border texels.

+ * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + * + * @see Reference Page + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer data) { + GL44C.glClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); + } + + /** + * Fills all or part of a texture image with a constant value. + * + *

Arguments {@code xoffset}, {@code yoffset}, and {@code zoffset} specify the lower left texel coordinates of a {@code width}-wide by {@code height}-high + * by {@code depth}-deep rectangular subregion of the texel array and are interpreted as they are in {@link GL12C#glTexSubImage3D TexSubImage3D}.

+ * + *

For 1D array textures, {@code yoffset} is interpreted as the first layer to be cleared and {@code height} is the number of layers to clear. For 2D array + * textures, {@code zoffset} is interpreted as the first layer to be cleared and {@code depth} is the number of layers to clear. Cube map textures are + * treated as an array of six slices in the z-dimension, where the value of {@code zoffset} is interpreted as specifying the cube map face for the + * corresponding {@code layer} and {@code depth} is the number of faces to clear. For cube map array textures, {@code zoffset} is the first layer-face to + * clear, and {@code depth} is the number of layer-faces to clear. Each layer-face is translated into an array layer and a cube map face.

+ * + *

Negative values of {@code xoffset}, {@code yoffset}, and {@code zoffset} correspond to the coordinates of border texels.

+ * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + * + * @see Reference Page + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer data) { + GL44C.glClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); + } + + /** + * Fills all or part of a texture image with a constant value. + * + *

Arguments {@code xoffset}, {@code yoffset}, and {@code zoffset} specify the lower left texel coordinates of a {@code width}-wide by {@code height}-high + * by {@code depth}-deep rectangular subregion of the texel array and are interpreted as they are in {@link GL12C#glTexSubImage3D TexSubImage3D}.

+ * + *

For 1D array textures, {@code yoffset} is interpreted as the first layer to be cleared and {@code height} is the number of layers to clear. For 2D array + * textures, {@code zoffset} is interpreted as the first layer to be cleared and {@code depth} is the number of layers to clear. Cube map textures are + * treated as an array of six slices in the z-dimension, where the value of {@code zoffset} is interpreted as specifying the cube map face for the + * corresponding {@code layer} and {@code depth} is the number of faces to clear. For cube map array textures, {@code zoffset} is the first layer-face to + * clear, and {@code depth} is the number of layer-faces to clear. Each layer-face is translated into an array layer and a cube map face.

+ * + *

Negative values of {@code xoffset}, {@code yoffset}, and {@code zoffset} correspond to the coordinates of border texels.

+ * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + * + * @see Reference Page + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") DoubleBuffer data) { + GL44C.glClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); + } + + // --- [ glClearTexImage ] --- + + /** Unsafe version of: {@link #glClearTexImage ClearTexImage} */ + public static void nglClearTexImage(int texture, int level, int format, int type, long data) { + GL44C.nglClearTexImage(texture, level, format, type, data); + } + + /** + * Is equivalent to calling {@link #glClearTexSubImage ClearTexSubImage} with {@code xoffset}, {@code yoffset}, and {@code zoffset} equal to -{@code b} and {@code width}, + * {@code height}, and {@code depth} equal to the dimensions of the texture image plus {@code 2xb} (or zero and one for dimensions the texture doesn't + * have). + * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + * + * @see Reference Page + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer data) { + GL44C.glClearTexImage(texture, level, format, type, data); + } + + /** + * Is equivalent to calling {@link #glClearTexSubImage ClearTexSubImage} with {@code xoffset}, {@code yoffset}, and {@code zoffset} equal to -{@code b} and {@code width}, + * {@code height}, and {@code depth} equal to the dimensions of the texture image plus {@code 2xb} (or zero and one for dimensions the texture doesn't + * have). + * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + * + * @see Reference Page + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer data) { + GL44C.glClearTexImage(texture, level, format, type, data); + } + + /** + * Is equivalent to calling {@link #glClearTexSubImage ClearTexSubImage} with {@code xoffset}, {@code yoffset}, and {@code zoffset} equal to -{@code b} and {@code width}, + * {@code height}, and {@code depth} equal to the dimensions of the texture image plus {@code 2xb} (or zero and one for dimensions the texture doesn't + * have). + * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + * + * @see Reference Page + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer data) { + GL44C.glClearTexImage(texture, level, format, type, data); + } + + /** + * Is equivalent to calling {@link #glClearTexSubImage ClearTexSubImage} with {@code xoffset}, {@code yoffset}, and {@code zoffset} equal to -{@code b} and {@code width}, + * {@code height}, and {@code depth} equal to the dimensions of the texture image plus {@code 2xb} (or zero and one for dimensions the texture doesn't + * have). + * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + * + * @see Reference Page + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer data) { + GL44C.glClearTexImage(texture, level, format, type, data); + } + + /** + * Is equivalent to calling {@link #glClearTexSubImage ClearTexSubImage} with {@code xoffset}, {@code yoffset}, and {@code zoffset} equal to -{@code b} and {@code width}, + * {@code height}, and {@code depth} equal to the dimensions of the texture image plus {@code 2xb} (or zero and one for dimensions the texture doesn't + * have). + * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + * + * @see Reference Page + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") DoubleBuffer data) { + GL44C.glClearTexImage(texture, level, format, type, data); + } + + // --- [ glBindBuffersBase ] --- + + /** + * Unsafe version of: {@link #glBindBuffersBase BindBuffersBase} + * + * @param count the number of bindings + */ + public static void nglBindBuffersBase(int target, int first, int count, long buffers) { + GL44C.nglBindBuffersBase(target, first, count, buffers); + } + + /** + * Binds {@code count} existing buffer objects to bindings numbered {@code first} through {@code first+count-1} in the array of buffer binding points + * corresponding to {@code target}. If {@code buffers} is not {@code NULL}, it specifies an array of {@code count} values, each of which must be zero or the name + * of an existing buffer object. It is equivalent to: + * + *

+     * for ( i = 0; i < count; i++ ) {
+     *     if ( buffers == NULL ) {
+     *         glBindBufferBase(target, first + i, 0);
+     *     } else {
+     *         glBindBufferBase(target, first + i, buffers[i]);
+     *     }
+     * }
+ * + *

except that the single general buffer binding corresponding to {@code target} is unmodified, and that buffers will not be created if they do not exist.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param first the first binding + * @param buffers an array of zeros or names of existing buffers objects + * + * @see Reference Page + */ + public static void glBindBuffersBase(@NativeType("GLenum") int target, @NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") IntBuffer buffers) { + GL44C.glBindBuffersBase(target, first, buffers); + } + + // --- [ glBindBuffersRange ] --- + + /** + * Unsafe version of: {@link #glBindBuffersRange BindBuffersRange} + * + * @param count the number of bindings + */ + public static void nglBindBuffersRange(int target, int first, int count, long buffers, long offsets, long sizes) { + GL44C.nglBindBuffersRange(target, first, count, buffers, offsets, sizes); + } + + /** + * Binds {@code count} existing buffer objects to bindings numbered {@code first} through {@code first+count-1} in the array of buffer binding points + * corresponding to {@code target}. {@code offsets} and {@code sizes} specify arrays of {@code count} values indicating the range of each buffer to bind. + * If {@code buffers} is {@code NULL}, all bindings from {@code first} through {@code first+count-1} are reset to their unbound (zero) state. In this + * case, the offsets and sizes associated with the binding points are set to default values, ignoring {@code offsets} and {@code sizes}. It is equivalent + * to: + * + *

+     * for ( i = 0; i < count; i++ ) {
+     *     if ( buffers == NULL ) {
+     *         glBindBufferRange(target, first + i, 0, 0, 0);
+     *     } else {
+     *         glBindBufferRange(target, first + i, buffers[i], offsets[i], sizes[i]);
+     *     }
+     * }
+ * + *

except that the single general buffer binding corresponding to {@code target} is unmodified, and that buffers will not be created if they do not exist.

+ * + *

The values specified in {@code buffers}, {@code offsets}, and {@code sizes} will be checked separately for each binding point. When values for a + * specific binding point are invalid, the state for that binding point will be unchanged and an error will be generated. However, state for other binding + * points will still be changed if their corresponding values are valid.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param first the first binding + * @param buffers an array of names of existing buffers objects + * @param offsets an array of offsets + * @param sizes an array of sizes + * + * @see Reference Page + */ + public static void glBindBuffersRange(@NativeType("GLenum") int target, @NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") IntBuffer buffers, @Nullable @NativeType("GLintptr const *") PointerBuffer offsets, @Nullable @NativeType("GLsizeiptr const *") PointerBuffer sizes) { + GL44C.glBindBuffersRange(target, first, buffers, offsets, sizes); + } + + // --- [ glBindTextures ] --- + + /** + * Unsafe version of: {@link #glBindTextures BindTextures} + * + * @param count the number of texture objects + */ + public static void nglBindTextures(int first, int count, long textures) { + GL44C.nglBindTextures(first, count, textures); + } + + /** + * Binds {@code count} existing texture objects to texture image units numbered {@code first} through {@code first+count-1}. If {@code textures} is not + * {@code NULL}, it specifies an array of {@code count} values, each of which must be zero or the name of an existing texture object. When an entry in + * {@code textures} is the name of an existing texture object, that object is bound to corresponding texture unit for the target specified when the texture + * object was created. When an entry in {@code textures} is zero, each of the targets enumerated at the beginning of this section is reset to its default + * texture for the corresponding texture image unit. If {@code textures} is {@code NULL}, each target of each affected texture image unit from {@code first} + * through {@code first+count-1} is reset to its default texture. + * + *

{@code BindTextures} is equivalent to:

+ * + *

+     * for ( i = 0; i < count; i++ ) {
+     *     uint texture;
+     *     if ( textures == NULL ) {
+     *         texture = 0;
+     *     } else {
+     *         texture = textures[i];
+     *     }
+     *     ActiveTexture(TEXTURE0 + first + i);
+     *     if ( texture != 0 ) {
+     *         enum target; // target of texture object textures[i]
+     *         BindTexture(target, textures[i]);
+     *     } else {
+     *         for ( target in all supported targets ) {
+     *             BindTexture(target, 0);
+     *         }
+     *     }
+     * }
+ * + *

except that the active texture selector retains its original value upon completion of the command, and that textures will not be created if they do not + * exist.

+ * + *

The values specified in {@code textures} will be checked separately for each texture image unit. When a value for a specific texture image unit is + * invalid, the state for that texture image unit will be unchanged and an error will be generated. However, state for other texture image units will still + * be changed if their corresponding values are valid.

+ * + * @param first the first texture objects + * @param textures an array of zeros or names of existing texture objects + * + * @see Reference Page + */ + public static void glBindTextures(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") IntBuffer textures) { + GL44C.glBindTextures(first, textures); + } + + // --- [ glBindSamplers ] --- + + /** + * Unsafe version of: {@link #glBindSamplers BindSamplers} + * + * @param count the number of sampler objects + */ + public static void nglBindSamplers(int first, int count, long samplers) { + GL44C.nglBindSamplers(first, count, samplers); + } + + /** + * Binds {@code count} existing sampler objects to texture image units numbered {@code first} through {@code first+count-1}. If {@code samplers} is not + * {@code NULL}, it specifies an array of {@code count} values, each of which must be zero or the name of an existing sampler object. If {@code samplers} is {@code NULL}, + * each affected texture image unit from {@code first} through {@code first+count-1} will be reset to have no bound sampler object. + * + *

{@code BindSamplers} is equivalent to:

+ * + *

+     * for ( i = 0; i < count; i++ ) {
+     *     if ( samplers == NULL ) {
+     *         glBindSampler(first + i, 0);
+     *     } else {
+     *         glBindSampler(first + i, samplers[i]);
+     *     }
+     * }
+ * + *

The values specified in {@code samplers} will be checked separately for each texture image unit. When a value for a specific texture image unit is + * invalid, the state for that texture image unit will be unchanged and an error will be generated. However, state for other texture image units will still + * be changed if their corresponding values are valid.

+ * + * @param first the first sampler object + * @param samplers an array of zeros or names of existing sampler objects + * + * @see Reference Page + */ + public static void glBindSamplers(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") IntBuffer samplers) { + GL44C.glBindSamplers(first, samplers); + } + + // --- [ glBindImageTextures ] --- + + /** + * Unsafe version of: {@link #glBindImageTextures BindImageTextures} + * + * @param count the number of image units + */ + public static void nglBindImageTextures(int first, int count, long textures) { + GL44C.nglBindImageTextures(first, count, textures); + } + + /** + * Binds {@code count} existing texture objects to image units numbered {@code first} through {@code first+count-1}. If {@code textures} is not {@code NULL}, it + * specifies an array of {@code count} values, each of which must be zero or the name of an existing texture object. If {@code textures} is {@code NULL}, each + * affected image unit from {@code first} through {@code first+count-1} will be reset to have no bound texture object. + * + *

When binding a non-zero texture object to an image unit, the image unit {@code level}, {@code layered}, {@code layer}, and {@code access} parameters are + * set to zero, {@link GL11#GL_TRUE TRUE}, zero, and {@link GL15#GL_READ_WRITE READ_WRITE}, respectively. The image unit {@code format} parameter is taken from the internal + * format of the texture image at level zero of the texture object identified by {@code textures}. For cube map textures, the internal format of the + * {@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X} image of level zero is used. For multisample, multisample array, buffer, and rectangle textures, the internal + * format of the single texture level is used.

+ * + *

When unbinding a texture object from an image unit, the image unit parameters {@code level}, {@code layered}, {@code layer}, and {@code format} will be + * reset to their default values of zero, {@link GL11#GL_FALSE FALSE}, 0, and {@link GL30#GL_R8 R8}, respectively.

+ * + *

{@code BindImageTextures} is equivalent to:

+ * + *

+     * for ( i = 0; i < count; i++ ) {
+     *     if ( textures == NULL || textures[i] = 0 ) {
+     *         glBindImageTexture(first + i, 0, 0, FALSE, 0, READ_ONLY, R8);
+     *     } else {
+     *         glBindImageTexture(first + i, textures[i], 0, TRUE, 0, READ_WRITE, lookupInternalFormat(textures[i]));
+     *     }
+     * }
+ * + *

where {@code lookupInternalFormat} returns the internal format of the specified texture object.

+ * + *

The values specified in {@code textures} will be checked separately for each image unit. When a value for a specific image unit is invalid, the state + * for that image unit will be unchanged and an error will be generated. However, state for other image units will still be changed if their corresponding + * values are valid.

+ * + * @param first the first image unit + * @param textures an array of zeros or names of existing texture objects + * + * @see Reference Page + */ + public static void glBindImageTextures(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") IntBuffer textures) { + GL44C.glBindImageTextures(first, textures); + } + + // --- [ glBindVertexBuffers ] --- + + /** + * Unsafe version of: {@link #glBindVertexBuffers BindVertexBuffers} + * + * @param count the number of vertex buffer binding points + */ + public static void nglBindVertexBuffers(int first, int count, long buffers, long offsets, long strides) { + GL44C.nglBindVertexBuffers(first, count, buffers, offsets, strides); + } + + /** + * Binds {@code count} existing buffer objects to vertex buffer binding points numbered {@code first} through {@code first+count-1}. If {@code buffers} is + * not {@code NULL}, it specifies an array of {@code count} values, each of which must be zero or the name of an existing buffer object. {@code offsets} and + * {@code strides} specify arrays of {@code count} values indicating the offset of the first element and stride between elements in each buffer, + * respectively. If {@code buffers} is {@code NULL}, each affected vertex buffer binding point from {@code first} through {@code first+count-1} will be reset to + * have no bound buffer object. In this case, the offsets and strides associated with the binding points are set to default values, ignoring + * {@code offsets} and {@code strides}. + * + *

{@code BindVertexBuffers} is equivalent to:

+ * + *

+     * for ( i = 0; i < count; i++ ) {
+     *     if ( buffers == NULL ) {
+     *         glBindVertexBuffer(first + i, 0, 0, 16);
+     *     } else {
+     *         glBindVertexBuffer(first + i, buffers[i], offsets[i], strides[i]);
+     *     }
+     * }
+ * + *

except that buffers will not be created if they do not exist.

+ * + *

The values specified in {@code buffers}, {@code offsets}, and {@code strides} will be checked separately for each vertex buffer binding point. When a + * value for a specific binding point is invalid, the state for that binding point will be unchanged and an error will be generated. However, state for + * other binding points will still be changed if their corresponding values are valid.

+ * + * @param first the first vertex buffer binding point + * @param buffers an array of zeros or names of existing buffers objects + * @param offsets an array of offses + * @param strides an array of stride values + * + * @see Reference Page + */ + public static void glBindVertexBuffers(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") IntBuffer buffers, @Nullable @NativeType("GLintptr const *") PointerBuffer offsets, @Nullable @NativeType("GLsizei const *") IntBuffer strides) { + GL44C.glBindVertexBuffers(first, buffers, offsets, strides); + } + + /** + * Array version of: {@link #glBufferStorage BufferStorage} + * + * @see Reference Page + */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") short[] data, @NativeType("GLbitfield") int flags) { + GL44C.glBufferStorage(target, data, flags); + } + + /** + * Array version of: {@link #glBufferStorage BufferStorage} + * + * @see Reference Page + */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") int[] data, @NativeType("GLbitfield") int flags) { + GL44C.glBufferStorage(target, data, flags); + } + + /** + * Array version of: {@link #glBufferStorage BufferStorage} + * + * @see Reference Page + */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") float[] data, @NativeType("GLbitfield") int flags) { + GL44C.glBufferStorage(target, data, flags); + } + + /** + * Array version of: {@link #glBufferStorage BufferStorage} + * + * @see Reference Page + */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") double[] data, @NativeType("GLbitfield") int flags) { + GL44C.glBufferStorage(target, data, flags); + } + + /** + * Array version of: {@link #glClearTexSubImage ClearTexSubImage} + * + * @see Reference Page + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] data) { + GL44C.glClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); + } + + /** + * Array version of: {@link #glClearTexSubImage ClearTexSubImage} + * + * @see Reference Page + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] data) { + GL44C.glClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); + } + + /** + * Array version of: {@link #glClearTexSubImage ClearTexSubImage} + * + * @see Reference Page + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] data) { + GL44C.glClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); + } + + /** + * Array version of: {@link #glClearTexSubImage ClearTexSubImage} + * + * @see Reference Page + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") double[] data) { + GL44C.glClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data); + } + + /** + * Array version of: {@link #glClearTexImage ClearTexImage} + * + * @see Reference Page + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] data) { + GL44C.glClearTexImage(texture, level, format, type, data); + } + + /** + * Array version of: {@link #glClearTexImage ClearTexImage} + * + * @see Reference Page + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] data) { + GL44C.glClearTexImage(texture, level, format, type, data); + } + + /** + * Array version of: {@link #glClearTexImage ClearTexImage} + * + * @see Reference Page + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] data) { + GL44C.glClearTexImage(texture, level, format, type, data); + } + + /** + * Array version of: {@link #glClearTexImage ClearTexImage} + * + * @see Reference Page + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") double[] data) { + GL44C.glClearTexImage(texture, level, format, type, data); + } + + /** + * Array version of: {@link #glBindBuffersBase BindBuffersBase} + * + * @see Reference Page + */ + public static void glBindBuffersBase(@NativeType("GLenum") int target, @NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") int[] buffers) { + GL44C.glBindBuffersBase(target, first, buffers); + } + + /** + * Array version of: {@link #glBindBuffersRange BindBuffersRange} + * + * @see Reference Page + */ + public static void glBindBuffersRange(@NativeType("GLenum") int target, @NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") int[] buffers, @Nullable @NativeType("GLintptr const *") PointerBuffer offsets, @Nullable @NativeType("GLsizeiptr const *") PointerBuffer sizes) { + GL44C.glBindBuffersRange(target, first, buffers, offsets, sizes); + } + + /** + * Array version of: {@link #glBindTextures BindTextures} + * + * @see Reference Page + */ + public static void glBindTextures(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") int[] textures) { + GL44C.glBindTextures(first, textures); + } + + /** + * Array version of: {@link #glBindSamplers BindSamplers} + * + * @see Reference Page + */ + public static void glBindSamplers(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") int[] samplers) { + GL44C.glBindSamplers(first, samplers); + } + + /** + * Array version of: {@link #glBindImageTextures BindImageTextures} + * + * @see Reference Page + */ + public static void glBindImageTextures(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") int[] textures) { + GL44C.glBindImageTextures(first, textures); + } + + /** + * Array version of: {@link #glBindVertexBuffers BindVertexBuffers} + * + * @see Reference Page + */ + public static void glBindVertexBuffers(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") int[] buffers, @Nullable @NativeType("GLintptr const *") PointerBuffer offsets, @Nullable @NativeType("GLsizei const *") int[] strides) { + GL44C.glBindVertexBuffers(first, buffers, offsets, strides); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL44C.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL44C.java new file mode 100644 index 00000000..6d235565 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL44C.java @@ -0,0 +1,1239 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality up to version 4.4. Includes only Core Profile symbols. + * + *

OpenGL 4.4 implementations support revision 4.40 of the OpenGL Shading Language.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL44C extends GL43C { + + /** Implementation-dependent state which constrains the maximum value of stride parameters to vertex array pointer-setting commands. */ + public static final int GL_MAX_VERTEX_ATTRIB_STRIDE = 0x82E5; + + /** + * Implementations are not required to support primitive restart for separate patch primitives (primitive type PATCHES). Support can be queried by calling + * GetBooleanv with the symbolic constant PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED. A value of FALSE indicates that primitive restart is treated as + * disabled when drawing patches, no matter the value of the enables. A value of TRUE indicates that primitive restart behaves normally for patches. + */ + public static final int GL_PRIMITIVE_RESTART_FOR_PATCHES_SUPPORTED = 0x8221; + + /** Equivalent to {@link ARBTextureBufferObject#GL_TEXTURE_BUFFER_ARB TEXTURE_BUFFER_ARB} query, but named more consistently. */ + public static final int GL_TEXTURE_BUFFER_BINDING = 0x8C2A; + + /** Accepted in the {@code flags} parameter of {@link #glBufferStorage BufferStorage} and {@link ARBBufferStorage#glNamedBufferStorageEXT NamedBufferStorageEXT}. */ + public static final int + GL_MAP_PERSISTENT_BIT = 0x40, + GL_MAP_COHERENT_BIT = 0x80, + GL_DYNAMIC_STORAGE_BIT = 0x100, + GL_CLIENT_STORAGE_BIT = 0x200; + + /** Accepted by the {@code pname} parameter of {@code GetBufferParameter{i|i64}v}. */ + public static final int + GL_BUFFER_IMMUTABLE_STORAGE = 0x821F, + GL_BUFFER_STORAGE_FLAGS = 0x8220; + + /** Accepted by the {@code barriers} parameter of {@link GL42C#glMemoryBarrier MemoryBarrier}. */ + public static final int GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT = 0x4000; + + /** Accepted by the {@code pname} parameter for {@link GL42C#glGetInternalformativ GetInternalformativ} and {@link GL43C#glGetInternalformati64v GetInternalformati64v}. */ + public static final int GL_CLEAR_TEXTURE = 0x9365; + + /** Accepted in the {@code props} array of {@link GL43C#glGetProgramResourceiv GetProgramResourceiv}. */ + public static final int + GL_LOCATION_COMPONENT = 0x934A, + GL_TRANSFORM_FEEDBACK_BUFFER_INDEX = 0x934B, + GL_TRANSFORM_FEEDBACK_BUFFER_STRIDE = 0x934C; + + /** Accepted by the {@code pname} parameter of {@link GL15C#glGetQueryObjectiv GetQueryObjectiv}, {@link GL15C#glGetQueryObjectuiv GetQueryObjectuiv}, {@link GL33C#glGetQueryObjecti64v GetQueryObjecti64v} and {@link GL33C#glGetQueryObjectui64v GetQueryObjectui64v}. */ + public static final int GL_QUERY_RESULT_NO_WAIT = 0x9194; + + /** + * Accepted by the {@code target} parameter of {@link GL15C#glBindBuffer BindBuffer}, {@link GL15C#glBufferData BufferData}, {@link GL15C#glBufferSubData BufferSubData}, + * {@link GL15C#glMapBuffer MapBuffer}, {@link GL15C#glUnmapBuffer UnmapBuffer}, {@link GL30C#glMapBufferRange MapBufferRange}, {@link GL15C#glGetBufferSubData GetBufferSubData}, + * {@link GL15C#glGetBufferParameteriv GetBufferParameteriv}, {@link GL32C#glGetBufferParameteri64v GetBufferParameteri64v}, {@link GL15C#glGetBufferPointerv GetBufferPointerv}, + * {@link GL43C#glClearBufferSubData ClearBufferSubData}, and the {@code readtarget} and {@code writetarget} parameters of {@link GL31C#glCopyBufferSubData CopyBufferSubData}. + */ + public static final int GL_QUERY_BUFFER = 0x9192; + + /** + * Accepted by the {@code pname} parameter of {@link GL11C#glGetBooleanv GetBooleanv}, {@link GL11C#glGetIntegerv GetIntegerv}, {@link GL11C#glGetFloatv GetFloatv}, + * and {@link GL11C#glGetDoublev GetDoublev}. + */ + public static final int GL_QUERY_BUFFER_BINDING = 0x9193; + + /** Accepted in the {@code barriers} bitfield in {@link GL42C#glMemoryBarrier MemoryBarrier}. */ + public static final int GL_QUERY_BUFFER_BARRIER_BIT = 0x8000; + + /** + * Accepted by the {@code param} parameter of TexParameter{if}, SamplerParameter{if} and SamplerParameter{if}v, and by the {@code params} parameter of + * TexParameter{if}v, TexParameterI{i ui}v and SamplerParameterI{i ui}v when their {@code pname} parameter is {@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}, {@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}, or + * {@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}, + */ + public static final int GL_MIRROR_CLAMP_TO_EDGE = 0x8743; + + static { GL.initialize(); } + + protected GL44C() { + throw new UnsupportedOperationException(); + } + + // --- [ glBufferStorage ] --- + + /** + * Unsafe version of: {@link #glBufferStorage BufferStorage} + * + * @param size the size of the data store in basic machine units + */ + public static native void nglBufferStorage(int target, long size, long data, int flags); + + /** + * Creates the data store of a buffer object. + * + *

The data store of the buffer object bound to {@code target} is allocated as a result of a call to this function and cannot be de-allocated until the + * buffer is deleted with a call to {@link GL15C#glDeleteBuffers DeleteBuffers}. Such a store may not be re-allocated through further calls to {@code BufferStorage} + * or {@link GL15C#glBufferData BufferData}.

+ * + *

{@code BufferStorage} deletes any existing data store. If any portion of the buffer object is mapped in the current context or any context current to + * another thread, it is as though {@link GL15C#glUnmapBuffer UnmapBuffer} is executed in each such context prior to deleting the existing data store.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param size the size of the data store in basic machine units + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link #GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("GLsizeiptr") long size, @NativeType("GLbitfield") int flags) { + nglBufferStorage(target, size, NULL, flags); + } + + /** + * Creates the data store of a buffer object. + * + *

The data store of the buffer object bound to {@code target} is allocated as a result of a call to this function and cannot be de-allocated until the + * buffer is deleted with a call to {@link GL15C#glDeleteBuffers DeleteBuffers}. Such a store may not be re-allocated through further calls to {@code BufferStorage} + * or {@link GL15C#glBufferData BufferData}.

+ * + *

{@code BufferStorage} deletes any existing data store. If any portion of the buffer object is mapped in the current context or any context current to + * another thread, it is as though {@link GL15C#glUnmapBuffer UnmapBuffer} is executed in each such context prior to deleting the existing data store.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link #GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") ByteBuffer data, @NativeType("GLbitfield") int flags) { + nglBufferStorage(target, data.remaining(), memAddress(data), flags); + } + + /** + * Creates the data store of a buffer object. + * + *

The data store of the buffer object bound to {@code target} is allocated as a result of a call to this function and cannot be de-allocated until the + * buffer is deleted with a call to {@link GL15C#glDeleteBuffers DeleteBuffers}. Such a store may not be re-allocated through further calls to {@code BufferStorage} + * or {@link GL15C#glBufferData BufferData}.

+ * + *

{@code BufferStorage} deletes any existing data store. If any portion of the buffer object is mapped in the current context or any context current to + * another thread, it is as though {@link GL15C#glUnmapBuffer UnmapBuffer} is executed in each such context prior to deleting the existing data store.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link #GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") ShortBuffer data, @NativeType("GLbitfield") int flags) { + nglBufferStorage(target, Integer.toUnsignedLong(data.remaining()) << 1, memAddress(data), flags); + } + + /** + * Creates the data store of a buffer object. + * + *

The data store of the buffer object bound to {@code target} is allocated as a result of a call to this function and cannot be de-allocated until the + * buffer is deleted with a call to {@link GL15C#glDeleteBuffers DeleteBuffers}. Such a store may not be re-allocated through further calls to {@code BufferStorage} + * or {@link GL15C#glBufferData BufferData}.

+ * + *

{@code BufferStorage} deletes any existing data store. If any portion of the buffer object is mapped in the current context or any context current to + * another thread, it is as though {@link GL15C#glUnmapBuffer UnmapBuffer} is executed in each such context prior to deleting the existing data store.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link #GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") IntBuffer data, @NativeType("GLbitfield") int flags) { + nglBufferStorage(target, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data), flags); + } + + /** + * Creates the data store of a buffer object. + * + *

The data store of the buffer object bound to {@code target} is allocated as a result of a call to this function and cannot be de-allocated until the + * buffer is deleted with a call to {@link GL15C#glDeleteBuffers DeleteBuffers}. Such a store may not be re-allocated through further calls to {@code BufferStorage} + * or {@link GL15C#glBufferData BufferData}.

+ * + *

{@code BufferStorage} deletes any existing data store. If any portion of the buffer object is mapped in the current context or any context current to + * another thread, it is as though {@link GL15C#glUnmapBuffer UnmapBuffer} is executed in each such context prior to deleting the existing data store.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link #GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") FloatBuffer data, @NativeType("GLbitfield") int flags) { + nglBufferStorage(target, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data), flags); + } + + /** + * Creates the data store of a buffer object. + * + *

The data store of the buffer object bound to {@code target} is allocated as a result of a call to this function and cannot be de-allocated until the + * buffer is deleted with a call to {@link GL15C#glDeleteBuffers DeleteBuffers}. Such a store may not be re-allocated through further calls to {@code BufferStorage} + * or {@link GL15C#glBufferData BufferData}.

+ * + *

{@code BufferStorage} deletes any existing data store. If any portion of the buffer object is mapped in the current context or any context current to + * another thread, it is as though {@link GL15C#glUnmapBuffer UnmapBuffer} is executed in each such context prior to deleting the existing data store.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link #GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link #GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link #GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link #GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link #GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") DoubleBuffer data, @NativeType("GLbitfield") int flags) { + nglBufferStorage(target, Integer.toUnsignedLong(data.remaining()) << 3, memAddress(data), flags); + } + + // --- [ glClearTexSubImage ] --- + + /** Unsafe version of: {@link #glClearTexSubImage ClearTexSubImage} */ + public static native void nglClearTexSubImage(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, long data); + + /** + * Fills all or part of a texture image with a constant value. + * + *

Arguments {@code xoffset}, {@code yoffset}, and {@code zoffset} specify the lower left texel coordinates of a {@code width}-wide by {@code height}-high + * by {@code depth}-deep rectangular subregion of the texel array and are interpreted as they are in {@link GL12C#glTexSubImage3D TexSubImage3D}.

+ * + *

For 1D array textures, {@code yoffset} is interpreted as the first layer to be cleared and {@code height} is the number of layers to clear. For 2D array + * textures, {@code zoffset} is interpreted as the first layer to be cleared and {@code depth} is the number of layers to clear. Cube map textures are + * treated as an array of six slices in the z-dimension, where the value of {@code zoffset} is interpreted as specifying the cube map face for the + * corresponding {@code layer} and {@code depth} is the number of faces to clear. For cube map array textures, {@code zoffset} is the first layer-face to + * clear, and {@code depth} is the number of layer-faces to clear. Each layer-face is translated into an array layer and a cube map face.

+ * + *

Negative values of {@code xoffset}, {@code yoffset}, and {@code zoffset} correspond to the coordinates of border texels.

+ * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + * + * @see Reference Page + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer data) { + nglClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddressSafe(data)); + } + + /** + * Fills all or part of a texture image with a constant value. + * + *

Arguments {@code xoffset}, {@code yoffset}, and {@code zoffset} specify the lower left texel coordinates of a {@code width}-wide by {@code height}-high + * by {@code depth}-deep rectangular subregion of the texel array and are interpreted as they are in {@link GL12C#glTexSubImage3D TexSubImage3D}.

+ * + *

For 1D array textures, {@code yoffset} is interpreted as the first layer to be cleared and {@code height} is the number of layers to clear. For 2D array + * textures, {@code zoffset} is interpreted as the first layer to be cleared and {@code depth} is the number of layers to clear. Cube map textures are + * treated as an array of six slices in the z-dimension, where the value of {@code zoffset} is interpreted as specifying the cube map face for the + * corresponding {@code layer} and {@code depth} is the number of faces to clear. For cube map array textures, {@code zoffset} is the first layer-face to + * clear, and {@code depth} is the number of layer-faces to clear. Each layer-face is translated into an array layer and a cube map face.

+ * + *

Negative values of {@code xoffset}, {@code yoffset}, and {@code zoffset} correspond to the coordinates of border texels.

+ * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + * + * @see Reference Page + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer data) { + nglClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddressSafe(data)); + } + + /** + * Fills all or part of a texture image with a constant value. + * + *

Arguments {@code xoffset}, {@code yoffset}, and {@code zoffset} specify the lower left texel coordinates of a {@code width}-wide by {@code height}-high + * by {@code depth}-deep rectangular subregion of the texel array and are interpreted as they are in {@link GL12C#glTexSubImage3D TexSubImage3D}.

+ * + *

For 1D array textures, {@code yoffset} is interpreted as the first layer to be cleared and {@code height} is the number of layers to clear. For 2D array + * textures, {@code zoffset} is interpreted as the first layer to be cleared and {@code depth} is the number of layers to clear. Cube map textures are + * treated as an array of six slices in the z-dimension, where the value of {@code zoffset} is interpreted as specifying the cube map face for the + * corresponding {@code layer} and {@code depth} is the number of faces to clear. For cube map array textures, {@code zoffset} is the first layer-face to + * clear, and {@code depth} is the number of layer-faces to clear. Each layer-face is translated into an array layer and a cube map face.

+ * + *

Negative values of {@code xoffset}, {@code yoffset}, and {@code zoffset} correspond to the coordinates of border texels.

+ * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + * + * @see Reference Page + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer data) { + nglClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddressSafe(data)); + } + + /** + * Fills all or part of a texture image with a constant value. + * + *

Arguments {@code xoffset}, {@code yoffset}, and {@code zoffset} specify the lower left texel coordinates of a {@code width}-wide by {@code height}-high + * by {@code depth}-deep rectangular subregion of the texel array and are interpreted as they are in {@link GL12C#glTexSubImage3D TexSubImage3D}.

+ * + *

For 1D array textures, {@code yoffset} is interpreted as the first layer to be cleared and {@code height} is the number of layers to clear. For 2D array + * textures, {@code zoffset} is interpreted as the first layer to be cleared and {@code depth} is the number of layers to clear. Cube map textures are + * treated as an array of six slices in the z-dimension, where the value of {@code zoffset} is interpreted as specifying the cube map face for the + * corresponding {@code layer} and {@code depth} is the number of faces to clear. For cube map array textures, {@code zoffset} is the first layer-face to + * clear, and {@code depth} is the number of layer-faces to clear. Each layer-face is translated into an array layer and a cube map face.

+ * + *

Negative values of {@code xoffset}, {@code yoffset}, and {@code zoffset} correspond to the coordinates of border texels.

+ * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + * + * @see Reference Page + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer data) { + nglClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddressSafe(data)); + } + + /** + * Fills all or part of a texture image with a constant value. + * + *

Arguments {@code xoffset}, {@code yoffset}, and {@code zoffset} specify the lower left texel coordinates of a {@code width}-wide by {@code height}-high + * by {@code depth}-deep rectangular subregion of the texel array and are interpreted as they are in {@link GL12C#glTexSubImage3D TexSubImage3D}.

+ * + *

For 1D array textures, {@code yoffset} is interpreted as the first layer to be cleared and {@code height} is the number of layers to clear. For 2D array + * textures, {@code zoffset} is interpreted as the first layer to be cleared and {@code depth} is the number of layers to clear. Cube map textures are + * treated as an array of six slices in the z-dimension, where the value of {@code zoffset} is interpreted as specifying the cube map face for the + * corresponding {@code layer} and {@code depth} is the number of faces to clear. For cube map array textures, {@code zoffset} is the first layer-face to + * clear, and {@code depth} is the number of layer-faces to clear. Each layer-face is translated into an array layer and a cube map face.

+ * + *

Negative values of {@code xoffset}, {@code yoffset}, and {@code zoffset} correspond to the coordinates of border texels.

+ * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + * + * @see Reference Page + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") DoubleBuffer data) { + nglClearTexSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddressSafe(data)); + } + + // --- [ glClearTexImage ] --- + + /** Unsafe version of: {@link #glClearTexImage ClearTexImage} */ + public static native void nglClearTexImage(int texture, int level, int format, int type, long data); + + /** + * Is equivalent to calling {@link #glClearTexSubImage ClearTexSubImage} with {@code xoffset}, {@code yoffset}, and {@code zoffset} equal to -{@code b} and {@code width}, + * {@code height}, and {@code depth} equal to the dimensions of the texture image plus {@code 2xb} (or zero and one for dimensions the texture doesn't + * have). + * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + * + * @see Reference Page + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer data) { + nglClearTexImage(texture, level, format, type, memAddressSafe(data)); + } + + /** + * Is equivalent to calling {@link #glClearTexSubImage ClearTexSubImage} with {@code xoffset}, {@code yoffset}, and {@code zoffset} equal to -{@code b} and {@code width}, + * {@code height}, and {@code depth} equal to the dimensions of the texture image plus {@code 2xb} (or zero and one for dimensions the texture doesn't + * have). + * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + * + * @see Reference Page + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer data) { + nglClearTexImage(texture, level, format, type, memAddressSafe(data)); + } + + /** + * Is equivalent to calling {@link #glClearTexSubImage ClearTexSubImage} with {@code xoffset}, {@code yoffset}, and {@code zoffset} equal to -{@code b} and {@code width}, + * {@code height}, and {@code depth} equal to the dimensions of the texture image plus {@code 2xb} (or zero and one for dimensions the texture doesn't + * have). + * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + * + * @see Reference Page + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer data) { + nglClearTexImage(texture, level, format, type, memAddressSafe(data)); + } + + /** + * Is equivalent to calling {@link #glClearTexSubImage ClearTexSubImage} with {@code xoffset}, {@code yoffset}, and {@code zoffset} equal to -{@code b} and {@code width}, + * {@code height}, and {@code depth} equal to the dimensions of the texture image plus {@code 2xb} (or zero and one for dimensions the texture doesn't + * have). + * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + * + * @see Reference Page + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer data) { + nglClearTexImage(texture, level, format, type, memAddressSafe(data)); + } + + /** + * Is equivalent to calling {@link #glClearTexSubImage ClearTexSubImage} with {@code xoffset}, {@code yoffset}, and {@code zoffset} equal to -{@code b} and {@code width}, + * {@code height}, and {@code depth} equal to the dimensions of the texture image plus {@code 2xb} (or zero and one for dimensions the texture doesn't + * have). + * + * @param texture the texture to clear. It is an error if {@code texture} is zero or not the name of a texture object, if {@code texture} is a buffer texture, or if + * the texture image has a compressed internal format + * @param level the texture level to clear + * @param format the format of the source data. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the source data. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data an array of between one and four components of texel data that will be used as the source for the constant fill value. If {@code data} is {@code NULL}, + * then the pointer is ignored and the sub-range of the texture image is filled with zeros. + * + * @see Reference Page + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") DoubleBuffer data) { + nglClearTexImage(texture, level, format, type, memAddressSafe(data)); + } + + // --- [ glBindBuffersBase ] --- + + /** + * Unsafe version of: {@link #glBindBuffersBase BindBuffersBase} + * + * @param count the number of bindings + */ + public static native void nglBindBuffersBase(int target, int first, int count, long buffers); + + /** + * Binds {@code count} existing buffer objects to bindings numbered {@code first} through {@code first+count-1} in the array of buffer binding points + * corresponding to {@code target}. If {@code buffers} is not {@code NULL}, it specifies an array of {@code count} values, each of which must be zero or the name + * of an existing buffer object. It is equivalent to: + * + *

+     * for ( i = 0; i < count; i++ ) {
+     *     if ( buffers == NULL ) {
+     *         glBindBufferBase(target, first + i, 0);
+     *     } else {
+     *         glBindBufferBase(target, first + i, buffers[i]);
+     *     }
+     * }
+ * + *

except that the single general buffer binding corresponding to {@code target} is unmodified, and that buffers will not be created if they do not exist.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param first the first binding + * @param buffers an array of zeros or names of existing buffers objects + * + * @see Reference Page + */ + public static void glBindBuffersBase(@NativeType("GLenum") int target, @NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") IntBuffer buffers) { + nglBindBuffersBase(target, first, remainingSafe(buffers), memAddressSafe(buffers)); + } + + // --- [ glBindBuffersRange ] --- + + /** + * Unsafe version of: {@link #glBindBuffersRange BindBuffersRange} + * + * @param count the number of bindings + */ + public static native void nglBindBuffersRange(int target, int first, int count, long buffers, long offsets, long sizes); + + /** + * Binds {@code count} existing buffer objects to bindings numbered {@code first} through {@code first+count-1} in the array of buffer binding points + * corresponding to {@code target}. {@code offsets} and {@code sizes} specify arrays of {@code count} values indicating the range of each buffer to bind. + * If {@code buffers} is {@code NULL}, all bindings from {@code first} through {@code first+count-1} are reset to their unbound (zero) state. In this + * case, the offsets and sizes associated with the binding points are set to default values, ignoring {@code offsets} and {@code sizes}. It is equivalent + * to: + * + *

+     * for ( i = 0; i < count; i++ ) {
+     *     if ( buffers == NULL ) {
+     *         glBindBufferRange(target, first + i, 0, 0, 0);
+     *     } else {
+     *         glBindBufferRange(target, first + i, buffers[i], offsets[i], sizes[i]);
+     *     }
+     * }
+ * + *

except that the single general buffer binding corresponding to {@code target} is unmodified, and that buffers will not be created if they do not exist.

+ * + *

The values specified in {@code buffers}, {@code offsets}, and {@code sizes} will be checked separately for each binding point. When values for a + * specific binding point are invalid, the state for that binding point will be unchanged and an error will be generated. However, state for other binding + * points will still be changed if their corresponding values are valid.

+ * + * @param target the buffer object target. One of:
{@link GL15#GL_ARRAY_BUFFER ARRAY_BUFFER}{@link GL15#GL_ELEMENT_ARRAY_BUFFER ELEMENT_ARRAY_BUFFER}{@link GL21#GL_PIXEL_PACK_BUFFER PIXEL_PACK_BUFFER}{@link GL21#GL_PIXEL_UNPACK_BUFFER PIXEL_UNPACK_BUFFER}
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER TRANSFORM_FEEDBACK_BUFFER}{@link GL31#GL_UNIFORM_BUFFER UNIFORM_BUFFER}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL31#GL_COPY_READ_BUFFER COPY_READ_BUFFER}
{@link GL31#GL_COPY_WRITE_BUFFER COPY_WRITE_BUFFER}{@link GL40#GL_DRAW_INDIRECT_BUFFER DRAW_INDIRECT_BUFFER}{@link GL42#GL_ATOMIC_COUNTER_BUFFER ATOMIC_COUNTER_BUFFER}{@link GL43#GL_DISPATCH_INDIRECT_BUFFER DISPATCH_INDIRECT_BUFFER}
{@link GL43#GL_SHADER_STORAGE_BUFFER SHADER_STORAGE_BUFFER}{@link ARBIndirectParameters#GL_PARAMETER_BUFFER_ARB PARAMETER_BUFFER_ARB}
+ * @param first the first binding + * @param buffers an array of names of existing buffers objects + * @param offsets an array of offsets + * @param sizes an array of sizes + * + * @see Reference Page + */ + public static void glBindBuffersRange(@NativeType("GLenum") int target, @NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") IntBuffer buffers, @Nullable @NativeType("GLintptr const *") PointerBuffer offsets, @Nullable @NativeType("GLsizeiptr const *") PointerBuffer sizes) { + if (CHECKS) { + checkSafe(offsets, remainingSafe(buffers)); + checkSafe(sizes, remainingSafe(buffers)); + } + nglBindBuffersRange(target, first, remainingSafe(buffers), memAddressSafe(buffers), memAddressSafe(offsets), memAddressSafe(sizes)); + } + + // --- [ glBindTextures ] --- + + /** + * Unsafe version of: {@link #glBindTextures BindTextures} + * + * @param count the number of texture objects + */ + public static native void nglBindTextures(int first, int count, long textures); + + /** + * Binds {@code count} existing texture objects to texture image units numbered {@code first} through {@code first+count-1}. If {@code textures} is not + * {@code NULL}, it specifies an array of {@code count} values, each of which must be zero or the name of an existing texture object. When an entry in + * {@code textures} is the name of an existing texture object, that object is bound to corresponding texture unit for the target specified when the texture + * object was created. When an entry in {@code textures} is zero, each of the targets enumerated at the beginning of this section is reset to its default + * texture for the corresponding texture image unit. If {@code textures} is {@code NULL}, each target of each affected texture image unit from {@code first} + * through {@code first+count-1} is reset to its default texture. + * + *

{@code BindTextures} is equivalent to:

+ * + *

+     * for ( i = 0; i < count; i++ ) {
+     *     uint texture;
+     *     if ( textures == NULL ) {
+     *         texture = 0;
+     *     } else {
+     *         texture = textures[i];
+     *     }
+     *     ActiveTexture(TEXTURE0 + first + i);
+     *     if ( texture != 0 ) {
+     *         enum target; // target of texture object textures[i]
+     *         BindTexture(target, textures[i]);
+     *     } else {
+     *         for ( target in all supported targets ) {
+     *             BindTexture(target, 0);
+     *         }
+     *     }
+     * }
+ * + *

except that the active texture selector retains its original value upon completion of the command, and that textures will not be created if they do not + * exist.

+ * + *

The values specified in {@code textures} will be checked separately for each texture image unit. When a value for a specific texture image unit is + * invalid, the state for that texture image unit will be unchanged and an error will be generated. However, state for other texture image units will still + * be changed if their corresponding values are valid.

+ * + * @param first the first texture objects + * @param textures an array of zeros or names of existing texture objects + * + * @see Reference Page + */ + public static void glBindTextures(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") IntBuffer textures) { + nglBindTextures(first, remainingSafe(textures), memAddressSafe(textures)); + } + + // --- [ glBindSamplers ] --- + + /** + * Unsafe version of: {@link #glBindSamplers BindSamplers} + * + * @param count the number of sampler objects + */ + public static native void nglBindSamplers(int first, int count, long samplers); + + /** + * Binds {@code count} existing sampler objects to texture image units numbered {@code first} through {@code first+count-1}. If {@code samplers} is not + * {@code NULL}, it specifies an array of {@code count} values, each of which must be zero or the name of an existing sampler object. If {@code samplers} is {@code NULL}, + * each affected texture image unit from {@code first} through {@code first+count-1} will be reset to have no bound sampler object. + * + *

{@code BindSamplers} is equivalent to:

+ * + *

+     * for ( i = 0; i < count; i++ ) {
+     *     if ( samplers == NULL ) {
+     *         glBindSampler(first + i, 0);
+     *     } else {
+     *         glBindSampler(first + i, samplers[i]);
+     *     }
+     * }
+ * + *

The values specified in {@code samplers} will be checked separately for each texture image unit. When a value for a specific texture image unit is + * invalid, the state for that texture image unit will be unchanged and an error will be generated. However, state for other texture image units will still + * be changed if their corresponding values are valid.

+ * + * @param first the first sampler object + * @param samplers an array of zeros or names of existing sampler objects + * + * @see Reference Page + */ + public static void glBindSamplers(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") IntBuffer samplers) { + nglBindSamplers(first, remainingSafe(samplers), memAddressSafe(samplers)); + } + + // --- [ glBindImageTextures ] --- + + /** + * Unsafe version of: {@link #glBindImageTextures BindImageTextures} + * + * @param count the number of image units + */ + public static native void nglBindImageTextures(int first, int count, long textures); + + /** + * Binds {@code count} existing texture objects to image units numbered {@code first} through {@code first+count-1}. If {@code textures} is not {@code NULL}, it + * specifies an array of {@code count} values, each of which must be zero or the name of an existing texture object. If {@code textures} is {@code NULL}, each + * affected image unit from {@code first} through {@code first+count-1} will be reset to have no bound texture object. + * + *

When binding a non-zero texture object to an image unit, the image unit {@code level}, {@code layered}, {@code layer}, and {@code access} parameters are + * set to zero, {@link GL11#GL_TRUE TRUE}, zero, and {@link GL15#GL_READ_WRITE READ_WRITE}, respectively. The image unit {@code format} parameter is taken from the internal + * format of the texture image at level zero of the texture object identified by {@code textures}. For cube map textures, the internal format of the + * {@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X} image of level zero is used. For multisample, multisample array, buffer, and rectangle textures, the internal + * format of the single texture level is used.

+ * + *

When unbinding a texture object from an image unit, the image unit parameters {@code level}, {@code layered}, {@code layer}, and {@code format} will be + * reset to their default values of zero, {@link GL11#GL_FALSE FALSE}, 0, and {@link GL30#GL_R8 R8}, respectively.

+ * + *

{@code BindImageTextures} is equivalent to:

+ * + *

+     * for ( i = 0; i < count; i++ ) {
+     *     if ( textures == NULL || textures[i] = 0 ) {
+     *         glBindImageTexture(first + i, 0, 0, FALSE, 0, READ_ONLY, R8);
+     *     } else {
+     *         glBindImageTexture(first + i, textures[i], 0, TRUE, 0, READ_WRITE, lookupInternalFormat(textures[i]));
+     *     }
+     * }
+ * + *

where {@code lookupInternalFormat} returns the internal format of the specified texture object.

+ * + *

The values specified in {@code textures} will be checked separately for each image unit. When a value for a specific image unit is invalid, the state + * for that image unit will be unchanged and an error will be generated. However, state for other image units will still be changed if their corresponding + * values are valid.

+ * + * @param first the first image unit + * @param textures an array of zeros or names of existing texture objects + * + * @see Reference Page + */ + public static void glBindImageTextures(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") IntBuffer textures) { + nglBindImageTextures(first, remainingSafe(textures), memAddressSafe(textures)); + } + + // --- [ glBindVertexBuffers ] --- + + /** + * Unsafe version of: {@link #glBindVertexBuffers BindVertexBuffers} + * + * @param count the number of vertex buffer binding points + */ + public static native void nglBindVertexBuffers(int first, int count, long buffers, long offsets, long strides); + + /** + * Binds {@code count} existing buffer objects to vertex buffer binding points numbered {@code first} through {@code first+count-1}. If {@code buffers} is + * not {@code NULL}, it specifies an array of {@code count} values, each of which must be zero or the name of an existing buffer object. {@code offsets} and + * {@code strides} specify arrays of {@code count} values indicating the offset of the first element and stride between elements in each buffer, + * respectively. If {@code buffers} is {@code NULL}, each affected vertex buffer binding point from {@code first} through {@code first+count-1} will be reset to + * have no bound buffer object. In this case, the offsets and strides associated with the binding points are set to default values, ignoring + * {@code offsets} and {@code strides}. + * + *

{@code BindVertexBuffers} is equivalent to:

+ * + *

+     * for ( i = 0; i < count; i++ ) {
+     *     if ( buffers == NULL ) {
+     *         glBindVertexBuffer(first + i, 0, 0, 16);
+     *     } else {
+     *         glBindVertexBuffer(first + i, buffers[i], offsets[i], strides[i]);
+     *     }
+     * }
+ * + *

except that buffers will not be created if they do not exist.

+ * + *

The values specified in {@code buffers}, {@code offsets}, and {@code strides} will be checked separately for each vertex buffer binding point. When a + * value for a specific binding point is invalid, the state for that binding point will be unchanged and an error will be generated. However, state for + * other binding points will still be changed if their corresponding values are valid.

+ * + * @param first the first vertex buffer binding point + * @param buffers an array of zeros or names of existing buffers objects + * @param offsets an array of offses + * @param strides an array of stride values + * + * @see Reference Page + */ + public static void glBindVertexBuffers(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") IntBuffer buffers, @Nullable @NativeType("GLintptr const *") PointerBuffer offsets, @Nullable @NativeType("GLsizei const *") IntBuffer strides) { + if (CHECKS) { + checkSafe(offsets, remainingSafe(buffers)); + checkSafe(strides, remainingSafe(buffers)); + } + nglBindVertexBuffers(first, remainingSafe(buffers), memAddressSafe(buffers), memAddressSafe(offsets), memAddressSafe(strides)); + } + + /** + * Array version of: {@link #glBufferStorage BufferStorage} + * + * @see Reference Page + */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") short[] data, @NativeType("GLbitfield") int flags) { + long __functionAddress = GL.getICD().glBufferStorage; + if (CHECKS) { + check(__functionAddress); + } + callPPV(target, Integer.toUnsignedLong(data.length) << 1, data, flags, __functionAddress); + } + + /** + * Array version of: {@link #glBufferStorage BufferStorage} + * + * @see Reference Page + */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") int[] data, @NativeType("GLbitfield") int flags) { + long __functionAddress = GL.getICD().glBufferStorage; + if (CHECKS) { + check(__functionAddress); + } + callPPV(target, Integer.toUnsignedLong(data.length) << 2, data, flags, __functionAddress); + } + + /** + * Array version of: {@link #glBufferStorage BufferStorage} + * + * @see Reference Page + */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") float[] data, @NativeType("GLbitfield") int flags) { + long __functionAddress = GL.getICD().glBufferStorage; + if (CHECKS) { + check(__functionAddress); + } + callPPV(target, Integer.toUnsignedLong(data.length) << 2, data, flags, __functionAddress); + } + + /** + * Array version of: {@link #glBufferStorage BufferStorage} + * + * @see Reference Page + */ + public static void glBufferStorage(@NativeType("GLenum") int target, @NativeType("void const *") double[] data, @NativeType("GLbitfield") int flags) { + long __functionAddress = GL.getICD().glBufferStorage; + if (CHECKS) { + check(__functionAddress); + } + callPPV(target, Integer.toUnsignedLong(data.length) << 3, data, flags, __functionAddress); + } + + /** + * Array version of: {@link #glClearTexSubImage ClearTexSubImage} + * + * @see Reference Page + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] data) { + long __functionAddress = GL.getICD().glClearTexSubImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data, __functionAddress); + } + + /** + * Array version of: {@link #glClearTexSubImage ClearTexSubImage} + * + * @see Reference Page + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] data) { + long __functionAddress = GL.getICD().glClearTexSubImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data, __functionAddress); + } + + /** + * Array version of: {@link #glClearTexSubImage ClearTexSubImage} + * + * @see Reference Page + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] data) { + long __functionAddress = GL.getICD().glClearTexSubImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data, __functionAddress); + } + + /** + * Array version of: {@link #glClearTexSubImage ClearTexSubImage} + * + * @see Reference Page + */ + public static void glClearTexSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") double[] data) { + long __functionAddress = GL.getICD().glClearTexSubImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data, __functionAddress); + } + + /** + * Array version of: {@link #glClearTexImage ClearTexImage} + * + * @see Reference Page + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] data) { + long __functionAddress = GL.getICD().glClearTexImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, format, type, data, __functionAddress); + } + + /** + * Array version of: {@link #glClearTexImage ClearTexImage} + * + * @see Reference Page + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] data) { + long __functionAddress = GL.getICD().glClearTexImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, format, type, data, __functionAddress); + } + + /** + * Array version of: {@link #glClearTexImage ClearTexImage} + * + * @see Reference Page + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] data) { + long __functionAddress = GL.getICD().glClearTexImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, format, type, data, __functionAddress); + } + + /** + * Array version of: {@link #glClearTexImage ClearTexImage} + * + * @see Reference Page + */ + public static void glClearTexImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") double[] data) { + long __functionAddress = GL.getICD().glClearTexImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, format, type, data, __functionAddress); + } + + /** + * Array version of: {@link #glBindBuffersBase BindBuffersBase} + * + * @see Reference Page + */ + public static void glBindBuffersBase(@NativeType("GLenum") int target, @NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") int[] buffers) { + long __functionAddress = GL.getICD().glBindBuffersBase; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, first, lengthSafe(buffers), buffers, __functionAddress); + } + + /** + * Array version of: {@link #glBindBuffersRange BindBuffersRange} + * + * @see Reference Page + */ + public static void glBindBuffersRange(@NativeType("GLenum") int target, @NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") int[] buffers, @Nullable @NativeType("GLintptr const *") PointerBuffer offsets, @Nullable @NativeType("GLsizeiptr const *") PointerBuffer sizes) { + long __functionAddress = GL.getICD().glBindBuffersRange; + if (CHECKS) { + check(__functionAddress); + checkSafe(offsets, lengthSafe(buffers)); + checkSafe(sizes, lengthSafe(buffers)); + } + callPPPV(target, first, lengthSafe(buffers), buffers, memAddressSafe(offsets), memAddressSafe(sizes), __functionAddress); + } + + /** + * Array version of: {@link #glBindTextures BindTextures} + * + * @see Reference Page + */ + public static void glBindTextures(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") int[] textures) { + long __functionAddress = GL.getICD().glBindTextures; + if (CHECKS) { + check(__functionAddress); + } + callPV(first, lengthSafe(textures), textures, __functionAddress); + } + + /** + * Array version of: {@link #glBindSamplers BindSamplers} + * + * @see Reference Page + */ + public static void glBindSamplers(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") int[] samplers) { + long __functionAddress = GL.getICD().glBindSamplers; + if (CHECKS) { + check(__functionAddress); + } + callPV(first, lengthSafe(samplers), samplers, __functionAddress); + } + + /** + * Array version of: {@link #glBindImageTextures BindImageTextures} + * + * @see Reference Page + */ + public static void glBindImageTextures(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") int[] textures) { + long __functionAddress = GL.getICD().glBindImageTextures; + if (CHECKS) { + check(__functionAddress); + } + callPV(first, lengthSafe(textures), textures, __functionAddress); + } + + /** + * Array version of: {@link #glBindVertexBuffers BindVertexBuffers} + * + * @see Reference Page + */ + public static void glBindVertexBuffers(@NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") int[] buffers, @Nullable @NativeType("GLintptr const *") PointerBuffer offsets, @Nullable @NativeType("GLsizei const *") int[] strides) { + long __functionAddress = GL.getICD().glBindVertexBuffers; + if (CHECKS) { + check(__functionAddress); + checkSafe(offsets, lengthSafe(buffers)); + checkSafe(strides, lengthSafe(buffers)); + } + callPPPV(first, lengthSafe(buffers), buffers, memAddressSafe(offsets), strides, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL45.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL45.java new file mode 100644 index 00000000..4113f33a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL45.java @@ -0,0 +1,5712 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality up to version 4.5. Includes the deprecated symbols of the Compatibility Profile. + * + *

OpenGL 4.5 implementations support revision 4.50 of the OpenGL Shading Language.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL45 extends GL44 { + + /** Accepted by the {@code depth} parameter of {@link #glClipControl ClipControl}. */ + public static final int + GL_NEGATIVE_ONE_TO_ONE = 0x935E, + GL_ZERO_TO_ONE = 0x935F; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_CLIP_ORIGIN = 0x935C, + GL_CLIP_DEPTH_MODE = 0x935D; + + /** Accepted by the {@code mode} parameter of {@link GL30C#glBeginConditionalRender BeginConditionalRender}. */ + public static final int + GL_QUERY_WAIT_INVERTED = 0x8E17, + GL_QUERY_NO_WAIT_INVERTED = 0x8E18, + GL_QUERY_BY_REGION_WAIT_INVERTED = 0x8E19, + GL_QUERY_BY_REGION_NO_WAIT_INVERTED = 0x8E1A; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetFloatv, GetIntegerv, and GetInteger64v. */ + public static final int + GL_MAX_CULL_DISTANCES = 0x82F9, + GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES = 0x82FA; + + /** Accepted by the {@code pname} parameter of GetTextureParameter{if}v and GetTextureParameterI{i ui}v. */ + public static final int GL_TEXTURE_TARGET = 0x1006; + + /** Accepted by the {@code pname} parameter of GetQueryObjectiv. */ + public static final int GL_QUERY_TARGET = 0x82EA; + + /** Accepted by the {@code pname} parameter of GetIntegerv, GetFloatv, GetBooleanv GetDoublev and GetInteger64v. */ + public static final int GL_CONTEXT_RELEASE_BEHAVIOR = 0x82FB; + + /** Returned in {@code data} by GetIntegerv, GetFloatv, GetBooleanv GetDoublev and GetInteger64v when {@code pname} is {@link #GL_CONTEXT_RELEASE_BEHAVIOR CONTEXT_RELEASE_BEHAVIOR}. */ + public static final int GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x82FC; + + /** Returned by {@link #glGetGraphicsResetStatus GetGraphicsResetStatus}. */ + public static final int + GL_GUILTY_CONTEXT_RESET = 0x8253, + GL_INNOCENT_CONTEXT_RESET = 0x8254, + GL_UNKNOWN_CONTEXT_RESET = 0x8255; + + /** Accepted by the {@code value} parameter of GetBooleanv, GetIntegerv, and GetFloatv. */ + public static final int GL_RESET_NOTIFICATION_STRATEGY = 0x8256; + + /** Returned by GetIntegerv and related simple queries when {@code value} is {@link #GL_RESET_NOTIFICATION_STRATEGY RESET_NOTIFICATION_STRATEGY}. */ + public static final int + GL_LOSE_CONTEXT_ON_RESET = 0x8252, + GL_NO_RESET_NOTIFICATION = 0x8261; + + /** Returned by GetIntegerv when {@code pname} is CONTEXT_FLAGS. */ + public static final int GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT = 0x4; + + /** Returned by {@link GL11C#glGetError GetError}. */ + public static final int GL_CONTEXT_LOST = 0x507; + + static { GL.initialize(); } + + protected GL45() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glClipControl, caps.glCreateTransformFeedbacks, caps.glTransformFeedbackBufferBase, caps.glTransformFeedbackBufferRange, + caps.glGetTransformFeedbackiv, caps.glGetTransformFeedbacki_v, caps.glGetTransformFeedbacki64_v, caps.glCreateBuffers, caps.glNamedBufferStorage, + caps.glNamedBufferData, caps.glNamedBufferSubData, caps.glCopyNamedBufferSubData, caps.glClearNamedBufferData, caps.glClearNamedBufferSubData, + caps.glMapNamedBuffer, caps.glMapNamedBufferRange, caps.glUnmapNamedBuffer, caps.glFlushMappedNamedBufferRange, caps.glGetNamedBufferParameteriv, + caps.glGetNamedBufferParameteri64v, caps.glGetNamedBufferPointerv, caps.glGetNamedBufferSubData, caps.glCreateFramebuffers, + caps.glNamedFramebufferRenderbuffer, caps.glNamedFramebufferParameteri, caps.glNamedFramebufferTexture, caps.glNamedFramebufferTextureLayer, + caps.glNamedFramebufferDrawBuffer, caps.glNamedFramebufferDrawBuffers, caps.glNamedFramebufferReadBuffer, caps.glInvalidateNamedFramebufferData, + caps.glInvalidateNamedFramebufferSubData, caps.glClearNamedFramebufferiv, caps.glClearNamedFramebufferuiv, caps.glClearNamedFramebufferfv, + caps.glClearNamedFramebufferfi, caps.glBlitNamedFramebuffer, caps.glCheckNamedFramebufferStatus, caps.glGetNamedFramebufferParameteriv, + caps.glGetNamedFramebufferAttachmentParameteriv, caps.glCreateRenderbuffers, caps.glNamedRenderbufferStorage, + caps.glNamedRenderbufferStorageMultisample, caps.glGetNamedRenderbufferParameteriv, caps.glCreateTextures, caps.glTextureBuffer, + caps.glTextureBufferRange, caps.glTextureStorage1D, caps.glTextureStorage2D, caps.glTextureStorage3D, caps.glTextureStorage2DMultisample, + caps.glTextureStorage3DMultisample, caps.glTextureSubImage1D, caps.glTextureSubImage2D, caps.glTextureSubImage3D, + caps.glCompressedTextureSubImage1D, caps.glCompressedTextureSubImage2D, caps.glCompressedTextureSubImage3D, caps.glCopyTextureSubImage1D, + caps.glCopyTextureSubImage2D, caps.glCopyTextureSubImage3D, caps.glTextureParameterf, caps.glTextureParameterfv, caps.glTextureParameteri, + caps.glTextureParameterIiv, caps.glTextureParameterIuiv, caps.glTextureParameteriv, caps.glGenerateTextureMipmap, caps.glBindTextureUnit, + caps.glGetTextureImage, caps.glGetCompressedTextureImage, caps.glGetTextureLevelParameterfv, caps.glGetTextureLevelParameteriv, + caps.glGetTextureParameterfv, caps.glGetTextureParameterIiv, caps.glGetTextureParameterIuiv, caps.glGetTextureParameteriv, + caps.glCreateVertexArrays, caps.glDisableVertexArrayAttrib, caps.glEnableVertexArrayAttrib, caps.glVertexArrayElementBuffer, + caps.glVertexArrayVertexBuffer, caps.glVertexArrayVertexBuffers, caps.glVertexArrayAttribFormat, caps.glVertexArrayAttribIFormat, + caps.glVertexArrayAttribLFormat, caps.glVertexArrayAttribBinding, caps.glVertexArrayBindingDivisor, caps.glGetVertexArrayiv, + caps.glGetVertexArrayIndexediv, caps.glGetVertexArrayIndexed64iv, caps.glCreateSamplers, caps.glCreateProgramPipelines, caps.glCreateQueries, + caps.glGetQueryBufferObjectiv, caps.glGetQueryBufferObjectuiv, caps.glGetQueryBufferObjecti64v, caps.glGetQueryBufferObjectui64v, + caps.glMemoryBarrierByRegion, caps.glGetTextureSubImage, caps.glGetCompressedTextureSubImage, caps.glTextureBarrier, caps.glGetGraphicsResetStatus, + caps.glReadnPixels, caps.glGetnUniformfv, caps.glGetnUniformiv, caps.glGetnUniformuiv + ); + } + + // --- [ glClipControl ] --- + + /** + * Controls the clipping volume behavior. + * + *

These parameters update the clip control origin and depth mode respectively. The initial value of the clip control origin is {@link GL20#GL_LOWER_LEFT LOWER_LEFT} and the + * initial value of the depth mode is {@link GL45C#GL_NEGATIVE_ONE_TO_ONE NEGATIVE_ONE_TO_ONE}.

+ * + *

The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated if ClipControl is executed between the execution of {@link GL11#glBegin Begin} and the corresponding + * execution of {@link GL11#glEnd End}.

+ * + * @param origin the clip origin. One of:
{@link GL20#GL_LOWER_LEFT LOWER_LEFT}{@link GL20#GL_UPPER_LEFT UPPER_LEFT}
+ * @param depth the clip depth mode. One of:
{@link GL45C#GL_NEGATIVE_ONE_TO_ONE NEGATIVE_ONE_TO_ONE}{@link GL45C#GL_ZERO_TO_ONE ZERO_TO_ONE}
+ * + * @see Reference Page + */ + public static void glClipControl(@NativeType("GLenum") int origin, @NativeType("GLenum") int depth) { + GL45C.glClipControl(origin, depth); + } + + // --- [ glCreateTransformFeedbacks ] --- + + /** + * Unsafe version of: {@link #glCreateTransformFeedbacks CreateTransformFeedbacks} + * + * @param n the number of transform feedback object names to create + */ + public static void nglCreateTransformFeedbacks(int n, long ids) { + GL45C.nglCreateTransformFeedbacks(n, ids); + } + + /** + * Returns {@code n} previously unused transform feedback object names in {@code ids}, each representing a new state vector. + * + * @param ids the buffer in which to return the names + * + * @see Reference Page + */ + public static void glCreateTransformFeedbacks(@NativeType("GLuint *") IntBuffer ids) { + GL45C.glCreateTransformFeedbacks(ids); + } + + /** + * Returns {@code n} previously unused transform feedback object names in {@code ids}, each representing a new state vector. + * + * @see Reference Page + */ + @NativeType("void") + public static int glCreateTransformFeedbacks() { + return GL45C.glCreateTransformFeedbacks(); + } + + // --- [ glTransformFeedbackBufferBase ] --- + + /** + * Binds a buffer object to a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param index the transform feedback stream index + * @param buffer the name of an existing buffer object + * + * @see Reference Page + */ + public static void glTransformFeedbackBufferBase(@NativeType("GLuint") int xfb, @NativeType("GLuint") int index, @NativeType("GLuint") int buffer) { + GL45C.glTransformFeedbackBufferBase(xfb, index, buffer); + } + + // --- [ glTransformFeedbackBufferRange ] --- + + /** + * Binds a region of a buffer object to a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param index the transform feedback stream index + * @param buffer the name of an existing buffer object + * @param offset the starting offset in basic machine units into the buffer object + * @param size the amount of data in machine units + * + * @see Reference Page + */ + public static void glTransformFeedbackBufferRange(@NativeType("GLuint") int xfb, @NativeType("GLuint") int index, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size) { + GL45C.glTransformFeedbackBufferRange(xfb, index, buffer, offset, size); + } + + // --- [ glGetTransformFeedbackiv ] --- + + /** Unsafe version of: {@link #glGetTransformFeedbackiv GetTransformFeedbackiv} */ + public static void nglGetTransformFeedbackiv(int xfb, int pname, long param) { + GL45C.nglGetTransformFeedbackiv(xfb, pname, param); + } + + /** + * Returns information about a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param pname the parameter to query. One of:
{@link GL42#GL_TRANSFORM_FEEDBACK_PAUSED TRANSFORM_FEEDBACK_PAUSED}{@link GL42#GL_TRANSFORM_FEEDBACK_ACTIVE TRANSFORM_FEEDBACK_ACTIVE}
+ * @param param the buffer in which to return the parameter value + * + * @see Reference Page + */ + public static void glGetTransformFeedbackiv(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer param) { + GL45C.glGetTransformFeedbackiv(xfb, pname, param); + } + + /** + * Returns information about a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param pname the parameter to query. One of:
{@link GL42#GL_TRANSFORM_FEEDBACK_PAUSED TRANSFORM_FEEDBACK_PAUSED}{@link GL42#GL_TRANSFORM_FEEDBACK_ACTIVE TRANSFORM_FEEDBACK_ACTIVE}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetTransformFeedbacki(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname) { + return GL45C.glGetTransformFeedbacki(xfb, pname); + } + + // --- [ glGetTransformFeedbacki_v ] --- + + /** Unsafe version of: {@link #glGetTransformFeedbacki_v GetTransformFeedbacki_v} */ + public static void nglGetTransformFeedbacki_v(int xfb, int pname, int index, long param) { + GL45C.nglGetTransformFeedbacki_v(xfb, pname, index, param); + } + + /** + * Returns information about a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param pname the parameter to query. Must be:
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER_BINDING TRANSFORM_FEEDBACK_BUFFER_BINDING}
+ * @param index the transform feedback stream index + * @param param the buffer in which to return the parameter value + * + * @see Reference Page + */ + public static void glGetTransformFeedbacki_v(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLint *") IntBuffer param) { + GL45C.glGetTransformFeedbacki_v(xfb, pname, index, param); + } + + /** + * Returns information about a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param pname the parameter to query. Must be:
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER_BINDING TRANSFORM_FEEDBACK_BUFFER_BINDING}
+ * @param index the transform feedback stream index + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetTransformFeedbacki(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLuint") int index) { + return GL45C.glGetTransformFeedbacki(xfb, pname, index); + } + + // --- [ glGetTransformFeedbacki64_v ] --- + + /** Unsafe version of: {@link #glGetTransformFeedbacki64_v GetTransformFeedbacki64_v} */ + public static void nglGetTransformFeedbacki64_v(int xfb, int pname, int index, long param) { + GL45C.nglGetTransformFeedbacki64_v(xfb, pname, index, param); + } + + /** + * Returns information about a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param pname the parameter to query. One of:
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER_START TRANSFORM_FEEDBACK_BUFFER_START}{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER_SIZE TRANSFORM_FEEDBACK_BUFFER_SIZE}
+ * @param index the transform feedback stream index + * @param param the buffer in which to return the parameter value + * + * @see Reference Page + */ + public static void glGetTransformFeedbacki64_v(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLint64 *") LongBuffer param) { + GL45C.glGetTransformFeedbacki64_v(xfb, pname, index, param); + } + + /** + * Returns information about a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param pname the parameter to query. One of:
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER_START TRANSFORM_FEEDBACK_BUFFER_START}{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER_SIZE TRANSFORM_FEEDBACK_BUFFER_SIZE}
+ * @param index the transform feedback stream index + * + * @see Reference Page + */ + @NativeType("void") + public static long glGetTransformFeedbacki64(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLuint") int index) { + return GL45C.glGetTransformFeedbacki64(xfb, pname, index); + } + + // --- [ glCreateBuffers ] --- + + /** + * Unsafe version of: {@link #glCreateBuffers CreateBuffers} + * + * @param n the number of buffer names to create + */ + public static void nglCreateBuffers(int n, long buffers) { + GL45C.nglCreateBuffers(n, buffers); + } + + /** + * Returns {@code n} previously unused buffer names in {@code buffers}, each representing a new buffer object initialized as if it had been bound to an + * unspecified target. + * + * @param buffers the buffer in which to return the names + * + * @see Reference Page + */ + public static void glCreateBuffers(@NativeType("GLuint *") IntBuffer buffers) { + GL45C.glCreateBuffers(buffers); + } + + /** + * Returns {@code n} previously unused buffer names in {@code buffers}, each representing a new buffer object initialized as if it had been bound to an + * unspecified target. + * + * @see Reference Page + */ + @NativeType("void") + public static int glCreateBuffers() { + return GL45C.glCreateBuffers(); + } + + // --- [ glNamedBufferStorage ] --- + + /** + * Unsafe version of: {@link #glNamedBufferStorage NamedBufferStorage} + * + * @param size the size of the data store in basic machine units + */ + public static void nglNamedBufferStorage(int buffer, long size, long data, int flags) { + GL45C.nglNamedBufferStorage(buffer, size, data, flags); + } + + /** + * DSA version of {@link GL44C#glBufferStorage BufferStorage}. + * + * @param buffer the buffer object name + * @param size the size of the data store in basic machine units + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("GLsizeiptr") long size, @NativeType("GLbitfield") int flags) { + GL45C.glNamedBufferStorage(buffer, size, flags); + } + + /** + * DSA version of {@link GL44C#glBufferStorage BufferStorage}. + * + * @param buffer the buffer object name + * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") ByteBuffer data, @NativeType("GLbitfield") int flags) { + GL45C.glNamedBufferStorage(buffer, data, flags); + } + + /** + * DSA version of {@link GL44C#glBufferStorage BufferStorage}. + * + * @param buffer the buffer object name + * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") ShortBuffer data, @NativeType("GLbitfield") int flags) { + GL45C.glNamedBufferStorage(buffer, data, flags); + } + + /** + * DSA version of {@link GL44C#glBufferStorage BufferStorage}. + * + * @param buffer the buffer object name + * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") IntBuffer data, @NativeType("GLbitfield") int flags) { + GL45C.glNamedBufferStorage(buffer, data, flags); + } + + /** + * DSA version of {@link GL44C#glBufferStorage BufferStorage}. + * + * @param buffer the buffer object name + * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") FloatBuffer data, @NativeType("GLbitfield") int flags) { + GL45C.glNamedBufferStorage(buffer, data, flags); + } + + /** + * DSA version of {@link GL44C#glBufferStorage BufferStorage}. + * + * @param buffer the buffer object name + * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") DoubleBuffer data, @NativeType("GLbitfield") int flags) { + GL45C.glNamedBufferStorage(buffer, data, flags); + } + + // --- [ glNamedBufferData ] --- + + /** + * Unsafe version of: {@link #glNamedBufferData NamedBufferData} + * + * @param size the size in bytes of the buffer object's new data store + */ + public static void nglNamedBufferData(int buffer, long size, long data, int usage) { + GL45C.nglNamedBufferData(buffer, size, data, usage); + } + + /** + * DSA version of {@link GL15C#glBufferData BufferData}. + * + * @param size the size in bytes of the buffer object's new data store + * @param usage the expected usage pattern of the data store. One of:
{@link GL15#GL_STREAM_DRAW STREAM_DRAW}{@link GL15#GL_STREAM_READ STREAM_READ}{@link GL15#GL_STREAM_COPY STREAM_COPY}{@link GL15#GL_STATIC_DRAW STATIC_DRAW}{@link GL15#GL_STATIC_READ STATIC_READ}{@link GL15#GL_STATIC_COPY STATIC_COPY}{@link GL15#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, size, usage); + } + + /** + * DSA version of {@link GL15C#glBufferData BufferData}. + * + * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15#GL_STREAM_DRAW STREAM_DRAW}{@link GL15#GL_STREAM_READ STREAM_READ}{@link GL15#GL_STREAM_COPY STREAM_COPY}{@link GL15#GL_STATIC_DRAW STATIC_DRAW}{@link GL15#GL_STATIC_READ STATIC_READ}{@link GL15#GL_STATIC_COPY STATIC_COPY}{@link GL15#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") ByteBuffer data, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, data, usage); + } + + /** + * DSA version of {@link GL15C#glBufferData BufferData}. + * + * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15#GL_STREAM_DRAW STREAM_DRAW}{@link GL15#GL_STREAM_READ STREAM_READ}{@link GL15#GL_STREAM_COPY STREAM_COPY}{@link GL15#GL_STATIC_DRAW STATIC_DRAW}{@link GL15#GL_STATIC_READ STATIC_READ}{@link GL15#GL_STATIC_COPY STATIC_COPY}{@link GL15#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") ShortBuffer data, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, data, usage); + } + + /** + * DSA version of {@link GL15C#glBufferData BufferData}. + * + * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15#GL_STREAM_DRAW STREAM_DRAW}{@link GL15#GL_STREAM_READ STREAM_READ}{@link GL15#GL_STREAM_COPY STREAM_COPY}{@link GL15#GL_STATIC_DRAW STATIC_DRAW}{@link GL15#GL_STATIC_READ STATIC_READ}{@link GL15#GL_STATIC_COPY STATIC_COPY}{@link GL15#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") IntBuffer data, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, data, usage); + } + + /** + * DSA version of {@link GL15C#glBufferData BufferData}. + * + * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15#GL_STREAM_DRAW STREAM_DRAW}{@link GL15#GL_STREAM_READ STREAM_READ}{@link GL15#GL_STREAM_COPY STREAM_COPY}{@link GL15#GL_STATIC_DRAW STATIC_DRAW}{@link GL15#GL_STATIC_READ STATIC_READ}{@link GL15#GL_STATIC_COPY STATIC_COPY}{@link GL15#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") LongBuffer data, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, data, usage); + } + + /** + * DSA version of {@link GL15C#glBufferData BufferData}. + * + * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15#GL_STREAM_DRAW STREAM_DRAW}{@link GL15#GL_STREAM_READ STREAM_READ}{@link GL15#GL_STREAM_COPY STREAM_COPY}{@link GL15#GL_STATIC_DRAW STATIC_DRAW}{@link GL15#GL_STATIC_READ STATIC_READ}{@link GL15#GL_STATIC_COPY STATIC_COPY}{@link GL15#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") FloatBuffer data, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, data, usage); + } + + /** + * DSA version of {@link GL15C#glBufferData BufferData}. + * + * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15#GL_STREAM_DRAW STREAM_DRAW}{@link GL15#GL_STREAM_READ STREAM_READ}{@link GL15#GL_STREAM_COPY STREAM_COPY}{@link GL15#GL_STATIC_DRAW STATIC_DRAW}{@link GL15#GL_STATIC_READ STATIC_READ}{@link GL15#GL_STATIC_COPY STATIC_COPY}{@link GL15#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") DoubleBuffer data, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, data, usage); + } + + // --- [ glNamedBufferSubData ] --- + + /** + * Unsafe version of: {@link #glNamedBufferSubData NamedBufferSubData} + * + * @param size the size in bytes of the data store region being replaced + */ + public static void nglNamedBufferSubData(int buffer, long offset, long size, long data) { + GL45C.nglNamedBufferSubData(buffer, offset, size, data); + } + + /** + * DSA version of {@link GL15C#glBufferSubData BufferSubData}. + * + * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") ByteBuffer data) { + GL45C.glNamedBufferSubData(buffer, offset, data); + } + + /** + * DSA version of {@link GL15C#glBufferSubData BufferSubData}. + * + * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") ShortBuffer data) { + GL45C.glNamedBufferSubData(buffer, offset, data); + } + + /** + * DSA version of {@link GL15C#glBufferSubData BufferSubData}. + * + * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") IntBuffer data) { + GL45C.glNamedBufferSubData(buffer, offset, data); + } + + /** + * DSA version of {@link GL15C#glBufferSubData BufferSubData}. + * + * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") LongBuffer data) { + GL45C.glNamedBufferSubData(buffer, offset, data); + } + + /** + * DSA version of {@link GL15C#glBufferSubData BufferSubData}. + * + * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") FloatBuffer data) { + GL45C.glNamedBufferSubData(buffer, offset, data); + } + + /** + * DSA version of {@link GL15C#glBufferSubData BufferSubData}. + * + * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") DoubleBuffer data) { + GL45C.glNamedBufferSubData(buffer, offset, data); + } + + // --- [ glCopyNamedBufferSubData ] --- + + /** + * DSA version of {@link GL31C#glCopyBufferSubData CopyBufferSubData}. + * + * @param readBuffer the source buffer object name + * @param writeBuffer the destination buffer object name + * @param readOffset the source buffer object offset, in bytes + * @param writeOffset the destination buffer object offset, in bytes + * @param size the number of bytes to copy + * + * @see Reference Page + */ + public static void glCopyNamedBufferSubData(@NativeType("GLuint") int readBuffer, @NativeType("GLuint") int writeBuffer, @NativeType("GLintptr") long readOffset, @NativeType("GLintptr") long writeOffset, @NativeType("GLsizeiptr") long size) { + GL45C.glCopyNamedBufferSubData(readBuffer, writeBuffer, readOffset, writeOffset, size); + } + + // --- [ glClearNamedBufferData ] --- + + /** Unsafe version of: {@link #glClearNamedBufferData ClearNamedBufferData} */ + public static void nglClearNamedBufferData(int buffer, int internalformat, int format, int type, long data) { + GL45C.nglClearNamedBufferData(buffer, internalformat, format, type, data); + } + + /** + * DSA version of {@link GL43C#glClearBufferData ClearBufferData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer data) { + GL45C.glClearNamedBufferData(buffer, internalformat, format, type, data); + } + + /** + * DSA version of {@link GL43C#glClearBufferData ClearBufferData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer data) { + GL45C.glClearNamedBufferData(buffer, internalformat, format, type, data); + } + + /** + * DSA version of {@link GL43C#glClearBufferData ClearBufferData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer data) { + GL45C.glClearNamedBufferData(buffer, internalformat, format, type, data); + } + + /** + * DSA version of {@link GL43C#glClearBufferData ClearBufferData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer data) { + GL45C.glClearNamedBufferData(buffer, internalformat, format, type, data); + } + + // --- [ glClearNamedBufferSubData ] --- + + /** Unsafe version of: {@link #glClearNamedBufferSubData ClearNamedBufferSubData} */ + public static void nglClearNamedBufferSubData(int buffer, int internalformat, long offset, long size, int format, int type, long data) { + GL45C.nglClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); + } + + /** + * DSA version of {@link GL43C#glClearBufferSubData ClearBufferSubData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer data) { + GL45C.glClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); + } + + /** + * DSA version of {@link GL43C#glClearBufferSubData ClearBufferSubData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer data) { + GL45C.glClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); + } + + /** + * DSA version of {@link GL43C#glClearBufferSubData ClearBufferSubData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer data) { + GL45C.glClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); + } + + /** + * DSA version of {@link GL43C#glClearBufferSubData ClearBufferSubData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer data) { + GL45C.glClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); + } + + // --- [ glMapNamedBuffer ] --- + + /** Unsafe version of: {@link #glMapNamedBuffer MapNamedBuffer} */ + public static long nglMapNamedBuffer(int buffer, int access) { + return GL45C.nglMapNamedBuffer(buffer, access); + } + + /** + * DSA version of {@link GL15C#glMapBuffer MapBuffer}. + * + * @param buffer the buffer object name + * @param access the access policy, indicating whether it will be possible to read from, write to, or both read from and write to the buffer object's mapped data store. One of:
{@link GL15#GL_READ_ONLY READ_ONLY}{@link GL15#GL_WRITE_ONLY WRITE_ONLY}{@link GL15#GL_READ_WRITE READ_WRITE}
+ * + * @see Reference Page + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapNamedBuffer(@NativeType("GLuint") int buffer, @NativeType("GLenum") int access) { + return GL45C.glMapNamedBuffer(buffer, access); + } + + /** + * DSA version of {@link GL15C#glMapBuffer MapBuffer}. + * + * @param buffer the buffer object name + * @param access the access policy, indicating whether it will be possible to read from, write to, or both read from and write to the buffer object's mapped data store. One of:
{@link GL15#GL_READ_ONLY READ_ONLY}{@link GL15#GL_WRITE_ONLY WRITE_ONLY}{@link GL15#GL_READ_WRITE READ_WRITE}
+ * + * @see Reference Page + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapNamedBuffer(@NativeType("GLuint") int buffer, @NativeType("GLenum") int access, @Nullable ByteBuffer old_buffer) { + return GL45C.glMapNamedBuffer(buffer, access, old_buffer); + } + + /** + * DSA version of {@link GL15C#glMapBuffer MapBuffer}. + * + * @param buffer the buffer object name + * @param access the access policy, indicating whether it will be possible to read from, write to, or both read from and write to the buffer object's mapped data store. One of:
{@link GL15#GL_READ_ONLY READ_ONLY}{@link GL15#GL_WRITE_ONLY WRITE_ONLY}{@link GL15#GL_READ_WRITE READ_WRITE}
+ * + * @see Reference Page + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapNamedBuffer(@NativeType("GLuint") int buffer, @NativeType("GLenum") int access, long length, @Nullable ByteBuffer old_buffer) { + return GL45C.glMapNamedBuffer(buffer, access, length, old_buffer); + } + + // --- [ glMapNamedBufferRange ] --- + + /** Unsafe version of: {@link #glMapNamedBufferRange MapNamedBufferRange} */ + public static long nglMapNamedBufferRange(int buffer, long offset, long length, int access) { + return GL45C.nglMapNamedBufferRange(buffer, offset, length, access); + } + + /** + * DSA version of {@link GL30C#glMapBufferRange MapBufferRange}. + * + * @param buffer the buffer object name + * @param offset the starting offset within the buffer of the range to be mapped + * @param length the length of the range to be mapped + * @param access a combination of access flags indicating the desired access to the range. One or more of:
{@link GL30#GL_MAP_READ_BIT MAP_READ_BIT}{@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}{@link GL30#GL_MAP_INVALIDATE_RANGE_BIT MAP_INVALIDATE_RANGE_BIT}{@link GL30#GL_MAP_INVALIDATE_BUFFER_BIT MAP_INVALIDATE_BUFFER_BIT}
{@link GL30#GL_MAP_FLUSH_EXPLICIT_BIT MAP_FLUSH_EXPLICIT_BIT}{@link GL30#GL_MAP_UNSYNCHRONIZED_BIT MAP_UNSYNCHRONIZED_BIT}
+ * + * @see Reference Page + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapNamedBufferRange(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length, @NativeType("GLbitfield") int access) { + return GL45C.glMapNamedBufferRange(buffer, offset, length, access); + } + + /** + * DSA version of {@link GL30C#glMapBufferRange MapBufferRange}. + * + * @param buffer the buffer object name + * @param offset the starting offset within the buffer of the range to be mapped + * @param length the length of the range to be mapped + * @param access a combination of access flags indicating the desired access to the range. One or more of:
{@link GL30#GL_MAP_READ_BIT MAP_READ_BIT}{@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}{@link GL30#GL_MAP_INVALIDATE_RANGE_BIT MAP_INVALIDATE_RANGE_BIT}{@link GL30#GL_MAP_INVALIDATE_BUFFER_BIT MAP_INVALIDATE_BUFFER_BIT}
{@link GL30#GL_MAP_FLUSH_EXPLICIT_BIT MAP_FLUSH_EXPLICIT_BIT}{@link GL30#GL_MAP_UNSYNCHRONIZED_BIT MAP_UNSYNCHRONIZED_BIT}
+ * + * @see Reference Page + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapNamedBufferRange(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length, @NativeType("GLbitfield") int access, @Nullable ByteBuffer old_buffer) { + return GL45C.glMapNamedBufferRange(buffer, offset, length, access, old_buffer); + } + + // --- [ glUnmapNamedBuffer ] --- + + /** + * DSA version of {@link GL15C#glUnmapBuffer UnmapBuffer}. + * + * @param buffer the buffer object name + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static boolean glUnmapNamedBuffer(@NativeType("GLuint") int buffer) { + return GL45C.glUnmapNamedBuffer(buffer); + } + + // --- [ glFlushMappedNamedBufferRange ] --- + + /** + * DSA version of {@link GL30C#glFlushMappedBufferRange FlushMappedBufferRange}. + * + * @param buffer the buffer object name + * @param offset the start of the buffer subrange, in basic machine units + * @param length the length of the buffer subrange, in basic machine units + * + * @see Reference Page + */ + public static void glFlushMappedNamedBufferRange(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length) { + GL45C.glFlushMappedNamedBufferRange(buffer, offset, length); + } + + // --- [ glGetNamedBufferParameteriv ] --- + + /** Unsafe version of: {@link #glGetNamedBufferParameteriv GetNamedBufferParameteriv} */ + public static void nglGetNamedBufferParameteriv(int buffer, int pname, long params) { + GL45C.nglGetNamedBufferParameteriv(buffer, pname, params); + } + + /** + * DSA version of {@link GL15C#glGetBufferParameteriv GetBufferParameteriv}. + * + * @param buffer the buffer object name + * @param pname the symbolic name of a buffer object parameter. One of:
{@link GL15#GL_BUFFER_SIZE BUFFER_SIZE}{@link GL15#GL_BUFFER_USAGE BUFFER_USAGE}{@link GL15#GL_BUFFER_ACCESS BUFFER_ACCESS}{@link GL15#GL_BUFFER_MAPPED BUFFER_MAPPED}
{@link GL30#GL_BUFFER_ACCESS_FLAGS BUFFER_ACCESS_FLAGS}{@link GL30#GL_BUFFER_MAP_LENGTH BUFFER_MAP_LENGTH}{@link GL30#GL_BUFFER_MAP_OFFSET BUFFER_MAP_OFFSET}{@link GL44#GL_BUFFER_IMMUTABLE_STORAGE BUFFER_IMMUTABLE_STORAGE}
{@link GL44#GL_BUFFER_STORAGE_FLAGS BUFFER_STORAGE_FLAGS}
+ * @param params the requested parameter + * + * @see Reference Page + */ + public static void glGetNamedBufferParameteriv(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL45C.glGetNamedBufferParameteriv(buffer, pname, params); + } + + /** + * DSA version of {@link GL15C#glGetBufferParameteriv GetBufferParameteriv}. + * + * @param buffer the buffer object name + * @param pname the symbolic name of a buffer object parameter. One of:
{@link GL15#GL_BUFFER_SIZE BUFFER_SIZE}{@link GL15#GL_BUFFER_USAGE BUFFER_USAGE}{@link GL15#GL_BUFFER_ACCESS BUFFER_ACCESS}{@link GL15#GL_BUFFER_MAPPED BUFFER_MAPPED}
{@link GL30#GL_BUFFER_ACCESS_FLAGS BUFFER_ACCESS_FLAGS}{@link GL30#GL_BUFFER_MAP_LENGTH BUFFER_MAP_LENGTH}{@link GL30#GL_BUFFER_MAP_OFFSET BUFFER_MAP_OFFSET}{@link GL44#GL_BUFFER_IMMUTABLE_STORAGE BUFFER_IMMUTABLE_STORAGE}
{@link GL44#GL_BUFFER_STORAGE_FLAGS BUFFER_STORAGE_FLAGS}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetNamedBufferParameteri(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname) { + return GL45C.glGetNamedBufferParameteri(buffer, pname); + } + + // --- [ glGetNamedBufferParameteri64v ] --- + + /** Unsafe version of: {@link #glGetNamedBufferParameteri64v GetNamedBufferParameteri64v} */ + public static void nglGetNamedBufferParameteri64v(int buffer, int pname, long params) { + GL45C.nglGetNamedBufferParameteri64v(buffer, pname, params); + } + + /** + * DSA version of {@link GL32C#glGetBufferParameteri64v GetBufferParameteri64v}. + * + * @param buffer the buffer object name + * @param pname the symbolic name of a buffer object parameter. One of:
{@link GL15#GL_BUFFER_SIZE BUFFER_SIZE}{@link GL15#GL_BUFFER_USAGE BUFFER_USAGE}{@link GL15#GL_BUFFER_ACCESS BUFFER_ACCESS}{@link GL15#GL_BUFFER_MAPPED BUFFER_MAPPED}
{@link GL30#GL_BUFFER_ACCESS_FLAGS BUFFER_ACCESS_FLAGS}{@link GL30#GL_BUFFER_MAP_LENGTH BUFFER_MAP_LENGTH}{@link GL30#GL_BUFFER_MAP_OFFSET BUFFER_MAP_OFFSET}{@link GL44#GL_BUFFER_IMMUTABLE_STORAGE BUFFER_IMMUTABLE_STORAGE}
{@link GL44#GL_BUFFER_STORAGE_FLAGS BUFFER_STORAGE_FLAGS}
+ * @param params the requested parameter + * + * @see Reference Page + */ + public static void glGetNamedBufferParameteri64v(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLint64 *") LongBuffer params) { + GL45C.glGetNamedBufferParameteri64v(buffer, pname, params); + } + + /** + * DSA version of {@link GL32C#glGetBufferParameteri64v GetBufferParameteri64v}. + * + * @param buffer the buffer object name + * @param pname the symbolic name of a buffer object parameter. One of:
{@link GL15#GL_BUFFER_SIZE BUFFER_SIZE}{@link GL15#GL_BUFFER_USAGE BUFFER_USAGE}{@link GL15#GL_BUFFER_ACCESS BUFFER_ACCESS}{@link GL15#GL_BUFFER_MAPPED BUFFER_MAPPED}
{@link GL30#GL_BUFFER_ACCESS_FLAGS BUFFER_ACCESS_FLAGS}{@link GL30#GL_BUFFER_MAP_LENGTH BUFFER_MAP_LENGTH}{@link GL30#GL_BUFFER_MAP_OFFSET BUFFER_MAP_OFFSET}{@link GL44#GL_BUFFER_IMMUTABLE_STORAGE BUFFER_IMMUTABLE_STORAGE}
{@link GL44#GL_BUFFER_STORAGE_FLAGS BUFFER_STORAGE_FLAGS}
+ * + * @see Reference Page + */ + @NativeType("void") + public static long glGetNamedBufferParameteri64(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname) { + return GL45C.glGetNamedBufferParameteri64(buffer, pname); + } + + // --- [ glGetNamedBufferPointerv ] --- + + /** Unsafe version of: {@link #glGetNamedBufferPointerv GetNamedBufferPointerv} */ + public static void nglGetNamedBufferPointerv(int buffer, int pname, long params) { + GL45C.nglGetNamedBufferPointerv(buffer, pname, params); + } + + /** + * DSA version of {@link GL15C#glGetBufferPointerv GetBufferPointerv}. + * + * @param buffer the buffer object name + * @param pname the pointer to be returned. Must be:
{@link GL15#GL_BUFFER_MAP_POINTER BUFFER_MAP_POINTER}
+ * @param params the pointer value specified by {@code pname} + * + * @see Reference Page + */ + public static void glGetNamedBufferPointerv(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("void **") PointerBuffer params) { + GL45C.glGetNamedBufferPointerv(buffer, pname, params); + } + + /** + * DSA version of {@link GL15C#glGetBufferPointerv GetBufferPointerv}. + * + * @param buffer the buffer object name + * @param pname the pointer to be returned. Must be:
{@link GL15#GL_BUFFER_MAP_POINTER BUFFER_MAP_POINTER}
+ * + * @see Reference Page + */ + @NativeType("void") + public static long glGetNamedBufferPointer(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname) { + return GL45C.glGetNamedBufferPointer(buffer, pname); + } + + // --- [ glGetNamedBufferSubData ] --- + + /** + * Unsafe version of: {@link #glGetNamedBufferSubData GetNamedBufferSubData} + * + * @param size the size in bytes of the data store region being returned + */ + public static void nglGetNamedBufferSubData(int buffer, long offset, long size, long data) { + GL45C.nglGetNamedBufferSubData(buffer, offset, size, data); + } + + /** + * DSA version of {@link GL15C#glGetBufferSubData GetBufferSubData}. + * + * @param buffer the buffer object name + * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") ByteBuffer data) { + GL45C.glGetNamedBufferSubData(buffer, offset, data); + } + + /** + * DSA version of {@link GL15C#glGetBufferSubData GetBufferSubData}. + * + * @param buffer the buffer object name + * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") ShortBuffer data) { + GL45C.glGetNamedBufferSubData(buffer, offset, data); + } + + /** + * DSA version of {@link GL15C#glGetBufferSubData GetBufferSubData}. + * + * @param buffer the buffer object name + * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") IntBuffer data) { + GL45C.glGetNamedBufferSubData(buffer, offset, data); + } + + /** + * DSA version of {@link GL15C#glGetBufferSubData GetBufferSubData}. + * + * @param buffer the buffer object name + * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") LongBuffer data) { + GL45C.glGetNamedBufferSubData(buffer, offset, data); + } + + /** + * DSA version of {@link GL15C#glGetBufferSubData GetBufferSubData}. + * + * @param buffer the buffer object name + * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") FloatBuffer data) { + GL45C.glGetNamedBufferSubData(buffer, offset, data); + } + + /** + * DSA version of {@link GL15C#glGetBufferSubData GetBufferSubData}. + * + * @param buffer the buffer object name + * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") DoubleBuffer data) { + GL45C.glGetNamedBufferSubData(buffer, offset, data); + } + + // --- [ glCreateFramebuffers ] --- + + /** + * Unsafe version of: {@link #glCreateFramebuffers CreateFramebuffers} + * + * @param n the number of framebuffer names to create + */ + public static void nglCreateFramebuffers(int n, long framebuffers) { + GL45C.nglCreateFramebuffers(n, framebuffers); + } + + /** + * Returns {@code n} previously unused framebuffer names in {@code framebuffers}, each representing a new framebuffer object. + * + * @param framebuffers the buffer in which to store the framebuffer names + * + * @see Reference Page + */ + public static void glCreateFramebuffers(@NativeType("GLuint *") IntBuffer framebuffers) { + GL45C.glCreateFramebuffers(framebuffers); + } + + /** + * Returns {@code n} previously unused framebuffer names in {@code framebuffers}, each representing a new framebuffer object. + * + * @see Reference Page + */ + @NativeType("void") + public static int glCreateFramebuffers() { + return GL45C.glCreateFramebuffers(); + } + + // --- [ glNamedFramebufferRenderbuffer ] --- + + /** + * DSA version of {@link GL30C#glFramebufferRenderbuffer FramebufferRenderbuffer}. + * + * @param framebuffer the framebuffer name + * @param attachment the attachment point of the framebuffer. One of:
{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param renderbuffertarget the renderbuffer target. Must be:
{@link GL30#GL_RENDERBUFFER RENDERBUFFER}
+ * @param renderbuffer the name of an existing renderbuffer object of type {@code renderbuffertarget} to attach + * + * @see Reference Page + */ + public static void glNamedFramebufferRenderbuffer(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLenum") int renderbuffertarget, @NativeType("GLuint") int renderbuffer) { + GL45C.glNamedFramebufferRenderbuffer(framebuffer, attachment, renderbuffertarget, renderbuffer); + } + + // --- [ glNamedFramebufferParameteri ] --- + + /** + * DSA version of {@link GL43C#glFramebufferParameteri FramebufferParameteri}. + * + * @param framebuffer the framebuffer name + * @param pname a token indicating the parameter to be modified. One of:
{@link GL43#GL_FRAMEBUFFER_DEFAULT_WIDTH FRAMEBUFFER_DEFAULT_WIDTH}{@link GL43#GL_FRAMEBUFFER_DEFAULT_HEIGHT FRAMEBUFFER_DEFAULT_HEIGHT}
{@link GL43#GL_FRAMEBUFFER_DEFAULT_LAYERS FRAMEBUFFER_DEFAULT_LAYERS}{@link GL43#GL_FRAMEBUFFER_DEFAULT_SAMPLES FRAMEBUFFER_DEFAULT_SAMPLES}
{@link GL43#GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS}
+ * @param param the new value for the parameter named {@code pname} + * + * @see Reference Page + */ + public static void glNamedFramebufferParameteri(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int pname, @NativeType("GLint") int param) { + GL45C.glNamedFramebufferParameteri(framebuffer, pname, param); + } + + // --- [ glNamedFramebufferTexture ] --- + + /** + * DSA version of {@link GL32C#glFramebufferTexture FramebufferTexture}. + * + * @param framebuffer the framebuffer name + * @param attachment the attachment point of the framebuffer + * @param texture the texture object to attach to the framebuffer attachment point named by {@code attachment} + * @param level the mipmap level of {@code texture} to attach + * + * @see Reference Page + */ + public static void glNamedFramebufferTexture(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level) { + GL45C.glNamedFramebufferTexture(framebuffer, attachment, texture, level); + } + + // --- [ glNamedFramebufferTextureLayer ] --- + + /** + * DSA version of {@link GL30C#glFramebufferTextureLayer FramebufferTextureLayer}. + * + * @param framebuffer the framebuffer name + * @param attachment the attachment point of the framebuffer. One of:
{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param texture the texture object to attach to the framebuffer attachment point named by {@code attachment} + * @param level the mipmap level of {@code texture} to attach + * @param layer the layer of {@code texture} to attach. + * + * @see Reference Page + */ + public static void glNamedFramebufferTextureLayer(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int layer) { + GL45C.glNamedFramebufferTextureLayer(framebuffer, attachment, texture, level, layer); + } + + // --- [ glNamedFramebufferDrawBuffer ] --- + + /** + * DSA version of {@link GL11C#glDrawBuffer DrawBuffer}. + * + * @param framebuffer the framebuffer name + * @param buf the color buffer to draw to. One of:
{@link GL11#GL_NONE NONE}{@link GL11#GL_FRONT_LEFT FRONT_LEFT}{@link GL11#GL_FRONT_RIGHT FRONT_RIGHT}{@link GL11#GL_BACK_LEFT BACK_LEFT}{@link GL11#GL_BACK_RIGHT BACK_RIGHT}{@link GL11#GL_FRONT FRONT}{@link GL11#GL_BACK BACK}{@link GL11#GL_LEFT LEFT}
{@link GL11#GL_RIGHT RIGHT}{@link GL11#GL_FRONT_AND_BACK FRONT_AND_BACK}{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}GL30.GL_COLOR_ATTACHMENT[1-15]
+ * + * @see Reference Page + */ + public static void glNamedFramebufferDrawBuffer(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buf) { + GL45C.glNamedFramebufferDrawBuffer(framebuffer, buf); + } + + // --- [ glNamedFramebufferDrawBuffers ] --- + + /** + * Unsafe version of: {@link #glNamedFramebufferDrawBuffers NamedFramebufferDrawBuffers} + * + * @param n the number of buffers in {@code bufs} + */ + public static void nglNamedFramebufferDrawBuffers(int framebuffer, int n, long bufs) { + GL45C.nglNamedFramebufferDrawBuffers(framebuffer, n, bufs); + } + + /** + * DSA version of {@link GL20C#glDrawBuffers DrawBuffers}. + * + * @param framebuffer the framebuffer name + * @param bufs an array of symbolic constants specifying the buffers into which fragment colors or data values will be written. One of:
{@link GL11#GL_NONE NONE}{@link GL11#GL_FRONT_LEFT FRONT_LEFT}{@link GL11#GL_FRONT_RIGHT FRONT_RIGHT}{@link GL11#GL_BACK_LEFT BACK_LEFT}{@link GL11#GL_BACK_RIGHT BACK_RIGHT}{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}
GL30.GL_COLOR_ATTACHMENT[1-15]
+ * + * @see Reference Page + */ + public static void glNamedFramebufferDrawBuffers(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") IntBuffer bufs) { + GL45C.glNamedFramebufferDrawBuffers(framebuffer, bufs); + } + + /** + * DSA version of {@link GL20C#glDrawBuffers DrawBuffers}. + * + * @param framebuffer the framebuffer name + * + * @see Reference Page + */ + public static void glNamedFramebufferDrawBuffers(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") int buf) { + GL45C.glNamedFramebufferDrawBuffers(framebuffer, buf); + } + + // --- [ glNamedFramebufferReadBuffer ] --- + + /** + * DSA version of {@link GL11C#glReadBuffer ReadBuffer}. + * + * @param framebuffer the framebuffer name + * @param src the color buffer to read from. One of:
{@link GL11#GL_NONE NONE}{@link GL11#GL_FRONT_LEFT FRONT_LEFT}{@link GL11#GL_FRONT_RIGHT FRONT_RIGHT}{@link GL11#GL_BACK_LEFT BACK_LEFT}{@link GL11#GL_BACK_RIGHT BACK_RIGHT}{@link GL11#GL_FRONT FRONT}{@link GL11#GL_BACK BACK}{@link GL11#GL_LEFT LEFT}
{@link GL11#GL_RIGHT RIGHT}{@link GL11#GL_FRONT_AND_BACK FRONT_AND_BACK}{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}GL30.GL_COLOR_ATTACHMENT[1-15]
+ * + * @see Reference Page + */ + public static void glNamedFramebufferReadBuffer(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int src) { + GL45C.glNamedFramebufferReadBuffer(framebuffer, src); + } + + // --- [ glInvalidateNamedFramebufferData ] --- + + /** + * Unsafe version of: {@link #glInvalidateNamedFramebufferData InvalidateNamedFramebufferData} + * + * @param numAttachments the number of entries in the {@code attachments} array + */ + public static void nglInvalidateNamedFramebufferData(int framebuffer, int numAttachments, long attachments) { + GL45C.nglInvalidateNamedFramebufferData(framebuffer, numAttachments, attachments); + } + + /** + * DSA version of {@link GL43C#glInvalidateFramebuffer InvalidateFramebuffer}. + * + * @param framebuffer the framebuffer name + * @param attachments the address of an array identifying the attachments to be invalidated + * + * @see Reference Page + */ + public static void glInvalidateNamedFramebufferData(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") IntBuffer attachments) { + GL45C.glInvalidateNamedFramebufferData(framebuffer, attachments); + } + + /** + * DSA version of {@link GL43C#glInvalidateFramebuffer InvalidateFramebuffer}. + * + * @param framebuffer the framebuffer name + * + * @see Reference Page + */ + public static void glInvalidateNamedFramebufferData(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") int attachment) { + GL45C.glInvalidateNamedFramebufferData(framebuffer, attachment); + } + + // --- [ glInvalidateNamedFramebufferSubData ] --- + + /** + * Unsafe version of: {@link #glInvalidateNamedFramebufferSubData InvalidateNamedFramebufferSubData} + * + * @param numAttachments the number of entries in the {@code attachments} array + */ + public static void nglInvalidateNamedFramebufferSubData(int framebuffer, int numAttachments, long attachments, int x, int y, int width, int height) { + GL45C.nglInvalidateNamedFramebufferSubData(framebuffer, numAttachments, attachments, x, y, width, height); + } + + /** + * DSA version of {@link GL43C#glInvalidateSubFramebuffer InvalidateSubFramebuffer}. + * + * @param framebuffer the framebuffer name + * @param attachments an array identifying the attachments to be invalidated + * @param x the X offset of the region to be invalidated + * @param y the Y offset of the region to be invalidated + * @param width the width of the region to be invalidated + * @param height the height of the region to be invalidated + * + * @see Reference Page + */ + public static void glInvalidateNamedFramebufferSubData(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") IntBuffer attachments, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL45C.glInvalidateNamedFramebufferSubData(framebuffer, attachments, x, y, width, height); + } + + /** + * DSA version of {@link GL43C#glInvalidateSubFramebuffer InvalidateSubFramebuffer}. + * + * @param framebuffer the framebuffer name + * @param x the X offset of the region to be invalidated + * @param y the Y offset of the region to be invalidated + * @param width the width of the region to be invalidated + * @param height the height of the region to be invalidated + * + * @see Reference Page + */ + public static void glInvalidateNamedFramebufferSubData(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") int attachment, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL45C.glInvalidateNamedFramebufferSubData(framebuffer, attachment, x, y, width, height); + } + + // --- [ glClearNamedFramebufferiv ] --- + + /** Unsafe version of: {@link #glClearNamedFramebufferiv ClearNamedFramebufferiv} */ + public static void nglClearNamedFramebufferiv(int framebuffer, int buffer, int drawbuffer, long value) { + GL45C.nglClearNamedFramebufferiv(framebuffer, buffer, drawbuffer, value); + } + + /** + * DSA version of {@link GL30C#glClearBufferiv ClearBufferiv}. + * + * @param framebuffer the framebuffer name + * @param buffer the buffer to clear. One of:
{@link GL11#GL_COLOR COLOR}{@link GL11#GL_STENCIL STENCIL}
+ * @param drawbuffer the draw buffer to clear + * @param value for color buffers, a pointer to a four-element vector specifying R, G, B and A values to clear the buffer to. For stencil buffers, a pointer to a + * single stencil value to clear the buffer to. + * + * @see Reference Page + */ + public static void glClearNamedFramebufferiv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLint *") IntBuffer value) { + GL45C.glClearNamedFramebufferiv(framebuffer, buffer, drawbuffer, value); + } + + // --- [ glClearNamedFramebufferuiv ] --- + + /** Unsafe version of: {@link #glClearNamedFramebufferuiv ClearNamedFramebufferuiv} */ + public static void nglClearNamedFramebufferuiv(int framebuffer, int buffer, int drawbuffer, long value) { + GL45C.nglClearNamedFramebufferuiv(framebuffer, buffer, drawbuffer, value); + } + + /** + * DSA version of {@link GL30C#glClearBufferuiv ClearBufferuiv}. + * + * @param framebuffer the framebuffer name + * @param buffer the buffer to clear. Must be:
{@link GL11#GL_COLOR COLOR}
+ * @param drawbuffer the draw buffer to clear + * @param value a pointer to a four-element vector specifying R, G, B and A values to clear the buffer to + * + * @see Reference Page + */ + public static void glClearNamedFramebufferuiv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLint *") IntBuffer value) { + GL45C.glClearNamedFramebufferuiv(framebuffer, buffer, drawbuffer, value); + } + + // --- [ glClearNamedFramebufferfv ] --- + + /** Unsafe version of: {@link #glClearNamedFramebufferfv ClearNamedFramebufferfv} */ + public static void nglClearNamedFramebufferfv(int framebuffer, int buffer, int drawbuffer, long value) { + GL45C.nglClearNamedFramebufferfv(framebuffer, buffer, drawbuffer, value); + } + + /** + * DSA version of {@link GL30C#glClearBufferfv ClearBufferfv}. + * + * @param framebuffer the framebuffer name + * @param buffer the buffer to clear. One of:
{@link GL11#GL_COLOR COLOR}{@link GL11#GL_DEPTH DEPTH}
+ * @param drawbuffer the draw buffer to clear + * @param value for color buffers, a pointer to a four-element vector specifying R, G, B and A values to clear the buffer to. For depth buffers, a pointer to a + * single depth value to clear the buffer to. + * + * @see Reference Page + */ + public static void glClearNamedFramebufferfv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLfloat *") FloatBuffer value) { + GL45C.glClearNamedFramebufferfv(framebuffer, buffer, drawbuffer, value); + } + + // --- [ glClearNamedFramebufferfi ] --- + + /** + * DSA version of {@link GL30C#glClearBufferfi ClearBufferfi}. + * + * @param framebuffer the framebuffer name + * @param buffer the buffer to clear. Must be:
{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param drawbuffer the draw buffer to clear + * @param depth the depth value to clear the buffer to + * @param stencil the stencil value to clear the buffer to + * + * @see Reference Page + */ + public static void glClearNamedFramebufferfi(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLfloat") float depth, @NativeType("GLint") int stencil) { + GL45C.glClearNamedFramebufferfi(framebuffer, buffer, drawbuffer, depth, stencil); + } + + // --- [ glBlitNamedFramebuffer ] --- + + /** + * DSA version of {@link GL30C#glBlitFramebuffer BlitFramebuffer}. + * + * @param readFramebuffer the source framebuffer name + * @param drawFramebuffer the destination framebuffer name + * @param srcX0 the lower-left coordinate of the source rectangle within the read buffer + * @param srcY0 the upper-left coordinate of the source rectangle within the read buffer + * @param srcX1 the lower-right coordinate of the source rectangle within the read buffer + * @param srcY1 the upper-right coordinate of the source rectangle within the read buffer + * @param dstX0 the lower-left coordinate of the destination rectangle within the write buffer + * @param dstY0 the upper-left coordinate of the destination rectangle within the write buffer + * @param dstX1 the lower-right coordinate of the destination rectangle within the write buffer + * @param dstY1 the upper-right coordinate of the destination rectangle within the write buffer + * @param mask the bitwise OR of the flags indicating which buffers are to be copied. One of:
{@link GL11#GL_COLOR_BUFFER_BIT COLOR_BUFFER_BIT}{@link GL11#GL_DEPTH_BUFFER_BIT DEPTH_BUFFER_BIT}{@link GL11#GL_STENCIL_BUFFER_BIT STENCIL_BUFFER_BIT}
+ * @param filter the interpolation to be applied if the image is stretched. One of:
{@link GL11#GL_NEAREST NEAREST}{@link GL11#GL_LINEAR LINEAR}
+ * + * @see Reference Page + */ + public static void glBlitNamedFramebuffer(@NativeType("GLuint") int readFramebuffer, @NativeType("GLuint") int drawFramebuffer, @NativeType("GLint") int srcX0, @NativeType("GLint") int srcY0, @NativeType("GLint") int srcX1, @NativeType("GLint") int srcY1, @NativeType("GLint") int dstX0, @NativeType("GLint") int dstY0, @NativeType("GLint") int dstX1, @NativeType("GLint") int dstY1, @NativeType("GLbitfield") int mask, @NativeType("GLenum") int filter) { + GL45C.glBlitNamedFramebuffer(readFramebuffer, drawFramebuffer, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter); + } + + // --- [ glCheckNamedFramebufferStatus ] --- + + /** + * DSA version of {@link GL30C#glCheckFramebufferStatus CheckFramebufferStatus}. + * + * @param framebuffer the framebuffer name + * @param target the target of the framebuffer completeness check. One of:
{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * + * @see Reference Page + */ + @NativeType("GLenum") + public static int glCheckNamedFramebufferStatus(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int target) { + return GL45C.glCheckNamedFramebufferStatus(framebuffer, target); + } + + // --- [ glGetNamedFramebufferParameteriv ] --- + + /** Unsafe version of: {@link #glGetNamedFramebufferParameteriv GetNamedFramebufferParameteriv} */ + public static void nglGetNamedFramebufferParameteriv(int framebuffer, int pname, long params) { + GL45C.nglGetNamedFramebufferParameteriv(framebuffer, pname, params); + } + + /** + * DSA version of {@link GL43C#glGetFramebufferParameteriv GetFramebufferParameteriv}. + * + * @param framebuffer the framebuffer name + * @param pname a token indicating the parameter to be retrieved. One of:
{@link GL43#GL_FRAMEBUFFER_DEFAULT_WIDTH FRAMEBUFFER_DEFAULT_WIDTH}{@link GL43#GL_FRAMEBUFFER_DEFAULT_HEIGHT FRAMEBUFFER_DEFAULT_HEIGHT}
{@link GL43#GL_FRAMEBUFFER_DEFAULT_LAYERS FRAMEBUFFER_DEFAULT_LAYERS}{@link GL43#GL_FRAMEBUFFER_DEFAULT_SAMPLES FRAMEBUFFER_DEFAULT_SAMPLES}
{@link GL43#GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS}
+ * @param params a variable to receive the value of the parameter named {@code pname} + * + * @see Reference Page + */ + public static void glGetNamedFramebufferParameteriv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL45C.glGetNamedFramebufferParameteriv(framebuffer, pname, params); + } + + /** + * DSA version of {@link GL43C#glGetFramebufferParameteriv GetFramebufferParameteriv}. + * + * @param framebuffer the framebuffer name + * @param pname a token indicating the parameter to be retrieved. One of:
{@link GL43#GL_FRAMEBUFFER_DEFAULT_WIDTH FRAMEBUFFER_DEFAULT_WIDTH}{@link GL43#GL_FRAMEBUFFER_DEFAULT_HEIGHT FRAMEBUFFER_DEFAULT_HEIGHT}
{@link GL43#GL_FRAMEBUFFER_DEFAULT_LAYERS FRAMEBUFFER_DEFAULT_LAYERS}{@link GL43#GL_FRAMEBUFFER_DEFAULT_SAMPLES FRAMEBUFFER_DEFAULT_SAMPLES}
{@link GL43#GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetNamedFramebufferParameteri(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int pname) { + return GL45C.glGetNamedFramebufferParameteri(framebuffer, pname); + } + + // --- [ glGetNamedFramebufferAttachmentParameteriv ] --- + + /** Unsafe version of: {@link #glGetNamedFramebufferAttachmentParameteriv GetNamedFramebufferAttachmentParameteriv} */ + public static void nglGetNamedFramebufferAttachmentParameteriv(int framebuffer, int attachment, int pname, long params) { + GL45C.nglGetNamedFramebufferAttachmentParameteriv(framebuffer, attachment, pname, params); + } + + /** + * DSA version of {@link GL30C#glGetFramebufferAttachmentParameteriv GetFramebufferAttachmentParameteriv}. + * + * @param framebuffer the framebuffer name + * @param attachment the attachment within {@code target}. One of:
{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param pname the parameter of {@code attachment} to query. One of:
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME FRAMEBUFFER_ATTACHMENT_OBJECT_NAME}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE FRAMEBUFFER_ATTACHMENT_RED_SIZE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE FRAMEBUFFER_ATTACHMENT_GREEN_SIZE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE FRAMEBUFFER_ATTACHMENT_BLUE_SIZE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE}
+ * @param params an array to receive the value of the queried parameter + * + * @see Reference Page + */ + public static void glGetNamedFramebufferAttachmentParameteriv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL45C.glGetNamedFramebufferAttachmentParameteriv(framebuffer, attachment, pname, params); + } + + /** + * DSA version of {@link GL30C#glGetFramebufferAttachmentParameteriv GetFramebufferAttachmentParameteriv}. + * + * @param framebuffer the framebuffer name + * @param attachment the attachment within {@code target}. One of:
{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param pname the parameter of {@code attachment} to query. One of:
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME FRAMEBUFFER_ATTACHMENT_OBJECT_NAME}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE FRAMEBUFFER_ATTACHMENT_RED_SIZE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE FRAMEBUFFER_ATTACHMENT_GREEN_SIZE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE FRAMEBUFFER_ATTACHMENT_BLUE_SIZE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetNamedFramebufferAttachmentParameteri(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname) { + return GL45C.glGetNamedFramebufferAttachmentParameteri(framebuffer, attachment, pname); + } + + // --- [ glCreateRenderbuffers ] --- + + /** + * Unsafe version of: {@link #glCreateRenderbuffers CreateRenderbuffers} + * + * @param n the number of renderbuffer names to create + */ + public static void nglCreateRenderbuffers(int n, long renderbuffers) { + GL45C.nglCreateRenderbuffers(n, renderbuffers); + } + + /** + * Returns {@code n} previously unused renderbuffer names in {@code renderbuffers}, each representing a new renderbuffer object. + * + * @param renderbuffers the buffer in which to store the created renderbuffer names + * + * @see Reference Page + */ + public static void glCreateRenderbuffers(@NativeType("GLuint *") IntBuffer renderbuffers) { + GL45C.glCreateRenderbuffers(renderbuffers); + } + + /** + * Returns {@code n} previously unused renderbuffer names in {@code renderbuffers}, each representing a new renderbuffer object. + * + * @see Reference Page + */ + @NativeType("void") + public static int glCreateRenderbuffers() { + return GL45C.glCreateRenderbuffers(); + } + + // --- [ glNamedRenderbufferStorage ] --- + + /** + * DSA version of {@link GL30C#glRenderbufferStorage RenderbufferStorage}. + * + * @param internalformat the internal format to use for the renderbuffer object's image. Must be a color-renderable, depth-renderable, or stencil-renderable format. + * @param width the width of the renderbuffer, in pixels + * @param height the height of the renderbuffer, in pixels + * + * @see Reference Page + */ + public static void glNamedRenderbufferStorage(@NativeType("GLuint") int renderbuffer, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL45C.glNamedRenderbufferStorage(renderbuffer, internalformat, width, height); + } + + // --- [ glNamedRenderbufferStorageMultisample ] --- + + /** + * DSA version of {@link GL30C#glRenderbufferStorageMultisample RenderbufferStorageMultisample}. + * + * @param samples the number of samples to be used for the renderbuffer object's storage + * @param internalformat the internal format to use for the renderbuffer object's image. Must be a color-renderable, depth-renderable, or stencil-renderable format. + * @param width the width of the renderbuffer, in pixels + * @param height the height of the renderbuffer, in pixels + * + * @see Reference Page + */ + public static void glNamedRenderbufferStorageMultisample(@NativeType("GLuint") int renderbuffer, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL45C.glNamedRenderbufferStorageMultisample(renderbuffer, samples, internalformat, width, height); + } + + // --- [ glGetNamedRenderbufferParameteriv ] --- + + /** Unsafe version of: {@link #glGetNamedRenderbufferParameteriv GetNamedRenderbufferParameteriv} */ + public static void nglGetNamedRenderbufferParameteriv(int renderbuffer, int pname, long params) { + GL45C.nglGetNamedRenderbufferParameteriv(renderbuffer, pname, params); + } + + /** + * DSA version of {@link GL30C#glGetRenderbufferParameteriv GetRenderbufferParameteriv}. + * + * @param pname the parameter whose value to retrieve from the renderbuffer bound to {@code target}. One of:
{@link GL30#GL_RENDERBUFFER_WIDTH RENDERBUFFER_WIDTH}{@link GL30#GL_RENDERBUFFER_HEIGHT RENDERBUFFER_HEIGHT}{@link GL30#GL_RENDERBUFFER_INTERNAL_FORMAT RENDERBUFFER_INTERNAL_FORMAT}
{@link GL30#GL_RENDERBUFFER_RED_SIZE RENDERBUFFER_RED_SIZE}{@link GL30#GL_RENDERBUFFER_GREEN_SIZE RENDERBUFFER_GREEN_SIZE}{@link GL30#GL_RENDERBUFFER_BLUE_SIZE RENDERBUFFER_BLUE_SIZE}
{@link GL30#GL_RENDERBUFFER_ALPHA_SIZE RENDERBUFFER_ALPHA_SIZE}{@link GL30#GL_RENDERBUFFER_DEPTH_SIZE RENDERBUFFER_DEPTH_SIZE}{@link GL30#GL_RENDERBUFFER_STENCIL_SIZE RENDERBUFFER_STENCIL_SIZE}
{@link GL30#GL_RENDERBUFFER_SAMPLES RENDERBUFFER_SAMPLES}
+ * @param params an array to receive the value of the queried parameter + * + * @see Reference Page + */ + public static void glGetNamedRenderbufferParameteriv(@NativeType("GLuint") int renderbuffer, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL45C.glGetNamedRenderbufferParameteriv(renderbuffer, pname, params); + } + + /** + * DSA version of {@link GL30C#glGetRenderbufferParameteriv GetRenderbufferParameteriv}. + * + * @param pname the parameter whose value to retrieve from the renderbuffer bound to {@code target}. One of:
{@link GL30#GL_RENDERBUFFER_WIDTH RENDERBUFFER_WIDTH}{@link GL30#GL_RENDERBUFFER_HEIGHT RENDERBUFFER_HEIGHT}{@link GL30#GL_RENDERBUFFER_INTERNAL_FORMAT RENDERBUFFER_INTERNAL_FORMAT}
{@link GL30#GL_RENDERBUFFER_RED_SIZE RENDERBUFFER_RED_SIZE}{@link GL30#GL_RENDERBUFFER_GREEN_SIZE RENDERBUFFER_GREEN_SIZE}{@link GL30#GL_RENDERBUFFER_BLUE_SIZE RENDERBUFFER_BLUE_SIZE}
{@link GL30#GL_RENDERBUFFER_ALPHA_SIZE RENDERBUFFER_ALPHA_SIZE}{@link GL30#GL_RENDERBUFFER_DEPTH_SIZE RENDERBUFFER_DEPTH_SIZE}{@link GL30#GL_RENDERBUFFER_STENCIL_SIZE RENDERBUFFER_STENCIL_SIZE}
{@link GL30#GL_RENDERBUFFER_SAMPLES RENDERBUFFER_SAMPLES}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetNamedRenderbufferParameteri(@NativeType("GLuint") int renderbuffer, @NativeType("GLenum") int pname) { + return GL45C.glGetNamedRenderbufferParameteri(renderbuffer, pname); + } + + // --- [ glCreateTextures ] --- + + /** + * Unsafe version of: {@link #glCreateTextures CreateTextures} + * + * @param n the number of texture names to create + */ + public static void nglCreateTextures(int target, int n, long textures) { + GL45C.nglCreateTextures(target, n, textures); + } + + /** + * Returns {@code n} previously unused texture names in {@code textures}, each representing a new texture object. + * + * @param target the texture target. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param textures the buffer in which to store the created texture names + * + * @see Reference Page + */ + public static void glCreateTextures(@NativeType("GLenum") int target, @NativeType("GLuint *") IntBuffer textures) { + GL45C.glCreateTextures(target, textures); + } + + /** + * Returns {@code n} previously unused texture names in {@code textures}, each representing a new texture object. + * + * @param target the texture target. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glCreateTextures(@NativeType("GLenum") int target) { + return GL45C.glCreateTextures(target); + } + + // --- [ glTextureBuffer ] --- + + /** + * DSA version of {@link GL31C#glTexBuffer TexBuffer}. + * + * @param texture the texture name + * @param internalformat the sized internal format of the data in the store belonging to {@code buffer} + * @param buffer the name of the buffer object whose storage to attach to the active buffer texture + * + * @see Reference Page + */ + public static void glTextureBuffer(@NativeType("GLuint") int texture, @NativeType("GLenum") int internalformat, @NativeType("GLuint") int buffer) { + GL45C.glTextureBuffer(texture, internalformat, buffer); + } + + // --- [ glTextureBufferRange ] --- + + /** + * DSA version of {@link GL43C#glTexBufferRange TexBufferRange}. + * + * @param texture the texture name + * @param internalformat the internal format of the data in the store belonging to {@code buffer} + * @param buffer the name of the buffer object whose storage to attach to the active buffer texture + * @param offset the offset of the start of the range of the buffer's data store to attach + * @param size the size of the range of the buffer's data store to attach + * + * @see Reference Page + */ + public static void glTextureBufferRange(@NativeType("GLuint") int texture, @NativeType("GLenum") int internalformat, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size) { + GL45C.glTextureBufferRange(texture, internalformat, buffer, offset, size); + } + + // --- [ glTextureStorage1D ] --- + + /** + * DSA version of {@link GL42C#glTexStorage1D TexStorage1D}. + * + * @param texture the texture name + * @param levels the number of texture levels + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * + * @see Reference Page + */ + public static void glTextureStorage1D(@NativeType("GLuint") int texture, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width) { + GL45C.glTextureStorage1D(texture, levels, internalformat, width); + } + + // --- [ glTextureStorage2D ] --- + + /** + * DSA version of {@link GL42C#glTexStorage2D TexStorage2D}. + * + * @param texture the texture name + * @param levels the number of texture levels + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * + * @see Reference Page + */ + public static void glTextureStorage2D(@NativeType("GLuint") int texture, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL45C.glTextureStorage2D(texture, levels, internalformat, width, height); + } + + // --- [ glTextureStorage3D ] --- + + /** + * DSA version of {@link GL42C#glTexStorage3D TexStorage3D}. + * + * @param texture the texture name + * @param levels the number of texture levels + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * @param depth the depth of the texture, in texels + * + * @see Reference Page + */ + public static void glTextureStorage3D(@NativeType("GLuint") int texture, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth) { + GL45C.glTextureStorage3D(texture, levels, internalformat, width, height, depth); + } + + // --- [ glTextureStorage2DMultisample ] --- + + /** + * DSA version of {@link GL43C#glTexStorage2DMultisample TexStorage2DMultisample}. + * + * @param texture the texture name + * @param samples the number of samples in the texture + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * @param fixedsamplelocations whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not + * depend on the internal format or size of the image + * + * @see Reference Page + */ + public static void glTextureStorage2DMultisample(@NativeType("GLuint") int texture, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLboolean") boolean fixedsamplelocations) { + GL45C.glTextureStorage2DMultisample(texture, samples, internalformat, width, height, fixedsamplelocations); + } + + // --- [ glTextureStorage3DMultisample ] --- + + /** + * DSA version of {@link GL43C#glTexStorage3DMultisample TexStorage3DMultisample}. + * + * @param texture the texture name + * @param samples the number of samples in the texture + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * @param depth the depth of the texture, in texels + * @param fixedsamplelocations whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not + * depend on the internal format or size of the image + * + * @see Reference Page + */ + public static void glTextureStorage3DMultisample(@NativeType("GLuint") int texture, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLboolean") boolean fixedsamplelocations) { + GL45C.glTextureStorage3DMultisample(texture, samples, internalformat, width, height, depth, fixedsamplelocations); + } + + // --- [ glTextureSubImage1D ] --- + + /** Unsafe version of: {@link #glTextureSubImage1D TextureSubImage1D} */ + public static void nglTextureSubImage1D(int texture, int level, int xoffset, int width, int format, int type, long pixels) { + GL45C.nglTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage1D TexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer pixels) { + GL45C.glTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage1D TexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long pixels) { + GL45C.glTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage1D TexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer pixels) { + GL45C.glTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage1D TexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer pixels) { + GL45C.glTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage1D TexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer pixels) { + GL45C.glTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage1D TexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") DoubleBuffer pixels) { + GL45C.glTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + // --- [ glTextureSubImage2D ] --- + + /** Unsafe version of: {@link #glTextureSubImage2D TextureSubImage2D} */ + public static void nglTextureSubImage2D(int texture, int level, int xoffset, int yoffset, int width, int height, int format, int type, long pixels) { + GL45C.nglTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage2D TexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer pixels) { + GL45C.glTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage2D TexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long pixels) { + GL45C.glTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage2D TexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer pixels) { + GL45C.glTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage2D TexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer pixels) { + GL45C.glTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage2D TexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer pixels) { + GL45C.glTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage2D TexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") DoubleBuffer pixels) { + GL45C.glTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + // --- [ glTextureSubImage3D ] --- + + /** Unsafe version of: {@link #glTextureSubImage3D TextureSubImage3D} */ + public static void nglTextureSubImage3D(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, long pixels) { + GL45C.nglTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * DSA version of {@link GL12C#glTexSubImage3D TexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer pixels) { + GL45C.glTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * DSA version of {@link GL12C#glTexSubImage3D TexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long pixels) { + GL45C.glTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * DSA version of {@link GL12C#glTexSubImage3D TexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer pixels) { + GL45C.glTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * DSA version of {@link GL12C#glTexSubImage3D TexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer pixels) { + GL45C.glTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * DSA version of {@link GL12C#glTexSubImage3D TexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer pixels) { + GL45C.glTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * DSA version of {@link GL12C#glTexSubImage3D TexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") DoubleBuffer pixels) { + GL45C.glTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + // --- [ glCompressedTextureSubImage1D ] --- + + /** + * Unsafe version of: {@link #glCompressedTextureSubImage1D CompressedTextureSubImage1D} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static void nglCompressedTextureSubImage1D(int texture, int level, int xoffset, int width, int format, int imageSize, long data) { + GL45C.nglCompressedTextureSubImage1D(texture, level, xoffset, width, format, imageSize, data); + } + + /** + * DSA version of {@link GL13C#glCompressedTexSubImage1D CompressedTexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param width the width of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + GL45C.glCompressedTextureSubImage1D(texture, level, xoffset, width, format, imageSize, data); + } + + /** + * DSA version of {@link GL13C#glCompressedTexSubImage1D CompressedTexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param width the width of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + GL45C.glCompressedTextureSubImage1D(texture, level, xoffset, width, format, data); + } + + // --- [ glCompressedTextureSubImage2D ] --- + + /** + * Unsafe version of: {@link #glCompressedTextureSubImage2D CompressedTextureSubImage2D} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static void nglCompressedTextureSubImage2D(int texture, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, long data) { + GL45C.nglCompressedTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, imageSize, data); + } + + /** + * DSA version of {@link GL13C#glCompressedTexSubImage2D CompressedTexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + GL45C.glCompressedTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, imageSize, data); + } + + /** + * DSA version of {@link GL13C#glCompressedTexSubImage2D CompressedTexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + GL45C.glCompressedTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, data); + } + + // --- [ glCompressedTextureSubImage3D ] --- + + /** + * Unsafe version of: {@link #glCompressedTextureSubImage3D CompressedTextureSubImage3D} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static void nglCompressedTextureSubImage3D(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, long data) { + GL45C.nglCompressedTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); + } + + /** + * DSA version of {@link GL13C#glCompressedTexSubImage3D CompressedTexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param zoffset a texel offset in the z direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param depth the depth of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + GL45C.glCompressedTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); + } + + /** + * DSA version of {@link GL13C#glCompressedTexSubImage3D CompressedTexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param zoffset a texel offset in the z direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param depth the depth of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + GL45C.glCompressedTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, data); + } + + // --- [ glCopyTextureSubImage1D ] --- + + /** + * DSA version of {@link GL11C#glCopyTexSubImage1D CopyTexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param xoffset the left texel coordinate of the texture subregion to update + * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the texture subregion width + * + * @see Reference Page + */ + public static void glCopyTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width) { + GL45C.glCopyTextureSubImage1D(texture, level, xoffset, x, y, width); + } + + // --- [ glCopyTextureSubImage2D ] --- + + /** + * DSA version of {@link GL11C#glCopyTexSubImage2D CopyTexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param xoffset the left texel coordinate of the texture subregion to update + * @param yoffset the lower texel coordinate of the texture subregion to update + * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the texture subregion width + * @param height the texture subregion height + * + * @see Reference Page + */ + public static void glCopyTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL45C.glCopyTextureSubImage2D(texture, level, xoffset, yoffset, x, y, width, height); + } + + // --- [ glCopyTextureSubImage3D ] --- + + /** + * DSA version of {@link GL12C#glCopyTexSubImage3D CopyTexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param xoffset the x coordinate of the texture subregion to update + * @param yoffset the y coordinate of the texture subregion to update + * @param zoffset the z coordinate of the texture subregion to update + * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the texture subregion width + * @param height the texture subregion height + * + * @see Reference Page + */ + public static void glCopyTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL45C.glCopyTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, x, y, width, height); + } + + // --- [ glTextureParameterf ] --- + + /** + * DSA version of {@link GL11C#glTexParameterf TexParameterf}. + * + * @param texture the texture name + * @param pname the parameter to set + * @param param the parameter value + * + * @see Reference Page + */ + public static void glTextureParameterf(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLfloat") float param) { + GL45C.glTextureParameterf(texture, pname, param); + } + + // --- [ glTextureParameterfv ] --- + + /** Unsafe version of: {@link #glTextureParameterfv TextureParameterfv} */ + public static void nglTextureParameterfv(int texture, int pname, long params) { + GL45C.nglTextureParameterfv(texture, pname, params); + } + + /** + * DSA version of {@link GL11C#glTexParameterfv TexParameterfv}. + * + * @param texture the texture name + * @param pname the parameter to set + * @param params the parameter value + * + * @see Reference Page + */ + public static void glTextureParameterfv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer params) { + GL45C.glTextureParameterfv(texture, pname, params); + } + + // --- [ glTextureParameteri ] --- + + /** + * DSA version of {@link GL11C#glTexParameteri TexParameteri}. + * + * @param texture the texture name + * @param pname the parameter to set. One of:
{@link GL12#GL_TEXTURE_BASE_LEVEL TEXTURE_BASE_LEVEL}{@link GL11#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}{@link GL12#GL_TEXTURE_MAX_LEVEL TEXTURE_MAX_LEVEL}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}
{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL33#GL_TEXTURE_SWIZZLE_R TEXTURE_SWIZZLE_R}{@link GL33#GL_TEXTURE_SWIZZLE_G TEXTURE_SWIZZLE_G}
{@link GL33#GL_TEXTURE_SWIZZLE_B TEXTURE_SWIZZLE_B}{@link GL33#GL_TEXTURE_SWIZZLE_A TEXTURE_SWIZZLE_A}{@link GL33#GL_TEXTURE_SWIZZLE_RGBA TEXTURE_SWIZZLE_RGBA}{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}
{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL14#GL_DEPTH_TEXTURE_MODE DEPTH_TEXTURE_MODE}{@link GL14#GL_GENERATE_MIPMAP GENERATE_MIPMAP}
+ * @param param the parameter value + * + * @see Reference Page + */ + public static void glTextureParameteri(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint") int param) { + GL45C.glTextureParameteri(texture, pname, param); + } + + // --- [ glTextureParameterIiv ] --- + + /** Unsafe version of: {@link #glTextureParameterIiv TextureParameterIiv} */ + public static void nglTextureParameterIiv(int texture, int pname, long params) { + GL45C.nglTextureParameterIiv(texture, pname, params); + } + + /** + * DSA version of {@link GL30C#glTexParameterIiv TexParameterIiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a single-valued texture parameter + * @param params the value of {@code pname} + * + * @see Reference Page + */ + public static void glTextureParameterIiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + GL45C.glTextureParameterIiv(texture, pname, params); + } + + /** + * DSA version of {@link GL30C#glTexParameterIiv TexParameterIiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a single-valued texture parameter + * + * @see Reference Page + */ + public static void glTextureParameterIi(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint const *") int param) { + GL45C.glTextureParameterIi(texture, pname, param); + } + + // --- [ glTextureParameterIuiv ] --- + + /** Unsafe version of: {@link #glTextureParameterIuiv TextureParameterIuiv} */ + public static void nglTextureParameterIuiv(int texture, int pname, long params) { + GL45C.nglTextureParameterIuiv(texture, pname, params); + } + + /** + * DSA version of {@link GL30C#glTexParameterIuiv TexParameterIuiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a single-valued texture parameter + * @param params the value of {@code pname} + * + * @see Reference Page + */ + public static void glTextureParameterIuiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLuint const *") IntBuffer params) { + GL45C.glTextureParameterIuiv(texture, pname, params); + } + + /** + * DSA version of {@link GL30C#glTexParameterIuiv TexParameterIuiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a single-valued texture parameter + * + * @see Reference Page + */ + public static void glTextureParameterIui(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLuint const *") int param) { + GL45C.glTextureParameterIui(texture, pname, param); + } + + // --- [ glTextureParameteriv ] --- + + /** Unsafe version of: {@link #glTextureParameteriv TextureParameteriv} */ + public static void nglTextureParameteriv(int texture, int pname, long params) { + GL45C.nglTextureParameteriv(texture, pname, params); + } + + /** + * DSA version of {@link GL11C#glTexParameteriv TexParameteriv}. + * + * @param texture the texture name + * @param pname the parameter to set + * @param params the parameter value + * + * @see Reference Page + */ + public static void glTextureParameteriv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + GL45C.glTextureParameteriv(texture, pname, params); + } + + // --- [ glGenerateTextureMipmap ] --- + + /** + * DSA version of {@link GL30C#glGenerateMipmap GenerateMipmap}. + * + * @param texture the texture name + * + * @see Reference Page + */ + public static void glGenerateTextureMipmap(@NativeType("GLuint") int texture) { + GL45C.glGenerateTextureMipmap(texture); + } + + // --- [ glBindTextureUnit ] --- + + /** + * Binds an existing texture object to the texture unit numbered {@code unit}. + * + *

{@code texture} must be zero or the name of an existing texture object. When {@code texture} is the name of an existing texture object, that object is + * bound to the target, in the corresponding texture unit, that was specified when the object was created. When {@code texture} is zero, each of the targets + * enumerated at the beginning of this section is reset to its default texture for the corresponding texture image unit.

+ * + * @param unit the texture unit number + * @param texture the texture name + * + * @see Reference Page + */ + public static void glBindTextureUnit(@NativeType("GLuint") int unit, @NativeType("GLuint") int texture) { + GL45C.glBindTextureUnit(unit, texture); + } + + // --- [ glGetTextureImage ] --- + + /** + * Unsafe version of: {@link #glGetTextureImage GetTextureImage} + * + * @param bufSize the size of the buffer to receive the retrieved pixel data + */ + public static void nglGetTextureImage(int texture, int level, int format, int type, int bufSize, long pixels) { + GL45C.nglGetTextureImage(texture, level, format, type, bufSize, pixels); + } + + /** + * DSA version of {@link GL11C#glGetTexImage GetTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param bufSize the size of the buffer to receive the retrieved pixel data + * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int bufSize, @NativeType("void *") long pixels) { + GL45C.glGetTextureImage(texture, level, format, type, bufSize, pixels); + } + + /** + * DSA version of {@link GL11C#glGetTexImage GetTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer pixels) { + GL45C.glGetTextureImage(texture, level, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glGetTexImage GetTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ShortBuffer pixels) { + GL45C.glGetTextureImage(texture, level, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glGetTexImage GetTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") IntBuffer pixels) { + GL45C.glGetTextureImage(texture, level, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glGetTexImage GetTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") FloatBuffer pixels) { + GL45C.glGetTextureImage(texture, level, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glGetTexImage GetTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") DoubleBuffer pixels) { + GL45C.glGetTextureImage(texture, level, format, type, pixels); + } + + // --- [ glGetCompressedTextureImage ] --- + + /** + * Unsafe version of: {@link #glGetCompressedTextureImage GetCompressedTextureImage} + * + * @param bufSize the size of the buffer to receive the retrieved pixel data + */ + public static void nglGetCompressedTextureImage(int texture, int level, int bufSize, long pixels) { + GL45C.nglGetCompressedTextureImage(texture, level, bufSize, pixels); + } + + /** + * DSA version of {@link GL13C#glGetCompressedTexImage GetCompressedTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param bufSize the size of the buffer to receive the retrieved pixel data + * @param pixels a buffer in which to return the compressed texture image + * + * @see Reference Page + */ + public static void glGetCompressedTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLsizei") int bufSize, @NativeType("void *") long pixels) { + GL45C.glGetCompressedTextureImage(texture, level, bufSize, pixels); + } + + /** + * DSA version of {@link GL13C#glGetCompressedTexImage GetCompressedTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param pixels a buffer in which to return the compressed texture image + * + * @see Reference Page + */ + public static void glGetCompressedTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("void *") ByteBuffer pixels) { + GL45C.glGetCompressedTextureImage(texture, level, pixels); + } + + // --- [ glGetTextureLevelParameterfv ] --- + + /** Unsafe version of: {@link #glGetTextureLevelParameterfv GetTextureLevelParameterfv} */ + public static void nglGetTextureLevelParameterfv(int texture, int level, int pname, long params) { + GL45C.nglGetTextureLevelParameterfv(texture, level, pname, params); + } + + /** + * DSA version of {@link GL11C#glGetTexLevelParameterfv GetTexLevelParameterfv}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param pname the parameter to query + * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureLevelParameterfv(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + GL45C.glGetTextureLevelParameterfv(texture, level, pname, params); + } + + /** + * DSA version of {@link GL11C#glGetTexLevelParameterfv GetTexLevelParameterfv}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param pname the parameter to query + * + * @see Reference Page + */ + @NativeType("void") + public static float glGetTextureLevelParameterf(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int pname) { + return GL45C.glGetTextureLevelParameterf(texture, level, pname); + } + + // --- [ glGetTextureLevelParameteriv ] --- + + /** Unsafe version of: {@link #glGetTextureLevelParameteriv GetTextureLevelParameteriv} */ + public static void nglGetTextureLevelParameteriv(int texture, int level, int pname, long params) { + GL45C.nglGetTextureLevelParameteriv(texture, level, pname, params); + } + + /** + * DSA version of {@link GL11C#glGetTexLevelParameteriv GetTexLevelParameteriv}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param pname the parameter to query. One of:
{@link GL11#GL_TEXTURE_WIDTH TEXTURE_WIDTH}{@link GL11#GL_TEXTURE_HEIGHT TEXTURE_HEIGHT}{@link GL12#GL_TEXTURE_DEPTH TEXTURE_DEPTH}{@link GL32#GL_TEXTURE_SAMPLES TEXTURE_SAMPLES}
{@link GL32#GL_TEXTURE_FIXED_SAMPLE_LOCATIONS TEXTURE_FIXED_SAMPLE_LOCATIONS}{@link GL11#GL_TEXTURE_INTERNAL_FORMAT TEXTURE_INTERNAL_FORMAT}{@link GL11#GL_TEXTURE_RED_SIZE TEXTURE_RED_SIZE}{@link GL11#GL_TEXTURE_GREEN_SIZE TEXTURE_GREEN_SIZE}
{@link GL11#GL_TEXTURE_BLUE_SIZE TEXTURE_BLUE_SIZE}{@link GL11#GL_TEXTURE_ALPHA_SIZE TEXTURE_ALPHA_SIZE}{@link GL14#GL_TEXTURE_DEPTH_SIZE TEXTURE_DEPTH_SIZE}{@link GL30#GL_TEXTURE_STENCIL_SIZE TEXTURE_STENCIL_SIZE}
{@link GL30#GL_TEXTURE_SHARED_SIZE TEXTURE_SHARED_SIZE}{@link GL30#GL_TEXTURE_ALPHA_TYPE TEXTURE_ALPHA_TYPE}{@link GL30#GL_TEXTURE_DEPTH_TYPE TEXTURE_DEPTH_TYPE}{@link GL13#GL_TEXTURE_COMPRESSED TEXTURE_COMPRESSED}
{@link GL13#GL_TEXTURE_COMPRESSED_IMAGE_SIZE TEXTURE_COMPRESSED_IMAGE_SIZE}{@link GL31#GL_TEXTURE_BUFFER_DATA_STORE_BINDING TEXTURE_BUFFER_DATA_STORE_BINDING}{@link GL43#GL_TEXTURE_BUFFER_OFFSET TEXTURE_BUFFER_OFFSET}{@link GL43#GL_TEXTURE_BUFFER_SIZE TEXTURE_BUFFER_SIZE}
+ * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureLevelParameteriv(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL45C.glGetTextureLevelParameteriv(texture, level, pname, params); + } + + /** + * DSA version of {@link GL11C#glGetTexLevelParameteriv GetTexLevelParameteriv}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param pname the parameter to query. One of:
{@link GL11#GL_TEXTURE_WIDTH TEXTURE_WIDTH}{@link GL11#GL_TEXTURE_HEIGHT TEXTURE_HEIGHT}{@link GL12#GL_TEXTURE_DEPTH TEXTURE_DEPTH}{@link GL32#GL_TEXTURE_SAMPLES TEXTURE_SAMPLES}
{@link GL32#GL_TEXTURE_FIXED_SAMPLE_LOCATIONS TEXTURE_FIXED_SAMPLE_LOCATIONS}{@link GL11#GL_TEXTURE_INTERNAL_FORMAT TEXTURE_INTERNAL_FORMAT}{@link GL11#GL_TEXTURE_RED_SIZE TEXTURE_RED_SIZE}{@link GL11#GL_TEXTURE_GREEN_SIZE TEXTURE_GREEN_SIZE}
{@link GL11#GL_TEXTURE_BLUE_SIZE TEXTURE_BLUE_SIZE}{@link GL11#GL_TEXTURE_ALPHA_SIZE TEXTURE_ALPHA_SIZE}{@link GL14#GL_TEXTURE_DEPTH_SIZE TEXTURE_DEPTH_SIZE}{@link GL30#GL_TEXTURE_STENCIL_SIZE TEXTURE_STENCIL_SIZE}
{@link GL30#GL_TEXTURE_SHARED_SIZE TEXTURE_SHARED_SIZE}{@link GL30#GL_TEXTURE_ALPHA_TYPE TEXTURE_ALPHA_TYPE}{@link GL30#GL_TEXTURE_DEPTH_TYPE TEXTURE_DEPTH_TYPE}{@link GL13#GL_TEXTURE_COMPRESSED TEXTURE_COMPRESSED}
{@link GL13#GL_TEXTURE_COMPRESSED_IMAGE_SIZE TEXTURE_COMPRESSED_IMAGE_SIZE}{@link GL31#GL_TEXTURE_BUFFER_DATA_STORE_BINDING TEXTURE_BUFFER_DATA_STORE_BINDING}{@link GL43#GL_TEXTURE_BUFFER_OFFSET TEXTURE_BUFFER_OFFSET}{@link GL43#GL_TEXTURE_BUFFER_SIZE TEXTURE_BUFFER_SIZE}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetTextureLevelParameteri(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int pname) { + return GL45C.glGetTextureLevelParameteri(texture, level, pname); + } + + // --- [ glGetTextureParameterfv ] --- + + /** Unsafe version of: {@link #glGetTextureParameterfv GetTextureParameterfv} */ + public static void nglGetTextureParameterfv(int texture, int pname, long params) { + GL45C.nglGetTextureParameterfv(texture, pname, params); + } + + /** + * DSA version of {@link GL11C#glGetTexParameterfv GetTexParameterfv}. + * + * @param texture the texture name + * @param pname the parameter to query + * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureParameterfv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + GL45C.glGetTextureParameterfv(texture, pname, params); + } + + /** + * DSA version of {@link GL11C#glGetTexParameterfv GetTexParameterfv}. + * + * @param texture the texture name + * @param pname the parameter to query + * + * @see Reference Page + */ + @NativeType("void") + public static float glGetTextureParameterf(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname) { + return GL45C.glGetTextureParameterf(texture, pname); + } + + // --- [ glGetTextureParameterIiv ] --- + + /** Unsafe version of: {@link #glGetTextureParameterIiv GetTextureParameterIiv} */ + public static void nglGetTextureParameterIiv(int texture, int pname, long params) { + GL45C.nglGetTextureParameterIiv(texture, pname, params); + } + + /** + * DSA version of {@link GL30C#glGetTexParameterIiv GetTexParameterIiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a texture parameter + * @param params returns the texture parameter value + * + * @see Reference Page + */ + public static void glGetTextureParameterIiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL45C.glGetTextureParameterIiv(texture, pname, params); + } + + /** + * DSA version of {@link GL30C#glGetTexParameterIiv GetTexParameterIiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a texture parameter + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetTextureParameterIi(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname) { + return GL45C.glGetTextureParameterIi(texture, pname); + } + + // --- [ glGetTextureParameterIuiv ] --- + + /** Unsafe version of: {@link #glGetTextureParameterIuiv GetTextureParameterIuiv} */ + public static void nglGetTextureParameterIuiv(int texture, int pname, long params) { + GL45C.nglGetTextureParameterIuiv(texture, pname, params); + } + + /** + * DSA version of {@link GL30C#glGetTexParameterIuiv GetTexParameterIuiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a texture parameter + * @param params returns the texture parameter value + * + * @see Reference Page + */ + public static void glGetTextureParameterIuiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLuint *") IntBuffer params) { + GL45C.glGetTextureParameterIuiv(texture, pname, params); + } + + /** + * DSA version of {@link GL30C#glGetTexParameterIuiv GetTexParameterIuiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a texture parameter + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetTextureParameterIui(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname) { + return GL45C.glGetTextureParameterIui(texture, pname); + } + + // --- [ glGetTextureParameteriv ] --- + + /** Unsafe version of: {@link #glGetTextureParameteriv GetTextureParameteriv} */ + public static void nglGetTextureParameteriv(int texture, int pname, long params) { + GL45C.nglGetTextureParameteriv(texture, pname, params); + } + + /** + * DSA version of {@link GL11C#glGetTexParameteriv GetTexParameteriv}. + * + * @param texture the texture name + * @param pname the parameter to query. One of:
{@link GL12#GL_TEXTURE_BASE_LEVEL TEXTURE_BASE_LEVEL}{@link GL11#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}{@link GL12#GL_TEXTURE_MAX_LEVEL TEXTURE_MAX_LEVEL}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}
{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL33#GL_TEXTURE_SWIZZLE_R TEXTURE_SWIZZLE_R}{@link GL33#GL_TEXTURE_SWIZZLE_G TEXTURE_SWIZZLE_G}
{@link GL33#GL_TEXTURE_SWIZZLE_B TEXTURE_SWIZZLE_B}{@link GL33#GL_TEXTURE_SWIZZLE_A TEXTURE_SWIZZLE_A}{@link GL33#GL_TEXTURE_SWIZZLE_RGBA TEXTURE_SWIZZLE_RGBA}{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}
{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL14#GL_DEPTH_TEXTURE_MODE DEPTH_TEXTURE_MODE}{@link GL14#GL_GENERATE_MIPMAP GENERATE_MIPMAP}
{@link GL42#GL_IMAGE_FORMAT_COMPATIBILITY_TYPE IMAGE_FORMAT_COMPATIBILITY_TYPE}{@link GL42#GL_TEXTURE_IMMUTABLE_FORMAT TEXTURE_IMMUTABLE_FORMAT}{@link GL43#GL_TEXTURE_IMMUTABLE_LEVELS TEXTURE_IMMUTABLE_LEVELS}{@link GL43#GL_TEXTURE_VIEW_MIN_LEVEL TEXTURE_VIEW_MIN_LEVEL}
{@link GL43#GL_TEXTURE_VIEW_NUM_LEVELS TEXTURE_VIEW_NUM_LEVELS}{@link GL43#GL_TEXTURE_VIEW_MIN_LAYER TEXTURE_VIEW_MIN_LAYER}{@link GL43#GL_TEXTURE_VIEW_NUM_LAYERS TEXTURE_VIEW_NUM_LAYERS}
+ * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureParameteriv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + GL45C.glGetTextureParameteriv(texture, pname, params); + } + + /** + * DSA version of {@link GL11C#glGetTexParameteriv GetTexParameteriv}. + * + * @param texture the texture name + * @param pname the parameter to query. One of:
{@link GL12#GL_TEXTURE_BASE_LEVEL TEXTURE_BASE_LEVEL}{@link GL11#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}{@link GL12#GL_TEXTURE_MAX_LEVEL TEXTURE_MAX_LEVEL}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}
{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL33#GL_TEXTURE_SWIZZLE_R TEXTURE_SWIZZLE_R}{@link GL33#GL_TEXTURE_SWIZZLE_G TEXTURE_SWIZZLE_G}
{@link GL33#GL_TEXTURE_SWIZZLE_B TEXTURE_SWIZZLE_B}{@link GL33#GL_TEXTURE_SWIZZLE_A TEXTURE_SWIZZLE_A}{@link GL33#GL_TEXTURE_SWIZZLE_RGBA TEXTURE_SWIZZLE_RGBA}{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}
{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL14#GL_DEPTH_TEXTURE_MODE DEPTH_TEXTURE_MODE}{@link GL14#GL_GENERATE_MIPMAP GENERATE_MIPMAP}
{@link GL42#GL_IMAGE_FORMAT_COMPATIBILITY_TYPE IMAGE_FORMAT_COMPATIBILITY_TYPE}{@link GL42#GL_TEXTURE_IMMUTABLE_FORMAT TEXTURE_IMMUTABLE_FORMAT}{@link GL43#GL_TEXTURE_IMMUTABLE_LEVELS TEXTURE_IMMUTABLE_LEVELS}{@link GL43#GL_TEXTURE_VIEW_MIN_LEVEL TEXTURE_VIEW_MIN_LEVEL}
{@link GL43#GL_TEXTURE_VIEW_NUM_LEVELS TEXTURE_VIEW_NUM_LEVELS}{@link GL43#GL_TEXTURE_VIEW_MIN_LAYER TEXTURE_VIEW_MIN_LAYER}{@link GL43#GL_TEXTURE_VIEW_NUM_LAYERS TEXTURE_VIEW_NUM_LAYERS}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetTextureParameteri(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname) { + return GL45C.glGetTextureParameteri(texture, pname); + } + + // --- [ glCreateVertexArrays ] --- + + /** + * Unsafe version of: {@link #glCreateVertexArrays CreateVertexArrays} + * + * @param n the number of vertex array object names to create + */ + public static void nglCreateVertexArrays(int n, long arrays) { + GL45C.nglCreateVertexArrays(n, arrays); + } + + /** + * Returns {@code n} previously unused vertex array object names in {@code arrays}. + * + * @param arrays the buffer in which to return the created vertex array object names + * + * @see Reference Page + */ + public static void glCreateVertexArrays(@NativeType("GLuint *") IntBuffer arrays) { + GL45C.glCreateVertexArrays(arrays); + } + + /** + * Returns {@code n} previously unused vertex array object names in {@code arrays}. + * + * @see Reference Page + */ + @NativeType("void") + public static int glCreateVertexArrays() { + return GL45C.glCreateVertexArrays(); + } + + // --- [ glDisableVertexArrayAttrib ] --- + + /** + * DSA version of {@link GL20C#glDisableVertexAttribArray DisableVertexAttribArray}. + * + * @param vaobj the vertex array object name + * @param index the index of the generic vertex attribute to be disabled + * + * @see Reference Page + */ + public static void glDisableVertexArrayAttrib(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index) { + GL45C.glDisableVertexArrayAttrib(vaobj, index); + } + + // --- [ glEnableVertexArrayAttrib ] --- + + /** + * DSA version of {@link GL20C#glEnableVertexAttribArray EnableVertexAttribArray}. + * + * @param vaobj the vertex array object name + * @param index the index of the generic vertex attribute to be enabled + * + * @see Reference Page + */ + public static void glEnableVertexArrayAttrib(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index) { + GL45C.glEnableVertexArrayAttrib(vaobj, index); + } + + // --- [ glVertexArrayElementBuffer ] --- + + /** + * Binds a buffer object to the element array buffer bind point of a vertex array object. + * + * @param vaobj the vertex array object name + * @param buffer the buffer object name. If {@code buffer} is zero, any existing element array buffer binding to {@code vaobj} is removed. + * + * @see Reference Page + */ + public static void glVertexArrayElementBuffer(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int buffer) { + GL45C.glVertexArrayElementBuffer(vaobj, buffer); + } + + // --- [ glVertexArrayVertexBuffer ] --- + + /** + * DSA version of {@link GL43C#glBindVertexBuffer BindVertexBuffer}. + * + * @param vaobj the vertex array object name + * @param bindingindex the index of the vertex buffer binding point to which to bind the buffer + * @param buffer the name of an existing buffer to bind to the vertex buffer binding point + * @param offset the offset of the first element of the buffer + * @param stride the distance between elements within the buffer + * + * @see Reference Page + */ + public static void glVertexArrayVertexBuffer(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int bindingindex, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizei") int stride) { + GL45C.glVertexArrayVertexBuffer(vaobj, bindingindex, buffer, offset, stride); + } + + // --- [ glVertexArrayVertexBuffers ] --- + + /** + * Unsafe version of: {@link #glVertexArrayVertexBuffers VertexArrayVertexBuffers} + * + * @param count the number of vertex buffer binding points + */ + public static void nglVertexArrayVertexBuffers(int vaobj, int first, int count, long buffers, long offsets, long strides) { + GL45C.nglVertexArrayVertexBuffers(vaobj, first, count, buffers, offsets, strides); + } + + /** + * DSA version of {@link GL44C#glBindVertexBuffers BindVertexBuffers}. + * + * @param vaobj the vertex array object name + * @param first the first vertex buffer binding point + * @param buffers an array of zeros or names of existing buffers objects + * @param offsets an array of offses + * @param strides an array of stride values + * + * @see Reference Page + */ + public static void glVertexArrayVertexBuffers(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") IntBuffer buffers, @Nullable @NativeType("GLintptr const *") PointerBuffer offsets, @Nullable @NativeType("GLsizei const *") IntBuffer strides) { + GL45C.glVertexArrayVertexBuffers(vaobj, first, buffers, offsets, strides); + } + + // --- [ glVertexArrayAttribFormat ] --- + + /** + * DSA version of {@link GL43C#glVertexAttribFormat VertexAttribFormat}. + * + * @param vaobj the vertex array object name + * @param attribindex the generic vertex attribute array being described + * @param size the number of values per vertex that are stored in the array. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the type of the data stored in the array + * @param normalized if true then integer data is normalized to the range [-1, 1] or [0, 1] if it is signed or unsigned, respectively. If false then integer data is + * directly converted to floating point. + * @param relativeoffset the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from + * + * @see Reference Page + */ + public static void glVertexArrayAttribFormat(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int attribindex, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint") int relativeoffset) { + GL45C.glVertexArrayAttribFormat(vaobj, attribindex, size, type, normalized, relativeoffset); + } + + // --- [ glVertexArrayAttribIFormat ] --- + + /** + * DSA version of {@link GL43C#glVertexAttribIFormat VertexAttribIFormat}. + * + * @param vaobj the vertex array object name + * @param attribindex the generic vertex attribute array being described + * @param size the number of values per vertex that are stored in the array. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the type of the data stored in the array + * @param relativeoffset the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from + * + * @see Reference Page + */ + public static void glVertexArrayAttribIFormat(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int attribindex, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLuint") int relativeoffset) { + GL45C.glVertexArrayAttribIFormat(vaobj, attribindex, size, type, relativeoffset); + } + + // --- [ glVertexArrayAttribLFormat ] --- + + /** + * DSA version of {@link GL43C#glVertexAttribLFormat VertexAttribLFormat}. + * + * @param vaobj the vertex array object name + * @param attribindex the generic vertex attribute array being described + * @param size the number of values per vertex that are stored in the array. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the type of the data stored in the array + * @param relativeoffset the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from + * + * @see Reference Page + */ + public static void glVertexArrayAttribLFormat(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int attribindex, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLuint") int relativeoffset) { + GL45C.glVertexArrayAttribLFormat(vaobj, attribindex, size, type, relativeoffset); + } + + // --- [ glVertexArrayAttribBinding ] --- + + /** + * DSA version of {@link GL43C#glVertexAttribBinding VertexAttribBinding}. + * + * @param vaobj the vertex array object name + * @param attribindex the index of the attribute to associate with a vertex buffer binding + * @param bindingindex the index of the vertex buffer binding with which to associate the generic vertex attribute + * + * @see Reference Page + */ + public static void glVertexArrayAttribBinding(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int attribindex, @NativeType("GLuint") int bindingindex) { + GL45C.glVertexArrayAttribBinding(vaobj, attribindex, bindingindex); + } + + // --- [ glVertexArrayBindingDivisor ] --- + + /** + * DSA version of {@link GL43C#glVertexBindingDivisor VertexBindingDivisor}. + * + * @param vaobj the vertex array object name + * @param bindingindex the index of the generic vertex attribute + * @param divisor the number of instances that will pass between updates of the generic attribute at slot {@code index} + * + * @see Reference Page + */ + public static void glVertexArrayBindingDivisor(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int bindingindex, @NativeType("GLuint") int divisor) { + GL45C.glVertexArrayBindingDivisor(vaobj, bindingindex, divisor); + } + + // --- [ glGetVertexArrayiv ] --- + + /** Unsafe version of: {@link #glGetVertexArrayiv GetVertexArrayiv} */ + public static void nglGetVertexArrayiv(int vaobj, int pname, long param) { + GL45C.nglGetVertexArrayiv(vaobj, pname, param); + } + + /** + * Queries parameters of a vertex array object. + * + * @param vaobj the vertex array object name + * @param pname the parameter to query. Must be:
{@link GL15#GL_ELEMENT_ARRAY_BUFFER_BINDING ELEMENT_ARRAY_BUFFER_BINDING}
+ * @param param the buffer in which to return the parameter values + * + * @see Reference Page + */ + public static void glGetVertexArrayiv(@NativeType("GLuint") int vaobj, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer param) { + GL45C.glGetVertexArrayiv(vaobj, pname, param); + } + + /** + * Queries parameters of a vertex array object. + * + * @param vaobj the vertex array object name + * @param pname the parameter to query. Must be:
{@link GL15#GL_ELEMENT_ARRAY_BUFFER_BINDING ELEMENT_ARRAY_BUFFER_BINDING}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetVertexArrayi(@NativeType("GLuint") int vaobj, @NativeType("GLenum") int pname) { + return GL45C.glGetVertexArrayi(vaobj, pname); + } + + // --- [ glGetVertexArrayIndexediv ] --- + + /** Unsafe version of: {@link #glGetVertexArrayIndexediv GetVertexArrayIndexediv} */ + public static void nglGetVertexArrayIndexediv(int vaobj, int index, int pname, long param) { + GL45C.nglGetVertexArrayIndexediv(vaobj, index, pname, param); + } + + /** + * Queries parameters of an attribute of a vertex array object. + * + * @param vaobj the vertex array object name + * @param index the attribute to query + * @param pname the parameter to query. One of:
{@link GL20#GL_VERTEX_ATTRIB_ARRAY_ENABLED VERTEX_ATTRIB_ARRAY_ENABLED}{@link GL20#GL_VERTEX_ATTRIB_ARRAY_SIZE VERTEX_ATTRIB_ARRAY_SIZE},
{@link GL20#GL_VERTEX_ATTRIB_ARRAY_STRIDE VERTEX_ATTRIB_ARRAY_STRIDE}{@link GL20#GL_VERTEX_ATTRIB_ARRAY_TYPE VERTEX_ATTRIB_ARRAY_TYPE}
{@link GL20#GL_VERTEX_ATTRIB_ARRAY_NORMALIZED VERTEX_ATTRIB_ARRAY_NORMALIZED}{@link GL30#GL_VERTEX_ATTRIB_ARRAY_INTEGER VERTEX_ATTRIB_ARRAY_INTEGER}
{@link GL33#GL_VERTEX_ATTRIB_ARRAY_DIVISOR VERTEX_ATTRIB_ARRAY_DIVISOR}{@link GL43#GL_VERTEX_ATTRIB_ARRAY_LONG VERTEX_ATTRIB_ARRAY_LONG}
{@link GL43#GL_VERTEX_ATTRIB_RELATIVE_OFFSET VERTEX_ATTRIB_RELATIVE_OFFSET}
+ * @param param the buffer in which to return the parameter values + * + * @see Reference Page + */ + public static void glGetVertexArrayIndexediv(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer param) { + GL45C.glGetVertexArrayIndexediv(vaobj, index, pname, param); + } + + /** + * Queries parameters of an attribute of a vertex array object. + * + * @param vaobj the vertex array object name + * @param index the attribute to query + * @param pname the parameter to query. One of:
{@link GL20#GL_VERTEX_ATTRIB_ARRAY_ENABLED VERTEX_ATTRIB_ARRAY_ENABLED}{@link GL20#GL_VERTEX_ATTRIB_ARRAY_SIZE VERTEX_ATTRIB_ARRAY_SIZE},
{@link GL20#GL_VERTEX_ATTRIB_ARRAY_STRIDE VERTEX_ATTRIB_ARRAY_STRIDE}{@link GL20#GL_VERTEX_ATTRIB_ARRAY_TYPE VERTEX_ATTRIB_ARRAY_TYPE}
{@link GL20#GL_VERTEX_ATTRIB_ARRAY_NORMALIZED VERTEX_ATTRIB_ARRAY_NORMALIZED}{@link GL30#GL_VERTEX_ATTRIB_ARRAY_INTEGER VERTEX_ATTRIB_ARRAY_INTEGER}
{@link GL33#GL_VERTEX_ATTRIB_ARRAY_DIVISOR VERTEX_ATTRIB_ARRAY_DIVISOR}{@link GL43#GL_VERTEX_ATTRIB_ARRAY_LONG VERTEX_ATTRIB_ARRAY_LONG}
{@link GL43#GL_VERTEX_ATTRIB_RELATIVE_OFFSET VERTEX_ATTRIB_RELATIVE_OFFSET}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetVertexArrayIndexedi(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + return GL45C.glGetVertexArrayIndexedi(vaobj, index, pname); + } + + // --- [ glGetVertexArrayIndexed64iv ] --- + + /** Unsafe version of: {@link #glGetVertexArrayIndexed64iv GetVertexArrayIndexed64iv} */ + public static void nglGetVertexArrayIndexed64iv(int vaobj, int index, int pname, long param) { + GL45C.nglGetVertexArrayIndexed64iv(vaobj, index, pname, param); + } + + /** + * Queries parameters of an attribute of a vertex array object. + * + * @param vaobj the vertex array object name + * @param index the attribute to query + * @param pname the parameter to query. Must be:
{@link GL43#GL_VERTEX_BINDING_OFFSET VERTEX_BINDING_OFFSET}
+ * @param param the buffer in which to return the parameter values + * + * @see Reference Page + */ + public static void glGetVertexArrayIndexed64iv(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint64 *") LongBuffer param) { + GL45C.glGetVertexArrayIndexed64iv(vaobj, index, pname, param); + } + + /** + * Queries parameters of an attribute of a vertex array object. + * + * @param vaobj the vertex array object name + * @param index the attribute to query + * @param pname the parameter to query. Must be:
{@link GL43#GL_VERTEX_BINDING_OFFSET VERTEX_BINDING_OFFSET}
+ * + * @see Reference Page + */ + @NativeType("void") + public static long glGetVertexArrayIndexed64i(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + return GL45C.glGetVertexArrayIndexed64i(vaobj, index, pname); + } + + // --- [ glCreateSamplers ] --- + + /** + * Unsafe version of: {@link #glCreateSamplers CreateSamplers} + * + * @param n the number of sampler object names to create + */ + public static void nglCreateSamplers(int n, long samplers) { + GL45C.nglCreateSamplers(n, samplers); + } + + /** + * Returns {@code n} previously unused sampler names in {@code samplers}, each representing a new sampler object. + * + * @param samplers the buffer in which to return the created sampler object names + * + * @see Reference Page + */ + public static void glCreateSamplers(@NativeType("GLuint *") IntBuffer samplers) { + GL45C.glCreateSamplers(samplers); + } + + /** + * Returns {@code n} previously unused sampler names in {@code samplers}, each representing a new sampler object. + * + * @see Reference Page + */ + @NativeType("void") + public static int glCreateSamplers() { + return GL45C.glCreateSamplers(); + } + + // --- [ glCreateProgramPipelines ] --- + + /** + * Unsafe version of: {@link #glCreateProgramPipelines CreateProgramPipelines} + * + * @param n the number of program pipeline names to create + */ + public static void nglCreateProgramPipelines(int n, long pipelines) { + GL45C.nglCreateProgramPipelines(n, pipelines); + } + + /** + * Returns {@code n} previously unused program pipeline names in {@code pipelines}, each representing a new program pipeline object. + * + * @param pipelines the buffer in which to return the created program pipeline names + * + * @see Reference Page + */ + public static void glCreateProgramPipelines(@NativeType("GLuint *") IntBuffer pipelines) { + GL45C.glCreateProgramPipelines(pipelines); + } + + /** + * Returns {@code n} previously unused program pipeline names in {@code pipelines}, each representing a new program pipeline object. + * + * @see Reference Page + */ + @NativeType("void") + public static int glCreateProgramPipelines() { + return GL45C.glCreateProgramPipelines(); + } + + // --- [ glCreateQueries ] --- + + /** + * Unsafe version of: {@link #glCreateQueries CreateQueries} + * + * @param n the number of query object names to create + */ + public static void nglCreateQueries(int target, int n, long ids) { + GL45C.nglCreateQueries(target, n, ids); + } + + /** + * Returns {@code n} previously unused query object names in {@code ids}, each representing a new query object with the specified {@code target}. + * + * @param target the query target. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param ids the buffer in which to return the created query object names + * + * @see Reference Page + */ + public static void glCreateQueries(@NativeType("GLenum") int target, @NativeType("GLuint *") IntBuffer ids) { + GL45C.glCreateQueries(target, ids); + } + + /** + * Returns {@code n} previously unused query object names in {@code ids}, each representing a new query object with the specified {@code target}. + * + * @param target the query target. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glCreateQueries(@NativeType("GLenum") int target) { + return GL45C.glCreateQueries(target); + } + + // --- [ glGetQueryBufferObjectiv ] --- + + /** + * Queries the state of a query object. + * + * @param id the name of a query object + * @param buffer the name of a buffer object + * @param pname the state to query + * @param offset the offset into {@code buffer} at which the queried value is written + * + * @see Reference Page + */ + public static void glGetQueryBufferObjectiv(@NativeType("GLuint") int id, @NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLintptr") long offset) { + GL45C.glGetQueryBufferObjectiv(id, buffer, pname, offset); + } + + // --- [ glGetQueryBufferObjectuiv ] --- + + /** + * Unsigned version of {@link #glGetQueryBufferObjectiv GetQueryBufferObjectiv}. + * + * @param id the name of a query object + * @param buffer the name of a buffer object + * @param pname the state to query + * @param offset the offset into {@code buffer} at which the queried value is written + * + * @see Reference Page + */ + public static void glGetQueryBufferObjectuiv(@NativeType("GLuint") int id, @NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLintptr") long offset) { + GL45C.glGetQueryBufferObjectuiv(id, buffer, pname, offset); + } + + // --- [ glGetQueryBufferObjecti64v ] --- + + /** + * 64bit version of {@link #glGetQueryBufferObjectiv GetQueryBufferObjectiv}. + * + * @param id the name of a query object + * @param buffer the name of a buffer object + * @param pname the state to query + * @param offset the offset into {@code buffer} at which the queried value is written + * + * @see Reference Page + */ + public static void glGetQueryBufferObjecti64v(@NativeType("GLuint") int id, @NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLintptr") long offset) { + GL45C.glGetQueryBufferObjecti64v(id, buffer, pname, offset); + } + + // --- [ glGetQueryBufferObjectui64v ] --- + + /** + * 64bit version of {@link #glGetQueryBufferObjectuiv GetQueryBufferObjectuiv}. + * + * @param id the name of a query object + * @param buffer the name of a buffer object + * @param pname the state to query + * @param offset the offset into {@code buffer} at which the queried value is written + * + * @see Reference Page + */ + public static void glGetQueryBufferObjectui64v(@NativeType("GLuint") int id, @NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLintptr") long offset) { + GL45C.glGetQueryBufferObjectui64v(id, buffer, pname, offset); + } + + // --- [ glMemoryBarrierByRegion ] --- + + /** + * Behaves like {@link GL42C#glMemoryBarrier MemoryBarrier}, with two differences: + * + *

First, it narrows the region under consideration so that only reads/writes of prior fragment shaders that are invoked for a smaller region of the + * framebuffer will be completed/reflected prior to subsequent reads/write of following fragment shaders. The size of the region is implementation + * dependent and may be as small as one framebuffer pixel.

+ * + *

Second, it only applies to memory transactions that may be read by or written by a fragment shader.

+ * + *

When barriers is {@link GL42#GL_ALL_BARRIER_BITS ALL_BARRIER_BITS}, shader memory accesses will be synchronized relative to all these barrier bits, but not to other + * barrier bits specific to {@link GL42C#glMemoryBarrier MemoryBarrier}. This implies that reads/writes for scatter/gather-like algorithms may or may not be + * completed/reflected after a MemoryBarrierByRegion command. However, for uses such as deferred shading, where a linked list of visible + * surfaces with the head at a framebuffer address may be constructed, and the entirety of the list is only dependent on previous executions at that + * framebuffer address, MemoryBarrierByRegion may be significantly more efficient than {@link GL42C#glMemoryBarrier MemoryBarrier}.

+ * + * @param barriers the barriers to insert. One or more of:
{@link GL42#GL_ATOMIC_COUNTER_BARRIER_BIT ATOMIC_COUNTER_BARRIER_BIT}{@link GL42#GL_FRAMEBUFFER_BARRIER_BIT FRAMEBUFFER_BARRIER_BIT}{@link GL42#GL_SHADER_IMAGE_ACCESS_BARRIER_BIT SHADER_IMAGE_ACCESS_BARRIER_BIT}
{@link GL43#GL_SHADER_STORAGE_BARRIER_BIT SHADER_STORAGE_BARRIER_BIT}{@link GL42#GL_TEXTURE_FETCH_BARRIER_BIT TEXTURE_FETCH_BARRIER_BIT}{@link GL42#GL_UNIFORM_BARRIER_BIT UNIFORM_BARRIER_BIT}
+ * + * @see Reference Page + */ + public static void glMemoryBarrierByRegion(@NativeType("GLbitfield") int barriers) { + GL45C.glMemoryBarrierByRegion(barriers); + } + + // --- [ glGetTextureSubImage ] --- + + /** + * Unsafe version of: {@link #glGetTextureSubImage GetTextureSubImage} + * + * @param bufSize the size of the buffer to receive the retrieved pixel data + */ + public static void nglGetTextureSubImage(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, int bufSize, long pixels) { + GL45C.nglGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize, pixels); + } + + /** + * Obtains sub-regions of a texture image from a texture object. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param bufSize the size of the buffer to receive the retrieved pixel data + * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int bufSize, @NativeType("void *") long pixels) { + GL45C.glGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize, pixels); + } + + /** + * Obtains sub-regions of a texture image from a texture object. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer pixels) { + GL45C.glGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Obtains sub-regions of a texture image from a texture object. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ShortBuffer pixels) { + GL45C.glGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Obtains sub-regions of a texture image from a texture object. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") IntBuffer pixels) { + GL45C.glGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Obtains sub-regions of a texture image from a texture object. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") FloatBuffer pixels) { + GL45C.glGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Obtains sub-regions of a texture image from a texture object. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") DoubleBuffer pixels) { + GL45C.glGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + // --- [ glGetCompressedTextureSubImage ] --- + + /** + * Unsafe version of: {@link #glGetCompressedTextureSubImage GetCompressedTextureSubImage} + * + * @param bufSize the size of the buffer to receive the retrieved pixel data + */ + public static void nglGetCompressedTextureSubImage(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int bufSize, long pixels) { + GL45C.nglGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, bufSize, pixels); + } + + /** + * Obtains a sub-region of a compressed texture image. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param bufSize the size of the buffer to receive the retrieved pixel data + * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLsizei") int bufSize, @NativeType("void *") long pixels) { + GL45C.glGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, bufSize, pixels); + } + + /** + * Obtains a sub-region of a compressed texture image. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") ByteBuffer pixels) { + GL45C.glGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels); + } + + /** + * Obtains a sub-region of a compressed texture image. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") ShortBuffer pixels) { + GL45C.glGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels); + } + + /** + * Obtains a sub-region of a compressed texture image. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") IntBuffer pixels) { + GL45C.glGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels); + } + + /** + * Obtains a sub-region of a compressed texture image. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") FloatBuffer pixels) { + GL45C.glGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels); + } + + /** + * Obtains a sub-region of a compressed texture image. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") DoubleBuffer pixels) { + GL45C.glGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels); + } + + // --- [ glTextureBarrier ] --- + + /** + * Guarantees that writes have completed and caches have been invalidated before subsequent Draws are executed. + * + * @see Reference Page + */ + public static void glTextureBarrier() { + GL45C.glTextureBarrier(); + } + + // --- [ glGetGraphicsResetStatus ] --- + + /** + * Indicates if the GL context has been in a reset state at any point since the last call to GetGraphicsResetStatus: + * + *
    + *
  • {@link GL11#GL_NO_ERROR NO_ERROR} indicates that the GL context has not been in a reset state since the last call.
  • + *
  • {@link GL45C#GL_GUILTY_CONTEXT_RESET GUILTY_CONTEXT_RESET} indicates that a reset has been detected that is attributable to the current GL context.
  • + *
  • {@link GL45C#GL_INNOCENT_CONTEXT_RESET INNOCENT_CONTEXT_RESET} indicates a reset has been detected that is not attributable to the current GL context.
  • + *
  • {@link GL45C#GL_UNKNOWN_CONTEXT_RESET UNKNOWN_CONTEXT_RESET} indicates a detected graphics reset whose cause is unknown.
  • + *
+ * + *

If a reset status other than NO_ERROR is returned and subsequent calls return NO_ERROR, the context reset was encountered and completed. If a reset + * status is repeatedly returned, the context may be in the process of resetting.

+ * + *

Reset notification behavior is determined at context creation time, and may be queried by calling GetIntegerv with the symbolic constant + * {@link GL45C#GL_RESET_NOTIFICATION_STRATEGY RESET_NOTIFICATION_STRATEGY}.

+ * + *

If the reset notification behavior is {@link GL45C#GL_NO_RESET_NOTIFICATION NO_RESET_NOTIFICATION}, then the implementation will never deliver notification of reset events, and + * GetGraphicsResetStatus will always return NO_ERROR.

+ * + *

If the behavior is {@link GL45C#GL_LOSE_CONTEXT_ON_RESET LOSE_CONTEXT_ON_RESET}, a graphics reset will result in a lost context and require creating a new context as described + * above. In this case GetGraphicsResetStatus will return an appropriate value from those described above.

+ * + *

If a graphics reset notification occurs in a context, a notification must also occur in all other contexts which share objects with that context.

+ * + *

After a graphics reset has occurred on a context, subsequent GL commands on that context (or any context which shares with that context) will generate a + * {@link GL45C#GL_CONTEXT_LOST CONTEXT_LOST} error. Such commands will not have side effects (in particular, they will not modify memory passed by pointer for query results, + * and may not block indefinitely or cause termination of the application. Exceptions to this behavior include:

+ * + *
    + *
  • {@link GL11C#glGetError GetError} and GetGraphicsResetStatus behave normally following a graphics reset, so that the application can determine a reset has + * occurred, and when it is safe to destroy and recreate the context.
  • + *
  • Any commands which might cause a polling application to block indefinitely will generate a CONTEXT_LOST error, but will also return a value + * indicating completion to the application.
  • + *
+ * + * @see Reference Page + */ + @NativeType("GLenum") + public static int glGetGraphicsResetStatus() { + return GL45C.glGetGraphicsResetStatus(); + } + + // --- [ glGetnMapdv ] --- + + /** + * Unsafe version of: {@link #glGetnMapdv GetnMapdv} + * + * @param bufSize the maximum number of bytes to write into {@code data} + */ + public static native void nglGetnMapdv(int target, int query, int bufSize, long data); + + /** + * Robust version of {@link GL11#glGetMapdv GetMapdv} + * + * @param target the evaluator map + * @param query the information to query + * @param data a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnMapdv(@NativeType("GLenum") int target, @NativeType("GLenum") int query, @NativeType("GLdouble *") DoubleBuffer data) { + nglGetnMapdv(target, query, data.remaining(), memAddress(data)); + } + + /** + * Robust version of {@link GL11#glGetMapdv GetMapdv} + * + * @param target the evaluator map + * @param query the information to query + * + * @see Reference Page + */ + @NativeType("void") + public static double glGetnMapd(@NativeType("GLenum") int target, @NativeType("GLenum") int query) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + DoubleBuffer data = stack.callocDouble(1); + nglGetnMapdv(target, query, 1, memAddress(data)); + return data.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetnMapfv ] --- + + /** + * Unsafe version of: {@link #glGetnMapfv GetnMapfv} + * + * @param bufSize the maximum number of bytes to write into {@code data} + */ + public static native void nglGetnMapfv(int target, int query, int bufSize, long data); + + /** + * Robust version of {@link GL11#glGetMapfv GetMapfv} + * + * @param target the evaluator map + * @param query the information to query + * @param data a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnMapfv(@NativeType("GLenum") int target, @NativeType("GLenum") int query, @NativeType("GLfloat *") FloatBuffer data) { + nglGetnMapfv(target, query, data.remaining(), memAddress(data)); + } + + /** + * Robust version of {@link GL11#glGetMapfv GetMapfv} + * + * @param target the evaluator map + * @param query the information to query + * + * @see Reference Page + */ + @NativeType("void") + public static float glGetnMapf(@NativeType("GLenum") int target, @NativeType("GLenum") int query) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer data = stack.callocFloat(1); + nglGetnMapfv(target, query, 1, memAddress(data)); + return data.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetnMapiv ] --- + + /** + * Unsafe version of: {@link #glGetnMapiv GetnMapiv} + * + * @param bufSize the maximum number of bytes to write into {@code data} + */ + public static native void nglGetnMapiv(int target, int query, int bufSize, long data); + + /** + * Robust version of {@link GL11#glGetMapiv GetMapiv} + * + * @param target the evaluator target. One of:
{@link GL11#GL_MAP1_VERTEX_3 MAP1_VERTEX_3}{@link GL11#GL_MAP1_VERTEX_4 MAP1_VERTEX_4}{@link GL11#GL_MAP1_COLOR_4 MAP1_COLOR_4}{@link GL11#GL_MAP1_NORMAL MAP1_NORMAL}{@link GL11#GL_MAP1_TEXTURE_COORD_1 MAP1_TEXTURE_COORD_1}
{@link GL11#GL_MAP1_TEXTURE_COORD_2 MAP1_TEXTURE_COORD_2}{@link GL11#GL_MAP1_TEXTURE_COORD_3 MAP1_TEXTURE_COORD_3}{@link GL11#GL_MAP1_TEXTURE_COORD_4 MAP1_TEXTURE_COORD_4}{@link GL11#GL_MAP2_VERTEX_3 MAP2_VERTEX_3}{@link GL11#GL_MAP2_VERTEX_4 MAP2_VERTEX_4}
{@link GL11#GL_MAP2_COLOR_4 MAP2_COLOR_4}{@link GL11#GL_MAP2_NORMAL MAP2_NORMAL}{@link GL11#GL_MAP2_TEXTURE_COORD_1 MAP2_TEXTURE_COORD_1}{@link GL11#GL_MAP2_TEXTURE_COORD_2 MAP2_TEXTURE_COORD_2}{@link GL11#GL_MAP2_TEXTURE_COORD_3 MAP2_TEXTURE_COORD_3}
{@link GL11#GL_MAP2_TEXTURE_COORD_4 MAP2_TEXTURE_COORD_4}
+ * @param query the information to query. One of:
{@link GL11#GL_ORDER ORDER}{@link GL11#GL_COEFF COEFF}{@link GL11#GL_DOMAIN DOMAIN}
+ * @param data a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnMapiv(@NativeType("GLenum") int target, @NativeType("GLenum") int query, @NativeType("GLint *") IntBuffer data) { + nglGetnMapiv(target, query, data.remaining(), memAddress(data)); + } + + /** + * Robust version of {@link GL11#glGetMapiv GetMapiv} + * + * @param target the evaluator target. One of:
{@link GL11#GL_MAP1_VERTEX_3 MAP1_VERTEX_3}{@link GL11#GL_MAP1_VERTEX_4 MAP1_VERTEX_4}{@link GL11#GL_MAP1_COLOR_4 MAP1_COLOR_4}{@link GL11#GL_MAP1_NORMAL MAP1_NORMAL}{@link GL11#GL_MAP1_TEXTURE_COORD_1 MAP1_TEXTURE_COORD_1}
{@link GL11#GL_MAP1_TEXTURE_COORD_2 MAP1_TEXTURE_COORD_2}{@link GL11#GL_MAP1_TEXTURE_COORD_3 MAP1_TEXTURE_COORD_3}{@link GL11#GL_MAP1_TEXTURE_COORD_4 MAP1_TEXTURE_COORD_4}{@link GL11#GL_MAP2_VERTEX_3 MAP2_VERTEX_3}{@link GL11#GL_MAP2_VERTEX_4 MAP2_VERTEX_4}
{@link GL11#GL_MAP2_COLOR_4 MAP2_COLOR_4}{@link GL11#GL_MAP2_NORMAL MAP2_NORMAL}{@link GL11#GL_MAP2_TEXTURE_COORD_1 MAP2_TEXTURE_COORD_1}{@link GL11#GL_MAP2_TEXTURE_COORD_2 MAP2_TEXTURE_COORD_2}{@link GL11#GL_MAP2_TEXTURE_COORD_3 MAP2_TEXTURE_COORD_3}
{@link GL11#GL_MAP2_TEXTURE_COORD_4 MAP2_TEXTURE_COORD_4}
+ * @param query the information to query. One of:
{@link GL11#GL_ORDER ORDER}{@link GL11#GL_COEFF COEFF}{@link GL11#GL_DOMAIN DOMAIN}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetnMapi(@NativeType("GLenum") int target, @NativeType("GLenum") int query) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer data = stack.callocInt(1); + nglGetnMapiv(target, query, 1, memAddress(data)); + return data.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetnPixelMapfv ] --- + + /** + * Unsafe version of: {@link #glGetnPixelMapfv GetnPixelMapfv} + * + * @param bufSize the maximum number of bytes to write into {@code data} + */ + public static native void nglGetnPixelMapfv(int map, int bufSize, long data); + + /** + * Robust version of {@link GL11#glGetPixelMapfv GetPixelMapfv} + * + * @param map the pixel map parameter to query. One of:
{@link GL11#GL_PIXEL_MAP_I_TO_I PIXEL_MAP_I_TO_I}{@link GL11#GL_PIXEL_MAP_S_TO_S PIXEL_MAP_S_TO_S}{@link GL11#GL_PIXEL_MAP_I_TO_R PIXEL_MAP_I_TO_R}{@link GL11#GL_PIXEL_MAP_I_TO_G PIXEL_MAP_I_TO_G}{@link GL11#GL_PIXEL_MAP_I_TO_B PIXEL_MAP_I_TO_B}
{@link GL11#GL_PIXEL_MAP_I_TO_A PIXEL_MAP_I_TO_A}{@link GL11#GL_PIXEL_MAP_R_TO_R PIXEL_MAP_R_TO_R}{@link GL11#GL_PIXEL_MAP_G_TO_G PIXEL_MAP_G_TO_G}{@link GL11#GL_PIXEL_MAP_B_TO_B PIXEL_MAP_B_TO_B}{@link GL11#GL_PIXEL_MAP_A_TO_A PIXEL_MAP_A_TO_A}
+ * @param data a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnPixelMapfv(@NativeType("GLenum") int map, @NativeType("GLfloat *") FloatBuffer data) { + nglGetnPixelMapfv(map, data.remaining(), memAddress(data)); + } + + // --- [ glGetnPixelMapuiv ] --- + + /** + * Unsafe version of: {@link #glGetnPixelMapuiv GetnPixelMapuiv} + * + * @param bufSize the maximum number of bytes to write into {@code data} + */ + public static native void nglGetnPixelMapuiv(int map, int bufSize, long data); + + /** + * Robust version of {@link GL11#glGetPixelMapuiv GetPixelMapuiv} + * + * @param map the pixel map parameter to query + * @param data a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnPixelMapuiv(@NativeType("GLenum") int map, @NativeType("GLuint *") IntBuffer data) { + nglGetnPixelMapuiv(map, data.remaining(), memAddress(data)); + } + + // --- [ glGetnPixelMapusv ] --- + + /** + * Unsafe version of: {@link #glGetnPixelMapusv GetnPixelMapusv} + * + * @param bufSize the maximum number of bytes to write into {@code data} + */ + public static native void nglGetnPixelMapusv(int map, int bufSize, long data); + + /** + * Robust version of {@link GL11#glGetPixelMapusv GetPixelMapusv} + * + * @param map the pixel map parameter to query + * @param data a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnPixelMapusv(@NativeType("GLenum") int map, @NativeType("GLushort *") ShortBuffer data) { + nglGetnPixelMapusv(map, data.remaining(), memAddress(data)); + } + + // --- [ glGetnPolygonStipple ] --- + + /** + * Unsafe version of: {@link #glGetnPolygonStipple GetnPolygonStipple} + * + * @param bufSize the maximum number of bytes to write into {@code pattern} + */ + public static native void nglGetnPolygonStipple(int bufSize, long pattern); + + /** + * Robust version of {@link GL11#glGetPolygonStipple GetPolygonStipple} + * + * @param bufSize the maximum number of bytes to write into {@code pattern} + * @param pattern a buffer in which to place the returned pattern + * + * @see Reference Page + */ + public static void glGetnPolygonStipple(@NativeType("GLsizei") int bufSize, @NativeType("GLubyte *") long pattern) { + nglGetnPolygonStipple(bufSize, pattern); + } + + /** + * Robust version of {@link GL11#glGetPolygonStipple GetPolygonStipple} + * + * @param pattern a buffer in which to place the returned pattern + * + * @see Reference Page + */ + public static void glGetnPolygonStipple(@NativeType("GLubyte *") ByteBuffer pattern) { + nglGetnPolygonStipple(pattern.remaining(), memAddress(pattern)); + } + + // --- [ glGetnTexImage ] --- + + /** + * Unsafe version of: {@link #glGetnTexImage GetnTexImage} + * + * @param bufSize the maximum number of bytes to write into {@code img} + */ + public static void nglGetnTexImage(int tex, int level, int format, int type, int bufSize, long img) { + GL45C.nglGetnTexImage(tex, level, format, type, bufSize, img); + } + + /** + * Robust version of {@link GL11C#glGetTexImage GetTexImage} + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param bufSize the maximum number of bytes to write into {@code img} + * @param img a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int bufSize, @NativeType("void *") long img) { + GL45C.glGetnTexImage(tex, level, format, type, bufSize, img); + } + + /** + * Robust version of {@link GL11C#glGetTexImage GetTexImage} + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param img a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer img) { + GL45C.glGetnTexImage(tex, level, format, type, img); + } + + /** + * Robust version of {@link GL11C#glGetTexImage GetTexImage} + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param img a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ShortBuffer img) { + GL45C.glGetnTexImage(tex, level, format, type, img); + } + + /** + * Robust version of {@link GL11C#glGetTexImage GetTexImage} + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param img a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") IntBuffer img) { + GL45C.glGetnTexImage(tex, level, format, type, img); + } + + /** + * Robust version of {@link GL11C#glGetTexImage GetTexImage} + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param img a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") FloatBuffer img) { + GL45C.glGetnTexImage(tex, level, format, type, img); + } + + /** + * Robust version of {@link GL11C#glGetTexImage GetTexImage} + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param img a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") DoubleBuffer img) { + GL45C.glGetnTexImage(tex, level, format, type, img); + } + + // --- [ glReadnPixels ] --- + + /** + * Unsafe version of: {@link #glReadnPixels ReadnPixels} + * + * @param bufSize the maximum number of bytes to write into {@code data} + */ + public static void nglReadnPixels(int x, int y, int width, int height, int format, int type, int bufSize, long pixels) { + GL45C.nglReadnPixels(x, y, width, height, format, type, bufSize, pixels); + } + + /** + * Behaves identically to {@link GL11C#glReadPixels ReadPixels} except that it does not write more than {@code bufSize} bytes into {@code data} + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param bufSize the maximum number of bytes to write into {@code data} + * @param pixels a buffer in which to place the returned pixel data + * + * @see Reference Page + */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int bufSize, @NativeType("void *") long pixels) { + GL45C.glReadnPixels(x, y, width, height, format, type, bufSize, pixels); + } + + /** + * Behaves identically to {@link GL11C#glReadPixels ReadPixels} except that it does not write more than {@code bufSize} bytes into {@code data} + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels a buffer in which to place the returned pixel data + * + * @see Reference Page + */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer pixels) { + GL45C.glReadnPixels(x, y, width, height, format, type, pixels); + } + + /** + * Behaves identically to {@link GL11C#glReadPixels ReadPixels} except that it does not write more than {@code bufSize} bytes into {@code data} + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels a buffer in which to place the returned pixel data + * + * @see Reference Page + */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ShortBuffer pixels) { + GL45C.glReadnPixels(x, y, width, height, format, type, pixels); + } + + /** + * Behaves identically to {@link GL11C#glReadPixels ReadPixels} except that it does not write more than {@code bufSize} bytes into {@code data} + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels a buffer in which to place the returned pixel data + * + * @see Reference Page + */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") IntBuffer pixels) { + GL45C.glReadnPixels(x, y, width, height, format, type, pixels); + } + + /** + * Behaves identically to {@link GL11C#glReadPixels ReadPixels} except that it does not write more than {@code bufSize} bytes into {@code data} + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels a buffer in which to place the returned pixel data + * + * @see Reference Page + */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") FloatBuffer pixels) { + GL45C.glReadnPixels(x, y, width, height, format, type, pixels); + } + + // --- [ glGetnColorTable ] --- + + /** + * Unsafe version of: {@link #glGetnColorTable GetnColorTable} + * + * @param bufSize the maximum number of bytes to write into {@code table} + */ + public static native void nglGetnColorTable(int target, int format, int type, int bufSize, long table); + + /** + * Robust version of {@link ARBImaging#glGetColorTable GetColorTable} + * + * @param target the color table target. One of:
{@link ARBImaging#GL_COLOR_TABLE COLOR_TABLE}{@link ARBImaging#GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link ARBImaging#GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param format the color data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the color data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param bufSize the maximum number of bytes to write into {@code table} + * @param table a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int bufSize, @NativeType("void *") long table) { + nglGetnColorTable(target, format, type, bufSize, table); + } + + /** + * Robust version of {@link ARBImaging#glGetColorTable GetColorTable} + * + * @param target the color table target. One of:
{@link ARBImaging#GL_COLOR_TABLE COLOR_TABLE}{@link ARBImaging#GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link ARBImaging#GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param format the color data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the color data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param table a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer table) { + nglGetnColorTable(target, format, type, table.remaining(), memAddress(table)); + } + + /** + * Robust version of {@link ARBImaging#glGetColorTable GetColorTable} + * + * @param target the color table target. One of:
{@link ARBImaging#GL_COLOR_TABLE COLOR_TABLE}{@link ARBImaging#GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link ARBImaging#GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param format the color data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the color data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param table a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ShortBuffer table) { + nglGetnColorTable(target, format, type, table.remaining() << 1, memAddress(table)); + } + + /** + * Robust version of {@link ARBImaging#glGetColorTable GetColorTable} + * + * @param target the color table target. One of:
{@link ARBImaging#GL_COLOR_TABLE COLOR_TABLE}{@link ARBImaging#GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link ARBImaging#GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param format the color data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the color data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param table a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") IntBuffer table) { + nglGetnColorTable(target, format, type, table.remaining() << 2, memAddress(table)); + } + + /** + * Robust version of {@link ARBImaging#glGetColorTable GetColorTable} + * + * @param target the color table target. One of:
{@link ARBImaging#GL_COLOR_TABLE COLOR_TABLE}{@link ARBImaging#GL_POST_CONVOLUTION_COLOR_TABLE POST_CONVOLUTION_COLOR_TABLE}{@link ARBImaging#GL_POST_COLOR_MATRIX_COLOR_TABLE POST_COLOR_MATRIX_COLOR_TABLE}
+ * @param format the color data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the color data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param table a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") FloatBuffer table) { + nglGetnColorTable(target, format, type, table.remaining() << 2, memAddress(table)); + } + + // --- [ glGetnConvolutionFilter ] --- + + /** + * Unsafe version of: {@link #glGetnConvolutionFilter GetnConvolutionFilter} + * + * @param bufSize the maximum number of bytes to write into {@code image} + */ + public static native void nglGetnConvolutionFilter(int target, int format, int type, int bufSize, long image); + + /** + * Robust version of {@link ARBImaging#glGetConvolutionFilter GetConvolutionFilter} + * + * @param target the convolution target. One of:
{@link ARBImaging#GL_CONVOLUTION_1D CONVOLUTION_1D}{@link ARBImaging#GL_CONVOLUTION_2D CONVOLUTION_2D}
+ * @param format the filter data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the filter data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param bufSize the maximum number of bytes to write into {@code image} + * @param image a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnConvolutionFilter(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int bufSize, @NativeType("void *") long image) { + nglGetnConvolutionFilter(target, format, type, bufSize, image); + } + + /** + * Robust version of {@link ARBImaging#glGetConvolutionFilter GetConvolutionFilter} + * + * @param target the convolution target. One of:
{@link ARBImaging#GL_CONVOLUTION_1D CONVOLUTION_1D}{@link ARBImaging#GL_CONVOLUTION_2D CONVOLUTION_2D}
+ * @param format the filter data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the filter data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param image a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnConvolutionFilter(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer image) { + nglGetnConvolutionFilter(target, format, type, image.remaining(), memAddress(image)); + } + + // --- [ glGetnSeparableFilter ] --- + + /** + * Unsafe version of: {@link #glGetnSeparableFilter GetnSeparableFilter} + * + * @param rowBufSize the maximum number of bytes to write into {@code row} + * @param columnBufSize the maximum number of bytes to write into {@code column} + */ + public static native void nglGetnSeparableFilter(int target, int format, int type, int rowBufSize, long row, int columnBufSize, long column, long span); + + /** + * Robust version of {@link ARBImaging#glGetSeparableFilter GetSeparableFilter} + * + * @param target the filter target. Must be:
{@link ARBImaging#GL_SEPARABLE_2D SEPARABLE_2D}
+ * @param format the filter data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the filter data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param rowBufSize the maximum number of bytes to write into {@code row} + * @param row a buffer in which to return the filter row + * @param columnBufSize the maximum number of bytes to write into {@code column} + * @param column a buffer in which to return the filter column + * + * @see Reference Page + */ + public static void glGetnSeparableFilter(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int rowBufSize, @NativeType("void *") long row, @NativeType("GLsizei") int columnBufSize, @NativeType("void *") long column, @Nullable @NativeType("void *") ByteBuffer span) { + nglGetnSeparableFilter(target, format, type, rowBufSize, row, columnBufSize, column, memAddressSafe(span)); + } + + /** + * Robust version of {@link ARBImaging#glGetSeparableFilter GetSeparableFilter} + * + * @param target the filter target. Must be:
{@link ARBImaging#GL_SEPARABLE_2D SEPARABLE_2D}
+ * @param format the filter data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the filter data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param row a buffer in which to return the filter row + * @param column a buffer in which to return the filter column + * + * @see Reference Page + */ + public static void glGetnSeparableFilter(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer row, @NativeType("void *") ByteBuffer column, @Nullable @NativeType("void *") ByteBuffer span) { + nglGetnSeparableFilter(target, format, type, row.remaining(), memAddress(row), column.remaining(), memAddress(column), memAddressSafe(span)); + } + + // --- [ glGetnHistogram ] --- + + /** + * Unsafe version of: {@link #glGetnHistogram GetnHistogram} + * + * @param bufSize the maximum number of bytes to write into {@code values} + */ + public static native void nglGetnHistogram(int target, boolean reset, int format, int type, int bufSize, long values); + + /** + * Robust version of {@link ARBImaging#glGetHistogram GetHistogram} + * + * @param target the histogram target. Must be:
{@link ARBImaging#GL_HISTOGRAM HISTOGRAM}
+ * @param reset if {@link GL11#GL_TRUE TRUE}, then all counters of all elements of the histogram are reset to zero. Counters are reset whether returned or not. + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel data types. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param bufSize the maximum number of bytes to write into {@code values} + * @param values a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnHistogram(@NativeType("GLenum") int target, @NativeType("GLboolean") boolean reset, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int bufSize, @NativeType("void *") long values) { + nglGetnHistogram(target, reset, format, type, bufSize, values); + } + + /** + * Robust version of {@link ARBImaging#glGetHistogram GetHistogram} + * + * @param target the histogram target. Must be:
{@link ARBImaging#GL_HISTOGRAM HISTOGRAM}
+ * @param reset if {@link GL11#GL_TRUE TRUE}, then all counters of all elements of the histogram are reset to zero. Counters are reset whether returned or not. + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel data types. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param values a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnHistogram(@NativeType("GLenum") int target, @NativeType("GLboolean") boolean reset, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer values) { + nglGetnHistogram(target, reset, format, type, values.remaining(), memAddress(values)); + } + + // --- [ glGetnMinmax ] --- + + /** + * Unsafe version of: {@link #glGetnMinmax GetnMinmax} + * + * @param bufSize the maximum number of bytes to write into {@code values} + */ + public static native void nglGetnMinmax(int target, boolean reset, int format, int type, int bufSize, long values); + + /** + * Robust version of {@link ARBImaging#glGetMinmax GetMinmax} + * + * @param target the minmax target. Must be:
{@link ARBImaging#GL_MINMAX MINMAX}
+ * @param reset If {@link GL11#GL_TRUE TRUE}, then each minimum value is reset to the maximum representable value, and each maximum value is reset to the minimum + * representable value. All values are reset, whether returned or not. + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param bufSize the maximum number of bytes to write into {@code values} + * @param values a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnMinmax(@NativeType("GLenum") int target, @NativeType("GLboolean") boolean reset, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int bufSize, @NativeType("void *") long values) { + nglGetnMinmax(target, reset, format, type, bufSize, values); + } + + /** + * Robust version of {@link ARBImaging#glGetMinmax GetMinmax} + * + * @param target the minmax target. Must be:
{@link ARBImaging#GL_MINMAX MINMAX}
+ * @param reset If {@link GL11#GL_TRUE TRUE}, then each minimum value is reset to the maximum representable value, and each maximum value is reset to the minimum + * representable value. All values are reset, whether returned or not. + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL11#GL_RGB RGB}{@link GL11#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}{@link GL12#GL_BGRA BGRA}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}
{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}
{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
+ * @param values a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnMinmax(@NativeType("GLenum") int target, @NativeType("GLboolean") boolean reset, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer values) { + nglGetnMinmax(target, reset, format, type, values.remaining(), memAddress(values)); + } + + // --- [ glGetnCompressedTexImage ] --- + + /** + * Unsafe version of: {@link #glGetnCompressedTexImage GetnCompressedTexImage} + * + * @param bufSize the maximum number of bytes to write into {@code img} + */ + public static void nglGetnCompressedTexImage(int target, int level, int bufSize, long img) { + GL45C.nglGetnCompressedTexImage(target, level, bufSize, img); + } + + /** + * Robust version of {@link GL13C#glGetCompressedTexImage GetCompressedTexImage} + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}
{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param bufSize the maximum number of bytes to write into {@code img} + * @param img a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnCompressedTexImage(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLsizei") int bufSize, @NativeType("void *") long img) { + GL45C.glGetnCompressedTexImage(target, level, bufSize, img); + } + + /** + * Robust version of {@link GL13C#glGetCompressedTexImage GetCompressedTexImage} + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}
{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param img a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnCompressedTexImage(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("void *") ByteBuffer img) { + GL45C.glGetnCompressedTexImage(target, level, img); + } + + // --- [ glGetnUniformfv ] --- + + /** + * Unsafe version of: {@link #glGetnUniformfv GetnUniformfv} + * + * @param bufSize the maximum number of bytes to write to {@code params} + */ + public static void nglGetnUniformfv(int program, int location, int bufSize, long params) { + GL45C.nglGetnUniformfv(program, location, bufSize, params); + } + + /** + * Returns the value or values of a uniform of the default uniform block. + * + * @param program the program object + * @param location the uniform location + * @param params the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnUniformfv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat *") FloatBuffer params) { + GL45C.glGetnUniformfv(program, location, params); + } + + /** + * Returns the value or values of a uniform of the default uniform block. + * + * @param program the program object + * @param location the uniform location + * + * @see Reference Page + */ + @NativeType("void") + public static float glGetnUniformf(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + return GL45C.glGetnUniformf(program, location); + } + + // --- [ glGetnUniformdv ] --- + + /** + * Unsafe version of: {@link #glGetnUniformdv GetnUniformdv} + * + * @param bufSize the maximum number of bytes to write to {@code params} + */ + public static void nglGetnUniformdv(int program, int location, int bufSize, long params) { + GL45C.nglGetnUniformdv(program, location, bufSize, params); + } + + /** + * Double version of {@link #glGetnUniformfv GetnUniformfv}. + * + * @param program the program object + * @param location the uniform location + * @param params the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnUniformdv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble *") DoubleBuffer params) { + GL45C.glGetnUniformdv(program, location, params); + } + + /** + * Double version of {@link #glGetnUniformfv GetnUniformfv}. + * + * @param program the program object + * @param location the uniform location + * + * @see Reference Page + */ + @NativeType("void") + public static double glGetnUniformd(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + return GL45C.glGetnUniformd(program, location); + } + + // --- [ glGetnUniformiv ] --- + + /** + * Unsafe version of: {@link #glGetnUniformiv GetnUniformiv} + * + * @param bufSize the maximum number of bytes to write to {@code params} + */ + public static void nglGetnUniformiv(int program, int location, int bufSize, long params) { + GL45C.nglGetnUniformiv(program, location, bufSize, params); + } + + /** + * Integer version of {@link #glGetnUniformfv GetnUniformfv}. + * + * @param program the program object + * @param location the uniform location + * @param params the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnUniformiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint *") IntBuffer params) { + GL45C.glGetnUniformiv(program, location, params); + } + + /** + * Integer version of {@link #glGetnUniformfv GetnUniformfv}. + * + * @param program the program object + * @param location the uniform location + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetnUniformi(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + return GL45C.glGetnUniformi(program, location); + } + + // --- [ glGetnUniformuiv ] --- + + /** + * Unsafe version of: {@link #glGetnUniformuiv GetnUniformuiv} + * + * @param bufSize the maximum number of bytes to write to {@code params} + */ + public static void nglGetnUniformuiv(int program, int location, int bufSize, long params) { + GL45C.nglGetnUniformuiv(program, location, bufSize, params); + } + + /** + * Unsigned version of {@link #glGetnUniformiv GetnUniformiv}. + * + * @param program the program object + * @param location the uniform location + * @param params the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnUniformuiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint *") IntBuffer params) { + GL45C.glGetnUniformuiv(program, location, params); + } + + /** + * Unsigned version of {@link #glGetnUniformiv GetnUniformiv}. + * + * @param program the program object + * @param location the uniform location + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetnUniformui(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + return GL45C.glGetnUniformui(program, location); + } + + /** + * Array version of: {@link #glCreateTransformFeedbacks CreateTransformFeedbacks} + * + * @see Reference Page + */ + public static void glCreateTransformFeedbacks(@NativeType("GLuint *") int[] ids) { + GL45C.glCreateTransformFeedbacks(ids); + } + + /** + * Array version of: {@link #glGetTransformFeedbackiv GetTransformFeedbackiv} + * + * @see Reference Page + */ + public static void glGetTransformFeedbackiv(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] param) { + GL45C.glGetTransformFeedbackiv(xfb, pname, param); + } + + /** + * Array version of: {@link #glGetTransformFeedbacki_v GetTransformFeedbacki_v} + * + * @see Reference Page + */ + public static void glGetTransformFeedbacki_v(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLint *") int[] param) { + GL45C.glGetTransformFeedbacki_v(xfb, pname, index, param); + } + + /** + * Array version of: {@link #glGetTransformFeedbacki64_v GetTransformFeedbacki64_v} + * + * @see Reference Page + */ + public static void glGetTransformFeedbacki64_v(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLint64 *") long[] param) { + GL45C.glGetTransformFeedbacki64_v(xfb, pname, index, param); + } + + /** + * Array version of: {@link #glCreateBuffers CreateBuffers} + * + * @see Reference Page + */ + public static void glCreateBuffers(@NativeType("GLuint *") int[] buffers) { + GL45C.glCreateBuffers(buffers); + } + + /** + * Array version of: {@link #glNamedBufferStorage NamedBufferStorage} + * + * @see Reference Page + */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") short[] data, @NativeType("GLbitfield") int flags) { + GL45C.glNamedBufferStorage(buffer, data, flags); + } + + /** + * Array version of: {@link #glNamedBufferStorage NamedBufferStorage} + * + * @see Reference Page + */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") int[] data, @NativeType("GLbitfield") int flags) { + GL45C.glNamedBufferStorage(buffer, data, flags); + } + + /** + * Array version of: {@link #glNamedBufferStorage NamedBufferStorage} + * + * @see Reference Page + */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") float[] data, @NativeType("GLbitfield") int flags) { + GL45C.glNamedBufferStorage(buffer, data, flags); + } + + /** + * Array version of: {@link #glNamedBufferStorage NamedBufferStorage} + * + * @see Reference Page + */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") double[] data, @NativeType("GLbitfield") int flags) { + GL45C.glNamedBufferStorage(buffer, data, flags); + } + + /** + * Array version of: {@link #glNamedBufferData NamedBufferData} + * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") short[] data, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, data, usage); + } + + /** + * Array version of: {@link #glNamedBufferData NamedBufferData} + * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") int[] data, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, data, usage); + } + + /** + * Array version of: {@link #glNamedBufferData NamedBufferData} + * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") long[] data, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, data, usage); + } + + /** + * Array version of: {@link #glNamedBufferData NamedBufferData} + * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") float[] data, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, data, usage); + } + + /** + * Array version of: {@link #glNamedBufferData NamedBufferData} + * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") double[] data, @NativeType("GLenum") int usage) { + GL45C.glNamedBufferData(buffer, data, usage); + } + + /** + * Array version of: {@link #glNamedBufferSubData NamedBufferSubData} + * + * @see Reference Page + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") short[] data) { + GL45C.glNamedBufferSubData(buffer, offset, data); + } + + /** + * Array version of: {@link #glNamedBufferSubData NamedBufferSubData} + * + * @see Reference Page + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") int[] data) { + GL45C.glNamedBufferSubData(buffer, offset, data); + } + + /** + * Array version of: {@link #glNamedBufferSubData NamedBufferSubData} + * + * @see Reference Page + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") long[] data) { + GL45C.glNamedBufferSubData(buffer, offset, data); + } + + /** + * Array version of: {@link #glNamedBufferSubData NamedBufferSubData} + * + * @see Reference Page + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") float[] data) { + GL45C.glNamedBufferSubData(buffer, offset, data); + } + + /** + * Array version of: {@link #glNamedBufferSubData NamedBufferSubData} + * + * @see Reference Page + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") double[] data) { + GL45C.glNamedBufferSubData(buffer, offset, data); + } + + /** + * Array version of: {@link #glClearNamedBufferData ClearNamedBufferData} + * + * @see Reference Page + */ + public static void glClearNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] data) { + GL45C.glClearNamedBufferData(buffer, internalformat, format, type, data); + } + + /** + * Array version of: {@link #glClearNamedBufferData ClearNamedBufferData} + * + * @see Reference Page + */ + public static void glClearNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] data) { + GL45C.glClearNamedBufferData(buffer, internalformat, format, type, data); + } + + /** + * Array version of: {@link #glClearNamedBufferData ClearNamedBufferData} + * + * @see Reference Page + */ + public static void glClearNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] data) { + GL45C.glClearNamedBufferData(buffer, internalformat, format, type, data); + } + + /** + * Array version of: {@link #glClearNamedBufferSubData ClearNamedBufferSubData} + * + * @see Reference Page + */ + public static void glClearNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] data) { + GL45C.glClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); + } + + /** + * Array version of: {@link #glClearNamedBufferSubData ClearNamedBufferSubData} + * + * @see Reference Page + */ + public static void glClearNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] data) { + GL45C.glClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); + } + + /** + * Array version of: {@link #glClearNamedBufferSubData ClearNamedBufferSubData} + * + * @see Reference Page + */ + public static void glClearNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] data) { + GL45C.glClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, data); + } + + /** + * Array version of: {@link #glGetNamedBufferParameteriv GetNamedBufferParameteriv} + * + * @see Reference Page + */ + public static void glGetNamedBufferParameteriv(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL45C.glGetNamedBufferParameteriv(buffer, pname, params); + } + + /** + * Array version of: {@link #glGetNamedBufferParameteri64v GetNamedBufferParameteri64v} + * + * @see Reference Page + */ + public static void glGetNamedBufferParameteri64v(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLint64 *") long[] params) { + GL45C.glGetNamedBufferParameteri64v(buffer, pname, params); + } + + /** + * Array version of: {@link #glGetNamedBufferSubData GetNamedBufferSubData} + * + * @see Reference Page + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") short[] data) { + GL45C.glGetNamedBufferSubData(buffer, offset, data); + } + + /** + * Array version of: {@link #glGetNamedBufferSubData GetNamedBufferSubData} + * + * @see Reference Page + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") int[] data) { + GL45C.glGetNamedBufferSubData(buffer, offset, data); + } + + /** + * Array version of: {@link #glGetNamedBufferSubData GetNamedBufferSubData} + * + * @see Reference Page + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") long[] data) { + GL45C.glGetNamedBufferSubData(buffer, offset, data); + } + + /** + * Array version of: {@link #glGetNamedBufferSubData GetNamedBufferSubData} + * + * @see Reference Page + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") float[] data) { + GL45C.glGetNamedBufferSubData(buffer, offset, data); + } + + /** + * Array version of: {@link #glGetNamedBufferSubData GetNamedBufferSubData} + * + * @see Reference Page + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") double[] data) { + GL45C.glGetNamedBufferSubData(buffer, offset, data); + } + + /** + * Array version of: {@link #glCreateFramebuffers CreateFramebuffers} + * + * @see Reference Page + */ + public static void glCreateFramebuffers(@NativeType("GLuint *") int[] framebuffers) { + GL45C.glCreateFramebuffers(framebuffers); + } + + /** + * Array version of: {@link #glNamedFramebufferDrawBuffers NamedFramebufferDrawBuffers} + * + * @see Reference Page + */ + public static void glNamedFramebufferDrawBuffers(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") int[] bufs) { + GL45C.glNamedFramebufferDrawBuffers(framebuffer, bufs); + } + + /** + * Array version of: {@link #glInvalidateNamedFramebufferData InvalidateNamedFramebufferData} + * + * @see Reference Page + */ + public static void glInvalidateNamedFramebufferData(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") int[] attachments) { + GL45C.glInvalidateNamedFramebufferData(framebuffer, attachments); + } + + /** + * Array version of: {@link #glInvalidateNamedFramebufferSubData InvalidateNamedFramebufferSubData} + * + * @see Reference Page + */ + public static void glInvalidateNamedFramebufferSubData(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") int[] attachments, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + GL45C.glInvalidateNamedFramebufferSubData(framebuffer, attachments, x, y, width, height); + } + + /** + * Array version of: {@link #glClearNamedFramebufferiv ClearNamedFramebufferiv} + * + * @see Reference Page + */ + public static void glClearNamedFramebufferiv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLint *") int[] value) { + GL45C.glClearNamedFramebufferiv(framebuffer, buffer, drawbuffer, value); + } + + /** + * Array version of: {@link #glClearNamedFramebufferuiv ClearNamedFramebufferuiv} + * + * @see Reference Page + */ + public static void glClearNamedFramebufferuiv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLint *") int[] value) { + GL45C.glClearNamedFramebufferuiv(framebuffer, buffer, drawbuffer, value); + } + + /** + * Array version of: {@link #glClearNamedFramebufferfv ClearNamedFramebufferfv} + * + * @see Reference Page + */ + public static void glClearNamedFramebufferfv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLfloat *") float[] value) { + GL45C.glClearNamedFramebufferfv(framebuffer, buffer, drawbuffer, value); + } + + /** + * Array version of: {@link #glGetNamedFramebufferParameteriv GetNamedFramebufferParameteriv} + * + * @see Reference Page + */ + public static void glGetNamedFramebufferParameteriv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL45C.glGetNamedFramebufferParameteriv(framebuffer, pname, params); + } + + /** + * Array version of: {@link #glGetNamedFramebufferAttachmentParameteriv GetNamedFramebufferAttachmentParameteriv} + * + * @see Reference Page + */ + public static void glGetNamedFramebufferAttachmentParameteriv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL45C.glGetNamedFramebufferAttachmentParameteriv(framebuffer, attachment, pname, params); + } + + /** + * Array version of: {@link #glCreateRenderbuffers CreateRenderbuffers} + * + * @see Reference Page + */ + public static void glCreateRenderbuffers(@NativeType("GLuint *") int[] renderbuffers) { + GL45C.glCreateRenderbuffers(renderbuffers); + } + + /** + * Array version of: {@link #glGetNamedRenderbufferParameteriv GetNamedRenderbufferParameteriv} + * + * @see Reference Page + */ + public static void glGetNamedRenderbufferParameteriv(@NativeType("GLuint") int renderbuffer, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL45C.glGetNamedRenderbufferParameteriv(renderbuffer, pname, params); + } + + /** + * Array version of: {@link #glCreateTextures CreateTextures} + * + * @see Reference Page + */ + public static void glCreateTextures(@NativeType("GLenum") int target, @NativeType("GLuint *") int[] textures) { + GL45C.glCreateTextures(target, textures); + } + + /** + * Array version of: {@link #glTextureSubImage1D TextureSubImage1D} + * + * @see Reference Page + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] pixels) { + GL45C.glTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + /** + * Array version of: {@link #glTextureSubImage1D TextureSubImage1D} + * + * @see Reference Page + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] pixels) { + GL45C.glTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + /** + * Array version of: {@link #glTextureSubImage1D TextureSubImage1D} + * + * @see Reference Page + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] pixels) { + GL45C.glTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + /** + * Array version of: {@link #glTextureSubImage1D TextureSubImage1D} + * + * @see Reference Page + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") double[] pixels) { + GL45C.glTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + /** + * Array version of: {@link #glTextureSubImage2D TextureSubImage2D} + * + * @see Reference Page + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] pixels) { + GL45C.glTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * Array version of: {@link #glTextureSubImage2D TextureSubImage2D} + * + * @see Reference Page + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] pixels) { + GL45C.glTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * Array version of: {@link #glTextureSubImage2D TextureSubImage2D} + * + * @see Reference Page + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] pixels) { + GL45C.glTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * Array version of: {@link #glTextureSubImage2D TextureSubImage2D} + * + * @see Reference Page + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") double[] pixels) { + GL45C.glTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * Array version of: {@link #glTextureSubImage3D TextureSubImage3D} + * + * @see Reference Page + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] pixels) { + GL45C.glTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Array version of: {@link #glTextureSubImage3D TextureSubImage3D} + * + * @see Reference Page + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] pixels) { + GL45C.glTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Array version of: {@link #glTextureSubImage3D TextureSubImage3D} + * + * @see Reference Page + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] pixels) { + GL45C.glTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Array version of: {@link #glTextureSubImage3D TextureSubImage3D} + * + * @see Reference Page + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") double[] pixels) { + GL45C.glTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Array version of: {@link #glTextureParameterfv TextureParameterfv} + * + * @see Reference Page + */ + public static void glTextureParameterfv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] params) { + GL45C.glTextureParameterfv(texture, pname, params); + } + + /** + * Array version of: {@link #glTextureParameterIiv TextureParameterIiv} + * + * @see Reference Page + */ + public static void glTextureParameterIiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + GL45C.glTextureParameterIiv(texture, pname, params); + } + + /** + * Array version of: {@link #glTextureParameterIuiv TextureParameterIuiv} + * + * @see Reference Page + */ + public static void glTextureParameterIuiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLuint const *") int[] params) { + GL45C.glTextureParameterIuiv(texture, pname, params); + } + + /** + * Array version of: {@link #glTextureParameteriv TextureParameteriv} + * + * @see Reference Page + */ + public static void glTextureParameteriv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + GL45C.glTextureParameteriv(texture, pname, params); + } + + /** + * Array version of: {@link #glGetTextureImage GetTextureImage} + * + * @see Reference Page + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") short[] pixels) { + GL45C.glGetTextureImage(texture, level, format, type, pixels); + } + + /** + * Array version of: {@link #glGetTextureImage GetTextureImage} + * + * @see Reference Page + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") int[] pixels) { + GL45C.glGetTextureImage(texture, level, format, type, pixels); + } + + /** + * Array version of: {@link #glGetTextureImage GetTextureImage} + * + * @see Reference Page + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") float[] pixels) { + GL45C.glGetTextureImage(texture, level, format, type, pixels); + } + + /** + * Array version of: {@link #glGetTextureImage GetTextureImage} + * + * @see Reference Page + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") double[] pixels) { + GL45C.glGetTextureImage(texture, level, format, type, pixels); + } + + /** + * Array version of: {@link #glGetTextureLevelParameterfv GetTextureLevelParameterfv} + * + * @see Reference Page + */ + public static void glGetTextureLevelParameterfv(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + GL45C.glGetTextureLevelParameterfv(texture, level, pname, params); + } + + /** + * Array version of: {@link #glGetTextureLevelParameteriv GetTextureLevelParameteriv} + * + * @see Reference Page + */ + public static void glGetTextureLevelParameteriv(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL45C.glGetTextureLevelParameteriv(texture, level, pname, params); + } + + /** + * Array version of: {@link #glGetTextureParameterfv GetTextureParameterfv} + * + * @see Reference Page + */ + public static void glGetTextureParameterfv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + GL45C.glGetTextureParameterfv(texture, pname, params); + } + + /** + * Array version of: {@link #glGetTextureParameterIiv GetTextureParameterIiv} + * + * @see Reference Page + */ + public static void glGetTextureParameterIiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL45C.glGetTextureParameterIiv(texture, pname, params); + } + + /** + * Array version of: {@link #glGetTextureParameterIuiv GetTextureParameterIuiv} + * + * @see Reference Page + */ + public static void glGetTextureParameterIuiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLuint *") int[] params) { + GL45C.glGetTextureParameterIuiv(texture, pname, params); + } + + /** + * Array version of: {@link #glGetTextureParameteriv GetTextureParameteriv} + * + * @see Reference Page + */ + public static void glGetTextureParameteriv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + GL45C.glGetTextureParameteriv(texture, pname, params); + } + + /** + * Array version of: {@link #glCreateVertexArrays CreateVertexArrays} + * + * @see Reference Page + */ + public static void glCreateVertexArrays(@NativeType("GLuint *") int[] arrays) { + GL45C.glCreateVertexArrays(arrays); + } + + /** + * Array version of: {@link #glVertexArrayVertexBuffers VertexArrayVertexBuffers} + * + * @see Reference Page + */ + public static void glVertexArrayVertexBuffers(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") int[] buffers, @Nullable @NativeType("GLintptr const *") PointerBuffer offsets, @Nullable @NativeType("GLsizei const *") int[] strides) { + GL45C.glVertexArrayVertexBuffers(vaobj, first, buffers, offsets, strides); + } + + /** + * Array version of: {@link #glGetVertexArrayiv GetVertexArrayiv} + * + * @see Reference Page + */ + public static void glGetVertexArrayiv(@NativeType("GLuint") int vaobj, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] param) { + GL45C.glGetVertexArrayiv(vaobj, pname, param); + } + + /** + * Array version of: {@link #glGetVertexArrayIndexediv GetVertexArrayIndexediv} + * + * @see Reference Page + */ + public static void glGetVertexArrayIndexediv(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] param) { + GL45C.glGetVertexArrayIndexediv(vaobj, index, pname, param); + } + + /** + * Array version of: {@link #glGetVertexArrayIndexed64iv GetVertexArrayIndexed64iv} + * + * @see Reference Page + */ + public static void glGetVertexArrayIndexed64iv(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint64 *") long[] param) { + GL45C.glGetVertexArrayIndexed64iv(vaobj, index, pname, param); + } + + /** + * Array version of: {@link #glCreateSamplers CreateSamplers} + * + * @see Reference Page + */ + public static void glCreateSamplers(@NativeType("GLuint *") int[] samplers) { + GL45C.glCreateSamplers(samplers); + } + + /** + * Array version of: {@link #glCreateProgramPipelines CreateProgramPipelines} + * + * @see Reference Page + */ + public static void glCreateProgramPipelines(@NativeType("GLuint *") int[] pipelines) { + GL45C.glCreateProgramPipelines(pipelines); + } + + /** + * Array version of: {@link #glCreateQueries CreateQueries} + * + * @see Reference Page + */ + public static void glCreateQueries(@NativeType("GLenum") int target, @NativeType("GLuint *") int[] ids) { + GL45C.glCreateQueries(target, ids); + } + + /** + * Array version of: {@link #glGetTextureSubImage GetTextureSubImage} + * + * @see Reference Page + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") short[] pixels) { + GL45C.glGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Array version of: {@link #glGetTextureSubImage GetTextureSubImage} + * + * @see Reference Page + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") int[] pixels) { + GL45C.glGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Array version of: {@link #glGetTextureSubImage GetTextureSubImage} + * + * @see Reference Page + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") float[] pixels) { + GL45C.glGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Array version of: {@link #glGetTextureSubImage GetTextureSubImage} + * + * @see Reference Page + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") double[] pixels) { + GL45C.glGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * Array version of: {@link #glGetCompressedTextureSubImage GetCompressedTextureSubImage} + * + * @see Reference Page + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") short[] pixels) { + GL45C.glGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels); + } + + /** + * Array version of: {@link #glGetCompressedTextureSubImage GetCompressedTextureSubImage} + * + * @see Reference Page + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") int[] pixels) { + GL45C.glGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels); + } + + /** + * Array version of: {@link #glGetCompressedTextureSubImage GetCompressedTextureSubImage} + * + * @see Reference Page + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") float[] pixels) { + GL45C.glGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels); + } + + /** + * Array version of: {@link #glGetCompressedTextureSubImage GetCompressedTextureSubImage} + * + * @see Reference Page + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") double[] pixels) { + GL45C.glGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels); + } + + /** + * Array version of: {@link #glGetnMapdv GetnMapdv} + * + * @see Reference Page + */ + public static void glGetnMapdv(@NativeType("GLenum") int target, @NativeType("GLenum") int query, @NativeType("GLdouble *") double[] data) { + long __functionAddress = GL.getICD().glGetnMapdv; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, query, data.length, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetnMapfv GetnMapfv} + * + * @see Reference Page + */ + public static void glGetnMapfv(@NativeType("GLenum") int target, @NativeType("GLenum") int query, @NativeType("GLfloat *") float[] data) { + long __functionAddress = GL.getICD().glGetnMapfv; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, query, data.length, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetnMapiv GetnMapiv} + * + * @see Reference Page + */ + public static void glGetnMapiv(@NativeType("GLenum") int target, @NativeType("GLenum") int query, @NativeType("GLint *") int[] data) { + long __functionAddress = GL.getICD().glGetnMapiv; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, query, data.length, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetnPixelMapfv GetnPixelMapfv} + * + * @see Reference Page + */ + public static void glGetnPixelMapfv(@NativeType("GLenum") int map, @NativeType("GLfloat *") float[] data) { + long __functionAddress = GL.getICD().glGetnPixelMapfv; + if (CHECKS) { + check(__functionAddress); + } + callPV(map, data.length, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetnPixelMapuiv GetnPixelMapuiv} + * + * @see Reference Page + */ + public static void glGetnPixelMapuiv(@NativeType("GLenum") int map, @NativeType("GLuint *") int[] data) { + long __functionAddress = GL.getICD().glGetnPixelMapuiv; + if (CHECKS) { + check(__functionAddress); + } + callPV(map, data.length, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetnPixelMapusv GetnPixelMapusv} + * + * @see Reference Page + */ + public static void glGetnPixelMapusv(@NativeType("GLenum") int map, @NativeType("GLushort *") short[] data) { + long __functionAddress = GL.getICD().glGetnPixelMapusv; + if (CHECKS) { + check(__functionAddress); + } + callPV(map, data.length, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetnTexImage GetnTexImage} + * + * @see Reference Page + */ + public static void glGetnTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") short[] img) { + GL45C.glGetnTexImage(tex, level, format, type, img); + } + + /** + * Array version of: {@link #glGetnTexImage GetnTexImage} + * + * @see Reference Page + */ + public static void glGetnTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") int[] img) { + GL45C.glGetnTexImage(tex, level, format, type, img); + } + + /** + * Array version of: {@link #glGetnTexImage GetnTexImage} + * + * @see Reference Page + */ + public static void glGetnTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") float[] img) { + GL45C.glGetnTexImage(tex, level, format, type, img); + } + + /** + * Array version of: {@link #glGetnTexImage GetnTexImage} + * + * @see Reference Page + */ + public static void glGetnTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") double[] img) { + GL45C.glGetnTexImage(tex, level, format, type, img); + } + + /** + * Array version of: {@link #glReadnPixels ReadnPixels} + * + * @see Reference Page + */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") short[] pixels) { + GL45C.glReadnPixels(x, y, width, height, format, type, pixels); + } + + /** + * Array version of: {@link #glReadnPixels ReadnPixels} + * + * @see Reference Page + */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") int[] pixels) { + GL45C.glReadnPixels(x, y, width, height, format, type, pixels); + } + + /** + * Array version of: {@link #glReadnPixels ReadnPixels} + * + * @see Reference Page + */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") float[] pixels) { + GL45C.glReadnPixels(x, y, width, height, format, type, pixels); + } + + /** + * Array version of: {@link #glGetnColorTable GetnColorTable} + * + * @see Reference Page + */ + public static void glGetnColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") short[] table) { + long __functionAddress = GL.getICD().glGetnColorTable; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, format, type, table.length << 1, table, __functionAddress); + } + + /** + * Array version of: {@link #glGetnColorTable GetnColorTable} + * + * @see Reference Page + */ + public static void glGetnColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") int[] table) { + long __functionAddress = GL.getICD().glGetnColorTable; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, format, type, table.length << 2, table, __functionAddress); + } + + /** + * Array version of: {@link #glGetnColorTable GetnColorTable} + * + * @see Reference Page + */ + public static void glGetnColorTable(@NativeType("GLenum") int target, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") float[] table) { + long __functionAddress = GL.getICD().glGetnColorTable; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, format, type, table.length << 2, table, __functionAddress); + } + + /** + * Array version of: {@link #glGetnUniformfv GetnUniformfv} + * + * @see Reference Page + */ + public static void glGetnUniformfv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat *") float[] params) { + GL45C.glGetnUniformfv(program, location, params); + } + + /** + * Array version of: {@link #glGetnUniformdv GetnUniformdv} + * + * @see Reference Page + */ + public static void glGetnUniformdv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble *") double[] params) { + GL45C.glGetnUniformdv(program, location, params); + } + + /** + * Array version of: {@link #glGetnUniformiv GetnUniformiv} + * + * @see Reference Page + */ + public static void glGetnUniformiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint *") int[] params) { + GL45C.glGetnUniformiv(program, location, params); + } + + /** + * Array version of: {@link #glGetnUniformuiv GetnUniformuiv} + * + * @see Reference Page + */ + public static void glGetnUniformuiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint *") int[] params) { + GL45C.glGetnUniformuiv(program, location, params); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL45C.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL45C.java new file mode 100644 index 00000000..decf83d0 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL45C.java @@ -0,0 +1,5639 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality up to version 4.5. Includes only Core Profile symbols. + * + *

OpenGL 4.5 implementations support revision 4.50 of the OpenGL Shading Language.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL45C extends GL44C { + + /** Accepted by the {@code depth} parameter of {@link #glClipControl ClipControl}. */ + public static final int + GL_NEGATIVE_ONE_TO_ONE = 0x935E, + GL_ZERO_TO_ONE = 0x935F; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_CLIP_ORIGIN = 0x935C, + GL_CLIP_DEPTH_MODE = 0x935D; + + /** Accepted by the {@code mode} parameter of {@link GL30C#glBeginConditionalRender BeginConditionalRender}. */ + public static final int + GL_QUERY_WAIT_INVERTED = 0x8E17, + GL_QUERY_NO_WAIT_INVERTED = 0x8E18, + GL_QUERY_BY_REGION_WAIT_INVERTED = 0x8E19, + GL_QUERY_BY_REGION_NO_WAIT_INVERTED = 0x8E1A; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetFloatv, GetIntegerv, and GetInteger64v. */ + public static final int + GL_MAX_CULL_DISTANCES = 0x82F9, + GL_MAX_COMBINED_CLIP_AND_CULL_DISTANCES = 0x82FA; + + /** Accepted by the {@code pname} parameter of GetTextureParameter{if}v and GetTextureParameterI{i ui}v. */ + public static final int GL_TEXTURE_TARGET = 0x1006; + + /** Accepted by the {@code pname} parameter of GetQueryObjectiv. */ + public static final int GL_QUERY_TARGET = 0x82EA; + + /** Accepted by the {@code pname} parameter of GetIntegerv, GetFloatv, GetBooleanv GetDoublev and GetInteger64v. */ + public static final int GL_CONTEXT_RELEASE_BEHAVIOR = 0x82FB; + + /** Returned in {@code data} by GetIntegerv, GetFloatv, GetBooleanv GetDoublev and GetInteger64v when {@code pname} is {@link #GL_CONTEXT_RELEASE_BEHAVIOR CONTEXT_RELEASE_BEHAVIOR}. */ + public static final int GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x82FC; + + /** Returned by {@link #glGetGraphicsResetStatus GetGraphicsResetStatus}. */ + public static final int + GL_GUILTY_CONTEXT_RESET = 0x8253, + GL_INNOCENT_CONTEXT_RESET = 0x8254, + GL_UNKNOWN_CONTEXT_RESET = 0x8255; + + /** Accepted by the {@code value} parameter of GetBooleanv, GetIntegerv, and GetFloatv. */ + public static final int GL_RESET_NOTIFICATION_STRATEGY = 0x8256; + + /** Returned by GetIntegerv and related simple queries when {@code value} is {@link #GL_RESET_NOTIFICATION_STRATEGY RESET_NOTIFICATION_STRATEGY}. */ + public static final int + GL_LOSE_CONTEXT_ON_RESET = 0x8252, + GL_NO_RESET_NOTIFICATION = 0x8261; + + /** Returned by GetIntegerv when {@code pname} is CONTEXT_FLAGS. */ + public static final int GL_CONTEXT_FLAG_ROBUST_ACCESS_BIT = 0x4; + + /** Returned by {@link GL11C#glGetError GetError}. */ + public static final int GL_CONTEXT_LOST = 0x507; + + static { GL.initialize(); } + + protected GL45C() { + throw new UnsupportedOperationException(); + } + + // --- [ glClipControl ] --- + + /** + * Controls the clipping volume behavior. + * + *

These parameters update the clip control origin and depth mode respectively. The initial value of the clip control origin is {@link GL20#GL_LOWER_LEFT LOWER_LEFT} and the + * initial value of the depth mode is {@link #GL_NEGATIVE_ONE_TO_ONE NEGATIVE_ONE_TO_ONE}.

+ * + *

The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated if ClipControl is executed between the execution of {@link GL11#glBegin Begin} and the corresponding + * execution of {@link GL11#glEnd End}.

+ * + * @param origin the clip origin. One of:
{@link GL20#GL_LOWER_LEFT LOWER_LEFT}{@link GL20#GL_UPPER_LEFT UPPER_LEFT}
+ * @param depth the clip depth mode. One of:
{@link #GL_NEGATIVE_ONE_TO_ONE NEGATIVE_ONE_TO_ONE}{@link #GL_ZERO_TO_ONE ZERO_TO_ONE}
+ * + * @see Reference Page + */ + public static native void glClipControl(@NativeType("GLenum") int origin, @NativeType("GLenum") int depth); + + // --- [ glCreateTransformFeedbacks ] --- + + /** + * Unsafe version of: {@link #glCreateTransformFeedbacks CreateTransformFeedbacks} + * + * @param n the number of transform feedback object names to create + */ + public static native void nglCreateTransformFeedbacks(int n, long ids); + + /** + * Returns {@code n} previously unused transform feedback object names in {@code ids}, each representing a new state vector. + * + * @param ids the buffer in which to return the names + * + * @see Reference Page + */ + public static void glCreateTransformFeedbacks(@NativeType("GLuint *") IntBuffer ids) { + nglCreateTransformFeedbacks(ids.remaining(), memAddress(ids)); + } + + /** + * Returns {@code n} previously unused transform feedback object names in {@code ids}, each representing a new state vector. + * + * @see Reference Page + */ + @NativeType("void") + public static int glCreateTransformFeedbacks() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer ids = stack.callocInt(1); + nglCreateTransformFeedbacks(1, memAddress(ids)); + return ids.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glTransformFeedbackBufferBase ] --- + + /** + * Binds a buffer object to a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param index the transform feedback stream index + * @param buffer the name of an existing buffer object + * + * @see Reference Page + */ + public static native void glTransformFeedbackBufferBase(@NativeType("GLuint") int xfb, @NativeType("GLuint") int index, @NativeType("GLuint") int buffer); + + // --- [ glTransformFeedbackBufferRange ] --- + + /** + * Binds a region of a buffer object to a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param index the transform feedback stream index + * @param buffer the name of an existing buffer object + * @param offset the starting offset in basic machine units into the buffer object + * @param size the amount of data in machine units + * + * @see Reference Page + */ + public static native void glTransformFeedbackBufferRange(@NativeType("GLuint") int xfb, @NativeType("GLuint") int index, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size); + + // --- [ glGetTransformFeedbackiv ] --- + + /** Unsafe version of: {@link #glGetTransformFeedbackiv GetTransformFeedbackiv} */ + public static native void nglGetTransformFeedbackiv(int xfb, int pname, long param); + + /** + * Returns information about a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param pname the parameter to query. One of:
{@link GL42#GL_TRANSFORM_FEEDBACK_PAUSED TRANSFORM_FEEDBACK_PAUSED}{@link GL42#GL_TRANSFORM_FEEDBACK_ACTIVE TRANSFORM_FEEDBACK_ACTIVE}
+ * @param param the buffer in which to return the parameter value + * + * @see Reference Page + */ + public static void glGetTransformFeedbackiv(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer param) { + if (CHECKS) { + check(param, 1); + } + nglGetTransformFeedbackiv(xfb, pname, memAddress(param)); + } + + /** + * Returns information about a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param pname the parameter to query. One of:
{@link GL42#GL_TRANSFORM_FEEDBACK_PAUSED TRANSFORM_FEEDBACK_PAUSED}{@link GL42#GL_TRANSFORM_FEEDBACK_ACTIVE TRANSFORM_FEEDBACK_ACTIVE}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetTransformFeedbacki(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer param = stack.callocInt(1); + nglGetTransformFeedbackiv(xfb, pname, memAddress(param)); + return param.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTransformFeedbacki_v ] --- + + /** Unsafe version of: {@link #glGetTransformFeedbacki_v GetTransformFeedbacki_v} */ + public static native void nglGetTransformFeedbacki_v(int xfb, int pname, int index, long param); + + /** + * Returns information about a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param pname the parameter to query. Must be:
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER_BINDING TRANSFORM_FEEDBACK_BUFFER_BINDING}
+ * @param index the transform feedback stream index + * @param param the buffer in which to return the parameter value + * + * @see Reference Page + */ + public static void glGetTransformFeedbacki_v(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLint *") IntBuffer param) { + if (CHECKS) { + check(param, 1); + } + nglGetTransformFeedbacki_v(xfb, pname, index, memAddress(param)); + } + + /** + * Returns information about a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param pname the parameter to query. Must be:
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER_BINDING TRANSFORM_FEEDBACK_BUFFER_BINDING}
+ * @param index the transform feedback stream index + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetTransformFeedbacki(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLuint") int index) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer param = stack.callocInt(1); + nglGetTransformFeedbacki_v(xfb, pname, index, memAddress(param)); + return param.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTransformFeedbacki64_v ] --- + + /** Unsafe version of: {@link #glGetTransformFeedbacki64_v GetTransformFeedbacki64_v} */ + public static native void nglGetTransformFeedbacki64_v(int xfb, int pname, int index, long param); + + /** + * Returns information about a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param pname the parameter to query. One of:
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER_START TRANSFORM_FEEDBACK_BUFFER_START}{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER_SIZE TRANSFORM_FEEDBACK_BUFFER_SIZE}
+ * @param index the transform feedback stream index + * @param param the buffer in which to return the parameter value + * + * @see Reference Page + */ + public static void glGetTransformFeedbacki64_v(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLint64 *") LongBuffer param) { + if (CHECKS) { + check(param, 1); + } + nglGetTransformFeedbacki64_v(xfb, pname, index, memAddress(param)); + } + + /** + * Returns information about a transform feedback object. + * + * @param xfb zero or the name of an existing transform feedback object + * @param pname the parameter to query. One of:
{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER_START TRANSFORM_FEEDBACK_BUFFER_START}{@link GL30#GL_TRANSFORM_FEEDBACK_BUFFER_SIZE TRANSFORM_FEEDBACK_BUFFER_SIZE}
+ * @param index the transform feedback stream index + * + * @see Reference Page + */ + @NativeType("void") + public static long glGetTransformFeedbacki64(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLuint") int index) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer param = stack.callocLong(1); + nglGetTransformFeedbacki64_v(xfb, pname, index, memAddress(param)); + return param.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glCreateBuffers ] --- + + /** + * Unsafe version of: {@link #glCreateBuffers CreateBuffers} + * + * @param n the number of buffer names to create + */ + public static native void nglCreateBuffers(int n, long buffers); + + /** + * Returns {@code n} previously unused buffer names in {@code buffers}, each representing a new buffer object initialized as if it had been bound to an + * unspecified target. + * + * @param buffers the buffer in which to return the names + * + * @see Reference Page + */ + public static void glCreateBuffers(@NativeType("GLuint *") IntBuffer buffers) { + nglCreateBuffers(buffers.remaining(), memAddress(buffers)); + } + + /** + * Returns {@code n} previously unused buffer names in {@code buffers}, each representing a new buffer object initialized as if it had been bound to an + * unspecified target. + * + * @see Reference Page + */ + @NativeType("void") + public static int glCreateBuffers() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer buffers = stack.callocInt(1); + nglCreateBuffers(1, memAddress(buffers)); + return buffers.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glNamedBufferStorage ] --- + + /** + * Unsafe version of: {@link #glNamedBufferStorage NamedBufferStorage} + * + * @param size the size of the data store in basic machine units + */ + public static native void nglNamedBufferStorage(int buffer, long size, long data, int flags); + + /** + * DSA version of {@link GL44C#glBufferStorage BufferStorage}. + * + * @param buffer the buffer object name + * @param size the size of the data store in basic machine units + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("GLsizeiptr") long size, @NativeType("GLbitfield") int flags) { + nglNamedBufferStorage(buffer, size, NULL, flags); + } + + /** + * DSA version of {@link GL44C#glBufferStorage BufferStorage}. + * + * @param buffer the buffer object name + * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") ByteBuffer data, @NativeType("GLbitfield") int flags) { + nglNamedBufferStorage(buffer, data.remaining(), memAddress(data), flags); + } + + /** + * DSA version of {@link GL44C#glBufferStorage BufferStorage}. + * + * @param buffer the buffer object name + * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") ShortBuffer data, @NativeType("GLbitfield") int flags) { + nglNamedBufferStorage(buffer, Integer.toUnsignedLong(data.remaining()) << 1, memAddress(data), flags); + } + + /** + * DSA version of {@link GL44C#glBufferStorage BufferStorage}. + * + * @param buffer the buffer object name + * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") IntBuffer data, @NativeType("GLbitfield") int flags) { + nglNamedBufferStorage(buffer, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data), flags); + } + + /** + * DSA version of {@link GL44C#glBufferStorage BufferStorage}. + * + * @param buffer the buffer object name + * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") FloatBuffer data, @NativeType("GLbitfield") int flags) { + nglNamedBufferStorage(buffer, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data), flags); + } + + /** + * DSA version of {@link GL44C#glBufferStorage BufferStorage}. + * + * @param buffer the buffer object name + * @param data the address in client memory of the data that should be used to initialize the buffer's data store. If {@code data} is {@code NULL}, the data store of the + * buffer is created, but contains undefined data. Otherwise, {@code data} should point to an array of at least {@code size} basic machine units. + * @param flags the bitwise {@code OR} of flags describing the intended usage of the buffer object's data store by the application. Valid flags and their meanings + * are as follows: + * + *
    + *
  • {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT} – The contents of the data store may be updated after creation through calls to + * {@link GL15C#glBufferSubData BufferSubData}. If this bit is not set, the buffer content may not be directly updated by the client. The {@code data} + * argument may be used to specify the initial content of the buffer's data store regardless of the presence of the {@link GL44#GL_DYNAMIC_STORAGE_BIT DYNAMIC_STORAGE_BIT}. + * Regardless of the presence of this bit, buffers may always be updated with server-side calls such as {@link GL31C#glCopyBufferSubData CopyBufferSubData} and + * {@link GL43C#glClearBufferSubData ClearBufferSubData}.
  • + *
  • {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} – The buffer's data store may be mapped by the client for read access and a pointer in the client's address space + * obtained that may be read from.
  • + *
  • {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT} – The buffer's data store may be mapped by the client for write access and a pointer in the client's address + * space obtained that may be written to.
  • + *
  • {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT} – The client may request that the server read from or write to the buffer while it is mapped. The client's + * pointer to the data store remains valid so long as the data store is mapped, even during execution of drawing or dispatch commands.
  • + *
  • {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} – Shared access to buffers that are simultaneously mapped for client access and are used by the server will be + * coherent, so long as that mapping is performed using MapBufferRange. That is, data written to the store by either the client or server will be + * immediately visible to the other with no further action taken by the application. In particular: + * + *
      + *
    • If {@code MAP_COHERENT_BIT} is not set and the client performs a write followed by a call to the {@link GL42C#glMemoryBarrier MemoryBarrier} command with + * the {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the client performs a write, then in subsequent commands the server will see the writes.
    • + *
    • If {@code MAP_COHERENT_BIT} is not set and the server performs a write, the application must call {@link GL42C#glMemoryBarrier MemoryBarrier} with the + * {@link GL44#GL_CLIENT_MAPPED_BUFFER_BARRIER_BIT CLIENT_MAPPED_BUFFER_BARRIER_BIT} set and then call {@link GL32C#glFenceSync FenceSync} with {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or + * {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
    • If {@code MAP_COHERENT_BIT} is set and the server does a write, the app must call {@link GL32C#glFenceSync FenceSync} with + * {@link GL32#GL_SYNC_GPU_COMMANDS_COMPLETE SYNC_GPU_COMMANDS_COMPLETE} (or {@link GL11C#glFinish Finish}). Then the CPU will see the writes after the sync is complete.
    • + *
  • + *
  • {@link GL44#GL_CLIENT_STORAGE_BIT CLIENT_STORAGE_BIT} – When all other criteria for the buffer storage allocation are met, this bit may be used by an + * implementation to determine whether to use storage that is local to the server or to the client to serve as the backing store for the buffer.
  • + *
+ * + *

If {@code flags} contains {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}, it must also contain at least one of {@link GL30#GL_MAP_READ_BIT MAP_READ_BIT} or {@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}.

+ * + *

It is an error to specify {@link GL44#GL_MAP_COHERENT_BIT MAP_COHERENT_BIT} without also specifying {@link GL44#GL_MAP_PERSISTENT_BIT MAP_PERSISTENT_BIT}.

+ * + * @see Reference Page + */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") DoubleBuffer data, @NativeType("GLbitfield") int flags) { + nglNamedBufferStorage(buffer, Integer.toUnsignedLong(data.remaining()) << 3, memAddress(data), flags); + } + + // --- [ glNamedBufferData ] --- + + /** + * Unsafe version of: {@link #glNamedBufferData NamedBufferData} + * + * @param size the size in bytes of the buffer object's new data store + */ + public static native void nglNamedBufferData(int buffer, long size, long data, int usage); + + /** + * DSA version of {@link GL15C#glBufferData BufferData}. + * + * @param size the size in bytes of the buffer object's new data store + * @param usage the expected usage pattern of the data store. One of:
{@link GL15#GL_STREAM_DRAW STREAM_DRAW}{@link GL15#GL_STREAM_READ STREAM_READ}{@link GL15#GL_STREAM_COPY STREAM_COPY}{@link GL15#GL_STATIC_DRAW STATIC_DRAW}{@link GL15#GL_STATIC_READ STATIC_READ}{@link GL15#GL_STATIC_COPY STATIC_COPY}{@link GL15#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int usage) { + nglNamedBufferData(buffer, size, NULL, usage); + } + + /** + * DSA version of {@link GL15C#glBufferData BufferData}. + * + * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15#GL_STREAM_DRAW STREAM_DRAW}{@link GL15#GL_STREAM_READ STREAM_READ}{@link GL15#GL_STREAM_COPY STREAM_COPY}{@link GL15#GL_STATIC_DRAW STATIC_DRAW}{@link GL15#GL_STATIC_READ STATIC_READ}{@link GL15#GL_STATIC_COPY STATIC_COPY}{@link GL15#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") ByteBuffer data, @NativeType("GLenum") int usage) { + nglNamedBufferData(buffer, data.remaining(), memAddress(data), usage); + } + + /** + * DSA version of {@link GL15C#glBufferData BufferData}. + * + * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15#GL_STREAM_DRAW STREAM_DRAW}{@link GL15#GL_STREAM_READ STREAM_READ}{@link GL15#GL_STREAM_COPY STREAM_COPY}{@link GL15#GL_STATIC_DRAW STATIC_DRAW}{@link GL15#GL_STATIC_READ STATIC_READ}{@link GL15#GL_STATIC_COPY STATIC_COPY}{@link GL15#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") ShortBuffer data, @NativeType("GLenum") int usage) { + nglNamedBufferData(buffer, Integer.toUnsignedLong(data.remaining()) << 1, memAddress(data), usage); + } + + /** + * DSA version of {@link GL15C#glBufferData BufferData}. + * + * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15#GL_STREAM_DRAW STREAM_DRAW}{@link GL15#GL_STREAM_READ STREAM_READ}{@link GL15#GL_STREAM_COPY STREAM_COPY}{@link GL15#GL_STATIC_DRAW STATIC_DRAW}{@link GL15#GL_STATIC_READ STATIC_READ}{@link GL15#GL_STATIC_COPY STATIC_COPY}{@link GL15#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") IntBuffer data, @NativeType("GLenum") int usage) { + nglNamedBufferData(buffer, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data), usage); + } + + /** + * DSA version of {@link GL15C#glBufferData BufferData}. + * + * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15#GL_STREAM_DRAW STREAM_DRAW}{@link GL15#GL_STREAM_READ STREAM_READ}{@link GL15#GL_STREAM_COPY STREAM_COPY}{@link GL15#GL_STATIC_DRAW STATIC_DRAW}{@link GL15#GL_STATIC_READ STATIC_READ}{@link GL15#GL_STATIC_COPY STATIC_COPY}{@link GL15#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") LongBuffer data, @NativeType("GLenum") int usage) { + nglNamedBufferData(buffer, Integer.toUnsignedLong(data.remaining()) << 3, memAddress(data), usage); + } + + /** + * DSA version of {@link GL15C#glBufferData BufferData}. + * + * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15#GL_STREAM_DRAW STREAM_DRAW}{@link GL15#GL_STREAM_READ STREAM_READ}{@link GL15#GL_STREAM_COPY STREAM_COPY}{@link GL15#GL_STATIC_DRAW STATIC_DRAW}{@link GL15#GL_STATIC_READ STATIC_READ}{@link GL15#GL_STATIC_COPY STATIC_COPY}{@link GL15#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") FloatBuffer data, @NativeType("GLenum") int usage) { + nglNamedBufferData(buffer, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data), usage); + } + + /** + * DSA version of {@link GL15C#glBufferData BufferData}. + * + * @param data a pointer to data that will be copied into the data store for initialization, or {@code NULL} if no data is to be copied + * @param usage the expected usage pattern of the data store. One of:
{@link GL15#GL_STREAM_DRAW STREAM_DRAW}{@link GL15#GL_STREAM_READ STREAM_READ}{@link GL15#GL_STREAM_COPY STREAM_COPY}{@link GL15#GL_STATIC_DRAW STATIC_DRAW}{@link GL15#GL_STATIC_READ STATIC_READ}{@link GL15#GL_STATIC_COPY STATIC_COPY}{@link GL15#GL_DYNAMIC_DRAW DYNAMIC_DRAW}
{@link GL15#GL_DYNAMIC_READ DYNAMIC_READ}{@link GL15#GL_DYNAMIC_COPY DYNAMIC_COPY}
+ * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") DoubleBuffer data, @NativeType("GLenum") int usage) { + nglNamedBufferData(buffer, Integer.toUnsignedLong(data.remaining()) << 3, memAddress(data), usage); + } + + // --- [ glNamedBufferSubData ] --- + + /** + * Unsafe version of: {@link #glNamedBufferSubData NamedBufferSubData} + * + * @param size the size in bytes of the data store region being replaced + */ + public static native void nglNamedBufferSubData(int buffer, long offset, long size, long data); + + /** + * DSA version of {@link GL15C#glBufferSubData BufferSubData}. + * + * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") ByteBuffer data) { + nglNamedBufferSubData(buffer, offset, data.remaining(), memAddress(data)); + } + + /** + * DSA version of {@link GL15C#glBufferSubData BufferSubData}. + * + * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") ShortBuffer data) { + nglNamedBufferSubData(buffer, offset, Integer.toUnsignedLong(data.remaining()) << 1, memAddress(data)); + } + + /** + * DSA version of {@link GL15C#glBufferSubData BufferSubData}. + * + * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") IntBuffer data) { + nglNamedBufferSubData(buffer, offset, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data)); + } + + /** + * DSA version of {@link GL15C#glBufferSubData BufferSubData}. + * + * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") LongBuffer data) { + nglNamedBufferSubData(buffer, offset, Integer.toUnsignedLong(data.remaining()) << 3, memAddress(data)); + } + + /** + * DSA version of {@link GL15C#glBufferSubData BufferSubData}. + * + * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") FloatBuffer data) { + nglNamedBufferSubData(buffer, offset, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data)); + } + + /** + * DSA version of {@link GL15C#glBufferSubData BufferSubData}. + * + * @param offset the offset into the buffer object's data store where data replacement will begin, measured in bytes + * @param data a pointer to the new data that will be copied into the data store + * + * @see Reference Page + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") DoubleBuffer data) { + nglNamedBufferSubData(buffer, offset, Integer.toUnsignedLong(data.remaining()) << 3, memAddress(data)); + } + + // --- [ glCopyNamedBufferSubData ] --- + + /** + * DSA version of {@link GL31C#glCopyBufferSubData CopyBufferSubData}. + * + * @param readBuffer the source buffer object name + * @param writeBuffer the destination buffer object name + * @param readOffset the source buffer object offset, in bytes + * @param writeOffset the destination buffer object offset, in bytes + * @param size the number of bytes to copy + * + * @see Reference Page + */ + public static native void glCopyNamedBufferSubData(@NativeType("GLuint") int readBuffer, @NativeType("GLuint") int writeBuffer, @NativeType("GLintptr") long readOffset, @NativeType("GLintptr") long writeOffset, @NativeType("GLsizeiptr") long size); + + // --- [ glClearNamedBufferData ] --- + + /** Unsafe version of: {@link #glClearNamedBufferData ClearNamedBufferData} */ + public static native void nglClearNamedBufferData(int buffer, int internalformat, int format, int type, long data); + + /** + * DSA version of {@link GL43C#glClearBufferData ClearBufferData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer data) { + nglClearNamedBufferData(buffer, internalformat, format, type, memAddressSafe(data)); + } + + /** + * DSA version of {@link GL43C#glClearBufferData ClearBufferData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer data) { + nglClearNamedBufferData(buffer, internalformat, format, type, memAddressSafe(data)); + } + + /** + * DSA version of {@link GL43C#glClearBufferData ClearBufferData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer data) { + nglClearNamedBufferData(buffer, internalformat, format, type, memAddressSafe(data)); + } + + /** + * DSA version of {@link GL43C#glClearBufferData ClearBufferData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer data) { + nglClearNamedBufferData(buffer, internalformat, format, type, memAddressSafe(data)); + } + + // --- [ glClearNamedBufferSubData ] --- + + /** Unsafe version of: {@link #glClearNamedBufferSubData ClearNamedBufferSubData} */ + public static native void nglClearNamedBufferSubData(int buffer, int internalformat, long offset, long size, int format, int type, long data); + + /** + * DSA version of {@link GL43C#glClearBufferSubData ClearBufferSubData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ByteBuffer data) { + nglClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, memAddressSafe(data)); + } + + /** + * DSA version of {@link GL43C#glClearBufferSubData ClearBufferSubData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") ShortBuffer data) { + nglClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, memAddressSafe(data)); + } + + /** + * DSA version of {@link GL43C#glClearBufferSubData ClearBufferSubData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") IntBuffer data) { + nglClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, memAddressSafe(data)); + } + + /** + * DSA version of {@link GL43C#glClearBufferSubData ClearBufferSubData}. + * + * @param buffer the buffer object name + * @param internalformat the internal format with which the data will be stored in the buffer object + * @param offset the offset, in basic machine units into the buffer object's data store at which to start filling + * @param size the size, in basic machine units of the range of the data store to fill + * @param format the format of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the type of the data in memory addressed by {@code data}. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param data the buffer containing the data to be used as the source of the constant fill value. The elements of data are converted by the GL into the format + * specified by internalformat, and then used to fill the specified range of the destination buffer. If data is {@code NULL}, then it is ignored and the + * sub-range of the buffer is filled with zeros. + * + * @see Reference Page + */ + public static void glClearNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") FloatBuffer data) { + nglClearNamedBufferSubData(buffer, internalformat, offset, size, format, type, memAddressSafe(data)); + } + + // --- [ glMapNamedBuffer ] --- + + /** Unsafe version of: {@link #glMapNamedBuffer MapNamedBuffer} */ + public static native long nglMapNamedBuffer(int buffer, int access); + + /** + * DSA version of {@link GL15C#glMapBuffer MapBuffer}. + * + * @param buffer the buffer object name + * @param access the access policy, indicating whether it will be possible to read from, write to, or both read from and write to the buffer object's mapped data store. One of:
{@link GL15#GL_READ_ONLY READ_ONLY}{@link GL15#GL_WRITE_ONLY WRITE_ONLY}{@link GL15#GL_READ_WRITE READ_WRITE}
+ * + * @see Reference Page + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapNamedBuffer(@NativeType("GLuint") int buffer, @NativeType("GLenum") int access) { + long __result = nglMapNamedBuffer(buffer, access); + return memByteBufferSafe(__result, glGetNamedBufferParameteri(buffer, GL15.GL_BUFFER_SIZE)); + } + + /** + * DSA version of {@link GL15C#glMapBuffer MapBuffer}. + * + * @param buffer the buffer object name + * @param access the access policy, indicating whether it will be possible to read from, write to, or both read from and write to the buffer object's mapped data store. One of:
{@link GL15#GL_READ_ONLY READ_ONLY}{@link GL15#GL_WRITE_ONLY WRITE_ONLY}{@link GL15#GL_READ_WRITE READ_WRITE}
+ * + * @see Reference Page + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapNamedBuffer(@NativeType("GLuint") int buffer, @NativeType("GLenum") int access, @Nullable ByteBuffer old_buffer) { + long __result = nglMapNamedBuffer(buffer, access); + int length = glGetNamedBufferParameteri(buffer, GL15.GL_BUFFER_SIZE); + return apiGetMappedBuffer(old_buffer, __result, length); + } + + /** + * DSA version of {@link GL15C#glMapBuffer MapBuffer}. + * + * @param buffer the buffer object name + * @param access the access policy, indicating whether it will be possible to read from, write to, or both read from and write to the buffer object's mapped data store. One of:
{@link GL15#GL_READ_ONLY READ_ONLY}{@link GL15#GL_WRITE_ONLY WRITE_ONLY}{@link GL15#GL_READ_WRITE READ_WRITE}
+ * + * @see Reference Page + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapNamedBuffer(@NativeType("GLuint") int buffer, @NativeType("GLenum") int access, long length, @Nullable ByteBuffer old_buffer) { + long __result = nglMapNamedBuffer(buffer, access); + return apiGetMappedBuffer(old_buffer, __result, (int)length); + } + + // --- [ glMapNamedBufferRange ] --- + + /** Unsafe version of: {@link #glMapNamedBufferRange MapNamedBufferRange} */ + public static native long nglMapNamedBufferRange(int buffer, long offset, long length, int access); + + /** + * DSA version of {@link GL30C#glMapBufferRange MapBufferRange}. + * + * @param buffer the buffer object name + * @param offset the starting offset within the buffer of the range to be mapped + * @param length the length of the range to be mapped + * @param access a combination of access flags indicating the desired access to the range. One or more of:
{@link GL30#GL_MAP_READ_BIT MAP_READ_BIT}{@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}{@link GL30#GL_MAP_INVALIDATE_RANGE_BIT MAP_INVALIDATE_RANGE_BIT}{@link GL30#GL_MAP_INVALIDATE_BUFFER_BIT MAP_INVALIDATE_BUFFER_BIT}
{@link GL30#GL_MAP_FLUSH_EXPLICIT_BIT MAP_FLUSH_EXPLICIT_BIT}{@link GL30#GL_MAP_UNSYNCHRONIZED_BIT MAP_UNSYNCHRONIZED_BIT}
+ * + * @see Reference Page + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapNamedBufferRange(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length, @NativeType("GLbitfield") int access) { + long __result = nglMapNamedBufferRange(buffer, offset, length, access); + return memByteBufferSafe(__result, (int)length); + } + + /** + * DSA version of {@link GL30C#glMapBufferRange MapBufferRange}. + * + * @param buffer the buffer object name + * @param offset the starting offset within the buffer of the range to be mapped + * @param length the length of the range to be mapped + * @param access a combination of access flags indicating the desired access to the range. One or more of:
{@link GL30#GL_MAP_READ_BIT MAP_READ_BIT}{@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}{@link GL30#GL_MAP_INVALIDATE_RANGE_BIT MAP_INVALIDATE_RANGE_BIT}{@link GL30#GL_MAP_INVALIDATE_BUFFER_BIT MAP_INVALIDATE_BUFFER_BIT}
{@link GL30#GL_MAP_FLUSH_EXPLICIT_BIT MAP_FLUSH_EXPLICIT_BIT}{@link GL30#GL_MAP_UNSYNCHRONIZED_BIT MAP_UNSYNCHRONIZED_BIT}
+ * + * @see Reference Page + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapNamedBufferRange(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length, @NativeType("GLbitfield") int access, @Nullable ByteBuffer old_buffer) { + long __result = nglMapNamedBufferRange(buffer, offset, length, access); + return apiGetMappedBuffer(old_buffer, __result, (int)length); + } + + // --- [ glUnmapNamedBuffer ] --- + + /** + * DSA version of {@link GL15C#glUnmapBuffer UnmapBuffer}. + * + * @param buffer the buffer object name + * + * @see Reference Page + */ + @NativeType("GLboolean") + public static native boolean glUnmapNamedBuffer(@NativeType("GLuint") int buffer); + + // --- [ glFlushMappedNamedBufferRange ] --- + + /** + * DSA version of {@link GL30C#glFlushMappedBufferRange FlushMappedBufferRange}. + * + * @param buffer the buffer object name + * @param offset the start of the buffer subrange, in basic machine units + * @param length the length of the buffer subrange, in basic machine units + * + * @see Reference Page + */ + public static native void glFlushMappedNamedBufferRange(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long length); + + // --- [ glGetNamedBufferParameteriv ] --- + + /** Unsafe version of: {@link #glGetNamedBufferParameteriv GetNamedBufferParameteriv} */ + public static native void nglGetNamedBufferParameteriv(int buffer, int pname, long params); + + /** + * DSA version of {@link GL15C#glGetBufferParameteriv GetBufferParameteriv}. + * + * @param buffer the buffer object name + * @param pname the symbolic name of a buffer object parameter. One of:
{@link GL15#GL_BUFFER_SIZE BUFFER_SIZE}{@link GL15#GL_BUFFER_USAGE BUFFER_USAGE}{@link GL15#GL_BUFFER_ACCESS BUFFER_ACCESS}{@link GL15#GL_BUFFER_MAPPED BUFFER_MAPPED}
{@link GL30#GL_BUFFER_ACCESS_FLAGS BUFFER_ACCESS_FLAGS}{@link GL30#GL_BUFFER_MAP_LENGTH BUFFER_MAP_LENGTH}{@link GL30#GL_BUFFER_MAP_OFFSET BUFFER_MAP_OFFSET}{@link GL44#GL_BUFFER_IMMUTABLE_STORAGE BUFFER_IMMUTABLE_STORAGE}
{@link GL44#GL_BUFFER_STORAGE_FLAGS BUFFER_STORAGE_FLAGS}
+ * @param params the requested parameter + * + * @see Reference Page + */ + public static void glGetNamedBufferParameteriv(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetNamedBufferParameteriv(buffer, pname, memAddress(params)); + } + + /** + * DSA version of {@link GL15C#glGetBufferParameteriv GetBufferParameteriv}. + * + * @param buffer the buffer object name + * @param pname the symbolic name of a buffer object parameter. One of:
{@link GL15#GL_BUFFER_SIZE BUFFER_SIZE}{@link GL15#GL_BUFFER_USAGE BUFFER_USAGE}{@link GL15#GL_BUFFER_ACCESS BUFFER_ACCESS}{@link GL15#GL_BUFFER_MAPPED BUFFER_MAPPED}
{@link GL30#GL_BUFFER_ACCESS_FLAGS BUFFER_ACCESS_FLAGS}{@link GL30#GL_BUFFER_MAP_LENGTH BUFFER_MAP_LENGTH}{@link GL30#GL_BUFFER_MAP_OFFSET BUFFER_MAP_OFFSET}{@link GL44#GL_BUFFER_IMMUTABLE_STORAGE BUFFER_IMMUTABLE_STORAGE}
{@link GL44#GL_BUFFER_STORAGE_FLAGS BUFFER_STORAGE_FLAGS}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetNamedBufferParameteri(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetNamedBufferParameteriv(buffer, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetNamedBufferParameteri64v ] --- + + /** Unsafe version of: {@link #glGetNamedBufferParameteri64v GetNamedBufferParameteri64v} */ + public static native void nglGetNamedBufferParameteri64v(int buffer, int pname, long params); + + /** + * DSA version of {@link GL32C#glGetBufferParameteri64v GetBufferParameteri64v}. + * + * @param buffer the buffer object name + * @param pname the symbolic name of a buffer object parameter. One of:
{@link GL15#GL_BUFFER_SIZE BUFFER_SIZE}{@link GL15#GL_BUFFER_USAGE BUFFER_USAGE}{@link GL15#GL_BUFFER_ACCESS BUFFER_ACCESS}{@link GL15#GL_BUFFER_MAPPED BUFFER_MAPPED}
{@link GL30#GL_BUFFER_ACCESS_FLAGS BUFFER_ACCESS_FLAGS}{@link GL30#GL_BUFFER_MAP_LENGTH BUFFER_MAP_LENGTH}{@link GL30#GL_BUFFER_MAP_OFFSET BUFFER_MAP_OFFSET}{@link GL44#GL_BUFFER_IMMUTABLE_STORAGE BUFFER_IMMUTABLE_STORAGE}
{@link GL44#GL_BUFFER_STORAGE_FLAGS BUFFER_STORAGE_FLAGS}
+ * @param params the requested parameter + * + * @see Reference Page + */ + public static void glGetNamedBufferParameteri64v(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLint64 *") LongBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetNamedBufferParameteri64v(buffer, pname, memAddress(params)); + } + + /** + * DSA version of {@link GL32C#glGetBufferParameteri64v GetBufferParameteri64v}. + * + * @param buffer the buffer object name + * @param pname the symbolic name of a buffer object parameter. One of:
{@link GL15#GL_BUFFER_SIZE BUFFER_SIZE}{@link GL15#GL_BUFFER_USAGE BUFFER_USAGE}{@link GL15#GL_BUFFER_ACCESS BUFFER_ACCESS}{@link GL15#GL_BUFFER_MAPPED BUFFER_MAPPED}
{@link GL30#GL_BUFFER_ACCESS_FLAGS BUFFER_ACCESS_FLAGS}{@link GL30#GL_BUFFER_MAP_LENGTH BUFFER_MAP_LENGTH}{@link GL30#GL_BUFFER_MAP_OFFSET BUFFER_MAP_OFFSET}{@link GL44#GL_BUFFER_IMMUTABLE_STORAGE BUFFER_IMMUTABLE_STORAGE}
{@link GL44#GL_BUFFER_STORAGE_FLAGS BUFFER_STORAGE_FLAGS}
+ * + * @see Reference Page + */ + @NativeType("void") + public static long glGetNamedBufferParameteri64(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglGetNamedBufferParameteri64v(buffer, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetNamedBufferPointerv ] --- + + /** Unsafe version of: {@link #glGetNamedBufferPointerv GetNamedBufferPointerv} */ + public static native void nglGetNamedBufferPointerv(int buffer, int pname, long params); + + /** + * DSA version of {@link GL15C#glGetBufferPointerv GetBufferPointerv}. + * + * @param buffer the buffer object name + * @param pname the pointer to be returned. Must be:
{@link GL15#GL_BUFFER_MAP_POINTER BUFFER_MAP_POINTER}
+ * @param params the pointer value specified by {@code pname} + * + * @see Reference Page + */ + public static void glGetNamedBufferPointerv(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("void **") PointerBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetNamedBufferPointerv(buffer, pname, memAddress(params)); + } + + /** + * DSA version of {@link GL15C#glGetBufferPointerv GetBufferPointerv}. + * + * @param buffer the buffer object name + * @param pname the pointer to be returned. Must be:
{@link GL15#GL_BUFFER_MAP_POINTER BUFFER_MAP_POINTER}
+ * + * @see Reference Page + */ + @NativeType("void") + public static long glGetNamedBufferPointer(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + PointerBuffer params = stack.callocPointer(1); + nglGetNamedBufferPointerv(buffer, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetNamedBufferSubData ] --- + + /** + * Unsafe version of: {@link #glGetNamedBufferSubData GetNamedBufferSubData} + * + * @param size the size in bytes of the data store region being returned + */ + public static native void nglGetNamedBufferSubData(int buffer, long offset, long size, long data); + + /** + * DSA version of {@link GL15C#glGetBufferSubData GetBufferSubData}. + * + * @param buffer the buffer object name + * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") ByteBuffer data) { + nglGetNamedBufferSubData(buffer, offset, data.remaining(), memAddress(data)); + } + + /** + * DSA version of {@link GL15C#glGetBufferSubData GetBufferSubData}. + * + * @param buffer the buffer object name + * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") ShortBuffer data) { + nglGetNamedBufferSubData(buffer, offset, Integer.toUnsignedLong(data.remaining()) << 1, memAddress(data)); + } + + /** + * DSA version of {@link GL15C#glGetBufferSubData GetBufferSubData}. + * + * @param buffer the buffer object name + * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") IntBuffer data) { + nglGetNamedBufferSubData(buffer, offset, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data)); + } + + /** + * DSA version of {@link GL15C#glGetBufferSubData GetBufferSubData}. + * + * @param buffer the buffer object name + * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") LongBuffer data) { + nglGetNamedBufferSubData(buffer, offset, Integer.toUnsignedLong(data.remaining()) << 3, memAddress(data)); + } + + /** + * DSA version of {@link GL15C#glGetBufferSubData GetBufferSubData}. + * + * @param buffer the buffer object name + * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") FloatBuffer data) { + nglGetNamedBufferSubData(buffer, offset, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data)); + } + + /** + * DSA version of {@link GL15C#glGetBufferSubData GetBufferSubData}. + * + * @param buffer the buffer object name + * @param offset the offset into the buffer object's data store from which data will be returned, measured in bytes + * @param data a pointer to the location where buffer object data is returned + * + * @see Reference Page + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") DoubleBuffer data) { + nglGetNamedBufferSubData(buffer, offset, Integer.toUnsignedLong(data.remaining()) << 3, memAddress(data)); + } + + // --- [ glCreateFramebuffers ] --- + + /** + * Unsafe version of: {@link #glCreateFramebuffers CreateFramebuffers} + * + * @param n the number of framebuffer names to create + */ + public static native void nglCreateFramebuffers(int n, long framebuffers); + + /** + * Returns {@code n} previously unused framebuffer names in {@code framebuffers}, each representing a new framebuffer object. + * + * @param framebuffers the buffer in which to store the framebuffer names + * + * @see Reference Page + */ + public static void glCreateFramebuffers(@NativeType("GLuint *") IntBuffer framebuffers) { + nglCreateFramebuffers(framebuffers.remaining(), memAddress(framebuffers)); + } + + /** + * Returns {@code n} previously unused framebuffer names in {@code framebuffers}, each representing a new framebuffer object. + * + * @see Reference Page + */ + @NativeType("void") + public static int glCreateFramebuffers() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer framebuffers = stack.callocInt(1); + nglCreateFramebuffers(1, memAddress(framebuffers)); + return framebuffers.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glNamedFramebufferRenderbuffer ] --- + + /** + * DSA version of {@link GL30C#glFramebufferRenderbuffer FramebufferRenderbuffer}. + * + * @param framebuffer the framebuffer name + * @param attachment the attachment point of the framebuffer. One of:
{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param renderbuffertarget the renderbuffer target. Must be:
{@link GL30#GL_RENDERBUFFER RENDERBUFFER}
+ * @param renderbuffer the name of an existing renderbuffer object of type {@code renderbuffertarget} to attach + * + * @see Reference Page + */ + public static native void glNamedFramebufferRenderbuffer(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLenum") int renderbuffertarget, @NativeType("GLuint") int renderbuffer); + + // --- [ glNamedFramebufferParameteri ] --- + + /** + * DSA version of {@link GL43C#glFramebufferParameteri FramebufferParameteri}. + * + * @param framebuffer the framebuffer name + * @param pname a token indicating the parameter to be modified. One of:
{@link GL43#GL_FRAMEBUFFER_DEFAULT_WIDTH FRAMEBUFFER_DEFAULT_WIDTH}{@link GL43#GL_FRAMEBUFFER_DEFAULT_HEIGHT FRAMEBUFFER_DEFAULT_HEIGHT}
{@link GL43#GL_FRAMEBUFFER_DEFAULT_LAYERS FRAMEBUFFER_DEFAULT_LAYERS}{@link GL43#GL_FRAMEBUFFER_DEFAULT_SAMPLES FRAMEBUFFER_DEFAULT_SAMPLES}
{@link GL43#GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS}
+ * @param param the new value for the parameter named {@code pname} + * + * @see Reference Page + */ + public static native void glNamedFramebufferParameteri(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int pname, @NativeType("GLint") int param); + + // --- [ glNamedFramebufferTexture ] --- + + /** + * DSA version of {@link GL32C#glFramebufferTexture FramebufferTexture}. + * + * @param framebuffer the framebuffer name + * @param attachment the attachment point of the framebuffer + * @param texture the texture object to attach to the framebuffer attachment point named by {@code attachment} + * @param level the mipmap level of {@code texture} to attach + * + * @see Reference Page + */ + public static native void glNamedFramebufferTexture(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level); + + // --- [ glNamedFramebufferTextureLayer ] --- + + /** + * DSA version of {@link GL30C#glFramebufferTextureLayer FramebufferTextureLayer}. + * + * @param framebuffer the framebuffer name + * @param attachment the attachment point of the framebuffer. One of:
{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param texture the texture object to attach to the framebuffer attachment point named by {@code attachment} + * @param level the mipmap level of {@code texture} to attach + * @param layer the layer of {@code texture} to attach. + * + * @see Reference Page + */ + public static native void glNamedFramebufferTextureLayer(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int layer); + + // --- [ glNamedFramebufferDrawBuffer ] --- + + /** + * DSA version of {@link GL11C#glDrawBuffer DrawBuffer}. + * + * @param framebuffer the framebuffer name + * @param buf the color buffer to draw to. One of:
{@link GL11#GL_NONE NONE}{@link GL11#GL_FRONT_LEFT FRONT_LEFT}{@link GL11#GL_FRONT_RIGHT FRONT_RIGHT}{@link GL11#GL_BACK_LEFT BACK_LEFT}{@link GL11#GL_BACK_RIGHT BACK_RIGHT}{@link GL11#GL_FRONT FRONT}{@link GL11#GL_BACK BACK}{@link GL11#GL_LEFT LEFT}
{@link GL11#GL_RIGHT RIGHT}{@link GL11#GL_FRONT_AND_BACK FRONT_AND_BACK}{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}GL30.GL_COLOR_ATTACHMENT[1-15]
+ * + * @see Reference Page + */ + public static native void glNamedFramebufferDrawBuffer(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buf); + + // --- [ glNamedFramebufferDrawBuffers ] --- + + /** + * Unsafe version of: {@link #glNamedFramebufferDrawBuffers NamedFramebufferDrawBuffers} + * + * @param n the number of buffers in {@code bufs} + */ + public static native void nglNamedFramebufferDrawBuffers(int framebuffer, int n, long bufs); + + /** + * DSA version of {@link GL20C#glDrawBuffers DrawBuffers}. + * + * @param framebuffer the framebuffer name + * @param bufs an array of symbolic constants specifying the buffers into which fragment colors or data values will be written. One of:
{@link GL11#GL_NONE NONE}{@link GL11#GL_FRONT_LEFT FRONT_LEFT}{@link GL11#GL_FRONT_RIGHT FRONT_RIGHT}{@link GL11#GL_BACK_LEFT BACK_LEFT}{@link GL11#GL_BACK_RIGHT BACK_RIGHT}{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}
GL30.GL_COLOR_ATTACHMENT[1-15]
+ * + * @see Reference Page + */ + public static void glNamedFramebufferDrawBuffers(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") IntBuffer bufs) { + nglNamedFramebufferDrawBuffers(framebuffer, bufs.remaining(), memAddress(bufs)); + } + + /** + * DSA version of {@link GL20C#glDrawBuffers DrawBuffers}. + * + * @param framebuffer the framebuffer name + * + * @see Reference Page + */ + public static void glNamedFramebufferDrawBuffers(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") int buf) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer bufs = stack.ints(buf); + nglNamedFramebufferDrawBuffers(framebuffer, 1, memAddress(bufs)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glNamedFramebufferReadBuffer ] --- + + /** + * DSA version of {@link GL11C#glReadBuffer ReadBuffer}. + * + * @param framebuffer the framebuffer name + * @param src the color buffer to read from. One of:
{@link GL11#GL_NONE NONE}{@link GL11#GL_FRONT_LEFT FRONT_LEFT}{@link GL11#GL_FRONT_RIGHT FRONT_RIGHT}{@link GL11#GL_BACK_LEFT BACK_LEFT}{@link GL11#GL_BACK_RIGHT BACK_RIGHT}{@link GL11#GL_FRONT FRONT}{@link GL11#GL_BACK BACK}{@link GL11#GL_LEFT LEFT}
{@link GL11#GL_RIGHT RIGHT}{@link GL11#GL_FRONT_AND_BACK FRONT_AND_BACK}{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}GL30.GL_COLOR_ATTACHMENT[1-15]
+ * + * @see Reference Page + */ + public static native void glNamedFramebufferReadBuffer(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int src); + + // --- [ glInvalidateNamedFramebufferData ] --- + + /** + * Unsafe version of: {@link #glInvalidateNamedFramebufferData InvalidateNamedFramebufferData} + * + * @param numAttachments the number of entries in the {@code attachments} array + */ + public static native void nglInvalidateNamedFramebufferData(int framebuffer, int numAttachments, long attachments); + + /** + * DSA version of {@link GL43C#glInvalidateFramebuffer InvalidateFramebuffer}. + * + * @param framebuffer the framebuffer name + * @param attachments the address of an array identifying the attachments to be invalidated + * + * @see Reference Page + */ + public static void glInvalidateNamedFramebufferData(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") IntBuffer attachments) { + nglInvalidateNamedFramebufferData(framebuffer, attachments.remaining(), memAddress(attachments)); + } + + /** + * DSA version of {@link GL43C#glInvalidateFramebuffer InvalidateFramebuffer}. + * + * @param framebuffer the framebuffer name + * + * @see Reference Page + */ + public static void glInvalidateNamedFramebufferData(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") int attachment) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer attachments = stack.ints(attachment); + nglInvalidateNamedFramebufferData(framebuffer, 1, memAddress(attachments)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glInvalidateNamedFramebufferSubData ] --- + + /** + * Unsafe version of: {@link #glInvalidateNamedFramebufferSubData InvalidateNamedFramebufferSubData} + * + * @param numAttachments the number of entries in the {@code attachments} array + */ + public static native void nglInvalidateNamedFramebufferSubData(int framebuffer, int numAttachments, long attachments, int x, int y, int width, int height); + + /** + * DSA version of {@link GL43C#glInvalidateSubFramebuffer InvalidateSubFramebuffer}. + * + * @param framebuffer the framebuffer name + * @param attachments an array identifying the attachments to be invalidated + * @param x the X offset of the region to be invalidated + * @param y the Y offset of the region to be invalidated + * @param width the width of the region to be invalidated + * @param height the height of the region to be invalidated + * + * @see Reference Page + */ + public static void glInvalidateNamedFramebufferSubData(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") IntBuffer attachments, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + nglInvalidateNamedFramebufferSubData(framebuffer, attachments.remaining(), memAddress(attachments), x, y, width, height); + } + + /** + * DSA version of {@link GL43C#glInvalidateSubFramebuffer InvalidateSubFramebuffer}. + * + * @param framebuffer the framebuffer name + * @param x the X offset of the region to be invalidated + * @param y the Y offset of the region to be invalidated + * @param width the width of the region to be invalidated + * @param height the height of the region to be invalidated + * + * @see Reference Page + */ + public static void glInvalidateNamedFramebufferSubData(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") int attachment, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer attachments = stack.ints(attachment); + nglInvalidateNamedFramebufferSubData(framebuffer, 1, memAddress(attachments), x, y, width, height); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glClearNamedFramebufferiv ] --- + + /** Unsafe version of: {@link #glClearNamedFramebufferiv ClearNamedFramebufferiv} */ + public static native void nglClearNamedFramebufferiv(int framebuffer, int buffer, int drawbuffer, long value); + + /** + * DSA version of {@link GL30C#glClearBufferiv ClearBufferiv}. + * + * @param framebuffer the framebuffer name + * @param buffer the buffer to clear. One of:
{@link GL11#GL_COLOR COLOR}{@link GL11#GL_STENCIL STENCIL}
+ * @param drawbuffer the draw buffer to clear + * @param value for color buffers, a pointer to a four-element vector specifying R, G, B and A values to clear the buffer to. For stencil buffers, a pointer to a + * single stencil value to clear the buffer to. + * + * @see Reference Page + */ + public static void glClearNamedFramebufferiv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLint *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nglClearNamedFramebufferiv(framebuffer, buffer, drawbuffer, memAddress(value)); + } + + // --- [ glClearNamedFramebufferuiv ] --- + + /** Unsafe version of: {@link #glClearNamedFramebufferuiv ClearNamedFramebufferuiv} */ + public static native void nglClearNamedFramebufferuiv(int framebuffer, int buffer, int drawbuffer, long value); + + /** + * DSA version of {@link GL30C#glClearBufferuiv ClearBufferuiv}. + * + * @param framebuffer the framebuffer name + * @param buffer the buffer to clear. Must be:
{@link GL11#GL_COLOR COLOR}
+ * @param drawbuffer the draw buffer to clear + * @param value a pointer to a four-element vector specifying R, G, B and A values to clear the buffer to + * + * @see Reference Page + */ + public static void glClearNamedFramebufferuiv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLint *") IntBuffer value) { + if (CHECKS) { + check(value, 4); + } + nglClearNamedFramebufferuiv(framebuffer, buffer, drawbuffer, memAddress(value)); + } + + // --- [ glClearNamedFramebufferfv ] --- + + /** Unsafe version of: {@link #glClearNamedFramebufferfv ClearNamedFramebufferfv} */ + public static native void nglClearNamedFramebufferfv(int framebuffer, int buffer, int drawbuffer, long value); + + /** + * DSA version of {@link GL30C#glClearBufferfv ClearBufferfv}. + * + * @param framebuffer the framebuffer name + * @param buffer the buffer to clear. One of:
{@link GL11#GL_COLOR COLOR}{@link GL11#GL_DEPTH DEPTH}
+ * @param drawbuffer the draw buffer to clear + * @param value for color buffers, a pointer to a four-element vector specifying R, G, B and A values to clear the buffer to. For depth buffers, a pointer to a + * single depth value to clear the buffer to. + * + * @see Reference Page + */ + public static void glClearNamedFramebufferfv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLfloat *") FloatBuffer value) { + if (CHECKS) { + check(value, 1); + } + nglClearNamedFramebufferfv(framebuffer, buffer, drawbuffer, memAddress(value)); + } + + // --- [ glClearNamedFramebufferfi ] --- + + /** + * DSA version of {@link GL30C#glClearBufferfi ClearBufferfi}. + * + * @param framebuffer the framebuffer name + * @param buffer the buffer to clear. Must be:
{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param drawbuffer the draw buffer to clear + * @param depth the depth value to clear the buffer to + * @param stencil the stencil value to clear the buffer to + * + * @see Reference Page + */ + public static native void glClearNamedFramebufferfi(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLfloat") float depth, @NativeType("GLint") int stencil); + + // --- [ glBlitNamedFramebuffer ] --- + + /** + * DSA version of {@link GL30C#glBlitFramebuffer BlitFramebuffer}. + * + * @param readFramebuffer the source framebuffer name + * @param drawFramebuffer the destination framebuffer name + * @param srcX0 the lower-left coordinate of the source rectangle within the read buffer + * @param srcY0 the upper-left coordinate of the source rectangle within the read buffer + * @param srcX1 the lower-right coordinate of the source rectangle within the read buffer + * @param srcY1 the upper-right coordinate of the source rectangle within the read buffer + * @param dstX0 the lower-left coordinate of the destination rectangle within the write buffer + * @param dstY0 the upper-left coordinate of the destination rectangle within the write buffer + * @param dstX1 the lower-right coordinate of the destination rectangle within the write buffer + * @param dstY1 the upper-right coordinate of the destination rectangle within the write buffer + * @param mask the bitwise OR of the flags indicating which buffers are to be copied. One of:
{@link GL11#GL_COLOR_BUFFER_BIT COLOR_BUFFER_BIT}{@link GL11#GL_DEPTH_BUFFER_BIT DEPTH_BUFFER_BIT}{@link GL11#GL_STENCIL_BUFFER_BIT STENCIL_BUFFER_BIT}
+ * @param filter the interpolation to be applied if the image is stretched. One of:
{@link GL11#GL_NEAREST NEAREST}{@link GL11#GL_LINEAR LINEAR}
+ * + * @see Reference Page + */ + public static native void glBlitNamedFramebuffer(@NativeType("GLuint") int readFramebuffer, @NativeType("GLuint") int drawFramebuffer, @NativeType("GLint") int srcX0, @NativeType("GLint") int srcY0, @NativeType("GLint") int srcX1, @NativeType("GLint") int srcY1, @NativeType("GLint") int dstX0, @NativeType("GLint") int dstY0, @NativeType("GLint") int dstX1, @NativeType("GLint") int dstY1, @NativeType("GLbitfield") int mask, @NativeType("GLenum") int filter); + + // --- [ glCheckNamedFramebufferStatus ] --- + + /** + * DSA version of {@link GL30C#glCheckFramebufferStatus CheckFramebufferStatus}. + * + * @param framebuffer the framebuffer name + * @param target the target of the framebuffer completeness check. One of:
{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * + * @see Reference Page + */ + @NativeType("GLenum") + public static native int glCheckNamedFramebufferStatus(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int target); + + // --- [ glGetNamedFramebufferParameteriv ] --- + + /** Unsafe version of: {@link #glGetNamedFramebufferParameteriv GetNamedFramebufferParameteriv} */ + public static native void nglGetNamedFramebufferParameteriv(int framebuffer, int pname, long params); + + /** + * DSA version of {@link GL43C#glGetFramebufferParameteriv GetFramebufferParameteriv}. + * + * @param framebuffer the framebuffer name + * @param pname a token indicating the parameter to be retrieved. One of:
{@link GL43#GL_FRAMEBUFFER_DEFAULT_WIDTH FRAMEBUFFER_DEFAULT_WIDTH}{@link GL43#GL_FRAMEBUFFER_DEFAULT_HEIGHT FRAMEBUFFER_DEFAULT_HEIGHT}
{@link GL43#GL_FRAMEBUFFER_DEFAULT_LAYERS FRAMEBUFFER_DEFAULT_LAYERS}{@link GL43#GL_FRAMEBUFFER_DEFAULT_SAMPLES FRAMEBUFFER_DEFAULT_SAMPLES}
{@link GL43#GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS}
+ * @param params a variable to receive the value of the parameter named {@code pname} + * + * @see Reference Page + */ + public static void glGetNamedFramebufferParameteriv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetNamedFramebufferParameteriv(framebuffer, pname, memAddress(params)); + } + + /** + * DSA version of {@link GL43C#glGetFramebufferParameteriv GetFramebufferParameteriv}. + * + * @param framebuffer the framebuffer name + * @param pname a token indicating the parameter to be retrieved. One of:
{@link GL43#GL_FRAMEBUFFER_DEFAULT_WIDTH FRAMEBUFFER_DEFAULT_WIDTH}{@link GL43#GL_FRAMEBUFFER_DEFAULT_HEIGHT FRAMEBUFFER_DEFAULT_HEIGHT}
{@link GL43#GL_FRAMEBUFFER_DEFAULT_LAYERS FRAMEBUFFER_DEFAULT_LAYERS}{@link GL43#GL_FRAMEBUFFER_DEFAULT_SAMPLES FRAMEBUFFER_DEFAULT_SAMPLES}
{@link GL43#GL_FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS FRAMEBUFFER_DEFAULT_FIXED_SAMPLE_LOCATIONS}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetNamedFramebufferParameteri(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetNamedFramebufferParameteriv(framebuffer, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetNamedFramebufferAttachmentParameteriv ] --- + + /** Unsafe version of: {@link #glGetNamedFramebufferAttachmentParameteriv GetNamedFramebufferAttachmentParameteriv} */ + public static native void nglGetNamedFramebufferAttachmentParameteriv(int framebuffer, int attachment, int pname, long params); + + /** + * DSA version of {@link GL30C#glGetFramebufferAttachmentParameteriv GetFramebufferAttachmentParameteriv}. + * + * @param framebuffer the framebuffer name + * @param attachment the attachment within {@code target}. One of:
{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param pname the parameter of {@code attachment} to query. One of:
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME FRAMEBUFFER_ATTACHMENT_OBJECT_NAME}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE FRAMEBUFFER_ATTACHMENT_RED_SIZE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE FRAMEBUFFER_ATTACHMENT_GREEN_SIZE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE FRAMEBUFFER_ATTACHMENT_BLUE_SIZE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE}
+ * @param params an array to receive the value of the queried parameter + * + * @see Reference Page + */ + public static void glGetNamedFramebufferAttachmentParameteriv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetNamedFramebufferAttachmentParameteriv(framebuffer, attachment, pname, memAddress(params)); + } + + /** + * DSA version of {@link GL30C#glGetFramebufferAttachmentParameteriv GetFramebufferAttachmentParameteriv}. + * + * @param framebuffer the framebuffer name + * @param attachment the attachment within {@code target}. One of:
{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param pname the parameter of {@code attachment} to query. One of:
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME FRAMEBUFFER_ATTACHMENT_OBJECT_NAME}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE FRAMEBUFFER_ATTACHMENT_RED_SIZE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE FRAMEBUFFER_ATTACHMENT_GREEN_SIZE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE FRAMEBUFFER_ATTACHMENT_BLUE_SIZE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE}{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE}
{@link GL30#GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetNamedFramebufferAttachmentParameteri(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetNamedFramebufferAttachmentParameteriv(framebuffer, attachment, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glCreateRenderbuffers ] --- + + /** + * Unsafe version of: {@link #glCreateRenderbuffers CreateRenderbuffers} + * + * @param n the number of renderbuffer names to create + */ + public static native void nglCreateRenderbuffers(int n, long renderbuffers); + + /** + * Returns {@code n} previously unused renderbuffer names in {@code renderbuffers}, each representing a new renderbuffer object. + * + * @param renderbuffers the buffer in which to store the created renderbuffer names + * + * @see Reference Page + */ + public static void glCreateRenderbuffers(@NativeType("GLuint *") IntBuffer renderbuffers) { + nglCreateRenderbuffers(renderbuffers.remaining(), memAddress(renderbuffers)); + } + + /** + * Returns {@code n} previously unused renderbuffer names in {@code renderbuffers}, each representing a new renderbuffer object. + * + * @see Reference Page + */ + @NativeType("void") + public static int glCreateRenderbuffers() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer renderbuffers = stack.callocInt(1); + nglCreateRenderbuffers(1, memAddress(renderbuffers)); + return renderbuffers.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glNamedRenderbufferStorage ] --- + + /** + * DSA version of {@link GL30C#glRenderbufferStorage RenderbufferStorage}. + * + * @param internalformat the internal format to use for the renderbuffer object's image. Must be a color-renderable, depth-renderable, or stencil-renderable format. + * @param width the width of the renderbuffer, in pixels + * @param height the height of the renderbuffer, in pixels + * + * @see Reference Page + */ + public static native void glNamedRenderbufferStorage(@NativeType("GLuint") int renderbuffer, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glNamedRenderbufferStorageMultisample ] --- + + /** + * DSA version of {@link GL30C#glRenderbufferStorageMultisample RenderbufferStorageMultisample}. + * + * @param samples the number of samples to be used for the renderbuffer object's storage + * @param internalformat the internal format to use for the renderbuffer object's image. Must be a color-renderable, depth-renderable, or stencil-renderable format. + * @param width the width of the renderbuffer, in pixels + * @param height the height of the renderbuffer, in pixels + * + * @see Reference Page + */ + public static native void glNamedRenderbufferStorageMultisample(@NativeType("GLuint") int renderbuffer, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glGetNamedRenderbufferParameteriv ] --- + + /** Unsafe version of: {@link #glGetNamedRenderbufferParameteriv GetNamedRenderbufferParameteriv} */ + public static native void nglGetNamedRenderbufferParameteriv(int renderbuffer, int pname, long params); + + /** + * DSA version of {@link GL30C#glGetRenderbufferParameteriv GetRenderbufferParameteriv}. + * + * @param pname the parameter whose value to retrieve from the renderbuffer bound to {@code target}. One of:
{@link GL30#GL_RENDERBUFFER_WIDTH RENDERBUFFER_WIDTH}{@link GL30#GL_RENDERBUFFER_HEIGHT RENDERBUFFER_HEIGHT}{@link GL30#GL_RENDERBUFFER_INTERNAL_FORMAT RENDERBUFFER_INTERNAL_FORMAT}
{@link GL30#GL_RENDERBUFFER_RED_SIZE RENDERBUFFER_RED_SIZE}{@link GL30#GL_RENDERBUFFER_GREEN_SIZE RENDERBUFFER_GREEN_SIZE}{@link GL30#GL_RENDERBUFFER_BLUE_SIZE RENDERBUFFER_BLUE_SIZE}
{@link GL30#GL_RENDERBUFFER_ALPHA_SIZE RENDERBUFFER_ALPHA_SIZE}{@link GL30#GL_RENDERBUFFER_DEPTH_SIZE RENDERBUFFER_DEPTH_SIZE}{@link GL30#GL_RENDERBUFFER_STENCIL_SIZE RENDERBUFFER_STENCIL_SIZE}
{@link GL30#GL_RENDERBUFFER_SAMPLES RENDERBUFFER_SAMPLES}
+ * @param params an array to receive the value of the queried parameter + * + * @see Reference Page + */ + public static void glGetNamedRenderbufferParameteriv(@NativeType("GLuint") int renderbuffer, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetNamedRenderbufferParameteriv(renderbuffer, pname, memAddress(params)); + } + + /** + * DSA version of {@link GL30C#glGetRenderbufferParameteriv GetRenderbufferParameteriv}. + * + * @param pname the parameter whose value to retrieve from the renderbuffer bound to {@code target}. One of:
{@link GL30#GL_RENDERBUFFER_WIDTH RENDERBUFFER_WIDTH}{@link GL30#GL_RENDERBUFFER_HEIGHT RENDERBUFFER_HEIGHT}{@link GL30#GL_RENDERBUFFER_INTERNAL_FORMAT RENDERBUFFER_INTERNAL_FORMAT}
{@link GL30#GL_RENDERBUFFER_RED_SIZE RENDERBUFFER_RED_SIZE}{@link GL30#GL_RENDERBUFFER_GREEN_SIZE RENDERBUFFER_GREEN_SIZE}{@link GL30#GL_RENDERBUFFER_BLUE_SIZE RENDERBUFFER_BLUE_SIZE}
{@link GL30#GL_RENDERBUFFER_ALPHA_SIZE RENDERBUFFER_ALPHA_SIZE}{@link GL30#GL_RENDERBUFFER_DEPTH_SIZE RENDERBUFFER_DEPTH_SIZE}{@link GL30#GL_RENDERBUFFER_STENCIL_SIZE RENDERBUFFER_STENCIL_SIZE}
{@link GL30#GL_RENDERBUFFER_SAMPLES RENDERBUFFER_SAMPLES}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetNamedRenderbufferParameteri(@NativeType("GLuint") int renderbuffer, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetNamedRenderbufferParameteriv(renderbuffer, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glCreateTextures ] --- + + /** + * Unsafe version of: {@link #glCreateTextures CreateTextures} + * + * @param n the number of texture names to create + */ + public static native void nglCreateTextures(int target, int n, long textures); + + /** + * Returns {@code n} previously unused texture names in {@code textures}, each representing a new texture object. + * + * @param target the texture target. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * @param textures the buffer in which to store the created texture names + * + * @see Reference Page + */ + public static void glCreateTextures(@NativeType("GLenum") int target, @NativeType("GLuint *") IntBuffer textures) { + nglCreateTextures(target, textures.remaining(), memAddress(textures)); + } + + /** + * Returns {@code n} previously unused texture names in {@code textures}, each representing a new texture object. + * + * @param target the texture target. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP TEXTURE_CUBE_MAP}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}{@link GL31#GL_TEXTURE_BUFFER TEXTURE_BUFFER}{@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}
{@link GL32#GL_TEXTURE_2D_MULTISAMPLE_ARRAY TEXTURE_2D_MULTISAMPLE_ARRAY}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glCreateTextures(@NativeType("GLenum") int target) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer textures = stack.callocInt(1); + nglCreateTextures(target, 1, memAddress(textures)); + return textures.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glTextureBuffer ] --- + + /** + * DSA version of {@link GL31C#glTexBuffer TexBuffer}. + * + * @param texture the texture name + * @param internalformat the sized internal format of the data in the store belonging to {@code buffer} + * @param buffer the name of the buffer object whose storage to attach to the active buffer texture + * + * @see Reference Page + */ + public static native void glTextureBuffer(@NativeType("GLuint") int texture, @NativeType("GLenum") int internalformat, @NativeType("GLuint") int buffer); + + // --- [ glTextureBufferRange ] --- + + /** + * DSA version of {@link GL43C#glTexBufferRange TexBufferRange}. + * + * @param texture the texture name + * @param internalformat the internal format of the data in the store belonging to {@code buffer} + * @param buffer the name of the buffer object whose storage to attach to the active buffer texture + * @param offset the offset of the start of the range of the buffer's data store to attach + * @param size the size of the range of the buffer's data store to attach + * + * @see Reference Page + */ + public static native void glTextureBufferRange(@NativeType("GLuint") int texture, @NativeType("GLenum") int internalformat, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size); + + // --- [ glTextureStorage1D ] --- + + /** + * DSA version of {@link GL42C#glTexStorage1D TexStorage1D}. + * + * @param texture the texture name + * @param levels the number of texture levels + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * + * @see Reference Page + */ + public static native void glTextureStorage1D(@NativeType("GLuint") int texture, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width); + + // --- [ glTextureStorage2D ] --- + + /** + * DSA version of {@link GL42C#glTexStorage2D TexStorage2D}. + * + * @param texture the texture name + * @param levels the number of texture levels + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * + * @see Reference Page + */ + public static native void glTextureStorage2D(@NativeType("GLuint") int texture, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glTextureStorage3D ] --- + + /** + * DSA version of {@link GL42C#glTexStorage3D TexStorage3D}. + * + * @param texture the texture name + * @param levels the number of texture levels + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * @param depth the depth of the texture, in texels + * + * @see Reference Page + */ + public static native void glTextureStorage3D(@NativeType("GLuint") int texture, @NativeType("GLsizei") int levels, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth); + + // --- [ glTextureStorage2DMultisample ] --- + + /** + * DSA version of {@link GL43C#glTexStorage2DMultisample TexStorage2DMultisample}. + * + * @param texture the texture name + * @param samples the number of samples in the texture + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * @param fixedsamplelocations whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not + * depend on the internal format or size of the image + * + * @see Reference Page + */ + public static native void glTextureStorage2DMultisample(@NativeType("GLuint") int texture, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLboolean") boolean fixedsamplelocations); + + // --- [ glTextureStorage3DMultisample ] --- + + /** + * DSA version of {@link GL43C#glTexStorage3DMultisample TexStorage3DMultisample}. + * + * @param texture the texture name + * @param samples the number of samples in the texture + * @param internalformat the sized internal format to be used to store texture image data + * @param width the width of the texture, in texels + * @param height the height of the texture, in texels + * @param depth the depth of the texture, in texels + * @param fixedsamplelocations whether the image will use identical sample locations and the same number of samples for all texels in the image, and the sample locations will not + * depend on the internal format or size of the image + * + * @see Reference Page + */ + public static native void glTextureStorage3DMultisample(@NativeType("GLuint") int texture, @NativeType("GLsizei") int samples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLboolean") boolean fixedsamplelocations); + + // --- [ glTextureSubImage1D ] --- + + /** Unsafe version of: {@link #glTextureSubImage1D TextureSubImage1D} */ + public static native void nglTextureSubImage1D(int texture, int level, int xoffset, int width, int format, int type, long pixels); + + /** + * DSA version of {@link GL11C#glTexSubImage1D TexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer pixels) { + nglTextureSubImage1D(texture, level, xoffset, width, format, type, memAddress(pixels)); + } + + /** + * DSA version of {@link GL11C#glTexSubImage1D TexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long pixels) { + nglTextureSubImage1D(texture, level, xoffset, width, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage1D TexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer pixels) { + nglTextureSubImage1D(texture, level, xoffset, width, format, type, memAddress(pixels)); + } + + /** + * DSA version of {@link GL11C#glTexSubImage1D TexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer pixels) { + nglTextureSubImage1D(texture, level, xoffset, width, format, type, memAddress(pixels)); + } + + /** + * DSA version of {@link GL11C#glTexSubImage1D TexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer pixels) { + nglTextureSubImage1D(texture, level, xoffset, width, format, type, memAddress(pixels)); + } + + /** + * DSA version of {@link GL11C#glTexSubImage1D TexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param width the subregion width + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") DoubleBuffer pixels) { + nglTextureSubImage1D(texture, level, xoffset, width, format, type, memAddress(pixels)); + } + + // --- [ glTextureSubImage2D ] --- + + /** Unsafe version of: {@link #glTextureSubImage2D TextureSubImage2D} */ + public static native void nglTextureSubImage2D(int texture, int level, int xoffset, int yoffset, int width, int height, int format, int type, long pixels); + + /** + * DSA version of {@link GL11C#glTexSubImage2D TexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer pixels) { + nglTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, memAddress(pixels)); + } + + /** + * DSA version of {@link GL11C#glTexSubImage2D TexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long pixels) { + nglTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, pixels); + } + + /** + * DSA version of {@link GL11C#glTexSubImage2D TexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer pixels) { + nglTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, memAddress(pixels)); + } + + /** + * DSA version of {@link GL11C#glTexSubImage2D TexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer pixels) { + nglTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, memAddress(pixels)); + } + + /** + * DSA version of {@link GL11C#glTexSubImage2D TexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer pixels) { + nglTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, memAddress(pixels)); + } + + /** + * DSA version of {@link GL11C#glTexSubImage2D TexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the left coordinate of the texel subregion + * @param yoffset the bottom coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") DoubleBuffer pixels) { + nglTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, type, memAddress(pixels)); + } + + // --- [ glTextureSubImage3D ] --- + + /** Unsafe version of: {@link #glTextureSubImage3D TextureSubImage3D} */ + public static native void nglTextureSubImage3D(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, long pixels); + + /** + * DSA version of {@link GL12C#glTexSubImage3D TexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer pixels) { + nglTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddress(pixels)); + } + + /** + * DSA version of {@link GL12C#glTexSubImage3D TexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") long pixels) { + nglTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels); + } + + /** + * DSA version of {@link GL12C#glTexSubImage3D TexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") ShortBuffer pixels) { + nglTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddress(pixels)); + } + + /** + * DSA version of {@link GL12C#glTexSubImage3D TexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer pixels) { + nglTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddress(pixels)); + } + + /** + * DSA version of {@link GL12C#glTexSubImage3D TexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") FloatBuffer pixels) { + nglTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddress(pixels)); + } + + /** + * DSA version of {@link GL12C#glTexSubImage3D TexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail-number + * @param xoffset the x coordinate of the texel subregion + * @param yoffset the y coordinate of the texel subregion + * @param zoffset the z coordinate of the texel subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel data format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel data type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the pixel data + * + * @see Reference Page + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") DoubleBuffer pixels) { + nglTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, memAddress(pixels)); + } + + // --- [ glCompressedTextureSubImage1D ] --- + + /** + * Unsafe version of: {@link #glCompressedTextureSubImage1D CompressedTextureSubImage1D} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static native void nglCompressedTextureSubImage1D(int texture, int level, int xoffset, int width, int format, int imageSize, long data); + + /** + * DSA version of {@link GL13C#glCompressedTexSubImage1D CompressedTexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param width the width of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + nglCompressedTextureSubImage1D(texture, level, xoffset, width, format, imageSize, data); + } + + /** + * DSA version of {@link GL13C#glCompressedTexSubImage1D CompressedTexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param width the width of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + nglCompressedTextureSubImage1D(texture, level, xoffset, width, format, data.remaining(), memAddress(data)); + } + + // --- [ glCompressedTextureSubImage2D ] --- + + /** + * Unsafe version of: {@link #glCompressedTextureSubImage2D CompressedTextureSubImage2D} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static native void nglCompressedTextureSubImage2D(int texture, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, long data); + + /** + * DSA version of {@link GL13C#glCompressedTexSubImage2D CompressedTexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + nglCompressedTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, imageSize, data); + } + + /** + * DSA version of {@link GL13C#glCompressedTexSubImage2D CompressedTexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + nglCompressedTextureSubImage2D(texture, level, xoffset, yoffset, width, height, format, data.remaining(), memAddress(data)); + } + + // --- [ glCompressedTextureSubImage3D ] --- + + /** + * Unsafe version of: {@link #glCompressedTextureSubImage3D CompressedTextureSubImage3D} + * + * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + */ + public static native void nglCompressedTextureSubImage3D(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, long data); + + /** + * DSA version of {@link GL13C#glCompressedTexSubImage3D CompressedTexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param zoffset a texel offset in the z direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param depth the depth of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param imageSize the number of unsigned bytes of image data starting at the address specified by {@code data} + * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLsizei") int imageSize, @NativeType("void const *") long data) { + nglCompressedTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data); + } + + /** + * DSA version of {@link GL13C#glCompressedTexSubImage3D CompressedTexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param xoffset a texel offset in the x direction within the texture array + * @param yoffset a texel offset in the y direction within the texture array + * @param zoffset a texel offset in the z direction within the texture array + * @param width the width of the texture subimage + * @param height the height of the texture subimage + * @param depth the depth of the texture subimage + * @param format the format of the compressed image data stored at address {@code data}. One of:
{@link GL30#GL_COMPRESSED_RED_RGTC1 COMPRESSED_RED_RGTC1}{@link GL30#GL_COMPRESSED_SIGNED_RED_RGTC1 COMPRESSED_SIGNED_RED_RGTC1}
{@link GL30#GL_COMPRESSED_RG_RGTC2 COMPRESSED_RG_RGTC2}{@link GL30#GL_COMPRESSED_SIGNED_RG_RGTC2 COMPRESSED_SIGNED_RG_RGTC2}
{@link GL42#GL_COMPRESSED_RGBA_BPTC_UNORM COMPRESSED_RGBA_BPTC_UNORM}{@link GL42#GL_COMPRESSED_SRGB_ALPHA_BPTC_UNORM COMPRESSED_SRGB_ALPHA_BPTC_UNORM}
{@link GL42#GL_COMPRESSED_RGB_BPTC_SIGNED_FLOAT COMPRESSED_RGB_BPTC_SIGNED_FLOAT}{@link GL42#GL_COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT COMPRESSED_RGB_BPTC_UNSIGNED_FLOAT}
{@link GL43#GL_COMPRESSED_RGB8_ETC2 COMPRESSED_RGB8_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_ETC2 COMPRESSED_SRGB8_ETC2}
{@link GL43#GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2}{@link GL43#GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2}
{@link GL43#GL_COMPRESSED_RGBA8_ETC2_EAC COMPRESSED_RGBA8_ETC2_EAC}{@link GL43#GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC COMPRESSED_SRGB8_ALPHA8_ETC2_EAC}
{@link GL43#GL_COMPRESSED_R11_EAC COMPRESSED_R11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_R11_EAC COMPRESSED_SIGNED_R11_EAC}
{@link GL43#GL_COMPRESSED_RG11_EAC COMPRESSED_RG11_EAC}{@link GL43#GL_COMPRESSED_SIGNED_RG11_EAC COMPRESSED_SIGNED_RG11_EAC}
see {@link EXTTextureCompressionS3TC}see {@link EXTTextureCompressionLATC}
see {@link ATITextureCompression3DC}see {@link KHRTextureCompressionASTCLDR}
+ * @param data a pointer to the compressed image data + * + * @see Reference Page + */ + public static void glCompressedTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer data) { + nglCompressedTextureSubImage3D(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, data.remaining(), memAddress(data)); + } + + // --- [ glCopyTextureSubImage1D ] --- + + /** + * DSA version of {@link GL11C#glCopyTexSubImage1D CopyTexSubImage1D}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param xoffset the left texel coordinate of the texture subregion to update + * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the texture subregion width + * + * @see Reference Page + */ + public static native void glCopyTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width); + + // --- [ glCopyTextureSubImage2D ] --- + + /** + * DSA version of {@link GL11C#glCopyTexSubImage2D CopyTexSubImage2D}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param xoffset the left texel coordinate of the texture subregion to update + * @param yoffset the lower texel coordinate of the texture subregion to update + * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the texture subregion width + * @param height the texture subregion height + * + * @see Reference Page + */ + public static native void glCopyTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glCopyTextureSubImage3D ] --- + + /** + * DSA version of {@link GL12C#glCopyTexSubImage3D CopyTexSubImage3D}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param xoffset the x coordinate of the texture subregion to update + * @param yoffset the y coordinate of the texture subregion to update + * @param zoffset the z coordinate of the texture subregion to update + * @param x the left framebuffer pixel coordinate + * @param y the lower framebuffer pixel coordinate + * @param width the texture subregion width + * @param height the texture subregion height + * + * @see Reference Page + */ + public static native void glCopyTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + // --- [ glTextureParameterf ] --- + + /** + * DSA version of {@link GL11C#glTexParameterf TexParameterf}. + * + * @param texture the texture name + * @param pname the parameter to set + * @param param the parameter value + * + * @see Reference Page + */ + public static native void glTextureParameterf(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLfloat") float param); + + // --- [ glTextureParameterfv ] --- + + /** Unsafe version of: {@link #glTextureParameterfv TextureParameterfv} */ + public static native void nglTextureParameterfv(int texture, int pname, long params); + + /** + * DSA version of {@link GL11C#glTexParameterfv TexParameterfv}. + * + * @param texture the texture name + * @param pname the parameter to set + * @param params the parameter value + * + * @see Reference Page + */ + public static void glTextureParameterfv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglTextureParameterfv(texture, pname, memAddress(params)); + } + + // --- [ glTextureParameteri ] --- + + /** + * DSA version of {@link GL11C#glTexParameteri TexParameteri}. + * + * @param texture the texture name + * @param pname the parameter to set. One of:
{@link GL12#GL_TEXTURE_BASE_LEVEL TEXTURE_BASE_LEVEL}{@link GL11#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}{@link GL12#GL_TEXTURE_MAX_LEVEL TEXTURE_MAX_LEVEL}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}
{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL33#GL_TEXTURE_SWIZZLE_R TEXTURE_SWIZZLE_R}{@link GL33#GL_TEXTURE_SWIZZLE_G TEXTURE_SWIZZLE_G}
{@link GL33#GL_TEXTURE_SWIZZLE_B TEXTURE_SWIZZLE_B}{@link GL33#GL_TEXTURE_SWIZZLE_A TEXTURE_SWIZZLE_A}{@link GL33#GL_TEXTURE_SWIZZLE_RGBA TEXTURE_SWIZZLE_RGBA}{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}
{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL14#GL_DEPTH_TEXTURE_MODE DEPTH_TEXTURE_MODE}{@link GL14#GL_GENERATE_MIPMAP GENERATE_MIPMAP}
+ * @param param the parameter value + * + * @see Reference Page + */ + public static native void glTextureParameteri(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint") int param); + + // --- [ glTextureParameterIiv ] --- + + /** Unsafe version of: {@link #glTextureParameterIiv TextureParameterIiv} */ + public static native void nglTextureParameterIiv(int texture, int pname, long params); + + /** + * DSA version of {@link GL30C#glTexParameterIiv TexParameterIiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a single-valued texture parameter + * @param params the value of {@code pname} + * + * @see Reference Page + */ + public static void glTextureParameterIiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglTextureParameterIiv(texture, pname, memAddress(params)); + } + + /** + * DSA version of {@link GL30C#glTexParameterIiv TexParameterIiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a single-valued texture parameter + * + * @see Reference Page + */ + public static void glTextureParameterIi(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint const *") int param) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.ints(param); + nglTextureParameterIiv(texture, pname, memAddress(params)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glTextureParameterIuiv ] --- + + /** Unsafe version of: {@link #glTextureParameterIuiv TextureParameterIuiv} */ + public static native void nglTextureParameterIuiv(int texture, int pname, long params); + + /** + * DSA version of {@link GL30C#glTexParameterIuiv TexParameterIuiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a single-valued texture parameter + * @param params the value of {@code pname} + * + * @see Reference Page + */ + public static void glTextureParameterIuiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLuint const *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglTextureParameterIuiv(texture, pname, memAddress(params)); + } + + /** + * DSA version of {@link GL30C#glTexParameterIuiv TexParameterIuiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a single-valued texture parameter + * + * @see Reference Page + */ + public static void glTextureParameterIui(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLuint const *") int param) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.ints(param); + nglTextureParameterIuiv(texture, pname, memAddress(params)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glTextureParameteriv ] --- + + /** Unsafe version of: {@link #glTextureParameteriv TextureParameteriv} */ + public static native void nglTextureParameteriv(int texture, int pname, long params); + + /** + * DSA version of {@link GL11C#glTexParameteriv TexParameteriv}. + * + * @param texture the texture name + * @param pname the parameter to set + * @param params the parameter value + * + * @see Reference Page + */ + public static void glTextureParameteriv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 4); + } + nglTextureParameteriv(texture, pname, memAddress(params)); + } + + // --- [ glGenerateTextureMipmap ] --- + + /** + * DSA version of {@link GL30C#glGenerateMipmap GenerateMipmap}. + * + * @param texture the texture name + * + * @see Reference Page + */ + public static native void glGenerateTextureMipmap(@NativeType("GLuint") int texture); + + // --- [ glBindTextureUnit ] --- + + /** + * Binds an existing texture object to the texture unit numbered {@code unit}. + * + *

{@code texture} must be zero or the name of an existing texture object. When {@code texture} is the name of an existing texture object, that object is + * bound to the target, in the corresponding texture unit, that was specified when the object was created. When {@code texture} is zero, each of the targets + * enumerated at the beginning of this section is reset to its default texture for the corresponding texture image unit.

+ * + * @param unit the texture unit number + * @param texture the texture name + * + * @see Reference Page + */ + public static native void glBindTextureUnit(@NativeType("GLuint") int unit, @NativeType("GLuint") int texture); + + // --- [ glGetTextureImage ] --- + + /** + * Unsafe version of: {@link #glGetTextureImage GetTextureImage} + * + * @param bufSize the size of the buffer to receive the retrieved pixel data + */ + public static native void nglGetTextureImage(int texture, int level, int format, int type, int bufSize, long pixels); + + /** + * DSA version of {@link GL11C#glGetTexImage GetTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param bufSize the size of the buffer to receive the retrieved pixel data + * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int bufSize, @NativeType("void *") long pixels) { + nglGetTextureImage(texture, level, format, type, bufSize, pixels); + } + + /** + * DSA version of {@link GL11C#glGetTexImage GetTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer pixels) { + nglGetTextureImage(texture, level, format, type, pixels.remaining(), memAddress(pixels)); + } + + /** + * DSA version of {@link GL11C#glGetTexImage GetTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ShortBuffer pixels) { + nglGetTextureImage(texture, level, format, type, pixels.remaining() << 1, memAddress(pixels)); + } + + /** + * DSA version of {@link GL11C#glGetTexImage GetTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") IntBuffer pixels) { + nglGetTextureImage(texture, level, format, type, pixels.remaining() << 2, memAddress(pixels)); + } + + /** + * DSA version of {@link GL11C#glGetTexImage GetTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") FloatBuffer pixels) { + nglGetTextureImage(texture, level, format, type, pixels.remaining() << 2, memAddress(pixels)); + } + + /** + * DSA version of {@link GL11C#glGetTexImage GetTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") DoubleBuffer pixels) { + nglGetTextureImage(texture, level, format, type, pixels.remaining() << 3, memAddress(pixels)); + } + + // --- [ glGetCompressedTextureImage ] --- + + /** + * Unsafe version of: {@link #glGetCompressedTextureImage GetCompressedTextureImage} + * + * @param bufSize the size of the buffer to receive the retrieved pixel data + */ + public static native void nglGetCompressedTextureImage(int texture, int level, int bufSize, long pixels); + + /** + * DSA version of {@link GL13C#glGetCompressedTexImage GetCompressedTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param bufSize the size of the buffer to receive the retrieved pixel data + * @param pixels a buffer in which to return the compressed texture image + * + * @see Reference Page + */ + public static void glGetCompressedTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLsizei") int bufSize, @NativeType("void *") long pixels) { + nglGetCompressedTextureImage(texture, level, bufSize, pixels); + } + + /** + * DSA version of {@link GL13C#glGetCompressedTexImage GetCompressedTexImage}. + * + * @param texture the texture name + * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param pixels a buffer in which to return the compressed texture image + * + * @see Reference Page + */ + public static void glGetCompressedTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("void *") ByteBuffer pixels) { + if (CHECKS) { + if (DEBUG) { + check(pixels, glGetTextureLevelParameteri(texture, level, GL13.GL_TEXTURE_COMPRESSED_IMAGE_SIZE)); + } + } + nglGetCompressedTextureImage(texture, level, pixels.remaining(), memAddress(pixels)); + } + + // --- [ glGetTextureLevelParameterfv ] --- + + /** Unsafe version of: {@link #glGetTextureLevelParameterfv GetTextureLevelParameterfv} */ + public static native void nglGetTextureLevelParameterfv(int texture, int level, int pname, long params); + + /** + * DSA version of {@link GL11C#glGetTexLevelParameterfv GetTexLevelParameterfv}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param pname the parameter to query + * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureLevelParameterfv(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetTextureLevelParameterfv(texture, level, pname, memAddress(params)); + } + + /** + * DSA version of {@link GL11C#glGetTexLevelParameterfv GetTexLevelParameterfv}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param pname the parameter to query + * + * @see Reference Page + */ + @NativeType("void") + public static float glGetTextureLevelParameterf(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer params = stack.callocFloat(1); + nglGetTextureLevelParameterfv(texture, level, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTextureLevelParameteriv ] --- + + /** Unsafe version of: {@link #glGetTextureLevelParameteriv GetTextureLevelParameteriv} */ + public static native void nglGetTextureLevelParameteriv(int texture, int level, int pname, long params); + + /** + * DSA version of {@link GL11C#glGetTexLevelParameteriv GetTexLevelParameteriv}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param pname the parameter to query. One of:
{@link GL11#GL_TEXTURE_WIDTH TEXTURE_WIDTH}{@link GL11#GL_TEXTURE_HEIGHT TEXTURE_HEIGHT}{@link GL12#GL_TEXTURE_DEPTH TEXTURE_DEPTH}{@link GL32#GL_TEXTURE_SAMPLES TEXTURE_SAMPLES}
{@link GL32#GL_TEXTURE_FIXED_SAMPLE_LOCATIONS TEXTURE_FIXED_SAMPLE_LOCATIONS}{@link GL11#GL_TEXTURE_INTERNAL_FORMAT TEXTURE_INTERNAL_FORMAT}{@link GL11#GL_TEXTURE_RED_SIZE TEXTURE_RED_SIZE}{@link GL11#GL_TEXTURE_GREEN_SIZE TEXTURE_GREEN_SIZE}
{@link GL11#GL_TEXTURE_BLUE_SIZE TEXTURE_BLUE_SIZE}{@link GL11#GL_TEXTURE_ALPHA_SIZE TEXTURE_ALPHA_SIZE}{@link GL14#GL_TEXTURE_DEPTH_SIZE TEXTURE_DEPTH_SIZE}{@link GL30#GL_TEXTURE_STENCIL_SIZE TEXTURE_STENCIL_SIZE}
{@link GL30#GL_TEXTURE_SHARED_SIZE TEXTURE_SHARED_SIZE}{@link GL30#GL_TEXTURE_ALPHA_TYPE TEXTURE_ALPHA_TYPE}{@link GL30#GL_TEXTURE_DEPTH_TYPE TEXTURE_DEPTH_TYPE}{@link GL13#GL_TEXTURE_COMPRESSED TEXTURE_COMPRESSED}
{@link GL13#GL_TEXTURE_COMPRESSED_IMAGE_SIZE TEXTURE_COMPRESSED_IMAGE_SIZE}{@link GL31#GL_TEXTURE_BUFFER_DATA_STORE_BINDING TEXTURE_BUFFER_DATA_STORE_BINDING}{@link GL43#GL_TEXTURE_BUFFER_OFFSET TEXTURE_BUFFER_OFFSET}{@link GL43#GL_TEXTURE_BUFFER_SIZE TEXTURE_BUFFER_SIZE}
+ * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureLevelParameteriv(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetTextureLevelParameteriv(texture, level, pname, memAddress(params)); + } + + /** + * DSA version of {@link GL11C#glGetTexLevelParameteriv GetTexLevelParameteriv}. + * + * @param texture the texture name + * @param level the level-of-detail number + * @param pname the parameter to query. One of:
{@link GL11#GL_TEXTURE_WIDTH TEXTURE_WIDTH}{@link GL11#GL_TEXTURE_HEIGHT TEXTURE_HEIGHT}{@link GL12#GL_TEXTURE_DEPTH TEXTURE_DEPTH}{@link GL32#GL_TEXTURE_SAMPLES TEXTURE_SAMPLES}
{@link GL32#GL_TEXTURE_FIXED_SAMPLE_LOCATIONS TEXTURE_FIXED_SAMPLE_LOCATIONS}{@link GL11#GL_TEXTURE_INTERNAL_FORMAT TEXTURE_INTERNAL_FORMAT}{@link GL11#GL_TEXTURE_RED_SIZE TEXTURE_RED_SIZE}{@link GL11#GL_TEXTURE_GREEN_SIZE TEXTURE_GREEN_SIZE}
{@link GL11#GL_TEXTURE_BLUE_SIZE TEXTURE_BLUE_SIZE}{@link GL11#GL_TEXTURE_ALPHA_SIZE TEXTURE_ALPHA_SIZE}{@link GL14#GL_TEXTURE_DEPTH_SIZE TEXTURE_DEPTH_SIZE}{@link GL30#GL_TEXTURE_STENCIL_SIZE TEXTURE_STENCIL_SIZE}
{@link GL30#GL_TEXTURE_SHARED_SIZE TEXTURE_SHARED_SIZE}{@link GL30#GL_TEXTURE_ALPHA_TYPE TEXTURE_ALPHA_TYPE}{@link GL30#GL_TEXTURE_DEPTH_TYPE TEXTURE_DEPTH_TYPE}{@link GL13#GL_TEXTURE_COMPRESSED TEXTURE_COMPRESSED}
{@link GL13#GL_TEXTURE_COMPRESSED_IMAGE_SIZE TEXTURE_COMPRESSED_IMAGE_SIZE}{@link GL31#GL_TEXTURE_BUFFER_DATA_STORE_BINDING TEXTURE_BUFFER_DATA_STORE_BINDING}{@link GL43#GL_TEXTURE_BUFFER_OFFSET TEXTURE_BUFFER_OFFSET}{@link GL43#GL_TEXTURE_BUFFER_SIZE TEXTURE_BUFFER_SIZE}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetTextureLevelParameteri(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetTextureLevelParameteriv(texture, level, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTextureParameterfv ] --- + + /** Unsafe version of: {@link #glGetTextureParameterfv GetTextureParameterfv} */ + public static native void nglGetTextureParameterfv(int texture, int pname, long params); + + /** + * DSA version of {@link GL11C#glGetTexParameterfv GetTexParameterfv}. + * + * @param texture the texture name + * @param pname the parameter to query + * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureParameterfv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetTextureParameterfv(texture, pname, memAddress(params)); + } + + /** + * DSA version of {@link GL11C#glGetTexParameterfv GetTexParameterfv}. + * + * @param texture the texture name + * @param pname the parameter to query + * + * @see Reference Page + */ + @NativeType("void") + public static float glGetTextureParameterf(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer params = stack.callocFloat(1); + nglGetTextureParameterfv(texture, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTextureParameterIiv ] --- + + /** Unsafe version of: {@link #glGetTextureParameterIiv GetTextureParameterIiv} */ + public static native void nglGetTextureParameterIiv(int texture, int pname, long params); + + /** + * DSA version of {@link GL30C#glGetTexParameterIiv GetTexParameterIiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a texture parameter + * @param params returns the texture parameter value + * + * @see Reference Page + */ + public static void glGetTextureParameterIiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetTextureParameterIiv(texture, pname, memAddress(params)); + } + + /** + * DSA version of {@link GL30C#glGetTexParameterIiv GetTexParameterIiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a texture parameter + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetTextureParameterIi(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetTextureParameterIiv(texture, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTextureParameterIuiv ] --- + + /** Unsafe version of: {@link #glGetTextureParameterIuiv GetTextureParameterIuiv} */ + public static native void nglGetTextureParameterIuiv(int texture, int pname, long params); + + /** + * DSA version of {@link GL30C#glGetTexParameterIuiv GetTexParameterIuiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a texture parameter + * @param params returns the texture parameter value + * + * @see Reference Page + */ + public static void glGetTextureParameterIuiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLuint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetTextureParameterIuiv(texture, pname, memAddress(params)); + } + + /** + * DSA version of {@link GL30C#glGetTexParameterIuiv GetTexParameterIuiv}. + * + * @param texture the texture name + * @param pname the symbolic name of a texture parameter + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetTextureParameterIui(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetTextureParameterIuiv(texture, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetTextureParameteriv ] --- + + /** Unsafe version of: {@link #glGetTextureParameteriv GetTextureParameteriv} */ + public static native void nglGetTextureParameteriv(int texture, int pname, long params); + + /** + * DSA version of {@link GL11C#glGetTexParameteriv GetTexParameteriv}. + * + * @param texture the texture name + * @param pname the parameter to query. One of:
{@link GL12#GL_TEXTURE_BASE_LEVEL TEXTURE_BASE_LEVEL}{@link GL11#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}{@link GL12#GL_TEXTURE_MAX_LEVEL TEXTURE_MAX_LEVEL}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}
{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL33#GL_TEXTURE_SWIZZLE_R TEXTURE_SWIZZLE_R}{@link GL33#GL_TEXTURE_SWIZZLE_G TEXTURE_SWIZZLE_G}
{@link GL33#GL_TEXTURE_SWIZZLE_B TEXTURE_SWIZZLE_B}{@link GL33#GL_TEXTURE_SWIZZLE_A TEXTURE_SWIZZLE_A}{@link GL33#GL_TEXTURE_SWIZZLE_RGBA TEXTURE_SWIZZLE_RGBA}{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}
{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL14#GL_DEPTH_TEXTURE_MODE DEPTH_TEXTURE_MODE}{@link GL14#GL_GENERATE_MIPMAP GENERATE_MIPMAP}
{@link GL42#GL_IMAGE_FORMAT_COMPATIBILITY_TYPE IMAGE_FORMAT_COMPATIBILITY_TYPE}{@link GL42#GL_TEXTURE_IMMUTABLE_FORMAT TEXTURE_IMMUTABLE_FORMAT}{@link GL43#GL_TEXTURE_IMMUTABLE_LEVELS TEXTURE_IMMUTABLE_LEVELS}{@link GL43#GL_TEXTURE_VIEW_MIN_LEVEL TEXTURE_VIEW_MIN_LEVEL}
{@link GL43#GL_TEXTURE_VIEW_NUM_LEVELS TEXTURE_VIEW_NUM_LEVELS}{@link GL43#GL_TEXTURE_VIEW_MIN_LAYER TEXTURE_VIEW_MIN_LAYER}{@link GL43#GL_TEXTURE_VIEW_NUM_LAYERS TEXTURE_VIEW_NUM_LAYERS}
+ * @param params a scalar or buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureParameteriv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetTextureParameteriv(texture, pname, memAddress(params)); + } + + /** + * DSA version of {@link GL11C#glGetTexParameteriv GetTexParameteriv}. + * + * @param texture the texture name + * @param pname the parameter to query. One of:
{@link GL12#GL_TEXTURE_BASE_LEVEL TEXTURE_BASE_LEVEL}{@link GL11#GL_TEXTURE_BORDER_COLOR TEXTURE_BORDER_COLOR}{@link GL14#GL_TEXTURE_COMPARE_MODE TEXTURE_COMPARE_MODE}{@link GL14#GL_TEXTURE_COMPARE_FUNC TEXTURE_COMPARE_FUNC}
{@link GL14#GL_TEXTURE_LOD_BIAS TEXTURE_LOD_BIAS}{@link GL11#GL_TEXTURE_MAG_FILTER TEXTURE_MAG_FILTER}{@link GL12#GL_TEXTURE_MAX_LEVEL TEXTURE_MAX_LEVEL}{@link GL12#GL_TEXTURE_MAX_LOD TEXTURE_MAX_LOD}
{@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER}{@link GL12#GL_TEXTURE_MIN_LOD TEXTURE_MIN_LOD}{@link GL33#GL_TEXTURE_SWIZZLE_R TEXTURE_SWIZZLE_R}{@link GL33#GL_TEXTURE_SWIZZLE_G TEXTURE_SWIZZLE_G}
{@link GL33#GL_TEXTURE_SWIZZLE_B TEXTURE_SWIZZLE_B}{@link GL33#GL_TEXTURE_SWIZZLE_A TEXTURE_SWIZZLE_A}{@link GL33#GL_TEXTURE_SWIZZLE_RGBA TEXTURE_SWIZZLE_RGBA}{@link GL11#GL_TEXTURE_WRAP_S TEXTURE_WRAP_S}
{@link GL11#GL_TEXTURE_WRAP_T TEXTURE_WRAP_T}{@link GL12#GL_TEXTURE_WRAP_R TEXTURE_WRAP_R}{@link GL14#GL_DEPTH_TEXTURE_MODE DEPTH_TEXTURE_MODE}{@link GL14#GL_GENERATE_MIPMAP GENERATE_MIPMAP}
{@link GL42#GL_IMAGE_FORMAT_COMPATIBILITY_TYPE IMAGE_FORMAT_COMPATIBILITY_TYPE}{@link GL42#GL_TEXTURE_IMMUTABLE_FORMAT TEXTURE_IMMUTABLE_FORMAT}{@link GL43#GL_TEXTURE_IMMUTABLE_LEVELS TEXTURE_IMMUTABLE_LEVELS}{@link GL43#GL_TEXTURE_VIEW_MIN_LEVEL TEXTURE_VIEW_MIN_LEVEL}
{@link GL43#GL_TEXTURE_VIEW_NUM_LEVELS TEXTURE_VIEW_NUM_LEVELS}{@link GL43#GL_TEXTURE_VIEW_MIN_LAYER TEXTURE_VIEW_MIN_LAYER}{@link GL43#GL_TEXTURE_VIEW_NUM_LAYERS TEXTURE_VIEW_NUM_LAYERS}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetTextureParameteri(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetTextureParameteriv(texture, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glCreateVertexArrays ] --- + + /** + * Unsafe version of: {@link #glCreateVertexArrays CreateVertexArrays} + * + * @param n the number of vertex array object names to create + */ + public static native void nglCreateVertexArrays(int n, long arrays); + + /** + * Returns {@code n} previously unused vertex array object names in {@code arrays}. + * + * @param arrays the buffer in which to return the created vertex array object names + * + * @see Reference Page + */ + public static void glCreateVertexArrays(@NativeType("GLuint *") IntBuffer arrays) { + nglCreateVertexArrays(arrays.remaining(), memAddress(arrays)); + } + + /** + * Returns {@code n} previously unused vertex array object names in {@code arrays}. + * + * @see Reference Page + */ + @NativeType("void") + public static int glCreateVertexArrays() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer arrays = stack.callocInt(1); + nglCreateVertexArrays(1, memAddress(arrays)); + return arrays.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glDisableVertexArrayAttrib ] --- + + /** + * DSA version of {@link GL20C#glDisableVertexAttribArray DisableVertexAttribArray}. + * + * @param vaobj the vertex array object name + * @param index the index of the generic vertex attribute to be disabled + * + * @see Reference Page + */ + public static native void glDisableVertexArrayAttrib(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index); + + // --- [ glEnableVertexArrayAttrib ] --- + + /** + * DSA version of {@link GL20C#glEnableVertexAttribArray EnableVertexAttribArray}. + * + * @param vaobj the vertex array object name + * @param index the index of the generic vertex attribute to be enabled + * + * @see Reference Page + */ + public static native void glEnableVertexArrayAttrib(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index); + + // --- [ glVertexArrayElementBuffer ] --- + + /** + * Binds a buffer object to the element array buffer bind point of a vertex array object. + * + * @param vaobj the vertex array object name + * @param buffer the buffer object name. If {@code buffer} is zero, any existing element array buffer binding to {@code vaobj} is removed. + * + * @see Reference Page + */ + public static native void glVertexArrayElementBuffer(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int buffer); + + // --- [ glVertexArrayVertexBuffer ] --- + + /** + * DSA version of {@link GL43C#glBindVertexBuffer BindVertexBuffer}. + * + * @param vaobj the vertex array object name + * @param bindingindex the index of the vertex buffer binding point to which to bind the buffer + * @param buffer the name of an existing buffer to bind to the vertex buffer binding point + * @param offset the offset of the first element of the buffer + * @param stride the distance between elements within the buffer + * + * @see Reference Page + */ + public static native void glVertexArrayVertexBuffer(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int bindingindex, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizei") int stride); + + // --- [ glVertexArrayVertexBuffers ] --- + + /** + * Unsafe version of: {@link #glVertexArrayVertexBuffers VertexArrayVertexBuffers} + * + * @param count the number of vertex buffer binding points + */ + public static native void nglVertexArrayVertexBuffers(int vaobj, int first, int count, long buffers, long offsets, long strides); + + /** + * DSA version of {@link GL44C#glBindVertexBuffers BindVertexBuffers}. + * + * @param vaobj the vertex array object name + * @param first the first vertex buffer binding point + * @param buffers an array of zeros or names of existing buffers objects + * @param offsets an array of offses + * @param strides an array of stride values + * + * @see Reference Page + */ + public static void glVertexArrayVertexBuffers(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") IntBuffer buffers, @Nullable @NativeType("GLintptr const *") PointerBuffer offsets, @Nullable @NativeType("GLsizei const *") IntBuffer strides) { + if (CHECKS) { + checkSafe(offsets, remainingSafe(buffers)); + checkSafe(strides, remainingSafe(buffers)); + } + nglVertexArrayVertexBuffers(vaobj, first, remainingSafe(buffers), memAddressSafe(buffers), memAddressSafe(offsets), memAddressSafe(strides)); + } + + // --- [ glVertexArrayAttribFormat ] --- + + /** + * DSA version of {@link GL43C#glVertexAttribFormat VertexAttribFormat}. + * + * @param vaobj the vertex array object name + * @param attribindex the generic vertex attribute array being described + * @param size the number of values per vertex that are stored in the array. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the type of the data stored in the array + * @param normalized if true then integer data is normalized to the range [-1, 1] or [0, 1] if it is signed or unsigned, respectively. If false then integer data is + * directly converted to floating point. + * @param relativeoffset the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from + * + * @see Reference Page + */ + public static native void glVertexArrayAttribFormat(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int attribindex, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLuint") int relativeoffset); + + // --- [ glVertexArrayAttribIFormat ] --- + + /** + * DSA version of {@link GL43C#glVertexAttribIFormat VertexAttribIFormat}. + * + * @param vaobj the vertex array object name + * @param attribindex the generic vertex attribute array being described + * @param size the number of values per vertex that are stored in the array. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the type of the data stored in the array + * @param relativeoffset the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from + * + * @see Reference Page + */ + public static native void glVertexArrayAttribIFormat(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int attribindex, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLuint") int relativeoffset); + + // --- [ glVertexArrayAttribLFormat ] --- + + /** + * DSA version of {@link GL43C#glVertexAttribLFormat VertexAttribLFormat}. + * + * @param vaobj the vertex array object name + * @param attribindex the generic vertex attribute array being described + * @param size the number of values per vertex that are stored in the array. One of:
1234{@link GL12#GL_BGRA BGRA}
+ * @param type the type of the data stored in the array + * @param relativeoffset the offset, measured in basic machine units of the first element relative to the start of the vertex buffer binding this attribute fetches from + * + * @see Reference Page + */ + public static native void glVertexArrayAttribLFormat(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int attribindex, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLuint") int relativeoffset); + + // --- [ glVertexArrayAttribBinding ] --- + + /** + * DSA version of {@link GL43C#glVertexAttribBinding VertexAttribBinding}. + * + * @param vaobj the vertex array object name + * @param attribindex the index of the attribute to associate with a vertex buffer binding + * @param bindingindex the index of the vertex buffer binding with which to associate the generic vertex attribute + * + * @see Reference Page + */ + public static native void glVertexArrayAttribBinding(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int attribindex, @NativeType("GLuint") int bindingindex); + + // --- [ glVertexArrayBindingDivisor ] --- + + /** + * DSA version of {@link GL43C#glVertexBindingDivisor VertexBindingDivisor}. + * + * @param vaobj the vertex array object name + * @param bindingindex the index of the generic vertex attribute + * @param divisor the number of instances that will pass between updates of the generic attribute at slot {@code index} + * + * @see Reference Page + */ + public static native void glVertexArrayBindingDivisor(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int bindingindex, @NativeType("GLuint") int divisor); + + // --- [ glGetVertexArrayiv ] --- + + /** Unsafe version of: {@link #glGetVertexArrayiv GetVertexArrayiv} */ + public static native void nglGetVertexArrayiv(int vaobj, int pname, long param); + + /** + * Queries parameters of a vertex array object. + * + * @param vaobj the vertex array object name + * @param pname the parameter to query. Must be:
{@link GL15#GL_ELEMENT_ARRAY_BUFFER_BINDING ELEMENT_ARRAY_BUFFER_BINDING}
+ * @param param the buffer in which to return the parameter values + * + * @see Reference Page + */ + public static void glGetVertexArrayiv(@NativeType("GLuint") int vaobj, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer param) { + if (CHECKS) { + check(param, 1); + } + nglGetVertexArrayiv(vaobj, pname, memAddress(param)); + } + + /** + * Queries parameters of a vertex array object. + * + * @param vaobj the vertex array object name + * @param pname the parameter to query. Must be:
{@link GL15#GL_ELEMENT_ARRAY_BUFFER_BINDING ELEMENT_ARRAY_BUFFER_BINDING}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetVertexArrayi(@NativeType("GLuint") int vaobj, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer param = stack.callocInt(1); + nglGetVertexArrayiv(vaobj, pname, memAddress(param)); + return param.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetVertexArrayIndexediv ] --- + + /** Unsafe version of: {@link #glGetVertexArrayIndexediv GetVertexArrayIndexediv} */ + public static native void nglGetVertexArrayIndexediv(int vaobj, int index, int pname, long param); + + /** + * Queries parameters of an attribute of a vertex array object. + * + * @param vaobj the vertex array object name + * @param index the attribute to query + * @param pname the parameter to query. One of:
{@link GL20#GL_VERTEX_ATTRIB_ARRAY_ENABLED VERTEX_ATTRIB_ARRAY_ENABLED}{@link GL20#GL_VERTEX_ATTRIB_ARRAY_SIZE VERTEX_ATTRIB_ARRAY_SIZE},
{@link GL20#GL_VERTEX_ATTRIB_ARRAY_STRIDE VERTEX_ATTRIB_ARRAY_STRIDE}{@link GL20#GL_VERTEX_ATTRIB_ARRAY_TYPE VERTEX_ATTRIB_ARRAY_TYPE}
{@link GL20#GL_VERTEX_ATTRIB_ARRAY_NORMALIZED VERTEX_ATTRIB_ARRAY_NORMALIZED}{@link GL30#GL_VERTEX_ATTRIB_ARRAY_INTEGER VERTEX_ATTRIB_ARRAY_INTEGER}
{@link GL33#GL_VERTEX_ATTRIB_ARRAY_DIVISOR VERTEX_ATTRIB_ARRAY_DIVISOR}{@link GL43#GL_VERTEX_ATTRIB_ARRAY_LONG VERTEX_ATTRIB_ARRAY_LONG}
{@link GL43#GL_VERTEX_ATTRIB_RELATIVE_OFFSET VERTEX_ATTRIB_RELATIVE_OFFSET}
+ * @param param the buffer in which to return the parameter values + * + * @see Reference Page + */ + public static void glGetVertexArrayIndexediv(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer param) { + if (CHECKS) { + check(param, 1); + } + nglGetVertexArrayIndexediv(vaobj, index, pname, memAddress(param)); + } + + /** + * Queries parameters of an attribute of a vertex array object. + * + * @param vaobj the vertex array object name + * @param index the attribute to query + * @param pname the parameter to query. One of:
{@link GL20#GL_VERTEX_ATTRIB_ARRAY_ENABLED VERTEX_ATTRIB_ARRAY_ENABLED}{@link GL20#GL_VERTEX_ATTRIB_ARRAY_SIZE VERTEX_ATTRIB_ARRAY_SIZE},
{@link GL20#GL_VERTEX_ATTRIB_ARRAY_STRIDE VERTEX_ATTRIB_ARRAY_STRIDE}{@link GL20#GL_VERTEX_ATTRIB_ARRAY_TYPE VERTEX_ATTRIB_ARRAY_TYPE}
{@link GL20#GL_VERTEX_ATTRIB_ARRAY_NORMALIZED VERTEX_ATTRIB_ARRAY_NORMALIZED}{@link GL30#GL_VERTEX_ATTRIB_ARRAY_INTEGER VERTEX_ATTRIB_ARRAY_INTEGER}
{@link GL33#GL_VERTEX_ATTRIB_ARRAY_DIVISOR VERTEX_ATTRIB_ARRAY_DIVISOR}{@link GL43#GL_VERTEX_ATTRIB_ARRAY_LONG VERTEX_ATTRIB_ARRAY_LONG}
{@link GL43#GL_VERTEX_ATTRIB_RELATIVE_OFFSET VERTEX_ATTRIB_RELATIVE_OFFSET}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glGetVertexArrayIndexedi(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer param = stack.callocInt(1); + nglGetVertexArrayIndexediv(vaobj, index, pname, memAddress(param)); + return param.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetVertexArrayIndexed64iv ] --- + + /** Unsafe version of: {@link #glGetVertexArrayIndexed64iv GetVertexArrayIndexed64iv} */ + public static native void nglGetVertexArrayIndexed64iv(int vaobj, int index, int pname, long param); + + /** + * Queries parameters of an attribute of a vertex array object. + * + * @param vaobj the vertex array object name + * @param index the attribute to query + * @param pname the parameter to query. Must be:
{@link GL43#GL_VERTEX_BINDING_OFFSET VERTEX_BINDING_OFFSET}
+ * @param param the buffer in which to return the parameter values + * + * @see Reference Page + */ + public static void glGetVertexArrayIndexed64iv(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint64 *") LongBuffer param) { + if (CHECKS) { + check(param, 1); + } + nglGetVertexArrayIndexed64iv(vaobj, index, pname, memAddress(param)); + } + + /** + * Queries parameters of an attribute of a vertex array object. + * + * @param vaobj the vertex array object name + * @param index the attribute to query + * @param pname the parameter to query. Must be:
{@link GL43#GL_VERTEX_BINDING_OFFSET VERTEX_BINDING_OFFSET}
+ * + * @see Reference Page + */ + @NativeType("void") + public static long glGetVertexArrayIndexed64i(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer param = stack.callocLong(1); + nglGetVertexArrayIndexed64iv(vaobj, index, pname, memAddress(param)); + return param.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glCreateSamplers ] --- + + /** + * Unsafe version of: {@link #glCreateSamplers CreateSamplers} + * + * @param n the number of sampler object names to create + */ + public static native void nglCreateSamplers(int n, long samplers); + + /** + * Returns {@code n} previously unused sampler names in {@code samplers}, each representing a new sampler object. + * + * @param samplers the buffer in which to return the created sampler object names + * + * @see Reference Page + */ + public static void glCreateSamplers(@NativeType("GLuint *") IntBuffer samplers) { + nglCreateSamplers(samplers.remaining(), memAddress(samplers)); + } + + /** + * Returns {@code n} previously unused sampler names in {@code samplers}, each representing a new sampler object. + * + * @see Reference Page + */ + @NativeType("void") + public static int glCreateSamplers() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer samplers = stack.callocInt(1); + nglCreateSamplers(1, memAddress(samplers)); + return samplers.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glCreateProgramPipelines ] --- + + /** + * Unsafe version of: {@link #glCreateProgramPipelines CreateProgramPipelines} + * + * @param n the number of program pipeline names to create + */ + public static native void nglCreateProgramPipelines(int n, long pipelines); + + /** + * Returns {@code n} previously unused program pipeline names in {@code pipelines}, each representing a new program pipeline object. + * + * @param pipelines the buffer in which to return the created program pipeline names + * + * @see Reference Page + */ + public static void glCreateProgramPipelines(@NativeType("GLuint *") IntBuffer pipelines) { + nglCreateProgramPipelines(pipelines.remaining(), memAddress(pipelines)); + } + + /** + * Returns {@code n} previously unused program pipeline names in {@code pipelines}, each representing a new program pipeline object. + * + * @see Reference Page + */ + @NativeType("void") + public static int glCreateProgramPipelines() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer pipelines = stack.callocInt(1); + nglCreateProgramPipelines(1, memAddress(pipelines)); + return pipelines.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glCreateQueries ] --- + + /** + * Unsafe version of: {@link #glCreateQueries CreateQueries} + * + * @param n the number of query object names to create + */ + public static native void nglCreateQueries(int target, int n, long ids); + + /** + * Returns {@code n} previously unused query object names in {@code ids}, each representing a new query object with the specified {@code target}. + * + * @param target the query target. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * @param ids the buffer in which to return the created query object names + * + * @see Reference Page + */ + public static void glCreateQueries(@NativeType("GLenum") int target, @NativeType("GLuint *") IntBuffer ids) { + nglCreateQueries(target, ids.remaining(), memAddress(ids)); + } + + /** + * Returns {@code n} previously unused query object names in {@code ids}, each representing a new query object with the specified {@code target}. + * + * @param target the query target. One of:
{@link GL15#GL_SAMPLES_PASSED SAMPLES_PASSED}{@link GL30#GL_PRIMITIVES_GENERATED PRIMITIVES_GENERATED}{@link GL30#GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN}{@link GL33#GL_TIME_ELAPSED TIME_ELAPSED}
{@link GL33#GL_TIMESTAMP TIMESTAMP}{@link GL33#GL_ANY_SAMPLES_PASSED ANY_SAMPLES_PASSED}{@link GL43#GL_ANY_SAMPLES_PASSED_CONSERVATIVE ANY_SAMPLES_PASSED_CONSERVATIVE}
+ * + * @see Reference Page + */ + @NativeType("void") + public static int glCreateQueries(@NativeType("GLenum") int target) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer ids = stack.callocInt(1); + nglCreateQueries(target, 1, memAddress(ids)); + return ids.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetQueryBufferObjectiv ] --- + + /** + * Queries the state of a query object. + * + * @param id the name of a query object + * @param buffer the name of a buffer object + * @param pname the state to query + * @param offset the offset into {@code buffer} at which the queried value is written + * + * @see Reference Page + */ + public static native void glGetQueryBufferObjectiv(@NativeType("GLuint") int id, @NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLintptr") long offset); + + // --- [ glGetQueryBufferObjectuiv ] --- + + /** + * Unsigned version of {@link #glGetQueryBufferObjectiv GetQueryBufferObjectiv}. + * + * @param id the name of a query object + * @param buffer the name of a buffer object + * @param pname the state to query + * @param offset the offset into {@code buffer} at which the queried value is written + * + * @see Reference Page + */ + public static native void glGetQueryBufferObjectuiv(@NativeType("GLuint") int id, @NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLintptr") long offset); + + // --- [ glGetQueryBufferObjecti64v ] --- + + /** + * 64bit version of {@link #glGetQueryBufferObjectiv GetQueryBufferObjectiv}. + * + * @param id the name of a query object + * @param buffer the name of a buffer object + * @param pname the state to query + * @param offset the offset into {@code buffer} at which the queried value is written + * + * @see Reference Page + */ + public static native void glGetQueryBufferObjecti64v(@NativeType("GLuint") int id, @NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLintptr") long offset); + + // --- [ glGetQueryBufferObjectui64v ] --- + + /** + * 64bit version of {@link #glGetQueryBufferObjectuiv GetQueryBufferObjectuiv}. + * + * @param id the name of a query object + * @param buffer the name of a buffer object + * @param pname the state to query + * @param offset the offset into {@code buffer} at which the queried value is written + * + * @see Reference Page + */ + public static native void glGetQueryBufferObjectui64v(@NativeType("GLuint") int id, @NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLintptr") long offset); + + // --- [ glMemoryBarrierByRegion ] --- + + /** + * Behaves like {@link GL42C#glMemoryBarrier MemoryBarrier}, with two differences: + * + *

First, it narrows the region under consideration so that only reads/writes of prior fragment shaders that are invoked for a smaller region of the + * framebuffer will be completed/reflected prior to subsequent reads/write of following fragment shaders. The size of the region is implementation + * dependent and may be as small as one framebuffer pixel.

+ * + *

Second, it only applies to memory transactions that may be read by or written by a fragment shader.

+ * + *

When barriers is {@link GL42#GL_ALL_BARRIER_BITS ALL_BARRIER_BITS}, shader memory accesses will be synchronized relative to all these barrier bits, but not to other + * barrier bits specific to {@link GL42C#glMemoryBarrier MemoryBarrier}. This implies that reads/writes for scatter/gather-like algorithms may or may not be + * completed/reflected after a MemoryBarrierByRegion command. However, for uses such as deferred shading, where a linked list of visible + * surfaces with the head at a framebuffer address may be constructed, and the entirety of the list is only dependent on previous executions at that + * framebuffer address, MemoryBarrierByRegion may be significantly more efficient than {@link GL42C#glMemoryBarrier MemoryBarrier}.

+ * + * @param barriers the barriers to insert. One or more of:
{@link GL42#GL_ATOMIC_COUNTER_BARRIER_BIT ATOMIC_COUNTER_BARRIER_BIT}{@link GL42#GL_FRAMEBUFFER_BARRIER_BIT FRAMEBUFFER_BARRIER_BIT}{@link GL42#GL_SHADER_IMAGE_ACCESS_BARRIER_BIT SHADER_IMAGE_ACCESS_BARRIER_BIT}
{@link GL43#GL_SHADER_STORAGE_BARRIER_BIT SHADER_STORAGE_BARRIER_BIT}{@link GL42#GL_TEXTURE_FETCH_BARRIER_BIT TEXTURE_FETCH_BARRIER_BIT}{@link GL42#GL_UNIFORM_BARRIER_BIT UNIFORM_BARRIER_BIT}
+ * + * @see Reference Page + */ + public static native void glMemoryBarrierByRegion(@NativeType("GLbitfield") int barriers); + + // --- [ glGetTextureSubImage ] --- + + /** + * Unsafe version of: {@link #glGetTextureSubImage GetTextureSubImage} + * + * @param bufSize the size of the buffer to receive the retrieved pixel data + */ + public static native void nglGetTextureSubImage(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int type, int bufSize, long pixels); + + /** + * Obtains sub-regions of a texture image from a texture object. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param bufSize the size of the buffer to receive the retrieved pixel data + * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int bufSize, @NativeType("void *") long pixels) { + nglGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, bufSize, pixels); + } + + /** + * Obtains sub-regions of a texture image from a texture object. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer pixels) { + nglGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels.remaining(), memAddress(pixels)); + } + + /** + * Obtains sub-regions of a texture image from a texture object. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ShortBuffer pixels) { + nglGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels.remaining() << 1, memAddress(pixels)); + } + + /** + * Obtains sub-regions of a texture image from a texture object. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") IntBuffer pixels) { + nglGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels.remaining() << 2, memAddress(pixels)); + } + + /** + * Obtains sub-regions of a texture image from a texture object. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") FloatBuffer pixels) { + nglGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels.remaining() << 2, memAddress(pixels)); + } + + /** + * Obtains sub-regions of a texture image from a texture object. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") DoubleBuffer pixels) { + nglGetTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels.remaining() << 3, memAddress(pixels)); + } + + // --- [ glGetCompressedTextureSubImage ] --- + + /** + * Unsafe version of: {@link #glGetCompressedTextureSubImage GetCompressedTextureSubImage} + * + * @param bufSize the size of the buffer to receive the retrieved pixel data + */ + public static native void nglGetCompressedTextureSubImage(int texture, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int bufSize, long pixels); + + /** + * Obtains a sub-region of a compressed texture image. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param bufSize the size of the buffer to receive the retrieved pixel data + * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLsizei") int bufSize, @NativeType("void *") long pixels) { + nglGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, bufSize, pixels); + } + + /** + * Obtains a sub-region of a compressed texture image. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") ByteBuffer pixels) { + nglGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels.remaining(), memAddress(pixels)); + } + + /** + * Obtains a sub-region of a compressed texture image. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") ShortBuffer pixels) { + nglGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels.remaining() << 1, memAddress(pixels)); + } + + /** + * Obtains a sub-region of a compressed texture image. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") IntBuffer pixels) { + nglGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels.remaining() << 2, memAddress(pixels)); + } + + /** + * Obtains a sub-region of a compressed texture image. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") FloatBuffer pixels) { + nglGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels.remaining() << 2, memAddress(pixels)); + } + + /** + * Obtains a sub-region of a compressed texture image. + * + * @param texture the source texture object name + * @param level the level-of-detail number + * @param xoffset the x-position of the subregion + * @param yoffset the y-position of the subregion + * @param zoffset the z-position of the subregion + * @param width the subregion width + * @param height the subregion height + * @param depth the subregion depth + * @param pixels the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") DoubleBuffer pixels) { + nglGetCompressedTextureSubImage(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels.remaining() << 3, memAddress(pixels)); + } + + // --- [ glTextureBarrier ] --- + + /** + * Guarantees that writes have completed and caches have been invalidated before subsequent Draws are executed. + * + * @see Reference Page + */ + public static native void glTextureBarrier(); + + // --- [ glGetGraphicsResetStatus ] --- + + /** + * Indicates if the GL context has been in a reset state at any point since the last call to GetGraphicsResetStatus: + * + *
    + *
  • {@link GL11#GL_NO_ERROR NO_ERROR} indicates that the GL context has not been in a reset state since the last call.
  • + *
  • {@link #GL_GUILTY_CONTEXT_RESET GUILTY_CONTEXT_RESET} indicates that a reset has been detected that is attributable to the current GL context.
  • + *
  • {@link #GL_INNOCENT_CONTEXT_RESET INNOCENT_CONTEXT_RESET} indicates a reset has been detected that is not attributable to the current GL context.
  • + *
  • {@link #GL_UNKNOWN_CONTEXT_RESET UNKNOWN_CONTEXT_RESET} indicates a detected graphics reset whose cause is unknown.
  • + *
+ * + *

If a reset status other than NO_ERROR is returned and subsequent calls return NO_ERROR, the context reset was encountered and completed. If a reset + * status is repeatedly returned, the context may be in the process of resetting.

+ * + *

Reset notification behavior is determined at context creation time, and may be queried by calling GetIntegerv with the symbolic constant + * {@link #GL_RESET_NOTIFICATION_STRATEGY RESET_NOTIFICATION_STRATEGY}.

+ * + *

If the reset notification behavior is {@link #GL_NO_RESET_NOTIFICATION NO_RESET_NOTIFICATION}, then the implementation will never deliver notification of reset events, and + * GetGraphicsResetStatus will always return NO_ERROR.

+ * + *

If the behavior is {@link #GL_LOSE_CONTEXT_ON_RESET LOSE_CONTEXT_ON_RESET}, a graphics reset will result in a lost context and require creating a new context as described + * above. In this case GetGraphicsResetStatus will return an appropriate value from those described above.

+ * + *

If a graphics reset notification occurs in a context, a notification must also occur in all other contexts which share objects with that context.

+ * + *

After a graphics reset has occurred on a context, subsequent GL commands on that context (or any context which shares with that context) will generate a + * {@link #GL_CONTEXT_LOST CONTEXT_LOST} error. Such commands will not have side effects (in particular, they will not modify memory passed by pointer for query results, + * and may not block indefinitely or cause termination of the application. Exceptions to this behavior include:

+ * + *
    + *
  • {@link GL11C#glGetError GetError} and GetGraphicsResetStatus behave normally following a graphics reset, so that the application can determine a reset has + * occurred, and when it is safe to destroy and recreate the context.
  • + *
  • Any commands which might cause a polling application to block indefinitely will generate a CONTEXT_LOST error, but will also return a value + * indicating completion to the application.
  • + *
+ * + * @see Reference Page + */ + @NativeType("GLenum") + public static native int glGetGraphicsResetStatus(); + + // --- [ glGetnTexImage ] --- + + /** + * Unsafe version of: {@link #glGetnTexImage GetnTexImage} + * + * @param bufSize the maximum number of bytes to write into {@code img} + */ + public static native void nglGetnTexImage(int tex, int level, int format, int type, int bufSize, long img); + + /** + * Robust version of {@link GL11C#glGetTexImage GetTexImage} + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param bufSize the maximum number of bytes to write into {@code img} + * @param img a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int bufSize, @NativeType("void *") long img) { + nglGetnTexImage(tex, level, format, type, bufSize, img); + } + + /** + * Robust version of {@link GL11C#glGetTexImage GetTexImage} + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param img a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer img) { + nglGetnTexImage(tex, level, format, type, img.remaining(), memAddress(img)); + } + + /** + * Robust version of {@link GL11C#glGetTexImage GetTexImage} + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param img a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ShortBuffer img) { + nglGetnTexImage(tex, level, format, type, img.remaining() << 1, memAddress(img)); + } + + /** + * Robust version of {@link GL11C#glGetTexImage GetTexImage} + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param img a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") IntBuffer img) { + nglGetnTexImage(tex, level, format, type, img.remaining() << 2, memAddress(img)); + } + + /** + * Robust version of {@link GL11C#glGetTexImage GetTexImage} + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param img a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") FloatBuffer img) { + nglGetnTexImage(tex, level, format, type, img.remaining() << 2, memAddress(img)); + } + + /** + * Robust version of {@link GL11C#glGetTexImage GetTexImage} + * + * @param tex the texture (or texture face) to be obtained. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
+ * @param level the level-of-detail number + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
+ * @param img a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") DoubleBuffer img) { + nglGetnTexImage(tex, level, format, type, img.remaining() << 3, memAddress(img)); + } + + // --- [ glReadnPixels ] --- + + /** + * Unsafe version of: {@link #glReadnPixels ReadnPixels} + * + * @param bufSize the maximum number of bytes to write into {@code data} + */ + public static native void nglReadnPixels(int x, int y, int width, int height, int format, int type, int bufSize, long pixels); + + /** + * Behaves identically to {@link GL11C#glReadPixels ReadPixels} except that it does not write more than {@code bufSize} bytes into {@code data} + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param bufSize the maximum number of bytes to write into {@code data} + * @param pixels a buffer in which to place the returned pixel data + * + * @see Reference Page + */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int bufSize, @NativeType("void *") long pixels) { + nglReadnPixels(x, y, width, height, format, type, bufSize, pixels); + } + + /** + * Behaves identically to {@link GL11C#glReadPixels ReadPixels} except that it does not write more than {@code bufSize} bytes into {@code data} + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels a buffer in which to place the returned pixel data + * + * @see Reference Page + */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer pixels) { + nglReadnPixels(x, y, width, height, format, type, pixels.remaining(), memAddress(pixels)); + } + + /** + * Behaves identically to {@link GL11C#glReadPixels ReadPixels} except that it does not write more than {@code bufSize} bytes into {@code data} + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels a buffer in which to place the returned pixel data + * + * @see Reference Page + */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ShortBuffer pixels) { + nglReadnPixels(x, y, width, height, format, type, pixels.remaining() << 1, memAddress(pixels)); + } + + /** + * Behaves identically to {@link GL11C#glReadPixels ReadPixels} except that it does not write more than {@code bufSize} bytes into {@code data} + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels a buffer in which to place the returned pixel data + * + * @see Reference Page + */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") IntBuffer pixels) { + nglReadnPixels(x, y, width, height, format, type, pixels.remaining() << 2, memAddress(pixels)); + } + + /** + * Behaves identically to {@link GL11C#glReadPixels ReadPixels} except that it does not write more than {@code bufSize} bytes into {@code data} + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels a buffer in which to place the returned pixel data + * + * @see Reference Page + */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") FloatBuffer pixels) { + nglReadnPixels(x, y, width, height, format, type, pixels.remaining() << 2, memAddress(pixels)); + } + + // --- [ glGetnCompressedTexImage ] --- + + /** + * Unsafe version of: {@link #glGetnCompressedTexImage GetnCompressedTexImage} + * + * @param bufSize the maximum number of bytes to write into {@code img} + */ + public static native void nglGetnCompressedTexImage(int target, int level, int bufSize, long img); + + /** + * Robust version of {@link GL13C#glGetCompressedTexImage GetCompressedTexImage} + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}
{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param bufSize the maximum number of bytes to write into {@code img} + * @param img a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnCompressedTexImage(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("GLsizei") int bufSize, @NativeType("void *") long img) { + nglGetnCompressedTexImage(target, level, bufSize, img); + } + + /** + * Robust version of {@link GL13C#glGetCompressedTexImage GetCompressedTexImage} + * + * @param target the target texture. One of:
{@link GL11#GL_TEXTURE_1D TEXTURE_1D}{@link GL11#GL_TEXTURE_2D TEXTURE_2D}{@link GL30#GL_TEXTURE_1D_ARRAY TEXTURE_1D_ARRAY}
{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_X TEXTURE_CUBE_MAP_POSITIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_X TEXTURE_CUBE_MAP_NEGATIVE_X}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Y TEXTURE_CUBE_MAP_POSITIVE_Y}
{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Y TEXTURE_CUBE_MAP_NEGATIVE_Y}{@link GL13#GL_TEXTURE_CUBE_MAP_POSITIVE_Z TEXTURE_CUBE_MAP_POSITIVE_Z}{@link GL13#GL_TEXTURE_CUBE_MAP_NEGATIVE_Z TEXTURE_CUBE_MAP_NEGATIVE_Z}
{@link GL12#GL_TEXTURE_3D TEXTURE_3D}{@link GL30#GL_TEXTURE_2D_ARRAY TEXTURE_2D_ARRAY}{@link GL40#GL_TEXTURE_CUBE_MAP_ARRAY TEXTURE_CUBE_MAP_ARRAY}
+ * @param level the level-of-detail number. Level 0 is the base image level. Level n is the nth mipmap reduction image. + * @param img a buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnCompressedTexImage(@NativeType("GLenum") int target, @NativeType("GLint") int level, @NativeType("void *") ByteBuffer img) { + if (CHECKS) { + if (DEBUG) { + check(img, GL11.glGetTexLevelParameteri(target, level, GL13.GL_TEXTURE_COMPRESSED_IMAGE_SIZE)); + } + } + nglGetnCompressedTexImage(target, level, img.remaining(), memAddress(img)); + } + + // --- [ glGetnUniformfv ] --- + + /** + * Unsafe version of: {@link #glGetnUniformfv GetnUniformfv} + * + * @param bufSize the maximum number of bytes to write to {@code params} + */ + public static native void nglGetnUniformfv(int program, int location, int bufSize, long params); + + /** + * Returns the value or values of a uniform of the default uniform block. + * + * @param program the program object + * @param location the uniform location + * @param params the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnUniformfv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat *") FloatBuffer params) { + nglGetnUniformfv(program, location, params.remaining(), memAddress(params)); + } + + /** + * Returns the value or values of a uniform of the default uniform block. + * + * @param program the program object + * @param location the uniform location + * + * @see Reference Page + */ + @NativeType("void") + public static float glGetnUniformf(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer params = stack.callocFloat(1); + nglGetnUniformfv(program, location, 1, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetnUniformdv ] --- + + /** + * Unsafe version of: {@link #glGetnUniformdv GetnUniformdv} + * + * @param bufSize the maximum number of bytes to write to {@code params} + */ + public static native void nglGetnUniformdv(int program, int location, int bufSize, long params); + + /** + * Double version of {@link #glGetnUniformfv GetnUniformfv}. + * + * @param program the program object + * @param location the uniform location + * @param params the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnUniformdv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble *") DoubleBuffer params) { + nglGetnUniformdv(program, location, params.remaining(), memAddress(params)); + } + + /** + * Double version of {@link #glGetnUniformfv GetnUniformfv}. + * + * @param program the program object + * @param location the uniform location + * + * @see Reference Page + */ + @NativeType("void") + public static double glGetnUniformd(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + DoubleBuffer params = stack.callocDouble(1); + nglGetnUniformdv(program, location, 1, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetnUniformiv ] --- + + /** + * Unsafe version of: {@link #glGetnUniformiv GetnUniformiv} + * + * @param bufSize the maximum number of bytes to write to {@code params} + */ + public static native void nglGetnUniformiv(int program, int location, int bufSize, long params); + + /** + * Integer version of {@link #glGetnUniformfv GetnUniformfv}. + * + * @param program the program object + * @param location the uniform location + * @param params the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnUniformiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint *") IntBuffer params) { + nglGetnUniformiv(program, location, params.remaining(), memAddress(params)); + } + + /** + * Integer version of {@link #glGetnUniformfv GetnUniformfv}. + * + * @param program the program object + * @param location the uniform location + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetnUniformi(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetnUniformiv(program, location, 1, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetnUniformuiv ] --- + + /** + * Unsafe version of: {@link #glGetnUniformuiv GetnUniformuiv} + * + * @param bufSize the maximum number of bytes to write to {@code params} + */ + public static native void nglGetnUniformuiv(int program, int location, int bufSize, long params); + + /** + * Unsigned version of {@link #glGetnUniformiv GetnUniformiv}. + * + * @param program the program object + * @param location the uniform location + * @param params the buffer in which to place the returned data + * + * @see Reference Page + */ + public static void glGetnUniformuiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint *") IntBuffer params) { + nglGetnUniformuiv(program, location, params.remaining(), memAddress(params)); + } + + /** + * Unsigned version of {@link #glGetnUniformiv GetnUniformiv}. + * + * @param program the program object + * @param location the uniform location + * + * @see Reference Page + */ + @NativeType("void") + public static int glGetnUniformui(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetnUniformuiv(program, location, 1, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Array version of: {@link #glCreateTransformFeedbacks CreateTransformFeedbacks} + * + * @see Reference Page + */ + public static void glCreateTransformFeedbacks(@NativeType("GLuint *") int[] ids) { + long __functionAddress = GL.getICD().glCreateTransformFeedbacks; + if (CHECKS) { + check(__functionAddress); + } + callPV(ids.length, ids, __functionAddress); + } + + /** + * Array version of: {@link #glGetTransformFeedbackiv GetTransformFeedbackiv} + * + * @see Reference Page + */ + public static void glGetTransformFeedbackiv(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] param) { + long __functionAddress = GL.getICD().glGetTransformFeedbackiv; + if (CHECKS) { + check(__functionAddress); + check(param, 1); + } + callPV(xfb, pname, param, __functionAddress); + } + + /** + * Array version of: {@link #glGetTransformFeedbacki_v GetTransformFeedbacki_v} + * + * @see Reference Page + */ + public static void glGetTransformFeedbacki_v(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLint *") int[] param) { + long __functionAddress = GL.getICD().glGetTransformFeedbacki_v; + if (CHECKS) { + check(__functionAddress); + check(param, 1); + } + callPV(xfb, pname, index, param, __functionAddress); + } + + /** + * Array version of: {@link #glGetTransformFeedbacki64_v GetTransformFeedbacki64_v} + * + * @see Reference Page + */ + public static void glGetTransformFeedbacki64_v(@NativeType("GLuint") int xfb, @NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLint64 *") long[] param) { + long __functionAddress = GL.getICD().glGetTransformFeedbacki64_v; + if (CHECKS) { + check(__functionAddress); + check(param, 1); + } + callPV(xfb, pname, index, param, __functionAddress); + } + + /** + * Array version of: {@link #glCreateBuffers CreateBuffers} + * + * @see Reference Page + */ + public static void glCreateBuffers(@NativeType("GLuint *") int[] buffers) { + long __functionAddress = GL.getICD().glCreateBuffers; + if (CHECKS) { + check(__functionAddress); + } + callPV(buffers.length, buffers, __functionAddress); + } + + /** + * Array version of: {@link #glNamedBufferStorage NamedBufferStorage} + * + * @see Reference Page + */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") short[] data, @NativeType("GLbitfield") int flags) { + long __functionAddress = GL.getICD().glNamedBufferStorage; + if (CHECKS) { + check(__functionAddress); + } + callPPV(buffer, Integer.toUnsignedLong(data.length) << 1, data, flags, __functionAddress); + } + + /** + * Array version of: {@link #glNamedBufferStorage NamedBufferStorage} + * + * @see Reference Page + */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") int[] data, @NativeType("GLbitfield") int flags) { + long __functionAddress = GL.getICD().glNamedBufferStorage; + if (CHECKS) { + check(__functionAddress); + } + callPPV(buffer, Integer.toUnsignedLong(data.length) << 2, data, flags, __functionAddress); + } + + /** + * Array version of: {@link #glNamedBufferStorage NamedBufferStorage} + * + * @see Reference Page + */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") float[] data, @NativeType("GLbitfield") int flags) { + long __functionAddress = GL.getICD().glNamedBufferStorage; + if (CHECKS) { + check(__functionAddress); + } + callPPV(buffer, Integer.toUnsignedLong(data.length) << 2, data, flags, __functionAddress); + } + + /** + * Array version of: {@link #glNamedBufferStorage NamedBufferStorage} + * + * @see Reference Page + */ + public static void glNamedBufferStorage(@NativeType("GLuint") int buffer, @NativeType("void const *") double[] data, @NativeType("GLbitfield") int flags) { + long __functionAddress = GL.getICD().glNamedBufferStorage; + if (CHECKS) { + check(__functionAddress); + } + callPPV(buffer, Integer.toUnsignedLong(data.length) << 3, data, flags, __functionAddress); + } + + /** + * Array version of: {@link #glNamedBufferData NamedBufferData} + * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") short[] data, @NativeType("GLenum") int usage) { + long __functionAddress = GL.getICD().glNamedBufferData; + if (CHECKS) { + check(__functionAddress); + } + callPPV(buffer, Integer.toUnsignedLong(data.length) << 1, data, usage, __functionAddress); + } + + /** + * Array version of: {@link #glNamedBufferData NamedBufferData} + * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") int[] data, @NativeType("GLenum") int usage) { + long __functionAddress = GL.getICD().glNamedBufferData; + if (CHECKS) { + check(__functionAddress); + } + callPPV(buffer, Integer.toUnsignedLong(data.length) << 2, data, usage, __functionAddress); + } + + /** + * Array version of: {@link #glNamedBufferData NamedBufferData} + * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") long[] data, @NativeType("GLenum") int usage) { + long __functionAddress = GL.getICD().glNamedBufferData; + if (CHECKS) { + check(__functionAddress); + } + callPPV(buffer, Integer.toUnsignedLong(data.length) << 3, data, usage, __functionAddress); + } + + /** + * Array version of: {@link #glNamedBufferData NamedBufferData} + * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") float[] data, @NativeType("GLenum") int usage) { + long __functionAddress = GL.getICD().glNamedBufferData; + if (CHECKS) { + check(__functionAddress); + } + callPPV(buffer, Integer.toUnsignedLong(data.length) << 2, data, usage, __functionAddress); + } + + /** + * Array version of: {@link #glNamedBufferData NamedBufferData} + * + * @see Reference Page + */ + public static void glNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("void const *") double[] data, @NativeType("GLenum") int usage) { + long __functionAddress = GL.getICD().glNamedBufferData; + if (CHECKS) { + check(__functionAddress); + } + callPPV(buffer, Integer.toUnsignedLong(data.length) << 3, data, usage, __functionAddress); + } + + /** + * Array version of: {@link #glNamedBufferSubData NamedBufferSubData} + * + * @see Reference Page + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") short[] data) { + long __functionAddress = GL.getICD().glNamedBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, offset, Integer.toUnsignedLong(data.length) << 1, data, __functionAddress); + } + + /** + * Array version of: {@link #glNamedBufferSubData NamedBufferSubData} + * + * @see Reference Page + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") int[] data) { + long __functionAddress = GL.getICD().glNamedBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, offset, Integer.toUnsignedLong(data.length) << 2, data, __functionAddress); + } + + /** + * Array version of: {@link #glNamedBufferSubData NamedBufferSubData} + * + * @see Reference Page + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") long[] data) { + long __functionAddress = GL.getICD().glNamedBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, offset, Integer.toUnsignedLong(data.length) << 3, data, __functionAddress); + } + + /** + * Array version of: {@link #glNamedBufferSubData NamedBufferSubData} + * + * @see Reference Page + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") float[] data) { + long __functionAddress = GL.getICD().glNamedBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, offset, Integer.toUnsignedLong(data.length) << 2, data, __functionAddress); + } + + /** + * Array version of: {@link #glNamedBufferSubData NamedBufferSubData} + * + * @see Reference Page + */ + public static void glNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") double[] data) { + long __functionAddress = GL.getICD().glNamedBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, offset, Integer.toUnsignedLong(data.length) << 3, data, __functionAddress); + } + + /** + * Array version of: {@link #glClearNamedBufferData ClearNamedBufferData} + * + * @see Reference Page + */ + public static void glClearNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] data) { + long __functionAddress = GL.getICD().glClearNamedBufferData; + if (CHECKS) { + check(__functionAddress); + } + callPV(buffer, internalformat, format, type, data, __functionAddress); + } + + /** + * Array version of: {@link #glClearNamedBufferData ClearNamedBufferData} + * + * @see Reference Page + */ + public static void glClearNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] data) { + long __functionAddress = GL.getICD().glClearNamedBufferData; + if (CHECKS) { + check(__functionAddress); + } + callPV(buffer, internalformat, format, type, data, __functionAddress); + } + + /** + * Array version of: {@link #glClearNamedBufferData ClearNamedBufferData} + * + * @see Reference Page + */ + public static void glClearNamedBufferData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] data) { + long __functionAddress = GL.getICD().glClearNamedBufferData; + if (CHECKS) { + check(__functionAddress); + } + callPV(buffer, internalformat, format, type, data, __functionAddress); + } + + /** + * Array version of: {@link #glClearNamedBufferSubData ClearNamedBufferSubData} + * + * @see Reference Page + */ + public static void glClearNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") short[] data) { + long __functionAddress = GL.getICD().glClearNamedBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, internalformat, offset, size, format, type, data, __functionAddress); + } + + /** + * Array version of: {@link #glClearNamedBufferSubData ClearNamedBufferSubData} + * + * @see Reference Page + */ + public static void glClearNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") int[] data) { + long __functionAddress = GL.getICD().glClearNamedBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, internalformat, offset, size, format, type, data, __functionAddress); + } + + /** + * Array version of: {@link #glClearNamedBufferSubData ClearNamedBufferSubData} + * + * @see Reference Page + */ + public static void glClearNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLenum") int internalformat, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @Nullable @NativeType("void const *") float[] data) { + long __functionAddress = GL.getICD().glClearNamedBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, internalformat, offset, size, format, type, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetNamedBufferParameteriv GetNamedBufferParameteriv} + * + * @see Reference Page + */ + public static void glGetNamedBufferParameteriv(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetNamedBufferParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(buffer, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetNamedBufferParameteri64v GetNamedBufferParameteri64v} + * + * @see Reference Page + */ + public static void glGetNamedBufferParameteri64v(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLint64 *") long[] params) { + long __functionAddress = GL.getICD().glGetNamedBufferParameteri64v; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(buffer, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetNamedBufferSubData GetNamedBufferSubData} + * + * @see Reference Page + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") short[] data) { + long __functionAddress = GL.getICD().glGetNamedBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, offset, Integer.toUnsignedLong(data.length) << 1, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetNamedBufferSubData GetNamedBufferSubData} + * + * @see Reference Page + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") int[] data) { + long __functionAddress = GL.getICD().glGetNamedBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, offset, Integer.toUnsignedLong(data.length) << 2, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetNamedBufferSubData GetNamedBufferSubData} + * + * @see Reference Page + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") long[] data) { + long __functionAddress = GL.getICD().glGetNamedBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, offset, Integer.toUnsignedLong(data.length) << 3, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetNamedBufferSubData GetNamedBufferSubData} + * + * @see Reference Page + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") float[] data) { + long __functionAddress = GL.getICD().glGetNamedBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, offset, Integer.toUnsignedLong(data.length) << 2, data, __functionAddress); + } + + /** + * Array version of: {@link #glGetNamedBufferSubData GetNamedBufferSubData} + * + * @see Reference Page + */ + public static void glGetNamedBufferSubData(@NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void *") double[] data) { + long __functionAddress = GL.getICD().glGetNamedBufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(buffer, offset, Integer.toUnsignedLong(data.length) << 3, data, __functionAddress); + } + + /** + * Array version of: {@link #glCreateFramebuffers CreateFramebuffers} + * + * @see Reference Page + */ + public static void glCreateFramebuffers(@NativeType("GLuint *") int[] framebuffers) { + long __functionAddress = GL.getICD().glCreateFramebuffers; + if (CHECKS) { + check(__functionAddress); + } + callPV(framebuffers.length, framebuffers, __functionAddress); + } + + /** + * Array version of: {@link #glNamedFramebufferDrawBuffers NamedFramebufferDrawBuffers} + * + * @see Reference Page + */ + public static void glNamedFramebufferDrawBuffers(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") int[] bufs) { + long __functionAddress = GL.getICD().glNamedFramebufferDrawBuffers; + if (CHECKS) { + check(__functionAddress); + } + callPV(framebuffer, bufs.length, bufs, __functionAddress); + } + + /** + * Array version of: {@link #glInvalidateNamedFramebufferData InvalidateNamedFramebufferData} + * + * @see Reference Page + */ + public static void glInvalidateNamedFramebufferData(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") int[] attachments) { + long __functionAddress = GL.getICD().glInvalidateNamedFramebufferData; + if (CHECKS) { + check(__functionAddress); + } + callPV(framebuffer, attachments.length, attachments, __functionAddress); + } + + /** + * Array version of: {@link #glInvalidateNamedFramebufferSubData InvalidateNamedFramebufferSubData} + * + * @see Reference Page + */ + public static void glInvalidateNamedFramebufferSubData(@NativeType("GLuint") int framebuffer, @NativeType("GLenum const *") int[] attachments, @NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height) { + long __functionAddress = GL.getICD().glInvalidateNamedFramebufferSubData; + if (CHECKS) { + check(__functionAddress); + } + callPV(framebuffer, attachments.length, attachments, x, y, width, height, __functionAddress); + } + + /** + * Array version of: {@link #glClearNamedFramebufferiv ClearNamedFramebufferiv} + * + * @see Reference Page + */ + public static void glClearNamedFramebufferiv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLint *") int[] value) { + long __functionAddress = GL.getICD().glClearNamedFramebufferiv; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + callPV(framebuffer, buffer, drawbuffer, value, __functionAddress); + } + + /** + * Array version of: {@link #glClearNamedFramebufferuiv ClearNamedFramebufferuiv} + * + * @see Reference Page + */ + public static void glClearNamedFramebufferuiv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLint *") int[] value) { + long __functionAddress = GL.getICD().glClearNamedFramebufferuiv; + if (CHECKS) { + check(__functionAddress); + check(value, 4); + } + callPV(framebuffer, buffer, drawbuffer, value, __functionAddress); + } + + /** + * Array version of: {@link #glClearNamedFramebufferfv ClearNamedFramebufferfv} + * + * @see Reference Page + */ + public static void glClearNamedFramebufferfv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int buffer, @NativeType("GLint") int drawbuffer, @NativeType("GLfloat *") float[] value) { + long __functionAddress = GL.getICD().glClearNamedFramebufferfv; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + callPV(framebuffer, buffer, drawbuffer, value, __functionAddress); + } + + /** + * Array version of: {@link #glGetNamedFramebufferParameteriv GetNamedFramebufferParameteriv} + * + * @see Reference Page + */ + public static void glGetNamedFramebufferParameteriv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetNamedFramebufferParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(framebuffer, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetNamedFramebufferAttachmentParameteriv GetNamedFramebufferAttachmentParameteriv} + * + * @see Reference Page + */ + public static void glGetNamedFramebufferAttachmentParameteriv(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetNamedFramebufferAttachmentParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(framebuffer, attachment, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glCreateRenderbuffers CreateRenderbuffers} + * + * @see Reference Page + */ + public static void glCreateRenderbuffers(@NativeType("GLuint *") int[] renderbuffers) { + long __functionAddress = GL.getICD().glCreateRenderbuffers; + if (CHECKS) { + check(__functionAddress); + } + callPV(renderbuffers.length, renderbuffers, __functionAddress); + } + + /** + * Array version of: {@link #glGetNamedRenderbufferParameteriv GetNamedRenderbufferParameteriv} + * + * @see Reference Page + */ + public static void glGetNamedRenderbufferParameteriv(@NativeType("GLuint") int renderbuffer, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetNamedRenderbufferParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(renderbuffer, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glCreateTextures CreateTextures} + * + * @see Reference Page + */ + public static void glCreateTextures(@NativeType("GLenum") int target, @NativeType("GLuint *") int[] textures) { + long __functionAddress = GL.getICD().glCreateTextures; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, textures.length, textures, __functionAddress); + } + + /** + * Array version of: {@link #glTextureSubImage1D TextureSubImage1D} + * + * @see Reference Page + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage1D; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, width, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTextureSubImage1D TextureSubImage1D} + * + * @see Reference Page + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage1D; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, width, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTextureSubImage1D TextureSubImage1D} + * + * @see Reference Page + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage1D; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, width, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTextureSubImage1D TextureSubImage1D} + * + * @see Reference Page + */ + public static void glTextureSubImage1D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLsizei") int width, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") double[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage1D; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, width, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTextureSubImage2D TextureSubImage2D} + * + * @see Reference Page + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage2D; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, yoffset, width, height, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTextureSubImage2D TextureSubImage2D} + * + * @see Reference Page + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage2D; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, yoffset, width, height, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTextureSubImage2D TextureSubImage2D} + * + * @see Reference Page + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage2D; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, yoffset, width, height, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTextureSubImage2D TextureSubImage2D} + * + * @see Reference Page + */ + public static void glTextureSubImage2D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") double[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage2D; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, yoffset, width, height, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTextureSubImage3D TextureSubImage3D} + * + * @see Reference Page + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") short[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage3D; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTextureSubImage3D TextureSubImage3D} + * + * @see Reference Page + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") int[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage3D; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTextureSubImage3D TextureSubImage3D} + * + * @see Reference Page + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") float[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage3D; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTextureSubImage3D TextureSubImage3D} + * + * @see Reference Page + */ + public static void glTextureSubImage3D(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void const *") double[] pixels) { + long __functionAddress = GL.getICD().glTextureSubImage3D; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glTextureParameterfv TextureParameterfv} + * + * @see Reference Page + */ + public static void glTextureParameterfv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] params) { + long __functionAddress = GL.getICD().glTextureParameterfv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(texture, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glTextureParameterIiv TextureParameterIiv} + * + * @see Reference Page + */ + public static void glTextureParameterIiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glTextureParameterIiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texture, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glTextureParameterIuiv TextureParameterIuiv} + * + * @see Reference Page + */ + public static void glTextureParameterIuiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLuint const *") int[] params) { + long __functionAddress = GL.getICD().glTextureParameterIuiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texture, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glTextureParameteriv TextureParameteriv} + * + * @see Reference Page + */ + public static void glTextureParameteriv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glTextureParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 4); + } + callPV(texture, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetTextureImage GetTextureImage} + * + * @see Reference Page + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") short[] pixels) { + long __functionAddress = GL.getICD().glGetTextureImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, format, type, pixels.length << 1, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glGetTextureImage GetTextureImage} + * + * @see Reference Page + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") int[] pixels) { + long __functionAddress = GL.getICD().glGetTextureImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, format, type, pixels.length << 2, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glGetTextureImage GetTextureImage} + * + * @see Reference Page + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") float[] pixels) { + long __functionAddress = GL.getICD().glGetTextureImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, format, type, pixels.length << 2, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glGetTextureImage GetTextureImage} + * + * @see Reference Page + */ + public static void glGetTextureImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") double[] pixels) { + long __functionAddress = GL.getICD().glGetTextureImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, format, type, pixels.length << 3, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glGetTextureLevelParameterfv GetTextureLevelParameterfv} + * + * @see Reference Page + */ + public static void glGetTextureLevelParameterfv(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetTextureLevelParameterfv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texture, level, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetTextureLevelParameteriv GetTextureLevelParameteriv} + * + * @see Reference Page + */ + public static void glGetTextureLevelParameteriv(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetTextureLevelParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texture, level, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetTextureParameterfv GetTextureParameterfv} + * + * @see Reference Page + */ + public static void glGetTextureParameterfv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetTextureParameterfv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texture, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetTextureParameterIiv GetTextureParameterIiv} + * + * @see Reference Page + */ + public static void glGetTextureParameterIiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetTextureParameterIiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texture, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetTextureParameterIuiv GetTextureParameterIuiv} + * + * @see Reference Page + */ + public static void glGetTextureParameterIuiv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLuint *") int[] params) { + long __functionAddress = GL.getICD().glGetTextureParameterIuiv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texture, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetTextureParameteriv GetTextureParameteriv} + * + * @see Reference Page + */ + public static void glGetTextureParameteriv(@NativeType("GLuint") int texture, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetTextureParameteriv; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(texture, pname, params, __functionAddress); + } + + /** + * Array version of: {@link #glCreateVertexArrays CreateVertexArrays} + * + * @see Reference Page + */ + public static void glCreateVertexArrays(@NativeType("GLuint *") int[] arrays) { + long __functionAddress = GL.getICD().glCreateVertexArrays; + if (CHECKS) { + check(__functionAddress); + } + callPV(arrays.length, arrays, __functionAddress); + } + + /** + * Array version of: {@link #glVertexArrayVertexBuffers VertexArrayVertexBuffers} + * + * @see Reference Page + */ + public static void glVertexArrayVertexBuffers(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int first, @Nullable @NativeType("GLuint const *") int[] buffers, @Nullable @NativeType("GLintptr const *") PointerBuffer offsets, @Nullable @NativeType("GLsizei const *") int[] strides) { + long __functionAddress = GL.getICD().glVertexArrayVertexBuffers; + if (CHECKS) { + check(__functionAddress); + checkSafe(offsets, lengthSafe(buffers)); + checkSafe(strides, lengthSafe(buffers)); + } + callPPPV(vaobj, first, lengthSafe(buffers), buffers, memAddressSafe(offsets), strides, __functionAddress); + } + + /** + * Array version of: {@link #glGetVertexArrayiv GetVertexArrayiv} + * + * @see Reference Page + */ + public static void glGetVertexArrayiv(@NativeType("GLuint") int vaobj, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] param) { + long __functionAddress = GL.getICD().glGetVertexArrayiv; + if (CHECKS) { + check(__functionAddress); + check(param, 1); + } + callPV(vaobj, pname, param, __functionAddress); + } + + /** + * Array version of: {@link #glGetVertexArrayIndexediv GetVertexArrayIndexediv} + * + * @see Reference Page + */ + public static void glGetVertexArrayIndexediv(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] param) { + long __functionAddress = GL.getICD().glGetVertexArrayIndexediv; + if (CHECKS) { + check(__functionAddress); + check(param, 1); + } + callPV(vaobj, index, pname, param, __functionAddress); + } + + /** + * Array version of: {@link #glGetVertexArrayIndexed64iv GetVertexArrayIndexed64iv} + * + * @see Reference Page + */ + public static void glGetVertexArrayIndexed64iv(@NativeType("GLuint") int vaobj, @NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint64 *") long[] param) { + long __functionAddress = GL.getICD().glGetVertexArrayIndexed64iv; + if (CHECKS) { + check(__functionAddress); + check(param, 1); + } + callPV(vaobj, index, pname, param, __functionAddress); + } + + /** + * Array version of: {@link #glCreateSamplers CreateSamplers} + * + * @see Reference Page + */ + public static void glCreateSamplers(@NativeType("GLuint *") int[] samplers) { + long __functionAddress = GL.getICD().glCreateSamplers; + if (CHECKS) { + check(__functionAddress); + } + callPV(samplers.length, samplers, __functionAddress); + } + + /** + * Array version of: {@link #glCreateProgramPipelines CreateProgramPipelines} + * + * @see Reference Page + */ + public static void glCreateProgramPipelines(@NativeType("GLuint *") int[] pipelines) { + long __functionAddress = GL.getICD().glCreateProgramPipelines; + if (CHECKS) { + check(__functionAddress); + } + callPV(pipelines.length, pipelines, __functionAddress); + } + + /** + * Array version of: {@link #glCreateQueries CreateQueries} + * + * @see Reference Page + */ + public static void glCreateQueries(@NativeType("GLenum") int target, @NativeType("GLuint *") int[] ids) { + long __functionAddress = GL.getICD().glCreateQueries; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, ids.length, ids, __functionAddress); + } + + /** + * Array version of: {@link #glGetTextureSubImage GetTextureSubImage} + * + * @see Reference Page + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") short[] pixels) { + long __functionAddress = GL.getICD().glGetTextureSubImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels.length << 1, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glGetTextureSubImage GetTextureSubImage} + * + * @see Reference Page + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") int[] pixels) { + long __functionAddress = GL.getICD().glGetTextureSubImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels.length << 2, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glGetTextureSubImage GetTextureSubImage} + * + * @see Reference Page + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") float[] pixels) { + long __functionAddress = GL.getICD().glGetTextureSubImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels.length << 2, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glGetTextureSubImage GetTextureSubImage} + * + * @see Reference Page + */ + public static void glGetTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") double[] pixels) { + long __functionAddress = GL.getICD().glGetTextureSubImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels.length << 3, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glGetCompressedTextureSubImage GetCompressedTextureSubImage} + * + * @see Reference Page + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") short[] pixels) { + long __functionAddress = GL.getICD().glGetCompressedTextureSubImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels.length << 1, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glGetCompressedTextureSubImage GetCompressedTextureSubImage} + * + * @see Reference Page + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") int[] pixels) { + long __functionAddress = GL.getICD().glGetCompressedTextureSubImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels.length << 2, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glGetCompressedTextureSubImage GetCompressedTextureSubImage} + * + * @see Reference Page + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") float[] pixels) { + long __functionAddress = GL.getICD().glGetCompressedTextureSubImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels.length << 2, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glGetCompressedTextureSubImage GetCompressedTextureSubImage} + * + * @see Reference Page + */ + public static void glGetCompressedTextureSubImage(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int xoffset, @NativeType("GLint") int yoffset, @NativeType("GLint") int zoffset, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("void *") double[] pixels) { + long __functionAddress = GL.getICD().glGetCompressedTextureSubImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(texture, level, xoffset, yoffset, zoffset, width, height, depth, pixels.length << 3, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glGetnTexImage GetnTexImage} + * + * @see Reference Page + */ + public static void glGetnTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") short[] img) { + long __functionAddress = GL.getICD().glGetnTexImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(tex, level, format, type, img.length << 1, img, __functionAddress); + } + + /** + * Array version of: {@link #glGetnTexImage GetnTexImage} + * + * @see Reference Page + */ + public static void glGetnTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") int[] img) { + long __functionAddress = GL.getICD().glGetnTexImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(tex, level, format, type, img.length << 2, img, __functionAddress); + } + + /** + * Array version of: {@link #glGetnTexImage GetnTexImage} + * + * @see Reference Page + */ + public static void glGetnTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") float[] img) { + long __functionAddress = GL.getICD().glGetnTexImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(tex, level, format, type, img.length << 2, img, __functionAddress); + } + + /** + * Array version of: {@link #glGetnTexImage GetnTexImage} + * + * @see Reference Page + */ + public static void glGetnTexImage(@NativeType("GLenum") int tex, @NativeType("GLint") int level, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") double[] img) { + long __functionAddress = GL.getICD().glGetnTexImage; + if (CHECKS) { + check(__functionAddress); + } + callPV(tex, level, format, type, img.length << 3, img, __functionAddress); + } + + /** + * Array version of: {@link #glReadnPixels ReadnPixels} + * + * @see Reference Page + */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") short[] pixels) { + long __functionAddress = GL.getICD().glReadnPixels; + if (CHECKS) { + check(__functionAddress); + } + callPV(x, y, width, height, format, type, pixels.length << 1, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glReadnPixels ReadnPixels} + * + * @see Reference Page + */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") int[] pixels) { + long __functionAddress = GL.getICD().glReadnPixels; + if (CHECKS) { + check(__functionAddress); + } + callPV(x, y, width, height, format, type, pixels.length << 2, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glReadnPixels ReadnPixels} + * + * @see Reference Page + */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") float[] pixels) { + long __functionAddress = GL.getICD().glReadnPixels; + if (CHECKS) { + check(__functionAddress); + } + callPV(x, y, width, height, format, type, pixels.length << 2, pixels, __functionAddress); + } + + /** + * Array version of: {@link #glGetnUniformfv GetnUniformfv} + * + * @see Reference Page + */ + public static void glGetnUniformfv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetnUniformfv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, params.length, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetnUniformdv GetnUniformdv} + * + * @see Reference Page + */ + public static void glGetnUniformdv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLdouble *") double[] params) { + long __functionAddress = GL.getICD().glGetnUniformdv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, params.length, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetnUniformiv GetnUniformiv} + * + * @see Reference Page + */ + public static void glGetnUniformiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetnUniformiv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, params.length, params, __functionAddress); + } + + /** + * Array version of: {@link #glGetnUniformuiv GetnUniformuiv} + * + * @see Reference Page + */ + public static void glGetnUniformuiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint *") int[] params) { + long __functionAddress = GL.getICD().glGetnUniformuiv; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, params.length, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL46.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL46.java new file mode 100644 index 00000000..c4428b17 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL46.java @@ -0,0 +1,379 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * The OpenGL functionality up to version 4.6. Includes the deprecated symbols of the Compatibility Profile. + * + *

OpenGL 4.6 implementations support revision 4.60 of the OpenGL Shading Language.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL46 extends GL45 { + + /** + * Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferPointerv, + * MapBufferRange, FlushMappedBufferRange, GetBufferParameteriv, and CopyBufferSubData. + */ + public static final int GL_PARAMETER_BUFFER = 0x80EE; + + /** Accepted by the {@code value} parameter of GetIntegerv, GetBooleanv, GetFloatv, and GetDoublev. */ + public static final int GL_PARAMETER_BUFFER_BINDING = 0x80EF; + + /** + * Accepted by the {@code target} parameter of {@link GL15C#glBeginQuery BeginQuery}, {@link GL15C#glEndQuery EndQuery}, {@link GL15C#glGetQueryiv GetQueryiv}, + * {@link GL40C#glBeginQueryIndexed BeginQueryIndexed}, {@link GL40C#glEndQueryIndexed EndQueryIndexed} and {@link GL40C#glGetQueryIndexediv GetQueryIndexediv}. + */ + public static final int + GL_VERTICES_SUBMITTED = 0x82EE, + GL_PRIMITIVES_SUBMITTED = 0x82EF, + GL_VERTEX_SHADER_INVOCATIONS = 0x82F0, + GL_TESS_CONTROL_SHADER_PATCHES = 0x82F1, + GL_TESS_EVALUATION_SHADER_INVOCATIONS = 0x82F2, + GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED = 0x82F3, + GL_FRAGMENT_SHADER_INVOCATIONS = 0x82F4, + GL_COMPUTE_SHADER_INVOCATIONS = 0x82F5, + GL_CLIPPING_INPUT_PRIMITIVES = 0x82F6, + GL_CLIPPING_OUTPUT_PRIMITIVES = 0x82F7; + + /** Accepted by the {@code pname} parameters of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int GL_POLYGON_OFFSET_CLAMP = 0x8E1B; + + /** If set in {@link GL30#GL_CONTEXT_FLAGS CONTEXT_FLAGS}, then no error behavior is enabled for this context. */ + public static final int GL_CONTEXT_FLAG_NO_ERROR_BIT = 0x8; + + /** Accepted by the {@code binaryformat} parameter of {@link GL41C#glShaderBinary ShaderBinary}. */ + public static final int GL_SHADER_BINARY_FORMAT_SPIR_V = 0x9551; + + /** Accepted by the {@code pname} parameter of {@link GL20C#glGetShaderiv GetShaderiv}. */ + public static final int GL_SPIR_V_BINARY = 0x9552; + + /** Accepted by the {@code name} parameter of {@link GL30C#glGetStringi GetStringi}. */ + public static final int GL_SPIR_V_EXTENSIONS = 0x9553; + + /** Accepted by the {@code pname} parameter of {@link GL11C#glGetIntegerv GetIntegerv}. */ + public static final int GL_NUM_SPIR_V_EXTENSIONS = 0x9554; + + /** Accepted by the {@code pname} parameters of GetTexParameterfv, GetTexParameteriv, TexParameterf, TexParameterfv, TexParameteri, and TexParameteriv. */ + public static final int GL_TEXTURE_MAX_ANISOTROPY = 0x84FE; + + /** Accepted by the {@code pname} parameters of GetBooleanv, GetDoublev, GetFloatv, and GetIntegerv. */ + public static final int GL_MAX_TEXTURE_MAX_ANISOTROPY = 0x84FF; + + /** + * Accepted by the {@code target} parameter of {@link GL15C#glBeginQuery BeginQuery}, {@link GL15C#glEndQuery EndQuery}, {@link GL15C#glGetQueryiv GetQueryiv}, + * {@link GL40C#glBeginQueryIndexed BeginQueryIndexed}, {@link GL40C#glEndQueryIndexed EndQueryIndexed} and {@link GL40C#glGetQueryIndexediv GetQueryIndexediv}. + */ + public static final int + GL_TRANSFORM_FEEDBACK_OVERFLOW = 0x82EC, + GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW = 0x82ED; + + static { GL.initialize(); } + + protected GL46() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glMultiDrawArraysIndirectCount, caps.glMultiDrawElementsIndirectCount, caps.glPolygonOffsetClamp, caps.glSpecializeShader + ); + } + + // --- [ glMultiDrawArraysIndirectCount ] --- + + /** Unsafe version of: {@link #glMultiDrawArraysIndirectCount MultiDrawArraysIndirectCount} */ + public static void nglMultiDrawArraysIndirectCount(int mode, long indirect, long drawcount, int maxdrawcount, int stride) { + GL46C.nglMultiDrawArraysIndirectCount(mode, indirect, drawcount, maxdrawcount, stride); + } + + /** + * Behaves similarly to {@link GL43C#glMultiDrawArraysIndirect MultiDrawArraysIndirect}, except that {@code drawcount} defines an offset (in bytes) into the buffer object bound to the + * {@link GL46C#GL_PARAMETER_BUFFER PARAMETER_BUFFER} binding point at which a single {@code sizei} typed value is stored, which contains the draw count. {@code maxdrawcount} specifies + * the maximum number of draws that are expected to be stored in the buffer. If the value stored at {@code drawcount} into the buffer is greater than + * {@code maxdrawcount}, the implementation stops processing draws after {@code maxdrawcount} parameter sets. {@code drawcount} must be a multiple of + * four. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect an array of structures containing the draw parameters + * @param drawcount the offset into the parameter buffer object + * @param maxdrawcount the maximum number of draws + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawArraysIndirectCount(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + GL46C.glMultiDrawArraysIndirectCount(mode, indirect, drawcount, maxdrawcount, stride); + } + + /** + * Behaves similarly to {@link GL43C#glMultiDrawArraysIndirect MultiDrawArraysIndirect}, except that {@code drawcount} defines an offset (in bytes) into the buffer object bound to the + * {@link GL46C#GL_PARAMETER_BUFFER PARAMETER_BUFFER} binding point at which a single {@code sizei} typed value is stored, which contains the draw count. {@code maxdrawcount} specifies + * the maximum number of draws that are expected to be stored in the buffer. If the value stored at {@code drawcount} into the buffer is greater than + * {@code maxdrawcount}, the implementation stops processing draws after {@code maxdrawcount} parameter sets. {@code drawcount} must be a multiple of + * four. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect an array of structures containing the draw parameters + * @param drawcount the offset into the parameter buffer object + * @param maxdrawcount the maximum number of draws + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawArraysIndirectCount(@NativeType("GLenum") int mode, @NativeType("void const *") long indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + GL46C.glMultiDrawArraysIndirectCount(mode, indirect, drawcount, maxdrawcount, stride); + } + + /** + * Behaves similarly to {@link GL43C#glMultiDrawArraysIndirect MultiDrawArraysIndirect}, except that {@code drawcount} defines an offset (in bytes) into the buffer object bound to the + * {@link GL46C#GL_PARAMETER_BUFFER PARAMETER_BUFFER} binding point at which a single {@code sizei} typed value is stored, which contains the draw count. {@code maxdrawcount} specifies + * the maximum number of draws that are expected to be stored in the buffer. If the value stored at {@code drawcount} into the buffer is greater than + * {@code maxdrawcount}, the implementation stops processing draws after {@code maxdrawcount} parameter sets. {@code drawcount} must be a multiple of + * four. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect an array of structures containing the draw parameters + * @param drawcount the offset into the parameter buffer object + * @param maxdrawcount the maximum number of draws + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawArraysIndirectCount(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + GL46C.glMultiDrawArraysIndirectCount(mode, indirect, drawcount, maxdrawcount, stride); + } + + // --- [ glMultiDrawElementsIndirectCount ] --- + + /** Unsafe version of: {@link #glMultiDrawElementsIndirectCount MultiDrawElementsIndirectCount} */ + public static void nglMultiDrawElementsIndirectCount(int mode, int type, long indirect, long drawcount, int maxdrawcount, int stride) { + GL46C.nglMultiDrawElementsIndirectCount(mode, type, indirect, drawcount, maxdrawcount, stride); + } + + /** + * Behaves similarly to {@link GL43C#glMultiDrawElementsIndirect MultiDrawElementsIndirect}, except that {@code drawcount} defines an offset (in bytes) into the buffer object bound to the + * {@link GL46C#GL_PARAMETER_BUFFER PARAMETER_BUFFER} binding point at which a single {@code sizei} typed value is stored, which contains the draw count. {@code maxdrawcount} specifies + * the maximum number of draws that are expected to be stored in the buffer. If the value stored at {@code drawcount} into the buffer is greater than + * {@code maxdrawcount}, the implementation stops processing draws after {@code maxdrawcount} parameter sets. {@code drawcount} must be a multiple of + * four. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect a structure containing an array of draw parameters + * @param drawcount the offset into the parameter buffer object + * @param maxdrawcount the maximum number of draws + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawElementsIndirectCount(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + GL46C.glMultiDrawElementsIndirectCount(mode, type, indirect, drawcount, maxdrawcount, stride); + } + + /** + * Behaves similarly to {@link GL43C#glMultiDrawElementsIndirect MultiDrawElementsIndirect}, except that {@code drawcount} defines an offset (in bytes) into the buffer object bound to the + * {@link GL46C#GL_PARAMETER_BUFFER PARAMETER_BUFFER} binding point at which a single {@code sizei} typed value is stored, which contains the draw count. {@code maxdrawcount} specifies + * the maximum number of draws that are expected to be stored in the buffer. If the value stored at {@code drawcount} into the buffer is greater than + * {@code maxdrawcount}, the implementation stops processing draws after {@code maxdrawcount} parameter sets. {@code drawcount} must be a multiple of + * four. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect a structure containing an array of draw parameters + * @param drawcount the offset into the parameter buffer object + * @param maxdrawcount the maximum number of draws + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawElementsIndirectCount(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") long indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + GL46C.glMultiDrawElementsIndirectCount(mode, type, indirect, drawcount, maxdrawcount, stride); + } + + /** + * Behaves similarly to {@link GL43C#glMultiDrawElementsIndirect MultiDrawElementsIndirect}, except that {@code drawcount} defines an offset (in bytes) into the buffer object bound to the + * {@link GL46C#GL_PARAMETER_BUFFER PARAMETER_BUFFER} binding point at which a single {@code sizei} typed value is stored, which contains the draw count. {@code maxdrawcount} specifies + * the maximum number of draws that are expected to be stored in the buffer. If the value stored at {@code drawcount} into the buffer is greater than + * {@code maxdrawcount}, the implementation stops processing draws after {@code maxdrawcount} parameter sets. {@code drawcount} must be a multiple of + * four. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect a structure containing an array of draw parameters + * @param drawcount the offset into the parameter buffer object + * @param maxdrawcount the maximum number of draws + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawElementsIndirectCount(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + GL46C.glMultiDrawElementsIndirectCount(mode, type, indirect, drawcount, maxdrawcount, stride); + } + + // --- [ glPolygonOffsetClamp ] --- + + /** + * The depth values of all fragments generated by the rasterization of a polygon may be offset by a single value that is computed for that polygon. This + * function determines this value. + * + *

{@code factor} scales the maximum depth slope of the polygon, and {@code units} scales an implementation-dependent constant that relates to the usable + * resolution of the depth buffer. The resulting values are summed to produce the polygon offset value, which may then be clamped to a minimum or maximum + * value specified by {@code clamp}.

+ * + *

The values {@code factor}, {@code units}, and {@code clamp} may each be positive, negative, or zero. Calling the command {@link GL11C#glPolygonOffset PolygonOffset} is equivalent + * to calling the command {@code PolygonOffsetClamp} with clamp equal to zero.

+ * + * @param factor scales the maximum depth slope of the polygon + * @param units scales an implementation-dependent constant that relates to the usable resolution of the depth buffer + * @param clamp the minimum or maximum polygon offset value + * + * @see Reference Page + */ + public static void glPolygonOffsetClamp(@NativeType("GLfloat") float factor, @NativeType("GLfloat") float units, @NativeType("GLfloat") float clamp) { + GL46C.glPolygonOffsetClamp(factor, units, clamp); + } + + // --- [ glSpecializeShader ] --- + + /** + * Unsafe version of: {@link #glSpecializeShader SpecializeShader} + * + * @param numSpecializationConstants the number of specialization constants whose values to set in this call + */ + public static void nglSpecializeShader(int shader, long pEntryPoint, int numSpecializationConstants, long pConstantIndex, long pConstantValue) { + GL46C.nglSpecializeShader(shader, pEntryPoint, numSpecializationConstants, pConstantIndex, pConstantValue); + } + + /** + * Specializes a shader created from a SPIR-V module. + * + *

Shaders associated with SPIR-V modules must be specialized before they can be linked into a program object. It is not necessary to specialize the + * shader before it is attached to a program object. Once specialized, a shader may not be specialized again without first re-associating the original + * SPIR-V module with it, through {@link GL41C#glShaderBinary ShaderBinary}.

+ * + *

Specialization does two things:

+ * + *
    + *
  • Selects the name of the entry point, for that shader’s stage, from the SPIR-V module.
  • + *
  • Sets the values of all, or a subset of, the specialization constants in the SPIRV module.
  • + *
+ * + *

On successful shader specialization, the compile status for shader is set to {@link GL11#GL_TRUE TRUE}. On failure, the compile status for shader is set to {@link GL11#GL_FALSE FALSE} and + * additional information about the cause of the failure may be available in the shader compilation log.

+ * + * @param shader the name of a shader object containing unspecialized SPIR-V as created from a successful call to {@link GL41C#glShaderBinary ShaderBinary} to which a SPIR-V module was + * passed + * @param pEntryPoint a pointer to a null-terminated UTF-8 string specifying the name of the entry point in the SPIR-V module to use for this shader + * @param pConstantIndex is a pointer to an array of {@code numSpecializationConstants} unsigned integers, each holding the index of a specialization constant in the SPIR-V + * module whose value to set. + * + *

Specialization constants not referenced by {@code pConstantIndex} retain their default values as specified in the SPIR-V module.

+ * @param pConstantValue an entry in {@code pConstantValue} is used to set the value of the specialization constant indexed by the corresponding entry in + * {@code pConstantIndex}. + * + *

Although this array is of unsigned integer, each entry is bitcast to the appropriate type for the module, and therefore, floating-point constants + * may be set by including their IEEE-754 bit representation in the {@code pConstantValue} array.

+ * + * @see Reference Page + */ + public static void glSpecializeShader(@NativeType("GLuint") int shader, @NativeType("GLchar const *") ByteBuffer pEntryPoint, @NativeType("GLuint const *") IntBuffer pConstantIndex, @NativeType("GLuint const *") IntBuffer pConstantValue) { + GL46C.glSpecializeShader(shader, pEntryPoint, pConstantIndex, pConstantValue); + } + + /** + * Specializes a shader created from a SPIR-V module. + * + *

Shaders associated with SPIR-V modules must be specialized before they can be linked into a program object. It is not necessary to specialize the + * shader before it is attached to a program object. Once specialized, a shader may not be specialized again without first re-associating the original + * SPIR-V module with it, through {@link GL41C#glShaderBinary ShaderBinary}.

+ * + *

Specialization does two things:

+ * + *
    + *
  • Selects the name of the entry point, for that shader’s stage, from the SPIR-V module.
  • + *
  • Sets the values of all, or a subset of, the specialization constants in the SPIRV module.
  • + *
+ * + *

On successful shader specialization, the compile status for shader is set to {@link GL11#GL_TRUE TRUE}. On failure, the compile status for shader is set to {@link GL11#GL_FALSE FALSE} and + * additional information about the cause of the failure may be available in the shader compilation log.

+ * + * @param shader the name of a shader object containing unspecialized SPIR-V as created from a successful call to {@link GL41C#glShaderBinary ShaderBinary} to which a SPIR-V module was + * passed + * @param pEntryPoint a pointer to a null-terminated UTF-8 string specifying the name of the entry point in the SPIR-V module to use for this shader + * @param pConstantIndex is a pointer to an array of {@code numSpecializationConstants} unsigned integers, each holding the index of a specialization constant in the SPIR-V + * module whose value to set. + * + *

Specialization constants not referenced by {@code pConstantIndex} retain their default values as specified in the SPIR-V module.

+ * @param pConstantValue an entry in {@code pConstantValue} is used to set the value of the specialization constant indexed by the corresponding entry in + * {@code pConstantIndex}. + * + *

Although this array is of unsigned integer, each entry is bitcast to the appropriate type for the module, and therefore, floating-point constants + * may be set by including their IEEE-754 bit representation in the {@code pConstantValue} array.

+ * + * @see Reference Page + */ + public static void glSpecializeShader(@NativeType("GLuint") int shader, @NativeType("GLchar const *") CharSequence pEntryPoint, @NativeType("GLuint const *") IntBuffer pConstantIndex, @NativeType("GLuint const *") IntBuffer pConstantValue) { + GL46C.glSpecializeShader(shader, pEntryPoint, pConstantIndex, pConstantValue); + } + + /** + * Array version of: {@link #glMultiDrawArraysIndirectCount MultiDrawArraysIndirectCount} + * + * @see Reference Page + */ + public static void glMultiDrawArraysIndirectCount(@NativeType("GLenum") int mode, @NativeType("void const *") int[] indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + GL46C.glMultiDrawArraysIndirectCount(mode, indirect, drawcount, maxdrawcount, stride); + } + + /** + * Array version of: {@link #glMultiDrawElementsIndirectCount MultiDrawElementsIndirectCount} + * + * @see Reference Page + */ + public static void glMultiDrawElementsIndirectCount(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") int[] indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + GL46C.glMultiDrawElementsIndirectCount(mode, type, indirect, drawcount, maxdrawcount, stride); + } + + /** + * Array version of: {@link #glSpecializeShader SpecializeShader} + * + * @see Reference Page + */ + public static void glSpecializeShader(@NativeType("GLuint") int shader, @NativeType("GLchar const *") ByteBuffer pEntryPoint, @NativeType("GLuint const *") int[] pConstantIndex, @NativeType("GLuint const *") int[] pConstantValue) { + GL46C.glSpecializeShader(shader, pEntryPoint, pConstantIndex, pConstantValue); + } + + /** + * Array version of: {@link #glSpecializeShader SpecializeShader} + * + * @see Reference Page + */ + public static void glSpecializeShader(@NativeType("GLuint") int shader, @NativeType("GLchar const *") CharSequence pEntryPoint, @NativeType("GLuint const *") int[] pConstantIndex, @NativeType("GLuint const *") int[] pConstantValue) { + GL46C.glSpecializeShader(shader, pEntryPoint, pConstantIndex, pConstantValue); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL46C.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL46C.java new file mode 100644 index 00000000..72aadc47 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GL46C.java @@ -0,0 +1,422 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * The OpenGL functionality up to version 4.6. Includes only Core Profile symbols. + * + *

OpenGL 4.6 implementations support revision 4.60 of the OpenGL Shading Language.

+ * + *

Extensions promoted to core in this release:

+ * + * + */ +public class GL46C extends GL45C { + + /** + * Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferPointerv, + * MapBufferRange, FlushMappedBufferRange, GetBufferParameteriv, and CopyBufferSubData. + */ + public static final int GL_PARAMETER_BUFFER = 0x80EE; + + /** Accepted by the {@code value} parameter of GetIntegerv, GetBooleanv, GetFloatv, and GetDoublev. */ + public static final int GL_PARAMETER_BUFFER_BINDING = 0x80EF; + + /** + * Accepted by the {@code target} parameter of {@link GL15C#glBeginQuery BeginQuery}, {@link GL15C#glEndQuery EndQuery}, {@link GL15C#glGetQueryiv GetQueryiv}, + * {@link GL40C#glBeginQueryIndexed BeginQueryIndexed}, {@link GL40C#glEndQueryIndexed EndQueryIndexed} and {@link GL40C#glGetQueryIndexediv GetQueryIndexediv}. + */ + public static final int + GL_VERTICES_SUBMITTED = 0x82EE, + GL_PRIMITIVES_SUBMITTED = 0x82EF, + GL_VERTEX_SHADER_INVOCATIONS = 0x82F0, + GL_TESS_CONTROL_SHADER_PATCHES = 0x82F1, + GL_TESS_EVALUATION_SHADER_INVOCATIONS = 0x82F2, + GL_GEOMETRY_SHADER_PRIMITIVES_EMITTED = 0x82F3, + GL_FRAGMENT_SHADER_INVOCATIONS = 0x82F4, + GL_COMPUTE_SHADER_INVOCATIONS = 0x82F5, + GL_CLIPPING_INPUT_PRIMITIVES = 0x82F6, + GL_CLIPPING_OUTPUT_PRIMITIVES = 0x82F7; + + /** Accepted by the {@code pname} parameters of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int GL_POLYGON_OFFSET_CLAMP = 0x8E1B; + + /** If set in {@link GL30#GL_CONTEXT_FLAGS CONTEXT_FLAGS}, then no error behavior is enabled for this context. */ + public static final int GL_CONTEXT_FLAG_NO_ERROR_BIT = 0x8; + + /** Accepted by the {@code binaryformat} parameter of {@link GL41C#glShaderBinary ShaderBinary}. */ + public static final int GL_SHADER_BINARY_FORMAT_SPIR_V = 0x9551; + + /** Accepted by the {@code pname} parameter of {@link GL20C#glGetShaderiv GetShaderiv}. */ + public static final int GL_SPIR_V_BINARY = 0x9552; + + /** Accepted by the {@code name} parameter of {@link GL30C#glGetStringi GetStringi}. */ + public static final int GL_SPIR_V_EXTENSIONS = 0x9553; + + /** Accepted by the {@code pname} parameter of {@link GL11C#glGetIntegerv GetIntegerv}. */ + public static final int GL_NUM_SPIR_V_EXTENSIONS = 0x9554; + + /** Accepted by the {@code pname} parameters of GetTexParameterfv, GetTexParameteriv, TexParameterf, TexParameterfv, TexParameteri, and TexParameteriv. */ + public static final int GL_TEXTURE_MAX_ANISOTROPY = 0x84FE; + + /** Accepted by the {@code pname} parameters of GetBooleanv, GetDoublev, GetFloatv, and GetIntegerv. */ + public static final int GL_MAX_TEXTURE_MAX_ANISOTROPY = 0x84FF; + + /** + * Accepted by the {@code target} parameter of {@link GL15C#glBeginQuery BeginQuery}, {@link GL15C#glEndQuery EndQuery}, {@link GL15C#glGetQueryiv GetQueryiv}, + * {@link GL40C#glBeginQueryIndexed BeginQueryIndexed}, {@link GL40C#glEndQueryIndexed EndQueryIndexed} and {@link GL40C#glGetQueryIndexediv GetQueryIndexediv}. + */ + public static final int + GL_TRANSFORM_FEEDBACK_OVERFLOW = 0x82EC, + GL_TRANSFORM_FEEDBACK_STREAM_OVERFLOW = 0x82ED; + + static { GL.initialize(); } + + protected GL46C() { + throw new UnsupportedOperationException(); + } + + // --- [ glMultiDrawArraysIndirectCount ] --- + + /** Unsafe version of: {@link #glMultiDrawArraysIndirectCount MultiDrawArraysIndirectCount} */ + public static native void nglMultiDrawArraysIndirectCount(int mode, long indirect, long drawcount, int maxdrawcount, int stride); + + /** + * Behaves similarly to {@link GL43C#glMultiDrawArraysIndirect MultiDrawArraysIndirect}, except that {@code drawcount} defines an offset (in bytes) into the buffer object bound to the + * {@link #GL_PARAMETER_BUFFER PARAMETER_BUFFER} binding point at which a single {@code sizei} typed value is stored, which contains the draw count. {@code maxdrawcount} specifies + * the maximum number of draws that are expected to be stored in the buffer. If the value stored at {@code drawcount} into the buffer is greater than + * {@code maxdrawcount}, the implementation stops processing draws after {@code maxdrawcount} parameter sets. {@code drawcount} must be a multiple of + * four. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect an array of structures containing the draw parameters + * @param drawcount the offset into the parameter buffer object + * @param maxdrawcount the maximum number of draws + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawArraysIndirectCount(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + if (CHECKS) { + check(indirect, maxdrawcount * (stride == 0 ? (4 * 4) : stride)); + } + nglMultiDrawArraysIndirectCount(mode, memAddress(indirect), drawcount, maxdrawcount, stride); + } + + /** + * Behaves similarly to {@link GL43C#glMultiDrawArraysIndirect MultiDrawArraysIndirect}, except that {@code drawcount} defines an offset (in bytes) into the buffer object bound to the + * {@link #GL_PARAMETER_BUFFER PARAMETER_BUFFER} binding point at which a single {@code sizei} typed value is stored, which contains the draw count. {@code maxdrawcount} specifies + * the maximum number of draws that are expected to be stored in the buffer. If the value stored at {@code drawcount} into the buffer is greater than + * {@code maxdrawcount}, the implementation stops processing draws after {@code maxdrawcount} parameter sets. {@code drawcount} must be a multiple of + * four. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect an array of structures containing the draw parameters + * @param drawcount the offset into the parameter buffer object + * @param maxdrawcount the maximum number of draws + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawArraysIndirectCount(@NativeType("GLenum") int mode, @NativeType("void const *") long indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + nglMultiDrawArraysIndirectCount(mode, indirect, drawcount, maxdrawcount, stride); + } + + /** + * Behaves similarly to {@link GL43C#glMultiDrawArraysIndirect MultiDrawArraysIndirect}, except that {@code drawcount} defines an offset (in bytes) into the buffer object bound to the + * {@link #GL_PARAMETER_BUFFER PARAMETER_BUFFER} binding point at which a single {@code sizei} typed value is stored, which contains the draw count. {@code maxdrawcount} specifies + * the maximum number of draws that are expected to be stored in the buffer. If the value stored at {@code drawcount} into the buffer is greater than + * {@code maxdrawcount}, the implementation stops processing draws after {@code maxdrawcount} parameter sets. {@code drawcount} must be a multiple of + * four. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect an array of structures containing the draw parameters + * @param drawcount the offset into the parameter buffer object + * @param maxdrawcount the maximum number of draws + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawArraysIndirectCount(@NativeType("GLenum") int mode, @NativeType("void const *") IntBuffer indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + if (CHECKS) { + check(indirect, (maxdrawcount * (stride == 0 ? (4 * 4) : stride)) >> 2); + } + nglMultiDrawArraysIndirectCount(mode, memAddress(indirect), drawcount, maxdrawcount, stride); + } + + // --- [ glMultiDrawElementsIndirectCount ] --- + + /** Unsafe version of: {@link #glMultiDrawElementsIndirectCount MultiDrawElementsIndirectCount} */ + public static native void nglMultiDrawElementsIndirectCount(int mode, int type, long indirect, long drawcount, int maxdrawcount, int stride); + + /** + * Behaves similarly to {@link GL43C#glMultiDrawElementsIndirect MultiDrawElementsIndirect}, except that {@code drawcount} defines an offset (in bytes) into the buffer object bound to the + * {@link #GL_PARAMETER_BUFFER PARAMETER_BUFFER} binding point at which a single {@code sizei} typed value is stored, which contains the draw count. {@code maxdrawcount} specifies + * the maximum number of draws that are expected to be stored in the buffer. If the value stored at {@code drawcount} into the buffer is greater than + * {@code maxdrawcount}, the implementation stops processing draws after {@code maxdrawcount} parameter sets. {@code drawcount} must be a multiple of + * four. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect a structure containing an array of draw parameters + * @param drawcount the offset into the parameter buffer object + * @param maxdrawcount the maximum number of draws + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawElementsIndirectCount(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + if (CHECKS) { + check(indirect, maxdrawcount * (stride == 0 ? (5 * 4) : stride)); + } + nglMultiDrawElementsIndirectCount(mode, type, memAddress(indirect), drawcount, maxdrawcount, stride); + } + + /** + * Behaves similarly to {@link GL43C#glMultiDrawElementsIndirect MultiDrawElementsIndirect}, except that {@code drawcount} defines an offset (in bytes) into the buffer object bound to the + * {@link #GL_PARAMETER_BUFFER PARAMETER_BUFFER} binding point at which a single {@code sizei} typed value is stored, which contains the draw count. {@code maxdrawcount} specifies + * the maximum number of draws that are expected to be stored in the buffer. If the value stored at {@code drawcount} into the buffer is greater than + * {@code maxdrawcount}, the implementation stops processing draws after {@code maxdrawcount} parameter sets. {@code drawcount} must be a multiple of + * four. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect a structure containing an array of draw parameters + * @param drawcount the offset into the parameter buffer object + * @param maxdrawcount the maximum number of draws + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawElementsIndirectCount(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") long indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + nglMultiDrawElementsIndirectCount(mode, type, indirect, drawcount, maxdrawcount, stride); + } + + /** + * Behaves similarly to {@link GL43C#glMultiDrawElementsIndirect MultiDrawElementsIndirect}, except that {@code drawcount} defines an offset (in bytes) into the buffer object bound to the + * {@link #GL_PARAMETER_BUFFER PARAMETER_BUFFER} binding point at which a single {@code sizei} typed value is stored, which contains the draw count. {@code maxdrawcount} specifies + * the maximum number of draws that are expected to be stored in the buffer. If the value stored at {@code drawcount} into the buffer is greater than + * {@code maxdrawcount}, the implementation stops processing draws after {@code maxdrawcount} parameter sets. {@code drawcount} must be a multiple of + * four. + * + * @param mode what kind of primitives to render. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the type of data in the buffer bound to the GL_ELEMENT_ARRAY_BUFFER binding. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect a structure containing an array of draw parameters + * @param drawcount the offset into the parameter buffer object + * @param maxdrawcount the maximum number of draws + * @param stride the distance in basic machine units between elements of the draw parameter array + * + * @see Reference Page + */ + public static void glMultiDrawElementsIndirectCount(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") IntBuffer indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + if (CHECKS) { + check(indirect, (maxdrawcount * (stride == 0 ? (5 * 4) : stride)) >> 2); + } + nglMultiDrawElementsIndirectCount(mode, type, memAddress(indirect), drawcount, maxdrawcount, stride); + } + + // --- [ glPolygonOffsetClamp ] --- + + /** + * The depth values of all fragments generated by the rasterization of a polygon may be offset by a single value that is computed for that polygon. This + * function determines this value. + * + *

{@code factor} scales the maximum depth slope of the polygon, and {@code units} scales an implementation-dependent constant that relates to the usable + * resolution of the depth buffer. The resulting values are summed to produce the polygon offset value, which may then be clamped to a minimum or maximum + * value specified by {@code clamp}.

+ * + *

The values {@code factor}, {@code units}, and {@code clamp} may each be positive, negative, or zero. Calling the command {@link GL11C#glPolygonOffset PolygonOffset} is equivalent + * to calling the command {@code PolygonOffsetClamp} with clamp equal to zero.

+ * + * @param factor scales the maximum depth slope of the polygon + * @param units scales an implementation-dependent constant that relates to the usable resolution of the depth buffer + * @param clamp the minimum or maximum polygon offset value + * + * @see Reference Page + */ + public static native void glPolygonOffsetClamp(@NativeType("GLfloat") float factor, @NativeType("GLfloat") float units, @NativeType("GLfloat") float clamp); + + // --- [ glSpecializeShader ] --- + + /** + * Unsafe version of: {@link #glSpecializeShader SpecializeShader} + * + * @param numSpecializationConstants the number of specialization constants whose values to set in this call + */ + public static native void nglSpecializeShader(int shader, long pEntryPoint, int numSpecializationConstants, long pConstantIndex, long pConstantValue); + + /** + * Specializes a shader created from a SPIR-V module. + * + *

Shaders associated with SPIR-V modules must be specialized before they can be linked into a program object. It is not necessary to specialize the + * shader before it is attached to a program object. Once specialized, a shader may not be specialized again without first re-associating the original + * SPIR-V module with it, through {@link GL41C#glShaderBinary ShaderBinary}.

+ * + *

Specialization does two things:

+ * + *
    + *
  • Selects the name of the entry point, for that shader’s stage, from the SPIR-V module.
  • + *
  • Sets the values of all, or a subset of, the specialization constants in the SPIRV module.
  • + *
+ * + *

On successful shader specialization, the compile status for shader is set to {@link GL11#GL_TRUE TRUE}. On failure, the compile status for shader is set to {@link GL11#GL_FALSE FALSE} and + * additional information about the cause of the failure may be available in the shader compilation log.

+ * + * @param shader the name of a shader object containing unspecialized SPIR-V as created from a successful call to {@link GL41C#glShaderBinary ShaderBinary} to which a SPIR-V module was + * passed + * @param pEntryPoint a pointer to a null-terminated UTF-8 string specifying the name of the entry point in the SPIR-V module to use for this shader + * @param pConstantIndex is a pointer to an array of {@code numSpecializationConstants} unsigned integers, each holding the index of a specialization constant in the SPIR-V + * module whose value to set. + * + *

Specialization constants not referenced by {@code pConstantIndex} retain their default values as specified in the SPIR-V module.

+ * @param pConstantValue an entry in {@code pConstantValue} is used to set the value of the specialization constant indexed by the corresponding entry in + * {@code pConstantIndex}. + * + *

Although this array is of unsigned integer, each entry is bitcast to the appropriate type for the module, and therefore, floating-point constants + * may be set by including their IEEE-754 bit representation in the {@code pConstantValue} array.

+ * + * @see Reference Page + */ + public static void glSpecializeShader(@NativeType("GLuint") int shader, @NativeType("GLchar const *") ByteBuffer pEntryPoint, @NativeType("GLuint const *") IntBuffer pConstantIndex, @NativeType("GLuint const *") IntBuffer pConstantValue) { + if (CHECKS) { + checkNT1(pEntryPoint); + check(pConstantValue, pConstantIndex.remaining()); + } + nglSpecializeShader(shader, memAddress(pEntryPoint), pConstantIndex.remaining(), memAddress(pConstantIndex), memAddress(pConstantValue)); + } + + /** + * Specializes a shader created from a SPIR-V module. + * + *

Shaders associated with SPIR-V modules must be specialized before they can be linked into a program object. It is not necessary to specialize the + * shader before it is attached to a program object. Once specialized, a shader may not be specialized again without first re-associating the original + * SPIR-V module with it, through {@link GL41C#glShaderBinary ShaderBinary}.

+ * + *

Specialization does two things:

+ * + *
    + *
  • Selects the name of the entry point, for that shader’s stage, from the SPIR-V module.
  • + *
  • Sets the values of all, or a subset of, the specialization constants in the SPIRV module.
  • + *
+ * + *

On successful shader specialization, the compile status for shader is set to {@link GL11#GL_TRUE TRUE}. On failure, the compile status for shader is set to {@link GL11#GL_FALSE FALSE} and + * additional information about the cause of the failure may be available in the shader compilation log.

+ * + * @param shader the name of a shader object containing unspecialized SPIR-V as created from a successful call to {@link GL41C#glShaderBinary ShaderBinary} to which a SPIR-V module was + * passed + * @param pEntryPoint a pointer to a null-terminated UTF-8 string specifying the name of the entry point in the SPIR-V module to use for this shader + * @param pConstantIndex is a pointer to an array of {@code numSpecializationConstants} unsigned integers, each holding the index of a specialization constant in the SPIR-V + * module whose value to set. + * + *

Specialization constants not referenced by {@code pConstantIndex} retain their default values as specified in the SPIR-V module.

+ * @param pConstantValue an entry in {@code pConstantValue} is used to set the value of the specialization constant indexed by the corresponding entry in + * {@code pConstantIndex}. + * + *

Although this array is of unsigned integer, each entry is bitcast to the appropriate type for the module, and therefore, floating-point constants + * may be set by including their IEEE-754 bit representation in the {@code pConstantValue} array.

+ * + * @see Reference Page + */ + public static void glSpecializeShader(@NativeType("GLuint") int shader, @NativeType("GLchar const *") CharSequence pEntryPoint, @NativeType("GLuint const *") IntBuffer pConstantIndex, @NativeType("GLuint const *") IntBuffer pConstantValue) { + if (CHECKS) { + check(pConstantValue, pConstantIndex.remaining()); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(pEntryPoint, true); + long pEntryPointEncoded = stack.getPointerAddress(); + nglSpecializeShader(shader, pEntryPointEncoded, pConstantIndex.remaining(), memAddress(pConstantIndex), memAddress(pConstantValue)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Array version of: {@link #glMultiDrawArraysIndirectCount MultiDrawArraysIndirectCount} + * + * @see Reference Page + */ + public static void glMultiDrawArraysIndirectCount(@NativeType("GLenum") int mode, @NativeType("void const *") int[] indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + long __functionAddress = GL.getICD().glMultiDrawArraysIndirectCount; + if (CHECKS) { + check(__functionAddress); + check(indirect, (maxdrawcount * (stride == 0 ? (4 * 4) : stride)) >> 2); + } + callPPV(mode, indirect, drawcount, maxdrawcount, stride, __functionAddress); + } + + /** + * Array version of: {@link #glMultiDrawElementsIndirectCount MultiDrawElementsIndirectCount} + * + * @see Reference Page + */ + public static void glMultiDrawElementsIndirectCount(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") int[] indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride) { + long __functionAddress = GL.getICD().glMultiDrawElementsIndirectCount; + if (CHECKS) { + check(__functionAddress); + check(indirect, (maxdrawcount * (stride == 0 ? (5 * 4) : stride)) >> 2); + } + callPPV(mode, type, indirect, drawcount, maxdrawcount, stride, __functionAddress); + } + + /** + * Array version of: {@link #glSpecializeShader SpecializeShader} + * + * @see Reference Page + */ + public static void glSpecializeShader(@NativeType("GLuint") int shader, @NativeType("GLchar const *") ByteBuffer pEntryPoint, @NativeType("GLuint const *") int[] pConstantIndex, @NativeType("GLuint const *") int[] pConstantValue) { + long __functionAddress = GL.getICD().glSpecializeShader; + if (CHECKS) { + check(__functionAddress); + checkNT1(pEntryPoint); + check(pConstantValue, pConstantIndex.length); + } + callPPPV(shader, memAddress(pEntryPoint), pConstantIndex.length, pConstantIndex, pConstantValue, __functionAddress); + } + + /** + * Array version of: {@link #glSpecializeShader SpecializeShader} + * + * @see Reference Page + */ + public static void glSpecializeShader(@NativeType("GLuint") int shader, @NativeType("GLchar const *") CharSequence pEntryPoint, @NativeType("GLuint const *") int[] pConstantIndex, @NativeType("GLuint const *") int[] pConstantValue) { + long __functionAddress = GL.getICD().glSpecializeShader; + if (CHECKS) { + check(__functionAddress); + check(pConstantValue, pConstantIndex.length); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(pEntryPoint, true); + long pEntryPointEncoded = stack.getPointerAddress(); + callPPPV(shader, pEntryPointEncoded, pConstantIndex.length, pConstantIndex, pConstantValue, __functionAddress); + } finally { + stack.setPointer(stackPointer); + } + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLCapabilities.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLCapabilities.java new file mode 100644 index 00000000..e671da9f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLCapabilities.java @@ -0,0 +1,6844 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; +import java.util.Set; +import org.lwjgl.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Defines the capabilities of an OpenGL context. */ +public final class GLCapabilities { + + public final long + glAccum, + glAlphaFunc, + glAreTexturesResident, + glArrayElement, + glBegin, + glBitmap, + glCallList, + glCallLists, + glClearAccum, + glClearIndex, + glClipPlane, + glColor3b, + glColor3s, + glColor3i, + glColor3f, + glColor3d, + glColor3ub, + glColor3us, + glColor3ui, + glColor3bv, + glColor3sv, + glColor3iv, + glColor3fv, + glColor3dv, + glColor3ubv, + glColor3usv, + glColor3uiv, + glColor4b, + glColor4s, + glColor4i, + glColor4f, + glColor4d, + glColor4ub, + glColor4us, + glColor4ui, + glColor4bv, + glColor4sv, + glColor4iv, + glColor4fv, + glColor4dv, + glColor4ubv, + glColor4usv, + glColor4uiv, + glColorMaterial, + glColorPointer, + glCopyPixels, + glDeleteLists, + glDisableClientState, + glDrawPixels, + glEdgeFlag, + glEdgeFlagv, + glEdgeFlagPointer, + glEnableClientState, + glEnd, + glEvalCoord1f, + glEvalCoord1fv, + glEvalCoord1d, + glEvalCoord1dv, + glEvalCoord2f, + glEvalCoord2fv, + glEvalCoord2d, + glEvalCoord2dv, + glEvalMesh1, + glEvalMesh2, + glEvalPoint1, + glEvalPoint2, + glFeedbackBuffer, + glFogi, + glFogiv, + glFogf, + glFogfv, + glGenLists, + glGetClipPlane, + glGetLightiv, + glGetLightfv, + glGetMapiv, + glGetMapfv, + glGetMapdv, + glGetMaterialiv, + glGetMaterialfv, + glGetPixelMapfv, + glGetPixelMapusv, + glGetPixelMapuiv, + glGetPolygonStipple, + glGetTexEnviv, + glGetTexEnvfv, + glGetTexGeniv, + glGetTexGenfv, + glGetTexGendv, + glIndexi, + glIndexub, + glIndexs, + glIndexf, + glIndexd, + glIndexiv, + glIndexubv, + glIndexsv, + glIndexfv, + glIndexdv, + glIndexMask, + glIndexPointer, + glInitNames, + glInterleavedArrays, + glIsList, + glLightModeli, + glLightModelf, + glLightModeliv, + glLightModelfv, + glLighti, + glLightf, + glLightiv, + glLightfv, + glLineStipple, + glListBase, + glLoadMatrixf, + glLoadMatrixd, + glLoadIdentity, + glLoadName, + glMap1f, + glMap1d, + glMap2f, + glMap2d, + glMapGrid1f, + glMapGrid1d, + glMapGrid2f, + glMapGrid2d, + glMateriali, + glMaterialf, + glMaterialiv, + glMaterialfv, + glMatrixMode, + glMultMatrixf, + glMultMatrixd, + glFrustum, + glNewList, + glEndList, + glNormal3f, + glNormal3b, + glNormal3s, + glNormal3i, + glNormal3d, + glNormal3fv, + glNormal3bv, + glNormal3sv, + glNormal3iv, + glNormal3dv, + glNormalPointer, + glOrtho, + glPassThrough, + glPixelMapfv, + glPixelMapusv, + glPixelMapuiv, + glPixelTransferi, + glPixelTransferf, + glPixelZoom, + glPolygonStipple, + glPushAttrib, + glPushClientAttrib, + glPopAttrib, + glPopClientAttrib, + glPopMatrix, + glPopName, + glPrioritizeTextures, + glPushMatrix, + glPushName, + glRasterPos2i, + glRasterPos2s, + glRasterPos2f, + glRasterPos2d, + glRasterPos2iv, + glRasterPos2sv, + glRasterPos2fv, + glRasterPos2dv, + glRasterPos3i, + glRasterPos3s, + glRasterPos3f, + glRasterPos3d, + glRasterPos3iv, + glRasterPos3sv, + glRasterPos3fv, + glRasterPos3dv, + glRasterPos4i, + glRasterPos4s, + glRasterPos4f, + glRasterPos4d, + glRasterPos4iv, + glRasterPos4sv, + glRasterPos4fv, + glRasterPos4dv, + glRecti, + glRects, + glRectf, + glRectd, + glRectiv, + glRectsv, + glRectfv, + glRectdv, + glRenderMode, + glRotatef, + glRotated, + glScalef, + glScaled, + glSelectBuffer, + glShadeModel, + glTexCoord1f, + glTexCoord1s, + glTexCoord1i, + glTexCoord1d, + glTexCoord1fv, + glTexCoord1sv, + glTexCoord1iv, + glTexCoord1dv, + glTexCoord2f, + glTexCoord2s, + glTexCoord2i, + glTexCoord2d, + glTexCoord2fv, + glTexCoord2sv, + glTexCoord2iv, + glTexCoord2dv, + glTexCoord3f, + glTexCoord3s, + glTexCoord3i, + glTexCoord3d, + glTexCoord3fv, + glTexCoord3sv, + glTexCoord3iv, + glTexCoord3dv, + glTexCoord4f, + glTexCoord4s, + glTexCoord4i, + glTexCoord4d, + glTexCoord4fv, + glTexCoord4sv, + glTexCoord4iv, + glTexCoord4dv, + glTexCoordPointer, + glTexEnvi, + glTexEnviv, + glTexEnvf, + glTexEnvfv, + glTexGeni, + glTexGeniv, + glTexGenf, + glTexGenfv, + glTexGend, + glTexGendv, + glTranslatef, + glTranslated, + glVertex2f, + glVertex2s, + glVertex2i, + glVertex2d, + glVertex2fv, + glVertex2sv, + glVertex2iv, + glVertex2dv, + glVertex3f, + glVertex3s, + glVertex3i, + glVertex3d, + glVertex3fv, + glVertex3sv, + glVertex3iv, + glVertex3dv, + glVertex4f, + glVertex4s, + glVertex4i, + glVertex4d, + glVertex4fv, + glVertex4sv, + glVertex4iv, + glVertex4dv, + glVertexPointer, + glEnable, + glDisable, + glBindTexture, + glBlendFunc, + glClear, + glClearColor, + glClearDepth, + glClearStencil, + glColorMask, + glCullFace, + glDepthFunc, + glDepthMask, + glDepthRange, + glDrawArrays, + glDrawBuffer, + glDrawElements, + glFinish, + glFlush, + glFrontFace, + glGenTextures, + glDeleteTextures, + glGetBooleanv, + glGetFloatv, + glGetIntegerv, + glGetDoublev, + glGetError, + glGetPointerv, + glGetString, + glGetTexImage, + glGetTexLevelParameteriv, + glGetTexLevelParameterfv, + glGetTexParameteriv, + glGetTexParameterfv, + glHint, + glIsEnabled, + glIsTexture, + glLineWidth, + glLogicOp, + glPixelStorei, + glPixelStoref, + glPointSize, + glPolygonMode, + glPolygonOffset, + glReadBuffer, + glReadPixels, + glScissor, + glStencilFunc, + glStencilMask, + glStencilOp, + glTexImage1D, + glTexImage2D, + glCopyTexImage1D, + glCopyTexImage2D, + glCopyTexSubImage1D, + glCopyTexSubImage2D, + glTexParameteri, + glTexParameteriv, + glTexParameterf, + glTexParameterfv, + glTexSubImage1D, + glTexSubImage2D, + glViewport, + glTexImage3D, + glTexSubImage3D, + glCopyTexSubImage3D, + glDrawRangeElements, + glClientActiveTexture, + glMultiTexCoord1f, + glMultiTexCoord1s, + glMultiTexCoord1i, + glMultiTexCoord1d, + glMultiTexCoord1fv, + glMultiTexCoord1sv, + glMultiTexCoord1iv, + glMultiTexCoord1dv, + glMultiTexCoord2f, + glMultiTexCoord2s, + glMultiTexCoord2i, + glMultiTexCoord2d, + glMultiTexCoord2fv, + glMultiTexCoord2sv, + glMultiTexCoord2iv, + glMultiTexCoord2dv, + glMultiTexCoord3f, + glMultiTexCoord3s, + glMultiTexCoord3i, + glMultiTexCoord3d, + glMultiTexCoord3fv, + glMultiTexCoord3sv, + glMultiTexCoord3iv, + glMultiTexCoord3dv, + glMultiTexCoord4f, + glMultiTexCoord4s, + glMultiTexCoord4i, + glMultiTexCoord4d, + glMultiTexCoord4fv, + glMultiTexCoord4sv, + glMultiTexCoord4iv, + glMultiTexCoord4dv, + glLoadTransposeMatrixf, + glLoadTransposeMatrixd, + glMultTransposeMatrixf, + glMultTransposeMatrixd, + glCompressedTexImage3D, + glCompressedTexImage2D, + glCompressedTexImage1D, + glCompressedTexSubImage3D, + glCompressedTexSubImage2D, + glCompressedTexSubImage1D, + glGetCompressedTexImage, + glSampleCoverage, + glActiveTexture, + glFogCoordf, + glFogCoordd, + glFogCoordfv, + glFogCoorddv, + glFogCoordPointer, + glSecondaryColor3b, + glSecondaryColor3s, + glSecondaryColor3i, + glSecondaryColor3f, + glSecondaryColor3d, + glSecondaryColor3ub, + glSecondaryColor3us, + glSecondaryColor3ui, + glSecondaryColor3bv, + glSecondaryColor3sv, + glSecondaryColor3iv, + glSecondaryColor3fv, + glSecondaryColor3dv, + glSecondaryColor3ubv, + glSecondaryColor3usv, + glSecondaryColor3uiv, + glSecondaryColorPointer, + glWindowPos2i, + glWindowPos2s, + glWindowPos2f, + glWindowPos2d, + glWindowPos2iv, + glWindowPos2sv, + glWindowPos2fv, + glWindowPos2dv, + glWindowPos3i, + glWindowPos3s, + glWindowPos3f, + glWindowPos3d, + glWindowPos3iv, + glWindowPos3sv, + glWindowPos3fv, + glWindowPos3dv, + glBlendColor, + glBlendEquation, + glMultiDrawArrays, + glMultiDrawElements, + glPointParameterf, + glPointParameteri, + glPointParameterfv, + glPointParameteriv, + glBlendFuncSeparate, + glBindBuffer, + glDeleteBuffers, + glGenBuffers, + glIsBuffer, + glBufferData, + glBufferSubData, + glGetBufferSubData, + glMapBuffer, + glUnmapBuffer, + glGetBufferParameteriv, + glGetBufferPointerv, + glGenQueries, + glDeleteQueries, + glIsQuery, + glBeginQuery, + glEndQuery, + glGetQueryiv, + glGetQueryObjectiv, + glGetQueryObjectuiv, + glCreateProgram, + glDeleteProgram, + glIsProgram, + glCreateShader, + glDeleteShader, + glIsShader, + glAttachShader, + glDetachShader, + glShaderSource, + glCompileShader, + glLinkProgram, + glUseProgram, + glValidateProgram, + glUniform1f, + glUniform2f, + glUniform3f, + glUniform4f, + glUniform1i, + glUniform2i, + glUniform3i, + glUniform4i, + glUniform1fv, + glUniform2fv, + glUniform3fv, + glUniform4fv, + glUniform1iv, + glUniform2iv, + glUniform3iv, + glUniform4iv, + glUniformMatrix2fv, + glUniformMatrix3fv, + glUniformMatrix4fv, + glGetShaderiv, + glGetProgramiv, + glGetShaderInfoLog, + glGetProgramInfoLog, + glGetAttachedShaders, + glGetUniformLocation, + glGetActiveUniform, + glGetUniformfv, + glGetUniformiv, + glGetShaderSource, + glVertexAttrib1f, + glVertexAttrib1s, + glVertexAttrib1d, + glVertexAttrib2f, + glVertexAttrib2s, + glVertexAttrib2d, + glVertexAttrib3f, + glVertexAttrib3s, + glVertexAttrib3d, + glVertexAttrib4f, + glVertexAttrib4s, + glVertexAttrib4d, + glVertexAttrib4Nub, + glVertexAttrib1fv, + glVertexAttrib1sv, + glVertexAttrib1dv, + glVertexAttrib2fv, + glVertexAttrib2sv, + glVertexAttrib2dv, + glVertexAttrib3fv, + glVertexAttrib3sv, + glVertexAttrib3dv, + glVertexAttrib4fv, + glVertexAttrib4sv, + glVertexAttrib4dv, + glVertexAttrib4iv, + glVertexAttrib4bv, + glVertexAttrib4ubv, + glVertexAttrib4usv, + glVertexAttrib4uiv, + glVertexAttrib4Nbv, + glVertexAttrib4Nsv, + glVertexAttrib4Niv, + glVertexAttrib4Nubv, + glVertexAttrib4Nusv, + glVertexAttrib4Nuiv, + glVertexAttribPointer, + glEnableVertexAttribArray, + glDisableVertexAttribArray, + glBindAttribLocation, + glGetActiveAttrib, + glGetAttribLocation, + glGetVertexAttribiv, + glGetVertexAttribfv, + glGetVertexAttribdv, + glGetVertexAttribPointerv, + glDrawBuffers, + glBlendEquationSeparate, + glStencilOpSeparate, + glStencilFuncSeparate, + glStencilMaskSeparate, + glUniformMatrix2x3fv, + glUniformMatrix3x2fv, + glUniformMatrix2x4fv, + glUniformMatrix4x2fv, + glUniformMatrix3x4fv, + glUniformMatrix4x3fv, + glGetStringi, + glClearBufferiv, + glClearBufferuiv, + glClearBufferfv, + glClearBufferfi, + glVertexAttribI1i, + glVertexAttribI2i, + glVertexAttribI3i, + glVertexAttribI4i, + glVertexAttribI1ui, + glVertexAttribI2ui, + glVertexAttribI3ui, + glVertexAttribI4ui, + glVertexAttribI1iv, + glVertexAttribI2iv, + glVertexAttribI3iv, + glVertexAttribI4iv, + glVertexAttribI1uiv, + glVertexAttribI2uiv, + glVertexAttribI3uiv, + glVertexAttribI4uiv, + glVertexAttribI4bv, + glVertexAttribI4sv, + glVertexAttribI4ubv, + glVertexAttribI4usv, + glVertexAttribIPointer, + glGetVertexAttribIiv, + glGetVertexAttribIuiv, + glUniform1ui, + glUniform2ui, + glUniform3ui, + glUniform4ui, + glUniform1uiv, + glUniform2uiv, + glUniform3uiv, + glUniform4uiv, + glGetUniformuiv, + glBindFragDataLocation, + glGetFragDataLocation, + glBeginConditionalRender, + glEndConditionalRender, + glMapBufferRange, + glFlushMappedBufferRange, + glClampColor, + glIsRenderbuffer, + glBindRenderbuffer, + glDeleteRenderbuffers, + glGenRenderbuffers, + glRenderbufferStorage, + glRenderbufferStorageMultisample, + glGetRenderbufferParameteriv, + glIsFramebuffer, + glBindFramebuffer, + glDeleteFramebuffers, + glGenFramebuffers, + glCheckFramebufferStatus, + glFramebufferTexture1D, + glFramebufferTexture2D, + glFramebufferTexture3D, + glFramebufferTextureLayer, + glFramebufferRenderbuffer, + glGetFramebufferAttachmentParameteriv, + glBlitFramebuffer, + glGenerateMipmap, + glTexParameterIiv, + glTexParameterIuiv, + glGetTexParameterIiv, + glGetTexParameterIuiv, + glColorMaski, + glGetBooleani_v, + glGetIntegeri_v, + glEnablei, + glDisablei, + glIsEnabledi, + glBindBufferRange, + glBindBufferBase, + glBeginTransformFeedback, + glEndTransformFeedback, + glTransformFeedbackVaryings, + glGetTransformFeedbackVarying, + glBindVertexArray, + glDeleteVertexArrays, + glGenVertexArrays, + glIsVertexArray, + glDrawArraysInstanced, + glDrawElementsInstanced, + glCopyBufferSubData, + glPrimitiveRestartIndex, + glTexBuffer, + glGetUniformIndices, + glGetActiveUniformsiv, + glGetActiveUniformName, + glGetUniformBlockIndex, + glGetActiveUniformBlockiv, + glGetActiveUniformBlockName, + glUniformBlockBinding, + glGetBufferParameteri64v, + glDrawElementsBaseVertex, + glDrawRangeElementsBaseVertex, + glDrawElementsInstancedBaseVertex, + glMultiDrawElementsBaseVertex, + glProvokingVertex, + glTexImage2DMultisample, + glTexImage3DMultisample, + glGetMultisamplefv, + glSampleMaski, + glFramebufferTexture, + glFenceSync, + glIsSync, + glDeleteSync, + glClientWaitSync, + glWaitSync, + glGetInteger64v, + glGetInteger64i_v, + glGetSynciv, + glVertexP2ui, + glVertexP3ui, + glVertexP4ui, + glVertexP2uiv, + glVertexP3uiv, + glVertexP4uiv, + glTexCoordP1ui, + glTexCoordP2ui, + glTexCoordP3ui, + glTexCoordP4ui, + glTexCoordP1uiv, + glTexCoordP2uiv, + glTexCoordP3uiv, + glTexCoordP4uiv, + glMultiTexCoordP1ui, + glMultiTexCoordP2ui, + glMultiTexCoordP3ui, + glMultiTexCoordP4ui, + glMultiTexCoordP1uiv, + glMultiTexCoordP2uiv, + glMultiTexCoordP3uiv, + glMultiTexCoordP4uiv, + glNormalP3ui, + glNormalP3uiv, + glColorP3ui, + glColorP4ui, + glColorP3uiv, + glColorP4uiv, + glSecondaryColorP3ui, + glSecondaryColorP3uiv, + glBindFragDataLocationIndexed, + glGetFragDataIndex, + glGenSamplers, + glDeleteSamplers, + glIsSampler, + glBindSampler, + glSamplerParameteri, + glSamplerParameterf, + glSamplerParameteriv, + glSamplerParameterfv, + glSamplerParameterIiv, + glSamplerParameterIuiv, + glGetSamplerParameteriv, + glGetSamplerParameterfv, + glGetSamplerParameterIiv, + glGetSamplerParameterIuiv, + glQueryCounter, + glGetQueryObjecti64v, + glGetQueryObjectui64v, + glVertexAttribDivisor, + glVertexAttribP1ui, + glVertexAttribP2ui, + glVertexAttribP3ui, + glVertexAttribP4ui, + glVertexAttribP1uiv, + glVertexAttribP2uiv, + glVertexAttribP3uiv, + glVertexAttribP4uiv, + glBlendEquationi, + glBlendEquationSeparatei, + glBlendFunci, + glBlendFuncSeparatei, + glDrawArraysIndirect, + glDrawElementsIndirect, + glUniform1d, + glUniform2d, + glUniform3d, + glUniform4d, + glUniform1dv, + glUniform2dv, + glUniform3dv, + glUniform4dv, + glUniformMatrix2dv, + glUniformMatrix3dv, + glUniformMatrix4dv, + glUniformMatrix2x3dv, + glUniformMatrix2x4dv, + glUniformMatrix3x2dv, + glUniformMatrix3x4dv, + glUniformMatrix4x2dv, + glUniformMatrix4x3dv, + glGetUniformdv, + glMinSampleShading, + glGetSubroutineUniformLocation, + glGetSubroutineIndex, + glGetActiveSubroutineUniformiv, + glGetActiveSubroutineUniformName, + glGetActiveSubroutineName, + glUniformSubroutinesuiv, + glGetUniformSubroutineuiv, + glGetProgramStageiv, + glPatchParameteri, + glPatchParameterfv, + glBindTransformFeedback, + glDeleteTransformFeedbacks, + glGenTransformFeedbacks, + glIsTransformFeedback, + glPauseTransformFeedback, + glResumeTransformFeedback, + glDrawTransformFeedback, + glDrawTransformFeedbackStream, + glBeginQueryIndexed, + glEndQueryIndexed, + glGetQueryIndexediv, + glReleaseShaderCompiler, + glShaderBinary, + glGetShaderPrecisionFormat, + glDepthRangef, + glClearDepthf, + glGetProgramBinary, + glProgramBinary, + glProgramParameteri, + glUseProgramStages, + glActiveShaderProgram, + glCreateShaderProgramv, + glBindProgramPipeline, + glDeleteProgramPipelines, + glGenProgramPipelines, + glIsProgramPipeline, + glGetProgramPipelineiv, + glProgramUniform1i, + glProgramUniform2i, + glProgramUniform3i, + glProgramUniform4i, + glProgramUniform1ui, + glProgramUniform2ui, + glProgramUniform3ui, + glProgramUniform4ui, + glProgramUniform1f, + glProgramUniform2f, + glProgramUniform3f, + glProgramUniform4f, + glProgramUniform1d, + glProgramUniform2d, + glProgramUniform3d, + glProgramUniform4d, + glProgramUniform1iv, + glProgramUniform2iv, + glProgramUniform3iv, + glProgramUniform4iv, + glProgramUniform1uiv, + glProgramUniform2uiv, + glProgramUniform3uiv, + glProgramUniform4uiv, + glProgramUniform1fv, + glProgramUniform2fv, + glProgramUniform3fv, + glProgramUniform4fv, + glProgramUniform1dv, + glProgramUniform2dv, + glProgramUniform3dv, + glProgramUniform4dv, + glProgramUniformMatrix2fv, + glProgramUniformMatrix3fv, + glProgramUniformMatrix4fv, + glProgramUniformMatrix2dv, + glProgramUniformMatrix3dv, + glProgramUniformMatrix4dv, + glProgramUniformMatrix2x3fv, + glProgramUniformMatrix3x2fv, + glProgramUniformMatrix2x4fv, + glProgramUniformMatrix4x2fv, + glProgramUniformMatrix3x4fv, + glProgramUniformMatrix4x3fv, + glProgramUniformMatrix2x3dv, + glProgramUniformMatrix3x2dv, + glProgramUniformMatrix2x4dv, + glProgramUniformMatrix4x2dv, + glProgramUniformMatrix3x4dv, + glProgramUniformMatrix4x3dv, + glValidateProgramPipeline, + glGetProgramPipelineInfoLog, + glVertexAttribL1d, + glVertexAttribL2d, + glVertexAttribL3d, + glVertexAttribL4d, + glVertexAttribL1dv, + glVertexAttribL2dv, + glVertexAttribL3dv, + glVertexAttribL4dv, + glVertexAttribLPointer, + glGetVertexAttribLdv, + glViewportArrayv, + glViewportIndexedf, + glViewportIndexedfv, + glScissorArrayv, + glScissorIndexed, + glScissorIndexedv, + glDepthRangeArrayv, + glDepthRangeIndexed, + glGetFloati_v, + glGetDoublei_v, + glGetActiveAtomicCounterBufferiv, + glTexStorage1D, + glTexStorage2D, + glTexStorage3D, + glDrawTransformFeedbackInstanced, + glDrawTransformFeedbackStreamInstanced, + glDrawArraysInstancedBaseInstance, + glDrawElementsInstancedBaseInstance, + glDrawElementsInstancedBaseVertexBaseInstance, + glBindImageTexture, + glMemoryBarrier, + glGetInternalformativ, + glClearBufferData, + glClearBufferSubData, + glDispatchCompute, + glDispatchComputeIndirect, + glCopyImageSubData, + glDebugMessageControl, + glDebugMessageInsert, + glDebugMessageCallback, + glGetDebugMessageLog, + glPushDebugGroup, + glPopDebugGroup, + glObjectLabel, + glGetObjectLabel, + glObjectPtrLabel, + glGetObjectPtrLabel, + glFramebufferParameteri, + glGetFramebufferParameteriv, + glGetInternalformati64v, + glInvalidateTexSubImage, + glInvalidateTexImage, + glInvalidateBufferSubData, + glInvalidateBufferData, + glInvalidateFramebuffer, + glInvalidateSubFramebuffer, + glMultiDrawArraysIndirect, + glMultiDrawElementsIndirect, + glGetProgramInterfaceiv, + glGetProgramResourceIndex, + glGetProgramResourceName, + glGetProgramResourceiv, + glGetProgramResourceLocation, + glGetProgramResourceLocationIndex, + glShaderStorageBlockBinding, + glTexBufferRange, + glTexStorage2DMultisample, + glTexStorage3DMultisample, + glTextureView, + glBindVertexBuffer, + glVertexAttribFormat, + glVertexAttribIFormat, + glVertexAttribLFormat, + glVertexAttribBinding, + glVertexBindingDivisor, + glBufferStorage, + glClearTexSubImage, + glClearTexImage, + glBindBuffersBase, + glBindBuffersRange, + glBindTextures, + glBindSamplers, + glBindImageTextures, + glBindVertexBuffers, + glGetnMapdv, + glGetnMapfv, + glGetnMapiv, + glGetnPixelMapfv, + glGetnPixelMapuiv, + glGetnPixelMapusv, + glGetnPolygonStipple, + glGetnColorTable, + glGetnConvolutionFilter, + glGetnSeparableFilter, + glGetnHistogram, + glGetnMinmax, + glClipControl, + glCreateTransformFeedbacks, + glTransformFeedbackBufferBase, + glTransformFeedbackBufferRange, + glGetTransformFeedbackiv, + glGetTransformFeedbacki_v, + glGetTransformFeedbacki64_v, + glCreateBuffers, + glNamedBufferStorage, + glNamedBufferData, + glNamedBufferSubData, + glCopyNamedBufferSubData, + glClearNamedBufferData, + glClearNamedBufferSubData, + glMapNamedBuffer, + glMapNamedBufferRange, + glUnmapNamedBuffer, + glFlushMappedNamedBufferRange, + glGetNamedBufferParameteriv, + glGetNamedBufferParameteri64v, + glGetNamedBufferPointerv, + glGetNamedBufferSubData, + glCreateFramebuffers, + glNamedFramebufferRenderbuffer, + glNamedFramebufferParameteri, + glNamedFramebufferTexture, + glNamedFramebufferTextureLayer, + glNamedFramebufferDrawBuffer, + glNamedFramebufferDrawBuffers, + glNamedFramebufferReadBuffer, + glInvalidateNamedFramebufferData, + glInvalidateNamedFramebufferSubData, + glClearNamedFramebufferiv, + glClearNamedFramebufferuiv, + glClearNamedFramebufferfv, + glClearNamedFramebufferfi, + glBlitNamedFramebuffer, + glCheckNamedFramebufferStatus, + glGetNamedFramebufferParameteriv, + glGetNamedFramebufferAttachmentParameteriv, + glCreateRenderbuffers, + glNamedRenderbufferStorage, + glNamedRenderbufferStorageMultisample, + glGetNamedRenderbufferParameteriv, + glCreateTextures, + glTextureBuffer, + glTextureBufferRange, + glTextureStorage1D, + glTextureStorage2D, + glTextureStorage3D, + glTextureStorage2DMultisample, + glTextureStorage3DMultisample, + glTextureSubImage1D, + glTextureSubImage2D, + glTextureSubImage3D, + glCompressedTextureSubImage1D, + glCompressedTextureSubImage2D, + glCompressedTextureSubImage3D, + glCopyTextureSubImage1D, + glCopyTextureSubImage2D, + glCopyTextureSubImage3D, + glTextureParameterf, + glTextureParameterfv, + glTextureParameteri, + glTextureParameterIiv, + glTextureParameterIuiv, + glTextureParameteriv, + glGenerateTextureMipmap, + glBindTextureUnit, + glGetTextureImage, + glGetCompressedTextureImage, + glGetTextureLevelParameterfv, + glGetTextureLevelParameteriv, + glGetTextureParameterfv, + glGetTextureParameterIiv, + glGetTextureParameterIuiv, + glGetTextureParameteriv, + glCreateVertexArrays, + glDisableVertexArrayAttrib, + glEnableVertexArrayAttrib, + glVertexArrayElementBuffer, + glVertexArrayVertexBuffer, + glVertexArrayVertexBuffers, + glVertexArrayAttribFormat, + glVertexArrayAttribIFormat, + glVertexArrayAttribLFormat, + glVertexArrayAttribBinding, + glVertexArrayBindingDivisor, + glGetVertexArrayiv, + glGetVertexArrayIndexediv, + glGetVertexArrayIndexed64iv, + glCreateSamplers, + glCreateProgramPipelines, + glCreateQueries, + glGetQueryBufferObjectiv, + glGetQueryBufferObjectuiv, + glGetQueryBufferObjecti64v, + glGetQueryBufferObjectui64v, + glMemoryBarrierByRegion, + glGetTextureSubImage, + glGetCompressedTextureSubImage, + glTextureBarrier, + glGetGraphicsResetStatus, + glGetnTexImage, + glReadnPixels, + glGetnCompressedTexImage, + glGetnUniformfv, + glGetnUniformdv, + glGetnUniformiv, + glGetnUniformuiv, + glMultiDrawArraysIndirectCount, + glMultiDrawElementsIndirectCount, + glPolygonOffsetClamp, + glSpecializeShader, + glDebugMessageEnableAMD, + glDebugMessageInsertAMD, + glDebugMessageCallbackAMD, + glGetDebugMessageLogAMD, + glBlendFuncIndexedAMD, + glBlendFuncSeparateIndexedAMD, + glBlendEquationIndexedAMD, + glBlendEquationSeparateIndexedAMD, + glRenderbufferStorageMultisampleAdvancedAMD, + glNamedRenderbufferStorageMultisampleAdvancedAMD, + glVertexAttribParameteriAMD, + glQueryObjectParameteruiAMD, + glGetPerfMonitorGroupsAMD, + glGetPerfMonitorCountersAMD, + glGetPerfMonitorGroupStringAMD, + glGetPerfMonitorCounterStringAMD, + glGetPerfMonitorCounterInfoAMD, + glGenPerfMonitorsAMD, + glDeletePerfMonitorsAMD, + glSelectPerfMonitorCountersAMD, + glBeginPerfMonitorAMD, + glEndPerfMonitorAMD, + glGetPerfMonitorCounterDataAMD, + glSetMultisamplefvAMD, + glTexStorageSparseAMD, + glTextureStorageSparseAMD, + glStencilOpValueAMD, + glTessellationFactorAMD, + glTessellationModeAMD, + glGetTextureHandleARB, + glGetTextureSamplerHandleARB, + glMakeTextureHandleResidentARB, + glMakeTextureHandleNonResidentARB, + glGetImageHandleARB, + glMakeImageHandleResidentARB, + glMakeImageHandleNonResidentARB, + glUniformHandleui64ARB, + glUniformHandleui64vARB, + glProgramUniformHandleui64ARB, + glProgramUniformHandleui64vARB, + glIsTextureHandleResidentARB, + glIsImageHandleResidentARB, + glVertexAttribL1ui64ARB, + glVertexAttribL1ui64vARB, + glGetVertexAttribLui64vARB, + glNamedBufferStorageEXT, + glClearNamedBufferDataEXT, + glClearNamedBufferSubDataEXT, + glClampColorARB, + glDispatchComputeGroupSizeARB, + glDebugMessageControlARB, + glDebugMessageInsertARB, + glDebugMessageCallbackARB, + glGetDebugMessageLogARB, + glDrawBuffersARB, + glBlendEquationiARB, + glBlendEquationSeparateiARB, + glBlendFunciARB, + glBlendFuncSeparateiARB, + glDrawArraysInstancedARB, + glDrawElementsInstancedARB, + glPrimitiveBoundingBoxARB, + glNamedFramebufferParameteriEXT, + glGetNamedFramebufferParameterivEXT, + glProgramParameteriARB, + glFramebufferTextureARB, + glFramebufferTextureLayerARB, + glFramebufferTextureFaceARB, + glSpecializeShaderARB, + glProgramUniform1dEXT, + glProgramUniform2dEXT, + glProgramUniform3dEXT, + glProgramUniform4dEXT, + glProgramUniform1dvEXT, + glProgramUniform2dvEXT, + glProgramUniform3dvEXT, + glProgramUniform4dvEXT, + glProgramUniformMatrix2dvEXT, + glProgramUniformMatrix3dvEXT, + glProgramUniformMatrix4dvEXT, + glProgramUniformMatrix2x3dvEXT, + glProgramUniformMatrix2x4dvEXT, + glProgramUniformMatrix3x2dvEXT, + glProgramUniformMatrix3x4dvEXT, + glProgramUniformMatrix4x2dvEXT, + glProgramUniformMatrix4x3dvEXT, + glUniform1i64ARB, + glUniform1i64vARB, + glProgramUniform1i64ARB, + glProgramUniform1i64vARB, + glUniform2i64ARB, + glUniform2i64vARB, + glProgramUniform2i64ARB, + glProgramUniform2i64vARB, + glUniform3i64ARB, + glUniform3i64vARB, + glProgramUniform3i64ARB, + glProgramUniform3i64vARB, + glUniform4i64ARB, + glUniform4i64vARB, + glProgramUniform4i64ARB, + glProgramUniform4i64vARB, + glUniform1ui64ARB, + glUniform1ui64vARB, + glProgramUniform1ui64ARB, + glProgramUniform1ui64vARB, + glUniform2ui64ARB, + glUniform2ui64vARB, + glProgramUniform2ui64ARB, + glProgramUniform2ui64vARB, + glUniform3ui64ARB, + glUniform3ui64vARB, + glProgramUniform3ui64ARB, + glProgramUniform3ui64vARB, + glUniform4ui64ARB, + glUniform4ui64vARB, + glProgramUniform4ui64ARB, + glProgramUniform4ui64vARB, + glGetUniformi64vARB, + glGetUniformui64vARB, + glGetnUniformi64vARB, + glGetnUniformui64vARB, + glColorTable, + glCopyColorTable, + glColorTableParameteriv, + glColorTableParameterfv, + glGetColorTable, + glGetColorTableParameteriv, + glGetColorTableParameterfv, + glColorSubTable, + glCopyColorSubTable, + glConvolutionFilter1D, + glConvolutionFilter2D, + glCopyConvolutionFilter1D, + glCopyConvolutionFilter2D, + glGetConvolutionFilter, + glSeparableFilter2D, + glGetSeparableFilter, + glConvolutionParameteri, + glConvolutionParameteriv, + glConvolutionParameterf, + glConvolutionParameterfv, + glGetConvolutionParameteriv, + glGetConvolutionParameterfv, + glHistogram, + glResetHistogram, + glGetHistogram, + glGetHistogramParameteriv, + glGetHistogramParameterfv, + glMinmax, + glResetMinmax, + glGetMinmax, + glGetMinmaxParameteriv, + glGetMinmaxParameterfv, + glMultiDrawArraysIndirectCountARB, + glMultiDrawElementsIndirectCountARB, + glVertexAttribDivisorARB, + glVertexArrayVertexAttribDivisorEXT, + glCurrentPaletteMatrixARB, + glMatrixIndexuivARB, + glMatrixIndexubvARB, + glMatrixIndexusvARB, + glMatrixIndexPointerARB, + glSampleCoverageARB, + glActiveTextureARB, + glClientActiveTextureARB, + glMultiTexCoord1fARB, + glMultiTexCoord1sARB, + glMultiTexCoord1iARB, + glMultiTexCoord1dARB, + glMultiTexCoord1fvARB, + glMultiTexCoord1svARB, + glMultiTexCoord1ivARB, + glMultiTexCoord1dvARB, + glMultiTexCoord2fARB, + glMultiTexCoord2sARB, + glMultiTexCoord2iARB, + glMultiTexCoord2dARB, + glMultiTexCoord2fvARB, + glMultiTexCoord2svARB, + glMultiTexCoord2ivARB, + glMultiTexCoord2dvARB, + glMultiTexCoord3fARB, + glMultiTexCoord3sARB, + glMultiTexCoord3iARB, + glMultiTexCoord3dARB, + glMultiTexCoord3fvARB, + glMultiTexCoord3svARB, + glMultiTexCoord3ivARB, + glMultiTexCoord3dvARB, + glMultiTexCoord4fARB, + glMultiTexCoord4sARB, + glMultiTexCoord4iARB, + glMultiTexCoord4dARB, + glMultiTexCoord4fvARB, + glMultiTexCoord4svARB, + glMultiTexCoord4ivARB, + glMultiTexCoord4dvARB, + glGenQueriesARB, + glDeleteQueriesARB, + glIsQueryARB, + glBeginQueryARB, + glEndQueryARB, + glGetQueryivARB, + glGetQueryObjectivARB, + glGetQueryObjectuivARB, + glMaxShaderCompilerThreadsARB, + glPointParameterfARB, + glPointParameterfvARB, + glGetGraphicsResetStatusARB, + glGetnMapdvARB, + glGetnMapfvARB, + glGetnMapivARB, + glGetnPixelMapfvARB, + glGetnPixelMapuivARB, + glGetnPixelMapusvARB, + glGetnPolygonStippleARB, + glGetnTexImageARB, + glReadnPixelsARB, + glGetnColorTableARB, + glGetnConvolutionFilterARB, + glGetnSeparableFilterARB, + glGetnHistogramARB, + glGetnMinmaxARB, + glGetnCompressedTexImageARB, + glGetnUniformfvARB, + glGetnUniformivARB, + glGetnUniformuivARB, + glGetnUniformdvARB, + glFramebufferSampleLocationsfvARB, + glNamedFramebufferSampleLocationsfvARB, + glEvaluateDepthValuesARB, + glMinSampleShadingARB, + glDeleteObjectARB, + glGetHandleARB, + glDetachObjectARB, + glCreateShaderObjectARB, + glShaderSourceARB, + glCompileShaderARB, + glCreateProgramObjectARB, + glAttachObjectARB, + glLinkProgramARB, + glUseProgramObjectARB, + glValidateProgramARB, + glUniform1fARB, + glUniform2fARB, + glUniform3fARB, + glUniform4fARB, + glUniform1iARB, + glUniform2iARB, + glUniform3iARB, + glUniform4iARB, + glUniform1fvARB, + glUniform2fvARB, + glUniform3fvARB, + glUniform4fvARB, + glUniform1ivARB, + glUniform2ivARB, + glUniform3ivARB, + glUniform4ivARB, + glUniformMatrix2fvARB, + glUniformMatrix3fvARB, + glUniformMatrix4fvARB, + glGetObjectParameterfvARB, + glGetObjectParameterivARB, + glGetInfoLogARB, + glGetAttachedObjectsARB, + glGetUniformLocationARB, + glGetActiveUniformARB, + glGetUniformfvARB, + glGetUniformivARB, + glGetShaderSourceARB, + glNamedStringARB, + glDeleteNamedStringARB, + glCompileShaderIncludeARB, + glIsNamedStringARB, + glGetNamedStringARB, + glGetNamedStringivARB, + glBufferPageCommitmentARB, + glNamedBufferPageCommitmentEXT, + glNamedBufferPageCommitmentARB, + glTexPageCommitmentARB, + glTexturePageCommitmentEXT, + glTexBufferARB, + glTextureBufferRangeEXT, + glCompressedTexImage3DARB, + glCompressedTexImage2DARB, + glCompressedTexImage1DARB, + glCompressedTexSubImage3DARB, + glCompressedTexSubImage2DARB, + glCompressedTexSubImage1DARB, + glGetCompressedTexImageARB, + glTextureStorage1DEXT, + glTextureStorage2DEXT, + glTextureStorage3DEXT, + glTextureStorage2DMultisampleEXT, + glTextureStorage3DMultisampleEXT, + glLoadTransposeMatrixfARB, + glLoadTransposeMatrixdARB, + glMultTransposeMatrixfARB, + glMultTransposeMatrixdARB, + glVertexArrayVertexAttribLOffsetEXT, + glVertexArrayBindVertexBufferEXT, + glVertexArrayVertexAttribFormatEXT, + glVertexArrayVertexAttribIFormatEXT, + glVertexArrayVertexAttribLFormatEXT, + glVertexArrayVertexAttribBindingEXT, + glVertexArrayVertexBindingDivisorEXT, + glWeightfvARB, + glWeightbvARB, + glWeightubvARB, + glWeightsvARB, + glWeightusvARB, + glWeightivARB, + glWeightuivARB, + glWeightdvARB, + glWeightPointerARB, + glVertexBlendARB, + glBindBufferARB, + glDeleteBuffersARB, + glGenBuffersARB, + glIsBufferARB, + glBufferDataARB, + glBufferSubDataARB, + glGetBufferSubDataARB, + glMapBufferARB, + glUnmapBufferARB, + glGetBufferParameterivARB, + glGetBufferPointervARB, + glProgramStringARB, + glBindProgramARB, + glDeleteProgramsARB, + glGenProgramsARB, + glProgramEnvParameter4dARB, + glProgramEnvParameter4dvARB, + glProgramEnvParameter4fARB, + glProgramEnvParameter4fvARB, + glProgramLocalParameter4dARB, + glProgramLocalParameter4dvARB, + glProgramLocalParameter4fARB, + glProgramLocalParameter4fvARB, + glGetProgramEnvParameterfvARB, + glGetProgramEnvParameterdvARB, + glGetProgramLocalParameterfvARB, + glGetProgramLocalParameterdvARB, + glGetProgramivARB, + glGetProgramStringARB, + glIsProgramARB, + glVertexAttrib1fARB, + glVertexAttrib1sARB, + glVertexAttrib1dARB, + glVertexAttrib2fARB, + glVertexAttrib2sARB, + glVertexAttrib2dARB, + glVertexAttrib3fARB, + glVertexAttrib3sARB, + glVertexAttrib3dARB, + glVertexAttrib4fARB, + glVertexAttrib4sARB, + glVertexAttrib4dARB, + glVertexAttrib4NubARB, + glVertexAttrib1fvARB, + glVertexAttrib1svARB, + glVertexAttrib1dvARB, + glVertexAttrib2fvARB, + glVertexAttrib2svARB, + glVertexAttrib2dvARB, + glVertexAttrib3fvARB, + glVertexAttrib3svARB, + glVertexAttrib3dvARB, + glVertexAttrib4fvARB, + glVertexAttrib4svARB, + glVertexAttrib4dvARB, + glVertexAttrib4ivARB, + glVertexAttrib4bvARB, + glVertexAttrib4ubvARB, + glVertexAttrib4usvARB, + glVertexAttrib4uivARB, + glVertexAttrib4NbvARB, + glVertexAttrib4NsvARB, + glVertexAttrib4NivARB, + glVertexAttrib4NubvARB, + glVertexAttrib4NusvARB, + glVertexAttrib4NuivARB, + glVertexAttribPointerARB, + glEnableVertexAttribArrayARB, + glDisableVertexAttribArrayARB, + glBindAttribLocationARB, + glGetActiveAttribARB, + glGetAttribLocationARB, + glGetVertexAttribivARB, + glGetVertexAttribfvARB, + glGetVertexAttribdvARB, + glGetVertexAttribPointervARB, + glWindowPos2iARB, + glWindowPos2sARB, + glWindowPos2fARB, + glWindowPos2dARB, + glWindowPos2ivARB, + glWindowPos2svARB, + glWindowPos2fvARB, + glWindowPos2dvARB, + glWindowPos3iARB, + glWindowPos3sARB, + glWindowPos3fARB, + glWindowPos3dARB, + glWindowPos3ivARB, + glWindowPos3svARB, + glWindowPos3fvARB, + glWindowPos3dvARB, + glUniformBufferEXT, + glGetUniformBufferSizeEXT, + glGetUniformOffsetEXT, + glBlendColorEXT, + glBlendEquationSeparateEXT, + glBlendFuncSeparateEXT, + glBlendEquationEXT, + glLockArraysEXT, + glUnlockArraysEXT, + glLabelObjectEXT, + glGetObjectLabelEXT, + glInsertEventMarkerEXT, + glPushGroupMarkerEXT, + glPopGroupMarkerEXT, + glDepthBoundsEXT, + glClientAttribDefaultEXT, + glPushClientAttribDefaultEXT, + glMatrixLoadfEXT, + glMatrixLoaddEXT, + glMatrixMultfEXT, + glMatrixMultdEXT, + glMatrixLoadIdentityEXT, + glMatrixRotatefEXT, + glMatrixRotatedEXT, + glMatrixScalefEXT, + glMatrixScaledEXT, + glMatrixTranslatefEXT, + glMatrixTranslatedEXT, + glMatrixOrthoEXT, + glMatrixFrustumEXT, + glMatrixPushEXT, + glMatrixPopEXT, + glTextureParameteriEXT, + glTextureParameterivEXT, + glTextureParameterfEXT, + glTextureParameterfvEXT, + glTextureImage1DEXT, + glTextureImage2DEXT, + glTextureSubImage1DEXT, + glTextureSubImage2DEXT, + glCopyTextureImage1DEXT, + glCopyTextureImage2DEXT, + glCopyTextureSubImage1DEXT, + glCopyTextureSubImage2DEXT, + glGetTextureImageEXT, + glGetTextureParameterfvEXT, + glGetTextureParameterivEXT, + glGetTextureLevelParameterfvEXT, + glGetTextureLevelParameterivEXT, + glTextureImage3DEXT, + glTextureSubImage3DEXT, + glCopyTextureSubImage3DEXT, + glBindMultiTextureEXT, + glMultiTexCoordPointerEXT, + glMultiTexEnvfEXT, + glMultiTexEnvfvEXT, + glMultiTexEnviEXT, + glMultiTexEnvivEXT, + glMultiTexGendEXT, + glMultiTexGendvEXT, + glMultiTexGenfEXT, + glMultiTexGenfvEXT, + glMultiTexGeniEXT, + glMultiTexGenivEXT, + glGetMultiTexEnvfvEXT, + glGetMultiTexEnvivEXT, + glGetMultiTexGendvEXT, + glGetMultiTexGenfvEXT, + glGetMultiTexGenivEXT, + glMultiTexParameteriEXT, + glMultiTexParameterivEXT, + glMultiTexParameterfEXT, + glMultiTexParameterfvEXT, + glMultiTexImage1DEXT, + glMultiTexImage2DEXT, + glMultiTexSubImage1DEXT, + glMultiTexSubImage2DEXT, + glCopyMultiTexImage1DEXT, + glCopyMultiTexImage2DEXT, + glCopyMultiTexSubImage1DEXT, + glCopyMultiTexSubImage2DEXT, + glGetMultiTexImageEXT, + glGetMultiTexParameterfvEXT, + glGetMultiTexParameterivEXT, + glGetMultiTexLevelParameterfvEXT, + glGetMultiTexLevelParameterivEXT, + glMultiTexImage3DEXT, + glMultiTexSubImage3DEXT, + glCopyMultiTexSubImage3DEXT, + glEnableClientStateIndexedEXT, + glDisableClientStateIndexedEXT, + glEnableClientStateiEXT, + glDisableClientStateiEXT, + glGetFloatIndexedvEXT, + glGetDoubleIndexedvEXT, + glGetPointerIndexedvEXT, + glGetFloati_vEXT, + glGetDoublei_vEXT, + glGetPointeri_vEXT, + glNamedProgramStringEXT, + glNamedProgramLocalParameter4dEXT, + glNamedProgramLocalParameter4dvEXT, + glNamedProgramLocalParameter4fEXT, + glNamedProgramLocalParameter4fvEXT, + glGetNamedProgramLocalParameterdvEXT, + glGetNamedProgramLocalParameterfvEXT, + glGetNamedProgramivEXT, + glGetNamedProgramStringEXT, + glCompressedTextureImage3DEXT, + glCompressedTextureImage2DEXT, + glCompressedTextureImage1DEXT, + glCompressedTextureSubImage3DEXT, + glCompressedTextureSubImage2DEXT, + glCompressedTextureSubImage1DEXT, + glGetCompressedTextureImageEXT, + glCompressedMultiTexImage3DEXT, + glCompressedMultiTexImage2DEXT, + glCompressedMultiTexImage1DEXT, + glCompressedMultiTexSubImage3DEXT, + glCompressedMultiTexSubImage2DEXT, + glCompressedMultiTexSubImage1DEXT, + glGetCompressedMultiTexImageEXT, + glMatrixLoadTransposefEXT, + glMatrixLoadTransposedEXT, + glMatrixMultTransposefEXT, + glMatrixMultTransposedEXT, + glNamedBufferDataEXT, + glNamedBufferSubDataEXT, + glMapNamedBufferEXT, + glUnmapNamedBufferEXT, + glGetNamedBufferParameterivEXT, + glGetNamedBufferSubDataEXT, + glProgramUniform1fEXT, + glProgramUniform2fEXT, + glProgramUniform3fEXT, + glProgramUniform4fEXT, + glProgramUniform1iEXT, + glProgramUniform2iEXT, + glProgramUniform3iEXT, + glProgramUniform4iEXT, + glProgramUniform1fvEXT, + glProgramUniform2fvEXT, + glProgramUniform3fvEXT, + glProgramUniform4fvEXT, + glProgramUniform1ivEXT, + glProgramUniform2ivEXT, + glProgramUniform3ivEXT, + glProgramUniform4ivEXT, + glProgramUniformMatrix2fvEXT, + glProgramUniformMatrix3fvEXT, + glProgramUniformMatrix4fvEXT, + glProgramUniformMatrix2x3fvEXT, + glProgramUniformMatrix3x2fvEXT, + glProgramUniformMatrix2x4fvEXT, + glProgramUniformMatrix4x2fvEXT, + glProgramUniformMatrix3x4fvEXT, + glProgramUniformMatrix4x3fvEXT, + glTextureBufferEXT, + glMultiTexBufferEXT, + glTextureParameterIivEXT, + glTextureParameterIuivEXT, + glGetTextureParameterIivEXT, + glGetTextureParameterIuivEXT, + glMultiTexParameterIivEXT, + glMultiTexParameterIuivEXT, + glGetMultiTexParameterIivEXT, + glGetMultiTexParameterIuivEXT, + glProgramUniform1uiEXT, + glProgramUniform2uiEXT, + glProgramUniform3uiEXT, + glProgramUniform4uiEXT, + glProgramUniform1uivEXT, + glProgramUniform2uivEXT, + glProgramUniform3uivEXT, + glProgramUniform4uivEXT, + glNamedProgramLocalParameters4fvEXT, + glNamedProgramLocalParameterI4iEXT, + glNamedProgramLocalParameterI4ivEXT, + glNamedProgramLocalParametersI4ivEXT, + glNamedProgramLocalParameterI4uiEXT, + glNamedProgramLocalParameterI4uivEXT, + glNamedProgramLocalParametersI4uivEXT, + glGetNamedProgramLocalParameterIivEXT, + glGetNamedProgramLocalParameterIuivEXT, + glNamedRenderbufferStorageEXT, + glGetNamedRenderbufferParameterivEXT, + glNamedRenderbufferStorageMultisampleEXT, + glNamedRenderbufferStorageMultisampleCoverageEXT, + glCheckNamedFramebufferStatusEXT, + glNamedFramebufferTexture1DEXT, + glNamedFramebufferTexture2DEXT, + glNamedFramebufferTexture3DEXT, + glNamedFramebufferRenderbufferEXT, + glGetNamedFramebufferAttachmentParameterivEXT, + glGenerateTextureMipmapEXT, + glGenerateMultiTexMipmapEXT, + glFramebufferDrawBufferEXT, + glFramebufferDrawBuffersEXT, + glFramebufferReadBufferEXT, + glGetFramebufferParameterivEXT, + glNamedCopyBufferSubDataEXT, + glNamedFramebufferTextureEXT, + glNamedFramebufferTextureLayerEXT, + glNamedFramebufferTextureFaceEXT, + glTextureRenderbufferEXT, + glMultiTexRenderbufferEXT, + glVertexArrayVertexOffsetEXT, + glVertexArrayColorOffsetEXT, + glVertexArrayEdgeFlagOffsetEXT, + glVertexArrayIndexOffsetEXT, + glVertexArrayNormalOffsetEXT, + glVertexArrayTexCoordOffsetEXT, + glVertexArrayMultiTexCoordOffsetEXT, + glVertexArrayFogCoordOffsetEXT, + glVertexArraySecondaryColorOffsetEXT, + glVertexArrayVertexAttribOffsetEXT, + glVertexArrayVertexAttribIOffsetEXT, + glEnableVertexArrayEXT, + glDisableVertexArrayEXT, + glEnableVertexArrayAttribEXT, + glDisableVertexArrayAttribEXT, + glGetVertexArrayIntegervEXT, + glGetVertexArrayPointervEXT, + glGetVertexArrayIntegeri_vEXT, + glGetVertexArrayPointeri_vEXT, + glMapNamedBufferRangeEXT, + glFlushMappedNamedBufferRangeEXT, + glColorMaskIndexedEXT, + glGetBooleanIndexedvEXT, + glGetIntegerIndexedvEXT, + glEnableIndexedEXT, + glDisableIndexedEXT, + glIsEnabledIndexedEXT, + glDrawArraysInstancedEXT, + glDrawElementsInstancedEXT, + glEGLImageTargetTexStorageEXT, + glEGLImageTargetTextureStorageEXT, + glBufferStorageExternalEXT, + glNamedBufferStorageExternalEXT, + glBlitFramebufferEXT, + glRenderbufferStorageMultisampleEXT, + glIsRenderbufferEXT, + glBindRenderbufferEXT, + glDeleteRenderbuffersEXT, + glGenRenderbuffersEXT, + glRenderbufferStorageEXT, + glGetRenderbufferParameterivEXT, + glIsFramebufferEXT, + glBindFramebufferEXT, + glDeleteFramebuffersEXT, + glGenFramebuffersEXT, + glCheckFramebufferStatusEXT, + glFramebufferTexture1DEXT, + glFramebufferTexture2DEXT, + glFramebufferTexture3DEXT, + glFramebufferRenderbufferEXT, + glGetFramebufferAttachmentParameterivEXT, + glGenerateMipmapEXT, + glProgramParameteriEXT, + glFramebufferTextureEXT, + glFramebufferTextureFaceEXT, + glProgramEnvParameters4fvEXT, + glProgramLocalParameters4fvEXT, + glVertexAttribI1iEXT, + glVertexAttribI2iEXT, + glVertexAttribI3iEXT, + glVertexAttribI4iEXT, + glVertexAttribI1uiEXT, + glVertexAttribI2uiEXT, + glVertexAttribI3uiEXT, + glVertexAttribI4uiEXT, + glVertexAttribI1ivEXT, + glVertexAttribI2ivEXT, + glVertexAttribI3ivEXT, + glVertexAttribI4ivEXT, + glVertexAttribI1uivEXT, + glVertexAttribI2uivEXT, + glVertexAttribI3uivEXT, + glVertexAttribI4uivEXT, + glVertexAttribI4bvEXT, + glVertexAttribI4svEXT, + glVertexAttribI4ubvEXT, + glVertexAttribI4usvEXT, + glVertexAttribIPointerEXT, + glGetVertexAttribIivEXT, + glGetVertexAttribIuivEXT, + glGetUniformuivEXT, + glBindFragDataLocationEXT, + glGetFragDataLocationEXT, + glUniform1uiEXT, + glUniform2uiEXT, + glUniform3uiEXT, + glUniform4uiEXT, + glUniform1uivEXT, + glUniform2uivEXT, + glUniform3uivEXT, + glUniform4uivEXT, + glGetUnsignedBytevEXT, + glGetUnsignedBytei_vEXT, + glDeleteMemoryObjectsEXT, + glIsMemoryObjectEXT, + glCreateMemoryObjectsEXT, + glMemoryObjectParameterivEXT, + glGetMemoryObjectParameterivEXT, + glTexStorageMem2DEXT, + glTexStorageMem2DMultisampleEXT, + glTexStorageMem3DEXT, + glTexStorageMem3DMultisampleEXT, + glBufferStorageMemEXT, + glTextureStorageMem2DEXT, + glTextureStorageMem2DMultisampleEXT, + glTextureStorageMem3DEXT, + glTextureStorageMem3DMultisampleEXT, + glNamedBufferStorageMemEXT, + glTexStorageMem1DEXT, + glTextureStorageMem1DEXT, + glImportMemoryFdEXT, + glImportMemoryWin32HandleEXT, + glImportMemoryWin32NameEXT, + glPointParameterfEXT, + glPointParameterfvEXT, + glPolygonOffsetClampEXT, + glProvokingVertexEXT, + glRasterSamplesEXT, + glSecondaryColor3bEXT, + glSecondaryColor3sEXT, + glSecondaryColor3iEXT, + glSecondaryColor3fEXT, + glSecondaryColor3dEXT, + glSecondaryColor3ubEXT, + glSecondaryColor3usEXT, + glSecondaryColor3uiEXT, + glSecondaryColor3bvEXT, + glSecondaryColor3svEXT, + glSecondaryColor3ivEXT, + glSecondaryColor3fvEXT, + glSecondaryColor3dvEXT, + glSecondaryColor3ubvEXT, + glSecondaryColor3usvEXT, + glSecondaryColor3uivEXT, + glSecondaryColorPointerEXT, + glGenSemaphoresEXT, + glDeleteSemaphoresEXT, + glIsSemaphoreEXT, + glSemaphoreParameterui64vEXT, + glGetSemaphoreParameterui64vEXT, + glWaitSemaphoreEXT, + glSignalSemaphoreEXT, + glImportSemaphoreFdEXT, + glImportSemaphoreWin32HandleEXT, + glImportSemaphoreWin32NameEXT, + glUseShaderProgramEXT, + glActiveProgramEXT, + glCreateShaderProgramEXT, + glFramebufferFetchBarrierEXT, + glBindImageTextureEXT, + glMemoryBarrierEXT, + glStencilClearTagEXT, + glActiveStencilFaceEXT, + glFramebufferTextureLayerEXT, + glTexBufferEXT, + glClearColorIiEXT, + glClearColorIuiEXT, + glTexParameterIivEXT, + glTexParameterIuivEXT, + glGetTexParameterIivEXT, + glGetTexParameterIuivEXT, + glGetQueryObjecti64vEXT, + glGetQueryObjectui64vEXT, + glBindBufferRangeEXT, + glBindBufferOffsetEXT, + glBindBufferBaseEXT, + glBeginTransformFeedbackEXT, + glEndTransformFeedbackEXT, + glTransformFeedbackVaryingsEXT, + glGetTransformFeedbackVaryingEXT, + glVertexAttribL1dEXT, + glVertexAttribL2dEXT, + glVertexAttribL3dEXT, + glVertexAttribL4dEXT, + glVertexAttribL1dvEXT, + glVertexAttribL2dvEXT, + glVertexAttribL3dvEXT, + glVertexAttribL4dvEXT, + glVertexAttribLPointerEXT, + glGetVertexAttribLdvEXT, + glAcquireKeyedMutexWin32EXT, + glReleaseKeyedMutexWin32EXT, + glWindowRectanglesEXT, + glImportSyncEXT, + glFrameTerminatorGREMEDY, + glStringMarkerGREMEDY, + glApplyFramebufferAttachmentCMAAINTEL, + glSyncTextureINTEL, + glUnmapTexture2DINTEL, + glMapTexture2DINTEL, + glBeginPerfQueryINTEL, + glCreatePerfQueryINTEL, + glDeletePerfQueryINTEL, + glEndPerfQueryINTEL, + glGetFirstPerfQueryIdINTEL, + glGetNextPerfQueryIdINTEL, + glGetPerfCounterInfoINTEL, + glGetPerfQueryDataINTEL, + glGetPerfQueryIdByNameINTEL, + glGetPerfQueryInfoINTEL, + glBlendBarrierKHR, + glMaxShaderCompilerThreadsKHR, + glAlphaToCoverageDitherControlNV, + glMultiDrawArraysIndirectBindlessNV, + glMultiDrawElementsIndirectBindlessNV, + glMultiDrawArraysIndirectBindlessCountNV, + glMultiDrawElementsIndirectBindlessCountNV, + glGetTextureHandleNV, + glGetTextureSamplerHandleNV, + glMakeTextureHandleResidentNV, + glMakeTextureHandleNonResidentNV, + glGetImageHandleNV, + glMakeImageHandleResidentNV, + glMakeImageHandleNonResidentNV, + glUniformHandleui64NV, + glUniformHandleui64vNV, + glProgramUniformHandleui64NV, + glProgramUniformHandleui64vNV, + glIsTextureHandleResidentNV, + glIsImageHandleResidentNV, + glBlendParameteriNV, + glBlendBarrierNV, + glViewportPositionWScaleNV, + glCreateStatesNV, + glDeleteStatesNV, + glIsStateNV, + glStateCaptureNV, + glGetCommandHeaderNV, + glGetStageIndexNV, + glDrawCommandsNV, + glDrawCommandsAddressNV, + glDrawCommandsStatesNV, + glDrawCommandsStatesAddressNV, + glCreateCommandListsNV, + glDeleteCommandListsNV, + glIsCommandListNV, + glListDrawCommandsStatesClientNV, + glCommandListSegmentsNV, + glCompileCommandListNV, + glCallCommandListNV, + glBeginConditionalRenderNV, + glEndConditionalRenderNV, + glSubpixelPrecisionBiasNV, + glConservativeRasterParameterfNV, + glConservativeRasterParameteriNV, + glCopyImageSubDataNV, + glDepthRangedNV, + glClearDepthdNV, + glDepthBoundsdNV, + glDrawTextureNV, + glDrawVkImageNV, + glGetVkProcAddrNV, + glWaitVkSemaphoreNV, + glSignalVkSemaphoreNV, + glSignalVkFenceNV, + glGetMultisamplefvNV, + glSampleMaskIndexedNV, + glTexRenderbufferNV, + glDeleteFencesNV, + glGenFencesNV, + glIsFenceNV, + glTestFenceNV, + glGetFenceivNV, + glFinishFenceNV, + glSetFenceNV, + glFragmentCoverageColorNV, + glCoverageModulationTableNV, + glGetCoverageModulationTableNV, + glCoverageModulationNV, + glRenderbufferStorageMultisampleCoverageNV, + glRenderGpuMaskNV, + glMulticastBufferSubDataNV, + glMulticastCopyBufferSubDataNV, + glMulticastCopyImageSubDataNV, + glMulticastBlitFramebufferNV, + glMulticastFramebufferSampleLocationsfvNV, + glMulticastBarrierNV, + glMulticastWaitSyncNV, + glMulticastGetQueryObjectivNV, + glMulticastGetQueryObjectuivNV, + glMulticastGetQueryObjecti64vNV, + glMulticastGetQueryObjectui64vNV, + glUniform1i64NV, + glUniform2i64NV, + glUniform3i64NV, + glUniform4i64NV, + glUniform1i64vNV, + glUniform2i64vNV, + glUniform3i64vNV, + glUniform4i64vNV, + glUniform1ui64NV, + glUniform2ui64NV, + glUniform3ui64NV, + glUniform4ui64NV, + glUniform1ui64vNV, + glUniform2ui64vNV, + glUniform3ui64vNV, + glUniform4ui64vNV, + glGetUniformi64vNV, + glProgramUniform1i64NV, + glProgramUniform2i64NV, + glProgramUniform3i64NV, + glProgramUniform4i64NV, + glProgramUniform1i64vNV, + glProgramUniform2i64vNV, + glProgramUniform3i64vNV, + glProgramUniform4i64vNV, + glProgramUniform1ui64NV, + glProgramUniform2ui64NV, + glProgramUniform3ui64NV, + glProgramUniform4ui64NV, + glProgramUniform1ui64vNV, + glProgramUniform2ui64vNV, + glProgramUniform3ui64vNV, + glProgramUniform4ui64vNV, + glVertex2hNV, + glVertex2hvNV, + glVertex3hNV, + glVertex3hvNV, + glVertex4hNV, + glVertex4hvNV, + glNormal3hNV, + glNormal3hvNV, + glColor3hNV, + glColor3hvNV, + glColor4hNV, + glColor4hvNV, + glTexCoord1hNV, + glTexCoord1hvNV, + glTexCoord2hNV, + glTexCoord2hvNV, + glTexCoord3hNV, + glTexCoord3hvNV, + glTexCoord4hNV, + glTexCoord4hvNV, + glMultiTexCoord1hNV, + glMultiTexCoord1hvNV, + glMultiTexCoord2hNV, + glMultiTexCoord2hvNV, + glMultiTexCoord3hNV, + glMultiTexCoord3hvNV, + glMultiTexCoord4hNV, + glMultiTexCoord4hvNV, + glFogCoordhNV, + glFogCoordhvNV, + glSecondaryColor3hNV, + glSecondaryColor3hvNV, + glVertexWeighthNV, + glVertexWeighthvNV, + glVertexAttrib1hNV, + glVertexAttrib1hvNV, + glVertexAttrib2hNV, + glVertexAttrib2hvNV, + glVertexAttrib3hNV, + glVertexAttrib3hvNV, + glVertexAttrib4hNV, + glVertexAttrib4hvNV, + glVertexAttribs1hvNV, + glVertexAttribs2hvNV, + glVertexAttribs3hvNV, + glVertexAttribs4hvNV, + glGetInternalformatSampleivNV, + glGetMemoryObjectDetachedResourcesuivNV, + glResetMemoryObjectParameterNV, + glTexAttachMemoryNV, + glBufferAttachMemoryNV, + glTextureAttachMemoryNV, + glNamedBufferAttachMemoryNV, + glDrawMeshTasksNV, + glDrawMeshTasksIndirectNV, + glMultiDrawMeshTasksIndirectNV, + glMultiDrawMeshTasksIndirectCountNV, + glPathCommandsNV, + glPathCoordsNV, + glPathSubCommandsNV, + glPathSubCoordsNV, + glPathStringNV, + glPathGlyphsNV, + glPathGlyphRangeNV, + glPathGlyphIndexArrayNV, + glPathMemoryGlyphIndexArrayNV, + glCopyPathNV, + glWeightPathsNV, + glInterpolatePathsNV, + glTransformPathNV, + glPathParameterivNV, + glPathParameteriNV, + glPathParameterfvNV, + glPathParameterfNV, + glPathDashArrayNV, + glGenPathsNV, + glDeletePathsNV, + glIsPathNV, + glPathStencilFuncNV, + glPathStencilDepthOffsetNV, + glStencilFillPathNV, + glStencilStrokePathNV, + glStencilFillPathInstancedNV, + glStencilStrokePathInstancedNV, + glPathCoverDepthFuncNV, + glPathColorGenNV, + glPathTexGenNV, + glPathFogGenNV, + glCoverFillPathNV, + glCoverStrokePathNV, + glCoverFillPathInstancedNV, + glCoverStrokePathInstancedNV, + glStencilThenCoverFillPathNV, + glStencilThenCoverStrokePathNV, + glStencilThenCoverFillPathInstancedNV, + glStencilThenCoverStrokePathInstancedNV, + glPathGlyphIndexRangeNV, + glProgramPathFragmentInputGenNV, + glGetPathParameterivNV, + glGetPathParameterfvNV, + glGetPathCommandsNV, + glGetPathCoordsNV, + glGetPathDashArrayNV, + glGetPathMetricsNV, + glGetPathMetricRangeNV, + glGetPathSpacingNV, + glGetPathColorGenivNV, + glGetPathColorGenfvNV, + glGetPathTexGenivNV, + glGetPathTexGenfvNV, + glIsPointInFillPathNV, + glIsPointInStrokePathNV, + glGetPathLengthNV, + glPointAlongPathNV, + glMatrixLoad3x2fNV, + glMatrixLoad3x3fNV, + glMatrixLoadTranspose3x3fNV, + glMatrixMult3x2fNV, + glMatrixMult3x3fNV, + glMatrixMultTranspose3x3fNV, + glGetProgramResourcefvNV, + glPixelDataRangeNV, + glFlushPixelDataRangeNV, + glPointParameteriNV, + glPointParameterivNV, + glPrimitiveRestartNV, + glPrimitiveRestartIndexNV, + glQueryResourceNV, + glGenQueryResourceTagNV, + glDeleteQueryResourceTagNV, + glQueryResourceTagNV, + glFramebufferSampleLocationsfvNV, + glNamedFramebufferSampleLocationsfvNV, + glResolveDepthValuesNV, + glScissorExclusiveArrayvNV, + glScissorExclusiveNV, + glMakeBufferResidentNV, + glMakeBufferNonResidentNV, + glIsBufferResidentNV, + glMakeNamedBufferResidentNV, + glMakeNamedBufferNonResidentNV, + glIsNamedBufferResidentNV, + glGetBufferParameterui64vNV, + glGetNamedBufferParameterui64vNV, + glGetIntegerui64vNV, + glUniformui64NV, + glUniformui64vNV, + glGetUniformui64vNV, + glProgramUniformui64NV, + glProgramUniformui64vNV, + glBindShadingRateImageNV, + glShadingRateImagePaletteNV, + glGetShadingRateImagePaletteNV, + glShadingRateImageBarrierNV, + glShadingRateSampleOrderNV, + glShadingRateSampleOrderCustomNV, + glGetShadingRateSampleLocationivNV, + glTextureBarrierNV, + glTexImage2DMultisampleCoverageNV, + glTexImage3DMultisampleCoverageNV, + glTextureImage2DMultisampleNV, + glTextureImage3DMultisampleNV, + glTextureImage2DMultisampleCoverageNV, + glTextureImage3DMultisampleCoverageNV, + glBeginTransformFeedbackNV, + glEndTransformFeedbackNV, + glTransformFeedbackAttribsNV, + glBindBufferRangeNV, + glBindBufferOffsetNV, + glBindBufferBaseNV, + glTransformFeedbackVaryingsNV, + glActiveVaryingNV, + glGetVaryingLocationNV, + glGetActiveVaryingNV, + glGetTransformFeedbackVaryingNV, + glTransformFeedbackStreamAttribsNV, + glBindTransformFeedbackNV, + glDeleteTransformFeedbacksNV, + glGenTransformFeedbacksNV, + glIsTransformFeedbackNV, + glPauseTransformFeedbackNV, + glResumeTransformFeedbackNV, + glDrawTransformFeedbackNV, + glVertexArrayRangeNV, + glFlushVertexArrayRangeNV, + glVertexAttribL1i64NV, + glVertexAttribL2i64NV, + glVertexAttribL3i64NV, + glVertexAttribL4i64NV, + glVertexAttribL1i64vNV, + glVertexAttribL2i64vNV, + glVertexAttribL3i64vNV, + glVertexAttribL4i64vNV, + glVertexAttribL1ui64NV, + glVertexAttribL2ui64NV, + glVertexAttribL3ui64NV, + glVertexAttribL4ui64NV, + glVertexAttribL1ui64vNV, + glVertexAttribL2ui64vNV, + glVertexAttribL3ui64vNV, + glVertexAttribL4ui64vNV, + glGetVertexAttribLi64vNV, + glGetVertexAttribLui64vNV, + glVertexAttribLFormatNV, + glBufferAddressRangeNV, + glVertexFormatNV, + glNormalFormatNV, + glColorFormatNV, + glIndexFormatNV, + glTexCoordFormatNV, + glEdgeFlagFormatNV, + glSecondaryColorFormatNV, + glFogCoordFormatNV, + glVertexAttribFormatNV, + glVertexAttribIFormatNV, + glGetIntegerui64i_vNV, + glViewportSwizzleNV, + glBeginConditionalRenderNVX, + glEndConditionalRenderNVX, + glAsyncCopyImageSubDataNVX, + glAsyncCopyBufferSubDataNVX, + glUploadGpuMaskNVX, + glMulticastViewportArrayvNVX, + glMulticastScissorArrayvNVX, + glMulticastViewportPositionWScaleNVX, + glCreateProgressFenceNVX, + glSignalSemaphoreui64NVX, + glWaitSemaphoreui64NVX, + glClientWaitSemaphoreui64NVX, + glFramebufferTextureMultiviewOVR, + glNamedFramebufferTextureMultiviewOVR; + + /** When true, {@link GL11} is supported. */ + public final boolean OpenGL11; + /** When true, {@link GL12} is supported. */ + public final boolean OpenGL12; + /** When true, {@link GL13} is supported. */ + public final boolean OpenGL13; + /** When true, {@link GL14} is supported. */ + public final boolean OpenGL14; + /** When true, {@link GL15} is supported. */ + public final boolean OpenGL15; + /** When true, {@link GL20} is supported. */ + public final boolean OpenGL20; + /** When true, {@link GL21} is supported. */ + public final boolean OpenGL21; + /** When true, {@link GL30} is supported. */ + public final boolean OpenGL30; + /** When true, {@link GL31} is supported. */ + public final boolean OpenGL31; + /** When true, {@link GL32} is supported. */ + public final boolean OpenGL32; + /** When true, {@link GL33} is supported. */ + public final boolean OpenGL33; + /** When true, {@link GL40} is supported. */ + public final boolean OpenGL40; + /** When true, {@link GL41} is supported. */ + public final boolean OpenGL41; + /** When true, {@link GL42} is supported. */ + public final boolean OpenGL42; + /** When true, {@link GL43} is supported. */ + public final boolean OpenGL43; + /** When true, {@link GL44} is supported. */ + public final boolean OpenGL44; + /** When true, {@link GL45} is supported. */ + public final boolean OpenGL45; + /** When true, {@link GL46} is supported. */ + public final boolean OpenGL46; + /** When true, {@link AMDBlendMinmaxFactor} is supported. */ + public final boolean GL_AMD_blend_minmax_factor; + /** + * When true, the AMD_conservative_depth extension is supported. + * + *

There is a common optimization for hardware accelerated implementation of OpenGL which relies on an early depth test to be run before the fragment + * shader so that the shader evaluation can be skipped if the fragment ends up being discarded because it is occluded.

+ * + *

This optimization does not affect the final rendering, and is typically possible when the fragment does not change the depth programmatically. (i.e.: it + * does not write to the built-in {@code gl_FragDepth} output). There are, however a class of operations on the depth in the shader which could still be + * performed while allowing the early depth test to operate.

+ * + *

This extension allows the application to pass enough information to the GL implementation to activate such optimizations safely.

+ * + *

Requires {@link GL30 OpenGL 3.0}. Promoted to core in {@link GL42 OpenGL 4.2}.

+ */ + public final boolean GL_AMD_conservative_depth; + /** When true, {@link AMDDebugOutput} is supported. */ + public final boolean GL_AMD_debug_output; + /** When true, {@link AMDDepthClampSeparate} is supported. */ + public final boolean GL_AMD_depth_clamp_separate; + /** When true, {@link AMDDrawBuffersBlend} is supported. */ + public final boolean GL_AMD_draw_buffers_blend; + /** When true, {@link AMDFramebufferMultisampleAdvanced} is supported. */ + public final boolean GL_AMD_framebuffer_multisample_advanced; + /** + * When true, the AMD_gcn_shader extension is supported. + * + *

This extension exposes miscellaneous features of the AMD "Graphics Core Next" shader architecture that do not cleanly fit into other extensions + * and are not significant enough alone to warrant their own extensions. This includes cross-SIMD lane ballots, cube map query functions and a + * functionality to query the elapsed shader core time.

+ * + *

Requires {@link #GL_AMD_gpu_shader_int64 AMD_gpu_shader_int64} or {@link #GL_NV_gpu_shader5 NV_gpu_shader5}.

+ */ + public final boolean GL_AMD_gcn_shader; + /** When true, {@link AMDGPUShaderHalfFloat} is supported. */ + public final boolean GL_AMD_gpu_shader_half_float; + /** When true, {@link AMDGPUShaderHalfFloatFetch} is supported. */ + public final boolean GL_AMD_gpu_shader_half_float_fetch; + /** + * When true, the AMD_gpu_shader_int16 extension is supported. + * + *

This extension was developed to allow implementations supporting 16-bit integers to expose the feature in GLSL.

+ * + *

The extension introduces the following features for all shader types:

+ * + *
    + *
  • new built-in functions to pack and unpack 32-bit integer types into a two-component 16-bit integer vector;
  • + *
  • new built-in functions to convert half-precision floating-point values to or from their 16-bit integer bit encodings;
  • + *
  • vector relational functions supporting comparisons of vectors of 16-bit integer types; and
  • + *
  • common functions abs, frexp, ldexp, sign, min, max, clamp, and mix supporting arguments of 16-bit integer types.
  • + *
+ * + *

Requires GLSL 4.00.

+ */ + public final boolean GL_AMD_gpu_shader_int16; + /** When true, {@link AMDGPUShaderInt64} is supported. */ + public final boolean GL_AMD_gpu_shader_int64; + /** When true, {@link AMDInterleavedElements} is supported. */ + public final boolean GL_AMD_interleaved_elements; + /** When true, {@link AMDOcclusionQueryEvent} is supported. */ + public final boolean GL_AMD_occlusion_query_event; + /** When true, {@link AMDPerformanceMonitor} is supported. */ + public final boolean GL_AMD_performance_monitor; + /** When true, {@link AMDPinnedMemory} is supported. */ + public final boolean GL_AMD_pinned_memory; + /** When true, {@link AMDQueryBufferObject} is supported. */ + public final boolean GL_AMD_query_buffer_object; + /** When true, {@link AMDSamplePositions} is supported. */ + public final boolean GL_AMD_sample_positions; + /** When true, {@link AMDSeamlessCubemapPerTexture} is supported. */ + public final boolean GL_AMD_seamless_cubemap_per_texture; + /** + * When true, the AMD_shader_atomic_counter_ops extension is supported. + * + *

This extension is written against the OpenGL 4.3 (core) specification and the GLSL 4.30.7 specification.

+ * + *

Requires {@link GL42 OpenGL 4.2} or {@link #GL_ARB_shader_atomic_counters ARB_shader_atomic_counters}.

+ */ + public final boolean GL_AMD_shader_atomic_counter_ops; + /** + * When true, the AMD_shader_ballot extension is supported. + * + *

The extensions {@code ARB_shader_group_vote} and {@code ARB_shader_ballot} introduced the concept of sub-groups and a set of operations that allow data + * exchange across shader invocations within a sub-group.

+ * + *

This extension further extends the capabilities of these extensions with additional sub-group operations.

+ * + *

Requires {@link #GL_ARB_shader_group_vote ARB_shader_group_vote}, {@link #GL_ARB_shader_ballot ARB_shader_ballot} and {@link ARBGPUShaderInt64 ARB_gpu_shader_int64} or {@link AMDGPUShaderInt64 AMD_gpu_shader_int64}.

+ */ + public final boolean GL_AMD_shader_ballot; + /** + * When true, the AMD_shader_explicit_vertex_parameter extension is supported. + * + *

Unextended GLSL provides a set of fixed function interpolation modes and even those are limited to certain types of interpolants (for example, + * interpolation of integer and double isn't supported).

+ * + *

This extension introduces new built-in functions allowing access to vertex parameters explicitly in the fragment shader. It also exposes barycentric + * coordinates as new built-in variables, which can be used to implement custom interpolation algorithms using shader code.

+ * + *

Requires {@link GL20 OpenGL 2.0} or {@link ARBShaderObjects ARB_shader_objects}.

+ */ + public final boolean GL_AMD_shader_explicit_vertex_parameter; + /** + * When true, the AMD_shader_image_load_store_lod extension is supported. + * + *

This extension was developed based on the {@link ARBShaderImageLoadStore ARB_shader_image_load_store} extension to allow implementations supporting loads and stores on mipmap + * texture images.

+ * + *

Requires {@link GL40 OpenGL 4.0} and GLSL 4.00

+ */ + public final boolean GL_AMD_shader_image_load_store_lod; + /** + * When true, the AMD_shader_stencil_export extension is supported. + * + *

In OpenGL, the stencil test is a powerful mechanism to selectively discard fragments based on the content of the stencil buffer. However, facilites to + * update the content of the stencil buffer are limited to operations such as incrementing the existing value, or overwriting with a fixed reference value.

+ * + *

This extension provides a mechanism whereby a shader may generate the stencil reference value per invocation. When stencil testing is enabled, this + * allows the test to be performed against the value generated in the shader. When the stencil operation is set to {@link GL11#GL_REPLACE REPLACE}, this allows a value generated + * in the shader to be written to the stencil buffer directly.

+ * + *

Requires {@link #GL_ARB_fragment_shader ARB_fragment_shader}.

+ */ + public final boolean GL_AMD_shader_stencil_export; + /** + * When true, the AMD_shader_trinary_minmax extension is supported. + * + *

This extension introduces three new trinary built-in functions to the OpenGL Shading Languages. These functions allow the minimum, maximum or median of + * three inputs to be found with a single function call. These operations may be useful for sorting and filtering operations, for example. By explicitly + * performing a trinary operation with a single built-in function, shader compilers and optimizers may be able to generate better instruction sequences for + * perform sorting and other multi-input functions.

+ * + *

Requires {@link GL20 OpenGL 2.0} or {@link #GL_ARB_shader_objects ARB_shader_objects}.

+ */ + public final boolean GL_AMD_shader_trinary_minmax; + /** When true, {@link AMDSparseTexture} is supported. */ + public final boolean GL_AMD_sparse_texture; + /** When true, {@link AMDStencilOperationExtended} is supported. */ + public final boolean GL_AMD_stencil_operation_extended; + /** + * When true, the AMD_texture_gather_bias_lod extension is supported. + * + *

This extension was developed based on existing built-in texture gather functions to allow implementations supporting bias of implicit level of detail + * and explicit control of level of detail in texture gather operations.

+ */ + public final boolean GL_AMD_texture_gather_bias_lod; + /** + * When true, the AMD_texture_texture4 extension is supported. + * + *

This extension adds new shading language built-in texture functions to the shading language.

+ * + *

These texture functions may be used to access one component textures.

+ * + *

The {@code texture4} built-in function returns a texture value derived from a 2x2 set of texels in the image array of level levelbase is selected. These + * texels are selected in the same way as when the value of {@link GL11#GL_TEXTURE_MIN_FILTER TEXTURE_MIN_FILTER} is {@link GL11#GL_LINEAR LINEAR}, but instead of these texels being filtered to generate the + * texture value, the R, G, B and A texture values are derived directly from these four texels.

+ */ + public final boolean GL_AMD_texture_texture4; + /** + * When true, the AMD_transform_feedback3_lines_triangles extension is supported. + * + *

OpenGL 4.0 introduced the ability to record primitives into multiple output streams using transform feedback. However, the restriction that all streams + * must output {@link GL11#GL_POINT POINT} primitives when more than one output stream is active was also introduced. This extension simply removes that restriction, allowing + * the same set of primitives to be used with multiple transform feedback streams as with a single stream.

+ * + *

Requires {@link GL40 OpenGL 4.0} or {@link ARBTransformFeedback3 ARB_transform_feedback3}.

+ */ + public final boolean GL_AMD_transform_feedback3_lines_triangles; + /** When true, {@link AMDTransformFeedback4} is supported. */ + public final boolean GL_AMD_transform_feedback4; + /** + * When true, the AMD_vertex_shader_layer extension is supported. + * + *

The {@code gl_Layer} built-in shading language variable was introduced with the {@link #GL_ARB_geometry_shader4 ARB_geometry_shader4} extension and subsequently promoted to core + * OpenGL in version 3.2. This variable is an output from the geometry shader stage that allows rendering to be directed to a specific layer of an array + * texture, slice of a 3D texture or face of a cube map or cube map array attachment of the framebuffer. Thus, this extremely useful functionality is only + * available if a geometry shader is present - even if the geometry shader is not otherwise required by the application. This adds overhead to the graphics + * processing pipeline, and complexity to applications. It also precludes implementations that cannot support geometry shaders from supporting rendering to + * layered framebuffer attachments.

+ * + *

This extension exposes the {@code gl_Layer} built-in variable in the vertex shader, allowing rendering to be directed to layered framebuffer attachments + * with only a vertex and fragment shader present. Combined with features such as instancing, or static vertex attributes and so on, this allows a wide + * variety of techniques to be implemented without the requirement for a geometry shader to be present.

+ * + *

Requires {@link GL30 OpenGL 3.0} or {@link #GL_EXT_texture_array EXT_texture_array}.

+ */ + public final boolean GL_AMD_vertex_shader_layer; + /** When true, {@link AMDVertexShaderTessellator} is supported. */ + public final boolean GL_AMD_vertex_shader_tessellator; + /** + * When true, the AMD_vertex_shader_viewport_index extension is supported. + * + *

The {@code gl_ViewportIndex} built-in variable was introduced by the {@link #GL_ARB_viewport_array ARB_viewport_array} extension and {@link GL41 OpenGL 4.1}. This variable is available + * in un-extended OpenGL only to the geometry shader. When written in the geometry shader, it causes geometry to be directed to one of an array of several + * independent viewport rectangles.

+ * + *

In order to use any viewport other than zero, a geometry shader must be present. Geometry shaders introduce processing overhead and potential + * performance issues. This extension exposes the {@code gl_ViewportIndex} built-in variable to the vertex shader, allowing the functionality introduced by + * ARB_viewport_array to be accessed without requiring a geometry shader to be present.

+ * + *

Requires {@link GL41 OpenGL 4.1} or {@link #GL_ARB_viewport_array ARB_viewport_array}.

+ */ + public final boolean GL_AMD_vertex_shader_viewport_index; + /** + * When true, the ARB_arrays_of_arrays extension is supported. + * + *

This extension removes the restriction that arrays cannot be formed into arrays, allowing arrays of arrays to be declared.

+ * + *

Requires GLSL 1.2. Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ + public final boolean GL_ARB_arrays_of_arrays; + /** When true, {@link ARBBaseInstance} is supported. */ + public final boolean GL_ARB_base_instance; + /** When true, {@link ARBBindlessTexture} is supported. */ + public final boolean GL_ARB_bindless_texture; + /** When true, {@link ARBBlendFuncExtended} is supported. */ + public final boolean GL_ARB_blend_func_extended; + /** When true, {@link ARBBufferStorage} is supported. */ + public final boolean GL_ARB_buffer_storage; + /** When true, {@link ARBClearBufferObject} is supported. */ + public final boolean GL_ARB_clear_buffer_object; + /** When true, {@link ARBClearTexture} is supported. */ + public final boolean GL_ARB_clear_texture; + /** When true, {@link ARBClipControl} is supported. */ + public final boolean GL_ARB_clip_control; + /** When true, {@link ARBColorBufferFloat} is supported. */ + public final boolean GL_ARB_color_buffer_float; + /** + * When true, the ARB_compatibility extension is supported. + * + *

This extension restores features deprecated by {@link GL30 OpenGL 3.0}.

+ */ + public final boolean GL_ARB_compatibility; + /** When true, {@link ARBCompressedTexturePixelStorage} is supported. */ + public final boolean GL_ARB_compressed_texture_pixel_storage; + /** When true, {@link ARBComputeShader} is supported. */ + public final boolean GL_ARB_compute_shader; + /** When true, {@link ARBComputeVariableGroupSize} is supported. */ + public final boolean GL_ARB_compute_variable_group_size; + /** When true, {@link ARBConditionalRenderInverted} is supported. */ + public final boolean GL_ARB_conditional_render_inverted; + /** + * When true, the ARB_conservative_depth extension is supported. + * + *

There is a common optimization for hardware accelerated implementation of OpenGL which relies on an early depth test to be run before the fragment + * shader so that the shader evaluation can be skipped if the fragment ends up being discarded because it is occluded.

+ * + *

This optimization does not affect the final rendering, and is typically possible when the fragment does not change the depth programmatically. (i.e.: it + * does not write to the built-in gl_FragDepth output). There are, however a class of operations on the depth in the shader which could still be performed + * while allowing the early depth test to operate.

+ * + *

This extension allows the application to pass enough information to the GL implementation to activate such optimizations safely.

+ * + *

Requires {@link GL30 OpenGL 3.0}. Promoted to core in {@link GL42 OpenGL 4.2}.

+ */ + public final boolean GL_ARB_conservative_depth; + /** When true, {@link ARBCopyBuffer} is supported. */ + public final boolean GL_ARB_copy_buffer; + /** When true, {@link ARBCopyImage} is supported. */ + public final boolean GL_ARB_copy_image; + /** When true, {@link ARBCullDistance} is supported. */ + public final boolean GL_ARB_cull_distance; + /** When true, {@link ARBDebugOutput} is supported. */ + public final boolean GL_ARB_debug_output; + /** When true, {@link ARBDepthBufferFloat} is supported. */ + public final boolean GL_ARB_depth_buffer_float; + /** When true, {@link ARBDepthClamp} is supported. */ + public final boolean GL_ARB_depth_clamp; + /** When true, {@link ARBDepthTexture} is supported. */ + public final boolean GL_ARB_depth_texture; + /** + * When true, the ARB_derivative_control extension is supported. + * + *

This extension provides control over the spacial granularity at which the underlying implementation computes derivatives.

+ * + *

For example, for the coarse-granularity derivative, a single x derivative could be computed for each 2x2 group of pixels, using that same derivative + * value for all 4 pixels. For the fine-granularity derivative, two derivatives could be computed for each 2x2 group of pixels; one for the top row and one + * for the bottom row. Implementations vary somewhat on how this is done.

+ * + *

To select the coarse derivative, use:

+ * + *

+     * dFdxCoarse(p)
+     * dFdyCoarse(p)
+     * fwidthCoarse(p)
+ * + *

To select the fine derivative, use:

+ * + *

+     * dFdxFine(p)
+     * dFdyFine(p)
+     * fwidthFine(p)
+ * + *

To select which ever is "better" (based on performance, API hints, or other factors), use:

+ * + *

+     * dFdx(p)
+     * dFdy(p)
+     * fwidth(p)
+ * + *

This last set is the set of previously existing built-ins for derivatives, and continues to work in a backward compatible way.

+ * + *

Requires {@link GL40 OpenGL 4.0} and GLSL 4.00. Promoted to core in {@link GL45 OpenGL 4.5}.

+ */ + public final boolean GL_ARB_derivative_control; + /** When true, {@link ARBDirectStateAccess} is supported. */ + public final boolean GL_ARB_direct_state_access; + /** When true, {@link ARBDrawBuffers} is supported. */ + public final boolean GL_ARB_draw_buffers; + /** When true, {@link ARBDrawBuffersBlend} is supported. */ + public final boolean GL_ARB_draw_buffers_blend; + /** When true, {@link ARBDrawElementsBaseVertex} is supported. */ + public final boolean GL_ARB_draw_elements_base_vertex; + /** When true, {@link ARBDrawIndirect} is supported. */ + public final boolean GL_ARB_draw_indirect; + /** When true, {@link ARBDrawInstanced} is supported. */ + public final boolean GL_ARB_draw_instanced; + /** When true, {@link ARBEnhancedLayouts} is supported. */ + public final boolean GL_ARB_enhanced_layouts; + /** When true, {@link ARBES2Compatibility} is supported. */ + public final boolean GL_ARB_ES2_compatibility; + /** When true, {@link ARBES31Compatibility} is supported. */ + public final boolean GL_ARB_ES3_1_compatibility; + /** When true, {@link ARBES32Compatibility} is supported. */ + public final boolean GL_ARB_ES3_2_compatibility; + /** When true, {@link ARBES3Compatibility} is supported. */ + public final boolean GL_ARB_ES3_compatibility; + /** + * When true, the ARB_explicit_attrib_location extension is supported. + * + *

This extension provides a method to pre-assign attribute locations to named vertex shader inputs and color numbers to named fragment shader outputs. + * This allows applications to globally assign a particular semantic meaning, such as diffuse color or vertex normal, to a particular attribute location + * without knowing how that attribute will be named in any particular shader.

+ * + *

Requires {@link GL20 OpenGL 2.0} or {@link #GL_ARB_vertex_shader ARB_vertex_shader}. Promoted to core in {@link GL33 OpenGL 3.3}.

+ */ + public final boolean GL_ARB_explicit_attrib_location; + /** When true, {@link ARBExplicitUniformLocation} is supported. */ + public final boolean GL_ARB_explicit_uniform_location; + /** + * When true, the ARB_fragment_coord_conventions extension is supported. + * + *

This extension provides alternative conventions for the fragment coordinate XY location available for programmable fragment processing.

+ * + *

The scope of this extension deals *only* with how the fragment coordinate XY location appears during programming fragment processing. Beyond the scope + * of this extension are coordinate conventions used for rasterization or transformation.

+ * + *

In the case of the coordinate conventions for rasterization and transformation, some combination of the viewport, depth range, culling state, and + * projection matrix state can be reconfigured to adopt other arbitrary clip-space and window-space coordinate space conventions. Adopting other clip-space + * and window-space conventions involves adjusting existing OpenGL state. However it is non-trivial to massage an arbitrary fragment shader or program to + * adopt a different window-space coordinate system because such shaders are encoded in various textual representations.

+ * + *

The dominant 2D and 3D rendering APIs make two basic choices of convention when locating fragments in window space. The two choices are:

+ * + *
    + *
  1. Is the origin nearest the lower-left- or upper-left-most pixel of the window?
  2. + *
  3. Is the (x,y) location of the pixel nearest the origin at (0,0) or (0.5,0.5)?
  4. + *
+ * + *

OpenGL assumes a lower-left origin for window coordinates and assumes pixel centers are located at half-pixel coordinates. This means the XY location + * (0.5,0.5) corresponds to the lower-left-most pixel in a window.

+ * + *

Other window coordinate conventions exist for other rendering APIs. X11, GDI, and Direct3D version through DirectX 9 assume an upper-left window origin + * and locate pixel centers at integer XY values. By this alternative convention, the XY location (0,0) corresponds to the upper-left-most pixel in a window.

+ * + *

Direct3D for DirectX 10 assumes an upper-left origin (as do prior DirectX versions) yet assumes half-pixel coordinates (unlike prior DirectX versions). + * By the DirectX 10 convention, the XY location (0.5,0.5) corresponds to the upper-left-most pixel in a window.

+ * + *

Fragment shaders can directly access the location of a given processed fragment in window space. We call this location the "fragment coordinate".

+ * + *

This extension provides a means for fragment shaders written in GLSL or OpenGL assembly extensions to specify alternative conventions for determining + * the fragment coordinate value accessed during programmable fragment processing.

+ * + *

The motivation for this extension is to provide an easy, efficient means for fragment shaders accessing a fragment's window-space location to adopt the + * fragment coordinate convention for which the shader was originally written.

+ * + *

Promoted to core in {@link GL32 OpenGL 3.2}.

+ */ + public final boolean GL_ARB_fragment_coord_conventions; + /** + * When true, the ARB_fragment_layer_viewport extension is supported. + * + *

The geometry shader has the special built-in variables gl_Layer and gl_ViewportIndex that specify which layer and viewport primitives are rendered to. + * Currently the fragment shader does not know which layer or viewport the fragments are being written to without the application implementing their own + * interface variables between the geometry and fragment shaders.

+ * + *

This extension specifies that the gl_Layer and gl_ViewportIndex built-in variables are also available to the fragment shader so the application doesn't + * need to implement these manually.

+ * + *

Requires {@link GL30 OpenGL 3.0} and {@link #GL_ARB_geometry_shader4 ARB_geometry_shader4}, or {@link GL32 OpenGL 3.2}. Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ + public final boolean GL_ARB_fragment_layer_viewport; + /** When true, {@link ARBFragmentProgram} is supported. */ + public final boolean GL_ARB_fragment_program; + /** + * When true, the ARB_fragment_program_shadow extension is supported. + * + *

This extension extends ARB_fragment_program to remove the interaction with ARB_shadow and defines the program option "ARB_fragment_program_shadow".

+ * + *

Requires {@link #GL_ARB_fragment_program ARB_fragment_program} and {@link #GL_ARB_shadow ARB_shadow}.

+ */ + public final boolean GL_ARB_fragment_program_shadow; + /** When true, {@link ARBFragmentShader} is supported. */ + public final boolean GL_ARB_fragment_shader; + /** + * When true, the ARB_fragment_shader_interlock extension is supported. + * + *

In unextended OpenGL 4.5, applications may produce a large number of fragment shader invocations that perform loads and stores to memory using image + * uniforms, atomic counter uniforms, buffer variables, or pointers. The order in which loads and stores to common addresses are performed by different + * fragment shader invocations is largely undefined. For algorithms that use shader writes and touch the same pixels more than once, one or more of the + * following techniques may be required to ensure proper execution ordering:

+ * + *
    + *
  • inserting Finish or WaitSync commands to drain the pipeline between different "passes" or "layers";
  • + *
  • using only atomic memory operations to write to shader memory (which may be relatively slow and limits how memory may be updated); or
  • + *
  • injecting spin loops into shaders to prevent multiple shader invocations from touching the same memory concurrently.
  • + *
+ * + *

This extension provides new GLSL built-in functions beginInvocationInterlockARB() and endInvocationInterlockARB() that delimit a critical section of + * fragment shader code. For pairs of shader invocations with "overlapping" coverage in a given pixel, the OpenGL implementation will guarantee that the + * critical section of the fragment shader will be executed for only one fragment at a time.

+ * + *

There are four different interlock modes supported by this extension, which are identified by layout qualifiers. The qualifiers + * "pixel_interlock_ordered" and "pixel_interlock_unordered" provides mutual exclusion in the critical section for any pair of fragments corresponding to + * the same pixel. When using multisampling, the qualifiers "sample_interlock_ordered" and "sample_interlock_unordered" only provide mutual exclusion for + * pairs of fragments that both cover at least one common sample in the same pixel; these are recommended for performance if shaders use per-sample data + * structures.

+ * + *

Additionally, when the "pixel_interlock_ordered" or "sample_interlock_ordered" layout qualifier is used, the interlock also guarantees that the + * critical section for multiple shader invocations with "overlapping" coverage will be executed in the order in which the primitives were processed by + * the GL. Such a guarantee is useful for applications like blending in the fragment shader, where an application requires that fragment values to be + * composited in the framebuffer in primitive order.

+ * + *

This extension can be useful for algorithms that need to access per-pixel data structures via shader loads and stores. Such algorithms using this + * extension can access such data structures in the critical section without worrying about other invocations for the same pixel accessing the data + * structures concurrently. Additionally, the ordering guarantees are useful for cases where the API ordering of fragments is meaningful. For example, + * applications may be able to execute programmable blending operations in the fragment shader, where the destination buffer is read via image loads and + * the final value is written via image stores.

+ * + *

Requires {@link GL42 OpenGL 4.2} or {@link ARBShaderImageLoadStore ARB_shader_image_load_store}.

+ */ + public final boolean GL_ARB_fragment_shader_interlock; + /** When true, {@link ARBFramebufferNoAttachments} is supported. */ + public final boolean GL_ARB_framebuffer_no_attachments; + /** When true, {@link ARBFramebufferObject} is supported. */ + public final boolean GL_ARB_framebuffer_object; + /** When true, {@link ARBFramebufferSRGB} is supported. */ + public final boolean GL_ARB_framebuffer_sRGB; + /** When true, {@link ARBGeometryShader4} is supported. */ + public final boolean GL_ARB_geometry_shader4; + /** When true, {@link ARBGetProgramBinary} is supported. */ + public final boolean GL_ARB_get_program_binary; + /** When true, {@link ARBGetTextureSubImage} is supported. */ + public final boolean GL_ARB_get_texture_sub_image; + /** When true, {@link ARBGLSPIRV} is supported. */ + public final boolean GL_ARB_gl_spirv; + /** When true, {@link ARBGPUShader5} is supported. */ + public final boolean GL_ARB_gpu_shader5; + /** When true, {@link ARBGPUShaderFP64} is supported. */ + public final boolean GL_ARB_gpu_shader_fp64; + /** When true, {@link ARBGPUShaderInt64} is supported. */ + public final boolean GL_ARB_gpu_shader_int64; + /** When true, {@link ARBHalfFloatPixel} is supported. */ + public final boolean GL_ARB_half_float_pixel; + /** When true, {@link ARBHalfFloatVertex} is supported. */ + public final boolean GL_ARB_half_float_vertex; + /** When true, {@link ARBImaging} is supported. */ + public final boolean GL_ARB_imaging; + /** When true, {@link ARBIndirectParameters} is supported. */ + public final boolean GL_ARB_indirect_parameters; + /** When true, {@link ARBInstancedArrays} is supported. */ + public final boolean GL_ARB_instanced_arrays; + /** When true, {@link ARBInternalformatQuery} is supported. */ + public final boolean GL_ARB_internalformat_query; + /** When true, {@link ARBInternalformatQuery2} is supported. */ + public final boolean GL_ARB_internalformat_query2; + /** When true, {@link ARBInvalidateSubdata} is supported. */ + public final boolean GL_ARB_invalidate_subdata; + /** When true, {@link ARBMapBufferAlignment} is supported. */ + public final boolean GL_ARB_map_buffer_alignment; + /** When true, {@link ARBMapBufferRange} is supported. */ + public final boolean GL_ARB_map_buffer_range; + /** When true, {@link ARBMatrixPalette} is supported. */ + public final boolean GL_ARB_matrix_palette; + /** When true, {@link ARBMultiBind} is supported. */ + public final boolean GL_ARB_multi_bind; + /** When true, {@link ARBMultiDrawIndirect} is supported. */ + public final boolean GL_ARB_multi_draw_indirect; + /** When true, {@link ARBMultisample} is supported. */ + public final boolean GL_ARB_multisample; + /** When true, {@link ARBMultitexture} is supported. */ + public final boolean GL_ARB_multitexture; + /** When true, {@link ARBOcclusionQuery} is supported. */ + public final boolean GL_ARB_occlusion_query; + /** When true, {@link ARBOcclusionQuery2} is supported. */ + public final boolean GL_ARB_occlusion_query2; + /** When true, {@link ARBParallelShaderCompile} is supported. */ + public final boolean GL_ARB_parallel_shader_compile; + /** When true, {@link ARBPipelineStatisticsQuery} is supported. */ + public final boolean GL_ARB_pipeline_statistics_query; + /** When true, {@link ARBPixelBufferObject} is supported. */ + public final boolean GL_ARB_pixel_buffer_object; + /** When true, {@link ARBPointParameters} is supported. */ + public final boolean GL_ARB_point_parameters; + /** When true, {@link ARBPointSprite} is supported. */ + public final boolean GL_ARB_point_sprite; + /** When true, {@link ARBPolygonOffsetClamp} is supported. */ + public final boolean GL_ARB_polygon_offset_clamp; + /** + * When true, the ARB_post_depth_coverage extension is supported. + * + *

This extension allows the fragment shader to control whether values in {@code gl_SampleMaskIn[]} reflect the coverage after application of the early + * depth and stencil tests. This feature can be enabled with the following layout qualifier in the fragment shader:

+ * + *

+     *         layout(post_depth_coverage) in;
+ * + *

Use of this feature implicitly enables early fragment tests.

+ */ + public final boolean GL_ARB_post_depth_coverage; + /** When true, {@link ARBProgramInterfaceQuery} is supported. */ + public final boolean GL_ARB_program_interface_query; + /** When true, {@link ARBProvokingVertex} is supported. */ + public final boolean GL_ARB_provoking_vertex; + /** When true, {@link ARBQueryBufferObject} is supported. */ + public final boolean GL_ARB_query_buffer_object; + /** + * When true, the ARB_robust_buffer_access_behavior extension is supported. + * + *

This extension specifies the behavior of out-of-bounds buffer and array accesses. This is an improvement over the existing ARB_robustness extension + * which stated that the application should not crash, but the behavior is otherwise undefined. This extension specifies the access protection provided by + * the GL to ensure that out-of-bounds accesses cannot read from or write to data not owned by the application. All accesses are contained within the + * buffer object and program area they reference. These additional robustness guarantees apply to contexts created with the + * {@code CONTEXT_FLAG_ROBUST_ACCESS_BIT_ARB} feature enabled.

+ * + *

Requires {@link ARBRobustness ARB_robustness}. Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ + public final boolean GL_ARB_robust_buffer_access_behavior; + /** When true, {@link ARBRobustness} is supported. */ + public final boolean GL_ARB_robustness; + /** + * When true, the ARB_robustness_application_isolation extension is supported. + * + *

{@link ARBRobustness ARB_robustness} and supporting window system extensions allow creating an OpenGL context supporting graphics reset notification behavior. This + * extension provides stronger guarantees about the possible side-effects of a graphics reset.

+ * + *

It is expected that there may be a performance cost associated with isolating an application or share group from other contexts on the GPU. For this + * reason, ARB_robustness_isolation is phrased as an opt-in mechanism, with a new context creation bit defined in the window system bindings. It is + * expected that implementations might only advertise the strings in this extension if both the implementation supports the desired isolation properties, + * and the context was created with the appropriate reset isolation bit.

+ * + *

If the graphics driver advertises the {@code GL_ARB_robustness_application_isolation} extension string, then the driver guarantees that if a particular + * application causes a graphics reset to occur:

+ * + *
    + *
  1. No other application on the system is affected by the graphics reset.
  2. + *
  3. No other application on the system receives any notification that the graphics reset occurred.
  4. + *
+ * + *

Requires {@link ARBRobustness ARB_robustness}. Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ + public final boolean GL_ARB_robustness_application_isolation; + /** + * When true, the ARB_robustness_share_group_isolation extension is supported. + * + *

See {@link #GL_ARB_robustness_application_isolation ARB_robustness_application_isolation}.

+ * + *

If the graphics driver advertises the {@code GL_ARB_robustness_share_group_isolation} extension string, then the driver guarantees that if a context in + * a particular share group causes a graphics reset to occur:

+ * + *
    + *
  1. No other share group within the application is affected by the graphics reset. Additionally, no other application on the system is affected by the + * graphics reset.
  2. + *
  3. No other share group within the application receives any notification that the graphics reset occurred. Additionally, no other application on the + * system receives any notification that the graphics reset occurred.
  4. + *
+ */ + public final boolean GL_ARB_robustness_share_group_isolation; + /** When true, {@link ARBSampleLocations} is supported. */ + public final boolean GL_ARB_sample_locations; + /** When true, {@link ARBSampleShading} is supported. */ + public final boolean GL_ARB_sample_shading; + /** When true, {@link ARBSamplerObjects} is supported. */ + public final boolean GL_ARB_sampler_objects; + /** When true, {@link ARBSeamlessCubeMap} is supported. */ + public final boolean GL_ARB_seamless_cube_map; + /** When true, {@link ARBSeamlessCubemapPerTexture} is supported. */ + public final boolean GL_ARB_seamless_cubemap_per_texture; + /** When true, {@link ARBSeparateShaderObjects} is supported. */ + public final boolean GL_ARB_separate_shader_objects; + /** + * When true, the ARB_shader_atomic_counter_ops extension is supported. + * + *

The {@link ARBShaderAtomicCounters ARB_shader_atomic_counters} extension introduced atomic counters, but it limits list of potential operations that can be performed on them + * to increment, decrement, and query. This extension extends the list of GLSL built-in functions that can operate on atomic counters. The list of new + * operations include:

+ * + *
    + *
  • Addition and subtraction
  • + *
  • Minimum and maximum
  • + *
  • Bitwise operators (AND, OR, XOR, etc.)
  • + *
  • Exchange, and compare and exchange operators
  • + *
+ * + *

Requires {@link GL42 OpenGL 4.2} or {@link ARBShaderAtomicCounters ARB_shader_atomic_counters}.

+ */ + public final boolean GL_ARB_shader_atomic_counter_ops; + /** When true, {@link ARBShaderAtomicCounters} is supported. */ + public final boolean GL_ARB_shader_atomic_counters; + /** + * When true, the ARB_shader_ballot extension is supported. + * + *

This extension provides the ability for a group of invocations which execute in lockstep to do limited forms of cross-invocation communication via a + * group broadcast of a invocation value, or broadcast of a bitarray representing a predicate value from each invocation in the group.

+ * + *

Requires {@link ARBGPUShaderInt64 ARB_gpu_shader_int64}.

+ */ + public final boolean GL_ARB_shader_ballot; + /** + * When true, the ARB_shader_bit_encoding extension is supported. + * + *

This extension trivially adds built-in functions for getting/setting the bit encoding for floating-point values in the OpenGL Shading Language.

+ * + *

Promoted to core in {@link GL33 OpenGL 3.3}.

+ */ + public final boolean GL_ARB_shader_bit_encoding; + /** + * When true, the ARB_shader_clock extension is supported. + * + *

This extension exposes a 64-bit monotonically incrementing shader counter which may be used to derive local timing information within a single shader + * invocation.

+ */ + public final boolean GL_ARB_shader_clock; + /** + * When true, the ARB_shader_draw_parameters extension is supported. + * + *

In unextended GL, vertex shaders have inputs named {@code gl_VertexID} and {@code gl_InstanceID}, which contain, respectively the index of the vertex + * and instance. The value of {@code gl_VertexID} is the implicitly passed index of the vertex being processed, which includes the value of baseVertex, for + * those commands that accept it. Meanwhile, {@code gl_InstanceID} is the integer index of the current instance being processed, but, even for commands + * that accept a baseInstance parameter, it does not include the value of this argument. Furthermore, the equivalents to these variables in other graphics + * APIs do not necessarily follow these conventions. The reason for this inconsistency is that there are legitimate use cases for both inclusion and + * exclusion of the baseVertex or baseInstance parameters in {@code gl_VertexID} and {@code gl_InstanceID}, respectively.

+ * + *

Rather than change the semantics of either built-in variable, this extension adds two new built-in variables to the GL shading language, + * {@code gl_BaseVertexARB} and {@code gl_BaseInstanceARB}, which contain the values passed in the baseVertex and baseInstance parameters, respectively. + * Shaders provided by the application may use these variables to offset {@code gl_VertexID} or {@code gl_InstanceID} if desired, or use them for any other + * purpose.

+ * + *

Additionally, this extension adds a further built-in variable, {@code gl_DrawID} to the shading language. This variable contains the index of the draw + * currently being processed by a Multi* variant of a drawing command (such as {@link GL14C#glMultiDrawElements MultiDrawElements} or {@link GL43C#glMultiDrawArraysIndirect MultiDrawArraysIndirect}).

+ * + *

Requires {@link GL31 OpenGL 3.1}. Promoted to core in {@link GL33 OpenGL 3.3}.

+ */ + public final boolean GL_ARB_shader_draw_parameters; + /** + * When true, the ARB_shader_group_vote extension is supported. + * + *

This extension provides new built-in functions to compute the composite of a set of boolean conditions across a group of shader invocations. These + * composite results may be used to execute shaders more efficiently on a single-instruction multiple-data (SIMD) processor. The set of shader invocations + * across which boolean conditions are evaluated is implementation-dependent, and this extension provides no guarantee over how individual shader + * invocations are assigned to such sets. In particular, the set of shader invocations has no necessary relationship with the compute shader local work + * group -- a pair of shader invocations in a single compute shader work group may end up in different sets used by these built-ins.

+ * + *

Compute shaders operate on an explicitly specified group of threads (a local work group), but many implementations of OpenGL 4.3 will even group + * non-compute shader invocations and execute them in a SIMD fashion. When executing code like

+ * + *

+     * if (condition) {
+     *     result = do_fast_path();
+     * } else {
+     *     result = do_general_path();
+     * }
+ * + *

where {@code condition} diverges between invocations, a SIMD implementation might first call do_fast_path() for the invocations where {@code condition} + * is true and leave the other invocations dormant. Once do_fast_path() returns, it might call do_general_path() for invocations where {@code condition} is + * false and leave the other invocations dormant. In this case, the shader executes *both* the fast and the general path and might be better off just using + * the general path for all invocations.

+ * + *

This extension provides the ability to avoid divergent execution by evaluting a condition across an entire SIMD invocation group using code like:

+ * + *

+     * if (allInvocationsARB(condition)) {
+     *     result = do_fast_path();
+     * } else {
+     *     result = do_general_path();
+     * }
+ * + *

The built-in function allInvocationsARB() will return the same value for all invocations in the group, so the group will either execute do_fast_path() + * or do_general_path(), but never both. For example, shader code might want to evaluate a complex function iteratively by starting with an approximation + * of the result and then refining the approximation. Some input values may require a small number of iterations to generate an accurate result + * (do_fast_path) while others require a larger number (do_general_path). In another example, shader code might want to evaluate a complex function + * (do_general_path) that can be greatly simplified when assuming a specific value for one of its inputs (do_fast_path).

+ * + *

Requires {@link GL43 OpenGL 4.3} or {@link ARBComputeShader ARB_compute_shader}.

+ */ + public final boolean GL_ARB_shader_group_vote; + /** When true, {@link ARBShaderImageLoadStore} is supported. */ + public final boolean GL_ARB_shader_image_load_store; + /** + * When true, the ARB_shader_image_size extension is supported. + * + *

This extension provides GLSL built-in functions allowing shaders to query the size of an image.

+ * + *

Requires {@link GL42 OpenGL 4.2} and GLSL 4.20. Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ + public final boolean GL_ARB_shader_image_size; + /** When true, {@link ARBShaderObjects} is supported. */ + public final boolean GL_ARB_shader_objects; + /** + * When true, the ARB_shader_precision extension is supported. + * + *

This extension more clearly restricts the precision requirements of implementations of the GLSL specification. These include precision of arithmetic + * operations (operators '+', '/', ...), transcendentals (log, exp, pow, reciprocal sqrt, ...), when NaNs (not a number) and INFs (infinities) will be + * supported and generated, and denorm flushing behavior. Trigonometric built-ins and some other categories of built-ins are not addressed.

+ * + *

Requires {@link GL40 OpenGL 4.0}. Promoted to core in {@link GL41 OpenGL 4.1}.

+ */ + public final boolean GL_ARB_shader_precision; + /** + * When true, the ARB_shader_stencil_export extension is supported. + * + *

In OpenGL, the stencil test is a powerful mechanism to selectively discard fragments based on the content of the stencil buffer. However, facilites to + * update the content of the stencil buffer are limited to operations such as incrementing the existing value, or overwriting with a fixed reference value.

+ * + *

This extension provides a mechanism whereby a shader may generate the stencil reference value per invocation. When stencil testing is enabled, this + * allows the test to be performed against the value generated in the shader. When the stencil operation is set to {@link GL11#GL_REPLACE REPLACE}, this allows a value generated + * in the shader to be written to the stencil buffer directly.

+ * + *

Requires {@link #GL_ARB_fragment_shader ARB_fragment_shader}.

+ */ + public final boolean GL_ARB_shader_stencil_export; + /** When true, {@link ARBShaderStorageBufferObject} is supported. */ + public final boolean GL_ARB_shader_storage_buffer_object; + /** When true, {@link ARBShaderSubroutine} is supported. */ + public final boolean GL_ARB_shader_subroutine; + /** + * When true, the ARB_shader_texture_image_samples extension is supported. + * + *

This extension provides GLSL built-in functions allowing shaders to query the number of samples of a texture.

+ * + *

Requires GLSL 1.50 or {@link ARBTextureMultisample ARB_texture_multisample}.

+ */ + public final boolean GL_ARB_shader_texture_image_samples; + /** + * When true, the ARB_shader_texture_lod extension is supported. + * + *

This extension adds additional texture functions to the OpenGL Shading Language which provide the shader writer with explicit control of LOD.

+ * + *

Mipmap texture fetches and anisotropic texture fetches require an implicit derivatives to calculate rho, lambda and/or the line of anisotropy. These + * implicit derivatives will be undefined for texture fetches occurring inside non-uniform control flow or for vertex shader texture fetches, resulting in + * undefined texels.

+ * + *

The additional texture functions introduced with this extension provide explict control of LOD (isotropic texture functions) or provide explicit + * derivatives (anisotropic texture functions).

+ * + *

Anisotropic texture functions return defined texels for mipmap texture fetches or anisotropic texture fetches, even inside non-uniform control flow. + * Isotropic texture functions return defined texels for mipmap texture fetches, even inside non-uniform control flow. However, isotropic texture functions + * return undefined texels for anisotropic texture fetches.

+ * + *

The existing isotropic vertex texture functions:

+ * + *

+     * texture1DLod,   texture1DProjLod,
+     * texture2DLod,   texture2DProjLod,
+     * texture3DLod,   texture3DProjLod,
+     * textureCubeLod,
+     * shadow1DLod,    shadow1DProjLod,
+     * shadow2DLod,    shadow2DProjLod
+ * + *

are added to the built-in functions for fragment shaders.

+ * + *

New anisotropic texture functions, providing explicit derivatives:

+ * + *

+     * texture1DGradARB(
+     *     sampler1D sampler,
+     *     float P, float dPdx, float dPdy);
+     * texture1DProjGradARB(
+     *     sampler1D sampler,
+     *     vec2 P, float dPdx, float dPdy);
+     * texture1DProjGradARB(
+     *     sampler1D sampler,
+     *     vec4 P, float dPdx, float dPdy);
+     * texture2DGradARB(
+     *     sampler2D sampler,
+     *     vec2 P, vec2 dPdx, vec2 dPdy);
+     * texture2DProjGradARB(
+     *     sampler2D sampler,
+     *     vec3 P, vec2 dPdx, vec2 dPdy);
+     * texture2DProjGradARB(
+     *     sampler2D sampler,
+     *     vec4 P, vec2 dPdx, vec2 dPdy);
+     * texture3DGradARB(
+     *     sampler3D sampler,
+     *     vec3 P, vec3 dPdx, vec3 dPdy);
+     * texture3DProjGradARB(
+     *     sampler3D sampler,
+     *     vec4 P, vec3 dPdx, vec3 dPdy);
+     * textureCubeGradARB(
+     *     samplerCube sampler,
+     *     vec3 P, vec3 dPdx, vec3 dPdy);
+     * 
+     * shadow1DGradARB(
+     *     sampler1DShadow sampler,
+     *     vec3 P, float dPdx, float dPdy);
+     * shadow1DProjGradARB(
+     *     sampler1DShadow sampler,
+     *     vec4 P, float dPdx, float dPdy);
+     * shadow2DGradARB(
+     *     sampler2DShadow sampler,
+     *     vec3 P, vec2 dPdx, vec2 dPdy);
+     * shadow2DProjGradARB(
+     *     sampler2DShadow sampler,
+     *     vec4 P, vec2 dPdx, vec2 dPdy);
+     * 
+     * texture2DRectGradARB(
+     *     sampler2DRect sampler,
+     *     vec2 P, vec2 dPdx, vec2 dPdy);
+     * texture2DRectProjGradARB(
+     *     sampler2DRect sampler,
+     *     vec3 P, vec2 dPdx, vec2 dPdy);
+     * texture2DRectProjGradARB(
+     *     sampler2DRect sampler,
+     *     vec4 P, vec2 dPdx, vec2 dPdy);
+     * 
+     * shadow2DRectGradARB(
+     *     sampler2DRectShadow sampler,
+     *     vec3 P, vec2 dPdx, vec2 dPdy);
+     * shadow2DRectProjGradARB(
+     *     sampler2DRectShadow sampler,
+     *     vec4 P, vec2 dPdx, vec2 dPdy);
+ * + *

are added to the built-in functions for vertex shaders and fragment shaders.

+ * + *

Requires {@link #GL_ARB_shader_objects ARB_shader_objects}. Promoted to core in {@link GL30 OpenGL 3.0}.

+ */ + public final boolean GL_ARB_shader_texture_lod; + /** + * When true, the ARB_shader_viewport_layer_array extension is supported. + * + *

The gl_ViewportIndex and gl_Layer built-in variables were introduced by the in OpenGL 4.1. These variables are available in un-extended OpenGL only to + * the geometry shader. When written in the geometry shader, they cause geometry to be directed to one of an array of several independent viewport + * rectangles or framebuffer attachment layers, respectively.

+ * + *

In order to use any viewport or attachment layer other than zero, a geometry shader must be present. Geometry shaders introduce processing overhead and + * potential performance issues. The AMD_vertex_shader_layer and AMD_vertex_shader_viewport_index extensions allowed the gl_Layer and gl_ViewportIndex + * outputs to be written directly from the vertex shader with no geometry shader present.

+ * + *

This extension effectively merges the AMD_vertex_shader_layer and AMD_vertex_shader_viewport_index extensions together and extends them further to + * allow both outputs to be written from tessellation evaluation shaders.

+ * + *

Requires {@link GL41 OpenGL 4.1}.

+ */ + public final boolean GL_ARB_shader_viewport_layer_array; + /** When true, {@link ARBShadingLanguage100} is supported. */ + public final boolean GL_ARB_shading_language_100; + /** + * When true, the ARB_shading_language_420pack extension is supported. + * + *

This is a language feature only extension formed from changes made to version 4.20 of GLSL. It includes:

+ * + *
    + *
  • Add line-continuation using '', as in C++.
  • + *
  • Change from ASCII to UTF-8 for the language character set and also allow any characters inside comments.
  • + *
  • Allow implicit conversions of return values to the declared type of the function.
  • + *
  • The *const* keyword can be used to declare variables within a function body with initializer expressions that are not constant expressions.
  • + *
  • Qualifiers on variable declarations no longer have to follow a strict order. The layout qualifier can be used multiple times, and multiple parameter + * qualifiers can be used. However, this is not as straightforward as saying declarations have arbitrary lists of initializers. Typically, one + * qualifier from each class of qualifiers is allowed, so care is now taken to classify them and say so. Then, of these, order restrictions are removed.
  • + *
  • Add layout qualifier identifier "binding" to bind the location of a uniform block. This requires version 1.4 of GLSL. If this extension is used with + * an earlier version than 1.4, this feature is not present.
  • + *
  • Add layout qualifier identifier "binding" to bind units to sampler and image variable declarations.
  • + *
  • Add C-style curly brace initializer lists syntax for initializers. Full initialization of aggregates is required when these are used.
  • + *
  • Allow ".length()" to be applied to vectors and matrices, returning the number of components or columns.
  • + *
  • Allow swizzle operations on scalars.
  • + *
  • Built-in constants for {@code gl_MinProgramTexelOffset} and {@code gl_MaxProgramTexelOffset}.
  • + *
+ * + *

Requires GLSL 1.30. Requires GLSL 1.40 for uniform block bindings. Promoted to core in {@link GL42 OpenGL 4.2}.

+ */ + public final boolean GL_ARB_shading_language_420pack; + /** When true, {@link ARBShadingLanguageInclude} is supported. */ + public final boolean GL_ARB_shading_language_include; + /** + * When true, the ARB_shading_language_packing extension is supported. + * + *

This extension provides the GLSL built-in functions to convert a 32-bit unsigned integer holding a pair of 16-bit floating-point values to or from a + * two-component floating-point vector (vec2).

+ * + *

This mechanism allows GLSL shaders to read and write 16-bit floating-point encodings (via 32-bit unsigned integers) without introducing a full set of + * 16-bit floating-point data types.

+ * + *

This extension also adds the GLSL built-in packing functions included in GLSL version 4.00 and the ARB_gpu_shader5 extension which pack and unpack + * vectors of small fixed-point data types into a larger scalar. By putting these packing functions in this separate extension it allows implementations to + * provide these functions in hardware that supports them independent of the other {@link #GL_ARB_gpu_shader5 ARB_gpu_shader5} features.

+ * + *

In addition to the packing functions from ARB_gpu_shader5 this extension also adds the missing {@code [un]packSnorm2x16} for completeness.

+ * + *

Promoted to core in {@link GL42 OpenGL 4.2}.

+ */ + public final boolean GL_ARB_shading_language_packing; + /** When true, {@link ARBShadow} is supported. */ + public final boolean GL_ARB_shadow; + /** When true, {@link ARBShadowAmbient} is supported. */ + public final boolean GL_ARB_shadow_ambient; + /** When true, {@link ARBSparseBuffer} is supported. */ + public final boolean GL_ARB_sparse_buffer; + /** When true, {@link ARBSparseTexture} is supported. */ + public final boolean GL_ARB_sparse_texture; + /** + * When true, the ARB_sparse_texture2 extension is supported. + * + *

This extension builds on the {@link ARBSparseTexture ARB_sparse_texture} extension, providing the following new functionality:

+ * + *
    + *
  • New built-in GLSL texture lookup and image load functions are provided that return information on whether the texels accessed for the texture + * lookup accessed uncommitted texture memory.
  • + *
  • New built-in GLSL texture lookup functions are provided that specify a minimum level of detail to use for lookups where the level of detail is + * computed automatically. This allows shaders to avoid accessing unpopulated portions of high-resolution levels of detail when it knows that the + * memory accessed is unpopulated, either from a priori knowledge or from feedback provided by the return value of previously executed "sparse" + * texture lookup functions.
  • + *
  • Reads of uncommitted texture memory will act as though such memory were filled with zeroes; previously, the values returned by reads were + * undefined.
  • + *
  • Standard implementation-independent virtual page sizes for internal formats required to be supported with sparse textures. These standard sizes can + * be requested by leaving {@link ARBSparseTexture#GL_VIRTUAL_PAGE_SIZE_INDEX_ARB VIRTUAL_PAGE_SIZE_INDEX_ARB} at its initial value (0).
  • + *
  • Support for creating sparse multisample and multisample array textures is added. However, the virtual page sizes for such textures remain fully + * implementation-dependent.
  • + *
+ * + *

Requires {@link ARBSparseTexture ARB_sparse_texture}

+ */ + public final boolean GL_ARB_sparse_texture2; + /** + * When true, the ARB_sparse_texture_clamp extension is supported. + * + *

This extension builds on the {@link #GL_ARB_sparse_texture2 ARB_sparse_texture2} extension, providing the following new functionality:

+ * + *

New built-in GLSL texture lookup functions are provided that specify a minimum level of detail to use for lookups where the level of detail is + * computed automatically. This allows shaders to avoid accessing unpopulated portions of high-resolution levels of detail when it knows that the memory + * accessed is unpopulated, either from a priori knowledge or from feedback provided by the return value of previously executed "sparse" texture lookup + * functions.

+ * + *

Requires {@link #GL_ARB_sparse_texture2 ARB_sparse_texture2}

+ */ + public final boolean GL_ARB_sparse_texture_clamp; + /** When true, {@link ARBSPIRVExtensions} is supported. */ + public final boolean GL_ARB_spirv_extensions; + /** When true, {@link ARBStencilTexturing} is supported. */ + public final boolean GL_ARB_stencil_texturing; + /** When true, {@link ARBSync} is supported. */ + public final boolean GL_ARB_sync; + /** When true, {@link ARBTessellationShader} is supported. */ + public final boolean GL_ARB_tessellation_shader; + /** When true, {@link ARBTextureBarrier} is supported. */ + public final boolean GL_ARB_texture_barrier; + /** When true, {@link ARBTextureBorderClamp} is supported. */ + public final boolean GL_ARB_texture_border_clamp; + /** When true, {@link ARBTextureBufferObject} is supported. */ + public final boolean GL_ARB_texture_buffer_object; + /** + * When true, the ARB_texture_buffer_object_rgb32 extension is supported. + * + *

This extension adds three new buffer texture formats - RGB32F, RGB32I, and RGB32UI. This partially addresses one of the limitations of buffer textures + * in the original {@link #GL_EXT_texture_buffer_object EXT_texture_buffer_object} extension and in {@link GL31 OpenGL 3.1}, which provide no support for three-component formats.

+ * + *

Promoted to core in {@link GL40 OpenGL 4.0}.

+ */ + public final boolean GL_ARB_texture_buffer_object_rgb32; + /** When true, {@link ARBTextureBufferRange} is supported. */ + public final boolean GL_ARB_texture_buffer_range; + /** When true, {@link ARBTextureCompression} is supported. */ + public final boolean GL_ARB_texture_compression; + /** When true, {@link ARBTextureCompressionBPTC} is supported. */ + public final boolean GL_ARB_texture_compression_bptc; + /** When true, {@link ARBTextureCompressionRGTC} is supported. */ + public final boolean GL_ARB_texture_compression_rgtc; + /** When true, {@link ARBTextureCubeMap} is supported. */ + public final boolean GL_ARB_texture_cube_map; + /** When true, {@link ARBTextureCubeMapArray} is supported. */ + public final boolean GL_ARB_texture_cube_map_array; + /** + * When true, the ARB_texture_env_add extension is supported. + * + *

This extension adds a new texture environment function: ADD.

+ * + *

Promoted to core in {@link GL13 OpenGL 1.3}.

+ */ + public final boolean GL_ARB_texture_env_add; + /** When true, {@link ARBTextureEnvCombine} is supported. */ + public final boolean GL_ARB_texture_env_combine; + /** + * When true, the ARB_texture_env_crossbar extension is supported. + * + *

This extension adds the capability to use the texture color from other texture units as sources to the {@link ARBTextureEnvCombine#GL_COMBINE_ARB COMBINE_ARB} environment + * function. The {@link ARBTextureEnvCombine ARB_texture_env_combine} extension defined texture environment functions which could use the color from the current texture unit + * as a source. This extension adds the ability to use the color from any texture unit as a source.

+ * + *

Requires {@link #GL_ARB_multitexture ARB_multitexture} and {@link ARBTextureEnvCombine ARB_texture_env_combine}. Promoted to core in {@link GL14 OpenGL 1.4}.

+ */ + public final boolean GL_ARB_texture_env_crossbar; + /** When true, {@link ARBTextureEnvDot3} is supported. */ + public final boolean GL_ARB_texture_env_dot3; + /** When true, {@link ARBTextureFilterAnisotropic} is supported. */ + public final boolean GL_ARB_texture_filter_anisotropic; + /** When true, {@link ARBTextureFilterMinmax} is supported. */ + public final boolean GL_ARB_texture_filter_minmax; + /** When true, {@link ARBTextureFloat} is supported. */ + public final boolean GL_ARB_texture_float; + /** When true, {@link ARBTextureGather} is supported. */ + public final boolean GL_ARB_texture_gather; + /** When true, {@link ARBTextureMirrorClampToEdge} is supported. */ + public final boolean GL_ARB_texture_mirror_clamp_to_edge; + /** When true, {@link ARBTextureMirroredRepeat} is supported. */ + public final boolean GL_ARB_texture_mirrored_repeat; + /** When true, {@link ARBTextureMultisample} is supported. */ + public final boolean GL_ARB_texture_multisample; + /** + * When true, the ARB_texture_non_power_of_two extension is supported. + * + *

Conventional OpenGL texturing is limited to images with power-of-two dimensions and an optional 1-texel border. This extension relaxes the size + * restrictions for the 1D, 2D, cube map, and 3D texture targets.

+ * + *

Promoted to core in {@link GL20 OpenGL 2.0}.

+ */ + public final boolean GL_ARB_texture_non_power_of_two; + /** + * When true, the ARB_texture_query_levels extension is supported. + * + *

This extension provides a new set of texture functions ({@code textureQueryLevels}) in the OpenGL Shading Language that exposes the number of accessible + * mipmap levels in the texture associated with a GLSL sampler variable. The set of accessible levels includes all the levels of the texture defined either + * through TexImage*, TexStorage*, or TextureView* ({@link ARBTextureView ARB_texture_view}) APIs that are not below the {@link GL12#GL_TEXTURE_BASE_LEVEL TEXTURE_BASE_LEVEL} or above the + * {@link GL12#GL_TEXTURE_MAX_LEVEL TEXTURE_MAX_LEVEL} parameters. For textures defined with TexImage*, the set of resident levels is somewhat implementation-dependent. For fully + * defined results, applications should use TexStorage*/TextureView unless the texture has a full mipmap chain and is used with a mipmapped minification + * filter.

+ * + *

These functions means that shaders are not required to manually recompute, approximate, or maintain a uniform holding a pre-computed level count, since + * the true level count is already available to the implementation. This value can be used to avoid black or leaking pixel artifacts for rendering methods + * which are using texture images as memory pages (eg: virtual textures); methods that can't only rely on the fixed pipeline texture functions which take + * advantage of {@link GL12#GL_TEXTURE_MAX_LEVEL TEXTURE_MAX_LEVEL} for their sampling.

+ * + *

Requires {@link GL30 OpenGL 3.0} and GLSL 1.30. Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ + public final boolean GL_ARB_texture_query_levels; + /** + * When true, the ARB_texture_query_lod extension is supported. + * + *

This extension provides a new set of fragment shader texture functions ({@code textureLOD}) that return the results of automatic level-of-detail + * computations that would be performed if a texture lookup were performed.

+ * + *

Requires {@link GL20 OpenGL 2.0}, {@link #GL_EXT_gpu_shader4 EXT_gpu_shader4}, {@link #GL_EXT_texture_array EXT_texture_array} and GLSL 1.30. Promoted to core in {@link GL40 OpenGL 4.0}.

+ */ + public final boolean GL_ARB_texture_query_lod; + /** When true, {@link ARBTextureRectangle} is supported. */ + public final boolean GL_ARB_texture_rectangle; + /** When true, {@link ARBTextureRG} is supported. */ + public final boolean GL_ARB_texture_rg; + /** When true, {@link ARBTextureRGB10_A2UI} is supported. */ + public final boolean GL_ARB_texture_rgb10_a2ui; + /** + * When true, the ARB_texture_stencil8 extension is supported. + * + *

This extension accepts {@link GL30#GL_STENCIL_INDEX8 STENCIL_INDEX8} as a texture internal format, and adds STENCIL_INDEX8 to the required internal format list. This removes the + * need to use renderbuffers if a stencil-only format is desired.

+ * + *

Promoted to core in {@link GL44 OpenGL 4.4}.

+ */ + public final boolean GL_ARB_texture_stencil8; + /** When true, {@link ARBTextureStorage} is supported. */ + public final boolean GL_ARB_texture_storage; + /** When true, {@link ARBTextureStorageMultisample} is supported. */ + public final boolean GL_ARB_texture_storage_multisample; + /** When true, {@link ARBTextureSwizzle} is supported. */ + public final boolean GL_ARB_texture_swizzle; + /** When true, {@link ARBTextureView} is supported. */ + public final boolean GL_ARB_texture_view; + /** When true, {@link ARBTimerQuery} is supported. */ + public final boolean GL_ARB_timer_query; + /** When true, {@link ARBTransformFeedback2} is supported. */ + public final boolean GL_ARB_transform_feedback2; + /** When true, {@link ARBTransformFeedback3} is supported. */ + public final boolean GL_ARB_transform_feedback3; + /** When true, {@link ARBTransformFeedbackInstanced} is supported. */ + public final boolean GL_ARB_transform_feedback_instanced; + /** When true, {@link ARBTransformFeedbackOverflowQuery} is supported. */ + public final boolean GL_ARB_transform_feedback_overflow_query; + /** When true, {@link ARBTransposeMatrix} is supported. */ + public final boolean GL_ARB_transpose_matrix; + /** When true, {@link ARBUniformBufferObject} is supported. */ + public final boolean GL_ARB_uniform_buffer_object; + /** When true, {@link ARBVertexArrayBGRA} is supported. */ + public final boolean GL_ARB_vertex_array_bgra; + /** When true, {@link ARBVertexArrayObject} is supported. */ + public final boolean GL_ARB_vertex_array_object; + /** When true, {@link ARBVertexAttrib64Bit} is supported. */ + public final boolean GL_ARB_vertex_attrib_64bit; + /** When true, {@link ARBVertexAttribBinding} is supported. */ + public final boolean GL_ARB_vertex_attrib_binding; + /** When true, {@link ARBVertexBlend} is supported. */ + public final boolean GL_ARB_vertex_blend; + /** When true, {@link ARBVertexBufferObject} is supported. */ + public final boolean GL_ARB_vertex_buffer_object; + /** When true, {@link ARBVertexProgram} is supported. */ + public final boolean GL_ARB_vertex_program; + /** When true, {@link ARBVertexShader} is supported. */ + public final boolean GL_ARB_vertex_shader; + /** + * When true, the ARB_vertex_type_10f_11f_11f_rev extension is supported. + * + *

This extension a new vertex attribute data format: a packed 11.11.10 unsigned float vertex data format. This vertex data format can be used to describe + * a compressed 3 component stream of values that can be represented by 10- or 11-bit unsigned floating point values.

+ * + *

The {@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV} vertex attribute type is equivalent to the {@link GL30#GL_R11F_G11F_B10F R11F_G11F_B10F} texture internal format.

+ * + *

Requires {@link GL30 OpenGL 3.0} and {@link ARBVertexType2_10_10_10_REV ARB_vertex_type_2_10_10_10_rev}. Promoted to core in {@link GL44 OpenGL 4.4}.

+ */ + public final boolean GL_ARB_vertex_type_10f_11f_11f_rev; + /** When true, {@link ARBVertexType2_10_10_10_REV} is supported. */ + public final boolean GL_ARB_vertex_type_2_10_10_10_rev; + /** When true, {@link ARBViewportArray} is supported. */ + public final boolean GL_ARB_viewport_array; + /** When true, {@link ARBWindowPos} is supported. */ + public final boolean GL_ARB_window_pos; + /** When true, {@link ATIMeminfo} is supported. */ + public final boolean GL_ATI_meminfo; + /** When true, the ATI_shader_texture_lod extension is supported. */ + public final boolean GL_ATI_shader_texture_lod; + /** When true, {@link ATITextureCompression3DC} is supported. */ + public final boolean GL_ATI_texture_compression_3dc; + /** When true, {@link EXT422Pixels} is supported. */ + public final boolean GL_EXT_422_pixels; + /** When true, {@link EXTABGR} is supported. */ + public final boolean GL_EXT_abgr; + /** When true, {@link EXTBGRA} is supported. */ + public final boolean GL_EXT_bgra; + /** When true, {@link EXTBindableUniform} is supported. */ + public final boolean GL_EXT_bindable_uniform; + /** When true, {@link EXTBlendColor} is supported. */ + public final boolean GL_EXT_blend_color; + /** When true, {@link EXTBlendEquationSeparate} is supported. */ + public final boolean GL_EXT_blend_equation_separate; + /** When true, {@link EXTBlendFuncSeparate} is supported. */ + public final boolean GL_EXT_blend_func_separate; + /** When true, {@link EXTBlendMinmax} is supported. */ + public final boolean GL_EXT_blend_minmax; + /** When true, {@link EXTBlendSubtract} is supported. */ + public final boolean GL_EXT_blend_subtract; + /** When true, {@link EXTClipVolumeHint} is supported. */ + public final boolean GL_EXT_clip_volume_hint; + /** When true, {@link EXTCompiledVertexArray} is supported. */ + public final boolean GL_EXT_compiled_vertex_array; + /** When true, {@link EXTDebugLabel} is supported. */ + public final boolean GL_EXT_debug_label; + /** When true, {@link EXTDebugMarker} is supported. */ + public final boolean GL_EXT_debug_marker; + /** When true, {@link EXTDepthBoundsTest} is supported. */ + public final boolean GL_EXT_depth_bounds_test; + /** When true, {@link EXTDirectStateAccess} is supported. */ + public final boolean GL_EXT_direct_state_access; + /** When true, {@link EXTDrawBuffers2} is supported. */ + public final boolean GL_EXT_draw_buffers2; + /** When true, {@link EXTDrawInstanced} is supported. */ + public final boolean GL_EXT_draw_instanced; + /** When true, {@link EXTEGLImageStorage} is supported. */ + public final boolean GL_EXT_EGL_image_storage; + /** When true, {@link EXTExternalBuffer} is supported. */ + public final boolean GL_EXT_external_buffer; + /** When true, {@link EXTFramebufferBlit} is supported. */ + public final boolean GL_EXT_framebuffer_blit; + /** When true, {@link EXTFramebufferMultisample} is supported. */ + public final boolean GL_EXT_framebuffer_multisample; + /** When true, {@link EXTFramebufferMultisampleBlitScaled} is supported. */ + public final boolean GL_EXT_framebuffer_multisample_blit_scaled; + /** When true, {@link EXTFramebufferObject} is supported. */ + public final boolean GL_EXT_framebuffer_object; + /** When true, {@link EXTFramebufferSRGB} is supported. */ + public final boolean GL_EXT_framebuffer_sRGB; + /** When true, {@link EXTGeometryShader4} is supported. */ + public final boolean GL_EXT_geometry_shader4; + /** When true, {@link EXTGPUProgramParameters} is supported. */ + public final boolean GL_EXT_gpu_program_parameters; + /** When true, {@link EXTGPUShader4} is supported. */ + public final boolean GL_EXT_gpu_shader4; + /** When true, {@link EXTMemoryObject} is supported. */ + public final boolean GL_EXT_memory_object; + /** When true, {@link EXTMemoryObjectFD} is supported. */ + public final boolean GL_EXT_memory_object_fd; + /** When true, {@link EXTMemoryObjectWin32} is supported. */ + public final boolean GL_EXT_memory_object_win32; + /** + * When true, the EXT_multiview_tessellation_geometry_shader extension is supported. + * + *

This extension removes one of the limitations of the {@code OVR_multiview} extension by allowing the use of tessellation control, tessellation + * evaluation, and geometry shaders during multiview rendering. {@code OVR_multiview} by itself forbids the use of any of these shader types.

+ * + *

When using tessellation control, tessellation evaluation, and geometry shaders during multiview rendering, any such shader must use the + * "{@code num_views}" layout qualifier provided by the matching shading language extension to specify a view count. The view count specified in these + * shaders must match the count specified in the vertex shader. Additionally, the shading language extension allows these shaders to use the + * {@code gl_ViewID_OVR} built-in to handle tessellation or geometry shader processing differently for each view.

+ * + *

{@code OVR_multiview2} extends {@code OVR_multiview} by allowing view-dependent values for any vertex attributes instead of just the position. This new + * extension does not imply the availability of {@code OVR_multiview2}, but if both are available, view-dependent values for any vertex attributes are + * also allowed in tessellation control, tessellation evaluation, and geometry shaders.

+ * + *

Requires {@link GL40 OpenGL 4.0} and {@link OVRMultiview OVR_multiview}.

+ */ + public final boolean GL_EXT_multiview_tessellation_geometry_shader; + /** + * When true, the EXT_multiview_texture_multisample extension is supported. + * + *

This extension removes one of the limitations of the {@code OVR_multiview} extension by allowing the use of multisample textures during multiview + * rendering.

+ * + *

This is one of two extensions that allow multisampling when using {@code OVR_multiview}. Each supports one of the two different approaches to + * multisampling in OpenGL:

+ * + *

Core OpenGL has explicit support for multisample texture types, such as {@link GL32#GL_TEXTURE_2D_MULTISAMPLE TEXTURE_2D_MULTISAMPLE}. Applications can access the values of individual + * samples and can explicitly "resolve" the samples of each pixel down to a single color.

+ * + *

The extension {@code EXT_multisampled_render_to_texture} provides support for multisampled rendering to non-multisample texture types, such as + * {@link GL11#GL_TEXTURE_2D TEXTURE_2D}. The individual samples for each pixel are maintained internally by the implementation and can not be accessed directly by applications. + * These samples are eventually resolved implicitly to a single color for each pixel.

+ * + *

This extension supports the first multisampling style with multiview rendering; the {@code OVR_multiview_multisampled_render_to_texture} extension + * supports the second style. Note that support for one of these multiview extensions does not imply support for the other.

+ * + *

Requires {@link GL40 OpenGL 4.0} and {@link OVRMultiview OVR_multiview}.

+ */ + public final boolean GL_EXT_multiview_texture_multisample; + /** + * When true, the EXT_multiview_timer_query extension is supported. + * + *

This extension removes one of the limitations of the {@code OVR_multiview} extension by allowing the use of timer queries during multiview rendering. + * {@code OVR_multiview} does not specify defined behavior for such usage.

+ * + *

Requires {@link GL40 OpenGL 4.0} and {@link OVRMultiview OVR_multiview}.

+ */ + public final boolean GL_EXT_multiview_timer_query; + /** When true, {@link EXTPackedDepthStencil} is supported. */ + public final boolean GL_EXT_packed_depth_stencil; + /** When true, {@link EXTPackedFloat} is supported. */ + public final boolean GL_EXT_packed_float; + /** When true, {@link EXTPixelBufferObject} is supported. */ + public final boolean GL_EXT_pixel_buffer_object; + /** When true, {@link EXTPointParameters} is supported. */ + public final boolean GL_EXT_point_parameters; + /** When true, {@link EXTPolygonOffsetClamp} is supported. */ + public final boolean GL_EXT_polygon_offset_clamp; + /** + * When true, the EXT_post_depth_coverage extension is supported. + * + *

This extension allows the fragment shader to control whether values in {@code gl_SampleMaskIn[]} reflect the coverage after application of the early + * depth and stencil tests. This feature can be enabled with the following layout qualifier in the fragment shader:

+ * + *

+     * layout(post_depth_coverage) in;
+ * + *

To use this feature, early fragment tests must also be enabled in the fragment shader via:

+ * + *

+     * layout(early_fragment_tests) in;
+ */ + public final boolean GL_EXT_post_depth_coverage; + /** When true, {@link EXTProvokingVertex} is supported. */ + public final boolean GL_EXT_provoking_vertex; + /** When true, {@link EXTRasterMultisample} is supported. */ + public final boolean GL_EXT_raster_multisample; + /** When true, {@link EXTSecondaryColor} is supported. */ + public final boolean GL_EXT_secondary_color; + /** When true, {@link EXTSemaphore} is supported. */ + public final boolean GL_EXT_semaphore; + /** When true, {@link EXTSemaphoreFD} is supported. */ + public final boolean GL_EXT_semaphore_fd; + /** When true, {@link EXTSemaphoreWin32} is supported. */ + public final boolean GL_EXT_semaphore_win32; + /** When true, {@link EXTSeparateShaderObjects} is supported. */ + public final boolean GL_EXT_separate_shader_objects; + /** When true, {@link EXTShaderFramebufferFetch} is supported. */ + public final boolean GL_EXT_shader_framebuffer_fetch; + /** When true, {@link EXTShaderFramebufferFetchNonCoherent} is supported. */ + public final boolean GL_EXT_shader_framebuffer_fetch_non_coherent; + /** + * When true, the EXT_shader_image_load_formatted extension is supported. + * + *

{@link ARBShaderImageLoadStore ARB_shader_image_load_store} (and OpenGL 4.2) added support for random access load and store from/to texture images, but due to hardware + * limitations, loads were required to declare the image format in the shader source. This extension relaxes that requirement, and the return values from + * {@code imageLoad} can be format-converted based on the format of the image binding.

+ */ + public final boolean GL_EXT_shader_image_load_formatted; + /** When true, {@link EXTShaderImageLoadStore} is supported. */ + public final boolean GL_EXT_shader_image_load_store; + /** + * When true, the EXT_shader_integer_mix extension is supported. + * + *

GLSL 1.30 (and GLSL ES 3.00) expanded the mix() built-in function to operate on a boolean third argument that does not interpolate but selects. This + * extension extends mix() to select between int, uint, and bool components.

+ * + *

Requires {@link GL30 OpenGL 3.0}.

+ */ + public final boolean GL_EXT_shader_integer_mix; + /** + * When true, the EXT_shadow_funcs extension is supported. + * + *

This extension generalizes the {@link #GL_ARB_shadow ARB_shadow} extension to support all eight binary texture comparison functions rather than just {@link GL11#GL_LEQUAL LEQUAL} and + * {@link GL11#GL_GEQUAL GEQUAL}.

+ * + *

Requires {@link #GL_ARB_depth_texture ARB_depth_texture} and {@link #GL_ARB_shadow ARB_shadow}.

+ */ + public final boolean GL_EXT_shadow_funcs; + /** When true, {@link EXTSharedTexturePalette} is supported. */ + public final boolean GL_EXT_shared_texture_palette; + /** + * When true, the EXT_sparse_texture2 extension is supported. + * + *

This extension builds on the {@link ARBSparseTexture ARB_sparse_texture} extension, providing the following new functionality:

+ * + *
    + *
  • New built-in GLSL texture lookup and image load functions are provided that return information on whether the texels accessed for the texture + * lookup accessed uncommitted texture memory. + * + *

    New built-in GLSL texture lookup functions are provided that specify a minimum level of detail to use for lookups where the level of detail is + * computed automatically. This allows shaders to avoid accessing unpopulated portions of high-resolution levels of detail when it knows that the + * memory accessed is unpopulated, either from a priori knowledge or from feedback provided by the return value of previously executed "sparse" + * texture lookup functions.

    + * + *

    Reads of uncommitted texture memory will act as though such memory were filled with zeroes; previously, the values returned by reads were undefined.

    + * + *

    Standard implementation-independent virtual page sizes for internal formats required to be supported with sparse textures. These standard sizes can + * be requested by leaving {@link ARBSparseTexture#GL_VIRTUAL_PAGE_SIZE_INDEX_ARB VIRTUAL_PAGE_SIZE_INDEX_ARB} at its initial value (0).

    + * + *

    Support for creating sparse multisample and multisample array textures is added. However, the virtual page sizes for such textures remain fully + * implementation-dependent.

  • + *
+ * + *

Requires {@link ARBSparseTexture ARB_sparse_texture}.

+ */ + public final boolean GL_EXT_sparse_texture2; + /** When true, {@link EXTStencilClearTag} is supported. */ + public final boolean GL_EXT_stencil_clear_tag; + /** When true, {@link EXTStencilTwoSide} is supported. */ + public final boolean GL_EXT_stencil_two_side; + /** When true, {@link EXTStencilWrap} is supported. */ + public final boolean GL_EXT_stencil_wrap; + /** When true, {@link EXTTextureArray} is supported. */ + public final boolean GL_EXT_texture_array; + /** When true, {@link EXTTextureBufferObject} is supported. */ + public final boolean GL_EXT_texture_buffer_object; + /** When true, {@link EXTTextureCompressionLATC} is supported. */ + public final boolean GL_EXT_texture_compression_latc; + /** When true, {@link EXTTextureCompressionRGTC} is supported. */ + public final boolean GL_EXT_texture_compression_rgtc; + /** When true, {@link EXTTextureCompressionS3TC} is supported. */ + public final boolean GL_EXT_texture_compression_s3tc; + /** When true, {@link EXTTextureFilterAnisotropic} is supported. */ + public final boolean GL_EXT_texture_filter_anisotropic; + /** When true, {@link EXTTextureFilterMinmax} is supported. */ + public final boolean GL_EXT_texture_filter_minmax; + /** When true, {@link EXTTextureInteger} is supported. */ + public final boolean GL_EXT_texture_integer; + /** When true, {@link EXTTextureMirrorClamp} is supported. */ + public final boolean GL_EXT_texture_mirror_clamp; + /** + * This extension adds support for various shadow sampler types with texture functions having interactions with the LOD of texture lookups. + * + *

Modern shading languages support LOD queries for shadow sampler types, but until now the OpenGL Shading Language Specification has excluded multiple + * texture function overloads involving LOD calculations with various shadow samplers. Shading languages for other APIs do support the equivalent + * LOD-based texture sampling functions for these types which has made porting between those shading languages to GLSL cumbersome and has required the + * usage of sub-optimal workarounds.

+ * + *

Requires {@link GL20 OpenGL 2.0} and {@link EXTGPUShader4 EXT_gpu_shader4} or equivalent functionality.

+ */ + public final boolean GL_EXT_texture_shadow_lod; + /** When true, {@link EXTTextureSharedExponent} is supported. */ + public final boolean GL_EXT_texture_shared_exponent; + /** When true, {@link EXTTextureSnorm} is supported. */ + public final boolean GL_EXT_texture_snorm; + /** When true, {@link EXTTextureSRGB} is supported. */ + public final boolean GL_EXT_texture_sRGB; + /** When true, {@link EXTTextureSRGBDecode} is supported. */ + public final boolean GL_EXT_texture_sRGB_decode; + /** When true, {@link EXTTextureSRGBR8} is supported. */ + public final boolean GL_EXT_texture_sRGB_R8; + /** When true, {@link EXTTextureSwizzle} is supported. */ + public final boolean GL_EXT_texture_swizzle; + /** When true, {@link EXTTimerQuery} is supported. */ + public final boolean GL_EXT_timer_query; + /** When true, {@link EXTTransformFeedback} is supported. */ + public final boolean GL_EXT_transform_feedback; + /** + * When true, the EXT_vertex_array_bgra extension is supported. + * + *

This extension provides a single new component format for vertex arrays to read 4-component unsigned byte vertex attributes with a BGRA component + * ordering.

+ * + *

OpenGL expects vertex arrays containing 4 unsigned bytes per element to be in the RGBA, STRQ, or XYZW order (reading components left-to-right in their + * lower address to higher address order). Essentially the order the components appear in memory is the order the components appear in the resulting + * vertex attribute vector.

+ * + *

However Direct3D has color (diffuse and specular) vertex arrays containing 4 unsigned bytes per element that are in a BGRA order (again reading + * components left-to-right in their lower address to higher address order). Direct3D calls this "ARGB" reading the components in the opposite order + * (reading components left-to-right in their higher address to lower address order). This ordering is generalized in the DirectX 10 by the + * DXGI_FORMAT_B8G8R8A8_UNORM format.

+ * + *

For an OpenGL application to source color data from a vertex buffer formatted for Direct3D's color array format conventions, the application is forced + * to either:

+ * + *
    + *
  1. Rely on a vertex program or shader to swizzle the color components from the BGRA to conventional RGBA order.
  2. + *
  3. Re-order the color data components in the vertex buffer from Direct3D's native BGRA order to OpenGL's native RGBA order.
  4. + *
+ * + *

Neither option is entirely satisfactory.

+ * + *

Option 1 means vertex shaders have to be re-written to source colors differently. If the same vertex shader is used with vertex arrays configured to + * source the color as 4 floating-point color components, the swizzle for BGRA colors stored as 4 unsigned bytes is no longer appropriate. The shader's + * swizzling of colors becomes dependent on the type and number of color components. Ideally the vertex shader should be independent from the format and + * component ordering of the data it sources.

+ * + *

Option 2 is expensive because vertex buffers may have to be reformatted prior to use. OpenGL treats the memory for vertex arrays (whether client-side + * memory or buffer objects) as essentially untyped memory and vertex arrays can be stored separately, interleaved, or even interwoven (where multiple + * arrays overlap with differing strides and formats).

+ * + *

Rather than force a re-ordering of either vertex array components in memory or a vertex array format-dependent re-ordering of vertex shader inputs, + * OpenGL can simply provide a vertex array format that matches the Direct3D color component ordering.

+ * + *

This approach mimics that of the EXT_bgra extension for pixel and texel formats except for vertex instead of image data.

+ */ + public final boolean GL_EXT_vertex_array_bgra; + /** When true, {@link EXTVertexAttrib64bit} is supported. */ + public final boolean GL_EXT_vertex_attrib_64bit; + /** When true, {@link EXTWin32KeyedMutex} is supported. */ + public final boolean GL_EXT_win32_keyed_mutex; + /** When true, {@link EXTWindowRectangles} is supported. */ + public final boolean GL_EXT_window_rectangles; + /** When true, {@link EXTX11SyncObject} is supported. */ + public final boolean GL_EXT_x11_sync_object; + /** When true, {@link GREMEDYFrameTerminator} is supported. */ + public final boolean GL_GREMEDY_frame_terminator; + /** When true, {@link GREMEDYStringMarker} is supported. */ + public final boolean GL_GREMEDY_string_marker; + /** When true, {@link INTELBlackholeRender} is supported. */ + public final boolean GL_INTEL_blackhole_render; + /** When true, {@link INTELConservativeRasterization} is supported. */ + public final boolean GL_INTEL_conservative_rasterization; + /** + * When true, the INTEL_fragment_shader_ordering extension is supported. + * + *

Graphics devices may execute in parallel fragment shaders referring to the same window xy coordinates. Framebuffer writes are guaranteed to be + * processed in primitive rasterization order, but there is no order guarantee for other instructions and image or buffer object accesses in particular.

+ * + *

The extension introduces a new GLSL built-in function, beginFragmentShaderOrderingINTEL(), which blocks execution of a fragment shader invocation until + * invocations from previous primitives that map to the same xy window coordinates (and same sample when per-sample shading is active) complete their + * execution. All memory transactions from previous fragment shader invocations are made visible to the fragment shader invocation that called + * beginFragmentShaderOrderingINTEL() when the function returns.

+ */ + public final boolean GL_INTEL_fragment_shader_ordering; + /** When true, {@link INTELFramebufferCMAA} is supported. */ + public final boolean GL_INTEL_framebuffer_CMAA; + /** When true, {@link INTELMapTexture} is supported. */ + public final boolean GL_INTEL_map_texture; + /** When true, {@link INTELPerformanceQuery} is supported. */ + public final boolean GL_INTEL_performance_query; + /** When true, {@link KHRBlendEquationAdvanced} is supported. */ + public final boolean GL_KHR_blend_equation_advanced; + /** When true, {@link KHRBlendEquationAdvancedCoherent} is supported. */ + public final boolean GL_KHR_blend_equation_advanced_coherent; + /** When true, {@link KHRContextFlushControl} is supported. */ + public final boolean GL_KHR_context_flush_control; + /** When true, {@link KHRDebug} is supported. */ + public final boolean GL_KHR_debug; + /** When true, {@link KHRNoError} is supported. */ + public final boolean GL_KHR_no_error; + /** When true, {@link KHRParallelShaderCompile} is supported. */ + public final boolean GL_KHR_parallel_shader_compile; + /** + * When true, the KHR_robust_buffer_access_behavior extension is supported. + * + *

This extension specifies the behavior of out-of-bounds buffer and array accesses. This is an improvement over the existing {@link #GL_KHR_robustness KHR_robustness} + * extension which states that the application should not crash, but that behavior is otherwise undefined. This extension specifies the access protection + * provided by the GL to ensure that out-of-bounds accesses cannot read from or write to data not owned by the application. All accesses are contained + * within the buffer object and program area they reference. These additional robustness guarantees apply to contexts created with the robust access flag + * set.

+ * + *

Requires {@link GL32 OpenGL 3.2} and {@link #GL_KHR_robustness KHR_robustness}.

+ */ + public final boolean GL_KHR_robust_buffer_access_behavior; + /** When true, {@link KHRRobustness} is supported. */ + public final boolean GL_KHR_robustness; + /** When true, {@link KHRShaderSubgroup} is supported. */ + public final boolean GL_KHR_shader_subgroup; + /** + * When true, the KHR_texture_compression_astc_hdr extension is supported. + * + *

This extension corresponds to the ASTC HDR Profile, see {@link KHRTextureCompressionASTCLDR KHR_texture_compression_astc_ldr} for details.

+ */ + public final boolean GL_KHR_texture_compression_astc_hdr; + /** When true, {@link KHRTextureCompressionASTCLDR} is supported. */ + public final boolean GL_KHR_texture_compression_astc_ldr; + /** + * When true, the KHR_texture_compression_astc_sliced_3d extension is supported. + * + *

Adaptive Scalable Texture Compression (ASTC) is a new texture compression technology that offers unprecendented flexibility, while producing better or + * comparable results than existing texture compressions at all bit rates. It includes support for 2D and slice-based 3D textures, with low and high + * dynamic range, at bitrates from below 1 bit/pixel up to 8 bits/pixel in fine steps.

+ * + *

This extension extends the functionality of {@link KHRTextureCompressionASTCLDR KHR_texture_compression_astc_ldr} to include slice-based 3D textures for textures using the LDR + * profile in the same way as the HDR profile allows slice-based 3D textures.

+ * + *

Requires {@link KHRTextureCompressionASTCLDR KHR_texture_compression_astc_ldr}.

+ */ + public final boolean GL_KHR_texture_compression_astc_sliced_3d; + /** When true, {@link NVAlphaToCoverageDitherControl} is supported. */ + public final boolean GL_NV_alpha_to_coverage_dither_control; + /** When true, {@link NVBindlessMultiDrawIndirect} is supported. */ + public final boolean GL_NV_bindless_multi_draw_indirect; + /** When true, {@link NVBindlessMultiDrawIndirectCount} is supported. */ + public final boolean GL_NV_bindless_multi_draw_indirect_count; + /** When true, {@link NVBindlessTexture} is supported. */ + public final boolean GL_NV_bindless_texture; + /** When true, {@link NVBlendEquationAdvanced} is supported. */ + public final boolean GL_NV_blend_equation_advanced; + /** When true, {@link NVBlendEquationAdvancedCoherent} is supported. */ + public final boolean GL_NV_blend_equation_advanced_coherent; + /** When true, {@link NVBlendMinmaxFactor} is supported. */ + public final boolean GL_NV_blend_minmax_factor; + /** When true, the NV_blend_square extension is supported. */ + public final boolean GL_NV_blend_square; + /** When true, {@link NVClipSpaceWScaling} is supported. */ + public final boolean GL_NV_clip_space_w_scaling; + /** When true, {@link NVCommandList} is supported. */ + public final boolean GL_NV_command_list; + /** + * When true, the NV_compute_shader_derivatives extension is supported. + * + *

This extension adds OpenGL API support for the OpenGL Shading Language (GLSL) extension {@code "NV_compute_shader_derivatives"}.

+ * + *

That extension, when enabled, allows applications to use derivatives in compute shaders. It adds compute shader support for explicit derivative + * built-in functions like {@code dFdx()}, automatic derivative computation in texture lookup functions like {@code texture()}, use of the optional LOD + * bias parameter to adjust the computed level of detail values in texture lookup functions, and the texture level of detail query function + * {@code textureQueryLod()}.

+ * + *

Requires {@link GL45 OpenGL 4.5}.

+ */ + public final boolean GL_NV_compute_shader_derivatives; + /** When true, {@link NVConditionalRender} is supported. */ + public final boolean GL_NV_conditional_render; + /** When true, {@link NVConservativeRaster} is supported. */ + public final boolean GL_NV_conservative_raster; + /** When true, {@link NVConservativeRasterDilate} is supported. */ + public final boolean GL_NV_conservative_raster_dilate; + /** When true, {@link NVConservativeRasterPreSnap} is supported. */ + public final boolean GL_NV_conservative_raster_pre_snap; + /** When true, {@link NVConservativeRasterPreSnapTriangles} is supported. */ + public final boolean GL_NV_conservative_raster_pre_snap_triangles; + /** + * When true, the NV_conservative_raster_underestimation extension is supported. + * + *

The extension {@link NVConservativeRaster NV_conservative_raster} provides a new rasterization mode known as "Overestimated Conservative Rasterization", where any pixel + * that is partially covered, even if no sample location is covered, is treated as fully covered and a corresponding fragment will be shaded. There is + * also an "Underestimated Conservative Rasterization" variant, where only the pixels that are completely covered by the primitive are rasterized.

+ * + *

This extension provides the underestimated conservative rasterization information for each fragment in the fragment shader through a new built-in + * {@code gl_FragFullyCoveredNV}.

+ */ + public final boolean GL_NV_conservative_raster_underestimation; + /** When true, {@link NVCopyDepthToColor} is supported. */ + public final boolean GL_NV_copy_depth_to_color; + /** When true, {@link NVCopyImage} is supported. */ + public final boolean GL_NV_copy_image; + /** When true, {@link NVDeepTexture3D} is supported. */ + public final boolean GL_NV_deep_texture3D; + /** When true, {@link NVDepthBufferFloat} is supported. */ + public final boolean GL_NV_depth_buffer_float; + /** When true, {@link NVDepthClamp} is supported. */ + public final boolean GL_NV_depth_clamp; + /** When true, {@link NVDrawTexture} is supported. */ + public final boolean GL_NV_draw_texture; + /** When true, {@link NVDrawVulkanImage} is supported. */ + public final boolean GL_NV_draw_vulkan_image; + /** When true, the NV_ES3_1_compatibility extension is supported. */ + public final boolean GL_NV_ES3_1_compatibility; + /** When true, {@link NVExplicitMultisample} is supported. */ + public final boolean GL_NV_explicit_multisample; + /** When true, {@link NVFence} is supported. */ + public final boolean GL_NV_fence; + /** When true, {@link NVFillRectangle} is supported. */ + public final boolean GL_NV_fill_rectangle; + /** When true, {@link NVFloatBuffer} is supported. */ + public final boolean GL_NV_float_buffer; + /** When true, {@link NVFogDistance} is supported. */ + public final boolean GL_NV_fog_distance; + /** When true, {@link NVFragmentCoverageToColor} is supported. */ + public final boolean GL_NV_fragment_coverage_to_color; + /** When true, the NV_fragment_program4 extension is supported. */ + public final boolean GL_NV_fragment_program4; + /** When true, the NV_fragment_program_option extension is supported. */ + public final boolean GL_NV_fragment_program_option; + /** + * When true, the NV_fragment_shader_barycentric extension is supported. + * + *

This extension advertises OpenGL support for the OpenGL Shading Language (GLSL) extension {@code "NV_fragment_shader_barycentric"}, which provides + * fragment shader built-in variables holding barycentric weight vectors that identify the location of the fragment within its primitive. Additionally, + * the GLSL extension allows fragment the ability to read raw attribute values for each of the vertices of the primitive that produced the fragment.

+ * + *

Requires {@link GL45 OpenGL 4.5}.

+ */ + public final boolean GL_NV_fragment_shader_barycentric; + /** + * When true, the NV_fragment_shader_interlock extension is supported. + * + *

In unextended OpenGL 4.3, applications may produce a large number of fragment shader invocations that perform loads and stores to memory using image + * uniforms, atomic counter uniforms, buffer variables, or pointers. The order in which loads and stores to common addresses are performed by different + * fragment shader invocations is largely undefined. For algorithms that use shader writes and touch the same pixels more than once, one or more of the + * following techniques may be required to ensure proper execution ordering:

+ * + *
    + *
  • inserting Finish or WaitSync commands to drain the pipeline between different "passes" or "layers";
  • + *
  • using only atomic memory operations to write to shader memory (which may be relatively slow and limits how memory may be updated); or
  • + *
  • injecting spin loops into shaders to prevent multiple shader invocations from touching the same memory concurrently.
  • + *
+ * + *

This extension provides new GLSL built-in functions beginInvocationInterlockNV() and endInvocationInterlockNV() that delimit a critical section of + * fragment shader code. For pairs of shader invocations with "overlapping" coverage in a given pixel, the OpenGL implementation will guarantee that the + * critical section of the fragment shader will be executed for only one fragment at a time.

+ * + *

There are four different interlock modes supported by this extension, which are identified by layout qualifiers. The qualifiers + * "pixel_interlock_ordered" and "pixel_interlock_unordered" provides mutual exclusion in the critical section for any pair of fragments corresponding to + * the same pixel. When using multisampling, the qualifiers "sample_interlock_ordered" and "sample_interlock_unordered" only provide mutual exclusion for + * pairs of fragments that both cover at least one common sample in the same pixel; these are recommended for performance if shaders use per-sample data + * structures.

+ * + *

Additionally, when the "pixel_interlock_ordered" or "sample_interlock_ordered" layout qualifier is used, the interlock also guarantees that the + * critical section for multiple shader invocations with "overlapping" coverage will be executed in the order in which the primitives were processed by + * the GL. Such a guarantee is useful for applications like blending in the fragment shader, where an application requires that fragment values to be + * composited in the framebuffer in primitive order.

+ * + *

This extension can be useful for algorithms that need to access per-pixel data structures via shader loads and stores. Such algorithms using this + * extension can access such data structures in the critical section without worrying about other invocations for the same pixel accessing the data + * structures concurrently. Additionally, the ordering guarantees are useful for cases where the API ordering of fragments is meaningful. For example, + * applications may be able to execute programmable blending operations in the fragment shader, where the destination buffer is read via image loads and + * the final value is written via image stores.

+ * + *

Requires {@link GL43 OpenGL 4.3} and GLSL 4.30.

+ */ + public final boolean GL_NV_fragment_shader_interlock; + /** When true, {@link NVFramebufferMixedSamples} is supported. */ + public final boolean GL_NV_framebuffer_mixed_samples; + /** When true, {@link NVFramebufferMultisampleCoverage} is supported. */ + public final boolean GL_NV_framebuffer_multisample_coverage; + /** + * When true, the NV_geometry_shader4 extension is supported. + * + *

This extension builds upon the {@link #GL_EXT_geometry_shader4 EXT_geometry_shader4} specification to provide two additional capabilities:

+ * + *
    + *
  • Support for QUADS, QUAD_STRIP, and POLYGON primitive types when geometry shaders are enabled. Such primitives will be tessellated into individual + * triangles.
  • + *
  • Setting the value of GEOMETRY_VERTICES_OUT_EXT will take effect immediately. It is not necessary to link the program object in order for this change + * to take effect, as is the case in the EXT version of this extension.
  • + *
+ * + *

Requires {@link #GL_EXT_geometry_shader4 EXT_geometry_shader4}.

+ */ + public final boolean GL_NV_geometry_shader4; + /** + * When true, the NV_geometry_shader_passthrough extension is supported. + * + *

This extension provides a shading language abstraction to express such shaders without requiring explicit logic to manually copy attributes from input + * vertices to output vertices.

+ */ + public final boolean GL_NV_geometry_shader_passthrough; + /** When true, {@link NVGPUMulticast} is supported. */ + public final boolean GL_NV_gpu_multicast; + /** When true, {@link NVGPUShader5} is supported. */ + public final boolean GL_NV_gpu_shader5; + /** When true, {@link NVHalfFloat} is supported. */ + public final boolean GL_NV_half_float; + /** When true, {@link NVInternalformatSampleQuery} is supported. */ + public final boolean GL_NV_internalformat_sample_query; + /** When true, {@link NVLightMaxExponent} is supported. */ + public final boolean GL_NV_light_max_exponent; + /** When true, {@link NVMemoryAttachment} is supported. */ + public final boolean GL_NV_memory_attachment; + /** When true, {@link NVMeshShader} is supported. */ + public final boolean GL_NV_mesh_shader; + /** When true, {@link NVMultisampleCoverage} is supported. */ + public final boolean GL_NV_multisample_coverage; + /** When true, {@link NVMultisampleFilterHint} is supported. */ + public final boolean GL_NV_multisample_filter_hint; + /** When true, {@link NVPackedDepthStencil} is supported. */ + public final boolean GL_NV_packed_depth_stencil; + /** When true, {@link NVPathRendering} is supported. */ + public final boolean GL_NV_path_rendering; + /** When true, {@link NVPathRenderingSharedEdge} is supported. */ + public final boolean GL_NV_path_rendering_shared_edge; + /** When true, {@link NVPixelDataRange} is supported. */ + public final boolean GL_NV_pixel_data_range; + /** When true, {@link NVPointSprite} is supported. */ + public final boolean GL_NV_point_sprite; + /** When true, {@link NVPrimitiveRestart} is supported. */ + public final boolean GL_NV_primitive_restart; + /** When true, {@link NVQueryResource} is supported. */ + public final boolean GL_NV_query_resource; + /** When true, {@link NVQueryResourceTag} is supported. */ + public final boolean GL_NV_query_resource_tag; + /** When true, {@link NVRepresentativeFragmentTest} is supported. */ + public final boolean GL_NV_representative_fragment_test; + /** When true, {@link NVRobustnessVideoMemoryPurge} is supported. */ + public final boolean GL_NV_robustness_video_memory_purge; + /** When true, {@link NVSampleLocations} is supported. */ + public final boolean GL_NV_sample_locations; + /** + * When true, the NV_sample_mask_override_coverage extension is supported. + * + *

This extension allows the fragment shader to control whether the gl_SampleMask output can enable samples that were not covered by the original + * primitive, or that failed the early depth/stencil tests.

+ */ + public final boolean GL_NV_sample_mask_override_coverage; + /** When true, {@link NVScissorExclusive} is supported. */ + public final boolean GL_NV_scissor_exclusive; + /** + * When true, the NV_shader_atomic_float extension is supported. + * + *

This extension provides GLSL built-in functions and assembly opcodes allowing shaders to perform atomic read-modify-write operations to buffer or + * texture memory with floating-point components. The set of atomic operations provided by this extension is limited to adds and exchanges. Providing + * atomic add support allows shaders to atomically accumulate the sum of floating-point values into buffer or texture memory across multiple (possibly + * concurrent) shader invocations.

+ * + *

This extension provides GLSL support for atomics targeting image uniforms (if GLSL 4.20, {@link #GL_ARB_shader_image_load_store ARB_shader_image_load_store}, or + * {@link #GL_EXT_shader_image_load_store EXT_shader_image_load_store} is supported) or floating-point pointers (if {@link #GL_NV_gpu_shader5 NV_gpu_shader5} is supported). Additionally, assembly opcodes + * for these operations is also provided if NV_gpu_program5 is supported.

+ */ + public final boolean GL_NV_shader_atomic_float; + /** + * When true, the NV_shader_atomic_float64 extension is supported. + * + *

This extension provides GLSL built-in functions and assembly opcodes allowing shaders to perform atomic read-modify-write operations to buffer or + * shared memory with double-precision floating-point components. The set of atomic operations provided by this extension is limited to adds and + * exchanges. Providing atomic add support allows shaders to atomically accumulate the sum of double-precision floating-point values into buffer memory + * across multiple (possibly concurrent) shader invocations.

+ * + *

This extension provides GLSL support for atomics targeting double-precision floating-point pointers (if {@link NVGPUShader5 NV_gpu_shader5} is supported). + * Additionally, assembly opcodes for these operations are also provided if {@code NV_gpu_program5} is supported.

+ * + *

Requires {@link ARBGPUShaderFP64 ARB_gpu_shader_fp64} or {@code NV_gpu_program_fp64}.

+ */ + public final boolean GL_NV_shader_atomic_float64; + /** + * When true, the NV_shader_atomic_fp16_vector extension is supported. + * + *

This extension provides GLSL built-in functions and assembly opcodes allowing shaders to perform a limited set of atomic read-modify-write operations + * to buffer or texture memory with 16-bit floating point vector surface formats.

+ * + *

Requires {@link #GL_NV_gpu_shader5 NV_gpu_shader5}.

+ */ + public final boolean GL_NV_shader_atomic_fp16_vector; + /** + * When true, the NV_shader_atomic_int64 extension is supported. + * + *

This extension provides additional GLSL built-in functions and assembly opcodes allowing shaders to perform additional atomic read-modify-write + * operations on 64-bit signed and unsigned integers stored in buffer object memory.

+ */ + public final boolean GL_NV_shader_atomic_int64; + /** When true, {@link NVShaderBufferLoad} is supported. */ + public final boolean GL_NV_shader_buffer_load; + /** When true, {@link NVShaderBufferStore} is supported. */ + public final boolean GL_NV_shader_buffer_store; + /** When true, {@link NVShaderSubgroupPartitioned} is supported. */ + public final boolean GL_NV_shader_subgroup_partitioned; + /** + * When true, the NV_shader_texture_footprint extension is supported. + * + *

This extension adds OpenGL API support for the OpenGL Shading Language (GLSL) extension {@code "NV_shader_texture_footprint"}. That extension adds a + * new set of texture query functions ({@code "textureFootprint*NV"}) to GLSL. These built-in functions prepare to perform a filtered texture lookup based + * on coordinates and other parameters passed in by the calling code. However, instead of returning data from the provided texture image, these query + * functions instead return data identifying the texture footprint for an equivalent texture access. The texture footprint identifies a set of + * texels that may be accessed in order to return a filtered result for the texture access.

+ * + *

The footprint itself is a structure that includes integer values that identify a small neighborhood of texels in the texture being accessed and a + * bitfield that indicates which texels in that neighborhood would be used. Each bit in the returned bitfield identifies whether any texel in a small + * aligned block of texels would be fetched by the texture lookup. The size of each block is specified by an access granularity provided by the + * shader. The minimum granularity supported by this extension is 2x2 (for 2D textures) and 2x2x2 (for 3D textures); the maximum granularity is 256x256 + * (for 2D textures) or 64x32x32 (for 3D textures). Each footprint query returns the footprint from a single texture level. When using minification + * filters that combine accesses from multiple mipmap levels, shaders must perform separate queries for the two levels accessed ("fine" and "coarse"). The + * footprint query also returns a flag indicating if the texture lookup would access texels from only one mipmap level or from two neighboring levels.

+ * + *

This extension should be useful for multi-pass rendering operations that do an initial expensive rendering pass to produce a first image that is then + * used as a texture for a second pass. If the second pass ends up accessing only portions of the first image (e.g., due to visibility), the work spent + * rendering the non-accessed portion of the first image was wasted. With this feature, an application can limit this waste using an initial pass over the + * geometry in the second image that performs a footprint query for each visible pixel to determine the set of pixels that it needs from the first image. + * This pass would accumulate an aggregate footprint of all visible pixels into a separate "footprint texture" using shader atomics. Then, when rendering + * the first image, the application can kill all shading work for pixels not in this aggregate footprint.

+ * + *

The implementation of this extension has a number of limitations. The texture footprint query functions are only supported for two- and + * three-dimensional textures ({@link GL11#GL_TEXTURE_2D TEXTURE_2D}, {@link GL12#GL_TEXTURE_3D TEXTURE_3D}). Texture footprint evaluation only supports the {@link GL12#GL_CLAMP_TO_EDGE CLAMP_TO_EDGE} wrap mode; results are undefined + * for all other wrap modes. The implementation supports only a limited set of granularity values and does not support separate coverage information for + * each texel in the original texture.

+ * + *

Requires {@link GL45 OpenGL 4.5}.

+ */ + public final boolean GL_NV_shader_texture_footprint; + /** When true, {@link NVShaderThreadGroup} is supported. */ + public final boolean GL_NV_shader_thread_group; + /** + * When true, the NV_shader_thread_shuffle extension is supported. + * + *

Implementations of the OpenGL Shading Language may, but are not required, to run multiple shader threads for a single stage as a SIMD thread group, + * where individual execution threads are assigned to thread groups in an undefined, implementation-dependent order. This extension provides a set of + * new features to the OpenGL Shading Language to share data between multiple threads within a thread group.

+ * + *

Requires {@link GL43 OpenGL 4.3} and GLSL 4.3.

+ */ + public final boolean GL_NV_shader_thread_shuffle; + /** When true, {@link NVShadingRateImage} is supported. */ + public final boolean GL_NV_shading_rate_image; + /** + * When true, the NV_stereo_view_rendering extension is supported. + * + *

Virtual reality (VR) applications often render a single logical scene from multiple views corresponding to a pair of eyes. The views (eyes) are + * separated by a fixed offset in the X direction.

+ * + *

Traditionally, multiple views are rendered via multiple rendering passes. This is expensive for the GPU because the objects in the scene must be + * transformed, rasterized, shaded, and fragment processed redundantly. This is expensive for the CPU because the scene graph needs to be visited multiple + * times and driver validation happens for each view. Rendering N passes tends to take N times longer than a single pass.

+ * + *

This extension provides a mechanism to render binocular (stereo) views from a single stream of OpenGL rendering commands. Vertex, tessellation, and + * geometry (VTG) shaders can output two positions for each vertex corresponding to the two eye views. A built-in "gl_SecondaryPositionNV" is added to + * specify the second position. The positions from each view may be sent to different viewports and/or layers. A built-in "gl_SecondaryViewportMaskNV[]" + * is also added to specify the viewport mask for the second view. A new layout-qualifier "secondary_view_offset" is added for built-in output "gl_Layer" + * which allows for the geometry from each view to be sent to different layers for rendering.

+ * + *

Requires {@link #GL_NV_viewport_array2 NV_viewport_array2}.

+ */ + public final boolean GL_NV_stereo_view_rendering; + /** When true, {@link NVTexgenReflection} is supported. */ + public final boolean GL_NV_texgen_reflection; + /** When true, {@link NVTextureBarrier} is supported. */ + public final boolean GL_NV_texture_barrier; + /** + * When true, the NV_texture_compression_vtc extension is supported. + * + *

This extension adds support for the VTC 3D texture compression formats, which are analogous to the S3TC texture compression formats, with the addition + * of some retiling in the Z direction. VTC has the same compression ratio as S3TC and uses 4x4x1, 4x4x2, (4x4x3 when non-power-of-two textures are + * supported), or 4x4x4 blocks.

+ */ + public final boolean GL_NV_texture_compression_vtc; + /** When true, {@link NVTextureMultisample} is supported. */ + public final boolean GL_NV_texture_multisample; + /** + * When true, the NV_texture_rectangle_compressed extension is supported. + * + *

This extension allows applications to use compressed texture formats with the {@link GL31#GL_TEXTURE_RECTANGLE TEXTURE_RECTANGLE} texture target, removing an old limitation that + * prohibited such usage globally for rectangle textures.

+ */ + public final boolean GL_NV_texture_rectangle_compressed; + /** When true, {@link NVTransformFeedback} is supported. */ + public final boolean GL_NV_transform_feedback; + /** When true, {@link NVTransformFeedback2} is supported. */ + public final boolean GL_NV_transform_feedback2; + /** When true, {@link NVUniformBufferUnifiedMemory} is supported. */ + public final boolean GL_NV_uniform_buffer_unified_memory; + /** When true, {@link NVVertexArrayRange} is supported. */ + public final boolean GL_NV_vertex_array_range; + /** When true, {@link NVVertexArrayRange2} is supported. */ + public final boolean GL_NV_vertex_array_range2; + /** When true, {@link NVVertexAttribInteger64bit} is supported. */ + public final boolean GL_NV_vertex_attrib_integer_64bit; + /** When true, {@link NVVertexBufferUnifiedMemory} is supported. */ + public final boolean GL_NV_vertex_buffer_unified_memory; + /** + * When true, the NV_viewport_array2 extension is supported. + * + *

This extension provides new support allowing a single primitive to be broadcast to multiple viewports and/or multiple layers. A shader output + * gl_ViewportMask[] is provided, allowing a single primitive to be output to multiple viewports simultaneously. Also, a new shader option is provided to + * control whether the effective viewport index is added into gl_Layer. These capabilities allow a single primitive to be output to multiple layers + * simultaneously.

+ * + *

The gl_ViewportMask[] output is available in vertex, tessellation control, tessellation evaluation, and geometry shaders. gl_ViewportIndex and gl_Layer + * are also made available in all these shader stages. The actual viewport index or mask and render target layer values are taken from the last active + * shader stage from this set of stages.

+ * + *

This extension is a superset of the GL_AMD_vertex_shader_layer and GL_AMD_vertex_shader_viewport_index extensions, and thus those extension strings are + * expected to be exported if GL_NV_viewport_array2 is supported.

+ */ + public final boolean GL_NV_viewport_array2; + /** When true, {@link NVViewportSwizzle} is supported. */ + public final boolean GL_NV_viewport_swizzle; + /** + * When true, the NVX_blend_equation_advanced_multi_draw_buffers extension is supported. + * + *

This extension adds support for using advanced blend equations introduced with {@link NVBlendEquationAdvanced NV_blend_equation_advanced} (and standardized by + * {@link KHRBlendEquationAdvanced KHR_blend_equation_advanced}) in conjunction with multiple draw buffers. The NV_blend_equation_advanced extension supports advanced blending + * equations only when rending to a single color buffer using fragment color zero and throws and {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} error when multiple draw buffers are + * used. This extension removes this restriction.

+ * + *

Requires either {@link NVBlendEquationAdvanced NV_blend_equation_advanced} or {@link KHRBlendEquationAdvanced KHR_blend_equation_advanced}.

+ */ + public final boolean GL_NVX_blend_equation_advanced_multi_draw_buffers; + /** When true, {@link NVXConditionalRender} is supported. */ + public final boolean GL_NVX_conditional_render; + /** When true, {@link NVXGPUMemoryInfo} is supported. */ + public final boolean GL_NVX_gpu_memory_info; + /** When true, {@link NVXGpuMulticast2} is supported. */ + public final boolean GL_NVX_gpu_multicast2; + /** When true, {@link NVXProgressFence} is supported. */ + public final boolean GL_NVX_progress_fence; + /** When true, {@link OVRMultiview} is supported. */ + public final boolean GL_OVR_multiview; + /** + * When true, the OVR_multiview2 extension is supported. + * + *

This extension relaxes the restriction in OVR_multiview that only {@code gl_Position} can depend on {@code ViewID} in the vertex shader. With this + * change, view-dependent outputs like reflection vectors and similar are allowed.

+ * + *

Requires {@link GL30 OpenGL 3.0} and {@link OVRMultiview OVR_multiview}.

+ */ + public final boolean GL_OVR_multiview2; + + /** When true, deprecated functions are not available. */ + public final boolean forwardCompatible; + + /** Off-heap array of the above function addresses. */ + final PointerBuffer addresses; + + GLCapabilities(FunctionProvider provider, Set ext, boolean fc) { + forwardCompatible = fc; + + glAccum = getFunctionAddress(fc, provider, "glAccum"); + glAlphaFunc = getFunctionAddress(fc, provider, "glAlphaFunc"); + glAreTexturesResident = getFunctionAddress(fc, provider, "glAreTexturesResident"); + glArrayElement = getFunctionAddress(fc, provider, "glArrayElement"); + glBegin = getFunctionAddress(fc, provider, "glBegin"); + glBitmap = getFunctionAddress(fc, provider, "glBitmap"); + glCallList = getFunctionAddress(fc, provider, "glCallList"); + glCallLists = getFunctionAddress(fc, provider, "glCallLists"); + glClearAccum = getFunctionAddress(fc, provider, "glClearAccum"); + glClearIndex = getFunctionAddress(fc, provider, "glClearIndex"); + glClipPlane = getFunctionAddress(fc, provider, "glClipPlane"); + glColor3b = getFunctionAddress(fc, provider, "glColor3b"); + glColor3s = getFunctionAddress(fc, provider, "glColor3s"); + glColor3i = getFunctionAddress(fc, provider, "glColor3i"); + glColor3f = getFunctionAddress(fc, provider, "glColor3f"); + glColor3d = getFunctionAddress(fc, provider, "glColor3d"); + glColor3ub = getFunctionAddress(fc, provider, "glColor3ub"); + glColor3us = getFunctionAddress(fc, provider, "glColor3us"); + glColor3ui = getFunctionAddress(fc, provider, "glColor3ui"); + glColor3bv = getFunctionAddress(fc, provider, "glColor3bv"); + glColor3sv = getFunctionAddress(fc, provider, "glColor3sv"); + glColor3iv = getFunctionAddress(fc, provider, "glColor3iv"); + glColor3fv = getFunctionAddress(fc, provider, "glColor3fv"); + glColor3dv = getFunctionAddress(fc, provider, "glColor3dv"); + glColor3ubv = getFunctionAddress(fc, provider, "glColor3ubv"); + glColor3usv = getFunctionAddress(fc, provider, "glColor3usv"); + glColor3uiv = getFunctionAddress(fc, provider, "glColor3uiv"); + glColor4b = getFunctionAddress(fc, provider, "glColor4b"); + glColor4s = getFunctionAddress(fc, provider, "glColor4s"); + glColor4i = getFunctionAddress(fc, provider, "glColor4i"); + glColor4f = getFunctionAddress(fc, provider, "glColor4f"); + glColor4d = getFunctionAddress(fc, provider, "glColor4d"); + glColor4ub = getFunctionAddress(fc, provider, "glColor4ub"); + glColor4us = getFunctionAddress(fc, provider, "glColor4us"); + glColor4ui = getFunctionAddress(fc, provider, "glColor4ui"); + glColor4bv = getFunctionAddress(fc, provider, "glColor4bv"); + glColor4sv = getFunctionAddress(fc, provider, "glColor4sv"); + glColor4iv = getFunctionAddress(fc, provider, "glColor4iv"); + glColor4fv = getFunctionAddress(fc, provider, "glColor4fv"); + glColor4dv = getFunctionAddress(fc, provider, "glColor4dv"); + glColor4ubv = getFunctionAddress(fc, provider, "glColor4ubv"); + glColor4usv = getFunctionAddress(fc, provider, "glColor4usv"); + glColor4uiv = getFunctionAddress(fc, provider, "glColor4uiv"); + glColorMaterial = getFunctionAddress(fc, provider, "glColorMaterial"); + glColorPointer = getFunctionAddress(fc, provider, "glColorPointer"); + glCopyPixels = getFunctionAddress(fc, provider, "glCopyPixels"); + glDeleteLists = getFunctionAddress(fc, provider, "glDeleteLists"); + glDisableClientState = provider.getFunctionAddress("glDisableClientState"); + glDrawPixels = getFunctionAddress(fc, provider, "glDrawPixels"); + glEdgeFlag = getFunctionAddress(fc, provider, "glEdgeFlag"); + glEdgeFlagv = getFunctionAddress(fc, provider, "glEdgeFlagv"); + glEdgeFlagPointer = getFunctionAddress(fc, provider, "glEdgeFlagPointer"); + glEnableClientState = provider.getFunctionAddress("glEnableClientState"); + glEnd = getFunctionAddress(fc, provider, "glEnd"); + glEvalCoord1f = getFunctionAddress(fc, provider, "glEvalCoord1f"); + glEvalCoord1fv = getFunctionAddress(fc, provider, "glEvalCoord1fv"); + glEvalCoord1d = getFunctionAddress(fc, provider, "glEvalCoord1d"); + glEvalCoord1dv = getFunctionAddress(fc, provider, "glEvalCoord1dv"); + glEvalCoord2f = getFunctionAddress(fc, provider, "glEvalCoord2f"); + glEvalCoord2fv = getFunctionAddress(fc, provider, "glEvalCoord2fv"); + glEvalCoord2d = getFunctionAddress(fc, provider, "glEvalCoord2d"); + glEvalCoord2dv = getFunctionAddress(fc, provider, "glEvalCoord2dv"); + glEvalMesh1 = getFunctionAddress(fc, provider, "glEvalMesh1"); + glEvalMesh2 = getFunctionAddress(fc, provider, "glEvalMesh2"); + glEvalPoint1 = getFunctionAddress(fc, provider, "glEvalPoint1"); + glEvalPoint2 = getFunctionAddress(fc, provider, "glEvalPoint2"); + glFeedbackBuffer = getFunctionAddress(fc, provider, "glFeedbackBuffer"); + glFogi = getFunctionAddress(fc, provider, "glFogi"); + glFogiv = getFunctionAddress(fc, provider, "glFogiv"); + glFogf = getFunctionAddress(fc, provider, "glFogf"); + glFogfv = getFunctionAddress(fc, provider, "glFogfv"); + glGenLists = getFunctionAddress(fc, provider, "glGenLists"); + glGetClipPlane = getFunctionAddress(fc, provider, "glGetClipPlane"); + glGetLightiv = getFunctionAddress(fc, provider, "glGetLightiv"); + glGetLightfv = getFunctionAddress(fc, provider, "glGetLightfv"); + glGetMapiv = getFunctionAddress(fc, provider, "glGetMapiv"); + glGetMapfv = getFunctionAddress(fc, provider, "glGetMapfv"); + glGetMapdv = getFunctionAddress(fc, provider, "glGetMapdv"); + glGetMaterialiv = getFunctionAddress(fc, provider, "glGetMaterialiv"); + glGetMaterialfv = getFunctionAddress(fc, provider, "glGetMaterialfv"); + glGetPixelMapfv = getFunctionAddress(fc, provider, "glGetPixelMapfv"); + glGetPixelMapusv = getFunctionAddress(fc, provider, "glGetPixelMapusv"); + glGetPixelMapuiv = getFunctionAddress(fc, provider, "glGetPixelMapuiv"); + glGetPolygonStipple = getFunctionAddress(fc, provider, "glGetPolygonStipple"); + glGetTexEnviv = getFunctionAddress(fc, provider, "glGetTexEnviv"); + glGetTexEnvfv = getFunctionAddress(fc, provider, "glGetTexEnvfv"); + glGetTexGeniv = getFunctionAddress(fc, provider, "glGetTexGeniv"); + glGetTexGenfv = getFunctionAddress(fc, provider, "glGetTexGenfv"); + glGetTexGendv = getFunctionAddress(fc, provider, "glGetTexGendv"); + glIndexi = getFunctionAddress(fc, provider, "glIndexi"); + glIndexub = getFunctionAddress(fc, provider, "glIndexub"); + glIndexs = getFunctionAddress(fc, provider, "glIndexs"); + glIndexf = getFunctionAddress(fc, provider, "glIndexf"); + glIndexd = getFunctionAddress(fc, provider, "glIndexd"); + glIndexiv = getFunctionAddress(fc, provider, "glIndexiv"); + glIndexubv = getFunctionAddress(fc, provider, "glIndexubv"); + glIndexsv = getFunctionAddress(fc, provider, "glIndexsv"); + glIndexfv = getFunctionAddress(fc, provider, "glIndexfv"); + glIndexdv = getFunctionAddress(fc, provider, "glIndexdv"); + glIndexMask = getFunctionAddress(fc, provider, "glIndexMask"); + glIndexPointer = getFunctionAddress(fc, provider, "glIndexPointer"); + glInitNames = getFunctionAddress(fc, provider, "glInitNames"); + glInterleavedArrays = getFunctionAddress(fc, provider, "glInterleavedArrays"); + glIsList = getFunctionAddress(fc, provider, "glIsList"); + glLightModeli = getFunctionAddress(fc, provider, "glLightModeli"); + glLightModelf = getFunctionAddress(fc, provider, "glLightModelf"); + glLightModeliv = getFunctionAddress(fc, provider, "glLightModeliv"); + glLightModelfv = getFunctionAddress(fc, provider, "glLightModelfv"); + glLighti = getFunctionAddress(fc, provider, "glLighti"); + glLightf = getFunctionAddress(fc, provider, "glLightf"); + glLightiv = getFunctionAddress(fc, provider, "glLightiv"); + glLightfv = getFunctionAddress(fc, provider, "glLightfv"); + glLineStipple = getFunctionAddress(fc, provider, "glLineStipple"); + glListBase = getFunctionAddress(fc, provider, "glListBase"); + glLoadMatrixf = getFunctionAddress(fc, provider, "glLoadMatrixf"); + glLoadMatrixd = getFunctionAddress(fc, provider, "glLoadMatrixd"); + glLoadIdentity = getFunctionAddress(fc, provider, "glLoadIdentity"); + glLoadName = getFunctionAddress(fc, provider, "glLoadName"); + glMap1f = getFunctionAddress(fc, provider, "glMap1f"); + glMap1d = getFunctionAddress(fc, provider, "glMap1d"); + glMap2f = getFunctionAddress(fc, provider, "glMap2f"); + glMap2d = getFunctionAddress(fc, provider, "glMap2d"); + glMapGrid1f = getFunctionAddress(fc, provider, "glMapGrid1f"); + glMapGrid1d = getFunctionAddress(fc, provider, "glMapGrid1d"); + glMapGrid2f = getFunctionAddress(fc, provider, "glMapGrid2f"); + glMapGrid2d = getFunctionAddress(fc, provider, "glMapGrid2d"); + glMateriali = getFunctionAddress(fc, provider, "glMateriali"); + glMaterialf = getFunctionAddress(fc, provider, "glMaterialf"); + glMaterialiv = getFunctionAddress(fc, provider, "glMaterialiv"); + glMaterialfv = getFunctionAddress(fc, provider, "glMaterialfv"); + glMatrixMode = getFunctionAddress(fc, provider, "glMatrixMode"); + glMultMatrixf = getFunctionAddress(fc, provider, "glMultMatrixf"); + glMultMatrixd = getFunctionAddress(fc, provider, "glMultMatrixd"); + glFrustum = getFunctionAddress(fc, provider, "glFrustum"); + glNewList = getFunctionAddress(fc, provider, "glNewList"); + glEndList = getFunctionAddress(fc, provider, "glEndList"); + glNormal3f = getFunctionAddress(fc, provider, "glNormal3f"); + glNormal3b = getFunctionAddress(fc, provider, "glNormal3b"); + glNormal3s = getFunctionAddress(fc, provider, "glNormal3s"); + glNormal3i = getFunctionAddress(fc, provider, "glNormal3i"); + glNormal3d = getFunctionAddress(fc, provider, "glNormal3d"); + glNormal3fv = getFunctionAddress(fc, provider, "glNormal3fv"); + glNormal3bv = getFunctionAddress(fc, provider, "glNormal3bv"); + glNormal3sv = getFunctionAddress(fc, provider, "glNormal3sv"); + glNormal3iv = getFunctionAddress(fc, provider, "glNormal3iv"); + glNormal3dv = getFunctionAddress(fc, provider, "glNormal3dv"); + glNormalPointer = getFunctionAddress(fc, provider, "glNormalPointer"); + glOrtho = getFunctionAddress(fc, provider, "glOrtho"); + glPassThrough = getFunctionAddress(fc, provider, "glPassThrough"); + glPixelMapfv = getFunctionAddress(fc, provider, "glPixelMapfv"); + glPixelMapusv = getFunctionAddress(fc, provider, "glPixelMapusv"); + glPixelMapuiv = getFunctionAddress(fc, provider, "glPixelMapuiv"); + glPixelTransferi = getFunctionAddress(fc, provider, "glPixelTransferi"); + glPixelTransferf = getFunctionAddress(fc, provider, "glPixelTransferf"); + glPixelZoom = getFunctionAddress(fc, provider, "glPixelZoom"); + glPolygonStipple = getFunctionAddress(fc, provider, "glPolygonStipple"); + glPushAttrib = getFunctionAddress(fc, provider, "glPushAttrib"); + glPushClientAttrib = getFunctionAddress(fc, provider, "glPushClientAttrib"); + glPopAttrib = getFunctionAddress(fc, provider, "glPopAttrib"); + glPopClientAttrib = getFunctionAddress(fc, provider, "glPopClientAttrib"); + glPopMatrix = getFunctionAddress(fc, provider, "glPopMatrix"); + glPopName = getFunctionAddress(fc, provider, "glPopName"); + glPrioritizeTextures = getFunctionAddress(fc, provider, "glPrioritizeTextures"); + glPushMatrix = getFunctionAddress(fc, provider, "glPushMatrix"); + glPushName = getFunctionAddress(fc, provider, "glPushName"); + glRasterPos2i = getFunctionAddress(fc, provider, "glRasterPos2i"); + glRasterPos2s = getFunctionAddress(fc, provider, "glRasterPos2s"); + glRasterPos2f = getFunctionAddress(fc, provider, "glRasterPos2f"); + glRasterPos2d = getFunctionAddress(fc, provider, "glRasterPos2d"); + glRasterPos2iv = getFunctionAddress(fc, provider, "glRasterPos2iv"); + glRasterPos2sv = getFunctionAddress(fc, provider, "glRasterPos2sv"); + glRasterPos2fv = getFunctionAddress(fc, provider, "glRasterPos2fv"); + glRasterPos2dv = getFunctionAddress(fc, provider, "glRasterPos2dv"); + glRasterPos3i = getFunctionAddress(fc, provider, "glRasterPos3i"); + glRasterPos3s = getFunctionAddress(fc, provider, "glRasterPos3s"); + glRasterPos3f = getFunctionAddress(fc, provider, "glRasterPos3f"); + glRasterPos3d = getFunctionAddress(fc, provider, "glRasterPos3d"); + glRasterPos3iv = getFunctionAddress(fc, provider, "glRasterPos3iv"); + glRasterPos3sv = getFunctionAddress(fc, provider, "glRasterPos3sv"); + glRasterPos3fv = getFunctionAddress(fc, provider, "glRasterPos3fv"); + glRasterPos3dv = getFunctionAddress(fc, provider, "glRasterPos3dv"); + glRasterPos4i = getFunctionAddress(fc, provider, "glRasterPos4i"); + glRasterPos4s = getFunctionAddress(fc, provider, "glRasterPos4s"); + glRasterPos4f = getFunctionAddress(fc, provider, "glRasterPos4f"); + glRasterPos4d = getFunctionAddress(fc, provider, "glRasterPos4d"); + glRasterPos4iv = getFunctionAddress(fc, provider, "glRasterPos4iv"); + glRasterPos4sv = getFunctionAddress(fc, provider, "glRasterPos4sv"); + glRasterPos4fv = getFunctionAddress(fc, provider, "glRasterPos4fv"); + glRasterPos4dv = getFunctionAddress(fc, provider, "glRasterPos4dv"); + glRecti = getFunctionAddress(fc, provider, "glRecti"); + glRects = getFunctionAddress(fc, provider, "glRects"); + glRectf = getFunctionAddress(fc, provider, "glRectf"); + glRectd = getFunctionAddress(fc, provider, "glRectd"); + glRectiv = getFunctionAddress(fc, provider, "glRectiv"); + glRectsv = getFunctionAddress(fc, provider, "glRectsv"); + glRectfv = getFunctionAddress(fc, provider, "glRectfv"); + glRectdv = getFunctionAddress(fc, provider, "glRectdv"); + glRenderMode = getFunctionAddress(fc, provider, "glRenderMode"); + glRotatef = getFunctionAddress(fc, provider, "glRotatef"); + glRotated = getFunctionAddress(fc, provider, "glRotated"); + glScalef = getFunctionAddress(fc, provider, "glScalef"); + glScaled = getFunctionAddress(fc, provider, "glScaled"); + glSelectBuffer = getFunctionAddress(fc, provider, "glSelectBuffer"); + glShadeModel = getFunctionAddress(fc, provider, "glShadeModel"); + glTexCoord1f = getFunctionAddress(fc, provider, "glTexCoord1f"); + glTexCoord1s = getFunctionAddress(fc, provider, "glTexCoord1s"); + glTexCoord1i = getFunctionAddress(fc, provider, "glTexCoord1i"); + glTexCoord1d = getFunctionAddress(fc, provider, "glTexCoord1d"); + glTexCoord1fv = getFunctionAddress(fc, provider, "glTexCoord1fv"); + glTexCoord1sv = getFunctionAddress(fc, provider, "glTexCoord1sv"); + glTexCoord1iv = getFunctionAddress(fc, provider, "glTexCoord1iv"); + glTexCoord1dv = getFunctionAddress(fc, provider, "glTexCoord1dv"); + glTexCoord2f = getFunctionAddress(fc, provider, "glTexCoord2f"); + glTexCoord2s = getFunctionAddress(fc, provider, "glTexCoord2s"); + glTexCoord2i = getFunctionAddress(fc, provider, "glTexCoord2i"); + glTexCoord2d = getFunctionAddress(fc, provider, "glTexCoord2d"); + glTexCoord2fv = getFunctionAddress(fc, provider, "glTexCoord2fv"); + glTexCoord2sv = getFunctionAddress(fc, provider, "glTexCoord2sv"); + glTexCoord2iv = getFunctionAddress(fc, provider, "glTexCoord2iv"); + glTexCoord2dv = getFunctionAddress(fc, provider, "glTexCoord2dv"); + glTexCoord3f = getFunctionAddress(fc, provider, "glTexCoord3f"); + glTexCoord3s = getFunctionAddress(fc, provider, "glTexCoord3s"); + glTexCoord3i = getFunctionAddress(fc, provider, "glTexCoord3i"); + glTexCoord3d = getFunctionAddress(fc, provider, "glTexCoord3d"); + glTexCoord3fv = getFunctionAddress(fc, provider, "glTexCoord3fv"); + glTexCoord3sv = getFunctionAddress(fc, provider, "glTexCoord3sv"); + glTexCoord3iv = getFunctionAddress(fc, provider, "glTexCoord3iv"); + glTexCoord3dv = getFunctionAddress(fc, provider, "glTexCoord3dv"); + glTexCoord4f = getFunctionAddress(fc, provider, "glTexCoord4f"); + glTexCoord4s = getFunctionAddress(fc, provider, "glTexCoord4s"); + glTexCoord4i = getFunctionAddress(fc, provider, "glTexCoord4i"); + glTexCoord4d = getFunctionAddress(fc, provider, "glTexCoord4d"); + glTexCoord4fv = getFunctionAddress(fc, provider, "glTexCoord4fv"); + glTexCoord4sv = getFunctionAddress(fc, provider, "glTexCoord4sv"); + glTexCoord4iv = getFunctionAddress(fc, provider, "glTexCoord4iv"); + glTexCoord4dv = getFunctionAddress(fc, provider, "glTexCoord4dv"); + glTexCoordPointer = getFunctionAddress(fc, provider, "glTexCoordPointer"); + glTexEnvi = getFunctionAddress(fc, provider, "glTexEnvi"); + glTexEnviv = getFunctionAddress(fc, provider, "glTexEnviv"); + glTexEnvf = getFunctionAddress(fc, provider, "glTexEnvf"); + glTexEnvfv = getFunctionAddress(fc, provider, "glTexEnvfv"); + glTexGeni = getFunctionAddress(fc, provider, "glTexGeni"); + glTexGeniv = getFunctionAddress(fc, provider, "glTexGeniv"); + glTexGenf = getFunctionAddress(fc, provider, "glTexGenf"); + glTexGenfv = getFunctionAddress(fc, provider, "glTexGenfv"); + glTexGend = getFunctionAddress(fc, provider, "glTexGend"); + glTexGendv = getFunctionAddress(fc, provider, "glTexGendv"); + glTranslatef = getFunctionAddress(fc, provider, "glTranslatef"); + glTranslated = getFunctionAddress(fc, provider, "glTranslated"); + glVertex2f = getFunctionAddress(fc, provider, "glVertex2f"); + glVertex2s = getFunctionAddress(fc, provider, "glVertex2s"); + glVertex2i = getFunctionAddress(fc, provider, "glVertex2i"); + glVertex2d = getFunctionAddress(fc, provider, "glVertex2d"); + glVertex2fv = getFunctionAddress(fc, provider, "glVertex2fv"); + glVertex2sv = getFunctionAddress(fc, provider, "glVertex2sv"); + glVertex2iv = getFunctionAddress(fc, provider, "glVertex2iv"); + glVertex2dv = getFunctionAddress(fc, provider, "glVertex2dv"); + glVertex3f = getFunctionAddress(fc, provider, "glVertex3f"); + glVertex3s = getFunctionAddress(fc, provider, "glVertex3s"); + glVertex3i = getFunctionAddress(fc, provider, "glVertex3i"); + glVertex3d = getFunctionAddress(fc, provider, "glVertex3d"); + glVertex3fv = getFunctionAddress(fc, provider, "glVertex3fv"); + glVertex3sv = getFunctionAddress(fc, provider, "glVertex3sv"); + glVertex3iv = getFunctionAddress(fc, provider, "glVertex3iv"); + glVertex3dv = getFunctionAddress(fc, provider, "glVertex3dv"); + glVertex4f = getFunctionAddress(fc, provider, "glVertex4f"); + glVertex4s = getFunctionAddress(fc, provider, "glVertex4s"); + glVertex4i = getFunctionAddress(fc, provider, "glVertex4i"); + glVertex4d = getFunctionAddress(fc, provider, "glVertex4d"); + glVertex4fv = getFunctionAddress(fc, provider, "glVertex4fv"); + glVertex4sv = getFunctionAddress(fc, provider, "glVertex4sv"); + glVertex4iv = getFunctionAddress(fc, provider, "glVertex4iv"); + glVertex4dv = getFunctionAddress(fc, provider, "glVertex4dv"); + glVertexPointer = getFunctionAddress(fc, provider, "glVertexPointer"); + glEnable = provider.getFunctionAddress("glEnable"); + glDisable = provider.getFunctionAddress("glDisable"); + glBindTexture = provider.getFunctionAddress("glBindTexture"); + glBlendFunc = provider.getFunctionAddress("glBlendFunc"); + glClear = provider.getFunctionAddress("glClear"); + glClearColor = provider.getFunctionAddress("glClearColor"); + glClearDepth = provider.getFunctionAddress("glClearDepth"); + glClearStencil = provider.getFunctionAddress("glClearStencil"); + glColorMask = provider.getFunctionAddress("glColorMask"); + glCullFace = provider.getFunctionAddress("glCullFace"); + glDepthFunc = provider.getFunctionAddress("glDepthFunc"); + glDepthMask = provider.getFunctionAddress("glDepthMask"); + glDepthRange = provider.getFunctionAddress("glDepthRange"); + glDrawArrays = provider.getFunctionAddress("glDrawArrays"); + glDrawBuffer = provider.getFunctionAddress("glDrawBuffer"); + glDrawElements = provider.getFunctionAddress("glDrawElements"); + glFinish = provider.getFunctionAddress("glFinish"); + glFlush = provider.getFunctionAddress("glFlush"); + glFrontFace = provider.getFunctionAddress("glFrontFace"); + glGenTextures = provider.getFunctionAddress("glGenTextures"); + glDeleteTextures = provider.getFunctionAddress("glDeleteTextures"); + glGetBooleanv = provider.getFunctionAddress("glGetBooleanv"); + glGetFloatv = provider.getFunctionAddress("glGetFloatv"); + glGetIntegerv = provider.getFunctionAddress("glGetIntegerv"); + glGetDoublev = provider.getFunctionAddress("glGetDoublev"); + glGetError = provider.getFunctionAddress("glGetError"); + glGetPointerv = provider.getFunctionAddress("glGetPointerv"); + glGetString = provider.getFunctionAddress("glGetString"); + glGetTexImage = provider.getFunctionAddress("glGetTexImage"); + glGetTexLevelParameteriv = provider.getFunctionAddress("glGetTexLevelParameteriv"); + glGetTexLevelParameterfv = provider.getFunctionAddress("glGetTexLevelParameterfv"); + glGetTexParameteriv = provider.getFunctionAddress("glGetTexParameteriv"); + glGetTexParameterfv = provider.getFunctionAddress("glGetTexParameterfv"); + glHint = provider.getFunctionAddress("glHint"); + glIsEnabled = provider.getFunctionAddress("glIsEnabled"); + glIsTexture = provider.getFunctionAddress("glIsTexture"); + glLineWidth = provider.getFunctionAddress("glLineWidth"); + glLogicOp = provider.getFunctionAddress("glLogicOp"); + glPixelStorei = provider.getFunctionAddress("glPixelStorei"); + glPixelStoref = provider.getFunctionAddress("glPixelStoref"); + glPointSize = provider.getFunctionAddress("glPointSize"); + glPolygonMode = provider.getFunctionAddress("glPolygonMode"); + glPolygonOffset = provider.getFunctionAddress("glPolygonOffset"); + glReadBuffer = provider.getFunctionAddress("glReadBuffer"); + glReadPixels = provider.getFunctionAddress("glReadPixels"); + glScissor = provider.getFunctionAddress("glScissor"); + glStencilFunc = provider.getFunctionAddress("glStencilFunc"); + glStencilMask = provider.getFunctionAddress("glStencilMask"); + glStencilOp = provider.getFunctionAddress("glStencilOp"); + glTexImage1D = provider.getFunctionAddress("glTexImage1D"); + glTexImage2D = provider.getFunctionAddress("glTexImage2D"); + glCopyTexImage1D = provider.getFunctionAddress("glCopyTexImage1D"); + glCopyTexImage2D = provider.getFunctionAddress("glCopyTexImage2D"); + glCopyTexSubImage1D = provider.getFunctionAddress("glCopyTexSubImage1D"); + glCopyTexSubImage2D = provider.getFunctionAddress("glCopyTexSubImage2D"); + glTexParameteri = provider.getFunctionAddress("glTexParameteri"); + glTexParameteriv = provider.getFunctionAddress("glTexParameteriv"); + glTexParameterf = provider.getFunctionAddress("glTexParameterf"); + glTexParameterfv = provider.getFunctionAddress("glTexParameterfv"); + glTexSubImage1D = provider.getFunctionAddress("glTexSubImage1D"); + glTexSubImage2D = provider.getFunctionAddress("glTexSubImage2D"); + glViewport = provider.getFunctionAddress("glViewport"); + glTexImage3D = provider.getFunctionAddress("glTexImage3D"); + glTexSubImage3D = provider.getFunctionAddress("glTexSubImage3D"); + glCopyTexSubImage3D = provider.getFunctionAddress("glCopyTexSubImage3D"); + glDrawRangeElements = provider.getFunctionAddress("glDrawRangeElements"); + glClientActiveTexture = getFunctionAddress(fc, provider, "glClientActiveTexture"); + glMultiTexCoord1f = getFunctionAddress(fc, provider, "glMultiTexCoord1f"); + glMultiTexCoord1s = getFunctionAddress(fc, provider, "glMultiTexCoord1s"); + glMultiTexCoord1i = getFunctionAddress(fc, provider, "glMultiTexCoord1i"); + glMultiTexCoord1d = getFunctionAddress(fc, provider, "glMultiTexCoord1d"); + glMultiTexCoord1fv = getFunctionAddress(fc, provider, "glMultiTexCoord1fv"); + glMultiTexCoord1sv = getFunctionAddress(fc, provider, "glMultiTexCoord1sv"); + glMultiTexCoord1iv = getFunctionAddress(fc, provider, "glMultiTexCoord1iv"); + glMultiTexCoord1dv = getFunctionAddress(fc, provider, "glMultiTexCoord1dv"); + glMultiTexCoord2f = getFunctionAddress(fc, provider, "glMultiTexCoord2f"); + glMultiTexCoord2s = getFunctionAddress(fc, provider, "glMultiTexCoord2s"); + glMultiTexCoord2i = getFunctionAddress(fc, provider, "glMultiTexCoord2i"); + glMultiTexCoord2d = getFunctionAddress(fc, provider, "glMultiTexCoord2d"); + glMultiTexCoord2fv = getFunctionAddress(fc, provider, "glMultiTexCoord2fv"); + glMultiTexCoord2sv = getFunctionAddress(fc, provider, "glMultiTexCoord2sv"); + glMultiTexCoord2iv = getFunctionAddress(fc, provider, "glMultiTexCoord2iv"); + glMultiTexCoord2dv = getFunctionAddress(fc, provider, "glMultiTexCoord2dv"); + glMultiTexCoord3f = getFunctionAddress(fc, provider, "glMultiTexCoord3f"); + glMultiTexCoord3s = getFunctionAddress(fc, provider, "glMultiTexCoord3s"); + glMultiTexCoord3i = getFunctionAddress(fc, provider, "glMultiTexCoord3i"); + glMultiTexCoord3d = getFunctionAddress(fc, provider, "glMultiTexCoord3d"); + glMultiTexCoord3fv = getFunctionAddress(fc, provider, "glMultiTexCoord3fv"); + glMultiTexCoord3sv = getFunctionAddress(fc, provider, "glMultiTexCoord3sv"); + glMultiTexCoord3iv = getFunctionAddress(fc, provider, "glMultiTexCoord3iv"); + glMultiTexCoord3dv = getFunctionAddress(fc, provider, "glMultiTexCoord3dv"); + glMultiTexCoord4f = getFunctionAddress(fc, provider, "glMultiTexCoord4f"); + glMultiTexCoord4s = getFunctionAddress(fc, provider, "glMultiTexCoord4s"); + glMultiTexCoord4i = getFunctionAddress(fc, provider, "glMultiTexCoord4i"); + glMultiTexCoord4d = getFunctionAddress(fc, provider, "glMultiTexCoord4d"); + glMultiTexCoord4fv = getFunctionAddress(fc, provider, "glMultiTexCoord4fv"); + glMultiTexCoord4sv = getFunctionAddress(fc, provider, "glMultiTexCoord4sv"); + glMultiTexCoord4iv = getFunctionAddress(fc, provider, "glMultiTexCoord4iv"); + glMultiTexCoord4dv = getFunctionAddress(fc, provider, "glMultiTexCoord4dv"); + glLoadTransposeMatrixf = getFunctionAddress(fc, provider, "glLoadTransposeMatrixf"); + glLoadTransposeMatrixd = getFunctionAddress(fc, provider, "glLoadTransposeMatrixd"); + glMultTransposeMatrixf = getFunctionAddress(fc, provider, "glMultTransposeMatrixf"); + glMultTransposeMatrixd = getFunctionAddress(fc, provider, "glMultTransposeMatrixd"); + glCompressedTexImage3D = provider.getFunctionAddress("glCompressedTexImage3D"); + glCompressedTexImage2D = provider.getFunctionAddress("glCompressedTexImage2D"); + glCompressedTexImage1D = provider.getFunctionAddress("glCompressedTexImage1D"); + glCompressedTexSubImage3D = provider.getFunctionAddress("glCompressedTexSubImage3D"); + glCompressedTexSubImage2D = provider.getFunctionAddress("glCompressedTexSubImage2D"); + glCompressedTexSubImage1D = provider.getFunctionAddress("glCompressedTexSubImage1D"); + glGetCompressedTexImage = provider.getFunctionAddress("glGetCompressedTexImage"); + glSampleCoverage = provider.getFunctionAddress("glSampleCoverage"); + glActiveTexture = provider.getFunctionAddress("glActiveTexture"); + glFogCoordf = getFunctionAddress(fc, provider, "glFogCoordf"); + glFogCoordd = getFunctionAddress(fc, provider, "glFogCoordd"); + glFogCoordfv = getFunctionAddress(fc, provider, "glFogCoordfv"); + glFogCoorddv = getFunctionAddress(fc, provider, "glFogCoorddv"); + glFogCoordPointer = getFunctionAddress(fc, provider, "glFogCoordPointer"); + glSecondaryColor3b = getFunctionAddress(fc, provider, "glSecondaryColor3b"); + glSecondaryColor3s = getFunctionAddress(fc, provider, "glSecondaryColor3s"); + glSecondaryColor3i = getFunctionAddress(fc, provider, "glSecondaryColor3i"); + glSecondaryColor3f = getFunctionAddress(fc, provider, "glSecondaryColor3f"); + glSecondaryColor3d = getFunctionAddress(fc, provider, "glSecondaryColor3d"); + glSecondaryColor3ub = getFunctionAddress(fc, provider, "glSecondaryColor3ub"); + glSecondaryColor3us = getFunctionAddress(fc, provider, "glSecondaryColor3us"); + glSecondaryColor3ui = getFunctionAddress(fc, provider, "glSecondaryColor3ui"); + glSecondaryColor3bv = getFunctionAddress(fc, provider, "glSecondaryColor3bv"); + glSecondaryColor3sv = getFunctionAddress(fc, provider, "glSecondaryColor3sv"); + glSecondaryColor3iv = getFunctionAddress(fc, provider, "glSecondaryColor3iv"); + glSecondaryColor3fv = getFunctionAddress(fc, provider, "glSecondaryColor3fv"); + glSecondaryColor3dv = getFunctionAddress(fc, provider, "glSecondaryColor3dv"); + glSecondaryColor3ubv = getFunctionAddress(fc, provider, "glSecondaryColor3ubv"); + glSecondaryColor3usv = getFunctionAddress(fc, provider, "glSecondaryColor3usv"); + glSecondaryColor3uiv = getFunctionAddress(fc, provider, "glSecondaryColor3uiv"); + glSecondaryColorPointer = getFunctionAddress(fc, provider, "glSecondaryColorPointer"); + glWindowPos2i = getFunctionAddress(fc, provider, "glWindowPos2i"); + glWindowPos2s = getFunctionAddress(fc, provider, "glWindowPos2s"); + glWindowPos2f = getFunctionAddress(fc, provider, "glWindowPos2f"); + glWindowPos2d = getFunctionAddress(fc, provider, "glWindowPos2d"); + glWindowPos2iv = getFunctionAddress(fc, provider, "glWindowPos2iv"); + glWindowPos2sv = getFunctionAddress(fc, provider, "glWindowPos2sv"); + glWindowPos2fv = getFunctionAddress(fc, provider, "glWindowPos2fv"); + glWindowPos2dv = getFunctionAddress(fc, provider, "glWindowPos2dv"); + glWindowPos3i = getFunctionAddress(fc, provider, "glWindowPos3i"); + glWindowPos3s = getFunctionAddress(fc, provider, "glWindowPos3s"); + glWindowPos3f = getFunctionAddress(fc, provider, "glWindowPos3f"); + glWindowPos3d = getFunctionAddress(fc, provider, "glWindowPos3d"); + glWindowPos3iv = getFunctionAddress(fc, provider, "glWindowPos3iv"); + glWindowPos3sv = getFunctionAddress(fc, provider, "glWindowPos3sv"); + glWindowPos3fv = getFunctionAddress(fc, provider, "glWindowPos3fv"); + glWindowPos3dv = getFunctionAddress(fc, provider, "glWindowPos3dv"); + glBlendColor = provider.getFunctionAddress("glBlendColor"); + glBlendEquation = provider.getFunctionAddress("glBlendEquation"); + glMultiDrawArrays = provider.getFunctionAddress("glMultiDrawArrays"); + glMultiDrawElements = provider.getFunctionAddress("glMultiDrawElements"); + glPointParameterf = provider.getFunctionAddress("glPointParameterf"); + glPointParameteri = provider.getFunctionAddress("glPointParameteri"); + glPointParameterfv = provider.getFunctionAddress("glPointParameterfv"); + glPointParameteriv = provider.getFunctionAddress("glPointParameteriv"); + glBlendFuncSeparate = provider.getFunctionAddress("glBlendFuncSeparate"); + glBindBuffer = provider.getFunctionAddress("glBindBuffer"); + glDeleteBuffers = provider.getFunctionAddress("glDeleteBuffers"); + glGenBuffers = provider.getFunctionAddress("glGenBuffers"); + glIsBuffer = provider.getFunctionAddress("glIsBuffer"); + glBufferData = provider.getFunctionAddress("glBufferData"); + glBufferSubData = provider.getFunctionAddress("glBufferSubData"); + glGetBufferSubData = provider.getFunctionAddress("glGetBufferSubData"); + glMapBuffer = provider.getFunctionAddress("glMapBuffer"); + glUnmapBuffer = provider.getFunctionAddress("glUnmapBuffer"); + glGetBufferParameteriv = provider.getFunctionAddress("glGetBufferParameteriv"); + glGetBufferPointerv = provider.getFunctionAddress("glGetBufferPointerv"); + glGenQueries = provider.getFunctionAddress("glGenQueries"); + glDeleteQueries = provider.getFunctionAddress("glDeleteQueries"); + glIsQuery = provider.getFunctionAddress("glIsQuery"); + glBeginQuery = provider.getFunctionAddress("glBeginQuery"); + glEndQuery = provider.getFunctionAddress("glEndQuery"); + glGetQueryiv = provider.getFunctionAddress("glGetQueryiv"); + glGetQueryObjectiv = provider.getFunctionAddress("glGetQueryObjectiv"); + glGetQueryObjectuiv = provider.getFunctionAddress("glGetQueryObjectuiv"); + glCreateProgram = provider.getFunctionAddress("glCreateProgram"); + glDeleteProgram = provider.getFunctionAddress("glDeleteProgram"); + glIsProgram = provider.getFunctionAddress("glIsProgram"); + glCreateShader = provider.getFunctionAddress("glCreateShader"); + glDeleteShader = provider.getFunctionAddress("glDeleteShader"); + glIsShader = provider.getFunctionAddress("glIsShader"); + glAttachShader = provider.getFunctionAddress("glAttachShader"); + glDetachShader = provider.getFunctionAddress("glDetachShader"); + glShaderSource = provider.getFunctionAddress("glShaderSource"); + glCompileShader = provider.getFunctionAddress("glCompileShader"); + glLinkProgram = provider.getFunctionAddress("glLinkProgram"); + glUseProgram = provider.getFunctionAddress("glUseProgram"); + glValidateProgram = provider.getFunctionAddress("glValidateProgram"); + glUniform1f = provider.getFunctionAddress("glUniform1f"); + glUniform2f = provider.getFunctionAddress("glUniform2f"); + glUniform3f = provider.getFunctionAddress("glUniform3f"); + glUniform4f = provider.getFunctionAddress("glUniform4f"); + glUniform1i = provider.getFunctionAddress("glUniform1i"); + glUniform2i = provider.getFunctionAddress("glUniform2i"); + glUniform3i = provider.getFunctionAddress("glUniform3i"); + glUniform4i = provider.getFunctionAddress("glUniform4i"); + glUniform1fv = provider.getFunctionAddress("glUniform1fv"); + glUniform2fv = provider.getFunctionAddress("glUniform2fv"); + glUniform3fv = provider.getFunctionAddress("glUniform3fv"); + glUniform4fv = provider.getFunctionAddress("glUniform4fv"); + glUniform1iv = provider.getFunctionAddress("glUniform1iv"); + glUniform2iv = provider.getFunctionAddress("glUniform2iv"); + glUniform3iv = provider.getFunctionAddress("glUniform3iv"); + glUniform4iv = provider.getFunctionAddress("glUniform4iv"); + glUniformMatrix2fv = provider.getFunctionAddress("glUniformMatrix2fv"); + glUniformMatrix3fv = provider.getFunctionAddress("glUniformMatrix3fv"); + glUniformMatrix4fv = provider.getFunctionAddress("glUniformMatrix4fv"); + glGetShaderiv = provider.getFunctionAddress("glGetShaderiv"); + glGetProgramiv = provider.getFunctionAddress("glGetProgramiv"); + glGetShaderInfoLog = provider.getFunctionAddress("glGetShaderInfoLog"); + glGetProgramInfoLog = provider.getFunctionAddress("glGetProgramInfoLog"); + glGetAttachedShaders = provider.getFunctionAddress("glGetAttachedShaders"); + glGetUniformLocation = provider.getFunctionAddress("glGetUniformLocation"); + glGetActiveUniform = provider.getFunctionAddress("glGetActiveUniform"); + glGetUniformfv = provider.getFunctionAddress("glGetUniformfv"); + glGetUniformiv = provider.getFunctionAddress("glGetUniformiv"); + glGetShaderSource = provider.getFunctionAddress("glGetShaderSource"); + glVertexAttrib1f = provider.getFunctionAddress("glVertexAttrib1f"); + glVertexAttrib1s = provider.getFunctionAddress("glVertexAttrib1s"); + glVertexAttrib1d = provider.getFunctionAddress("glVertexAttrib1d"); + glVertexAttrib2f = provider.getFunctionAddress("glVertexAttrib2f"); + glVertexAttrib2s = provider.getFunctionAddress("glVertexAttrib2s"); + glVertexAttrib2d = provider.getFunctionAddress("glVertexAttrib2d"); + glVertexAttrib3f = provider.getFunctionAddress("glVertexAttrib3f"); + glVertexAttrib3s = provider.getFunctionAddress("glVertexAttrib3s"); + glVertexAttrib3d = provider.getFunctionAddress("glVertexAttrib3d"); + glVertexAttrib4f = provider.getFunctionAddress("glVertexAttrib4f"); + glVertexAttrib4s = provider.getFunctionAddress("glVertexAttrib4s"); + glVertexAttrib4d = provider.getFunctionAddress("glVertexAttrib4d"); + glVertexAttrib4Nub = provider.getFunctionAddress("glVertexAttrib4Nub"); + glVertexAttrib1fv = provider.getFunctionAddress("glVertexAttrib1fv"); + glVertexAttrib1sv = provider.getFunctionAddress("glVertexAttrib1sv"); + glVertexAttrib1dv = provider.getFunctionAddress("glVertexAttrib1dv"); + glVertexAttrib2fv = provider.getFunctionAddress("glVertexAttrib2fv"); + glVertexAttrib2sv = provider.getFunctionAddress("glVertexAttrib2sv"); + glVertexAttrib2dv = provider.getFunctionAddress("glVertexAttrib2dv"); + glVertexAttrib3fv = provider.getFunctionAddress("glVertexAttrib3fv"); + glVertexAttrib3sv = provider.getFunctionAddress("glVertexAttrib3sv"); + glVertexAttrib3dv = provider.getFunctionAddress("glVertexAttrib3dv"); + glVertexAttrib4fv = provider.getFunctionAddress("glVertexAttrib4fv"); + glVertexAttrib4sv = provider.getFunctionAddress("glVertexAttrib4sv"); + glVertexAttrib4dv = provider.getFunctionAddress("glVertexAttrib4dv"); + glVertexAttrib4iv = provider.getFunctionAddress("glVertexAttrib4iv"); + glVertexAttrib4bv = provider.getFunctionAddress("glVertexAttrib4bv"); + glVertexAttrib4ubv = provider.getFunctionAddress("glVertexAttrib4ubv"); + glVertexAttrib4usv = provider.getFunctionAddress("glVertexAttrib4usv"); + glVertexAttrib4uiv = provider.getFunctionAddress("glVertexAttrib4uiv"); + glVertexAttrib4Nbv = provider.getFunctionAddress("glVertexAttrib4Nbv"); + glVertexAttrib4Nsv = provider.getFunctionAddress("glVertexAttrib4Nsv"); + glVertexAttrib4Niv = provider.getFunctionAddress("glVertexAttrib4Niv"); + glVertexAttrib4Nubv = provider.getFunctionAddress("glVertexAttrib4Nubv"); + glVertexAttrib4Nusv = provider.getFunctionAddress("glVertexAttrib4Nusv"); + glVertexAttrib4Nuiv = provider.getFunctionAddress("glVertexAttrib4Nuiv"); + glVertexAttribPointer = provider.getFunctionAddress("glVertexAttribPointer"); + glEnableVertexAttribArray = provider.getFunctionAddress("glEnableVertexAttribArray"); + glDisableVertexAttribArray = provider.getFunctionAddress("glDisableVertexAttribArray"); + glBindAttribLocation = provider.getFunctionAddress("glBindAttribLocation"); + glGetActiveAttrib = provider.getFunctionAddress("glGetActiveAttrib"); + glGetAttribLocation = provider.getFunctionAddress("glGetAttribLocation"); + glGetVertexAttribiv = provider.getFunctionAddress("glGetVertexAttribiv"); + glGetVertexAttribfv = provider.getFunctionAddress("glGetVertexAttribfv"); + glGetVertexAttribdv = provider.getFunctionAddress("glGetVertexAttribdv"); + glGetVertexAttribPointerv = provider.getFunctionAddress("glGetVertexAttribPointerv"); + glDrawBuffers = provider.getFunctionAddress("glDrawBuffers"); + glBlendEquationSeparate = provider.getFunctionAddress("glBlendEquationSeparate"); + glStencilOpSeparate = provider.getFunctionAddress("glStencilOpSeparate"); + glStencilFuncSeparate = provider.getFunctionAddress("glStencilFuncSeparate"); + glStencilMaskSeparate = provider.getFunctionAddress("glStencilMaskSeparate"); + glUniformMatrix2x3fv = provider.getFunctionAddress("glUniformMatrix2x3fv"); + glUniformMatrix3x2fv = provider.getFunctionAddress("glUniformMatrix3x2fv"); + glUniformMatrix2x4fv = provider.getFunctionAddress("glUniformMatrix2x4fv"); + glUniformMatrix4x2fv = provider.getFunctionAddress("glUniformMatrix4x2fv"); + glUniformMatrix3x4fv = provider.getFunctionAddress("glUniformMatrix3x4fv"); + glUniformMatrix4x3fv = provider.getFunctionAddress("glUniformMatrix4x3fv"); + glGetStringi = provider.getFunctionAddress("glGetStringi"); + glClearBufferiv = provider.getFunctionAddress("glClearBufferiv"); + glClearBufferuiv = provider.getFunctionAddress("glClearBufferuiv"); + glClearBufferfv = provider.getFunctionAddress("glClearBufferfv"); + glClearBufferfi = provider.getFunctionAddress("glClearBufferfi"); + glVertexAttribI1i = provider.getFunctionAddress("glVertexAttribI1i"); + glVertexAttribI2i = provider.getFunctionAddress("glVertexAttribI2i"); + glVertexAttribI3i = provider.getFunctionAddress("glVertexAttribI3i"); + glVertexAttribI4i = provider.getFunctionAddress("glVertexAttribI4i"); + glVertexAttribI1ui = provider.getFunctionAddress("glVertexAttribI1ui"); + glVertexAttribI2ui = provider.getFunctionAddress("glVertexAttribI2ui"); + glVertexAttribI3ui = provider.getFunctionAddress("glVertexAttribI3ui"); + glVertexAttribI4ui = provider.getFunctionAddress("glVertexAttribI4ui"); + glVertexAttribI1iv = provider.getFunctionAddress("glVertexAttribI1iv"); + glVertexAttribI2iv = provider.getFunctionAddress("glVertexAttribI2iv"); + glVertexAttribI3iv = provider.getFunctionAddress("glVertexAttribI3iv"); + glVertexAttribI4iv = provider.getFunctionAddress("glVertexAttribI4iv"); + glVertexAttribI1uiv = provider.getFunctionAddress("glVertexAttribI1uiv"); + glVertexAttribI2uiv = provider.getFunctionAddress("glVertexAttribI2uiv"); + glVertexAttribI3uiv = provider.getFunctionAddress("glVertexAttribI3uiv"); + glVertexAttribI4uiv = provider.getFunctionAddress("glVertexAttribI4uiv"); + glVertexAttribI4bv = provider.getFunctionAddress("glVertexAttribI4bv"); + glVertexAttribI4sv = provider.getFunctionAddress("glVertexAttribI4sv"); + glVertexAttribI4ubv = provider.getFunctionAddress("glVertexAttribI4ubv"); + glVertexAttribI4usv = provider.getFunctionAddress("glVertexAttribI4usv"); + glVertexAttribIPointer = provider.getFunctionAddress("glVertexAttribIPointer"); + glGetVertexAttribIiv = provider.getFunctionAddress("glGetVertexAttribIiv"); + glGetVertexAttribIuiv = provider.getFunctionAddress("glGetVertexAttribIuiv"); + glUniform1ui = provider.getFunctionAddress("glUniform1ui"); + glUniform2ui = provider.getFunctionAddress("glUniform2ui"); + glUniform3ui = provider.getFunctionAddress("glUniform3ui"); + glUniform4ui = provider.getFunctionAddress("glUniform4ui"); + glUniform1uiv = provider.getFunctionAddress("glUniform1uiv"); + glUniform2uiv = provider.getFunctionAddress("glUniform2uiv"); + glUniform3uiv = provider.getFunctionAddress("glUniform3uiv"); + glUniform4uiv = provider.getFunctionAddress("glUniform4uiv"); + glGetUniformuiv = provider.getFunctionAddress("glGetUniformuiv"); + glBindFragDataLocation = provider.getFunctionAddress("glBindFragDataLocation"); + glGetFragDataLocation = provider.getFunctionAddress("glGetFragDataLocation"); + glBeginConditionalRender = provider.getFunctionAddress("glBeginConditionalRender"); + glEndConditionalRender = provider.getFunctionAddress("glEndConditionalRender"); + glMapBufferRange = provider.getFunctionAddress("glMapBufferRange"); + glFlushMappedBufferRange = provider.getFunctionAddress("glFlushMappedBufferRange"); + glClampColor = provider.getFunctionAddress("glClampColor"); + glIsRenderbuffer = provider.getFunctionAddress("glIsRenderbuffer"); + glBindRenderbuffer = provider.getFunctionAddress("glBindRenderbuffer"); + glDeleteRenderbuffers = provider.getFunctionAddress("glDeleteRenderbuffers"); + glGenRenderbuffers = provider.getFunctionAddress("glGenRenderbuffers"); + glRenderbufferStorage = provider.getFunctionAddress("glRenderbufferStorage"); + glRenderbufferStorageMultisample = provider.getFunctionAddress("glRenderbufferStorageMultisample"); + glGetRenderbufferParameteriv = provider.getFunctionAddress("glGetRenderbufferParameteriv"); + glIsFramebuffer = provider.getFunctionAddress("glIsFramebuffer"); + glBindFramebuffer = provider.getFunctionAddress("glBindFramebuffer"); + glDeleteFramebuffers = provider.getFunctionAddress("glDeleteFramebuffers"); + glGenFramebuffers = provider.getFunctionAddress("glGenFramebuffers"); + glCheckFramebufferStatus = provider.getFunctionAddress("glCheckFramebufferStatus"); + glFramebufferTexture1D = provider.getFunctionAddress("glFramebufferTexture1D"); + glFramebufferTexture2D = provider.getFunctionAddress("glFramebufferTexture2D"); + glFramebufferTexture3D = provider.getFunctionAddress("glFramebufferTexture3D"); + glFramebufferTextureLayer = provider.getFunctionAddress("glFramebufferTextureLayer"); + glFramebufferRenderbuffer = provider.getFunctionAddress("glFramebufferRenderbuffer"); + glGetFramebufferAttachmentParameteriv = provider.getFunctionAddress("glGetFramebufferAttachmentParameteriv"); + glBlitFramebuffer = provider.getFunctionAddress("glBlitFramebuffer"); + glGenerateMipmap = provider.getFunctionAddress("glGenerateMipmap"); + glTexParameterIiv = provider.getFunctionAddress("glTexParameterIiv"); + glTexParameterIuiv = provider.getFunctionAddress("glTexParameterIuiv"); + glGetTexParameterIiv = provider.getFunctionAddress("glGetTexParameterIiv"); + glGetTexParameterIuiv = provider.getFunctionAddress("glGetTexParameterIuiv"); + glColorMaski = provider.getFunctionAddress("glColorMaski"); + glGetBooleani_v = provider.getFunctionAddress("glGetBooleani_v"); + glGetIntegeri_v = provider.getFunctionAddress("glGetIntegeri_v"); + glEnablei = provider.getFunctionAddress("glEnablei"); + glDisablei = provider.getFunctionAddress("glDisablei"); + glIsEnabledi = provider.getFunctionAddress("glIsEnabledi"); + glBindBufferRange = provider.getFunctionAddress("glBindBufferRange"); + glBindBufferBase = provider.getFunctionAddress("glBindBufferBase"); + glBeginTransformFeedback = provider.getFunctionAddress("glBeginTransformFeedback"); + glEndTransformFeedback = provider.getFunctionAddress("glEndTransformFeedback"); + glTransformFeedbackVaryings = provider.getFunctionAddress("glTransformFeedbackVaryings"); + glGetTransformFeedbackVarying = provider.getFunctionAddress("glGetTransformFeedbackVarying"); + glBindVertexArray = provider.getFunctionAddress("glBindVertexArray"); + glDeleteVertexArrays = provider.getFunctionAddress("glDeleteVertexArrays"); + glGenVertexArrays = provider.getFunctionAddress("glGenVertexArrays"); + glIsVertexArray = provider.getFunctionAddress("glIsVertexArray"); + glDrawArraysInstanced = provider.getFunctionAddress("glDrawArraysInstanced"); + glDrawElementsInstanced = provider.getFunctionAddress("glDrawElementsInstanced"); + glCopyBufferSubData = provider.getFunctionAddress("glCopyBufferSubData"); + glPrimitiveRestartIndex = provider.getFunctionAddress("glPrimitiveRestartIndex"); + glTexBuffer = provider.getFunctionAddress("glTexBuffer"); + glGetUniformIndices = provider.getFunctionAddress("glGetUniformIndices"); + glGetActiveUniformsiv = provider.getFunctionAddress("glGetActiveUniformsiv"); + glGetActiveUniformName = provider.getFunctionAddress("glGetActiveUniformName"); + glGetUniformBlockIndex = provider.getFunctionAddress("glGetUniformBlockIndex"); + glGetActiveUniformBlockiv = provider.getFunctionAddress("glGetActiveUniformBlockiv"); + glGetActiveUniformBlockName = provider.getFunctionAddress("glGetActiveUniformBlockName"); + glUniformBlockBinding = provider.getFunctionAddress("glUniformBlockBinding"); + glGetBufferParameteri64v = provider.getFunctionAddress("glGetBufferParameteri64v"); + glDrawElementsBaseVertex = provider.getFunctionAddress("glDrawElementsBaseVertex"); + glDrawRangeElementsBaseVertex = provider.getFunctionAddress("glDrawRangeElementsBaseVertex"); + glDrawElementsInstancedBaseVertex = provider.getFunctionAddress("glDrawElementsInstancedBaseVertex"); + glMultiDrawElementsBaseVertex = provider.getFunctionAddress("glMultiDrawElementsBaseVertex"); + glProvokingVertex = provider.getFunctionAddress("glProvokingVertex"); + glTexImage2DMultisample = provider.getFunctionAddress("glTexImage2DMultisample"); + glTexImage3DMultisample = provider.getFunctionAddress("glTexImage3DMultisample"); + glGetMultisamplefv = provider.getFunctionAddress("glGetMultisamplefv"); + glSampleMaski = provider.getFunctionAddress("glSampleMaski"); + glFramebufferTexture = provider.getFunctionAddress("glFramebufferTexture"); + glFenceSync = provider.getFunctionAddress("glFenceSync"); + glIsSync = provider.getFunctionAddress("glIsSync"); + glDeleteSync = provider.getFunctionAddress("glDeleteSync"); + glClientWaitSync = provider.getFunctionAddress("glClientWaitSync"); + glWaitSync = provider.getFunctionAddress("glWaitSync"); + glGetInteger64v = provider.getFunctionAddress("glGetInteger64v"); + glGetInteger64i_v = provider.getFunctionAddress("glGetInteger64i_v"); + glGetSynciv = provider.getFunctionAddress("glGetSynciv"); + glVertexP2ui = getFunctionAddress(fc, provider, "glVertexP2ui"); + glVertexP3ui = getFunctionAddress(fc, provider, "glVertexP3ui"); + glVertexP4ui = getFunctionAddress(fc, provider, "glVertexP4ui"); + glVertexP2uiv = getFunctionAddress(fc, provider, "glVertexP2uiv"); + glVertexP3uiv = getFunctionAddress(fc, provider, "glVertexP3uiv"); + glVertexP4uiv = getFunctionAddress(fc, provider, "glVertexP4uiv"); + glTexCoordP1ui = getFunctionAddress(fc, provider, "glTexCoordP1ui"); + glTexCoordP2ui = getFunctionAddress(fc, provider, "glTexCoordP2ui"); + glTexCoordP3ui = getFunctionAddress(fc, provider, "glTexCoordP3ui"); + glTexCoordP4ui = getFunctionAddress(fc, provider, "glTexCoordP4ui"); + glTexCoordP1uiv = getFunctionAddress(fc, provider, "glTexCoordP1uiv"); + glTexCoordP2uiv = getFunctionAddress(fc, provider, "glTexCoordP2uiv"); + glTexCoordP3uiv = getFunctionAddress(fc, provider, "glTexCoordP3uiv"); + glTexCoordP4uiv = getFunctionAddress(fc, provider, "glTexCoordP4uiv"); + glMultiTexCoordP1ui = getFunctionAddress(fc, provider, "glMultiTexCoordP1ui"); + glMultiTexCoordP2ui = getFunctionAddress(fc, provider, "glMultiTexCoordP2ui"); + glMultiTexCoordP3ui = getFunctionAddress(fc, provider, "glMultiTexCoordP3ui"); + glMultiTexCoordP4ui = getFunctionAddress(fc, provider, "glMultiTexCoordP4ui"); + glMultiTexCoordP1uiv = getFunctionAddress(fc, provider, "glMultiTexCoordP1uiv"); + glMultiTexCoordP2uiv = getFunctionAddress(fc, provider, "glMultiTexCoordP2uiv"); + glMultiTexCoordP3uiv = getFunctionAddress(fc, provider, "glMultiTexCoordP3uiv"); + glMultiTexCoordP4uiv = getFunctionAddress(fc, provider, "glMultiTexCoordP4uiv"); + glNormalP3ui = getFunctionAddress(fc, provider, "glNormalP3ui"); + glNormalP3uiv = getFunctionAddress(fc, provider, "glNormalP3uiv"); + glColorP3ui = getFunctionAddress(fc, provider, "glColorP3ui"); + glColorP4ui = getFunctionAddress(fc, provider, "glColorP4ui"); + glColorP3uiv = getFunctionAddress(fc, provider, "glColorP3uiv"); + glColorP4uiv = getFunctionAddress(fc, provider, "glColorP4uiv"); + glSecondaryColorP3ui = getFunctionAddress(fc, provider, "glSecondaryColorP3ui"); + glSecondaryColorP3uiv = getFunctionAddress(fc, provider, "glSecondaryColorP3uiv"); + glBindFragDataLocationIndexed = provider.getFunctionAddress("glBindFragDataLocationIndexed"); + glGetFragDataIndex = provider.getFunctionAddress("glGetFragDataIndex"); + glGenSamplers = provider.getFunctionAddress("glGenSamplers"); + glDeleteSamplers = provider.getFunctionAddress("glDeleteSamplers"); + glIsSampler = provider.getFunctionAddress("glIsSampler"); + glBindSampler = provider.getFunctionAddress("glBindSampler"); + glSamplerParameteri = provider.getFunctionAddress("glSamplerParameteri"); + glSamplerParameterf = provider.getFunctionAddress("glSamplerParameterf"); + glSamplerParameteriv = provider.getFunctionAddress("glSamplerParameteriv"); + glSamplerParameterfv = provider.getFunctionAddress("glSamplerParameterfv"); + glSamplerParameterIiv = provider.getFunctionAddress("glSamplerParameterIiv"); + glSamplerParameterIuiv = provider.getFunctionAddress("glSamplerParameterIuiv"); + glGetSamplerParameteriv = provider.getFunctionAddress("glGetSamplerParameteriv"); + glGetSamplerParameterfv = provider.getFunctionAddress("glGetSamplerParameterfv"); + glGetSamplerParameterIiv = provider.getFunctionAddress("glGetSamplerParameterIiv"); + glGetSamplerParameterIuiv = provider.getFunctionAddress("glGetSamplerParameterIuiv"); + glQueryCounter = provider.getFunctionAddress("glQueryCounter"); + glGetQueryObjecti64v = provider.getFunctionAddress("glGetQueryObjecti64v"); + glGetQueryObjectui64v = provider.getFunctionAddress("glGetQueryObjectui64v"); + glVertexAttribDivisor = provider.getFunctionAddress("glVertexAttribDivisor"); + glVertexAttribP1ui = provider.getFunctionAddress("glVertexAttribP1ui"); + glVertexAttribP2ui = provider.getFunctionAddress("glVertexAttribP2ui"); + glVertexAttribP3ui = provider.getFunctionAddress("glVertexAttribP3ui"); + glVertexAttribP4ui = provider.getFunctionAddress("glVertexAttribP4ui"); + glVertexAttribP1uiv = provider.getFunctionAddress("glVertexAttribP1uiv"); + glVertexAttribP2uiv = provider.getFunctionAddress("glVertexAttribP2uiv"); + glVertexAttribP3uiv = provider.getFunctionAddress("glVertexAttribP3uiv"); + glVertexAttribP4uiv = provider.getFunctionAddress("glVertexAttribP4uiv"); + glBlendEquationi = provider.getFunctionAddress("glBlendEquationi"); + glBlendEquationSeparatei = provider.getFunctionAddress("glBlendEquationSeparatei"); + glBlendFunci = provider.getFunctionAddress("glBlendFunci"); + glBlendFuncSeparatei = provider.getFunctionAddress("glBlendFuncSeparatei"); + glDrawArraysIndirect = provider.getFunctionAddress("glDrawArraysIndirect"); + glDrawElementsIndirect = provider.getFunctionAddress("glDrawElementsIndirect"); + glUniform1d = provider.getFunctionAddress("glUniform1d"); + glUniform2d = provider.getFunctionAddress("glUniform2d"); + glUniform3d = provider.getFunctionAddress("glUniform3d"); + glUniform4d = provider.getFunctionAddress("glUniform4d"); + glUniform1dv = provider.getFunctionAddress("glUniform1dv"); + glUniform2dv = provider.getFunctionAddress("glUniform2dv"); + glUniform3dv = provider.getFunctionAddress("glUniform3dv"); + glUniform4dv = provider.getFunctionAddress("glUniform4dv"); + glUniformMatrix2dv = provider.getFunctionAddress("glUniformMatrix2dv"); + glUniformMatrix3dv = provider.getFunctionAddress("glUniformMatrix3dv"); + glUniformMatrix4dv = provider.getFunctionAddress("glUniformMatrix4dv"); + glUniformMatrix2x3dv = provider.getFunctionAddress("glUniformMatrix2x3dv"); + glUniformMatrix2x4dv = provider.getFunctionAddress("glUniformMatrix2x4dv"); + glUniformMatrix3x2dv = provider.getFunctionAddress("glUniformMatrix3x2dv"); + glUniformMatrix3x4dv = provider.getFunctionAddress("glUniformMatrix3x4dv"); + glUniformMatrix4x2dv = provider.getFunctionAddress("glUniformMatrix4x2dv"); + glUniformMatrix4x3dv = provider.getFunctionAddress("glUniformMatrix4x3dv"); + glGetUniformdv = provider.getFunctionAddress("glGetUniformdv"); + glMinSampleShading = provider.getFunctionAddress("glMinSampleShading"); + glGetSubroutineUniformLocation = provider.getFunctionAddress("glGetSubroutineUniformLocation"); + glGetSubroutineIndex = provider.getFunctionAddress("glGetSubroutineIndex"); + glGetActiveSubroutineUniformiv = provider.getFunctionAddress("glGetActiveSubroutineUniformiv"); + glGetActiveSubroutineUniformName = provider.getFunctionAddress("glGetActiveSubroutineUniformName"); + glGetActiveSubroutineName = provider.getFunctionAddress("glGetActiveSubroutineName"); + glUniformSubroutinesuiv = provider.getFunctionAddress("glUniformSubroutinesuiv"); + glGetUniformSubroutineuiv = provider.getFunctionAddress("glGetUniformSubroutineuiv"); + glGetProgramStageiv = provider.getFunctionAddress("glGetProgramStageiv"); + glPatchParameteri = provider.getFunctionAddress("glPatchParameteri"); + glPatchParameterfv = provider.getFunctionAddress("glPatchParameterfv"); + glBindTransformFeedback = provider.getFunctionAddress("glBindTransformFeedback"); + glDeleteTransformFeedbacks = provider.getFunctionAddress("glDeleteTransformFeedbacks"); + glGenTransformFeedbacks = provider.getFunctionAddress("glGenTransformFeedbacks"); + glIsTransformFeedback = provider.getFunctionAddress("glIsTransformFeedback"); + glPauseTransformFeedback = provider.getFunctionAddress("glPauseTransformFeedback"); + glResumeTransformFeedback = provider.getFunctionAddress("glResumeTransformFeedback"); + glDrawTransformFeedback = provider.getFunctionAddress("glDrawTransformFeedback"); + glDrawTransformFeedbackStream = provider.getFunctionAddress("glDrawTransformFeedbackStream"); + glBeginQueryIndexed = provider.getFunctionAddress("glBeginQueryIndexed"); + glEndQueryIndexed = provider.getFunctionAddress("glEndQueryIndexed"); + glGetQueryIndexediv = provider.getFunctionAddress("glGetQueryIndexediv"); + glReleaseShaderCompiler = provider.getFunctionAddress("glReleaseShaderCompiler"); + glShaderBinary = provider.getFunctionAddress("glShaderBinary"); + glGetShaderPrecisionFormat = provider.getFunctionAddress("glGetShaderPrecisionFormat"); + glDepthRangef = provider.getFunctionAddress("glDepthRangef"); + glClearDepthf = provider.getFunctionAddress("glClearDepthf"); + glGetProgramBinary = provider.getFunctionAddress("glGetProgramBinary"); + glProgramBinary = provider.getFunctionAddress("glProgramBinary"); + glProgramParameteri = provider.getFunctionAddress("glProgramParameteri"); + glUseProgramStages = provider.getFunctionAddress("glUseProgramStages"); + glActiveShaderProgram = provider.getFunctionAddress("glActiveShaderProgram"); + glCreateShaderProgramv = provider.getFunctionAddress("glCreateShaderProgramv"); + glBindProgramPipeline = provider.getFunctionAddress("glBindProgramPipeline"); + glDeleteProgramPipelines = provider.getFunctionAddress("glDeleteProgramPipelines"); + glGenProgramPipelines = provider.getFunctionAddress("glGenProgramPipelines"); + glIsProgramPipeline = provider.getFunctionAddress("glIsProgramPipeline"); + glGetProgramPipelineiv = provider.getFunctionAddress("glGetProgramPipelineiv"); + glProgramUniform1i = provider.getFunctionAddress("glProgramUniform1i"); + glProgramUniform2i = provider.getFunctionAddress("glProgramUniform2i"); + glProgramUniform3i = provider.getFunctionAddress("glProgramUniform3i"); + glProgramUniform4i = provider.getFunctionAddress("glProgramUniform4i"); + glProgramUniform1ui = provider.getFunctionAddress("glProgramUniform1ui"); + glProgramUniform2ui = provider.getFunctionAddress("glProgramUniform2ui"); + glProgramUniform3ui = provider.getFunctionAddress("glProgramUniform3ui"); + glProgramUniform4ui = provider.getFunctionAddress("glProgramUniform4ui"); + glProgramUniform1f = provider.getFunctionAddress("glProgramUniform1f"); + glProgramUniform2f = provider.getFunctionAddress("glProgramUniform2f"); + glProgramUniform3f = provider.getFunctionAddress("glProgramUniform3f"); + glProgramUniform4f = provider.getFunctionAddress("glProgramUniform4f"); + glProgramUniform1d = provider.getFunctionAddress("glProgramUniform1d"); + glProgramUniform2d = provider.getFunctionAddress("glProgramUniform2d"); + glProgramUniform3d = provider.getFunctionAddress("glProgramUniform3d"); + glProgramUniform4d = provider.getFunctionAddress("glProgramUniform4d"); + glProgramUniform1iv = provider.getFunctionAddress("glProgramUniform1iv"); + glProgramUniform2iv = provider.getFunctionAddress("glProgramUniform2iv"); + glProgramUniform3iv = provider.getFunctionAddress("glProgramUniform3iv"); + glProgramUniform4iv = provider.getFunctionAddress("glProgramUniform4iv"); + glProgramUniform1uiv = provider.getFunctionAddress("glProgramUniform1uiv"); + glProgramUniform2uiv = provider.getFunctionAddress("glProgramUniform2uiv"); + glProgramUniform3uiv = provider.getFunctionAddress("glProgramUniform3uiv"); + glProgramUniform4uiv = provider.getFunctionAddress("glProgramUniform4uiv"); + glProgramUniform1fv = provider.getFunctionAddress("glProgramUniform1fv"); + glProgramUniform2fv = provider.getFunctionAddress("glProgramUniform2fv"); + glProgramUniform3fv = provider.getFunctionAddress("glProgramUniform3fv"); + glProgramUniform4fv = provider.getFunctionAddress("glProgramUniform4fv"); + glProgramUniform1dv = provider.getFunctionAddress("glProgramUniform1dv"); + glProgramUniform2dv = provider.getFunctionAddress("glProgramUniform2dv"); + glProgramUniform3dv = provider.getFunctionAddress("glProgramUniform3dv"); + glProgramUniform4dv = provider.getFunctionAddress("glProgramUniform4dv"); + glProgramUniformMatrix2fv = provider.getFunctionAddress("glProgramUniformMatrix2fv"); + glProgramUniformMatrix3fv = provider.getFunctionAddress("glProgramUniformMatrix3fv"); + glProgramUniformMatrix4fv = provider.getFunctionAddress("glProgramUniformMatrix4fv"); + glProgramUniformMatrix2dv = provider.getFunctionAddress("glProgramUniformMatrix2dv"); + glProgramUniformMatrix3dv = provider.getFunctionAddress("glProgramUniformMatrix3dv"); + glProgramUniformMatrix4dv = provider.getFunctionAddress("glProgramUniformMatrix4dv"); + glProgramUniformMatrix2x3fv = provider.getFunctionAddress("glProgramUniformMatrix2x3fv"); + glProgramUniformMatrix3x2fv = provider.getFunctionAddress("glProgramUniformMatrix3x2fv"); + glProgramUniformMatrix2x4fv = provider.getFunctionAddress("glProgramUniformMatrix2x4fv"); + glProgramUniformMatrix4x2fv = provider.getFunctionAddress("glProgramUniformMatrix4x2fv"); + glProgramUniformMatrix3x4fv = provider.getFunctionAddress("glProgramUniformMatrix3x4fv"); + glProgramUniformMatrix4x3fv = provider.getFunctionAddress("glProgramUniformMatrix4x3fv"); + glProgramUniformMatrix2x3dv = provider.getFunctionAddress("glProgramUniformMatrix2x3dv"); + glProgramUniformMatrix3x2dv = provider.getFunctionAddress("glProgramUniformMatrix3x2dv"); + glProgramUniformMatrix2x4dv = provider.getFunctionAddress("glProgramUniformMatrix2x4dv"); + glProgramUniformMatrix4x2dv = provider.getFunctionAddress("glProgramUniformMatrix4x2dv"); + glProgramUniformMatrix3x4dv = provider.getFunctionAddress("glProgramUniformMatrix3x4dv"); + glProgramUniformMatrix4x3dv = provider.getFunctionAddress("glProgramUniformMatrix4x3dv"); + glValidateProgramPipeline = provider.getFunctionAddress("glValidateProgramPipeline"); + glGetProgramPipelineInfoLog = provider.getFunctionAddress("glGetProgramPipelineInfoLog"); + glVertexAttribL1d = provider.getFunctionAddress("glVertexAttribL1d"); + glVertexAttribL2d = provider.getFunctionAddress("glVertexAttribL2d"); + glVertexAttribL3d = provider.getFunctionAddress("glVertexAttribL3d"); + glVertexAttribL4d = provider.getFunctionAddress("glVertexAttribL4d"); + glVertexAttribL1dv = provider.getFunctionAddress("glVertexAttribL1dv"); + glVertexAttribL2dv = provider.getFunctionAddress("glVertexAttribL2dv"); + glVertexAttribL3dv = provider.getFunctionAddress("glVertexAttribL3dv"); + glVertexAttribL4dv = provider.getFunctionAddress("glVertexAttribL4dv"); + glVertexAttribLPointer = provider.getFunctionAddress("glVertexAttribLPointer"); + glGetVertexAttribLdv = provider.getFunctionAddress("glGetVertexAttribLdv"); + glViewportArrayv = provider.getFunctionAddress("glViewportArrayv"); + glViewportIndexedf = provider.getFunctionAddress("glViewportIndexedf"); + glViewportIndexedfv = provider.getFunctionAddress("glViewportIndexedfv"); + glScissorArrayv = provider.getFunctionAddress("glScissorArrayv"); + glScissorIndexed = provider.getFunctionAddress("glScissorIndexed"); + glScissorIndexedv = provider.getFunctionAddress("glScissorIndexedv"); + glDepthRangeArrayv = provider.getFunctionAddress("glDepthRangeArrayv"); + glDepthRangeIndexed = provider.getFunctionAddress("glDepthRangeIndexed"); + glGetFloati_v = provider.getFunctionAddress("glGetFloati_v"); + glGetDoublei_v = provider.getFunctionAddress("glGetDoublei_v"); + glGetActiveAtomicCounterBufferiv = provider.getFunctionAddress("glGetActiveAtomicCounterBufferiv"); + glTexStorage1D = provider.getFunctionAddress("glTexStorage1D"); + glTexStorage2D = provider.getFunctionAddress("glTexStorage2D"); + glTexStorage3D = provider.getFunctionAddress("glTexStorage3D"); + glDrawTransformFeedbackInstanced = provider.getFunctionAddress("glDrawTransformFeedbackInstanced"); + glDrawTransformFeedbackStreamInstanced = provider.getFunctionAddress("glDrawTransformFeedbackStreamInstanced"); + glDrawArraysInstancedBaseInstance = provider.getFunctionAddress("glDrawArraysInstancedBaseInstance"); + glDrawElementsInstancedBaseInstance = provider.getFunctionAddress("glDrawElementsInstancedBaseInstance"); + glDrawElementsInstancedBaseVertexBaseInstance = provider.getFunctionAddress("glDrawElementsInstancedBaseVertexBaseInstance"); + glBindImageTexture = provider.getFunctionAddress("glBindImageTexture"); + glMemoryBarrier = provider.getFunctionAddress("glMemoryBarrier"); + glGetInternalformativ = provider.getFunctionAddress("glGetInternalformativ"); + glClearBufferData = provider.getFunctionAddress("glClearBufferData"); + glClearBufferSubData = provider.getFunctionAddress("glClearBufferSubData"); + glDispatchCompute = provider.getFunctionAddress("glDispatchCompute"); + glDispatchComputeIndirect = provider.getFunctionAddress("glDispatchComputeIndirect"); + glCopyImageSubData = provider.getFunctionAddress("glCopyImageSubData"); + glDebugMessageControl = provider.getFunctionAddress("glDebugMessageControl"); + glDebugMessageInsert = provider.getFunctionAddress("glDebugMessageInsert"); + glDebugMessageCallback = provider.getFunctionAddress("glDebugMessageCallback"); + glGetDebugMessageLog = provider.getFunctionAddress("glGetDebugMessageLog"); + glPushDebugGroup = provider.getFunctionAddress("glPushDebugGroup"); + glPopDebugGroup = provider.getFunctionAddress("glPopDebugGroup"); + glObjectLabel = provider.getFunctionAddress("glObjectLabel"); + glGetObjectLabel = provider.getFunctionAddress("glGetObjectLabel"); + glObjectPtrLabel = provider.getFunctionAddress("glObjectPtrLabel"); + glGetObjectPtrLabel = provider.getFunctionAddress("glGetObjectPtrLabel"); + glFramebufferParameteri = provider.getFunctionAddress("glFramebufferParameteri"); + glGetFramebufferParameteriv = provider.getFunctionAddress("glGetFramebufferParameteriv"); + glGetInternalformati64v = provider.getFunctionAddress("glGetInternalformati64v"); + glInvalidateTexSubImage = provider.getFunctionAddress("glInvalidateTexSubImage"); + glInvalidateTexImage = provider.getFunctionAddress("glInvalidateTexImage"); + glInvalidateBufferSubData = provider.getFunctionAddress("glInvalidateBufferSubData"); + glInvalidateBufferData = provider.getFunctionAddress("glInvalidateBufferData"); + glInvalidateFramebuffer = provider.getFunctionAddress("glInvalidateFramebuffer"); + glInvalidateSubFramebuffer = provider.getFunctionAddress("glInvalidateSubFramebuffer"); + glMultiDrawArraysIndirect = provider.getFunctionAddress("glMultiDrawArraysIndirect"); + glMultiDrawElementsIndirect = provider.getFunctionAddress("glMultiDrawElementsIndirect"); + glGetProgramInterfaceiv = provider.getFunctionAddress("glGetProgramInterfaceiv"); + glGetProgramResourceIndex = provider.getFunctionAddress("glGetProgramResourceIndex"); + glGetProgramResourceName = provider.getFunctionAddress("glGetProgramResourceName"); + glGetProgramResourceiv = provider.getFunctionAddress("glGetProgramResourceiv"); + glGetProgramResourceLocation = provider.getFunctionAddress("glGetProgramResourceLocation"); + glGetProgramResourceLocationIndex = provider.getFunctionAddress("glGetProgramResourceLocationIndex"); + glShaderStorageBlockBinding = provider.getFunctionAddress("glShaderStorageBlockBinding"); + glTexBufferRange = provider.getFunctionAddress("glTexBufferRange"); + glTexStorage2DMultisample = provider.getFunctionAddress("glTexStorage2DMultisample"); + glTexStorage3DMultisample = provider.getFunctionAddress("glTexStorage3DMultisample"); + glTextureView = provider.getFunctionAddress("glTextureView"); + glBindVertexBuffer = provider.getFunctionAddress("glBindVertexBuffer"); + glVertexAttribFormat = provider.getFunctionAddress("glVertexAttribFormat"); + glVertexAttribIFormat = provider.getFunctionAddress("glVertexAttribIFormat"); + glVertexAttribLFormat = provider.getFunctionAddress("glVertexAttribLFormat"); + glVertexAttribBinding = provider.getFunctionAddress("glVertexAttribBinding"); + glVertexBindingDivisor = provider.getFunctionAddress("glVertexBindingDivisor"); + glBufferStorage = provider.getFunctionAddress("glBufferStorage"); + glClearTexSubImage = provider.getFunctionAddress("glClearTexSubImage"); + glClearTexImage = provider.getFunctionAddress("glClearTexImage"); + glBindBuffersBase = provider.getFunctionAddress("glBindBuffersBase"); + glBindBuffersRange = provider.getFunctionAddress("glBindBuffersRange"); + glBindTextures = provider.getFunctionAddress("glBindTextures"); + glBindSamplers = provider.getFunctionAddress("glBindSamplers"); + glBindImageTextures = provider.getFunctionAddress("glBindImageTextures"); + glBindVertexBuffers = provider.getFunctionAddress("glBindVertexBuffers"); + glGetnMapdv = provider.getFunctionAddress("glGetnMapdv"); + glGetnMapfv = provider.getFunctionAddress("glGetnMapfv"); + glGetnMapiv = provider.getFunctionAddress("glGetnMapiv"); + glGetnPixelMapfv = provider.getFunctionAddress("glGetnPixelMapfv"); + glGetnPixelMapuiv = provider.getFunctionAddress("glGetnPixelMapuiv"); + glGetnPixelMapusv = provider.getFunctionAddress("glGetnPixelMapusv"); + glGetnPolygonStipple = provider.getFunctionAddress("glGetnPolygonStipple"); + glGetnColorTable = provider.getFunctionAddress("glGetnColorTable"); + glGetnConvolutionFilter = provider.getFunctionAddress("glGetnConvolutionFilter"); + glGetnSeparableFilter = provider.getFunctionAddress("glGetnSeparableFilter"); + glGetnHistogram = provider.getFunctionAddress("glGetnHistogram"); + glGetnMinmax = provider.getFunctionAddress("glGetnMinmax"); + glClipControl = provider.getFunctionAddress("glClipControl"); + glCreateTransformFeedbacks = provider.getFunctionAddress("glCreateTransformFeedbacks"); + glTransformFeedbackBufferBase = provider.getFunctionAddress("glTransformFeedbackBufferBase"); + glTransformFeedbackBufferRange = provider.getFunctionAddress("glTransformFeedbackBufferRange"); + glGetTransformFeedbackiv = provider.getFunctionAddress("glGetTransformFeedbackiv"); + glGetTransformFeedbacki_v = provider.getFunctionAddress("glGetTransformFeedbacki_v"); + glGetTransformFeedbacki64_v = provider.getFunctionAddress("glGetTransformFeedbacki64_v"); + glCreateBuffers = provider.getFunctionAddress("glCreateBuffers"); + glNamedBufferStorage = provider.getFunctionAddress("glNamedBufferStorage"); + glNamedBufferData = provider.getFunctionAddress("glNamedBufferData"); + glNamedBufferSubData = provider.getFunctionAddress("glNamedBufferSubData"); + glCopyNamedBufferSubData = provider.getFunctionAddress("glCopyNamedBufferSubData"); + glClearNamedBufferData = provider.getFunctionAddress("glClearNamedBufferData"); + glClearNamedBufferSubData = provider.getFunctionAddress("glClearNamedBufferSubData"); + glMapNamedBuffer = provider.getFunctionAddress("glMapNamedBuffer"); + glMapNamedBufferRange = provider.getFunctionAddress("glMapNamedBufferRange"); + glUnmapNamedBuffer = provider.getFunctionAddress("glUnmapNamedBuffer"); + glFlushMappedNamedBufferRange = provider.getFunctionAddress("glFlushMappedNamedBufferRange"); + glGetNamedBufferParameteriv = provider.getFunctionAddress("glGetNamedBufferParameteriv"); + glGetNamedBufferParameteri64v = provider.getFunctionAddress("glGetNamedBufferParameteri64v"); + glGetNamedBufferPointerv = provider.getFunctionAddress("glGetNamedBufferPointerv"); + glGetNamedBufferSubData = provider.getFunctionAddress("glGetNamedBufferSubData"); + glCreateFramebuffers = provider.getFunctionAddress("glCreateFramebuffers"); + glNamedFramebufferRenderbuffer = provider.getFunctionAddress("glNamedFramebufferRenderbuffer"); + glNamedFramebufferParameteri = provider.getFunctionAddress("glNamedFramebufferParameteri"); + glNamedFramebufferTexture = provider.getFunctionAddress("glNamedFramebufferTexture"); + glNamedFramebufferTextureLayer = provider.getFunctionAddress("glNamedFramebufferTextureLayer"); + glNamedFramebufferDrawBuffer = provider.getFunctionAddress("glNamedFramebufferDrawBuffer"); + glNamedFramebufferDrawBuffers = provider.getFunctionAddress("glNamedFramebufferDrawBuffers"); + glNamedFramebufferReadBuffer = provider.getFunctionAddress("glNamedFramebufferReadBuffer"); + glInvalidateNamedFramebufferData = provider.getFunctionAddress("glInvalidateNamedFramebufferData"); + glInvalidateNamedFramebufferSubData = provider.getFunctionAddress("glInvalidateNamedFramebufferSubData"); + glClearNamedFramebufferiv = provider.getFunctionAddress("glClearNamedFramebufferiv"); + glClearNamedFramebufferuiv = provider.getFunctionAddress("glClearNamedFramebufferuiv"); + glClearNamedFramebufferfv = provider.getFunctionAddress("glClearNamedFramebufferfv"); + glClearNamedFramebufferfi = provider.getFunctionAddress("glClearNamedFramebufferfi"); + glBlitNamedFramebuffer = provider.getFunctionAddress("glBlitNamedFramebuffer"); + glCheckNamedFramebufferStatus = provider.getFunctionAddress("glCheckNamedFramebufferStatus"); + glGetNamedFramebufferParameteriv = provider.getFunctionAddress("glGetNamedFramebufferParameteriv"); + glGetNamedFramebufferAttachmentParameteriv = provider.getFunctionAddress("glGetNamedFramebufferAttachmentParameteriv"); + glCreateRenderbuffers = provider.getFunctionAddress("glCreateRenderbuffers"); + glNamedRenderbufferStorage = provider.getFunctionAddress("glNamedRenderbufferStorage"); + glNamedRenderbufferStorageMultisample = provider.getFunctionAddress("glNamedRenderbufferStorageMultisample"); + glGetNamedRenderbufferParameteriv = provider.getFunctionAddress("glGetNamedRenderbufferParameteriv"); + glCreateTextures = provider.getFunctionAddress("glCreateTextures"); + glTextureBuffer = provider.getFunctionAddress("glTextureBuffer"); + glTextureBufferRange = provider.getFunctionAddress("glTextureBufferRange"); + glTextureStorage1D = provider.getFunctionAddress("glTextureStorage1D"); + glTextureStorage2D = provider.getFunctionAddress("glTextureStorage2D"); + glTextureStorage3D = provider.getFunctionAddress("glTextureStorage3D"); + glTextureStorage2DMultisample = provider.getFunctionAddress("glTextureStorage2DMultisample"); + glTextureStorage3DMultisample = provider.getFunctionAddress("glTextureStorage3DMultisample"); + glTextureSubImage1D = provider.getFunctionAddress("glTextureSubImage1D"); + glTextureSubImage2D = provider.getFunctionAddress("glTextureSubImage2D"); + glTextureSubImage3D = provider.getFunctionAddress("glTextureSubImage3D"); + glCompressedTextureSubImage1D = provider.getFunctionAddress("glCompressedTextureSubImage1D"); + glCompressedTextureSubImage2D = provider.getFunctionAddress("glCompressedTextureSubImage2D"); + glCompressedTextureSubImage3D = provider.getFunctionAddress("glCompressedTextureSubImage3D"); + glCopyTextureSubImage1D = provider.getFunctionAddress("glCopyTextureSubImage1D"); + glCopyTextureSubImage2D = provider.getFunctionAddress("glCopyTextureSubImage2D"); + glCopyTextureSubImage3D = provider.getFunctionAddress("glCopyTextureSubImage3D"); + glTextureParameterf = provider.getFunctionAddress("glTextureParameterf"); + glTextureParameterfv = provider.getFunctionAddress("glTextureParameterfv"); + glTextureParameteri = provider.getFunctionAddress("glTextureParameteri"); + glTextureParameterIiv = provider.getFunctionAddress("glTextureParameterIiv"); + glTextureParameterIuiv = provider.getFunctionAddress("glTextureParameterIuiv"); + glTextureParameteriv = provider.getFunctionAddress("glTextureParameteriv"); + glGenerateTextureMipmap = provider.getFunctionAddress("glGenerateTextureMipmap"); + glBindTextureUnit = provider.getFunctionAddress("glBindTextureUnit"); + glGetTextureImage = provider.getFunctionAddress("glGetTextureImage"); + glGetCompressedTextureImage = provider.getFunctionAddress("glGetCompressedTextureImage"); + glGetTextureLevelParameterfv = provider.getFunctionAddress("glGetTextureLevelParameterfv"); + glGetTextureLevelParameteriv = provider.getFunctionAddress("glGetTextureLevelParameteriv"); + glGetTextureParameterfv = provider.getFunctionAddress("glGetTextureParameterfv"); + glGetTextureParameterIiv = provider.getFunctionAddress("glGetTextureParameterIiv"); + glGetTextureParameterIuiv = provider.getFunctionAddress("glGetTextureParameterIuiv"); + glGetTextureParameteriv = provider.getFunctionAddress("glGetTextureParameteriv"); + glCreateVertexArrays = provider.getFunctionAddress("glCreateVertexArrays"); + glDisableVertexArrayAttrib = provider.getFunctionAddress("glDisableVertexArrayAttrib"); + glEnableVertexArrayAttrib = provider.getFunctionAddress("glEnableVertexArrayAttrib"); + glVertexArrayElementBuffer = provider.getFunctionAddress("glVertexArrayElementBuffer"); + glVertexArrayVertexBuffer = provider.getFunctionAddress("glVertexArrayVertexBuffer"); + glVertexArrayVertexBuffers = provider.getFunctionAddress("glVertexArrayVertexBuffers"); + glVertexArrayAttribFormat = provider.getFunctionAddress("glVertexArrayAttribFormat"); + glVertexArrayAttribIFormat = provider.getFunctionAddress("glVertexArrayAttribIFormat"); + glVertexArrayAttribLFormat = provider.getFunctionAddress("glVertexArrayAttribLFormat"); + glVertexArrayAttribBinding = provider.getFunctionAddress("glVertexArrayAttribBinding"); + glVertexArrayBindingDivisor = provider.getFunctionAddress("glVertexArrayBindingDivisor"); + glGetVertexArrayiv = provider.getFunctionAddress("glGetVertexArrayiv"); + glGetVertexArrayIndexediv = provider.getFunctionAddress("glGetVertexArrayIndexediv"); + glGetVertexArrayIndexed64iv = provider.getFunctionAddress("glGetVertexArrayIndexed64iv"); + glCreateSamplers = provider.getFunctionAddress("glCreateSamplers"); + glCreateProgramPipelines = provider.getFunctionAddress("glCreateProgramPipelines"); + glCreateQueries = provider.getFunctionAddress("glCreateQueries"); + glGetQueryBufferObjectiv = provider.getFunctionAddress("glGetQueryBufferObjectiv"); + glGetQueryBufferObjectuiv = provider.getFunctionAddress("glGetQueryBufferObjectuiv"); + glGetQueryBufferObjecti64v = provider.getFunctionAddress("glGetQueryBufferObjecti64v"); + glGetQueryBufferObjectui64v = provider.getFunctionAddress("glGetQueryBufferObjectui64v"); + glMemoryBarrierByRegion = provider.getFunctionAddress("glMemoryBarrierByRegion"); + glGetTextureSubImage = provider.getFunctionAddress("glGetTextureSubImage"); + glGetCompressedTextureSubImage = provider.getFunctionAddress("glGetCompressedTextureSubImage"); + glTextureBarrier = provider.getFunctionAddress("glTextureBarrier"); + glGetGraphicsResetStatus = provider.getFunctionAddress("glGetGraphicsResetStatus"); + glGetnTexImage = provider.getFunctionAddress("glGetnTexImage"); + glReadnPixels = provider.getFunctionAddress("glReadnPixels"); + glGetnCompressedTexImage = provider.getFunctionAddress("glGetnCompressedTexImage"); + glGetnUniformfv = provider.getFunctionAddress("glGetnUniformfv"); + glGetnUniformdv = provider.getFunctionAddress("glGetnUniformdv"); + glGetnUniformiv = provider.getFunctionAddress("glGetnUniformiv"); + glGetnUniformuiv = provider.getFunctionAddress("glGetnUniformuiv"); + glMultiDrawArraysIndirectCount = provider.getFunctionAddress("glMultiDrawArraysIndirectCount"); + glMultiDrawElementsIndirectCount = provider.getFunctionAddress("glMultiDrawElementsIndirectCount"); + glPolygonOffsetClamp = provider.getFunctionAddress("glPolygonOffsetClamp"); + glSpecializeShader = provider.getFunctionAddress("glSpecializeShader"); + glDebugMessageEnableAMD = provider.getFunctionAddress("glDebugMessageEnableAMD"); + glDebugMessageInsertAMD = provider.getFunctionAddress("glDebugMessageInsertAMD"); + glDebugMessageCallbackAMD = provider.getFunctionAddress("glDebugMessageCallbackAMD"); + glGetDebugMessageLogAMD = provider.getFunctionAddress("glGetDebugMessageLogAMD"); + glBlendFuncIndexedAMD = provider.getFunctionAddress("glBlendFuncIndexedAMD"); + glBlendFuncSeparateIndexedAMD = provider.getFunctionAddress("glBlendFuncSeparateIndexedAMD"); + glBlendEquationIndexedAMD = provider.getFunctionAddress("glBlendEquationIndexedAMD"); + glBlendEquationSeparateIndexedAMD = provider.getFunctionAddress("glBlendEquationSeparateIndexedAMD"); + glRenderbufferStorageMultisampleAdvancedAMD = provider.getFunctionAddress("glRenderbufferStorageMultisampleAdvancedAMD"); + glNamedRenderbufferStorageMultisampleAdvancedAMD = provider.getFunctionAddress("glNamedRenderbufferStorageMultisampleAdvancedAMD"); + glVertexAttribParameteriAMD = provider.getFunctionAddress("glVertexAttribParameteriAMD"); + glQueryObjectParameteruiAMD = provider.getFunctionAddress("glQueryObjectParameteruiAMD"); + glGetPerfMonitorGroupsAMD = provider.getFunctionAddress("glGetPerfMonitorGroupsAMD"); + glGetPerfMonitorCountersAMD = provider.getFunctionAddress("glGetPerfMonitorCountersAMD"); + glGetPerfMonitorGroupStringAMD = provider.getFunctionAddress("glGetPerfMonitorGroupStringAMD"); + glGetPerfMonitorCounterStringAMD = provider.getFunctionAddress("glGetPerfMonitorCounterStringAMD"); + glGetPerfMonitorCounterInfoAMD = provider.getFunctionAddress("glGetPerfMonitorCounterInfoAMD"); + glGenPerfMonitorsAMD = provider.getFunctionAddress("glGenPerfMonitorsAMD"); + glDeletePerfMonitorsAMD = provider.getFunctionAddress("glDeletePerfMonitorsAMD"); + glSelectPerfMonitorCountersAMD = provider.getFunctionAddress("glSelectPerfMonitorCountersAMD"); + glBeginPerfMonitorAMD = provider.getFunctionAddress("glBeginPerfMonitorAMD"); + glEndPerfMonitorAMD = provider.getFunctionAddress("glEndPerfMonitorAMD"); + glGetPerfMonitorCounterDataAMD = provider.getFunctionAddress("glGetPerfMonitorCounterDataAMD"); + glSetMultisamplefvAMD = provider.getFunctionAddress("glSetMultisamplefvAMD"); + glTexStorageSparseAMD = provider.getFunctionAddress("glTexStorageSparseAMD"); + glTextureStorageSparseAMD = provider.getFunctionAddress("glTextureStorageSparseAMD"); + glStencilOpValueAMD = provider.getFunctionAddress("glStencilOpValueAMD"); + glTessellationFactorAMD = provider.getFunctionAddress("glTessellationFactorAMD"); + glTessellationModeAMD = provider.getFunctionAddress("glTessellationModeAMD"); + glGetTextureHandleARB = provider.getFunctionAddress("glGetTextureHandleARB"); + glGetTextureSamplerHandleARB = provider.getFunctionAddress("glGetTextureSamplerHandleARB"); + glMakeTextureHandleResidentARB = provider.getFunctionAddress("glMakeTextureHandleResidentARB"); + glMakeTextureHandleNonResidentARB = provider.getFunctionAddress("glMakeTextureHandleNonResidentARB"); + glGetImageHandleARB = provider.getFunctionAddress("glGetImageHandleARB"); + glMakeImageHandleResidentARB = provider.getFunctionAddress("glMakeImageHandleResidentARB"); + glMakeImageHandleNonResidentARB = provider.getFunctionAddress("glMakeImageHandleNonResidentARB"); + glUniformHandleui64ARB = provider.getFunctionAddress("glUniformHandleui64ARB"); + glUniformHandleui64vARB = provider.getFunctionAddress("glUniformHandleui64vARB"); + glProgramUniformHandleui64ARB = provider.getFunctionAddress("glProgramUniformHandleui64ARB"); + glProgramUniformHandleui64vARB = provider.getFunctionAddress("glProgramUniformHandleui64vARB"); + glIsTextureHandleResidentARB = provider.getFunctionAddress("glIsTextureHandleResidentARB"); + glIsImageHandleResidentARB = provider.getFunctionAddress("glIsImageHandleResidentARB"); + glVertexAttribL1ui64ARB = provider.getFunctionAddress("glVertexAttribL1ui64ARB"); + glVertexAttribL1ui64vARB = provider.getFunctionAddress("glVertexAttribL1ui64vARB"); + glGetVertexAttribLui64vARB = provider.getFunctionAddress("glGetVertexAttribLui64vARB"); + glNamedBufferStorageEXT = provider.getFunctionAddress("glNamedBufferStorageEXT"); + glClearNamedBufferDataEXT = provider.getFunctionAddress("glClearNamedBufferDataEXT"); + glClearNamedBufferSubDataEXT = provider.getFunctionAddress("glClearNamedBufferSubDataEXT"); + glClampColorARB = provider.getFunctionAddress("glClampColorARB"); + glDispatchComputeGroupSizeARB = provider.getFunctionAddress("glDispatchComputeGroupSizeARB"); + glDebugMessageControlARB = provider.getFunctionAddress("glDebugMessageControlARB"); + glDebugMessageInsertARB = provider.getFunctionAddress("glDebugMessageInsertARB"); + glDebugMessageCallbackARB = provider.getFunctionAddress("glDebugMessageCallbackARB"); + glGetDebugMessageLogARB = provider.getFunctionAddress("glGetDebugMessageLogARB"); + glDrawBuffersARB = provider.getFunctionAddress("glDrawBuffersARB"); + glBlendEquationiARB = provider.getFunctionAddress("glBlendEquationiARB"); + glBlendEquationSeparateiARB = provider.getFunctionAddress("glBlendEquationSeparateiARB"); + glBlendFunciARB = provider.getFunctionAddress("glBlendFunciARB"); + glBlendFuncSeparateiARB = provider.getFunctionAddress("glBlendFuncSeparateiARB"); + glDrawArraysInstancedARB = provider.getFunctionAddress("glDrawArraysInstancedARB"); + glDrawElementsInstancedARB = provider.getFunctionAddress("glDrawElementsInstancedARB"); + glPrimitiveBoundingBoxARB = provider.getFunctionAddress("glPrimitiveBoundingBoxARB"); + glNamedFramebufferParameteriEXT = provider.getFunctionAddress("glNamedFramebufferParameteriEXT"); + glGetNamedFramebufferParameterivEXT = provider.getFunctionAddress("glGetNamedFramebufferParameterivEXT"); + glProgramParameteriARB = provider.getFunctionAddress("glProgramParameteriARB"); + glFramebufferTextureARB = provider.getFunctionAddress("glFramebufferTextureARB"); + glFramebufferTextureLayerARB = provider.getFunctionAddress("glFramebufferTextureLayerARB"); + glFramebufferTextureFaceARB = provider.getFunctionAddress("glFramebufferTextureFaceARB"); + glSpecializeShaderARB = provider.getFunctionAddress("glSpecializeShaderARB"); + glProgramUniform1dEXT = provider.getFunctionAddress("glProgramUniform1dEXT"); + glProgramUniform2dEXT = provider.getFunctionAddress("glProgramUniform2dEXT"); + glProgramUniform3dEXT = provider.getFunctionAddress("glProgramUniform3dEXT"); + glProgramUniform4dEXT = provider.getFunctionAddress("glProgramUniform4dEXT"); + glProgramUniform1dvEXT = provider.getFunctionAddress("glProgramUniform1dvEXT"); + glProgramUniform2dvEXT = provider.getFunctionAddress("glProgramUniform2dvEXT"); + glProgramUniform3dvEXT = provider.getFunctionAddress("glProgramUniform3dvEXT"); + glProgramUniform4dvEXT = provider.getFunctionAddress("glProgramUniform4dvEXT"); + glProgramUniformMatrix2dvEXT = provider.getFunctionAddress("glProgramUniformMatrix2dvEXT"); + glProgramUniformMatrix3dvEXT = provider.getFunctionAddress("glProgramUniformMatrix3dvEXT"); + glProgramUniformMatrix4dvEXT = provider.getFunctionAddress("glProgramUniformMatrix4dvEXT"); + glProgramUniformMatrix2x3dvEXT = provider.getFunctionAddress("glProgramUniformMatrix2x3dvEXT"); + glProgramUniformMatrix2x4dvEXT = provider.getFunctionAddress("glProgramUniformMatrix2x4dvEXT"); + glProgramUniformMatrix3x2dvEXT = provider.getFunctionAddress("glProgramUniformMatrix3x2dvEXT"); + glProgramUniformMatrix3x4dvEXT = provider.getFunctionAddress("glProgramUniformMatrix3x4dvEXT"); + glProgramUniformMatrix4x2dvEXT = provider.getFunctionAddress("glProgramUniformMatrix4x2dvEXT"); + glProgramUniformMatrix4x3dvEXT = provider.getFunctionAddress("glProgramUniformMatrix4x3dvEXT"); + glUniform1i64ARB = provider.getFunctionAddress("glUniform1i64ARB"); + glUniform1i64vARB = provider.getFunctionAddress("glUniform1i64vARB"); + glProgramUniform1i64ARB = provider.getFunctionAddress("glProgramUniform1i64ARB"); + glProgramUniform1i64vARB = provider.getFunctionAddress("glProgramUniform1i64vARB"); + glUniform2i64ARB = provider.getFunctionAddress("glUniform2i64ARB"); + glUniform2i64vARB = provider.getFunctionAddress("glUniform2i64vARB"); + glProgramUniform2i64ARB = provider.getFunctionAddress("glProgramUniform2i64ARB"); + glProgramUniform2i64vARB = provider.getFunctionAddress("glProgramUniform2i64vARB"); + glUniform3i64ARB = provider.getFunctionAddress("glUniform3i64ARB"); + glUniform3i64vARB = provider.getFunctionAddress("glUniform3i64vARB"); + glProgramUniform3i64ARB = provider.getFunctionAddress("glProgramUniform3i64ARB"); + glProgramUniform3i64vARB = provider.getFunctionAddress("glProgramUniform3i64vARB"); + glUniform4i64ARB = provider.getFunctionAddress("glUniform4i64ARB"); + glUniform4i64vARB = provider.getFunctionAddress("glUniform4i64vARB"); + glProgramUniform4i64ARB = provider.getFunctionAddress("glProgramUniform4i64ARB"); + glProgramUniform4i64vARB = provider.getFunctionAddress("glProgramUniform4i64vARB"); + glUniform1ui64ARB = provider.getFunctionAddress("glUniform1ui64ARB"); + glUniform1ui64vARB = provider.getFunctionAddress("glUniform1ui64vARB"); + glProgramUniform1ui64ARB = provider.getFunctionAddress("glProgramUniform1ui64ARB"); + glProgramUniform1ui64vARB = provider.getFunctionAddress("glProgramUniform1ui64vARB"); + glUniform2ui64ARB = provider.getFunctionAddress("glUniform2ui64ARB"); + glUniform2ui64vARB = provider.getFunctionAddress("glUniform2ui64vARB"); + glProgramUniform2ui64ARB = provider.getFunctionAddress("glProgramUniform2ui64ARB"); + glProgramUniform2ui64vARB = provider.getFunctionAddress("glProgramUniform2ui64vARB"); + glUniform3ui64ARB = provider.getFunctionAddress("glUniform3ui64ARB"); + glUniform3ui64vARB = provider.getFunctionAddress("glUniform3ui64vARB"); + glProgramUniform3ui64ARB = provider.getFunctionAddress("glProgramUniform3ui64ARB"); + glProgramUniform3ui64vARB = provider.getFunctionAddress("glProgramUniform3ui64vARB"); + glUniform4ui64ARB = provider.getFunctionAddress("glUniform4ui64ARB"); + glUniform4ui64vARB = provider.getFunctionAddress("glUniform4ui64vARB"); + glProgramUniform4ui64ARB = provider.getFunctionAddress("glProgramUniform4ui64ARB"); + glProgramUniform4ui64vARB = provider.getFunctionAddress("glProgramUniform4ui64vARB"); + glGetUniformi64vARB = provider.getFunctionAddress("glGetUniformi64vARB"); + glGetUniformui64vARB = provider.getFunctionAddress("glGetUniformui64vARB"); + glGetnUniformi64vARB = provider.getFunctionAddress("glGetnUniformi64vARB"); + glGetnUniformui64vARB = provider.getFunctionAddress("glGetnUniformui64vARB"); + glColorTable = getFunctionAddress(fc, provider, "glColorTable"); + glCopyColorTable = getFunctionAddress(fc, provider, "glCopyColorTable"); + glColorTableParameteriv = getFunctionAddress(fc, provider, "glColorTableParameteriv"); + glColorTableParameterfv = getFunctionAddress(fc, provider, "glColorTableParameterfv"); + glGetColorTable = getFunctionAddress(fc, provider, "glGetColorTable"); + glGetColorTableParameteriv = getFunctionAddress(fc, provider, "glGetColorTableParameteriv"); + glGetColorTableParameterfv = getFunctionAddress(fc, provider, "glGetColorTableParameterfv"); + glColorSubTable = getFunctionAddress(fc, provider, "glColorSubTable"); + glCopyColorSubTable = getFunctionAddress(fc, provider, "glCopyColorSubTable"); + glConvolutionFilter1D = getFunctionAddress(fc, provider, "glConvolutionFilter1D"); + glConvolutionFilter2D = getFunctionAddress(fc, provider, "glConvolutionFilter2D"); + glCopyConvolutionFilter1D = getFunctionAddress(fc, provider, "glCopyConvolutionFilter1D"); + glCopyConvolutionFilter2D = getFunctionAddress(fc, provider, "glCopyConvolutionFilter2D"); + glGetConvolutionFilter = getFunctionAddress(fc, provider, "glGetConvolutionFilter"); + glSeparableFilter2D = getFunctionAddress(fc, provider, "glSeparableFilter2D"); + glGetSeparableFilter = getFunctionAddress(fc, provider, "glGetSeparableFilter"); + glConvolutionParameteri = getFunctionAddress(fc, provider, "glConvolutionParameteri"); + glConvolutionParameteriv = getFunctionAddress(fc, provider, "glConvolutionParameteriv"); + glConvolutionParameterf = getFunctionAddress(fc, provider, "glConvolutionParameterf"); + glConvolutionParameterfv = getFunctionAddress(fc, provider, "glConvolutionParameterfv"); + glGetConvolutionParameteriv = getFunctionAddress(fc, provider, "glGetConvolutionParameteriv"); + glGetConvolutionParameterfv = getFunctionAddress(fc, provider, "glGetConvolutionParameterfv"); + glHistogram = getFunctionAddress(fc, provider, "glHistogram"); + glResetHistogram = getFunctionAddress(fc, provider, "glResetHistogram"); + glGetHistogram = getFunctionAddress(fc, provider, "glGetHistogram"); + glGetHistogramParameteriv = getFunctionAddress(fc, provider, "glGetHistogramParameteriv"); + glGetHistogramParameterfv = getFunctionAddress(fc, provider, "glGetHistogramParameterfv"); + glMinmax = getFunctionAddress(fc, provider, "glMinmax"); + glResetMinmax = getFunctionAddress(fc, provider, "glResetMinmax"); + glGetMinmax = getFunctionAddress(fc, provider, "glGetMinmax"); + glGetMinmaxParameteriv = getFunctionAddress(fc, provider, "glGetMinmaxParameteriv"); + glGetMinmaxParameterfv = getFunctionAddress(fc, provider, "glGetMinmaxParameterfv"); + glMultiDrawArraysIndirectCountARB = provider.getFunctionAddress("glMultiDrawArraysIndirectCountARB"); + glMultiDrawElementsIndirectCountARB = provider.getFunctionAddress("glMultiDrawElementsIndirectCountARB"); + glVertexAttribDivisorARB = provider.getFunctionAddress("glVertexAttribDivisorARB"); + glVertexArrayVertexAttribDivisorEXT = provider.getFunctionAddress("glVertexArrayVertexAttribDivisorEXT"); + glCurrentPaletteMatrixARB = provider.getFunctionAddress("glCurrentPaletteMatrixARB"); + glMatrixIndexuivARB = provider.getFunctionAddress("glMatrixIndexuivARB"); + glMatrixIndexubvARB = provider.getFunctionAddress("glMatrixIndexubvARB"); + glMatrixIndexusvARB = provider.getFunctionAddress("glMatrixIndexusvARB"); + glMatrixIndexPointerARB = provider.getFunctionAddress("glMatrixIndexPointerARB"); + glSampleCoverageARB = provider.getFunctionAddress("glSampleCoverageARB"); + glActiveTextureARB = provider.getFunctionAddress("glActiveTextureARB"); + glClientActiveTextureARB = provider.getFunctionAddress("glClientActiveTextureARB"); + glMultiTexCoord1fARB = provider.getFunctionAddress("glMultiTexCoord1fARB"); + glMultiTexCoord1sARB = provider.getFunctionAddress("glMultiTexCoord1sARB"); + glMultiTexCoord1iARB = provider.getFunctionAddress("glMultiTexCoord1iARB"); + glMultiTexCoord1dARB = provider.getFunctionAddress("glMultiTexCoord1dARB"); + glMultiTexCoord1fvARB = provider.getFunctionAddress("glMultiTexCoord1fvARB"); + glMultiTexCoord1svARB = provider.getFunctionAddress("glMultiTexCoord1svARB"); + glMultiTexCoord1ivARB = provider.getFunctionAddress("glMultiTexCoord1ivARB"); + glMultiTexCoord1dvARB = provider.getFunctionAddress("glMultiTexCoord1dvARB"); + glMultiTexCoord2fARB = provider.getFunctionAddress("glMultiTexCoord2fARB"); + glMultiTexCoord2sARB = provider.getFunctionAddress("glMultiTexCoord2sARB"); + glMultiTexCoord2iARB = provider.getFunctionAddress("glMultiTexCoord2iARB"); + glMultiTexCoord2dARB = provider.getFunctionAddress("glMultiTexCoord2dARB"); + glMultiTexCoord2fvARB = provider.getFunctionAddress("glMultiTexCoord2fvARB"); + glMultiTexCoord2svARB = provider.getFunctionAddress("glMultiTexCoord2svARB"); + glMultiTexCoord2ivARB = provider.getFunctionAddress("glMultiTexCoord2ivARB"); + glMultiTexCoord2dvARB = provider.getFunctionAddress("glMultiTexCoord2dvARB"); + glMultiTexCoord3fARB = provider.getFunctionAddress("glMultiTexCoord3fARB"); + glMultiTexCoord3sARB = provider.getFunctionAddress("glMultiTexCoord3sARB"); + glMultiTexCoord3iARB = provider.getFunctionAddress("glMultiTexCoord3iARB"); + glMultiTexCoord3dARB = provider.getFunctionAddress("glMultiTexCoord3dARB"); + glMultiTexCoord3fvARB = provider.getFunctionAddress("glMultiTexCoord3fvARB"); + glMultiTexCoord3svARB = provider.getFunctionAddress("glMultiTexCoord3svARB"); + glMultiTexCoord3ivARB = provider.getFunctionAddress("glMultiTexCoord3ivARB"); + glMultiTexCoord3dvARB = provider.getFunctionAddress("glMultiTexCoord3dvARB"); + glMultiTexCoord4fARB = provider.getFunctionAddress("glMultiTexCoord4fARB"); + glMultiTexCoord4sARB = provider.getFunctionAddress("glMultiTexCoord4sARB"); + glMultiTexCoord4iARB = provider.getFunctionAddress("glMultiTexCoord4iARB"); + glMultiTexCoord4dARB = provider.getFunctionAddress("glMultiTexCoord4dARB"); + glMultiTexCoord4fvARB = provider.getFunctionAddress("glMultiTexCoord4fvARB"); + glMultiTexCoord4svARB = provider.getFunctionAddress("glMultiTexCoord4svARB"); + glMultiTexCoord4ivARB = provider.getFunctionAddress("glMultiTexCoord4ivARB"); + glMultiTexCoord4dvARB = provider.getFunctionAddress("glMultiTexCoord4dvARB"); + glGenQueriesARB = provider.getFunctionAddress("glGenQueriesARB"); + glDeleteQueriesARB = provider.getFunctionAddress("glDeleteQueriesARB"); + glIsQueryARB = provider.getFunctionAddress("glIsQueryARB"); + glBeginQueryARB = provider.getFunctionAddress("glBeginQueryARB"); + glEndQueryARB = provider.getFunctionAddress("glEndQueryARB"); + glGetQueryivARB = provider.getFunctionAddress("glGetQueryivARB"); + glGetQueryObjectivARB = provider.getFunctionAddress("glGetQueryObjectivARB"); + glGetQueryObjectuivARB = provider.getFunctionAddress("glGetQueryObjectuivARB"); + glMaxShaderCompilerThreadsARB = provider.getFunctionAddress("glMaxShaderCompilerThreadsARB"); + glPointParameterfARB = provider.getFunctionAddress("glPointParameterfARB"); + glPointParameterfvARB = provider.getFunctionAddress("glPointParameterfvARB"); + glGetGraphicsResetStatusARB = provider.getFunctionAddress("glGetGraphicsResetStatusARB"); + glGetnMapdvARB = provider.getFunctionAddress("glGetnMapdvARB"); + glGetnMapfvARB = provider.getFunctionAddress("glGetnMapfvARB"); + glGetnMapivARB = provider.getFunctionAddress("glGetnMapivARB"); + glGetnPixelMapfvARB = provider.getFunctionAddress("glGetnPixelMapfvARB"); + glGetnPixelMapuivARB = provider.getFunctionAddress("glGetnPixelMapuivARB"); + glGetnPixelMapusvARB = provider.getFunctionAddress("glGetnPixelMapusvARB"); + glGetnPolygonStippleARB = provider.getFunctionAddress("glGetnPolygonStippleARB"); + glGetnTexImageARB = provider.getFunctionAddress("glGetnTexImageARB"); + glReadnPixelsARB = provider.getFunctionAddress("glReadnPixelsARB"); + glGetnColorTableARB = provider.getFunctionAddress("glGetnColorTableARB"); + glGetnConvolutionFilterARB = provider.getFunctionAddress("glGetnConvolutionFilterARB"); + glGetnSeparableFilterARB = provider.getFunctionAddress("glGetnSeparableFilterARB"); + glGetnHistogramARB = provider.getFunctionAddress("glGetnHistogramARB"); + glGetnMinmaxARB = provider.getFunctionAddress("glGetnMinmaxARB"); + glGetnCompressedTexImageARB = provider.getFunctionAddress("glGetnCompressedTexImageARB"); + glGetnUniformfvARB = provider.getFunctionAddress("glGetnUniformfvARB"); + glGetnUniformivARB = provider.getFunctionAddress("glGetnUniformivARB"); + glGetnUniformuivARB = provider.getFunctionAddress("glGetnUniformuivARB"); + glGetnUniformdvARB = provider.getFunctionAddress("glGetnUniformdvARB"); + glFramebufferSampleLocationsfvARB = provider.getFunctionAddress("glFramebufferSampleLocationsfvARB"); + glNamedFramebufferSampleLocationsfvARB = provider.getFunctionAddress("glNamedFramebufferSampleLocationsfvARB"); + glEvaluateDepthValuesARB = provider.getFunctionAddress("glEvaluateDepthValuesARB"); + glMinSampleShadingARB = provider.getFunctionAddress("glMinSampleShadingARB"); + glDeleteObjectARB = provider.getFunctionAddress("glDeleteObjectARB"); + glGetHandleARB = provider.getFunctionAddress("glGetHandleARB"); + glDetachObjectARB = provider.getFunctionAddress("glDetachObjectARB"); + glCreateShaderObjectARB = provider.getFunctionAddress("glCreateShaderObjectARB"); + glShaderSourceARB = provider.getFunctionAddress("glShaderSourceARB"); + glCompileShaderARB = provider.getFunctionAddress("glCompileShaderARB"); + glCreateProgramObjectARB = provider.getFunctionAddress("glCreateProgramObjectARB"); + glAttachObjectARB = provider.getFunctionAddress("glAttachObjectARB"); + glLinkProgramARB = provider.getFunctionAddress("glLinkProgramARB"); + glUseProgramObjectARB = provider.getFunctionAddress("glUseProgramObjectARB"); + glValidateProgramARB = provider.getFunctionAddress("glValidateProgramARB"); + glUniform1fARB = provider.getFunctionAddress("glUniform1fARB"); + glUniform2fARB = provider.getFunctionAddress("glUniform2fARB"); + glUniform3fARB = provider.getFunctionAddress("glUniform3fARB"); + glUniform4fARB = provider.getFunctionAddress("glUniform4fARB"); + glUniform1iARB = provider.getFunctionAddress("glUniform1iARB"); + glUniform2iARB = provider.getFunctionAddress("glUniform2iARB"); + glUniform3iARB = provider.getFunctionAddress("glUniform3iARB"); + glUniform4iARB = provider.getFunctionAddress("glUniform4iARB"); + glUniform1fvARB = provider.getFunctionAddress("glUniform1fvARB"); + glUniform2fvARB = provider.getFunctionAddress("glUniform2fvARB"); + glUniform3fvARB = provider.getFunctionAddress("glUniform3fvARB"); + glUniform4fvARB = provider.getFunctionAddress("glUniform4fvARB"); + glUniform1ivARB = provider.getFunctionAddress("glUniform1ivARB"); + glUniform2ivARB = provider.getFunctionAddress("glUniform2ivARB"); + glUniform3ivARB = provider.getFunctionAddress("glUniform3ivARB"); + glUniform4ivARB = provider.getFunctionAddress("glUniform4ivARB"); + glUniformMatrix2fvARB = provider.getFunctionAddress("glUniformMatrix2fvARB"); + glUniformMatrix3fvARB = provider.getFunctionAddress("glUniformMatrix3fvARB"); + glUniformMatrix4fvARB = provider.getFunctionAddress("glUniformMatrix4fvARB"); + glGetObjectParameterfvARB = provider.getFunctionAddress("glGetObjectParameterfvARB"); + glGetObjectParameterivARB = provider.getFunctionAddress("glGetObjectParameterivARB"); + glGetInfoLogARB = provider.getFunctionAddress("glGetInfoLogARB"); + glGetAttachedObjectsARB = provider.getFunctionAddress("glGetAttachedObjectsARB"); + glGetUniformLocationARB = provider.getFunctionAddress("glGetUniformLocationARB"); + glGetActiveUniformARB = provider.getFunctionAddress("glGetActiveUniformARB"); + glGetUniformfvARB = provider.getFunctionAddress("glGetUniformfvARB"); + glGetUniformivARB = provider.getFunctionAddress("glGetUniformivARB"); + glGetShaderSourceARB = provider.getFunctionAddress("glGetShaderSourceARB"); + glNamedStringARB = provider.getFunctionAddress("glNamedStringARB"); + glDeleteNamedStringARB = provider.getFunctionAddress("glDeleteNamedStringARB"); + glCompileShaderIncludeARB = provider.getFunctionAddress("glCompileShaderIncludeARB"); + glIsNamedStringARB = provider.getFunctionAddress("glIsNamedStringARB"); + glGetNamedStringARB = provider.getFunctionAddress("glGetNamedStringARB"); + glGetNamedStringivARB = provider.getFunctionAddress("glGetNamedStringivARB"); + glBufferPageCommitmentARB = provider.getFunctionAddress("glBufferPageCommitmentARB"); + glNamedBufferPageCommitmentEXT = provider.getFunctionAddress("glNamedBufferPageCommitmentEXT"); + glNamedBufferPageCommitmentARB = provider.getFunctionAddress("glNamedBufferPageCommitmentARB"); + glTexPageCommitmentARB = provider.getFunctionAddress("glTexPageCommitmentARB"); + glTexturePageCommitmentEXT = provider.getFunctionAddress("glTexturePageCommitmentEXT"); + glTexBufferARB = provider.getFunctionAddress("glTexBufferARB"); + glTextureBufferRangeEXT = provider.getFunctionAddress("glTextureBufferRangeEXT"); + glCompressedTexImage3DARB = provider.getFunctionAddress("glCompressedTexImage3DARB"); + glCompressedTexImage2DARB = provider.getFunctionAddress("glCompressedTexImage2DARB"); + glCompressedTexImage1DARB = provider.getFunctionAddress("glCompressedTexImage1DARB"); + glCompressedTexSubImage3DARB = provider.getFunctionAddress("glCompressedTexSubImage3DARB"); + glCompressedTexSubImage2DARB = provider.getFunctionAddress("glCompressedTexSubImage2DARB"); + glCompressedTexSubImage1DARB = provider.getFunctionAddress("glCompressedTexSubImage1DARB"); + glGetCompressedTexImageARB = provider.getFunctionAddress("glGetCompressedTexImageARB"); + glTextureStorage1DEXT = provider.getFunctionAddress("glTextureStorage1DEXT"); + glTextureStorage2DEXT = provider.getFunctionAddress("glTextureStorage2DEXT"); + glTextureStorage3DEXT = provider.getFunctionAddress("glTextureStorage3DEXT"); + glTextureStorage2DMultisampleEXT = provider.getFunctionAddress("glTextureStorage2DMultisampleEXT"); + glTextureStorage3DMultisampleEXT = provider.getFunctionAddress("glTextureStorage3DMultisampleEXT"); + glLoadTransposeMatrixfARB = provider.getFunctionAddress("glLoadTransposeMatrixfARB"); + glLoadTransposeMatrixdARB = provider.getFunctionAddress("glLoadTransposeMatrixdARB"); + glMultTransposeMatrixfARB = provider.getFunctionAddress("glMultTransposeMatrixfARB"); + glMultTransposeMatrixdARB = provider.getFunctionAddress("glMultTransposeMatrixdARB"); + glVertexArrayVertexAttribLOffsetEXT = provider.getFunctionAddress("glVertexArrayVertexAttribLOffsetEXT"); + glVertexArrayBindVertexBufferEXT = provider.getFunctionAddress("glVertexArrayBindVertexBufferEXT"); + glVertexArrayVertexAttribFormatEXT = provider.getFunctionAddress("glVertexArrayVertexAttribFormatEXT"); + glVertexArrayVertexAttribIFormatEXT = provider.getFunctionAddress("glVertexArrayVertexAttribIFormatEXT"); + glVertexArrayVertexAttribLFormatEXT = provider.getFunctionAddress("glVertexArrayVertexAttribLFormatEXT"); + glVertexArrayVertexAttribBindingEXT = provider.getFunctionAddress("glVertexArrayVertexAttribBindingEXT"); + glVertexArrayVertexBindingDivisorEXT = provider.getFunctionAddress("glVertexArrayVertexBindingDivisorEXT"); + glWeightfvARB = provider.getFunctionAddress("glWeightfvARB"); + glWeightbvARB = provider.getFunctionAddress("glWeightbvARB"); + glWeightubvARB = provider.getFunctionAddress("glWeightubvARB"); + glWeightsvARB = provider.getFunctionAddress("glWeightsvARB"); + glWeightusvARB = provider.getFunctionAddress("glWeightusvARB"); + glWeightivARB = provider.getFunctionAddress("glWeightivARB"); + glWeightuivARB = provider.getFunctionAddress("glWeightuivARB"); + glWeightdvARB = provider.getFunctionAddress("glWeightdvARB"); + glWeightPointerARB = provider.getFunctionAddress("glWeightPointerARB"); + glVertexBlendARB = provider.getFunctionAddress("glVertexBlendARB"); + glBindBufferARB = provider.getFunctionAddress("glBindBufferARB"); + glDeleteBuffersARB = provider.getFunctionAddress("glDeleteBuffersARB"); + glGenBuffersARB = provider.getFunctionAddress("glGenBuffersARB"); + glIsBufferARB = provider.getFunctionAddress("glIsBufferARB"); + glBufferDataARB = provider.getFunctionAddress("glBufferDataARB"); + glBufferSubDataARB = provider.getFunctionAddress("glBufferSubDataARB"); + glGetBufferSubDataARB = provider.getFunctionAddress("glGetBufferSubDataARB"); + glMapBufferARB = provider.getFunctionAddress("glMapBufferARB"); + glUnmapBufferARB = provider.getFunctionAddress("glUnmapBufferARB"); + glGetBufferParameterivARB = provider.getFunctionAddress("glGetBufferParameterivARB"); + glGetBufferPointervARB = provider.getFunctionAddress("glGetBufferPointervARB"); + glProgramStringARB = provider.getFunctionAddress("glProgramStringARB"); + glBindProgramARB = provider.getFunctionAddress("glBindProgramARB"); + glDeleteProgramsARB = provider.getFunctionAddress("glDeleteProgramsARB"); + glGenProgramsARB = provider.getFunctionAddress("glGenProgramsARB"); + glProgramEnvParameter4dARB = provider.getFunctionAddress("glProgramEnvParameter4dARB"); + glProgramEnvParameter4dvARB = provider.getFunctionAddress("glProgramEnvParameter4dvARB"); + glProgramEnvParameter4fARB = provider.getFunctionAddress("glProgramEnvParameter4fARB"); + glProgramEnvParameter4fvARB = provider.getFunctionAddress("glProgramEnvParameter4fvARB"); + glProgramLocalParameter4dARB = provider.getFunctionAddress("glProgramLocalParameter4dARB"); + glProgramLocalParameter4dvARB = provider.getFunctionAddress("glProgramLocalParameter4dvARB"); + glProgramLocalParameter4fARB = provider.getFunctionAddress("glProgramLocalParameter4fARB"); + glProgramLocalParameter4fvARB = provider.getFunctionAddress("glProgramLocalParameter4fvARB"); + glGetProgramEnvParameterfvARB = provider.getFunctionAddress("glGetProgramEnvParameterfvARB"); + glGetProgramEnvParameterdvARB = provider.getFunctionAddress("glGetProgramEnvParameterdvARB"); + glGetProgramLocalParameterfvARB = provider.getFunctionAddress("glGetProgramLocalParameterfvARB"); + glGetProgramLocalParameterdvARB = provider.getFunctionAddress("glGetProgramLocalParameterdvARB"); + glGetProgramivARB = provider.getFunctionAddress("glGetProgramivARB"); + glGetProgramStringARB = provider.getFunctionAddress("glGetProgramStringARB"); + glIsProgramARB = provider.getFunctionAddress("glIsProgramARB"); + glVertexAttrib1fARB = provider.getFunctionAddress("glVertexAttrib1fARB"); + glVertexAttrib1sARB = provider.getFunctionAddress("glVertexAttrib1sARB"); + glVertexAttrib1dARB = provider.getFunctionAddress("glVertexAttrib1dARB"); + glVertexAttrib2fARB = provider.getFunctionAddress("glVertexAttrib2fARB"); + glVertexAttrib2sARB = provider.getFunctionAddress("glVertexAttrib2sARB"); + glVertexAttrib2dARB = provider.getFunctionAddress("glVertexAttrib2dARB"); + glVertexAttrib3fARB = provider.getFunctionAddress("glVertexAttrib3fARB"); + glVertexAttrib3sARB = provider.getFunctionAddress("glVertexAttrib3sARB"); + glVertexAttrib3dARB = provider.getFunctionAddress("glVertexAttrib3dARB"); + glVertexAttrib4fARB = provider.getFunctionAddress("glVertexAttrib4fARB"); + glVertexAttrib4sARB = provider.getFunctionAddress("glVertexAttrib4sARB"); + glVertexAttrib4dARB = provider.getFunctionAddress("glVertexAttrib4dARB"); + glVertexAttrib4NubARB = provider.getFunctionAddress("glVertexAttrib4NubARB"); + glVertexAttrib1fvARB = provider.getFunctionAddress("glVertexAttrib1fvARB"); + glVertexAttrib1svARB = provider.getFunctionAddress("glVertexAttrib1svARB"); + glVertexAttrib1dvARB = provider.getFunctionAddress("glVertexAttrib1dvARB"); + glVertexAttrib2fvARB = provider.getFunctionAddress("glVertexAttrib2fvARB"); + glVertexAttrib2svARB = provider.getFunctionAddress("glVertexAttrib2svARB"); + glVertexAttrib2dvARB = provider.getFunctionAddress("glVertexAttrib2dvARB"); + glVertexAttrib3fvARB = provider.getFunctionAddress("glVertexAttrib3fvARB"); + glVertexAttrib3svARB = provider.getFunctionAddress("glVertexAttrib3svARB"); + glVertexAttrib3dvARB = provider.getFunctionAddress("glVertexAttrib3dvARB"); + glVertexAttrib4fvARB = provider.getFunctionAddress("glVertexAttrib4fvARB"); + glVertexAttrib4svARB = provider.getFunctionAddress("glVertexAttrib4svARB"); + glVertexAttrib4dvARB = provider.getFunctionAddress("glVertexAttrib4dvARB"); + glVertexAttrib4ivARB = provider.getFunctionAddress("glVertexAttrib4ivARB"); + glVertexAttrib4bvARB = provider.getFunctionAddress("glVertexAttrib4bvARB"); + glVertexAttrib4ubvARB = provider.getFunctionAddress("glVertexAttrib4ubvARB"); + glVertexAttrib4usvARB = provider.getFunctionAddress("glVertexAttrib4usvARB"); + glVertexAttrib4uivARB = provider.getFunctionAddress("glVertexAttrib4uivARB"); + glVertexAttrib4NbvARB = provider.getFunctionAddress("glVertexAttrib4NbvARB"); + glVertexAttrib4NsvARB = provider.getFunctionAddress("glVertexAttrib4NsvARB"); + glVertexAttrib4NivARB = provider.getFunctionAddress("glVertexAttrib4NivARB"); + glVertexAttrib4NubvARB = provider.getFunctionAddress("glVertexAttrib4NubvARB"); + glVertexAttrib4NusvARB = provider.getFunctionAddress("glVertexAttrib4NusvARB"); + glVertexAttrib4NuivARB = provider.getFunctionAddress("glVertexAttrib4NuivARB"); + glVertexAttribPointerARB = provider.getFunctionAddress("glVertexAttribPointerARB"); + glEnableVertexAttribArrayARB = provider.getFunctionAddress("glEnableVertexAttribArrayARB"); + glDisableVertexAttribArrayARB = provider.getFunctionAddress("glDisableVertexAttribArrayARB"); + glBindAttribLocationARB = provider.getFunctionAddress("glBindAttribLocationARB"); + glGetActiveAttribARB = provider.getFunctionAddress("glGetActiveAttribARB"); + glGetAttribLocationARB = provider.getFunctionAddress("glGetAttribLocationARB"); + glGetVertexAttribivARB = provider.getFunctionAddress("glGetVertexAttribivARB"); + glGetVertexAttribfvARB = provider.getFunctionAddress("glGetVertexAttribfvARB"); + glGetVertexAttribdvARB = provider.getFunctionAddress("glGetVertexAttribdvARB"); + glGetVertexAttribPointervARB = provider.getFunctionAddress("glGetVertexAttribPointervARB"); + glWindowPos2iARB = provider.getFunctionAddress("glWindowPos2iARB"); + glWindowPos2sARB = provider.getFunctionAddress("glWindowPos2sARB"); + glWindowPos2fARB = provider.getFunctionAddress("glWindowPos2fARB"); + glWindowPos2dARB = provider.getFunctionAddress("glWindowPos2dARB"); + glWindowPos2ivARB = provider.getFunctionAddress("glWindowPos2ivARB"); + glWindowPos2svARB = provider.getFunctionAddress("glWindowPos2svARB"); + glWindowPos2fvARB = provider.getFunctionAddress("glWindowPos2fvARB"); + glWindowPos2dvARB = provider.getFunctionAddress("glWindowPos2dvARB"); + glWindowPos3iARB = provider.getFunctionAddress("glWindowPos3iARB"); + glWindowPos3sARB = provider.getFunctionAddress("glWindowPos3sARB"); + glWindowPos3fARB = provider.getFunctionAddress("glWindowPos3fARB"); + glWindowPos3dARB = provider.getFunctionAddress("glWindowPos3dARB"); + glWindowPos3ivARB = provider.getFunctionAddress("glWindowPos3ivARB"); + glWindowPos3svARB = provider.getFunctionAddress("glWindowPos3svARB"); + glWindowPos3fvARB = provider.getFunctionAddress("glWindowPos3fvARB"); + glWindowPos3dvARB = provider.getFunctionAddress("glWindowPos3dvARB"); + glUniformBufferEXT = provider.getFunctionAddress("glUniformBufferEXT"); + glGetUniformBufferSizeEXT = provider.getFunctionAddress("glGetUniformBufferSizeEXT"); + glGetUniformOffsetEXT = provider.getFunctionAddress("glGetUniformOffsetEXT"); + glBlendColorEXT = provider.getFunctionAddress("glBlendColorEXT"); + glBlendEquationSeparateEXT = provider.getFunctionAddress("glBlendEquationSeparateEXT"); + glBlendFuncSeparateEXT = provider.getFunctionAddress("glBlendFuncSeparateEXT"); + glBlendEquationEXT = provider.getFunctionAddress("glBlendEquationEXT"); + glLockArraysEXT = provider.getFunctionAddress("glLockArraysEXT"); + glUnlockArraysEXT = provider.getFunctionAddress("glUnlockArraysEXT"); + glLabelObjectEXT = provider.getFunctionAddress("glLabelObjectEXT"); + glGetObjectLabelEXT = provider.getFunctionAddress("glGetObjectLabelEXT"); + glInsertEventMarkerEXT = provider.getFunctionAddress("glInsertEventMarkerEXT"); + glPushGroupMarkerEXT = provider.getFunctionAddress("glPushGroupMarkerEXT"); + glPopGroupMarkerEXT = provider.getFunctionAddress("glPopGroupMarkerEXT"); + glDepthBoundsEXT = provider.getFunctionAddress("glDepthBoundsEXT"); + glClientAttribDefaultEXT = provider.getFunctionAddress("glClientAttribDefaultEXT"); + glPushClientAttribDefaultEXT = provider.getFunctionAddress("glPushClientAttribDefaultEXT"); + glMatrixLoadfEXT = provider.getFunctionAddress("glMatrixLoadfEXT"); + glMatrixLoaddEXT = provider.getFunctionAddress("glMatrixLoaddEXT"); + glMatrixMultfEXT = provider.getFunctionAddress("glMatrixMultfEXT"); + glMatrixMultdEXT = provider.getFunctionAddress("glMatrixMultdEXT"); + glMatrixLoadIdentityEXT = provider.getFunctionAddress("glMatrixLoadIdentityEXT"); + glMatrixRotatefEXT = provider.getFunctionAddress("glMatrixRotatefEXT"); + glMatrixRotatedEXT = provider.getFunctionAddress("glMatrixRotatedEXT"); + glMatrixScalefEXT = provider.getFunctionAddress("glMatrixScalefEXT"); + glMatrixScaledEXT = provider.getFunctionAddress("glMatrixScaledEXT"); + glMatrixTranslatefEXT = provider.getFunctionAddress("glMatrixTranslatefEXT"); + glMatrixTranslatedEXT = provider.getFunctionAddress("glMatrixTranslatedEXT"); + glMatrixOrthoEXT = provider.getFunctionAddress("glMatrixOrthoEXT"); + glMatrixFrustumEXT = provider.getFunctionAddress("glMatrixFrustumEXT"); + glMatrixPushEXT = provider.getFunctionAddress("glMatrixPushEXT"); + glMatrixPopEXT = provider.getFunctionAddress("glMatrixPopEXT"); + glTextureParameteriEXT = provider.getFunctionAddress("glTextureParameteriEXT"); + glTextureParameterivEXT = provider.getFunctionAddress("glTextureParameterivEXT"); + glTextureParameterfEXT = provider.getFunctionAddress("glTextureParameterfEXT"); + glTextureParameterfvEXT = provider.getFunctionAddress("glTextureParameterfvEXT"); + glTextureImage1DEXT = provider.getFunctionAddress("glTextureImage1DEXT"); + glTextureImage2DEXT = provider.getFunctionAddress("glTextureImage2DEXT"); + glTextureSubImage1DEXT = provider.getFunctionAddress("glTextureSubImage1DEXT"); + glTextureSubImage2DEXT = provider.getFunctionAddress("glTextureSubImage2DEXT"); + glCopyTextureImage1DEXT = provider.getFunctionAddress("glCopyTextureImage1DEXT"); + glCopyTextureImage2DEXT = provider.getFunctionAddress("glCopyTextureImage2DEXT"); + glCopyTextureSubImage1DEXT = provider.getFunctionAddress("glCopyTextureSubImage1DEXT"); + glCopyTextureSubImage2DEXT = provider.getFunctionAddress("glCopyTextureSubImage2DEXT"); + glGetTextureImageEXT = provider.getFunctionAddress("glGetTextureImageEXT"); + glGetTextureParameterfvEXT = provider.getFunctionAddress("glGetTextureParameterfvEXT"); + glGetTextureParameterivEXT = provider.getFunctionAddress("glGetTextureParameterivEXT"); + glGetTextureLevelParameterfvEXT = provider.getFunctionAddress("glGetTextureLevelParameterfvEXT"); + glGetTextureLevelParameterivEXT = provider.getFunctionAddress("glGetTextureLevelParameterivEXT"); + glTextureImage3DEXT = provider.getFunctionAddress("glTextureImage3DEXT"); + glTextureSubImage3DEXT = provider.getFunctionAddress("glTextureSubImage3DEXT"); + glCopyTextureSubImage3DEXT = provider.getFunctionAddress("glCopyTextureSubImage3DEXT"); + glBindMultiTextureEXT = provider.getFunctionAddress("glBindMultiTextureEXT"); + glMultiTexCoordPointerEXT = provider.getFunctionAddress("glMultiTexCoordPointerEXT"); + glMultiTexEnvfEXT = provider.getFunctionAddress("glMultiTexEnvfEXT"); + glMultiTexEnvfvEXT = provider.getFunctionAddress("glMultiTexEnvfvEXT"); + glMultiTexEnviEXT = provider.getFunctionAddress("glMultiTexEnviEXT"); + glMultiTexEnvivEXT = provider.getFunctionAddress("glMultiTexEnvivEXT"); + glMultiTexGendEXT = provider.getFunctionAddress("glMultiTexGendEXT"); + glMultiTexGendvEXT = provider.getFunctionAddress("glMultiTexGendvEXT"); + glMultiTexGenfEXT = provider.getFunctionAddress("glMultiTexGenfEXT"); + glMultiTexGenfvEXT = provider.getFunctionAddress("glMultiTexGenfvEXT"); + glMultiTexGeniEXT = provider.getFunctionAddress("glMultiTexGeniEXT"); + glMultiTexGenivEXT = provider.getFunctionAddress("glMultiTexGenivEXT"); + glGetMultiTexEnvfvEXT = provider.getFunctionAddress("glGetMultiTexEnvfvEXT"); + glGetMultiTexEnvivEXT = provider.getFunctionAddress("glGetMultiTexEnvivEXT"); + glGetMultiTexGendvEXT = provider.getFunctionAddress("glGetMultiTexGendvEXT"); + glGetMultiTexGenfvEXT = provider.getFunctionAddress("glGetMultiTexGenfvEXT"); + glGetMultiTexGenivEXT = provider.getFunctionAddress("glGetMultiTexGenivEXT"); + glMultiTexParameteriEXT = provider.getFunctionAddress("glMultiTexParameteriEXT"); + glMultiTexParameterivEXT = provider.getFunctionAddress("glMultiTexParameterivEXT"); + glMultiTexParameterfEXT = provider.getFunctionAddress("glMultiTexParameterfEXT"); + glMultiTexParameterfvEXT = provider.getFunctionAddress("glMultiTexParameterfvEXT"); + glMultiTexImage1DEXT = provider.getFunctionAddress("glMultiTexImage1DEXT"); + glMultiTexImage2DEXT = provider.getFunctionAddress("glMultiTexImage2DEXT"); + glMultiTexSubImage1DEXT = provider.getFunctionAddress("glMultiTexSubImage1DEXT"); + glMultiTexSubImage2DEXT = provider.getFunctionAddress("glMultiTexSubImage2DEXT"); + glCopyMultiTexImage1DEXT = provider.getFunctionAddress("glCopyMultiTexImage1DEXT"); + glCopyMultiTexImage2DEXT = provider.getFunctionAddress("glCopyMultiTexImage2DEXT"); + glCopyMultiTexSubImage1DEXT = provider.getFunctionAddress("glCopyMultiTexSubImage1DEXT"); + glCopyMultiTexSubImage2DEXT = provider.getFunctionAddress("glCopyMultiTexSubImage2DEXT"); + glGetMultiTexImageEXT = provider.getFunctionAddress("glGetMultiTexImageEXT"); + glGetMultiTexParameterfvEXT = provider.getFunctionAddress("glGetMultiTexParameterfvEXT"); + glGetMultiTexParameterivEXT = provider.getFunctionAddress("glGetMultiTexParameterivEXT"); + glGetMultiTexLevelParameterfvEXT = provider.getFunctionAddress("glGetMultiTexLevelParameterfvEXT"); + glGetMultiTexLevelParameterivEXT = provider.getFunctionAddress("glGetMultiTexLevelParameterivEXT"); + glMultiTexImage3DEXT = provider.getFunctionAddress("glMultiTexImage3DEXT"); + glMultiTexSubImage3DEXT = provider.getFunctionAddress("glMultiTexSubImage3DEXT"); + glCopyMultiTexSubImage3DEXT = provider.getFunctionAddress("glCopyMultiTexSubImage3DEXT"); + glEnableClientStateIndexedEXT = provider.getFunctionAddress("glEnableClientStateIndexedEXT"); + glDisableClientStateIndexedEXT = provider.getFunctionAddress("glDisableClientStateIndexedEXT"); + glEnableClientStateiEXT = provider.getFunctionAddress("glEnableClientStateiEXT"); + glDisableClientStateiEXT = provider.getFunctionAddress("glDisableClientStateiEXT"); + glGetFloatIndexedvEXT = provider.getFunctionAddress("glGetFloatIndexedvEXT"); + glGetDoubleIndexedvEXT = provider.getFunctionAddress("glGetDoubleIndexedvEXT"); + glGetPointerIndexedvEXT = provider.getFunctionAddress("glGetPointerIndexedvEXT"); + glGetFloati_vEXT = provider.getFunctionAddress("glGetFloati_vEXT"); + glGetDoublei_vEXT = provider.getFunctionAddress("glGetDoublei_vEXT"); + glGetPointeri_vEXT = provider.getFunctionAddress("glGetPointeri_vEXT"); + glNamedProgramStringEXT = provider.getFunctionAddress("glNamedProgramStringEXT"); + glNamedProgramLocalParameter4dEXT = provider.getFunctionAddress("glNamedProgramLocalParameter4dEXT"); + glNamedProgramLocalParameter4dvEXT = provider.getFunctionAddress("glNamedProgramLocalParameter4dvEXT"); + glNamedProgramLocalParameter4fEXT = provider.getFunctionAddress("glNamedProgramLocalParameter4fEXT"); + glNamedProgramLocalParameter4fvEXT = provider.getFunctionAddress("glNamedProgramLocalParameter4fvEXT"); + glGetNamedProgramLocalParameterdvEXT = provider.getFunctionAddress("glGetNamedProgramLocalParameterdvEXT"); + glGetNamedProgramLocalParameterfvEXT = provider.getFunctionAddress("glGetNamedProgramLocalParameterfvEXT"); + glGetNamedProgramivEXT = provider.getFunctionAddress("glGetNamedProgramivEXT"); + glGetNamedProgramStringEXT = provider.getFunctionAddress("glGetNamedProgramStringEXT"); + glCompressedTextureImage3DEXT = provider.getFunctionAddress("glCompressedTextureImage3DEXT"); + glCompressedTextureImage2DEXT = provider.getFunctionAddress("glCompressedTextureImage2DEXT"); + glCompressedTextureImage1DEXT = provider.getFunctionAddress("glCompressedTextureImage1DEXT"); + glCompressedTextureSubImage3DEXT = provider.getFunctionAddress("glCompressedTextureSubImage3DEXT"); + glCompressedTextureSubImage2DEXT = provider.getFunctionAddress("glCompressedTextureSubImage2DEXT"); + glCompressedTextureSubImage1DEXT = provider.getFunctionAddress("glCompressedTextureSubImage1DEXT"); + glGetCompressedTextureImageEXT = provider.getFunctionAddress("glGetCompressedTextureImageEXT"); + glCompressedMultiTexImage3DEXT = provider.getFunctionAddress("glCompressedMultiTexImage3DEXT"); + glCompressedMultiTexImage2DEXT = provider.getFunctionAddress("glCompressedMultiTexImage2DEXT"); + glCompressedMultiTexImage1DEXT = provider.getFunctionAddress("glCompressedMultiTexImage1DEXT"); + glCompressedMultiTexSubImage3DEXT = provider.getFunctionAddress("glCompressedMultiTexSubImage3DEXT"); + glCompressedMultiTexSubImage2DEXT = provider.getFunctionAddress("glCompressedMultiTexSubImage2DEXT"); + glCompressedMultiTexSubImage1DEXT = provider.getFunctionAddress("glCompressedMultiTexSubImage1DEXT"); + glGetCompressedMultiTexImageEXT = provider.getFunctionAddress("glGetCompressedMultiTexImageEXT"); + glMatrixLoadTransposefEXT = provider.getFunctionAddress("glMatrixLoadTransposefEXT"); + glMatrixLoadTransposedEXT = provider.getFunctionAddress("glMatrixLoadTransposedEXT"); + glMatrixMultTransposefEXT = provider.getFunctionAddress("glMatrixMultTransposefEXT"); + glMatrixMultTransposedEXT = provider.getFunctionAddress("glMatrixMultTransposedEXT"); + glNamedBufferDataEXT = provider.getFunctionAddress("glNamedBufferDataEXT"); + glNamedBufferSubDataEXT = provider.getFunctionAddress("glNamedBufferSubDataEXT"); + glMapNamedBufferEXT = provider.getFunctionAddress("glMapNamedBufferEXT"); + glUnmapNamedBufferEXT = provider.getFunctionAddress("glUnmapNamedBufferEXT"); + glGetNamedBufferParameterivEXT = provider.getFunctionAddress("glGetNamedBufferParameterivEXT"); + glGetNamedBufferSubDataEXT = provider.getFunctionAddress("glGetNamedBufferSubDataEXT"); + glProgramUniform1fEXT = provider.getFunctionAddress("glProgramUniform1fEXT"); + glProgramUniform2fEXT = provider.getFunctionAddress("glProgramUniform2fEXT"); + glProgramUniform3fEXT = provider.getFunctionAddress("glProgramUniform3fEXT"); + glProgramUniform4fEXT = provider.getFunctionAddress("glProgramUniform4fEXT"); + glProgramUniform1iEXT = provider.getFunctionAddress("glProgramUniform1iEXT"); + glProgramUniform2iEXT = provider.getFunctionAddress("glProgramUniform2iEXT"); + glProgramUniform3iEXT = provider.getFunctionAddress("glProgramUniform3iEXT"); + glProgramUniform4iEXT = provider.getFunctionAddress("glProgramUniform4iEXT"); + glProgramUniform1fvEXT = provider.getFunctionAddress("glProgramUniform1fvEXT"); + glProgramUniform2fvEXT = provider.getFunctionAddress("glProgramUniform2fvEXT"); + glProgramUniform3fvEXT = provider.getFunctionAddress("glProgramUniform3fvEXT"); + glProgramUniform4fvEXT = provider.getFunctionAddress("glProgramUniform4fvEXT"); + glProgramUniform1ivEXT = provider.getFunctionAddress("glProgramUniform1ivEXT"); + glProgramUniform2ivEXT = provider.getFunctionAddress("glProgramUniform2ivEXT"); + glProgramUniform3ivEXT = provider.getFunctionAddress("glProgramUniform3ivEXT"); + glProgramUniform4ivEXT = provider.getFunctionAddress("glProgramUniform4ivEXT"); + glProgramUniformMatrix2fvEXT = provider.getFunctionAddress("glProgramUniformMatrix2fvEXT"); + glProgramUniformMatrix3fvEXT = provider.getFunctionAddress("glProgramUniformMatrix3fvEXT"); + glProgramUniformMatrix4fvEXT = provider.getFunctionAddress("glProgramUniformMatrix4fvEXT"); + glProgramUniformMatrix2x3fvEXT = provider.getFunctionAddress("glProgramUniformMatrix2x3fvEXT"); + glProgramUniformMatrix3x2fvEXT = provider.getFunctionAddress("glProgramUniformMatrix3x2fvEXT"); + glProgramUniformMatrix2x4fvEXT = provider.getFunctionAddress("glProgramUniformMatrix2x4fvEXT"); + glProgramUniformMatrix4x2fvEXT = provider.getFunctionAddress("glProgramUniformMatrix4x2fvEXT"); + glProgramUniformMatrix3x4fvEXT = provider.getFunctionAddress("glProgramUniformMatrix3x4fvEXT"); + glProgramUniformMatrix4x3fvEXT = provider.getFunctionAddress("glProgramUniformMatrix4x3fvEXT"); + glTextureBufferEXT = provider.getFunctionAddress("glTextureBufferEXT"); + glMultiTexBufferEXT = provider.getFunctionAddress("glMultiTexBufferEXT"); + glTextureParameterIivEXT = provider.getFunctionAddress("glTextureParameterIivEXT"); + glTextureParameterIuivEXT = provider.getFunctionAddress("glTextureParameterIuivEXT"); + glGetTextureParameterIivEXT = provider.getFunctionAddress("glGetTextureParameterIivEXT"); + glGetTextureParameterIuivEXT = provider.getFunctionAddress("glGetTextureParameterIuivEXT"); + glMultiTexParameterIivEXT = provider.getFunctionAddress("glMultiTexParameterIivEXT"); + glMultiTexParameterIuivEXT = provider.getFunctionAddress("glMultiTexParameterIuivEXT"); + glGetMultiTexParameterIivEXT = provider.getFunctionAddress("glGetMultiTexParameterIivEXT"); + glGetMultiTexParameterIuivEXT = provider.getFunctionAddress("glGetMultiTexParameterIuivEXT"); + glProgramUniform1uiEXT = provider.getFunctionAddress("glProgramUniform1uiEXT"); + glProgramUniform2uiEXT = provider.getFunctionAddress("glProgramUniform2uiEXT"); + glProgramUniform3uiEXT = provider.getFunctionAddress("glProgramUniform3uiEXT"); + glProgramUniform4uiEXT = provider.getFunctionAddress("glProgramUniform4uiEXT"); + glProgramUniform1uivEXT = provider.getFunctionAddress("glProgramUniform1uivEXT"); + glProgramUniform2uivEXT = provider.getFunctionAddress("glProgramUniform2uivEXT"); + glProgramUniform3uivEXT = provider.getFunctionAddress("glProgramUniform3uivEXT"); + glProgramUniform4uivEXT = provider.getFunctionAddress("glProgramUniform4uivEXT"); + glNamedProgramLocalParameters4fvEXT = provider.getFunctionAddress("glNamedProgramLocalParameters4fvEXT"); + glNamedProgramLocalParameterI4iEXT = provider.getFunctionAddress("glNamedProgramLocalParameterI4iEXT"); + glNamedProgramLocalParameterI4ivEXT = provider.getFunctionAddress("glNamedProgramLocalParameterI4ivEXT"); + glNamedProgramLocalParametersI4ivEXT = provider.getFunctionAddress("glNamedProgramLocalParametersI4ivEXT"); + glNamedProgramLocalParameterI4uiEXT = provider.getFunctionAddress("glNamedProgramLocalParameterI4uiEXT"); + glNamedProgramLocalParameterI4uivEXT = provider.getFunctionAddress("glNamedProgramLocalParameterI4uivEXT"); + glNamedProgramLocalParametersI4uivEXT = provider.getFunctionAddress("glNamedProgramLocalParametersI4uivEXT"); + glGetNamedProgramLocalParameterIivEXT = provider.getFunctionAddress("glGetNamedProgramLocalParameterIivEXT"); + glGetNamedProgramLocalParameterIuivEXT = provider.getFunctionAddress("glGetNamedProgramLocalParameterIuivEXT"); + glNamedRenderbufferStorageEXT = provider.getFunctionAddress("glNamedRenderbufferStorageEXT"); + glGetNamedRenderbufferParameterivEXT = provider.getFunctionAddress("glGetNamedRenderbufferParameterivEXT"); + glNamedRenderbufferStorageMultisampleEXT = provider.getFunctionAddress("glNamedRenderbufferStorageMultisampleEXT"); + glNamedRenderbufferStorageMultisampleCoverageEXT = provider.getFunctionAddress("glNamedRenderbufferStorageMultisampleCoverageEXT"); + glCheckNamedFramebufferStatusEXT = provider.getFunctionAddress("glCheckNamedFramebufferStatusEXT"); + glNamedFramebufferTexture1DEXT = provider.getFunctionAddress("glNamedFramebufferTexture1DEXT"); + glNamedFramebufferTexture2DEXT = provider.getFunctionAddress("glNamedFramebufferTexture2DEXT"); + glNamedFramebufferTexture3DEXT = provider.getFunctionAddress("glNamedFramebufferTexture3DEXT"); + glNamedFramebufferRenderbufferEXT = provider.getFunctionAddress("glNamedFramebufferRenderbufferEXT"); + glGetNamedFramebufferAttachmentParameterivEXT = provider.getFunctionAddress("glGetNamedFramebufferAttachmentParameterivEXT"); + glGenerateTextureMipmapEXT = provider.getFunctionAddress("glGenerateTextureMipmapEXT"); + glGenerateMultiTexMipmapEXT = provider.getFunctionAddress("glGenerateMultiTexMipmapEXT"); + glFramebufferDrawBufferEXT = provider.getFunctionAddress("glFramebufferDrawBufferEXT"); + glFramebufferDrawBuffersEXT = provider.getFunctionAddress("glFramebufferDrawBuffersEXT"); + glFramebufferReadBufferEXT = provider.getFunctionAddress("glFramebufferReadBufferEXT"); + glGetFramebufferParameterivEXT = provider.getFunctionAddress("glGetFramebufferParameterivEXT"); + glNamedCopyBufferSubDataEXT = provider.getFunctionAddress("glNamedCopyBufferSubDataEXT"); + glNamedFramebufferTextureEXT = provider.getFunctionAddress("glNamedFramebufferTextureEXT"); + glNamedFramebufferTextureLayerEXT = provider.getFunctionAddress("glNamedFramebufferTextureLayerEXT"); + glNamedFramebufferTextureFaceEXT = provider.getFunctionAddress("glNamedFramebufferTextureFaceEXT"); + glTextureRenderbufferEXT = provider.getFunctionAddress("glTextureRenderbufferEXT"); + glMultiTexRenderbufferEXT = provider.getFunctionAddress("glMultiTexRenderbufferEXT"); + glVertexArrayVertexOffsetEXT = provider.getFunctionAddress("glVertexArrayVertexOffsetEXT"); + glVertexArrayColorOffsetEXT = provider.getFunctionAddress("glVertexArrayColorOffsetEXT"); + glVertexArrayEdgeFlagOffsetEXT = provider.getFunctionAddress("glVertexArrayEdgeFlagOffsetEXT"); + glVertexArrayIndexOffsetEXT = provider.getFunctionAddress("glVertexArrayIndexOffsetEXT"); + glVertexArrayNormalOffsetEXT = provider.getFunctionAddress("glVertexArrayNormalOffsetEXT"); + glVertexArrayTexCoordOffsetEXT = provider.getFunctionAddress("glVertexArrayTexCoordOffsetEXT"); + glVertexArrayMultiTexCoordOffsetEXT = provider.getFunctionAddress("glVertexArrayMultiTexCoordOffsetEXT"); + glVertexArrayFogCoordOffsetEXT = provider.getFunctionAddress("glVertexArrayFogCoordOffsetEXT"); + glVertexArraySecondaryColorOffsetEXT = provider.getFunctionAddress("glVertexArraySecondaryColorOffsetEXT"); + glVertexArrayVertexAttribOffsetEXT = provider.getFunctionAddress("glVertexArrayVertexAttribOffsetEXT"); + glVertexArrayVertexAttribIOffsetEXT = provider.getFunctionAddress("glVertexArrayVertexAttribIOffsetEXT"); + glEnableVertexArrayEXT = provider.getFunctionAddress("glEnableVertexArrayEXT"); + glDisableVertexArrayEXT = provider.getFunctionAddress("glDisableVertexArrayEXT"); + glEnableVertexArrayAttribEXT = provider.getFunctionAddress("glEnableVertexArrayAttribEXT"); + glDisableVertexArrayAttribEXT = provider.getFunctionAddress("glDisableVertexArrayAttribEXT"); + glGetVertexArrayIntegervEXT = provider.getFunctionAddress("glGetVertexArrayIntegervEXT"); + glGetVertexArrayPointervEXT = provider.getFunctionAddress("glGetVertexArrayPointervEXT"); + glGetVertexArrayIntegeri_vEXT = provider.getFunctionAddress("glGetVertexArrayIntegeri_vEXT"); + glGetVertexArrayPointeri_vEXT = provider.getFunctionAddress("glGetVertexArrayPointeri_vEXT"); + glMapNamedBufferRangeEXT = provider.getFunctionAddress("glMapNamedBufferRangeEXT"); + glFlushMappedNamedBufferRangeEXT = provider.getFunctionAddress("glFlushMappedNamedBufferRangeEXT"); + glColorMaskIndexedEXT = provider.getFunctionAddress("glColorMaskIndexedEXT"); + glGetBooleanIndexedvEXT = provider.getFunctionAddress("glGetBooleanIndexedvEXT"); + glGetIntegerIndexedvEXT = provider.getFunctionAddress("glGetIntegerIndexedvEXT"); + glEnableIndexedEXT = provider.getFunctionAddress("glEnableIndexedEXT"); + glDisableIndexedEXT = provider.getFunctionAddress("glDisableIndexedEXT"); + glIsEnabledIndexedEXT = provider.getFunctionAddress("glIsEnabledIndexedEXT"); + glDrawArraysInstancedEXT = provider.getFunctionAddress("glDrawArraysInstancedEXT"); + glDrawElementsInstancedEXT = provider.getFunctionAddress("glDrawElementsInstancedEXT"); + glEGLImageTargetTexStorageEXT = provider.getFunctionAddress("glEGLImageTargetTexStorageEXT"); + glEGLImageTargetTextureStorageEXT = provider.getFunctionAddress("glEGLImageTargetTextureStorageEXT"); + glBufferStorageExternalEXT = provider.getFunctionAddress("glBufferStorageExternalEXT"); + glNamedBufferStorageExternalEXT = provider.getFunctionAddress("glNamedBufferStorageExternalEXT"); + glBlitFramebufferEXT = provider.getFunctionAddress("glBlitFramebufferEXT"); + glRenderbufferStorageMultisampleEXT = provider.getFunctionAddress("glRenderbufferStorageMultisampleEXT"); + glIsRenderbufferEXT = provider.getFunctionAddress("glIsRenderbufferEXT"); + glBindRenderbufferEXT = provider.getFunctionAddress("glBindRenderbufferEXT"); + glDeleteRenderbuffersEXT = provider.getFunctionAddress("glDeleteRenderbuffersEXT"); + glGenRenderbuffersEXT = provider.getFunctionAddress("glGenRenderbuffersEXT"); + glRenderbufferStorageEXT = provider.getFunctionAddress("glRenderbufferStorageEXT"); + glGetRenderbufferParameterivEXT = provider.getFunctionAddress("glGetRenderbufferParameterivEXT"); + glIsFramebufferEXT = provider.getFunctionAddress("glIsFramebufferEXT"); + glBindFramebufferEXT = provider.getFunctionAddress("glBindFramebufferEXT"); + glDeleteFramebuffersEXT = provider.getFunctionAddress("glDeleteFramebuffersEXT"); + glGenFramebuffersEXT = provider.getFunctionAddress("glGenFramebuffersEXT"); + glCheckFramebufferStatusEXT = provider.getFunctionAddress("glCheckFramebufferStatusEXT"); + glFramebufferTexture1DEXT = provider.getFunctionAddress("glFramebufferTexture1DEXT"); + glFramebufferTexture2DEXT = provider.getFunctionAddress("glFramebufferTexture2DEXT"); + glFramebufferTexture3DEXT = provider.getFunctionAddress("glFramebufferTexture3DEXT"); + glFramebufferRenderbufferEXT = provider.getFunctionAddress("glFramebufferRenderbufferEXT"); + glGetFramebufferAttachmentParameterivEXT = provider.getFunctionAddress("glGetFramebufferAttachmentParameterivEXT"); + glGenerateMipmapEXT = provider.getFunctionAddress("glGenerateMipmapEXT"); + glProgramParameteriEXT = provider.getFunctionAddress("glProgramParameteriEXT"); + glFramebufferTextureEXT = provider.getFunctionAddress("glFramebufferTextureEXT"); + glFramebufferTextureFaceEXT = provider.getFunctionAddress("glFramebufferTextureFaceEXT"); + glProgramEnvParameters4fvEXT = provider.getFunctionAddress("glProgramEnvParameters4fvEXT"); + glProgramLocalParameters4fvEXT = provider.getFunctionAddress("glProgramLocalParameters4fvEXT"); + glVertexAttribI1iEXT = provider.getFunctionAddress("glVertexAttribI1iEXT"); + glVertexAttribI2iEXT = provider.getFunctionAddress("glVertexAttribI2iEXT"); + glVertexAttribI3iEXT = provider.getFunctionAddress("glVertexAttribI3iEXT"); + glVertexAttribI4iEXT = provider.getFunctionAddress("glVertexAttribI4iEXT"); + glVertexAttribI1uiEXT = provider.getFunctionAddress("glVertexAttribI1uiEXT"); + glVertexAttribI2uiEXT = provider.getFunctionAddress("glVertexAttribI2uiEXT"); + glVertexAttribI3uiEXT = provider.getFunctionAddress("glVertexAttribI3uiEXT"); + glVertexAttribI4uiEXT = provider.getFunctionAddress("glVertexAttribI4uiEXT"); + glVertexAttribI1ivEXT = provider.getFunctionAddress("glVertexAttribI1ivEXT"); + glVertexAttribI2ivEXT = provider.getFunctionAddress("glVertexAttribI2ivEXT"); + glVertexAttribI3ivEXT = provider.getFunctionAddress("glVertexAttribI3ivEXT"); + glVertexAttribI4ivEXT = provider.getFunctionAddress("glVertexAttribI4ivEXT"); + glVertexAttribI1uivEXT = provider.getFunctionAddress("glVertexAttribI1uivEXT"); + glVertexAttribI2uivEXT = provider.getFunctionAddress("glVertexAttribI2uivEXT"); + glVertexAttribI3uivEXT = provider.getFunctionAddress("glVertexAttribI3uivEXT"); + glVertexAttribI4uivEXT = provider.getFunctionAddress("glVertexAttribI4uivEXT"); + glVertexAttribI4bvEXT = provider.getFunctionAddress("glVertexAttribI4bvEXT"); + glVertexAttribI4svEXT = provider.getFunctionAddress("glVertexAttribI4svEXT"); + glVertexAttribI4ubvEXT = provider.getFunctionAddress("glVertexAttribI4ubvEXT"); + glVertexAttribI4usvEXT = provider.getFunctionAddress("glVertexAttribI4usvEXT"); + glVertexAttribIPointerEXT = provider.getFunctionAddress("glVertexAttribIPointerEXT"); + glGetVertexAttribIivEXT = provider.getFunctionAddress("glGetVertexAttribIivEXT"); + glGetVertexAttribIuivEXT = provider.getFunctionAddress("glGetVertexAttribIuivEXT"); + glGetUniformuivEXT = provider.getFunctionAddress("glGetUniformuivEXT"); + glBindFragDataLocationEXT = provider.getFunctionAddress("glBindFragDataLocationEXT"); + glGetFragDataLocationEXT = provider.getFunctionAddress("glGetFragDataLocationEXT"); + glUniform1uiEXT = provider.getFunctionAddress("glUniform1uiEXT"); + glUniform2uiEXT = provider.getFunctionAddress("glUniform2uiEXT"); + glUniform3uiEXT = provider.getFunctionAddress("glUniform3uiEXT"); + glUniform4uiEXT = provider.getFunctionAddress("glUniform4uiEXT"); + glUniform1uivEXT = provider.getFunctionAddress("glUniform1uivEXT"); + glUniform2uivEXT = provider.getFunctionAddress("glUniform2uivEXT"); + glUniform3uivEXT = provider.getFunctionAddress("glUniform3uivEXT"); + glUniform4uivEXT = provider.getFunctionAddress("glUniform4uivEXT"); + glGetUnsignedBytevEXT = provider.getFunctionAddress("glGetUnsignedBytevEXT"); + glGetUnsignedBytei_vEXT = provider.getFunctionAddress("glGetUnsignedBytei_vEXT"); + glDeleteMemoryObjectsEXT = provider.getFunctionAddress("glDeleteMemoryObjectsEXT"); + glIsMemoryObjectEXT = provider.getFunctionAddress("glIsMemoryObjectEXT"); + glCreateMemoryObjectsEXT = provider.getFunctionAddress("glCreateMemoryObjectsEXT"); + glMemoryObjectParameterivEXT = provider.getFunctionAddress("glMemoryObjectParameterivEXT"); + glGetMemoryObjectParameterivEXT = provider.getFunctionAddress("glGetMemoryObjectParameterivEXT"); + glTexStorageMem2DEXT = provider.getFunctionAddress("glTexStorageMem2DEXT"); + glTexStorageMem2DMultisampleEXT = provider.getFunctionAddress("glTexStorageMem2DMultisampleEXT"); + glTexStorageMem3DEXT = provider.getFunctionAddress("glTexStorageMem3DEXT"); + glTexStorageMem3DMultisampleEXT = provider.getFunctionAddress("glTexStorageMem3DMultisampleEXT"); + glBufferStorageMemEXT = provider.getFunctionAddress("glBufferStorageMemEXT"); + glTextureStorageMem2DEXT = provider.getFunctionAddress("glTextureStorageMem2DEXT"); + glTextureStorageMem2DMultisampleEXT = provider.getFunctionAddress("glTextureStorageMem2DMultisampleEXT"); + glTextureStorageMem3DEXT = provider.getFunctionAddress("glTextureStorageMem3DEXT"); + glTextureStorageMem3DMultisampleEXT = provider.getFunctionAddress("glTextureStorageMem3DMultisampleEXT"); + glNamedBufferStorageMemEXT = provider.getFunctionAddress("glNamedBufferStorageMemEXT"); + glTexStorageMem1DEXT = provider.getFunctionAddress("glTexStorageMem1DEXT"); + glTextureStorageMem1DEXT = provider.getFunctionAddress("glTextureStorageMem1DEXT"); + glImportMemoryFdEXT = provider.getFunctionAddress("glImportMemoryFdEXT"); + glImportMemoryWin32HandleEXT = provider.getFunctionAddress("glImportMemoryWin32HandleEXT"); + glImportMemoryWin32NameEXT = provider.getFunctionAddress("glImportMemoryWin32NameEXT"); + glPointParameterfEXT = provider.getFunctionAddress("glPointParameterfEXT"); + glPointParameterfvEXT = provider.getFunctionAddress("glPointParameterfvEXT"); + glPolygonOffsetClampEXT = provider.getFunctionAddress("glPolygonOffsetClampEXT"); + glProvokingVertexEXT = provider.getFunctionAddress("glProvokingVertexEXT"); + glRasterSamplesEXT = provider.getFunctionAddress("glRasterSamplesEXT"); + glSecondaryColor3bEXT = provider.getFunctionAddress("glSecondaryColor3bEXT"); + glSecondaryColor3sEXT = provider.getFunctionAddress("glSecondaryColor3sEXT"); + glSecondaryColor3iEXT = provider.getFunctionAddress("glSecondaryColor3iEXT"); + glSecondaryColor3fEXT = provider.getFunctionAddress("glSecondaryColor3fEXT"); + glSecondaryColor3dEXT = provider.getFunctionAddress("glSecondaryColor3dEXT"); + glSecondaryColor3ubEXT = provider.getFunctionAddress("glSecondaryColor3ubEXT"); + glSecondaryColor3usEXT = provider.getFunctionAddress("glSecondaryColor3usEXT"); + glSecondaryColor3uiEXT = provider.getFunctionAddress("glSecondaryColor3uiEXT"); + glSecondaryColor3bvEXT = provider.getFunctionAddress("glSecondaryColor3bvEXT"); + glSecondaryColor3svEXT = provider.getFunctionAddress("glSecondaryColor3svEXT"); + glSecondaryColor3ivEXT = provider.getFunctionAddress("glSecondaryColor3ivEXT"); + glSecondaryColor3fvEXT = provider.getFunctionAddress("glSecondaryColor3fvEXT"); + glSecondaryColor3dvEXT = provider.getFunctionAddress("glSecondaryColor3dvEXT"); + glSecondaryColor3ubvEXT = provider.getFunctionAddress("glSecondaryColor3ubvEXT"); + glSecondaryColor3usvEXT = provider.getFunctionAddress("glSecondaryColor3usvEXT"); + glSecondaryColor3uivEXT = provider.getFunctionAddress("glSecondaryColor3uivEXT"); + glSecondaryColorPointerEXT = provider.getFunctionAddress("glSecondaryColorPointerEXT"); + glGenSemaphoresEXT = provider.getFunctionAddress("glGenSemaphoresEXT"); + glDeleteSemaphoresEXT = provider.getFunctionAddress("glDeleteSemaphoresEXT"); + glIsSemaphoreEXT = provider.getFunctionAddress("glIsSemaphoreEXT"); + glSemaphoreParameterui64vEXT = provider.getFunctionAddress("glSemaphoreParameterui64vEXT"); + glGetSemaphoreParameterui64vEXT = provider.getFunctionAddress("glGetSemaphoreParameterui64vEXT"); + glWaitSemaphoreEXT = provider.getFunctionAddress("glWaitSemaphoreEXT"); + glSignalSemaphoreEXT = provider.getFunctionAddress("glSignalSemaphoreEXT"); + glImportSemaphoreFdEXT = provider.getFunctionAddress("glImportSemaphoreFdEXT"); + glImportSemaphoreWin32HandleEXT = provider.getFunctionAddress("glImportSemaphoreWin32HandleEXT"); + glImportSemaphoreWin32NameEXT = provider.getFunctionAddress("glImportSemaphoreWin32NameEXT"); + glUseShaderProgramEXT = provider.getFunctionAddress("glUseShaderProgramEXT"); + glActiveProgramEXT = provider.getFunctionAddress("glActiveProgramEXT"); + glCreateShaderProgramEXT = provider.getFunctionAddress("glCreateShaderProgramEXT"); + glFramebufferFetchBarrierEXT = provider.getFunctionAddress("glFramebufferFetchBarrierEXT"); + glBindImageTextureEXT = provider.getFunctionAddress("glBindImageTextureEXT"); + glMemoryBarrierEXT = provider.getFunctionAddress("glMemoryBarrierEXT"); + glStencilClearTagEXT = provider.getFunctionAddress("glStencilClearTagEXT"); + glActiveStencilFaceEXT = provider.getFunctionAddress("glActiveStencilFaceEXT"); + glFramebufferTextureLayerEXT = provider.getFunctionAddress("glFramebufferTextureLayerEXT"); + glTexBufferEXT = provider.getFunctionAddress("glTexBufferEXT"); + glClearColorIiEXT = provider.getFunctionAddress("glClearColorIiEXT"); + glClearColorIuiEXT = provider.getFunctionAddress("glClearColorIuiEXT"); + glTexParameterIivEXT = provider.getFunctionAddress("glTexParameterIivEXT"); + glTexParameterIuivEXT = provider.getFunctionAddress("glTexParameterIuivEXT"); + glGetTexParameterIivEXT = provider.getFunctionAddress("glGetTexParameterIivEXT"); + glGetTexParameterIuivEXT = provider.getFunctionAddress("glGetTexParameterIuivEXT"); + glGetQueryObjecti64vEXT = provider.getFunctionAddress("glGetQueryObjecti64vEXT"); + glGetQueryObjectui64vEXT = provider.getFunctionAddress("glGetQueryObjectui64vEXT"); + glBindBufferRangeEXT = provider.getFunctionAddress("glBindBufferRangeEXT"); + glBindBufferOffsetEXT = provider.getFunctionAddress("glBindBufferOffsetEXT"); + glBindBufferBaseEXT = provider.getFunctionAddress("glBindBufferBaseEXT"); + glBeginTransformFeedbackEXT = provider.getFunctionAddress("glBeginTransformFeedbackEXT"); + glEndTransformFeedbackEXT = provider.getFunctionAddress("glEndTransformFeedbackEXT"); + glTransformFeedbackVaryingsEXT = provider.getFunctionAddress("glTransformFeedbackVaryingsEXT"); + glGetTransformFeedbackVaryingEXT = provider.getFunctionAddress("glGetTransformFeedbackVaryingEXT"); + glVertexAttribL1dEXT = provider.getFunctionAddress("glVertexAttribL1dEXT"); + glVertexAttribL2dEXT = provider.getFunctionAddress("glVertexAttribL2dEXT"); + glVertexAttribL3dEXT = provider.getFunctionAddress("glVertexAttribL3dEXT"); + glVertexAttribL4dEXT = provider.getFunctionAddress("glVertexAttribL4dEXT"); + glVertexAttribL1dvEXT = provider.getFunctionAddress("glVertexAttribL1dvEXT"); + glVertexAttribL2dvEXT = provider.getFunctionAddress("glVertexAttribL2dvEXT"); + glVertexAttribL3dvEXT = provider.getFunctionAddress("glVertexAttribL3dvEXT"); + glVertexAttribL4dvEXT = provider.getFunctionAddress("glVertexAttribL4dvEXT"); + glVertexAttribLPointerEXT = provider.getFunctionAddress("glVertexAttribLPointerEXT"); + glGetVertexAttribLdvEXT = provider.getFunctionAddress("glGetVertexAttribLdvEXT"); + glAcquireKeyedMutexWin32EXT = provider.getFunctionAddress("glAcquireKeyedMutexWin32EXT"); + glReleaseKeyedMutexWin32EXT = provider.getFunctionAddress("glReleaseKeyedMutexWin32EXT"); + glWindowRectanglesEXT = provider.getFunctionAddress("glWindowRectanglesEXT"); + glImportSyncEXT = provider.getFunctionAddress("glImportSyncEXT"); + glFrameTerminatorGREMEDY = provider.getFunctionAddress("glFrameTerminatorGREMEDY"); + glStringMarkerGREMEDY = provider.getFunctionAddress("glStringMarkerGREMEDY"); + glApplyFramebufferAttachmentCMAAINTEL = provider.getFunctionAddress("glApplyFramebufferAttachmentCMAAINTEL"); + glSyncTextureINTEL = provider.getFunctionAddress("glSyncTextureINTEL"); + glUnmapTexture2DINTEL = provider.getFunctionAddress("glUnmapTexture2DINTEL"); + glMapTexture2DINTEL = provider.getFunctionAddress("glMapTexture2DINTEL"); + glBeginPerfQueryINTEL = provider.getFunctionAddress("glBeginPerfQueryINTEL"); + glCreatePerfQueryINTEL = provider.getFunctionAddress("glCreatePerfQueryINTEL"); + glDeletePerfQueryINTEL = provider.getFunctionAddress("glDeletePerfQueryINTEL"); + glEndPerfQueryINTEL = provider.getFunctionAddress("glEndPerfQueryINTEL"); + glGetFirstPerfQueryIdINTEL = provider.getFunctionAddress("glGetFirstPerfQueryIdINTEL"); + glGetNextPerfQueryIdINTEL = provider.getFunctionAddress("glGetNextPerfQueryIdINTEL"); + glGetPerfCounterInfoINTEL = provider.getFunctionAddress("glGetPerfCounterInfoINTEL"); + glGetPerfQueryDataINTEL = provider.getFunctionAddress("glGetPerfQueryDataINTEL"); + glGetPerfQueryIdByNameINTEL = provider.getFunctionAddress("glGetPerfQueryIdByNameINTEL"); + glGetPerfQueryInfoINTEL = provider.getFunctionAddress("glGetPerfQueryInfoINTEL"); + glBlendBarrierKHR = provider.getFunctionAddress("glBlendBarrierKHR"); + glMaxShaderCompilerThreadsKHR = provider.getFunctionAddress("glMaxShaderCompilerThreadsKHR"); + glAlphaToCoverageDitherControlNV = provider.getFunctionAddress("glAlphaToCoverageDitherControlNV"); + glMultiDrawArraysIndirectBindlessNV = provider.getFunctionAddress("glMultiDrawArraysIndirectBindlessNV"); + glMultiDrawElementsIndirectBindlessNV = provider.getFunctionAddress("glMultiDrawElementsIndirectBindlessNV"); + glMultiDrawArraysIndirectBindlessCountNV = provider.getFunctionAddress("glMultiDrawArraysIndirectBindlessCountNV"); + glMultiDrawElementsIndirectBindlessCountNV = provider.getFunctionAddress("glMultiDrawElementsIndirectBindlessCountNV"); + glGetTextureHandleNV = provider.getFunctionAddress("glGetTextureHandleNV"); + glGetTextureSamplerHandleNV = provider.getFunctionAddress("glGetTextureSamplerHandleNV"); + glMakeTextureHandleResidentNV = provider.getFunctionAddress("glMakeTextureHandleResidentNV"); + glMakeTextureHandleNonResidentNV = provider.getFunctionAddress("glMakeTextureHandleNonResidentNV"); + glGetImageHandleNV = provider.getFunctionAddress("glGetImageHandleNV"); + glMakeImageHandleResidentNV = provider.getFunctionAddress("glMakeImageHandleResidentNV"); + glMakeImageHandleNonResidentNV = provider.getFunctionAddress("glMakeImageHandleNonResidentNV"); + glUniformHandleui64NV = provider.getFunctionAddress("glUniformHandleui64NV"); + glUniformHandleui64vNV = provider.getFunctionAddress("glUniformHandleui64vNV"); + glProgramUniformHandleui64NV = provider.getFunctionAddress("glProgramUniformHandleui64NV"); + glProgramUniformHandleui64vNV = provider.getFunctionAddress("glProgramUniformHandleui64vNV"); + glIsTextureHandleResidentNV = provider.getFunctionAddress("glIsTextureHandleResidentNV"); + glIsImageHandleResidentNV = provider.getFunctionAddress("glIsImageHandleResidentNV"); + glBlendParameteriNV = provider.getFunctionAddress("glBlendParameteriNV"); + glBlendBarrierNV = provider.getFunctionAddress("glBlendBarrierNV"); + glViewportPositionWScaleNV = provider.getFunctionAddress("glViewportPositionWScaleNV"); + glCreateStatesNV = provider.getFunctionAddress("glCreateStatesNV"); + glDeleteStatesNV = provider.getFunctionAddress("glDeleteStatesNV"); + glIsStateNV = provider.getFunctionAddress("glIsStateNV"); + glStateCaptureNV = provider.getFunctionAddress("glStateCaptureNV"); + glGetCommandHeaderNV = provider.getFunctionAddress("glGetCommandHeaderNV"); + glGetStageIndexNV = provider.getFunctionAddress("glGetStageIndexNV"); + glDrawCommandsNV = provider.getFunctionAddress("glDrawCommandsNV"); + glDrawCommandsAddressNV = provider.getFunctionAddress("glDrawCommandsAddressNV"); + glDrawCommandsStatesNV = provider.getFunctionAddress("glDrawCommandsStatesNV"); + glDrawCommandsStatesAddressNV = provider.getFunctionAddress("glDrawCommandsStatesAddressNV"); + glCreateCommandListsNV = provider.getFunctionAddress("glCreateCommandListsNV"); + glDeleteCommandListsNV = provider.getFunctionAddress("glDeleteCommandListsNV"); + glIsCommandListNV = provider.getFunctionAddress("glIsCommandListNV"); + glListDrawCommandsStatesClientNV = provider.getFunctionAddress("glListDrawCommandsStatesClientNV"); + glCommandListSegmentsNV = provider.getFunctionAddress("glCommandListSegmentsNV"); + glCompileCommandListNV = provider.getFunctionAddress("glCompileCommandListNV"); + glCallCommandListNV = provider.getFunctionAddress("glCallCommandListNV"); + glBeginConditionalRenderNV = provider.getFunctionAddress("glBeginConditionalRenderNV"); + glEndConditionalRenderNV = provider.getFunctionAddress("glEndConditionalRenderNV"); + glSubpixelPrecisionBiasNV = provider.getFunctionAddress("glSubpixelPrecisionBiasNV"); + glConservativeRasterParameterfNV = provider.getFunctionAddress("glConservativeRasterParameterfNV"); + glConservativeRasterParameteriNV = provider.getFunctionAddress("glConservativeRasterParameteriNV"); + glCopyImageSubDataNV = provider.getFunctionAddress("glCopyImageSubDataNV"); + glDepthRangedNV = provider.getFunctionAddress("glDepthRangedNV"); + glClearDepthdNV = provider.getFunctionAddress("glClearDepthdNV"); + glDepthBoundsdNV = provider.getFunctionAddress("glDepthBoundsdNV"); + glDrawTextureNV = provider.getFunctionAddress("glDrawTextureNV"); + glDrawVkImageNV = provider.getFunctionAddress("glDrawVkImageNV"); + glGetVkProcAddrNV = provider.getFunctionAddress("glGetVkProcAddrNV"); + glWaitVkSemaphoreNV = provider.getFunctionAddress("glWaitVkSemaphoreNV"); + glSignalVkSemaphoreNV = provider.getFunctionAddress("glSignalVkSemaphoreNV"); + glSignalVkFenceNV = provider.getFunctionAddress("glSignalVkFenceNV"); + glGetMultisamplefvNV = provider.getFunctionAddress("glGetMultisamplefvNV"); + glSampleMaskIndexedNV = provider.getFunctionAddress("glSampleMaskIndexedNV"); + glTexRenderbufferNV = provider.getFunctionAddress("glTexRenderbufferNV"); + glDeleteFencesNV = provider.getFunctionAddress("glDeleteFencesNV"); + glGenFencesNV = provider.getFunctionAddress("glGenFencesNV"); + glIsFenceNV = provider.getFunctionAddress("glIsFenceNV"); + glTestFenceNV = provider.getFunctionAddress("glTestFenceNV"); + glGetFenceivNV = provider.getFunctionAddress("glGetFenceivNV"); + glFinishFenceNV = provider.getFunctionAddress("glFinishFenceNV"); + glSetFenceNV = provider.getFunctionAddress("glSetFenceNV"); + glFragmentCoverageColorNV = provider.getFunctionAddress("glFragmentCoverageColorNV"); + glCoverageModulationTableNV = provider.getFunctionAddress("glCoverageModulationTableNV"); + glGetCoverageModulationTableNV = provider.getFunctionAddress("glGetCoverageModulationTableNV"); + glCoverageModulationNV = provider.getFunctionAddress("glCoverageModulationNV"); + glRenderbufferStorageMultisampleCoverageNV = provider.getFunctionAddress("glRenderbufferStorageMultisampleCoverageNV"); + glRenderGpuMaskNV = provider.getFunctionAddress("glRenderGpuMaskNV"); + glMulticastBufferSubDataNV = provider.getFunctionAddress("glMulticastBufferSubDataNV"); + glMulticastCopyBufferSubDataNV = provider.getFunctionAddress("glMulticastCopyBufferSubDataNV"); + glMulticastCopyImageSubDataNV = provider.getFunctionAddress("glMulticastCopyImageSubDataNV"); + glMulticastBlitFramebufferNV = provider.getFunctionAddress("glMulticastBlitFramebufferNV"); + glMulticastFramebufferSampleLocationsfvNV = provider.getFunctionAddress("glMulticastFramebufferSampleLocationsfvNV"); + glMulticastBarrierNV = provider.getFunctionAddress("glMulticastBarrierNV"); + glMulticastWaitSyncNV = provider.getFunctionAddress("glMulticastWaitSyncNV"); + glMulticastGetQueryObjectivNV = provider.getFunctionAddress("glMulticastGetQueryObjectivNV"); + glMulticastGetQueryObjectuivNV = provider.getFunctionAddress("glMulticastGetQueryObjectuivNV"); + glMulticastGetQueryObjecti64vNV = provider.getFunctionAddress("glMulticastGetQueryObjecti64vNV"); + glMulticastGetQueryObjectui64vNV = provider.getFunctionAddress("glMulticastGetQueryObjectui64vNV"); + glUniform1i64NV = provider.getFunctionAddress("glUniform1i64NV"); + glUniform2i64NV = provider.getFunctionAddress("glUniform2i64NV"); + glUniform3i64NV = provider.getFunctionAddress("glUniform3i64NV"); + glUniform4i64NV = provider.getFunctionAddress("glUniform4i64NV"); + glUniform1i64vNV = provider.getFunctionAddress("glUniform1i64vNV"); + glUniform2i64vNV = provider.getFunctionAddress("glUniform2i64vNV"); + glUniform3i64vNV = provider.getFunctionAddress("glUniform3i64vNV"); + glUniform4i64vNV = provider.getFunctionAddress("glUniform4i64vNV"); + glUniform1ui64NV = provider.getFunctionAddress("glUniform1ui64NV"); + glUniform2ui64NV = provider.getFunctionAddress("glUniform2ui64NV"); + glUniform3ui64NV = provider.getFunctionAddress("glUniform3ui64NV"); + glUniform4ui64NV = provider.getFunctionAddress("glUniform4ui64NV"); + glUniform1ui64vNV = provider.getFunctionAddress("glUniform1ui64vNV"); + glUniform2ui64vNV = provider.getFunctionAddress("glUniform2ui64vNV"); + glUniform3ui64vNV = provider.getFunctionAddress("glUniform3ui64vNV"); + glUniform4ui64vNV = provider.getFunctionAddress("glUniform4ui64vNV"); + glGetUniformi64vNV = provider.getFunctionAddress("glGetUniformi64vNV"); + glProgramUniform1i64NV = provider.getFunctionAddress("glProgramUniform1i64NV"); + glProgramUniform2i64NV = provider.getFunctionAddress("glProgramUniform2i64NV"); + glProgramUniform3i64NV = provider.getFunctionAddress("glProgramUniform3i64NV"); + glProgramUniform4i64NV = provider.getFunctionAddress("glProgramUniform4i64NV"); + glProgramUniform1i64vNV = provider.getFunctionAddress("glProgramUniform1i64vNV"); + glProgramUniform2i64vNV = provider.getFunctionAddress("glProgramUniform2i64vNV"); + glProgramUniform3i64vNV = provider.getFunctionAddress("glProgramUniform3i64vNV"); + glProgramUniform4i64vNV = provider.getFunctionAddress("glProgramUniform4i64vNV"); + glProgramUniform1ui64NV = provider.getFunctionAddress("glProgramUniform1ui64NV"); + glProgramUniform2ui64NV = provider.getFunctionAddress("glProgramUniform2ui64NV"); + glProgramUniform3ui64NV = provider.getFunctionAddress("glProgramUniform3ui64NV"); + glProgramUniform4ui64NV = provider.getFunctionAddress("glProgramUniform4ui64NV"); + glProgramUniform1ui64vNV = provider.getFunctionAddress("glProgramUniform1ui64vNV"); + glProgramUniform2ui64vNV = provider.getFunctionAddress("glProgramUniform2ui64vNV"); + glProgramUniform3ui64vNV = provider.getFunctionAddress("glProgramUniform3ui64vNV"); + glProgramUniform4ui64vNV = provider.getFunctionAddress("glProgramUniform4ui64vNV"); + glVertex2hNV = provider.getFunctionAddress("glVertex2hNV"); + glVertex2hvNV = provider.getFunctionAddress("glVertex2hvNV"); + glVertex3hNV = provider.getFunctionAddress("glVertex3hNV"); + glVertex3hvNV = provider.getFunctionAddress("glVertex3hvNV"); + glVertex4hNV = provider.getFunctionAddress("glVertex4hNV"); + glVertex4hvNV = provider.getFunctionAddress("glVertex4hvNV"); + glNormal3hNV = provider.getFunctionAddress("glNormal3hNV"); + glNormal3hvNV = provider.getFunctionAddress("glNormal3hvNV"); + glColor3hNV = provider.getFunctionAddress("glColor3hNV"); + glColor3hvNV = provider.getFunctionAddress("glColor3hvNV"); + glColor4hNV = provider.getFunctionAddress("glColor4hNV"); + glColor4hvNV = provider.getFunctionAddress("glColor4hvNV"); + glTexCoord1hNV = provider.getFunctionAddress("glTexCoord1hNV"); + glTexCoord1hvNV = provider.getFunctionAddress("glTexCoord1hvNV"); + glTexCoord2hNV = provider.getFunctionAddress("glTexCoord2hNV"); + glTexCoord2hvNV = provider.getFunctionAddress("glTexCoord2hvNV"); + glTexCoord3hNV = provider.getFunctionAddress("glTexCoord3hNV"); + glTexCoord3hvNV = provider.getFunctionAddress("glTexCoord3hvNV"); + glTexCoord4hNV = provider.getFunctionAddress("glTexCoord4hNV"); + glTexCoord4hvNV = provider.getFunctionAddress("glTexCoord4hvNV"); + glMultiTexCoord1hNV = provider.getFunctionAddress("glMultiTexCoord1hNV"); + glMultiTexCoord1hvNV = provider.getFunctionAddress("glMultiTexCoord1hvNV"); + glMultiTexCoord2hNV = provider.getFunctionAddress("glMultiTexCoord2hNV"); + glMultiTexCoord2hvNV = provider.getFunctionAddress("glMultiTexCoord2hvNV"); + glMultiTexCoord3hNV = provider.getFunctionAddress("glMultiTexCoord3hNV"); + glMultiTexCoord3hvNV = provider.getFunctionAddress("glMultiTexCoord3hvNV"); + glMultiTexCoord4hNV = provider.getFunctionAddress("glMultiTexCoord4hNV"); + glMultiTexCoord4hvNV = provider.getFunctionAddress("glMultiTexCoord4hvNV"); + glFogCoordhNV = provider.getFunctionAddress("glFogCoordhNV"); + glFogCoordhvNV = provider.getFunctionAddress("glFogCoordhvNV"); + glSecondaryColor3hNV = provider.getFunctionAddress("glSecondaryColor3hNV"); + glSecondaryColor3hvNV = provider.getFunctionAddress("glSecondaryColor3hvNV"); + glVertexWeighthNV = provider.getFunctionAddress("glVertexWeighthNV"); + glVertexWeighthvNV = provider.getFunctionAddress("glVertexWeighthvNV"); + glVertexAttrib1hNV = provider.getFunctionAddress("glVertexAttrib1hNV"); + glVertexAttrib1hvNV = provider.getFunctionAddress("glVertexAttrib1hvNV"); + glVertexAttrib2hNV = provider.getFunctionAddress("glVertexAttrib2hNV"); + glVertexAttrib2hvNV = provider.getFunctionAddress("glVertexAttrib2hvNV"); + glVertexAttrib3hNV = provider.getFunctionAddress("glVertexAttrib3hNV"); + glVertexAttrib3hvNV = provider.getFunctionAddress("glVertexAttrib3hvNV"); + glVertexAttrib4hNV = provider.getFunctionAddress("glVertexAttrib4hNV"); + glVertexAttrib4hvNV = provider.getFunctionAddress("glVertexAttrib4hvNV"); + glVertexAttribs1hvNV = provider.getFunctionAddress("glVertexAttribs1hvNV"); + glVertexAttribs2hvNV = provider.getFunctionAddress("glVertexAttribs2hvNV"); + glVertexAttribs3hvNV = provider.getFunctionAddress("glVertexAttribs3hvNV"); + glVertexAttribs4hvNV = provider.getFunctionAddress("glVertexAttribs4hvNV"); + glGetInternalformatSampleivNV = provider.getFunctionAddress("glGetInternalformatSampleivNV"); + glGetMemoryObjectDetachedResourcesuivNV = provider.getFunctionAddress("glGetMemoryObjectDetachedResourcesuivNV"); + glResetMemoryObjectParameterNV = provider.getFunctionAddress("glResetMemoryObjectParameterNV"); + glTexAttachMemoryNV = provider.getFunctionAddress("glTexAttachMemoryNV"); + glBufferAttachMemoryNV = provider.getFunctionAddress("glBufferAttachMemoryNV"); + glTextureAttachMemoryNV = provider.getFunctionAddress("glTextureAttachMemoryNV"); + glNamedBufferAttachMemoryNV = provider.getFunctionAddress("glNamedBufferAttachMemoryNV"); + glDrawMeshTasksNV = provider.getFunctionAddress("glDrawMeshTasksNV"); + glDrawMeshTasksIndirectNV = provider.getFunctionAddress("glDrawMeshTasksIndirectNV"); + glMultiDrawMeshTasksIndirectNV = provider.getFunctionAddress("glMultiDrawMeshTasksIndirectNV"); + glMultiDrawMeshTasksIndirectCountNV = provider.getFunctionAddress("glMultiDrawMeshTasksIndirectCountNV"); + glPathCommandsNV = provider.getFunctionAddress("glPathCommandsNV"); + glPathCoordsNV = provider.getFunctionAddress("glPathCoordsNV"); + glPathSubCommandsNV = provider.getFunctionAddress("glPathSubCommandsNV"); + glPathSubCoordsNV = provider.getFunctionAddress("glPathSubCoordsNV"); + glPathStringNV = provider.getFunctionAddress("glPathStringNV"); + glPathGlyphsNV = provider.getFunctionAddress("glPathGlyphsNV"); + glPathGlyphRangeNV = provider.getFunctionAddress("glPathGlyphRangeNV"); + glPathGlyphIndexArrayNV = provider.getFunctionAddress("glPathGlyphIndexArrayNV"); + glPathMemoryGlyphIndexArrayNV = provider.getFunctionAddress("glPathMemoryGlyphIndexArrayNV"); + glCopyPathNV = provider.getFunctionAddress("glCopyPathNV"); + glWeightPathsNV = provider.getFunctionAddress("glWeightPathsNV"); + glInterpolatePathsNV = provider.getFunctionAddress("glInterpolatePathsNV"); + glTransformPathNV = provider.getFunctionAddress("glTransformPathNV"); + glPathParameterivNV = provider.getFunctionAddress("glPathParameterivNV"); + glPathParameteriNV = provider.getFunctionAddress("glPathParameteriNV"); + glPathParameterfvNV = provider.getFunctionAddress("glPathParameterfvNV"); + glPathParameterfNV = provider.getFunctionAddress("glPathParameterfNV"); + glPathDashArrayNV = provider.getFunctionAddress("glPathDashArrayNV"); + glGenPathsNV = provider.getFunctionAddress("glGenPathsNV"); + glDeletePathsNV = provider.getFunctionAddress("glDeletePathsNV"); + glIsPathNV = provider.getFunctionAddress("glIsPathNV"); + glPathStencilFuncNV = provider.getFunctionAddress("glPathStencilFuncNV"); + glPathStencilDepthOffsetNV = provider.getFunctionAddress("glPathStencilDepthOffsetNV"); + glStencilFillPathNV = provider.getFunctionAddress("glStencilFillPathNV"); + glStencilStrokePathNV = provider.getFunctionAddress("glStencilStrokePathNV"); + glStencilFillPathInstancedNV = provider.getFunctionAddress("glStencilFillPathInstancedNV"); + glStencilStrokePathInstancedNV = provider.getFunctionAddress("glStencilStrokePathInstancedNV"); + glPathCoverDepthFuncNV = provider.getFunctionAddress("glPathCoverDepthFuncNV"); + glPathColorGenNV = provider.getFunctionAddress("glPathColorGenNV"); + glPathTexGenNV = provider.getFunctionAddress("glPathTexGenNV"); + glPathFogGenNV = provider.getFunctionAddress("glPathFogGenNV"); + glCoverFillPathNV = provider.getFunctionAddress("glCoverFillPathNV"); + glCoverStrokePathNV = provider.getFunctionAddress("glCoverStrokePathNV"); + glCoverFillPathInstancedNV = provider.getFunctionAddress("glCoverFillPathInstancedNV"); + glCoverStrokePathInstancedNV = provider.getFunctionAddress("glCoverStrokePathInstancedNV"); + glStencilThenCoverFillPathNV = provider.getFunctionAddress("glStencilThenCoverFillPathNV"); + glStencilThenCoverStrokePathNV = provider.getFunctionAddress("glStencilThenCoverStrokePathNV"); + glStencilThenCoverFillPathInstancedNV = provider.getFunctionAddress("glStencilThenCoverFillPathInstancedNV"); + glStencilThenCoverStrokePathInstancedNV = provider.getFunctionAddress("glStencilThenCoverStrokePathInstancedNV"); + glPathGlyphIndexRangeNV = provider.getFunctionAddress("glPathGlyphIndexRangeNV"); + glProgramPathFragmentInputGenNV = provider.getFunctionAddress("glProgramPathFragmentInputGenNV"); + glGetPathParameterivNV = provider.getFunctionAddress("glGetPathParameterivNV"); + glGetPathParameterfvNV = provider.getFunctionAddress("glGetPathParameterfvNV"); + glGetPathCommandsNV = provider.getFunctionAddress("glGetPathCommandsNV"); + glGetPathCoordsNV = provider.getFunctionAddress("glGetPathCoordsNV"); + glGetPathDashArrayNV = provider.getFunctionAddress("glGetPathDashArrayNV"); + glGetPathMetricsNV = provider.getFunctionAddress("glGetPathMetricsNV"); + glGetPathMetricRangeNV = provider.getFunctionAddress("glGetPathMetricRangeNV"); + glGetPathSpacingNV = provider.getFunctionAddress("glGetPathSpacingNV"); + glGetPathColorGenivNV = provider.getFunctionAddress("glGetPathColorGenivNV"); + glGetPathColorGenfvNV = provider.getFunctionAddress("glGetPathColorGenfvNV"); + glGetPathTexGenivNV = provider.getFunctionAddress("glGetPathTexGenivNV"); + glGetPathTexGenfvNV = provider.getFunctionAddress("glGetPathTexGenfvNV"); + glIsPointInFillPathNV = provider.getFunctionAddress("glIsPointInFillPathNV"); + glIsPointInStrokePathNV = provider.getFunctionAddress("glIsPointInStrokePathNV"); + glGetPathLengthNV = provider.getFunctionAddress("glGetPathLengthNV"); + glPointAlongPathNV = provider.getFunctionAddress("glPointAlongPathNV"); + glMatrixLoad3x2fNV = provider.getFunctionAddress("glMatrixLoad3x2fNV"); + glMatrixLoad3x3fNV = provider.getFunctionAddress("glMatrixLoad3x3fNV"); + glMatrixLoadTranspose3x3fNV = provider.getFunctionAddress("glMatrixLoadTranspose3x3fNV"); + glMatrixMult3x2fNV = provider.getFunctionAddress("glMatrixMult3x2fNV"); + glMatrixMult3x3fNV = provider.getFunctionAddress("glMatrixMult3x3fNV"); + glMatrixMultTranspose3x3fNV = provider.getFunctionAddress("glMatrixMultTranspose3x3fNV"); + glGetProgramResourcefvNV = provider.getFunctionAddress("glGetProgramResourcefvNV"); + glPixelDataRangeNV = provider.getFunctionAddress("glPixelDataRangeNV"); + glFlushPixelDataRangeNV = provider.getFunctionAddress("glFlushPixelDataRangeNV"); + glPointParameteriNV = provider.getFunctionAddress("glPointParameteriNV"); + glPointParameterivNV = provider.getFunctionAddress("glPointParameterivNV"); + glPrimitiveRestartNV = provider.getFunctionAddress("glPrimitiveRestartNV"); + glPrimitiveRestartIndexNV = provider.getFunctionAddress("glPrimitiveRestartIndexNV"); + glQueryResourceNV = provider.getFunctionAddress("glQueryResourceNV"); + glGenQueryResourceTagNV = provider.getFunctionAddress("glGenQueryResourceTagNV"); + glDeleteQueryResourceTagNV = provider.getFunctionAddress("glDeleteQueryResourceTagNV"); + glQueryResourceTagNV = provider.getFunctionAddress("glQueryResourceTagNV"); + glFramebufferSampleLocationsfvNV = provider.getFunctionAddress("glFramebufferSampleLocationsfvNV"); + glNamedFramebufferSampleLocationsfvNV = provider.getFunctionAddress("glNamedFramebufferSampleLocationsfvNV"); + glResolveDepthValuesNV = provider.getFunctionAddress("glResolveDepthValuesNV"); + glScissorExclusiveArrayvNV = provider.getFunctionAddress("glScissorExclusiveArrayvNV"); + glScissorExclusiveNV = provider.getFunctionAddress("glScissorExclusiveNV"); + glMakeBufferResidentNV = provider.getFunctionAddress("glMakeBufferResidentNV"); + glMakeBufferNonResidentNV = provider.getFunctionAddress("glMakeBufferNonResidentNV"); + glIsBufferResidentNV = provider.getFunctionAddress("glIsBufferResidentNV"); + glMakeNamedBufferResidentNV = provider.getFunctionAddress("glMakeNamedBufferResidentNV"); + glMakeNamedBufferNonResidentNV = provider.getFunctionAddress("glMakeNamedBufferNonResidentNV"); + glIsNamedBufferResidentNV = provider.getFunctionAddress("glIsNamedBufferResidentNV"); + glGetBufferParameterui64vNV = provider.getFunctionAddress("glGetBufferParameterui64vNV"); + glGetNamedBufferParameterui64vNV = provider.getFunctionAddress("glGetNamedBufferParameterui64vNV"); + glGetIntegerui64vNV = provider.getFunctionAddress("glGetIntegerui64vNV"); + glUniformui64NV = provider.getFunctionAddress("glUniformui64NV"); + glUniformui64vNV = provider.getFunctionAddress("glUniformui64vNV"); + glGetUniformui64vNV = provider.getFunctionAddress("glGetUniformui64vNV"); + glProgramUniformui64NV = provider.getFunctionAddress("glProgramUniformui64NV"); + glProgramUniformui64vNV = provider.getFunctionAddress("glProgramUniformui64vNV"); + glBindShadingRateImageNV = provider.getFunctionAddress("glBindShadingRateImageNV"); + glShadingRateImagePaletteNV = provider.getFunctionAddress("glShadingRateImagePaletteNV"); + glGetShadingRateImagePaletteNV = provider.getFunctionAddress("glGetShadingRateImagePaletteNV"); + glShadingRateImageBarrierNV = provider.getFunctionAddress("glShadingRateImageBarrierNV"); + glShadingRateSampleOrderNV = provider.getFunctionAddress("glShadingRateSampleOrderNV"); + glShadingRateSampleOrderCustomNV = provider.getFunctionAddress("glShadingRateSampleOrderCustomNV"); + glGetShadingRateSampleLocationivNV = provider.getFunctionAddress("glGetShadingRateSampleLocationivNV"); + glTextureBarrierNV = provider.getFunctionAddress("glTextureBarrierNV"); + glTexImage2DMultisampleCoverageNV = provider.getFunctionAddress("glTexImage2DMultisampleCoverageNV"); + glTexImage3DMultisampleCoverageNV = provider.getFunctionAddress("glTexImage3DMultisampleCoverageNV"); + glTextureImage2DMultisampleNV = provider.getFunctionAddress("glTextureImage2DMultisampleNV"); + glTextureImage3DMultisampleNV = provider.getFunctionAddress("glTextureImage3DMultisampleNV"); + glTextureImage2DMultisampleCoverageNV = provider.getFunctionAddress("glTextureImage2DMultisampleCoverageNV"); + glTextureImage3DMultisampleCoverageNV = provider.getFunctionAddress("glTextureImage3DMultisampleCoverageNV"); + glBeginTransformFeedbackNV = provider.getFunctionAddress("glBeginTransformFeedbackNV"); + glEndTransformFeedbackNV = provider.getFunctionAddress("glEndTransformFeedbackNV"); + glTransformFeedbackAttribsNV = provider.getFunctionAddress("glTransformFeedbackAttribsNV"); + glBindBufferRangeNV = provider.getFunctionAddress("glBindBufferRangeNV"); + glBindBufferOffsetNV = provider.getFunctionAddress("glBindBufferOffsetNV"); + glBindBufferBaseNV = provider.getFunctionAddress("glBindBufferBaseNV"); + glTransformFeedbackVaryingsNV = provider.getFunctionAddress("glTransformFeedbackVaryingsNV"); + glActiveVaryingNV = provider.getFunctionAddress("glActiveVaryingNV"); + glGetVaryingLocationNV = provider.getFunctionAddress("glGetVaryingLocationNV"); + glGetActiveVaryingNV = provider.getFunctionAddress("glGetActiveVaryingNV"); + glGetTransformFeedbackVaryingNV = provider.getFunctionAddress("glGetTransformFeedbackVaryingNV"); + glTransformFeedbackStreamAttribsNV = provider.getFunctionAddress("glTransformFeedbackStreamAttribsNV"); + glBindTransformFeedbackNV = provider.getFunctionAddress("glBindTransformFeedbackNV"); + glDeleteTransformFeedbacksNV = provider.getFunctionAddress("glDeleteTransformFeedbacksNV"); + glGenTransformFeedbacksNV = provider.getFunctionAddress("glGenTransformFeedbacksNV"); + glIsTransformFeedbackNV = provider.getFunctionAddress("glIsTransformFeedbackNV"); + glPauseTransformFeedbackNV = provider.getFunctionAddress("glPauseTransformFeedbackNV"); + glResumeTransformFeedbackNV = provider.getFunctionAddress("glResumeTransformFeedbackNV"); + glDrawTransformFeedbackNV = provider.getFunctionAddress("glDrawTransformFeedbackNV"); + glVertexArrayRangeNV = provider.getFunctionAddress("glVertexArrayRangeNV"); + glFlushVertexArrayRangeNV = provider.getFunctionAddress("glFlushVertexArrayRangeNV"); + glVertexAttribL1i64NV = provider.getFunctionAddress("glVertexAttribL1i64NV"); + glVertexAttribL2i64NV = provider.getFunctionAddress("glVertexAttribL2i64NV"); + glVertexAttribL3i64NV = provider.getFunctionAddress("glVertexAttribL3i64NV"); + glVertexAttribL4i64NV = provider.getFunctionAddress("glVertexAttribL4i64NV"); + glVertexAttribL1i64vNV = provider.getFunctionAddress("glVertexAttribL1i64vNV"); + glVertexAttribL2i64vNV = provider.getFunctionAddress("glVertexAttribL2i64vNV"); + glVertexAttribL3i64vNV = provider.getFunctionAddress("glVertexAttribL3i64vNV"); + glVertexAttribL4i64vNV = provider.getFunctionAddress("glVertexAttribL4i64vNV"); + glVertexAttribL1ui64NV = provider.getFunctionAddress("glVertexAttribL1ui64NV"); + glVertexAttribL2ui64NV = provider.getFunctionAddress("glVertexAttribL2ui64NV"); + glVertexAttribL3ui64NV = provider.getFunctionAddress("glVertexAttribL3ui64NV"); + glVertexAttribL4ui64NV = provider.getFunctionAddress("glVertexAttribL4ui64NV"); + glVertexAttribL1ui64vNV = provider.getFunctionAddress("glVertexAttribL1ui64vNV"); + glVertexAttribL2ui64vNV = provider.getFunctionAddress("glVertexAttribL2ui64vNV"); + glVertexAttribL3ui64vNV = provider.getFunctionAddress("glVertexAttribL3ui64vNV"); + glVertexAttribL4ui64vNV = provider.getFunctionAddress("glVertexAttribL4ui64vNV"); + glGetVertexAttribLi64vNV = provider.getFunctionAddress("glGetVertexAttribLi64vNV"); + glGetVertexAttribLui64vNV = provider.getFunctionAddress("glGetVertexAttribLui64vNV"); + glVertexAttribLFormatNV = provider.getFunctionAddress("glVertexAttribLFormatNV"); + glBufferAddressRangeNV = provider.getFunctionAddress("glBufferAddressRangeNV"); + glVertexFormatNV = provider.getFunctionAddress("glVertexFormatNV"); + glNormalFormatNV = provider.getFunctionAddress("glNormalFormatNV"); + glColorFormatNV = provider.getFunctionAddress("glColorFormatNV"); + glIndexFormatNV = provider.getFunctionAddress("glIndexFormatNV"); + glTexCoordFormatNV = provider.getFunctionAddress("glTexCoordFormatNV"); + glEdgeFlagFormatNV = provider.getFunctionAddress("glEdgeFlagFormatNV"); + glSecondaryColorFormatNV = provider.getFunctionAddress("glSecondaryColorFormatNV"); + glFogCoordFormatNV = provider.getFunctionAddress("glFogCoordFormatNV"); + glVertexAttribFormatNV = provider.getFunctionAddress("glVertexAttribFormatNV"); + glVertexAttribIFormatNV = provider.getFunctionAddress("glVertexAttribIFormatNV"); + glGetIntegerui64i_vNV = provider.getFunctionAddress("glGetIntegerui64i_vNV"); + glViewportSwizzleNV = provider.getFunctionAddress("glViewportSwizzleNV"); + glBeginConditionalRenderNVX = provider.getFunctionAddress("glBeginConditionalRenderNVX"); + glEndConditionalRenderNVX = provider.getFunctionAddress("glEndConditionalRenderNVX"); + glAsyncCopyImageSubDataNVX = provider.getFunctionAddress("glAsyncCopyImageSubDataNVX"); + glAsyncCopyBufferSubDataNVX = provider.getFunctionAddress("glAsyncCopyBufferSubDataNVX"); + glUploadGpuMaskNVX = provider.getFunctionAddress("glUploadGpuMaskNVX"); + glMulticastViewportArrayvNVX = provider.getFunctionAddress("glMulticastViewportArrayvNVX"); + glMulticastScissorArrayvNVX = provider.getFunctionAddress("glMulticastScissorArrayvNVX"); + glMulticastViewportPositionWScaleNVX = provider.getFunctionAddress("glMulticastViewportPositionWScaleNVX"); + glCreateProgressFenceNVX = provider.getFunctionAddress("glCreateProgressFenceNVX"); + glSignalSemaphoreui64NVX = provider.getFunctionAddress("glSignalSemaphoreui64NVX"); + glWaitSemaphoreui64NVX = provider.getFunctionAddress("glWaitSemaphoreui64NVX"); + glClientWaitSemaphoreui64NVX = provider.getFunctionAddress("glClientWaitSemaphoreui64NVX"); + glFramebufferTextureMultiviewOVR = provider.getFunctionAddress("glFramebufferTextureMultiviewOVR"); + glNamedFramebufferTextureMultiviewOVR = provider.getFunctionAddress("glNamedFramebufferTextureMultiviewOVR"); + + OpenGL11 = ext.contains("OpenGL11") && checkExtension("OpenGL11", GL11.isAvailable(this, ext, fc)); + OpenGL12 = ext.contains("OpenGL12") && checkExtension("OpenGL12", GL12.isAvailable(this)); + OpenGL13 = ext.contains("OpenGL13") && checkExtension("OpenGL13", GL13.isAvailable(this, fc)); + OpenGL14 = ext.contains("OpenGL14") && checkExtension("OpenGL14", GL14.isAvailable(this, fc)); + OpenGL15 = ext.contains("OpenGL15") && checkExtension("OpenGL15", GL15.isAvailable(this)); + OpenGL20 = ext.contains("OpenGL20") && checkExtension("OpenGL20", GL20.isAvailable(this)); + OpenGL21 = ext.contains("OpenGL21") && checkExtension("OpenGL21", GL21.isAvailable(this)); + OpenGL30 = ext.contains("OpenGL30") && checkExtension("OpenGL30", GL30.isAvailable(this)); + OpenGL31 = ext.contains("OpenGL31") && checkExtension("OpenGL31", GL31.isAvailable(this)); + OpenGL32 = ext.contains("OpenGL32") && checkExtension("OpenGL32", GL32.isAvailable(this)); + OpenGL33 = ext.contains("OpenGL33") && checkExtension("OpenGL33", GL33.isAvailable(this, fc)); + OpenGL40 = ext.contains("OpenGL40") && checkExtension("OpenGL40", GL40.isAvailable(this)); + OpenGL41 = ext.contains("OpenGL41") && checkExtension("OpenGL41", GL41.isAvailable(this)); + OpenGL42 = ext.contains("OpenGL42") && checkExtension("OpenGL42", GL42.isAvailable(this)); + OpenGL43 = ext.contains("OpenGL43") && checkExtension("OpenGL43", GL43.isAvailable(this)); + OpenGL44 = ext.contains("OpenGL44") && checkExtension("OpenGL44", GL44.isAvailable(this)); + OpenGL45 = ext.contains("OpenGL45") && checkExtension("OpenGL45", GL45.isAvailable(this, ext)); + OpenGL46 = ext.contains("OpenGL46") && checkExtension("OpenGL46", GL46.isAvailable(this)); + GL_AMD_blend_minmax_factor = ext.contains("GL_AMD_blend_minmax_factor"); + GL_AMD_conservative_depth = ext.contains("GL_AMD_conservative_depth"); + GL_AMD_debug_output = ext.contains("GL_AMD_debug_output") && checkExtension("GL_AMD_debug_output", AMDDebugOutput.isAvailable(this)); + GL_AMD_depth_clamp_separate = ext.contains("GL_AMD_depth_clamp_separate"); + GL_AMD_draw_buffers_blend = ext.contains("GL_AMD_draw_buffers_blend") && checkExtension("GL_AMD_draw_buffers_blend", AMDDrawBuffersBlend.isAvailable(this)); + GL_AMD_framebuffer_multisample_advanced = ext.contains("GL_AMD_framebuffer_multisample_advanced") && checkExtension("GL_AMD_framebuffer_multisample_advanced", AMDFramebufferMultisampleAdvanced.isAvailable(this)); + GL_AMD_gcn_shader = ext.contains("GL_AMD_gcn_shader"); + GL_AMD_gpu_shader_half_float = ext.contains("GL_AMD_gpu_shader_half_float"); + GL_AMD_gpu_shader_half_float_fetch = ext.contains("GL_AMD_gpu_shader_half_float_fetch"); + GL_AMD_gpu_shader_int16 = ext.contains("GL_AMD_gpu_shader_int16"); + GL_AMD_gpu_shader_int64 = ext.contains("GL_AMD_gpu_shader_int64") && checkExtension("GL_AMD_gpu_shader_int64", AMDGPUShaderInt64.isAvailable(this, ext)); + GL_AMD_interleaved_elements = ext.contains("GL_AMD_interleaved_elements") && checkExtension("GL_AMD_interleaved_elements", AMDInterleavedElements.isAvailable(this)); + GL_AMD_occlusion_query_event = ext.contains("GL_AMD_occlusion_query_event") && checkExtension("GL_AMD_occlusion_query_event", AMDOcclusionQueryEvent.isAvailable(this)); + GL_AMD_performance_monitor = ext.contains("GL_AMD_performance_monitor") && checkExtension("GL_AMD_performance_monitor", AMDPerformanceMonitor.isAvailable(this)); + GL_AMD_pinned_memory = ext.contains("GL_AMD_pinned_memory"); + GL_AMD_query_buffer_object = ext.contains("GL_AMD_query_buffer_object"); + GL_AMD_sample_positions = ext.contains("GL_AMD_sample_positions") && checkExtension("GL_AMD_sample_positions", AMDSamplePositions.isAvailable(this)); + GL_AMD_seamless_cubemap_per_texture = ext.contains("GL_AMD_seamless_cubemap_per_texture"); + GL_AMD_shader_atomic_counter_ops = ext.contains("GL_AMD_shader_atomic_counter_ops"); + GL_AMD_shader_ballot = ext.contains("GL_AMD_shader_ballot"); + GL_AMD_shader_explicit_vertex_parameter = ext.contains("GL_AMD_shader_explicit_vertex_parameter"); + GL_AMD_shader_image_load_store_lod = ext.contains("GL_AMD_shader_image_load_store_lod"); + GL_AMD_shader_stencil_export = ext.contains("GL_AMD_shader_stencil_export"); + GL_AMD_shader_trinary_minmax = ext.contains("GL_AMD_shader_trinary_minmax"); + GL_AMD_sparse_texture = ext.contains("GL_AMD_sparse_texture") && checkExtension("GL_AMD_sparse_texture", AMDSparseTexture.isAvailable(this)); + GL_AMD_stencil_operation_extended = ext.contains("GL_AMD_stencil_operation_extended") && checkExtension("GL_AMD_stencil_operation_extended", AMDStencilOperationExtended.isAvailable(this)); + GL_AMD_texture_gather_bias_lod = ext.contains("GL_AMD_texture_gather_bias_lod"); + GL_AMD_texture_texture4 = ext.contains("GL_AMD_texture_texture4"); + GL_AMD_transform_feedback3_lines_triangles = ext.contains("GL_AMD_transform_feedback3_lines_triangles"); + GL_AMD_transform_feedback4 = ext.contains("GL_AMD_transform_feedback4"); + GL_AMD_vertex_shader_layer = ext.contains("GL_AMD_vertex_shader_layer"); + GL_AMD_vertex_shader_tessellator = ext.contains("GL_AMD_vertex_shader_tessellator") && checkExtension("GL_AMD_vertex_shader_tessellator", AMDVertexShaderTessellator.isAvailable(this)); + GL_AMD_vertex_shader_viewport_index = ext.contains("GL_AMD_vertex_shader_viewport_index"); + GL_ARB_arrays_of_arrays = ext.contains("GL_ARB_arrays_of_arrays"); + GL_ARB_base_instance = ext.contains("GL_ARB_base_instance") && checkExtension("GL_ARB_base_instance", ARBBaseInstance.isAvailable(this)); + GL_ARB_bindless_texture = ext.contains("GL_ARB_bindless_texture") && checkExtension("GL_ARB_bindless_texture", ARBBindlessTexture.isAvailable(this)); + GL_ARB_blend_func_extended = ext.contains("GL_ARB_blend_func_extended") && checkExtension("GL_ARB_blend_func_extended", ARBBlendFuncExtended.isAvailable(this)); + GL_ARB_buffer_storage = ext.contains("GL_ARB_buffer_storage") && checkExtension("GL_ARB_buffer_storage", ARBBufferStorage.isAvailable(this, ext)); + GL_ARB_clear_buffer_object = ext.contains("GL_ARB_clear_buffer_object") && checkExtension("GL_ARB_clear_buffer_object", ARBClearBufferObject.isAvailable(this, ext)); + GL_ARB_clear_texture = ext.contains("GL_ARB_clear_texture") && checkExtension("GL_ARB_clear_texture", ARBClearTexture.isAvailable(this)); + GL_ARB_clip_control = ext.contains("GL_ARB_clip_control") && checkExtension("GL_ARB_clip_control", ARBClipControl.isAvailable(this)); + GL_ARB_color_buffer_float = ext.contains("GL_ARB_color_buffer_float") && checkExtension("GL_ARB_color_buffer_float", ARBColorBufferFloat.isAvailable(this)); + GL_ARB_compatibility = ext.contains("GL_ARB_compatibility"); + GL_ARB_compressed_texture_pixel_storage = ext.contains("GL_ARB_compressed_texture_pixel_storage"); + GL_ARB_compute_shader = ext.contains("GL_ARB_compute_shader") && checkExtension("GL_ARB_compute_shader", ARBComputeShader.isAvailable(this)); + GL_ARB_compute_variable_group_size = ext.contains("GL_ARB_compute_variable_group_size") && checkExtension("GL_ARB_compute_variable_group_size", ARBComputeVariableGroupSize.isAvailable(this)); + GL_ARB_conditional_render_inverted = ext.contains("GL_ARB_conditional_render_inverted"); + GL_ARB_conservative_depth = ext.contains("GL_ARB_conservative_depth"); + GL_ARB_copy_buffer = ext.contains("GL_ARB_copy_buffer") && checkExtension("GL_ARB_copy_buffer", ARBCopyBuffer.isAvailable(this)); + GL_ARB_copy_image = ext.contains("GL_ARB_copy_image") && checkExtension("GL_ARB_copy_image", ARBCopyImage.isAvailable(this)); + GL_ARB_cull_distance = ext.contains("GL_ARB_cull_distance"); + GL_ARB_debug_output = ext.contains("GL_ARB_debug_output") && checkExtension("GL_ARB_debug_output", ARBDebugOutput.isAvailable(this)); + GL_ARB_depth_buffer_float = ext.contains("GL_ARB_depth_buffer_float"); + GL_ARB_depth_clamp = ext.contains("GL_ARB_depth_clamp"); + GL_ARB_depth_texture = ext.contains("GL_ARB_depth_texture"); + GL_ARB_derivative_control = ext.contains("GL_ARB_derivative_control"); + GL_ARB_direct_state_access = ext.contains("GL_ARB_direct_state_access") && checkExtension("GL_ARB_direct_state_access", ARBDirectStateAccess.isAvailable(this, ext)); + GL_ARB_draw_buffers = ext.contains("GL_ARB_draw_buffers") && checkExtension("GL_ARB_draw_buffers", ARBDrawBuffers.isAvailable(this)); + GL_ARB_draw_buffers_blend = ext.contains("GL_ARB_draw_buffers_blend") && checkExtension("GL_ARB_draw_buffers_blend", ARBDrawBuffersBlend.isAvailable(this)); + GL_ARB_draw_elements_base_vertex = ext.contains("GL_ARB_draw_elements_base_vertex") && checkExtension("GL_ARB_draw_elements_base_vertex", ARBDrawElementsBaseVertex.isAvailable(this)); + GL_ARB_draw_indirect = ext.contains("GL_ARB_draw_indirect") && checkExtension("GL_ARB_draw_indirect", ARBDrawIndirect.isAvailable(this)); + GL_ARB_draw_instanced = ext.contains("GL_ARB_draw_instanced") && checkExtension("GL_ARB_draw_instanced", ARBDrawInstanced.isAvailable(this)); + GL_ARB_enhanced_layouts = ext.contains("GL_ARB_enhanced_layouts"); + GL_ARB_ES2_compatibility = ext.contains("GL_ARB_ES2_compatibility") && checkExtension("GL_ARB_ES2_compatibility", ARBES2Compatibility.isAvailable(this)); + GL_ARB_ES3_1_compatibility = ext.contains("GL_ARB_ES3_1_compatibility") && checkExtension("GL_ARB_ES3_1_compatibility", ARBES31Compatibility.isAvailable(this)); + GL_ARB_ES3_2_compatibility = ext.contains("GL_ARB_ES3_2_compatibility") && checkExtension("GL_ARB_ES3_2_compatibility", ARBES32Compatibility.isAvailable(this)); + GL_ARB_ES3_compatibility = ext.contains("GL_ARB_ES3_compatibility"); + GL_ARB_explicit_attrib_location = ext.contains("GL_ARB_explicit_attrib_location"); + GL_ARB_explicit_uniform_location = ext.contains("GL_ARB_explicit_uniform_location"); + GL_ARB_fragment_coord_conventions = ext.contains("GL_ARB_fragment_coord_conventions"); + GL_ARB_fragment_layer_viewport = ext.contains("GL_ARB_fragment_layer_viewport"); + GL_ARB_fragment_program = ext.contains("GL_ARB_fragment_program"); + GL_ARB_fragment_program_shadow = ext.contains("GL_ARB_fragment_program_shadow"); + GL_ARB_fragment_shader = ext.contains("GL_ARB_fragment_shader"); + GL_ARB_fragment_shader_interlock = ext.contains("GL_ARB_fragment_shader_interlock"); + GL_ARB_framebuffer_no_attachments = ext.contains("GL_ARB_framebuffer_no_attachments") && checkExtension("GL_ARB_framebuffer_no_attachments", ARBFramebufferNoAttachments.isAvailable(this, ext)); + GL_ARB_framebuffer_object = ext.contains("GL_ARB_framebuffer_object") && checkExtension("GL_ARB_framebuffer_object", ARBFramebufferObject.isAvailable(this)); + GL_ARB_framebuffer_sRGB = ext.contains("GL_ARB_framebuffer_sRGB"); + GL_ARB_geometry_shader4 = ext.contains("GL_ARB_geometry_shader4") && checkExtension("GL_ARB_geometry_shader4", ARBGeometryShader4.isAvailable(this)); + GL_ARB_get_program_binary = ext.contains("GL_ARB_get_program_binary") && checkExtension("GL_ARB_get_program_binary", ARBGetProgramBinary.isAvailable(this)); + GL_ARB_get_texture_sub_image = ext.contains("GL_ARB_get_texture_sub_image") && checkExtension("GL_ARB_get_texture_sub_image", ARBGetTextureSubImage.isAvailable(this)); + GL_ARB_gl_spirv = ext.contains("GL_ARB_gl_spirv") && checkExtension("GL_ARB_gl_spirv", ARBGLSPIRV.isAvailable(this)); + GL_ARB_gpu_shader5 = ext.contains("GL_ARB_gpu_shader5"); + GL_ARB_gpu_shader_fp64 = ext.contains("GL_ARB_gpu_shader_fp64") && checkExtension("GL_ARB_gpu_shader_fp64", ARBGPUShaderFP64.isAvailable(this, ext)); + GL_ARB_gpu_shader_int64 = ext.contains("GL_ARB_gpu_shader_int64") && checkExtension("GL_ARB_gpu_shader_int64", ARBGPUShaderInt64.isAvailable(this)); + GL_ARB_half_float_pixel = ext.contains("GL_ARB_half_float_pixel"); + GL_ARB_half_float_vertex = ext.contains("GL_ARB_half_float_vertex"); + GL_ARB_imaging = ext.contains("GL_ARB_imaging") && checkExtension("GL_ARB_imaging", ARBImaging.isAvailable(this, fc)); + GL_ARB_indirect_parameters = ext.contains("GL_ARB_indirect_parameters") && checkExtension("GL_ARB_indirect_parameters", ARBIndirectParameters.isAvailable(this)); + GL_ARB_instanced_arrays = ext.contains("GL_ARB_instanced_arrays") && checkExtension("GL_ARB_instanced_arrays", ARBInstancedArrays.isAvailable(this, ext)); + GL_ARB_internalformat_query = ext.contains("GL_ARB_internalformat_query") && checkExtension("GL_ARB_internalformat_query", ARBInternalformatQuery.isAvailable(this)); + GL_ARB_internalformat_query2 = ext.contains("GL_ARB_internalformat_query2") && checkExtension("GL_ARB_internalformat_query2", ARBInternalformatQuery2.isAvailable(this)); + GL_ARB_invalidate_subdata = ext.contains("GL_ARB_invalidate_subdata") && checkExtension("GL_ARB_invalidate_subdata", ARBInvalidateSubdata.isAvailable(this)); + GL_ARB_map_buffer_alignment = ext.contains("GL_ARB_map_buffer_alignment"); + GL_ARB_map_buffer_range = ext.contains("GL_ARB_map_buffer_range") && checkExtension("GL_ARB_map_buffer_range", ARBMapBufferRange.isAvailable(this)); + GL_ARB_matrix_palette = ext.contains("GL_ARB_matrix_palette") && checkExtension("GL_ARB_matrix_palette", ARBMatrixPalette.isAvailable(this)); + GL_ARB_multi_bind = ext.contains("GL_ARB_multi_bind") && checkExtension("GL_ARB_multi_bind", ARBMultiBind.isAvailable(this)); + GL_ARB_multi_draw_indirect = ext.contains("GL_ARB_multi_draw_indirect") && checkExtension("GL_ARB_multi_draw_indirect", ARBMultiDrawIndirect.isAvailable(this)); + GL_ARB_multisample = ext.contains("GL_ARB_multisample") && checkExtension("GL_ARB_multisample", ARBMultisample.isAvailable(this)); + GL_ARB_multitexture = ext.contains("GL_ARB_multitexture") && checkExtension("GL_ARB_multitexture", ARBMultitexture.isAvailable(this)); + GL_ARB_occlusion_query = ext.contains("GL_ARB_occlusion_query") && checkExtension("GL_ARB_occlusion_query", ARBOcclusionQuery.isAvailable(this)); + GL_ARB_occlusion_query2 = ext.contains("GL_ARB_occlusion_query2"); + GL_ARB_parallel_shader_compile = ext.contains("GL_ARB_parallel_shader_compile") && checkExtension("GL_ARB_parallel_shader_compile", ARBParallelShaderCompile.isAvailable(this)); + GL_ARB_pipeline_statistics_query = ext.contains("GL_ARB_pipeline_statistics_query"); + GL_ARB_pixel_buffer_object = ext.contains("GL_ARB_pixel_buffer_object"); + GL_ARB_point_parameters = ext.contains("GL_ARB_point_parameters") && checkExtension("GL_ARB_point_parameters", ARBPointParameters.isAvailable(this)); + GL_ARB_point_sprite = ext.contains("GL_ARB_point_sprite"); + GL_ARB_polygon_offset_clamp = ext.contains("GL_ARB_polygon_offset_clamp") && checkExtension("GL_ARB_polygon_offset_clamp", ARBPolygonOffsetClamp.isAvailable(this)); + GL_ARB_post_depth_coverage = ext.contains("GL_ARB_post_depth_coverage"); + GL_ARB_program_interface_query = ext.contains("GL_ARB_program_interface_query") && checkExtension("GL_ARB_program_interface_query", ARBProgramInterfaceQuery.isAvailable(this)); + GL_ARB_provoking_vertex = ext.contains("GL_ARB_provoking_vertex") && checkExtension("GL_ARB_provoking_vertex", ARBProvokingVertex.isAvailable(this)); + GL_ARB_query_buffer_object = ext.contains("GL_ARB_query_buffer_object"); + GL_ARB_robust_buffer_access_behavior = ext.contains("GL_ARB_robust_buffer_access_behavior"); + GL_ARB_robustness = ext.contains("GL_ARB_robustness") && checkExtension("GL_ARB_robustness", ARBRobustness.isAvailable(this, ext)); + GL_ARB_robustness_application_isolation = ext.contains("GL_ARB_robustness_application_isolation"); + GL_ARB_robustness_share_group_isolation = ext.contains("GL_ARB_robustness_share_group_isolation"); + GL_ARB_sample_locations = ext.contains("GL_ARB_sample_locations") && checkExtension("GL_ARB_sample_locations", ARBSampleLocations.isAvailable(this)); + GL_ARB_sample_shading = ext.contains("GL_ARB_sample_shading") && checkExtension("GL_ARB_sample_shading", ARBSampleShading.isAvailable(this)); + GL_ARB_sampler_objects = ext.contains("GL_ARB_sampler_objects") && checkExtension("GL_ARB_sampler_objects", ARBSamplerObjects.isAvailable(this)); + GL_ARB_seamless_cube_map = ext.contains("GL_ARB_seamless_cube_map"); + GL_ARB_seamless_cubemap_per_texture = ext.contains("GL_ARB_seamless_cubemap_per_texture"); + GL_ARB_separate_shader_objects = ext.contains("GL_ARB_separate_shader_objects") && checkExtension("GL_ARB_separate_shader_objects", ARBSeparateShaderObjects.isAvailable(this)); + GL_ARB_shader_atomic_counter_ops = ext.contains("GL_ARB_shader_atomic_counter_ops"); + GL_ARB_shader_atomic_counters = ext.contains("GL_ARB_shader_atomic_counters") && checkExtension("GL_ARB_shader_atomic_counters", ARBShaderAtomicCounters.isAvailable(this)); + GL_ARB_shader_ballot = ext.contains("GL_ARB_shader_ballot"); + GL_ARB_shader_bit_encoding = ext.contains("GL_ARB_shader_bit_encoding"); + GL_ARB_shader_clock = ext.contains("GL_ARB_shader_clock"); + GL_ARB_shader_draw_parameters = ext.contains("GL_ARB_shader_draw_parameters"); + GL_ARB_shader_group_vote = ext.contains("GL_ARB_shader_group_vote"); + GL_ARB_shader_image_load_store = ext.contains("GL_ARB_shader_image_load_store") && checkExtension("GL_ARB_shader_image_load_store", ARBShaderImageLoadStore.isAvailable(this)); + GL_ARB_shader_image_size = ext.contains("GL_ARB_shader_image_size"); + GL_ARB_shader_objects = ext.contains("GL_ARB_shader_objects") && checkExtension("GL_ARB_shader_objects", ARBShaderObjects.isAvailable(this)); + GL_ARB_shader_precision = ext.contains("GL_ARB_shader_precision"); + GL_ARB_shader_stencil_export = ext.contains("GL_ARB_shader_stencil_export"); + GL_ARB_shader_storage_buffer_object = ext.contains("GL_ARB_shader_storage_buffer_object") && checkExtension("GL_ARB_shader_storage_buffer_object", ARBShaderStorageBufferObject.isAvailable(this)); + GL_ARB_shader_subroutine = ext.contains("GL_ARB_shader_subroutine") && checkExtension("GL_ARB_shader_subroutine", ARBShaderSubroutine.isAvailable(this)); + GL_ARB_shader_texture_image_samples = ext.contains("GL_ARB_shader_texture_image_samples"); + GL_ARB_shader_texture_lod = ext.contains("GL_ARB_shader_texture_lod"); + GL_ARB_shader_viewport_layer_array = ext.contains("GL_ARB_shader_viewport_layer_array"); + GL_ARB_shading_language_100 = ext.contains("GL_ARB_shading_language_100"); + GL_ARB_shading_language_420pack = ext.contains("GL_ARB_shading_language_420pack"); + GL_ARB_shading_language_include = ext.contains("GL_ARB_shading_language_include") && checkExtension("GL_ARB_shading_language_include", ARBShadingLanguageInclude.isAvailable(this)); + GL_ARB_shading_language_packing = ext.contains("GL_ARB_shading_language_packing"); + GL_ARB_shadow = ext.contains("GL_ARB_shadow"); + GL_ARB_shadow_ambient = ext.contains("GL_ARB_shadow_ambient"); + GL_ARB_sparse_buffer = ext.contains("GL_ARB_sparse_buffer") && checkExtension("GL_ARB_sparse_buffer", ARBSparseBuffer.isAvailable(this, ext)); + GL_ARB_sparse_texture = ext.contains("GL_ARB_sparse_texture") && checkExtension("GL_ARB_sparse_texture", ARBSparseTexture.isAvailable(this, ext)); + GL_ARB_sparse_texture2 = ext.contains("GL_ARB_sparse_texture2"); + GL_ARB_sparse_texture_clamp = ext.contains("GL_ARB_sparse_texture_clamp"); + GL_ARB_spirv_extensions = ext.contains("GL_ARB_spirv_extensions"); + GL_ARB_stencil_texturing = ext.contains("GL_ARB_stencil_texturing"); + GL_ARB_sync = ext.contains("GL_ARB_sync") && checkExtension("GL_ARB_sync", ARBSync.isAvailable(this)); + GL_ARB_tessellation_shader = ext.contains("GL_ARB_tessellation_shader") && checkExtension("GL_ARB_tessellation_shader", ARBTessellationShader.isAvailable(this)); + GL_ARB_texture_barrier = ext.contains("GL_ARB_texture_barrier") && checkExtension("GL_ARB_texture_barrier", ARBTextureBarrier.isAvailable(this)); + GL_ARB_texture_border_clamp = ext.contains("GL_ARB_texture_border_clamp"); + GL_ARB_texture_buffer_object = ext.contains("GL_ARB_texture_buffer_object") && checkExtension("GL_ARB_texture_buffer_object", ARBTextureBufferObject.isAvailable(this)); + GL_ARB_texture_buffer_object_rgb32 = ext.contains("GL_ARB_texture_buffer_object_rgb32"); + GL_ARB_texture_buffer_range = ext.contains("GL_ARB_texture_buffer_range") && checkExtension("GL_ARB_texture_buffer_range", ARBTextureBufferRange.isAvailable(this, ext)); + GL_ARB_texture_compression = ext.contains("GL_ARB_texture_compression") && checkExtension("GL_ARB_texture_compression", ARBTextureCompression.isAvailable(this)); + GL_ARB_texture_compression_bptc = ext.contains("GL_ARB_texture_compression_bptc"); + GL_ARB_texture_compression_rgtc = ext.contains("GL_ARB_texture_compression_rgtc"); + GL_ARB_texture_cube_map = ext.contains("GL_ARB_texture_cube_map"); + GL_ARB_texture_cube_map_array = ext.contains("GL_ARB_texture_cube_map_array"); + GL_ARB_texture_env_add = ext.contains("GL_ARB_texture_env_add"); + GL_ARB_texture_env_combine = ext.contains("GL_ARB_texture_env_combine"); + GL_ARB_texture_env_crossbar = ext.contains("GL_ARB_texture_env_crossbar"); + GL_ARB_texture_env_dot3 = ext.contains("GL_ARB_texture_env_dot3"); + GL_ARB_texture_filter_anisotropic = ext.contains("GL_ARB_texture_filter_anisotropic"); + GL_ARB_texture_filter_minmax = ext.contains("GL_ARB_texture_filter_minmax"); + GL_ARB_texture_float = ext.contains("GL_ARB_texture_float"); + GL_ARB_texture_gather = ext.contains("GL_ARB_texture_gather"); + GL_ARB_texture_mirror_clamp_to_edge = ext.contains("GL_ARB_texture_mirror_clamp_to_edge"); + GL_ARB_texture_mirrored_repeat = ext.contains("GL_ARB_texture_mirrored_repeat"); + GL_ARB_texture_multisample = ext.contains("GL_ARB_texture_multisample") && checkExtension("GL_ARB_texture_multisample", ARBTextureMultisample.isAvailable(this)); + GL_ARB_texture_non_power_of_two = ext.contains("GL_ARB_texture_non_power_of_two"); + GL_ARB_texture_query_levels = ext.contains("GL_ARB_texture_query_levels"); + GL_ARB_texture_query_lod = ext.contains("GL_ARB_texture_query_lod"); + GL_ARB_texture_rectangle = ext.contains("GL_ARB_texture_rectangle"); + GL_ARB_texture_rg = ext.contains("GL_ARB_texture_rg"); + GL_ARB_texture_rgb10_a2ui = ext.contains("GL_ARB_texture_rgb10_a2ui"); + GL_ARB_texture_stencil8 = ext.contains("GL_ARB_texture_stencil8"); + GL_ARB_texture_storage = ext.contains("GL_ARB_texture_storage") && checkExtension("GL_ARB_texture_storage", ARBTextureStorage.isAvailable(this, ext)); + GL_ARB_texture_storage_multisample = ext.contains("GL_ARB_texture_storage_multisample") && checkExtension("GL_ARB_texture_storage_multisample", ARBTextureStorageMultisample.isAvailable(this, ext)); + GL_ARB_texture_swizzle = ext.contains("GL_ARB_texture_swizzle"); + GL_ARB_texture_view = ext.contains("GL_ARB_texture_view") && checkExtension("GL_ARB_texture_view", ARBTextureView.isAvailable(this)); + GL_ARB_timer_query = ext.contains("GL_ARB_timer_query") && checkExtension("GL_ARB_timer_query", ARBTimerQuery.isAvailable(this)); + GL_ARB_transform_feedback2 = ext.contains("GL_ARB_transform_feedback2") && checkExtension("GL_ARB_transform_feedback2", ARBTransformFeedback2.isAvailable(this)); + GL_ARB_transform_feedback3 = ext.contains("GL_ARB_transform_feedback3") && checkExtension("GL_ARB_transform_feedback3", ARBTransformFeedback3.isAvailable(this)); + GL_ARB_transform_feedback_instanced = ext.contains("GL_ARB_transform_feedback_instanced") && checkExtension("GL_ARB_transform_feedback_instanced", ARBTransformFeedbackInstanced.isAvailable(this)); + GL_ARB_transform_feedback_overflow_query = ext.contains("GL_ARB_transform_feedback_overflow_query"); + GL_ARB_transpose_matrix = ext.contains("GL_ARB_transpose_matrix") && checkExtension("GL_ARB_transpose_matrix", ARBTransposeMatrix.isAvailable(this)); + GL_ARB_uniform_buffer_object = ext.contains("GL_ARB_uniform_buffer_object") && checkExtension("GL_ARB_uniform_buffer_object", ARBUniformBufferObject.isAvailable(this)); + GL_ARB_vertex_array_bgra = ext.contains("GL_ARB_vertex_array_bgra"); + GL_ARB_vertex_array_object = ext.contains("GL_ARB_vertex_array_object") && checkExtension("GL_ARB_vertex_array_object", ARBVertexArrayObject.isAvailable(this)); + GL_ARB_vertex_attrib_64bit = ext.contains("GL_ARB_vertex_attrib_64bit") && checkExtension("GL_ARB_vertex_attrib_64bit", ARBVertexAttrib64Bit.isAvailable(this, ext)); + GL_ARB_vertex_attrib_binding = ext.contains("GL_ARB_vertex_attrib_binding") && checkExtension("GL_ARB_vertex_attrib_binding", ARBVertexAttribBinding.isAvailable(this, ext)); + GL_ARB_vertex_blend = ext.contains("GL_ARB_vertex_blend") && checkExtension("GL_ARB_vertex_blend", ARBVertexBlend.isAvailable(this)); + GL_ARB_vertex_buffer_object = ext.contains("GL_ARB_vertex_buffer_object") && checkExtension("GL_ARB_vertex_buffer_object", ARBVertexBufferObject.isAvailable(this)); + GL_ARB_vertex_program = ext.contains("GL_ARB_vertex_program") && checkExtension("GL_ARB_vertex_program", ARBVertexProgram.isAvailable(this)); + GL_ARB_vertex_shader = ext.contains("GL_ARB_vertex_shader") && checkExtension("GL_ARB_vertex_shader", ARBVertexShader.isAvailable(this)); + GL_ARB_vertex_type_10f_11f_11f_rev = ext.contains("GL_ARB_vertex_type_10f_11f_11f_rev"); + GL_ARB_vertex_type_2_10_10_10_rev = ext.contains("GL_ARB_vertex_type_2_10_10_10_rev") && checkExtension("GL_ARB_vertex_type_2_10_10_10_rev", ARBVertexType2_10_10_10_REV.isAvailable(this, fc)); + GL_ARB_viewport_array = ext.contains("GL_ARB_viewport_array") && checkExtension("GL_ARB_viewport_array", ARBViewportArray.isAvailable(this)); + GL_ARB_window_pos = ext.contains("GL_ARB_window_pos") && checkExtension("GL_ARB_window_pos", ARBWindowPos.isAvailable(this)); + GL_ATI_meminfo = ext.contains("GL_ATI_meminfo"); + GL_ATI_shader_texture_lod = ext.contains("GL_ATI_shader_texture_lod"); + GL_ATI_texture_compression_3dc = ext.contains("GL_ATI_texture_compression_3dc"); + GL_EXT_422_pixels = ext.contains("GL_EXT_422_pixels"); + GL_EXT_abgr = ext.contains("GL_EXT_abgr"); + GL_EXT_bgra = ext.contains("GL_EXT_bgra"); + GL_EXT_bindable_uniform = ext.contains("GL_EXT_bindable_uniform") && checkExtension("GL_EXT_bindable_uniform", EXTBindableUniform.isAvailable(this)); + GL_EXT_blend_color = ext.contains("GL_EXT_blend_color") && checkExtension("GL_EXT_blend_color", EXTBlendColor.isAvailable(this)); + GL_EXT_blend_equation_separate = ext.contains("GL_EXT_blend_equation_separate") && checkExtension("GL_EXT_blend_equation_separate", EXTBlendEquationSeparate.isAvailable(this)); + GL_EXT_blend_func_separate = ext.contains("GL_EXT_blend_func_separate") && checkExtension("GL_EXT_blend_func_separate", EXTBlendFuncSeparate.isAvailable(this)); + GL_EXT_blend_minmax = ext.contains("GL_EXT_blend_minmax") && checkExtension("GL_EXT_blend_minmax", EXTBlendMinmax.isAvailable(this)); + GL_EXT_blend_subtract = ext.contains("GL_EXT_blend_subtract"); + GL_EXT_clip_volume_hint = ext.contains("GL_EXT_clip_volume_hint"); + GL_EXT_compiled_vertex_array = ext.contains("GL_EXT_compiled_vertex_array") && checkExtension("GL_EXT_compiled_vertex_array", EXTCompiledVertexArray.isAvailable(this)); + GL_EXT_debug_label = ext.contains("GL_EXT_debug_label") && checkExtension("GL_EXT_debug_label", EXTDebugLabel.isAvailable(this)); + GL_EXT_debug_marker = ext.contains("GL_EXT_debug_marker") && checkExtension("GL_EXT_debug_marker", EXTDebugMarker.isAvailable(this)); + GL_EXT_depth_bounds_test = ext.contains("GL_EXT_depth_bounds_test") && checkExtension("GL_EXT_depth_bounds_test", EXTDepthBoundsTest.isAvailable(this)); + GL_EXT_direct_state_access = ext.contains("GL_EXT_direct_state_access") && checkExtension("GL_EXT_direct_state_access", EXTDirectStateAccess.isAvailable(this, ext)); + GL_EXT_draw_buffers2 = ext.contains("GL_EXT_draw_buffers2") && checkExtension("GL_EXT_draw_buffers2", EXTDrawBuffers2.isAvailable(this)); + GL_EXT_draw_instanced = ext.contains("GL_EXT_draw_instanced") && checkExtension("GL_EXT_draw_instanced", EXTDrawInstanced.isAvailable(this)); + GL_EXT_EGL_image_storage = ext.contains("GL_EXT_EGL_image_storage") && checkExtension("GL_EXT_EGL_image_storage", EXTEGLImageStorage.isAvailable(this, ext)); + GL_EXT_external_buffer = ext.contains("GL_EXT_external_buffer") && checkExtension("GL_EXT_external_buffer", EXTExternalBuffer.isAvailable(this, ext)); + GL_EXT_framebuffer_blit = ext.contains("GL_EXT_framebuffer_blit") && checkExtension("GL_EXT_framebuffer_blit", EXTFramebufferBlit.isAvailable(this)); + GL_EXT_framebuffer_multisample = ext.contains("GL_EXT_framebuffer_multisample") && checkExtension("GL_EXT_framebuffer_multisample", EXTFramebufferMultisample.isAvailable(this)); + GL_EXT_framebuffer_multisample_blit_scaled = ext.contains("GL_EXT_framebuffer_multisample_blit_scaled"); + GL_EXT_framebuffer_object = ext.contains("GL_EXT_framebuffer_object") && checkExtension("GL_EXT_framebuffer_object", EXTFramebufferObject.isAvailable(this)); + GL_EXT_framebuffer_sRGB = ext.contains("GL_EXT_framebuffer_sRGB"); + GL_EXT_geometry_shader4 = ext.contains("GL_EXT_geometry_shader4") && checkExtension("GL_EXT_geometry_shader4", EXTGeometryShader4.isAvailable(this)); + GL_EXT_gpu_program_parameters = ext.contains("GL_EXT_gpu_program_parameters") && checkExtension("GL_EXT_gpu_program_parameters", EXTGPUProgramParameters.isAvailable(this)); + GL_EXT_gpu_shader4 = ext.contains("GL_EXT_gpu_shader4") && checkExtension("GL_EXT_gpu_shader4", EXTGPUShader4.isAvailable(this)); + GL_EXT_memory_object = ext.contains("GL_EXT_memory_object") && checkExtension("GL_EXT_memory_object", EXTMemoryObject.isAvailable(this, ext)); + GL_EXT_memory_object_fd = ext.contains("GL_EXT_memory_object_fd") && checkExtension("GL_EXT_memory_object_fd", EXTMemoryObjectFD.isAvailable(this)); + GL_EXT_memory_object_win32 = ext.contains("GL_EXT_memory_object_win32") && checkExtension("GL_EXT_memory_object_win32", EXTMemoryObjectWin32.isAvailable(this)); + GL_EXT_multiview_tessellation_geometry_shader = ext.contains("GL_EXT_multiview_tessellation_geometry_shader"); + GL_EXT_multiview_texture_multisample = ext.contains("GL_EXT_multiview_texture_multisample"); + GL_EXT_multiview_timer_query = ext.contains("GL_EXT_multiview_timer_query"); + GL_EXT_packed_depth_stencil = ext.contains("GL_EXT_packed_depth_stencil"); + GL_EXT_packed_float = ext.contains("GL_EXT_packed_float"); + GL_EXT_pixel_buffer_object = ext.contains("GL_EXT_pixel_buffer_object"); + GL_EXT_point_parameters = ext.contains("GL_EXT_point_parameters") && checkExtension("GL_EXT_point_parameters", EXTPointParameters.isAvailable(this)); + GL_EXT_polygon_offset_clamp = ext.contains("GL_EXT_polygon_offset_clamp") && checkExtension("GL_EXT_polygon_offset_clamp", EXTPolygonOffsetClamp.isAvailable(this)); + GL_EXT_post_depth_coverage = ext.contains("GL_EXT_post_depth_coverage"); + GL_EXT_provoking_vertex = ext.contains("GL_EXT_provoking_vertex") && checkExtension("GL_EXT_provoking_vertex", EXTProvokingVertex.isAvailable(this)); + GL_EXT_raster_multisample = ext.contains("GL_EXT_raster_multisample") && checkExtension("GL_EXT_raster_multisample", EXTRasterMultisample.isAvailable(this)); + GL_EXT_secondary_color = ext.contains("GL_EXT_secondary_color") && checkExtension("GL_EXT_secondary_color", EXTSecondaryColor.isAvailable(this)); + GL_EXT_semaphore = ext.contains("GL_EXT_semaphore") && checkExtension("GL_EXT_semaphore", EXTSemaphore.isAvailable(this)); + GL_EXT_semaphore_fd = ext.contains("GL_EXT_semaphore_fd") && checkExtension("GL_EXT_semaphore_fd", EXTSemaphoreFD.isAvailable(this)); + GL_EXT_semaphore_win32 = ext.contains("GL_EXT_semaphore_win32") && checkExtension("GL_EXT_semaphore_win32", EXTSemaphoreWin32.isAvailable(this)); + GL_EXT_separate_shader_objects = ext.contains("GL_EXT_separate_shader_objects") && checkExtension("GL_EXT_separate_shader_objects", EXTSeparateShaderObjects.isAvailable(this)); + GL_EXT_shader_framebuffer_fetch = ext.contains("GL_EXT_shader_framebuffer_fetch"); + GL_EXT_shader_framebuffer_fetch_non_coherent = ext.contains("GL_EXT_shader_framebuffer_fetch_non_coherent") && checkExtension("GL_EXT_shader_framebuffer_fetch_non_coherent", EXTShaderFramebufferFetchNonCoherent.isAvailable(this)); + GL_EXT_shader_image_load_formatted = ext.contains("GL_EXT_shader_image_load_formatted"); + GL_EXT_shader_image_load_store = ext.contains("GL_EXT_shader_image_load_store") && checkExtension("GL_EXT_shader_image_load_store", EXTShaderImageLoadStore.isAvailable(this)); + GL_EXT_shader_integer_mix = ext.contains("GL_EXT_shader_integer_mix"); + GL_EXT_shadow_funcs = ext.contains("GL_EXT_shadow_funcs"); + GL_EXT_shared_texture_palette = ext.contains("GL_EXT_shared_texture_palette"); + GL_EXT_sparse_texture2 = ext.contains("GL_EXT_sparse_texture2"); + GL_EXT_stencil_clear_tag = ext.contains("GL_EXT_stencil_clear_tag") && checkExtension("GL_EXT_stencil_clear_tag", EXTStencilClearTag.isAvailable(this)); + GL_EXT_stencil_two_side = ext.contains("GL_EXT_stencil_two_side") && checkExtension("GL_EXT_stencil_two_side", EXTStencilTwoSide.isAvailable(this)); + GL_EXT_stencil_wrap = ext.contains("GL_EXT_stencil_wrap"); + GL_EXT_texture_array = ext.contains("GL_EXT_texture_array") && checkExtension("GL_EXT_texture_array", EXTTextureArray.isAvailable(this)); + GL_EXT_texture_buffer_object = ext.contains("GL_EXT_texture_buffer_object") && checkExtension("GL_EXT_texture_buffer_object", EXTTextureBufferObject.isAvailable(this)); + GL_EXT_texture_compression_latc = ext.contains("GL_EXT_texture_compression_latc"); + GL_EXT_texture_compression_rgtc = ext.contains("GL_EXT_texture_compression_rgtc"); + GL_EXT_texture_compression_s3tc = ext.contains("GL_EXT_texture_compression_s3tc"); + GL_EXT_texture_filter_anisotropic = ext.contains("GL_EXT_texture_filter_anisotropic"); + GL_EXT_texture_filter_minmax = ext.contains("GL_EXT_texture_filter_minmax"); + GL_EXT_texture_integer = ext.contains("GL_EXT_texture_integer") && checkExtension("GL_EXT_texture_integer", EXTTextureInteger.isAvailable(this)); + GL_EXT_texture_mirror_clamp = ext.contains("GL_EXT_texture_mirror_clamp"); + GL_EXT_texture_shadow_lod = ext.contains("GL_EXT_texture_shadow_lod"); + GL_EXT_texture_shared_exponent = ext.contains("GL_EXT_texture_shared_exponent"); + GL_EXT_texture_snorm = ext.contains("GL_EXT_texture_snorm"); + GL_EXT_texture_sRGB = ext.contains("GL_EXT_texture_sRGB"); + GL_EXT_texture_sRGB_decode = ext.contains("GL_EXT_texture_sRGB_decode"); + GL_EXT_texture_sRGB_R8 = ext.contains("GL_EXT_texture_sRGB_R8"); + GL_EXT_texture_swizzle = ext.contains("GL_EXT_texture_swizzle"); + GL_EXT_timer_query = ext.contains("GL_EXT_timer_query") && checkExtension("GL_EXT_timer_query", EXTTimerQuery.isAvailable(this)); + GL_EXT_transform_feedback = ext.contains("GL_EXT_transform_feedback") && checkExtension("GL_EXT_transform_feedback", EXTTransformFeedback.isAvailable(this)); + GL_EXT_vertex_array_bgra = ext.contains("GL_EXT_vertex_array_bgra"); + GL_EXT_vertex_attrib_64bit = ext.contains("GL_EXT_vertex_attrib_64bit") && checkExtension("GL_EXT_vertex_attrib_64bit", EXTVertexAttrib64bit.isAvailable(this, ext)); + GL_EXT_win32_keyed_mutex = ext.contains("GL_EXT_win32_keyed_mutex") && checkExtension("GL_EXT_win32_keyed_mutex", EXTWin32KeyedMutex.isAvailable(this)); + GL_EXT_window_rectangles = ext.contains("GL_EXT_window_rectangles") && checkExtension("GL_EXT_window_rectangles", EXTWindowRectangles.isAvailable(this)); + GL_EXT_x11_sync_object = ext.contains("GL_EXT_x11_sync_object") && checkExtension("GL_EXT_x11_sync_object", EXTX11SyncObject.isAvailable(this)); + GL_GREMEDY_frame_terminator = ext.contains("GL_GREMEDY_frame_terminator") && checkExtension("GL_GREMEDY_frame_terminator", GREMEDYFrameTerminator.isAvailable(this)); + GL_GREMEDY_string_marker = ext.contains("GL_GREMEDY_string_marker") && checkExtension("GL_GREMEDY_string_marker", GREMEDYStringMarker.isAvailable(this)); + GL_INTEL_blackhole_render = ext.contains("GL_INTEL_blackhole_render"); + GL_INTEL_conservative_rasterization = ext.contains("GL_INTEL_conservative_rasterization"); + GL_INTEL_fragment_shader_ordering = ext.contains("GL_INTEL_fragment_shader_ordering"); + GL_INTEL_framebuffer_CMAA = ext.contains("GL_INTEL_framebuffer_CMAA") && checkExtension("GL_INTEL_framebuffer_CMAA", INTELFramebufferCMAA.isAvailable(this)); + GL_INTEL_map_texture = ext.contains("GL_INTEL_map_texture") && checkExtension("GL_INTEL_map_texture", INTELMapTexture.isAvailable(this)); + GL_INTEL_performance_query = ext.contains("GL_INTEL_performance_query") && checkExtension("GL_INTEL_performance_query", INTELPerformanceQuery.isAvailable(this)); + GL_KHR_blend_equation_advanced = ext.contains("GL_KHR_blend_equation_advanced") && checkExtension("GL_KHR_blend_equation_advanced", KHRBlendEquationAdvanced.isAvailable(this)); + GL_KHR_blend_equation_advanced_coherent = ext.contains("GL_KHR_blend_equation_advanced_coherent"); + GL_KHR_context_flush_control = ext.contains("GL_KHR_context_flush_control"); + GL_KHR_debug = ext.contains("GL_KHR_debug") && checkExtension("GL_KHR_debug", KHRDebug.isAvailable(this)); + GL_KHR_no_error = ext.contains("GL_KHR_no_error"); + GL_KHR_parallel_shader_compile = ext.contains("GL_KHR_parallel_shader_compile") && checkExtension("GL_KHR_parallel_shader_compile", KHRParallelShaderCompile.isAvailable(this)); + GL_KHR_robust_buffer_access_behavior = ext.contains("GL_KHR_robust_buffer_access_behavior"); + GL_KHR_robustness = ext.contains("GL_KHR_robustness") && checkExtension("GL_KHR_robustness", KHRRobustness.isAvailable(this)); + GL_KHR_shader_subgroup = ext.contains("GL_KHR_shader_subgroup"); + GL_KHR_texture_compression_astc_hdr = ext.contains("GL_KHR_texture_compression_astc_hdr"); + GL_KHR_texture_compression_astc_ldr = ext.contains("GL_KHR_texture_compression_astc_ldr"); + GL_KHR_texture_compression_astc_sliced_3d = ext.contains("GL_KHR_texture_compression_astc_sliced_3d"); + GL_NV_alpha_to_coverage_dither_control = ext.contains("GL_NV_alpha_to_coverage_dither_control") && checkExtension("GL_NV_alpha_to_coverage_dither_control", NVAlphaToCoverageDitherControl.isAvailable(this)); + GL_NV_bindless_multi_draw_indirect = ext.contains("GL_NV_bindless_multi_draw_indirect") && checkExtension("GL_NV_bindless_multi_draw_indirect", NVBindlessMultiDrawIndirect.isAvailable(this)); + GL_NV_bindless_multi_draw_indirect_count = ext.contains("GL_NV_bindless_multi_draw_indirect_count") && checkExtension("GL_NV_bindless_multi_draw_indirect_count", NVBindlessMultiDrawIndirectCount.isAvailable(this)); + GL_NV_bindless_texture = ext.contains("GL_NV_bindless_texture") && checkExtension("GL_NV_bindless_texture", NVBindlessTexture.isAvailable(this)); + GL_NV_blend_equation_advanced = ext.contains("GL_NV_blend_equation_advanced") && checkExtension("GL_NV_blend_equation_advanced", NVBlendEquationAdvanced.isAvailable(this)); + GL_NV_blend_equation_advanced_coherent = ext.contains("GL_NV_blend_equation_advanced_coherent"); + GL_NV_blend_minmax_factor = ext.contains("GL_NV_blend_minmax_factor"); + GL_NV_blend_square = ext.contains("GL_NV_blend_square"); + GL_NV_clip_space_w_scaling = ext.contains("GL_NV_clip_space_w_scaling") && checkExtension("GL_NV_clip_space_w_scaling", NVClipSpaceWScaling.isAvailable(this)); + GL_NV_command_list = ext.contains("GL_NV_command_list") && checkExtension("GL_NV_command_list", NVCommandList.isAvailable(this)); + GL_NV_compute_shader_derivatives = ext.contains("GL_NV_compute_shader_derivatives"); + GL_NV_conditional_render = ext.contains("GL_NV_conditional_render") && checkExtension("GL_NV_conditional_render", NVConditionalRender.isAvailable(this)); + GL_NV_conservative_raster = ext.contains("GL_NV_conservative_raster") && checkExtension("GL_NV_conservative_raster", NVConservativeRaster.isAvailable(this)); + GL_NV_conservative_raster_dilate = ext.contains("GL_NV_conservative_raster_dilate") && checkExtension("GL_NV_conservative_raster_dilate", NVConservativeRasterDilate.isAvailable(this)); + GL_NV_conservative_raster_pre_snap = ext.contains("GL_NV_conservative_raster_pre_snap"); + GL_NV_conservative_raster_pre_snap_triangles = ext.contains("GL_NV_conservative_raster_pre_snap_triangles") && checkExtension("GL_NV_conservative_raster_pre_snap_triangles", NVConservativeRasterPreSnapTriangles.isAvailable(this)); + GL_NV_conservative_raster_underestimation = ext.contains("GL_NV_conservative_raster_underestimation"); + GL_NV_copy_depth_to_color = ext.contains("GL_NV_copy_depth_to_color"); + GL_NV_copy_image = ext.contains("GL_NV_copy_image") && checkExtension("GL_NV_copy_image", NVCopyImage.isAvailable(this)); + GL_NV_deep_texture3D = ext.contains("GL_NV_deep_texture3D"); + GL_NV_depth_buffer_float = ext.contains("GL_NV_depth_buffer_float") && checkExtension("GL_NV_depth_buffer_float", NVDepthBufferFloat.isAvailable(this)); + GL_NV_depth_clamp = ext.contains("GL_NV_depth_clamp"); + GL_NV_draw_texture = ext.contains("GL_NV_draw_texture") && checkExtension("GL_NV_draw_texture", NVDrawTexture.isAvailable(this)); + GL_NV_draw_vulkan_image = ext.contains("GL_NV_draw_vulkan_image") && checkExtension("GL_NV_draw_vulkan_image", NVDrawVulkanImage.isAvailable(this)); + GL_NV_ES3_1_compatibility = ext.contains("GL_NV_ES3_1_compatibility"); + GL_NV_explicit_multisample = ext.contains("GL_NV_explicit_multisample") && checkExtension("GL_NV_explicit_multisample", NVExplicitMultisample.isAvailable(this)); + GL_NV_fence = ext.contains("GL_NV_fence") && checkExtension("GL_NV_fence", NVFence.isAvailable(this)); + GL_NV_fill_rectangle = ext.contains("GL_NV_fill_rectangle"); + GL_NV_float_buffer = ext.contains("GL_NV_float_buffer"); + GL_NV_fog_distance = ext.contains("GL_NV_fog_distance"); + GL_NV_fragment_coverage_to_color = ext.contains("GL_NV_fragment_coverage_to_color") && checkExtension("GL_NV_fragment_coverage_to_color", NVFragmentCoverageToColor.isAvailable(this)); + GL_NV_fragment_program4 = ext.contains("GL_NV_fragment_program4"); + GL_NV_fragment_program_option = ext.contains("GL_NV_fragment_program_option"); + GL_NV_fragment_shader_barycentric = ext.contains("GL_NV_fragment_shader_barycentric"); + GL_NV_fragment_shader_interlock = ext.contains("GL_NV_fragment_shader_interlock"); + GL_NV_framebuffer_mixed_samples = ext.contains("GL_NV_framebuffer_mixed_samples") && checkExtension("GL_NV_framebuffer_mixed_samples", NVFramebufferMixedSamples.isAvailable(this)); + GL_NV_framebuffer_multisample_coverage = ext.contains("GL_NV_framebuffer_multisample_coverage") && checkExtension("GL_NV_framebuffer_multisample_coverage", NVFramebufferMultisampleCoverage.isAvailable(this)); + GL_NV_geometry_shader4 = ext.contains("GL_NV_geometry_shader4"); + GL_NV_geometry_shader_passthrough = ext.contains("GL_NV_geometry_shader_passthrough"); + GL_NV_gpu_multicast = ext.contains("GL_NV_gpu_multicast") && checkExtension("GL_NV_gpu_multicast", NVGPUMulticast.isAvailable(this)); + GL_NV_gpu_shader5 = ext.contains("GL_NV_gpu_shader5") && checkExtension("GL_NV_gpu_shader5", NVGPUShader5.isAvailable(this, ext)); + GL_NV_half_float = ext.contains("GL_NV_half_float") && checkExtension("GL_NV_half_float", NVHalfFloat.isAvailable(this, ext)); + GL_NV_internalformat_sample_query = ext.contains("GL_NV_internalformat_sample_query") && checkExtension("GL_NV_internalformat_sample_query", NVInternalformatSampleQuery.isAvailable(this)); + GL_NV_light_max_exponent = ext.contains("GL_NV_light_max_exponent"); + GL_NV_memory_attachment = ext.contains("GL_NV_memory_attachment") && checkExtension("GL_NV_memory_attachment", NVMemoryAttachment.isAvailable(this, ext)); + GL_NV_mesh_shader = ext.contains("GL_NV_mesh_shader") && checkExtension("GL_NV_mesh_shader", NVMeshShader.isAvailable(this)); + GL_NV_multisample_coverage = ext.contains("GL_NV_multisample_coverage"); + GL_NV_multisample_filter_hint = ext.contains("GL_NV_multisample_filter_hint"); + GL_NV_packed_depth_stencil = ext.contains("GL_NV_packed_depth_stencil"); + GL_NV_path_rendering = ext.contains("GL_NV_path_rendering") && checkExtension("GL_NV_path_rendering", NVPathRendering.isAvailable(this)); + GL_NV_path_rendering_shared_edge = ext.contains("GL_NV_path_rendering_shared_edge"); + GL_NV_pixel_data_range = ext.contains("GL_NV_pixel_data_range") && checkExtension("GL_NV_pixel_data_range", NVPixelDataRange.isAvailable(this)); + GL_NV_point_sprite = ext.contains("GL_NV_point_sprite") && checkExtension("GL_NV_point_sprite", NVPointSprite.isAvailable(this)); + GL_NV_primitive_restart = ext.contains("GL_NV_primitive_restart") && checkExtension("GL_NV_primitive_restart", NVPrimitiveRestart.isAvailable(this)); + GL_NV_query_resource = ext.contains("GL_NV_query_resource") && checkExtension("GL_NV_query_resource", NVQueryResource.isAvailable(this)); + GL_NV_query_resource_tag = ext.contains("GL_NV_query_resource_tag") && checkExtension("GL_NV_query_resource_tag", NVQueryResourceTag.isAvailable(this)); + GL_NV_representative_fragment_test = ext.contains("GL_NV_representative_fragment_test"); + GL_NV_robustness_video_memory_purge = ext.contains("GL_NV_robustness_video_memory_purge"); + GL_NV_sample_locations = ext.contains("GL_NV_sample_locations") && checkExtension("GL_NV_sample_locations", NVSampleLocations.isAvailable(this)); + GL_NV_sample_mask_override_coverage = ext.contains("GL_NV_sample_mask_override_coverage"); + GL_NV_scissor_exclusive = ext.contains("GL_NV_scissor_exclusive") && checkExtension("GL_NV_scissor_exclusive", NVScissorExclusive.isAvailable(this)); + GL_NV_shader_atomic_float = ext.contains("GL_NV_shader_atomic_float"); + GL_NV_shader_atomic_float64 = ext.contains("GL_NV_shader_atomic_float64"); + GL_NV_shader_atomic_fp16_vector = ext.contains("GL_NV_shader_atomic_fp16_vector"); + GL_NV_shader_atomic_int64 = ext.contains("GL_NV_shader_atomic_int64"); + GL_NV_shader_buffer_load = ext.contains("GL_NV_shader_buffer_load") && checkExtension("GL_NV_shader_buffer_load", NVShaderBufferLoad.isAvailable(this)); + GL_NV_shader_buffer_store = ext.contains("GL_NV_shader_buffer_store"); + GL_NV_shader_subgroup_partitioned = ext.contains("GL_NV_shader_subgroup_partitioned"); + GL_NV_shader_texture_footprint = ext.contains("GL_NV_shader_texture_footprint"); + GL_NV_shader_thread_group = ext.contains("GL_NV_shader_thread_group"); + GL_NV_shader_thread_shuffle = ext.contains("GL_NV_shader_thread_shuffle"); + GL_NV_shading_rate_image = ext.contains("GL_NV_shading_rate_image") && checkExtension("GL_NV_shading_rate_image", NVShadingRateImage.isAvailable(this)); + GL_NV_stereo_view_rendering = ext.contains("GL_NV_stereo_view_rendering"); + GL_NV_texgen_reflection = ext.contains("GL_NV_texgen_reflection"); + GL_NV_texture_barrier = ext.contains("GL_NV_texture_barrier") && checkExtension("GL_NV_texture_barrier", NVTextureBarrier.isAvailable(this)); + GL_NV_texture_compression_vtc = ext.contains("GL_NV_texture_compression_vtc"); + GL_NV_texture_multisample = ext.contains("GL_NV_texture_multisample") && checkExtension("GL_NV_texture_multisample", NVTextureMultisample.isAvailable(this)); + GL_NV_texture_rectangle_compressed = ext.contains("GL_NV_texture_rectangle_compressed"); + GL_NV_transform_feedback = ext.contains("GL_NV_transform_feedback") && checkExtension("GL_NV_transform_feedback", NVTransformFeedback.isAvailable(this)); + GL_NV_transform_feedback2 = ext.contains("GL_NV_transform_feedback2") && checkExtension("GL_NV_transform_feedback2", NVTransformFeedback2.isAvailable(this)); + GL_NV_uniform_buffer_unified_memory = ext.contains("GL_NV_uniform_buffer_unified_memory"); + GL_NV_vertex_array_range = ext.contains("GL_NV_vertex_array_range") && checkExtension("GL_NV_vertex_array_range", NVVertexArrayRange.isAvailable(this)); + GL_NV_vertex_array_range2 = ext.contains("GL_NV_vertex_array_range2"); + GL_NV_vertex_attrib_integer_64bit = ext.contains("GL_NV_vertex_attrib_integer_64bit") && checkExtension("GL_NV_vertex_attrib_integer_64bit", NVVertexAttribInteger64bit.isAvailable(this, ext)); + GL_NV_vertex_buffer_unified_memory = ext.contains("GL_NV_vertex_buffer_unified_memory") && checkExtension("GL_NV_vertex_buffer_unified_memory", NVVertexBufferUnifiedMemory.isAvailable(this)); + GL_NV_viewport_array2 = ext.contains("GL_NV_viewport_array2"); + GL_NV_viewport_swizzle = ext.contains("GL_NV_viewport_swizzle") && checkExtension("GL_NV_viewport_swizzle", NVViewportSwizzle.isAvailable(this)); + GL_NVX_blend_equation_advanced_multi_draw_buffers = ext.contains("GL_NVX_blend_equation_advanced_multi_draw_buffers"); + GL_NVX_conditional_render = ext.contains("GL_NVX_conditional_render") && checkExtension("GL_NVX_conditional_render", NVXConditionalRender.isAvailable(this)); + GL_NVX_gpu_memory_info = ext.contains("GL_NVX_gpu_memory_info"); + GL_NVX_gpu_multicast2 = ext.contains("GL_NVX_gpu_multicast2") && checkExtension("GL_NVX_gpu_multicast2", NVXGpuMulticast2.isAvailable(this)); + GL_NVX_progress_fence = ext.contains("GL_NVX_progress_fence") && checkExtension("GL_NVX_progress_fence", NVXProgressFence.isAvailable(this)); + GL_OVR_multiview = ext.contains("GL_OVR_multiview") && checkExtension("GL_OVR_multiview", OVRMultiview.isAvailable(this, ext)); + GL_OVR_multiview2 = ext.contains("GL_OVR_multiview2"); + + addresses = ThreadLocalUtil.getAddressesFromCapabilities(this); + } + + boolean hasDSA(Set ext) { + return ext.contains("GL45") || ext.contains("GL_ARB_direct_state_access") || ext.contains("GL_EXT_direct_state_access"); + } + + private static long getFunctionAddress(boolean fc, FunctionProvider provider, String functionName) { + return fc ? NULL : provider.getFunctionAddress(functionName); + } + + private static boolean checkExtension(String extension, boolean supported) { + if (supported) { + return true; + } + + apiLog("[GL] " + extension + " was reported as available but an entry point is missing."); + return false; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLChecks.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLChecks.java new file mode 100644 index 00000000..91cac0f6 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLChecks.java @@ -0,0 +1,109 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.opengl; + +import static org.lwjgl.opengl.GL41.*; +import static org.lwjgl.opengl.NVGPUShader5.*; +import static org.lwjgl.system.APIUtil.*; + +final class GLChecks { + + private GLChecks() { + } + + /** + * Returns the number of bytes required to store the specified OpenGL type. + * + * @param type the OpenGL type to translate + * + * @return the number of bytes + */ + static int typeToBytes(int type) { + switch (type) { + case GL_BYTE: + case GL_UNSIGNED_BYTE: + return 1; + case GL_SHORT: + case GL_UNSIGNED_SHORT: + case GL_2_BYTES: + case GL_HALF_FLOAT: + return 2; + case GL_3_BYTES: + return 3; + case GL_INT: + case GL_UNSIGNED_INT: + case GL_FLOAT: + case GL_4_BYTES: + case GL_FIXED: + return 4; + case GL_DOUBLE: + case GL_INT64_NV: + case GL_UNSIGNED_INT64_NV: + return 8; + default: + throw new IllegalArgumentException(apiUnknownToken("Unsupported OpenGL type", type)); + } + } + + /** + * Returns the power-of-two of the number of bytes required to store the specified OpenGL type. + * + * @param type the OpenGL type to translate + * + * @return the number of bytes PoT value + */ + static int typeToByteShift(int type) { + switch (type) { + case GL_BYTE: + case GL_UNSIGNED_BYTE: + return 0; + case GL_SHORT: + case GL_UNSIGNED_SHORT: + case GL_2_BYTES: + case GL_HALF_FLOAT: + return 1; + case GL_INT: + case GL_UNSIGNED_INT: + case GL_FLOAT: + case GL_4_BYTES: + case GL_FIXED: + return 2; + case GL_DOUBLE: + case GL_INT64_NV: + case GL_UNSIGNED_INT64_NV: + return 3; + default: + throw new IllegalArgumentException(apiUnknownToken("Unsupported OpenGL type", type)); + } + } + + /** + * Queries the specified parameter of the specified texture object level. If direct-state-access functionality is not available, the texture must be + * currently bound to the specified texture target. + * + * @param texture the texture object + * @param target the texture target + * @param level the texture level + * @param pname the parameter to query + * + * @return the parameter value + */ + static int getTexLevelParameteri(int texture, int target, int level, int pname) { + GLCapabilities caps = GL.getCapabilities(); + + if (caps.OpenGL45) { + return GL45.glGetTextureLevelParameteri(texture, level, pname); + } + if (caps.GL_ARB_direct_state_access) { + return ARBDirectStateAccess.glGetTextureLevelParameteri(texture, level, pname); + } + if (caps.GL_EXT_direct_state_access) { + return EXTDirectStateAccess.glGetTextureLevelParameteriEXT(texture, target, level, pname); + } + + return glGetTexLevelParameteri(target, level, pname); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageAMDCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageAMDCallback.java new file mode 100644 index 00000000..472abe7c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageAMDCallback.java @@ -0,0 +1,94 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Instances of this class may be passed to the {@link AMDDebugOutput#glDebugMessageCallbackAMD DebugMessageCallbackAMD} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLuint id,
+ *     GLenum category,
+ *     GLenum severity,
+ *     GLsizei length,
+ *     GLchar const *message,
+ *     void *userParam
+ * )
+ */ +public abstract class GLDebugMessageAMDCallback extends Callback implements GLDebugMessageAMDCallbackI { + + /** + * Creates a {@code GLDebugMessageAMDCallback} instance from the specified function pointer. + * + * @return the new {@code GLDebugMessageAMDCallback} + */ + public static GLDebugMessageAMDCallback create(long functionPointer) { + GLDebugMessageAMDCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLDebugMessageAMDCallback + ? (GLDebugMessageAMDCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLDebugMessageAMDCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLDebugMessageAMDCallback} instance that delegates to the specified {@code GLDebugMessageAMDCallbackI} instance. */ + public static GLDebugMessageAMDCallback create(GLDebugMessageAMDCallbackI instance) { + return instance instanceof GLDebugMessageAMDCallback + ? (GLDebugMessageAMDCallback)instance + : new Container(instance.address(), instance); + } + + protected GLDebugMessageAMDCallback() { + super(SIGNATURE); + } + + GLDebugMessageAMDCallback(long functionPointer) { + super(functionPointer); + } + + /** + * Converts the specified {@link GLDebugMessageAMDCallback} arguments to a String. + * + *

This method may only be used inside a GLDebugMessageAMDCallback invocation.

+ * + * @param length the GLDebugMessageAMDCallback {@code length} argument + * @param message the GLDebugMessageAMDCallback {@code message} argument + * + * @return the message as a String + */ + public static String getMessage(int length, long message) { + return memUTF8(memByteBuffer(message, length)); + } + + private static final class Container extends GLDebugMessageAMDCallback { + + private final GLDebugMessageAMDCallbackI delegate; + + Container(long functionPointer, GLDebugMessageAMDCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(int id, int category, int severity, int length, long message, long userParam) { + delegate.invoke(id, category, severity, length, message, userParam); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageAMDCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageAMDCallbackI.java new file mode 100644 index 00000000..ec1d9133 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageAMDCallbackI.java @@ -0,0 +1,60 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link AMDDebugOutput#glDebugMessageCallbackAMD DebugMessageCallbackAMD} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLuint id,
+ *     GLenum category,
+ *     GLenum severity,
+ *     GLsizei length,
+ *     GLchar const *message,
+ *     void *userParam
+ * )
+ */ +@FunctionalInterface +@NativeType("GLDEBUGPROCAMD") +public interface GLDebugMessageAMDCallbackI extends CallbackI.V { + + String SIGNATURE = Callback.__stdcall("(iiiipp)v"); + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgInt(args), + dcbArgInt(args), + dcbArgInt(args), + dcbArgInt(args), + dcbArgPointer(args), + dcbArgPointer(args) + ); + } + + /** + * Will be called when a debug message is generated. + * + * @param id the message ID + * @param category the message category + * @param severity the message severity + * @param length the message length, excluding the null-terminator + * @param message a pointer to the message string representation + * @param userParam the user-specified value that was passed when calling {@link AMDDebugOutput#glDebugMessageCallbackAMD DebugMessageCallbackAMD} + */ + void invoke(@NativeType("GLuint") int id, @NativeType("GLenum") int category, @NativeType("GLenum") int severity, @NativeType("GLsizei") int length, @NativeType("GLchar const *") long message, @NativeType("void *") long userParam); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageARBCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageARBCallback.java new file mode 100644 index 00000000..9fac999a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageARBCallback.java @@ -0,0 +1,95 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Instances of this class may be passed to the {@link ARBDebugOutput#glDebugMessageCallbackARB DebugMessageCallbackARB} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLenum source,
+ *     GLenum type,
+ *     GLuint id,
+ *     GLenum severity,
+ *     GLsizei length,
+ *     GLchar const *message,
+ *     void const *userParam
+ * )
+ */ +public abstract class GLDebugMessageARBCallback extends Callback implements GLDebugMessageARBCallbackI { + + /** + * Creates a {@code GLDebugMessageARBCallback} instance from the specified function pointer. + * + * @return the new {@code GLDebugMessageARBCallback} + */ + public static GLDebugMessageARBCallback create(long functionPointer) { + GLDebugMessageARBCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLDebugMessageARBCallback + ? (GLDebugMessageARBCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLDebugMessageARBCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLDebugMessageARBCallback} instance that delegates to the specified {@code GLDebugMessageARBCallbackI} instance. */ + public static GLDebugMessageARBCallback create(GLDebugMessageARBCallbackI instance) { + return instance instanceof GLDebugMessageARBCallback + ? (GLDebugMessageARBCallback)instance + : new Container(instance.address(), instance); + } + + protected GLDebugMessageARBCallback() { + super(SIGNATURE); + } + + GLDebugMessageARBCallback(long functionPointer) { + super(functionPointer); + } + + /** + * Converts the specified {@link GLDebugMessageARBCallback} arguments to a String. + * + *

This method may only be used inside a GLDebugMessageARBCallback invocation.

+ * + * @param length the GLDebugMessageARBCallback {@code length} argument + * @param message the GLDebugMessageARBCallback {@code message} argument + * + * @return the message as a String + */ + public static String getMessage(int length, long message) { + return memUTF8(memByteBuffer(message, length)); + } + + private static final class Container extends GLDebugMessageARBCallback { + + private final GLDebugMessageARBCallbackI delegate; + + Container(long functionPointer, GLDebugMessageARBCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(int source, int type, int id, int severity, int length, long message, long userParam) { + delegate.invoke(source, type, id, severity, length, message, userParam); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageARBCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageARBCallbackI.java new file mode 100644 index 00000000..61cfdcd1 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageARBCallbackI.java @@ -0,0 +1,63 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link ARBDebugOutput#glDebugMessageCallbackARB DebugMessageCallbackARB} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLenum source,
+ *     GLenum type,
+ *     GLuint id,
+ *     GLenum severity,
+ *     GLsizei length,
+ *     GLchar const *message,
+ *     void const *userParam
+ * )
+ */ +@FunctionalInterface +@NativeType("GLDEBUGPROCARB") +public interface GLDebugMessageARBCallbackI extends CallbackI.V { + + String SIGNATURE = Callback.__stdcall("(iiiiipp)v"); + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgInt(args), + dcbArgInt(args), + dcbArgInt(args), + dcbArgInt(args), + dcbArgInt(args), + dcbArgPointer(args), + dcbArgPointer(args) + ); + } + + /** + * Will be called when a debug message is generated. + * + * @param source the message source + * @param type the message type + * @param id the message ID + * @param severity the message severity + * @param length the message length, excluding the null-terminator + * @param message a pointer to the message string representation + * @param userParam the user-specified value that was passed when calling {@link ARBDebugOutput#glDebugMessageCallbackARB DebugMessageCallbackARB} + */ + void invoke(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLuint") int id, @NativeType("GLenum") int severity, @NativeType("GLsizei") int length, @NativeType("GLchar const *") long message, @NativeType("void const *") long userParam); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageCallback.java new file mode 100644 index 00000000..b437e7f7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageCallback.java @@ -0,0 +1,95 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Instances of this class may be passed to the {@link GL43#glDebugMessageCallback} and {@link KHRDebug#glDebugMessageCallback} methods. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLenum source,
+ *     GLenum type,
+ *     GLuint id,
+ *     GLenum severity,
+ *     GLsizei length,
+ *     GLchar const *message,
+ *     void const *userParam
+ * )
+ */ +public abstract class GLDebugMessageCallback extends Callback implements GLDebugMessageCallbackI { + + /** + * Creates a {@code GLDebugMessageCallback} instance from the specified function pointer. + * + * @return the new {@code GLDebugMessageCallback} + */ + public static GLDebugMessageCallback create(long functionPointer) { + GLDebugMessageCallbackI instance = Callback.get(functionPointer); + return instance instanceof GLDebugMessageCallback + ? (GLDebugMessageCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static GLDebugMessageCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code GLDebugMessageCallback} instance that delegates to the specified {@code GLDebugMessageCallbackI} instance. */ + public static GLDebugMessageCallback create(GLDebugMessageCallbackI instance) { + return instance instanceof GLDebugMessageCallback + ? (GLDebugMessageCallback)instance + : new Container(instance.address(), instance); + } + + protected GLDebugMessageCallback() { + super(SIGNATURE); + } + + GLDebugMessageCallback(long functionPointer) { + super(functionPointer); + } + + /** + * Converts the specified {@link GLDebugMessageCallback} arguments to a String. + * + *

This method may only be used inside a GLDebugMessageCallback invocation.

+ * + * @param length the GLDebugMessageCallback {@code length} argument + * @param message the GLDebugMessageCallback {@code message} argument + * + * @return the message as a String + */ + public static String getMessage(int length, long message) { + return memUTF8(memByteBuffer(message, length)); + } + + private static final class Container extends GLDebugMessageCallback { + + private final GLDebugMessageCallbackI delegate; + + Container(long functionPointer, GLDebugMessageCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(int source, int type, int id, int severity, int length, long message, long userParam) { + delegate.invoke(source, type, id, severity, length, message, userParam); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageCallbackI.java new file mode 100644 index 00000000..d7366f1a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLDebugMessageCallbackI.java @@ -0,0 +1,63 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link GL43#glDebugMessageCallback} and {@link KHRDebug#glDebugMessageCallback} methods. + * + *

Type

+ * + *

+ * void (*) (
+ *     GLenum source,
+ *     GLenum type,
+ *     GLuint id,
+ *     GLenum severity,
+ *     GLsizei length,
+ *     GLchar const *message,
+ *     void const *userParam
+ * )
+ */ +@FunctionalInterface +@NativeType("GLDEBUGPROC") +public interface GLDebugMessageCallbackI extends CallbackI.V { + + String SIGNATURE = Callback.__stdcall("(iiiiipp)v"); + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgInt(args), + dcbArgInt(args), + dcbArgInt(args), + dcbArgInt(args), + dcbArgInt(args), + dcbArgPointer(args), + dcbArgPointer(args) + ); + } + + /** + * Will be called when a debug message is generated. + * + * @param source the message source + * @param type the message type + * @param id the message ID + * @param severity the message severity + * @param length the message length, excluding the null-terminator + * @param message a pointer to the message string representation + * @param userParam the user-specified value that was passed when calling {@link GL43#glDebugMessageCallback} or {@link KHRDebug#glDebugMessageCallback} + */ + void invoke(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLuint") int id, @NativeType("GLenum") int severity, @NativeType("GLsizei") int length, @NativeType("GLchar const *") long message, @NativeType("void const *") long userParam); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLUtil.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLUtil.java new file mode 100644 index 00000000..669f2f2b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLUtil.java @@ -0,0 +1,256 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import javax.annotation.*; +import java.io.*; + +import static org.lwjgl.opengl.AMDDebugOutput.*; +import static org.lwjgl.opengl.ARBDebugOutput.*; +import static org.lwjgl.opengl.GL43C.*; +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** OpenGL utilities. */ +public final class GLUtil { + + private GLUtil() { + } + + /** + * Detects the best debug output functionality to use and creates a callback that prints information to {@link APIUtil#DEBUG_STREAM}. The callback + * function is returned as a {@link Callback}, that should be {@link Callback#free freed} when no longer needed. + */ + @Nullable + public static Callback setupDebugMessageCallback() { + return setupDebugMessageCallback(APIUtil.DEBUG_STREAM); + } + + /** + * Detects the best debug output functionality to use and creates a callback that prints information to the specified {@link PrintStream}. The callback + * function is returned as a {@link Callback}, that should be {@link Callback#free freed} when no longer needed. + * + * @param stream the output {@link PrintStream} + */ + @Nullable + public static Callback setupDebugMessageCallback(PrintStream stream) { + GLCapabilities caps = GL.getCapabilities(); + + if (caps.OpenGL43) { + apiLog("[GL] Using OpenGL 4.3 for error logging."); + GLDebugMessageCallback proc = GLDebugMessageCallback.create((source, type, id, severity, length, message, userParam) -> { + stream.println("[LWJGL] OpenGL debug message"); + printDetail(stream, "ID", String.format("0x%X", id)); + printDetail(stream, "Source", getDebugSource(source)); + printDetail(stream, "Type", getDebugType(type)); + printDetail(stream, "Severity", getDebugSeverity(severity)); + printDetail(stream, "Message", GLDebugMessageCallback.getMessage(length, message)); + }); + glDebugMessageCallback(proc, NULL); + if ((glGetInteger(GL_CONTEXT_FLAGS) & GL_CONTEXT_FLAG_DEBUG_BIT) == 0) { + apiLog("[GL] Warning: A non-debug context may not produce any debug output."); + glEnable(GL_DEBUG_OUTPUT); + } + return proc; + } + + if (caps.GL_KHR_debug) { + apiLog("[GL] Using KHR_debug for error logging."); + GLDebugMessageCallback proc = GLDebugMessageCallback.create((source, type, id, severity, length, message, userParam) -> { + stream.println("[LWJGL] OpenGL debug message"); + printDetail(stream, "ID", String.format("0x%X", id)); + printDetail(stream, "Source", getDebugSource(source)); + printDetail(stream, "Type", getDebugType(type)); + printDetail(stream, "Severity", getDebugSeverity(severity)); + printDetail(stream, "Message", GLDebugMessageCallback.getMessage(length, message)); + }); + KHRDebug.glDebugMessageCallback(proc, NULL); + if (caps.OpenGL30 && (glGetInteger(GL_CONTEXT_FLAGS) & GL_CONTEXT_FLAG_DEBUG_BIT) == 0) { + apiLog("[GL] Warning: A non-debug context may not produce any debug output."); + glEnable(GL_DEBUG_OUTPUT); + } + return proc; + } + + if (caps.GL_ARB_debug_output) { + apiLog("[GL] Using ARB_debug_output for error logging."); + GLDebugMessageARBCallback proc = GLDebugMessageARBCallback.create((source, type, id, severity, length, message, userParam) -> { + stream.println("[LWJGL] ARB_debug_output message"); + printDetail(stream, "ID", String.format("0x%X", id)); + printDetail(stream, "Source", getSourceARB(source)); + printDetail(stream, "Type", getTypeARB(type)); + printDetail(stream, "Severity", getSeverityARB(severity)); + printDetail(stream, "Message", GLDebugMessageARBCallback.getMessage(length, message)); + }); + glDebugMessageCallbackARB(proc, NULL); + return proc; + } + + if (caps.GL_AMD_debug_output) { + apiLog("[GL] Using AMD_debug_output for error logging."); + GLDebugMessageAMDCallback proc = GLDebugMessageAMDCallback.create((id, category, severity, length, message, userParam) -> { + stream.println("[LWJGL] AMD_debug_output message"); + printDetail(stream, "ID", String.format("0x%X", id)); + printDetail(stream, "Category", getCategoryAMD(category)); + printDetail(stream, "Severity", getSeverityAMD(severity)); + printDetail(stream, "Message", GLDebugMessageAMDCallback.getMessage(length, message)); + }); + glDebugMessageCallbackAMD(proc, NULL); + return proc; + } + + apiLog("[GL] No debug output implementation is available."); + return null; + } + + private static void printDetail(PrintStream stream, String type, String message) { + stream.printf("\t%s: %s\n", type, message); + } + + private static String getDebugSource(int source) { + switch (source) { + case GL_DEBUG_SOURCE_API: + return "API"; + case GL_DEBUG_SOURCE_WINDOW_SYSTEM: + return "WINDOW SYSTEM"; + case GL_DEBUG_SOURCE_SHADER_COMPILER: + return "SHADER COMPILER"; + case GL_DEBUG_SOURCE_THIRD_PARTY: + return "THIRD PARTY"; + case GL_DEBUG_SOURCE_APPLICATION: + return "APPLICATION"; + case GL_DEBUG_SOURCE_OTHER: + return "OTHER"; + default: + return apiUnknownToken(source); + } + } + + private static String getDebugType(int type) { + switch (type) { + case GL_DEBUG_TYPE_ERROR: + return "ERROR"; + case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR: + return "DEPRECATED BEHAVIOR"; + case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR: + return "UNDEFINED BEHAVIOR"; + case GL_DEBUG_TYPE_PORTABILITY: + return "PORTABILITY"; + case GL_DEBUG_TYPE_PERFORMANCE: + return "PERFORMANCE"; + case GL_DEBUG_TYPE_OTHER: + return "OTHER"; + case GL_DEBUG_TYPE_MARKER: + return "MARKER"; + default: + return apiUnknownToken(type); + } + } + + private static String getDebugSeverity(int severity) { + switch (severity) { + case GL_DEBUG_SEVERITY_HIGH: + return "HIGH"; + case GL_DEBUG_SEVERITY_MEDIUM: + return "MEDIUM"; + case GL_DEBUG_SEVERITY_LOW: + return "LOW"; + case GL_DEBUG_SEVERITY_NOTIFICATION: + return "NOTIFICATION"; + default: + return apiUnknownToken(severity); + } + } + + private static String getSourceARB(int source) { + switch (source) { + case GL_DEBUG_SOURCE_API_ARB: + return "API"; + case GL_DEBUG_SOURCE_WINDOW_SYSTEM_ARB: + return "WINDOW SYSTEM"; + case GL_DEBUG_SOURCE_SHADER_COMPILER_ARB: + return "SHADER COMPILER"; + case GL_DEBUG_SOURCE_THIRD_PARTY_ARB: + return "THIRD PARTY"; + case GL_DEBUG_SOURCE_APPLICATION_ARB: + return "APPLICATION"; + case GL_DEBUG_SOURCE_OTHER_ARB: + return "OTHER"; + default: + return apiUnknownToken(source); + } + } + + private static String getTypeARB(int type) { + switch (type) { + case GL_DEBUG_TYPE_ERROR_ARB: + return "ERROR"; + case GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR_ARB: + return "DEPRECATED BEHAVIOR"; + case GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR_ARB: + return "UNDEFINED BEHAVIOR"; + case GL_DEBUG_TYPE_PORTABILITY_ARB: + return "PORTABILITY"; + case GL_DEBUG_TYPE_PERFORMANCE_ARB: + return "PERFORMANCE"; + case GL_DEBUG_TYPE_OTHER_ARB: + return "OTHER"; + default: + return apiUnknownToken(type); + } + } + + private static String getSeverityARB(int severity) { + switch (severity) { + case GL_DEBUG_SEVERITY_HIGH_ARB: + return "HIGH"; + case GL_DEBUG_SEVERITY_MEDIUM_ARB: + return "MEDIUM"; + case GL_DEBUG_SEVERITY_LOW_ARB: + return "LOW"; + default: + return apiUnknownToken(severity); + } + } + + private static String getCategoryAMD(int category) { + switch (category) { + case GL_DEBUG_CATEGORY_API_ERROR_AMD: + return "API ERROR"; + case GL_DEBUG_CATEGORY_WINDOW_SYSTEM_AMD: + return "WINDOW SYSTEM"; + case GL_DEBUG_CATEGORY_DEPRECATION_AMD: + return "DEPRECATION"; + case GL_DEBUG_CATEGORY_UNDEFINED_BEHAVIOR_AMD: + return "UNDEFINED BEHAVIOR"; + case GL_DEBUG_CATEGORY_PERFORMANCE_AMD: + return "PERFORMANCE"; + case GL_DEBUG_CATEGORY_SHADER_COMPILER_AMD: + return "SHADER COMPILER"; + case GL_DEBUG_CATEGORY_APPLICATION_AMD: + return "APPLICATION"; + case GL_DEBUG_CATEGORY_OTHER_AMD: + return "OTHER"; + default: + return apiUnknownToken(category); + } + } + + private static String getSeverityAMD(int severity) { + switch (severity) { + case GL_DEBUG_SEVERITY_HIGH_AMD: + return "HIGH"; + case GL_DEBUG_SEVERITY_MEDIUM_AMD: + return "MEDIUM"; + case GL_DEBUG_SEVERITY_LOW_AMD: + return "LOW"; + default: + return apiUnknownToken(severity); + } + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLX.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLX.java new file mode 100644 index 00000000..9c94337c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLX.java @@ -0,0 +1,483 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +import org.lwjgl.system.linux.*; + +/** Native bindings to GLX. */ +public class GLX { + + /** Errors. */ + public static final int + GLXBadContext = 0, + GLXBadContextState = 1, + GLXBadDrawable = 2, + GLXBadPixmap = 3, + GLXBadContextTag = 4, + GLXBadCurrentWindow = 5, + GLXBadRenderRequest = 6, + GLXBadLargeRequest = 7, + GLXUnsupportedPrivateRequest = 8, + GLXBadFBConfig = 9, + GLXBadPbuffer = 10, + GLXBadCurrentDrawable = 11, + GLXBadWindow = 12; + + /** Names for attributes to {@link #glXGetConfig GetConfig}. */ + public static final int + GLX_USE_GL = 1, + GLX_BUFFER_SIZE = 2, + GLX_LEVEL = 3, + GLX_RGBA = 4, + GLX_DOUBLEBUFFER = 5, + GLX_STEREO = 6, + GLX_AUX_BUFFERS = 7, + GLX_RED_SIZE = 8, + GLX_GREEN_SIZE = 9, + GLX_BLUE_SIZE = 10, + GLX_ALPHA_SIZE = 11, + GLX_DEPTH_SIZE = 12, + GLX_STENCIL_SIZE = 13, + GLX_ACCUM_RED_SIZE = 14, + GLX_ACCUM_GREEN_SIZE = 15, + GLX_ACCUM_BLUE_SIZE = 16, + GLX_ACCUM_ALPHA_SIZE = 17; + + /** Error return values from {@link #glXGetConfig GetConfig}. Success is indicated by a value of 0. */ + public static final int + GLX_BAD_SCREEN = 1, + GLX_BAD_ATTRIBUTE = 2, + GLX_NO_EXTENSION = 3, + GLX_BAD_VISUAL = 4, + GLX_BAD_CONTEXT = 5, + GLX_BAD_VALUE = 6, + GLX_BAD_ENUM = 7; + + protected GLX() { + throw new UnsupportedOperationException(); + } + + /** Contains the function pointers loaded from {@code GL.getFunctionProvider()}. */ + public static final class Functions { + + private Functions() {} + + /** Function address. */ + public static final long + QueryExtension = apiGetFunctionAddress(GL.getFunctionProvider(), "glXQueryExtension"), + QueryVersion = apiGetFunctionAddress(GL.getFunctionProvider(), "glXQueryVersion"), + GetConfig = apiGetFunctionAddress(GL.getFunctionProvider(), "glXGetConfig"), + ChooseVisual = apiGetFunctionAddress(GL.getFunctionProvider(), "glXChooseVisual"), + CreateContext = apiGetFunctionAddress(GL.getFunctionProvider(), "glXCreateContext"), + MakeCurrent = apiGetFunctionAddress(GL.getFunctionProvider(), "glXMakeCurrent"), + CopyContext = apiGetFunctionAddress(GL.getFunctionProvider(), "glXCopyContext"), + IsDirect = apiGetFunctionAddress(GL.getFunctionProvider(), "glXIsDirect"), + DestroyContext = apiGetFunctionAddress(GL.getFunctionProvider(), "glXDestroyContext"), + GetCurrentContext = apiGetFunctionAddress(GL.getFunctionProvider(), "glXGetCurrentContext"), + GetCurrentDrawable = apiGetFunctionAddress(GL.getFunctionProvider(), "glXGetCurrentDrawable"), + WaitGL = apiGetFunctionAddress(GL.getFunctionProvider(), "glXWaitGL"), + WaitX = apiGetFunctionAddress(GL.getFunctionProvider(), "glXWaitX"), + SwapBuffers = apiGetFunctionAddress(GL.getFunctionProvider(), "glXSwapBuffers"), + UseXFont = apiGetFunctionAddress(GL.getFunctionProvider(), "glXUseXFont"), + CreateGLXPixmap = apiGetFunctionAddress(GL.getFunctionProvider(), "glXCreateGLXPixmap"), + DestroyGLXPixmap = apiGetFunctionAddress(GL.getFunctionProvider(), "glXDestroyGLXPixmap"); + + } + + // --- [ glXQueryExtension ] --- + + /** Unsafe version of: {@link #glXQueryExtension QueryExtension} */ + public static int nglXQueryExtension(long display, long error_base, long event_base) { + long __functionAddress = Functions.QueryExtension; + if (CHECKS) { + check(display); + } + return callPPPI(display, error_base, event_base, __functionAddress); + } + + /** + * Ascertains if the GLX extension is defined for an X server. + * + * @param display the connection to the X server + * @param error_base returns the value of the first error code + * @param event_base returns the value of the first event code + */ + @NativeType("Bool") + public static boolean glXQueryExtension(@NativeType("Display *") long display, @NativeType("int *") IntBuffer error_base, @NativeType("int *") IntBuffer event_base) { + if (CHECKS) { + check(error_base, 1); + check(event_base, 1); + } + return nglXQueryExtension(display, memAddress(error_base), memAddress(event_base)) != 0; + } + + // --- [ glXQueryVersion ] --- + + /** Unsafe version of: {@link #glXQueryVersion QueryVersion} */ + public static int nglXQueryVersion(long display, long major, long minor) { + long __functionAddress = Functions.QueryVersion; + if (CHECKS) { + check(display); + } + return callPPPI(display, major, minor, __functionAddress); + } + + /** + * Queries the GLX version supported. + * + * @param display the connection to the X server + * @param major returns the major version + * @param minor returns the minor version + */ + @NativeType("Bool") + public static boolean glXQueryVersion(@NativeType("Display *") long display, @NativeType("int *") IntBuffer major, @NativeType("int *") IntBuffer minor) { + if (CHECKS) { + check(major, 1); + check(minor, 1); + } + return nglXQueryVersion(display, memAddress(major), memAddress(minor)) != 0; + } + + // --- [ glXGetConfig ] --- + + /** Unsafe version of: {@link #glXGetConfig GetConfig} */ + public static int nglXGetConfig(long display, long visual, int attribute, long value) { + long __functionAddress = Functions.GetConfig; + if (CHECKS) { + check(display); + XVisualInfo.validate(visual); + } + return callPPPI(display, visual, attribute, value, __functionAddress); + } + + /** + * Returns a description of an OpenGL attribute exported by a Visual. + * + * @param display the connection to the X server + * @param visual a pointer to an {@link XVisualInfo} structure + * @param attribute the attribute to query + * @param value returns the attribute value + */ + public static int glXGetConfig(@NativeType("Display *") long display, @NativeType("XVisualInfo *") XVisualInfo visual, int attribute, @NativeType("int *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + return nglXGetConfig(display, visual.address(), attribute, memAddress(value)); + } + + // --- [ glXChooseVisual ] --- + + /** Unsafe version of: {@link #glXChooseVisual ChooseVisual} */ + public static long nglXChooseVisual(long display, int screen, long attrib_list) { + long __functionAddress = Functions.ChooseVisual; + if (CHECKS) { + check(display); + } + return callPPP(display, screen, attrib_list, __functionAddress); + } + + /** + * Finds a visual that matches the client’s specified attributes. + * + * @param display the connection to the X server + * @param screen the screen number + * @param attrib_list a list of attributes terminated with {@code None} + * + * @return a pointer to an {@code XVisualInfo} structure describing the visual that best matches the specified attributes. If no matching visual exists, {@code NULL} is + * returned. + */ + @Nullable + @NativeType("XVisualInfo *") + public static XVisualInfo glXChooseVisual(@NativeType("Display *") long display, int screen, @Nullable @NativeType("int *") IntBuffer attrib_list) { + if (CHECKS) { + checkNTSafe(attrib_list); + } + long __result = nglXChooseVisual(display, screen, memAddressSafe(attrib_list)); + return XVisualInfo.createSafe(__result); + } + + // --- [ glXCreateContext ] --- + + /** Unsafe version of: {@link #glXCreateContext CreateContext} */ + public static long nglXCreateContext(long display, long visual, long share_list, int direct) { + long __functionAddress = Functions.CreateContext; + if (CHECKS) { + check(display); + XVisualInfo.validate(visual); + } + return callPPPP(display, visual, share_list, direct, __functionAddress); + } + + /** + * Creates an OpenGL context. + * + * @param display the connection to the X server + * @param visual a pointer to an {@link XVisualInfo} structure + * @param share_list the GLXContext to share objects with + * @param direct whether direct rendering is requested + */ + @NativeType("GLXContext") + public static long glXCreateContext(@NativeType("Display *") long display, @NativeType("XVisualInfo *") XVisualInfo visual, @NativeType("GLXContext") long share_list, @NativeType("Bool") boolean direct) { + return nglXCreateContext(display, visual.address(), share_list, direct ? 1 : 0); + } + + // --- [ glXMakeCurrent ] --- + + /** + * Makes a context current in the current thread + * + * @param display the connection to the X server + * @param draw the draw GLXdrawable + * @param ctx the GLXContext to make current + */ + @NativeType("Bool") + public static boolean glXMakeCurrent(@NativeType("Display *") long display, @NativeType("GLXDrawable") long draw, @NativeType("GLXContext") long ctx) { + long __functionAddress = Functions.MakeCurrent; + if (CHECKS) { + check(display); + } + return callPPPI(display, draw, ctx, __functionAddress) != 0; + } + + // --- [ glXCopyContext ] --- + + /** + * Copies OpenGL rendering state from one context to another. + * + * @param display the connection to the X server + * @param source the source GLXContext + * @param dest the destination GLXContext + * @param mask indicates which groups of state variables are to be copied; it contains the bitwise OR of the symbolic names for the attribute groups + */ + public static void glXCopyContext(@NativeType("Display *") long display, @NativeType("GLXContext") long source, @NativeType("GLXContext") long dest, @NativeType("unsigned long") long mask) { + long __functionAddress = Functions.CopyContext; + if (CHECKS) { + check(display); + check(source); + check(dest); + } + callPPPNV(display, source, dest, mask, __functionAddress); + } + + // --- [ glXIsDirect ] --- + + /** + * Determines if an OpenGL rendering context is direct. + * + * @param display the connection to the X server + * @param ctx the GLXContext to query + */ + @NativeType("Bool") + public static boolean glXIsDirect(@NativeType("Display *") long display, @NativeType("GLXContext") long ctx) { + long __functionAddress = Functions.IsDirect; + if (CHECKS) { + check(display); + check(ctx); + } + return callPPI(display, ctx, __functionAddress) != 0; + } + + // --- [ glXDestroyContext ] --- + + /** + * Destroys an OpenGL context. + * + *

If {@code ctx} is still current to any thread, {@code ctx} is not destroyed until it is no longer current. In any event, the associated XID will be + * destroyed and {@code ctx} cannot subsequently be made current to any thread.

+ * + * @param display the connection to the X server + * @param ctx the GLXContext to destroy + */ + public static void glXDestroyContext(@NativeType("Display *") long display, @NativeType("GLXContext") long ctx) { + long __functionAddress = Functions.DestroyContext; + if (CHECKS) { + check(display); + check(ctx); + } + callPPV(display, ctx, __functionAddress); + } + + // --- [ glXGetCurrentContext ] --- + + /** Returns the GLXContext that is current in the current thread. */ + @NativeType("GLXContext") + public static long glXGetCurrentContext() { + long __functionAddress = Functions.GetCurrentContext; + return callP(__functionAddress); + } + + // --- [ glXGetCurrentDrawable ] --- + + /** Returns the XID of the current drawable used for rendering. */ + @NativeType("GLXDrawable") + public static long glXGetCurrentDrawable() { + long __functionAddress = Functions.GetCurrentDrawable; + return callP(__functionAddress); + } + + // --- [ glXWaitGL ] --- + + /** + * Prevents X requests from executing until any outstanding OpenGL rendering is done. + * + *

OpenGL calls made prior to {@code glXWaitGL} are guaranteed to be executed before X rendering calls made after {@code glXWaitGL}. While the same result + * can be achieved using {@link GL11C#glFinish Finish}, {@code glXWaitGL} does not require a round trip to the server, and is therefore more efficient in cases + * where the client and server are on separate machines.

+ */ + public static void glXWaitGL() { + long __functionAddress = Functions.WaitGL; + callV(__functionAddress); + } + + // --- [ glXWaitX ] --- + + /** + * Prevents the OpenGL command sequence from executing until any outstanding X requests are completed. + * + *

X rendering calls made prior to {@code glXWaitX} are guaranteed to be executed before OpenGL rendering calls made after {@code glXWaitX}. While the same + * result can be achieved using {@code XSync()}, {@code glXWaitX} does not require a round trip to the server, and may therefore be more efficient.

+ */ + public static void glXWaitX() { + long __functionAddress = Functions.WaitX; + callV(__functionAddress); + } + + // --- [ glXSwapBuffers ] --- + + /** + * For drawables that are double buffered, makes the contexts of the back buffer potentially visible (i.e., become the contents of the front buffer). + * + *

The contents of the back buffer then become undefined. This operation is a no-op if draw was created with a non-double-buffered GLXFBConfig, or if draw + * is a GLXPixmap.

+ * + * @param display the connection to the X server + * @param draw a double buffered GLXDrawable + */ + public static void glXSwapBuffers(@NativeType("Display *") long display, @NativeType("GLXDrawable") long draw) { + long __functionAddress = Functions.SwapBuffers; + if (CHECKS) { + check(display); + check(draw); + } + callPPV(display, draw, __functionAddress); + } + + // --- [ glXUseXFont ] --- + + /** + * Provides a shortcut for using X fonts. + * + * @param font the font to use + * @param first the first glyph in the font to use + * @param count the number of display lists to define + * @param list_base the base list number + */ + public static void glXUseXFont(@NativeType("Font") long font, int first, int count, int list_base) { + long __functionAddress = Functions.UseXFont; + callNV(font, first, count, list_base, __functionAddress); + } + + // --- [ glXCreateGLXPixmap ] --- + + /** Unsafe version of: {@link #glXCreateGLXPixmap CreateGLXPixmap} */ + public static long nglXCreateGLXPixmap(long display, long visual, long pixmap) { + long __functionAddress = Functions.CreateGLXPixmap; + if (CHECKS) { + check(display); + XVisualInfo.validate(visual); + } + return callPPNP(display, visual, pixmap, __functionAddress); + } + + /** + * Creates a GLXPixmap from a Pixmap. + * + * @param display the connection to the X server + * @param visual a pointer to a {@link XVisualInfo} structure + * @param pixmap the Pixmap + */ + @NativeType("GLXPixmap") + public static long glXCreateGLXPixmap(@NativeType("Display *") long display, @NativeType("XVisualInfo *") XVisualInfo visual, @NativeType("Pixmap") long pixmap) { + return nglXCreateGLXPixmap(display, visual.address(), pixmap); + } + + // --- [ glXDestroyGLXPixmap ] --- + + /** + * Destroys a GLXPixmap. + * + * @param display the connection to the X server + * @param pixmap the GLXPixmap to destroy. + */ + public static void glXDestroyGLXPixmap(@NativeType("Display *") long display, @NativeType("GLXPixmap") long pixmap) { + long __functionAddress = Functions.DestroyGLXPixmap; + if (CHECKS) { + check(display); + check(pixmap); + } + callPPV(display, pixmap, __functionAddress); + } + + /** Array version of: {@link #glXQueryExtension QueryExtension} */ + @NativeType("Bool") + public static boolean glXQueryExtension(@NativeType("Display *") long display, @NativeType("int *") int[] error_base, @NativeType("int *") int[] event_base) { + long __functionAddress = Functions.QueryExtension; + if (CHECKS) { + check(display); + check(error_base, 1); + check(event_base, 1); + } + return callPPPI(display, error_base, event_base, __functionAddress) != 0; + } + + /** Array version of: {@link #glXQueryVersion QueryVersion} */ + @NativeType("Bool") + public static boolean glXQueryVersion(@NativeType("Display *") long display, @NativeType("int *") int[] major, @NativeType("int *") int[] minor) { + long __functionAddress = Functions.QueryVersion; + if (CHECKS) { + check(display); + check(major, 1); + check(minor, 1); + } + return callPPPI(display, major, minor, __functionAddress) != 0; + } + + /** Array version of: {@link #glXGetConfig GetConfig} */ + public static int glXGetConfig(@NativeType("Display *") long display, @NativeType("XVisualInfo *") XVisualInfo visual, int attribute, @NativeType("int *") int[] value) { + long __functionAddress = Functions.GetConfig; + if (CHECKS) { + check(display); + check(value, 1); + XVisualInfo.validate(visual.address()); + } + return callPPPI(display, visual.address(), attribute, value, __functionAddress); + } + + /** Array version of: {@link #glXChooseVisual ChooseVisual} */ + @Nullable + @NativeType("XVisualInfo *") + public static XVisualInfo glXChooseVisual(@NativeType("Display *") long display, int screen, @Nullable @NativeType("int *") int[] attrib_list) { + long __functionAddress = Functions.ChooseVisual; + if (CHECKS) { + check(display); + checkNTSafe(attrib_list); + } + long __result = callPPP(display, screen, attrib_list, __functionAddress); + return XVisualInfo.createSafe(__result); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLX11.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLX11.java new file mode 100644 index 00000000..db0297d5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLX11.java @@ -0,0 +1,111 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to GLX 1.1. */ +public class GLX11 extends GLX { + + /** Names for attributes to {@link #glXGetClientString GetClientString}. */ + public static final int + GLX_VENDOR = 0x1, + GLX_VERSION = 0x2, + GLX_EXTENSIONS = 0x3; + + protected GLX11() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLXCapabilities caps) { + return checkFunctions( + caps.glXQueryExtensionsString, caps.glXGetClientString, caps.glXQueryServerString + ); + } + + // --- [ glXQueryExtensionsString ] --- + + /** Unsafe version of: {@link #glXQueryExtensionsString QueryExtensionsString} */ + public static long nglXQueryExtensionsString(long display, int screen) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXQueryExtensionsString; + if (CHECKS) { + check(__functionAddress); + check(display); + } + return callPP(display, screen, __functionAddress); + } + + /** + * Returns a string describing which GLX extensions are supported on the connection. + * + * @param display the connection to the X server + * @param screen the screen number + */ + @Nullable + @NativeType("char const *") + public static String glXQueryExtensionsString(@NativeType("Display *") long display, int screen) { + long __result = nglXQueryExtensionsString(display, screen); + return memASCIISafe(__result); + } + + // --- [ glXGetClientString ] --- + + /** Unsafe version of: {@link #glXGetClientString GetClientString} */ + public static long nglXGetClientString(long display, int name) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetClientString; + if (CHECKS) { + check(__functionAddress); + check(display); + } + return callPP(display, name, __functionAddress); + } + + /** + * Returns a pointer to a string describing some aspect of the client library. + * + * @param display the connection to the X server + * @param name the string to query + */ + @Nullable + @NativeType("char const *") + public static String glXGetClientString(@NativeType("Display *") long display, int name) { + long __result = nglXGetClientString(display, name); + return memASCIISafe(__result); + } + + // --- [ glXQueryServerString ] --- + + /** Unsafe version of: {@link #glXQueryServerString QueryServerString} */ + public static long nglXQueryServerString(long display, int screen, int name) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXQueryServerString; + if (CHECKS) { + check(__functionAddress); + check(display); + } + return callPP(display, screen, name, __functionAddress); + } + + /** + * Returns a pointer to a string describing some aspect of the server's GLX extension. + * + * @param display the connection to the X server + * @param screen the screen number + * @param name the string to query + */ + @Nullable + @NativeType("char const *") + public static String glXQueryServerString(@NativeType("Display *") long display, int screen, int name) { + long __result = nglXQueryServerString(display, screen, name); + return memASCIISafe(__result); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLX12.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLX12.java new file mode 100644 index 00000000..8e3ea5f0 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLX12.java @@ -0,0 +1,38 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; + +/** Native bindings to GLX 1.2. */ +public class GLX12 extends GLX11 { + + protected GLX12() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLXCapabilities caps) { + return checkFunctions( + caps.glXGetCurrentDisplay + ); + } + + // --- [ glXGetCurrentDisplay ] --- + + /** Returns the display associated with the current context and drawable. */ + @NativeType("Display *") + public static long glXGetCurrentDisplay() { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetCurrentDisplay; + if (CHECKS) { + check(__functionAddress); + } + return callP(__functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLX13.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLX13.java new file mode 100644 index 00000000..b1ef4c1c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLX13.java @@ -0,0 +1,617 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +import org.lwjgl.system.linux.*; + +/** Native bindings to GLX 1.3. */ +public class GLX13 extends GLX12 { + + /** Added in GLX 1.3. */ + public static final int + GLX_WINDOW_BIT = 0x1, + GLX_PIXMAP_BIT = 0x2, + GLX_PBUFFER_BIT = 0x4, + GLX_RGBA_BIT = 0x1, + GLX_COLOR_INDEX_BIT = 0x2, + GLX_PBUFFER_CLOBBER_MASK = 0x8000000, + GLX_FRONT_LEFT_BUFFER_BIT = 0x1, + GLX_FRONT_RIGHT_BUFFER_BIT = 0x2, + GLX_BACK_LEFT_BUFFER_BIT = 0x4, + GLX_BACK_RIGHT_BUFFER_BIT = 0x8, + GLX_AUX_BUFFERS_BIT = 0x10, + GLX_DEPTH_BUFFER_BIT = 0x20, + GLX_STENCIL_BUFFER_BIT = 0x40, + GLX_ACCUM_BUFFER_BIT = 0x80, + GLX_CONFIG_CAVEAT = 0x20, + GLX_X_VISUAL_TYPE = 0x22, + GLX_TRANSPARENT_TYPE = 0x23, + GLX_TRANSPARENT_INDEX_VALUE = 0x24, + GLX_TRANSPARENT_RED_VALUE = 0x25, + GLX_TRANSPARENT_GREEN_VALUE = 0x26, + GLX_TRANSPARENT_BLUE_VALUE = 0x27, + GLX_TRANSPARENT_ALPHA_VALUE = 0x28, + GLX_DONT_CARE = 0xFFFFFFFF, + GLX_NONE = 0x8000, + GLX_SLOW_CONFIG = 0x8001, + GLX_TRUE_COLOR = 0x8002, + GLX_DIRECT_COLOR = 0x8003, + GLX_PSEUDO_COLOR = 0x8004, + GLX_STATIC_COLOR = 0x8005, + GLX_GRAY_SCALE = 0x8006, + GLX_STATIC_GRAY = 0x8007, + GLX_TRANSPARENT_RGB = 0x8008, + GLX_TRANSPARENT_INDEX = 0x8009, + GLX_VISUAL_ID = 0x800B, + GLX_SCREEN = 0x800C, + GLX_NON_CONFORMANT_CONFIG = 0x800D, + GLX_DRAWABLE_TYPE = 0x8010, + GLX_RENDER_TYPE = 0x8011, + GLX_X_RENDERABLE = 0x8012, + GLX_FBCONFIG_ID = 0x8013, + GLX_RGBA_TYPE = 0x8014, + GLX_COLOR_INDEX_TYPE = 0x8015, + GLX_MAX_PBUFFER_WIDTH = 0x8016, + GLX_MAX_PBUFFER_HEIGHT = 0x8017, + GLX_MAX_PBUFFER_PIXELS = 0x8018, + GLX_PRESERVED_CONTENTS = 0x801B, + GLX_LARGEST_PBUFFER = 0x801C, + GLX_WIDTH = 0x801D, + GLX_HEIGHT = 0x801E, + GLX_EVENT_MASK = 0x801F, + GLX_DAMAGED = 0x8020, + GLX_SAVED = 0x8021, + GLX_WINDOW = 0x8022, + GLX_PBUFFER = 0x8023, + GLX_PBUFFER_HEIGHT = 0x8040, + GLX_PBUFFER_WIDTH = 0x8041; + + protected GLX13() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLXCapabilities caps) { + return checkFunctions( + caps.glXGetFBConfigs, caps.glXChooseFBConfig, caps.glXGetFBConfigAttrib, caps.glXGetVisualFromFBConfig, caps.glXCreateWindow, caps.glXCreatePixmap, + caps.glXDestroyPixmap, caps.glXCreatePbuffer, caps.glXDestroyPbuffer, caps.glXQueryDrawable, caps.glXCreateNewContext, caps.glXMakeContextCurrent, + caps.glXGetCurrentReadDrawable, caps.glXQueryContext, caps.glXSelectEvent, caps.glXGetSelectedEvent + ); + } + + // --- [ glXGetFBConfigs ] --- + + /** + * Unsafe version of: {@link #glXGetFBConfigs GetFBConfigs} + * + * @param nelements returns the number of GLXFBConfigs in the returned list + */ + public static long nglXGetFBConfigs(long display, int screen, long nelements) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetFBConfigs; + if (CHECKS) { + check(__functionAddress); + check(display); + } + return callPPP(display, screen, nelements, __functionAddress); + } + + /** + * Returns the list of all GLXFBConfigs that are available on the specified screen. + * + * @param display the connection to the X server + * @param screen the screen number + */ + @Nullable + @NativeType("GLXFBConfig *") + public static PointerBuffer glXGetFBConfigs(@NativeType("Display *") long display, int screen) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + IntBuffer nelements = stack.callocInt(1); + try { + long __result = nglXGetFBConfigs(display, screen, memAddress(nelements)); + return memPointerBufferSafe(__result, nelements.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glXChooseFBConfig ] --- + + /** + * Unsafe version of: {@link #glXChooseFBConfig ChooseFBConfig} + * + * @param nelements returns the number of GLXFBConfigs matched + */ + public static long nglXChooseFBConfig(long display, int screen, long attrib_list, long nelements) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXChooseFBConfig; + if (CHECKS) { + check(__functionAddress); + check(display); + } + return callPPPP(display, screen, attrib_list, nelements, __functionAddress); + } + + /** + * Returns a list of GLXFBConfigs that match a list of attributes. + * + * @param display the connection to the X server + * @param screen the screen number + * @param attrib_list a list of attributes terminated with {@code None} + */ + @Nullable + @NativeType("GLXFBConfig *") + public static PointerBuffer glXChooseFBConfig(@NativeType("Display *") long display, int screen, @Nullable @NativeType("int const *") IntBuffer attrib_list) { + if (CHECKS) { + checkNTSafe(attrib_list); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + IntBuffer nelements = stack.callocInt(1); + try { + long __result = nglXChooseFBConfig(display, screen, memAddressSafe(attrib_list), memAddress(nelements)); + return memPointerBufferSafe(__result, nelements.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glXGetFBConfigAttrib ] --- + + /** Unsafe version of: {@link #glXGetFBConfigAttrib GetFBConfigAttrib} */ + public static int nglXGetFBConfigAttrib(long display, long config, int attribute, long value) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetFBConfigAttrib; + if (CHECKS) { + check(__functionAddress); + check(display); + check(config); + } + return callPPPI(display, config, attribute, value, __functionAddress); + } + + /** + * Queries the value of a GLX attribute for a GLXFBConfig. + * + * @param display the connection to the X server + * @param config the GLXFBConfig being queried + * @param attribute the attribute to query + * @param value the attribute value + */ + public static int glXGetFBConfigAttrib(@NativeType("Display *") long display, @NativeType("GLXFBConfig") long config, int attribute, @NativeType("int *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + return nglXGetFBConfigAttrib(display, config, attribute, memAddress(value)); + } + + // --- [ glXGetVisualFromFBConfig ] --- + + /** Unsafe version of: {@link #glXGetVisualFromFBConfig GetVisualFromFBConfig} */ + public static long nglXGetVisualFromFBConfig(long display, long config) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetVisualFromFBConfig; + if (CHECKS) { + check(__functionAddress); + check(display); + check(config); + } + return callPPP(display, config, __functionAddress); + } + + /** + * Retrieves the associated visual of a GLXFBConfig. + * + * @param display the connection to the X server + * @param config the GLXFBConfig + */ + @Nullable + @NativeType("XVisualInfo *") + public static XVisualInfo glXGetVisualFromFBConfig(@NativeType("Display *") long display, @NativeType("GLXFBConfig") long config) { + long __result = nglXGetVisualFromFBConfig(display, config); + return XVisualInfo.createSafe(__result); + } + + // --- [ glXCreateWindow ] --- + + /** Unsafe version of: {@link #glXCreateWindow CreateWindow} */ + public static long nglXCreateWindow(long display, long config, long win, long attrib_list) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXCreateWindow; + if (CHECKS) { + check(__functionAddress); + check(display); + check(config); + } + return callPPNPP(display, config, win, attrib_list, __functionAddress); + } + + /** + * Create an onscreen rendering area from an X Window and a desired GLXFBConfig. + * + * @param display the connection to the X server + * @param config the GLXFBConfig + * @param win the X Window + * @param attrib_list a list of attributes terminated with {@code None} + */ + @NativeType("GLXWindow") + public static long glXCreateWindow(@NativeType("Display *") long display, @NativeType("GLXFBConfig") long config, @NativeType("Window") long win, @Nullable @NativeType("int const *") IntBuffer attrib_list) { + if (CHECKS) { + checkNTSafe(attrib_list); + } + return nglXCreateWindow(display, config, win, memAddressSafe(attrib_list)); + } + + // --- [ glXCreatePixmap ] --- + + /** Unsafe version of: {@link #glXCreatePixmap CreatePixmap} */ + public static long nglXCreatePixmap(long display, long config, long pixmap, long attrib_list) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXCreatePixmap; + if (CHECKS) { + check(__functionAddress); + check(display); + check(config); + } + return callPPNPP(display, config, pixmap, attrib_list, __functionAddress); + } + + /** + * Creates a GLXPixmap offscreen rendering area from an X Pixmap and a desired GLXFBConfig. + * + * @param display the connection to the X server + * @param config the GLXFBConfig + * @param pixmap the X Pixmap + * @param attrib_list a list of attributes terminated with {@code None} + */ + @NativeType("GLXPixmap") + public static long glXCreatePixmap(@NativeType("Display *") long display, @NativeType("GLXFBConfig") long config, @NativeType("Pixmap") long pixmap, @Nullable @NativeType("int const *") IntBuffer attrib_list) { + if (CHECKS) { + checkNTSafe(attrib_list); + } + return nglXCreatePixmap(display, config, pixmap, memAddressSafe(attrib_list)); + } + + // --- [ glXDestroyPixmap ] --- + + /** + * Destroys a GLXPixmap. + * + * @param display the connection to the X server + * @param pixmap the GLXPixmap to destroy + */ + public static void glXDestroyPixmap(@NativeType("Display *") long display, @NativeType("GLXPixmap") long pixmap) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXDestroyPixmap; + if (CHECKS) { + check(__functionAddress); + check(display); + check(pixmap); + } + callPPV(display, pixmap, __functionAddress); + } + + // --- [ glXCreatePbuffer ] --- + + /** Unsafe version of: {@link #glXCreatePbuffer CreatePbuffer} */ + public static long nglXCreatePbuffer(long display, long config, long attrib_list) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXCreatePbuffer; + if (CHECKS) { + check(__functionAddress); + check(display); + check(config); + } + return callPPPP(display, config, attrib_list, __functionAddress); + } + + /** + * Creates a GLXPbuffer from a GLXFBConfig. + * + * @param display the connection to the X server + * @param config the GLXFBConfig + * @param attrib_list a list of attributes terminated with {@code None} + */ + @NativeType("GLXPbuffer") + public static long glXCreatePbuffer(@NativeType("Display *") long display, @NativeType("GLXFBConfig") long config, @Nullable @NativeType("int const *") IntBuffer attrib_list) { + if (CHECKS) { + checkNTSafe(attrib_list); + } + return nglXCreatePbuffer(display, config, memAddressSafe(attrib_list)); + } + + // --- [ glXDestroyPbuffer ] --- + + /** + * Destroys a GLXPbuffer. + * + * @param display the connection to the X server + * @param pbuf the GLXPbuffer to destroy + */ + public static void glXDestroyPbuffer(@NativeType("Display *") long display, @NativeType("GLXPbuffer") long pbuf) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXDestroyPbuffer; + if (CHECKS) { + check(__functionAddress); + check(display); + check(pbuf); + } + callPPV(display, pbuf, __functionAddress); + } + + // --- [ glXQueryDrawable ] --- + + /** Unsafe version of: {@link #glXQueryDrawable QueryDrawable} */ + public static void nglXQueryDrawable(long display, long draw, int attribute, long value) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXQueryDrawable; + if (CHECKS) { + check(__functionAddress); + check(display); + check(draw); + } + callPPPV(display, draw, attribute, value, __functionAddress); + } + + /** + * Queries an attribute associated with a GLXDrawable. + * + * @param display the connection to the X server + * @param draw the GLXDrawable being queried + * @param attribute the attribute to query + * @param value returns the attribute value + */ + public static void glXQueryDrawable(@NativeType("Display *") long display, @NativeType("GLXDrawable") long draw, int attribute, @NativeType("unsigned int *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nglXQueryDrawable(display, draw, attribute, memAddress(value)); + } + + /** + * Queries an attribute associated with a GLXDrawable. + * + * @param display the connection to the X server + * @param draw the GLXDrawable being queried + * @param attribute the attribute to query + */ + @NativeType("void") + public static int glXQueryDrawable(@NativeType("Display *") long display, @NativeType("GLXDrawable") long draw, int attribute) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer value = stack.callocInt(1); + nglXQueryDrawable(display, draw, attribute, memAddress(value)); + return value.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glXCreateNewContext ] --- + + /** + * Creates an OpenGL rendering context. + * + * @param display the connection to the X server + * @param config the GLXFBConfig + * @param render_type the render type + * @param share_list a GLXContext to share objects with + * @param direct whether direct rendering is requested + */ + @NativeType("GLXContext") + public static long glXCreateNewContext(@NativeType("Display *") long display, @NativeType("GLXFBConfig") long config, int render_type, @NativeType("GLXContext") long share_list, @NativeType("Bool") boolean direct) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXCreateNewContext; + if (CHECKS) { + check(__functionAddress); + check(display); + check(config); + } + return callPPPP(display, config, render_type, share_list, direct ? 1 : 0, __functionAddress); + } + + // --- [ glXMakeContextCurrent ] --- + + /** + * Makes a GLXContext current in the current thread. + * + * @param display the connection to the X server + * @param draw the draw GLXDrawable + * @param read the read GLXDrawable + * @param ctx the GLXContext + */ + @NativeType("Bool") + public static boolean glXMakeContextCurrent(@NativeType("Display *") long display, @NativeType("GLXDrawable") long draw, @NativeType("GLXDrawable") long read, @NativeType("GLXContext") long ctx) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXMakeContextCurrent; + if (CHECKS) { + check(__functionAddress); + check(display); + } + return callPPPPI(display, draw, read, ctx, __functionAddress) != 0; + } + + // --- [ glXGetCurrentReadDrawable ] --- + + /** Returns the current GLXDrawable used for reading in the current thread. */ + @NativeType("GLXDrawable") + public static long glXGetCurrentReadDrawable() { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetCurrentReadDrawable; + if (CHECKS) { + check(__functionAddress); + } + return callP(__functionAddress); + } + + // --- [ glXQueryContext ] --- + + /** Unsafe version of: {@link #glXQueryContext QueryContext} */ + public static int nglXQueryContext(long display, long ctx, int attribute, long value) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXQueryContext; + if (CHECKS) { + check(__functionAddress); + check(display); + check(ctx); + } + return callPPPI(display, ctx, attribute, value, __functionAddress); + } + + /** + * Queries the value of a GLXContext attribute. + * + * @param display the connection to the X server + * @param ctx the GLXContext being queried + * @param attribute the attribute to query + * @param value returns the attribute value + */ + public static int glXQueryContext(@NativeType("Display *") long display, @NativeType("GLXContext") long ctx, int attribute, @NativeType("int *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + return nglXQueryContext(display, ctx, attribute, memAddress(value)); + } + + // --- [ glXSelectEvent ] --- + + /** + * Selects which GLX events should be received on a GLXDrawable. + * + * @param display the connection to the X server + * @param draw the GLXDrawable + * @param event_mask the selection mask + */ + public static void glXSelectEvent(@NativeType("Display *") long display, @NativeType("GLXDrawable") long draw, @NativeType("unsigned long") long event_mask) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXSelectEvent; + if (CHECKS) { + check(__functionAddress); + check(display); + check(draw); + } + callPPNV(display, draw, event_mask, __functionAddress); + } + + // --- [ glXGetSelectedEvent ] --- + + /** Unsafe version of: {@link #glXGetSelectedEvent GetSelectedEvent} */ + public static void nglXGetSelectedEvent(long display, long draw, long event_mask) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetSelectedEvent; + if (CHECKS) { + check(__functionAddress); + check(display); + check(draw); + } + callPPPV(display, draw, event_mask, __functionAddress); + } + + /** + * Returns which GLX events are selected for a GLXDrawable. + * + * @param display the connection to the X server + * @param draw the GLXDrawable + * @param event_mask returns the selection mask + */ + public static void glXGetSelectedEvent(@NativeType("Display *") long display, @NativeType("GLXDrawable") long draw, @NativeType("unsigned long *") CLongBuffer event_mask) { + if (CHECKS) { + check(event_mask, 1); + } + nglXGetSelectedEvent(display, draw, memAddress(event_mask)); + } + + /** Array version of: {@link #glXChooseFBConfig ChooseFBConfig} */ + @Nullable + @NativeType("GLXFBConfig *") + public static PointerBuffer glXChooseFBConfig(@NativeType("Display *") long display, int screen, @Nullable @NativeType("int const *") int[] attrib_list) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXChooseFBConfig; + if (CHECKS) { + check(__functionAddress); + check(display); + checkNTSafe(attrib_list); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + IntBuffer nelements = stack.callocInt(1); + try { + long __result = callPPPP(display, screen, attrib_list, memAddress(nelements), __functionAddress); + return memPointerBufferSafe(__result, nelements.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #glXGetFBConfigAttrib GetFBConfigAttrib} */ + public static int glXGetFBConfigAttrib(@NativeType("Display *") long display, @NativeType("GLXFBConfig") long config, int attribute, @NativeType("int *") int[] value) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetFBConfigAttrib; + if (CHECKS) { + check(__functionAddress); + check(display); + check(config); + check(value, 1); + } + return callPPPI(display, config, attribute, value, __functionAddress); + } + + /** Array version of: {@link #glXCreateWindow CreateWindow} */ + @NativeType("GLXWindow") + public static long glXCreateWindow(@NativeType("Display *") long display, @NativeType("GLXFBConfig") long config, @NativeType("Window") long win, @Nullable @NativeType("int const *") int[] attrib_list) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXCreateWindow; + if (CHECKS) { + check(__functionAddress); + check(display); + check(config); + checkNTSafe(attrib_list); + } + return callPPNPP(display, config, win, attrib_list, __functionAddress); + } + + /** Array version of: {@link #glXCreatePixmap CreatePixmap} */ + @NativeType("GLXPixmap") + public static long glXCreatePixmap(@NativeType("Display *") long display, @NativeType("GLXFBConfig") long config, @NativeType("Pixmap") long pixmap, @Nullable @NativeType("int const *") int[] attrib_list) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXCreatePixmap; + if (CHECKS) { + check(__functionAddress); + check(display); + check(config); + checkNTSafe(attrib_list); + } + return callPPNPP(display, config, pixmap, attrib_list, __functionAddress); + } + + /** Array version of: {@link #glXCreatePbuffer CreatePbuffer} */ + @NativeType("GLXPbuffer") + public static long glXCreatePbuffer(@NativeType("Display *") long display, @NativeType("GLXFBConfig") long config, @Nullable @NativeType("int const *") int[] attrib_list) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXCreatePbuffer; + if (CHECKS) { + check(__functionAddress); + check(display); + check(config); + checkNTSafe(attrib_list); + } + return callPPPP(display, config, attrib_list, __functionAddress); + } + + /** Array version of: {@link #glXQueryDrawable QueryDrawable} */ + public static void glXQueryDrawable(@NativeType("Display *") long display, @NativeType("GLXDrawable") long draw, int attribute, @NativeType("unsigned int *") int[] value) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXQueryDrawable; + if (CHECKS) { + check(__functionAddress); + check(display); + check(draw); + check(value, 1); + } + callPPPV(display, draw, attribute, value, __functionAddress); + } + + /** Array version of: {@link #glXQueryContext QueryContext} */ + public static int glXQueryContext(@NativeType("Display *") long display, @NativeType("GLXContext") long ctx, int attribute, @NativeType("int *") int[] value) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXQueryContext; + if (CHECKS) { + check(__functionAddress); + check(display); + check(ctx); + check(value, 1); + } + return callPPPI(display, ctx, attribute, value, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLX14.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLX14.java new file mode 100644 index 00000000..69707939 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLX14.java @@ -0,0 +1,108 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to GLX 1.4. */ +public class GLX14 extends GLX13 { + + /** Added in GLX 1.4. */ + public static final int + GLX_SAMPLE_BUFFERS = 0x186A0, + GLX_SAMPLES = 0x186A1; + + protected GLX14() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLXCapabilities caps) { + return checkFunctions( + caps.glXGetProcAddress + ); + } + + // --- [ glXGetProcAddress ] --- + + /** Unsafe version of: {@link #glXGetProcAddress GetProcAddress} */ + public static long nglXGetProcAddress(long procName) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetProcAddress; + if (CHECKS) { + check(__functionAddress); + } + return callPP(procName, __functionAddress); + } + + /** + * Returns the address of the extension function named by {@code procName}. The pointer returned should be cast to a function pointer type matching the + * extension function's definition in that extension specification. A return value of {@code NULL} indicates that the specified function does not exist for the + * implementation. + * + *

A non-{@code NULL} return value for {@code glXGetProcAddress} does not guarantee that an extension function is actually supported at runtime. The client must + * also query {@link GL11C#glGetString GetString}({@link GL11#GL_EXTENSIONS}) or {@link GLX11#glXQueryExtensionsString QueryExtensionsString} to determine if an extension is supported by a particular context.

+ * + *

GL function pointers returned by {@code glXGetProcAddress} are independent of the currently bound context and may be used by any context which supports + * the extension.

+ * + *

{@code glXGetProcAddress} may be queried for all of the following functions:

+ * + *
    + *
  • All GL and GLX extension functions supported by the implementation (whether those extensions are supported by the current context or not).
  • + *
  • All core (non-extension) functions in GL and GLX from version 1.0 up to and including the versions of those specifications supported by the + * implementation, as determined by {@link GL11C#glGetString GetString}({@link GL11#GL_VERSION}) and {@link GLX#glXQueryVersion QueryVersion} queries.
  • + *
+ * + * @param procName the function name to query + */ + @NativeType("void *") + public static long glXGetProcAddress(@NativeType("GLchar const *") ByteBuffer procName) { + if (CHECKS) { + checkNT1(procName); + } + return nglXGetProcAddress(memAddress(procName)); + } + + /** + * Returns the address of the extension function named by {@code procName}. The pointer returned should be cast to a function pointer type matching the + * extension function's definition in that extension specification. A return value of {@code NULL} indicates that the specified function does not exist for the + * implementation. + * + *

A non-{@code NULL} return value for {@code glXGetProcAddress} does not guarantee that an extension function is actually supported at runtime. The client must + * also query {@link GL11C#glGetString GetString}({@link GL11#GL_EXTENSIONS}) or {@link GLX11#glXQueryExtensionsString QueryExtensionsString} to determine if an extension is supported by a particular context.

+ * + *

GL function pointers returned by {@code glXGetProcAddress} are independent of the currently bound context and may be used by any context which supports + * the extension.

+ * + *

{@code glXGetProcAddress} may be queried for all of the following functions:

+ * + *
    + *
  • All GL and GLX extension functions supported by the implementation (whether those extensions are supported by the current context or not).
  • + *
  • All core (non-extension) functions in GL and GLX from version 1.0 up to and including the versions of those specifications supported by the + * implementation, as determined by {@link GL11C#glGetString GetString}({@link GL11#GL_VERSION}) and {@link GLX#glXQueryVersion QueryVersion} queries.
  • + *
+ * + * @param procName the function name to query + */ + @NativeType("void *") + public static long glXGetProcAddress(@NativeType("GLchar const *") CharSequence procName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(procName, true); + long procNameEncoded = stack.getPointerAddress(); + return nglXGetProcAddress(procNameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXAMDGPUAssociation.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXAMDGPUAssociation.java new file mode 100644 index 00000000..329059e3 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXAMDGPUAssociation.java @@ -0,0 +1,207 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the GLX_AMD_gpu_association extension. + * + *

There currently is no way for applications to efficiently use GPU resources in systems that contain more than one GPU. Vendors have provided methods + * that attempt to split the workload for an application among the available GPU resources. This has proven to be very inefficient because most + * applications were never written with these sorts of optimizations in mind.

+ * + *

This extension provides a mechanism for applications to explicitly use the GPU resources on a given system individually. By providing this + * functionality, a driver allows applications to make appropriate decisions regarding where and when to distribute rendering tasks.

+ * + *

Requires {@link GL15 OpenGL 1.5}, {@link GLX13 GLX 1.3}, {@link EXTFramebufferObject EXT_framebuffer_object} and {@link GLXARBGetProcAddress GLX_ARB_get_proc_address}.

+ */ +public class GLXAMDGPUAssociation { + + /** Accepted by the {@code property} parameter of {@link #glXGetGPUInfoAMD GetGPUInfoAMD}. */ + public static final int + GLX_GPU_VENDOR_AMD = 0x1F00, + GLX_GPU_RENDERER_STRING_AMD = 0x1F01, + GLX_GPU_OPENGL_VERSION_STRING_AMD = 0x1F02, + GLX_GPU_FASTEST_TARGET_GPUS_AMD = 0x21A2, + GLX_GPU_RAM_AMD = 0x21A3, + GLX_GPU_CLOCK_AMD = 0x21A4, + GLX_GPU_NUM_PIPES_AMD = 0x21A5, + GLX_GPU_NUM_SIMD_AMD = 0x21A6, + GLX_GPU_NUM_RB_AMD = 0x21A7, + GLX_GPU_NUM_SPI_AMD = 0x21A8; + + protected GLXAMDGPUAssociation() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLXCapabilities caps) { + return checkFunctions( + caps.glXBlitContextFramebufferAMD, caps.glXCreateAssociatedContextAMD, caps.glXCreateAssociatedContextAttribsAMD, + caps.glXDeleteAssociatedContextAMD, caps.glXGetContextGPUIDAMD, caps.glXGetCurrentAssociatedContextAMD, caps.glXGetGPUIDsAMD, caps.glXGetGPUInfoAMD, + caps.glXMakeAssociatedContextCurrentAMD + ); + } + + // --- [ glXBlitContextFramebufferAMD ] --- + + public static void glXBlitContextFramebufferAMD(@NativeType("GLXContext") long dstCtx, @NativeType("GLint") int srcX0, @NativeType("GLint") int srcY0, @NativeType("GLint") int srcX1, @NativeType("GLint") int srcY1, @NativeType("GLint") int dstX0, @NativeType("GLint") int dstY0, @NativeType("GLint") int dstX1, @NativeType("GLint") int dstY1, @NativeType("GLbitfield") int mask, @NativeType("GLenum") int filter) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXBlitContextFramebufferAMD; + if (CHECKS) { + check(__functionAddress); + check(dstCtx); + } + callPV(dstCtx, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter, __functionAddress); + } + + // --- [ glXCreateAssociatedContextAMD ] --- + + /** Creates an associated context. */ + @NativeType("GLXContext") + public static long glXCreateAssociatedContextAMD(@NativeType("unsigned int") int id, @NativeType("GLXContext") long share_list) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXCreateAssociatedContextAMD; + if (CHECKS) { + check(__functionAddress); + check(share_list); + } + return callPP(id, share_list, __functionAddress); + } + + // --- [ glXCreateAssociatedContextAttribsAMD ] --- + + /** Unsafe version of: {@link #glXCreateAssociatedContextAttribsAMD CreateAssociatedContextAttribsAMD} */ + public static long nglXCreateAssociatedContextAttribsAMD(int id, long share_context, long attribList) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXCreateAssociatedContextAttribsAMD; + if (CHECKS) { + check(__functionAddress); + check(share_context); + } + return callPPP(id, share_context, attribList, __functionAddress); + } + + /** Creates an associated context and requests a specific GL version. */ + @NativeType("GLXContext") + public static long glXCreateAssociatedContextAttribsAMD(@NativeType("unsigned int") int id, @NativeType("GLXContext") long share_context, @NativeType("int const *") IntBuffer attribList) { + if (CHECKS) { + checkNT(attribList); + } + return nglXCreateAssociatedContextAttribsAMD(id, share_context, memAddress(attribList)); + } + + // --- [ glXDeleteAssociatedContextAMD ] --- + + /** + * Deletes an associated context. + * + * @param ctx the GLXContext + */ + @NativeType("Bool") + public static boolean glXDeleteAssociatedContextAMD(@NativeType("GLXContext") long ctx) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXDeleteAssociatedContextAMD; + if (CHECKS) { + check(__functionAddress); + check(ctx); + } + return callPI(ctx, __functionAddress) != 0; + } + + // --- [ glXGetContextGPUIDAMD ] --- + + /** + * Determines which GPU a context is attached to. + * + * @param ctx the GLXContext + */ + @NativeType("unsigned int") + public static int glXGetContextGPUIDAMD(@NativeType("GLXContext") long ctx) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetContextGPUIDAMD; + if (CHECKS) { + check(__functionAddress); + check(ctx); + } + return callPI(ctx, __functionAddress); + } + + // --- [ glXGetCurrentAssociatedContextAMD ] --- + + /** Queries the crrent associated context. */ + @NativeType("GLXContext") + public static long glXGetCurrentAssociatedContextAMD() { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetCurrentAssociatedContextAMD; + if (CHECKS) { + check(__functionAddress); + } + return callP(__functionAddress); + } + + // --- [ glXGetGPUIDsAMD ] --- + + /** Queries the IDs for available GPUs. */ + @NativeType("unsigned int") + public static int glXGetGPUIDsAMD(@NativeType("unsigned int") int maxCount, @NativeType("unsigned int") int ids) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetGPUIDsAMD; + if (CHECKS) { + check(__functionAddress); + } + return callI(maxCount, ids, __functionAddress); + } + + // --- [ glXGetGPUInfoAMD ] --- + + /** Unsafe version of: {@link #glXGetGPUInfoAMD GetGPUInfoAMD} */ + public static int nglXGetGPUInfoAMD(int id, int property, int dataType, int size, long data) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetGPUInfoAMD; + if (CHECKS) { + check(__functionAddress); + } + return callPI(id, property, dataType, size, data, __functionAddress); + } + + /** + * Queries GPU properties. + * + * @param property one of:
{@link #GLX_GPU_VENDOR_AMD GPU_VENDOR_AMD}{@link #GLX_GPU_RENDERER_STRING_AMD GPU_RENDERER_STRING_AMD}{@link #GLX_GPU_OPENGL_VERSION_STRING_AMD GPU_OPENGL_VERSION_STRING_AMD}{@link #GLX_GPU_FASTEST_TARGET_GPUS_AMD GPU_FASTEST_TARGET_GPUS_AMD}
{@link #GLX_GPU_RAM_AMD GPU_RAM_AMD}{@link #GLX_GPU_CLOCK_AMD GPU_CLOCK_AMD}{@link #GLX_GPU_NUM_PIPES_AMD GPU_NUM_PIPES_AMD}{@link #GLX_GPU_NUM_SIMD_AMD GPU_NUM_SIMD_AMD}
{@link #GLX_GPU_NUM_RB_AMD GPU_NUM_RB_AMD}{@link #GLX_GPU_NUM_SPI_AMD GPU_NUM_SPI_AMD}
+ */ + public static int glXGetGPUInfoAMD(@NativeType("unsigned int") int id, int property, @NativeType("GLenum") int dataType, @NativeType("void *") ByteBuffer data) { + return nglXGetGPUInfoAMD(id, property, dataType, data.remaining(), memAddress(data)); + } + + // --- [ glXMakeAssociatedContextCurrentAMD ] --- + + /** + * Makes an associated context current in the current thread. + * + * @param ctx the GLXContext + */ + @NativeType("Bool") + public static boolean glXMakeAssociatedContextCurrentAMD(@NativeType("GLXContext") long ctx) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXMakeAssociatedContextCurrentAMD; + if (CHECKS) { + check(__functionAddress); + check(ctx); + } + return callPI(ctx, __functionAddress) != 0; + } + + /** Array version of: {@link #glXCreateAssociatedContextAttribsAMD CreateAssociatedContextAttribsAMD} */ + @NativeType("GLXContext") + public static long glXCreateAssociatedContextAttribsAMD(@NativeType("unsigned int") int id, @NativeType("GLXContext") long share_context, @NativeType("int const *") int[] attribList) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXCreateAssociatedContextAttribsAMD; + if (CHECKS) { + check(__functionAddress); + check(share_context); + checkNT(attribList); + } + return callPPP(id, share_context, attribList, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBContextFlushControl.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBContextFlushControl.java new file mode 100644 index 00000000..3f27e9b3 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBContextFlushControl.java @@ -0,0 +1,29 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_ARB_context_flush_control extension. + * + *

The GLX version of {@link KHRContextFlushControl}. This extension adds new context creation parameters the allow an application to specify the behavior + * that is desired when a context is made non-current, and specifically to opt out of the implicit flush behavior.

+ */ +public final class GLXARBContextFlushControl { + + /** Accepted as an attribute name in the {@code *attrib_list} argument to {@link GLXARBCreateContext#glXCreateContextAttribsARB CreateContextAttribsARB}. */ + public static final int GLX_CONTEXT_RELEASE_BEHAVIOR_ARB = 0x2097; + + /** + * Accepted as an attribute value for {@link #GLX_CONTEXT_RELEASE_BEHAVIOR_ARB CONTEXT_RELEASE_BEHAVIOR_ARB} in the {@code *attrib_list} argument to + * {@link GLXARBCreateContext#glXCreateContextAttribsARB CreateContextAttribsARB}. + */ + public static final int + GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB = 0x0, + GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB = 0x2098; + + private GLXARBContextFlushControl() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBCreateContext.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBCreateContext.java new file mode 100644 index 00000000..5bbdf8f6 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBCreateContext.java @@ -0,0 +1,113 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the GLX_ARB_create_context extension. + * + *

With the advent of new versions of OpenGL which deprecate features and/or break backward compatibility with older versions, there is a need and desire + * to indicate at context creation which interface will be used. These extensions add a new context creation routine with attributes specifying the GL + * version and context properties requested for the context, and additionally add an attribute specifying the GL profile requested for a context of OpenGL + * 3.2 or later. It also allows making an OpenGL 3.0 or later context current without providing a default framebuffer.

+ * + *

Requires {@link GLX14 GLX 1.4}.

+ */ +public class GLXARBCreateContext { + + /** Accepted as an attribute name in {@code attrib_list}. */ + public static final int + GLX_CONTEXT_MAJOR_VERSION_ARB = 0x2091, + GLX_CONTEXT_MINOR_VERSION_ARB = 0x2092, + GLX_CONTEXT_FLAGS_ARB = 0x2094; + + /** Accepted as bits in the attribute value for {@link #GLX_CONTEXT_FLAGS_ARB CONTEXT_FLAGS_ARB} in {@code attrib_list}. */ + public static final int + GLX_CONTEXT_DEBUG_BIT_ARB = 0x1, + GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB = 0x2; + + protected GLXARBCreateContext() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLXCapabilities caps) { + return checkFunctions( + caps.glXCreateContextAttribsARB + ); + } + + // --- [ glXCreateContextAttribsARB ] --- + + /** Unsafe version of: {@link #glXCreateContextAttribsARB CreateContextAttribsARB} */ + public static long nglXCreateContextAttribsARB(long display, long config, long share_context, int direct, long attrib_list) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXCreateContextAttribsARB; + if (CHECKS) { + check(__functionAddress); + check(display); + check(config); + } + return callPPPPP(display, config, share_context, direct, attrib_list, __functionAddress); + } + + /** + * Creates an OpenGL rendering context. + * + *

If {@code glXCreateContextAttribsARB} succeeds, it initializes the context to the initial state defined by the OpenGL specification, and returns a + * handle to it. This handle can be used to render to any GLX surface (window, pixmap, or pbuffer) compatible with {@code config}, subject to constraints + * imposed by the OpenGL API version of the context.

+ * + *

If {@code share_context} is not {@code NULL}, then all shareable data (excluding OpenGL texture objects named 0) will be shared by {@code share_context}, all + * other contexts {@code share_context} already shares with, and the newly created context. An arbitrary number of {@code GLXContexts} can share data in + * this fashion. The server context state for all sharing contexts must exist in a single address space.

+ * + * @param display the connection to the X server + * @param config the {@code GLXFBConfig} + * @param share_context if not {@code NULL}, then all shareable data (excluding OpenGL texture objects named 0) will be shared by {@code share_context}, all other contexts + * {@code share_context} already shares with, and the newly created context. An arbitrary number of GLXContexts can share data in this fashion. The + * server context state for all sharing contexts must exist in a single address space. + * @param direct direct rendering is requested if {@code direct} is {@code True}, and indirect rendering if {@code direct} is {@code False}. If + * {@code direct} is {@code True}, the implementation may nonetheless create an indirect rendering context if any of the following conditions hold: + * + *
    + *
  • The implementation does not support direct rendering.
  • + *
  • {@code display} is not a local X server.
  • + *
  • Implementation-dependent limits on the number of direct rendering contexts that can be supported simultaneously are exceeded.
  • + *
+ * + *

Use {@link GLX#glXIsDirect IsDirect} to determine whether or not a request for a direct rendering context succeeded.

+ * @param attrib_list an optional list of attributes for the context, terminated with {@code None} + */ + @NativeType("GLXContext") + public static long glXCreateContextAttribsARB(@NativeType("Display *") long display, @NativeType("GLXFBConfig") long config, @NativeType("GLXContext") long share_context, @NativeType("Bool") boolean direct, @Nullable @NativeType("int const *") IntBuffer attrib_list) { + if (CHECKS) { + checkNTSafe(attrib_list); + } + return nglXCreateContextAttribsARB(display, config, share_context, direct ? 1 : 0, memAddressSafe(attrib_list)); + } + + /** Array version of: {@link #glXCreateContextAttribsARB CreateContextAttribsARB} */ + @NativeType("GLXContext") + public static long glXCreateContextAttribsARB(@NativeType("Display *") long display, @NativeType("GLXFBConfig") long config, @NativeType("GLXContext") long share_context, @NativeType("Bool") boolean direct, @Nullable @NativeType("int const *") int[] attrib_list) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXCreateContextAttribsARB; + if (CHECKS) { + check(__functionAddress); + check(display); + check(config); + checkNTSafe(attrib_list); + } + return callPPPPP(display, config, share_context, direct ? 1 : 0, attrib_list, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBCreateContextNoError.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBCreateContextNoError.java new file mode 100644 index 00000000..8b7af629 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBCreateContextNoError.java @@ -0,0 +1,23 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_ARB_create_context_no_error extension. + * + *

This extension allows the creation of an OpenGL or OpenGL ES context that doesn't generate errors if the context supports a no error mode. The + * implications of this feature are discussed in the {@link KHRNoError KHR_no_error} extension.

+ * + *

Requires {@link WGLARBCreateContext WGL_ARB_create_context}.

+ */ +public final class GLXARBCreateContextNoError { + + /** Accepted as an attribute name in the {@code *attrib_list} argument to {@link GLXARBCreateContext#glXCreateContextAttribsARB CreateContextAttribsARB}. */ + public static final int GLX_CONTEXT_OPENGL_NO_ERROR_ARB = 0x31B3; + + private GLXARBCreateContextNoError() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBCreateContextProfile.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBCreateContextProfile.java new file mode 100644 index 00000000..c9917369 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBCreateContextProfile.java @@ -0,0 +1,30 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_ARB_create_context_profile extension. + * + *

Adds an attribute to {@link GLXARBCreateContext}, specifying the GL profile requested for a context of OpenGL 3.2 or later.

+ * + *

Requires {@link GLX14 GLX 1.4} and {@link GL32 OpenGL 3.2}.

+ */ +public final class GLXARBCreateContextProfile { + + /** Accepted as an attribute name in {@code attrib_list}. */ + public static final int GLX_CONTEXT_PROFILE_MASK_ARB = 0x9126; + + /** Accepted as bits in the attribute value for {@link #GLX_CONTEXT_PROFILE_MASK_ARB CONTEXT_PROFILE_MASK_ARB} in {@code attrib_list}. */ + public static final int + GLX_CONTEXT_CORE_PROFILE_BIT_ARB = 0x1, + GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB = 0x2; + + /** GLX error. */ + public static final int GLXBadProfileARB = 13; + + private GLXARBCreateContextProfile() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBCreateContextRobustness.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBCreateContextRobustness.java new file mode 100644 index 00000000..4d4a225e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBCreateContextRobustness.java @@ -0,0 +1,36 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_ARB_create_context_robustness extension. + * + *

This extension allows creating an OpenGL context supporting robust buffer access behavior and a specified graphics reset notification behavior.

+ * + *

Requires {@link GLX14 GLX 1.4}, {@link GLXARBCreateContext GLX_ARB_create_context} and {@link ARBRobustness ARB_robustness}.

+ */ +public final class GLXARBCreateContextRobustness { + + /** + * Accepted as a bit in the attribute value for {@link GLXARBCreateContext#GLX_CONTEXT_FLAGS_ARB CONTEXT_FLAGS_ARB} in the {@code attrib_list} argument to + * {@link GLXARBCreateContext#glXCreateContextAttribsARB CreateContextAttribsARB}. + */ + public static final int GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB = 0x4; + + /** Accepted as an attribute name in the {@code attrib_list} argument to {@link GLXARBCreateContext#glXCreateContextAttribsARB CreateContextAttribsARB}. */ + public static final int GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB = 0x8256; + + /** + * Accepted as an attribute value for {@link #GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB} in the {@code attrib_list} argument to + * {@link GLXARBCreateContext#glXCreateContextAttribsARB CreateContextAttribsARB}. + */ + public static final int + GLX_NO_RESET_NOTIFICATION_ARB = 0x8261, + GLX_LOSE_CONTEXT_ON_RESET_ARB = 0x8252; + + private GLXARBCreateContextRobustness() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBFBConfigFloat.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBFBConfigFloat.java new file mode 100644 index 00000000..059cfbbf --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBFBConfigFloat.java @@ -0,0 +1,26 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_ARB_fbconfig_float extension. + * + *

The standard OpenGL pipeline is based on a fixed-point pipeline. While color components are nominally floating-point values in the pipeline, components + * are frequently clamped to the range [0,1] to accomodate the fixed-point color buffer representation and allow for fixed-point computational hardware.

+ * + *

This extension adds pixel formats or visuals with floating-point RGBA color components and controls for clamping of color components within the pipeline.

+ */ +public final class GLXARBFBConfigFloat { + + /** Accepted as values of the {@code render_type} arguments in the {@link GLX13#glXCreateNewContext CreateNewContext} and {@link GLX#glXCreateContext CreateContext} functions. */ + public static final int GLX_RGBA_FLOAT_TYPE_ARB = 0x20B9; + + /** Accepted as a bit set in the GLX_RENDER_TYPE variable. */ + public static final int GLX_RGBA_FLOAT_BIT_ARB = 0x4; + + private GLXARBFBConfigFloat() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBFramebufferSRGB.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBFramebufferSRGB.java new file mode 100644 index 00000000..bf68b089 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBFramebufferSRGB.java @@ -0,0 +1,20 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_ARB_framebuffer_sRGB extension. + * + *

GLX functionality for {@link ARBFramebufferSRGB ARB_framebuffer_sRGB}.

+ */ +public final class GLXARBFramebufferSRGB { + + /** Accepted by the {@code attribList} parameter of {@link GLX#glXChooseVisual ChooseVisual}, and by the {@code attrib} parameter of {@link GLX#glXGetConfig GetConfig}. */ + public static final int GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB = 0x20B2; + + private GLXARBFramebufferSRGB() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBGetProcAddress.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBGetProcAddress.java new file mode 100644 index 00000000..1b6d2bc9 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBGetProcAddress.java @@ -0,0 +1,111 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the GLX_ARB_get_proc_address extension. + * + *

This extension adds a function to return the address of GLX and GL extension functions, given the function name. This is necessary with (for example) + * heterogenous implementations where hardware drivers may implement extension functions not known to the link library; a similar situation on Windows + * implementations resulted in the {@code wglGetProcAddress} function.

+ */ +public class GLXARBGetProcAddress { + + protected GLXARBGetProcAddress() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLXCapabilities caps) { + return checkFunctions( + caps.glXGetProcAddressARB + ); + } + + // --- [ glXGetProcAddressARB ] --- + + /** Unsafe version of: {@link #glXGetProcAddressARB GetProcAddressARB} */ + public static long nglXGetProcAddressARB(long procName) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetProcAddressARB; + if (CHECKS) { + check(__functionAddress); + } + return callPP(procName, __functionAddress); + } + + /** + * Returns the address of the extension function named by procName. The pointer returned should be cast to a function pointer type matching the extension + * function's definition in that extension specification. A return value of {@code NULL} indicates that the specified function does not exist for the + * implementation. + * + *

A non-{@code NULL} return value for {@code glXGetProcAddressARB} does not guarantee that an extension function is actually supported at runtime. The client + * must must also query {@link GL11C#glGetString GetString}({@link GL11#GL_EXTENSIONS}) or {@link GLX11#glXQueryExtensionsString QueryExtensionsString} to determine if an extension is supported by a particular + * context.

+ * + *

GL function pointers returned by {@code glXGetProcAddressARB} are independent of the currently bound context and may be used by any context which + * supports the extension.

+ * + *

{@code glXGetProcAddressARB} may be queried for all of the following functions:

+ * + *
    + *
  • All GL and GLX extension functions supported by the implementation (whether those extensions are supported by the current context or not).
  • + *
  • All core (non-extension) functions in GL and GLX from version 1.0 up to and including the versions of those specifications supported by the + * implementation, as determined by {@link GL11C#glGetString GetString}({@link GL11#GL_VERSION}) and {@link GLX#glXQueryVersion QueryVersion} queries.
  • + *
+ * + * @param procName the function name to query + */ + @NativeType("void *") + public static long glXGetProcAddressARB(@NativeType("GLchar const *") ByteBuffer procName) { + if (CHECKS) { + checkNT1(procName); + } + return nglXGetProcAddressARB(memAddress(procName)); + } + + /** + * Returns the address of the extension function named by procName. The pointer returned should be cast to a function pointer type matching the extension + * function's definition in that extension specification. A return value of {@code NULL} indicates that the specified function does not exist for the + * implementation. + * + *

A non-{@code NULL} return value for {@code glXGetProcAddressARB} does not guarantee that an extension function is actually supported at runtime. The client + * must must also query {@link GL11C#glGetString GetString}({@link GL11#GL_EXTENSIONS}) or {@link GLX11#glXQueryExtensionsString QueryExtensionsString} to determine if an extension is supported by a particular + * context.

+ * + *

GL function pointers returned by {@code glXGetProcAddressARB} are independent of the currently bound context and may be used by any context which + * supports the extension.

+ * + *

{@code glXGetProcAddressARB} may be queried for all of the following functions:

+ * + *
    + *
  • All GL and GLX extension functions supported by the implementation (whether those extensions are supported by the current context or not).
  • + *
  • All core (non-extension) functions in GL and GLX from version 1.0 up to and including the versions of those specifications supported by the + * implementation, as determined by {@link GL11C#glGetString GetString}({@link GL11#GL_VERSION}) and {@link GLX#glXQueryVersion QueryVersion} queries.
  • + *
+ * + * @param procName the function name to query + */ + @NativeType("void *") + public static long glXGetProcAddressARB(@NativeType("GLchar const *") CharSequence procName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(procName, true); + long procNameEncoded = stack.getPointerAddress(); + return nglXGetProcAddressARB(procNameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBMultisample.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBMultisample.java new file mode 100644 index 00000000..2b8b8688 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBMultisample.java @@ -0,0 +1,22 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_ARB_multisample extension. + * + *

See {@link ARBMultisample} for details.

+ */ +public final class GLXARBMultisample { + + /** Accepted by the {@code attribList} parameter of {@link GLX#glXChooseVisual ChooseVisual}, and by the {@code attrib} parameter of {@link GLX#glXGetConfig GetConfig}. */ + public static final int + GLX_SAMPLE_BUFFERS_ARB = 100000, + GLX_SAMPLES_ARB = 100001; + + private GLXARBMultisample() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBRobustnessApplicationIsolation.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBRobustnessApplicationIsolation.java new file mode 100644 index 00000000..c84833db --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBRobustnessApplicationIsolation.java @@ -0,0 +1,34 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_ARB_robustness_application_isolation extension. + * + *

GL_ARB_robustness and GLX_ARB_create_context_robustness allow creating an OpenGL context supporting graphics reset notification behavior. + * GLX_ARB_robustness_application_isolation provides stronger guarantees about the possible side-effects of a graphics reset.

+ * + *

If the graphics driver advertises the GLX_ARB_robustness_application_isolation extension string, then the driver guarantees that if a particular + * application causes a graphics reset to occur:

+ * + *
    + *
  1. No other application on the system is affected by the graphics reset.
  2. + *
  3. No other application on the system receives any notification that the graphics reset occurred.
  4. + *
+ * + *

Requires {@link GLX14 GLX 1.4} and {@link GLXARBCreateContextRobustness GLX_ARB_create_context_robustness}.

+ */ +public final class GLXARBRobustnessApplicationIsolation { + + /** + * Accepted as a bit in the attribute value for {@link GLXARBCreateContext#GLX_CONTEXT_FLAGS_ARB CONTEXT_FLAGS_ARB} in the {@code attrib_list} argument to + * {@link GLXARBCreateContext#glXCreateContextAttribsARB CreateContextAttribsARB}. + */ + public static final int GLX_CONTEXT_RESET_ISOLATION_BIT_ARB = 0x8; + + private GLXARBRobustnessApplicationIsolation() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBVertexBufferObject.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBVertexBufferObject.java new file mode 100644 index 00000000..ef07c8e7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXARBVertexBufferObject.java @@ -0,0 +1,27 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_ARB_vertex_buffer_object extension. + * + *

It is the client's responsibility to convert buffer data to and from the server's byte order. Since only the client knows the correct format of the + * data, and there may be multiple clients with different byte orderings sharing a single buffer object, it is unreasonable to ask the GL to handle buffer + * object byte-swapping. To avoid errors caused by naive clients attempting to use buffer objects without performing the appropriate byte swapping, clients + * must opt in to buffer object support at context creation time using the {@link #GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB} context attrib. If this attribute + * is not specified and the byte ordering of the client and server differ, the VBO extension must not be exposed and the maximum context version that can + * be reported is 1.4.

+ * + *

Requires {@link GLXARBCreateContext GLX_ARB_create_context} and {@link ARBVertexBufferObject ARB_vertex_buffer_object}.

+ */ +public final class GLXARBVertexBufferObject { + + /** Accepted as an attribute name in the {@code attrib_list} parameter of {@link GLXARBCreateContext#glXCreateContextAttribsARB CreateContextAttribsARB}. */ + public static final int GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB = 0x2095; + + private GLXARBVertexBufferObject() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXCapabilities.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXCapabilities.java new file mode 100644 index 00000000..e4a990da --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXCapabilities.java @@ -0,0 +1,330 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; +import java.util.Set; + +import static org.lwjgl.system.APIUtil.*; + +/** Defines the GLX capabilities of a connection. */ +public final class GLXCapabilities { + + public final long + glXQueryExtensionsString, + glXGetClientString, + glXQueryServerString, + glXGetCurrentDisplay, + glXGetFBConfigs, + glXChooseFBConfig, + glXGetFBConfigAttrib, + glXGetVisualFromFBConfig, + glXCreateWindow, + glXCreatePixmap, + glXDestroyPixmap, + glXCreatePbuffer, + glXDestroyPbuffer, + glXQueryDrawable, + glXCreateNewContext, + glXMakeContextCurrent, + glXGetCurrentReadDrawable, + glXQueryContext, + glXSelectEvent, + glXGetSelectedEvent, + glXGetProcAddress, + glXBlitContextFramebufferAMD, + glXCreateAssociatedContextAMD, + glXCreateAssociatedContextAttribsAMD, + glXDeleteAssociatedContextAMD, + glXGetContextGPUIDAMD, + glXGetCurrentAssociatedContextAMD, + glXGetGPUIDsAMD, + glXGetGPUInfoAMD, + glXMakeAssociatedContextCurrentAMD, + glXCreateContextAttribsARB, + glXGetProcAddressARB, + glXGetCurrentDisplayEXT, + glXQueryContextInfoEXT, + glXGetContextIDEXT, + glXImportContextEXT, + glXFreeContextEXT, + glXSwapIntervalEXT, + glXBindTexImageEXT, + glXReleaseTexImageEXT, + glXCopyBufferSubDataNV, + glXNamedCopyBufferSubDataNV, + glXCopyImageSubDataNV, + glXDelayBeforeSwapNV, + glXJoinSwapGroupNV, + glXBindSwapBarrierNV, + glXQuerySwapGroupNV, + glXQueryMaxSwapGroupsNV, + glXQueryFrameCountNV, + glXResetFrameCountNV, + glXMakeCurrentReadSGI, + glXGetCurrentReadDrawableSGI, + glXSwapIntervalSGI, + glXGetVideoSyncSGI, + glXWaitVideoSyncSGI, + glXGetFBConfigAttribSGIX, + glXChooseFBConfigSGIX, + glXCreateGLXPixmapWithConfigSGIX, + glXCreateContextWithConfigSGIX, + glXGetVisualFromFBConfigSGIX, + glXGetFBConfigFromVisualSGIX, + glXCreateGLXPbufferSGIX, + glXDestroyGLXPbufferSGIX, + glXQueryGLXPbufferSGIX, + glXSelectEventSGIX, + glXGetSelectedEventSGIX, + glXBindSwapBarrierSGIX, + glXQueryMaxSwapBarriersSGIX, + glXJoinSwapGroupSGIX; + + /** When true, {@link GLX11} is supported. */ + public final boolean GLX11; + /** When true, {@link GLX12} is supported. */ + public final boolean GLX12; + /** When true, {@link GLX13} is supported. */ + public final boolean GLX13; + /** When true, {@link GLX14} is supported. */ + public final boolean GLX14; + /** When true, {@link GLXAMDGPUAssociation} is supported. */ + public final boolean GLX_AMD_gpu_association; + /** When true, {@link GLXARBContextFlushControl} is supported. */ + public final boolean GLX_ARB_context_flush_control; + /** When true, {@link GLXARBCreateContext} is supported. */ + public final boolean GLX_ARB_create_context; + /** When true, {@link GLXARBCreateContextNoError} is supported. */ + public final boolean GLX_ARB_create_context_no_error; + /** When true, {@link GLXARBCreateContextProfile} is supported. */ + public final boolean GLX_ARB_create_context_profile; + /** When true, {@link GLXARBCreateContextRobustness} is supported. */ + public final boolean GLX_ARB_create_context_robustness; + /** When true, {@link GLXARBFBConfigFloat} is supported. */ + public final boolean GLX_ARB_fbconfig_float; + /** When true, {@link GLXARBFramebufferSRGB} is supported. */ + public final boolean GLX_ARB_framebuffer_sRGB; + /** When true, {@link GLXARBGetProcAddress} is supported. */ + public final boolean GLX_ARB_get_proc_address; + /** When true, {@link GLXARBMultisample} is supported. */ + public final boolean GLX_ARB_multisample; + /** When true, {@link GLXARBRobustnessApplicationIsolation} is supported. */ + public final boolean GLX_ARB_robustness_application_isolation; + /** + * When true, the GLX_ARB_robustness_share_group_isolation extension is supported. + * + *

GL_ARB_robustness and GLX_ARB_create_context_robustness allow creating an OpenGL context supporting graphics reset notification behavior. + * GLX_ARB_robustness_share_group_isolation provides stronger guarantees about the possible side-effects of a graphics reset.

+ * + *

If the graphics driver advertises the GLX_ARB_robustness_share_group_isolation extension string, then the driver guarantees that if a context in a + * particular share group causes a graphics reset to occur:

+ * + *
    + *
  1. No other share group within the application, nor any other application on the system, is affected by the graphics reset.
  2. + *
  3. No other share group within the application, nor any other application on the system, receives any notification that the graphics reset occurred.
  4. + *
+ * + *

Requires {@link GLX14 GLX 1.4} and {@link GLXARBCreateContextRobustness GLX_ARB_create_context_robustness}.

+ */ + public final boolean GLX_ARB_robustness_share_group_isolation; + /** When true, {@link GLXARBVertexBufferObject} is supported. */ + public final boolean GLX_ARB_vertex_buffer_object; + /** When true, {@link GLXEXTBufferAge} is supported. */ + public final boolean GLX_EXT_buffer_age; + /** When true, {@link GLXEXTContextPriority} is supported. */ + public final boolean GLX_EXT_context_priority; + /** When true, {@link GLXEXTCreateContextES2Profile} is supported. */ + public final boolean GLX_EXT_create_context_es2_profile; + /** When true, {@link GLXEXTCreateContextESProfile} is supported. */ + public final boolean GLX_EXT_create_context_es_profile; + /** When true, {@link GLXEXTFBConfigPackedFloat} is supported. */ + public final boolean GLX_EXT_fbconfig_packed_float; + /** When true, {@link GLXEXTFramebufferSRGB} is supported. */ + public final boolean GLX_EXT_framebuffer_sRGB; + /** When true, {@link GLXEXTImportContext} is supported. */ + public final boolean GLX_EXT_import_context; + /** + * When true, the GLX_EXT_no_config_context extension is supported. + * + *

Modern GPUs allow contexts to render to almost any combination of supported color and auxiliary buffer formats. Traditionally GLX context creation is + * done with respect to a GLXFBConfig specifying buffer formats, and constrains contexts to only work with drawables created with a "compatible" config.

+ * + *

This extension allows creation of GL & ES contexts without specifying a {@code GLXFBConfig}.

+ */ + public final boolean GLX_EXT_no_config_context; + /** When true, {@link GLXEXTStereoTree} is supported. */ + public final boolean GLX_EXT_stereo_tree; + /** When true, {@link GLXEXTSwapControl} is supported. */ + public final boolean GLX_EXT_swap_control; + /** When true, {@link GLXEXTSwapControlTear} is supported. */ + public final boolean GLX_EXT_swap_control_tear; + /** When true, {@link GLXEXTTextureFromPixmap} is supported. */ + public final boolean GLX_EXT_texture_from_pixmap; + /** When true, {@link GLXEXTVisualInfo} is supported. */ + public final boolean GLX_EXT_visual_info; + /** When true, {@link GLXEXTVisualRating} is supported. */ + public final boolean GLX_EXT_visual_rating; + /** When true, {@link GLXINTELSwapEvent} is supported. */ + public final boolean GLX_INTEL_swap_event; + /** When true, {@link GLXNVCopyBuffer} is supported. */ + public final boolean GLX_NV_copy_buffer; + /** When true, {@link GLXNVCopyImage} is supported. */ + public final boolean GLX_NV_copy_image; + /** When true, {@link GLXNVDelayBeforeSwap} is supported. */ + public final boolean GLX_NV_delay_before_swap; + /** When true, {@link GLXNVFloatBuffer} is supported. */ + public final boolean GLX_NV_float_buffer; + /** When true, {@link GLXNVMultisampleCoverage} is supported. */ + public final boolean GLX_NV_multisample_coverage; + /** When true, {@link GLXNVRobustnessVideoMemoryPurge} is supported. */ + public final boolean GLX_NV_robustness_video_memory_purge; + /** When true, {@link GLXNVSwapGroup} is supported. */ + public final boolean GLX_NV_swap_group; + /** When true, {@link GLXSGIMakeCurrentRead} is supported. */ + public final boolean GLX_SGI_make_current_read; + /** When true, {@link GLXSGISwapControl} is supported. */ + public final boolean GLX_SGI_swap_control; + /** When true, {@link GLXSGIVideoSync} is supported. */ + public final boolean GLX_SGI_video_sync; + /** When true, {@link GLXSGIXFBConfig} is supported. */ + public final boolean GLX_SGIX_fbconfig; + /** When true, {@link GLXSGIXPbuffer} is supported. */ + public final boolean GLX_SGIX_pbuffer; + /** When true, {@link GLXSGIXSwapBarrier} is supported. */ + public final boolean GLX_SGIX_swap_barrier; + /** When true, {@link GLXSGIXSwapGroup} is supported. */ + public final boolean GLX_SGIX_swap_group; + + GLXCapabilities(FunctionProvider provider, Set ext) { + glXQueryExtensionsString = provider.getFunctionAddress("glXQueryExtensionsString"); + glXGetClientString = provider.getFunctionAddress("glXGetClientString"); + glXQueryServerString = provider.getFunctionAddress("glXQueryServerString"); + glXGetCurrentDisplay = provider.getFunctionAddress("glXGetCurrentDisplay"); + glXGetFBConfigs = provider.getFunctionAddress("glXGetFBConfigs"); + glXChooseFBConfig = provider.getFunctionAddress("glXChooseFBConfig"); + glXGetFBConfigAttrib = provider.getFunctionAddress("glXGetFBConfigAttrib"); + glXGetVisualFromFBConfig = provider.getFunctionAddress("glXGetVisualFromFBConfig"); + glXCreateWindow = provider.getFunctionAddress("glXCreateWindow"); + glXCreatePixmap = provider.getFunctionAddress("glXCreatePixmap"); + glXDestroyPixmap = provider.getFunctionAddress("glXDestroyPixmap"); + glXCreatePbuffer = provider.getFunctionAddress("glXCreatePbuffer"); + glXDestroyPbuffer = provider.getFunctionAddress("glXDestroyPbuffer"); + glXQueryDrawable = provider.getFunctionAddress("glXQueryDrawable"); + glXCreateNewContext = provider.getFunctionAddress("glXCreateNewContext"); + glXMakeContextCurrent = provider.getFunctionAddress("glXMakeContextCurrent"); + glXGetCurrentReadDrawable = provider.getFunctionAddress("glXGetCurrentReadDrawable"); + glXQueryContext = provider.getFunctionAddress("glXQueryContext"); + glXSelectEvent = provider.getFunctionAddress("glXSelectEvent"); + glXGetSelectedEvent = provider.getFunctionAddress("glXGetSelectedEvent"); + glXGetProcAddress = provider.getFunctionAddress("glXGetProcAddress"); + glXBlitContextFramebufferAMD = provider.getFunctionAddress("glXBlitContextFramebufferAMD"); + glXCreateAssociatedContextAMD = provider.getFunctionAddress("glXCreateAssociatedContextAMD"); + glXCreateAssociatedContextAttribsAMD = provider.getFunctionAddress("glXCreateAssociatedContextAttribsAMD"); + glXDeleteAssociatedContextAMD = provider.getFunctionAddress("glXDeleteAssociatedContextAMD"); + glXGetContextGPUIDAMD = provider.getFunctionAddress("glXGetContextGPUIDAMD"); + glXGetCurrentAssociatedContextAMD = provider.getFunctionAddress("glXGetCurrentAssociatedContextAMD"); + glXGetGPUIDsAMD = provider.getFunctionAddress("glXGetGPUIDsAMD"); + glXGetGPUInfoAMD = provider.getFunctionAddress("glXGetGPUInfoAMD"); + glXMakeAssociatedContextCurrentAMD = provider.getFunctionAddress("glXMakeAssociatedContextCurrentAMD"); + glXCreateContextAttribsARB = provider.getFunctionAddress("glXCreateContextAttribsARB"); + glXGetProcAddressARB = provider.getFunctionAddress("glXGetProcAddressARB"); + glXGetCurrentDisplayEXT = provider.getFunctionAddress("glXGetCurrentDisplayEXT"); + glXQueryContextInfoEXT = provider.getFunctionAddress("glXQueryContextInfoEXT"); + glXGetContextIDEXT = provider.getFunctionAddress("glXGetContextIDEXT"); + glXImportContextEXT = provider.getFunctionAddress("glXImportContextEXT"); + glXFreeContextEXT = provider.getFunctionAddress("glXFreeContextEXT"); + glXSwapIntervalEXT = provider.getFunctionAddress("glXSwapIntervalEXT"); + glXBindTexImageEXT = provider.getFunctionAddress("glXBindTexImageEXT"); + glXReleaseTexImageEXT = provider.getFunctionAddress("glXReleaseTexImageEXT"); + glXCopyBufferSubDataNV = provider.getFunctionAddress("glXCopyBufferSubDataNV"); + glXNamedCopyBufferSubDataNV = provider.getFunctionAddress("glXNamedCopyBufferSubDataNV"); + glXCopyImageSubDataNV = provider.getFunctionAddress("glXCopyImageSubDataNV"); + glXDelayBeforeSwapNV = provider.getFunctionAddress("glXDelayBeforeSwapNV"); + glXJoinSwapGroupNV = provider.getFunctionAddress("glXJoinSwapGroupNV"); + glXBindSwapBarrierNV = provider.getFunctionAddress("glXBindSwapBarrierNV"); + glXQuerySwapGroupNV = provider.getFunctionAddress("glXQuerySwapGroupNV"); + glXQueryMaxSwapGroupsNV = provider.getFunctionAddress("glXQueryMaxSwapGroupsNV"); + glXQueryFrameCountNV = provider.getFunctionAddress("glXQueryFrameCountNV"); + glXResetFrameCountNV = provider.getFunctionAddress("glXResetFrameCountNV"); + glXMakeCurrentReadSGI = provider.getFunctionAddress("glXMakeCurrentReadSGI"); + glXGetCurrentReadDrawableSGI = provider.getFunctionAddress("glXGetCurrentReadDrawableSGI"); + glXSwapIntervalSGI = provider.getFunctionAddress("glXSwapIntervalSGI"); + glXGetVideoSyncSGI = provider.getFunctionAddress("glXGetVideoSyncSGI"); + glXWaitVideoSyncSGI = provider.getFunctionAddress("glXWaitVideoSyncSGI"); + glXGetFBConfigAttribSGIX = provider.getFunctionAddress("glXGetFBConfigAttribSGIX"); + glXChooseFBConfigSGIX = provider.getFunctionAddress("glXChooseFBConfigSGIX"); + glXCreateGLXPixmapWithConfigSGIX = provider.getFunctionAddress("glXCreateGLXPixmapWithConfigSGIX"); + glXCreateContextWithConfigSGIX = provider.getFunctionAddress("glXCreateContextWithConfigSGIX"); + glXGetVisualFromFBConfigSGIX = provider.getFunctionAddress("glXGetVisualFromFBConfigSGIX"); + glXGetFBConfigFromVisualSGIX = provider.getFunctionAddress("glXGetFBConfigFromVisualSGIX"); + glXCreateGLXPbufferSGIX = provider.getFunctionAddress("glXCreateGLXPbufferSGIX"); + glXDestroyGLXPbufferSGIX = provider.getFunctionAddress("glXDestroyGLXPbufferSGIX"); + glXQueryGLXPbufferSGIX = provider.getFunctionAddress("glXQueryGLXPbufferSGIX"); + glXSelectEventSGIX = provider.getFunctionAddress("glXSelectEventSGIX"); + glXGetSelectedEventSGIX = provider.getFunctionAddress("glXGetSelectedEventSGIX"); + glXBindSwapBarrierSGIX = provider.getFunctionAddress("glXBindSwapBarrierSGIX"); + glXQueryMaxSwapBarriersSGIX = provider.getFunctionAddress("glXQueryMaxSwapBarriersSGIX"); + glXJoinSwapGroupSGIX = provider.getFunctionAddress("glXJoinSwapGroupSGIX"); + + GLX11 = ext.contains("GLX11") && checkExtension("GLX11", org.lwjgl.opengl.GLX11.isAvailable(this)); + GLX12 = ext.contains("GLX12") && checkExtension("GLX12", org.lwjgl.opengl.GLX12.isAvailable(this)); + GLX13 = ext.contains("GLX13") && checkExtension("GLX13", org.lwjgl.opengl.GLX13.isAvailable(this)); + GLX14 = ext.contains("GLX14") && checkExtension("GLX14", org.lwjgl.opengl.GLX14.isAvailable(this)); + GLX_AMD_gpu_association = ext.contains("GLX_AMD_gpu_association") && checkExtension("GLX_AMD_gpu_association", GLXAMDGPUAssociation.isAvailable(this)); + GLX_ARB_context_flush_control = ext.contains("GLX_ARB_context_flush_control"); + GLX_ARB_create_context = ext.contains("GLX_ARB_create_context") && checkExtension("GLX_ARB_create_context", GLXARBCreateContext.isAvailable(this)); + GLX_ARB_create_context_no_error = ext.contains("GLX_ARB_create_context_no_error"); + GLX_ARB_create_context_profile = ext.contains("GLX_ARB_create_context_profile"); + GLX_ARB_create_context_robustness = ext.contains("GLX_ARB_create_context_robustness"); + GLX_ARB_fbconfig_float = ext.contains("GLX_ARB_fbconfig_float"); + GLX_ARB_framebuffer_sRGB = ext.contains("GLX_ARB_framebuffer_sRGB"); + GLX_ARB_get_proc_address = ext.contains("GLX_ARB_get_proc_address") && checkExtension("GLX_ARB_get_proc_address", GLXARBGetProcAddress.isAvailable(this)); + GLX_ARB_multisample = ext.contains("GLX_ARB_multisample"); + GLX_ARB_robustness_application_isolation = ext.contains("GLX_ARB_robustness_application_isolation"); + GLX_ARB_robustness_share_group_isolation = ext.contains("GLX_ARB_robustness_share_group_isolation"); + GLX_ARB_vertex_buffer_object = ext.contains("GLX_ARB_vertex_buffer_object"); + GLX_EXT_buffer_age = ext.contains("GLX_EXT_buffer_age"); + GLX_EXT_context_priority = ext.contains("GLX_EXT_context_priority"); + GLX_EXT_create_context_es2_profile = ext.contains("GLX_EXT_create_context_es2_profile"); + GLX_EXT_create_context_es_profile = ext.contains("GLX_EXT_create_context_es_profile"); + GLX_EXT_fbconfig_packed_float = ext.contains("GLX_EXT_fbconfig_packed_float"); + GLX_EXT_framebuffer_sRGB = ext.contains("GLX_EXT_framebuffer_sRGB"); + GLX_EXT_import_context = ext.contains("GLX_EXT_import_context") && checkExtension("GLX_EXT_import_context", GLXEXTImportContext.isAvailable(this)); + GLX_EXT_no_config_context = ext.contains("GLX_EXT_no_config_context"); + GLX_EXT_stereo_tree = ext.contains("GLX_EXT_stereo_tree"); + GLX_EXT_swap_control = ext.contains("GLX_EXT_swap_control") && checkExtension("GLX_EXT_swap_control", GLXEXTSwapControl.isAvailable(this)); + GLX_EXT_swap_control_tear = ext.contains("GLX_EXT_swap_control_tear"); + GLX_EXT_texture_from_pixmap = ext.contains("GLX_EXT_texture_from_pixmap") && checkExtension("GLX_EXT_texture_from_pixmap", GLXEXTTextureFromPixmap.isAvailable(this)); + GLX_EXT_visual_info = ext.contains("GLX_EXT_visual_info"); + GLX_EXT_visual_rating = ext.contains("GLX_EXT_visual_rating"); + GLX_INTEL_swap_event = ext.contains("GLX_INTEL_swap_event"); + GLX_NV_copy_buffer = ext.contains("GLX_NV_copy_buffer") && checkExtension("GLX_NV_copy_buffer", GLXNVCopyBuffer.isAvailable(this)); + GLX_NV_copy_image = ext.contains("GLX_NV_copy_image") && checkExtension("GLX_NV_copy_image", GLXNVCopyImage.isAvailable(this)); + GLX_NV_delay_before_swap = ext.contains("GLX_NV_delay_before_swap") && checkExtension("GLX_NV_delay_before_swap", GLXNVDelayBeforeSwap.isAvailable(this)); + GLX_NV_float_buffer = ext.contains("GLX_NV_float_buffer"); + GLX_NV_multisample_coverage = ext.contains("GLX_NV_multisample_coverage"); + GLX_NV_robustness_video_memory_purge = ext.contains("GLX_NV_robustness_video_memory_purge"); + GLX_NV_swap_group = ext.contains("GLX_NV_swap_group") && checkExtension("GLX_NV_swap_group", GLXNVSwapGroup.isAvailable(this)); + GLX_SGI_make_current_read = ext.contains("GLX_SGI_make_current_read") && checkExtension("GLX_SGI_make_current_read", GLXSGIMakeCurrentRead.isAvailable(this)); + GLX_SGI_swap_control = ext.contains("GLX_SGI_swap_control") && checkExtension("GLX_SGI_swap_control", GLXSGISwapControl.isAvailable(this)); + GLX_SGI_video_sync = ext.contains("GLX_SGI_video_sync") && checkExtension("GLX_SGI_video_sync", GLXSGIVideoSync.isAvailable(this)); + GLX_SGIX_fbconfig = ext.contains("GLX_SGIX_fbconfig") && checkExtension("GLX_SGIX_fbconfig", GLXSGIXFBConfig.isAvailable(this)); + GLX_SGIX_pbuffer = ext.contains("GLX_SGIX_pbuffer") && checkExtension("GLX_SGIX_pbuffer", GLXSGIXPbuffer.isAvailable(this)); + GLX_SGIX_swap_barrier = ext.contains("GLX_SGIX_swap_barrier") && checkExtension("GLX_SGIX_swap_barrier", GLXSGIXSwapBarrier.isAvailable(this)); + GLX_SGIX_swap_group = ext.contains("GLX_SGIX_swap_group") && checkExtension("GLX_SGIX_swap_group", GLXSGIXSwapGroup.isAvailable(this)); + } + + private static boolean checkExtension(String extension, boolean supported) { + if (supported) { + return true; + } + + apiLog("[GLX] " + extension + " was reported as available but an entry point is missing."); + return false; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTBufferAge.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTBufferAge.java new file mode 100644 index 00000000..ef0dfc40 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTBufferAge.java @@ -0,0 +1,23 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_EXT_buffer_age extension. + * + *

The aim of this extension is to expose enough information to applications about how the driver manages the set of front and back buffers associated with + * a given surface to allow applications to re-use the contents of old frames and minimize how much must be redrawn for the next frame.

+ * + *

Requires {@link GLX14 GLX 1.4}.

+ */ +public final class GLXEXTBufferAge { + + /** Accepted by {@link GLX13#glXQueryDrawable QueryDrawable}. */ + public static final int GLX_BACK_BUFFER_AGE_EXT = 0x20F4; + + private GLXEXTBufferAge() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTContextPriority.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTContextPriority.java new file mode 100644 index 00000000..a029c93f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTContextPriority.java @@ -0,0 +1,30 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_EXT_context_priority extension. + * + *

This extension allows a {@code GLXContext} to be created with a priority hint. It is possible that an implementation will not honour the hint, + * especially if there are constraints on the number of high priority contexts available in the system, or system policy limits access to high priority + * contexts to appropriate system privilege level. A query is provided to find the real priority level assigned to the context after creation.

+ * + *

Requires {@link GLXARBCreateContext GLX_ARB_create_context}.

+ */ +public final class GLXEXTContextPriority { + + /** New attributes accepted by the {@code attrib_list} argument of {@link GLXARBCreateContext#glXCreateContextAttribsARB CreateContextAttribsARB}. */ + public static final int GLX_CONTEXT_PRIORITY_LEVEL_EXT = 0x3100; + + /** New attribute values accepted in the {@code attrib_list} argument of {@link GLXARBCreateContext#glXCreateContextAttribsARB CreateContextAttribsARB}. */ + public static final int + GLX_CONTEXT_PRIORITY_HIGH_EXT = 0x3101, + GLX_CONTEXT_PRIORITY_MEDIUM_EXT = 0x3102, + GLX_CONTEXT_PRIORITY_LOW_EXT = 0x3103; + + private GLXEXTContextPriority() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTCreateContextES2Profile.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTCreateContextES2Profile.java new file mode 100644 index 00000000..c345ea0a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTCreateContextES2Profile.java @@ -0,0 +1,22 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_EXT_create_context_es2_profile extension. + * + *

This extension allows creating an OpenGL ES context.

+ * + *

Requires {@link GLX14 GLX 1.4}, {@link GLXARBCreateContext GLX_ARB_create_context}, {@link GLXARBCreateContextProfile GLX_ARB_create_context_profile} and an OpenGL ES implemenation.

+ */ +public final class GLXEXTCreateContextES2Profile { + + /** Accepted as a bit in the attribute value for {@link GLXARBCreateContextProfile#GLX_CONTEXT_PROFILE_MASK_ARB CONTEXT_PROFILE_MASK_ARB} in {@code attrib_list}. */ + public static final int GLX_CONTEXT_ES2_PROFILE_BIT_EXT = 0x4; + + private GLXEXTCreateContextES2Profile() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTCreateContextESProfile.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTCreateContextESProfile.java new file mode 100644 index 00000000..f277c671 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTCreateContextESProfile.java @@ -0,0 +1,22 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_EXT_create_context_es_profile extension. + * + *

This extension allows creating an OpenGL ES context.

+ * + *

Requires {@link GLX14 GLX 1.4}, {@link GLXARBCreateContext GLX_ARB_create_context}, {@link GLXARBCreateContextProfile GLX_ARB_create_context_profile} and an OpenGL ES implemenation.

+ */ +public final class GLXEXTCreateContextESProfile { + + /** Accepted as a bit in the attribute value for {@link GLXARBCreateContextProfile#GLX_CONTEXT_PROFILE_MASK_ARB CONTEXT_PROFILE_MASK_ARB} in {@code attrib_list}. */ + public static final int GLX_CONTEXT_ES_PROFILE_BIT_EXT = 0x4; + + private GLXEXTCreateContextESProfile() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTFBConfigPackedFloat.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTFBConfigPackedFloat.java new file mode 100644 index 00000000..cf7df34a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTFBConfigPackedFloat.java @@ -0,0 +1,37 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_EXT_fbconfig_packed_float extension. + * + *

This extension adds a new 3-component floating-point texture format that fits within a single 32-bit word. This format stores 5 bits of biased exponent + * per component in the same manner as 16-bit floating-point formats, but rather than 10 mantissa bits, the red, green, and blue components have 6, 6, and + * 5 bits respectively. Each mantissa is assumed to have an implied leading one except in the denorm exponent case. There is no sign bit so only + * non-negative values can be represented. Positive infinity, positive denorms, and positive NaN values are representable. The value of the fourth + * component returned by a texture fetch is always 1.0.

+ * + *

This extension also provides support for rendering into an unsigned floating-point rendering format with the assumption that the texture format + * described above could also be advertised as an unsigned floating-point format for rendering.

+ * + *

The extension also provides a pixel external format for specifying packed float values directly.

+ * + *

Requires {@link GLX13 GLX 1.3}.

+ */ +public final class GLXEXTFBConfigPackedFloat { + + /** Accepted as values of the {@code render_type} arguments in the {@link GLX13#glXCreateNewContext CreateNewContext} and {@link GLX#glXCreateContext CreateContext} functions. */ + public static final int GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT = 0x20B1; + + /** + * Returned by {@link GLX13#glXGetFBConfigAttrib GetFBConfigAttrib} (when {@code attribute} is set to GLX_RENDER_TYPE) and accepted by the {@code attrib_list} parameter of + * {@link GLX13#glXChooseFBConfig ChooseFBConfig} (following the GLX_RENDER_TYPE token). + */ + public static final int GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT = 0x8; + + private GLXEXTFBConfigPackedFloat() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTFramebufferSRGB.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTFramebufferSRGB.java new file mode 100644 index 00000000..3dc6f71c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTFramebufferSRGB.java @@ -0,0 +1,20 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_EXT_framebuffer_sRGB extension. + * + *

GLX functionality for {@link EXTFramebufferSRGB EXT_framebuffer_sRGB}.

+ */ +public final class GLXEXTFramebufferSRGB { + + /** Accepted by the {@code attribList} parameter of glXChooseVisual, and by the {@code attrib} parameter of glXGetConfig. */ + public static final int GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT = 0x20B2; + + private GLXEXTFramebufferSRGB() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTImportContext.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTImportContext.java new file mode 100644 index 00000000..2def5b97 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTImportContext.java @@ -0,0 +1,146 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the GLX_EXT_import_context extension. + * + *

This extension allows multiple X clients to share an indirect rendering context.

+ * + *

Additional convenience procedures to get the current Display* bound to a context as well as other context information are also added.

+ */ +public class GLXEXTImportContext { + + /** Accepted by the {@code attribute} parameter of {@link #glXQueryContextInfoEXT QueryContextInfoEXT}. */ + public static final int + GLX_SHARE_CONTEXT_EXT = 0x800A, + GLX_VISUAL_ID_EXT = 0x800B, + GLX_SCREEN_EXT = 0x800C; + + protected GLXEXTImportContext() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLXCapabilities caps) { + return checkFunctions( + caps.glXGetCurrentDisplayEXT, caps.glXQueryContextInfoEXT, caps.glXGetContextIDEXT, caps.glXImportContextEXT, caps.glXFreeContextEXT + ); + } + + // --- [ glXGetCurrentDisplayEXT ] --- + + /** Returns the display associated with the current context. */ + @NativeType("Display *") + public static long glXGetCurrentDisplayEXT() { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetCurrentDisplayEXT; + if (CHECKS) { + check(__functionAddress); + } + return callP(__functionAddress); + } + + // --- [ glXQueryContextInfoEXT ] --- + + /** Unsafe version of: {@link #glXQueryContextInfoEXT QueryContextInfoEXT} */ + public static int nglXQueryContextInfoEXT(long display, long context, int attribute, long value) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXQueryContextInfoEXT; + if (CHECKS) { + check(__functionAddress); + check(display); + check(context); + } + return callPPPI(display, context, attribute, value, __functionAddress); + } + + /** + * Obtains the value of a context's attribute. + * + * @param display the connection to the X server + * @param context the context being queried + * @param attribute the attribute to query + * @param value returns the attribute value + */ + public static int glXQueryContextInfoEXT(@NativeType("Display *") long display, @NativeType("GLXContext") long context, int attribute, @NativeType("int *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + return nglXQueryContextInfoEXT(display, context, attribute, memAddress(value)); + } + + // --- [ glXGetContextIDEXT ] --- + + /** + * Returns the XID of a GLXContext. + * + * @param context the context + */ + @NativeType("GLXContextID") + public static long glXGetContextIDEXT(@NativeType("GLXContext const") long context) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetContextIDEXT; + if (CHECKS) { + check(__functionAddress); + check(context); + } + return callPN(context, __functionAddress); + } + + // --- [ glXImportContextEXT ] --- + + /** + * May be used in place of glXCreateContext to share another process's indirect rendering context. + * + * @param display the connection to the X server + * @param contextID the context XID + */ + @NativeType("GLXContext") + public static long glXImportContextEXT(@NativeType("Display *") long display, @NativeType("GLXContextID") long contextID) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXImportContextEXT; + if (CHECKS) { + check(__functionAddress); + check(display); + } + return callPNP(display, contextID, __functionAddress); + } + + // --- [ glXFreeContextEXT ] --- + + /** + * Frees the client-side part of a GLXContext that was created with {@link #glXImportContextEXT ImportContextEXT}. + * + * @param display the connection to the X server + * @param context the context to free + */ + public static void glXFreeContextEXT(@NativeType("Display *") long display, @NativeType("GLXContext") long context) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXFreeContextEXT; + if (CHECKS) { + check(__functionAddress); + check(display); + check(context); + } + callPPV(display, context, __functionAddress); + } + + /** Array version of: {@link #glXQueryContextInfoEXT QueryContextInfoEXT} */ + public static int glXQueryContextInfoEXT(@NativeType("Display *") long display, @NativeType("GLXContext") long context, int attribute, @NativeType("int *") int[] value) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXQueryContextInfoEXT; + if (CHECKS) { + check(__functionAddress); + check(display); + check(context); + check(value, 1); + } + return callPPPI(display, context, attribute, value, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTStereoTree.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTStereoTree.java new file mode 100644 index 00000000..8de6de3e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTStereoTree.java @@ -0,0 +1,37 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_EXT_stereo_tree extension. + * + *

When using stereoscopic rendering with the X composite extension, a stereo-aware GLX composite manager can be used to composite both the left and right + * buffers of a window's backing pixmap to the left and right buffers of the root or composite overlay window to preserve the stereo effect of a + * redirected window or any of its child windows. However, to do this, the composite manager needs a method to determine which windows have both left and + * right buffers available without needing to walk entire window trees or be aware of other clients' GLX drawables.

+ * + *

This extension provides a new drawable tree query, which can be used by the composite manager when it begins tracking a window, and an event, which can + * be used to listen for updates to a tracked window. This query and event provide the composite manager with a boolean value representing the stereo + * status of an entire redirected window tree. With this information, the composite manager is able to properly choose between a stereoscopic or + * monoscopic format when creating a GLXPixmap for a given window tree's backing pixmap.

+ */ +public final class GLXEXTStereoTree { + + /** Accepted by the {@code attribute} parameter of glXQueryDrawable and glXQueryGLXPbufferSGIX. */ + public static final int GLX_STEREO_TREE_EXT = 0x20F5; + + /** + * Accepted in the {@code event_mask} parameter of glXSelectEvent and glXSelectEventSGIX, and returned in the {@code event_mask} parameter of + * glXGetSelectedEvent and glXGetSelectedEventSGIX. + */ + public static final int GLX_STEREO_NOTIFY_MASK_EXT = 0x1; + + /** Returned in the {@code evtype} field of XGenericEventCookie events. */ + public static final int GLX_STEREO_NOTIFY_EXT = 0x0; + + private GLXEXTStereoTree() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTSwapControl.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTSwapControl.java new file mode 100644 index 00000000..9e955ec2 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTSwapControl.java @@ -0,0 +1,57 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; + +/** + * Native bindings to the GLX_EXT_swap_control extension. + * + *

This extension allows an application to specify a minimum periodicity of color buffer swaps, measured in video frame periods, for a particular drawable. + * It also allows an application to query the swap interval and the implementation-dependent maximum swap interval of a drawable.

+ */ +public class GLXEXTSwapControl { + + /** The current swap interval and implementation-dependent max swap interval for a particular drawable. */ + public static final int + GLX_SWAP_INTERVAL_EXT = 0x20F1, + GLX_MAX_SWAP_INTERVAL_EXT = 0x20F2; + + protected GLXEXTSwapControl() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLXCapabilities caps) { + return checkFunctions( + caps.glXSwapIntervalEXT + ); + } + + // --- [ glXSwapIntervalEXT ] --- + + /** + * Specifies the minimum number of video frame periods per buffer swap for a particular GLX drawable (e.g. a value of two means that the color buffers will + * be swapped at most every other video frame). The interval takes effect when {@link GLX#glXSwapBuffers SwapBuffers} is first called on the drawable subsequent to the + * {@code glXSwapIntervalEXT} call. + * + * @param display the connection to the X server + * @param drawable the drawable + * @param interval the swap interval + */ + public static void glXSwapIntervalEXT(@NativeType("Display *") long display, @NativeType("GLXDrawable") long drawable, int interval) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXSwapIntervalEXT; + if (CHECKS) { + check(__functionAddress); + check(display); + check(drawable); + } + callPPV(display, drawable, interval, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTSwapControlTear.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTSwapControlTear.java new file mode 100644 index 00000000..b6b83a61 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTSwapControlTear.java @@ -0,0 +1,24 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_EXT_swap_control_tear extension. + * + *

This extension extends the existing GLX_EXT_swap_control extension by allowing a negative {@code interval} parameter to + * {@link GLXEXTSwapControl#glXSwapIntervalEXT SwapIntervalEXT}. The negative {@code interval} allows late swaps to occur without synchronization to the video frame. This + * reduces the visual stutter on late frames and reduces the stall on subsequent frames.

+ * + *

Requires {@link GLXEXTSwapControl GLX_EXT_swap_control}.

+ */ +public final class GLXEXTSwapControlTear { + + /** Accepted by {@link GLX13#glXQueryDrawable QueryDrawable}. */ + public static final int GLX_LATE_SWAPS_TEAR_EXT = 0x20F3; + + private GLXEXTSwapControlTear() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTTextureFromPixmap.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTTextureFromPixmap.java new file mode 100644 index 00000000..96babf0e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTTextureFromPixmap.java @@ -0,0 +1,154 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the GLX_EXT_texture_from_pixmap extension. + * + *

This extension allows a color buffer to be used for both rendering and texturing.

+ * + *

Requires {@link GLX13 GLX 1.3}.

+ */ +public class GLXEXTTextureFromPixmap { + + /** Accepted by the {@code attribute} parameter of {@link GLX13#glXGetFBConfigAttrib GetFBConfigAttrib} and the {@code attrib_list} parameter of {@link GLX13#glXChooseFBConfig ChooseFBConfig}. */ + public static final int + GLX_BIND_TO_TEXTURE_RGB_EXT = 0x20D0, + GLX_BIND_TO_TEXTURE_RGBA_EXT = 0x20D1, + GLX_BIND_TO_MIPMAP_TEXTURE_EXT = 0x20D2, + GLX_BIND_TO_TEXTURE_TARGETS_EXT = 0x20D3, + GLX_Y_INVERTED_EXT = 0x20D4; + + /** Accepted as an attribute in the {@code attrib_list} parameter of {@link GLX13#glXCreatePixmap CreatePixmap}, and by the {@code attribute} parameter of {@link GLX13#glXQueryDrawable QueryDrawable}. */ + public static final int + GLX_TEXTURE_FORMAT_EXT = 0x20D5, + GLX_TEXTURE_TARGET_EXT = 0x20D6, + GLX_MIPMAP_TEXTURE_EXT = 0x20D7; + + /** + * Accepted as a value in the {@code attrib_list} parameter of {@link GLX13#glXCreatePixmap CreatePixmap} and returned in the {@code value} parameter of + * {@link GLX13#glXQueryDrawable QueryDrawable} when {@code attribute} is {@link #GLX_TEXTURE_FORMAT_EXT TEXTURE_FORMAT_EXT}. + */ + public static final int + GLX_TEXTURE_FORMAT_NONE_EXT = 0x20D8, + GLX_TEXTURE_FORMAT_RGB_EXT = 0x20D9, + GLX_TEXTURE_FORMAT_RGBA_EXT = 0x20DA; + + /** Accepted as bits in the {@link #GLX_BIND_TO_TEXTURE_TARGETS_EXT BIND_TO_TEXTURE_TARGETS_EXT} variable. */ + public static final int + GLX_TEXTURE_1D_BIT_EXT = 0x1, + GLX_TEXTURE_2D_BIT_EXT = 0x2, + GLX_TEXTURE_RECTANGLE_BIT_EXT = 0x4; + + /** + * Accepted as a value in the {@code attrib_list} parameter of {@link GLX13#glXCreatePixmap CreatePixmap} and returned in the {@code value} parameter of + * {@link GLX13#glXQueryDrawable QueryDrawable} when {@code attribute} is {@link #GLX_TEXTURE_TARGET_EXT TEXTURE_TARGET_EXT}. + */ + public static final int + GLX_TEXTURE_1D_EXT = 0x20DB, + GLX_TEXTURE_2D_EXT = 0x20DC, + GLX_TEXTURE_RECTANGLE_EXT = 0x20DD; + + /** Accepted by the {@code buffer} parameter of {@link #glXBindTexImageEXT BindTexImageEXT} and {@link #glXReleaseTexImageEXT ReleaseTexImageEXT}. */ + public static final int + GLX_FRONT_LEFT_EXT = 0x20DE, + GLX_FRONT_RIGHT_EXT = 0x20DF, + GLX_BACK_LEFT_EXT = 0x20E0, + GLX_BACK_RIGHT_EXT = 0x20E1, + GLX_FRONT_EXT = GLX_FRONT_LEFT_EXT, + GLX_BACK_EXT = GLX_BACK_LEFT_EXT, + GLX_AUX0_EXT = 0x20E2, + GLX_AUX1_EXT = 0x20E3, + GLX_AUX2_EXT = 0x20E4, + GLX_AUX3_EXT = 0x20E5, + GLX_AUX4_EXT = 0x20E6, + GLX_AUX5_EXT = 0x20E7, + GLX_AUX6_EXT = 0x20E8, + GLX_AUX7_EXT = 0x20E9, + GLX_AUX8_EXT = 0x20EA, + GLX_AUX9_EXT = 0x20EB; + + protected GLXEXTTextureFromPixmap() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLXCapabilities caps) { + return checkFunctions( + caps.glXBindTexImageEXT, caps.glXReleaseTexImageEXT + ); + } + + // --- [ glXBindTexImageEXT ] --- + + /** Unsafe version of: {@link #glXBindTexImageEXT BindTexImageEXT} */ + public static void nglXBindTexImageEXT(long display, long drawable, int buffer, long attrib_list) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXBindTexImageEXT; + if (CHECKS) { + check(__functionAddress); + check(display); + check(drawable); + } + callPPPV(display, drawable, buffer, attrib_list, __functionAddress); + } + + /** + * Defines a one- or two-dimensional texture image. The texture image is taken from {@code buffer} and need not be copied. The texture target, the texture + * format, and the size of the texture components are derived from attributes of {@code drawable}. + * + * @param display the connection to the X server + * @param drawable the drawable + * @param buffer the buffer + * @param attrib_list an optional null-terminated list of attributes + */ + public static void glXBindTexImageEXT(@NativeType("Display *") long display, @NativeType("GLXDrawable") long drawable, int buffer, @Nullable @NativeType("int const *") IntBuffer attrib_list) { + if (CHECKS) { + checkNTSafe(attrib_list); + } + nglXBindTexImageEXT(display, drawable, buffer, memAddressSafe(attrib_list)); + } + + // --- [ glXReleaseTexImageEXT ] --- + + /** + * Releases a color buffer that is being used as a texture. + * + * @param display the connection to the X server + * @param drawable the drawable + * @param buffer the buffer + */ + public static void glXReleaseTexImageEXT(@NativeType("Display *") long display, @NativeType("GLXDrawable") long drawable, int buffer) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXReleaseTexImageEXT; + if (CHECKS) { + check(__functionAddress); + check(display); + check(drawable); + } + callPPV(display, drawable, buffer, __functionAddress); + } + + /** Array version of: {@link #glXBindTexImageEXT BindTexImageEXT} */ + public static void glXBindTexImageEXT(@NativeType("Display *") long display, @NativeType("GLXDrawable") long drawable, int buffer, @Nullable @NativeType("int const *") int[] attrib_list) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXBindTexImageEXT; + if (CHECKS) { + check(__functionAddress); + check(display); + check(drawable); + checkNTSafe(attrib_list); + } + callPPPV(display, drawable, buffer, attrib_list, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTVisualInfo.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTVisualInfo.java new file mode 100644 index 00000000..c201979d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTVisualInfo.java @@ -0,0 +1,53 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_EXT_visual_info extension. + * + *

This extension allows the user to request a particular X visual type to be associated with a GLX visual, and allows the user to query the X visual type + * underlying a GLX visual.

+ * + *

In addition, this extension provides a means to request a visual with a transparent pixel and to query whether a visual supports a transparent pixel + * value and the value of the transparent pixel. Note that the notion of level and transparent pixels are orthogonal as both layer 1 and layer 0 visuals + * may or may not have a transparent pixel value.

+ */ +public final class GLXEXTVisualInfo { + + /** Accepted by the {@code attrib} parameter of {@link GLX#glXGetConfig GetConfig}, and by the {@code attrib_list} parameter of {@link GLX#glXChooseVisual ChooseVisual}. */ + public static final int + GLX_X_VISUAL_TYPE_EXT = 0x22, + GLX_TRANSPARENT_TYPE_EXT = 0x23, + GLX_TRANSPARENT_INDEX_VALUE_EXT = 0x24, + GLX_TRANSPARENT_RED_VALUE_EXT = 0x25, + GLX_TRANSPARENT_GREEN_VALUE_EXT = 0x26, + GLX_TRANSPARENT_BLUE_VALUE_EXT = 0x27, + GLX_TRANSPARENT_ALPHA_VALUE_EXT = 0x28; + + /** + * Returned by {@link GLX#glXGetConfig GetConfig}, and accepted by the {@code attrib_list} parameter of {@link GLX#glXChooseVisual ChooseVisual} (following the + * {@link #GLX_X_VISUAL_TYPE_EXT X_VISUAL_TYPE_EXT} token). + */ + public static final int + GLX_TRUE_COLOR_EXT = 0x8002, + GLX_DIRECT_COLOR_EXT = 0x8003, + GLX_PSEUDO_COLOR_EXT = 0x8004, + GLX_STATIC_COLOR_EXT = 0x8005, + GLX_GRAY_SCALE_EXT = 0x8006, + GLX_STATIC_GRAY_EXT = 0x8007; + + /** + * Returned by {@link GLX#glXGetConfig GetConfig}, and accepted by the {@code attrib_list} parameter of {@link GLX#glXChooseVisual ChooseVisual} (following the + * {@link #GLX_TRANSPARENT_TYPE_EXT TRANSPARENT_TYPE_EXT} token). + */ + public static final int + GLX_NONE_EXT = 0x8000, + GLX_TRANSPARENT_RGB_EXT = 0x8008, + GLX_TRANSPARENT_INDEX_EXT = 0x8009; + + private GLXEXTVisualInfo() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTVisualRating.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTVisualRating.java new file mode 100644 index 00000000..aeb4a881 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXEXTVisualRating.java @@ -0,0 +1,35 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_EXT_visual_rating extension. + * + *

This extension allows servers to identify a particular GLX visual as undesirable. A new visual attribute is introduced, providing a way for servers to + * specify caveats (e.g., slow) for a visual. The attribute may be queried using {@link GLX#glXGetConfig GetConfig}, and can therefore be used by + * application-specific visual selection routines. The new attribute is also used by {@link GLX#glXChooseVisual ChooseVisual} to discriminate against visuals with + * caveats.

+ * + *

This extension allows servers to export visuals with improved features or image quality, but lower performance or greater system burden, without having + * to have these visuals selected preferentially. It is intended to insure that most applications get the "right" visual, not that all applications do.

+ */ +public final class GLXEXTVisualRating { + + /** Accepted by the {@code attribute} parameter of {@link GLX#glXGetConfig GetConfig} and by the {@code attrib_list} parameter of {@link GLX#glXChooseVisual ChooseVisual}. */ + public static final int GLX_VISUAL_CAVEAT_EXT = 0x20; + + /** + * Returned by the {@code value} parameter of {@link GLX#glXGetConfig GetConfig} (when {@code attribute} is set to {@link #GLX_VISUAL_CAVEAT_EXT VISUAL_CAVEAT_EXT}) and accepted by the {@code attrib_list} + * parameter of {@link GLX#glXChooseVisual ChooseVisual} (following the {@link #GLX_VISUAL_CAVEAT_EXT VISUAL_CAVEAT_EXT} token). + */ + public static final int + GLX_NONE_EXT = 0x8000, + GLX_SLOW_VISUAL_EXT = 0x8001, + GLX_NON_CONFORMANT_VISUAL_EXT = 0x800D; + + private GLXEXTVisualRating() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXINTELSwapEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXINTELSwapEvent.java new file mode 100644 index 00000000..fbbf1fc4 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXINTELSwapEvent.java @@ -0,0 +1,29 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_INTEL_swap_event extension. + * + *

This extension adds a new event type, {@link #GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK BUFFER_SWAP_COMPLETE_INTEL_MASK}, which is sent to the client via the X11 event stream and + * selected/consumed by the normal GLX event mask mechanisms, to indicate when a previously queued swap has completed.

+ * + *

Requires {@link GLX13 GLX 1.3}.

+ */ +public final class GLXINTELSwapEvent { + + /** Accepted by the {@code mask} parameter of {@link GLX13#glXSelectEvent SelectEvent} and returned in the {@code mask} parameter of {@link GLX13#glXGetSelectedEvent GetSelectedEvent}. */ + public static final int GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK = 0x4000000; + + /** Returned in the {@code event_type} field of a "swap complete" event. */ + public static final int + GLX_EXCHANGE_COMPLETE_INTEL = 0x8180, + GLX_COPY_COMPLETE_INTEL = 0x8181, + GLX_FLIP_COMPLETE_INTEL = 0x8182; + + private GLXINTELSwapEvent() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVCopyBuffer.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVCopyBuffer.java new file mode 100644 index 00000000..ea09ffa1 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVCopyBuffer.java @@ -0,0 +1,58 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; + +/** + * Native bindings to the GLX_NV_copy_buffer extension. + * + *

Extends {@link ARBCopyBuffer ARB_copy_buffer} to have GLX bindings.

+ */ +public class GLXNVCopyBuffer { + + protected GLXNVCopyBuffer() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLXCapabilities caps) { + return checkFunctions( + caps.glXCopyBufferSubDataNV, caps.glXNamedCopyBufferSubDataNV + ); + } + + // --- [ glXCopyBufferSubDataNV ] --- + + /** @param display the connection to the X server */ + public static void glXCopyBufferSubDataNV(@NativeType("Display *") long display, @NativeType("GLXContext") long readCtx, @NativeType("GLXContext") long writeCtx, @NativeType("GLenum") int readTarget, @NativeType("GLenum") int writeTarget, @NativeType("GLintptr") long readOffset, @NativeType("GLintptr") long writeOffset, @NativeType("GLsizeiptr") long size) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXCopyBufferSubDataNV; + if (CHECKS) { + check(__functionAddress); + check(display); + check(readCtx); + check(writeCtx); + } + callPPPPPPV(display, readCtx, writeCtx, readTarget, writeTarget, readOffset, writeOffset, size, __functionAddress); + } + + // --- [ glXNamedCopyBufferSubDataNV ] --- + + /** @param display the connection to the X server */ + public static void glXNamedCopyBufferSubDataNV(@NativeType("Display *") long display, @NativeType("GLXContext") long readCtx, @NativeType("GLXContext") long writeCtx, @NativeType("GLuint") int readBuffer, @NativeType("GLuint") int writeBuffer, @NativeType("GLintptr") long readOffset, @NativeType("GLintptr") long writeOffset, @NativeType("GLsizeiptr") long size) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXNamedCopyBufferSubDataNV; + if (CHECKS) { + check(__functionAddress); + check(display); + check(readCtx); + check(writeCtx); + } + callPPPPPPV(display, readCtx, writeCtx, readBuffer, writeBuffer, readOffset, writeOffset, size, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVCopyImage.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVCopyImage.java new file mode 100644 index 00000000..e1188de7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVCopyImage.java @@ -0,0 +1,52 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; + +/** + * Native bindings to the GLX_NV_copy_image extension. + * + *

This extension enables efficient image data transfer between image objects (i.e. textures and renderbuffers) without the need to bind the objects or + * otherwise configure the rendering pipeline. The GLX version allows copying between images in different contexts, even if those contexts are in different + * sharelists or even on different physical devices.

+ */ +public class GLXNVCopyImage { + + protected GLXNVCopyImage() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLXCapabilities caps) { + return checkFunctions( + caps.glXCopyImageSubDataNV + ); + } + + // --- [ glXCopyImageSubDataNV ] --- + + /** + * Behaves identically to the core function {@link #glXCopyImageSubDataNV CopyImageSubDataNV}, except that the {@code srcCtx} and {@code dstCtx} parameters specify + * the contexts in which to look up the source and destination objects, respectively. A value of {@code NULL} for either context indicates that the value which is + * returned by {@link GLX#glXGetCurrentContext GetCurrentContext} should be used instead. Both contexts must share the same address space. + * + * @param display the connection to the X server + * @param srcCtx the source context + * @param dstCtx the destination context + */ + public static void glXCopyImageSubDataNV(@NativeType("Display *") long display, @NativeType("GLXContext") long srcCtx, @NativeType("GLuint") int srcName, @NativeType("GLenum") int srcTarget, @NativeType("GLint") int srcLevel, @NativeType("GLint") int srcX, @NativeType("GLint") int srcY, @NativeType("GLint") int srcZ, @NativeType("GLXContext") long dstCtx, @NativeType("GLuint") int dstName, @NativeType("GLenum") int dstTarget, @NativeType("GLint") int dstLevel, @NativeType("GLint") int dstX, @NativeType("GLint") int dstY, @NativeType("GLint") int dstZ, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXCopyImageSubDataNV; + if (CHECKS) { + check(__functionAddress); + check(display); + } + callPPPV(display, srcCtx, srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstCtx, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, width, height, depth, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVDelayBeforeSwap.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVDelayBeforeSwap.java new file mode 100644 index 00000000..72fca297 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVDelayBeforeSwap.java @@ -0,0 +1,71 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; + +/** + * Native bindings to the GLX_NV_delay_before_swap extension. + * + *

For most interactive applications, the standard rendering loop responding to input events on a frame granularity is sufficient. Some more demanding + * applications may want to exchange performance for the ability to sample input closer to the final frame swap and adjust rendering accordingly. This + * extension adds functionality to allow the application to wait until a specified time before a swapbuffers command would be able to execute.

+ * + *

Requires {@link GLX11 GLX11} and {@link GLXEXTSwapControl GLX_EXT_swap_control}.

+ */ +public class GLXNVDelayBeforeSwap { + + protected GLXNVDelayBeforeSwap() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLXCapabilities caps) { + return checkFunctions( + caps.glXDelayBeforeSwapNV + ); + } + + // --- [ glXDelayBeforeSwapNV ] --- + + /** + * Blocks the CPU until {@code seconds} seconds before a synchronized swap would occur on a particular GLX window drawable. It also returns a boolean value + * equal to {@code True} when the implementation had to wait for the synchronized swap and {@code False} otherwise. + * + *

The parameter {@code seconds} accepts positive floating point values not larger than the length in seconds of the swap period on the associated + * drawable. When buffer swaps are synchronized, the swap period is composed of one or multiple video frame periods. A video frame period is the time + * required by the monitor to display a full frame of video data. A swap interval set to a value of 2 means that the color buffers will be swapped at most + * every other video frame. If {@code seconds} is smaller than 0, {@code DelayBeforeSwapNV} will return False and will not wait for the end of the swap + * period. If {@code seconds} is greater than a swap period, {@code DelayBeforeSwapNV} will return immediately without generating any error and the return + * value will be False.

+ * + *

The application should use a {@code seconds} delay large enough to have time to complete its work before the end of the swap period. If {@code seconds} + * is close to 0.0, the application may miss the end of the swap period and it will have to wait an additional swap period before it can swap.

+ * + *

If {@code DelayBeforeSwapNV} detects that there is less than {@code seconds} seconds before the end of the swap period, it will return immediately and + * the return value will be False. The implementation will not wait an additional video frame period to have an exact delay of {@code seconds} seconds.

+ * + *

If buffer swaps are unsynchronized, {@code DelayBeforeSwapNV} will return immediately and the return value will be False. It could happen for multiple + * reasons, for example if the swap interval is equal to 0, if the window is in a mode switch or if no monitors are active.

+ * + * @param display the connection to the X server + * @param drawable the window drawable + * @param seconds the delay, in seconds + */ + @NativeType("Bool") + public static boolean glXDelayBeforeSwapNV(@NativeType("Display *") long display, @NativeType("GLXDrawable") long drawable, @NativeType("GLfloat") float seconds) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXDelayBeforeSwapNV; + if (CHECKS) { + check(__functionAddress); + check(display); + check(drawable); + } + return callPPI(display, drawable, seconds, __functionAddress) != 0; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVFloatBuffer.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVFloatBuffer.java new file mode 100644 index 00000000..7908823c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVFloatBuffer.java @@ -0,0 +1,20 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_NV_float_buffer extension. + * + *

GLX functionality for {@link NVFloatBuffer NV_float_buffer}.

+ */ +public final class GLXNVFloatBuffer { + + /** Accepted in the {@code value} array of glXGetFBConfigAttrib (and glXGetFBConfigAttribSGIX). */ + public static final int GLX_FLOAT_COMPONENTS_NV = 0x20B0; + + private GLXNVFloatBuffer() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVMultisampleCoverage.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVMultisampleCoverage.java new file mode 100644 index 00000000..e7fcc2b7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVMultisampleCoverage.java @@ -0,0 +1,25 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_NV_multisample_coverage extension. + * + *

GLX functionality for {@link NVMultisampleCoverage NV_multisample_coverage}.

+ */ +public final class GLXNVMultisampleCoverage { + + /** + * Accepted by the {@code attribList} parameter of glXChooseVisual, and by the {@code attrib} parameter of glXGetConfig, the + * {@code attrib_list} parameter of glXChooseFBConfig, and the {@code attribute} parameter of glXGetFBConfigAttrib. + */ + public static final int + GLX_COVERAGE_SAMPLES_NV = 100001, + GLX_COLOR_SAMPLES_NV = 0x20B3; + + private GLXNVMultisampleCoverage() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVRobustnessVideoMemoryPurge.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVRobustnessVideoMemoryPurge.java new file mode 100644 index 00000000..26118a3a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVRobustnessVideoMemoryPurge.java @@ -0,0 +1,20 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the GLX_NV_robustness_video_memory_purge extension. + * + *

GLX functionality for {@link NVRobustnessVideoMemoryPurge NV_robustness_video_memory_purge}.

+ */ +public final class GLXNVRobustnessVideoMemoryPurge { + + /** Accepted as an attribute name in the {@code *attrib_list} argument of glXCreateContextAttribsARB. */ + public static final int GLX_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV = 0x20F7; + + private GLXNVRobustnessVideoMemoryPurge() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVSwapGroup.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVSwapGroup.java new file mode 100644 index 00000000..c664c74f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXNVSwapGroup.java @@ -0,0 +1,185 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the GLX_NV_swap_group extension. + * + *

This extension provides the capability to synchronize the buffer swaps of a group of OpenGL windows. A swap group is created, and windows are added as + * members to the swap group. Buffer swaps to members of the swap group will then take place concurrently.

+ * + *

This extension also provides the capability to sychronize the buffer swaps of different swap groups, which may reside on distributed systems on a + * network. For this purpose swap groups can be bound to a swap barrier.

+ * + *

This extension extends the set of conditions that must be met before a buffer swap can take place.

+ */ +public class GLXNVSwapGroup { + + protected GLXNVSwapGroup() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLXCapabilities caps) { + return checkFunctions( + caps.glXJoinSwapGroupNV, caps.glXBindSwapBarrierNV, caps.glXQuerySwapGroupNV, caps.glXQueryMaxSwapGroupsNV, caps.glXQueryFrameCountNV, + caps.glXResetFrameCountNV + ); + } + + // --- [ glXJoinSwapGroupNV ] --- + + /** @param display the connection to the X server */ + @NativeType("Bool") + public static boolean glXJoinSwapGroupNV(@NativeType("Display *") long display, @NativeType("GLXDrawable") long drawable, @NativeType("GLuint") int group) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXJoinSwapGroupNV; + if (CHECKS) { + check(__functionAddress); + check(display); + check(drawable); + } + return callPPI(display, drawable, group, __functionAddress) != 0; + } + + // --- [ glXBindSwapBarrierNV ] --- + + /** @param display the connection to the X server */ + @NativeType("Bool") + public static boolean glXBindSwapBarrierNV(@NativeType("Display *") long display, @NativeType("GLuint") int group, @NativeType("GLuint") int barrier) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXBindSwapBarrierNV; + if (CHECKS) { + check(__functionAddress); + check(display); + } + return callPI(display, group, barrier, __functionAddress) != 0; + } + + // --- [ glXQuerySwapGroupNV ] --- + + /** Unsafe version of: {@link #glXQuerySwapGroupNV QuerySwapGroupNV} */ + public static int nglXQuerySwapGroupNV(long display, long drawable, long group, long barrier) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXQuerySwapGroupNV; + if (CHECKS) { + check(__functionAddress); + check(display); + check(drawable); + } + return callPPPPI(display, drawable, group, barrier, __functionAddress); + } + + /** @param display the connection to the X server */ + @NativeType("Bool") + public static boolean glXQuerySwapGroupNV(@NativeType("Display *") long display, @NativeType("GLXDrawable") long drawable, @NativeType("GLuint *") IntBuffer group, @NativeType("GLuint *") IntBuffer barrier) { + if (CHECKS) { + check(group, 1); + check(barrier, 1); + } + return nglXQuerySwapGroupNV(display, drawable, memAddress(group), memAddress(barrier)) != 0; + } + + // --- [ glXQueryMaxSwapGroupsNV ] --- + + /** Unsafe version of: {@link #glXQueryMaxSwapGroupsNV QueryMaxSwapGroupsNV} */ + public static int nglXQueryMaxSwapGroupsNV(long display, int screen, long maxGroups, long maxBarriers) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXQueryMaxSwapGroupsNV; + if (CHECKS) { + check(__functionAddress); + check(display); + } + return callPPPI(display, screen, maxGroups, maxBarriers, __functionAddress); + } + + /** @param display the connection to the X server */ + @NativeType("Bool") + public static boolean glXQueryMaxSwapGroupsNV(@NativeType("Display *") long display, int screen, @NativeType("GLuint *") IntBuffer maxGroups, @NativeType("GLuint *") IntBuffer maxBarriers) { + if (CHECKS) { + check(maxGroups, 1); + check(maxBarriers, 1); + } + return nglXQueryMaxSwapGroupsNV(display, screen, memAddress(maxGroups), memAddress(maxBarriers)) != 0; + } + + // --- [ glXQueryFrameCountNV ] --- + + /** Unsafe version of: {@link #glXQueryFrameCountNV QueryFrameCountNV} */ + public static int nglXQueryFrameCountNV(long display, int screen, long count) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXQueryFrameCountNV; + if (CHECKS) { + check(__functionAddress); + check(display); + } + return callPPI(display, screen, count, __functionAddress); + } + + /** @param display the connection to the X server */ + @NativeType("Bool") + public static boolean glXQueryFrameCountNV(@NativeType("Display *") long display, int screen, @NativeType("GLuint *") IntBuffer count) { + if (CHECKS) { + check(count, 1); + } + return nglXQueryFrameCountNV(display, screen, memAddress(count)) != 0; + } + + // --- [ glXResetFrameCountNV ] --- + + /** @param display the connection to the X server */ + @NativeType("Bool") + public static boolean glXResetFrameCountNV(@NativeType("Display *") long display, int screen) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXResetFrameCountNV; + if (CHECKS) { + check(__functionAddress); + check(display); + } + return callPI(display, screen, __functionAddress) != 0; + } + + /** Array version of: {@link #glXQuerySwapGroupNV QuerySwapGroupNV} */ + @NativeType("Bool") + public static boolean glXQuerySwapGroupNV(@NativeType("Display *") long display, @NativeType("GLXDrawable") long drawable, @NativeType("GLuint *") int[] group, @NativeType("GLuint *") int[] barrier) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXQuerySwapGroupNV; + if (CHECKS) { + check(__functionAddress); + check(display); + check(drawable); + check(group, 1); + check(barrier, 1); + } + return callPPPPI(display, drawable, group, barrier, __functionAddress) != 0; + } + + /** Array version of: {@link #glXQueryMaxSwapGroupsNV QueryMaxSwapGroupsNV} */ + @NativeType("Bool") + public static boolean glXQueryMaxSwapGroupsNV(@NativeType("Display *") long display, int screen, @NativeType("GLuint *") int[] maxGroups, @NativeType("GLuint *") int[] maxBarriers) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXQueryMaxSwapGroupsNV; + if (CHECKS) { + check(__functionAddress); + check(display); + check(maxGroups, 1); + check(maxBarriers, 1); + } + return callPPPI(display, screen, maxGroups, maxBarriers, __functionAddress) != 0; + } + + /** Array version of: {@link #glXQueryFrameCountNV QueryFrameCountNV} */ + @NativeType("Bool") + public static boolean glXQueryFrameCountNV(@NativeType("Display *") long display, int screen, @NativeType("GLuint *") int[] count) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXQueryFrameCountNV; + if (CHECKS) { + check(__functionAddress); + check(display); + check(count, 1); + } + return callPPI(display, screen, count, __functionAddress) != 0; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIMakeCurrentRead.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIMakeCurrentRead.java new file mode 100644 index 00000000..ca63fec2 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIMakeCurrentRead.java @@ -0,0 +1,64 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; + +/** + * Native bindings to the GLX_SGI_make_current_read extension. + * + *

The association of the current context with a drawable is extended to allow separate write and read drawables. This paves the way for allowing + * preprocessing of image data in an "off screen" window which is then read into the visible window for final display. Similarly it sets the frame-work + * for direct transfer of video to the GL, by treating the video as a special kind of read drawable (a.k.a, readable).

+ */ +public class GLXSGIMakeCurrentRead { + + protected GLXSGIMakeCurrentRead() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLXCapabilities caps) { + return checkFunctions( + caps.glXMakeCurrentReadSGI, caps.glXGetCurrentReadDrawableSGI + ); + } + + // --- [ glXMakeCurrentReadSGI ] --- + + /** + * Associates two {@code GLXDrawables} with the current rendering context. + * + * @param display the connection to the X server + * @param draw the draw drawable + * @param read the read drawable + * @param ctx the current context + */ + @NativeType("Bool") + public static boolean glXMakeCurrentReadSGI(@NativeType("Display *") long display, @NativeType("GLXDrawable") long draw, @NativeType("GLXDrawable") long read, @NativeType("GLXContext") long ctx) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXMakeCurrentReadSGI; + if (CHECKS) { + check(__functionAddress); + check(display); + } + return callPPPPI(display, draw, read, ctx, __functionAddress) != 0; + } + + // --- [ glXGetCurrentReadDrawableSGI ] --- + + /** Returns the name of the {@code GLXDrawable} currently being used as a pixel query source. */ + @NativeType("GLXDrawable") + public static long glXGetCurrentReadDrawableSGI() { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetCurrentReadDrawableSGI; + if (CHECKS) { + check(__functionAddress); + } + return callP(__functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGISwapControl.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGISwapControl.java new file mode 100644 index 00000000..ef31dd97 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGISwapControl.java @@ -0,0 +1,51 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; + +/** + * Native bindings to the GLX_SGI_swap_control extension. + * + *

This extension allows an application to specify a minimum periodicity of color buffer swaps, measured in video frame periods.

+ */ +public class GLXSGISwapControl { + + protected GLXSGISwapControl() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLXCapabilities caps) { + return checkFunctions( + caps.glXSwapIntervalSGI + ); + } + + // --- [ glXSwapIntervalSGI ] --- + + /** + * Specifies the minimum number of video frame periods per buffer swap. (e.g. a value of two means that the color buffers will be swapped at most every + * other video frame.) A return value of zero indicates success; otherwise an error occurred. The interval takes effect when {@link GLX#glXSwapBuffers SwapBuffers} + * is first called subsequent to the {@code glXSwapIntervalSGI} call. + * + *

A video frame period is the time required by the monitor to display a full frame of video data. In the case of an interlaced monitor, this is typically + * the time required to display both the even and odd fields of a frame of video data.

+ * + * @param interval the swap interval + */ + @NativeType("GLint") + public static int glXSwapIntervalSGI(int interval) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXSwapIntervalSGI; + if (CHECKS) { + check(__functionAddress); + } + return callI(interval, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIVideoSync.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIVideoSync.java new file mode 100644 index 00000000..3585509b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIVideoSync.java @@ -0,0 +1,111 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the GLX_SGI_video_sync extension. + * + *

This extension provides a means for synchronization with the video frame rate of a monitor.

+ */ +public class GLXSGIVideoSync { + + protected GLXSGIVideoSync() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLXCapabilities caps) { + return checkFunctions( + caps.glXGetVideoSyncSGI, caps.glXWaitVideoSyncSGI + ); + } + + // --- [ glXGetVideoSyncSGI ] --- + + /** Unsafe version of: {@link #glXGetVideoSyncSGI GetVideoSyncSGI} */ + public static int nglXGetVideoSyncSGI(long count) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetVideoSyncSGI; + if (CHECKS) { + check(__functionAddress); + } + return callPI(count, __functionAddress); + } + + /** + * Returns the value of the video sync counter in {@code count}. Zero is returned if the call is successful. + * + * @param count the video sync counter value + */ + @NativeType("GLint") + public static int glXGetVideoSyncSGI(@NativeType("unsigned int *") IntBuffer count) { + if (CHECKS) { + check(count, 1); + } + return nglXGetVideoSyncSGI(memAddress(count)); + } + + // --- [ glXWaitVideoSyncSGI ] --- + + /** Unsafe version of: {@link #glXWaitVideoSyncSGI WaitVideoSyncSGI} */ + public static int nglXWaitVideoSyncSGI(int divisor, int remainder, long count) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXWaitVideoSyncSGI; + if (CHECKS) { + check(__functionAddress); + } + return callPI(divisor, remainder, count, __functionAddress); + } + + /** + * Puts the calling process to sleep until + * + *

{@code (C mod D) = R}

+ * + *

where {@code C} is the video sync counter, {@code D} is specified by the {@code divisor} parameter of {@code glXWaitVideoSyncSGI}, and {@code R} is + * specified by the {@code remainder} parameter of {@code glXWaitVideoSyncSGI}. {@code glXWaitVideoSyncSGI} returns the current video sync counter value in + * {@code count}. Zero is returned by {@code glXWaitVideoSyncSGI} if it is successful.

+ * + * @param divisor the divisor value + * @param remainder the remainder value + * @param count the video sync counter value + */ + @NativeType("GLint") + public static int glXWaitVideoSyncSGI(int divisor, int remainder, @NativeType("unsigned int *") IntBuffer count) { + if (CHECKS) { + check(count, 1); + } + return nglXWaitVideoSyncSGI(divisor, remainder, memAddress(count)); + } + + /** Array version of: {@link #glXGetVideoSyncSGI GetVideoSyncSGI} */ + @NativeType("GLint") + public static int glXGetVideoSyncSGI(@NativeType("unsigned int *") int[] count) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetVideoSyncSGI; + if (CHECKS) { + check(__functionAddress); + check(count, 1); + } + return callPI(count, __functionAddress); + } + + /** Array version of: {@link #glXWaitVideoSyncSGI WaitVideoSyncSGI} */ + @NativeType("GLint") + public static int glXWaitVideoSyncSGI(int divisor, int remainder, @NativeType("unsigned int *") int[] count) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXWaitVideoSyncSGI; + if (CHECKS) { + check(__functionAddress); + check(count, 1); + } + return callPI(divisor, remainder, count, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIXFBConfig.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIXFBConfig.java new file mode 100644 index 00000000..62c587e6 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIXFBConfig.java @@ -0,0 +1,272 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +import org.lwjgl.system.linux.*; + +/** + * Native bindings to the GLX_SGIX_fbconfig extension. + * + *

This extension introduces a new way to describe the capabilities of a GLX drawable (i.e., to describe the depth of color buffer components and the type + * and size of ancillary buffers), removes the "similarity" requirement when making a context current to a drawable, and supports RGBA rendering to + * one-and two-component Windows and GLX Pixmaps.

+ */ +public class GLXSGIXFBConfig { + + /** Accepted by the {@code attribute} parameter of {@link #glXGetFBConfigAttribSGIX GetFBConfigAttribSGIX}, and by the {@code attrib_list} parameter of {@link #glXChooseFBConfigSGIX ChooseFBConfigSGIX}. */ + public static final int + GLX_DRAWABLE_TYPE_SGIX = 0x8010, + GLX_RENDER_TYPE_SGIX = 0x8011, + GLX_X_RENDERABLE_SGIX = 0x8012; + + /** + * Accepted by the {@code attribute} parameter of {@link #glXGetFBConfigAttribSGIX GetFBConfigAttribSGIX}, the {@code attrib_list} parameter of {@link #glXChooseFBConfigSGIX ChooseFBConfigSGIX}, + * by the {@code attribute} parameter of {@link GLXSGIXPbuffer#glXQueryGLXPbufferSGIX QueryGLXPbufferSGIX} and by the {@code attribute} parameter of + * {@link GLXEXTImportContext#glXQueryContextInfoEXT QueryContextInfoEXT}. + */ + public static final int GLX_FBCONFIG_ID_SGIX = 0x8013; + + /** Accepted by the {@code attribute} parameter of {@link #glXGetFBConfigAttribSGIX GetFBConfigAttribSGIX}. */ + public static final int GLX_SCREEN_EXT = 0x800C; + + /** + * Returned by {@link #glXGetFBConfigAttribSGIX GetFBConfigAttribSGIX} (when {@code attribute} is set to {@link #GLX_DRAWABLE_TYPE_SGIX DRAWABLE_TYPE_SGIX}) and accepted by the {@code attrib_list} + * parameter of {@link #glXChooseFBConfigSGIX ChooseFBConfigSGIX} (following the {@link #GLX_DRAWABLE_TYPE_SGIX DRAWABLE_TYPE_SGIX} token). + */ + public static final int + GLX_WINDOW_BIT_SGIX = 0x1, + GLX_PIXMAP_BIT_SGIX = 0x2; + + /** + * Returned by {@link #glXGetFBConfigAttribSGIX GetFBConfigAttribSGIX} (when {@code attribute} is set to {@link #GLX_RENDER_TYPE_SGIX RENDER_TYPE_SGIX}) and accepted by the {@code attrib_list} + * parameter of {@link #glXChooseFBConfigSGIX ChooseFBConfigSGIX} (following the {@link #GLX_RENDER_TYPE_SGIX RENDER_TYPE_SGIX} token). + */ + public static final int + GLX_RGBA_BIT_SGIX = 0x1, + GLX_COLOR_INDEX_BIT_SGIX = 0x2; + + /** Accepted by the {@code render_type} parameter of {@link #glXCreateContextWithConfigSGIX CreateContextWithConfigSGIX}. */ + public static final int + GLX_RGBA_TYPE_SGIX = 0x8014, + GLX_COLOR_INDEX_TYPE_SGIX = 0x8015; + + protected GLXSGIXFBConfig() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLXCapabilities caps) { + return checkFunctions( + caps.glXGetFBConfigAttribSGIX, caps.glXChooseFBConfigSGIX, caps.glXCreateGLXPixmapWithConfigSGIX, caps.glXCreateContextWithConfigSGIX, + caps.glXGetVisualFromFBConfigSGIX, caps.glXGetFBConfigFromVisualSGIX + ); + } + + // --- [ glXGetFBConfigAttribSGIX ] --- + + /** Unsafe version of: {@link #glXGetFBConfigAttribSGIX GetFBConfigAttribSGIX} */ + public static int nglXGetFBConfigAttribSGIX(long display, long config, int attribute, long value) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetFBConfigAttribSGIX; + if (CHECKS) { + check(__functionAddress); + check(display); + check(config); + } + return callPPPI(display, config, attribute, value, __functionAddress); + } + + /** + * Gets the value of a GLX attribute for a {@code GLXFBConfigSGIX}. + * + * @param display the connection to the X server + * @param config the {@code GLXFBConfigSGIX} being queried + * @param attribute the attribute to query + * @param value returns the attribute value + */ + public static int glXGetFBConfigAttribSGIX(@NativeType("Display *") long display, @NativeType("GLXFBConfigSGIX") long config, int attribute, @NativeType("int *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + return nglXGetFBConfigAttribSGIX(display, config, attribute, memAddress(value)); + } + + // --- [ glXChooseFBConfigSGIX ] --- + + /** + * Unsafe version of: {@link #glXChooseFBConfigSGIX ChooseFBConfigSGIX} + * + * @param nelements the number of {@code GLXFBConfigSGIX} returned + */ + public static long nglXChooseFBConfigSGIX(long display, int screen, long attrib_list, long nelements) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXChooseFBConfigSGIX; + if (CHECKS) { + check(__functionAddress); + check(display); + } + return callPPPP(display, screen, attrib_list, nelements, __functionAddress); + } + + /** + * Gets {@code GLXFBConfigSGIX}s that match a list of attributes or to get the list of GLXFBConfigSGIXs that are available on the specified screen. + * + * @param display the connection to the X server + * @param screen the screen number + * @param attrib_list an optional list of attributes, terminated with org.lwjgl.system.linux.{@code None} + */ + @Nullable + @NativeType("GLXFBConfigSGIX *") + public static PointerBuffer glXChooseFBConfigSGIX(@NativeType("Display *") long display, int screen, @Nullable @NativeType("int const *") IntBuffer attrib_list) { + if (CHECKS) { + checkNTSafe(attrib_list); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + IntBuffer nelements = stack.callocInt(1); + try { + long __result = nglXChooseFBConfigSGIX(display, screen, memAddressSafe(attrib_list), memAddress(nelements)); + return memPointerBufferSafe(__result, nelements.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glXCreateGLXPixmapWithConfigSGIX ] --- + + /** + * Creates a GLX pixmap using a {@code GLXFBConfigSGIX}. + * + * @param display the connection to the X server + * @param config the {@code GLXFBConfigSGIX} + * @param pixmap the pixmap + */ + @NativeType("GLXPixmap") + public static long glXCreateGLXPixmapWithConfigSGIX(@NativeType("Display *") long display, @NativeType("GLXFBConfig") long config, @NativeType("Pixmap") long pixmap) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXCreateGLXPixmapWithConfigSGIX; + if (CHECKS) { + check(__functionAddress); + check(display); + check(config); + } + return callPPNP(display, config, pixmap, __functionAddress); + } + + // --- [ glXCreateContextWithConfigSGIX ] --- + + /** + * Creates a GLX context using a {@code GLXFBConfigSGIX}. + * + * @param display the connection to the X server + * @param config the {@code GLXFBConfigSGIX} + * @param render_type the render type. One of:
{@link #GLX_RGBA_TYPE_SGIX RGBA_TYPE_SGIX}{@link #GLX_COLOR_INDEX_TYPE_SGIX COLOR_INDEX_TYPE_SGIX}
+ * @param share_list the GLX context to share objects with + * @param direct direct rendering request + */ + @NativeType("GLXContext") + public static long glXCreateContextWithConfigSGIX(@NativeType("Display *") long display, @NativeType("GLXFBConfig") long config, int render_type, @NativeType("GLXContext") long share_list, @NativeType("Bool") boolean direct) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXCreateContextWithConfigSGIX; + if (CHECKS) { + check(__functionAddress); + check(display); + check(config); + check(share_list); + } + return callPPPP(display, config, render_type, share_list, direct ? 1 : 0, __functionAddress); + } + + // --- [ glXGetVisualFromFBConfigSGIX ] --- + + /** Unsafe version of: {@link #glXGetVisualFromFBConfigSGIX GetVisualFromFBConfigSGIX} */ + public static long nglXGetVisualFromFBConfigSGIX(long display, long config) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetVisualFromFBConfigSGIX; + if (CHECKS) { + check(__functionAddress); + check(display); + check(config); + } + return callPPP(display, config, __functionAddress); + } + + /** + * Retrieves the associated visual of a {@code GLXFBConfigSGIX}. + * + * @param display the connection to the X server + * @param config the {@code GLXFBConfigSGIX} + */ + @Nullable + @NativeType("XVisualInfo *") + public static XVisualInfo glXGetVisualFromFBConfigSGIX(@NativeType("Display *") long display, @NativeType("GLXFBConfig") long config) { + long __result = nglXGetVisualFromFBConfigSGIX(display, config); + return XVisualInfo.createSafe(__result); + } + + // --- [ glXGetFBConfigFromVisualSGIX ] --- + + /** Unsafe version of: {@link #glXGetFBConfigFromVisualSGIX GetFBConfigFromVisualSGIX} */ + public static long nglXGetFBConfigFromVisualSGIX(long display, long vis) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetFBConfigFromVisualSGIX; + if (CHECKS) { + check(__functionAddress); + check(display); + XVisualInfo.validate(vis); + } + return callPPP(display, vis, __functionAddress); + } + + /** + * Retrieves the {@code GLXFBConfigSGIX} associated with a visual. + * + * @param display the connection to the X server + * @param vis the visual + */ + @NativeType("GLXFBConfigSGIX") + public static long glXGetFBConfigFromVisualSGIX(@NativeType("Display *") long display, @NativeType("XVisualInfo *") XVisualInfo vis) { + return nglXGetFBConfigFromVisualSGIX(display, vis.address()); + } + + /** Array version of: {@link #glXGetFBConfigAttribSGIX GetFBConfigAttribSGIX} */ + public static int glXGetFBConfigAttribSGIX(@NativeType("Display *") long display, @NativeType("GLXFBConfigSGIX") long config, int attribute, @NativeType("int *") int[] value) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetFBConfigAttribSGIX; + if (CHECKS) { + check(__functionAddress); + check(display); + check(config); + check(value, 1); + } + return callPPPI(display, config, attribute, value, __functionAddress); + } + + /** Array version of: {@link #glXChooseFBConfigSGIX ChooseFBConfigSGIX} */ + @Nullable + @NativeType("GLXFBConfigSGIX *") + public static PointerBuffer glXChooseFBConfigSGIX(@NativeType("Display *") long display, int screen, @Nullable @NativeType("int const *") int[] attrib_list) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXChooseFBConfigSGIX; + if (CHECKS) { + check(__functionAddress); + check(display); + checkNTSafe(attrib_list); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + IntBuffer nelements = stack.callocInt(1); + try { + long __result = callPPPP(display, screen, attrib_list, memAddress(nelements), __functionAddress); + return memPointerBufferSafe(__result, nelements.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIXPbuffer.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIXPbuffer.java new file mode 100644 index 00000000..a83dd211 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIXPbuffer.java @@ -0,0 +1,236 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the GLX_SGIX_pbuffer extension. + * + *

This extension defines pixel buffers (GLXPbuffers, or pbuffer for short). GLXPbuffers are additional non-visible rendering buffers for an OpenGL + * renderer.

+ */ +public class GLXSGIXPbuffer { + + /** Accepted by the {@code attribute} parameter of {@link GLXSGIXFBConfig#glXGetFBConfigAttribSGIX GetFBConfigAttribSGIX}. */ + public static final int + GLX_MAX_PBUFFER_WIDTH_SGIX = 0x8016, + GLX_MAX_PBUFFER_HEIGHT_SGIX = 0x8017, + GLX_MAX_PBUFFER_PIXELS_SGIX = 0x8018, + GLX_OPTIMAL_PBUFFER_WIDTH_SGIX = 0x8019, + GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX = 0x801A; + + /** + * Returned by {@link GLXSGIXFBConfig#glXGetFBConfigAttribSGIX GetFBConfigAttribSGIX} (when {@code attribute} is set to {@link GLXSGIXFBConfig#GLX_DRAWABLE_TYPE_SGIX DRAWABLE_TYPE_SGIX}) and + * accepted by the {@code attrib_list} parameter of {@link GLXSGIXFBConfig#glXChooseFBConfigSGIX ChooseFBConfigSGIX} (following the + * {@link GLXSGIXFBConfig#GLX_DRAWABLE_TYPE_SGIX DRAWABLE_TYPE_SGIX} token). + */ + public static final int GLX_PBUFFER_BIT_SGIX = 0x4; + + /** Accepted by the {@code attrib_list} parameter of {@link #glXCreateGLXPbufferSGIX CreateGLXPbufferSGIX} and by the {@code attribute} parameter of {@link #glXQueryGLXPbufferSGIX QueryGLXPbufferSGIX}. */ + public static final int + GLX_PRESERVED_CONTENTS_SGIX = 0x801B, + GLX_LARGEST_PBUFFER_SGIX = 0x801C; + + /** Accepted by the {@code attribute} parameter of {@link #glXQueryGLXPbufferSGIX QueryGLXPbufferSGIX}. */ + public static final int + GLX_WIDTH_SGIX = 0x801D, + GLX_HEIGHT_SGIX = 0x801E, + GLX_EVENT_MASK_SGIX = 0x801F; + + /** Accepted by the {@code mask} parameter of {@link #glXSelectEventSGIX SelectEventSGIX} and returned in the {@code mask} parameter of {@link #glXGetSelectedEventSGIX GetSelectedEventSGIX}. */ + public static final int GLX_BUFFER_CLOBBER_MASK_SGIX = 0x8000000; + + /** Returned in the {@code event_type} field of a "buffer clobber" event. */ + public static final int + GLX_DAMAGED_SGIX = 0x8020, + GLX_SAVED_SGIX = 0x8021; + + /** Returned in the {@code draw_type} field of a "buffer clobber" event. */ + public static final int + GLX_WINDOW_SGIX = 0x8022, + GLX_PBUFFER_SGIX = 0x8023; + + /** Returned in the {@code mask} field of a "buffer clobber" event. */ + public static final int + GLX_FRONT_LEFT_BUFFER_BIT_SGIX = 0x1, + GLX_FRONT_RIGHT_BUFFER_BIT_SGIX = 0x2, + GLX_BACK_LEFT_BUFFER_BIT_SGIX = 0x4, + GLX_BACK_RIGHT_BUFFER_BIT_SGIX = 0x8, + GLX_AUX_BUFFERS_BIT_SGIX = 0x10, + GLX_DEPTH_BUFFER_BIT_SGIX = 0x20, + GLX_STENCIL_BUFFER_BIT_SGIX = 0x40, + GLX_ACCUM_BUFFER_BIT_SGIX = 0x80, + GLX_SAMPLE_BUFFERS_BIT_SGIX = 0x100; + + protected GLXSGIXPbuffer() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLXCapabilities caps) { + return checkFunctions( + caps.glXCreateGLXPbufferSGIX, caps.glXDestroyGLXPbufferSGIX, caps.glXQueryGLXPbufferSGIX, caps.glXSelectEventSGIX, caps.glXGetSelectedEventSGIX + ); + } + + // --- [ glXCreateGLXPbufferSGIX ] --- + + /** Unsafe version of: {@link #glXCreateGLXPbufferSGIX CreateGLXPbufferSGIX} */ + public static long nglXCreateGLXPbufferSGIX(long display, long config, int width, int height, long attrib_list) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXCreateGLXPbufferSGIX; + if (CHECKS) { + check(__functionAddress); + check(display); + check(config); + } + return callPPPP(display, config, width, height, attrib_list, __functionAddress); + } + + /** + * Creates a single GLXPbuffer and returns its XID. + * + * @param display the connection to the X server + * @param config the {@code GLXFBConfig} + * @param width the pbuffer width + * @param height the pbuffer height + * @param attrib_list an optional null-terminated list of attributes + */ + @NativeType("GLXPbuffer") + public static long glXCreateGLXPbufferSGIX(@NativeType("Display *") long display, @NativeType("GLXFBConfig") long config, @NativeType("unsigned int") int width, @NativeType("unsigned int") int height, @Nullable @NativeType("int *") IntBuffer attrib_list) { + if (CHECKS) { + checkNTSafe(attrib_list); + } + return nglXCreateGLXPbufferSGIX(display, config, width, height, memAddressSafe(attrib_list)); + } + + // --- [ glXDestroyGLXPbufferSGIX ] --- + + /** + * Destroys a GLXPbuffer. + * + * @param display the connection to the X server + * @param pbuf the pbuffer to destroy + */ + public static void glXDestroyGLXPbufferSGIX(@NativeType("Display *") long display, @NativeType("GLXPbuffer") long pbuf) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXDestroyGLXPbufferSGIX; + if (CHECKS) { + check(__functionAddress); + check(display); + check(pbuf); + } + callPPV(display, pbuf, __functionAddress); + } + + // --- [ glXQueryGLXPbufferSGIX ] --- + + /** Unsafe version of: {@link #glXQueryGLXPbufferSGIX QueryGLXPbufferSGIX} */ + public static void nglXQueryGLXPbufferSGIX(long display, long pbuf, int attribute, long value) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXQueryGLXPbufferSGIX; + if (CHECKS) { + check(__functionAddress); + check(display); + check(pbuf); + } + callPPPV(display, pbuf, attribute, value, __functionAddress); + } + + /** + * Queries an attribute associated with a GLXPbuffer. + * + * @param display the connection to the X server + * @param pbuf the pbuffer being queried + * @param attribute the attribute to query + * @param value returns the attribute value + */ + public static void glXQueryGLXPbufferSGIX(@NativeType("Display *") long display, @NativeType("GLXPbuffer") long pbuf, int attribute, @NativeType("unsigned int *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nglXQueryGLXPbufferSGIX(display, pbuf, attribute, memAddress(value)); + } + + // --- [ glXSelectEventSGIX ] --- + + /** + * Selects which GLX events should be received on a GLXdrawable. + * + * @param display the connection to the X server + * @param drawable the GLXDrawable + * @param mask the selection mask + */ + public static void glXSelectEventSGIX(@NativeType("Display *") long display, @NativeType("GLXDrawable") long drawable, @NativeType("unsigned long") long mask) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXSelectEventSGIX; + if (CHECKS) { + check(__functionAddress); + check(display); + check(drawable); + } + callPPNV(display, drawable, mask, __functionAddress); + } + + // --- [ glXGetSelectedEventSGIX ] --- + + /** Unsafe version of: {@link #glXGetSelectedEventSGIX GetSelectedEventSGIX} */ + public static void nglXGetSelectedEventSGIX(long display, long drawable, long mask) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXGetSelectedEventSGIX; + if (CHECKS) { + check(__functionAddress); + check(display); + check(drawable); + } + callPPPV(display, drawable, mask, __functionAddress); + } + + /** + * Returns which GLX events are selected for a GLXdrawable. + * + * @param display the connection to the X server + * @param drawable the GLXDrawable + * @param mask returns the selection mask + */ + public static void glXGetSelectedEventSGIX(@NativeType("Display *") long display, @NativeType("GLXDrawable") long drawable, @NativeType("unsigned long *") CLongBuffer mask) { + if (CHECKS) { + check(mask, 1); + } + nglXGetSelectedEventSGIX(display, drawable, memAddress(mask)); + } + + /** Array version of: {@link #glXCreateGLXPbufferSGIX CreateGLXPbufferSGIX} */ + @NativeType("GLXPbuffer") + public static long glXCreateGLXPbufferSGIX(@NativeType("Display *") long display, @NativeType("GLXFBConfig") long config, @NativeType("unsigned int") int width, @NativeType("unsigned int") int height, @Nullable @NativeType("int *") int[] attrib_list) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXCreateGLXPbufferSGIX; + if (CHECKS) { + check(__functionAddress); + check(display); + check(config); + checkNTSafe(attrib_list); + } + return callPPPP(display, config, width, height, attrib_list, __functionAddress); + } + + /** Array version of: {@link #glXQueryGLXPbufferSGIX QueryGLXPbufferSGIX} */ + public static void glXQueryGLXPbufferSGIX(@NativeType("Display *") long display, @NativeType("GLXPbuffer") long pbuf, int attribute, @NativeType("unsigned int *") int[] value) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXQueryGLXPbufferSGIX; + if (CHECKS) { + check(__functionAddress); + check(display); + check(pbuf); + check(value, 1); + } + callPPPV(display, pbuf, attribute, value, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIXSwapBarrier.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIXSwapBarrier.java new file mode 100644 index 00000000..6fd94473 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIXSwapBarrier.java @@ -0,0 +1,94 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the GLX_SGIX_swap_barrier extension. + * + *

This extension provides the capability to sychronize the buffer swaps of different swap groups.

+ * + *

Requires {@link GLXSGIXSwapGroup GLX_SGIX_swap_group}.

+ */ +public class GLXSGIXSwapBarrier { + + protected GLXSGIXSwapBarrier() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLXCapabilities caps) { + return checkFunctions( + caps.glXBindSwapBarrierSGIX, caps.glXQueryMaxSwapBarriersSGIX + ); + } + + // --- [ glXBindSwapBarrierSGIX ] --- + + /** + * Binds the swap group that contains {@code drawable} to {@code barrier}. Subsequent buffer swaps for that group will be subject to this binding, until + * the group is unbound from {@code barrier}. If {@code barrier} is zero, the group is unbound from its current barrier, if any. + * + * @param display the connection to the X server + * @param drawable the swap group GLXDrawable + * @param barrier the swap barrier + */ + public static void glXBindSwapBarrierSGIX(@NativeType("Display *") long display, @NativeType("GLXDrawable") long drawable, int barrier) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXBindSwapBarrierSGIX; + if (CHECKS) { + check(__functionAddress); + check(display); + check(drawable); + } + callPPV(display, drawable, barrier, __functionAddress); + } + + // --- [ glXQueryMaxSwapBarriersSGIX ] --- + + /** Unsafe version of: {@link #glXQueryMaxSwapBarriersSGIX QueryMaxSwapBarriersSGIX} */ + public static int nglXQueryMaxSwapBarriersSGIX(long display, int screen, long max) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXQueryMaxSwapBarriersSGIX; + if (CHECKS) { + check(__functionAddress); + check(display); + } + return callPPI(display, screen, max, __functionAddress); + } + + /** + * Returns in {@code max} the maximum number of barriers supported by an implementation on {@code screen}. + * + * @param display the connection to the X server + * @param screen the screen + * @param max returns the maximum number of barriers + */ + @NativeType("Bool") + public static boolean glXQueryMaxSwapBarriersSGIX(@NativeType("Display *") long display, int screen, @NativeType("int *") IntBuffer max) { + if (CHECKS) { + check(max, 1); + } + return nglXQueryMaxSwapBarriersSGIX(display, screen, memAddress(max)) != 0; + } + + /** Array version of: {@link #glXQueryMaxSwapBarriersSGIX QueryMaxSwapBarriersSGIX} */ + @NativeType("Bool") + public static boolean glXQueryMaxSwapBarriersSGIX(@NativeType("Display *") long display, int screen, @NativeType("int *") int[] max) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXQueryMaxSwapBarriersSGIX; + if (CHECKS) { + check(__functionAddress); + check(display); + check(max, 1); + } + return callPPI(display, screen, max, __functionAddress) != 0; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIXSwapGroup.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIXSwapGroup.java new file mode 100644 index 00000000..b7978b51 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXSGIXSwapGroup.java @@ -0,0 +1,54 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; + +/** + * Native bindings to the GLX_SGIX_swap_group extension. + * + *

This extension provides the capability to synchronize the buffer swaps of a group of GLX drawables. A swap group is created, and drawables are added as + * members to the swap group. Buffer swaps to members of the swap group will then take place concurrently.

+ * + *

This extension extends the set of conditions that must be met before a buffer swap can take place.

+ */ +public class GLXSGIXSwapGroup { + + protected GLXSGIXSwapGroup() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLXCapabilities caps) { + return checkFunctions( + caps.glXJoinSwapGroupSGIX + ); + } + + // --- [ glXJoinSwapGroupSGIX ] --- + + /** + * Adds {@code drawable} to the swap group containing {@code member} as a member. If {@code drawable} is already a member of a different group, it is + * implicitly removed from that group first. If {@code member} is {@code None}, {@code drawable} is removed from the swap group that it belongs to, if + * any. + * + * @param display the connection to the X server + * @param drawable the GLXDrawable to add to the swap group + * @param member a member of the swap group or {@code None} + */ + public static void glXJoinSwapGroupSGIX(@NativeType("Display *") long display, @NativeType("GLXDrawable") long drawable, @NativeType("GLXDrawable") long member) { + long __functionAddress = GL.getCapabilitiesGLXClient().glXJoinSwapGroupSGIX; + if (CHECKS) { + check(__functionAddress); + check(display); + check(drawable); + } + callPPPV(display, drawable, member, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXStereoNotifyEventEXT.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXStereoNotifyEventEXT.java new file mode 100644 index 00000000..ef356e2b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GLXStereoNotifyEventEXT.java @@ -0,0 +1,233 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Member documentation

+ * + *
    + *
  • {@code type} – GenericEvent
  • + *
  • {@code serial} – \# of last request server processed
  • + *
  • {@code send_event} – {@code True} if generated by {@code SendEvent} request
  • + *
  • {@code display} – display the event was read from
  • + *
  • {@code extension} – GLX major opcode, from {@code XQueryExtension}
  • + *
  • {@code evtype} – always {@code GLX_STEREO_NOTIFY_EXT}
  • + *
  • {@code window} – XID of the X window affected
  • + *
  • {@code stereo_tree} – {@code True} if tree contains stereo windows
  • + *
+ * + *

Layout

+ * + *

+ * struct GLXStereoNotifyEventEXT {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     int extension;
+ *     int evtype;
+ *     GLXDrawable window;
+ *     Bool stereo_tree;
+ * }
+ */ +public class GLXStereoNotifyEventEXT extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + EXTENSION, + EVTYPE, + WINDOW, + STEREO_TREE; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(4), + __member(4), + __member(POINTER_SIZE), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + EXTENSION = layout.offsetof(4); + EVTYPE = layout.offsetof(5); + WINDOW = layout.offsetof(6); + STEREO_TREE = layout.offsetof(7); + } + + /** + * Creates a {@code GLXStereoNotifyEventEXT} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public GLXStereoNotifyEventEXT(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code extension} field. */ + public int extension() { return nextension(address()); } + /** Returns the value of the {@code evtype} field. */ + public int evtype() { return nevtype(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("GLXDrawable") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code stereo_tree} field. */ + @NativeType("Bool") + public boolean stereo_tree() { return nstereo_tree(address()) != 0; } + + // ----------------------------------- + + /** Returns a new {@code GLXStereoNotifyEventEXT} instance for the specified memory address. */ + public static GLXStereoNotifyEventEXT create(long address) { + return wrap(GLXStereoNotifyEventEXT.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static GLXStereoNotifyEventEXT createSafe(long address) { + return address == NULL ? null : wrap(GLXStereoNotifyEventEXT.class, address); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + GLXStereoNotifyEventEXT.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + GLXStereoNotifyEventEXT.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + GLXStereoNotifyEventEXT.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + GLXStereoNotifyEventEXT.DISPLAY); } + /** Unsafe version of {@link #extension}. */ + public static int nextension(long struct) { return UNSAFE.getInt(null, struct + GLXStereoNotifyEventEXT.EXTENSION); } + /** Unsafe version of {@link #evtype}. */ + public static int nevtype(long struct) { return UNSAFE.getInt(null, struct + GLXStereoNotifyEventEXT.EVTYPE); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetAddress(struct + GLXStereoNotifyEventEXT.WINDOW); } + /** Unsafe version of {@link #stereo_tree}. */ + public static int nstereo_tree(long struct) { return UNSAFE.getInt(null, struct + GLXStereoNotifyEventEXT.STEREO_TREE); } + + // ----------------------------------- + + /** An array of {@link GLXStereoNotifyEventEXT} structs. */ + public static class Buffer extends StructBuffer { + + private static final GLXStereoNotifyEventEXT ELEMENT_FACTORY = GLXStereoNotifyEventEXT.create(-1L); + + /** + * Creates a new {@code GLXStereoNotifyEventEXT.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link GLXStereoNotifyEventEXT#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected GLXStereoNotifyEventEXT getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return GLXStereoNotifyEventEXT.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return GLXStereoNotifyEventEXT.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return GLXStereoNotifyEventEXT.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return GLXStereoNotifyEventEXT.ndisplay(address()); } + /** Returns the value of the {@code extension} field. */ + public int extension() { return GLXStereoNotifyEventEXT.nextension(address()); } + /** Returns the value of the {@code evtype} field. */ + public int evtype() { return GLXStereoNotifyEventEXT.nevtype(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("GLXDrawable") + public long window() { return GLXStereoNotifyEventEXT.nwindow(address()); } + /** Returns the value of the {@code stereo_tree} field. */ + @NativeType("Bool") + public boolean stereo_tree() { return GLXStereoNotifyEventEXT.nstereo_tree(address()) != 0; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GPU_DEVICE.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GPU_DEVICE.java new file mode 100644 index 00000000..7f7e9f3d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GPU_DEVICE.java @@ -0,0 +1,339 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +import org.lwjgl.system.windows.*; + +/** + * Receives information about the display device specified by the {@code deviceIndex} parameter of the {@link WGLNVGPUAffinity#wglEnumGpuDevicesNV EnumGpuDevicesNV} function. + * + *

Member documentation

+ * + *
    + *
  • {@code cb} – + * the size of the {@code GPU_DEVICE} structure. Before calling {@link WGLNVGPUAffinity#wglEnumGpuDevicesNV EnumGpuDevicesNV}, set {@code cb} to the size, in bytes, of {@code GPU_DEVICE}.
  • + *
  • {@code DeviceName[32]} – + * a string identifying the display device name. This will be the same string as stored in the {@code DeviceName} field of the {@code DISPLAY_DEVICE} + * structure, which is filled in by {@code EnumDisplayDevices}.
  • + *
  • {@code DeviceString[128]} – + * a string describing the GPU for this display device. It is the same string as stored in the {@code DeviceString} field in the {@code DISPLAY_DEVICE} + * structure that is filled in by {@code EnumDisplayDevices} when it describes a display adapter (and not a monitor).
  • + *
  • {@code Flags} – indicates the state of the display device
  • + *
  • {@code rcVirtualScreen} – + * specifies the display device rectangle, in virtual screen coordinates. The value of {@code rcVirtualScreen} is undefined if the device is not part of + * the desktop, i.e. {@code DISPLAY_DEVICE_ATTACHED_TO_DESKTOP} is not set in the {@code Flags} field.
  • + *
+ * + *

Layout

+ * + *

+ * struct GPU_DEVICE {
+ *     DWORD cb;
+ *     CHAR DeviceName[32];
+ *     CHAR DeviceString[128];
+ *     DWORD Flags;
+ *     {@link RECT RECT} rcVirtualScreen;
+ * }
+ */ +public class GPU_DEVICE extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + CB, + DEVICENAME, + DEVICESTRING, + FLAGS, + RCVIRTUALSCREEN; + + static { + Layout layout = __struct( + __member(4), + __array(1, 32), + __array(1, 128), + __member(4), + __member(RECT.SIZEOF, RECT.ALIGNOF) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + CB = layout.offsetof(0); + DEVICENAME = layout.offsetof(1); + DEVICESTRING = layout.offsetof(2); + FLAGS = layout.offsetof(3); + RCVIRTUALSCREEN = layout.offsetof(4); + } + + /** + * Creates a {@code GPU_DEVICE} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public GPU_DEVICE(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code cb} field. */ + @NativeType("DWORD") + public int cb() { return ncb(address()); } + /** Returns a {@link ByteBuffer} view of the {@code DeviceName} field. */ + @NativeType("CHAR[32]") + public ByteBuffer DeviceName() { return nDeviceName(address()); } + /** Decodes the null-terminated string stored in the {@code DeviceName} field. */ + @NativeType("CHAR[32]") + public String DeviceNameString() { return nDeviceNameString(address()); } + /** Returns a {@link ByteBuffer} view of the {@code DeviceString} field. */ + @NativeType("CHAR[128]") + public ByteBuffer DeviceString() { return nDeviceString(address()); } + /** Decodes the null-terminated string stored in the {@code DeviceString} field. */ + @NativeType("CHAR[128]") + public String DeviceStringString() { return nDeviceStringString(address()); } + /** Returns the value of the {@code Flags} field. */ + @NativeType("DWORD") + public int Flags() { return nFlags(address()); } + /** Returns a {@link RECT} view of the {@code rcVirtualScreen} field. */ + public RECT rcVirtualScreen() { return nrcVirtualScreen(address()); } + + // ----------------------------------- + + /** Returns a new {@code GPU_DEVICE} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static GPU_DEVICE malloc() { + return wrap(GPU_DEVICE.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code GPU_DEVICE} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static GPU_DEVICE calloc() { + return wrap(GPU_DEVICE.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code GPU_DEVICE} instance allocated with {@link BufferUtils}. */ + public static GPU_DEVICE create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(GPU_DEVICE.class, memAddress(container), container); + } + + /** Returns a new {@code GPU_DEVICE} instance for the specified memory address. */ + public static GPU_DEVICE create(long address) { + return wrap(GPU_DEVICE.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static GPU_DEVICE createSafe(long address) { + return address == NULL ? null : wrap(GPU_DEVICE.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code GPU_DEVICE} instance allocated on the thread-local {@link MemoryStack}. */ + public static GPU_DEVICE mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code GPU_DEVICE} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static GPU_DEVICE callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code GPU_DEVICE} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static GPU_DEVICE mallocStack(MemoryStack stack) { + return wrap(GPU_DEVICE.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code GPU_DEVICE} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static GPU_DEVICE callocStack(MemoryStack stack) { + return wrap(GPU_DEVICE.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #cb}. */ + public static int ncb(long struct) { return UNSAFE.getInt(null, struct + GPU_DEVICE.CB); } + /** Unsafe version of {@link #DeviceName}. */ + public static ByteBuffer nDeviceName(long struct) { return memByteBuffer(struct + GPU_DEVICE.DEVICENAME, 32); } + /** Unsafe version of {@link #DeviceNameString}. */ + public static String nDeviceNameString(long struct) { return memASCII(struct + GPU_DEVICE.DEVICENAME); } + /** Unsafe version of {@link #DeviceString}. */ + public static ByteBuffer nDeviceString(long struct) { return memByteBuffer(struct + GPU_DEVICE.DEVICESTRING, 128); } + /** Unsafe version of {@link #DeviceStringString}. */ + public static String nDeviceStringString(long struct) { return memASCII(struct + GPU_DEVICE.DEVICESTRING); } + /** Unsafe version of {@link #Flags}. */ + public static int nFlags(long struct) { return UNSAFE.getInt(null, struct + GPU_DEVICE.FLAGS); } + /** Unsafe version of {@link #rcVirtualScreen}. */ + public static RECT nrcVirtualScreen(long struct) { return RECT.create(struct + GPU_DEVICE.RCVIRTUALSCREEN); } + + // ----------------------------------- + + /** An array of {@link GPU_DEVICE} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final GPU_DEVICE ELEMENT_FACTORY = GPU_DEVICE.create(-1L); + + /** + * Creates a new {@code GPU_DEVICE.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link GPU_DEVICE#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected GPU_DEVICE getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code cb} field. */ + @NativeType("DWORD") + public int cb() { return GPU_DEVICE.ncb(address()); } + /** Returns a {@link ByteBuffer} view of the {@code DeviceName} field. */ + @NativeType("CHAR[32]") + public ByteBuffer DeviceName() { return GPU_DEVICE.nDeviceName(address()); } + /** Decodes the null-terminated string stored in the {@code DeviceName} field. */ + @NativeType("CHAR[32]") + public String DeviceNameString() { return GPU_DEVICE.nDeviceNameString(address()); } + /** Returns a {@link ByteBuffer} view of the {@code DeviceString} field. */ + @NativeType("CHAR[128]") + public ByteBuffer DeviceString() { return GPU_DEVICE.nDeviceString(address()); } + /** Decodes the null-terminated string stored in the {@code DeviceString} field. */ + @NativeType("CHAR[128]") + public String DeviceStringString() { return GPU_DEVICE.nDeviceStringString(address()); } + /** Returns the value of the {@code Flags} field. */ + @NativeType("DWORD") + public int Flags() { return GPU_DEVICE.nFlags(address()); } + /** Returns a {@link RECT} view of the {@code rcVirtualScreen} field. */ + public RECT rcVirtualScreen() { return GPU_DEVICE.nrcVirtualScreen(address()); } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GREMEDYFrameTerminator.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GREMEDYFrameTerminator.java new file mode 100644 index 00000000..14bd4001 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GREMEDYFrameTerminator.java @@ -0,0 +1,51 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the GREMEDY_frame_terminator extension. + * + *

This extension defines a mechanism that enables marking the end of render frames within the OpenGL stream.

+ * + *

When debugging or profiling an OpenGL application, the debuggers and profilers needs to know when a render frame is ended. This is important for frame + * per second measurements, statistical analysis, marking and clearing stream loggers logs, performance counters sampling and more.

+ * + *

When an application uses off screen buffers, the debugger / profiler cannot be guaranteed that the application will call a certain function at the end + * of each off-screen frame (e.g: SwapBuffers / glClear / etc). This extension enables the application to notify the debugger / profiler whenever a render + * frame is ended.

+ * + *

This extension is mainly useful for debuggers and profilers. It is not expected that standard drivers would implement this extension. The main point of + * having this extension is to allow applications to have a clean way of accessing this functionality only when they are run under the control of a + * debugger / profiler, without having to recompile or change the application source code.

+ */ +public class GREMEDYFrameTerminator { + + static { GL.initialize(); } + + protected GREMEDYFrameTerminator() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glFrameTerminatorGREMEDY + ); + } + + // --- [ glFrameTerminatorGREMEDY ] --- + + /** + * Can be used to insert a frame terminator marker into the command stream. This frame terminator marker can be used by appropriate debugging tools / + * profiling tools / profiling drivers for frame per second measurements, statistical analysis, marking and clearing stream loggers logs, performance + * counters sampling and more. This command has no influence on the rendered image or the OpenGL state. + */ + public static native void glFrameTerminatorGREMEDY(); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GREMEDYStringMarker.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GREMEDYStringMarker.java new file mode 100644 index 00000000..38c4d9ee --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/GREMEDYStringMarker.java @@ -0,0 +1,83 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the GREMEDY_string_marker extension. + * + *

This extension defines a mechanism to insert textual markers into the OpenGL stream.

+ * + *

When debugging or profiling an OpenGL application some of the most important tools are stream loggers, which just output a list of the called OpenGL + * commands, and profilers, which show at which points the pipeline is bottlenecked for a given part of the frame. The problem in using these is that + * there is a definite loss of information between the application and the used debugger/profiler. The application generally has a pretty good idea what + * is rendered when (e.g. rendering background, landscape, building, players, particle effects, bullets etc.), but the debugger/profiler only sees the + * OpenGL stream. To analyze the stream developers have to guess what is done when by following the program code and the log output in parallel, which can + * get difficult for systems that restructure their internal pipeline or do lazy changes.

+ * + *

This extension is really only useful for these debuggers and profilers, and not for actual drivers. In fact, it is not expected that any standard + * driver would ever implement this extension. The main point of having this extension is to allow applications to have a clean way of accessing this + * functionality only when they are run under the control of a debugger/profiler, without having to recompile or change the application source code.

+ */ +public class GREMEDYStringMarker { + + static { GL.initialize(); } + + protected GREMEDYStringMarker() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glStringMarkerGREMEDY + ); + } + + // --- [ glStringMarkerGREMEDY ] --- + + /** + * Unsafe version of: {@link #glStringMarkerGREMEDY StringMarkerGREMEDY} + * + * @param len the length of the array. If {@code string} is null-terminated, {@code len} should not include the terminator. If {@code len} is 0, then the string + * is assumed to be null-terminated. + */ + public static native void nglStringMarkerGREMEDY(int len, long string); + + /** + * Can be used to insert arbitrary marker strings into the command stream that can be recorded by appropriate debugging tools / profiling tools / drivers. + * They have no influence on the rendered image or the OpenGL state. + * + * @param string a pointer to the array of bytes representing the marker being inserted, which need not be null-terminated + */ + public static void glStringMarkerGREMEDY(@NativeType("GLchar const *") ByteBuffer string) { + nglStringMarkerGREMEDY(string.remaining(), memAddress(string)); + } + + /** + * Can be used to insert arbitrary marker strings into the command stream that can be recorded by appropriate debugging tools / profiling tools / drivers. + * They have no influence on the rendered image or the OpenGL state. + * + * @param string a pointer to the array of bytes representing the marker being inserted, which need not be null-terminated + */ + public static void glStringMarkerGREMEDY(@NativeType("GLchar const *") CharSequence string) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + int stringEncodedLength = stack.nUTF8(string, false); + long stringEncoded = stack.getPointerAddress(); + nglStringMarkerGREMEDY(stringEncodedLength, stringEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/INTELBlackholeRender.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/INTELBlackholeRender.java new file mode 100644 index 00000000..963fb2e5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/INTELBlackholeRender.java @@ -0,0 +1,28 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the INTEL_blackhole_render extension. + * + *

The purpose of this extension is to allow an application to disable all rendering operations emitted to the GPU through the OpenGL rendering commands + * ({@code Draw*}, {@code DispatchCompute*}, {@code BlitFramebuffer}, etc...). Changes to the OpenGL pipeline are not affected.

+ * + *

New preprocessor {@code #defines} are added to the OpenGL Shading Language:

+ * + *

+ * #define GL_INTEL_blackhole_render 1
+ * + *

Requires {@link GL30 OpenGL 3.0}.

+ */ +public final class INTELBlackholeRender { + + /** Accepted by the {@code target} parameter of Enable, Disable, IsEnabled. */ + public static final int GL_BLACKHOLE_RENDER_INTEL = 0x83FC; + + private INTELBlackholeRender() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/INTELConservativeRasterization.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/INTELConservativeRasterization.java new file mode 100644 index 00000000..467e757c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/INTELConservativeRasterization.java @@ -0,0 +1,31 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the INTEL_conservative_rasterization extension. + * + *

Regular rasterization includes fragments with at least one sample covered by a polygon. Conservative rasterization includes all fragments that are at + * least partially covered by the polygon.

+ * + *

In some use cases, it is also important to know if a fragment is fully covered by a polygon, i.e. if all parts of the fragment are within the polygon. + * An application may, for example, want to process fully covered fragments different from the "edge" pixels. This extension adds an option for the + * fragment shader to receive this information via {@code gl_SampleMaskIn[]}.

+ * + *

This extension affects only polygons in {@link GL11#GL_FILL FILL} mode and specifically does not imply any changes in processing of lines or points.

+ * + *

Conservative rasterization automatically disables polygon antialiasing rasterization if enabled by {@link GL11#GL_POLYGON_SMOOTH POLYGON_SMOOTH}.

+ * + *

Requires {@link GL42 OpenGL 4.2}.

+ */ +public final class INTELConservativeRasterization { + + /** Accepted by the {@code target} parameter of {@link GL11#glEnable Enable}, {@link GL11#glDisable Disable}, {@link GL11#glIsEnabled IsEnabled}. */ + public static final int GL_CONSERVATIVE_RASTERIZATION_INTEL = 0x83FE; + + private INTELConservativeRasterization() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/INTELFramebufferCMAA.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/INTELFramebufferCMAA.java new file mode 100644 index 00000000..f4c3558c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/INTELFramebufferCMAA.java @@ -0,0 +1,51 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the INTEL_framebuffer_CMAA extension. + * + *

Multisampling is a mechanism to antialias all GL primitives and is part of the GL specification.

+ * + *

Better visual quality can be achieved by applying multisampling. However, on certain platforms it comes at a high performance cost. In general, the + * greater number of samples per pixel, the bigger the cost.

+ * + *

Conservative Morphological Anti-Aliasing (CMAA) is an alternative approach to antialiasing, which operates on the final image. This post processing + * technique results in image quality comparable to multisampling at much lower cost and better performance.

+ * + *

This extension incorporates an optimized CMAA algorithm implementation into the GL implementation.

+ * + *

For more information on CMAA refer to software.intel.com.

+ * + *

Requires {@link GL30 OpenGL 3.0}.

+ */ +public class INTELFramebufferCMAA { + + static { GL.initialize(); } + + protected INTELFramebufferCMAA() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glApplyFramebufferAttachmentCMAAINTEL + ); + } + + // --- [ glApplyFramebufferAttachmentCMAAINTEL ] --- + + /** + * Requests the post processing of current draw buffers pertaining to the framebuffer bound to the {@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER} target according to the + * Conservative Morphological Anti-Aliasing algorithm. + */ + public static native void glApplyFramebufferAttachmentCMAAINTEL(); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/INTELMapTexture.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/INTELMapTexture.java new file mode 100644 index 00000000..e74f02a6 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/INTELMapTexture.java @@ -0,0 +1,209 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the INTEL_map_texture extension. + * + *

Systems with integrated GPUs can share the same physical memory between CPU and GPU. This feature, if exposed by API, can bring significant performance + * benefits for graphics applications by reducing the complexity of uploading/accessing texture contents. This extension enables CPU direct access to the + * GPU memory holding textures.

+ * + *

The problem with texture memory directly exposed to clients is that textures are often 'tiled'. Texels are kept in specific layout to improve locality + * of reference and thus performance of texturing. This 'tiling' is specific to particular hardware and would be thus difficult to use.

+ * + *

This extension allows to create textures with 'linear' layout which allows for simplified access on user side (potentially sacrificing some performance + * during texture sampling).

+ * + *

Requires {@link GL30 OpenGL 3.0}.

+ */ +public class INTELMapTexture { + + /** Accepted by the {@code pname} parameter of TexParameteri, for target TEXTURE_2D. */ + public static final int GL_TEXTURE_MEMORY_LAYOUT_INTEL = 0x83FF; + + /** Accepted by the {@code params} when {@code pname} is set to {@code TEXTURE_MEMORY_LAYOUT_INTEL}. */ + public static final int + GL_LAYOUT_DEFAULT_INTEL = 0, + GL_LAYOUT_LINEAR_INTEL = 1, + GL_LAYOUT_LINEAR_CPU_CACHED_INTEL = 2; + + static { GL.initialize(); } + + protected INTELMapTexture() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glSyncTextureINTEL, caps.glUnmapTexture2DINTEL, caps.glMapTexture2DINTEL + ); + } + + // --- [ glSyncTextureINTEL ] --- + + /** + * Makes sure that changes made by CPU are visible to GPU by flushing texture cache in GPU. The GL implementation tracks the cache usage and ignores the + * command if such flush is not needed. + * + *

It is worth noting that this extension does not address automatic synchronization between CPU and GPU when both entities operate on the same texture at + * the same time. This is up to the application to assure such synchronization. Otherwise, the results may not be deterministic (writes from different + * entities may interleave in a non-deterministic way).

+ * + * @param texture the texture to synchronize + */ + public static native void glSyncTextureINTEL(@NativeType("GLuint") int texture); + + // --- [ glUnmapTexture2DINTEL ] --- + + /** + * Releases the pointer obtained previously via {@link #glMapTexture2DINTEL MapTexture2DINTEL}. This means that virtual memory space dedicated to make the texture available via a + * pointer is released and an application can no longer assume this memory is accessible from CPU. Successful execution of this command has an additional + * effect as if {@link #glSyncTextureINTEL SyncTextureINTEL} was called with {@code texture} parameter. + * + * @param texture the texture to unmap + * @param level the mipmap level-of-detail of the texture + */ + public static native void glUnmapTexture2DINTEL(@NativeType("GLuint") int texture, @NativeType("GLint") int level); + + // --- [ glMapTexture2DINTEL ] --- + + /** Unsafe version of: {@link #glMapTexture2DINTEL MapTexture2DINTEL} */ + public static native long nglMapTexture2DINTEL(int texture, int level, int access, long stride, long layout); + + /** + * Attempts to return a direct pointer to the graphics storage for 2D texture indicated by the {@code texture} parameter. + * + *

LWJGL note: If glMapTexture2DINTEL without an explicit length argument is used and direct-state-access functionality is not available in the + * current context, the texture object must currently be bound to the GL_TEXTURE_2D target.

+ * + * @param texture the texture to map + * @param level the mipmap level-of-detail of the texture + * @param access the type of access that will be performed by the application. One of:
{@link GL30#GL_MAP_READ_BIT MAP_READ_BIT}{@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}
+ * @param stride returns the distance in bytes between subsequent rows in the texture + * @param layout returns the internal layout of the texture in the graphics memory + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapTexture2DINTEL(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLbitfield") int access, @NativeType("GLint *") IntBuffer stride, @NativeType("GLenum *") IntBuffer layout) { + if (CHECKS) { + check(stride, 1); + check(layout, 1); + } + long __result = nglMapTexture2DINTEL(texture, level, access, memAddress(stride), memAddress(layout)); + return memByteBufferSafe(__result, getStride(stride) * GLChecks.getTexLevelParameteri(texture, GL11.GL_TEXTURE_2D, level, GL11.GL_TEXTURE_HEIGHT)); + } + + /** + * Attempts to return a direct pointer to the graphics storage for 2D texture indicated by the {@code texture} parameter. + * + *

LWJGL note: If glMapTexture2DINTEL without an explicit length argument is used and direct-state-access functionality is not available in the + * current context, the texture object must currently be bound to the GL_TEXTURE_2D target.

+ * + * @param texture the texture to map + * @param level the mipmap level-of-detail of the texture + * @param access the type of access that will be performed by the application. One of:
{@link GL30#GL_MAP_READ_BIT MAP_READ_BIT}{@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}
+ * @param stride returns the distance in bytes between subsequent rows in the texture + * @param layout returns the internal layout of the texture in the graphics memory + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapTexture2DINTEL(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLbitfield") int access, @NativeType("GLint *") IntBuffer stride, @NativeType("GLenum *") IntBuffer layout, @Nullable ByteBuffer old_buffer) { + if (CHECKS) { + check(stride, 1); + check(layout, 1); + } + long __result = nglMapTexture2DINTEL(texture, level, access, memAddress(stride), memAddress(layout)); + int length = getStride(stride) * GLChecks.getTexLevelParameteri(texture, GL11.GL_TEXTURE_2D, level, GL11.GL_TEXTURE_HEIGHT); + return apiGetMappedBuffer(old_buffer, __result, length); + } + + /** + * Attempts to return a direct pointer to the graphics storage for 2D texture indicated by the {@code texture} parameter. + * + *

LWJGL note: If glMapTexture2DINTEL without an explicit length argument is used and direct-state-access functionality is not available in the + * current context, the texture object must currently be bound to the GL_TEXTURE_2D target.

+ * + * @param texture the texture to map + * @param level the mipmap level-of-detail of the texture + * @param access the type of access that will be performed by the application. One of:
{@link GL30#GL_MAP_READ_BIT MAP_READ_BIT}{@link GL30#GL_MAP_WRITE_BIT MAP_WRITE_BIT}
+ * @param stride returns the distance in bytes between subsequent rows in the texture + * @param layout returns the internal layout of the texture in the graphics memory + */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapTexture2DINTEL(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLbitfield") int access, @NativeType("GLint *") IntBuffer stride, @NativeType("GLenum *") IntBuffer layout, long length, @Nullable ByteBuffer old_buffer) { + if (CHECKS) { + check(stride, 1); + check(layout, 1); + } + long __result = nglMapTexture2DINTEL(texture, level, access, memAddress(stride), memAddress(layout)); + return apiGetMappedBuffer(old_buffer, __result, (int)length); + } + + /** Array version of: {@link #glMapTexture2DINTEL MapTexture2DINTEL} */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapTexture2DINTEL(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLbitfield") int access, @NativeType("GLint *") int[] stride, @NativeType("GLenum *") int[] layout) { + long __functionAddress = GL.getICD().glMapTexture2DINTEL; + if (CHECKS) { + check(__functionAddress); + check(stride, 1); + check(layout, 1); + } + long __result = callPPP(texture, level, access, stride, layout, __functionAddress); + return memByteBufferSafe(__result, getStride(stride) * GLChecks.getTexLevelParameteri(texture, GL11.GL_TEXTURE_2D, level, GL11.GL_TEXTURE_HEIGHT)); + } + + /** Array version of: {@link #glMapTexture2DINTEL MapTexture2DINTEL} */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapTexture2DINTEL(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLbitfield") int access, @NativeType("GLint *") int[] stride, @NativeType("GLenum *") int[] layout, @Nullable ByteBuffer old_buffer) { + long __functionAddress = GL.getICD().glMapTexture2DINTEL; + if (CHECKS) { + check(__functionAddress); + check(stride, 1); + check(layout, 1); + } + long __result = callPPP(texture, level, access, stride, layout, __functionAddress); + int length = getStride(stride) * GLChecks.getTexLevelParameteri(texture, GL11.GL_TEXTURE_2D, level, GL11.GL_TEXTURE_HEIGHT); + return apiGetMappedBuffer(old_buffer, __result, length); + } + + /** Array version of: {@link #glMapTexture2DINTEL MapTexture2DINTEL} */ + @Nullable + @NativeType("void *") + public static ByteBuffer glMapTexture2DINTEL(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLbitfield") int access, @NativeType("GLint *") int[] stride, @NativeType("GLenum *") int[] layout, long length, @Nullable ByteBuffer old_buffer) { + long __functionAddress = GL.getICD().glMapTexture2DINTEL; + if (CHECKS) { + check(__functionAddress); + check(stride, 1); + check(layout, 1); + } + long __result = callPPP(texture, level, access, stride, layout, __functionAddress); + return apiGetMappedBuffer(old_buffer, __result, (int)length); + } + + private static int getStride(IntBuffer stride) { + return stride.get(stride.position()); + } + + private static int getStride(int[] stride) { + return stride[0]; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/INTELPerformanceQuery.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/INTELPerformanceQuery.java new file mode 100644 index 00000000..25f9abf6 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/INTELPerformanceQuery.java @@ -0,0 +1,355 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the INTEL_performance_query extension. + * + *

The purpose of this extension is to expose Intel proprietary hardware performance counters to the OpenGL applications. Performance counters may count:

+ * + *
    + *
  • number of hardware events such as number of spawned vertex shaders. In this case the results represent the number of events.
  • + *
  • duration of certain activity, like time took by all fragment shader invocations. In that case the result usually represents the number of clocks in + * which the particular HW unit was busy. In order to use such counter efficiently, it should be normalized to the range of <0,1> by dividing + * its value by the number of render clocks.
  • + *
  • used throughput of certain memory types such as texture memory. In that case the result of performance counter usually represents the number of + * bytes transferred between GPU and memory.
  • + *
+ * + *

This extension specifies universal API to manage performance counters on different Intel hardware platforms. Performance counters are grouped together + * into proprietary, hardware-specific, fixed sets of counters that are measured together by the GPU.

+ * + *

It is assumed that performance counters are started and ended on any arbitrary boundaries during rendering.

+ * + *

A set of performance counters is represented by a unique query type. Each query type is identified by assigned name and ID. Multiple query types (sets + * of performance counters) are supported by the Intel hardware. However each Intel hardware generation supports different sets of performance counters. + * Therefore the query types between hardware generations can be different. The definition of query types and their results structures can be learned + * through the API. It is also documented in a separate document of Intel OGL Performance Counters Specification issued per each new hardware generation.

+ * + *

The API allows to create multiple instances of any query type and to sample different fragments of 3D rendering with such instances. Query instances + * are identified with handles.

+ * + *

Requires {@link GL30 OpenGL 3.0}.

+ */ +public class INTELPerformanceQuery { + + /** Returned by the capsMask parameter of GetPerfQueryInfoINTEL. */ + public static final int + GL_PERFQUERY_SINGLE_CONTEXT_INTEL = 0x0, + GL_PERFQUERY_GLOBAL_CONTEXT_INTEL = 0x1; + + /** Accepted by the flags parameter of GetPerfQueryDataINTEL. */ + public static final int + GL_PERFQUERY_WAIT_INTEL = 0x83FB, + GL_PERFQUERY_FLUSH_INTEL = 0x83FA, + GL_PERFQUERY_DONOT_FLUSH_INTEL = 0x83F9; + + /** Returned by GetPerfCounterInfoINTEL function as counter type enumeration in location pointed by counterTypeEnum. */ + public static final int + GL_PERFQUERY_COUNTER_EVENT_INTEL = 0x94F0, + GL_PERFQUERY_COUNTER_DURATION_NORM_INTEL = 0x94F1, + GL_PERFQUERY_COUNTER_DURATION_RAW_INTEL = 0x94F2, + GL_PERFQUERY_COUNTER_THROUGHPUT_INTEL = 0x94F3, + GL_PERFQUERY_COUNTER_RAW_INTEL = 0x94F4, + GL_PERFQUERY_COUNTER_TIMESTAMP_INTEL = 0x94F5; + + /** Returned by glGetPerfCounterInfoINTEL function as counter data type enumeration in location pointed by counterDataTypeEnum. */ + public static final int + GL_PERFQUERY_COUNTER_DATA_UINT32_INTEL = 0x94F8, + GL_PERFQUERY_COUNTER_DATA_UINT64_INTEL = 0x94F9, + GL_PERFQUERY_COUNTER_DATA_FLOAT_INTEL = 0x94FA, + GL_PERFQUERY_COUNTER_DATA_DOUBLE_INTEL = 0x94FB, + GL_PERFQUERY_COUNTER_DATA_BOOL32_INTEL = 0x94FC; + + /** Accepted by the {@code pname} parameter of GetIntegerv. */ + public static final int + GL_PERFQUERY_QUERY_NAME_LENGTH_MAX_INTEL = 0x94FD, + GL_PERFQUERY_COUNTER_NAME_LENGTH_MAX_INTEL = 0x94FE, + GL_PERFQUERY_COUNTER_DESC_LENGTH_MAX_INTEL = 0x94FF; + + /** Accepted by the {@code pname} parameter of GetBooleanv. */ + public static final int GL_PERFQUERY_GPA_EXTENDED_COUNTERS_INTEL = 0x9500; + + static { GL.initialize(); } + + protected INTELPerformanceQuery() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBeginPerfQueryINTEL, caps.glCreatePerfQueryINTEL, caps.glDeletePerfQueryINTEL, caps.glEndPerfQueryINTEL, caps.glGetFirstPerfQueryIdINTEL, + caps.glGetNextPerfQueryIdINTEL, caps.glGetPerfCounterInfoINTEL, caps.glGetPerfQueryDataINTEL, caps.glGetPerfQueryIdByNameINTEL, + caps.glGetPerfQueryInfoINTEL + ); + } + + // --- [ glBeginPerfQueryINTEL ] --- + + public static native void glBeginPerfQueryINTEL(@NativeType("GLuint") int queryHandle); + + // --- [ glCreatePerfQueryINTEL ] --- + + public static native void nglCreatePerfQueryINTEL(int queryId, long queryHandle); + + public static void glCreatePerfQueryINTEL(@NativeType("GLuint") int queryId, @NativeType("GLuint *") IntBuffer queryHandle) { + if (CHECKS) { + check(queryHandle, 1); + } + nglCreatePerfQueryINTEL(queryId, memAddress(queryHandle)); + } + + @NativeType("void") + public static int glCreatePerfQueryINTEL(@NativeType("GLuint") int queryId) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer queryHandle = stack.callocInt(1); + nglCreatePerfQueryINTEL(queryId, memAddress(queryHandle)); + return queryHandle.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glDeletePerfQueryINTEL ] --- + + public static native void glDeletePerfQueryINTEL(@NativeType("GLuint") int queryHandle); + + // --- [ glEndPerfQueryINTEL ] --- + + public static native void glEndPerfQueryINTEL(@NativeType("GLuint") int queryHandle); + + // --- [ glGetFirstPerfQueryIdINTEL ] --- + + public static native void nglGetFirstPerfQueryIdINTEL(long queryId); + + public static void glGetFirstPerfQueryIdINTEL(@NativeType("GLuint *") IntBuffer queryId) { + if (CHECKS) { + check(queryId, 1); + } + nglGetFirstPerfQueryIdINTEL(memAddress(queryId)); + } + + @NativeType("void") + public static int glGetFirstPerfQueryIdINTEL() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer queryId = stack.callocInt(1); + nglGetFirstPerfQueryIdINTEL(memAddress(queryId)); + return queryId.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetNextPerfQueryIdINTEL ] --- + + public static native void nglGetNextPerfQueryIdINTEL(int queryId, long nextQueryId); + + public static void glGetNextPerfQueryIdINTEL(@NativeType("GLuint") int queryId, @NativeType("GLuint *") IntBuffer nextQueryId) { + if (CHECKS) { + check(nextQueryId, 1); + } + nglGetNextPerfQueryIdINTEL(queryId, memAddress(nextQueryId)); + } + + @NativeType("void") + public static int glGetNextPerfQueryIdINTEL(@NativeType("GLuint") int queryId) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer nextQueryId = stack.callocInt(1); + nglGetNextPerfQueryIdINTEL(queryId, memAddress(nextQueryId)); + return nextQueryId.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetPerfCounterInfoINTEL ] --- + + public static native void nglGetPerfCounterInfoINTEL(int queryId, int counterId, int counterNameLength, long counterName, int counterDescLength, long counterDesc, long counterOffset, long counterDataSize, long counterTypeEnum, long counterDataTypeEnum, long rawCounterMaxValue); + + public static void glGetPerfCounterInfoINTEL(@NativeType("GLuint") int queryId, @NativeType("GLuint") int counterId, @NativeType("GLchar *") ByteBuffer counterName, @NativeType("GLchar *") ByteBuffer counterDesc, @NativeType("GLuint *") IntBuffer counterOffset, @NativeType("GLuint *") IntBuffer counterDataSize, @NativeType("GLuint *") IntBuffer counterTypeEnum, @NativeType("GLuint *") IntBuffer counterDataTypeEnum, @NativeType("GLuint64 *") LongBuffer rawCounterMaxValue) { + if (CHECKS) { + check(counterOffset, 1); + check(counterDataSize, 1); + check(counterTypeEnum, 1); + check(counterDataTypeEnum, 1); + check(rawCounterMaxValue, 1); + } + nglGetPerfCounterInfoINTEL(queryId, counterId, counterName.remaining(), memAddress(counterName), counterDesc.remaining(), memAddress(counterDesc), memAddress(counterOffset), memAddress(counterDataSize), memAddress(counterTypeEnum), memAddress(counterDataTypeEnum), memAddress(rawCounterMaxValue)); + } + + // --- [ glGetPerfQueryDataINTEL ] --- + + public static native void nglGetPerfQueryDataINTEL(int queryHandle, int flags, int dataSize, long data, long bytesWritten); + + public static void glGetPerfQueryDataINTEL(@NativeType("GLuint") int queryHandle, @NativeType("GLuint") int flags, @NativeType("void *") ByteBuffer data, @NativeType("GLuint *") IntBuffer bytesWritten) { + if (CHECKS) { + check(bytesWritten, 1); + } + nglGetPerfQueryDataINTEL(queryHandle, flags, data.remaining(), memAddress(data), memAddress(bytesWritten)); + } + + // --- [ glGetPerfQueryIdByNameINTEL ] --- + + public static native void nglGetPerfQueryIdByNameINTEL(long queryName, long queryId); + + public static void glGetPerfQueryIdByNameINTEL(@NativeType("GLchar *") ByteBuffer queryName, @NativeType("GLuint *") IntBuffer queryId) { + if (CHECKS) { + checkNT1(queryName); + check(queryId, 1); + } + nglGetPerfQueryIdByNameINTEL(memAddress(queryName), memAddress(queryId)); + } + + public static void glGetPerfQueryIdByNameINTEL(@NativeType("GLchar *") CharSequence queryName, @NativeType("GLuint *") IntBuffer queryId) { + if (CHECKS) { + check(queryId, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(queryName, true); + long queryNameEncoded = stack.getPointerAddress(); + nglGetPerfQueryIdByNameINTEL(queryNameEncoded, memAddress(queryId)); + } finally { + stack.setPointer(stackPointer); + } + } + + @NativeType("void") + public static int glGetPerfQueryIdByNameINTEL(@NativeType("GLchar *") CharSequence queryName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(queryName, true); + long queryNameEncoded = stack.getPointerAddress(); + IntBuffer queryId = stack.callocInt(1); + nglGetPerfQueryIdByNameINTEL(queryNameEncoded, memAddress(queryId)); + return queryId.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetPerfQueryInfoINTEL ] --- + + public static native void nglGetPerfQueryInfoINTEL(int queryId, int queryNameLength, long queryName, long dataSize, long noCounters, long noInstances, long capsMask); + + public static void glGetPerfQueryInfoINTEL(@NativeType("GLuint") int queryId, @NativeType("GLchar *") ByteBuffer queryName, @NativeType("GLuint *") IntBuffer dataSize, @NativeType("GLuint *") IntBuffer noCounters, @NativeType("GLuint *") IntBuffer noInstances, @NativeType("GLuint *") IntBuffer capsMask) { + if (CHECKS) { + check(dataSize, 1); + check(noCounters, 1); + check(noInstances, 1); + check(capsMask, 1); + } + nglGetPerfQueryInfoINTEL(queryId, queryName.remaining(), memAddress(queryName), memAddress(dataSize), memAddress(noCounters), memAddress(noInstances), memAddress(capsMask)); + } + + /** Array version of: {@link #glCreatePerfQueryINTEL CreatePerfQueryINTEL} */ + public static void glCreatePerfQueryINTEL(@NativeType("GLuint") int queryId, @NativeType("GLuint *") int[] queryHandle) { + long __functionAddress = GL.getICD().glCreatePerfQueryINTEL; + if (CHECKS) { + check(__functionAddress); + check(queryHandle, 1); + } + callPV(queryId, queryHandle, __functionAddress); + } + + /** Array version of: {@link #glGetFirstPerfQueryIdINTEL GetFirstPerfQueryIdINTEL} */ + public static void glGetFirstPerfQueryIdINTEL(@NativeType("GLuint *") int[] queryId) { + long __functionAddress = GL.getICD().glGetFirstPerfQueryIdINTEL; + if (CHECKS) { + check(__functionAddress); + check(queryId, 1); + } + callPV(queryId, __functionAddress); + } + + /** Array version of: {@link #glGetNextPerfQueryIdINTEL GetNextPerfQueryIdINTEL} */ + public static void glGetNextPerfQueryIdINTEL(@NativeType("GLuint") int queryId, @NativeType("GLuint *") int[] nextQueryId) { + long __functionAddress = GL.getICD().glGetNextPerfQueryIdINTEL; + if (CHECKS) { + check(__functionAddress); + check(nextQueryId, 1); + } + callPV(queryId, nextQueryId, __functionAddress); + } + + /** Array version of: {@link #glGetPerfCounterInfoINTEL GetPerfCounterInfoINTEL} */ + public static void glGetPerfCounterInfoINTEL(@NativeType("GLuint") int queryId, @NativeType("GLuint") int counterId, @NativeType("GLchar *") ByteBuffer counterName, @NativeType("GLchar *") ByteBuffer counterDesc, @NativeType("GLuint *") int[] counterOffset, @NativeType("GLuint *") int[] counterDataSize, @NativeType("GLuint *") int[] counterTypeEnum, @NativeType("GLuint *") int[] counterDataTypeEnum, @NativeType("GLuint64 *") long[] rawCounterMaxValue) { + long __functionAddress = GL.getICD().glGetPerfCounterInfoINTEL; + if (CHECKS) { + check(__functionAddress); + check(counterOffset, 1); + check(counterDataSize, 1); + check(counterTypeEnum, 1); + check(counterDataTypeEnum, 1); + check(rawCounterMaxValue, 1); + } + callPPPPPPPV(queryId, counterId, counterName.remaining(), memAddress(counterName), counterDesc.remaining(), memAddress(counterDesc), counterOffset, counterDataSize, counterTypeEnum, counterDataTypeEnum, rawCounterMaxValue, __functionAddress); + } + + /** Array version of: {@link #glGetPerfQueryDataINTEL GetPerfQueryDataINTEL} */ + public static void glGetPerfQueryDataINTEL(@NativeType("GLuint") int queryHandle, @NativeType("GLuint") int flags, @NativeType("void *") ByteBuffer data, @NativeType("GLuint *") int[] bytesWritten) { + long __functionAddress = GL.getICD().glGetPerfQueryDataINTEL; + if (CHECKS) { + check(__functionAddress); + check(bytesWritten, 1); + } + callPPV(queryHandle, flags, data.remaining(), memAddress(data), bytesWritten, __functionAddress); + } + + /** Array version of: {@link #glGetPerfQueryIdByNameINTEL GetPerfQueryIdByNameINTEL} */ + public static void glGetPerfQueryIdByNameINTEL(@NativeType("GLchar *") ByteBuffer queryName, @NativeType("GLuint *") int[] queryId) { + long __functionAddress = GL.getICD().glGetPerfQueryIdByNameINTEL; + if (CHECKS) { + check(__functionAddress); + checkNT1(queryName); + check(queryId, 1); + } + callPPV(memAddress(queryName), queryId, __functionAddress); + } + + /** Array version of: {@link #glGetPerfQueryIdByNameINTEL GetPerfQueryIdByNameINTEL} */ + public static void glGetPerfQueryIdByNameINTEL(@NativeType("GLchar *") CharSequence queryName, @NativeType("GLuint *") int[] queryId) { + long __functionAddress = GL.getICD().glGetPerfQueryIdByNameINTEL; + if (CHECKS) { + check(__functionAddress); + check(queryId, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(queryName, true); + long queryNameEncoded = stack.getPointerAddress(); + callPPV(queryNameEncoded, queryId, __functionAddress); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #glGetPerfQueryInfoINTEL GetPerfQueryInfoINTEL} */ + public static void glGetPerfQueryInfoINTEL(@NativeType("GLuint") int queryId, @NativeType("GLchar *") ByteBuffer queryName, @NativeType("GLuint *") int[] dataSize, @NativeType("GLuint *") int[] noCounters, @NativeType("GLuint *") int[] noInstances, @NativeType("GLuint *") int[] capsMask) { + long __functionAddress = GL.getICD().glGetPerfQueryInfoINTEL; + if (CHECKS) { + check(__functionAddress); + check(dataSize, 1); + check(noCounters, 1); + check(noInstances, 1); + check(capsMask, 1); + } + callPPPPPV(queryId, queryName.remaining(), memAddress(queryName), dataSize, noCounters, noInstances, capsMask, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRBlendEquationAdvanced.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRBlendEquationAdvanced.java new file mode 100644 index 00000000..e4f4a814 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRBlendEquationAdvanced.java @@ -0,0 +1,97 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the KHR_blend_equation_advanced extension. + * + *

This extension adds a number of "advanced" blending equations that can be used to perform new color blending operations, many of which are more complex + * than the standard blend modes provided by unextended OpenGL. This extension provides two different extension string entries:

+ * + *
    + *
  • KHR_blend_equation_advanced:Provides the new blending equations, but guarantees defined results only if each sample is touched no more than + * once in any single rendering pass. The command {@link #glBlendBarrierKHR BlendBarrierKHR} is provided to indicate a boundary between passes.
  • + *
  • {@link KHRBlendEquationAdvancedCoherent KHR_blend_equation_advanced_coherent}: Provides the new blending equations, and guarantees that blending is + * done coherently and in API primitive order. An enable is provided to allow implementations to opt out of fully coherent blending and instead behave + * as though only KHR_blend_equation_advanced were supported.
  • + *
+ * + *

Some implementations may support KHR_blend_equation_advanced without supporting KHR_blend_equation_advanced_coherent.

+ * + *

In unextended OpenGL, the set of blending equations is limited, and can be expressed very simply. The {@link GL14#GL_MIN MIN} and {@link GL14#GL_MAX MAX} blend equations + * simply compute component-wise minimums or maximums of source and destination color components. The {@link GL14#GL_FUNC_ADD FUNC_ADD}, {@link GL14#GL_FUNC_SUBTRACT FUNC_SUBTRACT}, and + * {@link GL14#GL_FUNC_REVERSE_SUBTRACT FUNC_REVERSE_SUBTRACT} multiply the source and destination colors by source and destination factors and either add the two products together + * or subtract one from the other. This limited set of operations supports many common blending operations but precludes the use of more sophisticated + * transparency and blending operations commonly available in many dedicated imaging APIs.

+ * + *

This extension provides a number of new "advanced" blending equations. Unlike traditional blending operations using the {@link GL14#GL_FUNC_ADD FUNC_ADD} equation, + * these blending equations do not use source and destination factors specified by {@link GL11C#glBlendFunc BlendFunc}. Instead, each blend equation specifies a complete + * equation based on the source and destination colors. These new blend equations are used for both RGB and alpha components; they may not be used to + * perform separate RGB and alpha blending (via functions like {@link GL20C#glBlendEquationSeparate BlendEquationSeparate}).

+ * + *

These blending operations are performed using premultiplied source and destination colors, where RGB colors produced by the fragment shader and stored + * in the framebuffer are considered to be multiplied by alpha (coverage). Many of these advanced blending equations are formulated where the result of + * blending source and destination colors with partial coverage have three separate contributions: from the portions covered by both the source and the + * destination, from the portion covered only by the source, and from the portion covered only by the destination. Such equations are defined assuming that + * the source and destination coverage have no spatial correlation within the pixel.

+ * + *

In addition to the coherency issues on implementations not supporting KHR_blend_equation_advanced_coherent, this extension has several limitations worth + * noting. First, the new blend equations are not supported while rendering to more than one color buffer at once; an {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} will be + * generated if an application attempts to render any primitives in this unsupported configuration. Additionally, blending precision may be limited to + * 16-bit floating-point, which could result in a loss of precision and dynamic range for framebuffer formats with 32-bit floating-point components, and in + * a loss of precision for formats with 12- and 16-bit signed or unsigned normalized integer components.

+ * + *

Requires {@link GL20 OpenGL 2.0}.

+ */ +public class KHRBlendEquationAdvanced { + + /** Accepted by the {@code mode} parameter of BlendEquation and BlendEquationi. */ + public static final int + GL_MULTIPLY_KHR = 0x9294, + GL_SCREEN_KHR = 0x9295, + GL_OVERLAY_KHR = 0x9296, + GL_DARKEN_KHR = 0x9297, + GL_LIGHTEN_KHR = 0x9298, + GL_COLORDODGE_KHR = 0x9299, + GL_COLORBURN_KHR = 0x929A, + GL_HARDLIGHT_KHR = 0x929B, + GL_SOFTLIGHT_KHR = 0x929C, + GL_DIFFERENCE_KHR = 0x929E, + GL_EXCLUSION_KHR = 0x92A0, + GL_HSL_HUE_KHR = 0x92AD, + GL_HSL_SATURATION_KHR = 0x92AE, + GL_HSL_COLOR_KHR = 0x92AF, + GL_HSL_LUMINOSITY_KHR = 0x92B0; + + static { GL.initialize(); } + + protected KHRBlendEquationAdvanced() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBlendBarrierKHR + ); + } + + // --- [ glBlendBarrierKHR ] --- + + /** + * Specifies a boundary between passes when using advanced blend equations. + * + *

When using advanced blending equations, applications should split their rendering into a collection of blending passes, none of which touch an + * individual sample in the framebuffer more than once. The results of blending are undefined if the sample being blended has been touched previously in + * the same pass. Any command that causes the value of a sample to be modified using the framebuffer is considered to touch the sample, including clears, + * blended or unblended primitives, and {@link GL30C#glBlitFramebuffer BlitFramebuffer} copies.

+ */ + public static native void glBlendBarrierKHR(); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRBlendEquationAdvancedCoherent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRBlendEquationAdvancedCoherent.java new file mode 100644 index 00000000..28fb2cfd --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRBlendEquationAdvancedCoherent.java @@ -0,0 +1,26 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the KHR_blend_equation_advanced_coherent extension. + * + *

This extension guarantees that blending is done coherently and in API primitive order. An enable is provided to allow implementations to opt out of + * fully coherent blending and instead behave as though only {@link KHRBlendEquationAdvanced KHR_blend_equation_advanced} were supported.

+ * + *

Requires {@link GL20 OpenGL 2.0}.

+ */ +public final class KHRBlendEquationAdvancedCoherent { + + /** + * Accepted by the {@code cap} parameter of Disable, Enable, and IsEnabled, and by the {@code pname} parameter of GetIntegerv, GetBooleanv, GetFloatv, + * GetDoublev and GetInteger64v. + */ + public static final int GL_BLEND_ADVANCED_COHERENT_KHR = 0x9285; + + private KHRBlendEquationAdvancedCoherent() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRContextFlushControl.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRContextFlushControl.java new file mode 100644 index 00000000..c5dddc90 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRContextFlushControl.java @@ -0,0 +1,37 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the KHR_context_flush_control extension. + * + *

OpenGL and OpenGL ES have long supported multiple contexts. The semantics of switching contexts is generally left to window system binding APIs such as + * WGL, GLX and EGL. Most of these APIs (if not all) specify that when the current context for a thread is changed, the outgoing context performs an + * implicit flush of any commands that have been issued to that point. OpenGL and OpenGL ES define a flush as sending any pending commands for execution + * and that this action will result in their completion in finite time.

+ * + *

This behavior has subtle consequences. For example, if an application is rendering to the front buffer and switches contexts, it may assume that any + * rendering performed thus far will eventually be visible to the user. With recent introduction of shared memory buffers, there become inumerable ways in + * which applications may observe side effects of an implicit flush (or lack thereof).

+ * + *

In general, a full flush is not the desired behavior of the application. Nonetheless, applications that switch contexts frequently suffer the + * performance consequences of this unless implementations make special considerations for them, which is generally untenable.

+ * + *

This extension allows querying the context flush behavior.

+ * + *

Promoted to core in {@link GL45 OpenGL 4.5}.

+ */ +public final class KHRContextFlushControl { + + /** Accepted by the {@code pname} parameter of GetIntegerv, GetFloatv, GetBooleanv GetDoublev and GetInteger64v. */ + public static final int GL_CONTEXT_RELEASE_BEHAVIOR = 0x82FB; + + /** Returned in {@code data} by GetIntegerv, GetFloatv, GetBooleanv GetDoublev and GetInteger64v when {@code pname} is {@link #GL_CONTEXT_RELEASE_BEHAVIOR CONTEXT_RELEASE_BEHAVIOR}. */ + public static final int GL_CONTEXT_RELEASE_BEHAVIOR_FLUSH = 0x82FC; + + private KHRContextFlushControl() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRDebug.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRDebug.java new file mode 100644 index 00000000..bffce506 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRDebug.java @@ -0,0 +1,641 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the KHR_debug extension. + * + *

This extension allows the GL to notify applications when various events occur that may be useful during application development, debugging and + * profiling.

+ * + *

These events are represented in the form of enumerable messages with a human-readable string representation. Examples of debug events include incorrect + * use of the GL, warnings of undefined behavior, and performance warnings.

+ * + *

A message is uniquely identified by a source, a type and an implementation-dependent ID within the source and type pair.

+ * + *

A message's source identifies the origin of the message and can either describe components of the GL, the window system, third-party external sources + * such as external debuggers, or even the application itself.

+ * + *

The type of the message roughly identifies the nature of the event that caused the message. Examples include errors, performance warnings, warnings + * about undefined behavior or notifications identifying that the application is within a specific section of the application code.

+ * + *

A message's ID for a given source and type further distinguishes messages within namespaces. For example, an error caused by a negative parameter value + * or an invalid internal texture format are both errors generated by the API, but would likely have different message IDs.

+ * + *

Each message is also assigned to a severity level that denotes roughly how "important" that message is in comparison to other messages across all + * sources and types. For example, notification of a GL error would likely have a higher severity than a performance warning due to redundant state changes.

+ * + *

Furthermore, every message contains an implementation-dependent string representation that provides a useful description of the event.

+ * + *

Messages are communicated to the application through an application-defined callback function that is called by the GL implementation on each debug + * message. The motivation for the callback routine is to free application developers from actively having to query whether a GL error, or any other + * debuggable event has happened after each call to a GL function. With a callback, developers can keep their code free of debug checks, set breakpoints in + * the callback function, and only have to react to messages as they occur. In situations where using a callback is not possible, a message log is also + * provided that stores only copies of recent messages until they are actively queried.

+ * + *

To control the volume of debug output, messages can be disabled either individually by ID, or entire sets of messages can be turned off based on + * combination of source and type, through the entire application code or only section of the code encapsulated in debug groups. A debug group may also be + * used to annotate the command stream using descriptive texts.

+ * + *

This extension also defines debug markers, a mechanism for the OpenGL application to annotate the command stream with markers for discrete events.

+ * + *

When profiling or debugging an OpenGL application with a built-in or an external debugger or profiler, it is difficult to relate the commands within the + * command stream to the elements of the scene or parts of the program code to which they correspond. Debug markers and debug groups help obviate this by + * allowing applications to specify this link. For example, a debug marker can be used to identify the beginning of a frame in the command stream and a + * debug group can encapsulate a specific command stream to identify a rendering pass. Debug groups also allow control of the debug outputs volume per + * section of an application code providing an effective way to handle the massive amount of debug outputs that drivers can generate.

+ * + *

Some existing implementations of {@link ARBDebugOutput ARB_debug_output} only expose the ARB_debug_output extension string if the context was created with the debug + * flag {GLX|WGL}_CONTEXT_DEBUG_BIT_ARB as specified in {GLX|WGL}_ARB_create_context. The behavior is not obvious when the functionality is brought into + * the OpenGL core specification because the extension string and function entry points must always exist.

+ * + *

This extension modifies the existing ARB_debug_output extension to allow implementations to always have an empty message log. The specific messages + * written to the message log or callback routines are already implementation defined, so this specification simply makes it explicit that it's fine for + * there to be zero messages generated, even when a GL error occurs, which is useful if the context is non-debug.

+ * + *

Debug output can be enabled and disabled by changing the {@link #GL_DEBUG_OUTPUT DEBUG_OUTPUT} state. It is implementation defined how much debug output is generated if the + * context was created without the {@link #GL_CONTEXT_FLAG_DEBUG_BIT CONTEXT_FLAG_DEBUG_BIT} set. This is a new query bit added to the existing {@link GL30#GL_CONTEXT_FLAGS CONTEXT_FLAGS} state to specify whether the + * context was created with debug enabled.

+ * + *

Finally, this extension defines a mechanism for OpenGL applications to label their objects (textures, buffers, shaders, etc.) with a descriptive string.

+ * + *

When profiling or debugging an OpenGL application within an external or built-in (debut output API) debugger or profiler it is difficult to identify + * objects from their object names (integers).

+ * + *

Even when the object itself is viewed it can be problematic to differentiate between similar objects. Attaching a descriptive string, a label, to an + * object obviates this difficulty.

+ * + *

The intended purpose of this extension is purely to improve the user experience within OpenGL development tools and application built-in profilers and + * debuggers. This extension typically improves OpenGL programmers efficiency by allowing them to instantly detect issues and the reason for these issues + * giving him more time to focus on adding new features to an OpenGL application.

+ * + *

Promoted to core in {@link GL43 OpenGL 4.3}.

+ */ +public class KHRDebug { + + /** Tokens accepted by the {@code target} parameters of Enable, Disable, and IsEnabled. */ + public static final int + GL_DEBUG_OUTPUT = 0x92E0, + GL_DEBUG_OUTPUT_SYNCHRONOUS = 0x8242; + + /** Returned by GetIntegerv when {@code pname} is CONTEXT_FLAGS. */ + public static final int GL_CONTEXT_FLAG_DEBUG_BIT = 0x2; + + /** Tokens accepted by the {@code value} parameters of GetBooleanv, GetIntegerv, GetFloatv, GetDoublev and GetInteger64v. */ + public static final int + GL_MAX_DEBUG_MESSAGE_LENGTH = 0x9143, + GL_MAX_DEBUG_LOGGED_MESSAGES = 0x9144, + GL_DEBUG_LOGGED_MESSAGES = 0x9145, + GL_DEBUG_NEXT_LOGGED_MESSAGE_LENGTH = 0x8243, + GL_MAX_DEBUG_GROUP_STACK_DEPTH = 0x826C, + GL_DEBUG_GROUP_STACK_DEPTH = 0x826D, + GL_MAX_LABEL_LENGTH = 0x82E8; + + /** Tokens accepted by the {@code pname} parameter of GetPointerv. */ + public static final int + GL_DEBUG_CALLBACK_FUNCTION = 0x8244, + GL_DEBUG_CALLBACK_USER_PARAM = 0x8245; + + /** + * Tokens accepted or provided by the {@code source} parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC, and the {@code sources} parameter + * of GetDebugMessageLog (some commands restrict {@code source} to a subset of these parameters; see the specification body for details). + */ + public static final int + GL_DEBUG_SOURCE_API = 0x8246, + GL_DEBUG_SOURCE_WINDOW_SYSTEM = 0x8247, + GL_DEBUG_SOURCE_SHADER_COMPILER = 0x8248, + GL_DEBUG_SOURCE_THIRD_PARTY = 0x8249, + GL_DEBUG_SOURCE_APPLICATION = 0x824A, + GL_DEBUG_SOURCE_OTHER = 0x824B; + + /** + * Tokens accepted or provided by the {@code type} parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC, and the {@code types} parameter of + * GetDebugMessageLog. + */ + public static final int + GL_DEBUG_TYPE_ERROR = 0x824C, + GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR = 0x824D, + GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR = 0x824E, + GL_DEBUG_TYPE_PORTABILITY = 0x824F, + GL_DEBUG_TYPE_PERFORMANCE = 0x8250, + GL_DEBUG_TYPE_OTHER = 0x8251, + GL_DEBUG_TYPE_MARKER = 0x8268; + + /** Tokens accepted or provided by the {@code type} parameters of DebugMessageControl and DEBUGPROC, and the {@code types} parameter of GetDebugMessageLog. */ + public static final int + GL_DEBUG_TYPE_PUSH_GROUP = 0x8269, + GL_DEBUG_TYPE_POP_GROUP = 0x826A; + + /** + * Tokens accepted or provided by the {@code severity} parameters of DebugMessageControl, DebugMessageInsert and DEBUGPROC callback functions, and the + * {@code severities} parameter of GetDebugMessageLog. + */ + public static final int + GL_DEBUG_SEVERITY_HIGH = 0x9146, + GL_DEBUG_SEVERITY_MEDIUM = 0x9147, + GL_DEBUG_SEVERITY_LOW = 0x9148, + GL_DEBUG_SEVERITY_NOTIFICATION = 0x826B; + + /** Tokens accepted or provided by the {@code identifier} parameters of ObjectLabel and GetObjectLabel. */ + public static final int + GL_BUFFER = 0x82E0, + GL_SHADER = 0x82E1, + GL_PROGRAM = 0x82E2, + GL_QUERY = 0x82E3, + GL_PROGRAM_PIPELINE = 0x82E4, + GL_SAMPLER = 0x82E6, + GL_DISPLAY_LIST = 0x82E7; + + static { GL.initialize(); } + + protected KHRDebug() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glDebugMessageControl, caps.glDebugMessageInsert, caps.glDebugMessageCallback, caps.glGetDebugMessageLog, caps.glPushDebugGroup, + caps.glPopDebugGroup, caps.glObjectLabel, caps.glGetObjectLabel, caps.glObjectPtrLabel, caps.glGetObjectPtrLabel + ); + } + + // --- [ glDebugMessageControl ] --- + + /** + * Unsafe version of: {@link #glDebugMessageControl DebugMessageControl} + * + * @param count the length of the array {@code ids} + */ + public static void nglDebugMessageControl(int source, int type, int severity, int count, long ids, boolean enabled) { + GL43C.nglDebugMessageControl(source, type, severity, count, ids, enabled); + } + + /** + * Controls the volume of debug output in the active debug group, by disabling specific or groups of messages. + * + *

If {@code enabled} is {@link GL11#GL_TRUE TRUE}, the referenced subset of messages will be enabled. If {@link GL11#GL_FALSE FALSE}, then those messages will be disabled.

+ * + *

This command can reference different subsets of messages by first considering the set of all messages, and filtering out messages based on the following + * ways:

+ * + *
    + *
  • If {@code source}, {@code type}, or {@code severity} is {@link GL11#GL_DONT_CARE DONT_CARE}, the messages from all sources, of all types, or of all severities are + * referenced respectively.
  • + *
  • When values other than {@link GL11#GL_DONT_CARE DONT_CARE} are specified, all messages whose source, type, or severity match the specified {@code source}, {@code type}, + * or {@code severity} respectively will be referenced.
  • + *
  • If {@code count} is greater than zero, then {@code ids} is an array of {@code count} message IDs for the specified combination of {@code source} and + * {@code type}. In this case, if {@code source} or {@code type} is {@link GL11#GL_DONT_CARE DONT_CARE}, or {@code severity} is not {@link GL11#GL_DONT_CARE DONT_CARE}, the error + * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated.
  • + *
+ * + *

Unrecognized message IDs in {@code ids} are ignored. If {@code count} is zero, the value if {@code ids} is ignored.

+ * + *

Although messages are grouped into an implicit hierarchy by their sources and types, there is no explicit per-source, per-type or per-severity enabled + * state. Instead, the enabled state is stored individually for each message. There is no difference between disabling all messages from one source in a + * single call, and individually disabling all messages from that source using their types and IDs.

+ * + *

If the {@link GL43C#GL_DEBUG_OUTPUT DEBUG_OUTPUT} state is disabled the GL operates the same as if messages of every {@code source}, {@code type} or {@code severity} are disabled.

+ * + * @param source the source of debug messages to enable or disable. One of:
{@link GL43C#GL_DEBUG_SOURCE_API DEBUG_SOURCE_API}{@link GL43C#GL_DEBUG_SOURCE_WINDOW_SYSTEM DEBUG_SOURCE_WINDOW_SYSTEM}{@link GL43C#GL_DEBUG_SOURCE_SHADER_COMPILER DEBUG_SOURCE_SHADER_COMPILER}
{@link GL43C#GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}{@link GL43C#GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION}{@link GL43C#GL_DEBUG_SOURCE_OTHER DEBUG_SOURCE_OTHER}
+ * @param type the type of debug messages to enable or disable. One of:
{@link GL43C#GL_DEBUG_TYPE_ERROR DEBUG_TYPE_ERROR}{@link GL43C#GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR DEBUG_TYPE_DEPRECATED_BEHAVIOR}{@link GL43C#GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR DEBUG_TYPE_UNDEFINED_BEHAVIOR}
{@link GL43C#GL_DEBUG_TYPE_PORTABILITY DEBUG_TYPE_PORTABILITY}{@link GL43C#GL_DEBUG_TYPE_PERFORMANCE DEBUG_TYPE_PERFORMANCE}{@link GL43C#GL_DEBUG_TYPE_OTHER DEBUG_TYPE_OTHER}
{@link GL43C#GL_DEBUG_TYPE_MARKER DEBUG_TYPE_MARKER}
+ * @param severity the severity of debug messages to enable or disable. One of:
{@link GL43C#GL_DEBUG_SEVERITY_HIGH DEBUG_SEVERITY_HIGH}{@link GL43C#GL_DEBUG_SEVERITY_MEDIUM DEBUG_SEVERITY_MEDIUM}{@link GL43C#GL_DEBUG_SEVERITY_LOW DEBUG_SEVERITY_LOW}
{@link GL43C#GL_DEBUG_SEVERITY_NOTIFICATION DEBUG_SEVERITY_NOTIFICATION}
+ * @param ids an array of unsigned integers containing the ids of the messages to enable or disable + * @param enabled whether the selected messages should be enabled or disabled + */ + public static void glDebugMessageControl(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLenum") int severity, @Nullable @NativeType("GLuint const *") IntBuffer ids, @NativeType("GLboolean") boolean enabled) { + GL43C.glDebugMessageControl(source, type, severity, ids, enabled); + } + + /** + * Controls the volume of debug output in the active debug group, by disabling specific or groups of messages. + * + *

If {@code enabled} is {@link GL11#GL_TRUE TRUE}, the referenced subset of messages will be enabled. If {@link GL11#GL_FALSE FALSE}, then those messages will be disabled.

+ * + *

This command can reference different subsets of messages by first considering the set of all messages, and filtering out messages based on the following + * ways:

+ * + *
    + *
  • If {@code source}, {@code type}, or {@code severity} is {@link GL11#GL_DONT_CARE DONT_CARE}, the messages from all sources, of all types, or of all severities are + * referenced respectively.
  • + *
  • When values other than {@link GL11#GL_DONT_CARE DONT_CARE} are specified, all messages whose source, type, or severity match the specified {@code source}, {@code type}, + * or {@code severity} respectively will be referenced.
  • + *
  • If {@code count} is greater than zero, then {@code ids} is an array of {@code count} message IDs for the specified combination of {@code source} and + * {@code type}. In this case, if {@code source} or {@code type} is {@link GL11#GL_DONT_CARE DONT_CARE}, or {@code severity} is not {@link GL11#GL_DONT_CARE DONT_CARE}, the error + * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated.
  • + *
+ * + *

Unrecognized message IDs in {@code ids} are ignored. If {@code count} is zero, the value if {@code ids} is ignored.

+ * + *

Although messages are grouped into an implicit hierarchy by their sources and types, there is no explicit per-source, per-type or per-severity enabled + * state. Instead, the enabled state is stored individually for each message. There is no difference between disabling all messages from one source in a + * single call, and individually disabling all messages from that source using their types and IDs.

+ * + *

If the {@link GL43C#GL_DEBUG_OUTPUT DEBUG_OUTPUT} state is disabled the GL operates the same as if messages of every {@code source}, {@code type} or {@code severity} are disabled.

+ * + * @param source the source of debug messages to enable or disable. One of:
{@link GL43C#GL_DEBUG_SOURCE_API DEBUG_SOURCE_API}{@link GL43C#GL_DEBUG_SOURCE_WINDOW_SYSTEM DEBUG_SOURCE_WINDOW_SYSTEM}{@link GL43C#GL_DEBUG_SOURCE_SHADER_COMPILER DEBUG_SOURCE_SHADER_COMPILER}
{@link GL43C#GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}{@link GL43C#GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION}{@link GL43C#GL_DEBUG_SOURCE_OTHER DEBUG_SOURCE_OTHER}
+ * @param type the type of debug messages to enable or disable. One of:
{@link GL43C#GL_DEBUG_TYPE_ERROR DEBUG_TYPE_ERROR}{@link GL43C#GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR DEBUG_TYPE_DEPRECATED_BEHAVIOR}{@link GL43C#GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR DEBUG_TYPE_UNDEFINED_BEHAVIOR}
{@link GL43C#GL_DEBUG_TYPE_PORTABILITY DEBUG_TYPE_PORTABILITY}{@link GL43C#GL_DEBUG_TYPE_PERFORMANCE DEBUG_TYPE_PERFORMANCE}{@link GL43C#GL_DEBUG_TYPE_OTHER DEBUG_TYPE_OTHER}
{@link GL43C#GL_DEBUG_TYPE_MARKER DEBUG_TYPE_MARKER}
+ * @param severity the severity of debug messages to enable or disable. One of:
{@link GL43C#GL_DEBUG_SEVERITY_HIGH DEBUG_SEVERITY_HIGH}{@link GL43C#GL_DEBUG_SEVERITY_MEDIUM DEBUG_SEVERITY_MEDIUM}{@link GL43C#GL_DEBUG_SEVERITY_LOW DEBUG_SEVERITY_LOW}
{@link GL43C#GL_DEBUG_SEVERITY_NOTIFICATION DEBUG_SEVERITY_NOTIFICATION}
+ * @param enabled whether the selected messages should be enabled or disabled + */ + public static void glDebugMessageControl(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLenum") int severity, @NativeType("GLuint const *") int id, @NativeType("GLboolean") boolean enabled) { + GL43C.glDebugMessageControl(source, type, severity, id, enabled); + } + + // --- [ glDebugMessageInsert ] --- + + /** + * Unsafe version of: {@link #glDebugMessageInsert DebugMessageInsert} + * + * @param length the length of the string contained in the character array whose address is given by {@code message} + */ + public static void nglDebugMessageInsert(int source, int type, int id, int severity, int length, long message) { + GL43C.nglDebugMessageInsert(source, type, id, severity, length, message); + } + + /** + * This function can be called by applications and third-party libraries to generate their own messages, such as ones containing timestamp information or + * signals about specific render system events. + * + *

The value of {@code id} specifies the ID for the message and {@code severity} indicates its severity level as defined by the caller. The string + * {@code buf} contains the string representation of the message. The parameter {@code length} contains the number of characters in {@code buf}. If + * {@code length} is negative, it is implied that {@code buf} contains a null terminated string. The error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} will be generated if the + * number of characters in {@code buf}, excluding the null terminator when {@code length} is negative, is not less than the value of + * {@link GL43C#GL_MAX_DEBUG_MESSAGE_LENGTH MAX_DEBUG_MESSAGE_LENGTH}.

+ * + *

If the {@link GL43C#GL_DEBUG_OUTPUT DEBUG_OUTPUT} state is disabled calls to DebugMessageInsert are discarded and do not generate an error.

+ * + * @param source the source of the debug message to insert. One of:
{@link GL43C#GL_DEBUG_SOURCE_API DEBUG_SOURCE_API}{@link GL43C#GL_DEBUG_SOURCE_WINDOW_SYSTEM DEBUG_SOURCE_WINDOW_SYSTEM}{@link GL43C#GL_DEBUG_SOURCE_SHADER_COMPILER DEBUG_SOURCE_SHADER_COMPILER}
{@link GL43C#GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}{@link GL43C#GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION}{@link GL43C#GL_DEBUG_SOURCE_OTHER DEBUG_SOURCE_OTHER}
+ * @param type the type of the debug message insert. One of:
{@link GL43C#GL_DEBUG_TYPE_ERROR DEBUG_TYPE_ERROR}{@link GL43C#GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR DEBUG_TYPE_DEPRECATED_BEHAVIOR}{@link GL43C#GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR DEBUG_TYPE_UNDEFINED_BEHAVIOR}
{@link GL43C#GL_DEBUG_TYPE_PORTABILITY DEBUG_TYPE_PORTABILITY}{@link GL43C#GL_DEBUG_TYPE_PERFORMANCE DEBUG_TYPE_PERFORMANCE}{@link GL43C#GL_DEBUG_TYPE_OTHER DEBUG_TYPE_OTHER}
{@link GL43C#GL_DEBUG_TYPE_MARKER DEBUG_TYPE_MARKER}
+ * @param id the user-supplied identifier of the message to insert. One of:
{@link GL43C#GL_DEBUG_SEVERITY_HIGH DEBUG_SEVERITY_HIGH}{@link GL43C#GL_DEBUG_SEVERITY_MEDIUM DEBUG_SEVERITY_MEDIUM}{@link GL43C#GL_DEBUG_SEVERITY_LOW DEBUG_SEVERITY_LOW}
{@link GL43C#GL_DEBUG_SEVERITY_NOTIFICATION DEBUG_SEVERITY_NOTIFICATION}
+ * @param severity the severity of the debug messages to insert + * @param message a character array containing the message to insert + */ + public static void glDebugMessageInsert(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLuint") int id, @NativeType("GLenum") int severity, @NativeType("GLchar const *") ByteBuffer message) { + GL43C.glDebugMessageInsert(source, type, id, severity, message); + } + + /** + * This function can be called by applications and third-party libraries to generate their own messages, such as ones containing timestamp information or + * signals about specific render system events. + * + *

The value of {@code id} specifies the ID for the message and {@code severity} indicates its severity level as defined by the caller. The string + * {@code buf} contains the string representation of the message. The parameter {@code length} contains the number of characters in {@code buf}. If + * {@code length} is negative, it is implied that {@code buf} contains a null terminated string. The error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} will be generated if the + * number of characters in {@code buf}, excluding the null terminator when {@code length} is negative, is not less than the value of + * {@link GL43C#GL_MAX_DEBUG_MESSAGE_LENGTH MAX_DEBUG_MESSAGE_LENGTH}.

+ * + *

If the {@link GL43C#GL_DEBUG_OUTPUT DEBUG_OUTPUT} state is disabled calls to DebugMessageInsert are discarded and do not generate an error.

+ * + * @param source the source of the debug message to insert. One of:
{@link GL43C#GL_DEBUG_SOURCE_API DEBUG_SOURCE_API}{@link GL43C#GL_DEBUG_SOURCE_WINDOW_SYSTEM DEBUG_SOURCE_WINDOW_SYSTEM}{@link GL43C#GL_DEBUG_SOURCE_SHADER_COMPILER DEBUG_SOURCE_SHADER_COMPILER}
{@link GL43C#GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}{@link GL43C#GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION}{@link GL43C#GL_DEBUG_SOURCE_OTHER DEBUG_SOURCE_OTHER}
+ * @param type the type of the debug message insert. One of:
{@link GL43C#GL_DEBUG_TYPE_ERROR DEBUG_TYPE_ERROR}{@link GL43C#GL_DEBUG_TYPE_DEPRECATED_BEHAVIOR DEBUG_TYPE_DEPRECATED_BEHAVIOR}{@link GL43C#GL_DEBUG_TYPE_UNDEFINED_BEHAVIOR DEBUG_TYPE_UNDEFINED_BEHAVIOR}
{@link GL43C#GL_DEBUG_TYPE_PORTABILITY DEBUG_TYPE_PORTABILITY}{@link GL43C#GL_DEBUG_TYPE_PERFORMANCE DEBUG_TYPE_PERFORMANCE}{@link GL43C#GL_DEBUG_TYPE_OTHER DEBUG_TYPE_OTHER}
{@link GL43C#GL_DEBUG_TYPE_MARKER DEBUG_TYPE_MARKER}
+ * @param id the user-supplied identifier of the message to insert. One of:
{@link GL43C#GL_DEBUG_SEVERITY_HIGH DEBUG_SEVERITY_HIGH}{@link GL43C#GL_DEBUG_SEVERITY_MEDIUM DEBUG_SEVERITY_MEDIUM}{@link GL43C#GL_DEBUG_SEVERITY_LOW DEBUG_SEVERITY_LOW}
{@link GL43C#GL_DEBUG_SEVERITY_NOTIFICATION DEBUG_SEVERITY_NOTIFICATION}
+ * @param severity the severity of the debug messages to insert + * @param message a character array containing the message to insert + */ + public static void glDebugMessageInsert(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLuint") int id, @NativeType("GLenum") int severity, @NativeType("GLchar const *") CharSequence message) { + GL43C.glDebugMessageInsert(source, type, id, severity, message); + } + + // --- [ glDebugMessageCallback ] --- + + /** Unsafe version of: {@link #glDebugMessageCallback DebugMessageCallback} */ + public static void nglDebugMessageCallback(long callback, long userParam) { + GL43C.nglDebugMessageCallback(callback, userParam); + } + + /** + * Specifies a callback to receive debugging messages from the GL. + * + *

The function's prototype must follow the type definition of DEBUGPROC including its platform-dependent calling convention. Anything else will result in + * undefined behavior. Only one debug callback can be specified for the current context, and further calls overwrite the previous callback. Specifying + * {@code NULL} as the value of {@code callback} clears the current callback and disables message output through callbacks. Applications can provide + * user-specified data through the pointer {@code userParam}. The context will store this pointer and will include it as one of the parameters in each call + * to the callback function.

+ * + *

If the application has specified a callback function for receiving debug output, the implementation will call that function whenever any enabled message + * is generated. The source, type, ID, and severity of the message are specified by the DEBUGPROC parameters {@code source}, {@code type}, {@code id}, and + * {@code severity}, respectively. The string representation of the message is stored in {@code message} and its length (excluding the null-terminator) is + * stored in {@code length}. The parameter {@code userParam} is the user-specified parameter that was given when calling DebugMessageCallback.

+ * + *

Applications can query the current callback function and the current user-specified parameter by obtaining the values of {@link GL43C#GL_DEBUG_CALLBACK_FUNCTION DEBUG_CALLBACK_FUNCTION} and + * {@link GL43C#GL_DEBUG_CALLBACK_USER_PARAM DEBUG_CALLBACK_USER_PARAM}, respectively.

+ * + *

Applications that specify a callback function must be aware of certain special conditions when executing code inside a callback when it is called by the + * GL, regardless of the debug source.

+ * + *

The memory for {@code message} is owned and managed by the GL, and should only be considered valid for the duration of the function call.

+ * + *

The behavior of calling any GL or window system function from within the callback function is undefined and may lead to program termination.

+ * + *

Care must also be taken in securing debug callbacks for use with asynchronous debug output by multi-threaded GL implementations.

+ * + *

If the {@link GL43C#GL_DEBUG_OUTPUT DEBUG_OUTPUT} state is disabled then the GL will not call the callback function.

+ * + * @param callback a callback function that will be called when a debug message is generated + * @param userParam a user supplied pointer that will be passed on each invocation of {@code callback} + */ + public static void glDebugMessageCallback(@Nullable @NativeType("GLDEBUGPROC") GLDebugMessageCallbackI callback, @NativeType("void const *") long userParam) { + GL43C.glDebugMessageCallback(callback, userParam); + } + + // --- [ glGetDebugMessageLog ] --- + + /** + * Unsafe version of: {@link #glGetDebugMessageLog GetDebugMessageLog} + * + * @param bufsize the size of the buffer whose address is given by {@code messageLog} + */ + public static int nglGetDebugMessageLog(int count, int bufsize, long sources, long types, long ids, long severities, long lengths, long messageLog) { + return GL43C.nglGetDebugMessageLog(count, bufsize, sources, types, ids, severities, lengths, messageLog); + } + + /** + * Retrieves messages from the debug message log. + * + *

This function fetches a maximum of {@code count} messages from the message log, and will return the number of messages successfully fetched.

+ * + *

Messages will be fetched from the log in order of oldest to newest. Those messages that were fetched will be removed from the log.

+ * + *

The sources, types, severities, IDs, and string lengths of fetched messages will be stored in the application-provided arrays {@code sources}, + * {@code types}, {@code severities}, {@code ids}, and {@code lengths}, respectively. The application is responsible for allocating enough space for each + * array to hold up to {@code count} elements. The string representations of all fetched messages are stored in the {@code messageLog} array. If multiple + * messages are fetched, their strings are concatenated into the same {@code messageLog} array and will be separated by single null terminators. The last + * string in the array will also be null-terminated. The maximum size of {@code messageLog}, including the space used by all null terminators, is given by + * {@code bufSize}. If {@code bufSize} is less than zero and {@code messageLog} is not {@code NULL}, an {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error will be generated. If a message's + * string, including its null terminator, can not fully fit within the {@code messageLog} array's remaining space, then that message and any subsequent + * messages will not be fetched and will remain in the log. The string lengths stored in the array {@code lengths} include the space for the null + * terminator of each string.

+ * + *

Any or all of the arrays {@code sources}, {@code types}, {@code ids}, {@code severities}, {@code lengths} and {@code messageLog} can also be null + * pointers, which causes the attributes for such arrays to be discarded when messages are fetched, however those messages will still be removed from the + * log. Thus to simply delete up to {@code count} messages from the message log while ignoring their attributes, the application can call the function + * with null pointers for all attribute arrays.

+ * + *

If the context was created without the {@link GL43C#GL_CONTEXT_FLAG_DEBUG_BIT CONTEXT_FLAG_DEBUG_BIT} in the {@link GL30#GL_CONTEXT_FLAGS CONTEXT_FLAGS} state, then the GL can opt to never add messages to the + * message log so GetDebugMessageLog will always return zero.

+ * + * @param count the number of debug messages to retrieve from the log + * @param sources an array of variables to receive the sources of the retrieved messages + * @param types an array of variables to receive the types of the retrieved messages + * @param ids an array of unsigned integers to receive the ids of the retrieved messages + * @param severities an array of variables to receive the severites of the retrieved messages + * @param lengths an array of variables to receive the lengths of the received messages + * @param messageLog an array of characters that will receive the messages + */ + @NativeType("GLuint") + public static int glGetDebugMessageLog(@NativeType("GLuint") int count, @Nullable @NativeType("GLenum *") IntBuffer sources, @Nullable @NativeType("GLenum *") IntBuffer types, @Nullable @NativeType("GLuint *") IntBuffer ids, @Nullable @NativeType("GLenum *") IntBuffer severities, @Nullable @NativeType("GLsizei *") IntBuffer lengths, @Nullable @NativeType("GLchar *") ByteBuffer messageLog) { + return GL43C.glGetDebugMessageLog(count, sources, types, ids, severities, lengths, messageLog); + } + + // --- [ glPushDebugGroup ] --- + + /** + * Unsafe version of: {@link #glPushDebugGroup PushDebugGroup} + * + * @param length the length of the message to be sent to the debug output stream + */ + public static void nglPushDebugGroup(int source, int id, int length, long message) { + GL43C.nglPushDebugGroup(source, id, length, message); + } + + /** + * Pushes a debug group described by the string {@code message} into the command stream. The value of {@code id} specifies the ID of messages generated. + * The parameter {@code length} contains the number of characters in {@code message}. If {@code length} is negative, it is implied that {@code message} + * contains a null terminated string. The message has the specified {@code source} and {@code id}, {@code type} {@link GL43C#GL_DEBUG_TYPE_PUSH_GROUP DEBUG_TYPE_PUSH_GROUP}, and + * {@code severity} {@link GL43C#GL_DEBUG_SEVERITY_NOTIFICATION DEBUG_SEVERITY_NOTIFICATION}. The GL will put a new debug group on top of the debug group stack which inherits the control of the + * volume of debug output of the debug group previously residing on the top of the debug group stack. Because debug groups are strictly hierarchical, any + * additional control of the debug output volume will only apply within the active debug group and the debug groups pushed on top of the active debug group. + * + *

An {@link GL11#GL_INVALID_ENUM INVALID_ENUM} error is generated if the value of {@code source} is neither {@link GL43C#GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION} nor {@link GL43C#GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}. An + * {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error is generated if {@code length} is negative and the number of characters in {@code message}, excluding the null-terminator, is + * not less than the value of {@link GL43C#GL_MAX_DEBUG_MESSAGE_LENGTH MAX_DEBUG_MESSAGE_LENGTH}.

+ * + * @param source the source of the debug message. One of:
{@link GL43C#GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION}{@link GL43C#GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}
+ * @param id the identifier of the message + * @param message a string containing the message to be sent to the debug output stream + */ + public static void glPushDebugGroup(@NativeType("GLenum") int source, @NativeType("GLuint") int id, @NativeType("GLchar const *") ByteBuffer message) { + GL43C.glPushDebugGroup(source, id, message); + } + + /** + * Pushes a debug group described by the string {@code message} into the command stream. The value of {@code id} specifies the ID of messages generated. + * The parameter {@code length} contains the number of characters in {@code message}. If {@code length} is negative, it is implied that {@code message} + * contains a null terminated string. The message has the specified {@code source} and {@code id}, {@code type} {@link GL43C#GL_DEBUG_TYPE_PUSH_GROUP DEBUG_TYPE_PUSH_GROUP}, and + * {@code severity} {@link GL43C#GL_DEBUG_SEVERITY_NOTIFICATION DEBUG_SEVERITY_NOTIFICATION}. The GL will put a new debug group on top of the debug group stack which inherits the control of the + * volume of debug output of the debug group previously residing on the top of the debug group stack. Because debug groups are strictly hierarchical, any + * additional control of the debug output volume will only apply within the active debug group and the debug groups pushed on top of the active debug group. + * + *

An {@link GL11#GL_INVALID_ENUM INVALID_ENUM} error is generated if the value of {@code source} is neither {@link GL43C#GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION} nor {@link GL43C#GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}. An + * {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error is generated if {@code length} is negative and the number of characters in {@code message}, excluding the null-terminator, is + * not less than the value of {@link GL43C#GL_MAX_DEBUG_MESSAGE_LENGTH MAX_DEBUG_MESSAGE_LENGTH}.

+ * + * @param source the source of the debug message. One of:
{@link GL43C#GL_DEBUG_SOURCE_APPLICATION DEBUG_SOURCE_APPLICATION}{@link GL43C#GL_DEBUG_SOURCE_THIRD_PARTY DEBUG_SOURCE_THIRD_PARTY}
+ * @param id the identifier of the message + * @param message a string containing the message to be sent to the debug output stream + */ + public static void glPushDebugGroup(@NativeType("GLenum") int source, @NativeType("GLuint") int id, @NativeType("GLchar const *") CharSequence message) { + GL43C.glPushDebugGroup(source, id, message); + } + + // --- [ glPopDebugGroup ] --- + + /** + * Pops the active debug group. When a debug group is popped, the GL will also generate a debug output message describing its cause based on the + * {@code message} string, the source {@code source}, and an ID {@code id} submitted to the associated {@link #glPushDebugGroup PushDebugGroup} command. {@link GL43C#GL_DEBUG_TYPE_PUSH_GROUP DEBUG_TYPE_PUSH_GROUP} + * and {@link GL43C#GL_DEBUG_TYPE_POP_GROUP DEBUG_TYPE_POP_GROUP} share a single namespace for message {@code id}. {@code severity} has the value {@link GL43C#GL_DEBUG_SEVERITY_NOTIFICATION DEBUG_SEVERITY_NOTIFICATION}. The {@code type} + * has the value {@link GL43C#GL_DEBUG_TYPE_POP_GROUP DEBUG_TYPE_POP_GROUP}. Popping a debug group restores the debug output volume control of the parent debug group. + * + *

Attempting to pop the default debug group off the stack generates a {@link GL11#GL_STACK_UNDERFLOW STACK_UNDERFLOW} error; pushing a debug group onto a stack containing + * {@link GL43C#GL_MAX_DEBUG_GROUP_STACK_DEPTH MAX_DEBUG_GROUP_STACK_DEPTH} minus one elements will generate a {@link GL11#GL_STACK_OVERFLOW STACK_OVERFLOW} error.

+ */ + public static void glPopDebugGroup() { + GL43C.glPopDebugGroup(); + } + + // --- [ glObjectLabel ] --- + + /** + * Unsafe version of: {@link #glObjectLabel ObjectLabel} + * + * @param length the length of the label to be used for the object + */ + public static void nglObjectLabel(int identifier, int name, int length, long label) { + GL43C.nglObjectLabel(identifier, name, length, label); + } + + /** + * Labels a named object identified within a namespace. + * + * @param identifier the namespace from which the name of the object is allocated. One of:
{@link GL43C#GL_BUFFER BUFFER}{@link GL43C#GL_SHADER SHADER}{@link GL43C#GL_PROGRAM PROGRAM}{@link GL43C#GL_QUERY QUERY}{@link GL43C#GL_PROGRAM_PIPELINE PROGRAM_PIPELINE}{@link GL43C#GL_SAMPLER SAMPLER}{@link GL11#GL_VERTEX_ARRAY VERTEX_ARRAY}{@link GL11#GL_TEXTURE TEXTURE}
{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL40#GL_TRANSFORM_FEEDBACK TRANSFORM_FEEDBACK}
+ * @param name the name of the object to label + * @param label a string containing the label to assign to the object + */ + public static void glObjectLabel(@NativeType("GLenum") int identifier, @NativeType("GLuint") int name, @NativeType("GLchar const *") ByteBuffer label) { + GL43C.glObjectLabel(identifier, name, label); + } + + /** + * Labels a named object identified within a namespace. + * + * @param identifier the namespace from which the name of the object is allocated. One of:
{@link GL43C#GL_BUFFER BUFFER}{@link GL43C#GL_SHADER SHADER}{@link GL43C#GL_PROGRAM PROGRAM}{@link GL43C#GL_QUERY QUERY}{@link GL43C#GL_PROGRAM_PIPELINE PROGRAM_PIPELINE}{@link GL43C#GL_SAMPLER SAMPLER}{@link GL11#GL_VERTEX_ARRAY VERTEX_ARRAY}{@link GL11#GL_TEXTURE TEXTURE}
{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL40#GL_TRANSFORM_FEEDBACK TRANSFORM_FEEDBACK}
+ * @param name the name of the object to label + * @param label a string containing the label to assign to the object + */ + public static void glObjectLabel(@NativeType("GLenum") int identifier, @NativeType("GLuint") int name, @NativeType("GLchar const *") CharSequence label) { + GL43C.glObjectLabel(identifier, name, label); + } + + // --- [ glGetObjectLabel ] --- + + /** + * Unsafe version of: {@link #glGetObjectLabel GetObjectLabel} + * + * @param bufSize the length of the buffer whose address is in {@code label} + */ + public static void nglGetObjectLabel(int identifier, int name, int bufSize, long length, long label) { + GL43C.nglGetObjectLabel(identifier, name, bufSize, length, label); + } + + /** + * Retrieves the label of a named object identified within a namespace. + * + * @param identifier the namespace from which the name of the object is allocated. One of:
{@link GL43C#GL_BUFFER BUFFER}{@link GL43C#GL_SHADER SHADER}{@link GL43C#GL_PROGRAM PROGRAM}{@link GL43C#GL_QUERY QUERY}{@link GL43C#GL_PROGRAM_PIPELINE PROGRAM_PIPELINE}{@link GL43C#GL_SAMPLER SAMPLER}{@link GL11#GL_VERTEX_ARRAY VERTEX_ARRAY}{@link GL11#GL_TEXTURE TEXTURE}
{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL40#GL_TRANSFORM_FEEDBACK TRANSFORM_FEEDBACK}
+ * @param name the name of the object whose label to retrieve + * @param length the address of a variable to receive the length of the object label + * @param label a string that will receive the object label + */ + public static void glGetObjectLabel(@NativeType("GLenum") int identifier, @NativeType("GLuint") int name, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer label) { + GL43C.glGetObjectLabel(identifier, name, length, label); + } + + /** + * Retrieves the label of a named object identified within a namespace. + * + * @param identifier the namespace from which the name of the object is allocated. One of:
{@link GL43C#GL_BUFFER BUFFER}{@link GL43C#GL_SHADER SHADER}{@link GL43C#GL_PROGRAM PROGRAM}{@link GL43C#GL_QUERY QUERY}{@link GL43C#GL_PROGRAM_PIPELINE PROGRAM_PIPELINE}{@link GL43C#GL_SAMPLER SAMPLER}{@link GL11#GL_VERTEX_ARRAY VERTEX_ARRAY}{@link GL11#GL_TEXTURE TEXTURE}
{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL40#GL_TRANSFORM_FEEDBACK TRANSFORM_FEEDBACK}
+ * @param name the name of the object whose label to retrieve + * @param bufSize the length of the buffer whose address is in {@code label} + */ + @NativeType("void") + public static String glGetObjectLabel(@NativeType("GLenum") int identifier, @NativeType("GLuint") int name, @NativeType("GLsizei") int bufSize) { + return GL43C.glGetObjectLabel(identifier, name, bufSize); + } + + /** + * Retrieves the label of a named object identified within a namespace. + * + * @param identifier the namespace from which the name of the object is allocated. One of:
{@link GL43C#GL_BUFFER BUFFER}{@link GL43C#GL_SHADER SHADER}{@link GL43C#GL_PROGRAM PROGRAM}{@link GL43C#GL_QUERY QUERY}{@link GL43C#GL_PROGRAM_PIPELINE PROGRAM_PIPELINE}{@link GL43C#GL_SAMPLER SAMPLER}{@link GL11#GL_VERTEX_ARRAY VERTEX_ARRAY}{@link GL11#GL_TEXTURE TEXTURE}
{@link GL30#GL_RENDERBUFFER RENDERBUFFER}{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL40#GL_TRANSFORM_FEEDBACK TRANSFORM_FEEDBACK}
+ * @param name the name of the object whose label to retrieve + */ + @NativeType("void") + public static String glGetObjectLabel(@NativeType("GLenum") int identifier, @NativeType("GLuint") int name) { + return glGetObjectLabel(identifier, name, GL11.glGetInteger(GL_MAX_LABEL_LENGTH)); + } + + // --- [ glObjectPtrLabel ] --- + + /** + * Unsafe version of: {@link #glObjectPtrLabel ObjectPtrLabel} + * + * @param length the length of the label to be used for the object + */ + public static void nglObjectPtrLabel(long ptr, int length, long label) { + GL43C.nglObjectPtrLabel(ptr, length, label); + } + + /** + * Labels a sync object identified by a pointer. + * + * @param ptr a pointer identifying a sync object + * @param label a string containing the label to assign to the object + */ + public static void glObjectPtrLabel(@NativeType("void *") long ptr, @NativeType("GLchar const *") ByteBuffer label) { + GL43C.glObjectPtrLabel(ptr, label); + } + + /** + * Labels a sync object identified by a pointer. + * + * @param ptr a pointer identifying a sync object + * @param label a string containing the label to assign to the object + */ + public static void glObjectPtrLabel(@NativeType("void *") long ptr, @NativeType("GLchar const *") CharSequence label) { + GL43C.glObjectPtrLabel(ptr, label); + } + + // --- [ glGetObjectPtrLabel ] --- + + /** + * Unsafe version of: {@link #glGetObjectPtrLabel GetObjectPtrLabel} + * + * @param bufSize the length of the buffer whose address is in {@code label} + */ + public static void nglGetObjectPtrLabel(long ptr, int bufSize, long length, long label) { + GL43C.nglGetObjectPtrLabel(ptr, bufSize, length, label); + } + + /** + * Retrieves the label of a sync object identified by a pointer. + * + * @param ptr the name of the sync object whose label to retrieve + * @param length a variable to receive the length of the object label + * @param label a string that will receive the object label + */ + public static void glGetObjectPtrLabel(@NativeType("void *") long ptr, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLchar *") ByteBuffer label) { + GL43C.glGetObjectPtrLabel(ptr, length, label); + } + + /** + * Retrieves the label of a sync object identified by a pointer. + * + * @param ptr the name of the sync object whose label to retrieve + * @param bufSize the length of the buffer whose address is in {@code label} + */ + @NativeType("void") + public static String glGetObjectPtrLabel(@NativeType("void *") long ptr, @NativeType("GLsizei") int bufSize) { + return GL43C.glGetObjectPtrLabel(ptr, bufSize); + } + + /** + * Retrieves the label of a sync object identified by a pointer. + * + * @param ptr the name of the sync object whose label to retrieve + */ + @NativeType("void") + public static String glGetObjectPtrLabel(@NativeType("void *") long ptr) { + return glGetObjectPtrLabel(ptr, GL11.glGetInteger(GL_MAX_LABEL_LENGTH)); + } + + /** Array version of: {@link #glDebugMessageControl DebugMessageControl} */ + public static void glDebugMessageControl(@NativeType("GLenum") int source, @NativeType("GLenum") int type, @NativeType("GLenum") int severity, @Nullable @NativeType("GLuint const *") int[] ids, @NativeType("GLboolean") boolean enabled) { + GL43C.glDebugMessageControl(source, type, severity, ids, enabled); + } + + /** Array version of: {@link #glGetDebugMessageLog GetDebugMessageLog} */ + @NativeType("GLuint") + public static int glGetDebugMessageLog(@NativeType("GLuint") int count, @Nullable @NativeType("GLenum *") int[] sources, @Nullable @NativeType("GLenum *") int[] types, @Nullable @NativeType("GLuint *") int[] ids, @Nullable @NativeType("GLenum *") int[] severities, @Nullable @NativeType("GLsizei *") int[] lengths, @Nullable @NativeType("GLchar *") ByteBuffer messageLog) { + return GL43C.glGetDebugMessageLog(count, sources, types, ids, severities, lengths, messageLog); + } + + /** Array version of: {@link #glGetObjectLabel GetObjectLabel} */ + public static void glGetObjectLabel(@NativeType("GLenum") int identifier, @NativeType("GLuint") int name, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer label) { + GL43C.glGetObjectLabel(identifier, name, length, label); + } + + /** Array version of: {@link #glGetObjectPtrLabel GetObjectPtrLabel} */ + public static void glGetObjectPtrLabel(@NativeType("void *") long ptr, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLchar *") ByteBuffer label) { + GL43C.glGetObjectPtrLabel(ptr, length, label); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRNoError.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRNoError.java new file mode 100644 index 00000000..f361b9d1 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRNoError.java @@ -0,0 +1,25 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the KHR_no_error extension. + * + *

With this extension enabled any behavior that generates a GL error will have undefined behavior. The reason this extension exists is performance can be + * increased and power usage decreased. When this mode is used, a GL driver can have undefined behavior where it would have generated a GL error without + * this extension. This could include application termination. In general this extension should be used after you have verified all the GL errors are + * removed, and an application is not the kind that would check for GL errors and adjust behavior based on those errors.

+ * + *

Requires {@link GL20 OpenGL 2.0}.

+ */ +public final class KHRNoError { + + /** If set in {@link GL30#GL_CONTEXT_FLAGS CONTEXT_FLAGS}, then no error behavior is enabled for this context. */ + public static final int GL_CONTEXT_FLAG_NO_ERROR_BIT_KHR = 0x8; + + private KHRNoError() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRParallelShaderCompile.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRParallelShaderCompile.java new file mode 100644 index 00000000..c5bea233 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRParallelShaderCompile.java @@ -0,0 +1,55 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the KHR_parallel_shader_compile extension. + * + *

Compiling GLSL into implementation-specific code can be a time consuming process, so a GL implementation may wish to perform the compilation in a + * separate CPU thread. This extension provides a mechanism for the application to provide a hint to limit the number of threads it wants to be used to + * compile shaders, as well as a query to determine if the compilation process is complete.

+ */ +public class KHRParallelShaderCompile { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int GL_MAX_SHADER_COMPILER_THREADS_KHR = 0x91B0; + + /** Accepted as part of the {@code pname} parameter to {@link GL20C#glGetShaderiv GetShaderiv} and accepted as part of the {@code pname} parameter to {@link GL20C#glGetProgramiv GetProgramiv}. */ + public static final int GL_COMPLETION_STATUS_KHR = 0x91B1; + + static { GL.initialize(); } + + protected KHRParallelShaderCompile() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glMaxShaderCompilerThreadsKHR + ); + } + + // --- [ glMaxShaderCompilerThreadsKHR ] --- + + /** + * Applications may use this function to hint to the driver the maximum number background threads it would like to be used in the process of compiling + * shaders or linking programs, + * + *

An implementation may combine the maximum compiler thread request from multiple contexts in a share group in an implementation-specific way.

+ * + *

An application can query the current {@code MaxShaderCompilerThreadsKHR} {@code count} by calling {@link GL11C#glGetIntegerv GetIntegerv} with {@code pname} set to + * {@link #GL_MAX_SHADER_COMPILER_THREADS_KHR MAX_SHADER_COMPILER_THREADS_KHR}, which returns the value of the current state.

+ * + * @param count the number of background threads. A {@code count} of zero specifies a request for no parallel compiling or linking and a {@code count} of + * {@code 0xFFFFFFFF} requests an implementation-specific maximum. + */ + public static native void glMaxShaderCompilerThreadsKHR(@NativeType("GLuint") int count); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRRobustness.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRRobustness.java new file mode 100644 index 00000000..c07d5658 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRRobustness.java @@ -0,0 +1,343 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the KHR_robustness extension. + * + *

Several recent trends in how OpenGL ES integrates into modern computer systems have created new requirements for robustness and security for GL + * rendering contexts.

+ * + *

Additionally GPU architectures now support hardware fault detection; for example, video memory supporting ECC (error correcting codes) and error + * detection. GL contexts should be capable of recovering from hardware faults such as uncorrectable memory errors. Along with recovery from such hardware + * faults, the recovery mechanism can also allow recovery from video memory access exceptions and system software failures. System software failures can + * be due to device changes or driver failures.

+ * + *

GL queries that return (write) some number of bytes to a buffer indicated by a pointer parameter introduce risk of buffer overflows that might be + * exploitable by malware. To address this, queries with return value sizes that are not expressed directly by the parameters to the query itself are + * given additional API functions with an additional parameter that specifies the number of bytes in the buffer and never writing bytes beyond that limit. + * This is particularly useful for multi-threaded usage of GL contexts in a "share group" where one context can change objects in ways that can cause + * buffer overflows for another context's GL queries.

+ * + *

The original ARB_vertex_buffer_object extension includes an issue that explicitly states program termination is allowed when out-of-bounds vertex + * buffer object fetches occur. Modern graphics hardware is capable of well-defined behavior in the case of out-of- bounds vertex buffer object fetches. + * Older hardware may require extra checks to enforce well-defined (and termination free) behavior, but this expense is warranted when processing + * potentially untrusted content.

+ * + *

The intent of this extension is to address some specific robustness goals:

+ * + *
    + *
  • For all existing GL queries, provide additional "safe" APIs that limit data written to user pointers to a buffer size in bytes that is an explicit + * additional parameter of the query.
  • + *
  • Provide a mechanism for a GL application to learn about graphics resets that affect the context. When a graphics reset occurs, the GL context + * becomes unusable and the application must create a new context to continue operation. Detecting a graphics reset happens through an inexpensive query.
  • + *
  • Define behavior of OpenGL calls made after a graphics reset.
  • + *
  • Provide an enable to guarantee that out-of-bounds buffer object accesses by the GPU will have deterministic behavior and preclude application + * instability or termination due to an incorrect buffer access. Such accesses include vertex buffer fetches of attributes and indices, and indexed + * reads of uniforms or parameters from buffers.
  • + *
+ * + *

Requires {@link GL32 OpenGL 3.2}.

+ */ +public class KHRRobustness { + + /** Returned by {@link #glGetGraphicsResetStatus GetGraphicsResetStatus}. */ + public static final int + GL_NO_ERROR = 0x0, + GL_GUILTY_CONTEXT_RESET = 0x8253, + GL_INNOCENT_CONTEXT_RESET = 0x8254, + GL_UNKNOWN_CONTEXT_RESET = 0x8255; + + /** Accepted by the {@code value} parameter of GetBooleanv, GetIntegerv, and GetFloatv. */ + public static final int + GL_CONTEXT_ROBUST_ACCESS = 0x90F3, + GL_RESET_NOTIFICATION_STRATEGY = 0x8256; + + /** Returned by GetIntegerv and related simple queries when {@code value} is {@link #GL_RESET_NOTIFICATION_STRATEGY RESET_NOTIFICATION_STRATEGY}. */ + public static final int + GL_LOSE_CONTEXT_ON_RESET = 0x8252, + GL_NO_RESET_NOTIFICATION = 0x8261; + + /** Returned by {@link GL11C#glGetError GetError}. */ + public static final int GL_CONTEXT_LOST = 0x507; + + static { GL.initialize(); } + + protected KHRRobustness() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glGetGraphicsResetStatus, caps.glReadnPixels, caps.glGetnUniformfv, caps.glGetnUniformiv, caps.glGetnUniformuiv + ); + } + + // --- [ glGetGraphicsResetStatus ] --- + + /** + * Indicates if the GL context has been in a reset state at any point since the last call to GetGraphicsResetStatus: + * + *
    + *
  • {@link GL11#GL_NO_ERROR NO_ERROR} indicates that the GL context has not been in a reset state since the last call.
  • + *
  • {@link GL45C#GL_GUILTY_CONTEXT_RESET GUILTY_CONTEXT_RESET} indicates that a reset has been detected that is attributable to the current GL context.
  • + *
  • {@link GL45C#GL_INNOCENT_CONTEXT_RESET INNOCENT_CONTEXT_RESET} indicates a reset has been detected that is not attributable to the current GL context.
  • + *
  • {@link GL45C#GL_UNKNOWN_CONTEXT_RESET UNKNOWN_CONTEXT_RESET} indicates a detected graphics reset whose cause is unknown.
  • + *
+ * + *

If a reset status other than NO_ERROR is returned and subsequent calls return NO_ERROR, the context reset was encountered and completed. If a reset + * status is repeatedly returned, the context may be in the process of resetting.

+ * + *

Reset notification behavior is determined at context creation time, and may be queried by calling GetIntegerv with the symbolic constant + * {@link GL45C#GL_RESET_NOTIFICATION_STRATEGY RESET_NOTIFICATION_STRATEGY}.

+ * + *

If the reset notification behavior is {@link GL45C#GL_NO_RESET_NOTIFICATION NO_RESET_NOTIFICATION}, then the implementation will never deliver notification of reset events, and + * GetGraphicsResetStatus will always return NO_ERROR.

+ * + *

If the behavior is {@link GL45C#GL_LOSE_CONTEXT_ON_RESET LOSE_CONTEXT_ON_RESET}, a graphics reset will result in a lost context and require creating a new context as described + * above. In this case GetGraphicsResetStatus will return an appropriate value from those described above.

+ * + *

If a graphics reset notification occurs in a context, a notification must also occur in all other contexts which share objects with that context.

+ * + *

After a graphics reset has occurred on a context, subsequent GL commands on that context (or any context which shares with that context) will generate a + * {@link GL45C#GL_CONTEXT_LOST CONTEXT_LOST} error. Such commands will not have side effects (in particular, they will not modify memory passed by pointer for query results, + * and may not block indefinitely or cause termination of the application. Exceptions to this behavior include:

+ * + *
    + *
  • {@link GL11C#glGetError GetError} and GetGraphicsResetStatus behave normally following a graphics reset, so that the application can determine a reset has + * occurred, and when it is safe to destroy and recreate the context.
  • + *
  • Any commands which might cause a polling application to block indefinitely will generate a CONTEXT_LOST error, but will also return a value + * indicating completion to the application.
  • + *
+ */ + @NativeType("GLenum") + public static int glGetGraphicsResetStatus() { + return GL45C.glGetGraphicsResetStatus(); + } + + // --- [ glReadnPixels ] --- + + /** + * Unsafe version of: {@link #glReadnPixels ReadnPixels} + * + * @param bufSize the maximum number of bytes to write into {@code data} + */ + public static void nglReadnPixels(int x, int y, int width, int height, int format, int type, int bufSize, long pixels) { + GL45C.nglReadnPixels(x, y, width, height, format, type, bufSize, pixels); + } + + /** + * Behaves identically to {@link GL11C#glReadPixels ReadPixels} except that it does not write more than {@code bufSize} bytes into {@code data} + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param bufSize the maximum number of bytes to write into {@code data} + * @param pixels a buffer in which to place the returned pixel data + */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("GLsizei") int bufSize, @NativeType("void *") long pixels) { + GL45C.glReadnPixels(x, y, width, height, format, type, bufSize, pixels); + } + + /** + * Behaves identically to {@link GL11C#glReadPixels ReadPixels} except that it does not write more than {@code bufSize} bytes into {@code data} + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels a buffer in which to place the returned pixel data + */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ByteBuffer pixels) { + GL45C.glReadnPixels(x, y, width, height, format, type, pixels); + } + + /** + * Behaves identically to {@link GL11C#glReadPixels ReadPixels} except that it does not write more than {@code bufSize} bytes into {@code data} + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels a buffer in which to place the returned pixel data + */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") ShortBuffer pixels) { + GL45C.glReadnPixels(x, y, width, height, format, type, pixels); + } + + /** + * Behaves identically to {@link GL11C#glReadPixels ReadPixels} except that it does not write more than {@code bufSize} bytes into {@code data} + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels a buffer in which to place the returned pixel data + */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") IntBuffer pixels) { + GL45C.glReadnPixels(x, y, width, height, format, type, pixels); + } + + /** + * Behaves identically to {@link GL11C#glReadPixels ReadPixels} except that it does not write more than {@code bufSize} bytes into {@code data} + * + * @param x the left pixel coordinate + * @param y the lower pixel coordinate + * @param width the number of pixels to read in the x-dimension + * @param height the number of pixels to read in the y-dimension + * @param format the pixel format. One of:
{@link GL11#GL_RED RED}{@link GL11#GL_GREEN GREEN}{@link GL11#GL_BLUE BLUE}{@link GL11#GL_ALPHA ALPHA}{@link GL30#GL_RG RG}{@link GL11#GL_RGB RGB}{@link GL11C#GL_RGBA RGBA}{@link GL12#GL_BGR BGR}
{@link GL12#GL_BGRA BGRA}{@link GL30#GL_RED_INTEGER RED_INTEGER}{@link GL30#GL_GREEN_INTEGER GREEN_INTEGER}{@link GL30#GL_BLUE_INTEGER BLUE_INTEGER}{@link GL30#GL_ALPHA_INTEGER ALPHA_INTEGER}{@link GL30#GL_RG_INTEGER RG_INTEGER}{@link GL30#GL_RGB_INTEGER RGB_INTEGER}{@link GL30#GL_RGBA_INTEGER RGBA_INTEGER}
{@link GL30#GL_BGR_INTEGER BGR_INTEGER}{@link GL30#GL_BGRA_INTEGER BGRA_INTEGER}{@link GL11#GL_STENCIL_INDEX STENCIL_INDEX}{@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT}{@link GL30#GL_DEPTH_STENCIL DEPTH_STENCIL}{@link GL11#GL_LUMINANCE LUMINANCE}{@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA}
+ * @param type the pixel type. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_SHORT SHORT}
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL30#GL_HALF_FLOAT HALF_FLOAT}{@link GL11#GL_FLOAT FLOAT}
{@link GL12#GL_UNSIGNED_BYTE_3_3_2 UNSIGNED_BYTE_3_3_2}{@link GL12#GL_UNSIGNED_BYTE_2_3_3_REV UNSIGNED_BYTE_2_3_3_REV}{@link GL12#GL_UNSIGNED_SHORT_5_6_5 UNSIGNED_SHORT_5_6_5}{@link GL12#GL_UNSIGNED_SHORT_5_6_5_REV UNSIGNED_SHORT_5_6_5_REV}
{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4 UNSIGNED_SHORT_4_4_4_4}{@link GL12#GL_UNSIGNED_SHORT_4_4_4_4_REV UNSIGNED_SHORT_4_4_4_4_REV}{@link GL12#GL_UNSIGNED_SHORT_5_5_5_1 UNSIGNED_SHORT_5_5_5_1}{@link GL12#GL_UNSIGNED_SHORT_1_5_5_5_REV UNSIGNED_SHORT_1_5_5_5_REV}
{@link GL12#GL_UNSIGNED_INT_8_8_8_8 UNSIGNED_INT_8_8_8_8}{@link GL12#GL_UNSIGNED_INT_8_8_8_8_REV UNSIGNED_INT_8_8_8_8_REV}{@link GL12#GL_UNSIGNED_INT_10_10_10_2 UNSIGNED_INT_10_10_10_2}{@link GL12#GL_UNSIGNED_INT_2_10_10_10_REV UNSIGNED_INT_2_10_10_10_REV}
{@link GL30#GL_UNSIGNED_INT_24_8 UNSIGNED_INT_24_8}{@link GL30#GL_UNSIGNED_INT_10F_11F_11F_REV UNSIGNED_INT_10F_11F_11F_REV}{@link GL30#GL_UNSIGNED_INT_5_9_9_9_REV UNSIGNED_INT_5_9_9_9_REV}{@link GL30#GL_FLOAT_32_UNSIGNED_INT_24_8_REV FLOAT_32_UNSIGNED_INT_24_8_REV}
{@link GL11#GL_BITMAP BITMAP}
+ * @param pixels a buffer in which to place the returned pixel data + */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") FloatBuffer pixels) { + GL45C.glReadnPixels(x, y, width, height, format, type, pixels); + } + + // --- [ glGetnUniformfv ] --- + + /** + * Unsafe version of: {@link #glGetnUniformfv GetnUniformfv} + * + * @param bufSize the maximum number of bytes to write to {@code params} + */ + public static void nglGetnUniformfv(int program, int location, int bufSize, long params) { + GL45C.nglGetnUniformfv(program, location, bufSize, params); + } + + /** + * Returns the value or values of a uniform of the default uniform block. + * + * @param program the program object + * @param location the uniform location + * @param params the buffer in which to place the returned data + */ + public static void glGetnUniformfv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat *") FloatBuffer params) { + GL45C.glGetnUniformfv(program, location, params); + } + + /** + * Returns the value or values of a uniform of the default uniform block. + * + * @param program the program object + * @param location the uniform location + */ + @NativeType("void") + public static float glGetnUniformf(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + return GL45C.glGetnUniformf(program, location); + } + + // --- [ glGetnUniformiv ] --- + + /** + * Unsafe version of: {@link #glGetnUniformiv GetnUniformiv} + * + * @param bufSize the maximum number of bytes to write to {@code params} + */ + public static void nglGetnUniformiv(int program, int location, int bufSize, long params) { + GL45C.nglGetnUniformiv(program, location, bufSize, params); + } + + /** + * Integer version of {@link #glGetnUniformfv GetnUniformfv}. + * + * @param program the program object + * @param location the uniform location + * @param params the buffer in which to place the returned data + */ + public static void glGetnUniformiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint *") IntBuffer params) { + GL45C.glGetnUniformiv(program, location, params); + } + + /** + * Integer version of {@link #glGetnUniformfv GetnUniformfv}. + * + * @param program the program object + * @param location the uniform location + */ + @NativeType("void") + public static int glGetnUniformi(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + return GL45C.glGetnUniformi(program, location); + } + + // --- [ glGetnUniformuiv ] --- + + /** + * Unsafe version of: {@link #glGetnUniformuiv GetnUniformuiv} + * + * @param bufSize the maximum number of bytes to write to {@code params} + */ + public static void nglGetnUniformuiv(int program, int location, int bufSize, long params) { + GL45C.nglGetnUniformuiv(program, location, bufSize, params); + } + + /** + * Unsigned version of {@link #glGetnUniformiv GetnUniformiv}. + * + * @param program the program object + * @param location the uniform location + * @param params the buffer in which to place the returned data + */ + public static void glGetnUniformuiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint *") IntBuffer params) { + GL45C.glGetnUniformuiv(program, location, params); + } + + /** + * Unsigned version of {@link #glGetnUniformiv GetnUniformiv}. + * + * @param program the program object + * @param location the uniform location + */ + @NativeType("void") + public static int glGetnUniformui(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + return GL45C.glGetnUniformui(program, location); + } + + /** Array version of: {@link #glReadnPixels ReadnPixels} */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") short[] pixels) { + GL45C.glReadnPixels(x, y, width, height, format, type, pixels); + } + + /** Array version of: {@link #glReadnPixels ReadnPixels} */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") int[] pixels) { + GL45C.glReadnPixels(x, y, width, height, format, type, pixels); + } + + /** Array version of: {@link #glReadnPixels ReadnPixels} */ + public static void glReadnPixels(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLenum") int format, @NativeType("GLenum") int type, @NativeType("void *") float[] pixels) { + GL45C.glReadnPixels(x, y, width, height, format, type, pixels); + } + + /** Array version of: {@link #glGetnUniformfv GetnUniformfv} */ + public static void glGetnUniformfv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLfloat *") float[] params) { + GL45C.glGetnUniformfv(program, location, params); + } + + /** Array version of: {@link #glGetnUniformiv GetnUniformiv} */ + public static void glGetnUniformiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint *") int[] params) { + GL45C.glGetnUniformiv(program, location, params); + } + + /** Array version of: {@link #glGetnUniformuiv GetnUniformuiv} */ + public static void glGetnUniformuiv(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint *") int[] params) { + GL45C.glGetnUniformuiv(program, location, params); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRShaderSubgroup.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRShaderSubgroup.java new file mode 100644 index 00000000..25689ee1 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRShaderSubgroup.java @@ -0,0 +1,51 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the KHR_shader_subgroup extension. + * + *

This extension enables support for the {@code KHR_shader_subgroup} shading language extension in OpenGL.

+ * + *

The extension adds API queries to be able to query

+ * + *
    + *
  • the size of subgroups in this implementation ({@link #GL_SUBGROUP_SIZE_KHR SUBGROUP_SIZE_KHR})
  • + *
  • which shader stages support subgroup operations ({@link #GL_SUBGROUP_SUPPORTED_STAGES_KHR SUBGROUP_SUPPORTED_STAGES_KHR})
  • + *
  • which subgroup features are supported ({@link #GL_SUBGROUP_SUPPORTED_FEATURES_KHR SUBGROUP_SUPPORTED_FEATURES_KHR})
  • + *
  • whether quad subgroup operations are supported in all stages supporting subgroup operations ({@link #GL_SUBGROUP_QUAD_ALL_STAGES_KHR SUBGROUP_QUAD_ALL_STAGES_KHR})
  • + *
+ * + *

In OpenGL implementations supporting SPIR-V, this extension enables the minimal subset of SPIR-V 1.3 which is required to support the subgroup features + * that are supported by the implementation.

+ * + *

Requires {@link GL43 OpenGL 4.3}.

+ */ +public final class KHRShaderSubgroup { + + /** Accepted as the {@code pname} argument for {@link GL11C#glGetIntegerv GetIntegerv} and {@link GL32C#glGetInteger64v GetInteger64v}. */ + public static final int + GL_SUBGROUP_SIZE_KHR = 0x9532, + GL_SUBGROUP_SUPPORTED_STAGES_KHR = 0x9533, + GL_SUBGROUP_SUPPORTED_FEATURES_KHR = 0x9534; + + /** Accepted as the {@code pname} argument for {@link GL11C#glGetBooleanv GetBooleanv}. */ + public static final int GL_SUBGROUP_QUAD_ALL_STAGES_KHR = 0x9535; + + /** Returned as bitfield in the {@code data} argument when {@link GL11C#glGetIntegerv GetIntegerv} is queried with a {@code pname} of {@link #GL_SUBGROUP_SUPPORTED_FEATURES_KHR SUBGROUP_SUPPORTED_FEATURES_KHR}. */ + public static final int + GL_SUBGROUP_FEATURE_BASIC_BIT_KHR = 0x1, + GL_SUBGROUP_FEATURE_VOTE_BIT_KHR = 0x2, + GL_SUBGROUP_FEATURE_ARITHMETIC_BIT_KHR = 0x4, + GL_SUBGROUP_FEATURE_BALLOT_BIT_KHR = 0x8, + GL_SUBGROUP_FEATURE_SHUFFLE_BIT_KHR = 0x10, + GL_SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT_KHR = 0x20, + GL_SUBGROUP_FEATURE_CLUSTERED_BIT_KHR = 0x40, + GL_SUBGROUP_FEATURE_QUAD_BIT_KHR = 0x80; + + private KHRShaderSubgroup() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRTextureCompressionASTCLDR.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRTextureCompressionASTCLDR.java new file mode 100644 index 00000000..a5191b11 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/KHRTextureCompressionASTCLDR.java @@ -0,0 +1,80 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the KHR_texture_compression_astc_ldr extension. + * + *

Adaptive Scalable Texture Compression (ASTC) is a new texture compression technology that offers unprecendented flexibility, while producing better or + * comparable results than existing texture compressions at all bit rates. It includes support for 2D and slice-based 3D textures, with low and high + * dynamic range, at bitrates from below 1 bit/pixel up to 8 bits/pixel in fine steps.

+ * + *

The goal of this extension is to support the full 2D profile of the ASTC texture compression specification, and allow construction of 3D textures from + * multiple 2D slices.

+ * + *

ASTC-compressed textures are handled in OpenGL by adding new supported formats to the existing mechanisms for handling compressed textures.

+ * + *

What is ASTC

+ * + *

ASTC stands for Adaptive Scalable Texture Compression. The ASTC formats form a family of related compressed texture image formats. They are all derived + * from a common set of definitions.

+ * + *

ASTC textures may be either 2D or 3D.

+ * + *

ASTC textures may be encoded using either high or low dynamic range. Low dynamic range images may optionally be specified using the sRGB color space.

+ * + *

A sub-profile ("HDR Profile") is defined, which supports only 2D images (and 3D images made up of multiple 2D slices) at low or high dynamic range.

+ * + *

Support for this profile is indicated by the presence of the extension string "GL_KHR_texture_compression_astc_hdr". If, in future, the full profile is + * supported, "GL_KHR_texture_compression_astc_hdr" must still be published, in order to ensure backward compatibility.

+ * + *

A lower sub-profile ("LDR Profile") may be implemented, which supports only 2D images at low dynamic range. This is indicated by the presence of the + * extension string "GL_KHR_texture_compression_astc_ldr". If either the HDR or full profile are implemented, then both name strings + * "GL_KHR_texture_compression_astc_ldr" and "GL_KHR_texture_compression_astc_hdr" must be published.

+ * + *

ASTC textures may be encoded as 1, 2, 3 or 4 components, but they are all decoded into RGBA.

+ * + *

ASTC has a variable block size, and this is specified as part of the name of the token passed to CompressedImage2D and its related functions.

+ */ +public final class KHRTextureCompressionASTCLDR { + + /** + * Accepted by the {@code internalformat} parameter of CompressedTexImage2D, CompressedTexSubImage2D, TexStorage2D, TextureStorage2D, TexStorage3D, and + * TextureStorage3D. + */ + public static final int + GL_COMPRESSED_RGBA_ASTC_4x4_KHR = 0x93B0, + GL_COMPRESSED_RGBA_ASTC_5x4_KHR = 0x93B1, + GL_COMPRESSED_RGBA_ASTC_5x5_KHR = 0x93B2, + GL_COMPRESSED_RGBA_ASTC_6x5_KHR = 0x93B3, + GL_COMPRESSED_RGBA_ASTC_6x6_KHR = 0x93B4, + GL_COMPRESSED_RGBA_ASTC_8x5_KHR = 0x93B5, + GL_COMPRESSED_RGBA_ASTC_8x6_KHR = 0x93B6, + GL_COMPRESSED_RGBA_ASTC_8x8_KHR = 0x93B7, + GL_COMPRESSED_RGBA_ASTC_10x5_KHR = 0x93B8, + GL_COMPRESSED_RGBA_ASTC_10x6_KHR = 0x93B9, + GL_COMPRESSED_RGBA_ASTC_10x8_KHR = 0x93BA, + GL_COMPRESSED_RGBA_ASTC_10x10_KHR = 0x93BB, + GL_COMPRESSED_RGBA_ASTC_12x10_KHR = 0x93BC, + GL_COMPRESSED_RGBA_ASTC_12x12_KHR = 0x93BD, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_4x4_KHR = 0x93D0, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x4_KHR = 0x93D1, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_5x5_KHR = 0x93D2, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x5_KHR = 0x93D3, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_6x6_KHR = 0x93D4, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x5_KHR = 0x93D5, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x6_KHR = 0x93D6, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_8x8_KHR = 0x93D7, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x5_KHR = 0x93D8, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x6_KHR = 0x93D9, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x8_KHR = 0x93DA, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_10x10_KHR = 0x93DB, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x10_KHR = 0x93DC, + GL_COMPRESSED_SRGB8_ALPHA8_ASTC_12x12_KHR = 0x93DD; + + private KHRTextureCompressionASTCLDR() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVAlphaToCoverageDitherControl.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVAlphaToCoverageDitherControl.java new file mode 100644 index 00000000..ec304f07 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVAlphaToCoverageDitherControl.java @@ -0,0 +1,45 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the NV_alpha_to_coverage_dither_control extension. + * + *

{@code NV_alpha_to_coverage_dither_control} provides a new mechanism to control whether dithering is applied when the existing alpha to coverage + * functionality is used.

+ */ +public class NVAlphaToCoverageDitherControl { + + /** Accepted by the {@code param} parameter of {@link #glAlphaToCoverageDitherControlNV AlphaToCoverageDitherControlNV}. */ + public static final int + GL_ALPHA_TO_COVERAGE_DITHER_DEFAULT_NV = 0x934D, + GL_ALPHA_TO_COVERAGE_DITHER_ENABLE_NV = 0x934E, + GL_ALPHA_TO_COVERAGE_DITHER_DISABLE_NV = 0x934F; + + /** Accepted by the {@code param} of {@link GL11C#glGetIntegerv GetIntegerv}. */ + public static final int GL_ALPHA_TO_COVERAGE_DITHER_MODE_NV = 0x92BF; + + static { GL.initialize(); } + + protected NVAlphaToCoverageDitherControl() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glAlphaToCoverageDitherControlNV + ); + } + + // --- [ glAlphaToCoverageDitherControlNV ] --- + + public static native void glAlphaToCoverageDitherControlNV(@NativeType("GLenum") int mode); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBindlessMultiDrawIndirect.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBindlessMultiDrawIndirect.java new file mode 100644 index 00000000..e21b1c41 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBindlessMultiDrawIndirect.java @@ -0,0 +1,175 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_bindless_multi_draw_indirect extension. + * + *

This extension combines {@code NV_vertex_buffer_unified_memory} and {@code ARB_multi_draw_indirect} to allow the processing of multiple drawing + * commands, whose vertex and index data can be sourced from arbitrary buffer locations, by a single function call.

+ * + *

The {@code NV_vertex_buffer_unified_memory} extension provided a mechanism to specify vertex attrib and element array locations using GPU addresses. + * Prior to this extension, these addresses had to be set through explicit function calls. Now the ability to set the pointer addresses indirectly by + * extending the {@link ARBDrawIndirect ARB_draw_indirect} mechanism has been added.

+ * + *

Combined with other "bindless" extensions, such as {@link NVBindlessTexture NV_bindless_texture} and {@link NVShaderBufferLoad NV_shader_buffer_load}, it is now possible for the GPU to + * create draw commands that source all resource inputs, which are common to change frequently between draw calls from the GPU: vertex and index buffers, + * samplers, images and other shader input data stored in buffers.

+ * + *

Requires {@link GL43 OpenGL 4.3} or {@link ARBMultiDrawIndirect ARB_multi_draw_indirect}, and {@link NVVertexBufferUnifiedMemory NV_vertex_buffer_unified_memory}.

+ */ +public class NVBindlessMultiDrawIndirect { + + static { GL.initialize(); } + + protected NVBindlessMultiDrawIndirect() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glMultiDrawArraysIndirectBindlessNV, caps.glMultiDrawElementsIndirectBindlessNV + ); + } + + // --- [ glMultiDrawArraysIndirectBindlessNV ] --- + + /** Unsafe version of: {@link #glMultiDrawArraysIndirectBindlessNV MultiDrawArraysIndirectBindlessNV} */ + public static native void nglMultiDrawArraysIndirectBindlessNV(int mode, long indirect, int drawCount, int stride, int vertexBufferCount); + + /** + * Behaves similar to {@link GL43C#glMultiDrawArraysIndirect MultiDrawArraysIndirect}, except that {@code indirect} is treated as an array of {@code drawCount} + * {@code DrawArraysIndirectBindlessCommandNV} structures: + * + *

+     * typedef struct {
+     *   GLuint   index;
+     *   GLuint   reserved;
+     *   GLuint64 address;
+     *   GLuint64 length;
+     * } BindlessPtrNV;
+     * 
+     * typedef struct {
+     *   DrawArraysIndirectCommand   cmd;
+     *   BindlessPtrNV               vertexBuffers[];
+     * } DrawArraysIndirectBindlessCommandNV;
+ * + * @param mode the primitive mode. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect an array of {@code DrawArraysIndirectBindlessCommandNV} structures (see the extension spec for more information) + * @param drawCount the number of structures in the {@code indirect} array + * @param stride the size of one {@code DrawArraysIndirectBindlessCommandNV} structure + * @param vertexBufferCount the number of vertex buffers in the {@code DrawArraysIndirectBindlessCommandNV} structure + */ + public static void glMultiDrawArraysIndirectBindlessNV(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indirect, @NativeType("GLsizei") int drawCount, @NativeType("GLsizei") int stride, @NativeType("GLint") int vertexBufferCount) { + if (CHECKS) { + check(indirect, drawCount * (stride == 0 ? (16 + vertexBufferCount * 24) : stride)); + } + nglMultiDrawArraysIndirectBindlessNV(mode, memAddress(indirect), drawCount, stride, vertexBufferCount); + } + + /** + * Behaves similar to {@link GL43C#glMultiDrawArraysIndirect MultiDrawArraysIndirect}, except that {@code indirect} is treated as an array of {@code drawCount} + * {@code DrawArraysIndirectBindlessCommandNV} structures: + * + *

+     * typedef struct {
+     *   GLuint   index;
+     *   GLuint   reserved;
+     *   GLuint64 address;
+     *   GLuint64 length;
+     * } BindlessPtrNV;
+     * 
+     * typedef struct {
+     *   DrawArraysIndirectCommand   cmd;
+     *   BindlessPtrNV               vertexBuffers[];
+     * } DrawArraysIndirectBindlessCommandNV;
+ * + * @param mode the primitive mode. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect an array of {@code DrawArraysIndirectBindlessCommandNV} structures (see the extension spec for more information) + * @param drawCount the number of structures in the {@code indirect} array + * @param stride the size of one {@code DrawArraysIndirectBindlessCommandNV} structure + * @param vertexBufferCount the number of vertex buffers in the {@code DrawArraysIndirectBindlessCommandNV} structure + */ + public static void glMultiDrawArraysIndirectBindlessNV(@NativeType("GLenum") int mode, @NativeType("void const *") long indirect, @NativeType("GLsizei") int drawCount, @NativeType("GLsizei") int stride, @NativeType("GLint") int vertexBufferCount) { + nglMultiDrawArraysIndirectBindlessNV(mode, indirect, drawCount, stride, vertexBufferCount); + } + + // --- [ glMultiDrawElementsIndirectBindlessNV ] --- + + /** Unsafe version of: {@link #glMultiDrawElementsIndirectBindlessNV MultiDrawElementsIndirectBindlessNV} */ + public static native void nglMultiDrawElementsIndirectBindlessNV(int mode, int type, long indirect, int drawCount, int stride, int vertexBufferCount); + + /** + * Behaves similar to {@link GL43C#glMultiDrawElementsIndirect MultiDrawElementsIndirect}, except that {@code indirect} is treated as an array of {@code drawCount} + * {@code DrawElementsIndirectBindlessCommandNV} structures: + * + *

+     *  typedef struct {
+     *   GLuint   index;
+     *   GLuint   reserved;
+     *   GLuint64 address;
+     *   GLuint64 length;
+     * } BindlessPtrNV;
+     * 
+     * typedef struct {
+     *   DrawElementsIndirectCommand cmd;
+     *   GLuint                      reserved;
+     *   BindlessPtrNV               indexBuffer;
+     *   BindlessPtrNV               vertexBuffers[];
+     * } DrawElementsIndirectBindlessCommandNV;
+ * + * @param mode the primitive mode. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the data type of the element indices. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect an array of {@code DrawElementsIndirectBindlessCommandNV} structures (see the extension spec for more information) + * @param drawCount the number of structures in the {@code indirect} array + * @param stride the size of one {@code DrawElementsIndirectBindlessCommandNV} structure + * @param vertexBufferCount the number of vertex buffers in the {@code DrawElementsIndirectBindlessCommandNV} structure + */ + public static void glMultiDrawElementsIndirectBindlessNV(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indirect, @NativeType("GLsizei") int drawCount, @NativeType("GLsizei") int stride, @NativeType("GLint") int vertexBufferCount) { + if (CHECKS) { + check(indirect, drawCount * (stride == 0 ? ((vertexBufferCount + 2) * 24) : stride)); + } + nglMultiDrawElementsIndirectBindlessNV(mode, type, memAddress(indirect), drawCount, stride, vertexBufferCount); + } + + /** + * Behaves similar to {@link GL43C#glMultiDrawElementsIndirect MultiDrawElementsIndirect}, except that {@code indirect} is treated as an array of {@code drawCount} + * {@code DrawElementsIndirectBindlessCommandNV} structures: + * + *

+     *  typedef struct {
+     *   GLuint   index;
+     *   GLuint   reserved;
+     *   GLuint64 address;
+     *   GLuint64 length;
+     * } BindlessPtrNV;
+     * 
+     * typedef struct {
+     *   DrawElementsIndirectCommand cmd;
+     *   GLuint                      reserved;
+     *   BindlessPtrNV               indexBuffer;
+     *   BindlessPtrNV               vertexBuffers[];
+     * } DrawElementsIndirectBindlessCommandNV;
+ * + * @param mode the primitive mode. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the data type of the element indices. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect an array of {@code DrawElementsIndirectBindlessCommandNV} structures (see the extension spec for more information) + * @param drawCount the number of structures in the {@code indirect} array + * @param stride the size of one {@code DrawElementsIndirectBindlessCommandNV} structure + * @param vertexBufferCount the number of vertex buffers in the {@code DrawElementsIndirectBindlessCommandNV} structure + */ + public static void glMultiDrawElementsIndirectBindlessNV(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") long indirect, @NativeType("GLsizei") int drawCount, @NativeType("GLsizei") int stride, @NativeType("GLint") int vertexBufferCount) { + nglMultiDrawElementsIndirectBindlessNV(mode, type, indirect, drawCount, stride, vertexBufferCount); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBindlessMultiDrawIndirectCount.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBindlessMultiDrawIndirectCount.java new file mode 100644 index 00000000..e7b463da --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBindlessMultiDrawIndirectCount.java @@ -0,0 +1,123 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_bindless_multi_draw_indirect_count extension. + * + *

This extension adds the possibility to define the number of drawcalls within a multi-draw-indirect call from the GPU, as provided by + * {@code ARB_indirect_parameters}, for the functions added in {@code NV_bindless_multi_draw_indirect}.

+ * + *

Requires {@link NVBindlessMultiDrawIndirect NV_bindless_multi_draw_indirect}, {@link ARBIndirectParameters ARB_indirect_parameters}.

+ */ +public class NVBindlessMultiDrawIndirectCount { + + static { GL.initialize(); } + + protected NVBindlessMultiDrawIndirectCount() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glMultiDrawArraysIndirectBindlessCountNV, caps.glMultiDrawElementsIndirectBindlessCountNV + ); + } + + // --- [ glMultiDrawArraysIndirectBindlessCountNV ] --- + + /** Unsafe version of: {@link #glMultiDrawArraysIndirectBindlessCountNV MultiDrawArraysIndirectBindlessCountNV} */ + public static native void nglMultiDrawArraysIndirectBindlessCountNV(int mode, long indirect, long drawCount, int maxDrawCount, int stride, int vertexBufferCount); + + /** + * Behaves similarly to {@link NVBindlessMultiDrawIndirect#glMultiDrawArraysIndirectBindlessNV MultiDrawArraysIndirectBindlessNV}, except that {@code drawCount} defines an offset (in bytes) into + * the buffer object bound to the PARAMETER_BUFFER_ARB binding point at which a single {@code sizei} typed value is stored, which contains the draw count. + * If the value stored at {@code drawCount} into the buffer is greater than {@code maxDrawCount}, an implementation may stop processing draws after + * {@code maxDrawCount} parameter sets. + * + * @param mode the primitive mode. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect an array of DrawArraysIndirectBindlessCommandNV structures (see the extension spec for more information) + * @param drawCount the byte offset into the buffer object containing the draw count. This offset must be a multiple of 4 + * @param maxDrawCount the maximum number of draws that are expected to be stored in the buffer + * @param stride the size of one DrawArraysIndirectBindlessCommandNV structure + * @param vertexBufferCount the number of vertex buffers in the DrawArraysIndirectBindlessCommandNV structure + */ + public static void glMultiDrawArraysIndirectBindlessCountNV(@NativeType("GLenum") int mode, @NativeType("void const *") ByteBuffer indirect, @NativeType("GLintptr") long drawCount, @NativeType("GLsizei") int maxDrawCount, @NativeType("GLsizei") int stride, @NativeType("GLint") int vertexBufferCount) { + if (CHECKS) { + check(indirect, maxDrawCount * (stride == 0 ? (16 + vertexBufferCount * 24) : stride)); + } + nglMultiDrawArraysIndirectBindlessCountNV(mode, memAddress(indirect), drawCount, maxDrawCount, stride, vertexBufferCount); + } + + /** + * Behaves similarly to {@link NVBindlessMultiDrawIndirect#glMultiDrawArraysIndirectBindlessNV MultiDrawArraysIndirectBindlessNV}, except that {@code drawCount} defines an offset (in bytes) into + * the buffer object bound to the PARAMETER_BUFFER_ARB binding point at which a single {@code sizei} typed value is stored, which contains the draw count. + * If the value stored at {@code drawCount} into the buffer is greater than {@code maxDrawCount}, an implementation may stop processing draws after + * {@code maxDrawCount} parameter sets. + * + * @param mode the primitive mode. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param indirect an array of DrawArraysIndirectBindlessCommandNV structures (see the extension spec for more information) + * @param drawCount the byte offset into the buffer object containing the draw count. This offset must be a multiple of 4 + * @param maxDrawCount the maximum number of draws that are expected to be stored in the buffer + * @param stride the size of one DrawArraysIndirectBindlessCommandNV structure + * @param vertexBufferCount the number of vertex buffers in the DrawArraysIndirectBindlessCommandNV structure + */ + public static void glMultiDrawArraysIndirectBindlessCountNV(@NativeType("GLenum") int mode, @NativeType("void const *") long indirect, @NativeType("GLintptr") long drawCount, @NativeType("GLsizei") int maxDrawCount, @NativeType("GLsizei") int stride, @NativeType("GLint") int vertexBufferCount) { + nglMultiDrawArraysIndirectBindlessCountNV(mode, indirect, drawCount, maxDrawCount, stride, vertexBufferCount); + } + + // --- [ glMultiDrawElementsIndirectBindlessCountNV ] --- + + /** Unsafe version of: {@link #glMultiDrawElementsIndirectBindlessCountNV MultiDrawElementsIndirectBindlessCountNV} */ + public static native void nglMultiDrawElementsIndirectBindlessCountNV(int mode, int type, long indirect, long drawCount, int maxDrawCount, int stride, int vertexBufferCount); + + /** + * Behaves similarly to {@link NVBindlessMultiDrawIndirect#glMultiDrawElementsIndirectBindlessNV MultiDrawElementsIndirectBindlessNV}, except that {@code drawCount} defines an offset (in bytes) into + * the buffer object bound to the PARAMETER_BUFFER_ARB binding point at which a single {@code sizei} typed value is stored, which contains the draw count. + * If the value stored at {@code drawCount} into the buffer is greater than {@code maxDrawCount}, an implementation may stop processing draws after + * {@code maxDrawCount} parameter sets. + * + * @param mode the primitive mode. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the data type of the element indices. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect an array of DrawElementsIndirectBindlessCommandNV structures (see the extension spec for more information) + * @param drawCount the byte offset into the buffer object containing the draw count. This offset must be a multiple of 4 + * @param maxDrawCount the maximum number of draws that are expected to be stored in the buffer + * @param stride the size of one DrawElementsIndirectBindlessCommandNV structure + * @param vertexBufferCount the number of vertex buffers in the DrawElementsIndirectBindlessCommandNV structure + */ + public static void glMultiDrawElementsIndirectBindlessCountNV(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer indirect, @NativeType("GLintptr") long drawCount, @NativeType("GLsizei") int maxDrawCount, @NativeType("GLsizei") int stride, @NativeType("GLint") int vertexBufferCount) { + if (CHECKS) { + check(indirect, maxDrawCount * (stride == 0 ? ((vertexBufferCount + 2) * 24) : stride)); + } + nglMultiDrawElementsIndirectBindlessCountNV(mode, type, memAddress(indirect), drawCount, maxDrawCount, stride, vertexBufferCount); + } + + /** + * Behaves similarly to {@link NVBindlessMultiDrawIndirect#glMultiDrawElementsIndirectBindlessNV MultiDrawElementsIndirectBindlessNV}, except that {@code drawCount} defines an offset (in bytes) into + * the buffer object bound to the PARAMETER_BUFFER_ARB binding point at which a single {@code sizei} typed value is stored, which contains the draw count. + * If the value stored at {@code drawCount} into the buffer is greater than {@code maxDrawCount}, an implementation may stop processing draws after + * {@code maxDrawCount} parameter sets. + * + * @param mode the primitive mode. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINE_STRIP LINE_STRIP}{@link GL11#GL_LINE_LOOP LINE_LOOP}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLE_STRIP TRIANGLE_STRIP}{@link GL11#GL_TRIANGLE_FAN TRIANGLE_FAN}{@link GL11#GL_TRIANGLES TRIANGLES}
{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_LINE_STRIP_ADJACENCY LINE_STRIP_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL32#GL_TRIANGLE_STRIP_ADJACENCY TRIANGLE_STRIP_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}{@link GL11#GL_POLYGON POLYGON}{@link GL11#GL_QUADS QUADS}
{@link GL11#GL_QUAD_STRIP QUAD_STRIP}
+ * @param type the data type of the element indices. One of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}
+ * @param indirect an array of DrawElementsIndirectBindlessCommandNV structures (see the extension spec for more information) + * @param drawCount the byte offset into the buffer object containing the draw count. This offset must be a multiple of 4 + * @param maxDrawCount the maximum number of draws that are expected to be stored in the buffer + * @param stride the size of one DrawElementsIndirectBindlessCommandNV structure + * @param vertexBufferCount the number of vertex buffers in the DrawElementsIndirectBindlessCommandNV structure + */ + public static void glMultiDrawElementsIndirectBindlessCountNV(@NativeType("GLenum") int mode, @NativeType("GLenum") int type, @NativeType("void const *") long indirect, @NativeType("GLintptr") long drawCount, @NativeType("GLsizei") int maxDrawCount, @NativeType("GLsizei") int stride, @NativeType("GLint") int vertexBufferCount) { + nglMultiDrawElementsIndirectBindlessCountNV(mode, type, indirect, drawCount, maxDrawCount, stride, vertexBufferCount); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBindlessTexture.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBindlessTexture.java new file mode 100644 index 00000000..3fdc6037 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBindlessTexture.java @@ -0,0 +1,327 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_bindless_texture extension. + * + *

This extension allows OpenGL applications to access texture objects in + * shaders without first binding each texture to one of a limited number of + * texture image units. Using this extension, an application can query a + * 64-bit unsigned integer texture handle for each texture that it wants to + * access and then use that handle directly in GLSL or assembly-based + * shaders. The ability to access textures without having to bind and/or + * re-bind them is similar to the capability provided by the + * NV_shader_buffer_load extension that allows shaders to access buffer + * objects without binding them. In both cases, these extensions + * significantly reduce the amount of API and internal GL driver overhead + * needed to manage resource bindings.

+ * + *

This extension also provides similar capability for the image load, store, + * and atomic functionality provided by OpenGL 4.2, OpenGL ES 3.1 and the + * ARB_shader_image_load_store and EXT_shader_image_load_store extensions, + * where a texture can be accessed without first binding it to an image unit. + * An image handle can be extracted from a texture object using an API with a + * set of parameters similar to those for BindImageTextureEXT.

+ * + *

This extension adds no new data types to GLSL. Instead, it uses existing + * sampler and image data types and allows them to be populated with texture + * and image handles. This extension does permit sampler and image data + * types to be used in more contexts than in unextended GLSL 4.00. In + * particular, sampler and image types may be used as shader inputs/outputs, + * temporary variables, and uniform block members, and may be assigned to by + * shader code. Constructors are provided to convert 64-bit unsigned integer + * values to and from sampler and image data types. Additionally, new APIs + * are provided to load values for sampler and image uniforms with 64-bit + * handle inputs. The use of existing integer-based Uniform* APIs is still + * permitted, in which case the integer specified will identify a texture + * image or image unit. For samplers and images with values specified as + * texture image or image units, the GL implemenation will translate the unit + * number to an internal handle as required.

+ * + *

To access texture or image resources using handles, the handles must first + * be made resident. Accessing a texture or image by handle without first + * making it resident can result in undefined results, including program + * termination. Since the amount of texture memory required by an + * application may exceed the amount of memory available to the system, this + * extension provides API calls allowing applications to manage overall + * texture memory consumption by making a texture resident and non-resident + * as required.

+ * + *

Requires {@link GL40 OpenGL 4.0}.

+ */ +public class NVBindlessTexture { + + static { GL.initialize(); } + + protected NVBindlessTexture() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glGetTextureHandleNV, caps.glGetTextureSamplerHandleNV, caps.glMakeTextureHandleResidentNV, caps.glMakeTextureHandleNonResidentNV, + caps.glGetImageHandleNV, caps.glMakeImageHandleResidentNV, caps.glMakeImageHandleNonResidentNV, caps.glUniformHandleui64NV, + caps.glUniformHandleui64vNV, caps.glProgramUniformHandleui64NV, caps.glProgramUniformHandleui64vNV, caps.glIsTextureHandleResidentNV, + caps.glIsImageHandleResidentNV + ); + } + + // --- [ glGetTextureHandleNV ] --- + + /** + * Creates a texture handle using the current state of the texture named {@code texture}, including any embedded sampler state. See + * {@link #glGetTextureSamplerHandleNV GetTextureSamplerHandleNV} for details. + * + * @param texture the texture object + */ + @NativeType("GLuint64") + public static native long glGetTextureHandleNV(@NativeType("GLuint") int texture); + + // --- [ glGetTextureSamplerHandleNV ] --- + + /** + * Creates a texture handle using the current non-sampler state from the texture named {@code texture} and the sampler state from the sampler object + * {@code sampler}. In both cases, a 64-bit unsigned integer handle is returned. The error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} is generated if {@code texture} is zero or is + * not the name of an existing texture object or if {@code sampler} is zero or is not the name of an existing sampler object. The error + * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated if the texture object {@code texture} is not complete. If an error occurs, a handle of zero is returned. + * + *

The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated if the border color (taken from the embedded sampler for GetTextureHandleNV or from the {@code sampler} + * for GetTextureSamplerHandleNV) is not one of the following allowed values. If the texture's base internal format is signed or unsigned integer, allowed + * values are (0,0,0,0), (0,0,0,1), (1,1,1,0), and (1,1,1,1). If the base internal format is not integer, allowed values are (0.0,0.0,0.0,0.0), + * (0.0,0.0,0.0,1.0), (1.0,1.0,1.0,0.0), and (1.0,1.0,1.0,1.0).

+ * + *

The handle for each texture or texture/sampler pair is unique; the same handle will be returned if GetTextureHandleNV is called multiple times for the + * same texture or if GetTextureSamplerHandleNV is called multiple times for the same texture/sampler pair.

+ * + *

When a texture object is referenced by one or more texture handles, the texture parameters of the object may not be changed, and the size and format of + * the images in the texture object may not be re-specified. The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated if the functions TexImage*, CopyTexImage*, + * CompressedTexImage*, TexBuffer*, or TexParameter* are called to modify a texture object referenced by one or more texture handles. The contents of the + * images in a texture object may still be updated via commands such as TexSubImage*, CopyTexSubImage*, and CompressedTexSubImage*, and by rendering to a + * framebuffer object, even if the texture object is referenced by one or more texture handles.

+ * + *

The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated by {@link GL15C#glBufferData BufferData} if it is called to modify a buffer object bound to a buffer texture while that + * texture object is referenced by one or more texture handles. The contents of the buffer object may still be updated via buffer update commands such as + * {@link GL15C#glBufferSubData BufferSubData} and MapBuffer*, or via the texture update commands, even if the buffer is bound to a texture while that buffer texture object is + * referenced by one or more texture handles.

+ * + *

When a sampler object is referenced by one or more texture handles, the sampler parameters of the object may not be changed. The error + * {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated when calling SamplerParameter* functions to modify a sampler object referenced by one or more texture handles.

+ * + * @param texture the texture object + * @param sampler the sampler object + */ + @NativeType("GLuint64") + public static native long glGetTextureSamplerHandleNV(@NativeType("GLuint") int texture, @NativeType("GLuint") int sampler); + + // --- [ glMakeTextureHandleResidentNV ] --- + + /** + * Make a texture handle resident, so that it is accessible to shaders for texture mapping operations. + * + *

While the texture handle is resident, it may be used in texture mapping operations. If a shader attempts to perform a texture mapping operation using a + * handle that is not resident, the results of that operation are undefined and may lead to application termination. When a texture handle is resident, the + * texture it references is also considered resident for the purposes of the {@link GL11#glAreTexturesResident AreTexturesResident} command. The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is + * generated if {@code handle} is not a valid texture handle, or if {@code handle} is already resident in the current GL context.

+ * + * @param handle the texture handle + */ + public static native void glMakeTextureHandleResidentNV(@NativeType("GLuint64") long handle); + + // --- [ glMakeTextureHandleNonResidentNV ] --- + + /** + * Makes a texture handle inaccessible to shaders. + * + *

The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated if {@code handle} is not a valid texture handle, or if {@code handle} is not resident in the current GL + * context.

+ * + * @param handle the texture handle + */ + public static native void glMakeTextureHandleNonResidentNV(@NativeType("GLuint64") long handle); + + // --- [ glGetImageHandleNV ] --- + + /** + * Creates and returns an image handle for level {@code level} of the texture named {@code texture}. If {@code layered} is {@link GL11#GL_TRUE TRUE}, a handle is created + * for the entire texture level. If {@code layered} is {@link GL11#GL_FALSE FALSE}, a handle is created for only the layer {@code layer} of the texture level. + * {@code format} specifies a format used to interpret the texels of the image when used for image loads, stores, and atomics, and has the same meaning as + * the {@code format} parameter of BindImageTextureEXT(). A 64-bit unsigned integer handle is returned if the command succeeds; otherwise, zero is returned. + * + *

The error {@link GL11#GL_INVALID_VALUE INVALID_VALUE} is generated by GetImageHandleNV if:

+ * + *
    + *
  • {@code texture} is zero or not the name of an existing texture object;
  • + *
  • the image for the texture level {@code level} doesn't exist (i.e., has a size of zero in {@code texture}); or
  • + *
  • {@code layered} is FALSE and {@code layer} is greater than or equal to the number of layers in the image at level {@code level}.
  • + *
+ * + *

The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated by GetImageHandleNV if:

+ * + *
    + *
  • the texture object {@code texture} is not complete (section 3.9.14);
  • + *
  • {@code layered} is TRUE and the texture is not a three-dimensional, one-dimensional array, two dimensional array, cube map, or cube map array + * texture.
  • + *
+ * + *

When a texture object is referenced by one or more image handles, the texture parameters of the object may not be changed, and the size and format of + * the images in the texture object may not be re-specified. The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated when calling TexImage*, CopyTexImage*, + * CompressedTexImage*, TexBuffer*, or TexParameter* functions while a texture object is referenced by one or more image handles. The contents of the + * images in a texture object may still be updated via commands such as TexSubImage*, CopyTexSubImage*, and CompressedTexSubImage*, and by rendering to a + * framebuffer object, even if the texture object is referenced by one or more image handles.

+ * + *

The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated by {@link GL15C#glBufferData BufferData} if it is called to modify a buffer object bound to a buffer texture while that texture + * object is referenced by one or more image handles. The contents of the buffer object may still be updated via buffer update commands such as + * {@link GL15C#glBufferSubData BufferSubData} and MapBuffer*, or via the texture update commands, even if the buffer is bound to a texture while that buffer texture object is + * referenced by one or more image handles.

+ * + *

The handle returned for each combination of {@code texture}, {@code level}, {@code layered}, {@code layer}, and {@code format} is unique; the same + * handle will be returned if GetImageHandleNV is called multiple times with the same parameters.

+ * + * @param texture the texture object + * @param level the texture level + * @param layered the layered flag + * @param layer the texture layer + * @param format the texture format + */ + @NativeType("GLuint64") + public static native long glGetImageHandleNV(@NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLboolean") boolean layered, @NativeType("GLint") int layer, @NativeType("GLenum") int format); + + // --- [ glMakeImageHandleResidentNV ] --- + + /** + * Makes an image handle resident, so that it is accessible to shaders for image loads, stores, and atomic operations. + * + *

{@code access} specifies whether the texture bound to the image handle will be treated as {@link GL15#GL_READ_ONLY READ_ONLY}, {@link GL15#GL_WRITE_ONLY WRITE_ONLY}, or {@link GL15#GL_READ_WRITE READ_WRITE}. If a + * shader reads from an image handle made resident as {@link GL15#GL_WRITE_ONLY WRITE_ONLY}, or writes to an image handle made resident as {@link GL15#GL_READ_ONLY READ_ONLY}, the results of that + * shader operation are undefined and may lead to application termination. The error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} is generated if {@code handle} is not a valid + * image handle, or if {@code handle} is already resident in the current GL context.

+ * + *

While the image handle is resident, it may be used in image load, store, and atomic operations. If a shader attempts to perform an image operation using + * a handle that is not resident, the results of that operation are undefined and may lead to application termination. When an image handle is resident, + * the texture it references is not necessarily considered resident for the purposes of the {@link GL11#glAreTexturesResident AreTexturesResident} command.

+ * + * @param handle the image handle + * @param access the access type. One of:
{@link GL15#GL_READ_ONLY READ_ONLY}{@link GL15#GL_WRITE_ONLY WRITE_ONLY}{@link GL15#GL_READ_WRITE READ_WRITE}
+ */ + public static native void glMakeImageHandleResidentNV(@NativeType("GLuint64") long handle, @NativeType("GLenum") int access); + + // --- [ glMakeImageHandleNonResidentNV ] --- + + /** + * Makes an image handle inaccessible to shaders. + * + * @param handle the image handle + */ + public static native void glMakeImageHandleNonResidentNV(@NativeType("GLuint64") long handle); + + // --- [ glUniformHandleui64NV ] --- + + /** + * Loads a 64-bit unsigned integer handle into a uniform location corresponding to sampler or image variable types. + * + * @param location the uniform location + * @param value the handle value + */ + public static native void glUniformHandleui64NV(@NativeType("GLint") int location, @NativeType("GLuint64") long value); + + // --- [ glUniformHandleui64vNV ] --- + + /** + * Unsafe version of: {@link #glUniformHandleui64vNV UniformHandleui64vNV} + * + * @param count the number of handles to load + */ + public static native void nglUniformHandleui64vNV(int location, int count, long values); + + /** + * Loads {@code count} 64-bit unsigned integer handles into a uniform location corresponding to sampler or image variable types. + * + * @param location the uniform location + * @param values a buffer from which to load the handles + */ + public static void glUniformHandleui64vNV(@NativeType("GLint") int location, @NativeType("GLuint64 const *") LongBuffer values) { + nglUniformHandleui64vNV(location, values.remaining(), memAddress(values)); + } + + // --- [ glProgramUniformHandleui64NV ] --- + + /** + * DSA version of {@link #glUniformHandleui64NV UniformHandleui64NV}. + * + * @param program the program object + * @param location the uniform location + * @param value the handle value + */ + public static native void glProgramUniformHandleui64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64") long value); + + // --- [ glProgramUniformHandleui64vNV ] --- + + /** + * Unsafe version of: {@link #glProgramUniformHandleui64vNV ProgramUniformHandleui64vNV} + * + * @param count the number of handles to load + */ + public static native void nglProgramUniformHandleui64vNV(int program, int location, int count, long values); + + /** + * DSA version of {@link #glUniformHandleui64vNV UniformHandleui64vNV}. + * + * @param program the program object + * @param location the uniform location + * @param values a buffer from which to load the handles + */ + public static void glProgramUniformHandleui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64 const *") LongBuffer values) { + nglProgramUniformHandleui64vNV(program, location, values.remaining(), memAddress(values)); + } + + // --- [ glIsTextureHandleResidentNV ] --- + + /** + * Returns {@link GL11#GL_TRUE TRUE} if the specified texture handle is resident in the current context. + * + * @param handle the texture handle + */ + @NativeType("GLboolean") + public static native boolean glIsTextureHandleResidentNV(@NativeType("GLuint64") long handle); + + // --- [ glIsImageHandleResidentNV ] --- + + /** + * Returns {@link GL11#GL_TRUE TRUE} if the specified image handle is resident in the current context. + * + * @param handle the image handle + */ + @NativeType("GLboolean") + public static native boolean glIsImageHandleResidentNV(@NativeType("GLuint64") long handle); + + /** Array version of: {@link #glUniformHandleui64vNV UniformHandleui64vNV} */ + public static void glUniformHandleui64vNV(@NativeType("GLint") int location, @NativeType("GLuint64 const *") long[] values) { + long __functionAddress = GL.getICD().glUniformHandleui64vNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, values.length, values, __functionAddress); + } + + /** Array version of: {@link #glProgramUniformHandleui64vNV ProgramUniformHandleui64vNV} */ + public static void glProgramUniformHandleui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64 const *") long[] values) { + long __functionAddress = GL.getICD().glProgramUniformHandleui64vNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, values.length, values, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBlendEquationAdvanced.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBlendEquationAdvanced.java new file mode 100644 index 00000000..8d88dd02 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBlendEquationAdvanced.java @@ -0,0 +1,103 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the NV_blend_equation_advanced extension. + * + *

This extension adds a number of "advanced" blending equations that can be used to perform new color blending operations, many of which are more complex + * than the standard blend modes provided by unextended OpenGL.

+ * + *

Provides the new blending equations, but guarantees defined results only if each sample is touched no more than once in any single rendering pass. The + * command {@link #glBlendBarrierNV BlendBarrierNV} is provided to indicate a boundary between passes.

+ * + *

Requires {@link GL20 OpenGL 2.0}.

+ */ +public class NVBlendEquationAdvanced { + + /** Accepted by the {@code pname} parameter of BlendParameteriNV, GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int + GL_BLEND_PREMULTIPLIED_SRC_NV = 0x9280, + GL_BLEND_OVERLAP_NV = 0x9281; + + /** Accepted by the {@code value} parameter of BlendParameteriNV when {@code pname} is BLEND_OVERLAP_NV. */ + public static final int + GL_UNCORRELATED_NV = 0x8521, + GL_DISJOINT_NV = 0x9283, + GL_CONJOINT_NV = 0x9284; + + /** Accepted by the {@code mode} parameter of BlendEquation and BlendEquationi. */ + public static final int + GL_SRC_NV = 0x9286, + GL_DST_NV = 0x9287, + GL_SRC_OVER_NV = 0x9288, + GL_DST_OVER_NV = 0x9289, + GL_SRC_IN_NV = 0x928A, + GL_DST_IN_NV = 0x928B, + GL_SRC_OUT_NV = 0x928C, + GL_DST_OUT_NV = 0x928D, + GL_SRC_ATOP_NV = 0x928E, + GL_DST_ATOP_NV = 0x928F, + GL_XOR_NV = 0x1506, + GL_MULTIPLY_NV = 0x9294, + GL_SCREEN_NV = 0x9295, + GL_OVERLAY_NV = 0x9296, + GL_DARKEN_NV = 0x9297, + GL_LIGHTEN_NV = 0x9298, + GL_COLORDODGE_NV = 0x9299, + GL_COLORBURN_NV = 0x929A, + GL_HARDLIGHT_NV = 0x929B, + GL_SOFTLIGHT_NV = 0x929C, + GL_DIFFERENCE_NV = 0x929E, + GL_EXCLUSION_NV = 0x92A0, + GL_INVERT_RGB_NV = 0x92A3, + GL_LINEARDODGE_NV = 0x92A4, + GL_LINEARBURN_NV = 0x92A5, + GL_VIVIDLIGHT_NV = 0x92A6, + GL_LINEARLIGHT_NV = 0x92A7, + GL_PINLIGHT_NV = 0x92A8, + GL_HARDMIX_NV = 0x92A9, + GL_HSL_HUE_NV = 0x92AD, + GL_HSL_SATURATION_NV = 0x92AE, + GL_HSL_COLOR_NV = 0x92AF, + GL_HSL_LUMINOSITY_NV = 0x92B0, + GL_PLUS_NV = 0x9291, + GL_PLUS_CLAMPED_NV = 0x92B1, + GL_PLUS_CLAMPED_ALPHA_NV = 0x92B2, + GL_PLUS_DARKER_NV = 0x9292, + GL_MINUS_NV = 0x929F, + GL_MINUS_CLAMPED_NV = 0x92B3, + GL_CONTRAST_NV = 0x92A1, + GL_INVERT_OVG_NV = 0x92B4, + GL_RED_NV = 0x1903, + GL_GREEN_NV = 0x1904, + GL_BLUE_NV = 0x1905; + + static { GL.initialize(); } + + protected NVBlendEquationAdvanced() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBlendParameteriNV, caps.glBlendBarrierNV + ); + } + + // --- [ glBlendParameteriNV ] --- + + public static native void glBlendParameteriNV(@NativeType("GLenum") int pname, @NativeType("GLint") int value); + + // --- [ glBlendBarrierNV ] --- + + public static native void glBlendBarrierNV(); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBlendEquationAdvancedCoherent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBlendEquationAdvancedCoherent.java new file mode 100644 index 00000000..92975b8f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBlendEquationAdvancedCoherent.java @@ -0,0 +1,26 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the NV_blend_equation_advanced_coherent extension. + * + *

Similar to NV_blend_equation_advanced, but guarantees that blending is done coherently and in API primitive ordering. An enable is provided to allow + * implementations to opt out of fully coherent blending and instead behave as though only NV_blend_equation_advanced were supported.

+ * + *

Requires {@link GL20 OpenGL 2.0} and {@link NVBlendEquationAdvanced NV_blend_equation_advanced}.

+ */ +public final class NVBlendEquationAdvancedCoherent { + + /** + * Accepted by the {@code cap} parameter of Disable, Enable, and IsEnabled, and by the {@code pname} parameter of GetIntegerv, GetBooleanv, GetFloatv, GetDoublev + * and GetInteger64v. + */ + public static final int GL_BLEND_ADVANCED_COHERENT_NV = 0x9285; + + private NVBlendEquationAdvancedCoherent() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBlendMinmaxFactor.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBlendMinmaxFactor.java new file mode 100644 index 00000000..60e80a73 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVBlendMinmaxFactor.java @@ -0,0 +1,31 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the NV_blend_minmax_factor extension. + * + *

The {@link EXTBlendMinmax EXT_blend_minmax} extension extended the GL's blending functionality to allow the blending equation to be specified by the application. That + * extension introduced the {@link EXTBlendMinmax#GL_MIN_EXT MIN_EXT} and {@link EXTBlendMinmax#GL_MAX_EXT MAX_EXT} blend equations, which caused the result of the blend equation to become the minimum or maximum of the + * source color and destination color, respectively.

+ * + *

The {@code MIN_EXT} and {@code MAX_EXT} blend equations, however, do not include the source or destination blend factors in the arguments to the min + * and max functions. This extension provides two new blend equations that produce the minimum or maximum of the products of the source color and source + * factor, and the destination color and destination factor.

+ */ +public final class NVBlendMinmaxFactor { + + /** + * Accepted by the {@code mode} parameter of BlendEquation and BlendEquationi, and by the {@code modeRGB} and {@code modeAlpha} parameters of + * BlendEquationSeparate and BlendEquationSeparatei. + */ + public static final int + GL_FACTOR_MIN_AMD = 0x901C, + GL_FACTOR_MAX_AMD = 0x901D; + + private NVBlendMinmaxFactor() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVClipSpaceWScaling.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVClipSpaceWScaling.java new file mode 100644 index 00000000..933cede7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVClipSpaceWScaling.java @@ -0,0 +1,84 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Virtual Reality (VR) applications often involve a post-processing step to apply a "barrel" distortion to the rendered image to correct the "pincushion" + * distortion introduced by the optics in a VR device. The barrel distorted image has lower resolution along the edges compared to the center. Since the + * original image is rendered at high resolution, which is uniform across the complete image, a lot of pixels towards the edges do not make it to the + * final post-processed image. + * + *

This extension also provides a mechanism to render VR scenes at a non-uniform resolution, in particular a resolution that falls linearly from the + * center towards the edges. This is achieved by scaling the "w" coordinate of the vertices in the clip space before perspective divide. The clip space + * "w" coordinate of the vertices may be offset as of a function of "x" and "y" coordinates as follows:

+ * + *

+ * w' = w + Ax + By
+ * + *

In the intended use case for viewport position scaling, an application should use a set of 4 viewports, one for each of the 4 quadrants of a Cartesian + * coordinate system. Each viewport is set to the dimension of the image, but is scissored to the quadrant it represents. The application should specify A + * and B coefficients of the w-scaling equation above, that have the same value, but different signs, for each of the viewports. The signs of A and B + * should match the signs of X and Y for the quadrant that they represent such that the value of "w'" will always be greater than or equal to the original + * "w" value for the entire image. Since the offset to "w", (Ax + By), is always positive and increases with the absolute values of "x" and "y", the + * effective resolution will fall off linearly from the center of the image to its edges.

+ */ +public class NVClipSpaceWScaling { + + /** Accepted by the {@code cap} parameter of Enable, Disable, IsEnabled. */ + public static final int GL_VIEWPORT_POSITION_W_SCALE_NV = 0x937C; + + /** Accepted by the {@code pname} parameter of GetBooleani_v, GetDoublei_v, GetIntegeri_v, GetFloati_v, and GetInteger64i_v. */ + public static final int + GL_VIEWPORT_POSITION_W_SCALE_X_COEFF = 0x937D, + GL_VIEWPORT_POSITION_W_SCALE_Y_COEFF = 0x937E; + + static { GL.initialize(); } + + protected NVClipSpaceWScaling() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glViewportPositionWScaleNV + ); + } + + // --- [ glViewportPositionWScaleNV ] --- + + /** + * If {@link #GL_VIEWPORT_POSITION_W_SCALE_NV VIEWPORT_POSITION_W_SCALE_NV} is enabled, the w coordinates for each primitive sent to a given viewport will be scaled as a function of its x and y + * coordinates using the following equation: + * + *

+     * w' = xcoeff * x + ycoeff * y + w;
+ * + *

The coefficients for "x" and "y" used in the above equation depend on the viewport index, and are controlled by this command.

+ * + *

The viewport specified by {@code index} has its coefficients for "x" and "y" set to the {@code xcoeff} and {@code ycoeff} values. Specifying these + * coefficients enables rendering images at a non-uniform resolution, in particular a resolution that falls off linearly from the center towards the + * edges, which is useful for VR applications. VR applications often involve a post-processing step to apply a "barrel" distortion to the rendered image + * to correct the "pincushion" distortion introduced by the optics in a VR device. The barrel distorted image, has lower resolution along the edges + * compared to the center. Since the original image is rendered at high resolution, which is uniform across the complete image, a lot of pixels towards + * the edges do not make it to the final post-processed image. VR applications may use the w-scaling to minimize the processing of unused fragments. To + * achieve the intended effect, applications should use a set of 4 viewports one for each of the 4 quadrants of a Cartesian coordinate system. Each + * viewport is set to the dimension of the image, but is scissored to the quadrant it represents. The application should specify the x and y coefficients + * of the w-scaling equation above, that have the same value, but different signs, for each of the viewports. The signs of {@code xcoeff} and + * {@code ycoeff} should match the signs of X and Y for the quadrant that they represent such that the value of "w'" will always be greater than or equal + * to the original "w" value for the entire image. Since the offset to "w", (Ax + By), is always positive and increases with the absolute values of "x" + * and "y", the effective resolution will fall off linearly from the center of the image to its edges.

+ * + * @param index the viewport index + * @param xcoeff the x coefficient + * @param ycoeff the y coefficient + */ + public static native void glViewportPositionWScaleNV(@NativeType("GLuint") int index, @NativeType("GLfloat") float xcoeff, @NativeType("GLfloat") float ycoeff); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVCommandList.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVCommandList.java new file mode 100644 index 00000000..648ea035 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVCommandList.java @@ -0,0 +1,668 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_command_list extension. + * + *

This extension adds a few new features designed to provide very low overhead batching and replay of rendering commands and state changes:

+ * + *
    + *
  • A state object, which stores a pre-validated representation of the state of (almost) the entire pipeline.
  • + *
  • A more flexible and extensible MultiDrawIndirect (MDI) type of mechanism, using a token-based command stream, allowing to setup binding state and + * emit draw calls.
  • + *
  • A set of functions to execute a list of the token-based command streams with state object changes interleaved with the streams.
  • + *
  • Command lists enabling compilation and reuse of sequences of command streams and state object changes.
  • + *
+ * + *

Because state objects reflect the state of the entire pipeline, it is expected that they can be pre-validated and executed efficiently. It is also + * expected that when state objects are combined into a command list, the command list can diff consecutive state objects to produce a reduced/ optimized + * set of state changes specific to that transition.

+ * + *

The token-based command stream can also be stored in regular buffer objects and therefore be modified by the server itself. This allows more complex + * work creation than the original MDI approach, which was limited to emitting draw calls only.

+ * + *

Command structures

+ * + *

+ * typedef struct {
+ *   uint  header;
+ * } TerminateSequenceCommandNV;
+ * 
+ * typedef struct {
+ *   uint  header;
+ * } NOPCommandNV;
+ * 
+ * typedef  struct {
+ *   uint  header;
+ *   uint  count;
+ *   uint  firstIndex;
+ *   uint  baseVertex;
+ * } DrawElementsCommandNV;
+ * 
+ * typedef  struct {
+ *   uint  header;
+ *   uint  count;
+ *   uint  first;
+ * } DrawArraysCommandNV;
+ * 
+ * typedef  struct {
+ *   uint  header;
+ *   uint  mode;
+ *   uint  count;
+ *   uint  instanceCount;
+ *   uint  firstIndex;
+ *   uint  baseVertex;
+ *   uint  baseInstance;
+ * } DrawElementsInstancedCommandNV;
+ * 
+ * typedef  struct {
+ *   uint  header;
+ *   uint  mode;
+ *   uint  count;
+ *   uint  instanceCount;
+ *   uint  first;
+ *   uint  baseInstance;
+ * } DrawArraysInstancedCommandNV;
+ * 
+ * typedef struct {
+ *   uint  header;
+ *   uint  addressLo;
+ *   uint  addressHi;
+ *   uint  typeSizeInByte;
+ * } ElementAddressCommandNV;
+ * 
+ * typedef struct {
+ *   uint  header;
+ *   uint  index;
+ *   uint  addressLo;
+ *   uint  addressHi;
+ * } AttributeAddressCommandNV;
+ * 
+ * typedef struct {
+ *   uint    header;
+ *   ushort  index;
+ *   ushort  stage;
+ *   uint    addressLo;
+ *   uint    addressHi;
+ * } UniformAddressCommandNV;
+ * 
+ * typedef struct {
+ *   uint  header;
+ *   float red;
+ *   float green;
+ *   float blue;
+ *   float alpha;
+ * } BlendColorCommandNV;
+ * 
+ * typedef struct {
+ *   uint  header;
+ *   uint  frontStencilRef;
+ *   uint  backStencilRef;
+ * } StencilRefCommandNV;
+ * 
+ * typedef struct {
+ *   uint  header;
+ *   float lineWidth;
+ * } LineWidthCommandNV;
+ * 
+ * typedef struct {
+ *   uint  header;
+ *   float scale;
+ *   float bias;
+ * } PolygonOffsetCommandNV;
+ * 
+ * typedef struct {
+ *   uint  header;
+ *   float alphaRef;
+ * } AlphaRefCommandNV;
+ * 
+ * typedef struct {
+ *   uint  header;
+ *   uint  x;
+ *   uint  y;
+ *   uint  width;
+ *   uint  height;
+ * } ViewportCommandNV; // only ViewportIndex 0
+ * 
+ * typedef struct {
+ *   uint  header;
+ *   uint  x;
+ *   uint  y;
+ *   uint  width;
+ *   uint  height;
+ * } ScissorCommandNV; // only ViewportIndex 0
+ * 
+ * typedef struct {
+ *   uint  header;
+ *   uint  frontFace; // 0 for CW, 1 for CCW
+ * } FrontFaceCommandNV;
+ * + *

Tight packing is used for all structures.

+ */ +public class NVCommandList { + + /** Used in DrawCommandsStates buffer formats, in GetCommandHeaderNV to return the header. */ + public static final int + GL_TERMINATE_SEQUENCE_COMMAND_NV = 0x0, + GL_NOP_COMMAND_NV = 0x1, + GL_DRAW_ELEMENTS_COMMAND_NV = 0x2, + GL_DRAW_ARRAYS_COMMAND_NV = 0x3, + GL_DRAW_ELEMENTS_STRIP_COMMAND_NV = 0x4, + GL_DRAW_ARRAYS_STRIP_COMMAND_NV = 0x5, + GL_DRAW_ELEMENTS_INSTANCED_COMMAND_NV = 0x6, + GL_DRAW_ARRAYS_INSTANCED_COMMAND_NV = 0x7, + GL_ELEMENT_ADDRESS_COMMAND_NV = 0x8, + GL_ATTRIBUTE_ADDRESS_COMMAND_NV = 0x9, + GL_UNIFORM_ADDRESS_COMMAND_NV = 0xA, + GL_BLEND_COLOR_COMMAND_NV = 0xB, + GL_STENCIL_REF_COMMAND_NV = 0xC, + GL_LINE_WIDTH_COMMAND_NV = 0xD, + GL_POLYGON_OFFSET_COMMAND_NV = 0xE, + GL_ALPHA_REF_COMMAND_NV = 0xF, + GL_VIEWPORT_COMMAND_NV = 0x10, + GL_SCISSOR_COMMAND_NV = 0x11, + GL_FRONT_FACE_COMMAND_NV = 0x12; + + static { GL.initialize(); } + + protected NVCommandList() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glCreateStatesNV, caps.glDeleteStatesNV, caps.glIsStateNV, caps.glStateCaptureNV, caps.glGetCommandHeaderNV, caps.glGetStageIndexNV, + caps.glDrawCommandsNV, caps.glDrawCommandsAddressNV, caps.glDrawCommandsStatesNV, caps.glDrawCommandsStatesAddressNV, caps.glCreateCommandListsNV, + caps.glDeleteCommandListsNV, caps.glIsCommandListNV, caps.glListDrawCommandsStatesClientNV, caps.glCommandListSegmentsNV, + caps.glCompileCommandListNV, caps.glCallCommandListNV + ); + } + + // --- [ glCreateStatesNV ] --- + + /** + * Unsafe version of: {@link #glCreateStatesNV CreateStatesNV} + * + * @param n the number of state object names to create + */ + public static native void nglCreateStatesNV(int n, long states); + + /** + * Returns {@code n} previously unused state object names in {@code states}, and creates a state object in the initial state for each name. + * + * @param states the buffer in which to write the created state object names + */ + public static void glCreateStatesNV(@NativeType("GLuint *") IntBuffer states) { + nglCreateStatesNV(states.remaining(), memAddress(states)); + } + + /** Returns {@code n} previously unused state object names in {@code states}, and creates a state object in the initial state for each name. */ + @NativeType("void") + public static int glCreateStatesNV() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer states = stack.callocInt(1); + nglCreateStatesNV(1, memAddress(states)); + return states.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glDeleteStatesNV ] --- + + /** + * Unsafe version of: {@link #glDeleteStatesNV DeleteStatesNV} + * + * @param n the number of state object names to delete + */ + public static native void nglDeleteStatesNV(int n, long states); + + /** + * Deletes {@code n} names of state objects given by {@code states}. Once a state object is deleted it has no contents and its name is again unused. + * Unused names in {@code states} are silently ignored, as is the value zero. + * + * @param states the buffer from which to read the state object names to delete + */ + public static void glDeleteStatesNV(@NativeType("GLuint const *") IntBuffer states) { + nglDeleteStatesNV(states.remaining(), memAddress(states)); + } + + /** + * Deletes {@code n} names of state objects given by {@code states}. Once a state object is deleted it has no contents and its name is again unused. + * Unused names in {@code states} are silently ignored, as is the value zero. + */ + public static void glDeleteStatesNV(@NativeType("GLuint const *") int state) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer states = stack.ints(state); + nglDeleteStatesNV(1, memAddress(states)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glIsStateNV ] --- + + /** + * Returns true if the specified name corresponds to a state object. + * + * @param state the object name to test + */ + @NativeType("GLboolean") + public static native boolean glIsStateNV(@NativeType("GLuint") int state); + + // --- [ glStateCaptureNV ] --- + + /** + * Captures the current state of the rendering pipeline into the object indicated by {@code state}. + * + *

The captured rendering state includes:

+ * + *
    + *
  • Vertex attribute enable state, formats, types, relative offsets and strides, but not bound vertex buffers or vertex unified addresses, nor their + * offsets, nor bound index buffers/addresses.
  • + *
  • Primitive state such as primitive restart and patch parameters, provoking vertex.
  • + *
  • Immediate vertex attribute values as provided by glVertexAttrib* or glVertexAttribI*
  • + *
  • All active program binaries except compute (either from the active program pipeline or from UseProgram) with their current subroutine configuration + * excluding all default-block uniform values.
  • + *
  • Rasterization, multisample fragment operation, depth, stencil, and blending state.
  • + *
  • Rasterization state such as line widths, stippling, polygon modes and offsets.
  • + *
  • Viewport, scissor, and depth range state.
  • + *
  • Framebuffer attachment configuration: attachment state including attachment formats, drawbuffer state, and target/layer information, but not + * including actual attachments or sizes of attachments (these are stored separately).
  • + *
  • Framebuffer attachment textures (but not residency state).
  • + *
+ * + * @param state the state object into which to capture the current rendering state + * @param mode the basic Begin mode that this state object must be used with. One of:
{@link GL11#GL_POINTS POINTS}{@link GL11#GL_LINES LINES}{@link GL11#GL_TRIANGLES TRIANGLES}{@link GL11#GL_QUADS QUADS}{@link GL32#GL_LINES_ADJACENCY LINES_ADJACENCY}{@link GL32#GL_TRIANGLES_ADJACENCY TRIANGLES_ADJACENCY}{@link GL40#GL_PATCHES PATCHES}
+ */ + public static native void glStateCaptureNV(@NativeType("GLuint") int state, @NativeType("GLenum") int mode); + + // --- [ glGetCommandHeaderNV ] --- + + /** + * Returns the encoded 32bit header value for a given command; the returned value is implementation specific. + * + * @param tokenID the command to query. One of:
{@link #GL_TERMINATE_SEQUENCE_COMMAND_NV TERMINATE_SEQUENCE_COMMAND_NV}{@link #GL_NOP_COMMAND_NV NOP_COMMAND_NV}{@link #GL_DRAW_ELEMENTS_COMMAND_NV DRAW_ELEMENTS_COMMAND_NV}
{@link #GL_DRAW_ARRAYS_COMMAND_NV DRAW_ARRAYS_COMMAND_NV}{@link #GL_DRAW_ELEMENTS_STRIP_COMMAND_NV DRAW_ELEMENTS_STRIP_COMMAND_NV}{@link #GL_DRAW_ARRAYS_STRIP_COMMAND_NV DRAW_ARRAYS_STRIP_COMMAND_NV}
{@link #GL_DRAW_ELEMENTS_INSTANCED_COMMAND_NV DRAW_ELEMENTS_INSTANCED_COMMAND_NV}{@link #GL_DRAW_ARRAYS_INSTANCED_COMMAND_NV DRAW_ARRAYS_INSTANCED_COMMAND_NV}{@link #GL_ELEMENT_ADDRESS_COMMAND_NV ELEMENT_ADDRESS_COMMAND_NV}
{@link #GL_ATTRIBUTE_ADDRESS_COMMAND_NV ATTRIBUTE_ADDRESS_COMMAND_NV}{@link #GL_UNIFORM_ADDRESS_COMMAND_NV UNIFORM_ADDRESS_COMMAND_NV}{@link #GL_BLEND_COLOR_COMMAND_NV BLEND_COLOR_COMMAND_NV}
{@link #GL_STENCIL_REF_COMMAND_NV STENCIL_REF_COMMAND_NV}{@link #GL_LINE_WIDTH_COMMAND_NV LINE_WIDTH_COMMAND_NV}{@link #GL_POLYGON_OFFSET_COMMAND_NV POLYGON_OFFSET_COMMAND_NV}
{@link #GL_ALPHA_REF_COMMAND_NV ALPHA_REF_COMMAND_NV}{@link #GL_VIEWPORT_COMMAND_NV VIEWPORT_COMMAND_NV}{@link #GL_SCISSOR_COMMAND_NV SCISSOR_COMMAND_NV}
{@link #GL_FRONT_FACE_COMMAND_NV FRONT_FACE_COMMAND_NV}
+ * @param size provided as basic consistency check, since the size of each structure is fixed and no padding is allowed. The value is the sum of the header and + * the command specific structure. + */ + @NativeType("GLuint") + public static native int glGetCommandHeaderNV(@NativeType("GLenum") int tokenID, @NativeType("GLuint") int size); + + // --- [ glGetStageIndexNV ] --- + + /** + * Returns the 16bit value for a specific shader stage; the returned value is implementation specific. The value is to be used with the stage field within + * {@code UniformAddressCommandNV} tokens. + * + * @param shadertype the shader stage type + */ + @NativeType("GLushort") + public static native short glGetStageIndexNV(@NativeType("GLenum") int shadertype); + + // --- [ glDrawCommandsNV ] --- + + /** + * Unsafe version of: {@link #glDrawCommandsNV DrawCommandsNV} + * + * @param count the number of commands + */ + public static native void nglDrawCommandsNV(int primitiveMode, int buffer, long indirects, long sizes, int count); + + /** + * Accepts arrays of buffer addresses as an array of offsets {@code indirects} into a buffer named by {@code buffer}, an array of command lengths in + * {@code sizes}. All arrays have {@code count} entries. + * + * @param primitiveMode the primitive mode + * @param buffer the buffer object name + * @param indirects the array of offsets into the buffer + * @param sizes the array of command lengths + */ + public static void glDrawCommandsNV(@NativeType("GLenum") int primitiveMode, @NativeType("GLuint") int buffer, @NativeType("GLintptr const *") PointerBuffer indirects, @NativeType("GLsizei const *") IntBuffer sizes) { + if (CHECKS) { + check(sizes, indirects.remaining()); + } + nglDrawCommandsNV(primitiveMode, buffer, memAddress(indirects), memAddress(sizes), indirects.remaining()); + } + + // --- [ glDrawCommandsAddressNV ] --- + + /** + * Unsafe version of: {@link #glDrawCommandsAddressNV DrawCommandsAddressNV} + * + * @param count the number of commands + */ + public static native void nglDrawCommandsAddressNV(int primitiveMode, long indirects, long sizes, int count); + + /** + * Accepts arrays of buffer addresses as an array of GPU addresses {@code indirects}, an array of sequence lengths in {@code sizes}. All arrays have + * {@code count} entries. + * + * @param primitiveMode the primitive mode + * @param indirects the array of GPU addreses + * @param sizes the array of command lengths + */ + public static void glDrawCommandsAddressNV(@NativeType("GLenum") int primitiveMode, @NativeType("GLuint64 const *") LongBuffer indirects, @NativeType("GLsizei const *") IntBuffer sizes) { + if (CHECKS) { + check(sizes, indirects.remaining()); + } + nglDrawCommandsAddressNV(primitiveMode, memAddress(indirects), memAddress(sizes), indirects.remaining()); + } + + // --- [ glDrawCommandsStatesNV ] --- + + /** + * Unsafe version of: {@link #glDrawCommandsStatesNV DrawCommandsStatesNV} + * + * @param count the number of commands + */ + public static native void nglDrawCommandsStatesNV(int buffer, long indirects, long sizes, long states, long fbos, int count); + + /** + * Accepts arrays of buffer addresses as an array of offsets {@code indirects} into a buffer named by {@code buffer}, an array of command lengths in + * {@code sizes}, and an array of state object names in {@code states}, of which all names must be non-zero. Frame buffer object names are stored in + * {@code fbos} and can be either zero or non-zero. All arrays have {@code count} entries. The residency of textures used as attachment inside the state + * object's captured fbo or the passed fbo must managed explicitly. + * + * @param buffer the buffer object name + * @param indirects the array of offsets into the buffer + * @param sizes the array of command lengths + * @param states the array of state object names + * @param fbos the array of framebuffer object names + */ + public static void glDrawCommandsStatesNV(@NativeType("GLuint") int buffer, @NativeType("GLintptr const *") PointerBuffer indirects, @NativeType("GLsizei const *") IntBuffer sizes, @NativeType("GLuint const *") IntBuffer states, @NativeType("GLuint const *") IntBuffer fbos) { + if (CHECKS) { + check(sizes, indirects.remaining()); + check(states, indirects.remaining()); + check(fbos, indirects.remaining()); + } + nglDrawCommandsStatesNV(buffer, memAddress(indirects), memAddress(sizes), memAddress(states), memAddress(fbos), indirects.remaining()); + } + + // --- [ glDrawCommandsStatesAddressNV ] --- + + /** + * Unsafe version of: {@link #glDrawCommandsStatesAddressNV DrawCommandsStatesAddressNV} + * + * @param count the number of commands + */ + public static native void nglDrawCommandsStatesAddressNV(long indirects, long sizes, long states, long fbos, int count); + + /** + * Accepts arrays of buffer addresses as an array of GPU addresses {@code indirects}, an array of command lengths in {@code sizes}, and an array of state + * object names in {@code states}, of which all names must be non-zero. Frame buffer object names are stored in {@code fbos} and can be either zero or + * non-zero. All arrays have {@code count} entries. The residency of textures used as attachment inside the state object's captured fbo or the passed fbo + * must managed explicitly. + * + * @param indirects the array of GPU addresses + * @param sizes the array of command lengths + * @param states the array of state object names + * @param fbos the array of framebuffer object names + */ + public static void glDrawCommandsStatesAddressNV(@NativeType("GLuint64 const *") LongBuffer indirects, @NativeType("GLsizei const *") IntBuffer sizes, @NativeType("GLuint const *") IntBuffer states, @NativeType("GLuint const *") IntBuffer fbos) { + if (CHECKS) { + check(sizes, indirects.remaining()); + check(states, indirects.remaining()); + check(fbos, indirects.remaining()); + } + nglDrawCommandsStatesAddressNV(memAddress(indirects), memAddress(sizes), memAddress(states), memAddress(fbos), indirects.remaining()); + } + + // --- [ glCreateCommandListsNV ] --- + + /** + * Unsafe version of: {@link #glCreateCommandListsNV CreateCommandListsNV} + * + * @param n the number of command list names to create + */ + public static native void nglCreateCommandListsNV(int n, long lists); + + /** + * Returns {@code n} previously unused command list names in {@code lists}, and creates a command list in the initial state for each name. + * + * @param lists the buffer in which to return the created command list names + */ + public static void glCreateCommandListsNV(@NativeType("GLuint *") IntBuffer lists) { + nglCreateCommandListsNV(lists.remaining(), memAddress(lists)); + } + + /** Returns {@code n} previously unused command list names in {@code lists}, and creates a command list in the initial state for each name. */ + @NativeType("void") + public static int glCreateCommandListsNV() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer lists = stack.callocInt(1); + nglCreateCommandListsNV(1, memAddress(lists)); + return lists.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glDeleteCommandListsNV ] --- + + /** + * Unsafe version of: {@link #glDeleteCommandListsNV DeleteCommandListsNV} + * + * @param n the number of command list names to delete + */ + public static native void nglDeleteCommandListsNV(int n, long lists); + + /** + * Deletes {@code n} command lists stored in {@code lists}. Once a command list is deleted it has no contents and its name is again unused. Unused names + * in {@code lists} are silently ignored, as is the value zero. + * + * @param lists the buffer from which to read the command list names to delete + */ + public static void glDeleteCommandListsNV(@NativeType("GLuint const *") IntBuffer lists) { + nglDeleteCommandListsNV(lists.remaining(), memAddress(lists)); + } + + /** + * Deletes {@code n} command lists stored in {@code lists}. Once a command list is deleted it has no contents and its name is again unused. Unused names + * in {@code lists} are silently ignored, as is the value zero. + */ + public static void glDeleteCommandListsNV(@NativeType("GLuint const *") int list) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer lists = stack.ints(list); + nglDeleteCommandListsNV(1, memAddress(lists)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glIsCommandListNV ] --- + + /** + * Returns true if the specified name corresponds to a command list. + * + * @param list the object name to query + */ + @NativeType("GLboolean") + public static native boolean glIsCommandListNV(@NativeType("GLuint") int list); + + // --- [ glListDrawCommandsStatesClientNV ] --- + + /** + * Unsafe version of: {@link #glListDrawCommandsStatesClientNV ListDrawCommandsStatesClientNV} + * + * @param count the number of commands + */ + public static native void nglListDrawCommandsStatesClientNV(int list, int segment, long indirects, long sizes, long states, long fbos, int count); + + /** + * A list has multiple segments and each segment enqueues an ordered list of commands. This command enqueues the equivalent of the + * DrawCommandsStatesClientNV commands into the list indicated by {@code list} on the segment indicated by {@code segment}. + * + *

A list has multiple segments and each segment enqueues an ordered list of command sequences. This command enqueues the equivalent of the + * DrawCommandsStatesNV commands into the list indicated by {@code list} on the segment indicated by {@code segment} except that the sequence data is + * copied from the sequences pointed to by the {@code indirects} pointer. The {@code indirects} pointer should point to a list of size {@code count} of + * pointers, each of which should point to a command sequence.

+ * + *

The pre-validated state from {@code states} is saved into the command list, rather than a reference to the state object (i.e. the state objects or fbos + * could be deleted and the command list would be unaffected). This includes native GPU addresses for all textures indirectly referenced through the fbos + * passed or state objects' fbos attachments, therefore a recompile of the command list is required if such referenced textures change their allocation + * (for example due to resizing), as well as explicit management of the residency of the textures prior {@link #glCallCommandListNV CallCommandListNV}.

+ * + *

ListDrawCommandsStatesClientNV performs a by-value copy of the indirect data based on the provided client-side pointers. In this case the content is + * fully immutable, while the buffer-based versions can change the content of the buffers at any later time.

+ * + * @param list the command list + * @param segment the segment + * @param indirects the array of GPU addresses + * @param sizes the array of command lengths + * @param states the array of state object names + * @param fbos the array of framebuffer object names + */ + public static void glListDrawCommandsStatesClientNV(@NativeType("GLuint") int list, @NativeType("GLuint") int segment, @NativeType("void const **") PointerBuffer indirects, @NativeType("size_t const *") PointerBuffer sizes, @NativeType("GLuint const *") IntBuffer states, @NativeType("GLuint const *") IntBuffer fbos) { + if (CHECKS) { + check(sizes, indirects.remaining()); + check(states, indirects.remaining()); + check(fbos, indirects.remaining()); + } + nglListDrawCommandsStatesClientNV(list, segment, memAddress(indirects), memAddress(sizes), memAddress(states), memAddress(fbos), indirects.remaining()); + } + + // --- [ glCommandListSegmentsNV ] --- + + /** + * Indicates that {@code list} will have {@code segments} number of segments, each of which is a list of command sequences that it enqueues. This must be + * called before any commands are enqueued. In the initial state, a command list has a single segment. + * + * @param list the command list + * @param segments the number of ordered sequences of commands + */ + public static native void glCommandListSegmentsNV(@NativeType("GLuint") int list, @NativeType("GLuint") int segments); + + // --- [ glCompileCommandListNV ] --- + + /** + * Makes the list indicated by {@code list} switch from allowing collection of commands to allowing its execution. At this time, the implementation may + * generate optimized commands to transition between states as efficiently as possible. + * + * @param list the command list to compile + */ + public static native void glCompileCommandListNV(@NativeType("GLuint") int list); + + // --- [ glCallCommandListNV ] --- + + /** + * Executes the command list indicated by {@code list}, which operates as if the DrawCommandsStates* commands were replayed in the order they were + * enqueued on each segment, starting from segment zero and proceeding to the maximum segment. All buffer or texture resources' residency must be managed + * explicitly, including texture attachments of the effective fbos during list enqueuing. + * + * @param list the command list to call + */ + public static native void glCallCommandListNV(@NativeType("GLuint") int list); + + /** Array version of: {@link #glCreateStatesNV CreateStatesNV} */ + public static void glCreateStatesNV(@NativeType("GLuint *") int[] states) { + long __functionAddress = GL.getICD().glCreateStatesNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(states.length, states, __functionAddress); + } + + /** Array version of: {@link #glDeleteStatesNV DeleteStatesNV} */ + public static void glDeleteStatesNV(@NativeType("GLuint const *") int[] states) { + long __functionAddress = GL.getICD().glDeleteStatesNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(states.length, states, __functionAddress); + } + + /** Array version of: {@link #glDrawCommandsNV DrawCommandsNV} */ + public static void glDrawCommandsNV(@NativeType("GLenum") int primitiveMode, @NativeType("GLuint") int buffer, @NativeType("GLintptr const *") PointerBuffer indirects, @NativeType("GLsizei const *") int[] sizes) { + long __functionAddress = GL.getICD().glDrawCommandsNV; + if (CHECKS) { + check(__functionAddress); + check(sizes, indirects.remaining()); + } + callPPV(primitiveMode, buffer, memAddress(indirects), sizes, indirects.remaining(), __functionAddress); + } + + /** Array version of: {@link #glDrawCommandsAddressNV DrawCommandsAddressNV} */ + public static void glDrawCommandsAddressNV(@NativeType("GLenum") int primitiveMode, @NativeType("GLuint64 const *") long[] indirects, @NativeType("GLsizei const *") int[] sizes) { + long __functionAddress = GL.getICD().glDrawCommandsAddressNV; + if (CHECKS) { + check(__functionAddress); + check(sizes, indirects.length); + } + callPPV(primitiveMode, indirects, sizes, indirects.length, __functionAddress); + } + + /** Array version of: {@link #glDrawCommandsStatesNV DrawCommandsStatesNV} */ + public static void glDrawCommandsStatesNV(@NativeType("GLuint") int buffer, @NativeType("GLintptr const *") PointerBuffer indirects, @NativeType("GLsizei const *") int[] sizes, @NativeType("GLuint const *") int[] states, @NativeType("GLuint const *") int[] fbos) { + long __functionAddress = GL.getICD().glDrawCommandsStatesNV; + if (CHECKS) { + check(__functionAddress); + check(sizes, indirects.remaining()); + check(states, indirects.remaining()); + check(fbos, indirects.remaining()); + } + callPPPPV(buffer, memAddress(indirects), sizes, states, fbos, indirects.remaining(), __functionAddress); + } + + /** Array version of: {@link #glDrawCommandsStatesAddressNV DrawCommandsStatesAddressNV} */ + public static void glDrawCommandsStatesAddressNV(@NativeType("GLuint64 const *") long[] indirects, @NativeType("GLsizei const *") int[] sizes, @NativeType("GLuint const *") int[] states, @NativeType("GLuint const *") int[] fbos) { + long __functionAddress = GL.getICD().glDrawCommandsStatesAddressNV; + if (CHECKS) { + check(__functionAddress); + check(sizes, indirects.length); + check(states, indirects.length); + check(fbos, indirects.length); + } + callPPPPV(indirects, sizes, states, fbos, indirects.length, __functionAddress); + } + + /** Array version of: {@link #glCreateCommandListsNV CreateCommandListsNV} */ + public static void glCreateCommandListsNV(@NativeType("GLuint *") int[] lists) { + long __functionAddress = GL.getICD().glCreateCommandListsNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(lists.length, lists, __functionAddress); + } + + /** Array version of: {@link #glDeleteCommandListsNV DeleteCommandListsNV} */ + public static void glDeleteCommandListsNV(@NativeType("GLuint const *") int[] lists) { + long __functionAddress = GL.getICD().glDeleteCommandListsNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(lists.length, lists, __functionAddress); + } + + /** Array version of: {@link #glListDrawCommandsStatesClientNV ListDrawCommandsStatesClientNV} */ + public static void glListDrawCommandsStatesClientNV(@NativeType("GLuint") int list, @NativeType("GLuint") int segment, @NativeType("void const **") PointerBuffer indirects, @NativeType("size_t const *") PointerBuffer sizes, @NativeType("GLuint const *") int[] states, @NativeType("GLuint const *") int[] fbos) { + long __functionAddress = GL.getICD().glListDrawCommandsStatesClientNV; + if (CHECKS) { + check(__functionAddress); + check(sizes, indirects.remaining()); + check(states, indirects.remaining()); + check(fbos, indirects.remaining()); + } + callPPPPV(list, segment, memAddress(indirects), memAddress(sizes), states, fbos, indirects.remaining(), __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVConditionalRender.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVConditionalRender.java new file mode 100644 index 00000000..e617f694 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVConditionalRender.java @@ -0,0 +1,59 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the NV_conditional_render extension. + * + *

This extension provides support for conditional rendering based on the results of an occlusion query. This mechanism allows an application to + * potentially reduce the latency between the completion of an occlusion query and the rendering commands depending on its result. It additionally allows + * the decision of whether to render to be made without application intervention.

+ * + *

This extension defines two new functions, {@link #glBeginConditionalRenderNV BeginConditionalRenderNV} and {@link #glEndConditionalRenderNV EndConditionalRenderNV}, between which rendering commands may be discarded + * based on the results of an occlusion query. If the specified occlusion query returns a non-zero value, rendering commands between these calls are + * executed. If the occlusion query returns a value of zero, all rendering commands between the calls are discarded.

+ * + *

If the occlusion query results are not available when {@link #glBeginConditionalRenderNV BeginConditionalRenderNV} is executed, the {@code mode} parameter specifies whether the GL + * should wait for the query to complete or should simply render the subsequent geometry unconditionally.

+ * + *

Additionally, the extension provides a set of "by region" modes, allowing for implementations that divide rendering work by screen regions to perform + * the conditional query test on a region-by-region basis without checking the query results from other regions. Such a mode is useful for cases like + * split-frame SLI, where a frame is divided between multiple GPUs, each of which has its own occlusion query hardware.

+ */ +public class NVConditionalRender { + + /** Accepted by the {@code mode} parameter of BeginConditionalRenderNV. */ + public static final int + GL_QUERY_WAIT_NV = 0x8E13, + GL_QUERY_NO_WAIT_NV = 0x8E14, + GL_QUERY_BY_REGION_WAIT_NV = 0x8E15, + GL_QUERY_BY_REGION_NO_WAIT_NV = 0x8E16; + + static { GL.initialize(); } + + protected NVConditionalRender() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBeginConditionalRenderNV, caps.glEndConditionalRenderNV + ); + } + + // --- [ glBeginConditionalRenderNV ] --- + + public static native void glBeginConditionalRenderNV(@NativeType("GLuint") int id, @NativeType("GLenum") int mode); + + // --- [ glEndConditionalRenderNV ] --- + + public static native void glEndConditionalRenderNV(); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVConservativeRaster.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVConservativeRaster.java new file mode 100644 index 00000000..f89a571b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVConservativeRaster.java @@ -0,0 +1,65 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the NV_conservative_raster extension. + * + *

This extension adds a "conservative" rasterization mode where any pixel that is partially covered, even if no sample location is covered, is treated as + * fully covered and a corresponding fragment will be shaded.

+ * + *

A new control is also added to modify window coordinate snapping precision.

+ * + *

These controls can be used to implement "binning" to a low-resolution render target, for example to determine which tiles of a sparse texture need to + * be populated. An app can construct a framebuffer where there is one pixel per tile in the sparse texture, and adjust the number of subpixel bits such + * that snapping occurs to the same effective grid as when rendering to the sparse texture. Then triangles should cover (at least) the same pixels in the + * low-res framebuffer as they do tiles in the sparse texture.

+ */ +public class NVConservativeRaster { + + /** Accepted by the {@code cap} parameter of Enable, Disable, IsEnabled. */ + public static final int GL_CONSERVATIVE_RASTERIZATION_NV = 0x9346; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV = 0x9347, + GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV = 0x9348, + GL_MAX_SUBPIXEL_PRECISION_BIAS_BITS_NV = 0x9349; + + static { GL.initialize(); } + + protected NVConservativeRaster() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glSubpixelPrecisionBiasNV + ); + } + + // --- [ glSubpixelPrecisionBiasNV ] --- + + /** + * Sets the {@link #GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV SUBPIXEL_PRECISION_BIAS_X_BITS_NV} and {@link #GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV SUBPIXEL_PRECISION_BIAS_Y_BITS_NV} values. + * + *

The vertex's window x and y coordinates may be optionally converted to fixed-point values with {@code N} fractional bits. If + * {@link #GL_CONSERVATIVE_RASTERIZATION_NV CONSERVATIVE_RASTERIZATION_NV} is disabled, then {@code N} is the implementation-dependent value of {@link GL11#GL_SUBPIXEL_BITS SUBPIXEL_BITS}. If + * {@link #GL_CONSERVATIVE_RASTERIZATION_NV CONSERVATIVE_RASTERIZATION_NV} is enabled, {@code N} is computed as the sum of the value of {@link GL11#GL_SUBPIXEL_BITS SUBPIXEL_BITS} and programmable values of + * {@link #GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV SUBPIXEL_PRECISION_BIAS_X_BITS_NV} and {@link #GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV SUBPIXEL_PRECISION_BIAS_Y_BITS_NV}.

+ * + *

When these values are non-zero, the invariance requirement may not apply because the subpixel precision may not be the same at all window coordinates.

+ * + * @param xbits the {@link #GL_SUBPIXEL_PRECISION_BIAS_X_BITS_NV SUBPIXEL_PRECISION_BIAS_X_BITS_NV} value. The initial value is zero. + * @param ybits the {@link #GL_SUBPIXEL_PRECISION_BIAS_Y_BITS_NV SUBPIXEL_PRECISION_BIAS_Y_BITS_NV} value. The initial value is zero. + */ + public static native void glSubpixelPrecisionBiasNV(@NativeType("GLuint") int xbits, @NativeType("GLuint") int ybits); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVConservativeRasterDilate.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVConservativeRasterDilate.java new file mode 100644 index 00000000..e5d68db2 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVConservativeRasterDilate.java @@ -0,0 +1,48 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the NV_conservative_raster_dilate extension. + * + *

This extension extends the conservative rasterization funtionality provided by NV_conservative_raster. It provides a new control to generate an + * "over-conservative" rasterization by dilating primitives prior to rasterization.

+ * + *

When using conservative raster to bin geometry, this extension provides a programmable overlap region between adjacent primitives. Regular + * rasterization bins triangles with a shared edge uniquely into pixels. Conservative raster has a one-pixel overlap along the shared edge. Using a + * half-pixel raster dilation, this overlap region increases to two pixels.

+ * + *

Requires {@link NVConservativeRaster NV_conservative_raster}.

+ */ +public class NVConservativeRasterDilate { + + /** Accepted by the {@code pname} parameter of ConservativeRasterParameterfNV, GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int + GL_CONSERVATIVE_RASTER_DILATE_NV = 0x9379, + GL_CONSERVATIVE_RASTER_DILATE_RANGE_NV = 0x937A, + GL_CONSERVATIVE_RASTER_DILATE_GRANULARITY_NV = 0x937B; + + static { GL.initialize(); } + + protected NVConservativeRasterDilate() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glConservativeRasterParameterfNV + ); + } + + // --- [ glConservativeRasterParameterfNV ] --- + + public static native void glConservativeRasterParameterfNV(@NativeType("GLenum") int pname, @NativeType("GLfloat") float value); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVConservativeRasterPreSnap.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVConservativeRasterPreSnap.java new file mode 100644 index 00000000..325f83bf --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVConservativeRasterPreSnap.java @@ -0,0 +1,24 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the NV_conservative_raster_pre_snap extension. + * + *

{@link NVConservativeRasterPreSnapTriangles NV_conservative_raster_pre_snap_triangles} provides a new mode to achieve rasterization of triangles that is conservative w.r.t the triangle at + * infinite precision i.e. before it is snapped to the sub-pixel grid. This extension provides a new mode that expands this functionality to lines and + * points.

+ * + *

Requires {@link NVConservativeRasterPreSnapTriangles NV_conservative_raster_pre_snap_triangles}.

+ */ +public final class NVConservativeRasterPreSnap { + + /** Accepted by the {@code param} parameter of {@link NVConservativeRasterPreSnapTriangles#glConservativeRasterParameteriNV ConservativeRasterParameteriNV} */ + public static final int GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_NV = 0x9550; + + private NVConservativeRasterPreSnap() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVConservativeRasterPreSnapTriangles.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVConservativeRasterPreSnapTriangles.java new file mode 100644 index 00000000..adae4855 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVConservativeRasterPreSnapTriangles.java @@ -0,0 +1,66 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * When {@link NVConservativeRaster#GL_CONSERVATIVE_RASTERIZATION_NV CONSERVATIVE_RASTERIZATION_NV} is enabled, the fragments generated for a primitive are conservative with respect to the primitive after snapping + * to sub-pixel grid. This extension provides a new mode of rasterization for triangles where the fragments generated are conservative with respect to the + * primitive at infinite precision before vertex snapping. + * + *

When the conservative raster mode is set to {@link #GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV}, triangles are rasterized more conservatively, and may + * generate fragments not generated when the mode is {@link #GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV CONSERVATIVE_RASTER_MODE_POST_SNAP_NV} (default). In particular it may generate fragments for pixels + * covered by triangles with zero area, or for pixels that are adjacent to but not covered by any triangle. This modified behavior may be useful in + * compensating for rounding errors caused by snapping vertex positions to a sub-pixel grid during rasterization. It's possible that a non-degenerate + * triangle becomes degenerate due to snapping. It's additionally possible that rounding errors in computing the position of a vertex or from snapping may + * cause a primitive that would cover a pixel at infinite precision to fail to cover the pixel post-snap. Rasterizing such primitives more conservatively + * may be useful for "binning" algorithms described in {@link NVConservativeRaster NV_conservative_raster}.

+ * + *

Requires {@link NVConservativeRaster NV_conservative_raster}.

+ */ +public class NVConservativeRasterPreSnapTriangles { + + /** Accepted by the {@code pname} parameter of ConservativeRasterParameteriNV. */ + public static final int GL_CONSERVATIVE_RASTER_MODE_NV = 0x954D; + + /** Accepted by the {@code param} parameter of ConservativeRasterParameteriNV. */ + public static final int + GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV = 0x954E, + GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV = 0x954F; + + static { GL.initialize(); } + + protected NVConservativeRasterPreSnapTriangles() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glConservativeRasterParameteriNV + ); + } + + // --- [ glConservativeRasterParameteriNV ] --- + + /** + * When {@link NVConservativeRaster#GL_CONSERVATIVE_RASTERIZATION_NV CONSERVATIVE_RASTERIZATION_NV} is enabled, the rasterization behavior may be controlled by calling the this command. + * + *

If the mode is set to {@link #GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV CONSERVATIVE_RASTER_MODE_POST_SNAP_NV}, the generated fragments are conservative w.r.t the primitive after it is snapped to + * sub-pixel grid. If the mode is set to {@link #GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV} the fragments generated for triangles will be conservative w.r.t + * the triangle at infinite precision. Since non-degenerate triangles may become degenerate due to vertex snapping, this mode will generate fragments for + * zero area triangles that are otherwise culled when the mode is {@link #GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV CONSERVATIVE_RASTER_MODE_POST_SNAP_NV}. This mode may also generate fragments for pixels + * that are within half a sub-pixel distance away from a triangle's infinite precision boundary. The default mode is set to + * {@link #GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV CONSERVATIVE_RASTER_MODE_POST_SNAP_NV}.

+ * + * @param pname the parameter to set. Must be:
{@link #GL_CONSERVATIVE_RASTER_MODE_NV CONSERVATIVE_RASTER_MODE_NV}
+ * @param param specifies the conservative raster mode to be used. One of:
{@link #GL_CONSERVATIVE_RASTER_MODE_POST_SNAP_NV CONSERVATIVE_RASTER_MODE_POST_SNAP_NV}
{@link #GL_CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV CONSERVATIVE_RASTER_MODE_PRE_SNAP_TRIANGLES_NV}
+ */ + public static native void glConservativeRasterParameteriNV(@NativeType("GLenum") int pname, @NativeType("GLint") int param); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVCopyDepthToColor.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVCopyDepthToColor.java new file mode 100644 index 00000000..d4800ee2 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVCopyDepthToColor.java @@ -0,0 +1,29 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Some applications, especially systems for distributed OpenGL rendering, would like to have a fast way of copying their depth buffer into a color + * buffer; for example, this allows the depth buffer to be scanned out, allowing downstream compositing operations. + * + *

To do this operation in unextended OpenGL, the app must use {@link GL11C#glReadPixels ReadPixels} of {@link GL11#GL_DEPTH_COMPONENT DEPTH_COMPONENT} data, followed by {@link GL11#glDrawPixels DrawPixels} of {@link GL11#GL_RGBA RGBA} + * data. However, this typically will not provide adequate performance.

+ * + *

This extension provides a way to copy the depth data directly into the color buffer, by adding two new options for the "type" parameter of + * {@link GL11#glCopyPixels CopyPixels}: {@link #GL_DEPTH_STENCIL_TO_RGBA_NV DEPTH_STENCIL_TO_RGBA_NV} and {@link #GL_DEPTH_STENCIL_TO_BGRA_NV DEPTH_STENCIL_TO_BGRA_NV}.

+ * + *

Requires {@link NVPackedDepthStencil NV_packed_depth_stencil}.

+ */ +public final class NVCopyDepthToColor { + + /** Accepted by the {@code type} parameter of CopyPixels. */ + public static final int + GL_DEPTH_STENCIL_TO_RGBA_NV = 0x886E, + GL_DEPTH_STENCIL_TO_BGRA_NV = 0x886F; + + private NVCopyDepthToColor() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVCopyImage.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVCopyImage.java new file mode 100644 index 00000000..e84d468c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVCopyImage.java @@ -0,0 +1,38 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the NV_copy_image extension. + * + *

This extension enables efficient image data transfer between image objects (i.e. textures and renderbuffers) without the need to bind the objects or + * otherwise configure the rendering pipeline. The WGL and GLX versions allow copying between images in different contexts, even if those contexts are in + * different sharelists or even on different physical devices.

+ */ +public class NVCopyImage { + + static { GL.initialize(); } + + protected NVCopyImage() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glCopyImageSubDataNV + ); + } + + // --- [ glCopyImageSubDataNV ] --- + + /** Copies a region of texel data between two image objects. An image object may be either a texture or a renderbuffer. */ + public static native void glCopyImageSubDataNV(@NativeType("GLuint") int srcName, @NativeType("GLenum") int srcTarget, @NativeType("GLint") int srcLevel, @NativeType("GLint") int srcX, @NativeType("GLint") int srcY, @NativeType("GLint") int srcZ, @NativeType("GLuint") int dstName, @NativeType("GLenum") int dstTarget, @NativeType("GLint") int dstLevel, @NativeType("GLint") int dstX, @NativeType("GLint") int dstY, @NativeType("GLint") int dstZ, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVDeepTexture3D.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVDeepTexture3D.java new file mode 100644 index 00000000..088e0f6f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVDeepTexture3D.java @@ -0,0 +1,24 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the NV_deep_texture3D extension. + * + *

Some applications require 3D textures that have a significant number of slices, but less resolution in width and height. In the current spec, the + * maximum value for the size of all three dimensions is specified by a single value. This extension adds a second set of limits against which 3D textures + * can be checked if an application needs deeper textures than would be allowed by the symmetric texture limits.

+ */ +public final class NVDeepTexture3D { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv and GetFloatv. */ + public static final int + GL_MAX_DEEP_3D_TEXTURE_WIDTH_HEIGHT_NV = 0x90D0, + GL_MAX_DEEP_3D_TEXTURE_DEPTH_NV = 0x90D1; + + private NVDeepTexture3D() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVDepthBufferFloat.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVDepthBufferFloat.java new file mode 100644 index 00000000..fab932e0 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVDepthBufferFloat.java @@ -0,0 +1,73 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the NV_depth_buffer_float extension. + * + *

This extension provides new texture internal formats whose depth components are stored as 32-bit floating-point values, rather than the normalized + * unsigned integers used in existing depth formats. Floating-point depth textures support all the functionality supported for fixed-point depth textures, + * including shadow mapping and rendering support via EXT_framebuffer_object. Floating-point depth textures can store values outside the range [0,1].

+ * + *

By default, OpenGL entry points taking depth values implicitly clamp the values to the range [0,1]. This extension provides new DepthClear, DepthRange, + * and DepthBoundsEXT entry points that allow applications to specify depth values that are not clamped.

+ * + *

Additionally, this extension provides new packed depth/stencil pixel formats (see EXT_packed_depth_stencil) that have 64-bit pixels consisting of a + * 32-bit floating-point depth value, 8 bits of stencil, and 24 unused bites. A packed depth/stencil texture internal format is also provided.

+ * + *

This extension does not provide support for WGL or GLX pixel formats with floating-point depth buffers. The existing (but not commonly used) + * WGL_EXT_depth_float extension could be used for this purpose.

+ * + *

Requires {@link GL20 OpenGL 2.0}, {@link ARBColorBufferFloat ARB_color_buffer_float}, {@link EXTPackedDepthStencil EXT_packed_depth_stencil} and {@link EXTFramebufferObject EXT_framebuffer_object}.

+ */ +public class NVDepthBufferFloat { + + /** + * Accepted by the {@code internalformat} parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, CopyTexImage2D, and RenderbufferStorageEXT, and + * returned in the {@code data} parameter of GetTexLevelParameter and GetRenderbufferParameterivEXT. + */ + public static final int + GL_DEPTH_COMPONENT32F_NV = 0x8DAB, + GL_DEPTH32F_STENCIL8_NV = 0x8DAC; + + /** + * Accepted by the {@code type} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, and + * GetTexImage. + */ + public static final int GL_FLOAT_32_UNSIGNED_INT_24_8_REV_NV = 0x8DAD; + + /** Accepted by the {@code pname} parameters of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_DEPTH_BUFFER_FLOAT_MODE_NV = 0x8DAF; + + static { GL.initialize(); } + + protected NVDepthBufferFloat() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glDepthRangedNV, caps.glClearDepthdNV, caps.glDepthBoundsdNV + ); + } + + // --- [ glDepthRangedNV ] --- + + public static native void glDepthRangedNV(@NativeType("GLdouble") double zNear, @NativeType("GLdouble") double zFar); + + // --- [ glClearDepthdNV ] --- + + public static native void glClearDepthdNV(@NativeType("GLdouble") double depth); + + // --- [ glDepthBoundsdNV ] --- + + public static native void glDepthBoundsdNV(@NativeType("GLdouble") double zmin, @NativeType("GLdouble") double zmax); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVDepthClamp.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVDepthClamp.java new file mode 100644 index 00000000..6d020e28 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVDepthClamp.java @@ -0,0 +1,36 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the NV_depth_clamp extension. + * + *

In some rendering applications such as shadow volumes, it is useful + * to allow line and polygon primitives to be rasterized without + * clipping the primitive to the near or far clip volume planes (side + * clip volume planes clip normally). Without the near and far clip + * planes, rasterization (pixel coverage determination) in X and Y + * can proceed normally if we ignore the near and far clip planes. + * The one major issue is that fragments of a primitive may extend + * beyond the conventional window space depth range for depth values + * (typically the range [0,1]). Rather than discarding fragments that + * defy the window space depth range (effectively what near and far + * plane clipping accomplish), the depth values can be clamped to the + * current depth range.

+ * + *

This extension provides exactly such functionality.

+ */ +public final class NVDepthClamp { + + /** + * Accepted by the {@code cap} parameter Enable, Disable, and IsEnabled, + * and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. + */ + public static final int GL_DEPTH_CLAMP_NV = 0x864F; + + private NVDepthClamp() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVDrawTexture.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVDrawTexture.java new file mode 100644 index 00000000..0406df4c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVDrawTexture.java @@ -0,0 +1,42 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the NV_draw_texture extension. + * + *

This extension provides a new function, DrawTextureNV(), allowing + * applications to draw an screen-aligned rectangle displaying some or all of + * the contents of a two-dimensional or rectangle texture. Callers specify a + * texture object, an optional sampler object, window coordinates of the + * rectangle to draw, and texture coordinates corresponding to the corners of + * the rectangle. For each fragment produced by the rectangle, DrawTextureNV + * interpolates the texture coordinates, performs a texture lookup, and uses + * the texture result as the fragment color.

+ */ +public class NVDrawTexture { + + static { GL.initialize(); } + + protected NVDrawTexture() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glDrawTextureNV + ); + } + + // --- [ glDrawTextureNV ] --- + + public static native void glDrawTextureNV(@NativeType("GLuint") int texture, @NativeType("GLuint") int sampler, @NativeType("GLfloat") float x0, @NativeType("GLfloat") float y0, @NativeType("GLfloat") float x1, @NativeType("GLfloat") float y1, @NativeType("GLfloat") float z, @NativeType("GLfloat") float s0, @NativeType("GLfloat") float t0, @NativeType("GLfloat") float s1, @NativeType("GLfloat") float t1); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVDrawVulkanImage.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVDrawVulkanImage.java new file mode 100644 index 00000000..510e1625 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVDrawVulkanImage.java @@ -0,0 +1,132 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_draw_vulkan_image extension. + * + *

This extension provides a new function, {@link #glDrawVkImageNV DrawVkImageNV}, allowing applications to draw a screen-aligned rectangle displaying some or all of the + * contents of a two-dimensional Vulkan VkImage. Callers specify a Vulkan {@code VkImage} handle, an optional OpenGL sampler object, window coordinates of + * the rectangle to draw, and texture coordinates corresponding to the corners of the rectangle. For each fragment produced by the rectangle, + * {@code DrawVkImageNV} interpolates the texture coordinates, performs a texture lookup, and uses the texture result as the fragment color.

+ * + *

No shaders are used by {@code DrawVkImageNV}; the results of the texture lookup are used in lieu of a fragment shader output. The fragments generated + * are processed by all per-fragment operations. In particular, {@code DrawVkImageNV()} fully supports blending and multisampling.

+ * + *

In order to synchronize between Vulkan and OpenGL there are three other functions provided; {@link #glWaitVkSemaphoreNV WaitVkSemaphoreNV}, {@link #glSignalVkSemaphoreNV SignalVkSemaphoreNV} and + * {@link #glSignalVkFenceNV SignalVkFenceNV}. These allow OpenGL to wait for Vulkan to complete work and also Vulkan to wait for OpenGL to complete work. Together OpenGL and + * Vulkan can synchronize on the server without application interation.

+ * + *

Finally the function {@code GetVkProcAddrNV()} is provided to allow the OpenGL context to query the Vulkan entry points directly and avoid having to + * load them through the typical Vulkan loader.

+ */ +public class NVDrawVulkanImage { + + static { GL.initialize(); } + + protected NVDrawVulkanImage() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glDrawVkImageNV, caps.glGetVkProcAddrNV, caps.glWaitVkSemaphoreNV, caps.glSignalVkSemaphoreNV, caps.glSignalVkFenceNV + ); + } + + // --- [ glDrawVkImageNV ] --- + + /** + * Draws a screen-aligned rectangle displaying a portion of the contents of the Vulkan {@code VkImage}. + * + * @param vkImage the Vulkan image handle + * @param sampler an optional sampler object + * @param x0 the rectangle left window coordinate + * @param y0 the rectangle bottom window coordinate + * @param x1 the rectangle right window coordinate + * @param y1 the rectangle top window coordinate + * @param z the Z window coordinate + * @param s0 the left texture coordinate + * @param t0 the bottom texture coordinate + * @param s1 the right texture coordinate + * @param t1 the top texture coordinate + */ + public static native void glDrawVkImageNV(@NativeType("GLuint64") long vkImage, @NativeType("GLuint") int sampler, @NativeType("GLfloat") float x0, @NativeType("GLfloat") float y0, @NativeType("GLfloat") float x1, @NativeType("GLfloat") float y1, @NativeType("GLfloat") float z, @NativeType("GLfloat") float s0, @NativeType("GLfloat") float t0, @NativeType("GLfloat") float s1, @NativeType("GLfloat") float t1); + + // --- [ glGetVkProcAddrNV ] --- + + /** Unsafe version of: {@link #glGetVkProcAddrNV GetVkProcAddrNV} */ + public static native long nglGetVkProcAddrNV(long name); + + /** + * Queries the Vulkan function entry points from within an OpenGL context. + * + * @param name name of the Vulkan function + */ + @NativeType("VULKANPROCNV") + public static long glGetVkProcAddrNV(@NativeType("GLchar const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nglGetVkProcAddrNV(memAddress(name)); + } + + /** + * Queries the Vulkan function entry points from within an OpenGL context. + * + * @param name name of the Vulkan function + */ + @NativeType("VULKANPROCNV") + public static long glGetVkProcAddrNV(@NativeType("GLchar const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + return nglGetVkProcAddrNV(nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glWaitVkSemaphoreNV ] --- + + /** + * Causes the GL server to block until the Vulkan {@code VkSemaphore} is signalled. No GL commands after this command are executed by the server until the + * semaphore is signaled. + * + * @param vkSemaphore a valid Vulkan {@code VkSemaphore} non-dispatchable handle otherwise the operation is undefined + */ + public static native void glWaitVkSemaphoreNV(@NativeType("GLuint64") long vkSemaphore); + + // --- [ glSignalVkSemaphoreNV ] --- + + /** + * Causes the GL server to signal the Vulkan {@code VkSemaphore} when it executes this command. The semaphore is not signalled by GL until all commands + * issued before this have completed execution on the GL server. + * + * @param vkSemaphore a valid Vulkan {@code VkSemaphore} non-dispatchable handle otherwise the operation is undefined + */ + public static native void glSignalVkSemaphoreNV(@NativeType("GLuint64") long vkSemaphore); + + // --- [ glSignalVkFenceNV ] --- + + /** + * Causes the GL server to signal the Vulkan {@code VkFence} object when it executes this command. The fence is not signalled by the GL until all commands + * issued before this have completed execution on the GL server. + * + * @param vkFence a valid Vulkan VkFence non-dispatcable handle otherwise the operation is undefined + */ + public static native void glSignalVkFenceNV(@NativeType("GLuint64") long vkFence); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVExplicitMultisample.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVExplicitMultisample.java new file mode 100644 index 00000000..a2b9bdbc --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVExplicitMultisample.java @@ -0,0 +1,102 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_explicit_multisample extension. + * + *

In traditional multisample specs, the API only allows access to the samples indirectly through methods such as coverage values and downsampled + * readbacks. NV_explicit_multisample adds a set of new capabilities to allow more precise control over the use of multisamples. Specifically, it adds:

+ * + *
    + *
  • A query in the API to query the location of samples within the pixel
  • + *
  • An explicit control for the multisample sample mask to augment the control provided by SampleCoverage
  • + *
  • A new texture target to wrap a renderbuffer and allow a restricted class of accesses to the samples
  • + *
  • The ability to fetch a specific sample from a multisampled texture from within a shader
  • + *
  • A program option to enable the new behavior
  • + *
+ * + *

Requires {@link GL20 OpenGL 2.0} and {@link ARBMultisample ARB_multisample}.

+ */ +public class NVExplicitMultisample { + + /** Accepted by the {@code pname} parameter of GetMultisamplefvNV. */ + public static final int GL_SAMPLE_POSITION_NV = 0x8E50; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_SAMPLE_MASK_NV = 0x8E51; + + /** Accepted by the {@code pname} parameter of GetBooleanIndexedvEXT and GetIntegerIndexedvEXT. */ + public static final int GL_SAMPLE_MASK_VALUE_NV = 0x8E52; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_TEXTURE_BINDING_RENDERBUFFER_NV = 0x8E53, + GL_TEXTURE_RENDERBUFFER_DATA_STORE_BINDING_NV = 0x8E54, + GL_MAX_SAMPLE_MASK_WORDS_NV = 0x8E59; + + /** Accepted by the {@code target} parameter of BindTexture, and TexRenderbufferNV. */ + public static final int GL_TEXTURE_RENDERBUFFER_NV = 0x8E55; + + /** Returned by the {@code type} parameter of GetActiveUniform. */ + public static final int + GL_SAMPLER_RENDERBUFFER_NV = 0x8E56, + GL_INT_SAMPLER_RENDERBUFFER_NV = 0x8E57, + GL_UNSIGNED_INT_SAMPLER_RENDERBUFFER_NV = 0x8E58; + + static { GL.initialize(); } + + protected NVExplicitMultisample() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glGetMultisamplefvNV, caps.glSampleMaskIndexedNV, caps.glTexRenderbufferNV + ); + } + + // --- [ glGetMultisamplefvNV ] --- + + public static native void nglGetMultisamplefvNV(int pname, int index, long val); + + public static void glGetMultisamplefvNV(@NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLfloat *") FloatBuffer val) { + if (CHECKS) { + check(val, 2); + } + nglGetMultisamplefvNV(pname, index, memAddress(val)); + } + + // --- [ glSampleMaskIndexedNV ] --- + + public static native void glSampleMaskIndexedNV(@NativeType("GLuint") int index, @NativeType("GLbitfield") int mask); + + // --- [ glTexRenderbufferNV ] --- + + public static native void glTexRenderbufferNV(@NativeType("GLenum") int target, @NativeType("GLuint") int renderbuffer); + + /** Array version of: {@link #glGetMultisamplefvNV GetMultisamplefvNV} */ + public static void glGetMultisamplefvNV(@NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLfloat *") float[] val) { + long __functionAddress = GL.getICD().glGetMultisamplefvNV; + if (CHECKS) { + check(__functionAddress); + check(val, 2); + } + callPV(pname, index, val, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFence.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFence.java new file mode 100644 index 00000000..5dff612c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFence.java @@ -0,0 +1,165 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_fence extension. + * + *

The goal of this extension is provide a finer granularity of synchronizing GL command completion than offered by standard OpenGL, which offers only two + * mechanisms for synchronization: Flush and Finish. Since Flush merely assures the user that the commands complete in a finite (though undetermined) + * amount of time, it is, thus, of only modest utility. Finish, on the other hand, stalls CPU execution until all pending GL commands have completed. This + * extension offers a middle ground - the ability to "finish" a subset of the command stream, and the ability to determine whether a given command has + * completed or not.

+ * + *

This extension introduces the concept of a "fence" to the OpenGL command stream. Once the fence is inserted into the command stream, it can be queried + * for a given condition - typically, its completion. Moreover, the application may also request a partial Finish -- that is, all commands prior to the + * fence will be forced to complete until control is returned to the calling process. These new mechanisms allow for synchronization between the host CPU + * and the GPU, which may be accessing the same resources (typically memory).

+ * + *

This extension is useful in conjunction with NV_vertex_array_range to determine when vertex information has been pulled from the vertex array range. + * Once a fence has been tested TRUE or finished, all vertex indices issued before the fence must have been pulled. This ensures that the vertex data + * memory corresponding to the issued vertex indices can be safely modified (assuming no other outstanding vertex indices are issued subsequent to the + * fence).

+ */ +public class NVFence { + + /** Accepted by the {@code condition} parameter of SetFenceNV. */ + public static final int GL_ALL_COMPLETED_NV = 0x84F2; + + /** Accepted by the {@code pname} parameter of GetFenceivNV. */ + public static final int + GL_FENCE_STATUS_NV = 0x84F3, + GL_FENCE_CONDITION_NV = 0x84F4; + + static { GL.initialize(); } + + protected NVFence() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glDeleteFencesNV, caps.glGenFencesNV, caps.glIsFenceNV, caps.glTestFenceNV, caps.glGetFenceivNV, caps.glFinishFenceNV, caps.glSetFenceNV + ); + } + + // --- [ glDeleteFencesNV ] --- + + public static native void nglDeleteFencesNV(int n, long fences); + + public static void glDeleteFencesNV(@NativeType("GLuint const *") IntBuffer fences) { + nglDeleteFencesNV(fences.remaining(), memAddress(fences)); + } + + public static void glDeleteFencesNV(@NativeType("GLuint const *") int fence) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer fences = stack.ints(fence); + nglDeleteFencesNV(1, memAddress(fences)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGenFencesNV ] --- + + public static native void nglGenFencesNV(int n, long fences); + + public static void glGenFencesNV(@NativeType("GLuint *") IntBuffer fences) { + nglGenFencesNV(fences.remaining(), memAddress(fences)); + } + + @NativeType("void") + public static int glGenFencesNV() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer fences = stack.callocInt(1); + nglGenFencesNV(1, memAddress(fences)); + return fences.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glIsFenceNV ] --- + + @NativeType("GLboolean") + public static native boolean glIsFenceNV(@NativeType("GLuint") int fence); + + // --- [ glTestFenceNV ] --- + + @NativeType("GLboolean") + public static native boolean glTestFenceNV(@NativeType("GLuint") int fence); + + // --- [ glGetFenceivNV ] --- + + public static native void nglGetFenceivNV(int fence, int pname, long params); + + public static void glGetFenceivNV(@NativeType("GLuint") int fence, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetFenceivNV(fence, pname, memAddress(params)); + } + + @NativeType("void") + public static int glGetFenceiNV(@NativeType("GLuint") int fence, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglGetFenceivNV(fence, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glFinishFenceNV ] --- + + public static native void glFinishFenceNV(@NativeType("GLuint") int fence); + + // --- [ glSetFenceNV ] --- + + public static native void glSetFenceNV(@NativeType("GLuint") int fence, @NativeType("GLenum") int condition); + + /** Array version of: {@link #glDeleteFencesNV DeleteFencesNV} */ + public static void glDeleteFencesNV(@NativeType("GLuint const *") int[] fences) { + long __functionAddress = GL.getICD().glDeleteFencesNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(fences.length, fences, __functionAddress); + } + + /** Array version of: {@link #glGenFencesNV GenFencesNV} */ + public static void glGenFencesNV(@NativeType("GLuint *") int[] fences) { + long __functionAddress = GL.getICD().glGenFencesNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(fences.length, fences, __functionAddress); + } + + /** Array version of: {@link #glGetFenceivNV GetFenceivNV} */ + public static void glGetFenceivNV(@NativeType("GLuint") int fence, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetFenceivNV; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(fence, pname, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFillRectangle.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFillRectangle.java new file mode 100644 index 00000000..88be949f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFillRectangle.java @@ -0,0 +1,22 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the NV_fill_rectangle extension. + * + *

This extension adds a new {@link GL11C#glPolygonMode PolygonMode} setting where a triangle is rasterized by computing and filling its axis-aligned screen-space bounding + * box, disregarding the actual triangle edges. This can be useful for drawing a rectangle without being split into two triangles with an internal edge. + * It is also useful to minimize the number of primitives that need to be drawn, particularly for a user-interface.

+ */ +public final class NVFillRectangle { + + /** Accepted by the {@code mode} parameter of PolygonMode. */ + public static final int GL_FILL_RECTANGLE_NV = 0x933C; + + private NVFillRectangle() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFloatBuffer.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFloatBuffer.java new file mode 100644 index 00000000..b91aa09b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFloatBuffer.java @@ -0,0 +1,41 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the NV_float_buffer extension. + * + *

This extension builds upon NV_fragment_program to provide a framebuffer and texture format that allows fragment programs to read and write + * unconstrained floating point data.

+ */ +public final class NVFloatBuffer { + + /** Accepted by the {@code internalformat} parameter of TexImage2D and CopyTexImage2D. */ + public static final int + GL_FLOAT_R_NV = 0x8880, + GL_FLOAT_RG_NV = 0x8881, + GL_FLOAT_RGB_NV = 0x8882, + GL_FLOAT_RGBA_NV = 0x8883, + GL_FLOAT_R16_NV = 0x8884, + GL_FLOAT_R32_NV = 0x8885, + GL_FLOAT_RG16_NV = 0x8886, + GL_FLOAT_RG32_NV = 0x8887, + GL_FLOAT_RGB16_NV = 0x8888, + GL_FLOAT_RGB32_NV = 0x8889, + GL_FLOAT_RGBA16_NV = 0x888A, + GL_FLOAT_RGBA32_NV = 0x888B; + + /** Accepted by the {@code pname} parameter of GetTexLevelParameterfv and GetTexLevelParameteriv. */ + public static final int GL_TEXTURE_FLOAT_COMPONENTS_NV = 0x888C; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_FLOAT_CLEAR_COLOR_VALUE_NV = 0x888D, + GL_FLOAT_RGBA_MODE_NV = 0x888E; + + private NVFloatBuffer() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFogDistance.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFogDistance.java new file mode 100644 index 00000000..a28060e1 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFogDistance.java @@ -0,0 +1,44 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the NV_fog_distance extension. + * + *

Ideally, the fog distance (used to compute the fog factor as described in Section 3.10) should be computed as the per-fragment Euclidean distance to + * the fragment center from the eye. In practice, implementations "may choose to approximate the eye-coordinate distance from the eye to each fragment + * center by abs(ze). Further, [the fog factor] f need not be computed at each fragment, but may be computed at each vertex and interpolated as other data + * are."

+ * + *

This extension provides the application specific control over how OpenGL computes the distance used in computing the fog factor.

+ * + *

The extension supports three fog distance modes: "eye plane absolute", where the fog distance is the absolute planar distance from the eye plane (i.e., + * OpenGL's standard implementation allowance as cited above); "eye plane", where the fog distance is the signed planar distance from the eye plane; and + * "eye radial", where the fog distance is computed as a Euclidean distance. In the case of the eye radial fog distance mode, the distance may be computed + * per-vertex and then interpolated per-fragment.

+ * + *

The intent of this extension is to provide applications with better control over the tradeoff between performance and fog quality. The "eye planar" + * modes (signed or absolute) are straightforward to implement with good performance, but scenes are consistently under-fogged at the edges of the field + * of view. The "eye radial" mode can provide for more accurate fog at the edges of the field of view, but this assumes that either the eye radial fog + * distance is computed per-fragment, or if the fog distance is computed per-vertex and then interpolated per-fragment, then the scene must be + * sufficiently tessellated.

+ */ +public final class NVFogDistance { + + /** Accepted by the {@code pname} parameters of Fogf, Fogi, Fogfv, Fogiv, GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_FOG_DISTANCE_MODE_NV = 0x855A; + + /** + * When the {@code pname} parameter of Fogf, Fogi, Foggv, and Fogiv, is FOG_DISTANCE_MODE_NV, then the value of {@code param} or the value pointed to by + * {@code params} may be. + */ + public static final int + GL_EYE_RADIAL_NV = 0x855B, + GL_EYE_PLANE_ABSOLUTE_NV = 0x855C; + + private NVFogDistance() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFragmentCoverageToColor.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFragmentCoverageToColor.java new file mode 100644 index 00000000..48ab0cb1 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFragmentCoverageToColor.java @@ -0,0 +1,49 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the NV_fragment_coverage_to_color extension. + * + *

This extension allows the fragment coverage value, represented as an + * integer bitfield, to be substituted for a color output being written to a + * single-component color buffer with integer components (e.g., R8UI). The + * capability provided by this extension is different from simply writing the + * gl_SampleMask fragment shader output in that the coverage value written to + * the framebuffer is taken after alpha test, stencil test, and depth test, + * as well as after the multisample fragment operations such as + * alpha-to-coverage.

+ */ +public class NVFragmentCoverageToColor { + + /** Accepted by the {@code cap} parameter of Enable, Disable, IsEnabled. */ + public static final int GL_FRAGMENT_COVERAGE_TO_COLOR_NV = 0x92DD; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int GL_FRAGMENT_COVERAGE_COLOR_NV = 0x92DE; + + static { GL.initialize(); } + + protected NVFragmentCoverageToColor() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glFragmentCoverageColorNV + ); + } + + // --- [ glFragmentCoverageColorNV ] --- + + /** @param color the draw buffer index that the coverage value will be written to. Must be between 0 and the value of MAX_DRAW_BUFFERS minus one, inclusive. */ + public static native void glFragmentCoverageColorNV(@NativeType("GLuint") int color); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFramebufferMixedSamples.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFramebufferMixedSamples.java new file mode 100644 index 00000000..3c778879 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFramebufferMixedSamples.java @@ -0,0 +1,143 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_framebuffer_mixed_samples extension. + * + *

This extension allows multisample rendering with a raster and + * depth/stencil sample count that is larger than the color sample count. + * Rasterization and the results of the depth and stencil tests together + * determine the portion of a pixel that is "covered". It can be useful to + * evaluate coverage at a higher frequency than color samples are stored. + * This coverage is then "reduced" to a collection of covered color samples, + * each having an opacity value corresponding to the fraction of the color + * sample covered. The opacity can optionally be blended into individual + * color samples.

+ */ +public class NVFramebufferMixedSamples { + + /** Accepted by the {@code cap} parameter of Enable, Disable, IsEnabled. */ + public static final int + GL_RASTER_MULTISAMPLE_EXT = 0x9327, + GL_COVERAGE_MODULATION_TABLE_NV = 0x9331; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_RASTER_SAMPLES_EXT = 0x9328, + GL_MAX_RASTER_SAMPLES_EXT = 0x9329, + GL_RASTER_FIXED_SAMPLE_LOCATIONS_EXT = 0x932A, + GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT = 0x932B, + GL_EFFECTIVE_RASTER_SAMPLES_EXT = 0x932C, + GL_COLOR_SAMPLES_NV = 0x8E20, + GL_DEPTH_SAMPLES_NV = 0x932D, + GL_STENCIL_SAMPLES_NV = 0x932E, + GL_MIXED_DEPTH_SAMPLES_SUPPORTED_NV = 0x932F, + GL_MIXED_STENCIL_SAMPLES_SUPPORTED_NV = 0x9330, + GL_COVERAGE_MODULATION_NV = 0x9332, + GL_COVERAGE_MODULATION_TABLE_SIZE_NV = 0x9333; + + static { GL.initialize(); } + + protected NVFramebufferMixedSamples() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glRasterSamplesEXT, caps.glCoverageModulationTableNV, caps.glGetCoverageModulationTableNV, caps.glCoverageModulationNV + ); + } + + // --- [ glRasterSamplesEXT ] --- + + /** + * Selects the number of samples to be used for rasterization. {@code samples} represents a request for a desired minimum number of samples. Since + * different implementations may support different sample counts, the actual sample pattern used is implementation-dependent. However, the resulting value + * for {@link EXTRasterMultisample#GL_RASTER_SAMPLES_EXT RASTER_SAMPLES_EXT} is guaranteed to be greater than or equal to {@code samples} and no more than the next larger sample count supported by the + * implementation. If {@code fixedsamplelocations} is {@link GL11#GL_TRUE TRUE}, identical sample locations will be used for all pixels. The sample locations chosen are a + * function of only the parameters to RasterSamplesEXT and not of any other state. + * + *

If {@link EXTRasterMultisample#GL_RASTER_MULTISAMPLE_EXT RASTER_MULTISAMPLE_EXT} is enabled, then the sample pattern chosen by RasterSamplesEXT will be used instead of sampling at the center of the pixel. + * The sample locations can be queried with {@link GL32C#glGetMultisamplefv GetMultisamplefv} with a {@code pname} of {@link GL32#GL_SAMPLE_POSITION SAMPLE_POSITION}, similar to normal multisample sample + * locations.

+ * + *

The value {@link EXTRasterMultisample#GL_MULTISAMPLE_RASTERIZATION_ALLOWED_EXT MULTISAMPLE_RASTERIZATION_ALLOWED_EXT} is {@link GL11#GL_TRUE TRUE} if {@link GL13#GL_SAMPLE_BUFFERS SAMPLE_BUFFERS} is one or if {@link EXTRasterMultisample#GL_RASTER_MULTISAMPLE_EXT RASTER_MULTISAMPLE_EXT} is enabled. The value + * {@link EXTRasterMultisample#GL_EFFECTIVE_RASTER_SAMPLES_EXT EFFECTIVE_RASTER_SAMPLES_EXT} is equal to {@link EXTRasterMultisample#GL_RASTER_SAMPLES_EXT RASTER_SAMPLES_EXT} if {@link EXTRasterMultisample#GL_RASTER_MULTISAMPLE_EXT RASTER_MULTISAMPLE_EXT} is enabled, otherwise is equal to {@link GL13#GL_SAMPLES SAMPLES}.

+ * + *

Explicit multisample rasterization can not be used in conjunction with depth, stencil, or depth bounds tests, multisample framebuffers, or if + * {@link EXTRasterMultisample#GL_RASTER_SAMPLES_EXT RASTER_SAMPLES_EXT} is zero. If {@link EXTRasterMultisample#GL_RASTER_MULTISAMPLE_EXT RASTER_MULTISAMPLE_EXT} is enabled, the error {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} will be generated by Draw commands if

+ * + *
    + *
  • the value of {@link EXTRasterMultisample#GL_RASTER_SAMPLES_EXT RASTER_SAMPLES_EXT} is zero
  • + *
  • the depth, stencil, or depth bounds test is enabled
  • + *
  • a multisample draw framebuffer is bound ({@link GL13#GL_SAMPLE_BUFFERS SAMPLE_BUFFERS} is one)
  • + *
+ * + *
Errors
+ * + *

An {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error is generated if {@code samples} is greater than the value of {@link EXTRasterMultisample#GL_MAX_RASTER_SAMPLES_EXT MAX_RASTER_SAMPLES_EXT} (the implementation-dependent maximum + * number of samples).

+ * + * @param samples the number of samples to be used for rasterization + * @param fixedsamplelocations if {@link GL11#GL_TRUE TRUE}, identical sample locations will be used for all pixels + */ + public static void glRasterSamplesEXT(@NativeType("GLuint") int samples, @NativeType("GLboolean") boolean fixedsamplelocations) { + EXTRasterMultisample.glRasterSamplesEXT(samples, fixedsamplelocations); + } + + // --- [ glCoverageModulationTableNV ] --- + + /** + * Unsafe version of: {@link #glCoverageModulationTableNV CoverageModulationTableNV} + * + * @param n The size of the coverage modulation table. Must be equal to the value of COVERAGE_MODULATION_TABLE_SIZE_NV. + */ + public static native void nglCoverageModulationTableNV(int n, long v); + + public static void glCoverageModulationTableNV(@NativeType("GLfloat const *") FloatBuffer v) { + nglCoverageModulationTableNV(v.remaining(), memAddress(v)); + } + + // --- [ glGetCoverageModulationTableNV ] --- + + public static native void nglGetCoverageModulationTableNV(int bufsize, long v); + + public static void glGetCoverageModulationTableNV(@NativeType("GLfloat *") FloatBuffer v) { + nglGetCoverageModulationTableNV(v.remaining(), memAddress(v)); + } + + // --- [ glCoverageModulationNV ] --- + + public static native void glCoverageModulationNV(@NativeType("GLenum") int components); + + /** Array version of: {@link #glCoverageModulationTableNV CoverageModulationTableNV} */ + public static void glCoverageModulationTableNV(@NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glCoverageModulationTableNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(v.length, v, __functionAddress); + } + + /** Array version of: {@link #glGetCoverageModulationTableNV GetCoverageModulationTableNV} */ + public static void glGetCoverageModulationTableNV(@NativeType("GLfloat *") float[] v) { + long __functionAddress = GL.getICD().glGetCoverageModulationTableNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(v.length, v, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFramebufferMultisampleCoverage.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFramebufferMultisampleCoverage.java new file mode 100644 index 00000000..90797f73 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVFramebufferMultisampleCoverage.java @@ -0,0 +1,56 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the NV_framebuffer_multisample_coverage extension. + * + *

This extension extends the EXT_framebuffer_multisample specification by providing a new function, RenderBufferStorageMultisampleCoverageNV, that + * distinguishes between color samples and coverage samples.

+ * + *

EXT_framebuffer_multisample introduced the function RenderbufferStorageMultisampleEXT as a method of defining the storage parameters for a multisample + * render buffer. This function takes a {@code samples} parameter. Using rules provided by the specification, the {@code samples} parameter is resolved to + * an actual number of samples that is supported by the underlying hardware. EXT_framebuffer_multisample does not specify whether {@code samples} refers + * to coverage samples or color samples.

+ * + *

This extension adds the function RenderbufferStorageMultisamplCoverageNV, which takes a {@code coverageSamples} parameter as well as a + * {@code colorSamples} parameter. These two parameters give developers more fine grained control over the quality of multisampled images.

+ * + *

Requires {@link EXTFramebufferObject EXT_framebuffer_object}, {@link EXTFramebufferBlit EXT_framebuffer_blit} and {@link EXTFramebufferMultisample EXT_framebuffer_multisample}.

+ */ +public class NVFramebufferMultisampleCoverage { + + /** Accepted by the {@code pname} parameter of GetRenderbufferParameterivEXT. */ + public static final int + GL_RENDERBUFFER_COVERAGE_SAMPLES_NV = 0x8CAB, + GL_RENDERBUFFER_COLOR_SAMPLES_NV = 0x8E10; + + /** Accepted by the {@code pname} parameter of GetIntegerv. */ + public static final int + GL_MAX_MULTISAMPLE_COVERAGE_MODES_NV = 0x8E11, + GL_MULTISAMPLE_COVERAGE_MODES_NV = 0x8E12; + + static { GL.initialize(); } + + protected NVFramebufferMultisampleCoverage() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glRenderbufferStorageMultisampleCoverageNV + ); + } + + // --- [ glRenderbufferStorageMultisampleCoverageNV ] --- + + public static native void glRenderbufferStorageMultisampleCoverageNV(@NativeType("GLenum") int target, @NativeType("GLsizei") int coverageSamples, @NativeType("GLsizei") int colorSamples, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVGPUMulticast.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVGPUMulticast.java new file mode 100644 index 00000000..73f4ea30 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVGPUMulticast.java @@ -0,0 +1,315 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_gpu_multicast extension. + * + *

This extension enables novel multi-GPU rendering techniques by providing application control over a group of linked GPUs with identical hardware + * configuration.

+ * + *

Multi-GPU rendering techniques fall into two categories: implicit and explicit. Existing explicit approaches like {@link WGLNVGPUAffinity WGL_NV_gpu_affinity} have two + * main drawbacks: CPU overhead and application complexity. An application must manage one context per GPU and multi-pump the API stream. Implicit + * multi-GPU rendering techniques avoid these issues by broadcasting rendering from one context to multiple GPUs. Common implicit approaches include + * alternate-frame rendering (AFR), split-frame rendering (SFR) and multi-GPU anti-aliasing. They each have drawbacks. AFR scales nicely but interacts + * poorly with inter-frame dependencies. SFR can improve latency but has challenges with offscreen rendering and scaling of vertex processing. With + * multi-GPU anti-aliasing, each GPU renders the same content with alternate sample positions and the driver blends the result to improve quality. This + * also has issues with offscreen rendering and can conflict with other anti-aliasing techniques.

+ * + *

These issues with implicit multi-GPU rendering all have the same root cause: the driver lacks adequate knowledge to accelerate every application. To + * resolve this, NV_gpu_multicast provides fine-grained, explicit application control over multiple GPUs with a single context.

+ * + *

Key points:

+ * + *
    + *
  • One context controls multiple GPUs. Every GPU in the linked group can access every object.
  • + *
  • Rendering is broadcast. Each draw is repeated across all GPUs in the linked group.
  • + *
  • Each GPU gets its own instance of all framebuffers, allowing individualized output for each GPU. Input data can be customized for each GPU using + * buffers created with the storage flag, {@link #GL_PER_GPU_STORAGE_BIT_NV PER_GPU_STORAGE_BIT_NV} and a new API, {@link #glMulticastBufferSubDataNV MulticastBufferSubDataNV}.
  • + *
  • New interfaces provide mechanisms to transfer textures and buffers from one GPU to another.
  • + *
+ * + *

Requires {@link ARBCopyImage ARB_copy_image} and {@link EXTDirectStateAccess EXT_direct_state_access}.

+ */ +public class NVGPUMulticast { + + /** Accepted in the {@code flags} parameter of BufferStorage and NamedBufferStorageEXT. */ + public static final int GL_PER_GPU_STORAGE_BIT_NV = 0x800; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int + GL_MULTICAST_GPUS_NV = 0x92BA, + GL_RENDER_GPU_MASK_NV = 0x9558; + + /** + * Accepted as a value for {@code pname} for the TexParameter{if}, TexParameter{if}v, TextureParameter{if}, TextureParameter{if}v, MultiTexParameter{if}EXT + * and MultiTexParameter{if}vEXT commands and for the {@code value} parameter of GetTexParameter{if}v, GetTextureParameter{if}vEXT and + * GetMultiTexParameter{if}vEXT. + */ + public static final int GL_PER_GPU_STORAGE_NV = 0x9548; + + /** Accepted by the {@code pname} parameter of GetMultisamplefv. */ + public static final int GL_MULTICAST_PROGRAMMABLE_SAMPLE_LOCATION_NV = 0x9549; + + static { GL.initialize(); } + + protected NVGPUMulticast() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glRenderGpuMaskNV, caps.glMulticastBufferSubDataNV, caps.glMulticastCopyBufferSubDataNV, caps.glMulticastCopyImageSubDataNV, + caps.glMulticastBlitFramebufferNV, caps.glMulticastFramebufferSampleLocationsfvNV, caps.glMulticastBarrierNV, caps.glMulticastWaitSyncNV, + caps.glMulticastGetQueryObjectivNV, caps.glMulticastGetQueryObjectuivNV, caps.glMulticastGetQueryObjecti64vNV, + caps.glMulticastGetQueryObjectui64vNV + ); + } + + // --- [ glRenderGpuMaskNV ] --- + + /** Restricts render commands to a specific set of GPUs. */ + public static native void glRenderGpuMaskNV(@NativeType("GLbitfield") int mask); + + // --- [ glMulticastBufferSubDataNV ] --- + + public static native void nglMulticastBufferSubDataNV(int gpuMask, int buffer, long offset, long size, long data); + + public static void glMulticastBufferSubDataNV(@NativeType("GLbitfield") int gpuMask, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") ByteBuffer data) { + nglMulticastBufferSubDataNV(gpuMask, buffer, offset, data.remaining(), memAddress(data)); + } + + public static void glMulticastBufferSubDataNV(@NativeType("GLbitfield") int gpuMask, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") ShortBuffer data) { + nglMulticastBufferSubDataNV(gpuMask, buffer, offset, Integer.toUnsignedLong(data.remaining()) << 1, memAddress(data)); + } + + public static void glMulticastBufferSubDataNV(@NativeType("GLbitfield") int gpuMask, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") IntBuffer data) { + nglMulticastBufferSubDataNV(gpuMask, buffer, offset, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data)); + } + + public static void glMulticastBufferSubDataNV(@NativeType("GLbitfield") int gpuMask, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") FloatBuffer data) { + nglMulticastBufferSubDataNV(gpuMask, buffer, offset, Integer.toUnsignedLong(data.remaining()) << 2, memAddress(data)); + } + + public static void glMulticastBufferSubDataNV(@NativeType("GLbitfield") int gpuMask, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") DoubleBuffer data) { + nglMulticastBufferSubDataNV(gpuMask, buffer, offset, Integer.toUnsignedLong(data.remaining()) << 3, memAddress(data)); + } + + // --- [ glMulticastCopyBufferSubDataNV ] --- + + public static native void glMulticastCopyBufferSubDataNV(@NativeType("GLuint") int readGpu, @NativeType("GLbitfield") int writeGpuMask, @NativeType("GLuint") int readBuffer, @NativeType("GLuint") int writeBuffer, @NativeType("GLintptr") long readOffset, @NativeType("GLintptr") long writeOffset, @NativeType("GLsizeiptr") long size); + + // --- [ glMulticastCopyImageSubDataNV ] --- + + public static native void glMulticastCopyImageSubDataNV(@NativeType("GLuint") int srcGpu, @NativeType("GLbitfield") int dstGpuMask, @NativeType("GLuint") int srcName, @NativeType("GLenum") int srcTarget, @NativeType("GLint") int srcLevel, @NativeType("GLint") int srcX, @NativeType("GLint") int srxY, @NativeType("GLint") int srcZ, @NativeType("GLuint") int dstName, @NativeType("GLenum") int dstTarget, @NativeType("GLint") int dstLevel, @NativeType("GLint") int dstX, @NativeType("GLint") int dstY, @NativeType("GLint") int dstZ, @NativeType("GLsizei") int srcWidth, @NativeType("GLsizei") int srcHeight, @NativeType("GLsizei") int srcDepth); + + // --- [ glMulticastBlitFramebufferNV ] --- + + public static native void glMulticastBlitFramebufferNV(@NativeType("GLuint") int srcGpu, @NativeType("GLuint") int dstGpu, @NativeType("GLint") int srcX0, @NativeType("GLint") int srcY0, @NativeType("GLint") int srcX1, @NativeType("GLint") int srcY1, @NativeType("GLint") int dstX0, @NativeType("GLint") int dstY0, @NativeType("GLint") int dstX1, @NativeType("GLint") int dstY1, @NativeType("GLbitfield") int mask, @NativeType("GLenum") int filter); + + // --- [ glMulticastFramebufferSampleLocationsfvNV ] --- + + public static native void nglMulticastFramebufferSampleLocationsfvNV(int gpu, int framebuffer, int start, int count, long v); + + public static void glMulticastFramebufferSampleLocationsfvNV(@NativeType("GLuint") int gpu, @NativeType("GLuint") int framebuffer, @NativeType("GLuint") int start, @NativeType("GLfloat const *") FloatBuffer v) { + nglMulticastFramebufferSampleLocationsfvNV(gpu, framebuffer, start, v.remaining() >> 1, memAddress(v)); + } + + // --- [ glMulticastBarrierNV ] --- + + public static native void glMulticastBarrierNV(); + + // --- [ glMulticastWaitSyncNV ] --- + + public static native void glMulticastWaitSyncNV(@NativeType("GLuint") int signalGpu, @NativeType("GLbitfield") int waitGpuMask); + + // --- [ glMulticastGetQueryObjectivNV ] --- + + public static native void nglMulticastGetQueryObjectivNV(int gpu, int id, int pname, long params); + + public static void glMulticastGetQueryObjectivNV(@NativeType("GLuint") int gpu, @NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglMulticastGetQueryObjectivNV(gpu, id, pname, memAddress(params)); + } + + @NativeType("void") + public static int glMulticastGetQueryObjectiNV(@NativeType("GLuint") int gpu, @NativeType("GLuint") int id, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglMulticastGetQueryObjectivNV(gpu, id, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glMulticastGetQueryObjectuivNV ] --- + + public static native void nglMulticastGetQueryObjectuivNV(int gpu, int id, int pname, long params); + + public static void glMulticastGetQueryObjectuivNV(@NativeType("GLuint") int gpu, @NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLuint *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglMulticastGetQueryObjectuivNV(gpu, id, pname, memAddress(params)); + } + + @NativeType("void") + public static int glMulticastGetQueryObjectuiNV(@NativeType("GLuint") int gpu, @NativeType("GLuint") int id, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer params = stack.callocInt(1); + nglMulticastGetQueryObjectuivNV(gpu, id, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glMulticastGetQueryObjecti64vNV ] --- + + public static native void nglMulticastGetQueryObjecti64vNV(int gpu, int id, int pname, long params); + + public static void glMulticastGetQueryObjecti64vNV(@NativeType("GLuint") int gpu, @NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLint64 *") LongBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglMulticastGetQueryObjecti64vNV(gpu, id, pname, memAddress(params)); + } + + @NativeType("void") + public static long glMulticastGetQueryObjecti64NV(@NativeType("GLuint") int gpu, @NativeType("GLuint") int id, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglMulticastGetQueryObjecti64vNV(gpu, id, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glMulticastGetQueryObjectui64vNV ] --- + + public static native void nglMulticastGetQueryObjectui64vNV(int gpu, int id, int pname, long params); + + public static void glMulticastGetQueryObjectui64vNV(@NativeType("GLuint") int gpu, @NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLuint64 *") LongBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglMulticastGetQueryObjectui64vNV(gpu, id, pname, memAddress(params)); + } + + @NativeType("void") + public static long glMulticastGetQueryObjectui64NV(@NativeType("GLuint") int gpu, @NativeType("GLuint") int id, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglMulticastGetQueryObjectui64vNV(gpu, id, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #glMulticastBufferSubDataNV MulticastBufferSubDataNV} */ + public static void glMulticastBufferSubDataNV(@NativeType("GLbitfield") int gpuMask, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") short[] data) { + long __functionAddress = GL.getICD().glMulticastBufferSubDataNV; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(gpuMask, buffer, offset, Integer.toUnsignedLong(data.length) << 1, data, __functionAddress); + } + + /** Array version of: {@link #glMulticastBufferSubDataNV MulticastBufferSubDataNV} */ + public static void glMulticastBufferSubDataNV(@NativeType("GLbitfield") int gpuMask, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") int[] data) { + long __functionAddress = GL.getICD().glMulticastBufferSubDataNV; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(gpuMask, buffer, offset, Integer.toUnsignedLong(data.length) << 2, data, __functionAddress); + } + + /** Array version of: {@link #glMulticastBufferSubDataNV MulticastBufferSubDataNV} */ + public static void glMulticastBufferSubDataNV(@NativeType("GLbitfield") int gpuMask, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") float[] data) { + long __functionAddress = GL.getICD().glMulticastBufferSubDataNV; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(gpuMask, buffer, offset, Integer.toUnsignedLong(data.length) << 2, data, __functionAddress); + } + + /** Array version of: {@link #glMulticastBufferSubDataNV MulticastBufferSubDataNV} */ + public static void glMulticastBufferSubDataNV(@NativeType("GLbitfield") int gpuMask, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("void const *") double[] data) { + long __functionAddress = GL.getICD().glMulticastBufferSubDataNV; + if (CHECKS) { + check(__functionAddress); + } + callPPPV(gpuMask, buffer, offset, Integer.toUnsignedLong(data.length) << 3, data, __functionAddress); + } + + /** Array version of: {@link #glMulticastFramebufferSampleLocationsfvNV MulticastFramebufferSampleLocationsfvNV} */ + public static void glMulticastFramebufferSampleLocationsfvNV(@NativeType("GLuint") int gpu, @NativeType("GLuint") int framebuffer, @NativeType("GLuint") int start, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glMulticastFramebufferSampleLocationsfvNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(gpu, framebuffer, start, v.length >> 1, v, __functionAddress); + } + + /** Array version of: {@link #glMulticastGetQueryObjectivNV MulticastGetQueryObjectivNV} */ + public static void glMulticastGetQueryObjectivNV(@NativeType("GLuint") int gpu, @NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glMulticastGetQueryObjectivNV; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(gpu, id, pname, params, __functionAddress); + } + + /** Array version of: {@link #glMulticastGetQueryObjectuivNV MulticastGetQueryObjectuivNV} */ + public static void glMulticastGetQueryObjectuivNV(@NativeType("GLuint") int gpu, @NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLuint *") int[] params) { + long __functionAddress = GL.getICD().glMulticastGetQueryObjectuivNV; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(gpu, id, pname, params, __functionAddress); + } + + /** Array version of: {@link #glMulticastGetQueryObjecti64vNV MulticastGetQueryObjecti64vNV} */ + public static void glMulticastGetQueryObjecti64vNV(@NativeType("GLuint") int gpu, @NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLint64 *") long[] params) { + long __functionAddress = GL.getICD().glMulticastGetQueryObjecti64vNV; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(gpu, id, pname, params, __functionAddress); + } + + /** Array version of: {@link #glMulticastGetQueryObjectui64vNV MulticastGetQueryObjectui64vNV} */ + public static void glMulticastGetQueryObjectui64vNV(@NativeType("GLuint") int gpu, @NativeType("GLuint") int id, @NativeType("GLenum") int pname, @NativeType("GLuint64 *") long[] params) { + long __functionAddress = GL.getICD().glMulticastGetQueryObjectui64vNV; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(gpu, id, pname, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVGPUShader5.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVGPUShader5.java new file mode 100644 index 00000000..6fe3d178 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVGPUShader5.java @@ -0,0 +1,514 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_gpu_shader5 extension. + * + *

This extension provides a set of new features to the OpenGL Shading Language and related APIs to support capabilities of new GPUs. Shaders using the + * new functionality provided by this extension should enable this functionality via the construct

+ * + *

+ * \#extension GL_NV_gpu_shader5 : require (or enable)
+ * + *

This extension was developed concurrently with the ARB_gpu_shader5 extension, and provides a superset of the features provided there. The features + * common to both extensions are documented in the ARB_gpu_shader5 specification; this document describes only the addition language features not + * available via ARB_gpu_shader5. A shader that enables this extension via an \#extension directive also implicitly enables the common capabilities + * provided by ARB_gpu_shader5.

+ * + *

In addition to the capabilities of ARB_gpu_shader5, this extension provides a variety of new features for all shader types, including:

+ * + *
    + *
  • support for a full set of 8-, 16-, 32-, and 64-bit scalar and vector data types, including uniform API, uniform buffer object, and shader input and + * output support;
  • + *
  • the ability to aggregate samplers into arrays, index these arrays with arbitrary expressions, and not require that non-constant indices be uniform + * across all shader invocations;
  • + *
  • new built-in functions to pack and unpack 64-bit integer types into a two-component 32-bit integer vector;
  • + *
  • new built-in functions to pack and unpack 32-bit unsigned integer types into a two-component 16-bit floating-point vector;
  • + *
  • new built-in functions to convert double-precision floating-point values to or from their 64-bit integer bit encodings;
  • + *
  • new built-in functions to compute the composite of a set of boolean conditions a group of shader threads;
  • + *
  • vector relational functions supporting comparisons of vectors of 8-, 16-, and 64-bit integer types or 16-bit floating-point types; and
  • + *
  • extending texel offset support to allow loading texel offsets from regular integer operands computed at run-time, except for lookups with gradients + * (textureGrad*).
  • + *
+ * + *

This extension also provides additional support for processing patch primitives (introduced by ARB_tessellation_shader). ARB_tessellation_shader + * requires the use of a tessellation evaluation shader when processing patches, which means that patches will never survive past the tessellation + * pipeline stage. This extension lifts that restriction, and allows patches to proceed further in the pipeline and be used

+ * + *
    + *
  • as input to a geometry shader, using a new "patches" layout qualifier;
  • + *
  • as input to transform feedback;
  • + *
  • by fixed-function rasterization stages, in which case the patches are drawn as independent points.
  • + *
+ * + *

Additionally, it allows geometry shaders to read per-patch attributes written by a tessellation control shader using input variables declared with + * "patch in".

+ * + *

Requires {@link GL32 OpenGL 3.2}, GLSL 1.50 and {@link ARBGPUShader5 ARB_gpu_shader5}.

+ */ +public class NVGPUShader5 { + + /** Returned by the {@code type} parameter of GetActiveAttrib, GetActiveUniform, and GetTransformFeedbackVarying. */ + public static final int + GL_INT64_NV = 0x140E, + GL_UNSIGNED_INT64_NV = 0x140F, + GL_INT8_NV = 0x8FE0, + GL_INT8_VEC2_NV = 0x8FE1, + GL_INT8_VEC3_NV = 0x8FE2, + GL_INT8_VEC4_NV = 0x8FE3, + GL_INT16_NV = 0x8FE4, + GL_INT16_VEC2_NV = 0x8FE5, + GL_INT16_VEC3_NV = 0x8FE6, + GL_INT16_VEC4_NV = 0x8FE7, + GL_INT64_VEC2_NV = 0x8FE9, + GL_INT64_VEC3_NV = 0x8FEA, + GL_INT64_VEC4_NV = 0x8FEB, + GL_UNSIGNED_INT8_NV = 0x8FEC, + GL_UNSIGNED_INT8_VEC2_NV = 0x8FED, + GL_UNSIGNED_INT8_VEC3_NV = 0x8FEE, + GL_UNSIGNED_INT8_VEC4_NV = 0x8FEF, + GL_UNSIGNED_INT16_NV = 0x8FF0, + GL_UNSIGNED_INT16_VEC2_NV = 0x8FF1, + GL_UNSIGNED_INT16_VEC3_NV = 0x8FF2, + GL_UNSIGNED_INT16_VEC4_NV = 0x8FF3, + GL_UNSIGNED_INT64_VEC2_NV = 0x8FF5, + GL_UNSIGNED_INT64_VEC3_NV = 0x8FF6, + GL_UNSIGNED_INT64_VEC4_NV = 0x8FF7, + GL_FLOAT16_NV = 0x8FF8, + GL_FLOAT16_VEC2_NV = 0x8FF9, + GL_FLOAT16_VEC3_NV = 0x8FFA, + GL_FLOAT16_VEC4_NV = 0x8FFB; + + static { GL.initialize(); } + + protected NVGPUShader5() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glUniform1i64NV, caps.glUniform2i64NV, caps.glUniform3i64NV, caps.glUniform4i64NV, caps.glUniform1i64vNV, caps.glUniform2i64vNV, + caps.glUniform3i64vNV, caps.glUniform4i64vNV, caps.glUniform1ui64NV, caps.glUniform2ui64NV, caps.glUniform3ui64NV, caps.glUniform4ui64NV, + caps.glUniform1ui64vNV, caps.glUniform2ui64vNV, caps.glUniform3ui64vNV, caps.glUniform4ui64vNV, caps.glGetUniformi64vNV, caps.glGetUniformui64vNV, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform1i64NV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform2i64NV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform3i64NV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform4i64NV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform1i64vNV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform2i64vNV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform3i64vNV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform4i64vNV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform1ui64NV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform2ui64NV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform3ui64NV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform4ui64NV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform1ui64vNV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform2ui64vNV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform3ui64vNV : -1L, + ext.contains("GL_EXT_direct_state_access") ? caps.glProgramUniform4ui64vNV : -1L + ); + } + + // --- [ glUniform1i64NV ] --- + + public static native void glUniform1i64NV(@NativeType("GLint") int location, @NativeType("GLint64EXT") long x); + + // --- [ glUniform2i64NV ] --- + + public static native void glUniform2i64NV(@NativeType("GLint") int location, @NativeType("GLint64EXT") long x, @NativeType("GLint64EXT") long y); + + // --- [ glUniform3i64NV ] --- + + public static native void glUniform3i64NV(@NativeType("GLint") int location, @NativeType("GLint64EXT") long x, @NativeType("GLint64EXT") long y, @NativeType("GLint64EXT") long z); + + // --- [ glUniform4i64NV ] --- + + public static native void glUniform4i64NV(@NativeType("GLint") int location, @NativeType("GLint64EXT") long x, @NativeType("GLint64EXT") long y, @NativeType("GLint64EXT") long z, @NativeType("GLint64EXT") long w); + + // --- [ glUniform1i64vNV ] --- + + public static native void nglUniform1i64vNV(int location, int count, long value); + + public static void glUniform1i64vNV(@NativeType("GLint") int location, @NativeType("GLint64EXT const *") LongBuffer value) { + nglUniform1i64vNV(location, value.remaining(), memAddress(value)); + } + + // --- [ glUniform2i64vNV ] --- + + public static native void nglUniform2i64vNV(int location, int count, long value); + + public static void glUniform2i64vNV(@NativeType("GLint") int location, @NativeType("GLint64EXT const *") LongBuffer value) { + nglUniform2i64vNV(location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glUniform3i64vNV ] --- + + public static native void nglUniform3i64vNV(int location, int count, long value); + + public static void glUniform3i64vNV(@NativeType("GLint") int location, @NativeType("GLint64EXT const *") LongBuffer value) { + nglUniform3i64vNV(location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glUniform4i64vNV ] --- + + public static native void nglUniform4i64vNV(int location, int count, long value); + + public static void glUniform4i64vNV(@NativeType("GLint") int location, @NativeType("GLint64EXT const *") LongBuffer value) { + nglUniform4i64vNV(location, value.remaining() >> 2, memAddress(value)); + } + + // --- [ glUniform1ui64NV ] --- + + public static native void glUniform1ui64NV(@NativeType("GLint") int location, @NativeType("GLuint64EXT") long x); + + // --- [ glUniform2ui64NV ] --- + + public static native void glUniform2ui64NV(@NativeType("GLint") int location, @NativeType("GLuint64EXT") long x, @NativeType("GLuint64EXT") long y); + + // --- [ glUniform3ui64NV ] --- + + public static native void glUniform3ui64NV(@NativeType("GLint") int location, @NativeType("GLuint64EXT") long x, @NativeType("GLuint64EXT") long y, @NativeType("GLuint64EXT") long z); + + // --- [ glUniform4ui64NV ] --- + + public static native void glUniform4ui64NV(@NativeType("GLint") int location, @NativeType("GLuint64EXT") long x, @NativeType("GLuint64EXT") long y, @NativeType("GLuint64EXT") long z, @NativeType("GLuint64EXT") long w); + + // --- [ glUniform1ui64vNV ] --- + + public static native void nglUniform1ui64vNV(int location, int count, long value); + + public static void glUniform1ui64vNV(@NativeType("GLint") int location, @NativeType("GLuint64EXT const *") LongBuffer value) { + nglUniform1ui64vNV(location, value.remaining(), memAddress(value)); + } + + // --- [ glUniform2ui64vNV ] --- + + public static native void nglUniform2ui64vNV(int location, int count, long value); + + public static void glUniform2ui64vNV(@NativeType("GLint") int location, @NativeType("GLuint64EXT *") LongBuffer value) { + nglUniform2ui64vNV(location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glUniform3ui64vNV ] --- + + public static native void nglUniform3ui64vNV(int location, int count, long value); + + public static void glUniform3ui64vNV(@NativeType("GLint") int location, @NativeType("GLuint64EXT const *") LongBuffer value) { + nglUniform3ui64vNV(location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glUniform4ui64vNV ] --- + + public static native void nglUniform4ui64vNV(int location, int count, long value); + + public static void glUniform4ui64vNV(@NativeType("GLint") int location, @NativeType("GLuint64EXT const *") LongBuffer value) { + nglUniform4ui64vNV(location, value.remaining() >> 2, memAddress(value)); + } + + // --- [ glGetUniformi64vNV ] --- + + public static native void nglGetUniformi64vNV(int program, int location, long params); + + public static void glGetUniformi64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT *") LongBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetUniformi64vNV(program, location, memAddress(params)); + } + + @NativeType("void") + public static long glGetUniformi64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglGetUniformi64vNV(program, location, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetUniformui64vNV ] --- + + public static void nglGetUniformui64vNV(int program, int location, long params) { + NVShaderBufferLoad.nglGetUniformui64vNV(program, location, params); + } + + public static void glGetUniformui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT *") LongBuffer params) { + NVShaderBufferLoad.glGetUniformui64vNV(program, location, params); + } + + @NativeType("void") + public static long glGetUniformui64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + return NVShaderBufferLoad.glGetUniformui64NV(program, location); + } + + // --- [ glProgramUniform1i64NV ] --- + + public static native void glProgramUniform1i64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT") long x); + + // --- [ glProgramUniform2i64NV ] --- + + public static native void glProgramUniform2i64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT") long x, @NativeType("GLint64EXT") long y); + + // --- [ glProgramUniform3i64NV ] --- + + public static native void glProgramUniform3i64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT") long x, @NativeType("GLint64EXT") long y, @NativeType("GLint64EXT") long z); + + // --- [ glProgramUniform4i64NV ] --- + + public static native void glProgramUniform4i64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT") long x, @NativeType("GLint64EXT") long y, @NativeType("GLint64EXT") long z, @NativeType("GLint64EXT") long w); + + // --- [ glProgramUniform1i64vNV ] --- + + public static native void nglProgramUniform1i64vNV(int program, int location, int count, long value); + + public static void glProgramUniform1i64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT const *") LongBuffer value) { + nglProgramUniform1i64vNV(program, location, value.remaining(), memAddress(value)); + } + + // --- [ glProgramUniform2i64vNV ] --- + + public static native void nglProgramUniform2i64vNV(int program, int location, int count, long value); + + public static void glProgramUniform2i64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT const *") LongBuffer value) { + nglProgramUniform2i64vNV(program, location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glProgramUniform3i64vNV ] --- + + public static native void nglProgramUniform3i64vNV(int program, int location, int count, long value); + + public static void glProgramUniform3i64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT const *") LongBuffer value) { + nglProgramUniform3i64vNV(program, location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glProgramUniform4i64vNV ] --- + + public static native void nglProgramUniform4i64vNV(int program, int location, int count, long value); + + public static void glProgramUniform4i64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT const *") LongBuffer value) { + nglProgramUniform4i64vNV(program, location, value.remaining() >> 2, memAddress(value)); + } + + // --- [ glProgramUniform1ui64NV ] --- + + public static native void glProgramUniform1ui64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT") long x); + + // --- [ glProgramUniform2ui64NV ] --- + + public static native void glProgramUniform2ui64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT") long x, @NativeType("GLuint64EXT") long y); + + // --- [ glProgramUniform3ui64NV ] --- + + public static native void glProgramUniform3ui64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT") long x, @NativeType("GLuint64EXT") long y, @NativeType("GLuint64EXT") long z); + + // --- [ glProgramUniform4ui64NV ] --- + + public static native void glProgramUniform4ui64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT") long x, @NativeType("GLuint64EXT") long y, @NativeType("GLuint64EXT") long z, @NativeType("GLuint64EXT") long w); + + // --- [ glProgramUniform1ui64vNV ] --- + + public static native void nglProgramUniform1ui64vNV(int program, int location, int count, long value); + + public static void glProgramUniform1ui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT const *") LongBuffer value) { + nglProgramUniform1ui64vNV(program, location, value.remaining(), memAddress(value)); + } + + // --- [ glProgramUniform2ui64vNV ] --- + + public static native void nglProgramUniform2ui64vNV(int program, int location, int count, long value); + + public static void glProgramUniform2ui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT const *") LongBuffer value) { + nglProgramUniform2ui64vNV(program, location, value.remaining() >> 1, memAddress(value)); + } + + // --- [ glProgramUniform3ui64vNV ] --- + + public static native void nglProgramUniform3ui64vNV(int program, int location, int count, long value); + + public static void glProgramUniform3ui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT const *") LongBuffer value) { + nglProgramUniform3ui64vNV(program, location, value.remaining() / 3, memAddress(value)); + } + + // --- [ glProgramUniform4ui64vNV ] --- + + public static native void nglProgramUniform4ui64vNV(int program, int location, int count, long value); + + public static void glProgramUniform4ui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT const *") LongBuffer value) { + nglProgramUniform4ui64vNV(program, location, value.remaining() >> 2, memAddress(value)); + } + + /** Array version of: {@link #glUniform1i64vNV Uniform1i64vNV} */ + public static void glUniform1i64vNV(@NativeType("GLint") int location, @NativeType("GLint64EXT const *") long[] value) { + long __functionAddress = GL.getICD().glUniform1i64vNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length, value, __functionAddress); + } + + /** Array version of: {@link #glUniform2i64vNV Uniform2i64vNV} */ + public static void glUniform2i64vNV(@NativeType("GLint") int location, @NativeType("GLint64EXT const *") long[] value) { + long __functionAddress = GL.getICD().glUniform2i64vNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 1, value, __functionAddress); + } + + /** Array version of: {@link #glUniform3i64vNV Uniform3i64vNV} */ + public static void glUniform3i64vNV(@NativeType("GLint") int location, @NativeType("GLint64EXT const *") long[] value) { + long __functionAddress = GL.getICD().glUniform3i64vNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length / 3, value, __functionAddress); + } + + /** Array version of: {@link #glUniform4i64vNV Uniform4i64vNV} */ + public static void glUniform4i64vNV(@NativeType("GLint") int location, @NativeType("GLint64EXT const *") long[] value) { + long __functionAddress = GL.getICD().glUniform4i64vNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 2, value, __functionAddress); + } + + /** Array version of: {@link #glUniform1ui64vNV Uniform1ui64vNV} */ + public static void glUniform1ui64vNV(@NativeType("GLint") int location, @NativeType("GLuint64EXT const *") long[] value) { + long __functionAddress = GL.getICD().glUniform1ui64vNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length, value, __functionAddress); + } + + /** Array version of: {@link #glUniform2ui64vNV Uniform2ui64vNV} */ + public static void glUniform2ui64vNV(@NativeType("GLint") int location, @NativeType("GLuint64EXT *") long[] value) { + long __functionAddress = GL.getICD().glUniform2ui64vNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 1, value, __functionAddress); + } + + /** Array version of: {@link #glUniform3ui64vNV Uniform3ui64vNV} */ + public static void glUniform3ui64vNV(@NativeType("GLint") int location, @NativeType("GLuint64EXT const *") long[] value) { + long __functionAddress = GL.getICD().glUniform3ui64vNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length / 3, value, __functionAddress); + } + + /** Array version of: {@link #glUniform4ui64vNV Uniform4ui64vNV} */ + public static void glUniform4ui64vNV(@NativeType("GLint") int location, @NativeType("GLuint64EXT const *") long[] value) { + long __functionAddress = GL.getICD().glUniform4ui64vNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length >> 2, value, __functionAddress); + } + + /** Array version of: {@link #glGetUniformi64vNV GetUniformi64vNV} */ + public static void glGetUniformi64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT *") long[] params) { + long __functionAddress = GL.getICD().glGetUniformi64vNV; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(program, location, params, __functionAddress); + } + + /** Array version of: {@link #glGetUniformui64vNV GetUniformui64vNV} */ + public static void glGetUniformui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT *") long[] params) { + NVShaderBufferLoad.glGetUniformui64vNV(program, location, params); + } + + /** Array version of: {@link #glProgramUniform1i64vNV ProgramUniform1i64vNV} */ + public static void glProgramUniform1i64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT const *") long[] value) { + long __functionAddress = GL.getICD().glProgramUniform1i64vNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform2i64vNV ProgramUniform2i64vNV} */ + public static void glProgramUniform2i64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT const *") long[] value) { + long __functionAddress = GL.getICD().glProgramUniform2i64vNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 1, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform3i64vNV ProgramUniform3i64vNV} */ + public static void glProgramUniform3i64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT const *") long[] value) { + long __functionAddress = GL.getICD().glProgramUniform3i64vNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 3, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform4i64vNV ProgramUniform4i64vNV} */ + public static void glProgramUniform4i64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLint64EXT const *") long[] value) { + long __functionAddress = GL.getICD().glProgramUniform4i64vNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 2, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform1ui64vNV ProgramUniform1ui64vNV} */ + public static void glProgramUniform1ui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT const *") long[] value) { + long __functionAddress = GL.getICD().glProgramUniform1ui64vNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform2ui64vNV ProgramUniform2ui64vNV} */ + public static void glProgramUniform2ui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT const *") long[] value) { + long __functionAddress = GL.getICD().glProgramUniform2ui64vNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 1, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform3ui64vNV ProgramUniform3ui64vNV} */ + public static void glProgramUniform3ui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT const *") long[] value) { + long __functionAddress = GL.getICD().glProgramUniform3ui64vNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length / 3, value, __functionAddress); + } + + /** Array version of: {@link #glProgramUniform4ui64vNV ProgramUniform4ui64vNV} */ + public static void glProgramUniform4ui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT const *") long[] value) { + long __functionAddress = GL.getICD().glProgramUniform4ui64vNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length >> 2, value, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVHalfFloat.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVHalfFloat.java new file mode 100644 index 00000000..797bd5d4 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVHalfFloat.java @@ -0,0 +1,655 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_half_float extension. + * + *

This extension introduces a new storage format and data type for half-precision (16-bit) floating-point quantities. The floating-point format is very + * similar to the IEEE single-precision floating-point standard, except that it has only 5 exponent bits and 10 mantissa bits. Half-precision floats are + * smaller than full precision floats and provide a larger dynamic range than similarly-sized normalized scalar data types.

+ * + *

This extension allows applications to use half-precision floating point data when specifying vertices or pixel data. It adds new commands to specify + * vertex attributes using the new data type, and extends the existing vertex array and image specification commands to accept the new data type.

+ * + *

This storage format is also used to represent 16-bit components in the floating-point frame buffers, as defined in the NV_float_buffer extension.

+ */ +public class NVHalfFloat { + + /** + * Accepted by the {@code type} argument of VertexPointer, NormalPointer, ColorPointer, TexCoordPointer, FogCoordPointerEXT, SecondaryColorPointerEXT, + * VertexWeightPointerEXT, VertexAttribPointerNV, DrawPixels, ReadPixels, TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, + * and GetTexImage. + */ + public static final int GL_HALF_FLOAT_NV = 0x140B; + + static { GL.initialize(); } + + protected NVHalfFloat() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glVertex2hNV, caps.glVertex2hvNV, caps.glVertex3hNV, caps.glVertex3hvNV, caps.glVertex4hNV, caps.glVertex4hvNV, caps.glNormal3hNV, + caps.glNormal3hvNV, caps.glColor3hNV, caps.glColor3hvNV, caps.glColor4hNV, caps.glColor4hvNV, caps.glTexCoord1hNV, caps.glTexCoord1hvNV, + caps.glTexCoord2hNV, caps.glTexCoord2hvNV, caps.glTexCoord3hNV, caps.glTexCoord3hvNV, caps.glTexCoord4hNV, caps.glTexCoord4hvNV, + caps.glMultiTexCoord1hNV, caps.glMultiTexCoord1hvNV, caps.glMultiTexCoord2hNV, caps.glMultiTexCoord2hvNV, caps.glMultiTexCoord3hNV, + caps.glMultiTexCoord3hvNV, caps.glMultiTexCoord4hNV, caps.glMultiTexCoord4hvNV, ext.contains("GL_EXT_fog_coord") ? caps.glFogCoordhNV : -1L, + ext.contains("GL_EXT_fog_coord") ? caps.glFogCoordhvNV : -1L, ext.contains("GL_EXT_secondary_color") ? caps.glSecondaryColor3hNV : -1L, + ext.contains("GL_EXT_secondary_color") ? caps.glSecondaryColor3hvNV : -1L, ext.contains("GL_EXT_vertex_weighting") ? caps.glVertexWeighthNV : -1L, + ext.contains("GL_EXT_vertex_weighting") ? caps.glVertexWeighthvNV : -1L, ext.contains("GL_NV_vertex_program") ? caps.glVertexAttrib1hNV : -1L, + ext.contains("GL_NV_vertex_program") ? caps.glVertexAttrib1hvNV : -1L, ext.contains("GL_NV_vertex_program") ? caps.glVertexAttrib2hNV : -1L, + ext.contains("GL_NV_vertex_program") ? caps.glVertexAttrib2hvNV : -1L, ext.contains("GL_NV_vertex_program") ? caps.glVertexAttrib3hNV : -1L, + ext.contains("GL_NV_vertex_program") ? caps.glVertexAttrib3hvNV : -1L, ext.contains("GL_NV_vertex_program") ? caps.glVertexAttrib4hNV : -1L, + ext.contains("GL_NV_vertex_program") ? caps.glVertexAttrib4hvNV : -1L, ext.contains("GL_NV_vertex_program") ? caps.glVertexAttribs1hvNV : -1L, + ext.contains("GL_NV_vertex_program") ? caps.glVertexAttribs2hvNV : -1L, ext.contains("GL_NV_vertex_program") ? caps.glVertexAttribs3hvNV : -1L, + ext.contains("GL_NV_vertex_program") ? caps.glVertexAttribs4hvNV : -1L + ); + } + + // --- [ glVertex2hNV ] --- + + public static native void glVertex2hNV(@NativeType("GLhalfNV") short x, @NativeType("GLhalfNV") short y); + + // --- [ glVertex2hvNV ] --- + + public static native void nglVertex2hvNV(long v); + + public static void glVertex2hvNV(@NativeType("GLhalfNV const *") ShortBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglVertex2hvNV(memAddress(v)); + } + + // --- [ glVertex3hNV ] --- + + public static native void glVertex3hNV(@NativeType("GLhalfNV") short x, @NativeType("GLhalfNV") short y, @NativeType("GLhalfNV") short z); + + // --- [ glVertex3hvNV ] --- + + public static native void nglVertex3hvNV(long v); + + public static void glVertex3hvNV(@NativeType("GLhalfNV const *") ShortBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglVertex3hvNV(memAddress(v)); + } + + // --- [ glVertex4hNV ] --- + + public static native void glVertex4hNV(@NativeType("GLhalfNV") short x, @NativeType("GLhalfNV") short y, @NativeType("GLhalfNV") short z, @NativeType("GLhalfNV") short w); + + // --- [ glVertex4hvNV ] --- + + public static native void nglVertex4hvNV(long v); + + public static void glVertex4hvNV(@NativeType("GLhalfNV const *") ShortBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertex4hvNV(memAddress(v)); + } + + // --- [ glNormal3hNV ] --- + + public static native void glNormal3hNV(@NativeType("GLhalfNV") short nx, @NativeType("GLhalfNV") short ny, @NativeType("GLhalfNV") short nz); + + // --- [ glNormal3hvNV ] --- + + public static native void nglNormal3hvNV(long v); + + public static void glNormal3hvNV(@NativeType("GLhalfNV const *") ShortBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglNormal3hvNV(memAddress(v)); + } + + // --- [ glColor3hNV ] --- + + public static native void glColor3hNV(@NativeType("GLhalfNV") short red, @NativeType("GLhalfNV") short green, @NativeType("GLhalfNV") short blue); + + // --- [ glColor3hvNV ] --- + + public static native void nglColor3hvNV(long v); + + public static void glColor3hvNV(@NativeType("GLhalfNV const *") ShortBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglColor3hvNV(memAddress(v)); + } + + // --- [ glColor4hNV ] --- + + public static native void glColor4hNV(@NativeType("GLhalfNV") short red, @NativeType("GLhalfNV") short green, @NativeType("GLhalfNV") short blue, @NativeType("GLhalfNV") short alpha); + + // --- [ glColor4hvNV ] --- + + public static native void nglColor4hvNV(long v); + + public static void glColor4hvNV(@NativeType("GLhalfNV const *") ShortBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglColor4hvNV(memAddress(v)); + } + + // --- [ glTexCoord1hNV ] --- + + public static native void glTexCoord1hNV(@NativeType("GLhalfNV") short s); + + // --- [ glTexCoord1hvNV ] --- + + public static native void nglTexCoord1hvNV(long v); + + public static void glTexCoord1hvNV(@NativeType("GLhalfNV const *") ShortBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglTexCoord1hvNV(memAddress(v)); + } + + // --- [ glTexCoord2hNV ] --- + + public static native void glTexCoord2hNV(@NativeType("GLhalfNV") short s, @NativeType("GLhalfNV") short t); + + // --- [ glTexCoord2hvNV ] --- + + public static native void nglTexCoord2hvNV(long v); + + public static void glTexCoord2hvNV(@NativeType("GLhalfNV const *") ShortBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglTexCoord2hvNV(memAddress(v)); + } + + // --- [ glTexCoord3hNV ] --- + + public static native void glTexCoord3hNV(@NativeType("GLhalfNV") short s, @NativeType("GLhalfNV") short t, @NativeType("GLhalfNV") short r); + + // --- [ glTexCoord3hvNV ] --- + + public static native void nglTexCoord3hvNV(long v); + + public static void glTexCoord3hvNV(@NativeType("GLhalfNV const *") ShortBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglTexCoord3hvNV(memAddress(v)); + } + + // --- [ glTexCoord4hNV ] --- + + public static native void glTexCoord4hNV(@NativeType("GLhalfNV") short s, @NativeType("GLhalfNV") short t, @NativeType("GLhalfNV") short r, @NativeType("GLhalfNV") short q); + + // --- [ glTexCoord4hvNV ] --- + + public static native void nglTexCoord4hvNV(long v); + + public static void glTexCoord4hvNV(@NativeType("GLhalfNV const *") ShortBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglTexCoord4hvNV(memAddress(v)); + } + + // --- [ glMultiTexCoord1hNV ] --- + + public static native void glMultiTexCoord1hNV(@NativeType("GLenum") int target, @NativeType("GLhalfNV") short s); + + // --- [ glMultiTexCoord1hvNV ] --- + + public static native void nglMultiTexCoord1hvNV(int target, long v); + + public static void glMultiTexCoord1hvNV(@NativeType("GLenum") int target, @NativeType("GLhalfNV const *") ShortBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglMultiTexCoord1hvNV(target, memAddress(v)); + } + + // --- [ glMultiTexCoord2hNV ] --- + + public static native void glMultiTexCoord2hNV(@NativeType("GLenum") int target, @NativeType("GLhalfNV") short s, @NativeType("GLhalfNV") short t); + + // --- [ glMultiTexCoord2hvNV ] --- + + public static native void nglMultiTexCoord2hvNV(int target, long v); + + public static void glMultiTexCoord2hvNV(@NativeType("GLenum") int target, @NativeType("GLhalfNV const *") ShortBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglMultiTexCoord2hvNV(target, memAddress(v)); + } + + // --- [ glMultiTexCoord3hNV ] --- + + public static native void glMultiTexCoord3hNV(@NativeType("GLenum") int target, @NativeType("GLhalfNV") short s, @NativeType("GLhalfNV") short t, @NativeType("GLhalfNV") short r); + + // --- [ glMultiTexCoord3hvNV ] --- + + public static native void nglMultiTexCoord3hvNV(int target, long v); + + public static void glMultiTexCoord3hvNV(@NativeType("GLenum") int target, @NativeType("GLhalfNV const *") ShortBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglMultiTexCoord3hvNV(target, memAddress(v)); + } + + // --- [ glMultiTexCoord4hNV ] --- + + public static native void glMultiTexCoord4hNV(@NativeType("GLenum") int target, @NativeType("GLhalfNV") short s, @NativeType("GLhalfNV") short t, @NativeType("GLhalfNV") short r, @NativeType("GLhalfNV") short q); + + // --- [ glMultiTexCoord4hvNV ] --- + + public static native void nglMultiTexCoord4hvNV(int target, long v); + + public static void glMultiTexCoord4hvNV(@NativeType("GLenum") int target, @NativeType("GLhalfNV const *") ShortBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglMultiTexCoord4hvNV(target, memAddress(v)); + } + + // --- [ glFogCoordhNV ] --- + + public static native void glFogCoordhNV(@NativeType("GLhalfNV") short fog); + + // --- [ glFogCoordhvNV ] --- + + public static native void nglFogCoordhvNV(long fog); + + public static void glFogCoordhvNV(@NativeType("GLhalfNV const *") ShortBuffer fog) { + if (CHECKS) { + check(fog, 1); + } + nglFogCoordhvNV(memAddress(fog)); + } + + // --- [ glSecondaryColor3hNV ] --- + + public static native void glSecondaryColor3hNV(@NativeType("GLhalfNV") short red, @NativeType("GLhalfNV") short green, @NativeType("GLhalfNV") short blue); + + // --- [ glSecondaryColor3hvNV ] --- + + public static native void nglSecondaryColor3hvNV(long v); + + public static void glSecondaryColor3hvNV(@NativeType("GLhalfNV const *") ShortBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglSecondaryColor3hvNV(memAddress(v)); + } + + // --- [ glVertexWeighthNV ] --- + + public static native void glVertexWeighthNV(@NativeType("GLhalfNV") short weight); + + // --- [ glVertexWeighthvNV ] --- + + public static native void nglVertexWeighthvNV(long weight); + + public static void glVertexWeighthvNV(@NativeType("GLhalfNV const *") ShortBuffer weight) { + if (CHECKS) { + check(weight, 1); + } + nglVertexWeighthvNV(memAddress(weight)); + } + + // --- [ glVertexAttrib1hNV ] --- + + public static native void glVertexAttrib1hNV(@NativeType("GLuint") int index, @NativeType("GLhalfNV") short x); + + // --- [ glVertexAttrib1hvNV ] --- + + public static native void nglVertexAttrib1hvNV(int index, long v); + + public static void glVertexAttrib1hvNV(@NativeType("GLuint") int index, @NativeType("GLhalfNV const *") ShortBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglVertexAttrib1hvNV(index, memAddress(v)); + } + + // --- [ glVertexAttrib2hNV ] --- + + public static native void glVertexAttrib2hNV(@NativeType("GLuint") int index, @NativeType("GLhalfNV") short x, @NativeType("GLhalfNV") short y); + + // --- [ glVertexAttrib2hvNV ] --- + + public static native void nglVertexAttrib2hvNV(int index, long v); + + public static void glVertexAttrib2hvNV(@NativeType("GLuint") int index, @NativeType("GLhalfNV const *") ShortBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglVertexAttrib2hvNV(index, memAddress(v)); + } + + // --- [ glVertexAttrib3hNV ] --- + + public static native void glVertexAttrib3hNV(@NativeType("GLuint") int index, @NativeType("GLhalfNV") short x, @NativeType("GLhalfNV") short y, @NativeType("GLhalfNV") short z); + + // --- [ glVertexAttrib3hvNV ] --- + + public static native void nglVertexAttrib3hvNV(int index, long v); + + public static void glVertexAttrib3hvNV(@NativeType("GLuint") int index, @NativeType("GLhalfNV const *") ShortBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglVertexAttrib3hvNV(index, memAddress(v)); + } + + // --- [ glVertexAttrib4hNV ] --- + + public static native void glVertexAttrib4hNV(@NativeType("GLuint") int index, @NativeType("GLhalfNV") short x, @NativeType("GLhalfNV") short y, @NativeType("GLhalfNV") short z, @NativeType("GLhalfNV") short w); + + // --- [ glVertexAttrib4hvNV ] --- + + public static native void nglVertexAttrib4hvNV(int index, long v); + + public static void glVertexAttrib4hvNV(@NativeType("GLuint") int index, @NativeType("GLhalfNV const *") ShortBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttrib4hvNV(index, memAddress(v)); + } + + // --- [ glVertexAttribs1hvNV ] --- + + public static native void nglVertexAttribs1hvNV(int index, int n, long v); + + public static void glVertexAttribs1hvNV(@NativeType("GLuint") int index, @NativeType("GLhalfNV const *") ShortBuffer v) { + nglVertexAttribs1hvNV(index, v.remaining(), memAddress(v)); + } + + // --- [ glVertexAttribs2hvNV ] --- + + public static native void nglVertexAttribs2hvNV(int index, int n, long v); + + public static void glVertexAttribs2hvNV(@NativeType("GLuint") int index, @NativeType("GLhalfNV const *") ShortBuffer v) { + nglVertexAttribs2hvNV(index, v.remaining() >> 1, memAddress(v)); + } + + // --- [ glVertexAttribs3hvNV ] --- + + public static native void nglVertexAttribs3hvNV(int index, int n, long v); + + public static void glVertexAttribs3hvNV(@NativeType("GLuint") int index, @NativeType("GLhalfNV const *") ShortBuffer v) { + nglVertexAttribs3hvNV(index, v.remaining() / 3, memAddress(v)); + } + + // --- [ glVertexAttribs4hvNV ] --- + + public static native void nglVertexAttribs4hvNV(int index, int n, long v); + + public static void glVertexAttribs4hvNV(@NativeType("GLuint") int index, @NativeType("GLhalfNV const *") ShortBuffer v) { + nglVertexAttribs4hvNV(index, v.remaining() >> 2, memAddress(v)); + } + + /** Array version of: {@link #glVertex2hvNV Vertex2hvNV} */ + public static void glVertex2hvNV(@NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glVertex2hvNV; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(v, __functionAddress); + } + + /** Array version of: {@link #glVertex3hvNV Vertex3hvNV} */ + public static void glVertex3hvNV(@NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glVertex3hvNV; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** Array version of: {@link #glVertex4hvNV Vertex4hvNV} */ + public static void glVertex4hvNV(@NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glVertex4hvNV; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(v, __functionAddress); + } + + /** Array version of: {@link #glNormal3hvNV Normal3hvNV} */ + public static void glNormal3hvNV(@NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glNormal3hvNV; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** Array version of: {@link #glColor3hvNV Color3hvNV} */ + public static void glColor3hvNV(@NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glColor3hvNV; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** Array version of: {@link #glColor4hvNV Color4hvNV} */ + public static void glColor4hvNV(@NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glColor4hvNV; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(v, __functionAddress); + } + + /** Array version of: {@link #glTexCoord1hvNV TexCoord1hvNV} */ + public static void glTexCoord1hvNV(@NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glTexCoord1hvNV; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(v, __functionAddress); + } + + /** Array version of: {@link #glTexCoord2hvNV TexCoord2hvNV} */ + public static void glTexCoord2hvNV(@NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glTexCoord2hvNV; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(v, __functionAddress); + } + + /** Array version of: {@link #glTexCoord3hvNV TexCoord3hvNV} */ + public static void glTexCoord3hvNV(@NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glTexCoord3hvNV; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** Array version of: {@link #glTexCoord4hvNV TexCoord4hvNV} */ + public static void glTexCoord4hvNV(@NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glTexCoord4hvNV; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(v, __functionAddress); + } + + /** Array version of: {@link #glMultiTexCoord1hvNV MultiTexCoord1hvNV} */ + public static void glMultiTexCoord1hvNV(@NativeType("GLenum") int target, @NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord1hvNV; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(target, v, __functionAddress); + } + + /** Array version of: {@link #glMultiTexCoord2hvNV MultiTexCoord2hvNV} */ + public static void glMultiTexCoord2hvNV(@NativeType("GLenum") int target, @NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord2hvNV; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(target, v, __functionAddress); + } + + /** Array version of: {@link #glMultiTexCoord3hvNV MultiTexCoord3hvNV} */ + public static void glMultiTexCoord3hvNV(@NativeType("GLenum") int target, @NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord3hvNV; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(target, v, __functionAddress); + } + + /** Array version of: {@link #glMultiTexCoord4hvNV MultiTexCoord4hvNV} */ + public static void glMultiTexCoord4hvNV(@NativeType("GLenum") int target, @NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glMultiTexCoord4hvNV; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(target, v, __functionAddress); + } + + /** Array version of: {@link #glFogCoordhvNV FogCoordhvNV} */ + public static void glFogCoordhvNV(@NativeType("GLhalfNV const *") short[] fog) { + long __functionAddress = GL.getICD().glFogCoordhvNV; + if (CHECKS) { + check(__functionAddress); + check(fog, 1); + } + callPV(fog, __functionAddress); + } + + /** Array version of: {@link #glSecondaryColor3hvNV SecondaryColor3hvNV} */ + public static void glSecondaryColor3hvNV(@NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glSecondaryColor3hvNV; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(v, __functionAddress); + } + + /** Array version of: {@link #glVertexWeighthvNV VertexWeighthvNV} */ + public static void glVertexWeighthvNV(@NativeType("GLhalfNV const *") short[] weight) { + long __functionAddress = GL.getICD().glVertexWeighthvNV; + if (CHECKS) { + check(__functionAddress); + check(weight, 1); + } + callPV(weight, __functionAddress); + } + + /** Array version of: {@link #glVertexAttrib1hvNV VertexAttrib1hvNV} */ + public static void glVertexAttrib1hvNV(@NativeType("GLuint") int index, @NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttrib1hvNV; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttrib2hvNV VertexAttrib2hvNV} */ + public static void glVertexAttrib2hvNV(@NativeType("GLuint") int index, @NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttrib2hvNV; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttrib3hvNV VertexAttrib3hvNV} */ + public static void glVertexAttrib3hvNV(@NativeType("GLuint") int index, @NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttrib3hvNV; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttrib4hvNV VertexAttrib4hvNV} */ + public static void glVertexAttrib4hvNV(@NativeType("GLuint") int index, @NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttrib4hvNV; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribs1hvNV VertexAttribs1hvNV} */ + public static void glVertexAttribs1hvNV(@NativeType("GLuint") int index, @NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttribs1hvNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(index, v.length, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribs2hvNV VertexAttribs2hvNV} */ + public static void glVertexAttribs2hvNV(@NativeType("GLuint") int index, @NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttribs2hvNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(index, v.length >> 1, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribs3hvNV VertexAttribs3hvNV} */ + public static void glVertexAttribs3hvNV(@NativeType("GLuint") int index, @NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttribs3hvNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(index, v.length / 3, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribs4hvNV VertexAttribs4hvNV} */ + public static void glVertexAttribs4hvNV(@NativeType("GLuint") int index, @NativeType("GLhalfNV const *") short[] v) { + long __functionAddress = GL.getICD().glVertexAttribs4hvNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(index, v.length >> 2, v, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVInternalformatSampleQuery.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVInternalformatSampleQuery.java new file mode 100644 index 00000000..f6db551c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVInternalformatSampleQuery.java @@ -0,0 +1,82 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_internalformat_sample_query extension. + * + *

Some OpenGL implementations support modes of multisampling which have + * properties which are non-obvious to applications and/or which may not be + * standards conformant. The idea of non-conformant AA modes is not new, + * and is exposed in both GLX and EGL with config caveats and the + * GLX_NON_CONFORMANT_CONFIG for GLX and EGL_NON_CONFORMANT_CONFIG for EGL, + * or by querying the EGL_CONFORMANT attribute in newer versions of EGL.

+ * + *

Both of these mechanisms operate on a per-config basis, which works as + * intended for window-based configs. However, with the advent of + * application-created FBOs, it is now possible to do all the multisample + * operations in an application-created FBO and never use a multisample + * window.

+ * + *

This extension further extends the internalformat query mechanism + * (first introduced by ARB_internalformat_query and extended in + * ARB_internalformat_query2) and introduces a mechanism for a + * implementation to report properties of formats that may also be + * dependent on the number of samples. This includes information + * such as whether the combination of format and samples should be + * considered conformant. This enables an implementation to report + * caveats which might apply to both window and FBO-based rendering + * configurations.

+ * + *

Requires {@link GL42 OpenGL 4.2} or {@link ARBInternalformatQuery ARB_internalformat_query}.

+ */ +public class NVInternalformatSampleQuery { + + /** Accepted by the {@code pname} parameter of GetInternalformatSampleivNV */ + public static final int + GL_MULTISAMPLES_NV = 0x9371, + GL_SUPERSAMPLE_SCALE_X_NV = 0x9372, + GL_SUPERSAMPLE_SCALE_Y_NV = 0x9373, + GL_CONFORMANT_NV = 0x9374; + + static { GL.initialize(); } + + protected NVInternalformatSampleQuery() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glGetInternalformatSampleivNV + ); + } + + // --- [ glGetInternalformatSampleivNV ] --- + + public static native void nglGetInternalformatSampleivNV(int target, int internalformat, int samples, int pname, int bufSize, long params); + + public static void glGetInternalformatSampleivNV(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int samples, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer params) { + nglGetInternalformatSampleivNV(target, internalformat, samples, pname, params.remaining(), memAddress(params)); + } + + /** Array version of: {@link #glGetInternalformatSampleivNV GetInternalformatSampleivNV} */ + public static void glGetInternalformatSampleivNV(@NativeType("GLenum") int target, @NativeType("GLenum") int internalformat, @NativeType("GLsizei") int samples, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] params) { + long __functionAddress = GL.getICD().glGetInternalformatSampleivNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, internalformat, samples, pname, params.length, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVLightMaxExponent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVLightMaxExponent.java new file mode 100644 index 00000000..2caf607d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVLightMaxExponent.java @@ -0,0 +1,23 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the NV_light_max_exponent extension. + * + *

Default OpenGL does not permit a shininess or spot exponent over 128.0. This extension permits implementations to support and advertise a maximum + * shininess and spot exponent beyond 128.0.

+ */ +public final class NVLightMaxExponent { + + /** Accepted by the {@code pname} parameters of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev */ + public static final int + GL_MAX_SHININESS_NV = 0x8504, + GL_MAX_SPOT_EXPONENT_NV = 0x8505; + + private NVLightMaxExponent() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVMemoryAttachment.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVMemoryAttachment.java new file mode 100644 index 00000000..42fcb853 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVMemoryAttachment.java @@ -0,0 +1,106 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_memory_attachment extension. + * + *

This extension extends the memory objects introduced with {@link EXTMemoryObject EXT_memory_object} to allow existing textures and buffers to be migrated to an + * imported memory allocation. The primary use-case of this extension is plug-in development where resource management (creation, deletion, sizing etc.) + * is handled by inaccessible host application code.

+ * + *

Requires {@link EXTMemoryObject EXT_memory_object} and {@link ARBTextureStorage ARB_texture_storage} or a version of OpenGL that incorporates it.

+ */ +public class NVMemoryAttachment { + + /** + * Accepted by the {@code pname} parameter of TexParameter{ifx}{v}, TexParameterI{i ui}v, TextureParameter{if}{v}, TextureParameterI{i ui}v, + * GetTexParameter{if}v, GetTexParameterI{i ui}v, GetTextureParameter{if}v, GetTextureParameterI{i ui}v, GetBufferParameter{i|i64}v and + * GetNamedBufferParameter{i|i64}v. + */ + public static final int + GL_ATTACHED_MEMORY_OBJECT_NV = 0x95A4, + GL_ATTACHED_MEMORY_OFFSET_NV = 0x95A5, + GL_MEMORY_ATTACHABLE_ALIGNMENT_NV = 0x95A6, + GL_MEMORY_ATTACHABLE_SIZE_NV = 0x95A7, + GL_MEMORY_ATTACHABLE_NV = 0x95A8; + + /** + * Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetFloatv, GetIntegerv, GetInteger64v, GetUnsignedBytevEXT, + * GetMemoryObjectParameterivEXT, and the {@code target} parameter of GetBooleani_v, GetIntegeri_v,GetFloati_v, GetDoublei_v, GetInteger64i_v and + * GetUnsignedBytei_vEXT. + */ + public static final int GL_DETACHED_MEMORY_INCARNATION_NV = 0x95A9; + + /** Accepted by the {@code pname} parameter of GetMemoryObjectParameterivEXT, GetMemoryObjectDetachedResourcesuivNV and ResetMemoryObjectParameterNV. */ + public static final int + GL_DETACHED_TEXTURES_NV = 0x95AA, + GL_DETACHED_BUFFERS_NV = 0x95AB; + + /** Accepted by the {@code pname} parameter of MemoryObjectParameterivEXT, GetMemoryObjectParameterivEXT. */ + public static final int + GL_MAX_DETACHED_TEXTURES_NV = 0x95AC, + GL_MAX_DETACHED_BUFFERS_NV = 0x95AD; + + static { GL.initialize(); } + + protected NVMemoryAttachment() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glGetMemoryObjectDetachedResourcesuivNV, caps.glResetMemoryObjectParameterNV, caps.glTexAttachMemoryNV, caps.glBufferAttachMemoryNV, + caps.hasDSA(ext) ? caps.glTextureAttachMemoryNV : -1L, caps.hasDSA(ext) ? caps.glNamedBufferAttachMemoryNV : -1L + ); + } + + // --- [ glGetMemoryObjectDetachedResourcesuivNV ] --- + + public static native void nglGetMemoryObjectDetachedResourcesuivNV(int memory, int pname, int first, int count, long params); + + public static void glGetMemoryObjectDetachedResourcesuivNV(@NativeType("GLuint") int memory, @NativeType("GLenum") int pname, @NativeType("GLint") int first, @NativeType("GLuint *") IntBuffer params) { + nglGetMemoryObjectDetachedResourcesuivNV(memory, pname, first, params.remaining(), memAddress(params)); + } + + // --- [ glResetMemoryObjectParameterNV ] --- + + public static native void glResetMemoryObjectParameterNV(@NativeType("GLuint") int memory, @NativeType("GLenum") int pname); + + // --- [ glTexAttachMemoryNV ] --- + + public static native void glTexAttachMemoryNV(@NativeType("GLenum") int target, @NativeType("GLuint") int memory, @NativeType("GLuint64") long offset); + + // --- [ glBufferAttachMemoryNV ] --- + + public static native void glBufferAttachMemoryNV(@NativeType("GLenum") int target, @NativeType("GLuint") int memory, @NativeType("GLuint64") long offset); + + // --- [ glTextureAttachMemoryNV ] --- + + public static native void glTextureAttachMemoryNV(@NativeType("GLuint") int texture, @NativeType("GLuint") int memory, @NativeType("GLuint64") long offset); + + // --- [ glNamedBufferAttachMemoryNV ] --- + + public static native void glNamedBufferAttachMemoryNV(@NativeType("GLuint") int buffer, @NativeType("GLuint") int memory, @NativeType("GLuint64") long offset); + + /** Array version of: {@link #glGetMemoryObjectDetachedResourcesuivNV GetMemoryObjectDetachedResourcesuivNV} */ + public static void glGetMemoryObjectDetachedResourcesuivNV(@NativeType("GLuint") int memory, @NativeType("GLenum") int pname, @NativeType("GLint") int first, @NativeType("GLuint *") int[] params) { + long __functionAddress = GL.getICD().glGetMemoryObjectDetachedResourcesuivNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(memory, pname, first, params.length, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVMeshShader.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVMeshShader.java new file mode 100644 index 00000000..2687fd42 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVMeshShader.java @@ -0,0 +1,130 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the NV_mesh_shader extension. + * + *

This extension provides a new mechanism allowing applications to use two new programmable shader types -- the task and mesh shader -- to generate + * collections of geometric primitives to be processed by fixed-function primitive assembly and rasterization logic. When the task and mesh shaders are + * drawn, they replace the standard programmable vertex processing pipeline, including vertex array attribute fetching, vertex shader processing, + * tessellation, and the geometry shader processing.

+ * + *

Requires {@link GL45 OpenGL 4.5}.

+ */ +public class NVMeshShader { + + /** Accepted by the {@code type} parameter of {@link GL20C#glCreateShader CreateShader} and returned by the {@code params} parameter of {@link GL20C#glGetShaderiv GetShaderiv}. */ + public static final int + GL_MESH_SHADER_NV = 0x9559, + GL_TASK_SHADER_NV = 0x955A; + + /** Accepted by the {@code pname} parameter of {@link GL11C#glGetIntegerv GetIntegerv}, {@link GL11C#glGetBooleanv GetBooleanv}, {@link GL11C#glGetFloatv GetFloatv}, {@link GL11C#glGetDoublev GetDoublev} and {@link GL32C#glGetInteger64v GetInteger64v}. */ + public static final int + GL_MAX_MESH_UNIFORM_BLOCKS_NV = 0x8E60, + GL_MAX_MESH_TEXTURE_IMAGE_UNITS_NV = 0x8E61, + GL_MAX_MESH_IMAGE_UNIFORMS_NV = 0x8E62, + GL_MAX_MESH_UNIFORM_COMPONENTS_NV = 0x8E63, + GL_MAX_MESH_ATOMIC_COUNTER_BUFFERS_NV = 0x8E64, + GL_MAX_MESH_ATOMIC_COUNTERS_NV = 0x8E65, + GL_MAX_MESH_SHADER_STORAGE_BLOCKS_NV = 0x8E66, + GL_MAX_COMBINED_MESH_UNIFORM_COMPONENTS_NV = 0x8E67, + GL_MAX_TASK_UNIFORM_BLOCKS_NV = 0x8E68, + GL_MAX_TASK_TEXTURE_IMAGE_UNITS_NV = 0x8E69, + GL_MAX_TASK_IMAGE_UNIFORMS_NV = 0x8E6A, + GL_MAX_TASK_UNIFORM_COMPONENTS_NV = 0x8E6B, + GL_MAX_TASK_ATOMIC_COUNTER_BUFFERS_NV = 0x8E6C, + GL_MAX_TASK_ATOMIC_COUNTERS_NV = 0x8E6D, + GL_MAX_TASK_SHADER_STORAGE_BLOCKS_NV = 0x8E6E, + GL_MAX_COMBINED_TASK_UNIFORM_COMPONENTS_NV = 0x8E6F, + GL_MAX_MESH_WORK_GROUP_INVOCATIONS_NV = 0x95A2, + GL_MAX_TASK_WORK_GROUP_INVOCATIONS_NV = 0x95A3, + GL_MAX_MESH_TOTAL_MEMORY_SIZE_NV = 0x9536, + GL_MAX_TASK_TOTAL_MEMORY_SIZE_NV = 0x9537, + GL_MAX_MESH_OUTPUT_VERTICES_NV = 0x9538, + GL_MAX_MESH_OUTPUT_PRIMITIVES_NV = 0x9539, + GL_MAX_TASK_OUTPUT_COUNT_NV = 0x953A, + GL_MAX_DRAW_MESH_TASKS_COUNT_NV = 0x953D, + GL_MAX_MESH_VIEWS_NV = 0x9557, + GL_MESH_OUTPUT_PER_VERTEX_GRANULARITY_NV = 0x92DF, + GL_MESH_OUTPUT_PER_PRIMITIVE_GRANULARITY_NV = 0x9543; + + /** Accepted by the {@code pname} parameter of {@link GL30C#glGetIntegeri_v GetIntegeri_v}, {@link GL30C#glGetBooleani_v GetBooleani_v}, {@link GL41C#glGetFloati_v GetFloati_v}, {@link GL41C#glGetDoublei_v GetDoublei_v} and {@link GL32C#glGetInteger64i_v GetInteger64i_v}. */ + public static final int + GL_MAX_MESH_WORK_GROUP_SIZE_NV = 0x953B, + GL_MAX_TASK_WORK_GROUP_SIZE_NV = 0x953C; + + /** Accepted by the {@code pname} parameter of {@link GL20C#glGetProgramiv GetProgramiv}. */ + public static final int + GL_MESH_WORK_GROUP_SIZE_NV = 0x953E, + GL_TASK_WORK_GROUP_SIZE_NV = 0x953F, + GL_MESH_VERTICES_OUT_NV = 0x9579, + GL_MESH_PRIMITIVES_OUT_NV = 0x957A, + GL_MESH_OUTPUT_TYPE_NV = 0x957B; + + /** Accepted by the {@code pname} parameter of {@link GL31C#glGetActiveUniformBlockiv GetActiveUniformBlockiv}. */ + public static final int + GL_UNIFORM_BLOCK_REFERENCED_BY_MESH_SHADER_NV = 0x959C, + GL_UNIFORM_BLOCK_REFERENCED_BY_TASK_SHADER_NV = 0x959D; + + /** Accepted by the {@code pname} parameter of {@link GL42C#glGetActiveAtomicCounterBufferiv GetActiveAtomicCounterBufferiv}. */ + public static final int + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_MESH_SHADER_NV = 0x959E, + GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TASK_SHADER_NV = 0x959F; + + /** Accepted in the {@code props} array of {@link GL43C#glGetProgramResourceiv GetProgramResourceiv}. */ + public static final int + GL_REFERENCED_BY_MESH_SHADER_NV = 0x95A0, + GL_REFERENCED_BY_TASK_SHADER_NV = 0x95A1; + + /** + * Accepted by the {@code programInterface} parameter of {@link GL43C#glGetProgramInterfaceiv GetProgramInterfaceiv}, {@link GL43C#glGetProgramResourceIndex GetProgramResourceIndex}, {@link GL43C#glGetProgramResourceName GetProgramResourceName}, + * {@link GL43C#glGetProgramResourceiv GetProgramResourceiv}, {@link GL43C#glGetProgramResourceLocation GetProgramResourceLocation}, and {@link GL43C#glGetProgramResourceLocationIndex GetProgramResourceLocationIndex}. + */ + public static final int + GL_MESH_SUBROUTINE_NV = 0x957C, + GL_TASK_SUBROUTINE_NV = 0x957D, + GL_MESH_SUBROUTINE_UNIFORM_NV = 0x957E, + GL_TASK_SUBROUTINE_UNIFORM_NV = 0x957F; + + /** Accepted by the {@code stages} parameter of {@link GL41C#glUseProgramStages UseProgramStages}. */ + public static final int + GL_MESH_SHADER_BIT_NV = 0x40, + GL_TASK_SHADER_BIT_NV = 0x80; + + static { GL.initialize(); } + + protected NVMeshShader() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glDrawMeshTasksNV, caps.glDrawMeshTasksIndirectNV, caps.glMultiDrawMeshTasksIndirectNV, caps.glMultiDrawMeshTasksIndirectCountNV + ); + } + + // --- [ glDrawMeshTasksNV ] --- + + public static native void glDrawMeshTasksNV(@NativeType("GLuint") int first, @NativeType("GLuint") int count); + + // --- [ glDrawMeshTasksIndirectNV ] --- + + public static native void glDrawMeshTasksIndirectNV(@NativeType("GLintptr") long indirect); + + // --- [ glMultiDrawMeshTasksIndirectNV ] --- + + public static native void glMultiDrawMeshTasksIndirectNV(@NativeType("GLintptr") long indirect, @NativeType("GLsizei") int drawcount, @NativeType("GLsizei") int stride); + + // --- [ glMultiDrawMeshTasksIndirectCountNV ] --- + + public static native void glMultiDrawMeshTasksIndirectCountNV(@NativeType("GLintptr") long indirect, @NativeType("GLintptr") long drawcount, @NativeType("GLsizei") int maxdrawcount, @NativeType("GLsizei") int stride); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVMultisampleCoverage.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVMultisampleCoverage.java new file mode 100644 index 00000000..4573a8ef --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVMultisampleCoverage.java @@ -0,0 +1,33 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the NV_multisample_coverage extension. + * + *

The ARB_multisample extension provides a mechanism for antialiasing primitives. This mechanism allows an application to request an additional buffer, + * the multisample buffer, that is added to the framebuffer. An application can request the number of samples per fragment that are stored in the + * multisample buffer. Rendering proceeds by writing color, depth, and stencil values for each sample to the multisample buffer. The results are + * automatically resolved to a single displayable color each time a pixel is updated.

+ * + *

Coverage Sample Anti-Aliasing (CSAA) is an extension to multisample antialiasing. The technique separates "samples" into two types of samples. "Color + * samples" are samples with color, depth, and stencil information stored in the multisample buffer. "Coverage samples" include both color samples and + * additional samples that only provide pixel coverage information.

+ * + *

This extension follows the example of the NV_framebuffer_multisample_coverage extension, which adds CSAA support for framebuffer objects. The base + * description of multisample rendering is written in terms of coverage samples and color samples. The windows system notion of "samples" (SAMPLES_ARB) is + * layered on top of coverage and color samples.

+ * + *

Requires {@link ARBMultisample ARB_multisample}.

+ */ +public final class NVMultisampleCoverage { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int GL_COLOR_SAMPLES_NV = 0x8E20; + + private NVMultisampleCoverage() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVMultisampleFilterHint.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVMultisampleFilterHint.java new file mode 100644 index 00000000..1b14d27b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVMultisampleFilterHint.java @@ -0,0 +1,27 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the NV_multisample_filter_hint extension. + * + *

OpenGL multisampling typically assumes that the samples of a given pixel are weighted uniformly and averaged to compute the pixel's resolved color. + * This extension provides a hint that permits implementations to provide an alternative method of resolving the color of multisampled pixels.

+ * + *

As an example of such an alternative method, NVIDIA's GeForce3 GPU provides a technique known as Quincunx filtering. This technique is used in + * two-sample multisampling, but it blends the pixel's two samples and three additional samples from adjacent pixels. The sample pattern is analogous to + * the 5 pattern on a die. The quality of this technique is widely regarded as comparable to 4 sample multisampling.

+ * + *

Requires {@link ARBMultisample ARB_multisample}.

+ */ +public final class NVMultisampleFilterHint { + + /** Accepted by the {@code target} parameter of Hint and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_MULTISAMPLE_FILTER_HINT_NV = 0x8534; + + private NVMultisampleFilterHint() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPackedDepthStencil.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPackedDepthStencil.java new file mode 100644 index 00000000..8fb05b53 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPackedDepthStencil.java @@ -0,0 +1,30 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * This extension provides a new data format, {@link #GL_DEPTH_STENCIL_NV DEPTH_STENCIL_NV}, that can be used with the glDrawPixels, glReadPixels, and glCopyPixels commands, as well + * as a packed data type, {@link #GL_UNSIGNED_INT_24_8_NV UNSIGNED_INT_24_8_NV}, that is meant to be used with GL_DEPTH_STENCIL_NV. No other formats are supported with + * GL_DEPTH_STENCIL_NV. If SGIX_depth_texture is supported, GL_DEPTH_STENCIL_NV/GL_UNSIGNED_INT_24_8_NV data can also be used for + * textures; this provides a more efficient way to supply data for a 24-bit depth texture. + */ +public final class NVPackedDepthStencil { + + /** + * Accepted by the {@code format} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, + * and GetTexImage, and by the {@code type} parameter of CopyPixels. + */ + public static final int GL_DEPTH_STENCIL_NV = 0x84F9; + + /** + * Accepted by the {@code type} parameter of DrawPixels, ReadPixels, TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, TexSubImage2D, TexSubImage3D, and + * GetTexImage. + */ + public static final int GL_UNSIGNED_INT_24_8_NV = 0x84FA; + + private NVPackedDepthStencil() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPathRendering.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPathRendering.java new file mode 100644 index 00000000..406e5f6d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPathRendering.java @@ -0,0 +1,1713 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +import static org.lwjgl.opengl.GL11.*; + +/** + * Native bindings to the NV_path_rendering extension. + * + *

Conventional OpenGL supports rendering images (pixel rectangles and bitmaps) and simple geometric primitives (points, lines, polygons).

+ * + *

This extension adds a new rendering paradigm, known as path rendering, for rendering filled and stroked paths. Path rendering is not novel but rather a + * standard part of most resolution-independent 2D rendering systems such as Flash, PDF, Silverlight, SVG, Java 2D, Office drawings, TrueType fonts, + * PostScript and its fonts, Quartz 2D, XML Paper Specification (XPS), and OpenVG. What is novel is the ability to mix path rendering with arbitrary + * OpenGL 3D rendering and imaging.

+ * + *

With this extension, path rendering becomes a first-class rendering mode within the OpenGL graphics system that can be arbitrarily mixed with existing + * OpenGL rendering and can take advantage of OpenGL's existing mechanisms for texturing, programmability, and per-fragment operations.

+ * + *

Unlike geometric primitive rendering, paths are specified on a 2D (non-projective) plane rather than in 3D (projective) space. Even though the path is + * defined in a 2D plane, every path can be transformed into 3D clip space allowing for 3D view frustum & user-defined clipping, depth offset, and + * depth testing in the same manner as geometric primitive rendering.

+ * + *

Both geometric primitive rendering and path rendering support rasterization of edges defined by line segments; however, path rendering also allows path + * segments to be specified by Bezier (cubic or quadratic) curves or partial elliptical arcs. This allows path rendering to define truly curved primitive + * boundaries unlike the straight edges of line and polygon primitives. Whereas geometric primitive rendering requires convex polygons for well-defined + * rendering results, path rendering allows (and encourages!) concave and curved outlines to be specified. These paths are even allowed to self-intersect.

+ * + *

When filling closed paths, the winding of paths (counterclockwise or clockwise) determines whether pixels are inside or outside of the path.

+ * + *

Paths can also be stroked whereby, conceptually, a fixed-width "brush" is pulled along the path such that the brush remains orthogonal to the gradient + * of each path segment. Samples within the sweep of this brush are considered inside the stroke of the path.

+ * + *

This extension supports path rendering through a sequence of three operations:

+ * + *
    + *
  1. Path specification is the process of creating and updating a path object consisting of a set of path commands and a corresponding set of 2D + * vertices. + * + *

    Path commands can be specified explicitly from path command and coordinate data, parsed from a string based on standard grammars for representing + * paths, or specified by a particular glyph of standard font representations. Also new paths can be specified by weighting one or more existing paths + * so long as all the weighted paths have consistent command sequences.

    + * + *

    Each path object contains zero or more subpaths specified by a sequence of line segments, partial elliptical arcs, and (cubic or quadratic) Bezier + * curve segments. Each path may contain multiple subpaths that can be closed (forming a contour) or open.

  2. + *
  3. Path stenciling is the process of updating the stencil buffer based on a path's coverage transformed into window space. + * + *

    Path stenciling can determine either the filled or stroked coverage of a path.

    + * + *

    The details of path stenciling are explained within the core of the specification.

    + * + *

    Stenciling a stroked path supports all the standard embellishments for path stroking such as end caps, join styles, miter limits, dashing, and dash + * caps. These stroking properties specified are parameters of path objects.

  4. + *
  5. Path covering is the process of emitting simple (convex & planar) geometry that (conservatively) "covers" the path's sample coverage in the + * stencil buffer. During path covering, stencil testing can be configured to discard fragments not within the actual coverage of the path as + * determined by prior path stenciling. + * + *

    Path covering can cover either the filled or stroked coverage of a path.

    + * + *

    The details of path covering are explained within the core of the specification.

  6. + *
+ * + *

To render a path object into the color buffer, an application specifies a path object and then uses a two-step rendering process. First, the path + * object is stenciled whereby the path object's stroked or filled coverage is rasterized into the stencil buffer. Second, the path object is covered + * whereby conservative bounding geometry for the path is transformed and rasterized with stencil testing configured to test against the coverage + * information written to the stencil buffer in the first step so that only fragments covered by the path are written during this second step. Also during + * this second step written pixels typically have their stencil value reset (so there's no need for clearing the stencil buffer between rendering each + * path).

+ */ +public class NVPathRendering { + + /** Accepted in elements of the {@code commands} array parameter of PathCommandsNV and PathSubCommandsNV. */ + public static final byte + GL_CLOSE_PATH_NV = 0x0, + GL_MOVE_TO_NV = 0x2, + GL_RELATIVE_MOVE_TO_NV = 0x3, + GL_LINE_TO_NV = 0x4, + GL_RELATIVE_LINE_TO_NV = 0x5, + GL_HORIZONTAL_LINE_TO_NV = 0x6, + GL_RELATIVE_HORIZONTAL_LINE_TO_NV = 0x7, + GL_VERTICAL_LINE_TO_NV = 0x8, + GL_RELATIVE_VERTICAL_LINE_TO_NV = 0x9, + GL_QUADRATIC_CURVE_TO_NV = 0xA, + GL_RELATIVE_QUADRATIC_CURVE_TO_NV = 0xB, + GL_CUBIC_CURVE_TO_NV = 0xC, + GL_RELATIVE_CUBIC_CURVE_TO_NV = 0xD, + GL_SMOOTH_QUADRATIC_CURVE_TO_NV = 0xE, + GL_RELATIVE_SMOOTH_QUADRATIC_CURVE_TO_NV = 0xF, + GL_SMOOTH_CUBIC_CURVE_TO_NV = 0x10, + GL_RELATIVE_SMOOTH_CUBIC_CURVE_TO_NV = 0x11, + GL_SMALL_CCW_ARC_TO_NV = 0x12, + GL_RELATIVE_SMALL_CCW_ARC_TO_NV = 0x13, + GL_SMALL_CW_ARC_TO_NV = 0x14, + GL_RELATIVE_SMALL_CW_ARC_TO_NV = 0x15, + GL_LARGE_CCW_ARC_TO_NV = 0x16, + GL_RELATIVE_LARGE_CCW_ARC_TO_NV = 0x17, + GL_LARGE_CW_ARC_TO_NV = 0x18, + GL_RELATIVE_LARGE_CW_ARC_TO_NV = 0x19, + GL_CONIC_CURVE_TO_NV = 0x1A, + GL_RELATIVE_CONIC_CURVE_TO_NV = 0x1B, + GL_ROUNDED_RECT_NV = (byte)0xE8, + GL_RELATIVE_ROUNDED_RECT_NV = (byte)0xE9, + GL_ROUNDED_RECT2_NV = (byte)0xEA, + GL_RELATIVE_ROUNDED_RECT2_NV = (byte)0xEB, + GL_ROUNDED_RECT4_NV = (byte)0xEC, + GL_RELATIVE_ROUNDED_RECT4_NV = (byte)0xED, + GL_ROUNDED_RECT8_NV = (byte)0xEE, + GL_RELATIVE_ROUNDED_RECT8_NV = (byte)0xEF, + GL_RESTART_PATH_NV = (byte)0xF0, + GL_DUP_FIRST_CUBIC_CURVE_TO_NV = (byte)0xF2, + GL_DUP_LAST_CUBIC_CURVE_TO_NV = (byte)0xF4, + GL_RECT_NV = (byte)0xF6, + GL_RELATIVE_RECT_NV = (byte)0xF7, + GL_CIRCULAR_CCW_ARC_TO_NV = (byte)0xF8, + GL_CIRCULAR_CW_ARC_TO_NV = (byte)0xFA, + GL_CIRCULAR_TANGENT_ARC_TO_NV = (byte)0xFC, + GL_ARC_TO_NV = (byte)0xFE, + GL_RELATIVE_ARC_TO_NV = (byte)0xFF; + + /** Accepted by the {@code format} parameter of PathStringNV. */ + public static final int + GL_PATH_FORMAT_SVG_NV = 0x9070, + GL_PATH_FORMAT_PS_NV = 0x9071; + + /** Accepted by the {@code fontTarget} parameter of PathGlyphsNV, PathGlyphRangeNV, and PathGlyphIndexRangeNV. */ + public static final int + GL_STANDARD_FONT_NAME_NV = 0x9072, + GL_SYSTEM_FONT_NAME_NV = 0x9073, + GL_FILE_NAME_NV = 0x9074; + + /** Accepted by the {@code fontTarget} parameter of PathMemoryGlyphIndexArrayNV. */ + public static final int GL_STANDARD_FONT_FORMAT_NV = 0x936C; + + /** Accepted by the {@code handleMissingGlyph} parameter of PathGlyphsNV and PathGlyphRangeNV. */ + public static final int + GL_SKIP_MISSING_GLYPH_NV = 0x90A9, + GL_USE_MISSING_GLYPH_NV = 0x90AA; + + /** Returned by PathGlyphIndexRangeNV. */ + public static final int + GL_FONT_GLYPHS_AVAILABLE_NV = 0x9368, + GL_FONT_TARGET_UNAVAILABLE_NV = 0x9369, + GL_FONT_UNAVAILABLE_NV = 0x936A, + GL_FONT_UNINTELLIGIBLE_NV = 0x936B; + + /** + * Accepted by the {@code pname} parameter of PathParameterfNV, PathParameterfvNV, GetPathParameterfvNV, PathParameteriNV, PathParameterivNV, and + * GetPathParameterivNV. + */ + public static final int + GL_PATH_STROKE_WIDTH_NV = 0x9075, + GL_PATH_INITIAL_END_CAP_NV = 0x9077, + GL_PATH_TERMINAL_END_CAP_NV = 0x9078, + GL_PATH_JOIN_STYLE_NV = 0x9079, + GL_PATH_MITER_LIMIT_NV = 0x907A, + GL_PATH_INITIAL_DASH_CAP_NV = 0x907C, + GL_PATH_TERMINAL_DASH_CAP_NV = 0x907D, + GL_PATH_DASH_OFFSET_NV = 0x907E, + GL_PATH_CLIENT_LENGTH_NV = 0x907F, + GL_PATH_DASH_OFFSET_RESET_NV = 0x90B4, + GL_PATH_FILL_MODE_NV = 0x9080, + GL_PATH_FILL_MASK_NV = 0x9081, + GL_PATH_FILL_COVER_MODE_NV = 0x9082, + GL_PATH_STROKE_COVER_MODE_NV = 0x9083, + GL_PATH_STROKE_MASK_NV = 0x9084, + GL_PATH_STROKE_BOUND_NV = 0x9086; + + /** Accepted by the {@code pname} parameter of PathParameterfNV and PathParameterfvNV. */ + public static final int + GL_PATH_END_CAPS_NV = 0x9076, + GL_PATH_DASH_CAPS_NV = 0x907B; + + /** Accepted by the {@code fillMode} parameter of StencilFillPathNV and StencilFillPathInstancedNV. */ + public static final int + GL_COUNT_UP_NV = 0x9088, + GL_COUNT_DOWN_NV = 0x9089; + + /** Accepted by the {@code color} parameter of PathColorGenNV, GetPathColorGenivNV, and GetPathColorGenfvNV. */ + public static final int + GL_PRIMARY_COLOR_NV = 0x852C, + GL_SECONDARY_COLOR_NV = 0x852D; + + /** Accepted by the {@code genMode} parameter of PathColorGenNV, PathTexGenNV, ProgramPathFragmentInputGenNV. */ + public static final int GL_PATH_OBJECT_BOUNDING_BOX_NV = 0x908A; + + /** Accepted by the {@code coverMode} parameter of CoverFillPathNV and CoverFillPathInstancedNV. */ + public static final int + GL_CONVEX_HULL_NV = 0x908B, + GL_BOUNDING_BOX_NV = 0x908D; + + /** + * Accepted by the {@code transformType} parameter of StencilFillPathInstancedNV, StencilStrokePathInstancedNV, CoverFillPathInstancedNV, and + * CoverStrokePathInstancedNV. + */ + public static final int + GL_TRANSLATE_X_NV = 0x908E, + GL_TRANSLATE_Y_NV = 0x908F, + GL_TRANSLATE_2D_NV = 0x9090, + GL_TRANSLATE_3D_NV = 0x9091, + GL_AFFINE_2D_NV = 0x9092, + GL_AFFINE_3D_NV = 0x9094, + GL_TRANSPOSE_AFFINE_2D_NV = 0x9096, + GL_TRANSPOSE_AFFINE_3D_NV = 0x9098; + + /** + * Accepted by the {@code type} or {@code pathNameType} parameter of StencilFillPathInstancedNV, StencilStrokePathInstancedNV, CoverFillPathInstancedNV, + * CoverStrokePathInstancedNV, GetPathMetricsNV, and GetPathSpacingNV. + */ + public static final int + GL_UTF8_NV = 0x909A, + GL_UTF16_NV = 0x909B; + + /** Accepted by the {@code coverMode} parameter of CoverFillPathInstancedNV. */ + public static final int GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV = 0x909C; + + /** Accepted by the {@code pname} parameter of GetPathParameterfvNV and GetPathParameterivNV. */ + public static final int + GL_PATH_COMMAND_COUNT_NV = 0x909D, + GL_PATH_COORD_COUNT_NV = 0x909E, + GL_PATH_DASH_ARRAY_COUNT_NV = 0x909F, + GL_PATH_COMPUTED_LENGTH_NV = 0x90A0, + GL_PATH_FILL_BOUNDING_BOX_NV = 0x90A1, + GL_PATH_STROKE_BOUNDING_BOX_NV = 0x90A2; + + /** + * Accepted by the {@code value} parameter of PathParameterfNV, PathParameterfvNV, PathParameteriNV, and PathParameterivNV when {@code pname} is one of + * PATH_END_CAPS_NV, PATH_INTIAL_END_CAP_NV, PATH_TERMINAL_END_CAP_NV, PATH_DASH_CAPS_NV, PATH_INITIAL_DASH_CAP_NV, and PATH_TERMINAL_DASH_CAP_NV. + */ + public static final int + GL_SQUARE_NV = 0x90A3, + GL_ROUND_NV = 0x90A4, + GL_TRIANGULAR_NV = 0x90A5; + + /** + * Accepted by the {@code value} parameter of PathParameterfNV, PathParameterfvNV, PathParameteriNV, and PathParameterivNV when {@code pname} is + * PATH_JOIN_STYLE_NV. + */ + public static final int + GL_BEVEL_NV = 0x90A6, + GL_MITER_REVERT_NV = 0x90A7, + GL_MITER_TRUNCATE_NV = 0x90A8; + + /** + * Accepted by the {@code value} parameter of PathParameterfNV, PathParameterfvNV, PathParameteriNV, and PathParameterivNV when {@code pname} is + * PATH_DASH_OFFSET_RESET_NV. + */ + public static final int + GL_MOVE_TO_RESETS_NV = 0x90B5, + GL_MOVE_TO_CONTINUES_NV = 0x90B6; + + /** Accepted by the {@code fontStyle} parameter of PathGlyphsNV, PathGlyphRangeNV, and PathGlyphIndexRangeNV. */ + public static final int + GL_BOLD_BIT_NV = 0x1, + GL_ITALIC_BIT_NV = 0x2; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int + GL_PATH_ERROR_POSITION_NV = 0x90AB, + GL_PATH_FOG_GEN_MODE_NV = 0x90AC, + GL_PATH_STENCIL_FUNC_NV = 0x90B7, + GL_PATH_STENCIL_REF_NV = 0x90B8, + GL_PATH_STENCIL_VALUE_MASK_NV = 0x90B9, + GL_PATH_STENCIL_DEPTH_OFFSET_FACTOR_NV = 0x90BD, + GL_PATH_STENCIL_DEPTH_OFFSET_UNITS_NV = 0x90BE, + GL_PATH_COVER_DEPTH_FUNC_NV = 0x90BF; + + /** Accepted as a bit within the {@code metricQueryMask} parameter of GetPathMetricRangeNV or GetPathMetricsNV. */ + public static final int + GL_GLYPH_WIDTH_BIT_NV = 0x1, + GL_GLYPH_HEIGHT_BIT_NV = 0x2, + GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV = 0x4, + GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV = 0x8, + GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV = 0x10, + GL_GLYPH_VERTICAL_BEARING_X_BIT_NV = 0x20, + GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV = 0x40, + GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV = 0x80, + GL_GLYPH_HAS_KERNING_BIT_NV = 0x100, + GL_FONT_X_MIN_BOUNDS_BIT_NV = 0x10000, + GL_FONT_Y_MIN_BOUNDS_BIT_NV = 0x20000, + GL_FONT_X_MAX_BOUNDS_BIT_NV = 0x40000, + GL_FONT_Y_MAX_BOUNDS_BIT_NV = 0x80000, + GL_FONT_UNITS_PER_EM_BIT_NV = 0x100000, + GL_FONT_ASCENDER_BIT_NV = 0x200000, + GL_FONT_DESCENDER_BIT_NV = 0x400000, + GL_FONT_HEIGHT_BIT_NV = 0x800000, + GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV = 0x1000000, + GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV = 0x2000000, + GL_FONT_UNDERLINE_POSITION_BIT_NV = 0x4000000, + GL_FONT_UNDERLINE_THICKNESS_BIT_NV = 0x8000000, + GL_FONT_HAS_KERNING_BIT_NV = 0x10000000, + GL_FONT_NUM_GLYPH_INDICES_BIT_NV = 0x20000000; + + /** Accepted by the {@code pathListMode} parameter of GetPathSpacingNV. */ + public static final int + GL_ACCUM_ADJACENT_PAIRS_NV = 0x90AD, + GL_ADJACENT_PAIRS_NV = 0x90AE, + GL_FIRST_TO_REST_NV = 0x90AF; + + /** Accepted by the {@code pname} parameter of GetPathColorGenivNV, GetPathColorGenfvNV, GetPathTexGenivNV and GetPathTexGenfvNV. */ + public static final int + GL_PATH_GEN_MODE_NV = 0x90B0, + GL_PATH_GEN_COEFF_NV = 0x90B1; + + /** Accepted by the {@code pname} parameter of GetPathColorGenivNV and GetPathColorGenfvNV. */ + public static final int GL_PATH_GEN_COLOR_FORMAT_NV = 0x90B2; + + /** Accepted by the {@code pname} parameter of GetPathTexGenivNV and GetPathTexGenfvNV. */ + public static final int GL_PATH_GEN_COMPONENTS_NV = 0x90B3; + + /** + * Accepted by the {@code programInterface} parameter of GetProgramInterfaceiv, GetProgramResourceIndex, GetProgramResourceName, GetProgramResourceiv, + * GetProgramResourcefvNV, and GetProgramResourceLocation. + */ + public static final int GL_FRAGMENT_INPUT_NV = 0x936D; + + /** Token values for matrices. */ + public static final int + GL_PATH_PROJECTION_NV = 0x1701, + GL_PATH_MODELVIEW_NV = 0x1700, + GL_PATH_MODELVIEW_STACK_DEPTH_NV = 0xBA3, + GL_PATH_MODELVIEW_MATRIX_NV = 0xBA6, + GL_PATH_MAX_MODELVIEW_STACK_DEPTH_NV = 0xD36, + GL_PATH_TRANSPOSE_MODELVIEW_MATRIX_NV = 0x84E3, + GL_PATH_PROJECTION_STACK_DEPTH_NV = 0xBA4, + GL_PATH_PROJECTION_MATRIX_NV = 0xBA7, + GL_PATH_MAX_PROJECTION_STACK_DEPTH_NV = 0xD38, + GL_PATH_TRANSPOSE_PROJECTION_MATRIX_NV = 0x84E4; + + /** The following types are defined as alias to the GL tokens. */ + public static final int + GL_2_BYTES_NV = 0x1407, + GL_3_BYTES_NV = 0x1408, + GL_4_BYTES_NV = 0x1409, + GL_EYE_LINEAR_NV = 0x2400, + GL_OBJECT_LINEAR_NV = 0x2401, + GL_CONSTANT_NV = 0x8576; + + static { GL.initialize(); } + + protected NVPathRendering() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glPathCommandsNV, caps.glPathCoordsNV, caps.glPathSubCommandsNV, caps.glPathSubCoordsNV, caps.glPathStringNV, caps.glPathGlyphsNV, + caps.glPathGlyphRangeNV, caps.glCopyPathNV, caps.glInterpolatePathsNV, caps.glTransformPathNV, caps.glPathParameterivNV, caps.glPathParameteriNV, + caps.glPathParameterfvNV, caps.glPathParameterfNV, caps.glPathDashArrayNV, caps.glGenPathsNV, caps.glDeletePathsNV, caps.glIsPathNV, + caps.glPathStencilFuncNV, caps.glPathStencilDepthOffsetNV, caps.glStencilFillPathNV, caps.glStencilStrokePathNV, caps.glStencilFillPathInstancedNV, + caps.glStencilStrokePathInstancedNV, caps.glPathCoverDepthFuncNV, caps.glCoverFillPathNV, caps.glCoverStrokePathNV, caps.glCoverFillPathInstancedNV, + caps.glCoverStrokePathInstancedNV, caps.glGetPathParameterivNV, caps.glGetPathParameterfvNV, caps.glGetPathCommandsNV, caps.glGetPathCoordsNV, + caps.glGetPathDashArrayNV, caps.glGetPathMetricsNV, caps.glGetPathMetricRangeNV, caps.glGetPathSpacingNV, caps.glIsPointInFillPathNV, + caps.glIsPointInStrokePathNV, caps.glGetPathLengthNV, caps.glPointAlongPathNV + ); + } + + // --- [ glPathCommandsNV ] --- + + /** Unsafe version of: {@link #glPathCommandsNV PathCommandsNV} */ + public static native void nglPathCommandsNV(int path, int numCommands, long commands, int numCoords, int coordType, long coords); + + /** @param coordType one of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_FLOAT FLOAT}
*/ + public static void glPathCommandsNV(@NativeType("GLuint") int path, @NativeType("GLubyte const *") ByteBuffer commands, @NativeType("GLenum") int coordType, @NativeType("void const *") ByteBuffer coords) { + nglPathCommandsNV(path, commands.remaining(), memAddress(commands), coords.remaining() >> GLChecks.typeToByteShift(coordType), coordType, memAddress(coords)); + } + + /** @param coordType one of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_FLOAT FLOAT}
*/ + public static void glPathCommandsNV(@NativeType("GLuint") int path, @NativeType("GLubyte const *") ByteBuffer commands, @NativeType("GLenum") int coordType, @NativeType("void const *") ShortBuffer coords) { + nglPathCommandsNV(path, commands.remaining(), memAddress(commands), (int)(((long)coords.remaining() << 1) >> GLChecks.typeToByteShift(coordType)), coordType, memAddress(coords)); + } + + /** @param coordType one of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_FLOAT FLOAT}
*/ + public static void glPathCommandsNV(@NativeType("GLuint") int path, @NativeType("GLubyte const *") ByteBuffer commands, @NativeType("GLenum") int coordType, @NativeType("void const *") FloatBuffer coords) { + nglPathCommandsNV(path, commands.remaining(), memAddress(commands), (int)(((long)coords.remaining() << 2) >> GLChecks.typeToByteShift(coordType)), coordType, memAddress(coords)); + } + + // --- [ glPathCoordsNV ] --- + + /** Unsafe version of: {@link #glPathCoordsNV PathCoordsNV} */ + public static native void nglPathCoordsNV(int path, int numCoords, int coordType, long coords); + + /** @param coordType one of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_FLOAT FLOAT}
*/ + public static void glPathCoordsNV(@NativeType("GLuint") int path, @NativeType("GLenum") int coordType, @NativeType("void const *") ByteBuffer coords) { + nglPathCoordsNV(path, coords.remaining() >> GLChecks.typeToByteShift(coordType), coordType, memAddress(coords)); + } + + /** @param coordType one of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_FLOAT FLOAT}
*/ + public static void glPathCoordsNV(@NativeType("GLuint") int path, @NativeType("GLenum") int coordType, @NativeType("void const *") ShortBuffer coords) { + nglPathCoordsNV(path, (int)(((long)coords.remaining() << 1) >> GLChecks.typeToByteShift(coordType)), coordType, memAddress(coords)); + } + + /** @param coordType one of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_FLOAT FLOAT}
*/ + public static void glPathCoordsNV(@NativeType("GLuint") int path, @NativeType("GLenum") int coordType, @NativeType("void const *") FloatBuffer coords) { + nglPathCoordsNV(path, (int)(((long)coords.remaining() << 2) >> GLChecks.typeToByteShift(coordType)), coordType, memAddress(coords)); + } + + // --- [ glPathSubCommandsNV ] --- + + /** Unsafe version of: {@link #glPathSubCommandsNV PathSubCommandsNV} */ + public static native void nglPathSubCommandsNV(int path, int commandStart, int commandsToDelete, int numCommands, long commands, int numCoords, int coordType, long coords); + + /** @param coordType one of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_FLOAT FLOAT}
*/ + public static void glPathSubCommandsNV(@NativeType("GLuint") int path, @NativeType("GLsizei") int commandStart, @NativeType("GLsizei") int commandsToDelete, @NativeType("GLubyte const *") ByteBuffer commands, @NativeType("GLenum") int coordType, @NativeType("void const *") ByteBuffer coords) { + nglPathSubCommandsNV(path, commandStart, commandsToDelete, commands.remaining(), memAddress(commands), coords.remaining() >> GLChecks.typeToByteShift(coordType), coordType, memAddress(coords)); + } + + /** @param coordType one of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_FLOAT FLOAT}
*/ + public static void glPathSubCommandsNV(@NativeType("GLuint") int path, @NativeType("GLsizei") int commandStart, @NativeType("GLsizei") int commandsToDelete, @NativeType("GLubyte const *") ByteBuffer commands, @NativeType("GLenum") int coordType, @NativeType("void const *") ShortBuffer coords) { + nglPathSubCommandsNV(path, commandStart, commandsToDelete, commands.remaining(), memAddress(commands), (int)(((long)coords.remaining() << 1) >> GLChecks.typeToByteShift(coordType)), coordType, memAddress(coords)); + } + + /** @param coordType one of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_FLOAT FLOAT}
*/ + public static void glPathSubCommandsNV(@NativeType("GLuint") int path, @NativeType("GLsizei") int commandStart, @NativeType("GLsizei") int commandsToDelete, @NativeType("GLubyte const *") ByteBuffer commands, @NativeType("GLenum") int coordType, @NativeType("void const *") FloatBuffer coords) { + nglPathSubCommandsNV(path, commandStart, commandsToDelete, commands.remaining(), memAddress(commands), (int)(((long)coords.remaining() << 2) >> GLChecks.typeToByteShift(coordType)), coordType, memAddress(coords)); + } + + // --- [ glPathSubCoordsNV ] --- + + /** Unsafe version of: {@link #glPathSubCoordsNV PathSubCoordsNV} */ + public static native void nglPathSubCoordsNV(int path, int coordStart, int numCoords, int coordType, long coords); + + /** @param coordType one of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_FLOAT FLOAT}
*/ + public static void glPathSubCoordsNV(@NativeType("GLuint") int path, @NativeType("GLsizei") int coordStart, @NativeType("GLenum") int coordType, @NativeType("void const *") ByteBuffer coords) { + nglPathSubCoordsNV(path, coordStart, coords.remaining() >> GLChecks.typeToByteShift(coordType), coordType, memAddress(coords)); + } + + /** @param coordType one of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_FLOAT FLOAT}
*/ + public static void glPathSubCoordsNV(@NativeType("GLuint") int path, @NativeType("GLsizei") int coordStart, @NativeType("GLenum") int coordType, @NativeType("void const *") ShortBuffer coords) { + nglPathSubCoordsNV(path, coordStart, (int)(((long)coords.remaining() << 1) >> GLChecks.typeToByteShift(coordType)), coordType, memAddress(coords)); + } + + /** @param coordType one of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_FLOAT FLOAT}
*/ + public static void glPathSubCoordsNV(@NativeType("GLuint") int path, @NativeType("GLsizei") int coordStart, @NativeType("GLenum") int coordType, @NativeType("void const *") FloatBuffer coords) { + nglPathSubCoordsNV(path, coordStart, (int)(((long)coords.remaining() << 2) >> GLChecks.typeToByteShift(coordType)), coordType, memAddress(coords)); + } + + // --- [ glPathStringNV ] --- + + /** Unsafe version of: {@link #glPathStringNV PathStringNV} */ + public static native void nglPathStringNV(int path, int format, int length, long pathString); + + /** @param format one of:
{@link #GL_PATH_FORMAT_SVG_NV PATH_FORMAT_SVG_NV}{@link #GL_PATH_FORMAT_PS_NV PATH_FORMAT_PS_NV}
*/ + public static void glPathStringNV(@NativeType("GLuint") int path, @NativeType("GLenum") int format, @NativeType("void const *") ByteBuffer pathString) { + nglPathStringNV(path, format, pathString.remaining(), memAddress(pathString)); + } + + // --- [ glPathGlyphsNV ] --- + + /** Unsafe version of: {@link #glPathGlyphsNV PathGlyphsNV} */ + public static native void nglPathGlyphsNV(int firstPathName, int fontTarget, long fontName, int fontStyle, int numGlyphs, int type, long charcodes, int handleMissingGlyphs, int pathParameterTemplate, float emScale); + + /** + * @param fontTarget one of:
{@link #GL_STANDARD_FONT_NAME_NV STANDARD_FONT_NAME_NV}{@link #GL_SYSTEM_FONT_NAME_NV SYSTEM_FONT_NAME_NV}{@link #GL_FILE_NAME_NV FILE_NAME_NV}
+ * @param fontStyle one or more of:
{@link #GL_BOLD_BIT_NV BOLD_BIT_NV}{@link #GL_ITALIC_BIT_NV ITALIC_BIT_NV}
+ * @param type one of:
{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link #GL_UTF8_NV UTF8_NV}{@link #GL_UTF16_NV UTF16_NV}{@link #GL_2_BYTES_NV 2_BYTES_NV}{@link #GL_3_BYTES_NV 3_BYTES_NV}
{@link #GL_4_BYTES_NV 4_BYTES_NV}
+ * @param handleMissingGlyphs one of:
{@link #GL_SKIP_MISSING_GLYPH_NV SKIP_MISSING_GLYPH_NV}{@link #GL_USE_MISSING_GLYPH_NV USE_MISSING_GLYPH_NV}
+ */ + public static void glPathGlyphsNV(@NativeType("GLuint") int firstPathName, @NativeType("GLenum") int fontTarget, @NativeType("void const *") ByteBuffer fontName, @NativeType("GLbitfield") int fontStyle, @NativeType("GLenum") int type, @NativeType("void const *") ByteBuffer charcodes, @NativeType("GLenum") int handleMissingGlyphs, @NativeType("GLuint") int pathParameterTemplate, @NativeType("GLfloat") float emScale) { + if (CHECKS) { + checkNT1(fontName); + } + nglPathGlyphsNV(firstPathName, fontTarget, memAddress(fontName), fontStyle, charcodes.remaining() / charcodeTypeToBytes(type), type, memAddress(charcodes), handleMissingGlyphs, pathParameterTemplate, emScale); + } + + // --- [ glPathGlyphRangeNV ] --- + + /** Unsafe version of: {@link #glPathGlyphRangeNV PathGlyphRangeNV} */ + public static native void nglPathGlyphRangeNV(int firstPathName, int fontTarget, long fontName, int fontStyle, int firstGlyph, int numGlyphs, int handleMissingGlyphs, int pathParameterTemplate, float emScale); + + /** + * @param fontTarget one of:
{@link #GL_STANDARD_FONT_NAME_NV STANDARD_FONT_NAME_NV}{@link #GL_SYSTEM_FONT_NAME_NV SYSTEM_FONT_NAME_NV}{@link #GL_FILE_NAME_NV FILE_NAME_NV}
+ * @param fontStyle one or more of:
{@link #GL_BOLD_BIT_NV BOLD_BIT_NV}{@link #GL_ITALIC_BIT_NV ITALIC_BIT_NV}
+ * @param handleMissingGlyphs one of:
{@link #GL_SKIP_MISSING_GLYPH_NV SKIP_MISSING_GLYPH_NV}{@link #GL_USE_MISSING_GLYPH_NV USE_MISSING_GLYPH_NV}
+ */ + public static void glPathGlyphRangeNV(@NativeType("GLuint") int firstPathName, @NativeType("GLenum") int fontTarget, @NativeType("void const *") ByteBuffer fontName, @NativeType("GLbitfield") int fontStyle, @NativeType("GLuint") int firstGlyph, @NativeType("GLsizei") int numGlyphs, @NativeType("GLenum") int handleMissingGlyphs, @NativeType("GLuint") int pathParameterTemplate, @NativeType("GLfloat") float emScale) { + if (CHECKS) { + checkNT1(fontName); + } + nglPathGlyphRangeNV(firstPathName, fontTarget, memAddress(fontName), fontStyle, firstGlyph, numGlyphs, handleMissingGlyphs, pathParameterTemplate, emScale); + } + + // --- [ glPathGlyphIndexArrayNV ] --- + + /** Unsafe version of: {@link #glPathGlyphIndexArrayNV PathGlyphIndexArrayNV} */ + public static native int nglPathGlyphIndexArrayNV(int firstPathName, int fontTarget, long fontName, int fontStyle, int firstGlyphIndex, int numGlyphs, int pathParameterTemplate, float emScale); + + /** + * @param fontTarget one of:
{@link #GL_STANDARD_FONT_NAME_NV STANDARD_FONT_NAME_NV}{@link #GL_SYSTEM_FONT_NAME_NV SYSTEM_FONT_NAME_NV}{@link #GL_FILE_NAME_NV FILE_NAME_NV}
+ * @param fontStyle one or more of:
{@link #GL_BOLD_BIT_NV BOLD_BIT_NV}{@link #GL_ITALIC_BIT_NV ITALIC_BIT_NV}
+ */ + @NativeType("GLenum") + public static int glPathGlyphIndexArrayNV(@NativeType("GLuint") int firstPathName, @NativeType("GLenum") int fontTarget, @NativeType("void const *") ByteBuffer fontName, @NativeType("GLbitfield") int fontStyle, @NativeType("GLuint") int firstGlyphIndex, @NativeType("GLsizei") int numGlyphs, @NativeType("GLuint") int pathParameterTemplate, @NativeType("GLfloat") float emScale) { + if (CHECKS) { + checkNT1(fontName); + } + return nglPathGlyphIndexArrayNV(firstPathName, fontTarget, memAddress(fontName), fontStyle, firstGlyphIndex, numGlyphs, pathParameterTemplate, emScale); + } + + // --- [ glPathMemoryGlyphIndexArrayNV ] --- + + /** Unsafe version of: {@link #glPathMemoryGlyphIndexArrayNV PathMemoryGlyphIndexArrayNV} */ + public static native int nglPathMemoryGlyphIndexArrayNV(int firstPathName, int fontTarget, long fontSize, long fontData, int faceIndex, int firstGlyphIndex, int numGlyphs, int pathParameterTemplate, float emScale); + + /** @param fontTarget one of:
{@link #GL_STANDARD_FONT_NAME_NV STANDARD_FONT_NAME_NV}{@link #GL_SYSTEM_FONT_NAME_NV SYSTEM_FONT_NAME_NV}{@link #GL_FILE_NAME_NV FILE_NAME_NV}
*/ + @NativeType("GLenum") + public static int glPathMemoryGlyphIndexArrayNV(@NativeType("GLuint") int firstPathName, @NativeType("GLenum") int fontTarget, @NativeType("void const *") ByteBuffer fontData, @NativeType("GLsizei") int faceIndex, @NativeType("GLuint") int firstGlyphIndex, @NativeType("GLsizei") int numGlyphs, @NativeType("GLuint") int pathParameterTemplate, @NativeType("GLfloat") float emScale) { + return nglPathMemoryGlyphIndexArrayNV(firstPathName, fontTarget, fontData.remaining(), memAddress(fontData), faceIndex, firstGlyphIndex, numGlyphs, pathParameterTemplate, emScale); + } + + // --- [ glCopyPathNV ] --- + + public static native void glCopyPathNV(@NativeType("GLuint") int resultPath, @NativeType("GLuint") int srcPath); + + // --- [ glWeightPathsNV ] --- + + public static native void nglWeightPathsNV(int resultPath, int numPaths, long paths, long weights); + + public static void glWeightPathsNV(@NativeType("GLuint") int resultPath, @NativeType("GLuint const *") IntBuffer paths, @NativeType("GLfloat const *") FloatBuffer weights) { + if (CHECKS) { + check(weights, paths.remaining()); + } + nglWeightPathsNV(resultPath, paths.remaining(), memAddress(paths), memAddress(weights)); + } + + // --- [ glInterpolatePathsNV ] --- + + public static native void glInterpolatePathsNV(@NativeType("GLuint") int resultPath, @NativeType("GLuint") int pathA, @NativeType("GLuint") int pathB, @NativeType("GLfloat") float weight); + + // --- [ glTransformPathNV ] --- + + /** Unsafe version of: {@link #glTransformPathNV TransformPathNV} */ + public static native void nglTransformPathNV(int resultPath, int srcPath, int transformType, long transformValues); + + /** @param transformType one of:
{@link #GL_TRANSLATE_X_NV TRANSLATE_X_NV}{@link #GL_TRANSLATE_Y_NV TRANSLATE_Y_NV}{@link #GL_TRANSLATE_2D_NV TRANSLATE_2D_NV}{@link #GL_TRANSLATE_3D_NV TRANSLATE_3D_NV}{@link #GL_AFFINE_2D_NV AFFINE_2D_NV}
{@link #GL_AFFINE_3D_NV AFFINE_3D_NV}{@link #GL_TRANSPOSE_AFFINE_2D_NV TRANSPOSE_AFFINE_2D_NV}{@link #GL_TRANSPOSE_AFFINE_3D_NV TRANSPOSE_AFFINE_3D_NV}
*/ + public static void glTransformPathNV(@NativeType("GLuint") int resultPath, @NativeType("GLuint") int srcPath, @NativeType("GLenum") int transformType, @NativeType("GLfloat const *") FloatBuffer transformValues) { + if (CHECKS) { + check(transformValues, transformTypeToElements(transformType)); + } + nglTransformPathNV(resultPath, srcPath, transformType, memAddress(transformValues)); + } + + // --- [ glPathParameterivNV ] --- + + /** Unsafe version of: {@link #glPathParameterivNV PathParameterivNV} */ + public static native void nglPathParameterivNV(int path, int pname, long value); + + /** @param pname one of:
{@link #GL_PATH_STROKE_WIDTH_NV PATH_STROKE_WIDTH_NV}{@link #GL_PATH_INITIAL_END_CAP_NV PATH_INITIAL_END_CAP_NV}{@link #GL_PATH_TERMINAL_END_CAP_NV PATH_TERMINAL_END_CAP_NV}
{@link #GL_PATH_JOIN_STYLE_NV PATH_JOIN_STYLE_NV}{@link #GL_PATH_MITER_LIMIT_NV PATH_MITER_LIMIT_NV}{@link #GL_PATH_INITIAL_DASH_CAP_NV PATH_INITIAL_DASH_CAP_NV}
{@link #GL_PATH_TERMINAL_DASH_CAP_NV PATH_TERMINAL_DASH_CAP_NV}{@link #GL_PATH_DASH_OFFSET_NV PATH_DASH_OFFSET_NV}{@link #GL_PATH_CLIENT_LENGTH_NV PATH_CLIENT_LENGTH_NV}
{@link #GL_PATH_DASH_OFFSET_RESET_NV PATH_DASH_OFFSET_RESET_NV}{@link #GL_PATH_FILL_MODE_NV PATH_FILL_MODE_NV}{@link #GL_PATH_FILL_MASK_NV PATH_FILL_MASK_NV}
{@link #GL_PATH_FILL_COVER_MODE_NV PATH_FILL_COVER_MODE_NV}{@link #GL_PATH_STROKE_COVER_MODE_NV PATH_STROKE_COVER_MODE_NV}{@link #GL_PATH_STROKE_MASK_NV PATH_STROKE_MASK_NV}
{@link #GL_PATH_STROKE_BOUND_NV PATH_STROKE_BOUND_NV}
*/ + public static void glPathParameterivNV(@NativeType("GLuint") int path, @NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nglPathParameterivNV(path, pname, memAddress(value)); + } + + // --- [ glPathParameteriNV ] --- + + /** @param pname one of:
{@link #GL_PATH_STROKE_WIDTH_NV PATH_STROKE_WIDTH_NV}{@link #GL_PATH_INITIAL_END_CAP_NV PATH_INITIAL_END_CAP_NV}{@link #GL_PATH_TERMINAL_END_CAP_NV PATH_TERMINAL_END_CAP_NV}
{@link #GL_PATH_JOIN_STYLE_NV PATH_JOIN_STYLE_NV}{@link #GL_PATH_MITER_LIMIT_NV PATH_MITER_LIMIT_NV}{@link #GL_PATH_INITIAL_DASH_CAP_NV PATH_INITIAL_DASH_CAP_NV}
{@link #GL_PATH_TERMINAL_DASH_CAP_NV PATH_TERMINAL_DASH_CAP_NV}{@link #GL_PATH_DASH_OFFSET_NV PATH_DASH_OFFSET_NV}{@link #GL_PATH_CLIENT_LENGTH_NV PATH_CLIENT_LENGTH_NV}
{@link #GL_PATH_DASH_OFFSET_RESET_NV PATH_DASH_OFFSET_RESET_NV}{@link #GL_PATH_FILL_MODE_NV PATH_FILL_MODE_NV}{@link #GL_PATH_FILL_MASK_NV PATH_FILL_MASK_NV}
{@link #GL_PATH_FILL_COVER_MODE_NV PATH_FILL_COVER_MODE_NV}{@link #GL_PATH_STROKE_COVER_MODE_NV PATH_STROKE_COVER_MODE_NV}{@link #GL_PATH_STROKE_MASK_NV PATH_STROKE_MASK_NV}
{@link #GL_PATH_STROKE_BOUND_NV PATH_STROKE_BOUND_NV}
*/ + public static native void glPathParameteriNV(@NativeType("GLuint") int path, @NativeType("GLenum") int pname, @NativeType("GLint") int value); + + // --- [ glPathParameterfvNV ] --- + + /** Unsafe version of: {@link #glPathParameterfvNV PathParameterfvNV} */ + public static native void nglPathParameterfvNV(int path, int pname, long value); + + /** @param pname one of:
{@link #GL_PATH_STROKE_WIDTH_NV PATH_STROKE_WIDTH_NV}{@link #GL_PATH_INITIAL_END_CAP_NV PATH_INITIAL_END_CAP_NV}{@link #GL_PATH_TERMINAL_END_CAP_NV PATH_TERMINAL_END_CAP_NV}
{@link #GL_PATH_JOIN_STYLE_NV PATH_JOIN_STYLE_NV}{@link #GL_PATH_MITER_LIMIT_NV PATH_MITER_LIMIT_NV}{@link #GL_PATH_INITIAL_DASH_CAP_NV PATH_INITIAL_DASH_CAP_NV}
{@link #GL_PATH_TERMINAL_DASH_CAP_NV PATH_TERMINAL_DASH_CAP_NV}{@link #GL_PATH_DASH_OFFSET_NV PATH_DASH_OFFSET_NV}{@link #GL_PATH_CLIENT_LENGTH_NV PATH_CLIENT_LENGTH_NV}
{@link #GL_PATH_DASH_OFFSET_RESET_NV PATH_DASH_OFFSET_RESET_NV}{@link #GL_PATH_FILL_MODE_NV PATH_FILL_MODE_NV}{@link #GL_PATH_FILL_MASK_NV PATH_FILL_MASK_NV}
{@link #GL_PATH_FILL_COVER_MODE_NV PATH_FILL_COVER_MODE_NV}{@link #GL_PATH_STROKE_COVER_MODE_NV PATH_STROKE_COVER_MODE_NV}{@link #GL_PATH_STROKE_MASK_NV PATH_STROKE_MASK_NV}
{@link #GL_PATH_STROKE_BOUND_NV PATH_STROKE_BOUND_NV}{@link #GL_PATH_END_CAPS_NV PATH_END_CAPS_NV}{@link #GL_PATH_DASH_CAPS_NV PATH_DASH_CAPS_NV}
*/ + public static void glPathParameterfvNV(@NativeType("GLuint") int path, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") FloatBuffer value) { + if (CHECKS) { + check(value, 1); + } + nglPathParameterfvNV(path, pname, memAddress(value)); + } + + // --- [ glPathParameterfNV ] --- + + /** @param pname one of:
{@link #GL_PATH_STROKE_WIDTH_NV PATH_STROKE_WIDTH_NV}{@link #GL_PATH_INITIAL_END_CAP_NV PATH_INITIAL_END_CAP_NV}{@link #GL_PATH_TERMINAL_END_CAP_NV PATH_TERMINAL_END_CAP_NV}
{@link #GL_PATH_JOIN_STYLE_NV PATH_JOIN_STYLE_NV}{@link #GL_PATH_MITER_LIMIT_NV PATH_MITER_LIMIT_NV}{@link #GL_PATH_INITIAL_DASH_CAP_NV PATH_INITIAL_DASH_CAP_NV}
{@link #GL_PATH_TERMINAL_DASH_CAP_NV PATH_TERMINAL_DASH_CAP_NV}{@link #GL_PATH_DASH_OFFSET_NV PATH_DASH_OFFSET_NV}{@link #GL_PATH_CLIENT_LENGTH_NV PATH_CLIENT_LENGTH_NV}
{@link #GL_PATH_DASH_OFFSET_RESET_NV PATH_DASH_OFFSET_RESET_NV}{@link #GL_PATH_FILL_MODE_NV PATH_FILL_MODE_NV}{@link #GL_PATH_FILL_MASK_NV PATH_FILL_MASK_NV}
{@link #GL_PATH_FILL_COVER_MODE_NV PATH_FILL_COVER_MODE_NV}{@link #GL_PATH_STROKE_COVER_MODE_NV PATH_STROKE_COVER_MODE_NV}{@link #GL_PATH_STROKE_MASK_NV PATH_STROKE_MASK_NV}
{@link #GL_PATH_STROKE_BOUND_NV PATH_STROKE_BOUND_NV}{@link #GL_PATH_END_CAPS_NV PATH_END_CAPS_NV}{@link #GL_PATH_DASH_CAPS_NV PATH_DASH_CAPS_NV}
*/ + public static native void glPathParameterfNV(@NativeType("GLuint") int path, @NativeType("GLenum") int pname, @NativeType("GLfloat") float value); + + // --- [ glPathDashArrayNV ] --- + + public static native void nglPathDashArrayNV(int path, int dashCount, long dashArray); + + public static void glPathDashArrayNV(@NativeType("GLuint") int path, @NativeType("GLfloat const *") FloatBuffer dashArray) { + nglPathDashArrayNV(path, dashArray.remaining(), memAddress(dashArray)); + } + + // --- [ glGenPathsNV ] --- + + @NativeType("GLuint") + public static native int glGenPathsNV(@NativeType("GLsizei") int range); + + // --- [ glDeletePathsNV ] --- + + public static native void glDeletePathsNV(@NativeType("GLuint") int path, @NativeType("GLsizei") int range); + + // --- [ glIsPathNV ] --- + + @NativeType("GLboolean") + public static native boolean glIsPathNV(@NativeType("GLuint") int path); + + // --- [ glPathStencilFuncNV ] --- + + public static native void glPathStencilFuncNV(@NativeType("GLenum") int func, @NativeType("GLint") int ref, @NativeType("GLuint") int mask); + + // --- [ glPathStencilDepthOffsetNV ] --- + + public static native void glPathStencilDepthOffsetNV(@NativeType("GLfloat") float factor, @NativeType("GLfloat") float units); + + // --- [ glStencilFillPathNV ] --- + + /** @param fillMode one of:
{@link GL11#GL_INVERT INVERT}{@link #GL_COUNT_UP_NV COUNT_UP_NV}{@link #GL_COUNT_DOWN_NV COUNT_DOWN_NV}{@link #GL_PATH_FILL_MODE_NV PATH_FILL_MODE_NV}
*/ + public static native void glStencilFillPathNV(@NativeType("GLuint") int path, @NativeType("GLenum") int fillMode, @NativeType("GLuint") int mask); + + // --- [ glStencilStrokePathNV ] --- + + public static native void glStencilStrokePathNV(@NativeType("GLuint") int path, @NativeType("GLint") int reference, @NativeType("GLuint") int mask); + + // --- [ glStencilFillPathInstancedNV ] --- + + /** Unsafe version of: {@link #glStencilFillPathInstancedNV StencilFillPathInstancedNV} */ + public static native void nglStencilFillPathInstancedNV(int numPaths, int pathNameType, long paths, int pathBase, int fillMode, int mask, int transformType, long transformValues); + + /** + * @param pathNameType one of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_FLOAT FLOAT}{@link #GL_UTF8_NV UTF8_NV}{@link #GL_UTF16_NV UTF16_NV}{@link #GL_2_BYTES_NV 2_BYTES_NV}
{@link #GL_3_BYTES_NV 3_BYTES_NV}{@link #GL_4_BYTES_NV 4_BYTES_NV}
+ * @param fillMode one of:
{@link GL11#GL_INVERT INVERT}{@link #GL_COUNT_UP_NV COUNT_UP_NV}{@link #GL_COUNT_DOWN_NV COUNT_DOWN_NV}{@link #GL_PATH_FILL_MODE_NV PATH_FILL_MODE_NV}
+ * @param transformType one of:
{@link #GL_TRANSLATE_X_NV TRANSLATE_X_NV}{@link #GL_TRANSLATE_Y_NV TRANSLATE_Y_NV}{@link #GL_TRANSLATE_2D_NV TRANSLATE_2D_NV}{@link #GL_TRANSLATE_3D_NV TRANSLATE_3D_NV}{@link #GL_AFFINE_2D_NV AFFINE_2D_NV}
{@link #GL_AFFINE_3D_NV AFFINE_3D_NV}{@link #GL_TRANSPOSE_AFFINE_2D_NV TRANSPOSE_AFFINE_2D_NV}{@link #GL_TRANSPOSE_AFFINE_3D_NV TRANSPOSE_AFFINE_3D_NV}
+ */ + public static void glStencilFillPathInstancedNV(@NativeType("GLenum") int pathNameType, @NativeType("void const *") ByteBuffer paths, @NativeType("GLuint") int pathBase, @NativeType("GLenum") int fillMode, @NativeType("GLuint") int mask, @NativeType("GLenum") int transformType, @NativeType("GLfloat const *") FloatBuffer transformValues) { + int numPaths = paths.remaining() / pathNameTypeToBytes(pathNameType); + if (CHECKS) { + check(transformValues, numPaths * transformTypeToElements(transformType)); + } + nglStencilFillPathInstancedNV(numPaths, pathNameType, memAddress(paths), pathBase, fillMode, mask, transformType, memAddress(transformValues)); + } + + // --- [ glStencilStrokePathInstancedNV ] --- + + /** Unsafe version of: {@link #glStencilStrokePathInstancedNV StencilStrokePathInstancedNV} */ + public static native void nglStencilStrokePathInstancedNV(int numPaths, int pathNameType, long paths, int pathBase, int reference, int mask, int transformType, long transformValues); + + /** + * @param pathNameType one of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_FLOAT FLOAT}{@link #GL_UTF8_NV UTF8_NV}{@link #GL_UTF16_NV UTF16_NV}{@link #GL_2_BYTES_NV 2_BYTES_NV}
{@link #GL_3_BYTES_NV 3_BYTES_NV}{@link #GL_4_BYTES_NV 4_BYTES_NV}
+ * @param transformType one of:
{@link #GL_TRANSLATE_X_NV TRANSLATE_X_NV}{@link #GL_TRANSLATE_Y_NV TRANSLATE_Y_NV}{@link #GL_TRANSLATE_2D_NV TRANSLATE_2D_NV}{@link #GL_TRANSLATE_3D_NV TRANSLATE_3D_NV}{@link #GL_AFFINE_2D_NV AFFINE_2D_NV}
{@link #GL_AFFINE_3D_NV AFFINE_3D_NV}{@link #GL_TRANSPOSE_AFFINE_2D_NV TRANSPOSE_AFFINE_2D_NV}{@link #GL_TRANSPOSE_AFFINE_3D_NV TRANSPOSE_AFFINE_3D_NV}
+ */ + public static void glStencilStrokePathInstancedNV(@NativeType("GLenum") int pathNameType, @NativeType("void const *") ByteBuffer paths, @NativeType("GLuint") int pathBase, @NativeType("GLint") int reference, @NativeType("GLuint") int mask, @NativeType("GLenum") int transformType, @NativeType("GLfloat const *") FloatBuffer transformValues) { + int numPaths = paths.remaining() / pathNameTypeToBytes(pathNameType); + if (CHECKS) { + check(transformValues, numPaths * transformTypeToElements(transformType)); + } + nglStencilStrokePathInstancedNV(numPaths, pathNameType, memAddress(paths), pathBase, reference, mask, transformType, memAddress(transformValues)); + } + + // --- [ glPathCoverDepthFuncNV ] --- + + public static native void glPathCoverDepthFuncNV(@NativeType("GLenum") int zfunc); + + // --- [ glPathColorGenNV ] --- + + /** Unsafe version of: {@link #glPathColorGenNV PathColorGenNV} */ + public static native void nglPathColorGenNV(int color, int genMode, int colorFormat, long coeffs); + + /** + * @param color one of:
{@link GL13#GL_PRIMARY_COLOR PRIMARY_COLOR}{@link #GL_PRIMARY_COLOR_NV PRIMARY_COLOR_NV}{@link #GL_SECONDARY_COLOR_NV SECONDARY_COLOR_NV}
+ * @param genMode one of:
{@link GL11#GL_NONE NONE}{@link #GL_OBJECT_LINEAR_NV OBJECT_LINEAR_NV}{@link #GL_PATH_OBJECT_BOUNDING_BOX_NV PATH_OBJECT_BOUNDING_BOX_NV}{@link #GL_EYE_LINEAR_NV EYE_LINEAR_NV}{@link #GL_CONSTANT_NV CONSTANT_NV}
+ * @param colorFormat {@link GL11#GL_LUMINANCE LUMINANCE} {@link GL11#GL_ALPHA ALPHA} {@link GL11#GL_INTENSITY INTENSITY} {@link GL11#GL_LUMINANCE_ALPHA LUMINANCE_ALPHA} {@link GL11#GL_RGB RGB} {@link GL11#GL_RGBA RGBA} + */ + public static void glPathColorGenNV(@NativeType("GLenum") int color, @NativeType("GLenum") int genMode, @NativeType("GLenum") int colorFormat, @NativeType("GLfloat const *") FloatBuffer coeffs) { + if (CHECKS) { + check(coeffs, genModeToElements(genMode) * colorFormatToComponents(colorFormat)); + } + nglPathColorGenNV(color, genMode, colorFormat, memAddress(coeffs)); + } + + // --- [ glPathTexGenNV ] --- + + public static native void nglPathTexGenNV(int texCoordSet, int genMode, int components, long coeffs); + + public static void glPathTexGenNV(@NativeType("GLenum") int texCoordSet, @NativeType("GLenum") int genMode, @NativeType("GLint") int components, @NativeType("GLfloat const *") FloatBuffer coeffs) { + if (CHECKS) { + check(coeffs, genModeToElements(genMode) * components); + } + nglPathTexGenNV(texCoordSet, genMode, components, memAddress(coeffs)); + } + + // --- [ glPathFogGenNV ] --- + + public static native void glPathFogGenNV(@NativeType("GLenum") int genMode); + + // --- [ glCoverFillPathNV ] --- + + /** @param coverMode one of:
{@link #GL_CONVEX_HULL_NV CONVEX_HULL_NV}{@link #GL_BOUNDING_BOX_NV BOUNDING_BOX_NV}
*/ + public static native void glCoverFillPathNV(@NativeType("GLuint") int path, @NativeType("GLenum") int coverMode); + + // --- [ glCoverStrokePathNV ] --- + + /** @param coverMode one of:
{@link #GL_CONVEX_HULL_NV CONVEX_HULL_NV}{@link #GL_BOUNDING_BOX_NV BOUNDING_BOX_NV}
*/ + public static native void glCoverStrokePathNV(@NativeType("GLuint") int path, @NativeType("GLenum") int coverMode); + + // --- [ glCoverFillPathInstancedNV ] --- + + /** Unsafe version of: {@link #glCoverFillPathInstancedNV CoverFillPathInstancedNV} */ + public static native void nglCoverFillPathInstancedNV(int numPaths, int pathNameType, long paths, int pathBase, int coverMode, int transformType, long transformValues); + + /** + * @param pathNameType one of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_FLOAT FLOAT}{@link #GL_UTF8_NV UTF8_NV}{@link #GL_UTF16_NV UTF16_NV}{@link #GL_2_BYTES_NV 2_BYTES_NV}
{@link #GL_3_BYTES_NV 3_BYTES_NV}{@link #GL_4_BYTES_NV 4_BYTES_NV}
+ * @param coverMode one of:
{@link #GL_CONVEX_HULL_NV CONVEX_HULL_NV}{@link #GL_BOUNDING_BOX_NV BOUNDING_BOX_NV}{@link #GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV BOUNDING_BOX_OF_BOUNDING_BOXES_NV}
+ * @param transformType one of:
{@link #GL_TRANSLATE_X_NV TRANSLATE_X_NV}{@link #GL_TRANSLATE_Y_NV TRANSLATE_Y_NV}{@link #GL_TRANSLATE_2D_NV TRANSLATE_2D_NV}{@link #GL_TRANSLATE_3D_NV TRANSLATE_3D_NV}{@link #GL_AFFINE_2D_NV AFFINE_2D_NV}
{@link #GL_AFFINE_3D_NV AFFINE_3D_NV}{@link #GL_TRANSPOSE_AFFINE_2D_NV TRANSPOSE_AFFINE_2D_NV}{@link #GL_TRANSPOSE_AFFINE_3D_NV TRANSPOSE_AFFINE_3D_NV}
+ */ + public static void glCoverFillPathInstancedNV(@NativeType("GLenum") int pathNameType, @NativeType("void const *") ByteBuffer paths, @NativeType("GLuint") int pathBase, @NativeType("GLenum") int coverMode, @NativeType("GLenum") int transformType, @NativeType("GLfloat const *") FloatBuffer transformValues) { + int numPaths = paths.remaining() / pathNameTypeToBytes(pathNameType); + if (CHECKS) { + check(transformValues, numPaths * transformTypeToElements(transformType)); + } + nglCoverFillPathInstancedNV(numPaths, pathNameType, memAddress(paths), pathBase, coverMode, transformType, memAddress(transformValues)); + } + + // --- [ glCoverStrokePathInstancedNV ] --- + + /** Unsafe version of: {@link #glCoverStrokePathInstancedNV CoverStrokePathInstancedNV} */ + public static native void nglCoverStrokePathInstancedNV(int numPaths, int pathNameType, long paths, int pathBase, int coverMode, int transformType, long transformValues); + + /** + * @param pathNameType one of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_FLOAT FLOAT}{@link #GL_UTF8_NV UTF8_NV}{@link #GL_UTF16_NV UTF16_NV}{@link #GL_2_BYTES_NV 2_BYTES_NV}
{@link #GL_3_BYTES_NV 3_BYTES_NV}{@link #GL_4_BYTES_NV 4_BYTES_NV}
+ * @param coverMode one of:
{@link #GL_CONVEX_HULL_NV CONVEX_HULL_NV}{@link #GL_BOUNDING_BOX_NV BOUNDING_BOX_NV}{@link #GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV BOUNDING_BOX_OF_BOUNDING_BOXES_NV}
+ * @param transformType one of:
{@link #GL_TRANSLATE_X_NV TRANSLATE_X_NV}{@link #GL_TRANSLATE_Y_NV TRANSLATE_Y_NV}{@link #GL_TRANSLATE_2D_NV TRANSLATE_2D_NV}{@link #GL_TRANSLATE_3D_NV TRANSLATE_3D_NV}{@link #GL_AFFINE_2D_NV AFFINE_2D_NV}
{@link #GL_AFFINE_3D_NV AFFINE_3D_NV}{@link #GL_TRANSPOSE_AFFINE_2D_NV TRANSPOSE_AFFINE_2D_NV}{@link #GL_TRANSPOSE_AFFINE_3D_NV TRANSPOSE_AFFINE_3D_NV}
+ */ + public static void glCoverStrokePathInstancedNV(@NativeType("GLenum") int pathNameType, @NativeType("void const *") ByteBuffer paths, @NativeType("GLuint") int pathBase, @NativeType("GLenum") int coverMode, @NativeType("GLenum") int transformType, @NativeType("GLfloat const *") FloatBuffer transformValues) { + int numPaths = paths.remaining() / pathNameTypeToBytes(pathNameType); + if (CHECKS) { + check(transformValues, numPaths * transformTypeToElements(transformType)); + } + nglCoverStrokePathInstancedNV(numPaths, pathNameType, memAddress(paths), pathBase, coverMode, transformType, memAddress(transformValues)); + } + + // --- [ glStencilThenCoverFillPathNV ] --- + + /** + * @param fillMode one of:
{@link GL11#GL_INVERT INVERT}{@link #GL_COUNT_UP_NV COUNT_UP_NV}{@link #GL_COUNT_DOWN_NV COUNT_DOWN_NV}{@link #GL_PATH_FILL_MODE_NV PATH_FILL_MODE_NV}
+ * @param coverMode one of:
{@link #GL_CONVEX_HULL_NV CONVEX_HULL_NV}{@link #GL_BOUNDING_BOX_NV BOUNDING_BOX_NV}
+ */ + public static native void glStencilThenCoverFillPathNV(@NativeType("GLuint") int path, @NativeType("GLenum") int fillMode, @NativeType("GLuint") int mask, @NativeType("GLenum") int coverMode); + + // --- [ glStencilThenCoverStrokePathNV ] --- + + /** @param coverMode one of:
{@link #GL_CONVEX_HULL_NV CONVEX_HULL_NV}{@link #GL_BOUNDING_BOX_NV BOUNDING_BOX_NV}
*/ + public static native void glStencilThenCoverStrokePathNV(@NativeType("GLuint") int path, @NativeType("GLint") int reference, @NativeType("GLuint") int mask, @NativeType("GLenum") int coverMode); + + // --- [ glStencilThenCoverFillPathInstancedNV ] --- + + /** Unsafe version of: {@link #glStencilThenCoverFillPathInstancedNV StencilThenCoverFillPathInstancedNV} */ + public static native void nglStencilThenCoverFillPathInstancedNV(int numPaths, int pathNameType, long paths, int pathBase, int fillMode, int mask, int coverMode, int transformType, long transformValues); + + /** + * @param pathNameType one of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_FLOAT FLOAT}{@link #GL_UTF8_NV UTF8_NV}{@link #GL_UTF16_NV UTF16_NV}{@link #GL_2_BYTES_NV 2_BYTES_NV}
{@link #GL_3_BYTES_NV 3_BYTES_NV}{@link #GL_4_BYTES_NV 4_BYTES_NV}
+ * @param fillMode one of:
{@link GL11#GL_INVERT INVERT}{@link #GL_COUNT_UP_NV COUNT_UP_NV}{@link #GL_COUNT_DOWN_NV COUNT_DOWN_NV}{@link #GL_PATH_FILL_MODE_NV PATH_FILL_MODE_NV}
+ * @param coverMode one of:
{@link #GL_CONVEX_HULL_NV CONVEX_HULL_NV}{@link #GL_BOUNDING_BOX_NV BOUNDING_BOX_NV}{@link #GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV BOUNDING_BOX_OF_BOUNDING_BOXES_NV}
+ * @param transformType one of:
{@link #GL_TRANSLATE_X_NV TRANSLATE_X_NV}{@link #GL_TRANSLATE_Y_NV TRANSLATE_Y_NV}{@link #GL_TRANSLATE_2D_NV TRANSLATE_2D_NV}{@link #GL_TRANSLATE_3D_NV TRANSLATE_3D_NV}{@link #GL_AFFINE_2D_NV AFFINE_2D_NV}
{@link #GL_AFFINE_3D_NV AFFINE_3D_NV}{@link #GL_TRANSPOSE_AFFINE_2D_NV TRANSPOSE_AFFINE_2D_NV}{@link #GL_TRANSPOSE_AFFINE_3D_NV TRANSPOSE_AFFINE_3D_NV}
+ */ + public static void glStencilThenCoverFillPathInstancedNV(@NativeType("GLenum") int pathNameType, @NativeType("void const *") ByteBuffer paths, @NativeType("GLuint") int pathBase, @NativeType("GLenum") int fillMode, @NativeType("GLuint") int mask, @NativeType("GLenum") int coverMode, @NativeType("GLenum") int transformType, @NativeType("GLfloat const *") FloatBuffer transformValues) { + int numPaths = paths.remaining() / pathNameTypeToBytes(pathNameType); + if (CHECKS) { + check(transformValues, numPaths * transformTypeToElements(transformType)); + } + nglStencilThenCoverFillPathInstancedNV(numPaths, pathNameType, memAddress(paths), pathBase, fillMode, mask, coverMode, transformType, memAddress(transformValues)); + } + + // --- [ glStencilThenCoverStrokePathInstancedNV ] --- + + /** Unsafe version of: {@link #glStencilThenCoverStrokePathInstancedNV StencilThenCoverStrokePathInstancedNV} */ + public static native void nglStencilThenCoverStrokePathInstancedNV(int numPaths, int pathNameType, long paths, int pathBase, int reference, int mask, int coverMode, int transformType, long transformValues); + + /** + * @param pathNameType one of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_FLOAT FLOAT}{@link #GL_UTF8_NV UTF8_NV}{@link #GL_UTF16_NV UTF16_NV}{@link #GL_2_BYTES_NV 2_BYTES_NV}
{@link #GL_3_BYTES_NV 3_BYTES_NV}{@link #GL_4_BYTES_NV 4_BYTES_NV}
+ * @param coverMode one of:
{@link #GL_CONVEX_HULL_NV CONVEX_HULL_NV}{@link #GL_BOUNDING_BOX_NV BOUNDING_BOX_NV}{@link #GL_BOUNDING_BOX_OF_BOUNDING_BOXES_NV BOUNDING_BOX_OF_BOUNDING_BOXES_NV}
+ * @param transformType one of:
{@link #GL_TRANSLATE_X_NV TRANSLATE_X_NV}{@link #GL_TRANSLATE_Y_NV TRANSLATE_Y_NV}{@link #GL_TRANSLATE_2D_NV TRANSLATE_2D_NV}{@link #GL_TRANSLATE_3D_NV TRANSLATE_3D_NV}{@link #GL_AFFINE_2D_NV AFFINE_2D_NV}
{@link #GL_AFFINE_3D_NV AFFINE_3D_NV}{@link #GL_TRANSPOSE_AFFINE_2D_NV TRANSPOSE_AFFINE_2D_NV}{@link #GL_TRANSPOSE_AFFINE_3D_NV TRANSPOSE_AFFINE_3D_NV}
+ */ + public static void glStencilThenCoverStrokePathInstancedNV(@NativeType("GLenum") int pathNameType, @NativeType("void const *") ByteBuffer paths, @NativeType("GLuint") int pathBase, @NativeType("GLint") int reference, @NativeType("GLuint") int mask, @NativeType("GLenum") int coverMode, @NativeType("GLenum") int transformType, @NativeType("GLfloat const *") FloatBuffer transformValues) { + int numPaths = paths.remaining() / pathNameTypeToBytes(pathNameType); + if (CHECKS) { + check(transformValues, numPaths * transformTypeToElements(transformType)); + } + nglStencilThenCoverStrokePathInstancedNV(numPaths, pathNameType, memAddress(paths), pathBase, reference, mask, coverMode, transformType, memAddress(transformValues)); + } + + // --- [ glPathGlyphIndexRangeNV ] --- + + /** Unsafe version of: {@link #glPathGlyphIndexRangeNV PathGlyphIndexRangeNV} */ + public static native int nglPathGlyphIndexRangeNV(int fontTarget, long fontName, int fontStyle, int pathParameterTemplate, float emScale, int baseAndCount); + + /** + * @param fontTarget one of:
{@link #GL_STANDARD_FONT_NAME_NV STANDARD_FONT_NAME_NV}{@link #GL_SYSTEM_FONT_NAME_NV SYSTEM_FONT_NAME_NV}{@link #GL_FILE_NAME_NV FILE_NAME_NV}
+ * @param fontStyle one or more of:
{@link #GL_BOLD_BIT_NV BOLD_BIT_NV}{@link #GL_ITALIC_BIT_NV ITALIC_BIT_NV}
+ */ + @NativeType("GLenum") + public static int glPathGlyphIndexRangeNV(@NativeType("GLenum") int fontTarget, @NativeType("void const *") ByteBuffer fontName, @NativeType("GLbitfield") int fontStyle, @NativeType("GLuint") int pathParameterTemplate, @NativeType("GLfloat") float emScale, @NativeType("GLuint") int baseAndCount) { + if (CHECKS) { + checkNT1(fontName); + } + return nglPathGlyphIndexRangeNV(fontTarget, memAddress(fontName), fontStyle, pathParameterTemplate, emScale, baseAndCount); + } + + // --- [ glProgramPathFragmentInputGenNV ] --- + + public static native void nglProgramPathFragmentInputGenNV(int program, int location, int genMode, int components, long coeffs); + + public static void glProgramPathFragmentInputGenNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLenum") int genMode, @NativeType("GLint") int components, @NativeType("GLfloat const *") FloatBuffer coeffs) { + if (CHECKS) { + check(coeffs, genModeToElements(genMode) * components); + } + nglProgramPathFragmentInputGenNV(program, location, genMode, components, memAddress(coeffs)); + } + + // --- [ glGetPathParameterivNV ] --- + + /** Unsafe version of: {@link #glGetPathParameterivNV GetPathParameterivNV} */ + public static native void nglGetPathParameterivNV(int path, int pname, long value); + + /** @param pname one of:
{@link #GL_PATH_STROKE_WIDTH_NV PATH_STROKE_WIDTH_NV}{@link #GL_PATH_INITIAL_END_CAP_NV PATH_INITIAL_END_CAP_NV}{@link #GL_PATH_TERMINAL_END_CAP_NV PATH_TERMINAL_END_CAP_NV}
{@link #GL_PATH_JOIN_STYLE_NV PATH_JOIN_STYLE_NV}{@link #GL_PATH_MITER_LIMIT_NV PATH_MITER_LIMIT_NV}{@link #GL_PATH_INITIAL_DASH_CAP_NV PATH_INITIAL_DASH_CAP_NV}
{@link #GL_PATH_TERMINAL_DASH_CAP_NV PATH_TERMINAL_DASH_CAP_NV}{@link #GL_PATH_DASH_OFFSET_NV PATH_DASH_OFFSET_NV}{@link #GL_PATH_CLIENT_LENGTH_NV PATH_CLIENT_LENGTH_NV}
{@link #GL_PATH_DASH_OFFSET_RESET_NV PATH_DASH_OFFSET_RESET_NV}{@link #GL_PATH_FILL_MODE_NV PATH_FILL_MODE_NV}{@link #GL_PATH_FILL_MASK_NV PATH_FILL_MASK_NV}
{@link #GL_PATH_FILL_COVER_MODE_NV PATH_FILL_COVER_MODE_NV}{@link #GL_PATH_STROKE_COVER_MODE_NV PATH_STROKE_COVER_MODE_NV}{@link #GL_PATH_STROKE_MASK_NV PATH_STROKE_MASK_NV}
{@link #GL_PATH_STROKE_BOUND_NV PATH_STROKE_BOUND_NV}{@link #GL_PATH_COMMAND_COUNT_NV PATH_COMMAND_COUNT_NV}{@link #GL_PATH_COORD_COUNT_NV PATH_COORD_COUNT_NV}
{@link #GL_PATH_DASH_ARRAY_COUNT_NV PATH_DASH_ARRAY_COUNT_NV}{@link #GL_PATH_COMPUTED_LENGTH_NV PATH_COMPUTED_LENGTH_NV}{@link #GL_PATH_FILL_BOUNDING_BOX_NV PATH_FILL_BOUNDING_BOX_NV}
{@link #GL_PATH_STROKE_BOUNDING_BOX_NV PATH_STROKE_BOUNDING_BOX_NV}
*/ + public static void glGetPathParameterivNV(@NativeType("GLuint") int path, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nglGetPathParameterivNV(path, pname, memAddress(value)); + } + + /** @param pname one of:
{@link #GL_PATH_STROKE_WIDTH_NV PATH_STROKE_WIDTH_NV}{@link #GL_PATH_INITIAL_END_CAP_NV PATH_INITIAL_END_CAP_NV}{@link #GL_PATH_TERMINAL_END_CAP_NV PATH_TERMINAL_END_CAP_NV}
{@link #GL_PATH_JOIN_STYLE_NV PATH_JOIN_STYLE_NV}{@link #GL_PATH_MITER_LIMIT_NV PATH_MITER_LIMIT_NV}{@link #GL_PATH_INITIAL_DASH_CAP_NV PATH_INITIAL_DASH_CAP_NV}
{@link #GL_PATH_TERMINAL_DASH_CAP_NV PATH_TERMINAL_DASH_CAP_NV}{@link #GL_PATH_DASH_OFFSET_NV PATH_DASH_OFFSET_NV}{@link #GL_PATH_CLIENT_LENGTH_NV PATH_CLIENT_LENGTH_NV}
{@link #GL_PATH_DASH_OFFSET_RESET_NV PATH_DASH_OFFSET_RESET_NV}{@link #GL_PATH_FILL_MODE_NV PATH_FILL_MODE_NV}{@link #GL_PATH_FILL_MASK_NV PATH_FILL_MASK_NV}
{@link #GL_PATH_FILL_COVER_MODE_NV PATH_FILL_COVER_MODE_NV}{@link #GL_PATH_STROKE_COVER_MODE_NV PATH_STROKE_COVER_MODE_NV}{@link #GL_PATH_STROKE_MASK_NV PATH_STROKE_MASK_NV}
{@link #GL_PATH_STROKE_BOUND_NV PATH_STROKE_BOUND_NV}{@link #GL_PATH_COMMAND_COUNT_NV PATH_COMMAND_COUNT_NV}{@link #GL_PATH_COORD_COUNT_NV PATH_COORD_COUNT_NV}
{@link #GL_PATH_DASH_ARRAY_COUNT_NV PATH_DASH_ARRAY_COUNT_NV}{@link #GL_PATH_COMPUTED_LENGTH_NV PATH_COMPUTED_LENGTH_NV}{@link #GL_PATH_FILL_BOUNDING_BOX_NV PATH_FILL_BOUNDING_BOX_NV}
{@link #GL_PATH_STROKE_BOUNDING_BOX_NV PATH_STROKE_BOUNDING_BOX_NV}
*/ + @NativeType("void") + public static int glGetPathParameteriNV(@NativeType("GLuint") int path, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer value = stack.callocInt(1); + nglGetPathParameterivNV(path, pname, memAddress(value)); + return value.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetPathParameterfvNV ] --- + + /** Unsafe version of: {@link #glGetPathParameterfvNV GetPathParameterfvNV} */ + public static native void nglGetPathParameterfvNV(int path, int pname, long value); + + /** @param pname one of:
{@link #GL_PATH_STROKE_WIDTH_NV PATH_STROKE_WIDTH_NV}{@link #GL_PATH_INITIAL_END_CAP_NV PATH_INITIAL_END_CAP_NV}{@link #GL_PATH_TERMINAL_END_CAP_NV PATH_TERMINAL_END_CAP_NV}
{@link #GL_PATH_JOIN_STYLE_NV PATH_JOIN_STYLE_NV}{@link #GL_PATH_MITER_LIMIT_NV PATH_MITER_LIMIT_NV}{@link #GL_PATH_INITIAL_DASH_CAP_NV PATH_INITIAL_DASH_CAP_NV}
{@link #GL_PATH_TERMINAL_DASH_CAP_NV PATH_TERMINAL_DASH_CAP_NV}{@link #GL_PATH_DASH_OFFSET_NV PATH_DASH_OFFSET_NV}{@link #GL_PATH_CLIENT_LENGTH_NV PATH_CLIENT_LENGTH_NV}
{@link #GL_PATH_DASH_OFFSET_RESET_NV PATH_DASH_OFFSET_RESET_NV}{@link #GL_PATH_FILL_MODE_NV PATH_FILL_MODE_NV}{@link #GL_PATH_FILL_MASK_NV PATH_FILL_MASK_NV}
{@link #GL_PATH_FILL_COVER_MODE_NV PATH_FILL_COVER_MODE_NV}{@link #GL_PATH_STROKE_COVER_MODE_NV PATH_STROKE_COVER_MODE_NV}{@link #GL_PATH_STROKE_MASK_NV PATH_STROKE_MASK_NV}
{@link #GL_PATH_STROKE_BOUND_NV PATH_STROKE_BOUND_NV}{@link #GL_PATH_COMMAND_COUNT_NV PATH_COMMAND_COUNT_NV}{@link #GL_PATH_COORD_COUNT_NV PATH_COORD_COUNT_NV}
{@link #GL_PATH_DASH_ARRAY_COUNT_NV PATH_DASH_ARRAY_COUNT_NV}{@link #GL_PATH_COMPUTED_LENGTH_NV PATH_COMPUTED_LENGTH_NV}{@link #GL_PATH_FILL_BOUNDING_BOX_NV PATH_FILL_BOUNDING_BOX_NV}
{@link #GL_PATH_STROKE_BOUNDING_BOX_NV PATH_STROKE_BOUNDING_BOX_NV}
*/ + public static void glGetPathParameterfvNV(@NativeType("GLuint") int path, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer value) { + if (CHECKS) { + check(value, 1); + } + nglGetPathParameterfvNV(path, pname, memAddress(value)); + } + + /** @param pname one of:
{@link #GL_PATH_STROKE_WIDTH_NV PATH_STROKE_WIDTH_NV}{@link #GL_PATH_INITIAL_END_CAP_NV PATH_INITIAL_END_CAP_NV}{@link #GL_PATH_TERMINAL_END_CAP_NV PATH_TERMINAL_END_CAP_NV}
{@link #GL_PATH_JOIN_STYLE_NV PATH_JOIN_STYLE_NV}{@link #GL_PATH_MITER_LIMIT_NV PATH_MITER_LIMIT_NV}{@link #GL_PATH_INITIAL_DASH_CAP_NV PATH_INITIAL_DASH_CAP_NV}
{@link #GL_PATH_TERMINAL_DASH_CAP_NV PATH_TERMINAL_DASH_CAP_NV}{@link #GL_PATH_DASH_OFFSET_NV PATH_DASH_OFFSET_NV}{@link #GL_PATH_CLIENT_LENGTH_NV PATH_CLIENT_LENGTH_NV}
{@link #GL_PATH_DASH_OFFSET_RESET_NV PATH_DASH_OFFSET_RESET_NV}{@link #GL_PATH_FILL_MODE_NV PATH_FILL_MODE_NV}{@link #GL_PATH_FILL_MASK_NV PATH_FILL_MASK_NV}
{@link #GL_PATH_FILL_COVER_MODE_NV PATH_FILL_COVER_MODE_NV}{@link #GL_PATH_STROKE_COVER_MODE_NV PATH_STROKE_COVER_MODE_NV}{@link #GL_PATH_STROKE_MASK_NV PATH_STROKE_MASK_NV}
{@link #GL_PATH_STROKE_BOUND_NV PATH_STROKE_BOUND_NV}{@link #GL_PATH_COMMAND_COUNT_NV PATH_COMMAND_COUNT_NV}{@link #GL_PATH_COORD_COUNT_NV PATH_COORD_COUNT_NV}
{@link #GL_PATH_DASH_ARRAY_COUNT_NV PATH_DASH_ARRAY_COUNT_NV}{@link #GL_PATH_COMPUTED_LENGTH_NV PATH_COMPUTED_LENGTH_NV}{@link #GL_PATH_FILL_BOUNDING_BOX_NV PATH_FILL_BOUNDING_BOX_NV}
{@link #GL_PATH_STROKE_BOUNDING_BOX_NV PATH_STROKE_BOUNDING_BOX_NV}
*/ + @NativeType("void") + public static float glGetPathParameterfNV(@NativeType("GLuint") int path, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer value = stack.callocFloat(1); + nglGetPathParameterfvNV(path, pname, memAddress(value)); + return value.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetPathCommandsNV ] --- + + public static native void nglGetPathCommandsNV(int path, long commands); + + public static void glGetPathCommandsNV(@NativeType("GLuint") int path, @NativeType("GLubyte *") ByteBuffer commands) { + if (CHECKS) { + if (DEBUG) { + check(commands, glGetPathParameteriNV(path, GL_PATH_COMMAND_COUNT_NV)); + } + } + nglGetPathCommandsNV(path, memAddress(commands)); + } + + // --- [ glGetPathCoordsNV ] --- + + public static native void nglGetPathCoordsNV(int path, long coords); + + public static void glGetPathCoordsNV(@NativeType("GLuint") int path, @NativeType("GLfloat *") FloatBuffer coords) { + if (CHECKS) { + if (DEBUG) { + check(coords, glGetPathParameteriNV(path, GL_PATH_COORD_COUNT_NV)); + } + } + nglGetPathCoordsNV(path, memAddress(coords)); + } + + // --- [ glGetPathDashArrayNV ] --- + + public static native void nglGetPathDashArrayNV(int path, long dashArray); + + public static void glGetPathDashArrayNV(@NativeType("GLuint") int path, @NativeType("GLfloat *") FloatBuffer dashArray) { + if (CHECKS) { + if (DEBUG) { + check(dashArray, glGetPathParameteriNV(path, GL_PATH_DASH_ARRAY_COUNT_NV)); + } + } + nglGetPathDashArrayNV(path, memAddress(dashArray)); + } + + // --- [ glGetPathMetricsNV ] --- + + /** Unsafe version of: {@link #glGetPathMetricsNV GetPathMetricsNV} */ + public static native void nglGetPathMetricsNV(int metricQueryMask, int numPaths, int pathNameType, long paths, int pathBase, int stride, long metrics); + + /** + * @param metricQueryMask one or more of:
{@link #GL_GLYPH_WIDTH_BIT_NV GLYPH_WIDTH_BIT_NV}{@link #GL_GLYPH_HEIGHT_BIT_NV GLYPH_HEIGHT_BIT_NV}
{@link #GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV GLYPH_HORIZONTAL_BEARING_X_BIT_NV}{@link #GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV GLYPH_HORIZONTAL_BEARING_Y_BIT_NV}
{@link #GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV}{@link #GL_GLYPH_VERTICAL_BEARING_X_BIT_NV GLYPH_VERTICAL_BEARING_X_BIT_NV}
{@link #GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV GLYPH_VERTICAL_BEARING_Y_BIT_NV}{@link #GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV}
{@link #GL_GLYPH_HAS_KERNING_BIT_NV GLYPH_HAS_KERNING_BIT_NV}{@link #GL_FONT_X_MIN_BOUNDS_BIT_NV FONT_X_MIN_BOUNDS_BIT_NV}
{@link #GL_FONT_Y_MIN_BOUNDS_BIT_NV FONT_Y_MIN_BOUNDS_BIT_NV}{@link #GL_FONT_X_MAX_BOUNDS_BIT_NV FONT_X_MAX_BOUNDS_BIT_NV}
{@link #GL_FONT_Y_MAX_BOUNDS_BIT_NV FONT_Y_MAX_BOUNDS_BIT_NV}{@link #GL_FONT_UNITS_PER_EM_BIT_NV FONT_UNITS_PER_EM_BIT_NV}
{@link #GL_FONT_ASCENDER_BIT_NV FONT_ASCENDER_BIT_NV}{@link #GL_FONT_DESCENDER_BIT_NV FONT_DESCENDER_BIT_NV}
{@link #GL_FONT_HEIGHT_BIT_NV FONT_HEIGHT_BIT_NV}{@link #GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV FONT_MAX_ADVANCE_WIDTH_BIT_NV}
{@link #GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV FONT_MAX_ADVANCE_HEIGHT_BIT_NV}{@link #GL_FONT_UNDERLINE_POSITION_BIT_NV FONT_UNDERLINE_POSITION_BIT_NV}
{@link #GL_FONT_UNDERLINE_THICKNESS_BIT_NV FONT_UNDERLINE_THICKNESS_BIT_NV}{@link #GL_FONT_HAS_KERNING_BIT_NV FONT_HAS_KERNING_BIT_NV}
{@link #GL_FONT_NUM_GLYPH_INDICES_BIT_NV FONT_NUM_GLYPH_INDICES_BIT_NV}
+ * @param pathNameType one of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_FLOAT FLOAT}{@link #GL_UTF8_NV UTF8_NV}{@link #GL_UTF16_NV UTF16_NV}{@link #GL_2_BYTES_NV 2_BYTES_NV}
{@link #GL_3_BYTES_NV 3_BYTES_NV}{@link #GL_4_BYTES_NV 4_BYTES_NV}
+ */ + public static void glGetPathMetricsNV(@NativeType("GLbitfield") int metricQueryMask, @NativeType("GLenum") int pathNameType, @NativeType("void const *") ByteBuffer paths, @NativeType("GLuint") int pathBase, @NativeType("GLsizei") int stride, @NativeType("GLfloat *") FloatBuffer metrics) { + int numPaths = paths.remaining() / pathNameTypeToBytes(pathNameType); + if (CHECKS) { + check(metrics, numPaths * (stride == 0 ? Integer.bitCount(metricQueryMask) : (stride >> 2))); + } + nglGetPathMetricsNV(metricQueryMask, numPaths, pathNameType, memAddress(paths), pathBase, stride, memAddress(metrics)); + } + + // --- [ glGetPathMetricRangeNV ] --- + + /** Unsafe version of: {@link #glGetPathMetricRangeNV GetPathMetricRangeNV} */ + public static native void nglGetPathMetricRangeNV(int metricQueryMask, int firstPathName, int numPaths, int stride, long metrics); + + /** @param metricQueryMask one or more of:
{@link #GL_GLYPH_WIDTH_BIT_NV GLYPH_WIDTH_BIT_NV}{@link #GL_GLYPH_HEIGHT_BIT_NV GLYPH_HEIGHT_BIT_NV}
{@link #GL_GLYPH_HORIZONTAL_BEARING_X_BIT_NV GLYPH_HORIZONTAL_BEARING_X_BIT_NV}{@link #GL_GLYPH_HORIZONTAL_BEARING_Y_BIT_NV GLYPH_HORIZONTAL_BEARING_Y_BIT_NV}
{@link #GL_GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV GLYPH_HORIZONTAL_BEARING_ADVANCE_BIT_NV}{@link #GL_GLYPH_VERTICAL_BEARING_X_BIT_NV GLYPH_VERTICAL_BEARING_X_BIT_NV}
{@link #GL_GLYPH_VERTICAL_BEARING_Y_BIT_NV GLYPH_VERTICAL_BEARING_Y_BIT_NV}{@link #GL_GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV GLYPH_VERTICAL_BEARING_ADVANCE_BIT_NV}
{@link #GL_GLYPH_HAS_KERNING_BIT_NV GLYPH_HAS_KERNING_BIT_NV}{@link #GL_FONT_X_MIN_BOUNDS_BIT_NV FONT_X_MIN_BOUNDS_BIT_NV}
{@link #GL_FONT_Y_MIN_BOUNDS_BIT_NV FONT_Y_MIN_BOUNDS_BIT_NV}{@link #GL_FONT_X_MAX_BOUNDS_BIT_NV FONT_X_MAX_BOUNDS_BIT_NV}
{@link #GL_FONT_Y_MAX_BOUNDS_BIT_NV FONT_Y_MAX_BOUNDS_BIT_NV}{@link #GL_FONT_UNITS_PER_EM_BIT_NV FONT_UNITS_PER_EM_BIT_NV}
{@link #GL_FONT_ASCENDER_BIT_NV FONT_ASCENDER_BIT_NV}{@link #GL_FONT_DESCENDER_BIT_NV FONT_DESCENDER_BIT_NV}
{@link #GL_FONT_HEIGHT_BIT_NV FONT_HEIGHT_BIT_NV}{@link #GL_FONT_MAX_ADVANCE_WIDTH_BIT_NV FONT_MAX_ADVANCE_WIDTH_BIT_NV}
{@link #GL_FONT_MAX_ADVANCE_HEIGHT_BIT_NV FONT_MAX_ADVANCE_HEIGHT_BIT_NV}{@link #GL_FONT_UNDERLINE_POSITION_BIT_NV FONT_UNDERLINE_POSITION_BIT_NV}
{@link #GL_FONT_UNDERLINE_THICKNESS_BIT_NV FONT_UNDERLINE_THICKNESS_BIT_NV}{@link #GL_FONT_HAS_KERNING_BIT_NV FONT_HAS_KERNING_BIT_NV}
{@link #GL_FONT_NUM_GLYPH_INDICES_BIT_NV FONT_NUM_GLYPH_INDICES_BIT_NV}
*/ + public static void glGetPathMetricRangeNV(@NativeType("GLbitfield") int metricQueryMask, @NativeType("GLuint") int firstPathName, @NativeType("GLsizei") int numPaths, @NativeType("GLsizei") int stride, @NativeType("GLfloat *") FloatBuffer metrics) { + if (CHECKS) { + check(metrics, numPaths * (stride == 0 ? Integer.bitCount(metricQueryMask) : (stride >> 2))); + } + nglGetPathMetricRangeNV(metricQueryMask, firstPathName, numPaths, stride, memAddress(metrics)); + } + + // --- [ glGetPathSpacingNV ] --- + + /** Unsafe version of: {@link #glGetPathSpacingNV GetPathSpacingNV} */ + public static native void nglGetPathSpacingNV(int pathListMode, int numPaths, int pathNameType, long paths, int pathBase, float advanceScale, float kerningScale, int transformType, long returnedSpacing); + + /** + * @param pathListMode one of:
{@link #GL_ACCUM_ADJACENT_PAIRS_NV ACCUM_ADJACENT_PAIRS_NV}{@link #GL_ADJACENT_PAIRS_NV ADJACENT_PAIRS_NV}{@link #GL_FIRST_TO_REST_NV FIRST_TO_REST_NV}
+ * @param pathNameType one of:
{@link GL11#GL_BYTE BYTE}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}{@link GL11#GL_SHORT SHORT}{@link GL11#GL_UNSIGNED_SHORT UNSIGNED_SHORT}{@link GL11#GL_INT INT}{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_FLOAT FLOAT}{@link #GL_UTF8_NV UTF8_NV}{@link #GL_UTF16_NV UTF16_NV}{@link #GL_2_BYTES_NV 2_BYTES_NV}
{@link #GL_3_BYTES_NV 3_BYTES_NV}{@link #GL_4_BYTES_NV 4_BYTES_NV}
+ * @param transformType one of:
{@link #GL_TRANSLATE_X_NV TRANSLATE_X_NV}{@link #GL_TRANSLATE_2D_NV TRANSLATE_2D_NV}
+ */ + public static void glGetPathSpacingNV(@NativeType("GLenum") int pathListMode, @NativeType("GLenum") int pathNameType, @NativeType("void const *") ByteBuffer paths, @NativeType("GLuint") int pathBase, @NativeType("GLfloat") float advanceScale, @NativeType("GLfloat") float kerningScale, @NativeType("GLenum") int transformType, @NativeType("GLfloat *") FloatBuffer returnedSpacing) { + int numPaths = paths.remaining() / pathNameTypeToBytes(pathNameType); + if (CHECKS) { + check(returnedSpacing, (numPaths - 1) * (transformType == GL_TRANSLATE_X_NV ? 1 : 2)); + } + nglGetPathSpacingNV(pathListMode, numPaths, pathNameType, memAddress(paths), pathBase, advanceScale, kerningScale, transformType, memAddress(returnedSpacing)); + } + + // --- [ glGetPathColorGenivNV ] --- + + /** Unsafe version of: {@link #glGetPathColorGenivNV GetPathColorGenivNV} */ + public static native void nglGetPathColorGenivNV(int color, int pname, long value); + + /** + * @param color one of:
{@link GL13#GL_PRIMARY_COLOR PRIMARY_COLOR}{@link #GL_PRIMARY_COLOR_NV PRIMARY_COLOR_NV}{@link #GL_SECONDARY_COLOR_NV SECONDARY_COLOR_NV}
+ * @param pname one of:
{@link #GL_PATH_GEN_MODE_NV PATH_GEN_MODE_NV}{@link #GL_PATH_GEN_COEFF_NV PATH_GEN_COEFF_NV}{@link #GL_PATH_GEN_COLOR_FORMAT_NV PATH_GEN_COLOR_FORMAT_NV}
+ */ + public static void glGetPathColorGenivNV(@NativeType("GLenum") int color, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nglGetPathColorGenivNV(color, pname, memAddress(value)); + } + + /** + * @param color one of:
{@link GL13#GL_PRIMARY_COLOR PRIMARY_COLOR}{@link #GL_PRIMARY_COLOR_NV PRIMARY_COLOR_NV}{@link #GL_SECONDARY_COLOR_NV SECONDARY_COLOR_NV}
+ * @param pname one of:
{@link #GL_PATH_GEN_MODE_NV PATH_GEN_MODE_NV}{@link #GL_PATH_GEN_COEFF_NV PATH_GEN_COEFF_NV}{@link #GL_PATH_GEN_COLOR_FORMAT_NV PATH_GEN_COLOR_FORMAT_NV}
+ */ + @NativeType("void") + public static int glGetPathColorGeniNV(@NativeType("GLenum") int color, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer value = stack.callocInt(1); + nglGetPathColorGenivNV(color, pname, memAddress(value)); + return value.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetPathColorGenfvNV ] --- + + /** Unsafe version of: {@link #glGetPathColorGenfvNV GetPathColorGenfvNV} */ + public static native void nglGetPathColorGenfvNV(int color, int pname, long value); + + /** + * @param color one of:
{@link GL13#GL_PRIMARY_COLOR PRIMARY_COLOR}{@link #GL_PRIMARY_COLOR_NV PRIMARY_COLOR_NV}{@link #GL_SECONDARY_COLOR_NV SECONDARY_COLOR_NV}
+ * @param pname one of:
{@link #GL_PATH_GEN_MODE_NV PATH_GEN_MODE_NV}{@link #GL_PATH_GEN_COEFF_NV PATH_GEN_COEFF_NV}{@link #GL_PATH_GEN_COLOR_FORMAT_NV PATH_GEN_COLOR_FORMAT_NV}
+ */ + public static void glGetPathColorGenfvNV(@NativeType("GLenum") int color, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer value) { + if (CHECKS) { + check(value, 1); + } + nglGetPathColorGenfvNV(color, pname, memAddress(value)); + } + + /** + * @param color one of:
{@link GL13#GL_PRIMARY_COLOR PRIMARY_COLOR}{@link #GL_PRIMARY_COLOR_NV PRIMARY_COLOR_NV}{@link #GL_SECONDARY_COLOR_NV SECONDARY_COLOR_NV}
+ * @param pname one of:
{@link #GL_PATH_GEN_MODE_NV PATH_GEN_MODE_NV}{@link #GL_PATH_GEN_COEFF_NV PATH_GEN_COEFF_NV}{@link #GL_PATH_GEN_COLOR_FORMAT_NV PATH_GEN_COLOR_FORMAT_NV}
+ */ + @NativeType("void") + public static float glGetPathColorGenfNV(@NativeType("GLenum") int color, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer value = stack.callocFloat(1); + nglGetPathColorGenfvNV(color, pname, memAddress(value)); + return value.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetPathTexGenivNV ] --- + + /** Unsafe version of: {@link #glGetPathTexGenivNV GetPathTexGenivNV} */ + public static native void nglGetPathTexGenivNV(int texCoordSet, int pname, long value); + + /** @param pname {@link #GL_PATH_GEN_MODE_NV PATH_GEN_MODE_NV} {@link #GL_PATH_GEN_COEFF_NV PATH_GEN_COEFF_NV} {@link #GL_PATH_GEN_COMPONENTS_NV PATH_GEN_COMPONENTS_NV} */ + public static void glGetPathTexGenivNV(@NativeType("GLenum") int texCoordSet, @NativeType("GLenum") int pname, @NativeType("GLint *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + nglGetPathTexGenivNV(texCoordSet, pname, memAddress(value)); + } + + /** @param pname {@link #GL_PATH_GEN_MODE_NV PATH_GEN_MODE_NV} {@link #GL_PATH_GEN_COEFF_NV PATH_GEN_COEFF_NV} {@link #GL_PATH_GEN_COMPONENTS_NV PATH_GEN_COMPONENTS_NV} */ + @NativeType("void") + public static int glGetPathTexGeniNV(@NativeType("GLenum") int texCoordSet, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer value = stack.callocInt(1); + nglGetPathTexGenivNV(texCoordSet, pname, memAddress(value)); + return value.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetPathTexGenfvNV ] --- + + /** Unsafe version of: {@link #glGetPathTexGenfvNV GetPathTexGenfvNV} */ + public static native void nglGetPathTexGenfvNV(int texCoordSet, int pname, long value); + + /** @param pname {@link #GL_PATH_GEN_MODE_NV PATH_GEN_MODE_NV} {@link #GL_PATH_GEN_COEFF_NV PATH_GEN_COEFF_NV} {@link #GL_PATH_GEN_COMPONENTS_NV PATH_GEN_COMPONENTS_NV} */ + public static void glGetPathTexGenfvNV(@NativeType("GLenum") int texCoordSet, @NativeType("GLenum") int pname, @NativeType("GLfloat *") FloatBuffer value) { + if (CHECKS) { + check(value, 1); + } + nglGetPathTexGenfvNV(texCoordSet, pname, memAddress(value)); + } + + /** @param pname {@link #GL_PATH_GEN_MODE_NV PATH_GEN_MODE_NV} {@link #GL_PATH_GEN_COEFF_NV PATH_GEN_COEFF_NV} {@link #GL_PATH_GEN_COMPONENTS_NV PATH_GEN_COMPONENTS_NV} */ + @NativeType("void") + public static float glGetPathTexGenfNV(@NativeType("GLenum") int texCoordSet, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + FloatBuffer value = stack.callocFloat(1); + nglGetPathTexGenfvNV(texCoordSet, pname, memAddress(value)); + return value.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glIsPointInFillPathNV ] --- + + @NativeType("GLboolean") + public static native boolean glIsPointInFillPathNV(@NativeType("GLuint") int path, @NativeType("GLuint") int mask, @NativeType("GLfloat") float x, @NativeType("GLfloat") float y); + + // --- [ glIsPointInStrokePathNV ] --- + + @NativeType("GLboolean") + public static native boolean glIsPointInStrokePathNV(@NativeType("GLuint") int path, @NativeType("GLfloat") float x, @NativeType("GLfloat") float y); + + // --- [ glGetPathLengthNV ] --- + + @NativeType("GLfloat") + public static native float glGetPathLengthNV(@NativeType("GLuint") int path, @NativeType("GLsizei") int startSegment, @NativeType("GLsizei") int numSegments); + + // --- [ glPointAlongPathNV ] --- + + public static native boolean nglPointAlongPathNV(int path, int startSegment, int numSegments, float distance, long x, long y, long tangentX, long tangentY); + + @NativeType("GLboolean") + public static boolean glPointAlongPathNV(@NativeType("GLuint") int path, @NativeType("GLsizei") int startSegment, @NativeType("GLsizei") int numSegments, @NativeType("GLfloat") float distance, @Nullable @NativeType("GLfloat *") FloatBuffer x, @Nullable @NativeType("GLfloat *") FloatBuffer y, @Nullable @NativeType("GLfloat *") FloatBuffer tangentX, @Nullable @NativeType("GLfloat *") FloatBuffer tangentY) { + if (CHECKS) { + checkSafe(x, 1); + checkSafe(y, 1); + checkSafe(tangentX, 1); + checkSafe(tangentY, 1); + } + return nglPointAlongPathNV(path, startSegment, numSegments, distance, memAddressSafe(x), memAddressSafe(y), memAddressSafe(tangentX), memAddressSafe(tangentY)); + } + + // --- [ glMatrixLoad3x2fNV ] --- + + /** Unsafe version of: {@link #glMatrixLoad3x2fNV MatrixLoad3x2fNV} */ + public static native void nglMatrixLoad3x2fNV(int matrixMode, long m); + + /** @param matrixMode one of:
{@link #GL_PATH_PROJECTION_NV PATH_PROJECTION_NV}{@link #GL_PATH_MODELVIEW_NV PATH_MODELVIEW_NV}
*/ + public static void glMatrixLoad3x2fNV(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat const *") FloatBuffer m) { + if (CHECKS) { + check(m, 6); + } + nglMatrixLoad3x2fNV(matrixMode, memAddress(m)); + } + + // --- [ glMatrixLoad3x3fNV ] --- + + /** Unsafe version of: {@link #glMatrixLoad3x3fNV MatrixLoad3x3fNV} */ + public static native void nglMatrixLoad3x3fNV(int matrixMode, long m); + + /** @param matrixMode one of:
{@link #GL_PATH_PROJECTION_NV PATH_PROJECTION_NV}{@link #GL_PATH_MODELVIEW_NV PATH_MODELVIEW_NV}
*/ + public static void glMatrixLoad3x3fNV(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat const *") FloatBuffer m) { + if (CHECKS) { + check(m, 9); + } + nglMatrixLoad3x3fNV(matrixMode, memAddress(m)); + } + + // --- [ glMatrixLoadTranspose3x3fNV ] --- + + /** Unsafe version of: {@link #glMatrixLoadTranspose3x3fNV MatrixLoadTranspose3x3fNV} */ + public static native void nglMatrixLoadTranspose3x3fNV(int matrixMode, long m); + + /** @param matrixMode one of:
{@link #GL_PATH_PROJECTION_NV PATH_PROJECTION_NV}{@link #GL_PATH_MODELVIEW_NV PATH_MODELVIEW_NV}
*/ + public static void glMatrixLoadTranspose3x3fNV(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat const *") FloatBuffer m) { + if (CHECKS) { + check(m, 9); + } + nglMatrixLoadTranspose3x3fNV(matrixMode, memAddress(m)); + } + + // --- [ glMatrixMult3x2fNV ] --- + + /** Unsafe version of: {@link #glMatrixMult3x2fNV MatrixMult3x2fNV} */ + public static native void nglMatrixMult3x2fNV(int matrixMode, long m); + + /** @param matrixMode one of:
{@link #GL_PATH_PROJECTION_NV PATH_PROJECTION_NV}{@link #GL_PATH_MODELVIEW_NV PATH_MODELVIEW_NV}
*/ + public static void glMatrixMult3x2fNV(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat const *") FloatBuffer m) { + if (CHECKS) { + check(m, 6); + } + nglMatrixMult3x2fNV(matrixMode, memAddress(m)); + } + + // --- [ glMatrixMult3x3fNV ] --- + + /** Unsafe version of: {@link #glMatrixMult3x3fNV MatrixMult3x3fNV} */ + public static native void nglMatrixMult3x3fNV(int matrixMode, long m); + + /** @param matrixMode one of:
{@link #GL_PATH_PROJECTION_NV PATH_PROJECTION_NV}{@link #GL_PATH_MODELVIEW_NV PATH_MODELVIEW_NV}
*/ + public static void glMatrixMult3x3fNV(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat const *") FloatBuffer m) { + if (CHECKS) { + check(m, 9); + } + nglMatrixMult3x3fNV(matrixMode, memAddress(m)); + } + + // --- [ glMatrixMultTranspose3x3fNV ] --- + + /** Unsafe version of: {@link #glMatrixMultTranspose3x3fNV MatrixMultTranspose3x3fNV} */ + public static native void nglMatrixMultTranspose3x3fNV(int matrixMode, long m); + + /** @param matrixMode one of:
{@link #GL_PATH_PROJECTION_NV PATH_PROJECTION_NV}{@link #GL_PATH_MODELVIEW_NV PATH_MODELVIEW_NV}
*/ + public static void glMatrixMultTranspose3x3fNV(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat const *") FloatBuffer m) { + if (CHECKS) { + check(m, 9); + } + nglMatrixMultTranspose3x3fNV(matrixMode, memAddress(m)); + } + + // --- [ glGetProgramResourcefvNV ] --- + + public static native void nglGetProgramResourcefvNV(int program, int programInterface, int index, int propCount, long props, int bufSize, long length, long params); + + public static void glGetProgramResourcefvNV(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLuint") int index, @NativeType("GLenum const *") IntBuffer props, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLfloat *") FloatBuffer params) { + if (CHECKS) { + checkSafe(length, 1); + } + nglGetProgramResourcefvNV(program, programInterface, index, props.remaining(), memAddress(props), params.remaining(), memAddressSafe(length), memAddress(params)); + } + + /** Array version of: {@link #glPathCommandsNV PathCommandsNV} */ + public static void glPathCommandsNV(@NativeType("GLuint") int path, @NativeType("GLubyte const *") ByteBuffer commands, @NativeType("GLenum") int coordType, @NativeType("void const *") short[] coords) { + long __functionAddress = GL.getICD().glPathCommandsNV; + if (CHECKS) { + check(__functionAddress); + } + callPPV(path, commands.remaining(), memAddress(commands), coords.length, coordType, coords, __functionAddress); + } + + /** Array version of: {@link #glPathCommandsNV PathCommandsNV} */ + public static void glPathCommandsNV(@NativeType("GLuint") int path, @NativeType("GLubyte const *") ByteBuffer commands, @NativeType("GLenum") int coordType, @NativeType("void const *") float[] coords) { + long __functionAddress = GL.getICD().glPathCommandsNV; + if (CHECKS) { + check(__functionAddress); + } + callPPV(path, commands.remaining(), memAddress(commands), coords.length, coordType, coords, __functionAddress); + } + + /** Array version of: {@link #glPathCoordsNV PathCoordsNV} */ + public static void glPathCoordsNV(@NativeType("GLuint") int path, @NativeType("GLenum") int coordType, @NativeType("void const *") short[] coords) { + long __functionAddress = GL.getICD().glPathCoordsNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(path, coords.length, coordType, coords, __functionAddress); + } + + /** Array version of: {@link #glPathCoordsNV PathCoordsNV} */ + public static void glPathCoordsNV(@NativeType("GLuint") int path, @NativeType("GLenum") int coordType, @NativeType("void const *") float[] coords) { + long __functionAddress = GL.getICD().glPathCoordsNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(path, coords.length, coordType, coords, __functionAddress); + } + + /** Array version of: {@link #glPathSubCommandsNV PathSubCommandsNV} */ + public static void glPathSubCommandsNV(@NativeType("GLuint") int path, @NativeType("GLsizei") int commandStart, @NativeType("GLsizei") int commandsToDelete, @NativeType("GLubyte const *") ByteBuffer commands, @NativeType("GLenum") int coordType, @NativeType("void const *") short[] coords) { + long __functionAddress = GL.getICD().glPathSubCommandsNV; + if (CHECKS) { + check(__functionAddress); + } + callPPV(path, commandStart, commandsToDelete, commands.remaining(), memAddress(commands), coords.length, coordType, coords, __functionAddress); + } + + /** Array version of: {@link #glPathSubCommandsNV PathSubCommandsNV} */ + public static void glPathSubCommandsNV(@NativeType("GLuint") int path, @NativeType("GLsizei") int commandStart, @NativeType("GLsizei") int commandsToDelete, @NativeType("GLubyte const *") ByteBuffer commands, @NativeType("GLenum") int coordType, @NativeType("void const *") float[] coords) { + long __functionAddress = GL.getICD().glPathSubCommandsNV; + if (CHECKS) { + check(__functionAddress); + } + callPPV(path, commandStart, commandsToDelete, commands.remaining(), memAddress(commands), coords.length, coordType, coords, __functionAddress); + } + + /** Array version of: {@link #glPathSubCoordsNV PathSubCoordsNV} */ + public static void glPathSubCoordsNV(@NativeType("GLuint") int path, @NativeType("GLsizei") int coordStart, @NativeType("GLenum") int coordType, @NativeType("void const *") short[] coords) { + long __functionAddress = GL.getICD().glPathSubCoordsNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(path, coordStart, coords.length, coordType, coords, __functionAddress); + } + + /** Array version of: {@link #glPathSubCoordsNV PathSubCoordsNV} */ + public static void glPathSubCoordsNV(@NativeType("GLuint") int path, @NativeType("GLsizei") int coordStart, @NativeType("GLenum") int coordType, @NativeType("void const *") float[] coords) { + long __functionAddress = GL.getICD().glPathSubCoordsNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(path, coordStart, coords.length, coordType, coords, __functionAddress); + } + + /** Array version of: {@link #glWeightPathsNV WeightPathsNV} */ + public static void glWeightPathsNV(@NativeType("GLuint") int resultPath, @NativeType("GLuint const *") int[] paths, @NativeType("GLfloat const *") float[] weights) { + long __functionAddress = GL.getICD().glWeightPathsNV; + if (CHECKS) { + check(__functionAddress); + check(weights, paths.length); + } + callPPV(resultPath, paths.length, paths, weights, __functionAddress); + } + + /** Array version of: {@link #glTransformPathNV TransformPathNV} */ + public static void glTransformPathNV(@NativeType("GLuint") int resultPath, @NativeType("GLuint") int srcPath, @NativeType("GLenum") int transformType, @NativeType("GLfloat const *") float[] transformValues) { + long __functionAddress = GL.getICD().glTransformPathNV; + if (CHECKS) { + check(__functionAddress); + check(transformValues, transformTypeToElements(transformType)); + } + callPV(resultPath, srcPath, transformType, transformValues, __functionAddress); + } + + /** Array version of: {@link #glPathParameterivNV PathParameterivNV} */ + public static void glPathParameterivNV(@NativeType("GLuint") int path, @NativeType("GLenum") int pname, @NativeType("GLint const *") int[] value) { + long __functionAddress = GL.getICD().glPathParameterivNV; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + callPV(path, pname, value, __functionAddress); + } + + /** Array version of: {@link #glPathParameterfvNV PathParameterfvNV} */ + public static void glPathParameterfvNV(@NativeType("GLuint") int path, @NativeType("GLenum") int pname, @NativeType("GLfloat const *") float[] value) { + long __functionAddress = GL.getICD().glPathParameterfvNV; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + callPV(path, pname, value, __functionAddress); + } + + /** Array version of: {@link #glPathDashArrayNV PathDashArrayNV} */ + public static void glPathDashArrayNV(@NativeType("GLuint") int path, @NativeType("GLfloat const *") float[] dashArray) { + long __functionAddress = GL.getICD().glPathDashArrayNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(path, dashArray.length, dashArray, __functionAddress); + } + + /** Array version of: {@link #glStencilFillPathInstancedNV StencilFillPathInstancedNV} */ + public static void glStencilFillPathInstancedNV(@NativeType("GLenum") int pathNameType, @NativeType("void const *") ByteBuffer paths, @NativeType("GLuint") int pathBase, @NativeType("GLenum") int fillMode, @NativeType("GLuint") int mask, @NativeType("GLenum") int transformType, @NativeType("GLfloat const *") float[] transformValues) { + long __functionAddress = GL.getICD().glStencilFillPathInstancedNV; + int numPaths = paths.remaining() / pathNameTypeToBytes(pathNameType); + if (CHECKS) { + check(__functionAddress); + check(transformValues, numPaths * transformTypeToElements(transformType)); + } + callPPV(numPaths, pathNameType, memAddress(paths), pathBase, fillMode, mask, transformType, transformValues, __functionAddress); + } + + /** Array version of: {@link #glStencilStrokePathInstancedNV StencilStrokePathInstancedNV} */ + public static void glStencilStrokePathInstancedNV(@NativeType("GLenum") int pathNameType, @NativeType("void const *") ByteBuffer paths, @NativeType("GLuint") int pathBase, @NativeType("GLint") int reference, @NativeType("GLuint") int mask, @NativeType("GLenum") int transformType, @NativeType("GLfloat const *") float[] transformValues) { + long __functionAddress = GL.getICD().glStencilStrokePathInstancedNV; + int numPaths = paths.remaining() / pathNameTypeToBytes(pathNameType); + if (CHECKS) { + check(__functionAddress); + check(transformValues, numPaths * transformTypeToElements(transformType)); + } + callPPV(numPaths, pathNameType, memAddress(paths), pathBase, reference, mask, transformType, transformValues, __functionAddress); + } + + /** Array version of: {@link #glPathColorGenNV PathColorGenNV} */ + public static void glPathColorGenNV(@NativeType("GLenum") int color, @NativeType("GLenum") int genMode, @NativeType("GLenum") int colorFormat, @NativeType("GLfloat const *") float[] coeffs) { + long __functionAddress = GL.getICD().glPathColorGenNV; + if (CHECKS) { + check(__functionAddress); + check(coeffs, genModeToElements(genMode) * colorFormatToComponents(colorFormat)); + } + callPV(color, genMode, colorFormat, coeffs, __functionAddress); + } + + /** Array version of: {@link #glPathTexGenNV PathTexGenNV} */ + public static void glPathTexGenNV(@NativeType("GLenum") int texCoordSet, @NativeType("GLenum") int genMode, @NativeType("GLint") int components, @NativeType("GLfloat const *") float[] coeffs) { + long __functionAddress = GL.getICD().glPathTexGenNV; + if (CHECKS) { + check(__functionAddress); + check(coeffs, genModeToElements(genMode) * components); + } + callPV(texCoordSet, genMode, components, coeffs, __functionAddress); + } + + /** Array version of: {@link #glCoverFillPathInstancedNV CoverFillPathInstancedNV} */ + public static void glCoverFillPathInstancedNV(@NativeType("GLenum") int pathNameType, @NativeType("void const *") ByteBuffer paths, @NativeType("GLuint") int pathBase, @NativeType("GLenum") int coverMode, @NativeType("GLenum") int transformType, @NativeType("GLfloat const *") float[] transformValues) { + long __functionAddress = GL.getICD().glCoverFillPathInstancedNV; + int numPaths = paths.remaining() / pathNameTypeToBytes(pathNameType); + if (CHECKS) { + check(__functionAddress); + check(transformValues, numPaths * transformTypeToElements(transformType)); + } + callPPV(numPaths, pathNameType, memAddress(paths), pathBase, coverMode, transformType, transformValues, __functionAddress); + } + + /** Array version of: {@link #glCoverStrokePathInstancedNV CoverStrokePathInstancedNV} */ + public static void glCoverStrokePathInstancedNV(@NativeType("GLenum") int pathNameType, @NativeType("void const *") ByteBuffer paths, @NativeType("GLuint") int pathBase, @NativeType("GLenum") int coverMode, @NativeType("GLenum") int transformType, @NativeType("GLfloat const *") float[] transformValues) { + long __functionAddress = GL.getICD().glCoverStrokePathInstancedNV; + int numPaths = paths.remaining() / pathNameTypeToBytes(pathNameType); + if (CHECKS) { + check(__functionAddress); + check(transformValues, numPaths * transformTypeToElements(transformType)); + } + callPPV(numPaths, pathNameType, memAddress(paths), pathBase, coverMode, transformType, transformValues, __functionAddress); + } + + /** Array version of: {@link #glStencilThenCoverFillPathInstancedNV StencilThenCoverFillPathInstancedNV} */ + public static void glStencilThenCoverFillPathInstancedNV(@NativeType("GLenum") int pathNameType, @NativeType("void const *") ByteBuffer paths, @NativeType("GLuint") int pathBase, @NativeType("GLenum") int fillMode, @NativeType("GLuint") int mask, @NativeType("GLenum") int coverMode, @NativeType("GLenum") int transformType, @NativeType("GLfloat const *") float[] transformValues) { + long __functionAddress = GL.getICD().glStencilThenCoverFillPathInstancedNV; + int numPaths = paths.remaining() / pathNameTypeToBytes(pathNameType); + if (CHECKS) { + check(__functionAddress); + check(transformValues, numPaths * transformTypeToElements(transformType)); + } + callPPV(numPaths, pathNameType, memAddress(paths), pathBase, fillMode, mask, coverMode, transformType, transformValues, __functionAddress); + } + + /** Array version of: {@link #glStencilThenCoverStrokePathInstancedNV StencilThenCoverStrokePathInstancedNV} */ + public static void glStencilThenCoverStrokePathInstancedNV(@NativeType("GLenum") int pathNameType, @NativeType("void const *") ByteBuffer paths, @NativeType("GLuint") int pathBase, @NativeType("GLint") int reference, @NativeType("GLuint") int mask, @NativeType("GLenum") int coverMode, @NativeType("GLenum") int transformType, @NativeType("GLfloat const *") float[] transformValues) { + long __functionAddress = GL.getICD().glStencilThenCoverStrokePathInstancedNV; + int numPaths = paths.remaining() / pathNameTypeToBytes(pathNameType); + if (CHECKS) { + check(__functionAddress); + check(transformValues, numPaths * transformTypeToElements(transformType)); + } + callPPV(numPaths, pathNameType, memAddress(paths), pathBase, reference, mask, coverMode, transformType, transformValues, __functionAddress); + } + + /** Array version of: {@link #glProgramPathFragmentInputGenNV ProgramPathFragmentInputGenNV} */ + public static void glProgramPathFragmentInputGenNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLenum") int genMode, @NativeType("GLint") int components, @NativeType("GLfloat const *") float[] coeffs) { + long __functionAddress = GL.getICD().glProgramPathFragmentInputGenNV; + if (CHECKS) { + check(__functionAddress); + check(coeffs, genModeToElements(genMode) * components); + } + callPV(program, location, genMode, components, coeffs, __functionAddress); + } + + /** Array version of: {@link #glGetPathParameterivNV GetPathParameterivNV} */ + public static void glGetPathParameterivNV(@NativeType("GLuint") int path, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] value) { + long __functionAddress = GL.getICD().glGetPathParameterivNV; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + callPV(path, pname, value, __functionAddress); + } + + /** Array version of: {@link #glGetPathParameterfvNV GetPathParameterfvNV} */ + public static void glGetPathParameterfvNV(@NativeType("GLuint") int path, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] value) { + long __functionAddress = GL.getICD().glGetPathParameterfvNV; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + callPV(path, pname, value, __functionAddress); + } + + /** Array version of: {@link #glGetPathCoordsNV GetPathCoordsNV} */ + public static void glGetPathCoordsNV(@NativeType("GLuint") int path, @NativeType("GLfloat *") float[] coords) { + long __functionAddress = GL.getICD().glGetPathCoordsNV; + if (CHECKS) { + check(__functionAddress); + if (DEBUG) { + check(coords, glGetPathParameteriNV(path, GL_PATH_COORD_COUNT_NV)); + } + } + callPV(path, coords, __functionAddress); + } + + /** Array version of: {@link #glGetPathDashArrayNV GetPathDashArrayNV} */ + public static void glGetPathDashArrayNV(@NativeType("GLuint") int path, @NativeType("GLfloat *") float[] dashArray) { + long __functionAddress = GL.getICD().glGetPathDashArrayNV; + if (CHECKS) { + check(__functionAddress); + if (DEBUG) { + check(dashArray, glGetPathParameteriNV(path, GL_PATH_DASH_ARRAY_COUNT_NV)); + } + } + callPV(path, dashArray, __functionAddress); + } + + /** Array version of: {@link #glGetPathMetricsNV GetPathMetricsNV} */ + public static void glGetPathMetricsNV(@NativeType("GLbitfield") int metricQueryMask, @NativeType("GLenum") int pathNameType, @NativeType("void const *") ByteBuffer paths, @NativeType("GLuint") int pathBase, @NativeType("GLsizei") int stride, @NativeType("GLfloat *") float[] metrics) { + long __functionAddress = GL.getICD().glGetPathMetricsNV; + int numPaths = paths.remaining() / pathNameTypeToBytes(pathNameType); + if (CHECKS) { + check(__functionAddress); + check(metrics, numPaths * (stride == 0 ? Integer.bitCount(metricQueryMask) : (stride >> 2))); + } + callPPV(metricQueryMask, numPaths, pathNameType, memAddress(paths), pathBase, stride, metrics, __functionAddress); + } + + /** Array version of: {@link #glGetPathMetricRangeNV GetPathMetricRangeNV} */ + public static void glGetPathMetricRangeNV(@NativeType("GLbitfield") int metricQueryMask, @NativeType("GLuint") int firstPathName, @NativeType("GLsizei") int numPaths, @NativeType("GLsizei") int stride, @NativeType("GLfloat *") float[] metrics) { + long __functionAddress = GL.getICD().glGetPathMetricRangeNV; + if (CHECKS) { + check(__functionAddress); + check(metrics, numPaths * (stride == 0 ? Integer.bitCount(metricQueryMask) : (stride >> 2))); + } + callPV(metricQueryMask, firstPathName, numPaths, stride, metrics, __functionAddress); + } + + /** Array version of: {@link #glGetPathSpacingNV GetPathSpacingNV} */ + public static void glGetPathSpacingNV(@NativeType("GLenum") int pathListMode, @NativeType("GLenum") int pathNameType, @NativeType("void const *") ByteBuffer paths, @NativeType("GLuint") int pathBase, @NativeType("GLfloat") float advanceScale, @NativeType("GLfloat") float kerningScale, @NativeType("GLenum") int transformType, @NativeType("GLfloat *") float[] returnedSpacing) { + long __functionAddress = GL.getICD().glGetPathSpacingNV; + int numPaths = paths.remaining() / pathNameTypeToBytes(pathNameType); + if (CHECKS) { + check(__functionAddress); + check(returnedSpacing, (numPaths - 1) * (transformType == GL_TRANSLATE_X_NV ? 1 : 2)); + } + callPPV(pathListMode, numPaths, pathNameType, memAddress(paths), pathBase, advanceScale, kerningScale, transformType, returnedSpacing, __functionAddress); + } + + /** Array version of: {@link #glGetPathColorGenivNV GetPathColorGenivNV} */ + public static void glGetPathColorGenivNV(@NativeType("GLenum") int color, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] value) { + long __functionAddress = GL.getICD().glGetPathColorGenivNV; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + callPV(color, pname, value, __functionAddress); + } + + /** Array version of: {@link #glGetPathColorGenfvNV GetPathColorGenfvNV} */ + public static void glGetPathColorGenfvNV(@NativeType("GLenum") int color, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] value) { + long __functionAddress = GL.getICD().glGetPathColorGenfvNV; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + callPV(color, pname, value, __functionAddress); + } + + /** Array version of: {@link #glGetPathTexGenivNV GetPathTexGenivNV} */ + public static void glGetPathTexGenivNV(@NativeType("GLenum") int texCoordSet, @NativeType("GLenum") int pname, @NativeType("GLint *") int[] value) { + long __functionAddress = GL.getICD().glGetPathTexGenivNV; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + callPV(texCoordSet, pname, value, __functionAddress); + } + + /** Array version of: {@link #glGetPathTexGenfvNV GetPathTexGenfvNV} */ + public static void glGetPathTexGenfvNV(@NativeType("GLenum") int texCoordSet, @NativeType("GLenum") int pname, @NativeType("GLfloat *") float[] value) { + long __functionAddress = GL.getICD().glGetPathTexGenfvNV; + if (CHECKS) { + check(__functionAddress); + check(value, 1); + } + callPV(texCoordSet, pname, value, __functionAddress); + } + + /** Array version of: {@link #glPointAlongPathNV PointAlongPathNV} */ + @NativeType("GLboolean") + public static boolean glPointAlongPathNV(@NativeType("GLuint") int path, @NativeType("GLsizei") int startSegment, @NativeType("GLsizei") int numSegments, @NativeType("GLfloat") float distance, @Nullable @NativeType("GLfloat *") float[] x, @Nullable @NativeType("GLfloat *") float[] y, @Nullable @NativeType("GLfloat *") float[] tangentX, @Nullable @NativeType("GLfloat *") float[] tangentY) { + long __functionAddress = GL.getICD().glPointAlongPathNV; + if (CHECKS) { + check(__functionAddress); + checkSafe(x, 1); + checkSafe(y, 1); + checkSafe(tangentX, 1); + checkSafe(tangentY, 1); + } + return callPPPPZ(path, startSegment, numSegments, distance, x, y, tangentX, tangentY, __functionAddress); + } + + /** Array version of: {@link #glMatrixLoad3x2fNV MatrixLoad3x2fNV} */ + public static void glMatrixLoad3x2fNV(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat const *") float[] m) { + long __functionAddress = GL.getICD().glMatrixLoad3x2fNV; + if (CHECKS) { + check(__functionAddress); + check(m, 6); + } + callPV(matrixMode, m, __functionAddress); + } + + /** Array version of: {@link #glMatrixLoad3x3fNV MatrixLoad3x3fNV} */ + public static void glMatrixLoad3x3fNV(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat const *") float[] m) { + long __functionAddress = GL.getICD().glMatrixLoad3x3fNV; + if (CHECKS) { + check(__functionAddress); + check(m, 9); + } + callPV(matrixMode, m, __functionAddress); + } + + /** Array version of: {@link #glMatrixLoadTranspose3x3fNV MatrixLoadTranspose3x3fNV} */ + public static void glMatrixLoadTranspose3x3fNV(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat const *") float[] m) { + long __functionAddress = GL.getICD().glMatrixLoadTranspose3x3fNV; + if (CHECKS) { + check(__functionAddress); + check(m, 9); + } + callPV(matrixMode, m, __functionAddress); + } + + /** Array version of: {@link #glMatrixMult3x2fNV MatrixMult3x2fNV} */ + public static void glMatrixMult3x2fNV(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat const *") float[] m) { + long __functionAddress = GL.getICD().glMatrixMult3x2fNV; + if (CHECKS) { + check(__functionAddress); + check(m, 6); + } + callPV(matrixMode, m, __functionAddress); + } + + /** Array version of: {@link #glMatrixMult3x3fNV MatrixMult3x3fNV} */ + public static void glMatrixMult3x3fNV(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat const *") float[] m) { + long __functionAddress = GL.getICD().glMatrixMult3x3fNV; + if (CHECKS) { + check(__functionAddress); + check(m, 9); + } + callPV(matrixMode, m, __functionAddress); + } + + /** Array version of: {@link #glMatrixMultTranspose3x3fNV MatrixMultTranspose3x3fNV} */ + public static void glMatrixMultTranspose3x3fNV(@NativeType("GLenum") int matrixMode, @NativeType("GLfloat const *") float[] m) { + long __functionAddress = GL.getICD().glMatrixMultTranspose3x3fNV; + if (CHECKS) { + check(__functionAddress); + check(m, 9); + } + callPV(matrixMode, m, __functionAddress); + } + + /** Array version of: {@link #glGetProgramResourcefvNV GetProgramResourcefvNV} */ + public static void glGetProgramResourcefvNV(@NativeType("GLuint") int program, @NativeType("GLenum") int programInterface, @NativeType("GLuint") int index, @NativeType("GLenum const *") int[] props, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLfloat *") float[] params) { + long __functionAddress = GL.getICD().glGetProgramResourcefvNV; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + } + callPPPV(program, programInterface, index, props.length, props, params.length, length, params, __functionAddress); + } + + private static int charcodeTypeToBytes(int type) { + switch ( type ) { + case GL_UNSIGNED_BYTE: + case GL_UTF8_NV: + return 1; + case GL_UNSIGNED_SHORT: + case GL_2_BYTES_NV: + case GL_UTF16_NV: + return 2; + case GL_3_BYTES_NV: + return 3; + case GL_UNSIGNED_INT: + case GL_4_BYTES_NV: + return 4; + default: + throw new IllegalArgumentException(String.format("Unsupported charcode type: 0x%X", type)); + } + } + + private static int pathNameTypeToBytes(int type) { + switch ( type ) { + case GL_BYTE: + case GL_UNSIGNED_BYTE: + case GL_UTF8_NV: + return 1; + case GL_SHORT: + case GL_UNSIGNED_SHORT: + case GL_2_BYTES_NV: + case GL_UTF16_NV: + return 2; + case GL_3_BYTES_NV: + return 3; + case GL_INT: + case GL_UNSIGNED_INT: + case GL_4_BYTES_NV: + return 4; + default: + throw new IllegalArgumentException(String.format("Unsupported path name type: 0x%X", type)); + } + } + + private static int transformTypeToElements(int type) { + switch ( type ) { + case GL_NONE: + return 0; + case GL_TRANSLATE_X_NV: + case GL_TRANSLATE_Y_NV: + return 1; + case GL_TRANSLATE_2D_NV: + return 2; + case GL_TRANSLATE_3D_NV: + return 3; + case GL_AFFINE_2D_NV: + case GL_TRANSPOSE_AFFINE_2D_NV: + return 6; + case GL_AFFINE_3D_NV: + case GL_TRANSPOSE_AFFINE_3D_NV: + return 12; + default: + throw new IllegalArgumentException(String.format("Unsupported transform type: 0x%X", type)); + } + } + + private static int colorFormatToComponents(int colorFormat) { + switch ( colorFormat ) { + case GL_LUMINANCE: + case GL_INTENSITY: + case GL_ALPHA: + return 1; + case GL_LUMINANCE_ALPHA: + return 2; + case GL_RGB: + return 3; + case GL_RGBA: + return 4; + default: + throw new IllegalArgumentException(String.format("Unsupported colorFormat specified: 0x%X", colorFormat)); + } + } + + private static int genModeToElements(int genMode) { + switch ( genMode ) { + case GL_NONE: + return 0; + case GL_CONSTANT_NV: + return 1; + case GL_OBJECT_LINEAR_NV: + case GL_PATH_OBJECT_BOUNDING_BOX_NV: + return 3; + case GL_EYE_LINEAR_NV: + return 4; + default: + throw new IllegalArgumentException(String.format("Unsupported genMode specified: 0x%X", genMode)); + } + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPathRenderingSharedEdge.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPathRenderingSharedEdge.java new file mode 100644 index 00000000..cf002b44 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPathRenderingSharedEdge.java @@ -0,0 +1,27 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the NV_path_rendering_shared_edge extension. + * + *

This extension introduces a new path command modifier to the NV_path_rendering extension to indicate that a path command represents an edge (either + * straight or curved) that is shared with another path.

+ * + *

When used in conjunction with {@link NVFramebufferMixedSamples NV_framebuffer_mixed_samples}, a shared edge (or a whole path including shared edges) will use modified + * rasterization rules in order to ensure that groups of raster samples associated with a given coverage sample will all produce consistent coverage + * results, in order to avoid artifacts described further in the issues section at the end of this document.

+ * + *

Requires {@link NVPathRendering NV_path_rendering}.

+ */ +public final class NVPathRenderingSharedEdge { + + /** Allowed to be added to command tokens in elements of the {@code commands} array parameter of PathCommandsNV and PathSubCommandsNV. */ + public static final int GL_SHARED_EDGE_NV = 0xC0; + + private NVPathRenderingSharedEdge() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPixelDataRange.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPixelDataRange.java new file mode 100644 index 00000000..ecba268c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPixelDataRange.java @@ -0,0 +1,94 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_pixel_data_range extension. + * + *

The vertex array range extension is intended to improve the efficiency of OpenGL vertex arrays. OpenGL vertex arrays' coherency model and ability to + * access memory from arbitrary locations in memory prevented implementations from using DMA (Direct Memory Access) operations.

+ * + *

Many image-intensive applications, such as those that use dynamically generated textures, face similar problems. These applications would like to be + * able to sustain throughputs of hundreds of millions of pixels per second through DrawPixels and hundreds of millions of texels per second through + * TexSubImage.

+ * + *

However, the same restrictions that limited vertex throughput also limit pixel throughput.

+ * + *

By the time that any pixel operation that reads data from user memory returns, OpenGL requires that it must be safe for the application to start using + * that memory for a different purpose. This coherency model prevents asynchronous DMA transfers directly out of the user's buffer.

+ * + *

There are also no restrictions on the pointer provided to pixel operations or on the size of the data. To facilitate DMA implementations, the driver + * needs to know in advance what region of the address space to lock down.

+ * + *

Vertex arrays faced both of these restrictions already, but pixel operations have one additional complicating factor -- they are bidirectional. Vertex + * array data is always being transfered from the application to the driver and the HW, whereas pixel operations sometimes transfer data to the + * application from the driver and HW. Note that the types of memory that are suitable for DMA for reading and writing purposes are often different. For + * example, on many PC platforms, DMA pulling is best accomplished with write-combined (uncached) AGP memory, while pushing data should use cached memory + * so that the application can read the data efficiently once it has been read back over the AGP bus.

+ * + *

This extension defines an API where an application can specify two pixel data ranges, which are analogous to vertex array ranges, except that one is + * for operations where the application is reading data (e.g. glReadPixels) and one is for operations where the application is writing data (e.g. + * glDrawPixels, glTexSubImage2D, etc.). Each pixel data range has a pointer to its start and a length in bytes.

+ * + *

When the pixel data range is enabled, and if the pointer specified as the argument to a pixel operation is inside the corresponding pixel data range, + * the implementation may choose to asynchronously pull data from the pixel data range or push data to the pixel data range. Data pulled from outside the + * pixel data range is undefined, while pushing data to outside the pixel data range produces undefined results.

+ * + *

The application may synchronize with the hardware in one of two ways: by flushing the pixel data range (or causing an implicit flush) or by using the + * NV_fence extension to insert fences in the command stream.

+ */ +public class NVPixelDataRange { + + /** + * Accepted by the {@code target} parameter of PixelDataRangeNV and FlushPixelDataRangeNV, and by the {@code cap} parameter of EnableClientState, + * DisableClientState, and IsEnabled. + */ + public static final int + GL_WRITE_PIXEL_DATA_RANGE_NV = 0x8878, + GL_READ_PIXEL_DATA_RANGE_NV = 0x8879; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV = 0x887A, + GL_READ_PIXEL_DATA_RANGE_LENGTH_NV = 0x887B; + + /** Accepted by the {@code pname} parameter of GetPointerv. */ + public static final int + GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV = 0x887C, + GL_READ_PIXEL_DATA_RANGE_POINTER_NV = 0x887D; + + static { GL.initialize(); } + + protected NVPixelDataRange() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glPixelDataRangeNV, caps.glFlushPixelDataRangeNV + ); + } + + // --- [ glPixelDataRangeNV ] --- + + public static native void nglPixelDataRangeNV(int target, int length, long pointer); + + public static void glPixelDataRangeNV(@NativeType("GLenum") int target, @NativeType("void const *") ByteBuffer pointer) { + nglPixelDataRangeNV(target, pointer.remaining(), memAddress(pointer)); + } + + // --- [ glFlushPixelDataRangeNV ] --- + + public static native void glFlushPixelDataRangeNV(@NativeType("GLenum") int target); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPointSprite.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPointSprite.java new file mode 100644 index 00000000..faad2b99 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPointSprite.java @@ -0,0 +1,91 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_point_sprite extension. + * + *

Applications such as particle systems usually must use OpenGL quads rather than points to render their geometry, since they would like to use a + * custom-drawn texture for each particle, rather than the traditional OpenGL round antialiased points, and each fragment in a point has the same texture + * coordinates as every other fragment.

+ * + *

Unfortunately, specifying the geometry for these quads can be quite expensive, since it quadruples the amount of geometry required, and it may also + * require the application to do extra processing to compute the location of each vertex.

+ * + *

The goal of this extension is to allow such apps to use points rather than quads. When {@link #GL_POINT_SPRITE_NV POINT_SPRITE_NV} is enabled, the state of point antialiasing + * is ignored. For each texture unit, the app can then specify whether to replace the existing texture coordinates with point sprite texture coordinates, + * which are interpolated across the point. Finally, the app can set a global parameter for the way to generate the R coordinate for point sprites; the R + * coordinate can either be zero, the input S coordinate, or the input R coordinate. This allows applications to use a 3D texture to represent a point + * sprite that goes through an animation, with filtering between frames, for example.

+ * + *

Requires {@link EXTPointParameters EXT_point_parameters}.

+ */ +public class NVPointSprite { + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev, and by the {@code target} parameter of TexEnvi, TexEnviv, TexEnvf, TexEnvfv, GetTexEnviv, and GetTexEnvfv. + */ + public static final int GL_POINT_SPRITE_NV = 0x8861; + + /** + * When the {@code target} parameter of TexEnvf, TexEnvfv, TexEnvi, TexEnviv, GetTexEnvfv, or GetTexEnviv is POINT_SPRITE_NV, then the value of + * {@code pname} may be. + */ + public static final int GL_COORD_REPLACE_NV = 0x8862; + + /** + * Accepted by the {@code pname} parameter of PointParameteriNV, PointParameterfEXT, PointParameterivNV, PointParameterfvEXT, GetBooleanv, GetIntegerv, + * GetFloatv, and GetDoublev. + */ + public static final int GL_POINT_SPRITE_R_MODE_NV = 0x8863; + + static { GL.initialize(); } + + protected NVPointSprite() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glPointParameteriNV, caps.glPointParameterivNV + ); + } + + // --- [ glPointParameteriNV ] --- + + public static native void glPointParameteriNV(@NativeType("GLenum") int pname, @NativeType("GLint") int param); + + // --- [ glPointParameterivNV ] --- + + public static native void nglPointParameterivNV(int pname, long params); + + public static void glPointParameterivNV(@NativeType("GLenum") int pname, @NativeType("GLint const *") IntBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglPointParameterivNV(pname, memAddress(params)); + } + + /** Array version of: {@link #glPointParameterivNV PointParameterivNV} */ + public static void glPointParameterivNV(@NativeType("GLenum") int pname, @NativeType("GLint const *") int[] params) { + long __functionAddress = GL.getICD().glPointParameterivNV; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(pname, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPrimitiveRestart.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPrimitiveRestart.java new file mode 100644 index 00000000..c94b90df --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVPrimitiveRestart.java @@ -0,0 +1,60 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the NV_primitive_restart extension. + * + *

This extension allows applications to easily and inexpensively restart a primitive in its middle. A "primitive restart" is simply the same as an End + * command, followed by another Begin command with the same mode as the original. The typical expected use of this feature is to draw a mesh with many + * triangle strips, though primitive restarts are legal for all primitive types, even for points (where they are not useful).

+ * + *

Although the EXT_multi_draw_arrays extension did reduce the overhead of such drawing techniques, they still remain more expensive than one would like.

+ * + *

This extension provides an extremely lightweight primitive restart, which is accomplished by allowing the application to choose a special index number + * that signals that a primitive restart should occur, rather than a vertex being provoked. This index can be an arbitrary 32-bit integer for maximum + * application convenience.

+ * + *

In addition, for full orthogonality, a special OpenGL command is provided to restart primitives when in immediate mode. This command is not likely to + * increase performance in any significant fashion, but providing it greatly simplifies the specification and implementation of display list compilation + * and indirect rendering.

+ */ +public class NVPrimitiveRestart { + + /** + * Accepted by the {@code array} parameter of EnableClientState and DisableClientState, by the {@code cap} parameter of IsEnabled, and by the {@code pname} + * parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. + */ + public static final int GL_PRIMITIVE_RESTART_NV = 0x8558; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int GL_PRIMITIVE_RESTART_INDEX_NV = 0x8559; + + static { GL.initialize(); } + + protected NVPrimitiveRestart() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glPrimitiveRestartNV, caps.glPrimitiveRestartIndexNV + ); + } + + // --- [ glPrimitiveRestartNV ] --- + + public static native void glPrimitiveRestartNV(); + + // --- [ glPrimitiveRestartIndexNV ] --- + + public static native void glPrimitiveRestartIndexNV(@NativeType("GLuint") int index); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVQueryResource.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVQueryResource.java new file mode 100644 index 00000000..ad363995 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVQueryResource.java @@ -0,0 +1,79 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_query_resource extension. + * + *

OpenGL implementations manage the residence of textures, shaders, and other graphical objects in GPU accessible memory (whether in on-board video + * memory or addressable system memory is implementation dependent). With more insight into OpenGL's memory usage 1) applications could make educated + * decisions on better utilizing the limited GPU resources, 2) users could better optimize their workflow when working with multiple tools, and 3) + * administrators can make better decisions regarding resource allocation and system configurations.

+ * + *

The purpose of this extension is to return a more detailed breakdown of memory usage in terms of the OpenGL objects residing in memory (textures, + * render buffers, buffer objects, system reserved objects, ...). This extension differs from GL_NVX_gpu_memory_info in that this extension returns + * detailed memory usage at the object level for video memory while the other extension only reports total vidmem usage.

+ * + *

For the purposes of this specification the term vidmem refers to video memory resident on the graphics card that is directly accessible to the GPU at + * the highest performance level.

+ * + *

Requires {@link GL20 OpenGL 2.0}.

+ */ +public class NVQueryResource { + + /** Accepted by the {@code queryType} parameter of {@link #glQueryResourceNV QueryResourceNV}. */ + public static final int GL_QUERY_RESOURCE_TYPE_VIDMEM_ALLOC_NV = 0x9540; + + /** New enums defined. */ + public static final int + GL_QUERY_RESOURCE_MEMTYPE_VIDMEM_NV = 0x9542, + GL_QUERY_RESOURCE_SYS_RESERVED_NV = 0x9544, + GL_QUERY_RESOURCE_TEXTURE_NV = 0x9545, + GL_QUERY_RESOURCE_RENDERBUFFER_NV = 0x9546, + GL_QUERY_RESOURCE_BUFFEROBJECT_NV = 0x9547; + + static { GL.initialize(); } + + protected NVQueryResource() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glQueryResourceNV + ); + } + + // --- [ glQueryResourceNV ] --- + + /** Unsafe version of: {@link #glQueryResourceNV QueryResourceNV} */ + public static native int nglQueryResourceNV(int queryType, int pname, int bufSize, long buffer); + + /** @param queryType must be:
{@link #GL_QUERY_RESOURCE_TYPE_VIDMEM_ALLOC_NV QUERY_RESOURCE_TYPE_VIDMEM_ALLOC_NV}
*/ + @NativeType("GLint") + public static int glQueryResourceNV(@NativeType("GLenum") int queryType, @NativeType("GLint") int pname, @NativeType("GLint *") IntBuffer buffer) { + return nglQueryResourceNV(queryType, pname, buffer.remaining(), memAddress(buffer)); + } + + /** Array version of: {@link #glQueryResourceNV QueryResourceNV} */ + @NativeType("GLint") + public static int glQueryResourceNV(@NativeType("GLenum") int queryType, @NativeType("GLint") int pname, @NativeType("GLint *") int[] buffer) { + long __functionAddress = GL.getICD().glQueryResourceNV; + if (CHECKS) { + check(__functionAddress); + } + return callPI(queryType, pname, buffer.length, buffer, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVQueryResourceTag.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVQueryResourceTag.java new file mode 100644 index 00000000..1e630bfd --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVQueryResourceTag.java @@ -0,0 +1,118 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_query_resource_tag extension. + * + *

This extension adds the capability to associate a tag with one or more memory resource allocations. This tag can be reported back during + * {@code queryResource} operations and also be used to limit resource reporting to only those allocations with the specified tag. A tag is a previously + * reserved id and an optional text string.

+ * + *

Requires {@link GL20 OpenGL 2.0} and {@link NVQueryResource NV_query_resource}.

+ */ +public class NVQueryResourceTag { + + static { GL.initialize(); } + + protected NVQueryResourceTag() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glGenQueryResourceTagNV, caps.glDeleteQueryResourceTagNV, caps.glQueryResourceTagNV + ); + } + + // --- [ glGenQueryResourceTagNV ] --- + + public static native void nglGenQueryResourceTagNV(int n, long tagIds); + + public static void glGenQueryResourceTagNV(@NativeType("GLuint *") IntBuffer tagIds) { + nglGenQueryResourceTagNV(tagIds.remaining(), memAddress(tagIds)); + } + + @NativeType("void") + public static int glGenQueryResourceTagNV() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer tagIds = stack.callocInt(1); + nglGenQueryResourceTagNV(1, memAddress(tagIds)); + return tagIds.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glDeleteQueryResourceTagNV ] --- + + public static native void nglDeleteQueryResourceTagNV(int n, long tagIds); + + public static void glDeleteQueryResourceTagNV(@NativeType("GLuint const *") IntBuffer tagIds) { + nglDeleteQueryResourceTagNV(tagIds.remaining(), memAddress(tagIds)); + } + + public static void glDeleteQueryResourceTagNV(@NativeType("GLuint const *") int tagId) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer tagIds = stack.ints(tagId); + nglDeleteQueryResourceTagNV(1, memAddress(tagIds)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glQueryResourceTagNV ] --- + + public static native void nglQueryResourceTagNV(int tagId, long tagString); + + public static void glQueryResourceTagNV(@NativeType("GLuint") int tagId, @NativeType("GLchar const *") ByteBuffer tagString) { + if (CHECKS) { + checkNT1(tagString); + } + nglQueryResourceTagNV(tagId, memAddress(tagString)); + } + + public static void glQueryResourceTagNV(@NativeType("GLuint") int tagId, @NativeType("GLchar const *") CharSequence tagString) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(tagString, true); + long tagStringEncoded = stack.getPointerAddress(); + nglQueryResourceTagNV(tagId, tagStringEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #glGenQueryResourceTagNV GenQueryResourceTagNV} */ + public static void glGenQueryResourceTagNV(@NativeType("GLuint *") int[] tagIds) { + long __functionAddress = GL.getICD().glGenQueryResourceTagNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(tagIds.length, tagIds, __functionAddress); + } + + /** Array version of: {@link #glDeleteQueryResourceTagNV DeleteQueryResourceTagNV} */ + public static void glDeleteQueryResourceTagNV(@NativeType("GLuint const *") int[] tagIds) { + long __functionAddress = GL.getICD().glDeleteQueryResourceTagNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(tagIds.length, tagIds, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVRepresentativeFragmentTest.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVRepresentativeFragmentTest.java new file mode 100644 index 00000000..d30eb61d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVRepresentativeFragmentTest.java @@ -0,0 +1,38 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the NV_representative_fragment_test extension. + * + *

This extension provides a new representative fragment test that allows implementations to reduce the amount of rasterization and fragment + * processing work performed for each point, line, or triangle primitive. For any primitive that produces one or more fragments that pass all other early + * fragment tests, the implementation is permitted to choose one or more "representative" fragments for processing and discard all other fragments. For + * draw calls rendering multiple points, lines, or triangles arranged in lists, strips, or fans, the representative fragment test is performed + * independently for each of those primitives.

+ * + *

This extension is useful for applications that use an early render pass to determine the full set of primitives that would be visible in the final + * scene. In this render pass, such applications would set up a fragment shader that enables early fragment tests and writes to an image or shader storage + * buffer to record the ID of the primitive that generated the fragment. Without this extension, the shader would record the ID separately for each + * visible fragment of each primitive. With this extension, fewer stores will be performed, particularly for large primitives.

+ * + *

The representative fragment test has no effect if early fragment tests are not enabled via the fragment shader. The set of fragments discarded by the + * representative fragment test is implementation-dependent and may vary from frame to frame. In some cases, the representative fragment test may not + * discard any fragments for a given primitive.

+ * + *

Requires {@link GL45 OpenGL 4.5}.

+ */ +public final class NVRepresentativeFragmentTest { + + /** + * Accepted by the {@code cap} parameter of {@link CGL#CGLEnable Enable}, {@link CGL#CGLDisable Disable}, and {@link CGL#CGLIsEnabled IsEnabled}, and by the {@code pname} parameter of {@link GL11C#glGetBooleanv GetBooleanv}, {@link GL11C#glGetIntegerv GetIntegerv}, + * {@link GL11C#glGetFloatv GetFloatv}, and {@link GL11C#glGetDoublev GetDoublev}. + */ + public static final int GL_REPRESENTATIVE_FRAGMENT_TEST_NV = 0x937F; + + private NVRepresentativeFragmentTest() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVRobustnessVideoMemoryPurge.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVRobustnessVideoMemoryPurge.java new file mode 100644 index 00000000..088bd659 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVRobustnessVideoMemoryPurge.java @@ -0,0 +1,32 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the NV_robustness_video_memory_purge extension. + * + *

This extension allows applications to be notified when video memory has been purged.

+ * + *

The NVIDIA OpenGL driver architecture on Linux has a limitation: resources located in video memory are not persistent across certain events. VT + * switches, suspend/resume events, and mode switching events may erase the contents of video memory. Any resource that is located exclusively in video + * memory, such as framebuffer objects (FBOs), will be lost. As the OpenGL specification makes no mention of events where the video memory is allowed to + * be cleared, the driver attempts to hide this fact from the application, but cannot do it for all resources.

+ * + *

This extension provides a way for applications to discover when video memory content has been lost, so that the application can re-populate the video + * memory content as necessary.

+ * + *

This extension will have a limited lifespan, as planned architectural evolutions in the NVIDIA Linux driver stack will allow video memory to be + * persistent. Any driver that exposes this extension is a driver that considers video memory to be volatile. Once the driver stack has been improved, the + * extension will no longer be exposed.

+ */ +public final class NVRobustnessVideoMemoryPurge { + + /** Returned by GetGraphicsResetStatusARB, in addition to other tokens defined in ARB_robustness. */ + public static final int GL_PURGED_CONTEXT_RESET_NV = 0x92BB; + + private NVRobustnessVideoMemoryPurge() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVSampleLocations.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVSampleLocations.java new file mode 100644 index 00000000..f39de524 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVSampleLocations.java @@ -0,0 +1,135 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_sample_locations extension. + * + *

This extension allows an application to modify the locations of samples within a pixel used in multisample rasterization. Additionally, it allows + * applications to specify different sample locations for each pixel in a group of adjacent pixels, which may increase antialiasing quality (particularly + * if a custom resolve shader is used that takes advantage of these different locations).

+ * + *

It is common for implementations to optimize the storage of depth values by storing values that can be used to reconstruct depth at each sample + * location, rather than storing separate depth values for each sample. For example, the depth values from a single triangle can be represented using + * plane equations. When the depth value for a sample is needed, it is automatically evaluated at the sample location. Modifying the sample locations + * causes the reconstruction to no longer evaluate the same depth values as when the samples were originally generated. This extension provides a command + * to "resolve" and store per-sample depth values using the currently programmed sample locations, which allows the application to manage this issue + * if/when necessary.

+ * + *

The programmable sample locations are used during rasterization and for evaluation of depth functions during normal geometric rendering. The + * programmable locations are associated with a framebuffer object rather than an individual depth buffer, so if the depth buffer is used as a texture the + * texture sampling may be done at the standard sample locations. Additionally, commands that do not render geometric primitives (e.g. ReadPixels, + * BlitFramebuffer, CopyTexSubImage2D, etc.) may use the standard sample locations to resolve depth functions rather than the programmable locations. If a + * single depth buffer is used at different times with different sample locations, the depth functions may be interpreted using the current sample + * locations.

+ */ +public class NVSampleLocations { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetInteger64v, GetFloatv, and GetDoublev. */ + public static final int + GL_SAMPLE_LOCATION_SUBPIXEL_BITS_NV = 0x933D, + GL_SAMPLE_LOCATION_PIXEL_GRID_WIDTH_NV = 0x933E, + GL_SAMPLE_LOCATION_PIXEL_GRID_HEIGHT_NV = 0x933F, + GL_PROGRAMMABLE_SAMPLE_LOCATION_TABLE_SIZE_NV = 0x9340; + + /** Accepted by the {@code pname} parameter of GetMultisamplefv. */ + public static final int + GL_SAMPLE_LOCATION_NV = 0x8E50, + GL_PROGRAMMABLE_SAMPLE_LOCATION_NV = 0x9341; + + /** Accepted by the {@code pname} parameter of FramebufferParameteri, GetFramebufferParameteriv. */ + public static final int + GL_FRAMEBUFFER_PROGRAMMABLE_SAMPLE_LOCATIONS_NV = 0x9342, + GL_FRAMEBUFFER_SAMPLE_LOCATION_PIXEL_GRID_NV = 0x9343; + + static { GL.initialize(); } + + protected NVSampleLocations() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glFramebufferSampleLocationsfvNV, caps.glNamedFramebufferSampleLocationsfvNV, caps.glResolveDepthValuesNV + ); + } + + // --- [ glFramebufferSampleLocationsfvNV ] --- + + /** + * Unsafe version of: {@link #glFramebufferSampleLocationsfvNV FramebufferSampleLocationsfvNV} + * + * @param count the number of sample locations to modify + */ + public static native void nglFramebufferSampleLocationsfvNV(int target, int start, int count, long v); + + /** + * Updates the programmable sample locations + * + * @param target the framebuffer whose programmable sample locations are modified + * @param start the index of the first sample location to modify + * @param v a pair of floating point values in the range [0,1] for each sample location + */ + public static void glFramebufferSampleLocationsfvNV(@NativeType("GLenum") int target, @NativeType("GLuint") int start, @NativeType("GLfloat const *") FloatBuffer v) { + nglFramebufferSampleLocationsfvNV(target, start, v.remaining() >> 1, memAddress(v)); + } + + // --- [ glNamedFramebufferSampleLocationsfvNV ] --- + + /** + * Unsafe version of: {@link #glNamedFramebufferSampleLocationsfvNV NamedFramebufferSampleLocationsfvNV} + * + * @param count the number of sample locations to modify + */ + public static native void nglNamedFramebufferSampleLocationsfvNV(int framebuffer, int start, int count, long v); + + /** + * Updates the programmable sample locations + * + * @param framebuffer the framebuffer whose programmable sample locations are modified + * @param start the index of the first sample location to modify + * @param v a pair of floating point values in the range [0,1] for each sample location + */ + public static void glNamedFramebufferSampleLocationsfvNV(@NativeType("GLuint") int framebuffer, @NativeType("GLuint") int start, @NativeType("GLfloat const *") FloatBuffer v) { + nglNamedFramebufferSampleLocationsfvNV(framebuffer, start, v.remaining() >> 1, memAddress(v)); + } + + // --- [ glResolveDepthValuesNV ] --- + + /** + * Evaluates depth values for all samples in the current depth buffer (subject to the pixel ownership and scissor tests) and stores each value in the + * depth buffer. This can be used to ensure that later accesses will use depth values consistent with the sample locations used when the samples were + * generated. If the current framebuffer has no depth buffer, ResolveDepthValuesNV will have no effect. + */ + public static native void glResolveDepthValuesNV(); + + /** Array version of: {@link #glFramebufferSampleLocationsfvNV FramebufferSampleLocationsfvNV} */ + public static void glFramebufferSampleLocationsfvNV(@NativeType("GLenum") int target, @NativeType("GLuint") int start, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glFramebufferSampleLocationsfvNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(target, start, v.length >> 1, v, __functionAddress); + } + + /** Array version of: {@link #glNamedFramebufferSampleLocationsfvNV NamedFramebufferSampleLocationsfvNV} */ + public static void glNamedFramebufferSampleLocationsfvNV(@NativeType("GLuint") int framebuffer, @NativeType("GLuint") int start, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glNamedFramebufferSampleLocationsfvNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(framebuffer, start, v.length >> 1, v, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVScissorExclusive.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVScissorExclusive.java new file mode 100644 index 00000000..ca40c7a5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVScissorExclusive.java @@ -0,0 +1,79 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_scissor_exclusive extension. + * + *

In unextended OpenGL, applications can enable a per-viewport scissor test ({@link GL11#GL_SCISSOR_TEST SCISSOR_TEST}) where fragments are discarded if their (x,y) coordinates lie + * outside the corresponding scissor rectangle. In this extension, we provide a separate per-viewport exclusive scissor test, where fragments are + * discarded if their (x,y) coordinates lie inside the corresponding exclusive scissor rectangle.

+ * + *

The regular (inclusive) scissor test and exclusive scissor test are orthogonal; applications can enable either or both tests for each viewport. If both + * tests are enabled, fragments will be discarded unless their (x,y) coordinates are both inside the regular scissor rectangle and outside the exclusive + * scissor rectangle.

+ * + *

Requires {@link GL45 OpenGL 4.5}.

+ */ +public class NVScissorExclusive { + + /** + * Accepted by the {@code cap} parameter of {@link CGL#CGLEnable Enable}, {@link CGL#CGLDisable Disable}, and {@link CGL#CGLIsEnabled IsEnabled}, by the {@code target} parameter of {@link GL30C#glEnablei Enablei}, {@link GL30C#glDisablei Disablei}, + * {@link GL30C#glIsEnabledi IsEnabledi}, {@link EXTDrawBuffers2#glEnableIndexedEXT EnableIndexedEXT}, {@link EXTDrawBuffers2#glDisableIndexedEXT DisableIndexedEXT}, and {@link EXTDrawBuffers2#glIsEnabledIndexedEXT IsEnabledIndexedEXT}, and by the {@code pname} parameter of {@link GL11C#glGetBooleanv GetBooleanv}, + * {@link GL11C#glGetIntegerv GetIntegerv}, {@link GL32C#glGetInteger64v GetInteger64v}, {@link GL11C#glGetFloatv GetFloatv}, {@link GL11C#glGetDoublev GetDoublev}, {@link EXTDirectStateAccess#glGetDoubleIndexedvEXT GetDoubleIndexedvEXT}, {@link GL30C#glGetBooleani_v GetBooleani_v}, {@link GL30C#glGetIntegeri_v GetIntegeri_v}, {@link GL32C#glGetInteger64i_v GetInteger64i_v}, + * {@link GL41C#glGetFloati_v GetFloati_v}, {@link GL41C#glGetDoublei_v GetDoublei_v}, {@link EXTDrawBuffers2#glGetBooleanIndexedvEXT GetBooleanIndexedvEXT}, {@link EXTDrawBuffers2#glGetIntegerIndexedvEXT GetIntegerIndexedvEXT}, and {@link EXTDirectStateAccess#glGetFloatIndexedvEXT GetFloatIndexedvEXT}. + */ + public static final int GL_SCISSOR_TEST_EXCLUSIVE_NV = 0x9555; + + /** + * Accepted by the {@code pname} parameter of {@link GL11C#glGetBooleanv GetBooleanv}, {@link GL11C#glGetIntegerv GetIntegerv}, {@link GL32C#glGetInteger64v GetInteger64v}, {@link GL11C#glGetFloatv GetFloatv}, {@link GL11C#glGetDoublev GetDoublev}, {@link GL30C#glGetBooleani_v GetBooleani_v}, + * {@link GL30C#glGetIntegeri_v GetIntegeri_v}, {@link GL32C#glGetInteger64i_v GetInteger64i_v}, {@link GL41C#glGetFloati_v GetFloati_v}, {@link GL41C#glGetDoublei_v GetDoublei_v}, {@link EXTDirectStateAccess#glGetDoubleIndexedvEXT GetDoubleIndexedvEXT}, {@link EXTDrawBuffers2#glGetBooleanIndexedvEXT GetBooleanIndexedvEXT}, {@link EXTDrawBuffers2#glGetIntegerIndexedvEXT GetIntegerIndexedvEXT}, and + * {@link EXTDirectStateAccess#glGetFloatIndexedvEXT GetFloatIndexedvEXT}. + */ + public static final int GL_SCISSOR_BOX_EXCLUSIVE_NV = 0x9556; + + static { GL.initialize(); } + + protected NVScissorExclusive() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glScissorExclusiveArrayvNV, caps.glScissorExclusiveNV + ); + } + + // --- [ glScissorExclusiveArrayvNV ] --- + + public static native void nglScissorExclusiveArrayvNV(int first, int count, long v); + + public static void glScissorExclusiveArrayvNV(@NativeType("GLuint") int first, @NativeType("GLint const *") IntBuffer v) { + nglScissorExclusiveArrayvNV(first, v.remaining() >> 2, memAddress(v)); + } + + // --- [ glScissorExclusiveNV ] --- + + public static native void glScissorExclusiveNV(@NativeType("GLint") int x, @NativeType("GLint") int y, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height); + + /** Array version of: {@link #glScissorExclusiveArrayvNV ScissorExclusiveArrayvNV} */ + public static void glScissorExclusiveArrayvNV(@NativeType("GLuint") int first, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glScissorExclusiveArrayvNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(first, v.length >> 2, v, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVShaderBufferLoad.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVShaderBufferLoad.java new file mode 100644 index 00000000..15d80e09 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVShaderBufferLoad.java @@ -0,0 +1,316 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_shader_buffer_load extension. + * + *

At a very coarse level, GL has evolved in a way that allows applications to replace many of the original state machine variables with blocks of + * user-defined data. For example, the current vertex state has been augmented by vertex buffer objects, fixed-function shading state and parameters have + * been replaced by shaders/programs and constant buffers, etc. Applications switch between coarse sets of state by binding objects to the context or to + * other container objects (e.g. vertex array objects) instead of manipulating state variables of the context. In terms of the number of GL commands + * required to draw an object, modern applications are orders of magnitude more efficient than legacy applications, but this explosion of objects bound to + * other objects has led to a new bottleneck - pointer chasing and CPU L2 cache misses in the driver, and general L2 cache pollution.

+ * + *

This extension provides a mechanism to read from a flat, 64-bit GPU address space from programs/shaders, to query GPU addresses of buffer objects at the + * API level, and to bind buffer objects to the context in such a way that they can be accessed via their GPU addresses in any shader stage.

+ * + *

The intent is that applications can avoid re-binding buffer objects or updating constants between each Draw call and instead simply use a VertexAttrib + * (or TexCoord, or InstanceID, or...) to "point" to the new object's state. In this way, one of the cheapest "state" updates (from the CPU's point of + * view) can be used to effect a significant state change in the shader similarly to how a pointer change may on the CPU. At the same time, this relieves + * the limits on how many buffer objects can be accessed at once by shaders, and allows these buffer object accesses to be exposed as C-style pointer + * dereferences in the shading language.

+ * + *

As a very simple example, imagine packing a group of similar objects' constants into a single buffer object and pointing your program at object + * <i> by setting {@code glVertexAttribI1iEXT(attrLoc, i);} and using a shader as such:

+ * + *

+ * struct MyObjectType {
+ *     mat4x4 modelView;
+ *     vec4 materialPropertyX;
+ *     // etc.
+ * };
+ * uniform MyObjectType *allObjects;
+ * in int objectID; // bound to attrLoc
+ * 
+ * ...
+ * 
+ * mat4x4 thisObjectsMatrix = allObjects[objectID].modelView;
+ * // do transform, shading, etc.
+ * + *

This is beneficial in much the same way that texture arrays allow choosing between similar, but independent, texture maps with a single coordinate + * identifying which slice of the texture to use. It also resembles instancing, where a lightweight change (incrementing the instance ID) can be used to + * generate a different and interesting result, but with additional flexibility over instancing because the values are app-controlled and not a single incrementing counter.

+ * + *

Dependent pointer fetches are allowed, so more complex scene graph structures can be built into buffer objects providing significant new flexibility in + * the use of shaders. Another simple example, showing something you can't do with existing functionality, is to do dependent fetches into many buffer + * objects:

+ * + *

+ * GenBuffers(N, dataBuffers);
+ * GenBuffers(1, &pointerBuffer);
+ * 
+ * GLuint64EXT gpuAddrs[N];
+ * for (i = 0; i < N; ++i) {
+ *     BindBuffer(target, dataBuffers[i]);
+ *     BufferData(target, size[i], myData[i], STATIC_DRAW);
+ * 
+ *     // get the address of this buffer and make it resident.
+ *     GetBufferParameterui64vNV(target, BUFFER_GPU_ADDRESS,
+ *                               gpuaddrs[i]);
+ *     MakeBufferResidentNV(target, READ_ONLY);
+ * }
+ * 
+ * GLuint64EXT pointerBufferAddr;
+ * BindBuffer(target, pointerBuffer);
+ * BufferData(target, sizeof(GLuint64EXT)*N, gpuAddrs, STATIC_DRAW);
+ * GetBufferParameterui64vNV(target, BUFFER_GPU_ADDRESS,
+ *                           &pointerBufferAddr);
+ * MakeBufferResidentNV(target, READ_ONLY);
+ * 
+ * // now in the shader, we can use a double indirection
+ * vec4 **ptrToBuffers = pointerBufferAddr;
+ * vec4 *ptrToBufferI = ptrToBuffers[i];
+ * + *

This allows simultaneous access to more buffers than {@link EXTBindableUniform EXT_bindable_uniform} ({@link EXTBindableUniform#GL_MAX_VERTEX_BINDABLE_UNIFORMS_EXT MAX_VERTEX_BINDABLE_UNIFORMS_EXT}, etc.) and each can be larger than + * {@link EXTBindableUniform#GL_MAX_BINDABLE_UNIFORM_SIZE_EXT MAX_BINDABLE_UNIFORM_SIZE_EXT}.

+ */ +public class NVShaderBufferLoad { + + /** Accepted by the {@code pname} parameter of GetBufferParameterui64vNV, GetNamedBufferParameterui64vNV. */ + public static final int GL_BUFFER_GPU_ADDRESS_NV = 0x8F1D; + + /** Returned by the {@code type} parameter of GetActiveUniform. */ + public static final int GL_GPU_ADDRESS_NV = 0x8F34; + + /** Accepted by the {@code value} parameter of GetIntegerui64vNV. */ + public static final int GL_MAX_SHADER_BUFFER_ADDRESS_NV = 0x8F35; + + static { GL.initialize(); } + + protected NVShaderBufferLoad() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glMakeBufferResidentNV, caps.glMakeBufferNonResidentNV, caps.glIsBufferResidentNV, caps.glMakeNamedBufferResidentNV, + caps.glMakeNamedBufferNonResidentNV, caps.glIsNamedBufferResidentNV, caps.glGetBufferParameterui64vNV, caps.glGetNamedBufferParameterui64vNV, + caps.glGetIntegerui64vNV, caps.glUniformui64NV, caps.glUniformui64vNV, caps.glGetUniformui64vNV, caps.glProgramUniformui64NV, + caps.glProgramUniformui64vNV + ); + } + + // --- [ glMakeBufferResidentNV ] --- + + public static native void glMakeBufferResidentNV(@NativeType("GLenum") int target, @NativeType("GLenum") int access); + + // --- [ glMakeBufferNonResidentNV ] --- + + public static native void glMakeBufferNonResidentNV(@NativeType("GLenum") int target); + + // --- [ glIsBufferResidentNV ] --- + + @NativeType("GLboolean") + public static native boolean glIsBufferResidentNV(@NativeType("GLenum") int target); + + // --- [ glMakeNamedBufferResidentNV ] --- + + public static native void glMakeNamedBufferResidentNV(@NativeType("GLuint") int buffer, @NativeType("GLenum") int access); + + // --- [ glMakeNamedBufferNonResidentNV ] --- + + public static native void glMakeNamedBufferNonResidentNV(@NativeType("GLuint") int buffer); + + // --- [ glIsNamedBufferResidentNV ] --- + + @NativeType("GLboolean") + public static native boolean glIsNamedBufferResidentNV(@NativeType("GLuint") int buffer); + + // --- [ glGetBufferParameterui64vNV ] --- + + public static native void nglGetBufferParameterui64vNV(int target, int pname, long params); + + public static void glGetBufferParameterui64vNV(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint64EXT *") LongBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetBufferParameterui64vNV(target, pname, memAddress(params)); + } + + @NativeType("void") + public static long glGetBufferParameterui64NV(@NativeType("GLenum") int target, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglGetBufferParameterui64vNV(target, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetNamedBufferParameterui64vNV ] --- + + public static native void nglGetNamedBufferParameterui64vNV(int buffer, int pname, long params); + + public static void glGetNamedBufferParameterui64vNV(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLuint64EXT *") LongBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetNamedBufferParameterui64vNV(buffer, pname, memAddress(params)); + } + + @NativeType("void") + public static long glGetNamedBufferParameterui64NV(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglGetNamedBufferParameterui64vNV(buffer, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetIntegerui64vNV ] --- + + public static native void nglGetIntegerui64vNV(int value, long result); + + public static void glGetIntegerui64vNV(@NativeType("GLenum") int value, @NativeType("GLuint64EXT *") LongBuffer result) { + if (CHECKS) { + check(result, 1); + } + nglGetIntegerui64vNV(value, memAddress(result)); + } + + @NativeType("void") + public static long glGetIntegerui64NV(@NativeType("GLenum") int value) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer result = stack.callocLong(1); + nglGetIntegerui64vNV(value, memAddress(result)); + return result.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glUniformui64NV ] --- + + public static native void glUniformui64NV(@NativeType("GLint") int location, @NativeType("GLuint64EXT") long value); + + // --- [ glUniformui64vNV ] --- + + public static native void nglUniformui64vNV(int location, int count, long value); + + public static void glUniformui64vNV(@NativeType("GLint") int location, @NativeType("GLuint64EXT const *") LongBuffer value) { + nglUniformui64vNV(location, value.remaining(), memAddress(value)); + } + + // --- [ glGetUniformui64vNV ] --- + + public static native void nglGetUniformui64vNV(int program, int location, long params); + + public static void glGetUniformui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT *") LongBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetUniformui64vNV(program, location, memAddress(params)); + } + + @NativeType("void") + public static long glGetUniformui64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglGetUniformui64vNV(program, location, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glProgramUniformui64NV ] --- + + public static native void glProgramUniformui64NV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT") long value); + + // --- [ glProgramUniformui64vNV ] --- + + public static native void nglProgramUniformui64vNV(int program, int location, int count, long value); + + public static void glProgramUniformui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT const *") LongBuffer value) { + nglProgramUniformui64vNV(program, location, value.remaining(), memAddress(value)); + } + + /** Array version of: {@link #glGetBufferParameterui64vNV GetBufferParameterui64vNV} */ + public static void glGetBufferParameterui64vNV(@NativeType("GLenum") int target, @NativeType("GLenum") int pname, @NativeType("GLuint64EXT *") long[] params) { + long __functionAddress = GL.getICD().glGetBufferParameterui64vNV; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(target, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetNamedBufferParameterui64vNV GetNamedBufferParameterui64vNV} */ + public static void glGetNamedBufferParameterui64vNV(@NativeType("GLuint") int buffer, @NativeType("GLenum") int pname, @NativeType("GLuint64EXT *") long[] params) { + long __functionAddress = GL.getICD().glGetNamedBufferParameterui64vNV; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(buffer, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetIntegerui64vNV GetIntegerui64vNV} */ + public static void glGetIntegerui64vNV(@NativeType("GLenum") int value, @NativeType("GLuint64EXT *") long[] result) { + long __functionAddress = GL.getICD().glGetIntegerui64vNV; + if (CHECKS) { + check(__functionAddress); + check(result, 1); + } + callPV(value, result, __functionAddress); + } + + /** Array version of: {@link #glUniformui64vNV Uniformui64vNV} */ + public static void glUniformui64vNV(@NativeType("GLint") int location, @NativeType("GLuint64EXT const *") long[] value) { + long __functionAddress = GL.getICD().glUniformui64vNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(location, value.length, value, __functionAddress); + } + + /** Array version of: {@link #glGetUniformui64vNV GetUniformui64vNV} */ + public static void glGetUniformui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT *") long[] params) { + long __functionAddress = GL.getICD().glGetUniformui64vNV; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(program, location, params, __functionAddress); + } + + /** Array version of: {@link #glProgramUniformui64vNV ProgramUniformui64vNV} */ + public static void glProgramUniformui64vNV(@NativeType("GLuint") int program, @NativeType("GLint") int location, @NativeType("GLuint64EXT const *") long[] value) { + long __functionAddress = GL.getICD().glProgramUniformui64vNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, location, value.length, value, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVShaderBufferStore.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVShaderBufferStore.java new file mode 100644 index 00000000..4e683ff8 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVShaderBufferStore.java @@ -0,0 +1,26 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the NV_shader_buffer_store extension. + * + *

This extension builds upon the mechanisms added by the NV_shader_buffer_load extension to allow shaders to perform random-access + * reads to buffer object memory without using dedicated buffer object binding points. Instead, it allowed an application to make a buffer + * object resident, query a GPU address (pointer) for the buffer object, and then use that address as a pointer in shader code. This approach allows + * shaders to access a large number of buffer objects without needing to repeatedly bind buffers to a limited number of fixed-functionality binding + * points.

+ * + *

Requires {@link GL30 OpenGL 3.0}, GLSL 1.30, {@link NVShaderBufferLoad NV_shader_buffer_load}, NV_gpu_program5 and/or {@link NVGPUShader5 NV_gpu_shader5}.

+ */ +public final class NVShaderBufferStore { + + /** Accepted by the {@code barriers} parameter of MemoryBarrierNV. */ + public static final int GL_SHADER_GLOBAL_ACCESS_BARRIER_BIT_NV = 0x10; + + private NVShaderBufferStore() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVShaderSubgroupPartitioned.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVShaderSubgroupPartitioned.java new file mode 100644 index 00000000..bd17ddd7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVShaderSubgroupPartitioned.java @@ -0,0 +1,26 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the NV_shader_subgroup_partitioned extension. + * + *

This extension enables support for the {@code NV_shader_subgroup_partitioned} shading language extension in OpenGL.

+ * + *

This extension adds a new {@link #GL_SUBGROUP_FEATURE_PARTITIONED_BIT_NV SUBGROUP_FEATURE_PARTITIONED_BIT_NV} feature bit that is returned by queryies for {@link KHRShaderSubgroup#GL_SUBGROUP_SUPPORTED_FEATURES_KHR SUBGROUP_SUPPORTED_FEATURES_KHR}.

+ * + *

In OpenGL implementations supporting SPIR-V, this extension enables support for the {@code SPV_NV_shader_subgroup_partitioned} extension.

+ * + *

Requires {@link GL43 OpenGL 4.3} and {@link KHRShaderSubgroup KHR_shader_subgroup}.

+ */ +public final class NVShaderSubgroupPartitioned { + + /** Returned as bitfield in the {@code data} argument when {@link GL11C#glGetIntegerv GetIntegerv} is queried with a {@code pname} of {@link KHRShaderSubgroup#GL_SUBGROUP_SUPPORTED_FEATURES_KHR SUBGROUP_SUPPORTED_FEATURES_KHR}. */ + public static final int GL_SUBGROUP_FEATURE_PARTITIONED_BIT_NV = 0x100; + + private NVShaderSubgroupPartitioned() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVShaderThreadGroup.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVShaderThreadGroup.java new file mode 100644 index 00000000..34c35d2b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVShaderThreadGroup.java @@ -0,0 +1,27 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the NV_shader_thread_group extension. + * + *

Implementations of the OpenGL Shading Language may, but are not required to, run multiple shader threads for a single stage as a SIMD thread group, + * where individual execution threads are assigned to thread groups in an undefined, implementation-dependent order. This extension provides a set of new + * features to the OpenGL Shading Language to query thread states and to share data between fragments within a 2x2 pixel quad.

+ * + *

Requires {@link GL43 OpenGL 4.3}.

+ */ +public final class NVShaderThreadGroup { + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_WARP_SIZE_NV = 0x9339, + GL_WARPS_PER_SM_NV = 0x933A, + GL_SM_COUNT_NV = 0x933B; + + private NVShaderThreadGroup() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVShadingRateImage.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVShadingRateImage.java new file mode 100644 index 00000000..fe349b1f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVShadingRateImage.java @@ -0,0 +1,187 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_shading_rate_image extension. + * + *

By default, OpenGL runs a fragment shader once for each pixel covered by a primitive being rasterized. When using multisampling, the outputs of that + * fragment shader are broadcast to each covered sample of the fragment's pixel. When using multisampling, applications can also request that the fragment + * shader be run once per color sample (when using the {@code "sample"} qualifier on one or more active fragment shader inputs), or run a fixed number of + * times per pixel using {@link GL40#GL_SAMPLE_SHADING SAMPLE_SHADING} enable and the {@link GL40C#glMinSampleShading MinSampleShading} frequency value. In all of these approaches, the number of fragment shader + * invocations per pixel is fixed, based on API state.

+ * + *

This extension allows applications to bind and enable a shading rate image that can be used to vary the number of fragment shader invocations across + * the framebuffer. This can be useful for applications like eye tracking for virtual reality, where the portion of the framebuffer that the user is + * looking at directly can be processed at high frequency, while distant corners of the image can be processed at lower frequency. The shading rate image + * is an immutable-format two-dimensional or two-dimensional array texture that uses a format of {@link GL30#GL_R8UI R8UI}. Each texel represents a fixed-size rectangle in + * the framebuffer, covering 16x16 pixels in the initial implementation of this extension. When rasterizing a primitive covering one of these rectangles, + * the OpenGL implementation reads the texel in the bound shading rate image and looks up the fetched value in a palette of shading rates. The shading + * rate used can vary from (finest) 16 fragment shader invocations per pixel to (coarsest) one fragment shader invocation for each 4x4 block of pixels.

+ * + *

When this extension is advertised by an OpenGL implementation, the implementation must also support the GLSL extension + * {@code "GL_NV_shading_rate_image"} (documented separately), which provides new built-in variables that allow fragment shaders to determine the + * effective shading rate used for each fragment. Additionally, the GLSL extension also provides new layout qualifiers allowing the interlock + * functionality provided by ARB_fragment_shader_interlock to guarantee mutual exclusion across an entire fragment when the shading rate specifies + * multiple pixels per fragment shader invocation.

+ * + *

Note that this extension requires the use of a framebuffer object; the shading rate image and related state are ignored when rendering to the default + * framebuffer.

+ * + *

Requires {@link GL45 OpenGL 4.5} and {@link NVFramebufferMixedSamples NV_framebuffer_mixed_samples}.

+ */ +public class NVShadingRateImage { + + /** + * Accepted by the {@code cap} parameter of {@link CGL#CGLEnable Enable}, {@link CGL#CGLDisable Disable}, and {@link CGL#CGLIsEnabled IsEnabled}, by the {@code target} parameter of {@link GL30C#glEnablei Enablei}, {@link GL30C#glDisablei Disablei}, + * {@link GL30C#glIsEnabledi IsEnabledi}, {@link EXTDrawBuffers2#glEnableIndexedEXT EnableIndexedEXT}, {@link EXTDrawBuffers2#glDisableIndexedEXT DisableIndexedEXT}, and {@link EXTDrawBuffers2#glIsEnabledIndexedEXT IsEnabledIndexedEXT}, and by the {@code pname} parameter of {@link GL11C#glGetBooleanv GetBooleanv}, + * {@link GL11C#glGetIntegerv GetIntegerv}, {@link GL32C#glGetInteger64v GetInteger64v}, {@link GL11C#glGetFloatv GetFloatv}, {@link GL11C#glGetDoublev GetDoublev}, {@link EXTDirectStateAccess#glGetDoubleIndexedvEXT GetDoubleIndexedvEXT}, {@link GL30C#glGetBooleani_v GetBooleani_v}, {@link GL30C#glGetIntegeri_v GetIntegeri_v}, {@link GL32C#glGetInteger64i_v GetInteger64i_v}, + * {@link GL41C#glGetFloati_v GetFloati_v}, {@link GL41C#glGetDoublei_v GetDoublei_v}, {@link EXTDrawBuffers2#glGetBooleanIndexedvEXT GetBooleanIndexedvEXT}, {@link EXTDrawBuffers2#glGetIntegerIndexedvEXT GetIntegerIndexedvEXT}, and {@link EXTDirectStateAccess#glGetFloatIndexedvEXT GetFloatIndexedvEXT}. + */ + public static final int GL_SHADING_RATE_IMAGE_NV = 0x9563; + + /** + * Accepted in the {@code rates} parameter of {@link #glShadingRateImagePaletteNV ShadingRateImagePaletteNV} and the {@code rate} parameter of {@link #glShadingRateSampleOrderCustomNV ShadingRateSampleOrderCustomNV} and + * {@link #glGetShadingRateSampleLocationivNV GetShadingRateSampleLocationivNV}; returned in the {@code rate} parameter of {@link #glGetShadingRateImagePaletteNV GetShadingRateImagePaletteNV}. + */ + public static final int + GL_SHADING_RATE_NO_INVOCATIONS_NV = 0x9564, + GL_SHADING_RATE_1_INVOCATION_PER_PIXEL_NV = 0x9565, + GL_SHADING_RATE_1_INVOCATION_PER_1X2_PIXELS_NV = 0x9566, + GL_SHADING_RATE_1_INVOCATION_PER_2X1_PIXELS_NV = 0x9567, + GL_SHADING_RATE_1_INVOCATION_PER_2X2_PIXELS_NV = 0x9568, + GL_SHADING_RATE_1_INVOCATION_PER_2X4_PIXELS_NV = 0x9569, + GL_SHADING_RATE_1_INVOCATION_PER_4X2_PIXELS_NV = 0x956A, + GL_SHADING_RATE_1_INVOCATION_PER_4X4_PIXELS_NV = 0x956B, + GL_SHADING_RATE_2_INVOCATIONS_PER_PIXEL_NV = 0x956C, + GL_SHADING_RATE_4_INVOCATIONS_PER_PIXEL_NV = 0x956D, + GL_SHADING_RATE_8_INVOCATIONS_PER_PIXEL_NV = 0x956E, + GL_SHADING_RATE_16_INVOCATIONS_PER_PIXEL_NV = 0x956F; + + /** Accepted by the {@code pname} parameter of {@link GL11C#glGetBooleanv GetBooleanv}, {@link GL11C#glGetDoublev GetDoublev}, {@link GL11C#glGetIntegerv GetIntegerv}, and {@link GL11C#glGetFloatv GetFloatv}. */ + public static final int + GL_SHADING_RATE_IMAGE_BINDING_NV = 0x955B, + GL_SHADING_RATE_IMAGE_TEXEL_WIDTH_NV = 0x955C, + GL_SHADING_RATE_IMAGE_TEXEL_HEIGHT_NV = 0x955D, + GL_SHADING_RATE_IMAGE_PALETTE_SIZE_NV = 0x955E, + GL_MAX_COARSE_FRAGMENT_SAMPLES_NV = 0x955F; + + /** Accepted by the {@code order} parameter of {@link #glShadingRateSampleOrderNV ShadingRateSampleOrderNV}. */ + public static final int + GL_SHADING_RATE_SAMPLE_ORDER_DEFAULT_NV = 0x95AE, + GL_SHADING_RATE_SAMPLE_ORDER_PIXEL_MAJOR_NV = 0x95AF, + GL_SHADING_RATE_SAMPLE_ORDER_SAMPLE_MAJOR_NV = 0x95B0; + + static { GL.initialize(); } + + protected NVShadingRateImage() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBindShadingRateImageNV, caps.glShadingRateImagePaletteNV, caps.glGetShadingRateImagePaletteNV, caps.glShadingRateImageBarrierNV, + caps.glShadingRateSampleOrderNV, caps.glShadingRateSampleOrderCustomNV, caps.glGetShadingRateSampleLocationivNV + ); + } + + // --- [ glBindShadingRateImageNV ] --- + + public static native void glBindShadingRateImageNV(@NativeType("GLuint") int texture); + + // --- [ glShadingRateImagePaletteNV ] --- + + public static native void nglShadingRateImagePaletteNV(int viewport, int first, int count, long rates); + + public static void glShadingRateImagePaletteNV(@NativeType("GLuint") int viewport, @NativeType("GLuint") int first, @NativeType("GLenum const *") IntBuffer rates) { + nglShadingRateImagePaletteNV(viewport, first, rates.remaining(), memAddress(rates)); + } + + // --- [ glGetShadingRateImagePaletteNV ] --- + + public static native void nglGetShadingRateImagePaletteNV(int viewport, int entry, long rate); + + public static void glGetShadingRateImagePaletteNV(@NativeType("GLuint") int viewport, @NativeType("GLuint") int entry, @NativeType("GLenum *") IntBuffer rate) { + if (CHECKS) { + check(rate, 1); + } + nglGetShadingRateImagePaletteNV(viewport, entry, memAddress(rate)); + } + + // --- [ glShadingRateImageBarrierNV ] --- + + public static native void glShadingRateImageBarrierNV(@NativeType("GLboolean") boolean synchronize); + + // --- [ glShadingRateSampleOrderNV ] --- + + public static native void glShadingRateSampleOrderNV(@NativeType("GLenum") int order); + + // --- [ glShadingRateSampleOrderCustomNV ] --- + + public static native void nglShadingRateSampleOrderCustomNV(int rate, int samples, long locations); + + public static void glShadingRateSampleOrderCustomNV(@NativeType("GLenum") int rate, @NativeType("GLuint") int samples, @NativeType("GLint const *") IntBuffer locations) { + nglShadingRateSampleOrderCustomNV(rate, samples, memAddress(locations)); + } + + // --- [ glGetShadingRateSampleLocationivNV ] --- + + public static native void nglGetShadingRateSampleLocationivNV(int rate, int samples, int index, long location); + + public static void glGetShadingRateSampleLocationivNV(@NativeType("GLenum") int rate, @NativeType("GLuint") int samples, @NativeType("GLuint") int index, @NativeType("GLint *") IntBuffer location) { + if (CHECKS) { + check(location, 3); + } + nglGetShadingRateSampleLocationivNV(rate, samples, index, memAddress(location)); + } + + /** Array version of: {@link #glShadingRateImagePaletteNV ShadingRateImagePaletteNV} */ + public static void glShadingRateImagePaletteNV(@NativeType("GLuint") int viewport, @NativeType("GLuint") int first, @NativeType("GLenum const *") int[] rates) { + long __functionAddress = GL.getICD().glShadingRateImagePaletteNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(viewport, first, rates.length, rates, __functionAddress); + } + + /** Array version of: {@link #glGetShadingRateImagePaletteNV GetShadingRateImagePaletteNV} */ + public static void glGetShadingRateImagePaletteNV(@NativeType("GLuint") int viewport, @NativeType("GLuint") int entry, @NativeType("GLenum *") int[] rate) { + long __functionAddress = GL.getICD().glGetShadingRateImagePaletteNV; + if (CHECKS) { + check(__functionAddress); + check(rate, 1); + } + callPV(viewport, entry, rate, __functionAddress); + } + + /** Array version of: {@link #glShadingRateSampleOrderCustomNV ShadingRateSampleOrderCustomNV} */ + public static void glShadingRateSampleOrderCustomNV(@NativeType("GLenum") int rate, @NativeType("GLuint") int samples, @NativeType("GLint const *") int[] locations) { + long __functionAddress = GL.getICD().glShadingRateSampleOrderCustomNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(rate, samples, locations, __functionAddress); + } + + /** Array version of: {@link #glGetShadingRateSampleLocationivNV GetShadingRateSampleLocationivNV} */ + public static void glGetShadingRateSampleLocationivNV(@NativeType("GLenum") int rate, @NativeType("GLuint") int samples, @NativeType("GLuint") int index, @NativeType("GLint *") int[] location) { + long __functionAddress = GL.getICD().glGetShadingRateSampleLocationivNV; + if (CHECKS) { + check(__functionAddress); + check(location, 3); + } + callPV(rate, samples, index, location, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVTexgenReflection.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVTexgenReflection.java new file mode 100644 index 00000000..db6691b1 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVTexgenReflection.java @@ -0,0 +1,22 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the NV_texgen_reflection extension. + * + *

This extension provides two new texture coordinate generation modes that are useful texture-based lighting and environment mapping.

+ */ +public final class NVTexgenReflection { + + /** Accepted by the {@code param} parameter of TexGend, TexGenf, TexGeni when {@code pname} parameter is TEXTURE_GEN_MODE */ + public static final int + GL_NORMAL_MAP_NV = 0x8511, + GL_REFLECTION_MAP_NV = 0x8512; + + private NVTexgenReflection() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVTextureBarrier.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVTextureBarrier.java new file mode 100644 index 00000000..f2d21413 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVTextureBarrier.java @@ -0,0 +1,36 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the NV_texture_barrier extension. + * + *

This extension relaxes the restrictions on rendering to a currently bound texture and provides a mechanism to avoid read-after-write hazards.

+ */ +public class NVTextureBarrier { + + static { GL.initialize(); } + + protected NVTextureBarrier() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glTextureBarrierNV + ); + } + + // --- [ glTextureBarrierNV ] --- + + /** Guarantees that writes have completed and caches have been invalidated before subsequent Draws are executed. */ + public static native void glTextureBarrierNV(); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVTextureMultisample.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVTextureMultisample.java new file mode 100644 index 00000000..7b02a9a4 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVTextureMultisample.java @@ -0,0 +1,64 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the NV_texture_multisample extension. + * + *

This specification extends NV_gpu_program4 to support per-sample fetching from multisample textures described in + * {@link ARBTextureMultisample ARB_texture_multisample}.

+ * + *

Requires {@link GL20 OpenGL 2.0}, {@link ARBTextureMultisample ARB_texture_multisample}.

+ */ +public class NVTextureMultisample { + + /** Accepted by the {@code pname} parameter of GetTexLevelParameter. */ + public static final int + GL_TEXTURE_COVERAGE_SAMPLES_NV = 0x9045, + GL_TEXTURE_COLOR_SAMPLES_NV = 0x9046; + + static { GL.initialize(); } + + protected NVTextureMultisample() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glTexImage2DMultisampleCoverageNV, caps.glTexImage3DMultisampleCoverageNV, caps.glTextureImage2DMultisampleNV, + caps.glTextureImage3DMultisampleNV, caps.glTextureImage2DMultisampleCoverageNV, caps.glTextureImage3DMultisampleCoverageNV + ); + } + + // --- [ glTexImage2DMultisampleCoverageNV ] --- + + public static native void glTexImage2DMultisampleCoverageNV(@NativeType("GLenum") int target, @NativeType("GLsizei") int coverageSamples, @NativeType("GLsizei") int colorSamples, @NativeType("GLint") int internalFormat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLboolean") boolean fixedSampleLocations); + + // --- [ glTexImage3DMultisampleCoverageNV ] --- + + public static native void glTexImage3DMultisampleCoverageNV(@NativeType("GLenum") int target, @NativeType("GLsizei") int coverageSamples, @NativeType("GLsizei") int colorSamples, @NativeType("GLint") int internalFormat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLboolean") boolean fixedSampleLocations); + + // --- [ glTextureImage2DMultisampleNV ] --- + + public static native void glTextureImage2DMultisampleNV(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLint") int internalFormat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLboolean") boolean fixedSampleLocations); + + // --- [ glTextureImage3DMultisampleNV ] --- + + public static native void glTextureImage3DMultisampleNV(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLsizei") int samples, @NativeType("GLint") int internalFormat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLboolean") boolean fixedSampleLocations); + + // --- [ glTextureImage2DMultisampleCoverageNV ] --- + + public static native void glTextureImage2DMultisampleCoverageNV(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLsizei") int coverageSamples, @NativeType("GLsizei") int colorSamples, @NativeType("GLint") int internalFormat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLboolean") boolean fixedSampleLocations); + + // --- [ glTextureImage3DMultisampleCoverageNV ] --- + + public static native void glTextureImage3DMultisampleCoverageNV(@NativeType("GLuint") int texture, @NativeType("GLenum") int target, @NativeType("GLsizei") int coverageSamples, @NativeType("GLsizei") int colorSamples, @NativeType("GLint") int internalFormat, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth, @NativeType("GLboolean") boolean fixedSampleLocations); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVTransformFeedback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVTransformFeedback.java new file mode 100644 index 00000000..fe86f27e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVTransformFeedback.java @@ -0,0 +1,295 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_transform_feedback extension. + * + *

This extension provides a new mode to the GL, called transform feedback, which records vertex attributes of the primitives processed by the GL. The + * selected attributes are written into buffer objects, and can be written with each attribute in a separate buffer object or with all attributes + * interleaved into a single buffer object. If a geometry program or shader is active, the primitives recorded are those emitted by the geometry program. + * Otherwise, transform feedback captures primitives whose vertex are transformed by a vertex program or shader, or by fixed-function vertex processing. + * In either case, the primitives captured are those generated prior to clipping. Transform feedback mode is capable of capturing transformed vertex data + * generated by fixed-function vertex processing, outputs from assembly vertex or geometry programs, or varying variables emitted from GLSL vertex or + * geometry shaders.

+ * + *

The vertex data recorded in transform feedback mode is stored into buffer objects as an array of vertex attributes. The regular representation and the + * use of buffer objects allows the recorded data to be processed directly by the GL without requiring CPU intervention to copy data. In particular, + * transform feedback data can be used for vertex arrays (via vertex buffer objects), as the source for pixel data (via pixel buffer objects), as program + * constant data (via the NV_parameter_buffer_object or EXT_bindable_uniform extension), or via any other extension that makes use of buffer objects.

+ * + *

This extension introduces new query object support to allow transform feedback mode to operate asynchronously. Query objects allow applications to + * determine when transform feedback results are complete, as well as the number of primitives processed and written back to buffer objects while in + * transform feedback mode. This extension also provides a new rasterizer discard enable, which allows applications to use transform feedback to capture + * vertex attributes without rendering anything.

+ * + *

Requires {@link GL15 OpenGL 1.5}.

+ */ +public class NVTransformFeedback { + + /** + * Accepted by the {@code target} parameters of BindBuffer, BufferData, BufferSubData, MapBuffer, UnmapBuffer, GetBufferSubData, GetBufferPointerv, + * BindBufferRangeNV, BindBufferOffsetNV and BindBufferBaseNV. + */ + public static final int GL_TRANSFORM_FEEDBACK_BUFFER_NV = 0x8C8E; + + /** Accepted by the {@code param} parameter of GetIntegerIndexedvEXT and GetBooleanIndexedvEXT. */ + public static final int + GL_TRANSFORM_FEEDBACK_BUFFER_START_NV = 0x8C84, + GL_TRANSFORM_FEEDBACK_BUFFER_SIZE_NV = 0x8C85, + GL_TRANSFORM_FEEDBACK_RECORD_NV = 0x8C86; + + /** + * Accepted by the {@code param} parameter of GetIntegerIndexedvEXT and GetBooleanIndexedvEXT, and by the {@code pname} parameter of GetBooleanv, + * GetDoublev, GetIntegerv, and GetFloatv. + */ + public static final int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING_NV = 0x8C8F; + + /** Accepted by the {@code bufferMode} parameter of TransformFeedbackAttribsNV and TransformFeedbackVaryingsNV. */ + public static final int + GL_INTERLEAVED_ATTRIBS_NV = 0x8C8C, + GL_SEPARATE_ATTRIBS_NV = 0x8C8D; + + /** Accepted by the {@code target} parameter of BeginQuery, EndQuery, and GetQueryiv. */ + public static final int + GL_PRIMITIVES_GENERATED_NV = 0x8C87, + GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN_NV = 0x8C88; + + /** + * Accepted by the {@code cap} parameter of Enable, Disable, and IsEnabled, and by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and + * GetDoublev. + */ + public static final int GL_RASTERIZER_DISCARD_NV = 0x8C89; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS_NV = 0x8C8A, + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS_NV = 0x8C8B, + GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS_NV = 0x8C80, + GL_TRANSFORM_FEEDBACK_ATTRIBS_NV = 0x8C7E; + + /** Accepted by the {@code pname} parameter of GetProgramiv. */ + public static final int + GL_ACTIVE_VARYINGS_NV = 0x8C81, + GL_ACTIVE_VARYING_MAX_LENGTH_NV = 0x8C82, + GL_TRANSFORM_FEEDBACK_VARYINGS_NV = 0x8C83; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, GetFloatv, and GetProgramiv. */ + public static final int GL_TRANSFORM_FEEDBACK_BUFFER_MODE_NV = 0x8C7F; + + /** Accepted by the {@code attribs} parameter of TransformFeedbackAttribsNV. */ + public static final int + GL_BACK_PRIMARY_COLOR_NV = 0x8C77, + GL_BACK_SECONDARY_COLOR_NV = 0x8C78, + GL_TEXTURE_COORD_NV = 0x8C79, + GL_CLIP_DISTANCE_NV = 0x8C7A, + GL_VERTEX_ID_NV = 0x8C7B, + GL_PRIMITIVE_ID_NV = 0x8C7C, + GL_GENERIC_ATTRIB_NV = 0x8C7D, + GL_SECONDARY_COLOR_NV = 0x852D, + GL_LAYER_NV = 0x8DAA; + + static { GL.initialize(); } + + protected NVTransformFeedback() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBeginTransformFeedbackNV, caps.glEndTransformFeedbackNV, caps.glTransformFeedbackAttribsNV, caps.glBindBufferRangeNV, + caps.glBindBufferOffsetNV, caps.glBindBufferBaseNV, caps.glTransformFeedbackVaryingsNV, caps.glActiveVaryingNV, caps.glGetVaryingLocationNV, + caps.glGetActiveVaryingNV, caps.glGetTransformFeedbackVaryingNV, caps.glTransformFeedbackStreamAttribsNV + ); + } + + // --- [ glBeginTransformFeedbackNV ] --- + + public static native void glBeginTransformFeedbackNV(@NativeType("GLenum") int primitiveMode); + + // --- [ glEndTransformFeedbackNV ] --- + + public static native void glEndTransformFeedbackNV(); + + // --- [ glTransformFeedbackAttribsNV ] --- + + public static native void nglTransformFeedbackAttribsNV(int count, long attribs, int bufferMode); + + public static void glTransformFeedbackAttribsNV(@NativeType("GLint const *") IntBuffer attribs, @NativeType("GLenum") int bufferMode) { + nglTransformFeedbackAttribsNV(attribs.remaining(), memAddress(attribs), bufferMode); + } + + // --- [ glBindBufferRangeNV ] --- + + public static native void glBindBufferRangeNV(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset, @NativeType("GLsizeiptr") long size); + + // --- [ glBindBufferOffsetNV ] --- + + public static native void glBindBufferOffsetNV(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLuint") int buffer, @NativeType("GLintptr") long offset); + + // --- [ glBindBufferBaseNV ] --- + + public static native void glBindBufferBaseNV(@NativeType("GLenum") int target, @NativeType("GLuint") int index, @NativeType("GLuint") int buffer); + + // --- [ glTransformFeedbackVaryingsNV ] --- + + public static native void nglTransformFeedbackVaryingsNV(int program, int count, long locations, int bufferMode); + + public static void glTransformFeedbackVaryingsNV(@NativeType("GLuint") int program, @NativeType("GLint const *") IntBuffer locations, @NativeType("GLenum") int bufferMode) { + nglTransformFeedbackVaryingsNV(program, locations.remaining(), memAddress(locations), bufferMode); + } + + // --- [ glActiveVaryingNV ] --- + + public static native void nglActiveVaryingNV(int program, long name); + + public static void glActiveVaryingNV(@NativeType("GLuint") int program, @NativeType("GLchar const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + nglActiveVaryingNV(program, memAddress(name)); + } + + public static void glActiveVaryingNV(@NativeType("GLuint") int program, @NativeType("GLchar const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + nglActiveVaryingNV(program, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetVaryingLocationNV ] --- + + public static native int nglGetVaryingLocationNV(int program, long name); + + @NativeType("GLint") + public static int glGetVaryingLocationNV(@NativeType("GLuint") int program, @NativeType("GLchar const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nglGetVaryingLocationNV(program, memAddress(name)); + } + + @NativeType("GLint") + public static int glGetVaryingLocationNV(@NativeType("GLuint") int program, @NativeType("GLchar const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + return nglGetVaryingLocationNV(program, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetActiveVaryingNV ] --- + + public static native void nglGetActiveVaryingNV(int program, int index, int bufSize, long length, long size, long type, long name); + + public static void glGetActiveVaryingNV(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") IntBuffer length, @NativeType("GLsizei *") IntBuffer size, @NativeType("GLenum *") IntBuffer type, @NativeType("GLchar *") ByteBuffer name) { + if (CHECKS) { + checkSafe(length, 1); + check(size, 1); + check(type, 1); + } + nglGetActiveVaryingNV(program, index, name.remaining(), memAddressSafe(length), memAddress(size), memAddress(type), memAddress(name)); + } + + // --- [ glGetTransformFeedbackVaryingNV ] --- + + public static native void nglGetTransformFeedbackVaryingNV(int program, int index, long location); + + public static void glGetTransformFeedbackVaryingNV(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @NativeType("GLint *") IntBuffer location) { + if (CHECKS) { + check(location, 1); + } + nglGetTransformFeedbackVaryingNV(program, index, memAddress(location)); + } + + @NativeType("void") + public static int glGetTransformFeedbackVaryingNV(@NativeType("GLuint") int program, @NativeType("GLuint") int index) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer location = stack.callocInt(1); + nglGetTransformFeedbackVaryingNV(program, index, memAddress(location)); + return location.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glTransformFeedbackStreamAttribsNV ] --- + + public static native void nglTransformFeedbackStreamAttribsNV(int count, long attribs, int nbuffers, long bufstreams, int bufferMode); + + public static void glTransformFeedbackStreamAttribsNV(@NativeType("GLint const *") IntBuffer attribs, @NativeType("GLint const *") IntBuffer bufstreams, @NativeType("GLenum") int bufferMode) { + nglTransformFeedbackStreamAttribsNV(attribs.remaining(), memAddress(attribs), bufstreams.remaining(), memAddress(bufstreams), bufferMode); + } + + /** Array version of: {@link #glTransformFeedbackAttribsNV TransformFeedbackAttribsNV} */ + public static void glTransformFeedbackAttribsNV(@NativeType("GLint const *") int[] attribs, @NativeType("GLenum") int bufferMode) { + long __functionAddress = GL.getICD().glTransformFeedbackAttribsNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(attribs.length, attribs, bufferMode, __functionAddress); + } + + /** Array version of: {@link #glTransformFeedbackVaryingsNV TransformFeedbackVaryingsNV} */ + public static void glTransformFeedbackVaryingsNV(@NativeType("GLuint") int program, @NativeType("GLint const *") int[] locations, @NativeType("GLenum") int bufferMode) { + long __functionAddress = GL.getICD().glTransformFeedbackVaryingsNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(program, locations.length, locations, bufferMode, __functionAddress); + } + + /** Array version of: {@link #glGetActiveVaryingNV GetActiveVaryingNV} */ + public static void glGetActiveVaryingNV(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @Nullable @NativeType("GLsizei *") int[] length, @NativeType("GLsizei *") int[] size, @NativeType("GLenum *") int[] type, @NativeType("GLchar *") ByteBuffer name) { + long __functionAddress = GL.getICD().glGetActiveVaryingNV; + if (CHECKS) { + check(__functionAddress); + checkSafe(length, 1); + check(size, 1); + check(type, 1); + } + callPPPPV(program, index, name.remaining(), length, size, type, memAddress(name), __functionAddress); + } + + /** Array version of: {@link #glGetTransformFeedbackVaryingNV GetTransformFeedbackVaryingNV} */ + public static void glGetTransformFeedbackVaryingNV(@NativeType("GLuint") int program, @NativeType("GLuint") int index, @NativeType("GLint *") int[] location) { + long __functionAddress = GL.getICD().glGetTransformFeedbackVaryingNV; + if (CHECKS) { + check(__functionAddress); + check(location, 1); + } + callPV(program, index, location, __functionAddress); + } + + /** Array version of: {@link #glTransformFeedbackStreamAttribsNV TransformFeedbackStreamAttribsNV} */ + public static void glTransformFeedbackStreamAttribsNV(@NativeType("GLint const *") int[] attribs, @NativeType("GLint const *") int[] bufstreams, @NativeType("GLenum") int bufferMode) { + long __functionAddress = GL.getICD().glTransformFeedbackStreamAttribsNV; + if (CHECKS) { + check(__functionAddress); + } + callPPV(attribs.length, attribs, bufstreams.length, bufstreams, bufferMode, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVTransformFeedback2.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVTransformFeedback2.java new file mode 100644 index 00000000..5540b8a8 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVTransformFeedback2.java @@ -0,0 +1,140 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_transform_feedback2 extension. + * + *

The NV_transform_feedback and EXT_transform_feedback extensions allow applications to capture primitives to one or more buffer objects when transformed + * by the GL. This extension provides a few additional capabilities to these extensions, making transform feedback mode more useful.

+ * + *

First, it provides transform feedback objects encapsulating transform feedback-related state, allowing applications to replace the entire transform + * feedback configuration in a single bind call. Second, it provides the ability to pause and resume transform feedback operations. When transform + * feedback is paused, applications may render without transform feedback or may use transform feedback with different state and a different transform + * feedback object. When transform feedback is resumed, additional primitives are captured and appended to previously captured primitives for the object.

+ * + *

Additionally, this extension provides the ability to draw primitives captured in transform feedback mode without querying the captured primitive count. + * The command DrawTransformFeedbackNV() is equivalent to {@code glDrawArrays(, 0, )}, where {@code count} is the number of vertices captured + * to buffer objects during the last transform feedback capture operation on the transform feedback object used. This draw operation only provides a + * vertex count -- it does not automatically set up vertex array state or vertex buffer object bindings, which must be done separately by the application.

+ * + *

Requires {@link GL15 OpenGL 1.5} and {@link NVTransformFeedback NV_transform_feedback} or {@link EXTTransformFeedback EXT_transform_feedback}.

+ */ +public class NVTransformFeedback2 { + + /** Accepted by the {@code target} parameter of BindTransformFeedbackNV. */ + public static final int GL_TRANSFORM_FEEDBACK_NV = 0x8E22; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetDoublev, GetIntegerv, and GetFloatv. */ + public static final int + GL_TRANSFORM_FEEDBACK_BUFFER_PAUSED_NV = 0x8E23, + GL_TRANSFORM_FEEDBACK_BUFFER_ACTIVE_NV = 0x8E24, + GL_TRANSFORM_FEEDBACK_BINDING_NV = 0x8E25; + + static { GL.initialize(); } + + protected NVTransformFeedback2() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBindTransformFeedbackNV, caps.glDeleteTransformFeedbacksNV, caps.glGenTransformFeedbacksNV, caps.glIsTransformFeedbackNV, + caps.glPauseTransformFeedbackNV, caps.glResumeTransformFeedbackNV, caps.glDrawTransformFeedbackNV + ); + } + + // --- [ glBindTransformFeedbackNV ] --- + + public static native void glBindTransformFeedbackNV(@NativeType("GLenum") int target, @NativeType("GLuint") int id); + + // --- [ glDeleteTransformFeedbacksNV ] --- + + public static native void nglDeleteTransformFeedbacksNV(int n, long ids); + + public static void glDeleteTransformFeedbacksNV(@NativeType("GLuint const *") IntBuffer ids) { + nglDeleteTransformFeedbacksNV(ids.remaining(), memAddress(ids)); + } + + public static void glDeleteTransformFeedbacksNV(@NativeType("GLuint const *") int id) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer ids = stack.ints(id); + nglDeleteTransformFeedbacksNV(1, memAddress(ids)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGenTransformFeedbacksNV ] --- + + public static native void nglGenTransformFeedbacksNV(int n, long ids); + + public static void glGenTransformFeedbacksNV(@NativeType("GLuint *") IntBuffer ids) { + if (CHECKS) { + check(ids, 1); + } + nglGenTransformFeedbacksNV(ids.remaining(), memAddress(ids)); + } + + @NativeType("void") + public static int glGenTransformFeedbacksNV() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer ids = stack.callocInt(1); + nglGenTransformFeedbacksNV(1, memAddress(ids)); + return ids.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glIsTransformFeedbackNV ] --- + + @NativeType("GLboolean") + public static native boolean glIsTransformFeedbackNV(@NativeType("GLuint") int id); + + // --- [ glPauseTransformFeedbackNV ] --- + + public static native void glPauseTransformFeedbackNV(); + + // --- [ glResumeTransformFeedbackNV ] --- + + public static native void glResumeTransformFeedbackNV(); + + // --- [ glDrawTransformFeedbackNV ] --- + + public static native void glDrawTransformFeedbackNV(@NativeType("GLenum") int mode, @NativeType("GLuint") int id); + + /** Array version of: {@link #glDeleteTransformFeedbacksNV DeleteTransformFeedbacksNV} */ + public static void glDeleteTransformFeedbacksNV(@NativeType("GLuint const *") int[] ids) { + long __functionAddress = GL.getICD().glDeleteTransformFeedbacksNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(ids.length, ids, __functionAddress); + } + + /** Array version of: {@link #glGenTransformFeedbacksNV GenTransformFeedbacksNV} */ + public static void glGenTransformFeedbacksNV(@NativeType("GLuint *") int[] ids) { + long __functionAddress = GL.getICD().glGenTransformFeedbacksNV; + if (CHECKS) { + check(__functionAddress); + check(ids, 1); + } + callPV(ids.length, ids, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVUniformBufferUnifiedMemory.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVUniformBufferUnifiedMemory.java new file mode 100644 index 00000000..4be20aa2 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVUniformBufferUnifiedMemory.java @@ -0,0 +1,34 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the NV_uniform_buffer_unified_memory extension. + * + *

This extension provides a mechanism to specify uniform buffers + * using GPU addresses.

+ * + *

Binding uniform buffers is one of the most frequent and expensive + * operations in many GL applications, due to the cost of chasing + * pointers and binding objects described in the overview of + * NV_shader_buffer_load. The intent of this extension is to enable a + * way for the application to specify uniform buffer state that alleviates + * the overhead of object binds and driver memory management.

+ */ +public final class NVUniformBufferUnifiedMemory { + + /** Accepted by the {@code cap} parameter of DisableClientState, EnableClientState, IsEnabled. */ + public static final int GL_UNIFORM_BUFFER_UNIFIED_NV = 0x936E; + + /** Accepted by the {@code pname} parameter of BufferAddressRangeNV and the {@code value} parameter of GetIntegerui64i_vNV. */ + public static final int GL_UNIFORM_BUFFER_ADDRESS_NV = 0x936F; + + /** Accepted by the {@code target} parameter of GetIntegeri_vNV. */ + public static final int GL_UNIFORM_BUFFER_LENGTH_NV = 0x9370; + + private NVUniformBufferUnifiedMemory() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVVertexArrayRange.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVVertexArrayRange.java new file mode 100644 index 00000000..63e60405 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVVertexArrayRange.java @@ -0,0 +1,59 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_vertex_array_range extension. + * + *

The goal of this extension is to permit extremely high vertex processing rates via OpenGL vertex arrays even when the CPU lacks the necessary data + * movement bandwidth to keep up with the rate at which the vertex engine can consume vertices.

+ */ +public class NVVertexArrayRange { + + /** Accepted by the {@code cap} parameter of EnableClientState, DisableClientState, and IsEnabled. */ + public static final int GL_VERTEX_ARRAY_RANGE_NV = 0x851D; + + /** Accepted by the {@code pname} parameter of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + GL_VERTEX_ARRAY_RANGE_LENGTH_NV = 0x851E, + GL_VERTEX_ARRAY_RANGE_VALID_NV = 0x851F, + GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV = 0x8520; + + /** Accepted by the {@code pname} parameter of GetPointerv. */ + public static final int GL_VERTEX_ARRAY_RANGE_POINTER_NV = 0x8521; + + static { GL.initialize(); } + + protected NVVertexArrayRange() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glVertexArrayRangeNV, caps.glFlushVertexArrayRangeNV + ); + } + + // --- [ glVertexArrayRangeNV ] --- + + public static native void nglVertexArrayRangeNV(int length, long pointer); + + public static void glVertexArrayRangeNV(@NativeType("void *") ByteBuffer pointer) { + nglVertexArrayRangeNV(pointer.remaining(), memAddress(pointer)); + } + + // --- [ glFlushVertexArrayRangeNV ] --- + + public static native void glFlushVertexArrayRangeNV(); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVVertexArrayRange2.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVVertexArrayRange2.java new file mode 100644 index 00000000..4c3a2f05 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVVertexArrayRange2.java @@ -0,0 +1,27 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the NV_vertex_array_range2 extension. + * + *

Enabling and disabling the vertex array range is specified by the original NV_vertex_array_range extension specification to flush the vertex array + * range implicitly. In retrospect, this semantic is extremely misconceived and creates terrible performance problems for any application that wishes to + * mix conventional vertex arrays with vertex arrange range-enabled vertex arrays.

+ * + *

This extension provides a new token for enabling/disabling the vertex array range that does NOT perform an implicit vertex array range flush when the + * enable/disable is performed.

+ * + *

Requires {@link NVVertexArrayRange NV_vertex_array_range}.

+ */ +public final class NVVertexArrayRange2 { + + /** Accepted by the {@code cap} parameter of EnableClientState, DisableClientState. */ + public static final int GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV = 0x8533; + + private NVVertexArrayRange2() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVVertexAttribInteger64bit.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVVertexAttribInteger64bit.java new file mode 100644 index 00000000..ccb127a5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVVertexAttribInteger64bit.java @@ -0,0 +1,321 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_vertex_attrib_integer_64bit extension. + * + *

This extension provides support for specifying vertex attributes with 64-bit integer components, analagous to the 64-bit floating point support added + * in EXT_vertex_attrib_64bit.

+ * + *

Additionally, it provides the VertexAttribLFormatNV entry point to specify bindless vertex attribute arrays with 64-bit integer or floating-point + * components in conjunction with the NV_vertex_buffer_unified_memory extension.

+ * + *

Requires {@link GL30 OpenGL 3.0}, GLSL 1.30, {@link NVGPUShader5 NV_gpu_shader5} or equivalent functionality and {@link EXTVertexAttrib64bit EXT_vertex_attrib_64bit}.

+ */ +public class NVVertexAttribInteger64bit { + + /** Accepted by the {@code type} parameter of VertexAttribLPointerEXT, VertexArrayVertexAttribLOffsetEXT, and VertexAttribLFormatNV. */ + public static final int + GL_INT64_NV = 0x140E, + GL_UNSIGNED_INT64_NV = 0x140F; + + static { GL.initialize(); } + + protected NVVertexAttribInteger64bit() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glVertexAttribL1i64NV, caps.glVertexAttribL2i64NV, caps.glVertexAttribL3i64NV, caps.glVertexAttribL4i64NV, caps.glVertexAttribL1i64vNV, + caps.glVertexAttribL2i64vNV, caps.glVertexAttribL3i64vNV, caps.glVertexAttribL4i64vNV, caps.glVertexAttribL1ui64NV, caps.glVertexAttribL2ui64NV, + caps.glVertexAttribL3ui64NV, caps.glVertexAttribL4ui64NV, caps.glVertexAttribL1ui64vNV, caps.glVertexAttribL2ui64vNV, caps.glVertexAttribL3ui64vNV, + caps.glVertexAttribL4ui64vNV, caps.glGetVertexAttribLi64vNV, caps.glGetVertexAttribLui64vNV, + ext.contains("GL_NV_vertex_buffer_unified_memory") ? caps.glVertexAttribLFormatNV : -1L + ); + } + + // --- [ glVertexAttribL1i64NV ] --- + + public static native void glVertexAttribL1i64NV(@NativeType("GLuint") int index, @NativeType("GLint64EXT") long x); + + // --- [ glVertexAttribL2i64NV ] --- + + public static native void glVertexAttribL2i64NV(@NativeType("GLuint") int index, @NativeType("GLint64EXT") long x, @NativeType("GLint64EXT") long y); + + // --- [ glVertexAttribL3i64NV ] --- + + public static native void glVertexAttribL3i64NV(@NativeType("GLuint") int index, @NativeType("GLint64EXT") long x, @NativeType("GLint64EXT") long y, @NativeType("GLint64EXT") long z); + + // --- [ glVertexAttribL4i64NV ] --- + + public static native void glVertexAttribL4i64NV(@NativeType("GLuint") int index, @NativeType("GLint64EXT") long x, @NativeType("GLint64EXT") long y, @NativeType("GLint64EXT") long z, @NativeType("GLint64EXT") long w); + + // --- [ glVertexAttribL1i64vNV ] --- + + public static native void nglVertexAttribL1i64vNV(int index, long v); + + public static void glVertexAttribL1i64vNV(@NativeType("GLuint") int index, @NativeType("GLint64EXT const *") LongBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglVertexAttribL1i64vNV(index, memAddress(v)); + } + + // --- [ glVertexAttribL2i64vNV ] --- + + public static native void nglVertexAttribL2i64vNV(int index, long v); + + public static void glVertexAttribL2i64vNV(@NativeType("GLuint") int index, @NativeType("GLint64EXT const *") LongBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglVertexAttribL2i64vNV(index, memAddress(v)); + } + + // --- [ glVertexAttribL3i64vNV ] --- + + public static native void nglVertexAttribL3i64vNV(int index, long v); + + public static void glVertexAttribL3i64vNV(@NativeType("GLuint") int index, @NativeType("GLint64EXT const *") LongBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglVertexAttribL3i64vNV(index, memAddress(v)); + } + + // --- [ glVertexAttribL4i64vNV ] --- + + public static native void nglVertexAttribL4i64vNV(int index, long v); + + public static void glVertexAttribL4i64vNV(@NativeType("GLuint") int index, @NativeType("GLint64EXT const *") LongBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttribL4i64vNV(index, memAddress(v)); + } + + // --- [ glVertexAttribL1ui64NV ] --- + + public static native void glVertexAttribL1ui64NV(@NativeType("GLuint") int index, @NativeType("GLuint64EXT") long x); + + // --- [ glVertexAttribL2ui64NV ] --- + + public static native void glVertexAttribL2ui64NV(@NativeType("GLuint") int index, @NativeType("GLuint64EXT") long x, @NativeType("GLuint64EXT") long y); + + // --- [ glVertexAttribL3ui64NV ] --- + + public static native void glVertexAttribL3ui64NV(@NativeType("GLuint") int index, @NativeType("GLuint64EXT") long x, @NativeType("GLuint64EXT") long y, @NativeType("GLuint64EXT") long z); + + // --- [ glVertexAttribL4ui64NV ] --- + + public static native void glVertexAttribL4ui64NV(@NativeType("GLuint") int index, @NativeType("GLuint64EXT") long x, @NativeType("GLuint64EXT") long y, @NativeType("GLuint64EXT") long z, @NativeType("GLuint64EXT") long w); + + // --- [ glVertexAttribL1ui64vNV ] --- + + public static native void nglVertexAttribL1ui64vNV(int index, long v); + + public static void glVertexAttribL1ui64vNV(@NativeType("GLuint") int index, @NativeType("GLuint64EXT const *") LongBuffer v) { + if (CHECKS) { + check(v, 1); + } + nglVertexAttribL1ui64vNV(index, memAddress(v)); + } + + // --- [ glVertexAttribL2ui64vNV ] --- + + public static native void nglVertexAttribL2ui64vNV(int index, long v); + + public static void glVertexAttribL2ui64vNV(@NativeType("GLuint") int index, @NativeType("GLuint64EXT const *") LongBuffer v) { + if (CHECKS) { + check(v, 2); + } + nglVertexAttribL2ui64vNV(index, memAddress(v)); + } + + // --- [ glVertexAttribL3ui64vNV ] --- + + public static native void nglVertexAttribL3ui64vNV(int index, long v); + + public static void glVertexAttribL3ui64vNV(@NativeType("GLuint") int index, @NativeType("GLuint64EXT const *") LongBuffer v) { + if (CHECKS) { + check(v, 3); + } + nglVertexAttribL3ui64vNV(index, memAddress(v)); + } + + // --- [ glVertexAttribL4ui64vNV ] --- + + public static native void nglVertexAttribL4ui64vNV(int index, long v); + + public static void glVertexAttribL4ui64vNV(@NativeType("GLuint") int index, @NativeType("GLuint64EXT const *") LongBuffer v) { + if (CHECKS) { + check(v, 4); + } + nglVertexAttribL4ui64vNV(index, memAddress(v)); + } + + // --- [ glGetVertexAttribLi64vNV ] --- + + public static native void nglGetVertexAttribLi64vNV(int index, int pname, long params); + + public static void glGetVertexAttribLi64vNV(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint64EXT *") LongBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetVertexAttribLi64vNV(index, pname, memAddress(params)); + } + + @NativeType("void") + public static long glGetVertexAttribLi64NV(@NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglGetVertexAttribLi64vNV(index, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glGetVertexAttribLui64vNV ] --- + + public static native void nglGetVertexAttribLui64vNV(int index, int pname, long params); + + public static void glGetVertexAttribLui64vNV(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLuint64EXT *") LongBuffer params) { + if (CHECKS) { + check(params, 1); + } + nglGetVertexAttribLui64vNV(index, pname, memAddress(params)); + } + + @NativeType("void") + public static long glGetVertexAttribLui64NV(@NativeType("GLuint") int index, @NativeType("GLenum") int pname) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer params = stack.callocLong(1); + nglGetVertexAttribLui64vNV(index, pname, memAddress(params)); + return params.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ glVertexAttribLFormatNV ] --- + + public static native void glVertexAttribLFormatNV(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride); + + /** Array version of: {@link #glVertexAttribL1i64vNV VertexAttribL1i64vNV} */ + public static void glVertexAttribL1i64vNV(@NativeType("GLuint") int index, @NativeType("GLint64EXT const *") long[] v) { + long __functionAddress = GL.getICD().glVertexAttribL1i64vNV; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribL2i64vNV VertexAttribL2i64vNV} */ + public static void glVertexAttribL2i64vNV(@NativeType("GLuint") int index, @NativeType("GLint64EXT const *") long[] v) { + long __functionAddress = GL.getICD().glVertexAttribL2i64vNV; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribL3i64vNV VertexAttribL3i64vNV} */ + public static void glVertexAttribL3i64vNV(@NativeType("GLuint") int index, @NativeType("GLint64EXT const *") long[] v) { + long __functionAddress = GL.getICD().glVertexAttribL3i64vNV; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribL4i64vNV VertexAttribL4i64vNV} */ + public static void glVertexAttribL4i64vNV(@NativeType("GLuint") int index, @NativeType("GLint64EXT const *") long[] v) { + long __functionAddress = GL.getICD().glVertexAttribL4i64vNV; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribL1ui64vNV VertexAttribL1ui64vNV} */ + public static void glVertexAttribL1ui64vNV(@NativeType("GLuint") int index, @NativeType("GLuint64EXT const *") long[] v) { + long __functionAddress = GL.getICD().glVertexAttribL1ui64vNV; + if (CHECKS) { + check(__functionAddress); + check(v, 1); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribL2ui64vNV VertexAttribL2ui64vNV} */ + public static void glVertexAttribL2ui64vNV(@NativeType("GLuint") int index, @NativeType("GLuint64EXT const *") long[] v) { + long __functionAddress = GL.getICD().glVertexAttribL2ui64vNV; + if (CHECKS) { + check(__functionAddress); + check(v, 2); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribL3ui64vNV VertexAttribL3ui64vNV} */ + public static void glVertexAttribL3ui64vNV(@NativeType("GLuint") int index, @NativeType("GLuint64EXT const *") long[] v) { + long __functionAddress = GL.getICD().glVertexAttribL3ui64vNV; + if (CHECKS) { + check(__functionAddress); + check(v, 3); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glVertexAttribL4ui64vNV VertexAttribL4ui64vNV} */ + public static void glVertexAttribL4ui64vNV(@NativeType("GLuint") int index, @NativeType("GLuint64EXT const *") long[] v) { + long __functionAddress = GL.getICD().glVertexAttribL4ui64vNV; + if (CHECKS) { + check(__functionAddress); + check(v, 4); + } + callPV(index, v, __functionAddress); + } + + /** Array version of: {@link #glGetVertexAttribLi64vNV GetVertexAttribLi64vNV} */ + public static void glGetVertexAttribLi64vNV(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLint64EXT *") long[] params) { + long __functionAddress = GL.getICD().glGetVertexAttribLi64vNV; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(index, pname, params, __functionAddress); + } + + /** Array version of: {@link #glGetVertexAttribLui64vNV GetVertexAttribLui64vNV} */ + public static void glGetVertexAttribLui64vNV(@NativeType("GLuint") int index, @NativeType("GLenum") int pname, @NativeType("GLuint64EXT *") long[] params) { + long __functionAddress = GL.getICD().glGetVertexAttribLui64vNV; + if (CHECKS) { + check(__functionAddress); + check(params, 1); + } + callPV(index, pname, params, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVVertexBufferUnifiedMemory.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVVertexBufferUnifiedMemory.java new file mode 100644 index 00000000..63ed3d59 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVVertexBufferUnifiedMemory.java @@ -0,0 +1,156 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NV_vertex_buffer_unified_memory extension. + * + *

This extension provides a mechanism to specify vertex attrib and element array locations using GPU addresses.

+ * + *

Binding vertex buffers is one of the most frequent and expensive operations in many GL applications, due to the cost of chasing pointers and binding + * objects described in the Overview of {@link NVShaderBufferLoad NV_shader_buffer_load}. The intent of this extension is to enable a way for the application to specify + * vertex attrib state that alleviates the overhead of object binds and driver memory management.

+ */ +public class NVVertexBufferUnifiedMemory { + + /** Accepted by the {@code cap} parameter of DisableClientState, EnableClientState, IsEnabled. */ + public static final int + GL_VERTEX_ATTRIB_ARRAY_UNIFIED_NV = 0x8F1E, + GL_ELEMENT_ARRAY_UNIFIED_NV = 0x8F1F; + + /** Accepted by the {@code pname} parameter of BufferAddressRangeNV and the {@code value} parameter of GetIntegerui64i_vNV. */ + public static final int + GL_VERTEX_ATTRIB_ARRAY_ADDRESS_NV = 0x8F20, + GL_TEXTURE_COORD_ARRAY_ADDRESS_NV = 0x8F25; + + /** Accepted by the {@code pname} parameter of BufferAddressRangeNV and the {@code value} parameter of GetIntegerui64vNV. */ + public static final int + GL_VERTEX_ARRAY_ADDRESS_NV = 0x8F21, + GL_NORMAL_ARRAY_ADDRESS_NV = 0x8F22, + GL_COLOR_ARRAY_ADDRESS_NV = 0x8F23, + GL_INDEX_ARRAY_ADDRESS_NV = 0x8F24, + GL_EDGE_FLAG_ARRAY_ADDRESS_NV = 0x8F26, + GL_SECONDARY_COLOR_ARRAY_ADDRESS_NV = 0x8F27, + GL_FOG_COORD_ARRAY_ADDRESS_NV = 0x8F28, + GL_ELEMENT_ARRAY_ADDRESS_NV = 0x8F29; + + /** Accepted by the {@code target} parameter of GetIntegeri_vNV. */ + public static final int + GL_VERTEX_ATTRIB_ARRAY_LENGTH_NV = 0x8F2A, + GL_TEXTURE_COORD_ARRAY_LENGTH_NV = 0x8F2F; + + /** Accepted by the {@code value} parameter of GetIntegerv. */ + public static final int + GL_VERTEX_ARRAY_LENGTH_NV = 0x8F2B, + GL_NORMAL_ARRAY_LENGTH_NV = 0x8F2C, + GL_COLOR_ARRAY_LENGTH_NV = 0x8F2D, + GL_INDEX_ARRAY_LENGTH_NV = 0x8F2E, + GL_EDGE_FLAG_ARRAY_LENGTH_NV = 0x8F30, + GL_SECONDARY_COLOR_ARRAY_LENGTH_NV = 0x8F31, + GL_FOG_COORD_ARRAY_LENGTH_NV = 0x8F32, + GL_ELEMENT_ARRAY_LENGTH_NV = 0x8F33; + + static { GL.initialize(); } + + protected NVVertexBufferUnifiedMemory() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBufferAddressRangeNV, caps.glVertexFormatNV, caps.glNormalFormatNV, caps.glColorFormatNV, caps.glIndexFormatNV, caps.glTexCoordFormatNV, + caps.glEdgeFlagFormatNV, caps.glSecondaryColorFormatNV, caps.glFogCoordFormatNV, caps.glVertexAttribFormatNV, caps.glVertexAttribIFormatNV, + caps.glGetIntegerui64i_vNV + ); + } + + // --- [ glBufferAddressRangeNV ] --- + + public static native void glBufferAddressRangeNV(@NativeType("GLenum") int pname, @NativeType("GLuint") int index, @NativeType("GLuint64EXT") long address, @NativeType("GLsizeiptr") long length); + + // --- [ glVertexFormatNV ] --- + + public static native void glVertexFormatNV(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride); + + // --- [ glNormalFormatNV ] --- + + public static native void glNormalFormatNV(@NativeType("GLenum") int type, @NativeType("GLsizei") int stride); + + // --- [ glColorFormatNV ] --- + + public static native void glColorFormatNV(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride); + + // --- [ glIndexFormatNV ] --- + + public static native void glIndexFormatNV(@NativeType("GLenum") int type, @NativeType("GLsizei") int stride); + + // --- [ glTexCoordFormatNV ] --- + + public static native void glTexCoordFormatNV(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride); + + // --- [ glEdgeFlagFormatNV ] --- + + public static native void glEdgeFlagFormatNV(@NativeType("GLsizei") int stride); + + // --- [ glSecondaryColorFormatNV ] --- + + public static native void glSecondaryColorFormatNV(@NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride); + + // --- [ glFogCoordFormatNV ] --- + + public static native void glFogCoordFormatNV(@NativeType("GLenum") int type, @NativeType("GLsizei") int stride); + + // --- [ glVertexAttribFormatNV ] --- + + public static native void glVertexAttribFormatNV(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLboolean") boolean normalized, @NativeType("GLsizei") int stride); + + // --- [ glVertexAttribIFormatNV ] --- + + public static native void glVertexAttribIFormatNV(@NativeType("GLuint") int index, @NativeType("GLint") int size, @NativeType("GLenum") int type, @NativeType("GLsizei") int stride); + + // --- [ glGetIntegerui64i_vNV ] --- + + public static native void nglGetIntegerui64i_vNV(int value, int index, long result); + + public static void glGetIntegerui64i_vNV(@NativeType("GLenum") int value, @NativeType("GLuint") int index, @NativeType("GLuint64EXT *") LongBuffer result) { + if (CHECKS) { + check(result, 1); + } + nglGetIntegerui64i_vNV(value, index, memAddress(result)); + } + + @NativeType("void") + public static long glGetIntegerui64iNV(@NativeType("GLenum") int value, @NativeType("GLuint") int index) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + LongBuffer result = stack.callocLong(1); + nglGetIntegerui64i_vNV(value, index, memAddress(result)); + return result.get(0); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #glGetIntegerui64i_vNV GetIntegerui64i_vNV} */ + public static void glGetIntegerui64i_vNV(@NativeType("GLenum") int value, @NativeType("GLuint") int index, @NativeType("GLuint64EXT *") long[] result) { + long __functionAddress = GL.getICD().glGetIntegerui64i_vNV; + if (CHECKS) { + check(__functionAddress); + check(result, 1); + } + callPV(value, index, result, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVViewportSwizzle.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVViewportSwizzle.java new file mode 100644 index 00000000..f21c2de6 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVViewportSwizzle.java @@ -0,0 +1,69 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the NV_viewport_swizzle extension. + * + *

This extension provides a new per-viewport swizzle that can modify the position of primitives sent to each viewport. New viewport swizzle state is + * added for each viewport, and a new position vector is computed for each vertex by selecting from and optionally negating any of the four components of + * the original position vector.

+ * + *

This new viewport swizzle is useful for a number of algorithms, including single-pass cubemap rendering (broadcasting a primitive to multiple faces and + * reorienting the vertex position for each face) and voxel rasterization. The per-viewport component remapping and negation provided by the swizzle + * allows application code to re-orient three-dimensional geometry with a view along any of the X, Y, or Z axes. If a perspective projection and depth + * buffering is required, 1/W buffering should be used, as described in the single-pass cubemap rendering example in the "Issues" section below.

+ */ +public class NVViewportSwizzle { + + /** Accepted by the {@code swizzlex}, {@code swizzley}, {@code swizzlez}, and {@code swizzlew} parameters of ViewportSwizzleNV. */ + public static final int + GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV = 0x9350, + GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV = 0x9351, + GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV = 0x9352, + GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV = 0x9353, + GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV = 0x9354, + GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV = 0x9355, + GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV = 0x9356, + GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV = 0x9357; + + /** Accepted by the {@code pname} parameter of GetBooleani_v, GetDoublei_v, GetIntegeri_v, GetFloati_v, and GetInteger64i_v. */ + public static final int + GL_VIEWPORT_SWIZZLE_X_NV = 0x9358, + GL_VIEWPORT_SWIZZLE_Y_NV = 0x9359, + GL_VIEWPORT_SWIZZLE_Z_NV = 0x935A, + GL_VIEWPORT_SWIZZLE_W_NV = 0x935B; + + static { GL.initialize(); } + + protected NVViewportSwizzle() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glViewportSwizzleNV + ); + } + + // --- [ glViewportSwizzleNV ] --- + + /** + * Sets the swizzle state for the specified viewport. + * + * @param index the viewport index + * @param swizzlex the x swizzle state. One of:
{@link #GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV VIEWPORT_SWIZZLE_POSITIVE_X_NV}{@link #GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV VIEWPORT_SWIZZLE_NEGATIVE_X_NV}
{@link #GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV VIEWPORT_SWIZZLE_POSITIVE_Y_NV}{@link #GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV VIEWPORT_SWIZZLE_NEGATIVE_Y_NV}
{@link #GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV VIEWPORT_SWIZZLE_POSITIVE_Z_NV}{@link #GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV VIEWPORT_SWIZZLE_NEGATIVE_Z_NV}
{@link #GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV VIEWPORT_SWIZZLE_POSITIVE_W_NV}{@link #GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV VIEWPORT_SWIZZLE_NEGATIVE_W_NV}
+ * @param swizzley the y swizzle state. One of:
{@link #GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV VIEWPORT_SWIZZLE_POSITIVE_X_NV}{@link #GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV VIEWPORT_SWIZZLE_NEGATIVE_X_NV}
{@link #GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV VIEWPORT_SWIZZLE_POSITIVE_Y_NV}{@link #GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV VIEWPORT_SWIZZLE_NEGATIVE_Y_NV}
{@link #GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV VIEWPORT_SWIZZLE_POSITIVE_Z_NV}{@link #GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV VIEWPORT_SWIZZLE_NEGATIVE_Z_NV}
{@link #GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV VIEWPORT_SWIZZLE_POSITIVE_W_NV}{@link #GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV VIEWPORT_SWIZZLE_NEGATIVE_W_NV}
+ * @param swizzlez the z swizzle state. One of:
{@link #GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV VIEWPORT_SWIZZLE_POSITIVE_X_NV}{@link #GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV VIEWPORT_SWIZZLE_NEGATIVE_X_NV}
{@link #GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV VIEWPORT_SWIZZLE_POSITIVE_Y_NV}{@link #GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV VIEWPORT_SWIZZLE_NEGATIVE_Y_NV}
{@link #GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV VIEWPORT_SWIZZLE_POSITIVE_Z_NV}{@link #GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV VIEWPORT_SWIZZLE_NEGATIVE_Z_NV}
{@link #GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV VIEWPORT_SWIZZLE_POSITIVE_W_NV}{@link #GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV VIEWPORT_SWIZZLE_NEGATIVE_W_NV}
+ * @param swizzlew the w swizzle state. One of:
{@link #GL_VIEWPORT_SWIZZLE_POSITIVE_X_NV VIEWPORT_SWIZZLE_POSITIVE_X_NV}{@link #GL_VIEWPORT_SWIZZLE_NEGATIVE_X_NV VIEWPORT_SWIZZLE_NEGATIVE_X_NV}
{@link #GL_VIEWPORT_SWIZZLE_POSITIVE_Y_NV VIEWPORT_SWIZZLE_POSITIVE_Y_NV}{@link #GL_VIEWPORT_SWIZZLE_NEGATIVE_Y_NV VIEWPORT_SWIZZLE_NEGATIVE_Y_NV}
{@link #GL_VIEWPORT_SWIZZLE_POSITIVE_Z_NV VIEWPORT_SWIZZLE_POSITIVE_Z_NV}{@link #GL_VIEWPORT_SWIZZLE_NEGATIVE_Z_NV VIEWPORT_SWIZZLE_NEGATIVE_Z_NV}
{@link #GL_VIEWPORT_SWIZZLE_POSITIVE_W_NV VIEWPORT_SWIZZLE_POSITIVE_W_NV}{@link #GL_VIEWPORT_SWIZZLE_NEGATIVE_W_NV VIEWPORT_SWIZZLE_NEGATIVE_W_NV}
+ */ + public static native void glViewportSwizzleNV(@NativeType("GLuint") int index, @NativeType("GLenum") int swizzlex, @NativeType("GLenum") int swizzley, @NativeType("GLenum") int swizzlez, @NativeType("GLenum") int swizzlew); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVXConditionalRender.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVXConditionalRender.java new file mode 100644 index 00000000..56bc1a33 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVXConditionalRender.java @@ -0,0 +1,46 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the NVX_conditional_render extension. + * + *

This extension provides support for conditional rendering based on the + * results of an occlusion query. This mechanism allows an application to + * potentially reduce the latency between the completion of an occlusion + * query and the rendering commands depending on its result. It additionally + * allows the decision of whether to render to be made without application + * intervention.

+ * + *

Requires {@link GL15 OpenGL 1.5} or {@link ARBOcclusionQuery ARB_occlusion_query}

+ */ +public class NVXConditionalRender { + + static { GL.initialize(); } + + protected NVXConditionalRender() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glBeginConditionalRenderNVX, caps.glEndConditionalRenderNVX + ); + } + + // --- [ glBeginConditionalRenderNVX ] --- + + public static native void glBeginConditionalRenderNVX(@NativeType("GLuint") int id); + + // --- [ glEndConditionalRenderNVX ] --- + + public static native void glEndConditionalRenderNVX(); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVXGPUMemoryInfo.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVXGPUMemoryInfo.java new file mode 100644 index 00000000..3f0e79b7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVXGPUMemoryInfo.java @@ -0,0 +1,28 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the NVX_gpu_memory_info extension. + * + *

GL_NVX_gpu_memory_info provides applications visibility into GPU hardware memory utilization in order to allow the application to effectively manage + * its resource allocations in the scope of the current available GPU memory.

+ * + *

Requires {@link GL20 OpenGL 2.0}

+ */ +public final class NVXGPUMemoryInfo { + + /** Accepted by the {@code param} parameter of GetIntegerv. */ + public static final int + GL_GPU_MEMORY_INFO_DEDICATED_VIDMEM_NVX = 0x9047, + GL_GPU_MEMORY_INFO_TOTAL_AVAILABLE_MEMORY_NVX = 0x9048, + GL_GPU_MEMORY_INFO_CURRENT_AVAILABLE_VIDMEM_NVX = 0x9049, + GL_GPU_MEMORY_INFO_EVICTION_COUNT_NVX = 0x904A, + GL_GPU_MEMORY_INFO_EVICTED_MEMORY_NVX = 0x904B; + + private NVXGPUMemoryInfo() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVXGpuMulticast2.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVXGpuMulticast2.java new file mode 100644 index 00000000..36eab626 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVXGpuMulticast2.java @@ -0,0 +1,130 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NVX_gpu_multicast2 extension. + * + *

This extension provides additional mechanisms that influence multicast rendering which is simultaneous rendering to multiple GPUs.

+ * + *

Requires {@link NVGPUMulticast NV_gpu_multicast}, {@code EXT_device_group}, {@code NV_viewport_array}, {@link NVClipSpaceWScaling NV_clip_space_w_scaling} and {@link NVXProgressFence NVX_progress_fence}.

+ */ +public class NVXGpuMulticast2 { + + static { GL.initialize(); } + + protected NVXGpuMulticast2() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glAsyncCopyImageSubDataNVX, caps.glAsyncCopyBufferSubDataNVX, caps.glUploadGpuMaskNVX, caps.glMulticastViewportArrayvNVX, + caps.glMulticastScissorArrayvNVX, caps.glMulticastViewportPositionWScaleNVX + ); + } + + // --- [ glAsyncCopyImageSubDataNVX ] --- + + public static native int nglAsyncCopyImageSubDataNVX(int waitSemaphoreCount, long waitSemaphoreArray, long waitValueArray, int srcGpu, int dstGpuMask, int srcName, int srcTarget, int srcLevel, int srcX, int srcY, int srcZ, int dstName, int dstTarget, int dstLevel, int dstX, int dstY, int dstZ, int srcWidth, int srcHeight, int srcDepth, int signalSemaphoreCount, long signalSemaphoreArray, long signalValueArray); + + @NativeType("GLuint") + public static int glAsyncCopyImageSubDataNVX(@NativeType("GLuint const *") IntBuffer waitSemaphoreArray, @NativeType("GLuint64 const *") LongBuffer waitValueArray, @NativeType("GLuint") int srcGpu, @NativeType("GLbitfield") int dstGpuMask, @NativeType("GLuint") int srcName, @NativeType("GLenum") int srcTarget, @NativeType("GLint") int srcLevel, @NativeType("GLint") int srcX, @NativeType("GLint") int srcY, @NativeType("GLint") int srcZ, @NativeType("GLuint") int dstName, @NativeType("GLenum") int dstTarget, @NativeType("GLint") int dstLevel, @NativeType("GLint") int dstX, @NativeType("GLint") int dstY, @NativeType("GLint") int dstZ, @NativeType("GLsizei") int srcWidth, @NativeType("GLsizei") int srcHeight, @NativeType("GLsizei") int srcDepth, @NativeType("GLuint const *") IntBuffer signalSemaphoreArray, @NativeType("GLuint64 const *") LongBuffer signalValueArray) { + if (CHECKS) { + check(waitValueArray, waitSemaphoreArray.remaining()); + check(signalValueArray, signalSemaphoreArray.remaining()); + } + return nglAsyncCopyImageSubDataNVX(waitSemaphoreArray.remaining(), memAddress(waitSemaphoreArray), memAddress(waitValueArray), srcGpu, dstGpuMask, srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth, signalSemaphoreArray.remaining(), memAddress(signalSemaphoreArray), memAddress(signalValueArray)); + } + + // --- [ glAsyncCopyBufferSubDataNVX ] --- + + public static native long nglAsyncCopyBufferSubDataNVX(int waitSemaphoreCount, long waitSemaphoreArray, long fenceValueArray, int readGpu, int writeGpuMask, int readBuffer, int writeBuffer, long readOffset, long writeOffset, long size, int signalSemaphoreCount, long signalSemaphoreArray, long signalValueArray); + + @NativeType("GLsync") + public static long glAsyncCopyBufferSubDataNVX(@NativeType("GLuint const *") IntBuffer waitSemaphoreArray, @NativeType("GLuint64 const *") LongBuffer fenceValueArray, @NativeType("GLuint") int readGpu, @NativeType("GLbitfield") int writeGpuMask, @NativeType("GLuint") int readBuffer, @NativeType("GLuint") int writeBuffer, @NativeType("GLintptr") long readOffset, @NativeType("GLintptr") long writeOffset, @NativeType("GLsizeiptr") long size, @NativeType("GLuint const *") IntBuffer signalSemaphoreArray, @NativeType("GLuint64 const *") LongBuffer signalValueArray) { + if (CHECKS) { + check(fenceValueArray, waitSemaphoreArray.remaining()); + check(signalValueArray, signalSemaphoreArray.remaining()); + } + return nglAsyncCopyBufferSubDataNVX(waitSemaphoreArray.remaining(), memAddress(waitSemaphoreArray), memAddress(fenceValueArray), readGpu, writeGpuMask, readBuffer, writeBuffer, readOffset, writeOffset, size, signalSemaphoreArray.remaining(), memAddress(signalSemaphoreArray), memAddress(signalValueArray)); + } + + // --- [ glUploadGpuMaskNVX ] --- + + public static native void glUploadGpuMaskNVX(@NativeType("GLbitfield") int mask); + + // --- [ glMulticastViewportArrayvNVX ] --- + + public static native void nglMulticastViewportArrayvNVX(int gpu, int first, int count, long v); + + public static void glMulticastViewportArrayvNVX(@NativeType("GLuint") int gpu, @NativeType("GLuint") int first, @NativeType("GLfloat const *") FloatBuffer v) { + nglMulticastViewportArrayvNVX(gpu, first, v.remaining() >> 2, memAddress(v)); + } + + // --- [ glMulticastScissorArrayvNVX ] --- + + public static native void nglMulticastScissorArrayvNVX(int gpu, int first, int count, long v); + + public static void glMulticastScissorArrayvNVX(@NativeType("GLuint") int gpu, @NativeType("GLuint") int first, @NativeType("GLint const *") IntBuffer v) { + nglMulticastScissorArrayvNVX(gpu, first, v.remaining() >> 2, memAddress(v)); + } + + // --- [ glMulticastViewportPositionWScaleNVX ] --- + + public static native void glMulticastViewportPositionWScaleNVX(@NativeType("GLuint") int gpu, @NativeType("GLuint") int index, @NativeType("GLfloat") float xcoeff, @NativeType("GLfloat") float ycoeff); + + /** Array version of: {@link #glAsyncCopyImageSubDataNVX AsyncCopyImageSubDataNVX} */ + @NativeType("GLuint") + public static int glAsyncCopyImageSubDataNVX(@NativeType("GLuint const *") int[] waitSemaphoreArray, @NativeType("GLuint64 const *") long[] waitValueArray, @NativeType("GLuint") int srcGpu, @NativeType("GLbitfield") int dstGpuMask, @NativeType("GLuint") int srcName, @NativeType("GLenum") int srcTarget, @NativeType("GLint") int srcLevel, @NativeType("GLint") int srcX, @NativeType("GLint") int srcY, @NativeType("GLint") int srcZ, @NativeType("GLuint") int dstName, @NativeType("GLenum") int dstTarget, @NativeType("GLint") int dstLevel, @NativeType("GLint") int dstX, @NativeType("GLint") int dstY, @NativeType("GLint") int dstZ, @NativeType("GLsizei") int srcWidth, @NativeType("GLsizei") int srcHeight, @NativeType("GLsizei") int srcDepth, @NativeType("GLuint const *") int[] signalSemaphoreArray, @NativeType("GLuint64 const *") long[] signalValueArray) { + long __functionAddress = GL.getICD().glAsyncCopyImageSubDataNVX; + if (CHECKS) { + check(__functionAddress); + check(waitValueArray, waitSemaphoreArray.length); + check(signalValueArray, signalSemaphoreArray.length); + } + return callPPPPI(waitSemaphoreArray.length, waitSemaphoreArray, waitValueArray, srcGpu, dstGpuMask, srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, srcWidth, srcHeight, srcDepth, signalSemaphoreArray.length, signalSemaphoreArray, signalValueArray, __functionAddress); + } + + /** Array version of: {@link #glAsyncCopyBufferSubDataNVX AsyncCopyBufferSubDataNVX} */ + @NativeType("GLsync") + public static long glAsyncCopyBufferSubDataNVX(@NativeType("GLuint const *") int[] waitSemaphoreArray, @NativeType("GLuint64 const *") long[] fenceValueArray, @NativeType("GLuint") int readGpu, @NativeType("GLbitfield") int writeGpuMask, @NativeType("GLuint") int readBuffer, @NativeType("GLuint") int writeBuffer, @NativeType("GLintptr") long readOffset, @NativeType("GLintptr") long writeOffset, @NativeType("GLsizeiptr") long size, @NativeType("GLuint const *") int[] signalSemaphoreArray, @NativeType("GLuint64 const *") long[] signalValueArray) { + long __functionAddress = GL.getICD().glAsyncCopyBufferSubDataNVX; + if (CHECKS) { + check(__functionAddress); + check(fenceValueArray, waitSemaphoreArray.length); + check(signalValueArray, signalSemaphoreArray.length); + } + return callPPPPPPPP(waitSemaphoreArray.length, waitSemaphoreArray, fenceValueArray, readGpu, writeGpuMask, readBuffer, writeBuffer, readOffset, writeOffset, size, signalSemaphoreArray.length, signalSemaphoreArray, signalValueArray, __functionAddress); + } + + /** Array version of: {@link #glMulticastViewportArrayvNVX MulticastViewportArrayvNVX} */ + public static void glMulticastViewportArrayvNVX(@NativeType("GLuint") int gpu, @NativeType("GLuint") int first, @NativeType("GLfloat const *") float[] v) { + long __functionAddress = GL.getICD().glMulticastViewportArrayvNVX; + if (CHECKS) { + check(__functionAddress); + } + callPV(gpu, first, v.length >> 2, v, __functionAddress); + } + + /** Array version of: {@link #glMulticastScissorArrayvNVX MulticastScissorArrayvNVX} */ + public static void glMulticastScissorArrayvNVX(@NativeType("GLuint") int gpu, @NativeType("GLuint") int first, @NativeType("GLint const *") int[] v) { + long __functionAddress = GL.getICD().glMulticastScissorArrayvNVX; + if (CHECKS) { + check(__functionAddress); + } + callPV(gpu, first, v.length >> 2, v, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVXProgressFence.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVXProgressFence.java new file mode 100644 index 00000000..bd46a8c3 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/NVXProgressFence.java @@ -0,0 +1,114 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the NVX_progress_fence extension. + * + *

This extension uses the concept of GL semaphores as defined in {@link EXTSemaphore EXT_semaphore} to better coordinate operations between multiple GPU command + * streams. A semaphore type called "progress fence" is derived from the GL semaphore. The progress fence semaphore is created by + * {@link #glCreateProgressFenceNVX CreateProgressFenceNVX}) returning the name of a newly created semaphore object. Like other semaphores, these are signaled by the GL server. Each + * signal operation is queued in the GPU command stream with an associated fence value that is written to the semaphore at the completion of a signal + * operation.

+ * + *

A GL server wait can be added to the command stream using {@link #glWaitSemaphoreui64NVX WaitSemaphoreui64NVX}. This blocks the GPU until the progress fence semaphore reaches or + * exceeds the specified fence value.

+ * + *

A GL client wait can be initiated using {@link #glClientWaitSemaphoreui64NVX ClientWaitSemaphoreui64NVX}. This blocks the CPU until the specified fence value is reached.

+ * + *

Requires {@code EXT_external_objects} and {@code EXT_external_objects_win32}.

+ */ +public class NVXProgressFence { + + static { GL.initialize(); } + + protected NVXProgressFence() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps) { + return checkFunctions( + caps.glCreateProgressFenceNVX, caps.glSignalSemaphoreui64NVX, caps.glWaitSemaphoreui64NVX, caps.glClientWaitSemaphoreui64NVX + ); + } + + // --- [ glCreateProgressFenceNVX ] --- + + @NativeType("GLuint") + public static native int glCreateProgressFenceNVX(); + + // --- [ glSignalSemaphoreui64NVX ] --- + + public static native void nglSignalSemaphoreui64NVX(int signalGpu, int fenceObjectCount, long semaphoreArray, long fenceValueArray); + + public static void glSignalSemaphoreui64NVX(@NativeType("GLuint") int signalGpu, @NativeType("GLuint const *") IntBuffer semaphoreArray, @NativeType("GLuint64 const *") LongBuffer fenceValueArray) { + if (CHECKS) { + check(fenceValueArray, semaphoreArray.remaining()); + } + nglSignalSemaphoreui64NVX(signalGpu, semaphoreArray.remaining(), memAddress(semaphoreArray), memAddress(fenceValueArray)); + } + + // --- [ glWaitSemaphoreui64NVX ] --- + + public static native void nglWaitSemaphoreui64NVX(int waitGpu, int fenceObjectCount, long semaphoreArray, long fenceValueArray); + + public static void glWaitSemaphoreui64NVX(@NativeType("GLuint") int waitGpu, @NativeType("GLuint const *") IntBuffer semaphoreArray, @NativeType("GLuint64 const *") LongBuffer fenceValueArray) { + if (CHECKS) { + check(fenceValueArray, semaphoreArray.remaining()); + } + nglWaitSemaphoreui64NVX(waitGpu, semaphoreArray.remaining(), memAddress(semaphoreArray), memAddress(fenceValueArray)); + } + + // --- [ glClientWaitSemaphoreui64NVX ] --- + + public static native void nglClientWaitSemaphoreui64NVX(int fenceObjectCount, long semaphoreArray, long fenceValueArray); + + public static void glClientWaitSemaphoreui64NVX(@NativeType("GLuint const *") IntBuffer semaphoreArray, @NativeType("GLuint64 const *") LongBuffer fenceValueArray) { + if (CHECKS) { + check(fenceValueArray, semaphoreArray.remaining()); + } + nglClientWaitSemaphoreui64NVX(semaphoreArray.remaining(), memAddress(semaphoreArray), memAddress(fenceValueArray)); + } + + /** Array version of: {@link #glSignalSemaphoreui64NVX SignalSemaphoreui64NVX} */ + public static void glSignalSemaphoreui64NVX(@NativeType("GLuint") int signalGpu, @NativeType("GLuint const *") int[] semaphoreArray, @NativeType("GLuint64 const *") long[] fenceValueArray) { + long __functionAddress = GL.getICD().glSignalSemaphoreui64NVX; + if (CHECKS) { + check(__functionAddress); + check(fenceValueArray, semaphoreArray.length); + } + callPPV(signalGpu, semaphoreArray.length, semaphoreArray, fenceValueArray, __functionAddress); + } + + /** Array version of: {@link #glWaitSemaphoreui64NVX WaitSemaphoreui64NVX} */ + public static void glWaitSemaphoreui64NVX(@NativeType("GLuint") int waitGpu, @NativeType("GLuint const *") int[] semaphoreArray, @NativeType("GLuint64 const *") long[] fenceValueArray) { + long __functionAddress = GL.getICD().glWaitSemaphoreui64NVX; + if (CHECKS) { + check(__functionAddress); + check(fenceValueArray, semaphoreArray.length); + } + callPPV(waitGpu, semaphoreArray.length, semaphoreArray, fenceValueArray, __functionAddress); + } + + /** Array version of: {@link #glClientWaitSemaphoreui64NVX ClientWaitSemaphoreui64NVX} */ + public static void glClientWaitSemaphoreui64NVX(@NativeType("GLuint const *") int[] semaphoreArray, @NativeType("GLuint64 const *") long[] fenceValueArray) { + long __functionAddress = GL.getICD().glClientWaitSemaphoreui64NVX; + if (CHECKS) { + check(__functionAddress); + check(fenceValueArray, semaphoreArray.length); + } + callPPV(semaphoreArray.length, semaphoreArray, fenceValueArray, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/OVRMultiview.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/OVRMultiview.java new file mode 100644 index 00000000..497893fe --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/OVRMultiview.java @@ -0,0 +1,128 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; + +/** + * Native bindings to the OVR_multiview extension. + * + *

The method of stereo rendering supported in OpenGL is currently achieved by rendering to the two eye buffers sequentially. This typically incurs double + * the application and driver overhead, despite the fact that the command streams and render states are almost identical.

+ * + *

This extension seeks to address the inefficiency of sequential multiview rendering by adding a means to render to multiple elements of a 2D texture + * array simultaneously. In multiview rendering, draw calls are instanced into each corresponding element of the texture array. The vertex program uses a + * new {@code gl_ViewID_OVR} variable to compute per-view values, typically the vertex position and view-dependent variables like reflection.

+ * + *

The formulation of this extension is high level in order to allow implementation freedom. On existing hardware, applications and drivers can realize + * the benefits of a single scene traversal, even if all GPU work is fully duplicated per-view. But future support could enable simultaneous rendering via + * multi-GPU, tile-based architectures could sort geometry into tiles for multiple views in a single pass, and the implementation could even choose to + * interleave at the fragment level for better texture cache utilization and more coherent fragment shader branching.

+ * + *

The most obvious use case in this model is to support two simultaneous views: one view for each eye. However, we also anticipate a usage where two + * views are rendered per eye, where one has a wide field of view and the other has a narrow one. The nature of wide field of view planar projection is + * that the sample density can become unacceptably low in the view direction. By rendering two inset eye views per eye, we can get the required sample + * density in the center of projection without wasting samples, memory, and time by oversampling in the periphery.

+ * + *

Requires {@link GL30 OpenGL 3.0}.

+ */ +public class OVRMultiview { + + /** Accepted by the {@code pname} parameter of {@link GL30C#glGetFramebufferAttachmentParameteriv GetFramebufferAttachmentParameteriv}. */ + public static final int + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR = 0x9630, + GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR = 0x9632; + + /** Accepted by the {@code pname} parameter of GetIntegerv. */ + public static final int GL_MAX_VIEWS_OVR = 0x9631; + + /** Returned by {@link GL30C#glCheckFramebufferStatus CheckFramebufferStatus}. */ + public static final int GL_FRAMEBUFFER_INCOMPLETE_VIEW_TARGETS_OVR = 0x9633; + + static { GL.initialize(); } + + protected OVRMultiview() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(GLCapabilities caps, java.util.Set ext) { + return checkFunctions( + caps.glFramebufferTextureMultiviewOVR, caps.hasDSA(ext) ? caps.glNamedFramebufferTextureMultiviewOVR : -1L + ); + } + + // --- [ glFramebufferTextureMultiviewOVR ] --- + + /** + * Operates similarly to the {@link GL30C#glFramebufferTextureLayer FramebufferTextureLayer} command, except that {@code baseViewIndex} and {@code numViews} select a range of texture array + * elements that will be targeted when rendering. Such an attachment is considered multiview and rendering commands issued when such a framebuffer + * object is bound are termed "multiview rendering". The maximum number of views which can be bound simultaneously is determined by the value of + * {@link #GL_MAX_VIEWS_OVR MAX_VIEWS_OVR}, which can be queried with the {@link GL11C#glGetIntegerv GetIntegerv} command. + * + *

The command

+ * + *

+     * View( uint id );
+ * + *

does not exist in the GL, but is used here to describe the multiview functionality in this section. The effect of this hypothetical function is to set + * the value of the shader built-in input {@code gl_ViewID_OVR}.

+ * + *

When multiview rendering is enabled, the {@code Clear}, {@code ClearBuffer*}, {@code Draw*}, and {@code Dispatch*} commands have the same effect as:

+ * + *

+     * for( int i = 0; i < numViews; i++ ) {
+     *     FramebufferTextureLayer( target, attachment, texture, level, baseViewIndex + i );
+     *     View( i );
+     *     <drawing-command>
+     * }
+ * + *

The result is that every drawing command is broadcast into every active view. The shader uses {@code gl_ViewID_OVR} to compute view dependent outputs.

+ * + *

The number of views, as specified by {@code numViews}, must be the same for all framebuffer attachments points where the value of + * {@link GL30#GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE} is not {@link GL11#GL_NONE NONE} or the framebuffer is incomplete.

+ * + *

If {@code texture} is non-zero and the command does not result in an error, the framebuffer attachment state corresponding to {@code attachment} is + * updated as in the {@link GL30C#glFramebufferTextureLayer FramebufferTextureLayer} command, except that the values of {@link GL30#GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER} and + * {@link #GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR FRAMEBUFFER_ATTACHMENT_TEXTURE_BASE_VIEW_INDEX_OVR} are is set to {@code baseViewIndex}, and the value of {@link #GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR FRAMEBUFFER_ATTACHMENT_TEXTURE_NUM_VIEWS_OVR} + * is set to {@code numViews}.

+ * + *
Errors
+ * + *

In addition to the corresponding errors for {@link GL30C#glFramebufferTextureLayer FramebufferTextureLayer} when called with the same parameters (other than {@code layer}):

+ * + *

An {@link GL11#GL_INVALID_VALUE INVALID_VALUE} error is generated if:

+ * + *
    + *
  • {@code numViews} is less than 1 or if {@code numViews} is greater than {@link #GL_MAX_VIEWS_OVR MAX_VIEWS_OVR}.
  • + *
  • {@code texture} is a two-dimensional array texture and {@code baseViewIndex} + {@code numViews} is larger than the value of + * {@link GL30#GL_MAX_ARRAY_TEXTURE_LAYERS MAX_ARRAY_TEXTURE_LAYERS} minus one.
  • + *
  • {@code texture} is non-zero and {@code baseViewIndex} is negative.
  • + *
+ * + *

An {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION} error is generated if texture is non-zero and is not the name of a two-dimensional array texture.

+ * + * @param target the framebuffer target. One of:
{@link GL30#GL_FRAMEBUFFER FRAMEBUFFER}{@link GL30#GL_READ_FRAMEBUFFER READ_FRAMEBUFFER}{@link GL30#GL_DRAW_FRAMEBUFFER DRAW_FRAMEBUFFER}
+ * @param attachment the attachment point of the framebuffer. One of:
{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param texture the texture object to attach to the framebuffer attachment point named by {@code attachment} + * @param level the mipmap level of {@code texture} to attach + * @param baseViewIndex the base framebuffer texture layer index + * @param numViews the number of views to target when rendering + */ + public static native void glFramebufferTextureMultiviewOVR(@NativeType("GLenum") int target, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int baseViewIndex, @NativeType("GLsizei") int numViews); + + // --- [ glNamedFramebufferTextureMultiviewOVR ] --- + + /** + * @param framebuffer the framebuffer name + * @param attachment the attachment point of the framebuffer. One of:
{@link GL30#GL_COLOR_ATTACHMENT0 COLOR_ATTACHMENT0}{@link GL30#GL_COLOR_ATTACHMENT1 COLOR_ATTACHMENT1}{@link GL30#GL_COLOR_ATTACHMENT2 COLOR_ATTACHMENT2}{@link GL30#GL_COLOR_ATTACHMENT3 COLOR_ATTACHMENT3}
{@link GL30#GL_COLOR_ATTACHMENT4 COLOR_ATTACHMENT4}{@link GL30#GL_COLOR_ATTACHMENT5 COLOR_ATTACHMENT5}{@link GL30#GL_COLOR_ATTACHMENT6 COLOR_ATTACHMENT6}{@link GL30#GL_COLOR_ATTACHMENT7 COLOR_ATTACHMENT7}
{@link GL30#GL_COLOR_ATTACHMENT8 COLOR_ATTACHMENT8}{@link GL30#GL_COLOR_ATTACHMENT9 COLOR_ATTACHMENT9}{@link GL30#GL_COLOR_ATTACHMENT10 COLOR_ATTACHMENT10}{@link GL30#GL_COLOR_ATTACHMENT11 COLOR_ATTACHMENT11}
{@link GL30#GL_COLOR_ATTACHMENT12 COLOR_ATTACHMENT12}{@link GL30#GL_COLOR_ATTACHMENT13 COLOR_ATTACHMENT13}{@link GL30#GL_COLOR_ATTACHMENT14 COLOR_ATTACHMENT14}{@link GL30#GL_COLOR_ATTACHMENT15 COLOR_ATTACHMENT15}
{@link GL30#GL_COLOR_ATTACHMENT16 COLOR_ATTACHMENT16}{@link GL30#GL_COLOR_ATTACHMENT17 COLOR_ATTACHMENT17}{@link GL30#GL_COLOR_ATTACHMENT18 COLOR_ATTACHMENT18}{@link GL30#GL_COLOR_ATTACHMENT19 COLOR_ATTACHMENT19}
{@link GL30#GL_COLOR_ATTACHMENT20 COLOR_ATTACHMENT20}{@link GL30#GL_COLOR_ATTACHMENT21 COLOR_ATTACHMENT21}{@link GL30#GL_COLOR_ATTACHMENT22 COLOR_ATTACHMENT22}{@link GL30#GL_COLOR_ATTACHMENT23 COLOR_ATTACHMENT23}
{@link GL30#GL_COLOR_ATTACHMENT24 COLOR_ATTACHMENT24}{@link GL30#GL_COLOR_ATTACHMENT25 COLOR_ATTACHMENT25}{@link GL30#GL_COLOR_ATTACHMENT26 COLOR_ATTACHMENT26}{@link GL30#GL_COLOR_ATTACHMENT27 COLOR_ATTACHMENT27}
{@link GL30#GL_COLOR_ATTACHMENT28 COLOR_ATTACHMENT28}{@link GL30#GL_COLOR_ATTACHMENT29 COLOR_ATTACHMENT29}{@link GL30#GL_COLOR_ATTACHMENT30 COLOR_ATTACHMENT30}{@link GL30#GL_COLOR_ATTACHMENT31 COLOR_ATTACHMENT31}
{@link GL30#GL_DEPTH_ATTACHMENT DEPTH_ATTACHMENT}{@link GL30#GL_STENCIL_ATTACHMENT STENCIL_ATTACHMENT}{@link GL30#GL_DEPTH_STENCIL_ATTACHMENT DEPTH_STENCIL_ATTACHMENT}
+ * @param texture the texture object to attach to the framebuffer attachment point named by {@code attachment} + * @param level the mipmap level of {@code texture} to attach + */ + public static native void glNamedFramebufferTextureMultiviewOVR(@NativeType("GLuint") int framebuffer, @NativeType("GLenum") int attachment, @NativeType("GLuint") int texture, @NativeType("GLint") int level, @NativeType("GLint") int baseViewIndex, @NativeType("GLsizei") int numViews); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGL.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGL.java new file mode 100644 index 00000000..1e56dd07 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGL.java @@ -0,0 +1,253 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +import org.lwjgl.system.windows.*; + +/** Native bindings to WGL functionality. */ +public class WGL { + + /** UseFontOutlines format. */ + public static final int + WGL_FONT_LINES = 0, + WGL_FONT_POLYGONS = 1; + + /** SwapLayerBuffers flags. */ + public static final int + WGL_SWAP_MAIN_PLANE = 0x1, + WGL_SWAP_OVERLAY1 = 0x2, + WGL_SWAP_OVERLAY2 = 0x4, + WGL_SWAP_OVERLAY3 = 0x8, + WGL_SWAP_OVERLAY4 = 0x10, + WGL_SWAP_OVERLAY5 = 0x20, + WGL_SWAP_OVERLAY6 = 0x40, + WGL_SWAP_OVERLAY7 = 0x80, + WGL_SWAP_OVERLAY8 = 0x100, + WGL_SWAP_OVERLAY9 = 0x200, + WGL_SWAP_OVERLAY10 = 0x400, + WGL_SWAP_OVERLAY11 = 0x800, + WGL_SWAP_OVERLAY12 = 0x1000, + WGL_SWAP_OVERLAY13 = 0x2000, + WGL_SWAP_OVERLAY14 = 0x4000, + WGL_SWAP_OVERLAY15 = 0x8000, + WGL_SWAP_UNDERLAY1 = 0x10000, + WGL_SWAP_UNDERLAY2 = 0x20000, + WGL_SWAP_UNDERLAY3 = 0x40000, + WGL_SWAP_UNDERLAY4 = 0x80000, + WGL_SWAP_UNDERLAY5 = 0x100000, + WGL_SWAP_UNDERLAY6 = 0x200000, + WGL_SWAP_UNDERLAY7 = 0x400000, + WGL_SWAP_UNDERLAY8 = 0x800000, + WGL_SWAP_UNDERLAY9 = 0x1000000, + WGL_SWAP_UNDERLAY10 = 0x2000000, + WGL_SWAP_UNDERLAY11 = 0x4000000, + WGL_SWAP_UNDERLAY12 = 0x8000000, + WGL_SWAP_UNDERLAY13 = 0x10000000, + WGL_SWAP_UNDERLAY14 = 0x20000000, + WGL_SWAP_UNDERLAY15 = 0x40000000; + + protected WGL() { + throw new UnsupportedOperationException(); + } + + /** Contains the function pointers loaded from {@code GL.getFunctionProvider()}. */ + public static final class Functions { + + private Functions() {} + + /** Function address. */ + public static final long + CreateContext = apiGetFunctionAddress(GL.getFunctionProvider(), "wglCreateContext"), + CreateLayerContext = apiGetFunctionAddress(GL.getFunctionProvider(), "wglCreateLayerContext"), + CopyContext = apiGetFunctionAddress(GL.getFunctionProvider(), "wglCopyContext"), + DeleteContext = apiGetFunctionAddress(GL.getFunctionProvider(), "wglDeleteContext"), + GetCurrentContext = apiGetFunctionAddress(GL.getFunctionProvider(), "wglGetCurrentContext"), + GetCurrentDC = apiGetFunctionAddress(GL.getFunctionProvider(), "wglGetCurrentDC"), + GetProcAddress = apiGetFunctionAddress(GL.getFunctionProvider(), "wglGetProcAddress"), + MakeCurrent = apiGetFunctionAddress(GL.getFunctionProvider(), "wglMakeCurrent"), + ShareLists = apiGetFunctionAddress(GL.getFunctionProvider(), "wglShareLists"); + + } + + // --- [ wglCreateContext ] --- + + /** + * Creates a new OpenGL rendering context, which is suitable for drawing on the device referenced by device. The rendering context has the same pixel + * format as the device context. + * + * @param hdc handle to a device context for which the function creates a suitable OpenGL rendering context + */ + @NativeType("HGLRC") + public static long wglCreateContext(@NativeType("HDC") long hdc) { + long __functionAddress = Functions.CreateContext; + if (CHECKS) { + check(hdc); + } + return callPP(hdc, __functionAddress); + } + + // --- [ wglCreateLayerContext ] --- + + /** + * Creates a new OpenGL rendering context for drawing to a specified layer plane on a device context. + * + * @param hdc the device context for a new rendering context + * @param layerPlane the layer plane to which you want to bind a rendering context. The value 0 identifies the main plane. Positive values of {@code layerPlace} identify + * overlay planes, where 1 is the first overlay plane over the main plane, 2 is the second overlay plane over the first overlay plane, and so on. + * Negative values identify underlay planes, where 1 is the first underlay plane under the main plane, 2 is the second underlay plane under the first + * underlay plane, and so on. The number of overlay and underlay planes is given in the {@code reserved} member of the {@link PIXELFORMATDESCRIPTOR} + * structure. + */ + @NativeType("HGLRC") + public static long wglCreateLayerContext(@NativeType("HDC") long hdc, int layerPlane) { + long __functionAddress = Functions.CreateLayerContext; + if (CHECKS) { + check(hdc); + } + return callPP(hdc, layerPlane, __functionAddress); + } + + // --- [ wglCopyContext ] --- + + /** + * Copies selected groups of rendering states from one OpenGL rendering context to another. + * + * @param src the source OpenGL rendering context whose state information is to be copied + * @param dst the destination OpenGL rendering context to which state information is to be copied + * @param mask which groups of the {@code src} rendering state are to be copied to {@code dst}. It contains the bitwise-OR of the same symbolic names that are + * passed to the {@link GL11#glPushAttrib PushAttrib} function. You can use {@link GL11#GL_ALL_ATTRIB_BITS ALL_ATTRIB_BITS} to copy all the rendering state information. + */ + @NativeType("BOOL") + public static boolean wglCopyContext(@NativeType("HGLRC") long src, @NativeType("HGLRC") long dst, @NativeType("UINT") int mask) { + long __functionAddress = Functions.CopyContext; + if (CHECKS) { + check(src); + check(dst); + } + return callPPI(src, dst, mask, __functionAddress) != 0; + } + + // --- [ wglDeleteContext ] --- + + /** + * Deletes a specified OpenGL rendering context. + * + * @param context handle to an OpenGL rendering context that the function will delete + */ + @NativeType("BOOL") + public static boolean wglDeleteContext(@NativeType("HGLRC") long context) { + long __functionAddress = Functions.DeleteContext; + if (CHECKS) { + check(context); + } + return callPI(context, __functionAddress) != 0; + } + + // --- [ wglGetCurrentContext ] --- + + /** Obtains a handle to the current OpenGL rendering context of the calling thread. */ + @NativeType("HGLRC") + public static long wglGetCurrentContext() { + long __functionAddress = Functions.GetCurrentContext; + return callP(__functionAddress); + } + + // --- [ wglGetCurrentDC ] --- + + /** Obtains a handle to the device context that is associated with the current OpenGL rendering context of the calling thread. */ + @NativeType("HDC") + public static long wglGetCurrentDC() { + long __functionAddress = Functions.GetCurrentDC; + return callP(__functionAddress); + } + + // --- [ wglGetProcAddress ] --- + + /** Unsafe version of: {@link #wglGetProcAddress GetProcAddress} */ + public static long nwglGetProcAddress(long proc) { + long __functionAddress = Functions.GetProcAddress; + return callPP(proc, __functionAddress); + } + + /** + * Returns the address of an OpenGL extension function for use with the current OpenGL rendering context. + * + * @param proc points to a null-terminated string that is the name of the extension function. The name of the extension function must be identical to a + * corresponding function implemented by OpenGL. + */ + @NativeType("PROC") + public static long wglGetProcAddress(@NativeType("LPCSTR") ByteBuffer proc) { + if (CHECKS) { + checkNT1(proc); + } + return nwglGetProcAddress(memAddress(proc)); + } + + /** + * Returns the address of an OpenGL extension function for use with the current OpenGL rendering context. + * + * @param proc points to a null-terminated string that is the name of the extension function. The name of the extension function must be identical to a + * corresponding function implemented by OpenGL. + */ + @NativeType("PROC") + public static long wglGetProcAddress(@NativeType("LPCSTR") CharSequence proc) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(proc, true); + long procEncoded = stack.getPointerAddress(); + return nwglGetProcAddress(procEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ wglMakeCurrent ] --- + + /** + * Makes a specified OpenGL rendering context the calling thread's current rendering context. All subsequent OpenGL calls made by the thread are drawn on + * the device identified by device. You can also use MakeCurrent to change the calling thread's current rendering context so it's no longer current. + * + * @param hdc handle to a device context. Subsequent OpenGL calls made by the calling thread are drawn on the device identified by {@code dc}. + * @param hglrc handle to an OpenGL rendering context that the function sets as the calling thread's rendering context. If {@code context} is {@code NULL}, the function + * makes the calling thread's current rendering context no longer current, and releases the device context that is used by the rendering context. In + * this case, {@code hdc} is ignored. + */ + @NativeType("BOOL") + public static boolean wglMakeCurrent(@NativeType("HDC") long hdc, @NativeType("HGLRC") long hglrc) { + long __functionAddress = Functions.MakeCurrent; + return callPPI(hdc, hglrc, __functionAddress) != 0; + } + + // --- [ wglShareLists ] --- + + /** + * Enables multiple OpenGL rendering contexts to share a single display-list space. + * + * @param hglrc1 the OpenGL rendering context with which to share display lists. + * @param hglrc2 the OpenGL rendering context to share display lists with {@code hglrc1}. The {@code hglrc2} parameter should not contain any existing display lists + * when {@code wglShareLists} is called. + */ + @NativeType("BOOL") + public static boolean wglShareLists(@NativeType("HGLRC") long hglrc1, @NativeType("HGLRC") long hglrc2) { + long __functionAddress = Functions.ShareLists; + if (CHECKS) { + check(hglrc1); + check(hglrc2); + } + return callPPI(hglrc1, hglrc2, __functionAddress) != 0; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLAMDGPUAssociation.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLAMDGPUAssociation.java new file mode 100644 index 00000000..1c5f558e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLAMDGPUAssociation.java @@ -0,0 +1,332 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the WGL_AMD_gpu_association extension. + * + *

There currently is no way for applications to efficiently use GPU resources in systems that contain more than one GPU. Vendors have provided methods + * that attempt to split the workload for an application among the available GPU resources. This has proven to be very inefficient because most + * applications were never written with these sorts of optimizations in mind.

+ * + *

This extension provides a mechanism for applications to explicitly use the GPU resources on a given system individually. By providing this + * functionality, a driver allows applications to make appropriate decisions regarding where and when to distribute rendering tasks.

+ * + *

Requires {@link WGLARBExtensionsString WGL_ARB_extensions_string} and {@link EXTFramebufferObject EXT_framebuffer_object}.

+ */ +public class WGLAMDGPUAssociation { + + /** Accepted by the {@code property} parameter of {@link #wglGetGPUInfoAMD GetGPUInfoAMD}. */ + public static final int + WGL_GPU_VENDOR_AMD = 0x1F00, + WGL_GPU_RENDERER_STRING_AMD = 0x1F01, + WGL_GPU_OPENGL_VERSION_STRING_AMD = 0x1F02, + WGL_GPU_FASTEST_TARGET_GPUS_AMD = 0x21A2, + WGL_GPU_RAM_AMD = 0x21A3, + WGL_GPU_CLOCK_AMD = 0x21A4, + WGL_GPU_NUM_PIPES_AMD = 0x21A5, + WGL_GPU_NUM_SIMD_AMD = 0x21A6, + WGL_GPU_NUM_RB_AMD = 0x21A7, + WGL_GPU_NUM_SPI_AMD = 0x21A8; + + protected WGLAMDGPUAssociation() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(WGLCapabilities caps) { + return checkFunctions( + caps.wglGetGPUIDsAMD, caps.wglGetGPUInfoAMD, caps.wglGetContextGPUIDAMD, caps.wglCreateAssociatedContextAMD, + caps.wglCreateAssociatedContextAttribsAMD, caps.wglDeleteAssociatedContextAMD, caps.wglMakeAssociatedContextCurrentAMD, + caps.wglGetCurrentAssociatedContextAMD + ); + } + + // --- [ wglGetGPUIDsAMD ] --- + + /** + * Unsafe version of: {@link #wglGetGPUIDsAMD GetGPUIDsAMD} + * + * @param maxCount the max number of IDs that can be returned + */ + public static int nwglGetGPUIDsAMD(int maxCount, long ids) { + long __functionAddress = GL.getCapabilitiesWGL().wglGetGPUIDsAMD; + if (CHECKS) { + check(__functionAddress); + } + return callPI(maxCount, ids, __functionAddress); + } + + /** + * Returns the IDs for available GPUs. + * + *

If the function succeeds, the return value is the number of total GPUs available. The value 0 is returned if no GPUs are available or if the call has + * failed. The ID 0 is reserved and will not be retuned as a valid GPU ID. If the array {@code ids} is {@code NULL}, the function will only return the total + * number of GPUs. {@code ids} will be tightly packed with no 0 values between valid ids.

+ * + * @param ids the array of returned IDs + */ + @NativeType("UINT") + public static int wglGetGPUIDsAMD(@Nullable @NativeType("UINT *") IntBuffer ids) { + return nwglGetGPUIDsAMD(remainingSafe(ids), memAddressSafe(ids)); + } + + // --- [ wglGetGPUInfoAMD ] --- + + /** + * Unsafe version of: {@link #wglGetGPUInfoAMD GetGPUInfoAMD} + * + * @param size the size of the {@code data} buffer + */ + public static int nwglGetGPUInfoAMD(int id, int property, int dataType, int size, long data) { + long __functionAddress = GL.getCapabilitiesWGL().wglGetGPUInfoAMD; + if (CHECKS) { + check(__functionAddress); + } + return callPI(id, property, dataType, size, data, __functionAddress); + } + + /** + * Each GPU in a system may have different properties, performance characteristics and different supported OpenGL versions. Use this function to determine + * which GPU is best suited for a specific task. + * + *

For a string, {@code size} will be the number of characters allocated and will include {@code NULL} termination. For arrays of type GL_UNSIGNED_INT, GL_INT, + * and GL_FLOAT {@code size} will be the array depth. If the function succeeds, the number of values written will be returned. If the number of values + * written is equal to {@code size}, the query should be repeated with a larger {@code data} buffer. Strings should be queried using the GL_UNSIGNED_BYTE + * type, are UTF-8 encoded and will be {@code NULL} terminated. If the function fails, -1 will be returned.

+ * + * @param id a GPU id obtained from calling {@link #wglGetGPUIDsAMD GetGPUIDsAMD} + * @param property the information being queried. One of:
{@link #WGL_GPU_VENDOR_AMD GPU_VENDOR_AMD}{@link #WGL_GPU_RENDERER_STRING_AMD GPU_RENDERER_STRING_AMD}{@link #WGL_GPU_OPENGL_VERSION_STRING_AMD GPU_OPENGL_VERSION_STRING_AMD}{@link #WGL_GPU_FASTEST_TARGET_GPUS_AMD GPU_FASTEST_TARGET_GPUS_AMD}
{@link #WGL_GPU_RAM_AMD GPU_RAM_AMD}{@link #WGL_GPU_CLOCK_AMD GPU_CLOCK_AMD}{@link #WGL_GPU_NUM_PIPES_AMD GPU_NUM_PIPES_AMD}{@link #WGL_GPU_NUM_SIMD_AMD GPU_NUM_SIMD_AMD}
{@link #WGL_GPU_NUM_RB_AMD GPU_NUM_RB_AMD}{@link #WGL_GPU_NUM_SPI_AMD GPU_NUM_SPI_AMD}
+ * @param dataType the data type to be returned. One of:
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL11#GL_FLOAT FLOAT}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}
+ * @param data the buffer which will be filled with the requested information + */ + public static int wglGetGPUInfoAMD(@NativeType("UINT") int id, int property, @NativeType("GLenum") int dataType, @NativeType("void *") ByteBuffer data) { + return nwglGetGPUInfoAMD(id, property, dataType, data.remaining() >> GLChecks.typeToByteShift(dataType), memAddress(data)); + } + + /** + * Each GPU in a system may have different properties, performance characteristics and different supported OpenGL versions. Use this function to determine + * which GPU is best suited for a specific task. + * + *

For a string, {@code size} will be the number of characters allocated and will include {@code NULL} termination. For arrays of type GL_UNSIGNED_INT, GL_INT, + * and GL_FLOAT {@code size} will be the array depth. If the function succeeds, the number of values written will be returned. If the number of values + * written is equal to {@code size}, the query should be repeated with a larger {@code data} buffer. Strings should be queried using the GL_UNSIGNED_BYTE + * type, are UTF-8 encoded and will be {@code NULL} terminated. If the function fails, -1 will be returned.

+ * + * @param id a GPU id obtained from calling {@link #wglGetGPUIDsAMD GetGPUIDsAMD} + * @param property the information being queried. One of:
{@link #WGL_GPU_VENDOR_AMD GPU_VENDOR_AMD}{@link #WGL_GPU_RENDERER_STRING_AMD GPU_RENDERER_STRING_AMD}{@link #WGL_GPU_OPENGL_VERSION_STRING_AMD GPU_OPENGL_VERSION_STRING_AMD}{@link #WGL_GPU_FASTEST_TARGET_GPUS_AMD GPU_FASTEST_TARGET_GPUS_AMD}
{@link #WGL_GPU_RAM_AMD GPU_RAM_AMD}{@link #WGL_GPU_CLOCK_AMD GPU_CLOCK_AMD}{@link #WGL_GPU_NUM_PIPES_AMD GPU_NUM_PIPES_AMD}{@link #WGL_GPU_NUM_SIMD_AMD GPU_NUM_SIMD_AMD}
{@link #WGL_GPU_NUM_RB_AMD GPU_NUM_RB_AMD}{@link #WGL_GPU_NUM_SPI_AMD GPU_NUM_SPI_AMD}
+ * @param dataType the data type to be returned. One of:
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL11#GL_FLOAT FLOAT}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}
+ * @param data the buffer which will be filled with the requested information + */ + public static int wglGetGPUInfoAMD(@NativeType("UINT") int id, int property, @NativeType("GLenum") int dataType, @NativeType("void *") IntBuffer data) { + return nwglGetGPUInfoAMD(id, property, dataType, (int)(((long)data.remaining() << 2) >> GLChecks.typeToByteShift(dataType)), memAddress(data)); + } + + /** + * Each GPU in a system may have different properties, performance characteristics and different supported OpenGL versions. Use this function to determine + * which GPU is best suited for a specific task. + * + *

For a string, {@code size} will be the number of characters allocated and will include {@code NULL} termination. For arrays of type GL_UNSIGNED_INT, GL_INT, + * and GL_FLOAT {@code size} will be the array depth. If the function succeeds, the number of values written will be returned. If the number of values + * written is equal to {@code size}, the query should be repeated with a larger {@code data} buffer. Strings should be queried using the GL_UNSIGNED_BYTE + * type, are UTF-8 encoded and will be {@code NULL} terminated. If the function fails, -1 will be returned.

+ * + * @param id a GPU id obtained from calling {@link #wglGetGPUIDsAMD GetGPUIDsAMD} + * @param property the information being queried. One of:
{@link #WGL_GPU_VENDOR_AMD GPU_VENDOR_AMD}{@link #WGL_GPU_RENDERER_STRING_AMD GPU_RENDERER_STRING_AMD}{@link #WGL_GPU_OPENGL_VERSION_STRING_AMD GPU_OPENGL_VERSION_STRING_AMD}{@link #WGL_GPU_FASTEST_TARGET_GPUS_AMD GPU_FASTEST_TARGET_GPUS_AMD}
{@link #WGL_GPU_RAM_AMD GPU_RAM_AMD}{@link #WGL_GPU_CLOCK_AMD GPU_CLOCK_AMD}{@link #WGL_GPU_NUM_PIPES_AMD GPU_NUM_PIPES_AMD}{@link #WGL_GPU_NUM_SIMD_AMD GPU_NUM_SIMD_AMD}
{@link #WGL_GPU_NUM_RB_AMD GPU_NUM_RB_AMD}{@link #WGL_GPU_NUM_SPI_AMD GPU_NUM_SPI_AMD}
+ * @param dataType the data type to be returned. One of:
{@link GL11#GL_UNSIGNED_INT UNSIGNED_INT}{@link GL11#GL_INT INT}{@link GL11#GL_FLOAT FLOAT}{@link GL11#GL_UNSIGNED_BYTE UNSIGNED_BYTE}
+ * @param data the buffer which will be filled with the requested information + */ + public static int wglGetGPUInfoAMD(@NativeType("UINT") int id, int property, @NativeType("GLenum") int dataType, @NativeType("void *") FloatBuffer data) { + return nwglGetGPUInfoAMD(id, property, dataType, (int)(((long)data.remaining() << 2) >> GLChecks.typeToByteShift(dataType)), memAddress(data)); + } + + // --- [ wglGetContextGPUIDAMD ] --- + + /** + * Determine which GPU a context is attached to. + * + *

Unassociated contexts are created by calling {@link WGL#wglCreateContext CreateContext}. Although these contexts are unassociated, their use will still be tied to a single + * GPU in most cases. For this reason it is advantageous to be able to query the GPU an existing unassociated context resides on. If multiple GPUs are + * available, it would be undesirable to use one for rendering to visible surfaces and then chose the same one for off-screen rendering.

+ * + * @param hglrc the context for which the GPU id will be returned + */ + @NativeType("UINT") + public static int wglGetContextGPUIDAMD(@NativeType("HGLRC") long hglrc) { + long __functionAddress = GL.getCapabilitiesWGL().wglGetContextGPUIDAMD; + if (CHECKS) { + check(__functionAddress); + check(hglrc); + } + return callPI(hglrc, __functionAddress); + } + + // --- [ wglCreateAssociatedContextAMD ] --- + + /** + * Creates an associated context. Upon successful creation, no pixel format is tied to an associated context. + * + * @param id a valid GPU id + */ + @NativeType("HGLRC") + public static long wglCreateAssociatedContextAMD(@NativeType("UINT") int id) { + long __functionAddress = GL.getCapabilitiesWGL().wglCreateAssociatedContextAMD; + if (CHECKS) { + check(__functionAddress); + } + return callP(id, __functionAddress); + } + + // --- [ wglCreateAssociatedContextAttribsAMD ] --- + + /** Unsafe version of: {@link #wglCreateAssociatedContextAttribsAMD CreateAssociatedContextAttribsAMD} */ + public static long nwglCreateAssociatedContextAttribsAMD(int id, long shareContext, long attribList) { + long __functionAddress = GL.getCapabilitiesWGL().wglCreateAssociatedContextAttribsAMD; + if (CHECKS) { + check(__functionAddress); + } + return callPPP(id, shareContext, attribList, __functionAddress); + } + + /** + * Create an associated context with a specific GL version. + * + *

All capabilities and limitations of {@link WGLARBCreateContext#wglCreateContextAttribsARB CreateContextAttribsARB} apply to {@code CreateAssociatedContextAttribsAMD}.

+ * + * @param id a valid GPU id + * @param shareContext must either be {@code NULL} or that of an associated context created with the same GPU ID as {@code id} + * @param attribList a 0-terminated list of attributes for the context + */ + @NativeType("HGLRC") + public static long wglCreateAssociatedContextAttribsAMD(@NativeType("UINT") int id, @NativeType("HGLRC") long shareContext, @Nullable @NativeType("int const *") IntBuffer attribList) { + if (CHECKS) { + checkNTSafe(attribList); + } + return nwglCreateAssociatedContextAttribsAMD(id, shareContext, memAddressSafe(attribList)); + } + + // --- [ wglDeleteAssociatedContextAMD ] --- + + /** + * Deletes an associated context. An associated context cannot be deleted by calling {@link WGL#wglDeleteContext DeleteContext}. + * + * @param hglrc a valid associated context created by calling {@link #wglCreateAssociatedContextAMD CreateAssociatedContextAMD} + */ + @NativeType("BOOL") + public static boolean wglDeleteAssociatedContextAMD(@NativeType("HGLRC") long hglrc) { + long __functionAddress = GL.getCapabilitiesWGL().wglDeleteAssociatedContextAMD; + if (CHECKS) { + check(__functionAddress); + check(hglrc); + } + return callPI(hglrc, __functionAddress) != 0; + } + + // --- [ wglMakeAssociatedContextCurrentAMD ] --- + + /** + * Makes an associated context current in the current thread. + * + * @param hglrc a context handle created by calling {@link #wglCreateAssociatedContextAMD CreateAssociatedContextAMD} + */ + @NativeType("BOOL") + public static boolean wglMakeAssociatedContextCurrentAMD(@NativeType("HGLRC") long hglrc) { + long __functionAddress = GL.getCapabilitiesWGL().wglMakeAssociatedContextCurrentAMD; + if (CHECKS) { + check(__functionAddress); + check(hglrc); + } + return callPI(hglrc, __functionAddress) != 0; + } + + // --- [ wglGetCurrentAssociatedContextAMD ] --- + + /** Returns the current associated context in the current thread. */ + @NativeType("HGLRC") + public static long wglGetCurrentAssociatedContextAMD() { + long __functionAddress = GL.getCapabilitiesWGL().wglGetCurrentAssociatedContextAMD; + if (CHECKS) { + check(__functionAddress); + } + return callP(__functionAddress); + } + + // --- [ wglBlitContextFramebufferAMD ] --- + + /** + * Blits data from one context to another. This facilitates high performance data communication between multiple contexts. + * + * @param dstCtx the context handle for the write context + * @param srcX0 the source x0 coordinate + * @param srcY0 the source Y0 coordinate + * @param srcX1 the source X1 coordinate + * @param srcY1 the source Y1 coordinate + * @param dstX0 the destination X0 coordinate + * @param dstY0 the destination Y0 coordinate + * @param dstX1 the destination X1 coordinate + * @param dstY1 the destination Y1 coordinate + * @param mask the bitwise OR of a number of values indicating which buffers are to be copied. One or more of:
{@link GL11#GL_COLOR_BUFFER_BIT COLOR_BUFFER_BIT}{@link GL11#GL_DEPTH_BUFFER_BIT DEPTH_BUFFER_BIT}{@link GL11#GL_STENCIL_BUFFER_BIT STENCIL_BUFFER_BIT}
+ * @param filter the interpolation method to apply if the image is stretched. One of:
{@link GL11#GL_LINEAR LINEAR}{@link GL11#GL_NEAREST NEAREST}
+ */ + @NativeType("VOID") + public static void wglBlitContextFramebufferAMD(@NativeType("HGLRC") long dstCtx, @NativeType("GLint") int srcX0, @NativeType("GLint") int srcY0, @NativeType("GLint") int srcX1, @NativeType("GLint") int srcY1, @NativeType("GLint") int dstX0, @NativeType("GLint") int dstY0, @NativeType("GLint") int dstX1, @NativeType("GLint") int dstY1, @NativeType("GLbitfield") int mask, @NativeType("GLenum") int filter) { + long __functionAddress = GL.getCapabilitiesWGL().wglBlitContextFramebufferAMD; + if (CHECKS) { + check(__functionAddress); + check(dstCtx); + } + callPV(dstCtx, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter, __functionAddress); + } + + /** Array version of: {@link #wglGetGPUIDsAMD GetGPUIDsAMD} */ + @NativeType("UINT") + public static int wglGetGPUIDsAMD(@Nullable @NativeType("UINT *") int[] ids) { + long __functionAddress = GL.getCapabilitiesWGL().wglGetGPUIDsAMD; + if (CHECKS) { + check(__functionAddress); + } + return callPI(lengthSafe(ids), ids, __functionAddress); + } + + /** Array version of: {@link #wglGetGPUInfoAMD GetGPUInfoAMD} */ + public static int wglGetGPUInfoAMD(@NativeType("UINT") int id, int property, @NativeType("GLenum") int dataType, @NativeType("void *") int[] data) { + long __functionAddress = GL.getCapabilitiesWGL().wglGetGPUInfoAMD; + if (CHECKS) { + check(__functionAddress); + } + return callPI(id, property, dataType, data.length, data, __functionAddress); + } + + /** Array version of: {@link #wglGetGPUInfoAMD GetGPUInfoAMD} */ + public static int wglGetGPUInfoAMD(@NativeType("UINT") int id, int property, @NativeType("GLenum") int dataType, @NativeType("void *") float[] data) { + long __functionAddress = GL.getCapabilitiesWGL().wglGetGPUInfoAMD; + if (CHECKS) { + check(__functionAddress); + } + return callPI(id, property, dataType, data.length, data, __functionAddress); + } + + /** Array version of: {@link #wglCreateAssociatedContextAttribsAMD CreateAssociatedContextAttribsAMD} */ + @NativeType("HGLRC") + public static long wglCreateAssociatedContextAttribsAMD(@NativeType("UINT") int id, @NativeType("HGLRC") long shareContext, @Nullable @NativeType("int const *") int[] attribList) { + long __functionAddress = GL.getCapabilitiesWGL().wglCreateAssociatedContextAttribsAMD; + if (CHECKS) { + check(__functionAddress); + checkNTSafe(attribList); + } + return callPPP(id, shareContext, attribList, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBBufferRegion.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBBufferRegion.java new file mode 100644 index 00000000..a50dc66b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBBufferRegion.java @@ -0,0 +1,129 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; + +/** + * Native bindings to the WGL_ARB_buffer_region extension. + * + *

The buffer region extension is a mechanism that allows an area of an OpenGL window to be saved in off-screen memory for quick restores. The off-screen + * memory can either be frame buffer memory or system memory, although frame buffer memory might offer optimal performance.

+ * + *

A buffer region can be created for the front color, back color, depth, and/or stencil buffer. Multiple buffer regions for the same buffer type can + * exist.

+ */ +public class WGLARBBufferRegion { + + /** Accepted by the {@code type} parameter of {@link #wglCreateBufferRegionARB CreateBufferRegionARB}. */ + public static final int + WGL_FRONT_COLOR_BUFFER_BIT_ARB = 0x1, + WGL_BACK_COLOR_BUFFER_BIT_ARB = 0x2, + WGL_DEPTH_BUFFER_BIT_ARB = 0x4, + WGL_STENCIL_BUFFER_BIT_ARB = 0x8; + + protected WGLARBBufferRegion() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(WGLCapabilities caps) { + return checkFunctions( + caps.wglCreateBufferRegionARB, caps.wglDeleteBufferRegionARB, caps.wglSaveBufferRegionARB, caps.wglRestoreBufferRegionARB + ); + } + + // --- [ wglCreateBufferRegionARB ] --- + + /** + * Creates a buffer region and returns a handle associated with it. + * + * @param hdc the device context for the device on which the buffer region is created + * @param layerPlane the layer plane. Positive values identify overlay planes, negative values identify underlay planes. A value of 0 identifies the main plane. + * @param type a bitwise OR of any of the following values indicating which buffers can be saved or restored. Multiple bits can be set and may result in better + * performance if multiple buffers are saved or restored. One of:
{@link #WGL_FRONT_COLOR_BUFFER_BIT_ARB FRONT_COLOR_BUFFER_BIT_ARB}{@link #WGL_BACK_COLOR_BUFFER_BIT_ARB BACK_COLOR_BUFFER_BIT_ARB}{@link #WGL_DEPTH_BUFFER_BIT_ARB DEPTH_BUFFER_BIT_ARB}
{@link #WGL_STENCIL_BUFFER_BIT_ARB STENCIL_BUFFER_BIT_ARB}
+ */ + @NativeType("HANDLE") + public static long wglCreateBufferRegionARB(@NativeType("HDC") long hdc, int layerPlane, @NativeType("UINT") int type) { + long __functionAddress = GL.getCapabilitiesWGL().wglCreateBufferRegionARB; + if (CHECKS) { + check(__functionAddress); + check(hdc); + } + return callPP(hdc, layerPlane, type, __functionAddress); + } + + // --- [ wglDeleteBufferRegionARB ] --- + + /** + * Deletes a buffer region. + * + * @param region a handle to a buffer region previously created with {@link #wglCreateBufferRegionARB CreateBufferRegionARB}. + */ + @NativeType("VOID") + public static void wglDeleteBufferRegionARB(@NativeType("HANDLE") long region) { + long __functionAddress = GL.getCapabilitiesWGL().wglDeleteBufferRegionARB; + if (CHECKS) { + check(__functionAddress); + check(region); + } + callPV(region, __functionAddress); + } + + // --- [ wglSaveBufferRegionARB ] --- + + /** + * Saves image, depth, and stencil data into the buffer region. + * + *

Data outside the window for the specified rectangle is undefined. The OpenGL coordinate system is used for specifying the rectangle ({@code x} and + * {@code y} specify the lower-left corner of the rectangle).

+ * + *

If an RC is current to the calling thread, a flush will occur before the save operation.

+ * + *

The saved buffer region area can be freed by calling {@code wglSaveBufferRegionARB} with {@code width} or {@code height} set to a value of 0.

+ * + * @param region a handle to a buffer region previously created with {@link #wglCreateBufferRegionARB CreateBufferRegionARB}. + * @param x the window x-coordinate for the source rectangle + * @param y the window y-coordinate for the source rectangle + * @param width the source rectangle width + * @param height the source rectangle height + */ + @NativeType("BOOL") + public static boolean wglSaveBufferRegionARB(@NativeType("HANDLE") long region, int x, int y, int width, int height) { + long __functionAddress = GL.getCapabilitiesWGL().wglSaveBufferRegionARB; + if (CHECKS) { + check(__functionAddress); + check(region); + } + return callPI(region, x, y, width, height, __functionAddress) != 0; + } + + // --- [ wglRestoreBufferRegionARB ] --- + + /** + * Restores a previously saved buffer region. + * + * @param region a handle to a buffer region previously created with {@link #wglCreateBufferRegionARB CreateBufferRegionARB}. + * @param x the window x-coordinate for the destination rectangle + * @param y the window y-coordinate for the destination rectangle + * @param width the destination rectangle width + * @param height the destination rectangle height + * @param xSrc the buffer region x-coordinate for the source of the data + * @param ySrc the buffer region y-coordinate for the source of the data + */ + @NativeType("BOOL") + public static boolean wglRestoreBufferRegionARB(@NativeType("HANDLE") long region, int x, int y, int width, int height, int xSrc, int ySrc) { + long __functionAddress = GL.getCapabilitiesWGL().wglRestoreBufferRegionARB; + if (CHECKS) { + check(__functionAddress); + check(region); + } + return callPI(region, x, y, width, height, xSrc, ySrc, __functionAddress) != 0; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBContextFlushControl.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBContextFlushControl.java new file mode 100644 index 00000000..95b25ff0 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBContextFlushControl.java @@ -0,0 +1,29 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the WGL_ARB_context_flush_control extension. + * + *

The WGL version of {@link KHRContextFlushControl}. This extension adds new context creation parameters the allow an application to specify the behavior + * that is desired when a context is made non-current, and specifically to opt out of the implicit flush behavior.

+ */ +public final class WGLARBContextFlushControl { + + /** Accepted as an attribute name in the {@code *attrib_list} argument to {@link WGLARBCreateContext#wglCreateContextAttribsARB CreateContextAttribsARB}. */ + public static final int WGL_CONTEXT_RELEASE_BEHAVIOR_ARB = 0x2097; + + /** + * Accepted as an attribute value for {@link #WGL_CONTEXT_RELEASE_BEHAVIOR_ARB CONTEXT_RELEASE_BEHAVIOR_ARB} in the {@code *attrib_list} argument to + * {@link WGLARBCreateContext#wglCreateContextAttribsARB CreateContextAttribsARB}. + */ + public static final int + WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB = 0x0, + WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB = 0x2098; + + private WGLARBContextFlushControl() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBCreateContext.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBCreateContext.java new file mode 100644 index 00000000..fcf41111 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBCreateContext.java @@ -0,0 +1,96 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the WGL_ARB_create_context extension. + * + *

With the advent of new versions of OpenGL which deprecate features and/or break backward compatibility with older versions, there is a need and desire + * to indicate at context creation which interface will be used. This extension add a new context creation routine with attributes specifying the GL + * version and context properties requested for the context.

+ * + *

Requires {@link WGLARBExtensionsString WGL_ARB_extensions_string}.

+ */ +public class WGLARBCreateContext { + + /** Accepted as an attribute name in {@code attribList}. */ + public static final int + WGL_CONTEXT_MAJOR_VERSION_ARB = 0x2091, + WGL_CONTEXT_MINOR_VERSION_ARB = 0x2092, + WGL_CONTEXT_LAYER_PLANE_ARB = 0x2093, + WGL_CONTEXT_FLAGS_ARB = 0x2094; + + /** Accepted as bits in the attribute value for {@link #WGL_CONTEXT_FLAGS_ARB CONTEXT_FLAGS_ARB} in {@code attribList}. */ + public static final int + WGL_CONTEXT_DEBUG_BIT_ARB = 0x1, + WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB = 0x2; + + /** New errors returned by {@link org.lwjgl.system.windows.WinBase#GetLastError}. */ + public static final int ERROR_INVALID_VERSION_ARB = 0x2095; + + protected WGLARBCreateContext() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(WGLCapabilities caps) { + return checkFunctions( + caps.wglCreateContextAttribsARB + ); + } + + // --- [ wglCreateContextAttribsARB ] --- + + /** Unsafe version of: {@link #wglCreateContextAttribsARB CreateContextAttribsARB} */ + public static long nwglCreateContextAttribsARB(long hdc, long shareContext, long attribList) { + long __functionAddress = GL.getCapabilitiesWGL().wglCreateContextAttribsARB; + if (CHECKS) { + check(__functionAddress); + check(hdc); + } + return callPPPP(hdc, shareContext, attribList, __functionAddress); + } + + /** + * Creates an OpenGL context. + * + *

If {@code shareContext} is not {@code NULL}, then all shareable data (excluding OpenGL texture objects named 0) will be shared by {@code shareContext}, all + * other contexts {@code shareContext} already shares with, and the newly created context. An arbitrary number of contexts can share data in this fashion.

+ * + * @param attribList a list of attributes for the context. The list consists of a sequence of <name, value> pairs terminated by the value 0. If an attribute is not + * specified in {@code attribList}, then the default value is used instead. If an attribute is specified more than once, then the last value specified + * is used. + */ + @NativeType("HGLRC") + public static long wglCreateContextAttribsARB(@NativeType("HDC") long hdc, @NativeType("HGLRC") long shareContext, @Nullable @NativeType("int const *") IntBuffer attribList) { + if (CHECKS) { + checkNTSafe(attribList); + } + return nwglCreateContextAttribsARB(hdc, shareContext, memAddressSafe(attribList)); + } + + /** Array version of: {@link #wglCreateContextAttribsARB CreateContextAttribsARB} */ + @NativeType("HGLRC") + public static long wglCreateContextAttribsARB(@NativeType("HDC") long hdc, @NativeType("HGLRC") long shareContext, @Nullable @NativeType("int const *") int[] attribList) { + long __functionAddress = GL.getCapabilitiesWGL().wglCreateContextAttribsARB; + if (CHECKS) { + check(__functionAddress); + check(hdc); + checkNTSafe(attribList); + } + return callPPPP(hdc, shareContext, attribList, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBCreateContextNoError.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBCreateContextNoError.java new file mode 100644 index 00000000..1f453d17 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBCreateContextNoError.java @@ -0,0 +1,23 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the WGL_ARB_create_context_no_error extension. + * + *

This extension allows the creation of an OpenGL or OpenGL ES context that doesn't generate errors if the context supports a no error mode. The + * implications of this feature are discussed in the {@link KHRNoError KHR_no_error} extension.

+ * + *

Requires {@link WGLARBCreateContext WGL_ARB_create_context}.

+ */ +public final class WGLARBCreateContextNoError { + + /** Accepted as an attribute name in the {@code *attrib_list} argument to {@link WGLARBCreateContext#wglCreateContextAttribsARB CreateContextAttribsARB}. */ + public static final int WGL_CONTEXT_OPENGL_NO_ERROR_ARB = 0x31B3; + + private WGLARBCreateContextNoError() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBCreateContextProfile.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBCreateContextProfile.java new file mode 100644 index 00000000..8385886f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBCreateContextProfile.java @@ -0,0 +1,30 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the WGL_ARB_create_context_profile extension. + * + *

Adds an attribute to {@link WGLARBCreateContext}, specifying the GL profile requested for a context of OpenGL 3.2 or later.

+ * + *

Requires {@link WGLARBExtensionsString WGL_ARB_extensions_string} and {@link GL32 OpenGL 3.2}.

+ */ +public final class WGLARBCreateContextProfile { + + /** Accepted as an attribute name in {@code attribList}. */ + public static final int WGL_CONTEXT_PROFILE_MASK_ARB = 0x9126; + + /** Accepted as bits in the attribute value for {@link #WGL_CONTEXT_PROFILE_MASK_ARB CONTEXT_PROFILE_MASK_ARB} in {@code attribList}. */ + public static final int + WGL_CONTEXT_CORE_PROFILE_BIT_ARB = 0x1, + WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB = 0x2; + + /** New errors returned by {@link org.lwjgl.system.windows.WinBase#GetLastError}. */ + public static final int ERROR_INVALID_PROFILE_ARB = 0x2096; + + private WGLARBCreateContextProfile() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBCreateContextRobustness.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBCreateContextRobustness.java new file mode 100644 index 00000000..31ca8252 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBCreateContextRobustness.java @@ -0,0 +1,36 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the WGL_ARB_create_context_robustness extension. + * + *

This extension allows creating an OpenGL context supporting robust buffer access behavior and a specified graphics reset notification behavior.

+ * + *

Requires {@link WGLARBExtensionsString WGL_ARB_extensions_string}, {@link WGLARBCreateContext WGL_ARB_create_context} and {@link ARBRobustness ARB_robustness}.

+ */ +public final class WGLARBCreateContextRobustness { + + /** + * Accepted as a bit in the attribute value for {@link WGLARBCreateContext#WGL_CONTEXT_FLAGS_ARB CONTEXT_FLAGS_ARB} in the {@code attrib_list} argument to + * {@link WGLARBCreateContext#wglCreateContextAttribsARB CreateContextAttribsARB}. + */ + public static final int WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB = 0x4; + + /** Accepted as an attribute name in the {@code attrib_list} argument to {@link WGLARBCreateContext#wglCreateContextAttribsARB CreateContextAttribsARB}. */ + public static final int WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB = 0x8256; + + /** + * Accepted as an attribute value for {@link #WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB} in the {@code attrib_list} argument to + * {@link WGLARBCreateContext#wglCreateContextAttribsARB CreateContextAttribsARB}. + */ + public static final int + WGL_NO_RESET_NOTIFICATION_ARB = 0x8261, + WGL_LOSE_CONTEXT_ON_RESET_ARB = 0x8252; + + private WGLARBCreateContextRobustness() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBExtensionsString.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBExtensionsString.java new file mode 100644 index 00000000..42ffbfb8 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBExtensionsString.java @@ -0,0 +1,60 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the WGL_ARB_extensions_string extension. + * + *

This extension provides a way for applications to determine which WGL extensions are supported by a device. This is the foundation upon which other WGL + * extensions are built.

+ */ +public class WGLARBExtensionsString { + + protected WGLARBExtensionsString() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(WGLCapabilities caps) { + return checkFunctions( + caps.wglGetExtensionsStringARB + ); + } + + // --- [ wglGetExtensionsStringARB ] --- + + /** Unsafe version of: {@link #wglGetExtensionsStringARB GetExtensionsStringARB} */ + public static long nwglGetExtensionsStringARB(long hdc) { + long __functionAddress = GL.getCapabilitiesWGL().wglGetExtensionsStringARB; + if (CHECKS) { + check(__functionAddress); + check(hdc); + } + return callPP(hdc, __functionAddress); + } + + /** + * Returns a list of supported extensions to WGL. Although the contents of the string is implementation specific, the string will be {@code NULL} terminated and + * will contain a space-separated list of extension names. (The extension names themselves do not contain spaces.) If there are no extensions then the + * empty string is returned. + * + * @param hdc the device context to query extensions for + */ + @Nullable + @NativeType("char const *") + public static String wglGetExtensionsStringARB(@NativeType("HDC") long hdc) { + long __result = nwglGetExtensionsStringARB(hdc); + return memASCIISafe(__result); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBFramebufferSRGB.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBFramebufferSRGB.java new file mode 100644 index 00000000..4f60b44f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBFramebufferSRGB.java @@ -0,0 +1,25 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the WGL_ARB_framebuffer_sRGB extension. + * + *

WGL functionality for {@link ARBFramebufferSRGB ARB_framebuffer_sRGB}.

+ * + *

Requires {@link WGLEXTExtensionsString WGL_EXT_extensions_string}, {@link WGLARBPixelFormat WGL_ARB_pixel_format} and {@link ARBFramebufferObject ARB_framebuffer_object}.

+ */ +public final class WGLARBFramebufferSRGB { + + /** + * Accepted by the {@code attributes} parameter of {@link WGLARBPixelFormat#wglGetPixelFormatAttribivARB GetPixelFormatAttribivARB} and the {@code attribIList} of + * {@link WGLARBPixelFormat#wglChoosePixelFormatARB ChoosePixelFormatARB}. + */ + public static final int WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB = 0x20A9; + + private WGLARBFramebufferSRGB() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBMakeCurrentRead.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBMakeCurrentRead.java new file mode 100644 index 00000000..decc401f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBMakeCurrentRead.java @@ -0,0 +1,91 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; + +/** + * Native bindings to the WGL_ARB_make_current_read extension. + * + *

The association of a separate "read" and "draw" DC with the current context allows for preprocessing of image data in an "off screen" DC which is then + * read into a visible DC for final display.

+ * + *

Requires {@link WGLARBExtensionsString WGL_ARB_extensions_string}.

+ */ +public class WGLARBMakeCurrentRead { + + /** New errors returned by {@link org.lwjgl.system.windows.WinBase#GetLastError}. */ + public static final int + ERROR_INVALID_PIXEL_TYPE_ARB = 0x2043, + ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB = 0x2054; + + protected WGLARBMakeCurrentRead() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(WGLCapabilities caps) { + return checkFunctions( + caps.wglMakeContextCurrentARB, caps.wglGetCurrentReadDCARB + ); + } + + // --- [ wglMakeContextCurrentARB ] --- + + /** + * Associates the context {@code hglrc} with the device {@code drawDC} for draws and the device {@code readDC} for reads. All subsequent OpenGL calls made + * by the calling thread are drawn on the device identified by {@code drawDC} and read on the device identified by {@code readDC}. + * + *

The {@code drawDC} and {@code readDC} parameters must refer to drawing surfaces supported by OpenGL. These parameters need not be the same {@code hdc} + * that was passed to {@link WGL#wglCreateContext CreateContext} when {@code hglrc} was created. {@code drawDC} must have the same pixel format and be created on the same + * physical device as the {@code hdc} that was passed into wglCreateContext. {@code readDC} must be created on the same device as the {@code hdc} that was + * passed to wglCreateContext and it must support the same pixel type as the pixel format of the {@code hdc} that was passed to wglCreateContext.

+ * + *

If {@code wglMakeContextCurrentARB} is used to associate a different device for reads than for draws, the "read" device will be used for the following + * OpenGL operations:

+ * + *
    + *
  1. Any pixel data that are sourced based on the value of {@link GL11#GL_READ_BUFFER READ_BUFFER}. Note, that accumulation operations use the value of {@code READ_BUFFER}, but + * are not allowed when a different device context is used for reads. In this case, the accumulation operation will generate {@link GL11#GL_INVALID_OPERATION INVALID_OPERATION}.
  2. + *
  3. Any depth values that are retrieved by {@link GL11C#glReadPixels ReadPixels}, {@link GL11#glCopyPixels CopyPixels}, or any OpenGL extension that sources depth images from the frame buffer in the + * manner of {@code ReadPixels} and {@code CopyPixels}.
  4. + *
  5. Any stencil values that are retrieved by {@code ReadPixels}, {@code CopyPixels}, or any OpenGL extension that sources stencil images from the + * framebuffer in the manner of {@code ReadPixels} and {@code CopyPixels}.
  6. + *
+ * + *

These frame buffer values are taken from the surface associated with the device context specified by {@code readDC}.

+ * + * @param drawDC the "draw" device context + * @param readDC the "read" device context + * @param hglrc the OpenGL context + */ + @NativeType("BOOL") + public static boolean wglMakeContextCurrentARB(@NativeType("HDC") long drawDC, @NativeType("HDC") long readDC, @NativeType("HGLRC") long hglrc) { + long __functionAddress = GL.getCapabilitiesWGL().wglMakeContextCurrentARB; + if (CHECKS) { + check(__functionAddress); + check(drawDC); + check(readDC); + check(hglrc); + } + return callPPPI(drawDC, readDC, hglrc, __functionAddress) != 0; + } + + // --- [ wglGetCurrentReadDCARB ] --- + + /** Returns the "read" device context for the current OpenGL context. */ + @NativeType("HDC") + public static long wglGetCurrentReadDCARB() { + long __functionAddress = GL.getCapabilitiesWGL().wglGetCurrentReadDCARB; + if (CHECKS) { + check(__functionAddress); + } + return callP(__functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBMultisample.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBMultisample.java new file mode 100644 index 00000000..ffa0fc52 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBMultisample.java @@ -0,0 +1,28 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the WGL_ARB_multisample extension. + * + *

See {@link ARBMultisample} for details.

+ * + *

Requires {@link WGLEXTExtensionsString WGL_EXT_extensions_string} and {@link WGLARBPixelFormat WGL_ARB_pixel_format}.

+ */ +public final class WGLARBMultisample { + + /** + * Accepted by the {@code attributes} parameter of {@link WGLARBPixelFormat#wglGetPixelFormatAttribivARB GetPixelFormatAttribivARB}, + * {@link WGLARBPixelFormat#wglGetPixelFormatAttribfvARB GetPixelFormatAttribfvARB}, and the {@code attribIList} and {@code attribFList} of + * {@link WGLARBPixelFormat#wglChoosePixelFormatARB ChoosePixelFormatARB}. + */ + public static final int + WGL_SAMPLE_BUFFERS_ARB = 0x2041, + WGL_SAMPLES_ARB = 0x2042; + + private WGLARBMultisample() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBPbuffer.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBPbuffer.java new file mode 100644 index 00000000..76a40b61 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBPbuffer.java @@ -0,0 +1,212 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the WGL_ARB_pbuffer extension. + * + *

This extension defines pixel buffers (pbuffer for short). Pbuffers are additional non-visible rendering buffers for an OpenGL renderer. Pbuffers are + * equivalent to a window that has the same pixel format descriptor with the following exceptions:

+ * + *
    + *
  1. There is no rendering to a pbuffer by GDI.
  2. + *
  3. The pixel format descriptors used for a pbuffer can only be those that are supported by the ICD. Generic formats are not valid.
  4. + *
  5. The allocation of a pbuffer can fail if there are insufficient resources (i.e., all the pbuffer memory has been allocated).
  6. + *
  7. The pixel buffer might be lost if a display mode change occurs. A query is provided that can be called after a display mode change to determine the + * state of the pixel buffer.
  8. + *
+ * + *

The intent of the pbuffer semantics is to enable implementations to allocate pbuffers in non-visible frame buffer memory. These pbuffers are intended to + * be "static" resources in that a program will typically allocate them only once rather than as a part of its rendering loop. (Pbuffers should be + * deallocated when the program is no longer using them -- for example, if the program is iconified.)

+ * + *

The frame buffer resources that are associated with a pbuffer are also static and are deallocated when the pbuffer is destroyed or possibly when a + * display mode change occurs.

+ * + *

Requires {@link WGLARBExtensionsString WGL_ARB_extensions_string} and {@link WGLARBPixelFormat WGL_ARB_pixel_format}.

+ */ +public class WGLARBPbuffer { + + /** + * Accepted by the {@code attribIList} parameter of {@link WGLARBPixelFormat#wglChoosePixelFormatARB ChoosePixelFormatARB} and the {@code attributes} parameter of + * {@link WGLARBPixelFormat#wglGetPixelFormatAttribivARB GetPixelFormatAttribivARB}. + */ + public static final int WGL_DRAW_TO_PBUFFER_ARB = 0x202D; + + /** Accepted by the {@code attributes} parameter of {@link WGLARBPixelFormat#wglGetPixelFormatAttribivARB GetPixelFormatAttribivARB}. */ + public static final int + WGL_MAX_PBUFFER_PIXELS_ARB = 0x202E, + WGL_MAX_PBUFFER_WIDTH_ARB = 0x202F, + WGL_MAX_PBUFFER_HEIGHT_ARB = 0x2030; + + /** Accepted by the {@code attribList} parameter of {@link #wglCreatePbufferARB CreatePbufferARB}. */ + public static final int WGL_PBUFFER_LARGEST_ARB = 0x2033; + + /** Accepted by the {@code attribute} parameter of {@link #wglQueryPbufferARB QueryPbufferARB}. */ + public static final int + WGL_PBUFFER_WIDTH_ARB = 0x2034, + WGL_PBUFFER_HEIGHT_ARB = 0x2035, + WGL_PBUFFER_LOST_ARB = 0x2036; + + protected WGLARBPbuffer() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(WGLCapabilities caps) { + return checkFunctions( + caps.wglCreatePbufferARB, caps.wglGetPbufferDCARB, caps.wglReleasePbufferDCARB, caps.wglDestroyPbufferARB, caps.wglQueryPbufferARB + ); + } + + // --- [ wglCreatePbufferARB ] --- + + /** Unsafe version of: {@link #wglCreatePbufferARB CreatePbufferARB} */ + public static long nwglCreatePbufferARB(long hdc, int pixelFormat, int width, int height, long attribList) { + long __functionAddress = GL.getCapabilitiesWGL().wglCreatePbufferARB; + if (CHECKS) { + check(__functionAddress); + check(hdc); + } + return callPPP(hdc, pixelFormat, width, height, attribList, __functionAddress); + } + + /** + * Creates a pixel buffer (pbuffer) and returns a handle to it. + * + *

Support for pbuffers may be restricted to specific pixel formats. Use {@link WGLARBPixelFormat#wglGetPixelFormatAttribivARB GetPixelFormatAttribivARB} to query the {@link #WGL_DRAW_TO_PBUFFER_ARB DRAW_TO_PBUFFER_ARB} + * attribute to determine which pixel formats support the creation of pbuffers.

+ * + * @param hdc a device context for the device on which the pbuffer is created + * @param pixelFormat a non-generic pixel format descriptor index + * @param width the pixel width of the rectangular pbuffer + * @param height the pixel height of the rectangular pbuffer + * @param attribList a 0-terminated list of attributes {type, value} pairs containing integer attribute values + */ + @NativeType("HPBUFFERARB") + public static long wglCreatePbufferARB(@NativeType("HDC") long hdc, int pixelFormat, int width, int height, @Nullable @NativeType("int const *") IntBuffer attribList) { + if (CHECKS) { + checkNTSafe(attribList); + } + return nwglCreatePbufferARB(hdc, pixelFormat, width, height, memAddressSafe(attribList)); + } + + // --- [ wglGetPbufferDCARB ] --- + + /** + * Creates a device context for the pbuffer. + * + * @param pbuffer a pbuffer handle returned from a previous call to {@link #wglCreatePbufferARB CreatePbufferARB} + */ + @NativeType("HDC") + public static long wglGetPbufferDCARB(@NativeType("HPBUFFERARB") long pbuffer) { + long __functionAddress = GL.getCapabilitiesWGL().wglGetPbufferDCARB; + if (CHECKS) { + check(__functionAddress); + check(pbuffer); + } + return callPP(pbuffer, __functionAddress); + } + + // --- [ wglReleasePbufferDCARB ] --- + + /** + * Releases a device context obtained from a previous call to {@link #wglGetPbufferDCARB GetPbufferDCARB}. + * + * @param pbuffer a pbuffer handle + * @param hdc a device context handle + */ + public static int wglReleasePbufferDCARB(@NativeType("HPBUFFERARB") long pbuffer, @NativeType("HDC") long hdc) { + long __functionAddress = GL.getCapabilitiesWGL().wglReleasePbufferDCARB; + if (CHECKS) { + check(__functionAddress); + check(pbuffer); + check(hdc); + } + return callPPI(pbuffer, hdc, __functionAddress); + } + + // --- [ wglDestroyPbufferARB ] --- + + /** + * Destroys a pbuffer. + * + *

The pbuffer is destroyed once it is no longer current to any rendering context. When a pbuffer is destroyed, any memory resources that are attached to + * it are freed and its handle is no longer valid.

+ * + * @param pbuffer a pbuffer handle + */ + @NativeType("BOOL") + public static boolean wglDestroyPbufferARB(@NativeType("HPBUFFERARB") long pbuffer) { + long __functionAddress = GL.getCapabilitiesWGL().wglDestroyPbufferARB; + if (CHECKS) { + check(__functionAddress); + check(pbuffer); + } + return callPI(pbuffer, __functionAddress) != 0; + } + + // --- [ wglQueryPbufferARB ] --- + + /** Unsafe version of: {@link #wglQueryPbufferARB QueryPbufferARB} */ + public static int nwglQueryPbufferARB(long pbuffer, int attribute, long value) { + long __functionAddress = GL.getCapabilitiesWGL().wglQueryPbufferARB; + if (CHECKS) { + check(__functionAddress); + check(pbuffer); + } + return callPPI(pbuffer, attribute, value, __functionAddress); + } + + /** + * Queries an attribute associated with a specific pbuffer. + * + * @param pbuffer a pbuffer handle + * @param attribute the attribute to query. One of:
{@link #WGL_PBUFFER_WIDTH_ARB PBUFFER_WIDTH_ARB}{@link #WGL_PBUFFER_HEIGHT_ARB PBUFFER_HEIGHT_ARB}{@link #WGL_PBUFFER_LOST_ARB PBUFFER_LOST_ARB}
+ * @param value the attribute value + */ + @NativeType("BOOL") + public static boolean wglQueryPbufferARB(@NativeType("HPBUFFERARB") long pbuffer, int attribute, @NativeType("int *") IntBuffer value) { + if (CHECKS) { + check(value, 1); + } + return nwglQueryPbufferARB(pbuffer, attribute, memAddress(value)) != 0; + } + + /** Array version of: {@link #wglCreatePbufferARB CreatePbufferARB} */ + @NativeType("HPBUFFERARB") + public static long wglCreatePbufferARB(@NativeType("HDC") long hdc, int pixelFormat, int width, int height, @Nullable @NativeType("int const *") int[] attribList) { + long __functionAddress = GL.getCapabilitiesWGL().wglCreatePbufferARB; + if (CHECKS) { + check(__functionAddress); + check(hdc); + checkNTSafe(attribList); + } + return callPPP(hdc, pixelFormat, width, height, attribList, __functionAddress); + } + + /** Array version of: {@link #wglQueryPbufferARB QueryPbufferARB} */ + @NativeType("BOOL") + public static boolean wglQueryPbufferARB(@NativeType("HPBUFFERARB") long pbuffer, int attribute, @NativeType("int *") int[] value) { + long __functionAddress = GL.getCapabilitiesWGL().wglQueryPbufferARB; + if (CHECKS) { + check(__functionAddress); + check(pbuffer); + check(value, 1); + } + return callPPI(pbuffer, attribute, value, __functionAddress) != 0; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBPixelFormat.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBPixelFormat.java new file mode 100644 index 00000000..c173f08d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBPixelFormat.java @@ -0,0 +1,284 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the WGL_ARB_pixel_format extension. + * + *

This extension adds functions to query pixel format attributes and to choose from the list of supported pixel formats.

+ * + *

These functions treat pixel formats as opaque types: attributes are specified by name rather than by accessing them directly as fields in a structure. + * Thus the list of attributes can be easily extended.

+ * + *

Requires {@link WGLARBExtensionsString WGL_ARB_extensions_string}.

+ */ +public class WGLARBPixelFormat { + + /** + * Accepted in the {@code attributes} parameter array of {@link #wglGetPixelFormatAttribivARB GetPixelFormatAttribivARB}, and {@link #wglGetPixelFormatAttribfvARB GetPixelFormatAttribfvARB}, and as a type in + * the {@code attribIList} and {@code attribFList} parameter arrays of {@link #wglChoosePixelFormatARB ChoosePixelFormatARB}. + */ + public static final int + WGL_NUMBER_PIXEL_FORMATS_ARB = 0x2000, + WGL_DRAW_TO_WINDOW_ARB = 0x2001, + WGL_DRAW_TO_BITMAP_ARB = 0x2002, + WGL_ACCELERATION_ARB = 0x2003, + WGL_NEED_PALETTE_ARB = 0x2004, + WGL_NEED_SYSTEM_PALETTE_ARB = 0x2005, + WGL_SWAP_LAYER_BUFFERS_ARB = 0x2006, + WGL_SWAP_METHOD_ARB = 0x2007, + WGL_NUMBER_OVERLAYS_ARB = 0x2008, + WGL_NUMBER_UNDERLAYS_ARB = 0x2009, + WGL_TRANSPARENT_ARB = 0x200A, + WGL_TRANSPARENT_RED_VALUE_ARB = 0x2037, + WGL_TRANSPARENT_GREEN_VALUE_ARB = 0x2038, + WGL_TRANSPARENT_BLUE_VALUE_ARB = 0x2039, + WGL_TRANSPARENT_ALPHA_VALUE_ARB = 0x203A, + WGL_TRANSPARENT_INDEX_VALUE_ARB = 0x203B, + WGL_SHARE_DEPTH_ARB = 0x200C, + WGL_SHARE_STENCIL_ARB = 0x200D, + WGL_SHARE_ACCUM_ARB = 0x200E, + WGL_SUPPORT_GDI_ARB = 0x200F, + WGL_SUPPORT_OPENGL_ARB = 0x2010, + WGL_DOUBLE_BUFFER_ARB = 0x2011, + WGL_STEREO_ARB = 0x2012, + WGL_PIXEL_TYPE_ARB = 0x2013, + WGL_COLOR_BITS_ARB = 0x2014, + WGL_RED_BITS_ARB = 0x2015, + WGL_RED_SHIFT_ARB = 0x2016, + WGL_GREEN_BITS_ARB = 0x2017, + WGL_GREEN_SHIFT_ARB = 0x2018, + WGL_BLUE_BITS_ARB = 0x2019, + WGL_BLUE_SHIFT_ARB = 0x201A, + WGL_ALPHA_BITS_ARB = 0x201B, + WGL_ALPHA_SHIFT_ARB = 0x201C, + WGL_ACCUM_BITS_ARB = 0x201D, + WGL_ACCUM_RED_BITS_ARB = 0x201E, + WGL_ACCUM_GREEN_BITS_ARB = 0x201F, + WGL_ACCUM_BLUE_BITS_ARB = 0x2020, + WGL_ACCUM_ALPHA_BITS_ARB = 0x2021, + WGL_DEPTH_BITS_ARB = 0x2022, + WGL_STENCIL_BITS_ARB = 0x2023, + WGL_AUX_BUFFERS_ARB = 0x2024; + + /** + * Accepted as a value in the {@code attribIList} and {@code attribFList} parameter arrays of {@link #wglChoosePixelFormatARB ChoosePixelFormatARB}, and returned in the + * {@code values} parameter array of {@link #wglGetPixelFormatAttribivARB GetPixelFormatAttribivARB} and {@link #wglGetPixelFormatAttribfvARB GetPixelFormatAttribfvARB}. + */ + public static final int + WGL_NO_ACCELERATION_ARB = 0x2025, + WGL_GENERIC_ACCELERATION_ARB = 0x2026, + WGL_FULL_ACCELERATION_ARB = 0x2027, + WGL_SWAP_EXCHANGE_ARB = 0x2028, + WGL_SWAP_COPY_ARB = 0x2029, + WGL_SWAP_UNDEFINED_ARB = 0x202A, + WGL_TYPE_RGBA_ARB = 0x202B, + WGL_TYPE_COLORINDEX_ARB = 0x202C; + + protected WGLARBPixelFormat() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(WGLCapabilities caps) { + return checkFunctions( + caps.wglGetPixelFormatAttribivARB, caps.wglGetPixelFormatAttribfvARB, caps.wglChoosePixelFormatARB + ); + } + + // --- [ wglGetPixelFormatAttribivARB ] --- + + /** + * Unsafe version of: {@link #wglGetPixelFormatAttribivARB GetPixelFormatAttribivARB} + * + * @param n the number of attributes being queried + */ + public static int nwglGetPixelFormatAttribivARB(long hdc, int pixelFormat, int layerPlane, int n, long attributes, long values) { + long __functionAddress = GL.getCapabilitiesWGL().wglGetPixelFormatAttribivARB; + if (CHECKS) { + check(__functionAddress); + check(hdc); + } + return callPPPI(hdc, pixelFormat, layerPlane, n, attributes, values, __functionAddress); + } + + /** + * @param hdc the device context on which the pixel format is supported + * @param pixelFormat an index that specifies the pixel format + * @param layerPlane the plane being queried + * @param attributes an array of pixel format attribute identifiers which specify the attributes to be queried. One of:
{@link #WGL_NUMBER_PIXEL_FORMATS_ARB NUMBER_PIXEL_FORMATS_ARB}{@link #WGL_DRAW_TO_WINDOW_ARB DRAW_TO_WINDOW_ARB}{@link #WGL_DRAW_TO_BITMAP_ARB DRAW_TO_BITMAP_ARB}{@link #WGL_ACCELERATION_ARB ACCELERATION_ARB}
{@link #WGL_NEED_PALETTE_ARB NEED_PALETTE_ARB}{@link #WGL_NEED_SYSTEM_PALETTE_ARB NEED_SYSTEM_PALETTE_ARB}{@link #WGL_SWAP_LAYER_BUFFERS_ARB SWAP_LAYER_BUFFERS_ARB}{@link #WGL_SWAP_METHOD_ARB SWAP_METHOD_ARB}
{@link #WGL_NUMBER_OVERLAYS_ARB NUMBER_OVERLAYS_ARB}{@link #WGL_NUMBER_UNDERLAYS_ARB NUMBER_UNDERLAYS_ARB}{@link #WGL_TRANSPARENT_ARB TRANSPARENT_ARB}{@link #WGL_TRANSPARENT_RED_VALUE_ARB TRANSPARENT_RED_VALUE_ARB}
{@link #WGL_TRANSPARENT_GREEN_VALUE_ARB TRANSPARENT_GREEN_VALUE_ARB}{@link #WGL_TRANSPARENT_BLUE_VALUE_ARB TRANSPARENT_BLUE_VALUE_ARB}{@link #WGL_TRANSPARENT_ALPHA_VALUE_ARB TRANSPARENT_ALPHA_VALUE_ARB}{@link #WGL_TRANSPARENT_INDEX_VALUE_ARB TRANSPARENT_INDEX_VALUE_ARB}
{@link #WGL_SHARE_DEPTH_ARB SHARE_DEPTH_ARB}{@link #WGL_SHARE_STENCIL_ARB SHARE_STENCIL_ARB}{@link #WGL_SHARE_ACCUM_ARB SHARE_ACCUM_ARB}{@link #WGL_SUPPORT_GDI_ARB SUPPORT_GDI_ARB}
{@link #WGL_SUPPORT_OPENGL_ARB SUPPORT_OPENGL_ARB}{@link #WGL_DOUBLE_BUFFER_ARB DOUBLE_BUFFER_ARB}{@link #WGL_STEREO_ARB STEREO_ARB}{@link #WGL_PIXEL_TYPE_ARB PIXEL_TYPE_ARB}
{@link #WGL_COLOR_BITS_ARB COLOR_BITS_ARB}{@link #WGL_RED_BITS_ARB RED_BITS_ARB}{@link #WGL_RED_SHIFT_ARB RED_SHIFT_ARB}{@link #WGL_GREEN_BITS_ARB GREEN_BITS_ARB}
{@link #WGL_GREEN_SHIFT_ARB GREEN_SHIFT_ARB}{@link #WGL_BLUE_BITS_ARB BLUE_BITS_ARB}{@link #WGL_BLUE_SHIFT_ARB BLUE_SHIFT_ARB}{@link #WGL_ALPHA_BITS_ARB ALPHA_BITS_ARB}
{@link #WGL_ALPHA_SHIFT_ARB ALPHA_SHIFT_ARB}{@link #WGL_ACCUM_BITS_ARB ACCUM_BITS_ARB}{@link #WGL_ACCUM_RED_BITS_ARB ACCUM_RED_BITS_ARB}{@link #WGL_ACCUM_GREEN_BITS_ARB ACCUM_GREEN_BITS_ARB}
{@link #WGL_ACCUM_BLUE_BITS_ARB ACCUM_BLUE_BITS_ARB}{@link #WGL_ACCUM_ALPHA_BITS_ARB ACCUM_ALPHA_BITS_ARB}{@link #WGL_DEPTH_BITS_ARB DEPTH_BITS_ARB}{@link #WGL_STENCIL_BITS_ARB STENCIL_BITS_ARB}
{@link #WGL_AUX_BUFFERS_ARB AUX_BUFFERS_ARB}
+ * @param values a buffer into which the results of the query will be placed + */ + @NativeType("BOOL") + public static boolean wglGetPixelFormatAttribivARB(@NativeType("HDC") long hdc, int pixelFormat, int layerPlane, @NativeType("int const *") IntBuffer attributes, @NativeType("int *") IntBuffer values) { + if (CHECKS) { + check(values, attributes.remaining()); + } + return nwglGetPixelFormatAttribivARB(hdc, pixelFormat, layerPlane, attributes.remaining(), memAddress(attributes), memAddress(values)) != 0; + } + + /** + * @param hdc the device context on which the pixel format is supported + * @param pixelFormat an index that specifies the pixel format + * @param layerPlane the plane being queried + * @param values a buffer into which the results of the query will be placed + */ + @NativeType("BOOL") + public static boolean wglGetPixelFormatAttribiARB(@NativeType("HDC") long hdc, int pixelFormat, int layerPlane, @NativeType("int const *") int attribute, @NativeType("int *") IntBuffer values) { + if (CHECKS) { + check(values, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer attributes = stack.ints(attribute); + return nwglGetPixelFormatAttribivARB(hdc, pixelFormat, layerPlane, 1, memAddress(attributes), memAddress(values)) != 0; + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ wglGetPixelFormatAttribfvARB ] --- + + /** + * Unsafe version of: {@link #wglGetPixelFormatAttribfvARB GetPixelFormatAttribfvARB} + * + * @param n the number of attributes being queried + */ + public static int nwglGetPixelFormatAttribfvARB(long hdc, int pixelFormat, int layerPlane, int n, long attributes, long values) { + long __functionAddress = GL.getCapabilitiesWGL().wglGetPixelFormatAttribfvARB; + if (CHECKS) { + check(__functionAddress); + check(hdc); + } + return callPPPI(hdc, pixelFormat, layerPlane, n, attributes, values, __functionAddress); + } + + /** + * Float version of {@link #wglGetPixelFormatAttribivARB GetPixelFormatAttribivARB}. + * + * @param hdc the device context on which the pixel format is supported + * @param pixelFormat an index that specifies the pixel format + * @param layerPlane the plane being queried + * @param attributes an array of pixel format attribute identifiers which specify the attributes to be queried + * @param values a buffer into which the results of the query will be placed + */ + @NativeType("BOOL") + public static boolean wglGetPixelFormatAttribfvARB(@NativeType("HDC") long hdc, int pixelFormat, int layerPlane, @NativeType("int const *") IntBuffer attributes, @NativeType("FLOAT *") FloatBuffer values) { + if (CHECKS) { + check(values, attributes.remaining()); + } + return nwglGetPixelFormatAttribfvARB(hdc, pixelFormat, layerPlane, attributes.remaining(), memAddress(attributes), memAddress(values)) != 0; + } + + /** + * Float version of {@link #wglGetPixelFormatAttribivARB GetPixelFormatAttribivARB}. + * + * @param hdc the device context on which the pixel format is supported + * @param pixelFormat an index that specifies the pixel format + * @param layerPlane the plane being queried + * @param values a buffer into which the results of the query will be placed + */ + @NativeType("BOOL") + public static boolean wglGetPixelFormatAttribfARB(@NativeType("HDC") long hdc, int pixelFormat, int layerPlane, @NativeType("int const *") int attribute, @NativeType("FLOAT *") FloatBuffer values) { + if (CHECKS) { + check(values, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer attributes = stack.ints(attribute); + return nwglGetPixelFormatAttribfvARB(hdc, pixelFormat, layerPlane, 1, memAddress(attributes), memAddress(values)) != 0; + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ wglChoosePixelFormatARB ] --- + + /** + * Unsafe version of: {@link #wglChoosePixelFormatARB ChoosePixelFormatARB} + * + * @param maxFormats the number of attributes being queried + */ + public static int nwglChoosePixelFormatARB(long hdc, long attribIList, long attribFList, int maxFormats, long formats, long numFormats) { + long __functionAddress = GL.getCapabilitiesWGL().wglChoosePixelFormatARB; + if (CHECKS) { + check(__functionAddress); + check(hdc); + } + return callPPPPPI(hdc, attribIList, attribFList, maxFormats, formats, numFormats, __functionAddress); + } + + /** + * Selects from among all of the available pixel formats (including both accelerated and generic formats and non-displayable formats). This function + * accepts attributes for the main planes. A list of pixel formats that match the specified attributes is returned with the "best" pixel formats at the + * start of the list (order is device dependent). + * + * @param hdc the device context on which the pixel format is supported + * @param attribIList a list of attribute {type, value} pairs containing integer attribute values. One of:
{@link #WGL_NUMBER_PIXEL_FORMATS_ARB NUMBER_PIXEL_FORMATS_ARB}{@link #WGL_DRAW_TO_WINDOW_ARB DRAW_TO_WINDOW_ARB}{@link #WGL_DRAW_TO_BITMAP_ARB DRAW_TO_BITMAP_ARB}{@link #WGL_ACCELERATION_ARB ACCELERATION_ARB}
{@link #WGL_NEED_PALETTE_ARB NEED_PALETTE_ARB}{@link #WGL_NEED_SYSTEM_PALETTE_ARB NEED_SYSTEM_PALETTE_ARB}{@link #WGL_SWAP_LAYER_BUFFERS_ARB SWAP_LAYER_BUFFERS_ARB}{@link #WGL_SWAP_METHOD_ARB SWAP_METHOD_ARB}
{@link #WGL_NUMBER_OVERLAYS_ARB NUMBER_OVERLAYS_ARB}{@link #WGL_NUMBER_UNDERLAYS_ARB NUMBER_UNDERLAYS_ARB}{@link #WGL_TRANSPARENT_ARB TRANSPARENT_ARB}{@link #WGL_TRANSPARENT_RED_VALUE_ARB TRANSPARENT_RED_VALUE_ARB}
{@link #WGL_TRANSPARENT_GREEN_VALUE_ARB TRANSPARENT_GREEN_VALUE_ARB}{@link #WGL_TRANSPARENT_BLUE_VALUE_ARB TRANSPARENT_BLUE_VALUE_ARB}{@link #WGL_TRANSPARENT_ALPHA_VALUE_ARB TRANSPARENT_ALPHA_VALUE_ARB}{@link #WGL_TRANSPARENT_INDEX_VALUE_ARB TRANSPARENT_INDEX_VALUE_ARB}
{@link #WGL_SHARE_DEPTH_ARB SHARE_DEPTH_ARB}{@link #WGL_SHARE_STENCIL_ARB SHARE_STENCIL_ARB}{@link #WGL_SHARE_ACCUM_ARB SHARE_ACCUM_ARB}{@link #WGL_SUPPORT_GDI_ARB SUPPORT_GDI_ARB}
{@link #WGL_SUPPORT_OPENGL_ARB SUPPORT_OPENGL_ARB}{@link #WGL_DOUBLE_BUFFER_ARB DOUBLE_BUFFER_ARB}{@link #WGL_STEREO_ARB STEREO_ARB}{@link #WGL_PIXEL_TYPE_ARB PIXEL_TYPE_ARB}
{@link #WGL_COLOR_BITS_ARB COLOR_BITS_ARB}{@link #WGL_RED_BITS_ARB RED_BITS_ARB}{@link #WGL_RED_SHIFT_ARB RED_SHIFT_ARB}{@link #WGL_GREEN_BITS_ARB GREEN_BITS_ARB}
{@link #WGL_GREEN_SHIFT_ARB GREEN_SHIFT_ARB}{@link #WGL_BLUE_BITS_ARB BLUE_BITS_ARB}{@link #WGL_BLUE_SHIFT_ARB BLUE_SHIFT_ARB}{@link #WGL_ALPHA_BITS_ARB ALPHA_BITS_ARB}
{@link #WGL_ALPHA_SHIFT_ARB ALPHA_SHIFT_ARB}{@link #WGL_ACCUM_BITS_ARB ACCUM_BITS_ARB}{@link #WGL_ACCUM_RED_BITS_ARB ACCUM_RED_BITS_ARB}{@link #WGL_ACCUM_GREEN_BITS_ARB ACCUM_GREEN_BITS_ARB}
{@link #WGL_ACCUM_BLUE_BITS_ARB ACCUM_BLUE_BITS_ARB}{@link #WGL_ACCUM_ALPHA_BITS_ARB ACCUM_ALPHA_BITS_ARB}{@link #WGL_DEPTH_BITS_ARB DEPTH_BITS_ARB}{@link #WGL_STENCIL_BITS_ARB STENCIL_BITS_ARB}
{@link #WGL_AUX_BUFFERS_ARB AUX_BUFFERS_ARB}
+ * @param attribFList a list of attribute {type, value} pairs containing floating point attribute values + * @param formats an array of returned indices of the matching pixel formats. The best pixel formats (i.e. closest match and best format for the hardware) are at the + * head of the list. + * @param numFormats returns the number of matching formats + */ + @NativeType("BOOL") + public static boolean wglChoosePixelFormatARB(@NativeType("HDC") long hdc, @Nullable @NativeType("int const *") IntBuffer attribIList, @Nullable @NativeType("FLOAT const *") FloatBuffer attribFList, @NativeType("int *") IntBuffer formats, @NativeType("UINT *") IntBuffer numFormats) { + if (CHECKS) { + checkNTSafe(attribIList); + checkNTSafe(attribFList); + check(numFormats, 1); + } + return nwglChoosePixelFormatARB(hdc, memAddressSafe(attribIList), memAddressSafe(attribFList), formats.remaining(), memAddress(formats), memAddress(numFormats)) != 0; + } + + /** Array version of: {@link #wglGetPixelFormatAttribivARB GetPixelFormatAttribivARB} */ + @NativeType("BOOL") + public static boolean wglGetPixelFormatAttribivARB(@NativeType("HDC") long hdc, int pixelFormat, int layerPlane, @NativeType("int const *") int[] attributes, @NativeType("int *") int[] values) { + long __functionAddress = GL.getCapabilitiesWGL().wglGetPixelFormatAttribivARB; + if (CHECKS) { + check(__functionAddress); + check(hdc); + check(values, attributes.length); + } + return callPPPI(hdc, pixelFormat, layerPlane, attributes.length, attributes, values, __functionAddress) != 0; + } + + /** Array version of: {@link #wglGetPixelFormatAttribfvARB GetPixelFormatAttribfvARB} */ + @NativeType("BOOL") + public static boolean wglGetPixelFormatAttribfvARB(@NativeType("HDC") long hdc, int pixelFormat, int layerPlane, @NativeType("int const *") int[] attributes, @NativeType("FLOAT *") float[] values) { + long __functionAddress = GL.getCapabilitiesWGL().wglGetPixelFormatAttribfvARB; + if (CHECKS) { + check(__functionAddress); + check(hdc); + check(values, attributes.length); + } + return callPPPI(hdc, pixelFormat, layerPlane, attributes.length, attributes, values, __functionAddress) != 0; + } + + /** Array version of: {@link #wglChoosePixelFormatARB ChoosePixelFormatARB} */ + @NativeType("BOOL") + public static boolean wglChoosePixelFormatARB(@NativeType("HDC") long hdc, @Nullable @NativeType("int const *") int[] attribIList, @Nullable @NativeType("FLOAT const *") float[] attribFList, @NativeType("int *") int[] formats, @NativeType("UINT *") int[] numFormats) { + long __functionAddress = GL.getCapabilitiesWGL().wglChoosePixelFormatARB; + if (CHECKS) { + check(__functionAddress); + check(hdc); + checkNTSafe(attribIList); + checkNTSafe(attribFList); + check(numFormats, 1); + } + return callPPPPPI(hdc, attribIList, attribFList, formats.length, formats, numFormats, __functionAddress) != 0; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBPixelFormatFloat.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBPixelFormatFloat.java new file mode 100644 index 00000000..03d05782 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBPixelFormatFloat.java @@ -0,0 +1,25 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the WGL_ARB_pixel_format_float extension. + * + *

This extension adds pixel formats with floating-point RGBA color components.

+ * + *

Requires {@link WGLARBPixelFormat WGL_ARB_pixel_format} and {@link GL15 OpenGL 1.5}.

+ */ +public final class WGLARBPixelFormatFloat { + + /** + * Accepted as a value in the {@code attribIList} parameter array of {@link WGLARBPixelFormat#wglChoosePixelFormatARB ChoosePixelFormatARB}, and returned in the {@code values} + * parameter array of {@link WGLARBPixelFormat#wglGetPixelFormatAttribivARB GetPixelFormatAttribivARB}. + */ + public static final int WGL_TYPE_RGBA_FLOAT_ARB = 0x21A0; + + private WGLARBPixelFormatFloat() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBRenderTexture.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBRenderTexture.java new file mode 100644 index 00000000..33bbb4da --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBRenderTexture.java @@ -0,0 +1,198 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the WGL_ARB_render_texture extension. + * + *

This extension allows a color buffer to be used for both rendering and texturing. When a color buffer is bound to a texture target it cannot be + * rendered to. Once it has been released from the texture it can be rendered to once again.

+ * + *

This extension may provide a performance boost and reduce memory requirements on architectures that support rendering to the same memory where textures + * reside and in the same memory format and layout required by texturing. The functionality is similar to CopyTexImage1D and CopyTexImage2D. However, some + * changes were made to make it easier to avoid copying data:

+ * + *
    + *
  • Only color buffers of a pbuffer can be bound as a texture. It is not possible to use the color buffer of a window as a texture.
  • + *
  • The texture internal format is determined when the color buffer is associated with the texture, guaranteeing that the color buffer format is + * equivalent to the texture internal format.
  • + *
  • When a color buffer of a pbuffer is being used as a texture, the pbuffer can not be used for rendering; this makes it easier for implementations to + * avoid a copy of the image since the semantics of the pointer swap are clear.
  • + *
  • The application must release the color buffer from the texture before it can render to the pbuffer again. When the color buffer is bound as a + * texture, draw and read operations on the pbuffer are undefined.
  • + *
  • A mipmap attribute can be set, in which case memory will be allocated up front for mipmaps. The application can render the mipmap images or, if + * SGIS_generate_mipmap is supported, they can be automatically generated when the color buffer is bound as a texture.
  • + *
  • A texture target is associated with the pbuffer, so that cubemap images can be rendered into a single color buffer.
  • + *
+ * + *

Requires {@link WGLARBExtensionsString WGL_ARB_extensions_string}, {@link WGLARBPixelFormat WGL_ARB_pixel_format}, {@link WGLARBPbuffer WGL_ARB_pbuffer}.

+ */ +public class WGLARBRenderTexture { + + /** + * Accepted by the {@code attributes} parameter of {@link WGLARBPixelFormat#wglGetPixelFormatAttribivARB GetPixelFormatAttribivARB}, and the {@code attribIList} parameters of + * {@link WGLARBPixelFormat#wglChoosePixelFormatARB ChoosePixelFormatARB}. + */ + public static final int + WGL_BIND_TO_TEXTURE_RGB_ARB = 0x2070, + WGL_BIND_TO_TEXTURE_RGBA_ARB = 0x2071; + + /** Accepted by the {@code attribList} parameter of {@link WGLARBPbuffer#wglCreatePbufferARB CreatePbufferARB} and by the {@code attribute} parameter of {@link WGLARBPbuffer#wglQueryPbufferARB QueryPbufferARB}. */ + public static final int + WGL_TEXTURE_FORMAT_ARB = 0x2072, + WGL_TEXTURE_TARGET_ARB = 0x2073, + WGL_MIPMAP_TEXTURE_ARB = 0x2074; + + /** + * Accepted as a value in the {@code attribList} parameter of {@link WGLARBPbuffer#wglCreatePbufferARB CreatePbufferARB} and returned in the value parameter of {@link WGLARBPbuffer#wglQueryPbufferARB QueryPbufferARB} when + * {@code attribute} is {@link #WGL_TEXTURE_FORMAT_ARB TEXTURE_FORMAT_ARB}. + */ + public static final int + WGL_TEXTURE_RGB_ARB = 0x2075, + WGL_TEXTURE_RGBA_ARB = 0x2076, + WGL_NO_TEXTURE_ARB = 0x2077; + + /** + * Accepted as a value in the {@code attribList} parameter of {@link WGLARBPbuffer#wglCreatePbufferARB CreatePbufferARB} and returned in the value parameter of {@link WGLARBPbuffer#wglQueryPbufferARB QueryPbufferARB} when + * {@code attribute} is {@link #WGL_TEXTURE_TARGET_ARB TEXTURE_TARGET_ARB}. + */ + public static final int + WGL_TEXTURE_CUBE_MAP_ARB = 0x2078, + WGL_TEXTURE_1D_ARB = 0x2079, + WGL_TEXTURE_2D_ARB = 0x207A; + + /** Accepted by the {@code attribList} parameter of {@link #wglSetPbufferAttribARB SetPbufferAttribARB} and by the {@code attribute} parameter of {@link WGLARBPbuffer#wglQueryPbufferARB QueryPbufferARB}. */ + public static final int + WGL_MIPMAP_LEVEL_ARB = 0x207B, + WGL_CUBE_MAP_FACE_ARB = 0x207C; + + /** + * Accepted as a value in the {@code attribList} parameter of {@link #wglSetPbufferAttribARB SetPbufferAttribARB} and returned in the value parameter of {@link WGLARBPbuffer#wglQueryPbufferARB QueryPbufferARB} when + * {@code attribute} is {@link #WGL_CUBE_MAP_FACE_ARB CUBE_MAP_FACE_ARB}. + */ + public static final int + WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB = 0x207D, + WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB = 0x207E, + WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB = 0x207F, + WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB = 0x2080, + WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB = 0x2081, + WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB = 0x2082; + + /** Accepted by the {@code buffer} parameter of {@link #wglBindTexImageARB BindTexImageARB} and {@link #wglReleaseTexImageARB ReleaseTexImageARB}. */ + public static final int + WGL_FRONT_LEFT_ARB = 0x2083, + WGL_FRONT_RIGHT_ARB = 0x2084, + WGL_BACK_LEFT_ARB = 0x2085, + WGL_BACK_RIGHT_ARB = 0x2086, + WGL_AUX0_ARB = 0x2087, + WGL_AUX1_ARB = 0x2088, + WGL_AUX2_ARB = 0x2089, + WGL_AUX3_ARB = 0x208A, + WGL_AUX4_ARB = 0x208B, + WGL_AUX5_ARB = 0x208C, + WGL_AUX6_ARB = 0x208D, + WGL_AUX7_ARB = 0x208E, + WGL_AUX8_ARB = 0x208F, + WGL_AUX9_ARB = 0x2090; + + protected WGLARBRenderTexture() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(WGLCapabilities caps) { + return checkFunctions( + caps.wglBindTexImageARB, caps.wglReleaseTexImageARB, caps.wglSetPbufferAttribARB + ); + } + + // --- [ wglBindTexImageARB ] --- + + /** + * Defines a one-dimensional texture image or two-dimensional texture image or a set of two-dimensional cube map texture images. The texture image or + * images consist of the image data in {@code buffer} for the specified {@code pbuffer} and need not be copied. The texture target, the texture format and + * the size of the texture components are derived from attributes of pbuffer specified by {@code pbuffer}. + * + * @param pbuffer a pbuffer handle + * @param buffer the target buffer. One of:
{@link #WGL_FRONT_LEFT_ARB FRONT_LEFT_ARB}{@link #WGL_FRONT_RIGHT_ARB FRONT_RIGHT_ARB}{@link #WGL_BACK_LEFT_ARB BACK_LEFT_ARB}{@link #WGL_BACK_RIGHT_ARB BACK_RIGHT_ARB}{@link #WGL_AUX0_ARB AUX0_ARB}WGL_AUX[1-9]_ARB
+ */ + @NativeType("BOOL") + public static boolean wglBindTexImageARB(@NativeType("HPBUFFERARB") long pbuffer, int buffer) { + long __functionAddress = GL.getCapabilitiesWGL().wglBindTexImageARB; + if (CHECKS) { + check(__functionAddress); + check(pbuffer); + } + return callPI(pbuffer, buffer, __functionAddress) != 0; + } + + // --- [ wglReleaseTexImageARB ] --- + + /** + * Releases the specified color buffer back to the pbuffer. The pbuffer is made available for reading and writing when it no longer has any color buffers + * bound as textures. + * + * @param pbuffer a pbuffer handle + * @param buffer the target buffer. One of:
{@link #WGL_FRONT_LEFT_ARB FRONT_LEFT_ARB}{@link #WGL_FRONT_RIGHT_ARB FRONT_RIGHT_ARB}{@link #WGL_BACK_LEFT_ARB BACK_LEFT_ARB}{@link #WGL_BACK_RIGHT_ARB BACK_RIGHT_ARB}{@link #WGL_AUX0_ARB AUX0_ARB}WGL_AUX[1-9]_ARB
+ */ + @NativeType("BOOL") + public static boolean wglReleaseTexImageARB(@NativeType("HPBUFFERARB") long pbuffer, int buffer) { + long __functionAddress = GL.getCapabilitiesWGL().wglReleaseTexImageARB; + if (CHECKS) { + check(__functionAddress); + check(pbuffer); + } + return callPI(pbuffer, buffer, __functionAddress) != 0; + } + + // --- [ wglSetPbufferAttribARB ] --- + + /** Unsafe version of: {@link #wglSetPbufferAttribARB SetPbufferAttribARB} */ + public static int nwglSetPbufferAttribARB(long pbuffer, long attribList) { + long __functionAddress = GL.getCapabilitiesWGL().wglSetPbufferAttribARB; + if (CHECKS) { + check(__functionAddress); + check(pbuffer); + } + return callPPI(pbuffer, attribList, __functionAddress); + } + + /** + * Sets an attribute to the specified pbuffer. + * + * @param pbuffer a pbuffer handle + * @param attribList a 0-terminated list of attribute {type, value} pairs containing integer values + */ + @NativeType("BOOL") + public static boolean wglSetPbufferAttribARB(@NativeType("HPBUFFERARB") long pbuffer, @Nullable @NativeType("int const *") IntBuffer attribList) { + if (CHECKS) { + checkNTSafe(attribList); + } + return nwglSetPbufferAttribARB(pbuffer, memAddressSafe(attribList)) != 0; + } + + /** Array version of: {@link #wglSetPbufferAttribARB SetPbufferAttribARB} */ + @NativeType("BOOL") + public static boolean wglSetPbufferAttribARB(@NativeType("HPBUFFERARB") long pbuffer, @Nullable @NativeType("int const *") int[] attribList) { + long __functionAddress = GL.getCapabilitiesWGL().wglSetPbufferAttribARB; + if (CHECKS) { + check(__functionAddress); + check(pbuffer); + checkNTSafe(attribList); + } + return callPPI(pbuffer, attribList, __functionAddress) != 0; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBRobustnessApplicationIsolation.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBRobustnessApplicationIsolation.java new file mode 100644 index 00000000..caf1894e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLARBRobustnessApplicationIsolation.java @@ -0,0 +1,34 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the WGL_ARB_robustness_application_isolation extension. + * + *

GL_ARB_robustness and WGL_ARB_create_context_robustness allow creating an OpenGL context supporting graphics reset notification behavior. + * WGL_ARB_robustness_application_isolation provides stronger guarantees about the possible side-effects of a graphics reset.

+ * + *

If the graphics driver advertises the WGL_ARB_robustness_application_isolation extension string, then the driver guarantees that if a particular + * application causes a graphics reset to occur:

+ * + *
    + *
  1. No other application on the system is affected by the graphics reset.
  2. + *
  3. No other application on the system receives any notification that the graphics reset occurred.
  4. + *
+ * + *

Requires {@link WGLARBExtensionsString WGL_ARB_extensions_string} and {@link WGLARBCreateContextRobustness WGL_ARB_create_context_robustness}.

+ */ +public final class WGLARBRobustnessApplicationIsolation { + + /** + * Accepted as a bit in the attribute value for {@link WGLARBCreateContext#WGL_CONTEXT_FLAGS_ARB CONTEXT_FLAGS_ARB} in the {@code attribList} argument to + * {@link WGLARBCreateContext#wglCreateContextAttribsARB CreateContextAttribsARB}. + */ + public static final int WGL_CONTEXT_RESET_ISOLATION_BIT_ARB = 0x8; + + private WGLARBRobustnessApplicationIsolation() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLATIPixelFormatFloat.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLATIPixelFormatFloat.java new file mode 100644 index 00000000..15e57538 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLATIPixelFormatFloat.java @@ -0,0 +1,37 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the WGL_ATI_pixel_format_float extension. + * + *

This extension adds pixel formats with floating-point RGBA color components.

+ * + *

The size of each float components is specified using the same WGL_RED_BITS_ARB, WGL_GREEN_BITS_ARB, WGL_BLUE_BITS_ARB and WGL_ALPHA_BITS_ARB pixel + * format attributes that are used for defining the size of fixed-point components. 32 bit floating- point components are in the standard IEEE float + * format. 16 bit floating-point components have 1 sign bit, 5 exponent bits, and 10 mantissa bits.

+ * + *

In standard OpenGL RGBA color components are normally clamped to the range [0,1]. The color components of a float buffer are clamped to the limits of + * the range representable by their format.

+ * + *

Requires {@link WGLARBPixelFormat WGL_ARB_pixel_format}.

+ */ +public final class WGLATIPixelFormatFloat { + + /** Accepted by the {@code pname} parameters of GetBooleanv, GetIntegerv, GetFloatv, and GetDoublev. */ + public static final int + WGL_RGBA_FLOAT_MODE_ATI = 0x8820, + WGL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI = 0x8835; + + /** + * Accepted as a value in the {@code piAttribIList} and {@code pfAttribFList} parameter arrays of wglChoosePixelFormatARB, and returned in the + * {@code piValues} parameter array of wglGetPixelFormatAttribivARB, and the {@code pfValues} parameter array of wglGetPixelFormatAttribfvARB. + */ + public static final int WGL_TYPE_RGBA_FLOAT_ATI = 0x21A0; + + private WGLATIPixelFormatFloat() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLATIRenderTextureRectangle.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLATIRenderTextureRectangle.java new file mode 100644 index 00000000..920a80f8 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLATIRenderTextureRectangle.java @@ -0,0 +1,25 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the WGL_ATI_render_texture_rectangle extension. + * + *

This extension builds upon {@link WGLARBRenderTexture WGL_ARB_render_texture} and allows a pbuffer to be bound to a texture rectangle target.

+ * + *

Requires {@link WGLARBRenderTexture WGL_ARB_render_texture} and {@link ARBTextureRectangle ARB_texture_rectangle}.

+ */ +public final class WGLATIRenderTextureRectangle { + + /** + * Accepted as a value in the {@code piAttribList} parameter of wglCreatePbufferARB and returned in the value parameter of wglQueryPbufferARB when + * {@code iAttribute} is WGL_TEXTURE_TARGET_ARB. + */ + public static final int WGL_TEXTURE_RECTANGLE_ATI = 0x21A5; + + private WGLATIRenderTextureRectangle() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLCapabilities.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLCapabilities.java new file mode 100644 index 00000000..34c92fe0 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLCapabilities.java @@ -0,0 +1,289 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; +import java.util.Set; + +import static org.lwjgl.system.APIUtil.*; + +/** Defines the WGL capabilities of an OpenGL device. */ +public final class WGLCapabilities { + + public final long + wglGetGPUIDsAMD, + wglGetGPUInfoAMD, + wglGetContextGPUIDAMD, + wglCreateAssociatedContextAMD, + wglCreateAssociatedContextAttribsAMD, + wglDeleteAssociatedContextAMD, + wglMakeAssociatedContextCurrentAMD, + wglGetCurrentAssociatedContextAMD, + wglBlitContextFramebufferAMD, + wglCreateBufferRegionARB, + wglDeleteBufferRegionARB, + wglSaveBufferRegionARB, + wglRestoreBufferRegionARB, + wglCreateContextAttribsARB, + wglGetExtensionsStringARB, + wglMakeContextCurrentARB, + wglGetCurrentReadDCARB, + wglCreatePbufferARB, + wglGetPbufferDCARB, + wglReleasePbufferDCARB, + wglDestroyPbufferARB, + wglQueryPbufferARB, + wglGetPixelFormatAttribivARB, + wglGetPixelFormatAttribfvARB, + wglChoosePixelFormatARB, + wglBindTexImageARB, + wglReleaseTexImageARB, + wglSetPbufferAttribARB, + wglGetExtensionsStringEXT, + wglSwapIntervalEXT, + wglGetSwapIntervalEXT, + wglCopyImageSubDataNV, + wglDelayBeforeSwapNV, + wglDXSetResourceShareHandleNV, + wglDXOpenDeviceNV, + wglDXCloseDeviceNV, + wglDXRegisterObjectNV, + wglDXUnregisterObjectNV, + wglDXObjectAccessNV, + wglDXLockObjectsNV, + wglDXUnlockObjectsNV, + wglEnumGpusNV, + wglEnumGpuDevicesNV, + wglCreateAffinityDCNV, + wglEnumGpusFromAffinityDCNV, + wglDeleteDCNV, + wglJoinSwapGroupNV, + wglBindSwapBarrierNV, + wglQuerySwapGroupNV, + wglQueryMaxSwapGroupsNV, + wglQueryFrameCountNV, + wglResetFrameCountNV, + wglAllocateMemoryNV, + wglFreeMemoryNV; + + /** When true, {@link WGLAMDGPUAssociation} is supported. */ + public final boolean WGL_AMD_gpu_association; + /** When true, {@link WGLARBBufferRegion} is supported. */ + public final boolean WGL_ARB_buffer_region; + /** When true, {@link WGLARBContextFlushControl} is supported. */ + public final boolean WGL_ARB_context_flush_control; + /** When true, {@link WGLARBCreateContext} is supported. */ + public final boolean WGL_ARB_create_context; + /** When true, {@link WGLARBCreateContextNoError} is supported. */ + public final boolean WGL_ARB_create_context_no_error; + /** When true, {@link WGLARBCreateContextProfile} is supported. */ + public final boolean WGL_ARB_create_context_profile; + /** When true, {@link WGLARBCreateContextRobustness} is supported. */ + public final boolean WGL_ARB_create_context_robustness; + /** When true, {@link WGLARBExtensionsString} is supported. */ + public final boolean WGL_ARB_extensions_string; + /** When true, {@link WGLARBFramebufferSRGB} is supported. */ + public final boolean WGL_ARB_framebuffer_sRGB; + /** When true, {@link WGLARBMakeCurrentRead} is supported. */ + public final boolean WGL_ARB_make_current_read; + /** When true, {@link WGLARBMultisample} is supported. */ + public final boolean WGL_ARB_multisample; + /** When true, {@link WGLARBPbuffer} is supported. */ + public final boolean WGL_ARB_pbuffer; + /** When true, {@link WGLARBPixelFormat} is supported. */ + public final boolean WGL_ARB_pixel_format; + /** When true, {@link WGLARBPixelFormatFloat} is supported. */ + public final boolean WGL_ARB_pixel_format_float; + /** When true, {@link WGLARBRenderTexture} is supported. */ + public final boolean WGL_ARB_render_texture; + /** When true, {@link WGLARBRobustnessApplicationIsolation} is supported. */ + public final boolean WGL_ARB_robustness_application_isolation; + /** + * Native bindings to the WGL_ARB_robustness_share_group_isolation extension. + * + *

GL_ARB_robustness and WGL_ARB_create_context_robustness allow creating an OpenGL context supporting graphics reset notification behavior. + * WGL_ARB_robustness_share_group_isolation provides stronger guarantees about the possible side-effects of a graphics reset.

+ * + *

If the graphics driver advertises the WGL_ARB_robustness_share_group_isolation extension string, then the driver guarantees that if a context in a + * particular share group causes a graphics reset to occur:

+ * + *
    + *
  1. No other share group within the application is affected by the graphics reset. Additionally, no other application on the system is affected by the + * graphics reset.
  2. + *
  3. No other share group within the application receives any notification that the graphics reset occurred. Additionally, no other application on the + * system receives any notification that the graphics reset occurred.
  4. + *
+ * + *

Requires {@link WGLARBExtensionsString WGL_ARB_extensions_string} and {@link WGLARBCreateContextRobustness WGL_ARB_create_context_robustness}.

+ */ + public final boolean WGL_ARB_robustness_share_group_isolation; + /** When true, {@link WGLATIPixelFormatFloat} is supported. */ + public final boolean WGL_ATI_pixel_format_float; + /** When true, {@link WGLATIRenderTextureRectangle} is supported. */ + public final boolean WGL_ATI_render_texture_rectangle; + /** When true, {@link WGLEXTColorspace} is supported. */ + public final boolean WGL_EXT_colorspace; + /** When true, {@link WGLEXTCreateContextES2Profile} is supported. */ + public final boolean WGL_EXT_create_context_es2_profile; + /** When true, {@link WGLEXTCreateContextESProfile} is supported. */ + public final boolean WGL_EXT_create_context_es_profile; + /** When true, {@link WGLEXTDepthFloat} is supported. */ + public final boolean WGL_EXT_depth_float; + /** When true, {@link WGLEXTExtensionsString} is supported. */ + public final boolean WGL_EXT_extensions_string; + /** When true, {@link WGLEXTFramebufferSRGB} is supported. */ + public final boolean WGL_EXT_framebuffer_sRGB; + /** When true, {@link WGLEXTPixelFormatPackedFloat} is supported. */ + public final boolean WGL_EXT_pixel_format_packed_float; + /** When true, {@link WGLEXTSwapControl} is supported. */ + public final boolean WGL_EXT_swap_control; + /** + * When true, the WGL_EXT_swap_control_tear extension is supported. + * + *

This extension extends the existing {@link WGLEXTSwapControl WGL_EXT_swap_control} extension by allowing a negative {@code interval} parameter to + * {@link WGLEXTSwapControl#wglSwapIntervalEXT SwapIntervalEXT}. The negative {@code interval} allows late swaps to occur without synchronization to the video frame. This + * reduces the visual stutter on late frames and reduces the stall on subsequent frames.

+ */ + public final boolean WGL_EXT_swap_control_tear; + /** When true, {@link WGLNVCopyImage} is supported. */ + public final boolean WGL_NV_copy_image; + /** When true, {@link WGLNVDelayBeforeSwap} is supported. */ + public final boolean WGL_NV_delay_before_swap; + /** When true, {@link WGLNVDXInterop} is supported. */ + public final boolean WGL_NV_DX_interop; + /** + * When true, the WGL_NV_DX_interop2 extension is supported. + * + *

This extension expands on the specification of {@link WGLNVDXInterop WGL_NV_DX_interop} to add support for DirectX version 10, 10.1 and 11 resources.

+ * + *

Requires {@link GL20 OpenGL 2.0} and {@link WGLNVDXInterop WGL_NV_DX_interop}.

+ */ + public final boolean WGL_NV_DX_interop2; + /** When true, {@link WGLNVFloatBuffer} is supported. */ + public final boolean WGL_NV_float_buffer; + /** When true, {@link WGLNVGPUAffinity} is supported. */ + public final boolean WGL_NV_gpu_affinity; + /** When true, {@link WGLNVMultigpuContext} is supported. */ + public final boolean WGL_NV_multigpu_context; + /** When true, {@link WGLNVMultisampleCoverage} is supported. */ + public final boolean WGL_NV_multisample_coverage; + /** When true, {@link WGLNVRenderDepthTexture} is supported. */ + public final boolean WGL_NV_render_depth_texture; + /** When true, {@link WGLNVRenderTextureRectangle} is supported. */ + public final boolean WGL_NV_render_texture_rectangle; + /** When true, {@link WGLNVSwapGroup} is supported. */ + public final boolean WGL_NV_swap_group; + /** When true, {@code WGL_NV_vertex_array_range} is supported. */ + public final boolean WGL_NV_vertex_array_range; + + WGLCapabilities(FunctionProvider provider, Set ext) { + wglGetGPUIDsAMD = provider.getFunctionAddress("wglGetGPUIDsAMD"); + wglGetGPUInfoAMD = provider.getFunctionAddress("wglGetGPUInfoAMD"); + wglGetContextGPUIDAMD = provider.getFunctionAddress("wglGetContextGPUIDAMD"); + wglCreateAssociatedContextAMD = provider.getFunctionAddress("wglCreateAssociatedContextAMD"); + wglCreateAssociatedContextAttribsAMD = provider.getFunctionAddress("wglCreateAssociatedContextAttribsAMD"); + wglDeleteAssociatedContextAMD = provider.getFunctionAddress("wglDeleteAssociatedContextAMD"); + wglMakeAssociatedContextCurrentAMD = provider.getFunctionAddress("wglMakeAssociatedContextCurrentAMD"); + wglGetCurrentAssociatedContextAMD = provider.getFunctionAddress("wglGetCurrentAssociatedContextAMD"); + wglBlitContextFramebufferAMD = provider.getFunctionAddress("wglBlitContextFramebufferAMD"); + wglCreateBufferRegionARB = provider.getFunctionAddress("wglCreateBufferRegionARB"); + wglDeleteBufferRegionARB = provider.getFunctionAddress("wglDeleteBufferRegionARB"); + wglSaveBufferRegionARB = provider.getFunctionAddress("wglSaveBufferRegionARB"); + wglRestoreBufferRegionARB = provider.getFunctionAddress("wglRestoreBufferRegionARB"); + wglCreateContextAttribsARB = provider.getFunctionAddress("wglCreateContextAttribsARB"); + wglGetExtensionsStringARB = provider.getFunctionAddress("wglGetExtensionsStringARB"); + wglMakeContextCurrentARB = provider.getFunctionAddress("wglMakeContextCurrentARB"); + wglGetCurrentReadDCARB = provider.getFunctionAddress("wglGetCurrentReadDCARB"); + wglCreatePbufferARB = provider.getFunctionAddress("wglCreatePbufferARB"); + wglGetPbufferDCARB = provider.getFunctionAddress("wglGetPbufferDCARB"); + wglReleasePbufferDCARB = provider.getFunctionAddress("wglReleasePbufferDCARB"); + wglDestroyPbufferARB = provider.getFunctionAddress("wglDestroyPbufferARB"); + wglQueryPbufferARB = provider.getFunctionAddress("wglQueryPbufferARB"); + wglGetPixelFormatAttribivARB = provider.getFunctionAddress("wglGetPixelFormatAttribivARB"); + wglGetPixelFormatAttribfvARB = provider.getFunctionAddress("wglGetPixelFormatAttribfvARB"); + wglChoosePixelFormatARB = provider.getFunctionAddress("wglChoosePixelFormatARB"); + wglBindTexImageARB = provider.getFunctionAddress("wglBindTexImageARB"); + wglReleaseTexImageARB = provider.getFunctionAddress("wglReleaseTexImageARB"); + wglSetPbufferAttribARB = provider.getFunctionAddress("wglSetPbufferAttribARB"); + wglGetExtensionsStringEXT = provider.getFunctionAddress("wglGetExtensionsStringEXT"); + wglSwapIntervalEXT = provider.getFunctionAddress("wglSwapIntervalEXT"); + wglGetSwapIntervalEXT = provider.getFunctionAddress("wglGetSwapIntervalEXT"); + wglCopyImageSubDataNV = provider.getFunctionAddress("wglCopyImageSubDataNV"); + wglDelayBeforeSwapNV = provider.getFunctionAddress("wglDelayBeforeSwapNV"); + wglDXSetResourceShareHandleNV = provider.getFunctionAddress("wglDXSetResourceShareHandleNV"); + wglDXOpenDeviceNV = provider.getFunctionAddress("wglDXOpenDeviceNV"); + wglDXCloseDeviceNV = provider.getFunctionAddress("wglDXCloseDeviceNV"); + wglDXRegisterObjectNV = provider.getFunctionAddress("wglDXRegisterObjectNV"); + wglDXUnregisterObjectNV = provider.getFunctionAddress("wglDXUnregisterObjectNV"); + wglDXObjectAccessNV = provider.getFunctionAddress("wglDXObjectAccessNV"); + wglDXLockObjectsNV = provider.getFunctionAddress("wglDXLockObjectsNV"); + wglDXUnlockObjectsNV = provider.getFunctionAddress("wglDXUnlockObjectsNV"); + wglEnumGpusNV = provider.getFunctionAddress("wglEnumGpusNV"); + wglEnumGpuDevicesNV = provider.getFunctionAddress("wglEnumGpuDevicesNV"); + wglCreateAffinityDCNV = provider.getFunctionAddress("wglCreateAffinityDCNV"); + wglEnumGpusFromAffinityDCNV = provider.getFunctionAddress("wglEnumGpusFromAffinityDCNV"); + wglDeleteDCNV = provider.getFunctionAddress("wglDeleteDCNV"); + wglJoinSwapGroupNV = provider.getFunctionAddress("wglJoinSwapGroupNV"); + wglBindSwapBarrierNV = provider.getFunctionAddress("wglBindSwapBarrierNV"); + wglQuerySwapGroupNV = provider.getFunctionAddress("wglQuerySwapGroupNV"); + wglQueryMaxSwapGroupsNV = provider.getFunctionAddress("wglQueryMaxSwapGroupsNV"); + wglQueryFrameCountNV = provider.getFunctionAddress("wglQueryFrameCountNV"); + wglResetFrameCountNV = provider.getFunctionAddress("wglResetFrameCountNV"); + wglAllocateMemoryNV = provider.getFunctionAddress("wglAllocateMemoryNV"); + wglFreeMemoryNV = provider.getFunctionAddress("wglFreeMemoryNV"); + + WGL_AMD_gpu_association = ext.contains("WGL_AMD_gpu_association") && checkExtension("WGL_AMD_gpu_association", WGLAMDGPUAssociation.isAvailable(this)); + WGL_ARB_buffer_region = ext.contains("WGL_ARB_buffer_region") && checkExtension("WGL_ARB_buffer_region", WGLARBBufferRegion.isAvailable(this)); + WGL_ARB_context_flush_control = ext.contains("WGL_ARB_context_flush_control"); + WGL_ARB_create_context = ext.contains("WGL_ARB_create_context") && checkExtension("WGL_ARB_create_context", WGLARBCreateContext.isAvailable(this)); + WGL_ARB_create_context_no_error = ext.contains("WGL_ARB_create_context_no_error"); + WGL_ARB_create_context_profile = ext.contains("WGL_ARB_create_context_profile"); + WGL_ARB_create_context_robustness = ext.contains("WGL_ARB_create_context_robustness"); + WGL_ARB_extensions_string = ext.contains("WGL_ARB_extensions_string") && checkExtension("WGL_ARB_extensions_string", WGLARBExtensionsString.isAvailable(this)); + WGL_ARB_framebuffer_sRGB = ext.contains("WGL_ARB_framebuffer_sRGB"); + WGL_ARB_make_current_read = ext.contains("WGL_ARB_make_current_read") && checkExtension("WGL_ARB_make_current_read", WGLARBMakeCurrentRead.isAvailable(this)); + WGL_ARB_multisample = ext.contains("WGL_ARB_multisample"); + WGL_ARB_pbuffer = ext.contains("WGL_ARB_pbuffer") && checkExtension("WGL_ARB_pbuffer", WGLARBPbuffer.isAvailable(this)); + WGL_ARB_pixel_format = ext.contains("WGL_ARB_pixel_format") && checkExtension("WGL_ARB_pixel_format", WGLARBPixelFormat.isAvailable(this)); + WGL_ARB_pixel_format_float = ext.contains("WGL_ARB_pixel_format_float"); + WGL_ARB_render_texture = ext.contains("WGL_ARB_render_texture") && checkExtension("WGL_ARB_render_texture", WGLARBRenderTexture.isAvailable(this)); + WGL_ARB_robustness_application_isolation = ext.contains("WGL_ARB_robustness_application_isolation"); + WGL_ARB_robustness_share_group_isolation = ext.contains("WGL_ARB_robustness_share_group_isolation"); + WGL_ATI_pixel_format_float = ext.contains("WGL_ATI_pixel_format_float"); + WGL_ATI_render_texture_rectangle = ext.contains("WGL_ATI_render_texture_rectangle"); + WGL_EXT_colorspace = ext.contains("WGL_EXT_colorspace"); + WGL_EXT_create_context_es2_profile = ext.contains("WGL_EXT_create_context_es2_profile"); + WGL_EXT_create_context_es_profile = ext.contains("WGL_EXT_create_context_es_profile"); + WGL_EXT_depth_float = ext.contains("WGL_EXT_depth_float"); + WGL_EXT_extensions_string = ext.contains("WGL_EXT_extensions_string") && checkExtension("WGL_EXT_extensions_string", WGLEXTExtensionsString.isAvailable(this)); + WGL_EXT_framebuffer_sRGB = ext.contains("WGL_EXT_framebuffer_sRGB"); + WGL_EXT_pixel_format_packed_float = ext.contains("WGL_EXT_pixel_format_packed_float"); + WGL_EXT_swap_control = ext.contains("WGL_EXT_swap_control") && checkExtension("WGL_EXT_swap_control", WGLEXTSwapControl.isAvailable(this)); + WGL_EXT_swap_control_tear = ext.contains("WGL_EXT_swap_control_tear"); + WGL_NV_copy_image = ext.contains("WGL_NV_copy_image") && checkExtension("WGL_NV_copy_image", WGLNVCopyImage.isAvailable(this)); + WGL_NV_delay_before_swap = ext.contains("WGL_NV_delay_before_swap") && checkExtension("WGL_NV_delay_before_swap", WGLNVDelayBeforeSwap.isAvailable(this)); + WGL_NV_DX_interop = ext.contains("WGL_NV_DX_interop") && checkExtension("WGL_NV_DX_interop", WGLNVDXInterop.isAvailable(this)); + WGL_NV_DX_interop2 = ext.contains("WGL_NV_DX_interop2"); + WGL_NV_float_buffer = ext.contains("WGL_NV_float_buffer"); + WGL_NV_gpu_affinity = ext.contains("WGL_NV_gpu_affinity") && checkExtension("WGL_NV_gpu_affinity", WGLNVGPUAffinity.isAvailable(this)); + WGL_NV_multigpu_context = ext.contains("WGL_NV_multigpu_context"); + WGL_NV_multisample_coverage = ext.contains("WGL_NV_multisample_coverage"); + WGL_NV_render_depth_texture = ext.contains("WGL_NV_render_depth_texture"); + WGL_NV_render_texture_rectangle = ext.contains("WGL_NV_render_texture_rectangle"); + WGL_NV_swap_group = ext.contains("WGL_NV_swap_group") && checkExtension("WGL_NV_swap_group", WGLNVSwapGroup.isAvailable(this)); + WGL_NV_vertex_array_range = ext.contains("WGL_NV_vertex_array_range") && checkExtension("WGL_NV_vertex_array_range", WGLNVVertexArrayRange.isAvailable(this)); + } + + private static boolean checkExtension(String extension, boolean supported) { + if (supported) { + return true; + } + + apiLog("[WGL] " + extension + " was reported as available but an entry point is missing."); + return false; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTColorspace.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTColorspace.java new file mode 100644 index 00000000..36ce252f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTColorspace.java @@ -0,0 +1,28 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the WGL_EXT_colorspace extension. + * + *

Applications may wish to use sRGB format default framebuffers to more easily achieve sRGB rendering to display devices. This extension allows creating + * pixel formats which will be rendered to in sRGB by OpenGL/ES contexts supporting that capability.

+ * + *

Requires {@link GL30 OpenGL 3.0}.

+ */ +public final class WGLEXTColorspace { + + /** Accepted as an attribute name by {@link WGLARBPixelFormat#wglGetPixelFormatAttribivARB GetPixelFormatAttribivARB}, {@link WGLARBPixelFormat#wglGetPixelFormatAttribivARB GetPixelFormatAttribivARB} and {@link WGLARBPixelFormat#wglChoosePixelFormatARB ChoosePixelFormatARB}. */ + public static final int WGL_COLORSPACE_EXT = 0x309D; + + /** Accepted as attribute values for {@link #WGL_COLORSPACE_EXT COLORSPACE_EXT} by {@link WGLARBPixelFormat#wglGetPixelFormatAttribivARB GetPixelFormatAttribivARB}, {@link WGLARBPixelFormat#wglGetPixelFormatAttribivARB GetPixelFormatAttribivARB} and {@link WGLARBPixelFormat#wglChoosePixelFormatARB ChoosePixelFormatARB}. */ + public static final int + WGL_COLORSPACE_SRGB_EXT = 0x3089, + WGL_COLORSPACE_LINEAR_EXT = 0x308A; + + private WGLEXTColorspace() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTCreateContextES2Profile.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTCreateContextES2Profile.java new file mode 100644 index 00000000..fc92dbb9 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTCreateContextES2Profile.java @@ -0,0 +1,22 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the WGL_EXT_create_context_es2_profile extension. + * + *

This extension allows creating an OpenGL ES context.

+ * + *

Requires {@link WGLARBExtensionsString WGL_ARB_extensions_string}, {@link WGLARBCreateContext WGL_ARB_create_context}, {@link WGLARBCreateContextProfile WGL_ARB_create_context_profile} and an OpenGL ES implementation.

+ */ +public final class WGLEXTCreateContextES2Profile { + + /** Accepted as a bit in the attribute value for {@link WGLARBCreateContextProfile#WGL_CONTEXT_PROFILE_MASK_ARB CONTEXT_PROFILE_MASK_ARB} in {@code attribList}. */ + public static final int WGL_CONTEXT_ES2_PROFILE_BIT_EXT = 0x4; + + private WGLEXTCreateContextES2Profile() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTCreateContextESProfile.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTCreateContextESProfile.java new file mode 100644 index 00000000..6a83f009 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTCreateContextESProfile.java @@ -0,0 +1,22 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the WGL_EXT_create_context_es_profile extension. + * + *

This extension allows creating an OpenGL ES context.

+ * + *

Requires {@link WGLARBExtensionsString WGL_ARB_extensions_string}, {@link WGLARBCreateContext WGL_ARB_create_context}, {@link WGLARBCreateContextProfile WGL_ARB_create_context_profile} and an OpenGL ES implementation.

+ */ +public final class WGLEXTCreateContextESProfile { + + /** Accepted as a bit in the attribute value for {@link WGLARBCreateContextProfile#WGL_CONTEXT_PROFILE_MASK_ARB CONTEXT_PROFILE_MASK_ARB} in {@code attribList}. */ + public static final int WGL_CONTEXT_ES_PROFILE_BIT_EXT = 0x4; + + private WGLEXTCreateContextESProfile() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTDepthFloat.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTDepthFloat.java new file mode 100644 index 00000000..1768de77 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTDepthFloat.java @@ -0,0 +1,27 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the WGL_EXT_depth_float extension. + * + *

For perspective scenes, the density of objects (vertices) increases as the distance from the eye increases. For a linear depth buffer, this means that + * objects (vertices) are sparse for a large portion of the depth range and are dense for a small portion of the depth buffer.

+ * + *

This behavior is obvious if you consider standing in a boat looking at the shore. The near objects include only the boat while the far objects include + * the entire shoreline which may include an entire city.

+ * + *

A non-linear (floating-point) depth buffer helps this problem. If the near clipping plane is set to 1.0, and the far clipping plane is set to 0.0, a + * much greater resolution of objects can occur.

+ */ +public final class WGLEXTDepthFloat { + + /** Accepted by the {@code attribute} parameter of wglGetPixelFormatAttribivEXT, wglGetPixelFormatAttribfvEXT, and wglChoosePixelFormatExEXT. */ + public static final int WGL_DEPTH_FLOAT_EXT = 0x2040; + + private WGLEXTDepthFloat() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTExtensionsString.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTExtensionsString.java new file mode 100644 index 00000000..5b58d464 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTExtensionsString.java @@ -0,0 +1,52 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to the WGL_EXT_extensions_string extension. */ +public class WGLEXTExtensionsString { + + protected WGLEXTExtensionsString() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(WGLCapabilities caps) { + return checkFunctions( + caps.wglGetExtensionsStringEXT + ); + } + + // --- [ wglGetExtensionsStringEXT ] --- + + /** Unsafe version of: {@link #wglGetExtensionsStringEXT GetExtensionsStringEXT} */ + public static long nwglGetExtensionsStringEXT() { + long __functionAddress = GL.getCapabilitiesWGL().wglGetExtensionsStringEXT; + if (CHECKS) { + check(__functionAddress); + } + return callP(__functionAddress); + } + + /** + * Returns a list of supported extensions to WGL. Although the contents of the string is implementation specific, the string will be {@code NULL} terminated and + * will contain a space-separated list of extension names. (The extension names themselves do not contain spaces.) If there are no extensions then the + * empty string is returned. + */ + @Nullable + @NativeType("char const *") + public static String wglGetExtensionsStringEXT() { + long __result = nwglGetExtensionsStringEXT(); + return memASCIISafe(__result); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTFramebufferSRGB.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTFramebufferSRGB.java new file mode 100644 index 00000000..c075e1f9 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTFramebufferSRGB.java @@ -0,0 +1,25 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the WGL_EXT_framebuffer_sRGB extension. + * + *

WGL functionality for {@link EXTFramebufferSRGB EXT_framebuffer_sRGB}.

+ * + *

Requires {@link WGLEXTExtensionsString WGL_EXT_extensions_string} and {@link WGLARBPixelFormat WGL_ARB_pixel_format}.

+ */ +public final class WGLEXTFramebufferSRGB { + + /** + * Accepted by the {@code piAttributes} parameter of wglGetPixelFormatAttribivEXT, wglGetPixelFormatAttribfvEXT, and the {@code piAttribIList} and + * {@code pfAttribIList} of wglChoosePixelFormatEXT. + */ + public static final int WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT = 0x20A9; + + private WGLEXTFramebufferSRGB() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTPixelFormatPackedFloat.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTPixelFormatPackedFloat.java new file mode 100644 index 00000000..81b8d313 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTPixelFormatPackedFloat.java @@ -0,0 +1,26 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the WGL_EXT_pixel_format_packed_float extension. + * + *

This extension provides support for rendering into an unsigned floating-point rendering format with the assumption that the texture format described in + * {@link EXTPackedFloat} could also be advertised as an unsigned floating-point format for rendering.

+ * + *

Requires {@link WGLARBPixelFormat WGL_ARB_pixel_format}.

+ */ +public final class WGLEXTPixelFormatPackedFloat { + + /** + * Accepted as a value in the {@code attribIList} parameter array of {@link WGLARBPixelFormat#wglChoosePixelFormatARB ChoosePixelFormatARB}, and returned in the {@code values} + * parameter array of {@link WGLARBPixelFormat#wglGetPixelFormatAttribivARB GetPixelFormatAttribivARB}. + */ + public static final int WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT = 0x20A8; + + private WGLEXTPixelFormatPackedFloat() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTSwapControl.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTSwapControl.java new file mode 100644 index 00000000..b5fa5b48 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLEXTSwapControl.java @@ -0,0 +1,69 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; + +/** + * Native bindings to the WGL_EXT_swap_control extension. + * + *

This extension allows an application to specify a minimum periodicity of color buffer swaps, measured in video frame periods.

+ * + *

Requires {@link WGLEXTExtensionsString WGL_EXT_extensions_string}.

+ */ +public class WGLEXTSwapControl { + + protected WGLEXTSwapControl() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(WGLCapabilities caps) { + return checkFunctions( + caps.wglSwapIntervalEXT, caps.wglGetSwapIntervalEXT + ); + } + + // --- [ wglSwapIntervalEXT ] --- + + /** + * Specifies the minimum number of video frame periods per buffer swap for the window associated with the current context. The interval takes effect when + * {@link org.lwjgl.system.windows.GDI32#SwapBuffers} or wglSwapLayerBuffer is first called subsequent to the {@code wglSwapIntervalEXT} call. + * + *

A video frame period is the time required by the monitor to display a full frame of video data. In the case of an interlaced monitor, this is typically + * the time required to display both the even and odd fields of a frame of video data. An interval set to a value of 2 means that the color buffers will + * be swapped at most every other video frame.

+ * + *

If {@code interval} is set to a value of 0, buffer swaps are not synchronized to a video frame. The {@code interval} value is silently clamped to the + * maximum implementation-dependent value supported before being stored.

+ * + *

The swap interval is not part of the render context state. It cannot be pushed or popped. The default swap interval is 1.

+ * + * @param interval the minimum number of video frames that are displayed before a buffer swap will occur + */ + @NativeType("BOOL") + public static boolean wglSwapIntervalEXT(int interval) { + long __functionAddress = GL.getCapabilitiesWGL().wglSwapIntervalEXT; + if (CHECKS) { + check(__functionAddress); + } + return callI(interval, __functionAddress) != 0; + } + + // --- [ wglGetSwapIntervalEXT ] --- + + /** Returns the current swap interval for the window associated with the current context. */ + public static int wglGetSwapIntervalEXT() { + long __functionAddress = GL.getCapabilitiesWGL().wglGetSwapIntervalEXT; + if (CHECKS) { + check(__functionAddress); + } + return callI(__functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVCopyImage.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVCopyImage.java new file mode 100644 index 00000000..85886c08 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVCopyImage.java @@ -0,0 +1,68 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; + +/** + * Native bindings to the WGL_NV_copy_image extension. + * + *

This extension enables efficient image data transfer between image objects (i.e. textures and renderbuffers) without the need to bind the objects or + * otherwise configure the rendering pipeline. The WGL version allows copying between images in different contexts, even if those contexts are in + * different sharelists or even on different physical devices.

+ */ +public class WGLNVCopyImage { + + protected WGLNVCopyImage() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(WGLCapabilities caps) { + return checkFunctions( + caps.wglCopyImageSubDataNV + ); + } + + // --- [ wglCopyImageSubDataNV ] --- + + /** + * Behaves identically to the core function {@link #wglCopyImageSubDataNV CopyImageSubDataNV}, except that the {@code srcRC} and {@code dstRC} parameters specify + * the contexts in which to look up the source and destination objects, respectively. A value of zero indicates that the currently bound context should be + * used instead. + * + * @param srcRC the source OpenGL context + * @param srcName the source object + * @param srcTarget the source object target + * @param srcLevel the source level-of-detail number + * @param srcX the source texel x coordinate + * @param srcY the source texel y coordinate + * @param srcZ the source texel z coordinate + * @param dstRC the destination OpenGL context + * @param dstName the destination object + * @param dstTarget the destination object target + * @param dstLevel the destination level-of-detail number + * @param dstX the destination texel x coordinate + * @param dstY the destination texel y coordinate + * @param dstZ the destination texel z coordinate + * @param width the number of texels to copy in the x-dimension + * @param height the number of texels to copy in the y-dimension + * @param depth the number of texels to copy in the z-dimension + */ + @NativeType("BOOL") + public static boolean wglCopyImageSubDataNV(@NativeType("HGLRC") long srcRC, @NativeType("GLuint") int srcName, @NativeType("GLenum") int srcTarget, @NativeType("GLint") int srcLevel, @NativeType("GLint") int srcX, @NativeType("GLint") int srcY, @NativeType("GLint") int srcZ, @NativeType("HGLRC") long dstRC, @NativeType("GLuint") int dstName, @NativeType("GLenum") int dstTarget, @NativeType("GLint") int dstLevel, @NativeType("GLint") int dstX, @NativeType("GLint") int dstY, @NativeType("GLint") int dstZ, @NativeType("GLsizei") int width, @NativeType("GLsizei") int height, @NativeType("GLsizei") int depth) { + long __functionAddress = GL.getCapabilitiesWGL().wglCopyImageSubDataNV; + if (CHECKS) { + check(__functionAddress); + check(srcRC); + check(dstRC); + } + return callPPI(srcRC, srcName, srcTarget, srcLevel, srcX, srcY, srcZ, dstRC, dstName, dstTarget, dstLevel, dstX, dstY, dstZ, width, height, depth, __functionAddress) != 0; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVDXInterop.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVDXInterop.java new file mode 100644 index 00000000..b110b388 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVDXInterop.java @@ -0,0 +1,203 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the WGL_NV_DX_interop extension. + * + *

This extension allows OpenGL to directly access DirectX buffers and surfaces. A DirectX vertex buffer may be shared as an OpenGL buffer object and a + * DirectX surface may be shared as an OpenGL texture or renderbuffer object.

+ * + *

Requires {@link GL21 OpenGL 2.1}.

+ */ +public class WGLNVDXInterop { + + /** Accepted by the {@code access} parameters of {@link #wglDXRegisterObjectNV DXRegisterObjectNV} and {@link #wglDXObjectAccessNV DXObjectAccessNV}. */ + public static final int + WGL_ACCESS_READ_ONLY_NV = 0x0, + WGL_ACCESS_READ_WRITE_NV = 0x1, + WGL_ACCESS_WRITE_DISCARD_NV = 0x2; + + protected WGLNVDXInterop() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(WGLCapabilities caps) { + return checkFunctions( + caps.wglDXSetResourceShareHandleNV, caps.wglDXOpenDeviceNV, caps.wglDXCloseDeviceNV, caps.wglDXRegisterObjectNV, caps.wglDXUnregisterObjectNV, + caps.wglDXObjectAccessNV, caps.wglDXLockObjectsNV, caps.wglDXUnlockObjectsNV + ); + } + + // --- [ wglDXSetResourceShareHandleNV ] --- + + /** + * @param dxObject a pointer to the DirectX resource that will be shared + * @param shareHandle the share handle that the OS generated for the resource + */ + @NativeType("BOOL") + public static boolean wglDXSetResourceShareHandleNV(@NativeType("void *") long dxObject, @NativeType("HANDLE") long shareHandle) { + long __functionAddress = GL.getCapabilitiesWGL().wglDXSetResourceShareHandleNV; + if (CHECKS) { + check(__functionAddress); + check(dxObject); + check(shareHandle); + } + return callPPI(dxObject, shareHandle, __functionAddress) != 0; + } + + // --- [ wglDXOpenDeviceNV ] --- + + /** + * Prepares a DirectX device for interoperability and returns a handle to a GL/DirectX interop device. + * + * @param dxDevice a pointer to a supported Direct3D device object + */ + @NativeType("HANDLE") + public static long wglDXOpenDeviceNV(@NativeType("void *") long dxDevice) { + long __functionAddress = GL.getCapabilitiesWGL().wglDXOpenDeviceNV; + if (CHECKS) { + check(__functionAddress); + check(dxDevice); + } + return callPP(dxDevice, __functionAddress); + } + + // --- [ wglDXCloseDeviceNV ] --- + + @NativeType("BOOL") + public static boolean wglDXCloseDeviceNV(@NativeType("HANDLE") long device) { + long __functionAddress = GL.getCapabilitiesWGL().wglDXCloseDeviceNV; + if (CHECKS) { + check(__functionAddress); + check(device); + } + return callPI(device, __functionAddress) != 0; + } + + // --- [ wglDXRegisterObjectNV ] --- + + /** + * Prepares a DirectX object for use by the GL and returns a handle to a GL/DirectX interop object. + * + * @param device a GL/DirectX interop device handle, as returned by {@link #wglDXOpenDeviceNV DXOpenDeviceNV} + * @param dxResource a pointer to a DirectX resource to be registered with the GL + * @param name the GL object name to be assigned to the DirectX resource in the namespace of the objects identified by {@code type} in the current GL context + * @param type the GL object type that will map to the DirectX resource being shared + * @param access indicates the intended usage of the resource in GL. One of:
{@link #WGL_ACCESS_READ_ONLY_NV ACCESS_READ_ONLY_NV}{@link #WGL_ACCESS_READ_WRITE_NV ACCESS_READ_WRITE_NV}{@link #WGL_ACCESS_WRITE_DISCARD_NV ACCESS_WRITE_DISCARD_NV}
+ */ + @NativeType("HANDLE") + public static long wglDXRegisterObjectNV(@NativeType("HANDLE") long device, @NativeType("void *") long dxResource, @NativeType("GLuint") int name, @NativeType("GLenum") int type, @NativeType("GLenum") int access) { + long __functionAddress = GL.getCapabilitiesWGL().wglDXRegisterObjectNV; + if (CHECKS) { + check(__functionAddress); + check(device); + check(dxResource); + } + return callPPP(device, dxResource, name, type, access, __functionAddress); + } + + // --- [ wglDXUnregisterObjectNV ] --- + + @NativeType("BOOL") + public static boolean wglDXUnregisterObjectNV(@NativeType("HANDLE") long device, @NativeType("HANDLE") long object) { + long __functionAddress = GL.getCapabilitiesWGL().wglDXUnregisterObjectNV; + if (CHECKS) { + check(__functionAddress); + check(device); + check(object); + } + return callPPI(device, object, __functionAddress) != 0; + } + + // --- [ wglDXObjectAccessNV ] --- + + /** + * Modifies the access mode of an interop object, if a different access mode is required after the object has been registered. + * + * @param object the GL/DirectX interop object + * @param access the new access mode. One of:
{@link #WGL_ACCESS_READ_ONLY_NV ACCESS_READ_ONLY_NV}{@link #WGL_ACCESS_READ_WRITE_NV ACCESS_READ_WRITE_NV}{@link #WGL_ACCESS_WRITE_DISCARD_NV ACCESS_WRITE_DISCARD_NV}
+ */ + @NativeType("BOOL") + public static boolean wglDXObjectAccessNV(@NativeType("HANDLE") long object, @NativeType("GLenum") int access) { + long __functionAddress = GL.getCapabilitiesWGL().wglDXObjectAccessNV; + if (CHECKS) { + check(__functionAddress); + check(object); + } + return callPI(object, access, __functionAddress) != 0; + } + + // --- [ wglDXLockObjectsNV ] --- + + /** + * Unsafe version of: {@link #wglDXLockObjectsNV DXLockObjectsNV} + * + * @param count the number of objects to lock + */ + public static int nwglDXLockObjectsNV(long device, int count, long objects) { + long __functionAddress = GL.getCapabilitiesWGL().wglDXLockObjectsNV; + if (CHECKS) { + check(__functionAddress); + check(device); + } + return callPPI(device, count, objects, __functionAddress); + } + + /** + * Before a GL object which is associated with a DirectX resource may be used, it must be locked with this function. + * + *

A return value of TRUE indicates that all objects were successfully locked. A return value of FALSE indicates an error. If the function returns FALSE, + * none of the objects will be locked.

+ * + *

Attempting to access an interop object via GL when the object is not locked, or attempting to access the DirectX resource through the DirectX API when + * it is locked by GL, will result in undefined behavior and may result in data corruption or program termination. Likewise, passing invalid interop device + * or object handles to this function has undefined results, including program termination.

+ * + * @param device the GL/DirectX interop device handle + * @param objects an array of {@code count} interop objects + */ + @NativeType("BOOL") + public static boolean wglDXLockObjectsNV(@NativeType("HANDLE") long device, @NativeType("HANDLE *") PointerBuffer objects) { + return nwglDXLockObjectsNV(device, objects.remaining(), memAddress(objects)) != 0; + } + + // --- [ wglDXUnlockObjectsNV ] --- + + /** + * Unsafe version of: {@link #wglDXUnlockObjectsNV DXUnlockObjectsNV} + * + * @param count the number of objects to unlock + */ + public static int nwglDXUnlockObjectsNV(long device, int count, long objects) { + long __functionAddress = GL.getCapabilitiesWGL().wglDXUnlockObjectsNV; + if (CHECKS) { + check(__functionAddress); + check(device); + } + return callPPI(device, count, objects, __functionAddress); + } + + /** + * Return control of an object to DirectX. + * + * @param device the GL/DirectX interop device handle + * @param objects an array of {@code count} interop objects + */ + @NativeType("BOOL") + public static boolean wglDXUnlockObjectsNV(@NativeType("HANDLE") long device, @NativeType("HANDLE *") PointerBuffer objects) { + return nwglDXUnlockObjectsNV(device, objects.remaining(), memAddress(objects)) != 0; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVDelayBeforeSwap.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVDelayBeforeSwap.java new file mode 100644 index 00000000..6fbf00e5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVDelayBeforeSwap.java @@ -0,0 +1,75 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; + +import org.lwjgl.system.windows.WinBase; + +/** + * Native bindings to the WGL_NV_delay_before_swap extension. + * + *

For most interactive applications, the standard rendering loop responding to input events on a frame granularity is sufficient. Some more demanding + * applications may want to exchange performance for the ability to sample input closer to the final frame swap and adjust rendering accordingly. This + * extension adds functionality to allow the application to wait until a specified time before a swapbuffers command would be able to execute.

+ * + *

Requires {@link GL21 OpenGL 2.1}.

+ */ +public class WGLNVDelayBeforeSwap { + + protected WGLNVDelayBeforeSwap() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(WGLCapabilities caps) { + return checkFunctions( + caps.wglDelayBeforeSwapNV + ); + } + + // --- [ wglDelayBeforeSwapNV ] --- + + /** + * Blocks the CPU until {@code seconds} seconds before a synchronized swap would occur on the window associated with {@code hDC}. It also returns a boolean + * value equal to {@link WinBase#TRUE} when the implementation had to wait for the synchronized swap and {@link WinBase#FALSE} otherwise. + * + *

The parameter {@code hDC} must be a valid device context associated with a graphic adapter. If {@code hDC} is not valid, {@link WinBase#GetLastError} will + * return WGL_INVALID_HDC, {@code DelayBeforeSwapNV} will return FALSE and will not wait for the swap. If {@code hDC} is not associated with a graphic + * adapter, {@code GetLastError} will return ERROR_DC_NOT_FOUND, {@code DelayBeforeSwapNV} will return FALSE and will not wait for the swap.

+ * + *

The parameter {@code seconds} accepts positive floating point values not larger than the length in seconds of the swap period on the associated window. + * When buffer swaps are synchronized, the swap period is composed of one or multiple video frame periods. A video frame period is the time required by the + * monitor to display a full frame of video data. A swap interval set to a value of 2 means that the color buffers will be swapped at most every other + * video frame. If {@code seconds} is smaller than 0, {@code GetLastError} will return ERROR_INVALID_DATA, {@code DelayBeforeSwapNV} will return FALSE and + * will not wait for the end of the swap period. If {@code seconds} is greater than a swap period, {@code DelayBeforeSwapNV} will return immediately + * without generating any error and the return value will be FALSE.

+ * + *

The application should use a {@code seconds} delay large enough to have time to complete its work before the end of the swap period. If {@code seconds} + * is close to 0.0, the application may miss the end of the swap period and it will have to wait an additional swap period before it can swap.

+ * + *

If {@code DelayBeforeSwapNV} detects that there is less than {@code seconds} seconds before the end of the swap period, it will return immediately and + * the return value will be FALSE. The implementation will not wait an additional video frame period to have an exact delay of {@code seconds} seconds.

+ * + *

If buffer swaps are unsynchronized, {@code DelayBeforeSwapNV} will return immediately and the return value will be FALSE. It could happen for multiple + * reasons, for example if the swap interval is equal to 0, if the window is in a mode switch or if no monitors are active.

+ * + * @param hDC a handle to the DC + * @param seconds the delay, in seconds + */ + @NativeType("BOOL") + public static boolean wglDelayBeforeSwapNV(@NativeType("HDC") long hDC, @NativeType("GLfloat") float seconds) { + long __functionAddress = GL.getCapabilitiesWGL().wglDelayBeforeSwapNV; + if (CHECKS) { + check(__functionAddress); + check(hDC); + } + return callPI(hDC, seconds, __functionAddress) != 0; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVFloatBuffer.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVFloatBuffer.java new file mode 100644 index 00000000..9259643c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVFloatBuffer.java @@ -0,0 +1,38 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the WGL_NV_float_buffer extension. + * + *

WGL functionality for {@link NVFloatBuffer NV_float_buffer}.

+ */ +public final class WGLNVFloatBuffer { + + /** + * Accepted in the {@code piAttributes} array of wglGetPixelFormatAttribivARB and wglGetPixelFormatAttribfvARB and in the {@code piAttribIList} and + * {@code pfAttribFList} arrays of wglChoosePixelFormatARB. + */ + public static final int + WGL_FLOAT_COMPONENTS_NV = 0x20B0, + WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV = 0x20B1, + WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV = 0x20B2, + WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV = 0x20B3, + WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV = 0x20B4; + + /** + * Accepted in the {@code piAttribIList} array of wglCreatePbufferARB and returned in the {@code value} parameter of wglQueryPbufferARB when + * {@code iAttribute} is TEXTURE_FORMAT_ARB. + */ + public static final int + WGL_TEXTURE_FLOAT_R_NV = 0x20B5, + WGL_TEXTURE_FLOAT_RG_NV = 0x20B6, + WGL_TEXTURE_FLOAT_RGB_NV = 0x20B7, + WGL_TEXTURE_FLOAT_RGBA_NV = 0x20B8; + + private WGLNVFloatBuffer() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVGPUAffinity.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVGPUAffinity.java new file mode 100644 index 00000000..f3dda8e4 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVGPUAffinity.java @@ -0,0 +1,176 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the WGL_NV_gpu_affinity extension. + * + *

On systems with more than one GPU it is desirable to be able to select which GPU(s) in the system become the target for OpenGL rendering commands. This + * extension introduces the concept of a GPU affinity mask. OpenGL rendering commands are directed to the GPU(s) specified by the affinity mask. GPU + * affinity is immutable. Once set, it cannot be changed.

+ * + *

This extension also introduces the concept called affinity-DC. An affinity-DC is a device context with a GPU affinity mask embedded in it. This + * restricts the device context to only allow OpenGL commands to be sent to the GPU(s) in the affinity mask.

+ * + *

Requires {@link WGLARBExtensionsString WGL_ARB_extensions_string}.

+ */ +public class WGLNVGPUAffinity { + + /** New error code set by wglShareLists, wglMakeCurrent and {@link WGLARBMakeCurrentRead#wglMakeContextCurrentARB MakeContextCurrentARB}. */ + public static final int ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV = 0x20D0; + + /** New error code set by {@link WGL#wglMakeCurrent MakeCurrent} and {@link WGLARBMakeCurrentRead#wglMakeContextCurrentARB MakeContextCurrentARB}. */ + public static final int ERROR_MISSING_AFFINITY_MASK_NV = 0x20D1; + + protected WGLNVGPUAffinity() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(WGLCapabilities caps) { + return checkFunctions( + caps.wglEnumGpusNV, caps.wglEnumGpuDevicesNV, caps.wglCreateAffinityDCNV, caps.wglEnumGpusFromAffinityDCNV, caps.wglDeleteDCNV + ); + } + + // --- [ wglEnumGpusNV ] --- + + /** Unsafe version of: {@link #wglEnumGpusNV EnumGpusNV} */ + public static int nwglEnumGpusNV(int gpuIndex, long gpu) { + long __functionAddress = GL.getCapabilitiesWGL().wglEnumGpusNV; + if (CHECKS) { + check(__functionAddress); + } + return callPI(gpuIndex, gpu, __functionAddress); + } + + /** + * Returns the handles for all GPUs in a system. + * + *

By looping over {@code wglEnumGpusNV} and incrementing {@code gpuIndex}, starting at index 0, all GPU handles can be queried. If the function succeeds, + * the return value is TRUE. If the function fails, the return value is FALSE and {@code gpu} will be unmodified. The function fails if {@code gpuIndex} is + * greater or equal than the number of GPUs supported by the system.

+ * + * @param gpuIndex an index value that specifies a GPU + * @param gpu returns a handle for GPU number {@code gpuIndex}. The first GPU will be index 0. + */ + @NativeType("BOOL") + public static boolean wglEnumGpusNV(@NativeType("UINT") int gpuIndex, @NativeType("HGPUNV *") PointerBuffer gpu) { + if (CHECKS) { + check(gpu, 1); + } + return nwglEnumGpusNV(gpuIndex, memAddress(gpu)) != 0; + } + + // --- [ wglEnumGpuDevicesNV ] --- + + /** Unsafe version of: {@link #wglEnumGpuDevicesNV EnumGpuDevicesNV} */ + public static int nwglEnumGpuDevicesNV(long gpu, int deviceIndex, long gpuDevice) { + long __functionAddress = GL.getCapabilitiesWGL().wglEnumGpuDevicesNV; + if (CHECKS) { + check(__functionAddress); + check(gpu); + } + return callPPI(gpu, deviceIndex, gpuDevice, __functionAddress); + } + + /** + * Retrieve information about the display devices supported by a GPU. + * + * @param gpu a handle to the GPU to query + * @param deviceIndex an index value that specifies a display device, supported by {@code gpu}, to query. The first display device will be index 0. + * @param gpuDevice a {@link GPU_DEVICE} structure which will receive information about the display device at index {@code deviceIndex}. + */ + @NativeType("BOOL") + public static boolean wglEnumGpuDevicesNV(@NativeType("HGPUNV") long gpu, @NativeType("UINT") int deviceIndex, @NativeType("PGPU_DEVICE") GPU_DEVICE gpuDevice) { + return nwglEnumGpuDevicesNV(gpu, deviceIndex, gpuDevice.address()) != 0; + } + + // --- [ wglCreateAffinityDCNV ] --- + + /** Unsafe version of: {@link #wglCreateAffinityDCNV CreateAffinityDCNV} */ + public static long nwglCreateAffinityDCNV(long gpuList) { + long __functionAddress = GL.getCapabilitiesWGL().wglCreateAffinityDCNV; + if (CHECKS) { + check(__functionAddress); + } + return callPP(gpuList, __functionAddress); + } + + /** + * Creates an affinity-DC. Affinity-DCs, a new type of DC, can be used to direct OpenGL commands to a specific GPU or set of GPUs. An affinity-DC is a + * device context with a GPU affinity mask embedded in it. This restricts the device context to only allow OpenGL commands to be sent to the GPU(s) in the + * affinity mask. An affinity-DC can be created directly, using the new function {@code wglCreateAffinityDCNV} and also indirectly by calling + * {@link WGLARBPbuffer#wglCreatePbufferARB CreatePbufferARB} followed by {@link WGLARBPbuffer#wglGetPbufferDCARB GetPbufferDCARB}. + * + *

If successful, the function returns an affinity-DC handle. If it fails, {@code NULL} will be returned.

+ * + * @param gpuList a {@code NULL}-terminated array of GPU handles to which the affinity-DC will be restricted + */ + @NativeType("HDC") + public static long wglCreateAffinityDCNV(@NativeType("HGPUNV const *") PointerBuffer gpuList) { + if (CHECKS) { + checkNT(gpuList); + } + return nwglCreateAffinityDCNV(memAddress(gpuList)); + } + + // --- [ wglEnumGpusFromAffinityDCNV ] --- + + /** Unsafe version of: {@link #wglEnumGpusFromAffinityDCNV EnumGpusFromAffinityDCNV} */ + public static int nwglEnumGpusFromAffinityDCNV(long affinityDC, int gpuIndex, long gpu) { + long __functionAddress = GL.getCapabilitiesWGL().wglEnumGpusFromAffinityDCNV; + if (CHECKS) { + check(__functionAddress); + check(affinityDC); + } + return callPPI(affinityDC, gpuIndex, gpu, __functionAddress); + } + + /** + * Retrieves a list of GPU handles that make up the affinity-mask of an affinity-DC. + * + *

By looping over {@code wglEnumGpusFromAffinityDCNV} and incrementing {@code gpuIndex}, starting at index 0, all GPU handles associated with the DC can + * be queried. If the function succeeds, the return value is TRUE. If the function fails, the return value is FALSE and {@code gpu} will be unmodified. The + * function fails if {@code gpuIndex} is greater or equal than the number of GPUs associated with {@code affinityDC}.

+ * + * @param affinityDC a handle of the affinity-DC to query + * @param gpuIndex an index value of the GPU handle in the affinity mask of {@code affinityDC} to query + * @param gpu returns a handle for GPU number {@code gpuIndex}. The first GPU will be at index 0. + */ + @NativeType("BOOL") + public static boolean wglEnumGpusFromAffinityDCNV(@NativeType("HDC") long affinityDC, @NativeType("UINT") int gpuIndex, @NativeType("HGPUNV *") PointerBuffer gpu) { + if (CHECKS) { + check(gpu, 1); + } + return nwglEnumGpusFromAffinityDCNV(affinityDC, gpuIndex, memAddress(gpu)) != 0; + } + + // --- [ wglDeleteDCNV ] --- + + /** + * Deletes an affinity-DC. + * + * @param hdc a handle of an affinity-DC to delete + */ + @NativeType("BOOL") + public static boolean wglDeleteDCNV(@NativeType("HDC") long hdc) { + long __functionAddress = GL.getCapabilitiesWGL().wglDeleteDCNV; + if (CHECKS) { + check(__functionAddress); + check(hdc); + } + return callPI(hdc, __functionAddress) != 0; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVMultigpuContext.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVMultigpuContext.java new file mode 100644 index 00000000..ebc263c9 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVMultigpuContext.java @@ -0,0 +1,43 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the WGL_NV_multigpu_context extension. + * + *

This extension allows the creation of an OpenGL context in a multi-GPU environment with a specified multi-GPU strategy (known as SLI mode) which takes + * precedence over process-wide multi-GPU mode settings.

+ * + *

The multi-GPU mode denotes vendor specific techniques to allow distributed rendering on multiple GPUs, further called AFR (alternate frame rendering) + * and Multicast (as defined in NV_gpu_multicast).

+ * + *

OpenGL supports multiple contexts. The semantics of switching contexts is generally left to window system binding APIs such as WGL, GLX and EGL. The + * extension {@code WGL_NV_multigpu_context} allows to specify a preferred multi-GPU rendering mode per context, thus context switching can also switch + * the current multi-GPU rendering mode.

+ * + *

The implementation is platform dependent and the actual multi-GPU rendering mode of the created context may vary on different hardware and operation + * system platforms.

+ * + *

Requires {@link WGLARBCreateContext WGL_ARB_create_context}.

+ */ +public final class WGLNVMultigpuContext { + + /** Accepted as an attribute name in the {@code *attrib_list} argument to {@link WGLARBCreateContext#wglCreateContextAttribsARB CreateContextAttribsARB}. */ + public static final int WGL_CONTEXT_MULTIGPU_ATTRIB_NV = 0x20AA; + + /** + * Accepted as an attribute value for {@link #WGL_CONTEXT_MULTIGPU_ATTRIB_NV CONTEXT_MULTIGPU_ATTRIB_NV} in the {@code *attrib_list} argument to + * {@link WGLARBCreateContext#wglCreateContextAttribsARB CreateContextAttribsARB}. + */ + public static final int + WGL_CONTEXT_MULTIGPU_ATTRIB_SINGLE_NV = 0x20AB, + WGL_CONTEXT_MULTIGPU_ATTRIB_AFR_NV = 0x20AC, + WGL_CONTEXT_MULTIGPU_ATTRIB_MULTICAST_NV = 0x20AD, + WGL_CONTEXT_MULTIGPU_ATTRIB_MULTI_DISPLAY_MULTICAST_NV = 0x20AE; + + private WGLNVMultigpuContext() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVMultisampleCoverage.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVMultisampleCoverage.java new file mode 100644 index 00000000..010c9de6 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVMultisampleCoverage.java @@ -0,0 +1,25 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the WGL_NV_multisample_coverage extension. + * + *

WGL functionality for {@link NVMultisampleCoverage NV_multisample_coverage}.

+ */ +public final class WGLNVMultisampleCoverage { + + /** + * Accepted by the {@code piAttributes} parameter of wglGetPixelFormatAttribivEXT, wglGetPixelFormatAttribfvEXT, and the + * {@code piAttribIList} and {@code pfAttribIList} of wglChoosePixelFormatEXT. + */ + public static final int + WGL_COVERAGE_SAMPLES_NV = 0x2042, + WGL_COLOR_SAMPLES_NV = 0x20B9; + + private WGLNVMultisampleCoverage() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVRenderDepthTexture.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVRenderDepthTexture.java new file mode 100644 index 00000000..d4fffdcb --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVRenderDepthTexture.java @@ -0,0 +1,40 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the WGL_NV_render_depth_texture extension. + * + *

This extension allows a depth buffer to be used for both rendering and texturing. It is built upon the ARB_render_texture extension; the only addition + * in this extension is the ability to use a depth buffer as a DEPTH_COMPONENT texture map.

+ */ +public final class WGLNVRenderDepthTexture { + + /** + * Accepted by the {@code piAttributes} parameter of wglGetPixelFormatAttribivARB, wglGetPixelFormatAttribfvARB, and the {@code piAttribIList} and + * {@code pfAttribIList} parameters of wglChoosePixelFormatARB. + */ + public static final int + WGL_BIND_TO_TEXTURE_DEPTH_NV = 0x20A3, + WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV = 0x20A4; + + /** Accepted by the {@code piAttribList} parameter of wglCreatePbufferARB and by the {@code iAttribute} parameter of wglQueryPbufferARB. */ + public static final int WGL_DEPTH_TEXTURE_FORMAT_NV = 0x20A5; + + /** + * Accepted as a value in the {@code piAttribList} parameter of wglCreatePbufferARB and returned in the value parameter of wglQueryPbufferARB when + * {@code iAttribute} is WGL_DEPTH_TEXTURE_FORMAT_NV. + */ + public static final int + WGL_TEXTURE_DEPTH_COMPONENT_NV = 0x20A6, + WGL_NO_TEXTURE_ARB = 0x2077; + + /** Accepted by the {@code iBuffer} parameter of wglBindTexImageARB. */ + public static final int WGL_DEPTH_COMPONENT_NV = 0x20A7; + + private WGLNVRenderDepthTexture() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVRenderTextureRectangle.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVRenderTextureRectangle.java new file mode 100644 index 00000000..2824ba16 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVRenderTextureRectangle.java @@ -0,0 +1,33 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +/** + * Native bindings to the WGL_NV_render_texture_rectangle extension. + * + *

This extension allows a color buffer with non-power-of-two dimensions to be used for both rendering and texturing. It is built upon the + * ARB_render_texture extension; the only addition in this extension is the ability to bind a texture to a texture rectangle target, as provided through + * the NV_texture_rectangle extension.

+ */ +public final class WGLNVRenderTextureRectangle { + + /** + * Accepted by the {@code piAttributes} parameter of wglGetPixelFormatAttribivARB, wglGetPixelFormatAttribfvARB, and the {@code piAttribIList} and + * {@code pfAttribIList} parameters of wglChoosePixelFormatARB. + */ + public static final int + WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV = 0x20A0, + WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV = 0x20A1; + + /** + * Accepted as a value in the {@code piAttribList} parameter of wglCreatePbufferARB and returned in the value parameter of wglQueryPbufferARB when + * {@code iAttribute} is WGL_TEXTURE_TARGET_ARB. + */ + public static final int WGL_TEXTURE_RECTANGLE_NV = 0x20A2; + + private WGLNVRenderTextureRectangle() {} + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVSwapGroup.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVSwapGroup.java new file mode 100644 index 00000000..0c42582a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVSwapGroup.java @@ -0,0 +1,172 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the WGL_NV_swap_group extension. + * + *

This extension provides the capability to synchronize the buffer swaps of a group of OpenGL windows. A swap group is created, and windows are added as + * members to the swap group. Buffer swaps to members of the swap group will then take place concurrently.

+ * + *

This extension also provides the capability to sychronize the buffer swaps of different swap groups, which may reside on distributed systems on a + * network. For this purpose swap groups can be bound to a swap barrier.

+ * + *

This extension extends the set of conditions that must be met before a buffer swap can take place.

+ */ +public class WGLNVSwapGroup { + + protected WGLNVSwapGroup() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(WGLCapabilities caps) { + return checkFunctions( + caps.wglJoinSwapGroupNV, caps.wglBindSwapBarrierNV, caps.wglQuerySwapGroupNV, caps.wglQueryMaxSwapGroupsNV, caps.wglQueryFrameCountNV, + caps.wglResetFrameCountNV + ); + } + + // --- [ wglJoinSwapGroupNV ] --- + + @NativeType("BOOL") + public static boolean wglJoinSwapGroupNV(@NativeType("HDC") long hDC, @NativeType("GLuint") int group) { + long __functionAddress = GL.getCapabilitiesWGL().wglJoinSwapGroupNV; + if (CHECKS) { + check(__functionAddress); + check(hDC); + } + return callPI(hDC, group, __functionAddress) != 0; + } + + // --- [ wglBindSwapBarrierNV ] --- + + @NativeType("BOOL") + public static boolean wglBindSwapBarrierNV(@NativeType("GLuint") int group, @NativeType("GLuint") int barrier) { + long __functionAddress = GL.getCapabilitiesWGL().wglBindSwapBarrierNV; + if (CHECKS) { + check(__functionAddress); + } + return callI(group, barrier, __functionAddress) != 0; + } + + // --- [ wglQuerySwapGroupNV ] --- + + public static int nwglQuerySwapGroupNV(long hDC, long group, long barrier) { + long __functionAddress = GL.getCapabilitiesWGL().wglQuerySwapGroupNV; + if (CHECKS) { + check(__functionAddress); + check(hDC); + } + return callPPPI(hDC, group, barrier, __functionAddress); + } + + @NativeType("BOOL") + public static boolean wglQuerySwapGroupNV(@NativeType("HDC") long hDC, @NativeType("GLuint *") IntBuffer group, @NativeType("GLuint *") IntBuffer barrier) { + if (CHECKS) { + check(group, 1); + check(barrier, 1); + } + return nwglQuerySwapGroupNV(hDC, memAddress(group), memAddress(barrier)) != 0; + } + + // --- [ wglQueryMaxSwapGroupsNV ] --- + + public static int nwglQueryMaxSwapGroupsNV(long hDC, long maxGroups, long maxBarriers) { + long __functionAddress = GL.getCapabilitiesWGL().wglQueryMaxSwapGroupsNV; + if (CHECKS) { + check(__functionAddress); + check(hDC); + } + return callPPPI(hDC, maxGroups, maxBarriers, __functionAddress); + } + + @NativeType("BOOL") + public static boolean wglQueryMaxSwapGroupsNV(@NativeType("HDC") long hDC, @NativeType("GLuint *") IntBuffer maxGroups, @NativeType("GLuint *") IntBuffer maxBarriers) { + if (CHECKS) { + check(maxGroups, 1); + check(maxBarriers, 1); + } + return nwglQueryMaxSwapGroupsNV(hDC, memAddress(maxGroups), memAddress(maxBarriers)) != 0; + } + + // --- [ wglQueryFrameCountNV ] --- + + public static int nwglQueryFrameCountNV(long hDC, long count) { + long __functionAddress = GL.getCapabilitiesWGL().wglQueryFrameCountNV; + if (CHECKS) { + check(__functionAddress); + check(hDC); + } + return callPPI(hDC, count, __functionAddress); + } + + @NativeType("BOOL") + public static boolean wglQueryFrameCountNV(@NativeType("HDC") long hDC, @NativeType("GLuint *") IntBuffer count) { + if (CHECKS) { + check(count, 1); + } + return nwglQueryFrameCountNV(hDC, memAddress(count)) != 0; + } + + // --- [ wglResetFrameCountNV ] --- + + @NativeType("BOOL") + public static boolean wglResetFrameCountNV(@NativeType("HDC") long hDC) { + long __functionAddress = GL.getCapabilitiesWGL().wglResetFrameCountNV; + if (CHECKS) { + check(__functionAddress); + check(hDC); + } + return callPI(hDC, __functionAddress) != 0; + } + + /** Array version of: {@link #wglQuerySwapGroupNV QuerySwapGroupNV} */ + @NativeType("BOOL") + public static boolean wglQuerySwapGroupNV(@NativeType("HDC") long hDC, @NativeType("GLuint *") int[] group, @NativeType("GLuint *") int[] barrier) { + long __functionAddress = GL.getCapabilitiesWGL().wglQuerySwapGroupNV; + if (CHECKS) { + check(__functionAddress); + check(hDC); + check(group, 1); + check(barrier, 1); + } + return callPPPI(hDC, group, barrier, __functionAddress) != 0; + } + + /** Array version of: {@link #wglQueryMaxSwapGroupsNV QueryMaxSwapGroupsNV} */ + @NativeType("BOOL") + public static boolean wglQueryMaxSwapGroupsNV(@NativeType("HDC") long hDC, @NativeType("GLuint *") int[] maxGroups, @NativeType("GLuint *") int[] maxBarriers) { + long __functionAddress = GL.getCapabilitiesWGL().wglQueryMaxSwapGroupsNV; + if (CHECKS) { + check(__functionAddress); + check(hDC); + check(maxGroups, 1); + check(maxBarriers, 1); + } + return callPPPI(hDC, maxGroups, maxBarriers, __functionAddress) != 0; + } + + /** Array version of: {@link #wglQueryFrameCountNV QueryFrameCountNV} */ + @NativeType("BOOL") + public static boolean wglQueryFrameCountNV(@NativeType("HDC") long hDC, @NativeType("GLuint *") int[] count) { + long __functionAddress = GL.getCapabilitiesWGL().wglQueryFrameCountNV; + if (CHECKS) { + check(__functionAddress); + check(hDC); + check(count, 1); + } + return callPPI(hDC, count, __functionAddress) != 0; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVVertexArrayRange.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVVertexArrayRange.java new file mode 100644 index 00000000..39b87204 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/WGLNVVertexArrayRange.java @@ -0,0 +1,61 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.opengl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +public class WGLNVVertexArrayRange { + + protected WGLNVVertexArrayRange() { + throw new UnsupportedOperationException(); + } + + static boolean isAvailable(WGLCapabilities caps) { + return checkFunctions( + caps.wglAllocateMemoryNV, caps.wglFreeMemoryNV + ); + } + + // --- [ wglAllocateMemoryNV ] --- + + public static long nwglAllocateMemoryNV(int size, float readfreq, float writefreq, float priority) { + long __functionAddress = GL.getCapabilitiesWGL().wglAllocateMemoryNV; + if (CHECKS) { + check(__functionAddress); + } + return callP(size, readfreq, writefreq, priority, __functionAddress); + } + + @Nullable + @NativeType("void *") + public static ByteBuffer wglAllocateMemoryNV(@NativeType("GLsizei") int size, @NativeType("GLfloat") float readfreq, @NativeType("GLfloat") float writefreq, @NativeType("GLfloat") float priority) { + long __result = nwglAllocateMemoryNV(size, readfreq, writefreq, priority); + return memByteBufferSafe(__result, size); + } + + // --- [ wglFreeMemoryNV ] --- + + public static void nwglFreeMemoryNV(long pointer) { + long __functionAddress = GL.getCapabilitiesWGL().wglFreeMemoryNV; + if (CHECKS) { + check(__functionAddress); + } + callPV(pointer, __functionAddress); + } + + public static void wglFreeMemoryNV(@NativeType("void *") ByteBuffer pointer) { + nwglFreeMemoryNV(memAddress(pointer)); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/package-info.java b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/package-info.java new file mode 100644 index 00000000..785eb5f0 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/opengl/package-info.java @@ -0,0 +1,41 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ + +/** + * Contains bindings to the OpenGL cross-platform 2D and 3D rendering API. + * + *

The OpenGL registry is a useful online resource that contains the OpenGL and OpenGL + * Shading Language specifications, as well as specifications of OpenGL extensions. + * The OpenGL Reference Pages is another convenient source of documentation.

+ * + *

The bindings of the core OpenGL functionality are contained in two distinct class hierarchies:

+ * + *
    + *
  • {@code GL11..GL46}: all symbols of the Compatibility Profile are included
  • + *
  • {@code GL11C..GL46C}: only symbols of the Core Profile are included
  • + *
+ * + *

Each of the above classes extends the class of the previous OpenGL version in the corresponding hierarchy.

+ * + *

The recommended way to write OpenGL applications with LWJGL is to statically import the class that corresponds to the minimum required OpenGL version. + * This will expose all symbols up to that version. Additional functionality (later core versions or extensions) should be guarded with appropriate checks + * using the {@link org.lwjgl.opengl.GLCapabilities GLCapabilities} instance of the OpenGL context.

+ * + *

The Compatibility Profile and Core Profile class hierarchies should not be mixed with static imports, as that would result in compilation ambiguities + * when resolving the symbols. Note that the Compatibility Profile hierarchy can be used with a Core Profile context (as long as no deprecated symbol is + * used) and the Core Profile hierarchy can be used with a Compatibility Profile context. The recommendation is to use the Compatibility Profile hierarchy + * only when deprecated functionality is required. In any other case, the Core Profile hierarchy should be preferred.

+ * + *

For example, an OpenGL application that requires OpenGL 3.3, must use modern OpenGL features only and needs the best possible performance:

+ * + *
    + *
  • Should create a 3.3 Compatibility Profile context. A Core Profile context would have extra validation overhead.
  • + *
  • Should use the Core Profile hierarchy to avoid deprecated symbols. Auto-complete lists in an IDE will also be cleaner.
  • + *
+ */ +@org.lwjgl.system.NonnullDefault +package org.lwjgl.opengl; + diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/package-info.java b/lwjgl3-fcl/src/main/java/org/lwjgl/package-info.java new file mode 100644 index 00000000..89e60569 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/package-info.java @@ -0,0 +1,22 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ + +/** + * The base LWJGL package. Contains functionality useful across all bindings. + * + *

LWJGL is a Java library that enables cross-platform access to popular native APIs useful in the development of graphics (OpenGL), audio (OpenAL) and + * parallel computing (OpenCL) applications. This access is direct and high-performance, yet also wrapped in a type-safe and user-friendly layer, appropriate + * for the Java ecosystem.

+ * + *

LWJGL is an enabling technology and provides low-level access. It is not a framework and does not provide higher-level utilities than what the native + * libraries expose. As such, novice programmers are encouraged to try one of the frameworks or game engines that make use of LWJGL, before working directly + * with the library.

+ * + *

LWJGL is open source software and freely available at no charge.

+ * + * @see www.lwjgl.org + */ +@org.lwjgl.system.NonnullDefault +package org.lwjgl; diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/LibSTB.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/LibSTB.java new file mode 100644 index 00000000..5d362bd7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/LibSTB.java @@ -0,0 +1,46 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** Initializes the stb shared library. */ +final class LibSTB { + + static { + String libName = Platform.mapLibraryNameBundled("lwjgl"); + Library.loadSystem(System::load, System::loadLibrary, LibSTB.class, "org.lwjgl.stb", libName); + + MemoryAllocator allocator = getAllocator(Configuration.DEBUG_MEMORY_ALLOCATOR_INTERNAL.get(true)); + setupMalloc( + allocator.getMalloc(), + allocator.getCalloc(), + allocator.getRealloc(), + allocator.getFree(), + allocator.getAlignedAlloc(), + allocator.getAlignedFree() + ); + } + + private LibSTB() { + } + + static void initialize() { + // intentionally empty to trigger static initializer + } + + private static native void setupMalloc( + long malloc, + long calloc, + long realloc, + long free, + long aligned_alloc, + long aligned_free + ); + +} diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBDXT.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBDXT.java new file mode 100644 index 00000000..136993be --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBDXT.java @@ -0,0 +1,96 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to stb_dxt.h from the stb library. + * + *

DXT1/DXT5 compressor.

+ */ +public class STBDXT { + + public static final int STB_DXT_NORMAL = 0x0; + + /** Use dithering. Dubious win, never use for normal maps and the like! */ + public static final int STB_DXT_DITHER = 0x1; + + /** High quality mode, does two refinement steps instead of 1. ~30-40% slower. */ + public static final int STB_DXT_HIGHQUAL = 0x2; + + static { LibSTB.initialize(); } + + protected STBDXT() { + throw new UnsupportedOperationException(); + } + + // --- [ stb_compress_dxt_block ] --- + + /** Unsafe version of: {@link #stb_compress_dxt_block compress_dxt_block} */ + public static native void nstb_compress_dxt_block(long dest, long src_rgba_four_bytes_per_pixel, int alpha, int mode); + + /** + * Call this function for every block (you must pad). The source should be a 4x4 block of RGBA data in row-major order; A is ignored if you specify + * {@code alpha=0}; you can turn on dithering and "high quality" using {@code mode}. + * + * @param dest a buffer in which to store the compressed block + * @param src_rgba_four_bytes_per_pixel the block to compress + * @param alpha 1 to compress the alpha channel, 0 to ignore it + * @param mode the compression mode. One of:
{@link #STB_DXT_NORMAL DXT_NORMAL}{@link #STB_DXT_DITHER DXT_DITHER}{@link #STB_DXT_HIGHQUAL DXT_HIGHQUAL}
+ */ + public static void stb_compress_dxt_block(@NativeType("unsigned char *") ByteBuffer dest, @NativeType("unsigned char const *") ByteBuffer src_rgba_four_bytes_per_pixel, @NativeType("int") boolean alpha, int mode) { + if (CHECKS) { + check(dest, alpha ? 16 : 8); + check(src_rgba_four_bytes_per_pixel, 64); + } + nstb_compress_dxt_block(memAddress(dest), memAddress(src_rgba_four_bytes_per_pixel), alpha ? 1 : 0, mode); + } + + // --- [ stb_compress_bc4_block ] --- + + /** Unsafe version of: {@link #stb_compress_bc4_block compress_bc4_block} */ + public static native void nstb_compress_bc4_block(long dest, long src_r_one_byte_per_pixel); + + /** + * Call this function for every block (you must pad). The source should be a 4x4 block of A data in row-major order. + * + * @param dest a buffer in which to store the compressed block + * @param src_r_one_byte_per_pixel the block to compress + */ + public static void stb_compress_bc4_block(@NativeType("unsigned char *") ByteBuffer dest, @NativeType("unsigned char const *") ByteBuffer src_r_one_byte_per_pixel) { + if (CHECKS) { + check(dest, 8); + check(src_r_one_byte_per_pixel, 16); + } + nstb_compress_bc4_block(memAddress(dest), memAddress(src_r_one_byte_per_pixel)); + } + + // --- [ stb_compress_bc5_block ] --- + + /** Unsafe version of: {@link #stb_compress_bc5_block compress_bc5_block} */ + public static native void nstb_compress_bc5_block(long dest, long src_rg_two_byte_per_pixel); + + /** + * Call this function for every block (you must pad). The source should be a 4x4 block of RG data in row-major order. + * + * @param dest a buffer in which to store the compressed block + * @param src_rg_two_byte_per_pixel the block to compress + */ + public static void stb_compress_bc5_block(@NativeType("unsigned char *") ByteBuffer dest, @NativeType("unsigned char const *") ByteBuffer src_rg_two_byte_per_pixel) { + if (CHECKS) { + check(dest, 16); + check(src_rg_two_byte_per_pixel, 32); + } + nstb_compress_bc5_block(memAddress(dest), memAddress(src_rg_two_byte_per_pixel)); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBEasyFont.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBEasyFont.java new file mode 100644 index 00000000..d66fb2e1 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBEasyFont.java @@ -0,0 +1,241 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to stb_easy_font.h from the stb library. + * + *

Bitmap font for use in 3D APIs:

+ * + *
    + *
  • Easy-to-deploy
  • + *
  • reasonably compact
  • + *
  • extremely inefficient performance-wise
  • + *
  • crappy-looking
  • + *
  • ASCII-only
  • + *
+ * + *

Intended for when you just want to get some text displaying in a 3D app as quickly as possible.

+ * + *

Doesn't use any textures, instead builds characters out of quads.

+ * + *

SAMPLE CODE

+ * + *

Here's sample code for old OpenGL; it's a lot more complicated to make work on modern APIs, and that's your problem.

+ * + *

+ * void print_string(float x, float y, char *text, float r, float g, float b)
+ * {
+ *     static char buffer[99999]; // ~500 chars
+ *     int num_quads;
+ * 
+ *     num_quads = stb_easy_font_print(x, y, text, NULL, buffer, sizeof(buffer));
+ * 
+ *     glColor3f(r,g,b);
+ *     glEnableClientState(GL_VERTEX_ARRAY);
+ *     glVertexPointer(2, GL_FLOAT, 16, buffer);
+ *     glDrawArrays(GL_QUADS, 0, num_quads*4);
+ *     glDisableClientState(GL_VERTEX_ARRAY);
+ * }
+ */ +public class STBEasyFont { + + static { LibSTB.initialize(); } + + protected STBEasyFont() { + throw new UnsupportedOperationException(); + } + + // --- [ stb_easy_font_width ] --- + + /** Unsafe version of: {@link #stb_easy_font_width easy_font_width} */ + public static native int nstb_easy_font_width(long text); + + /** + * Takes a string and returns the horizontal size. + * + * @param text an ASCII string + * + * @return the horizontal size, in pixels + */ + public static int stb_easy_font_width(@NativeType("char *") ByteBuffer text) { + if (CHECKS) { + checkNT1(text); + } + return nstb_easy_font_width(memAddress(text)); + } + + /** + * Takes a string and returns the horizontal size. + * + * @param text an ASCII string + * + * @return the horizontal size, in pixels + */ + public static int stb_easy_font_width(@NativeType("char *") CharSequence text) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(text, true); + long textEncoded = stack.getPointerAddress(); + return nstb_easy_font_width(textEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stb_easy_font_height ] --- + + /** Unsafe version of: {@link #stb_easy_font_height easy_font_height} */ + public static native int nstb_easy_font_height(long text); + + /** + * Takes a string and returns the vertical size (which can vary if {@code text} has newlines). + * + * @param text an ASCII string + * + * @return the vertical size, in pixels + */ + public static int stb_easy_font_height(@NativeType("char *") ByteBuffer text) { + if (CHECKS) { + checkNT1(text); + } + return nstb_easy_font_height(memAddress(text)); + } + + /** + * Takes a string and returns the vertical size (which can vary if {@code text} has newlines). + * + * @param text an ASCII string + * + * @return the vertical size, in pixels + */ + public static int stb_easy_font_height(@NativeType("char *") CharSequence text) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(text, true); + long textEncoded = stack.getPointerAddress(); + return nstb_easy_font_height(textEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stb_easy_font_print ] --- + + /** + * Unsafe version of: {@link #stb_easy_font_print easy_font_print} + * + * @param vbuf_size the {@code vertex_buffer} size, in bytes + */ + public static native int nstb_easy_font_print(float x, float y, long text, long color, long vertex_buffer, int vbuf_size); + + /** + * Takes a string (which can contain '\n') and fills out a vertex buffer with renderable data to draw the string. Output data assumes increasing x is + * rightwards, increasing y is downwards. + * + *

The vertex data is divided into quads, i.e. there are four vertices in the vertex buffer for each quad.

+ * + *

The vertices are stored in an interleaved format:

+ * + *

+     * x:float
+     * y:float
+     * z:float
+     * color:uint8[4]
+ * + *

You can ignore z and color if you get them from elsewhere. This format was chosen in the hopes it would make it easier for you to reuse existing + * buffer-drawing code.

+ * + *

If you pass in {@code NULL} for color, it becomes {@code 255,255,255,255}.

+ * + *

If the buffer isn't large enough, it will truncate. Expect it to use an average of ~270 bytes per character.

+ * + *

If your API doesn't draw quads, build a reusable index list that allows you to render quads as indexed triangles.

+ * + * @param x the x offset + * @param y the y offset + * @param text an ASCII string + * @param color the text color, in RGBA (4 bytes) + * @param vertex_buffer a pointer to memory in which to store the vertex data + * + * @return the number of quads + */ + public static int stb_easy_font_print(float x, float y, @NativeType("char *") ByteBuffer text, @Nullable @NativeType("unsigned char *") ByteBuffer color, @NativeType("void *") ByteBuffer vertex_buffer) { + if (CHECKS) { + checkNT1(text); + checkSafe(color, 4); + } + return nstb_easy_font_print(x, y, memAddress(text), memAddressSafe(color), memAddress(vertex_buffer), vertex_buffer.remaining()); + } + + /** + * Takes a string (which can contain '\n') and fills out a vertex buffer with renderable data to draw the string. Output data assumes increasing x is + * rightwards, increasing y is downwards. + * + *

The vertex data is divided into quads, i.e. there are four vertices in the vertex buffer for each quad.

+ * + *

The vertices are stored in an interleaved format:

+ * + *

+     * x:float
+     * y:float
+     * z:float
+     * color:uint8[4]
+ * + *

You can ignore z and color if you get them from elsewhere. This format was chosen in the hopes it would make it easier for you to reuse existing + * buffer-drawing code.

+ * + *

If you pass in {@code NULL} for color, it becomes {@code 255,255,255,255}.

+ * + *

If the buffer isn't large enough, it will truncate. Expect it to use an average of ~270 bytes per character.

+ * + *

If your API doesn't draw quads, build a reusable index list that allows you to render quads as indexed triangles.

+ * + * @param x the x offset + * @param y the y offset + * @param text an ASCII string + * @param color the text color, in RGBA (4 bytes) + * @param vertex_buffer a pointer to memory in which to store the vertex data + * + * @return the number of quads + */ + public static int stb_easy_font_print(float x, float y, @NativeType("char *") CharSequence text, @Nullable @NativeType("unsigned char *") ByteBuffer color, @NativeType("void *") ByteBuffer vertex_buffer) { + if (CHECKS) { + checkSafe(color, 4); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(text, true); + long textEncoded = stack.getPointerAddress(); + return nstb_easy_font_print(x, y, textEncoded, memAddressSafe(color), memAddress(vertex_buffer), vertex_buffer.remaining()); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stb_easy_font_spacing ] --- + + /** + * Use positive values to expand the space between characters, and small negative values (no smaller than {@code -1.5}) to contract the space between characters. + * + *

E.g. {@code spacing = 1} adds one "pixel" of spacing between the characters. {@code spacing = -1} is reasonable but feels a bit too compact to me; + * {@code -0.5} is a reasonable compromise as long as you're scaling the font up.

+ * + * @param spacing the font spacing + */ + public static native void stb_easy_font_spacing(float spacing); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIEOFCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIEOFCallback.java new file mode 100644 index 00000000..7158aa73 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIEOFCallback.java @@ -0,0 +1,75 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Instances of this class may be set to the {@code eof} field of the {@link STBIIOCallbacks} struct. + * + *

Type

+ * + *

+ * int (*) (
+ *     void *user
+ * )
+ */ +public abstract class STBIEOFCallback extends Callback implements STBIEOFCallbackI { + + /** + * Creates a {@code STBIEOFCallback} instance from the specified function pointer. + * + * @return the new {@code STBIEOFCallback} + */ + public static STBIEOFCallback create(long functionPointer) { + STBIEOFCallbackI instance = Callback.get(functionPointer); + return instance instanceof STBIEOFCallback + ? (STBIEOFCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static STBIEOFCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code STBIEOFCallback} instance that delegates to the specified {@code STBIEOFCallbackI} instance. */ + public static STBIEOFCallback create(STBIEOFCallbackI instance) { + return instance instanceof STBIEOFCallback + ? (STBIEOFCallback)instance + : new Container(instance.address(), instance); + } + + protected STBIEOFCallback() { + super(SIGNATURE); + } + + STBIEOFCallback(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends STBIEOFCallback { + + private final STBIEOFCallbackI delegate; + + Container(long functionPointer, STBIEOFCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public int invoke(long user) { + return delegate.invoke(user); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIEOFCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIEOFCallbackI.java new file mode 100644 index 00000000..bd4ac8ce --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIEOFCallbackI.java @@ -0,0 +1,47 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be set to the {@code eof} field of the {@link STBIIOCallbacks} struct. + * + *

Type

+ * + *

+ * int (*) (
+ *     void *user
+ * )
+ */ +@FunctionalInterface +@NativeType("int (*) (void *)") +public interface STBIEOFCallbackI extends CallbackI.I { + + String SIGNATURE = "(p)i"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default int callback(long args) { + return invoke( + dcbArgPointer(args) + ); + } + + /** + * The {@code stbi_io_callbacks.eof} callback. + * + * @param user a pointer to user data + * + * @return nonzero if we are at the end of file/data + */ + int invoke(@NativeType("void *") long user); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIIOCallbacks.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIIOCallbacks.java new file mode 100644 index 00000000..1af86322 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIIOCallbacks.java @@ -0,0 +1,361 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Image IO callbacks, used by {@link STBImage#stbi_load_from_callbacks load_from_callbacks}. + * + *

Member documentation

+ * + *
    + *
  • {@code read} – fill {@code data} with {@code size} bytes. Return number of bytes actually read.
  • + *
  • {@code skip} – skip the next {@code n} bytes, or {@code unget} the last -n bytes if negative
  • + *
  • {@code eof} – returns nonzero if we are at end of file/data
  • + *
+ * + *

Layout

+ * + *

+ * struct stbi_io_callbacks {
+ *     int (*{@link STBIReadCallbackI read}) (void *user, char *data, int size);
+ *     void (*{@link STBISkipCallbackI skip}) (void *user, int n);
+ *     int (*{@link STBIEOFCallbackI eof}) (void *user);
+ * }
+ */ +@NativeType("struct stbi_io_callbacks") +public class STBIIOCallbacks extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + READ, + SKIP, + EOF; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + READ = layout.offsetof(0); + SKIP = layout.offsetof(1); + EOF = layout.offsetof(2); + } + + /** + * Creates a {@code STBIIOCallbacks} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public STBIIOCallbacks(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code read} field. */ + @NativeType("int (*) (void *, char *, int)") + public STBIReadCallback read() { return nread(address()); } + /** Returns the value of the {@code skip} field. */ + @NativeType("void (*) (void *, int)") + public STBISkipCallback skip() { return nskip(address()); } + /** Returns the value of the {@code eof} field. */ + @NativeType("int (*) (void *)") + public STBIEOFCallback eof() { return neof(address()); } + + /** Sets the specified value to the {@code read} field. */ + public STBIIOCallbacks read(@NativeType("int (*) (void *, char *, int)") STBIReadCallbackI value) { nread(address(), value); return this; } + /** Sets the specified value to the {@code skip} field. */ + public STBIIOCallbacks skip(@NativeType("void (*) (void *, int)") STBISkipCallbackI value) { nskip(address(), value); return this; } + /** Sets the specified value to the {@code eof} field. */ + public STBIIOCallbacks eof(@NativeType("int (*) (void *)") STBIEOFCallbackI value) { neof(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public STBIIOCallbacks set( + STBIReadCallbackI read, + STBISkipCallbackI skip, + STBIEOFCallbackI eof + ) { + read(read); + skip(skip); + eof(eof); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public STBIIOCallbacks set(STBIIOCallbacks src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code STBIIOCallbacks} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static STBIIOCallbacks malloc() { + return wrap(STBIIOCallbacks.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code STBIIOCallbacks} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static STBIIOCallbacks calloc() { + return wrap(STBIIOCallbacks.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code STBIIOCallbacks} instance allocated with {@link BufferUtils}. */ + public static STBIIOCallbacks create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(STBIIOCallbacks.class, memAddress(container), container); + } + + /** Returns a new {@code STBIIOCallbacks} instance for the specified memory address. */ + public static STBIIOCallbacks create(long address) { + return wrap(STBIIOCallbacks.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static STBIIOCallbacks createSafe(long address) { + return address == NULL ? null : wrap(STBIIOCallbacks.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code STBIIOCallbacks} instance allocated on the thread-local {@link MemoryStack}. */ + public static STBIIOCallbacks mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code STBIIOCallbacks} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static STBIIOCallbacks callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code STBIIOCallbacks} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static STBIIOCallbacks mallocStack(MemoryStack stack) { + return wrap(STBIIOCallbacks.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code STBIIOCallbacks} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static STBIIOCallbacks callocStack(MemoryStack stack) { + return wrap(STBIIOCallbacks.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #read}. */ + public static STBIReadCallback nread(long struct) { return STBIReadCallback.create(memGetAddress(struct + STBIIOCallbacks.READ)); } + /** Unsafe version of {@link #skip}. */ + public static STBISkipCallback nskip(long struct) { return STBISkipCallback.create(memGetAddress(struct + STBIIOCallbacks.SKIP)); } + /** Unsafe version of {@link #eof}. */ + public static STBIEOFCallback neof(long struct) { return STBIEOFCallback.create(memGetAddress(struct + STBIIOCallbacks.EOF)); } + + /** Unsafe version of {@link #read(STBIReadCallbackI) read}. */ + public static void nread(long struct, STBIReadCallbackI value) { memPutAddress(struct + STBIIOCallbacks.READ, value.address()); } + /** Unsafe version of {@link #skip(STBISkipCallbackI) skip}. */ + public static void nskip(long struct, STBISkipCallbackI value) { memPutAddress(struct + STBIIOCallbacks.SKIP, value.address()); } + /** Unsafe version of {@link #eof(STBIEOFCallbackI) eof}. */ + public static void neof(long struct, STBIEOFCallbackI value) { memPutAddress(struct + STBIIOCallbacks.EOF, value.address()); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + STBIIOCallbacks.READ)); + check(memGetAddress(struct + STBIIOCallbacks.SKIP)); + check(memGetAddress(struct + STBIIOCallbacks.EOF)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link STBIIOCallbacks} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final STBIIOCallbacks ELEMENT_FACTORY = STBIIOCallbacks.create(-1L); + + /** + * Creates a new {@code STBIIOCallbacks.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link STBIIOCallbacks#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected STBIIOCallbacks getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code read} field. */ + @NativeType("int (*) (void *, char *, int)") + public STBIReadCallback read() { return STBIIOCallbacks.nread(address()); } + /** Returns the value of the {@code skip} field. */ + @NativeType("void (*) (void *, int)") + public STBISkipCallback skip() { return STBIIOCallbacks.nskip(address()); } + /** Returns the value of the {@code eof} field. */ + @NativeType("int (*) (void *)") + public STBIEOFCallback eof() { return STBIIOCallbacks.neof(address()); } + + /** Sets the specified value to the {@code read} field. */ + public Buffer read(@NativeType("int (*) (void *, char *, int)") STBIReadCallbackI value) { STBIIOCallbacks.nread(address(), value); return this; } + /** Sets the specified value to the {@code skip} field. */ + public Buffer skip(@NativeType("void (*) (void *, int)") STBISkipCallbackI value) { STBIIOCallbacks.nskip(address(), value); return this; } + /** Sets the specified value to the {@code eof} field. */ + public Buffer eof(@NativeType("int (*) (void *)") STBIEOFCallbackI value) { STBIIOCallbacks.neof(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIReadCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIReadCallback.java new file mode 100644 index 00000000..a77cc7a6 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIReadCallback.java @@ -0,0 +1,93 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +import java.nio.*; + +/** + * Instances of this class may be set to the {@code read} field of the {@link STBIIOCallbacks} struct. + * + *

Type

+ * + *

+ * int (*) (
+ *     void *user,
+ *     char *data,
+ *     int size
+ * )
+ */ +public abstract class STBIReadCallback extends Callback implements STBIReadCallbackI { + + /** + * Creates a {@code STBIReadCallback} instance from the specified function pointer. + * + * @return the new {@code STBIReadCallback} + */ + public static STBIReadCallback create(long functionPointer) { + STBIReadCallbackI instance = Callback.get(functionPointer); + return instance instanceof STBIReadCallback + ? (STBIReadCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static STBIReadCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code STBIReadCallback} instance that delegates to the specified {@code STBIReadCallbackI} instance. */ + public static STBIReadCallback create(STBIReadCallbackI instance) { + return instance instanceof STBIReadCallback + ? (STBIReadCallback)instance + : new Container(instance.address(), instance); + } + + protected STBIReadCallback() { + super(SIGNATURE); + } + + STBIReadCallback(long functionPointer) { + super(functionPointer); + } + + /** + * Converts the specified {@link STBIReadCallback} arguments to a ByteBuffer. + * + *

This method may only be used inside a STBIReadCallback invocation.

+ * + * @param data the STBIReadCallback {@code data} argument + * @param size the STBIReadCallback {@code size} argument + * + * @return the data as a ByteBuffer + */ + public static ByteBuffer getData(long data, int size) { + return memByteBuffer(data, size); + } + + private static final class Container extends STBIReadCallback { + + private final STBIReadCallbackI delegate; + + Container(long functionPointer, STBIReadCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public int invoke(long user, long data, int size) { + return delegate.invoke(user, data, size); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIReadCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIReadCallbackI.java new file mode 100644 index 00000000..ff63a8df --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIReadCallbackI.java @@ -0,0 +1,53 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be set to the {@code read} field of the {@link STBIIOCallbacks} struct. + * + *

Type

+ * + *

+ * int (*) (
+ *     void *user,
+ *     char *data,
+ *     int size
+ * )
+ */ +@FunctionalInterface +@NativeType("int (*) (void *, char *, int)") +public interface STBIReadCallbackI extends CallbackI.I { + + String SIGNATURE = "(ppi)i"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default int callback(long args) { + return invoke( + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgInt(args) + ); + } + + /** + * The {@code stbi_io_callbacks.read} callback. + * + * @param user a pointer to user data + * @param data the data buffer to fill + * @param size the number of bytes to read + * + * @return the number of bytes actually read + */ + int invoke(@NativeType("void *") long user, @NativeType("char *") long data, int size); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBISkipCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBISkipCallback.java new file mode 100644 index 00000000..da867f9f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBISkipCallback.java @@ -0,0 +1,76 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Instances of this class may be set to the {@code skip} field of the {@link STBIIOCallbacks} struct. + * + *

Type

+ * + *

+ * void (*) (
+ *     void *user,
+ *     int n
+ * )
+ */ +public abstract class STBISkipCallback extends Callback implements STBISkipCallbackI { + + /** + * Creates a {@code STBISkipCallback} instance from the specified function pointer. + * + * @return the new {@code STBISkipCallback} + */ + public static STBISkipCallback create(long functionPointer) { + STBISkipCallbackI instance = Callback.get(functionPointer); + return instance instanceof STBISkipCallback + ? (STBISkipCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static STBISkipCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code STBISkipCallback} instance that delegates to the specified {@code STBISkipCallbackI} instance. */ + public static STBISkipCallback create(STBISkipCallbackI instance) { + return instance instanceof STBISkipCallback + ? (STBISkipCallback)instance + : new Container(instance.address(), instance); + } + + protected STBISkipCallback() { + super(SIGNATURE); + } + + STBISkipCallback(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends STBISkipCallback { + + private final STBISkipCallbackI delegate; + + Container(long functionPointer, STBISkipCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long user, int n) { + delegate.invoke(user, n); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBISkipCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBISkipCallbackI.java new file mode 100644 index 00000000..1e368495 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBISkipCallbackI.java @@ -0,0 +1,48 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be set to the {@code skip} field of the {@link STBIIOCallbacks} struct. + * + *

Type

+ * + *

+ * void (*) (
+ *     void *user,
+ *     int n
+ * )
+ */ +@FunctionalInterface +@NativeType("void (*) (void *, int)") +public interface STBISkipCallbackI extends CallbackI.V { + + String SIGNATURE = "(pi)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgPointer(args), + dcbArgInt(args) + ); + } + + /** + * The {@code stbi_io_callbacks.skip} callback. + * + * @param user a pointer to user data + * @param n the number of bytes to skip if positive, or unget the last {@code -n} bytes if negative + */ + void invoke(@NativeType("void *") long user, int n); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIWriteCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIWriteCallback.java new file mode 100644 index 00000000..9a21e5c2 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIWriteCallback.java @@ -0,0 +1,93 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +import java.nio.*; + +/** + * Instances of this class may be used with the {@link STBImageWrite} {@code write_type_to_func} functions. + * + *

Type

+ * + *

+ * void (*) (
+ *     void *context,
+ *     void *data,
+ *     int size
+ * )
+ */ +public abstract class STBIWriteCallback extends Callback implements STBIWriteCallbackI { + + /** + * Creates a {@code STBIWriteCallback} instance from the specified function pointer. + * + * @return the new {@code STBIWriteCallback} + */ + public static STBIWriteCallback create(long functionPointer) { + STBIWriteCallbackI instance = Callback.get(functionPointer); + return instance instanceof STBIWriteCallback + ? (STBIWriteCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static STBIWriteCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code STBIWriteCallback} instance that delegates to the specified {@code STBIWriteCallbackI} instance. */ + public static STBIWriteCallback create(STBIWriteCallbackI instance) { + return instance instanceof STBIWriteCallback + ? (STBIWriteCallback)instance + : new Container(instance.address(), instance); + } + + protected STBIWriteCallback() { + super(SIGNATURE); + } + + STBIWriteCallback(long functionPointer) { + super(functionPointer); + } + + /** + * Converts the specified {@link STBIWriteCallback} arguments to a ByteBuffer. + * + *

This method may only be used inside a STBIWriteCallback invocation.

+ * + * @param data the STBIWriteCallback {@code data} argument + * @param size the STBIWriteCallback {@code size} argument + * + * @return the data as a ByteBuffer + */ + public static ByteBuffer getData(long data, int size) { + return memByteBuffer(data, size); + } + + private static final class Container extends STBIWriteCallback { + + private final STBIWriteCallbackI delegate; + + Container(long functionPointer, STBIWriteCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long context, long data, int size) { + delegate.invoke(context, data, size); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIWriteCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIWriteCallbackI.java new file mode 100644 index 00000000..6b5442ac --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIWriteCallbackI.java @@ -0,0 +1,51 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be used with the {@link STBImageWrite} {@code write_type_to_func} functions. + * + *

Type

+ * + *

+ * void (*) (
+ *     void *context,
+ *     void *data,
+ *     int size
+ * )
+ */ +@FunctionalInterface +@NativeType("stbi_write_func *") +public interface STBIWriteCallbackI extends CallbackI.V { + + String SIGNATURE = "(ppi)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgInt(args) + ); + } + + /** + * The {@code stbi_write_func} callback. + * + * @param context the context passed to the write function + * @param data the data to write + * @param size the number of bytes in {@code data} + */ + void invoke(@NativeType("void *") long context, @NativeType("void *") long data, int size); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIZlibCompress.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIZlibCompress.java new file mode 100644 index 00000000..520f6186 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIZlibCompress.java @@ -0,0 +1,78 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Instances of this class may be set to {@link STBImageWrite#stbi_zlib_compress}. + * + *

Type

+ * + *

+ * unsigned char * (*) (
+ *     unsigned char *data,
+ *     int data_len,
+ *     int *out_len,
+ *     int quality
+ * )
+ */ +public abstract class STBIZlibCompress extends Callback implements STBIZlibCompressI { + + /** + * Creates a {@code STBIZlibCompress} instance from the specified function pointer. + * + * @return the new {@code STBIZlibCompress} + */ + public static STBIZlibCompress create(long functionPointer) { + STBIZlibCompressI instance = Callback.get(functionPointer); + return instance instanceof STBIZlibCompress + ? (STBIZlibCompress)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static STBIZlibCompress createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code STBIZlibCompress} instance that delegates to the specified {@code STBIZlibCompressI} instance. */ + public static STBIZlibCompress create(STBIZlibCompressI instance) { + return instance instanceof STBIZlibCompress + ? (STBIZlibCompress)instance + : new Container(instance.address(), instance); + } + + protected STBIZlibCompress() { + super(SIGNATURE); + } + + STBIZlibCompress(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends STBIZlibCompress { + + private final STBIZlibCompressI delegate; + + Container(long functionPointer, STBIZlibCompressI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public long invoke(long data, int data_len, long out_len, int quality) { + return delegate.invoke(data, data_len, out_len, quality); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIZlibCompressI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIZlibCompressI.java new file mode 100644 index 00000000..31e2ab5d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBIZlibCompressI.java @@ -0,0 +1,58 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be set to {@link STBImageWrite#stbi_zlib_compress}. + * + *

Type

+ * + *

+ * unsigned char * (*) (
+ *     unsigned char *data,
+ *     int data_len,
+ *     int *out_len,
+ *     int quality
+ * )
+ */ +@FunctionalInterface +@NativeType("unsigned char * (*) (unsigned char *, int, int *, int)") +public interface STBIZlibCompressI extends CallbackI.P { + + String SIGNATURE = "(pipi)p"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default long callback(long args) { + return invoke( + dcbArgPointer(args), + dcbArgInt(args), + dcbArgPointer(args), + dcbArgInt(args) + ); + } + + /** + * Compresses a block of data using Zlib compression. + * + *

The returned data will be freed with {@link MemoryUtil#memFree} so it must be heap allocated with {@link MemoryUtil#memAlloc}.

+ * + * @param data the data to compress + * @param data_len the data length, in bytes + * @param out_len returns the compressed data length, in bytes + * @param quality the compression quality to use + * + * @return the compressed data + */ + @NativeType("unsigned char *") long invoke(@NativeType("unsigned char *") long data, int data_len, @NativeType("int *") long out_len, int quality); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBImage.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBImage.java new file mode 100644 index 00000000..82c302b1 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBImage.java @@ -0,0 +1,1322 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to stb_image.h from the stb library. + * + *

Quick notes

+ * + *

Primarily of interest to game developers and other people who can avoid problematic images and only need the trivial interface. Supported formats:

+ * + *
    + *
  • JPEG baseline & progressive (12 bpc/arithmetic not supported, same as stock IJG lib
  • + *
  • PNG 1/2/4/8/16-bit-per-channel
  • + *
  • TGA (not sure what subset, if a subset)
  • + *
  • BMP non-1bpp, non-RLE
  • + *
  • PSD (composited view only, no extra channels, 8/16 bit-per-channel)
  • + *
  • GIF (*desired_channels always reports as 4-channel)
  • + *
  • HDR (radiance rgbE format)
  • + *
  • PIC (Softimage PIC)
  • + *
  • PNM (PPM and PGM binary only)
  • + *
+ * + *

Animated GIF still needs a proper API, but here's one way to do it.

+ * + *

Features:

+ * + *
    + *
  • decode from memory
  • + *
  • decode from arbitrary I/O callbacks
  • + *
  • SIMD acceleration on x86/x64 (SSE2) and ARM (NEON)
  • + *
+ * + *

Limitations:

+ * + *
    + *
  • no 12-bit-per-channel JPEG
  • + *
  • no JPEGs with arithmetic coding
  • + *
  • GIF always returns *channels_in_file=4
  • + *
+ * + *

Basic usage (see HDR discussion below for HDR usage):

+ * + *

+ * int x,y,n;
+ * unsigned char *data = stbi_load(filename, &x, &y, &n, 0);
+ * // ... process data if not NULL ...
+ * // ... x = width, y = height, n = # 8-bit components per pixel ...
+ * // ... replace '0' with '1'..'4' to force that many components per pixel
+ * // ... but 'n' will always be the number that it would have been if you said 0
+ * stbi_image_free(data)
+ * + *

HDR image support

+ * + *

stb_image supports loading HDR images in general, and currently the Radiance .HDR file format specifically. You can still load any file through the + * existing interface; if you attempt to load an HDR file, it will be automatically remapped to LDR, assuming gamma 2.2 and an arbitrary scale factor + * defaulting to 1; both of these constants can be reconfigured through this interface:

+ * + *

+ * stbi_hdr_to_ldr_gamma(2.2f);
+ * stbi_hdr_to_ldr_scale(1.0f);
+ * + *

(note, do not use inverse constants; stbi_image will invert them appropriately).

+ * + *

Additionally, there is a new, parallel interface for loading files as (linear) floats to preserve the full dynamic range:

+ * + *

+ * float *data = stbi_loadf(filename, &x, &y, &n, 0);
+ * + *

If you load LDR images through this interface, those images will be promoted to floating point values, run through the inverse of constants + * corresponding to the above:

+ * + *

+ * stbi_ldr_to_hdr_scale(1.0f);
+ * stbi_ldr_to_hdr_gamma(2.2f);
+ * + *

Finally, given a filename (or an open file or memory block) containing image data, you can query for the "most appropriate" interface to use (that is, + * whether the image is HDR or not), using:

+ * + *

+ * stbi_is_hdr(char *filename);
+ * + *

iPhone PNG support

+ * + *

By default we convert iphone-formatted PNGs back to RGB, even though they are internally encoded differently. You can disable this conversion by + * calling {@link #stbi_convert_iphone_png_to_rgb convert_iphone_png_to_rgb}(0), in which case you will always just get the native iphone "format" through (which is BGR stored in RGB).

+ * + *

Call {@link #stbi_set_unpremultiply_on_load set_unpremultiply_on_load}(1) as well to force a divide per pixel to remove any premultiplied alpha *only* if the image file explicitly says + * there's premultiplied data (currently only happens in iPhone images, and only if iPhone convert-to-rgb processing is on).

+ */ +public class STBImage { + + /** + * Component count. + * + *
Enum values:
+ * + *
    + *
  • {@link #STBI_default default} - Default component count, used as an argument to {@code desired_channels}.
  • + *
  • {@link #STBI_grey grey}
  • + *
  • {@link #STBI_grey_alpha grey_alpha}
  • + *
  • {@link #STBI_rgb rgb}
  • + *
  • {@link #STBI_rgb_alpha rgb_alpha}
  • + *
+ */ + public static final int + STBI_default = 0, + STBI_grey = 1, + STBI_grey_alpha = 2, + STBI_rgb = 3, + STBI_rgb_alpha = 4; + + static { LibSTB.initialize(); } + + protected STBImage() { + throw new UnsupportedOperationException(); + } + + // --- [ stbi_load ] --- + + /** Unsafe version of: {@link #stbi_load load} */ + public static native long nstbi_load(long filename, long x, long y, long channels_in_file, int desired_channels); + + /** + * Loads an image from the specified file. + * + *

The return value from an image loader is an {@code 'unsigned char *'} which points to the pixel data, or {@code NULL} on an allocation failure or if the image + * is corrupt or invalid. The pixel data consists of {@code *y} scanlines of {@code *x} pixels, with each pixel consisting of N interleaved 8-bit + * components; the first pixel pointed to is top-left-most in the image. There is no padding between image scanlines or between pixels, regardless of + * format. The number of components N is {@code 'desired_channels'} if {@code desired_channels} is non-zero, or {@code *channels_in_file} otherwise. If + * {@code desired_channels} is non-zero, {@code *channels_in_file} has the number of components that would have been output otherwise. E.g. if you + * set {@code desired_channels} to 4, you will always get RGBA output, but you can check {@code *channels_in_file} to see if it's trivially opaque because + * e.g. there were only 3 channels in the source image.

+ * + *

An output image with N components has the following components interleaved in this order in each pixel:

+ * + *

+     * N=#channels_in_file     components
+     *   1                     grey
+     *   2                     grey, alpha
+     *   3                     red, green, blue
+     *   4                     red, green, blue, alpha
+ * + *

If image loading fails for any reason, the return value will be {@code NULL}, and {@code *x}, {@code *y}, {@code *channels_in_file} will be unchanged. The + * function {@link #stbi_failure_reason failure_reason} can be queried for an extremely brief, end-user unfriendly explanation of why the load failed.

+ * + *

Paletted PNG, BMP, GIF, and PIC images are automatically depalettized.

+ * + * @param filename the file name + * @param x outputs the image width in pixels + * @param y outputs the image height in pixels + * @param channels_in_file outputs number of components in image + * @param desired_channels 0 or 1..4 to force that many components per pixel. One of:
01234
+ */ + @Nullable + @NativeType("stbi_uc *") + public static ByteBuffer stbi_load(@NativeType("char const *") ByteBuffer filename, @NativeType("int *") IntBuffer x, @NativeType("int *") IntBuffer y, @NativeType("int *") IntBuffer channels_in_file, int desired_channels) { + if (CHECKS) { + checkNT1(filename); + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + } + long __result = nstbi_load(memAddress(filename), memAddress(x), memAddress(y), memAddress(channels_in_file), desired_channels); + return memByteBufferSafe(__result, x.get(x.position()) * y.get(y.position()) * (desired_channels != 0 ? desired_channels : channels_in_file.get(channels_in_file.position()))); + } + + /** + * Loads an image from the specified file. + * + *

The return value from an image loader is an {@code 'unsigned char *'} which points to the pixel data, or {@code NULL} on an allocation failure or if the image + * is corrupt or invalid. The pixel data consists of {@code *y} scanlines of {@code *x} pixels, with each pixel consisting of N interleaved 8-bit + * components; the first pixel pointed to is top-left-most in the image. There is no padding between image scanlines or between pixels, regardless of + * format. The number of components N is {@code 'desired_channels'} if {@code desired_channels} is non-zero, or {@code *channels_in_file} otherwise. If + * {@code desired_channels} is non-zero, {@code *channels_in_file} has the number of components that would have been output otherwise. E.g. if you + * set {@code desired_channels} to 4, you will always get RGBA output, but you can check {@code *channels_in_file} to see if it's trivially opaque because + * e.g. there were only 3 channels in the source image.

+ * + *

An output image with N components has the following components interleaved in this order in each pixel:

+ * + *

+     * N=#channels_in_file     components
+     *   1                     grey
+     *   2                     grey, alpha
+     *   3                     red, green, blue
+     *   4                     red, green, blue, alpha
+ * + *

If image loading fails for any reason, the return value will be {@code NULL}, and {@code *x}, {@code *y}, {@code *channels_in_file} will be unchanged. The + * function {@link #stbi_failure_reason failure_reason} can be queried for an extremely brief, end-user unfriendly explanation of why the load failed.

+ * + *

Paletted PNG, BMP, GIF, and PIC images are automatically depalettized.

+ * + * @param filename the file name + * @param x outputs the image width in pixels + * @param y outputs the image height in pixels + * @param channels_in_file outputs number of components in image + * @param desired_channels 0 or 1..4 to force that many components per pixel. One of:
01234
+ */ + @Nullable + @NativeType("stbi_uc *") + public static ByteBuffer stbi_load(@NativeType("char const *") CharSequence filename, @NativeType("int *") IntBuffer x, @NativeType("int *") IntBuffer y, @NativeType("int *") IntBuffer channels_in_file, int desired_channels) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(filename, true); + long filenameEncoded = stack.getPointerAddress(); + long __result = nstbi_load(filenameEncoded, memAddress(x), memAddress(y), memAddress(channels_in_file), desired_channels); + return memByteBufferSafe(__result, x.get(x.position()) * y.get(y.position()) * (desired_channels != 0 ? desired_channels : channels_in_file.get(channels_in_file.position()))); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stbi_load_from_memory ] --- + + /** + * Unsafe version of: {@link #stbi_load_from_memory load_from_memory} + * + * @param len the buffer length, in bytes + */ + public static native long nstbi_load_from_memory(long buffer, int len, long x, long y, long channels_in_file, int desired_channels); + + /** + * In-memory version of {@link #stbi_load load}. + * + * @param buffer the buffer from which to load the image data + * @param x outputs the image width in pixels + * @param y outputs the image height in pixels + * @param channels_in_file outputs number of components in image + * @param desired_channels 0 or 1..4 to force that many components per pixel. One of:
01234
+ */ + @Nullable + @NativeType("stbi_uc *") + public static ByteBuffer stbi_load_from_memory(@NativeType("stbi_uc const *") ByteBuffer buffer, @NativeType("int *") IntBuffer x, @NativeType("int *") IntBuffer y, @NativeType("int *") IntBuffer channels_in_file, int desired_channels) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + } + long __result = nstbi_load_from_memory(memAddress(buffer), buffer.remaining(), memAddress(x), memAddress(y), memAddress(channels_in_file), desired_channels); + return memByteBufferSafe(__result, x.get(x.position()) * y.get(y.position()) * (desired_channels != 0 ? desired_channels : channels_in_file.get(channels_in_file.position()))); + } + + // --- [ stbi_load_from_callbacks ] --- + + /** Unsafe version of: {@link #stbi_load_from_callbacks load_from_callbacks} */ + public static native long nstbi_load_from_callbacks(long clbk, long user, long x, long y, long channels_in_file, int desired_channels); + + /** + * Callback version of {@link #stbi_load load}. + * + *

I/O callbacks allow you to read from arbitrary sources, like packaged files or some other source. Data read from callbacks are processed through a + * small internal buffer (currently 128 bytes) to try to reduce overhead.

+ * + *

The three functions you must define are "read" (reads some bytes of data), "skip" (skips some bytes of data), "eof" (reports if the stream is at the + * end).

+ * + * @param clbk an {@link STBIIOCallbacks} struct + * @param user a pointer to user data + * @param x outputs the image width in pixels + * @param y outputs the image height in pixels + * @param channels_in_file outputs number of components in image + * @param desired_channels 0 or 1..4 to force that many components per pixel. One of:
01234
+ */ + @Nullable + @NativeType("stbi_uc *") + public static ByteBuffer stbi_load_from_callbacks(@NativeType("stbi_io_callbacks const *") STBIIOCallbacks clbk, @NativeType("void *") long user, @NativeType("int *") IntBuffer x, @NativeType("int *") IntBuffer y, @NativeType("int *") IntBuffer channels_in_file, int desired_channels) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + STBIIOCallbacks.validate(clbk.address()); + } + long __result = nstbi_load_from_callbacks(clbk.address(), user, memAddress(x), memAddress(y), memAddress(channels_in_file), desired_channels); + return memByteBufferSafe(__result, x.get(x.position()) * y.get(y.position()) * (desired_channels != 0 ? desired_channels : channels_in_file.get(channels_in_file.position()))); + } + + // --- [ stbi_load_gif_from_memory ] --- + + /** + * Unsafe version of: {@link #stbi_load_gif_from_memory load_gif_from_memory} + * + * @param len the buffer length, in bytes + */ + public static native long nstbi_load_gif_from_memory(long buffer, int len, long delays, long x, long y, long z, long channels_in_file, int desired_channels); + + /** + * gif version of {@link #stbi_load_from_memory load_from_memory}. + * + * @param buffer the buffer from which to load the image data + * @param delays output the delays of each layer in the image + * @param x outputs the image width in pixels + * @param y outputs the image height in pixels + * @param z outputs the number of layers in the image + * @param channels_in_file outputs number of components in image + * @param desired_channels 0 or 1..4 to force that many components per pixel. One of:
01234
+ */ + @Nullable + @NativeType("stbi_uc *") + public static ByteBuffer stbi_load_gif_from_memory(@NativeType("stbi_uc const *") ByteBuffer buffer, @NativeType("int **") PointerBuffer delays, @NativeType("int *") IntBuffer x, @NativeType("int *") IntBuffer y, @NativeType("int *") IntBuffer z, @NativeType("int *") IntBuffer channels_in_file, int desired_channels) { + if (CHECKS) { + check(delays, 1); + check(x, 1); + check(y, 1); + check(z, 1); + check(channels_in_file, 1); + } + long __result = nstbi_load_gif_from_memory(memAddress(buffer), buffer.remaining(), memAddress(delays), memAddress(x), memAddress(y), memAddress(z), memAddress(channels_in_file), desired_channels); + return memByteBufferSafe(__result, x.get(x.position()) * y.get(y.position()) * z.get(z.position()) * (desired_channels != 0 ? desired_channels : channels_in_file.get(channels_in_file.position()))); + } + + // --- [ stbi_load_16 ] --- + + /** Unsafe version of: {@link #stbi_load_16 load_16} */ + public static native long nstbi_load_16(long filename, long x, long y, long channels_in_file, int desired_channels); + + /** + * 16-bits-per-channel version of {@link #stbi_load load}. + * + * @param filename the file name + * @param x outputs the image width in pixels + * @param y outputs the image height in pixels + * @param channels_in_file outputs number of components in image + * @param desired_channels 0 or 1..4 to force that many components per pixel. One of:
01234
+ */ + @Nullable + @NativeType("stbi_us *") + public static ShortBuffer stbi_load_16(@NativeType("char const *") ByteBuffer filename, @NativeType("int *") IntBuffer x, @NativeType("int *") IntBuffer y, @NativeType("int *") IntBuffer channels_in_file, int desired_channels) { + if (CHECKS) { + checkNT1(filename); + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + } + long __result = nstbi_load_16(memAddress(filename), memAddress(x), memAddress(y), memAddress(channels_in_file), desired_channels); + return memShortBufferSafe(__result, x.get(x.position()) * y.get(y.position()) * (desired_channels != 0 ? desired_channels : channels_in_file.get(channels_in_file.position()))); + } + + /** + * 16-bits-per-channel version of {@link #stbi_load load}. + * + * @param filename the file name + * @param x outputs the image width in pixels + * @param y outputs the image height in pixels + * @param channels_in_file outputs number of components in image + * @param desired_channels 0 or 1..4 to force that many components per pixel. One of:
01234
+ */ + @Nullable + @NativeType("stbi_us *") + public static ShortBuffer stbi_load_16(@NativeType("char const *") CharSequence filename, @NativeType("int *") IntBuffer x, @NativeType("int *") IntBuffer y, @NativeType("int *") IntBuffer channels_in_file, int desired_channels) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(filename, true); + long filenameEncoded = stack.getPointerAddress(); + long __result = nstbi_load_16(filenameEncoded, memAddress(x), memAddress(y), memAddress(channels_in_file), desired_channels); + return memShortBufferSafe(__result, x.get(x.position()) * y.get(y.position()) * (desired_channels != 0 ? desired_channels : channels_in_file.get(channels_in_file.position()))); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stbi_load_16_from_memory ] --- + + /** + * Unsafe version of: {@link #stbi_load_16_from_memory load_16_from_memory} + * + * @param len the buffer length, in bytes + */ + public static native long nstbi_load_16_from_memory(long buffer, int len, long x, long y, long channels_in_file, int desired_channels); + + /** + * In-memory version of {@link #stbi_load_16 load_16}. + * + * @param buffer the buffer from which to load the image data + * @param x outputs the image width in pixels + * @param y outputs the image height in pixels + * @param channels_in_file outputs number of components in image + * @param desired_channels 0 or 1..4 to force that many components per pixel. One of:
01234
+ */ + @Nullable + @NativeType("stbi_us *") + public static ShortBuffer stbi_load_16_from_memory(@NativeType("stbi_uc const *") ByteBuffer buffer, @NativeType("int *") IntBuffer x, @NativeType("int *") IntBuffer y, @NativeType("int *") IntBuffer channels_in_file, int desired_channels) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + } + long __result = nstbi_load_16_from_memory(memAddress(buffer), buffer.remaining(), memAddress(x), memAddress(y), memAddress(channels_in_file), desired_channels); + return memShortBufferSafe(__result, x.get(x.position()) * y.get(y.position()) * (desired_channels != 0 ? desired_channels : channels_in_file.get(channels_in_file.position()))); + } + + // --- [ stbi_load_16_from_callbacks ] --- + + /** Unsafe version of: {@link #stbi_load_16_from_callbacks load_16_from_callbacks} */ + public static native long nstbi_load_16_from_callbacks(long clbk, long user, long x, long y, long channels_in_file, int desired_channels); + + /** + * Callback version of {@link #stbi_load_16 load_16}. + * + * @param clbk an {@link STBIIOCallbacks} struct + * @param user a pointer to user data + * @param x outputs the image width in pixels + * @param y outputs the image height in pixels + * @param channels_in_file outputs number of components in image + * @param desired_channels 0 or 1..4 to force that many components per pixel. One of:
01234
+ */ + @Nullable + @NativeType("stbi_us *") + public static ShortBuffer stbi_load_16_from_callbacks(@NativeType("stbi_io_callbacks const *") STBIIOCallbacks clbk, @NativeType("void *") long user, @NativeType("int *") IntBuffer x, @NativeType("int *") IntBuffer y, @NativeType("int *") IntBuffer channels_in_file, int desired_channels) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + STBIIOCallbacks.validate(clbk.address()); + } + long __result = nstbi_load_16_from_callbacks(clbk.address(), user, memAddress(x), memAddress(y), memAddress(channels_in_file), desired_channels); + return memShortBufferSafe(__result, x.get(x.position()) * y.get(y.position()) * (desired_channels != 0 ? desired_channels : channels_in_file.get(channels_in_file.position()))); + } + + // --- [ stbi_loadf ] --- + + /** Unsafe version of: {@link #stbi_loadf loadf} */ + public static native long nstbi_loadf(long filename, long x, long y, long channels_in_file, int desired_channels); + + /** + * Floating-point version of {@link #stbi_load load}. + * + * @param filename the file name + * @param x outputs the image width in pixels + * @param y outputs the image height in pixels + * @param channels_in_file outputs number of components in image + * @param desired_channels 0 or 1..4 to force that many components per pixel. One of:
01234
+ */ + @Nullable + @NativeType("float *") + public static FloatBuffer stbi_loadf(@NativeType("char const *") ByteBuffer filename, @NativeType("int *") IntBuffer x, @NativeType("int *") IntBuffer y, @NativeType("int *") IntBuffer channels_in_file, int desired_channels) { + if (CHECKS) { + checkNT1(filename); + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + } + long __result = nstbi_loadf(memAddress(filename), memAddress(x), memAddress(y), memAddress(channels_in_file), desired_channels); + return memFloatBufferSafe(__result, x.get(x.position()) * y.get(y.position()) * (desired_channels != 0 ? desired_channels : channels_in_file.get(channels_in_file.position()))); + } + + /** + * Floating-point version of {@link #stbi_load load}. + * + * @param filename the file name + * @param x outputs the image width in pixels + * @param y outputs the image height in pixels + * @param channels_in_file outputs number of components in image + * @param desired_channels 0 or 1..4 to force that many components per pixel. One of:
01234
+ */ + @Nullable + @NativeType("float *") + public static FloatBuffer stbi_loadf(@NativeType("char const *") CharSequence filename, @NativeType("int *") IntBuffer x, @NativeType("int *") IntBuffer y, @NativeType("int *") IntBuffer channels_in_file, int desired_channels) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(filename, true); + long filenameEncoded = stack.getPointerAddress(); + long __result = nstbi_loadf(filenameEncoded, memAddress(x), memAddress(y), memAddress(channels_in_file), desired_channels); + return memFloatBufferSafe(__result, x.get(x.position()) * y.get(y.position()) * (desired_channels != 0 ? desired_channels : channels_in_file.get(channels_in_file.position()))); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stbi_loadf_from_memory ] --- + + /** + * Unsafe version of: {@link #stbi_loadf_from_memory loadf_from_memory} + * + * @param len the buffer length, in bytes + */ + public static native long nstbi_loadf_from_memory(long buffer, int len, long x, long y, long channels_in_file, int desired_channels); + + /** + * Floating-point version of {@link #stbi_load_from_memory load_from_memory}. + * + * @param buffer the buffer from which to load the image data + * @param x outputs the image width in pixels + * @param y outputs the image height in pixels + * @param channels_in_file outputs number of components in image + * @param desired_channels 0 or 1..4 to force that many components per pixel. One of:
01234
+ */ + @Nullable + @NativeType("float *") + public static FloatBuffer stbi_loadf_from_memory(@NativeType("stbi_uc const *") ByteBuffer buffer, @NativeType("int *") IntBuffer x, @NativeType("int *") IntBuffer y, @NativeType("int *") IntBuffer channels_in_file, int desired_channels) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + } + long __result = nstbi_loadf_from_memory(memAddress(buffer), buffer.remaining(), memAddress(x), memAddress(y), memAddress(channels_in_file), desired_channels); + return memFloatBufferSafe(__result, x.get(x.position()) * y.get(y.position()) * (desired_channels != 0 ? desired_channels : channels_in_file.get(channels_in_file.position()))); + } + + // --- [ stbi_loadf_from_callbacks ] --- + + /** Unsafe version of: {@link #stbi_loadf_from_callbacks loadf_from_callbacks} */ + public static native long nstbi_loadf_from_callbacks(long clbk, long user, long x, long y, long channels_in_file, int desired_channels); + + /** + * Floating-point version of {@link #stbi_load_from_callbacks load_from_callbacks}. + * + * @param clbk an {@link STBIIOCallbacks} struct + * @param user a pointer to user data + * @param x outputs the image width in pixels + * @param y outputs the image height in pixels + * @param channels_in_file outputs number of components in image + * @param desired_channels 0 or 1..4 to force that many components per pixel. One of:
01234
+ */ + @Nullable + @NativeType("float *") + public static FloatBuffer stbi_loadf_from_callbacks(@NativeType("stbi_io_callbacks const *") STBIIOCallbacks clbk, @NativeType("void *") long user, @NativeType("int *") IntBuffer x, @NativeType("int *") IntBuffer y, @NativeType("int *") IntBuffer channels_in_file, int desired_channels) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + STBIIOCallbacks.validate(clbk.address()); + } + long __result = nstbi_loadf_from_callbacks(clbk.address(), user, memAddress(x), memAddress(y), memAddress(channels_in_file), desired_channels); + return memFloatBufferSafe(__result, x.get(x.position()) * y.get(y.position()) * (desired_channels != 0 ? desired_channels : channels_in_file.get(channels_in_file.position()))); + } + + // --- [ stbi_hdr_to_ldr_gamma ] --- + + /** + * Changes the gamma value used when converting HDR images to LDR. The default value is 2.2f + * + * @param gamma the gamma value + */ + public static native void stbi_hdr_to_ldr_gamma(float gamma); + + // --- [ stbi_hdr_to_ldr_scale ] --- + + /** + * Changes the scale factor used when converting HDR images to LDR. The default value is 1.0f + * + * @param scale the scale factor + */ + public static native void stbi_hdr_to_ldr_scale(float scale); + + // --- [ stbi_ldr_to_hdr_gamma ] --- + + /** + * Changes the gamma value used when converting LDR images to HDR. The default value is 2.2f + * + * @param gamma the gamma value + */ + public static native void stbi_ldr_to_hdr_gamma(float gamma); + + // --- [ stbi_ldr_to_hdr_scale ] --- + + /** + * Changes the scale value used when converting LDR images to HDR. The default value is 1.0f + * + * @param scale the scale factor + */ + public static native void stbi_ldr_to_hdr_scale(float scale); + + // --- [ stbi_is_hdr ] --- + + /** Unsafe version of: {@link #stbi_is_hdr is_hdr} */ + public static native int nstbi_is_hdr(long filename); + + /** + * Checks if the specified file contains an HDR image. + * + * @param filename the file name + * + * @return 1 if the image is HDR, 0 otherwise + */ + @NativeType("int") + public static boolean stbi_is_hdr(@NativeType("char const *") ByteBuffer filename) { + if (CHECKS) { + checkNT1(filename); + } + return nstbi_is_hdr(memAddress(filename)) != 0; + } + + /** + * Checks if the specified file contains an HDR image. + * + * @param filename the file name + * + * @return 1 if the image is HDR, 0 otherwise + */ + @NativeType("int") + public static boolean stbi_is_hdr(@NativeType("char const *") CharSequence filename) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(filename, true); + long filenameEncoded = stack.getPointerAddress(); + return nstbi_is_hdr(filenameEncoded) != 0; + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stbi_is_hdr_from_memory ] --- + + /** + * Unsafe version of: {@link #stbi_is_hdr_from_memory is_hdr_from_memory} + * + * @param len the buffer length, in bytes + */ + public static native int nstbi_is_hdr_from_memory(long buffer, int len); + + /** + * In-memory version of {@link #stbi_is_hdr is_hdr}. + * + * @param buffer the buffer from which to load the image data + */ + @NativeType("int") + public static boolean stbi_is_hdr_from_memory(@NativeType("stbi_uc const *") ByteBuffer buffer) { + return nstbi_is_hdr_from_memory(memAddress(buffer), buffer.remaining()) != 0; + } + + // --- [ stbi_is_hdr_from_callbacks ] --- + + /** Unsafe version of: {@link #stbi_is_hdr_from_callbacks is_hdr_from_callbacks} */ + public static native int nstbi_is_hdr_from_callbacks(long clbk, long user); + + /** + * Callback version of {@link #stbi_is_hdr is_hdr}. + * + * @param clbk an {@link STBIIOCallbacks} struct + * @param user a pointer to user data + */ + @NativeType("int") + public static boolean stbi_is_hdr_from_callbacks(@NativeType("stbi_io_callbacks const *") STBIIOCallbacks clbk, @NativeType("void *") long user) { + if (CHECKS) { + STBIIOCallbacks.validate(clbk.address()); + } + return nstbi_is_hdr_from_callbacks(clbk.address(), user) != 0; + } + + // --- [ stbi_failure_reason ] --- + + /** Unsafe version of: {@link #stbi_failure_reason failure_reason} */ + public static native long nstbi_failure_reason(); + + /** Returns a brief reason for failure. */ + @Nullable + @NativeType("char const *") + public static String stbi_failure_reason() { + long __result = nstbi_failure_reason(); + return memASCIISafe(__result); + } + + // --- [ stbi_image_free ] --- + + /** Unsafe version of: {@link #stbi_image_free image_free} */ + public static native void nstbi_image_free(long retval_from_stbi_load); + + /** + * Frees a loaded image + * + * @param retval_from_stbi_load an stb image + */ + public static void stbi_image_free(@NativeType("void *") ByteBuffer retval_from_stbi_load) { + nstbi_image_free(memAddress(retval_from_stbi_load)); + } + + /** + * Frees a loaded image + * + * @param retval_from_stbi_load an stb image + */ + public static void stbi_image_free(@NativeType("void *") ShortBuffer retval_from_stbi_load) { + nstbi_image_free(memAddress(retval_from_stbi_load)); + } + + /** + * Frees a loaded image + * + * @param retval_from_stbi_load an stb image + */ + public static void stbi_image_free(@NativeType("void *") FloatBuffer retval_from_stbi_load) { + nstbi_image_free(memAddress(retval_from_stbi_load)); + } + + // --- [ stbi_info ] --- + + /** Unsafe version of: {@link #stbi_info info} */ + public static native int nstbi_info(long filename, long x, long y, long comp); + + /** + * Returns image dimensions & components without fully decoding the image. + * + * @param filename the file name + * @param x outputs the image width in pixels + * @param y outputs the image height in pixels + * @param comp outputs number of components in image + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbi_info(@NativeType("char const *") ByteBuffer filename, @NativeType("int *") IntBuffer x, @NativeType("int *") IntBuffer y, @NativeType("int *") IntBuffer comp) { + if (CHECKS) { + checkNT1(filename); + check(x, 1); + check(y, 1); + check(comp, 1); + } + return nstbi_info(memAddress(filename), memAddress(x), memAddress(y), memAddress(comp)) != 0; + } + + /** + * Returns image dimensions & components without fully decoding the image. + * + * @param filename the file name + * @param x outputs the image width in pixels + * @param y outputs the image height in pixels + * @param comp outputs number of components in image + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbi_info(@NativeType("char const *") CharSequence filename, @NativeType("int *") IntBuffer x, @NativeType("int *") IntBuffer y, @NativeType("int *") IntBuffer comp) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(comp, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(filename, true); + long filenameEncoded = stack.getPointerAddress(); + return nstbi_info(filenameEncoded, memAddress(x), memAddress(y), memAddress(comp)) != 0; + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stbi_info_from_memory ] --- + + /** + * Unsafe version of: {@link #stbi_info_from_memory info_from_memory} + * + * @param len the buffer length, in bytes + */ + public static native int nstbi_info_from_memory(long buffer, int len, long x, long y, long comp); + + /** + * In-memory version of {@link #stbi_info info}. + * + * @param buffer the buffer from which to load the image data + * @param x outputs the image width in pixels + * @param y outputs the image height in pixels + * @param comp outputs number of components in image + */ + @NativeType("int") + public static boolean stbi_info_from_memory(@NativeType("stbi_uc const *") ByteBuffer buffer, @NativeType("int *") IntBuffer x, @NativeType("int *") IntBuffer y, @NativeType("int *") IntBuffer comp) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(comp, 1); + } + return nstbi_info_from_memory(memAddress(buffer), buffer.remaining(), memAddress(x), memAddress(y), memAddress(comp)) != 0; + } + + // --- [ stbi_info_from_callbacks ] --- + + /** Unsafe version of: {@link #stbi_info_from_callbacks info_from_callbacks} */ + public static native int nstbi_info_from_callbacks(long clbk, long user, long x, long y, long comp); + + /** + * Callback version of {@link #stbi_info info}. + * + * @param clbk an {@link STBIIOCallbacks} struct + * @param user a pointer to user data + * @param x outputs the image width in pixels + * @param y outputs the image height in pixels + * @param comp outputs number of components in image + */ + @NativeType("int") + public static boolean stbi_info_from_callbacks(@NativeType("stbi_io_callbacks const *") STBIIOCallbacks clbk, @NativeType("void *") long user, @NativeType("int *") IntBuffer x, @NativeType("int *") IntBuffer y, @NativeType("int *") IntBuffer comp) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(comp, 1); + STBIIOCallbacks.validate(clbk.address()); + } + return nstbi_info_from_callbacks(clbk.address(), user, memAddress(x), memAddress(y), memAddress(comp)) != 0; + } + + // --- [ stbi_is_16_bit ] --- + + /** Unsafe version of: {@link #stbi_is_16_bit is_16_bit} */ + public static native int nstbi_is_16_bit(long filename); + + /** + * Returns {@code true} if the file contains a 16-bit image. + * + * @param filename the file name + */ + @NativeType("int") + public static boolean stbi_is_16_bit(@NativeType("char const *") ByteBuffer filename) { + if (CHECKS) { + checkNT1(filename); + } + return nstbi_is_16_bit(memAddress(filename)) != 0; + } + + /** + * Returns {@code true} if the file contains a 16-bit image. + * + * @param filename the file name + */ + @NativeType("int") + public static boolean stbi_is_16_bit(@NativeType("char const *") CharSequence filename) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(filename, true); + long filenameEncoded = stack.getPointerAddress(); + return nstbi_is_16_bit(filenameEncoded) != 0; + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stbi_is_16_bit_from_memory ] --- + + /** + * Unsafe version of: {@link #stbi_is_16_bit_from_memory is_16_bit_from_memory} + * + * @param len the buffer length, in bytes + */ + public static native int nstbi_is_16_bit_from_memory(long buffer, int len); + + /** + * In-memory version of {@link #stbi_is_16_bit is_16_bit}. + * + * @param buffer the buffer from which to load the image data + */ + @NativeType("int") + public static boolean stbi_is_16_bit_from_memory(@NativeType("stbi_uc const *") ByteBuffer buffer) { + return nstbi_is_16_bit_from_memory(memAddress(buffer), buffer.remaining()) != 0; + } + + // --- [ stbi_is_16_bit_from_callbacks ] --- + + /** Unsafe version of: {@link #stbi_is_16_bit_from_callbacks is_16_bit_from_callbacks} */ + public static native int nstbi_is_16_bit_from_callbacks(long clbk, long user); + + /** + * Callback version of {@link #stbi_is_16_bit is_16_bit}. + * + * @param clbk an {@link STBIIOCallbacks} struct + * @param user a pointer to user data + */ + @NativeType("int") + public static boolean stbi_is_16_bit_from_callbacks(@NativeType("stbi_io_callbacks const *") STBIIOCallbacks clbk, @NativeType("void *") long user) { + if (CHECKS) { + STBIIOCallbacks.validate(clbk.address()); + } + return nstbi_is_16_bit_from_callbacks(clbk.address(), user) != 0; + } + + // --- [ stbi_set_unpremultiply_on_load ] --- + + /** Unsafe version of: {@link #stbi_set_unpremultiply_on_load set_unpremultiply_on_load} */ + public static native void nstbi_set_unpremultiply_on_load(int flag_true_if_should_unpremultiply); + + /** + * For image formats that explicitly notate that they have premultiplied alpha, we just return the colors as stored in the file. Set this flag to force + * unpremultiplication. Results are undefined if the unpremultiply overflows. + * + * @param flag_true_if_should_unpremultiply the unpremultiply flag + */ + public static void stbi_set_unpremultiply_on_load(@NativeType("int") boolean flag_true_if_should_unpremultiply) { + nstbi_set_unpremultiply_on_load(flag_true_if_should_unpremultiply ? 1 : 0); + } + + // --- [ stbi_convert_iphone_png_to_rgb ] --- + + /** Unsafe version of: {@link #stbi_convert_iphone_png_to_rgb convert_iphone_png_to_rgb} */ + public static native void nstbi_convert_iphone_png_to_rgb(int flag_true_if_should_convert); + + /** + * Indicate whether we should process iPhone images back to canonical format, or just pass them through "as-is". + * + * @param flag_true_if_should_convert the convert iPhone PNG to RGB flag + */ + public static void stbi_convert_iphone_png_to_rgb(@NativeType("int") boolean flag_true_if_should_convert) { + nstbi_convert_iphone_png_to_rgb(flag_true_if_should_convert ? 1 : 0); + } + + // --- [ stbi_set_flip_vertically_on_load ] --- + + /** Unsafe version of: {@link #stbi_set_flip_vertically_on_load set_flip_vertically_on_load} */ + public static native void nstbi_set_flip_vertically_on_load(int flag_true_if_should_flip); + + /** + * Flips the image vertically, so the first pixel in the output array is the bottom left. + * + * @param flag_true_if_should_flip the flip vertically on load flag + */ + public static void stbi_set_flip_vertically_on_load(@NativeType("int") boolean flag_true_if_should_flip) { + nstbi_set_flip_vertically_on_load(flag_true_if_should_flip ? 1 : 0); + } + + // --- [ stbi_zlib_decode_malloc_guesssize ] --- + + /** Unsafe version of: {@link #stbi_zlib_decode_malloc_guesssize zlib_decode_malloc_guesssize} */ + public static native long nstbi_zlib_decode_malloc_guesssize(long buffer, int len, int initial_size, long outlen); + + /** ZLIB client - used by PNG, available for other purposes */ + @Nullable + @NativeType("char *") + public static ByteBuffer stbi_zlib_decode_malloc_guesssize(@NativeType("char const *") ByteBuffer buffer, int initial_size) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer outlen = stack.callocInt(1); + long __result = nstbi_zlib_decode_malloc_guesssize(memAddress(buffer), buffer.remaining(), initial_size, memAddress(outlen)); + return memByteBufferSafe(__result, outlen.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stbi_zlib_decode_malloc_guesssize_headerflag ] --- + + /** Unsafe version of: {@link #stbi_zlib_decode_malloc_guesssize_headerflag zlib_decode_malloc_guesssize_headerflag} */ + public static native long nstbi_zlib_decode_malloc_guesssize_headerflag(long buffer, int len, int initial_size, long outlen, int parse_header); + + /** ZLIB client - used by PNG, available for other purposes */ + @Nullable + @NativeType("char *") + public static ByteBuffer stbi_zlib_decode_malloc_guesssize_headerflag(@NativeType("char const *") ByteBuffer buffer, int initial_size, @NativeType("int") boolean parse_header) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer outlen = stack.callocInt(1); + long __result = nstbi_zlib_decode_malloc_guesssize_headerflag(memAddress(buffer), buffer.remaining(), initial_size, memAddress(outlen), parse_header ? 1 : 0); + return memByteBufferSafe(__result, outlen.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stbi_zlib_decode_malloc ] --- + + /** Unsafe version of: {@link #stbi_zlib_decode_malloc zlib_decode_malloc} */ + public static native long nstbi_zlib_decode_malloc(long buffer, int len, long outlen); + + /** ZLIB client - used by PNG, available for other purposes */ + @Nullable + @NativeType("char *") + public static ByteBuffer stbi_zlib_decode_malloc(@NativeType("char const *") ByteBuffer buffer) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer outlen = stack.callocInt(1); + long __result = nstbi_zlib_decode_malloc(memAddress(buffer), buffer.remaining(), memAddress(outlen)); + return memByteBufferSafe(__result, outlen.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stbi_zlib_decode_buffer ] --- + + /** Unsafe version of: {@link #stbi_zlib_decode_buffer zlib_decode_buffer} */ + public static native int nstbi_zlib_decode_buffer(long obuffer, int olen, long ibuffer, int ilen); + + /** ZLIB client - used by PNG, available for other purposes */ + public static int stbi_zlib_decode_buffer(@NativeType("char *") ByteBuffer obuffer, @NativeType("char const *") ByteBuffer ibuffer) { + return nstbi_zlib_decode_buffer(memAddress(obuffer), obuffer.remaining(), memAddress(ibuffer), ibuffer.remaining()); + } + + // --- [ stbi_zlib_decode_noheader_malloc ] --- + + /** Unsafe version of: {@link #stbi_zlib_decode_noheader_malloc zlib_decode_noheader_malloc} */ + public static native long nstbi_zlib_decode_noheader_malloc(long buffer, int len, long outlen); + + /** ZLIB client - used by PNG, available for other purposes */ + @Nullable + @NativeType("char *") + public static ByteBuffer stbi_zlib_decode_noheader_malloc(@NativeType("char const *") ByteBuffer buffer) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer outlen = stack.callocInt(1); + long __result = nstbi_zlib_decode_noheader_malloc(memAddress(buffer), buffer.remaining(), memAddress(outlen)); + return memByteBufferSafe(__result, outlen.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stbi_zlib_decode_noheader_buffer ] --- + + /** Unsafe version of: {@link #stbi_zlib_decode_noheader_buffer zlib_decode_noheader_buffer} */ + public static native int nstbi_zlib_decode_noheader_buffer(long obuffer, int olen, long ibuffer, int ilen); + + /** ZLIB client - used by PNG, available for other purposes */ + public static int stbi_zlib_decode_noheader_buffer(@NativeType("char *") ByteBuffer obuffer, @NativeType("char const *") ByteBuffer ibuffer) { + return nstbi_zlib_decode_noheader_buffer(memAddress(obuffer), obuffer.remaining(), memAddress(ibuffer), ibuffer.remaining()); + } + + /** Array version of: {@link #nstbi_load} */ + public static native long nstbi_load(long filename, int[] x, int[] y, int[] channels_in_file, int desired_channels); + + /** Array version of: {@link #stbi_load load} */ + @Nullable + @NativeType("stbi_uc *") + public static ByteBuffer stbi_load(@NativeType("char const *") ByteBuffer filename, @NativeType("int *") int[] x, @NativeType("int *") int[] y, @NativeType("int *") int[] channels_in_file, int desired_channels) { + if (CHECKS) { + checkNT1(filename); + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + } + long __result = nstbi_load(memAddress(filename), x, y, channels_in_file, desired_channels); + return memByteBufferSafe(__result, x[0] * y[0] * (desired_channels != 0 ? desired_channels : channels_in_file[0])); + } + + /** Array version of: {@link #stbi_load load} */ + @Nullable + @NativeType("stbi_uc *") + public static ByteBuffer stbi_load(@NativeType("char const *") CharSequence filename, @NativeType("int *") int[] x, @NativeType("int *") int[] y, @NativeType("int *") int[] channels_in_file, int desired_channels) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(filename, true); + long filenameEncoded = stack.getPointerAddress(); + long __result = nstbi_load(filenameEncoded, x, y, channels_in_file, desired_channels); + return memByteBufferSafe(__result, x[0] * y[0] * (desired_channels != 0 ? desired_channels : channels_in_file[0])); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #nstbi_load_from_memory} */ + public static native long nstbi_load_from_memory(long buffer, int len, int[] x, int[] y, int[] channels_in_file, int desired_channels); + + /** Array version of: {@link #stbi_load_from_memory load_from_memory} */ + @Nullable + @NativeType("stbi_uc *") + public static ByteBuffer stbi_load_from_memory(@NativeType("stbi_uc const *") ByteBuffer buffer, @NativeType("int *") int[] x, @NativeType("int *") int[] y, @NativeType("int *") int[] channels_in_file, int desired_channels) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + } + long __result = nstbi_load_from_memory(memAddress(buffer), buffer.remaining(), x, y, channels_in_file, desired_channels); + return memByteBufferSafe(__result, x[0] * y[0] * (desired_channels != 0 ? desired_channels : channels_in_file[0])); + } + + /** Array version of: {@link #nstbi_load_from_callbacks} */ + public static native long nstbi_load_from_callbacks(long clbk, long user, int[] x, int[] y, int[] channels_in_file, int desired_channels); + + /** Array version of: {@link #stbi_load_from_callbacks load_from_callbacks} */ + @Nullable + @NativeType("stbi_uc *") + public static ByteBuffer stbi_load_from_callbacks(@NativeType("stbi_io_callbacks const *") STBIIOCallbacks clbk, @NativeType("void *") long user, @NativeType("int *") int[] x, @NativeType("int *") int[] y, @NativeType("int *") int[] channels_in_file, int desired_channels) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + STBIIOCallbacks.validate(clbk.address()); + } + long __result = nstbi_load_from_callbacks(clbk.address(), user, x, y, channels_in_file, desired_channels); + return memByteBufferSafe(__result, x[0] * y[0] * (desired_channels != 0 ? desired_channels : channels_in_file[0])); + } + + /** Array version of: {@link #nstbi_load_gif_from_memory} */ + public static native long nstbi_load_gif_from_memory(long buffer, int len, long delays, int[] x, int[] y, int[] z, int[] channels_in_file, int desired_channels); + + /** Array version of: {@link #stbi_load_gif_from_memory load_gif_from_memory} */ + @Nullable + @NativeType("stbi_uc *") + public static ByteBuffer stbi_load_gif_from_memory(@NativeType("stbi_uc const *") ByteBuffer buffer, @NativeType("int **") PointerBuffer delays, @NativeType("int *") int[] x, @NativeType("int *") int[] y, @NativeType("int *") int[] z, @NativeType("int *") int[] channels_in_file, int desired_channels) { + if (CHECKS) { + check(delays, 1); + check(x, 1); + check(y, 1); + check(z, 1); + check(channels_in_file, 1); + } + long __result = nstbi_load_gif_from_memory(memAddress(buffer), buffer.remaining(), memAddress(delays), x, y, z, channels_in_file, desired_channels); + return memByteBufferSafe(__result, x[0] * y[0] * z[0] * (desired_channels != 0 ? desired_channels : channels_in_file[0])); + } + + /** Array version of: {@link #nstbi_load_16} */ + public static native long nstbi_load_16(long filename, int[] x, int[] y, int[] channels_in_file, int desired_channels); + + /** Array version of: {@link #stbi_load_16 load_16} */ + @Nullable + @NativeType("stbi_us *") + public static ShortBuffer stbi_load_16(@NativeType("char const *") ByteBuffer filename, @NativeType("int *") int[] x, @NativeType("int *") int[] y, @NativeType("int *") int[] channels_in_file, int desired_channels) { + if (CHECKS) { + checkNT1(filename); + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + } + long __result = nstbi_load_16(memAddress(filename), x, y, channels_in_file, desired_channels); + return memShortBufferSafe(__result, x[0] * y[0] * (desired_channels != 0 ? desired_channels : channels_in_file[0])); + } + + /** Array version of: {@link #stbi_load_16 load_16} */ + @Nullable + @NativeType("stbi_us *") + public static ShortBuffer stbi_load_16(@NativeType("char const *") CharSequence filename, @NativeType("int *") int[] x, @NativeType("int *") int[] y, @NativeType("int *") int[] channels_in_file, int desired_channels) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(filename, true); + long filenameEncoded = stack.getPointerAddress(); + long __result = nstbi_load_16(filenameEncoded, x, y, channels_in_file, desired_channels); + return memShortBufferSafe(__result, x[0] * y[0] * (desired_channels != 0 ? desired_channels : channels_in_file[0])); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #nstbi_load_16_from_memory} */ + public static native long nstbi_load_16_from_memory(long buffer, int len, int[] x, int[] y, int[] channels_in_file, int desired_channels); + + /** Array version of: {@link #stbi_load_16_from_memory load_16_from_memory} */ + @Nullable + @NativeType("stbi_us *") + public static ShortBuffer stbi_load_16_from_memory(@NativeType("stbi_uc const *") ByteBuffer buffer, @NativeType("int *") int[] x, @NativeType("int *") int[] y, @NativeType("int *") int[] channels_in_file, int desired_channels) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + } + long __result = nstbi_load_16_from_memory(memAddress(buffer), buffer.remaining(), x, y, channels_in_file, desired_channels); + return memShortBufferSafe(__result, x[0] * y[0] * (desired_channels != 0 ? desired_channels : channels_in_file[0])); + } + + /** Array version of: {@link #nstbi_load_16_from_callbacks} */ + public static native long nstbi_load_16_from_callbacks(long clbk, long user, int[] x, int[] y, int[] channels_in_file, int desired_channels); + + /** Array version of: {@link #stbi_load_16_from_callbacks load_16_from_callbacks} */ + @Nullable + @NativeType("stbi_us *") + public static ShortBuffer stbi_load_16_from_callbacks(@NativeType("stbi_io_callbacks const *") STBIIOCallbacks clbk, @NativeType("void *") long user, @NativeType("int *") int[] x, @NativeType("int *") int[] y, @NativeType("int *") int[] channels_in_file, int desired_channels) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + STBIIOCallbacks.validate(clbk.address()); + } + long __result = nstbi_load_16_from_callbacks(clbk.address(), user, x, y, channels_in_file, desired_channels); + return memShortBufferSafe(__result, x[0] * y[0] * (desired_channels != 0 ? desired_channels : channels_in_file[0])); + } + + /** Array version of: {@link #nstbi_loadf} */ + public static native long nstbi_loadf(long filename, int[] x, int[] y, int[] channels_in_file, int desired_channels); + + /** Array version of: {@link #stbi_loadf loadf} */ + @Nullable + @NativeType("float *") + public static FloatBuffer stbi_loadf(@NativeType("char const *") ByteBuffer filename, @NativeType("int *") int[] x, @NativeType("int *") int[] y, @NativeType("int *") int[] channels_in_file, int desired_channels) { + if (CHECKS) { + checkNT1(filename); + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + } + long __result = nstbi_loadf(memAddress(filename), x, y, channels_in_file, desired_channels); + return memFloatBufferSafe(__result, x[0] * y[0] * (desired_channels != 0 ? desired_channels : channels_in_file[0])); + } + + /** Array version of: {@link #stbi_loadf loadf} */ + @Nullable + @NativeType("float *") + public static FloatBuffer stbi_loadf(@NativeType("char const *") CharSequence filename, @NativeType("int *") int[] x, @NativeType("int *") int[] y, @NativeType("int *") int[] channels_in_file, int desired_channels) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(filename, true); + long filenameEncoded = stack.getPointerAddress(); + long __result = nstbi_loadf(filenameEncoded, x, y, channels_in_file, desired_channels); + return memFloatBufferSafe(__result, x[0] * y[0] * (desired_channels != 0 ? desired_channels : channels_in_file[0])); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #nstbi_loadf_from_memory} */ + public static native long nstbi_loadf_from_memory(long buffer, int len, int[] x, int[] y, int[] channels_in_file, int desired_channels); + + /** Array version of: {@link #stbi_loadf_from_memory loadf_from_memory} */ + @Nullable + @NativeType("float *") + public static FloatBuffer stbi_loadf_from_memory(@NativeType("stbi_uc const *") ByteBuffer buffer, @NativeType("int *") int[] x, @NativeType("int *") int[] y, @NativeType("int *") int[] channels_in_file, int desired_channels) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + } + long __result = nstbi_loadf_from_memory(memAddress(buffer), buffer.remaining(), x, y, channels_in_file, desired_channels); + return memFloatBufferSafe(__result, x[0] * y[0] * (desired_channels != 0 ? desired_channels : channels_in_file[0])); + } + + /** Array version of: {@link #nstbi_loadf_from_callbacks} */ + public static native long nstbi_loadf_from_callbacks(long clbk, long user, int[] x, int[] y, int[] channels_in_file, int desired_channels); + + /** Array version of: {@link #stbi_loadf_from_callbacks loadf_from_callbacks} */ + @Nullable + @NativeType("float *") + public static FloatBuffer stbi_loadf_from_callbacks(@NativeType("stbi_io_callbacks const *") STBIIOCallbacks clbk, @NativeType("void *") long user, @NativeType("int *") int[] x, @NativeType("int *") int[] y, @NativeType("int *") int[] channels_in_file, int desired_channels) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(channels_in_file, 1); + STBIIOCallbacks.validate(clbk.address()); + } + long __result = nstbi_loadf_from_callbacks(clbk.address(), user, x, y, channels_in_file, desired_channels); + return memFloatBufferSafe(__result, x[0] * y[0] * (desired_channels != 0 ? desired_channels : channels_in_file[0])); + } + + /** Array version of: {@link #nstbi_info} */ + public static native int nstbi_info(long filename, int[] x, int[] y, int[] comp); + + /** Array version of: {@link #stbi_info info} */ + @NativeType("int") + public static boolean stbi_info(@NativeType("char const *") ByteBuffer filename, @NativeType("int *") int[] x, @NativeType("int *") int[] y, @NativeType("int *") int[] comp) { + if (CHECKS) { + checkNT1(filename); + check(x, 1); + check(y, 1); + check(comp, 1); + } + return nstbi_info(memAddress(filename), x, y, comp) != 0; + } + + /** Array version of: {@link #stbi_info info} */ + @NativeType("int") + public static boolean stbi_info(@NativeType("char const *") CharSequence filename, @NativeType("int *") int[] x, @NativeType("int *") int[] y, @NativeType("int *") int[] comp) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(comp, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(filename, true); + long filenameEncoded = stack.getPointerAddress(); + return nstbi_info(filenameEncoded, x, y, comp) != 0; + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #nstbi_info_from_memory} */ + public static native int nstbi_info_from_memory(long buffer, int len, int[] x, int[] y, int[] comp); + + /** Array version of: {@link #stbi_info_from_memory info_from_memory} */ + @NativeType("int") + public static boolean stbi_info_from_memory(@NativeType("stbi_uc const *") ByteBuffer buffer, @NativeType("int *") int[] x, @NativeType("int *") int[] y, @NativeType("int *") int[] comp) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(comp, 1); + } + return nstbi_info_from_memory(memAddress(buffer), buffer.remaining(), x, y, comp) != 0; + } + + /** Array version of: {@link #nstbi_info_from_callbacks} */ + public static native int nstbi_info_from_callbacks(long clbk, long user, int[] x, int[] y, int[] comp); + + /** Array version of: {@link #stbi_info_from_callbacks info_from_callbacks} */ + @NativeType("int") + public static boolean stbi_info_from_callbacks(@NativeType("stbi_io_callbacks const *") STBIIOCallbacks clbk, @NativeType("void *") long user, @NativeType("int *") int[] x, @NativeType("int *") int[] y, @NativeType("int *") int[] comp) { + if (CHECKS) { + check(x, 1); + check(y, 1); + check(comp, 1); + STBIIOCallbacks.validate(clbk.address()); + } + return nstbi_info_from_callbacks(clbk.address(), user, x, y, comp) != 0; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBImageResize.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBImageResize.java new file mode 100644 index 00000000..d3bc2624 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBImageResize.java @@ -0,0 +1,790 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to stb_image_resize.h from the stb library. + * + *

Written with emphasis on usability, portability, and efficiency. (No SIMD or threads, so it be easily outperformed by libs that use those.) Only + * scaling and translation is supported, no rotations or shears. Easy API downsamples w/Mitchell filter, upsamples w/cubic interpolation.

+ * + *

QUICKSTART

+ * + *

+ * stbir_resize_uint8(      input_pixels , in_w , in_h , 0,
+ *                          output_pixels, out_w, out_h, 0, num_channels)
+ * stbir_resize_float(...)
+ * stbir_resize_uint8_srgb( input_pixels , in_w , in_h , 0,
+ *                          output_pixels, out_w, out_h, 0,
+ *                          num_channels , alpha_chan  , 0)
+ * stbir_resize_uint8_srgb_edgemode(
+ *                          input_pixels , in_w , in_h , 0,
+ *                          output_pixels, out_w, out_h, 0,
+ *                          num_channels , alpha_chan  , 0, STBIR_EDGE_CLAMP)
+ *                                                       // WRAP/REFLECT/ZERO
+ * + *

ALPHA CHANNEL

+ * + *

Most of the resizing functions provide the ability to control how the alpha channel of an image is processed. The important things to know about this:

+ * + *
    + *
  1. The best mathematically-behaved version of alpha to use is called "premultiplied alpha", in which the other color channels have had the alpha value + * multiplied in. If you use premultiplied alpha, linear filtering (such as image resampling done by this library, or performed in texture units on + * GPUs) does the "right thing". While premultiplied alpha is standard in the movie CGI industry, it is still uncommon in the videogame/real-time + * world. If you linearly filter non-premultiplied alpha, strange effects occur. (For example, the average of 1% opaque bright green and 99% opaque + * black produces 50% transparent dark green when non-premultiplied, whereas premultiplied it produces 50% transparent near-black. The former + * introduces green energy that doesn't exist in the source image.)
  2. + *
  3. Artists should not edit premultiplied-alpha images; artists want non-premultiplied alpha images. Thus, art tools generally output non-premultiplied + * alpha images.
  4. + *
  5. You will get best results in most cases by converting images to premultiplied alpha before processing them mathematically.
  6. + *
  7. If you pass the flag {@link #STBIR_FLAG_ALPHA_PREMULTIPLIED FLAG_ALPHA_PREMULTIPLIED}, the resizer does not do anything special for the alpha channel; it is resampled identically to + * other channels. This produces the correct results for premultiplied-alpha images, but produces less-than-ideal results for non-premultiplied-alpha + * images.
  8. + *
  9. If you do not pass the flag {@link #STBIR_FLAG_ALPHA_PREMULTIPLIED FLAG_ALPHA_PREMULTIPLIED}, then the resizer weights the contribution of input pixels based on their alpha values, or, + * equivalently, it multiplies the alpha value into the color channels, resamples, then divides by the resultant alpha value. Input pixels which have + * {@code alpha=0} do not contribute at all to output pixels unless all of the input pixels affecting that output pixel have {@code alpha=0}, + * in which case the result for that pixel is the same as it would be without {@link #STBIR_FLAG_ALPHA_PREMULTIPLIED FLAG_ALPHA_PREMULTIPLIED}. However, this is only true for input images + * in integer formats. For input images in float format, input pixels with {@code alpha=0} have no effect, and output pixels which have + * {@code alpha=0} will be 0 in all channels. (For float images, you can manually achieve the same result by adding a tiny epsilon value to the alpha + * channel of every image, and then subtracting or clamping it at the end.)
  10. + *
  11. You can separately control whether the alpha channel is interpreted as linear or affected by the colorspace. By default it is linear; you almost + * never want to apply the colorspace. (For example, graphics hardware does not apply sRGB conversion to the alpha channel.)
  12. + *
+ */ +public class STBImageResize { + + /** Set this flag if you have no alpha channel, or otherwise provide the index of the alpha channel. */ + public static final int STBIR_ALPHA_CHANNEL_NONE = -1; + + /** + * Set this flag if your texture has premultiplied alpha. Otherwise, stbir will use alpha-weighted resampling (effectively premultiplying, resampling, + * then unpremultiplying). + */ + public static final int STBIR_FLAG_ALPHA_PREMULTIPLIED = -1; + + /** The specified alpha channel should be handled as gamma-corrected value even when doing sRGB operations. */ + public static final int STBIR_FLAG_ALPHA_USES_COLORSPACE = -1; + + /** + * Edge wrap mode. + * + *
Enum values:
+ * + *
    + *
  • {@link #STBIR_EDGE_CLAMP EDGE_CLAMP}
  • + *
  • {@link #STBIR_EDGE_REFLECT EDGE_REFLECT}
  • + *
  • {@link #STBIR_EDGE_WRAP EDGE_WRAP}
  • + *
  • {@link #STBIR_EDGE_ZERO EDGE_ZERO}
  • + *
+ */ + public static final int + STBIR_EDGE_CLAMP = 0x1, + STBIR_EDGE_REFLECT = 0x2, + STBIR_EDGE_WRAP = 0x3, + STBIR_EDGE_ZERO = 0x4; + + /** + * Filters. + * + *
Enum values:
+ * + *
    + *
  • {@link #STBIR_FILTER_DEFAULT FILTER_DEFAULT} - Use same filter type that easy-to-use API chooses.
  • + *
  • {@link #STBIR_FILTER_BOX FILTER_BOX} - A trapezoid w/1-pixel wide ramps, same result as box for integer scale ratios.
  • + *
  • {@link #STBIR_FILTER_TRIANGLE FILTER_TRIANGLE} - On upsampling, produces same results as bilinear texture filtering.
  • + *
  • {@link #STBIR_FILTER_CUBICBSPLINE FILTER_CUBICBSPLINE} - The cubic b-spline (aka Mitchell-Netrevalli with B=1,C=0), gaussian-esque.
  • + *
  • {@link #STBIR_FILTER_CATMULLROM FILTER_CATMULLROM} - An interpolating cubic spline.
  • + *
  • {@link #STBIR_FILTER_MITCHELL FILTER_MITCHELL} - Mitchell-Netrevalli filter with B=1/3, C=1/3.
  • + *
+ */ + public static final int + STBIR_FILTER_DEFAULT = 0, + STBIR_FILTER_BOX = 1, + STBIR_FILTER_TRIANGLE = 2, + STBIR_FILTER_CUBICBSPLINE = 3, + STBIR_FILTER_CATMULLROM = 4, + STBIR_FILTER_MITCHELL = 5; + + /** + * Colorspace. + * + *
Enum values:
+ * + *
    + *
  • {@link #STBIR_COLORSPACE_LINEAR COLORSPACE_LINEAR}
  • + *
  • {@link #STBIR_COLORSPACE_SRGB COLORSPACE_SRGB}
  • + *
+ */ + public static final int + STBIR_COLORSPACE_LINEAR = 0, + STBIR_COLORSPACE_SRGB = 1; + + /** + * Data type. + * + *
Enum values:
+ * + *
    + *
  • {@link #STBIR_TYPE_UINT8 TYPE_UINT8}
  • + *
  • {@link #STBIR_TYPE_UINT16 TYPE_UINT16}
  • + *
  • {@link #STBIR_TYPE_UINT32 TYPE_UINT32}
  • + *
  • {@link #STBIR_TYPE_FLOAT TYPE_FLOAT}
  • + *
+ */ + public static final int + STBIR_TYPE_UINT8 = 0, + STBIR_TYPE_UINT16 = 1, + STBIR_TYPE_UINT32 = 2, + STBIR_TYPE_FLOAT = 3; + + static { LibSTB.initialize(); } + + protected STBImageResize() { + throw new UnsupportedOperationException(); + } + + // --- [ stbir_resize_uint8 ] --- + + /** Unsafe version of: {@link #stbir_resize_uint8 resize_uint8} */ + public static native int nstbir_resize_uint8(long input_pixels, int input_w, int input_h, int input_stride_in_bytes, long output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels); + + /** + * Easy-to-use API for resizing images. + * + *
    + *
  • The colorspace is linear.
  • + *
  • The alpha channel is treated identically to other channels.
  • + *
  • Memory required grows approximately linearly with input and output size, but with discontinuities at {@code input_w == output_w} and + * {@code input_h == output_h}.
  • + *
+ * + *

This function uses the default resampling filter defined at compile time. For a different filter, use the medium-complexity API.

+ * + * @param input_pixels the source image data + * @param input_w the source image width + * @param input_h the source image height + * @param input_stride_in_bytes the offset between successive rows of the source image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param output_pixels returns the scaled image data + * @param output_w the resized image width + * @param output_h the resized image height + * @param output_stride_in_bytes the offset between successive rows of the resized image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param num_channels the number of channels in the image (e.g. RGB=3, RGBA=4) + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbir_resize_uint8(@NativeType("unsigned char const *") ByteBuffer input_pixels, int input_w, int input_h, int input_stride_in_bytes, @NativeType("unsigned char *") ByteBuffer output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels) { + if (CHECKS) { + check(input_pixels, input_h * (input_stride_in_bytes == 0 ? input_w * num_channels : input_stride_in_bytes)); + check(output_pixels, output_h * (output_stride_in_bytes == 0 ? output_w * num_channels : output_stride_in_bytes)); + } + return nstbir_resize_uint8(memAddress(input_pixels), input_w, input_h, input_stride_in_bytes, memAddress(output_pixels), output_w, output_h, output_stride_in_bytes, num_channels) != 0; + } + + // --- [ stbir_resize_float ] --- + + /** Unsafe version of: {@link #stbir_resize_float resize_float} */ + public static native int nstbir_resize_float(long input_pixels, int input_w, int input_h, int input_stride_in_bytes, long output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels); + + /** + * Float version of {@link #stbir_resize_uint8 resize_uint8}. + * + * @param input_pixels the source image data + * @param input_w the source image width + * @param input_h the source image height + * @param input_stride_in_bytes the offset between successive rows of the source image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param output_pixels returns the scaled image data + * @param output_w the resized image width + * @param output_h the resized image height + * @param output_stride_in_bytes the offset between successive rows of the resized image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param num_channels the number of channels in the image (e.g. RGB=3, RGBA=4) + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbir_resize_float(@NativeType("float const *") FloatBuffer input_pixels, int input_w, int input_h, int input_stride_in_bytes, @NativeType("float *") FloatBuffer output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels) { + if (CHECKS) { + check(input_pixels, input_h * (input_stride_in_bytes == 0 ? input_w * num_channels : (input_stride_in_bytes >> 2))); + check(output_pixels, output_h * (output_stride_in_bytes == 0 ? output_w * num_channels : (output_stride_in_bytes >> 2))); + } + return nstbir_resize_float(memAddress(input_pixels), input_w, input_h, input_stride_in_bytes, memAddress(output_pixels), output_w, output_h, output_stride_in_bytes, num_channels) != 0; + } + + // --- [ stbir_resize_uint8_srgb ] --- + + /** Unsafe version of: {@link #stbir_resize_uint8_srgb resize_uint8_srgb} */ + public static native int nstbir_resize_uint8_srgb(long input_pixels, int input_w, int input_h, int input_stride_in_bytes, long output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels, int alpha_channel, int flags); + + /** + * Easy-to-use API for resizing images. + * + *
    + *
  • The image data is interpreted as gamma-corrected sRGB.
  • + *
  • Memory required grows approximately linearly with input and output size, but with discontinuities at {@code input_w == output_w} and + * {@code input_h == output_h}.
  • + *
+ * + *

This function uses the default resampling filter defined at compile time. For a different filter, use the medium-complexity API.

+ * + * @param input_pixels the source image data + * @param input_w the source image width + * @param input_h the source image height + * @param input_stride_in_bytes the offset between successive rows of the source image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param output_pixels returns the scaled image data + * @param output_w the resized image width + * @param output_h the resized image height + * @param output_stride_in_bytes the offset between successive rows of the resized image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param num_channels the number of channels in the image (e.g. RGB=3, RGBA=4) + * @param alpha_channel the alpha channel index, or {@link #STBIR_ALPHA_CHANNEL_NONE ALPHA_CHANNEL_NONE} if there is no alpha channel + * @param flags the alpha channel flags. 0 will propably do the right thing if you're not sure what the flags mean. One of:
{@link #STBIR_FLAG_ALPHA_PREMULTIPLIED FLAG_ALPHA_PREMULTIPLIED}{@link #STBIR_FLAG_ALPHA_USES_COLORSPACE FLAG_ALPHA_USES_COLORSPACE}
+ * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbir_resize_uint8_srgb(@NativeType("unsigned char const *") ByteBuffer input_pixels, int input_w, int input_h, int input_stride_in_bytes, @NativeType("unsigned char *") ByteBuffer output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels, int alpha_channel, int flags) { + if (CHECKS) { + check(input_pixels, input_h * (input_stride_in_bytes == 0 ? input_w * num_channels : input_stride_in_bytes)); + check(output_pixels, output_h * (output_stride_in_bytes == 0 ? output_w * num_channels : output_stride_in_bytes)); + } + return nstbir_resize_uint8_srgb(memAddress(input_pixels), input_w, input_h, input_stride_in_bytes, memAddress(output_pixels), output_w, output_h, output_stride_in_bytes, num_channels, alpha_channel, flags) != 0; + } + + // --- [ stbir_resize_uint8_srgb_edgemode ] --- + + /** Unsafe version of: {@link #stbir_resize_uint8_srgb_edgemode resize_uint8_srgb_edgemode} */ + public static native int nstbir_resize_uint8_srgb_edgemode(long input_pixels, int input_w, int input_h, int input_stride_in_bytes, long output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels, int alpha_channel, int flags, int edge_wrap_mode); + + /** + * Same as {@link #stbir_resize_uint8_srgb resize_uint8_srgb}, but adds the ability to specify how requests to sample off the edge of the image are handled. + * + * @param input_pixels the source image data + * @param input_w the source image width + * @param input_h the source image height + * @param input_stride_in_bytes the offset between successive rows of the source image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param output_pixels returns the scaled image data + * @param output_w the resized image width + * @param output_h the resized image height + * @param output_stride_in_bytes the offset between successive rows of the resized image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param num_channels the number of channels in the image (e.g. RGB=3, RGBA=4) + * @param alpha_channel the alpha channel index, or {@link #STBIR_ALPHA_CHANNEL_NONE ALPHA_CHANNEL_NONE} if there is no alpha channel + * @param flags the alpha channel flags. 0 will propably do the right thing if you're not sure what the flags mean. One of:
{@link #STBIR_FLAG_ALPHA_PREMULTIPLIED FLAG_ALPHA_PREMULTIPLIED}{@link #STBIR_FLAG_ALPHA_USES_COLORSPACE FLAG_ALPHA_USES_COLORSPACE}
+ * @param edge_wrap_mode the edge wrap mode. One of:
{@link #STBIR_EDGE_CLAMP EDGE_CLAMP}{@link #STBIR_EDGE_REFLECT EDGE_REFLECT}{@link #STBIR_EDGE_WRAP EDGE_WRAP}{@link #STBIR_EDGE_ZERO EDGE_ZERO}
+ * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbir_resize_uint8_srgb_edgemode(@NativeType("unsigned char const *") ByteBuffer input_pixels, int input_w, int input_h, int input_stride_in_bytes, @NativeType("unsigned char *") ByteBuffer output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels, int alpha_channel, int flags, @NativeType("stbir_edge") int edge_wrap_mode) { + if (CHECKS) { + check(input_pixels, input_h * (input_stride_in_bytes == 0 ? input_w * num_channels : input_stride_in_bytes)); + check(output_pixels, output_h * (output_stride_in_bytes == 0 ? output_w * num_channels : output_stride_in_bytes)); + } + return nstbir_resize_uint8_srgb_edgemode(memAddress(input_pixels), input_w, input_h, input_stride_in_bytes, memAddress(output_pixels), output_w, output_h, output_stride_in_bytes, num_channels, alpha_channel, flags, edge_wrap_mode) != 0; + } + + // --- [ stbir_resize_uint8_generic ] --- + + /** Unsafe version of: {@link #stbir_resize_uint8_generic resize_uint8_generic} */ + public static native int nstbir_resize_uint8_generic(long input_pixels, int input_w, int input_h, int input_stride_in_bytes, long output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels, int alpha_channel, int flags, int edge_wrap_mode, int filter, int space, long alloc_context); + + /** + * Medium-complexity version of {@link #stbir_resize_uint8 resize_uint8}. + * + * @param input_pixels the source image data + * @param input_w the source image width + * @param input_h the source image height + * @param input_stride_in_bytes the offset between successive rows of the source image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param output_pixels returns the scaled image data + * @param output_w the resized image width + * @param output_h the resized image height + * @param output_stride_in_bytes the offset between successive rows of the resized image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param num_channels the number of channels in the image (e.g. RGB=3, RGBA=4) + * @param alpha_channel the alpha channel index, or {@link #STBIR_ALPHA_CHANNEL_NONE ALPHA_CHANNEL_NONE} if there is no alpha channel + * @param flags the alpha channel flags. 0 will propably do the right thing if you're not sure what the flags mean. One of:
{@link #STBIR_FLAG_ALPHA_PREMULTIPLIED FLAG_ALPHA_PREMULTIPLIED}{@link #STBIR_FLAG_ALPHA_USES_COLORSPACE FLAG_ALPHA_USES_COLORSPACE}
+ * @param edge_wrap_mode the edge wrap mode. One of:
{@link #STBIR_EDGE_CLAMP EDGE_CLAMP}{@link #STBIR_EDGE_REFLECT EDGE_REFLECT}{@link #STBIR_EDGE_WRAP EDGE_WRAP}{@link #STBIR_EDGE_ZERO EDGE_ZERO}
+ * @param filter the scale filter. One of:
{@link #STBIR_FILTER_DEFAULT FILTER_DEFAULT}{@link #STBIR_FILTER_BOX FILTER_BOX}{@link #STBIR_FILTER_TRIANGLE FILTER_TRIANGLE}{@link #STBIR_FILTER_CUBICBSPLINE FILTER_CUBICBSPLINE}{@link #STBIR_FILTER_CATMULLROM FILTER_CATMULLROM}
{@link #STBIR_FILTER_MITCHELL FILTER_MITCHELL}
+ * @param space the image colorspace. One of:
{@link #STBIR_COLORSPACE_LINEAR COLORSPACE_LINEAR}{@link #STBIR_COLORSPACE_SRGB COLORSPACE_SRGB}
+ * @param alloc_context pointer to the allocation context + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbir_resize_uint8_generic(@NativeType("unsigned char const *") ByteBuffer input_pixels, int input_w, int input_h, int input_stride_in_bytes, @NativeType("unsigned char *") ByteBuffer output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels, int alpha_channel, int flags, @NativeType("stbir_edge") int edge_wrap_mode, @NativeType("stbir_filter") int filter, @NativeType("stbir_colorspace") int space, @NativeType("void *") long alloc_context) { + if (CHECKS) { + check(input_pixels, input_h * (input_stride_in_bytes == 0 ? input_w * num_channels : input_stride_in_bytes)); + check(output_pixels, output_h * (output_stride_in_bytes == 0 ? output_w * num_channels : output_stride_in_bytes)); + check(alloc_context); + } + return nstbir_resize_uint8_generic(memAddress(input_pixels), input_w, input_h, input_stride_in_bytes, memAddress(output_pixels), output_w, output_h, output_stride_in_bytes, num_channels, alpha_channel, flags, edge_wrap_mode, filter, space, alloc_context) != 0; + } + + /** + * Medium-complexity version of {@link #stbir_resize_uint8 resize_uint8}. + * + * @param input_pixels the source image data + * @param input_w the source image width + * @param input_h the source image height + * @param input_stride_in_bytes the offset between successive rows of the source image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param output_pixels returns the scaled image data + * @param output_w the resized image width + * @param output_h the resized image height + * @param output_stride_in_bytes the offset between successive rows of the resized image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param num_channels the number of channels in the image (e.g. RGB=3, RGBA=4) + * @param alpha_channel the alpha channel index, or {@link #STBIR_ALPHA_CHANNEL_NONE ALPHA_CHANNEL_NONE} if there is no alpha channel + * @param flags the alpha channel flags. 0 will propably do the right thing if you're not sure what the flags mean. One of:
{@link #STBIR_FLAG_ALPHA_PREMULTIPLIED FLAG_ALPHA_PREMULTIPLIED}{@link #STBIR_FLAG_ALPHA_USES_COLORSPACE FLAG_ALPHA_USES_COLORSPACE}
+ * @param edge_wrap_mode the edge wrap mode. One of:
{@link #STBIR_EDGE_CLAMP EDGE_CLAMP}{@link #STBIR_EDGE_REFLECT EDGE_REFLECT}{@link #STBIR_EDGE_WRAP EDGE_WRAP}{@link #STBIR_EDGE_ZERO EDGE_ZERO}
+ * @param filter the scale filter. One of:
{@link #STBIR_FILTER_DEFAULT FILTER_DEFAULT}{@link #STBIR_FILTER_BOX FILTER_BOX}{@link #STBIR_FILTER_TRIANGLE FILTER_TRIANGLE}{@link #STBIR_FILTER_CUBICBSPLINE FILTER_CUBICBSPLINE}{@link #STBIR_FILTER_CATMULLROM FILTER_CATMULLROM}
{@link #STBIR_FILTER_MITCHELL FILTER_MITCHELL}
+ * @param space the image colorspace. One of:
{@link #STBIR_COLORSPACE_LINEAR COLORSPACE_LINEAR}{@link #STBIR_COLORSPACE_SRGB COLORSPACE_SRGB}
+ * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbir_resize_uint8_generic(@NativeType("unsigned char const *") ByteBuffer input_pixels, int input_w, int input_h, int input_stride_in_bytes, @NativeType("unsigned char *") ByteBuffer output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels, int alpha_channel, int flags, @NativeType("stbir_edge") int edge_wrap_mode, @NativeType("stbir_filter") int filter, @NativeType("stbir_colorspace") int space) { + if (CHECKS) { + check(input_pixels, input_h * (input_stride_in_bytes == 0 ? input_w * num_channels : input_stride_in_bytes)); + check(output_pixels, output_h * (output_stride_in_bytes == 0 ? output_w * num_channels : output_stride_in_bytes)); + } + return nstbir_resize_uint8_generic(memAddress(input_pixels), input_w, input_h, input_stride_in_bytes, memAddress(output_pixels), output_w, output_h, output_stride_in_bytes, num_channels, alpha_channel, flags, edge_wrap_mode, filter, space, NULL) != 0; + } + + // --- [ stbir_resize_uint16_generic ] --- + + /** Unsafe version of: {@link #stbir_resize_uint16_generic resize_uint16_generic} */ + public static native int nstbir_resize_uint16_generic(long input_pixels, int input_w, int input_h, int input_stride_in_bytes, long output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels, int alpha_channel, int flags, int edge_wrap_mode, int filter, int space, long alloc_context); + + /** + * Short version of {@link #stbir_resize_uint8_generic resize_uint8_generic}. + * + * @param input_pixels the source image data + * @param input_w the source image width + * @param input_h the source image height + * @param input_stride_in_bytes the offset between successive rows of the source image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param output_pixels returns the scaled image data + * @param output_w the resized image width + * @param output_h the resized image height + * @param output_stride_in_bytes the offset between successive rows of the resized image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param num_channels the number of channels in the image (e.g. RGB=3, RGBA=4) + * @param alpha_channel the alpha channel index, or {@link #STBIR_ALPHA_CHANNEL_NONE ALPHA_CHANNEL_NONE} if there is no alpha channel + * @param flags the alpha channel flags. 0 will propably do the right thing if you're not sure what the flags mean. One of:
{@link #STBIR_FLAG_ALPHA_PREMULTIPLIED FLAG_ALPHA_PREMULTIPLIED}{@link #STBIR_FLAG_ALPHA_USES_COLORSPACE FLAG_ALPHA_USES_COLORSPACE}
+ * @param edge_wrap_mode the edge wrap mode. One of:
{@link #STBIR_EDGE_CLAMP EDGE_CLAMP}{@link #STBIR_EDGE_REFLECT EDGE_REFLECT}{@link #STBIR_EDGE_WRAP EDGE_WRAP}{@link #STBIR_EDGE_ZERO EDGE_ZERO}
+ * @param filter the scale filter. One of:
{@link #STBIR_FILTER_DEFAULT FILTER_DEFAULT}{@link #STBIR_FILTER_BOX FILTER_BOX}{@link #STBIR_FILTER_TRIANGLE FILTER_TRIANGLE}{@link #STBIR_FILTER_CUBICBSPLINE FILTER_CUBICBSPLINE}{@link #STBIR_FILTER_CATMULLROM FILTER_CATMULLROM}
{@link #STBIR_FILTER_MITCHELL FILTER_MITCHELL}
+ * @param space the image colorspace. One of:
{@link #STBIR_COLORSPACE_LINEAR COLORSPACE_LINEAR}{@link #STBIR_COLORSPACE_SRGB COLORSPACE_SRGB}
+ * @param alloc_context pointer to the allocation context + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbir_resize_uint16_generic(@NativeType("stbir_uint16 const *") ShortBuffer input_pixels, int input_w, int input_h, int input_stride_in_bytes, @NativeType("stbir_uint16 *") ShortBuffer output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels, int alpha_channel, int flags, @NativeType("stbir_edge") int edge_wrap_mode, @NativeType("stbir_filter") int filter, @NativeType("stbir_colorspace") int space, @NativeType("void *") long alloc_context) { + if (CHECKS) { + check(input_pixels, input_h * (input_stride_in_bytes == 0 ? input_w * num_channels : (input_stride_in_bytes >> 1))); + check(output_pixels, output_h * (output_stride_in_bytes == 0 ? output_w * num_channels : (output_stride_in_bytes >> 1))); + check(alloc_context); + } + return nstbir_resize_uint16_generic(memAddress(input_pixels), input_w, input_h, input_stride_in_bytes, memAddress(output_pixels), output_w, output_h, output_stride_in_bytes, num_channels, alpha_channel, flags, edge_wrap_mode, filter, space, alloc_context) != 0; + } + + /** + * Short version of {@link #stbir_resize_uint8_generic resize_uint8_generic}. + * + * @param input_pixels the source image data + * @param input_w the source image width + * @param input_h the source image height + * @param input_stride_in_bytes the offset between successive rows of the source image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param output_pixels returns the scaled image data + * @param output_w the resized image width + * @param output_h the resized image height + * @param output_stride_in_bytes the offset between successive rows of the resized image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param num_channels the number of channels in the image (e.g. RGB=3, RGBA=4) + * @param alpha_channel the alpha channel index, or {@link #STBIR_ALPHA_CHANNEL_NONE ALPHA_CHANNEL_NONE} if there is no alpha channel + * @param flags the alpha channel flags. 0 will propably do the right thing if you're not sure what the flags mean. One of:
{@link #STBIR_FLAG_ALPHA_PREMULTIPLIED FLAG_ALPHA_PREMULTIPLIED}{@link #STBIR_FLAG_ALPHA_USES_COLORSPACE FLAG_ALPHA_USES_COLORSPACE}
+ * @param edge_wrap_mode the edge wrap mode. One of:
{@link #STBIR_EDGE_CLAMP EDGE_CLAMP}{@link #STBIR_EDGE_REFLECT EDGE_REFLECT}{@link #STBIR_EDGE_WRAP EDGE_WRAP}{@link #STBIR_EDGE_ZERO EDGE_ZERO}
+ * @param filter the scale filter. One of:
{@link #STBIR_FILTER_DEFAULT FILTER_DEFAULT}{@link #STBIR_FILTER_BOX FILTER_BOX}{@link #STBIR_FILTER_TRIANGLE FILTER_TRIANGLE}{@link #STBIR_FILTER_CUBICBSPLINE FILTER_CUBICBSPLINE}{@link #STBIR_FILTER_CATMULLROM FILTER_CATMULLROM}
{@link #STBIR_FILTER_MITCHELL FILTER_MITCHELL}
+ * @param space the image colorspace. One of:
{@link #STBIR_COLORSPACE_LINEAR COLORSPACE_LINEAR}{@link #STBIR_COLORSPACE_SRGB COLORSPACE_SRGB}
+ * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbir_resize_uint16_generic(@NativeType("stbir_uint16 const *") ShortBuffer input_pixels, int input_w, int input_h, int input_stride_in_bytes, @NativeType("stbir_uint16 *") ShortBuffer output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels, int alpha_channel, int flags, @NativeType("stbir_edge") int edge_wrap_mode, @NativeType("stbir_filter") int filter, @NativeType("stbir_colorspace") int space) { + if (CHECKS) { + check(input_pixels, input_h * (input_stride_in_bytes == 0 ? input_w * num_channels : (input_stride_in_bytes >> 1))); + check(output_pixels, output_h * (output_stride_in_bytes == 0 ? output_w * num_channels : (output_stride_in_bytes >> 1))); + } + return nstbir_resize_uint16_generic(memAddress(input_pixels), input_w, input_h, input_stride_in_bytes, memAddress(output_pixels), output_w, output_h, output_stride_in_bytes, num_channels, alpha_channel, flags, edge_wrap_mode, filter, space, NULL) != 0; + } + + // --- [ stbir_resize_float_generic ] --- + + /** Unsafe version of: {@link #stbir_resize_float_generic resize_float_generic} */ + public static native int nstbir_resize_float_generic(long input_pixels, int input_w, int input_h, int input_stride_in_bytes, long output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels, int alpha_channel, int flags, int edge_wrap_mode, int filter, int space, long alloc_context); + + /** + * Float version of {@link #stbir_resize_uint8_generic resize_uint8_generic}. + * + * @param input_pixels the source image data + * @param input_w the source image width + * @param input_h the source image height + * @param input_stride_in_bytes the offset between successive rows of the source image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param output_pixels returns the scaled image data + * @param output_w the resized image width + * @param output_h the resized image height + * @param output_stride_in_bytes the offset between successive rows of the resized image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param num_channels the number of channels in the image (e.g. RGB=3, RGBA=4) + * @param alpha_channel the alpha channel index, or {@link #STBIR_ALPHA_CHANNEL_NONE ALPHA_CHANNEL_NONE} if there is no alpha channel + * @param flags the alpha channel flags. 0 will propably do the right thing if you're not sure what the flags mean. One of:
{@link #STBIR_FLAG_ALPHA_PREMULTIPLIED FLAG_ALPHA_PREMULTIPLIED}{@link #STBIR_FLAG_ALPHA_USES_COLORSPACE FLAG_ALPHA_USES_COLORSPACE}
+ * @param edge_wrap_mode the edge wrap mode. One of:
{@link #STBIR_EDGE_CLAMP EDGE_CLAMP}{@link #STBIR_EDGE_REFLECT EDGE_REFLECT}{@link #STBIR_EDGE_WRAP EDGE_WRAP}{@link #STBIR_EDGE_ZERO EDGE_ZERO}
+ * @param filter the scale filter. One of:
{@link #STBIR_FILTER_DEFAULT FILTER_DEFAULT}{@link #STBIR_FILTER_BOX FILTER_BOX}{@link #STBIR_FILTER_TRIANGLE FILTER_TRIANGLE}{@link #STBIR_FILTER_CUBICBSPLINE FILTER_CUBICBSPLINE}{@link #STBIR_FILTER_CATMULLROM FILTER_CATMULLROM}
{@link #STBIR_FILTER_MITCHELL FILTER_MITCHELL}
+ * @param space the image colorspace. One of:
{@link #STBIR_COLORSPACE_LINEAR COLORSPACE_LINEAR}{@link #STBIR_COLORSPACE_SRGB COLORSPACE_SRGB}
+ * @param alloc_context pointer to the allocation context + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbir_resize_float_generic(@NativeType("float const *") FloatBuffer input_pixels, int input_w, int input_h, int input_stride_in_bytes, @NativeType("float *") FloatBuffer output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels, int alpha_channel, int flags, @NativeType("stbir_edge") int edge_wrap_mode, @NativeType("stbir_filter") int filter, @NativeType("stbir_colorspace") int space, @NativeType("void *") long alloc_context) { + if (CHECKS) { + check(input_pixels, input_h * (input_stride_in_bytes == 0 ? input_w * num_channels : (input_stride_in_bytes >> 2))); + check(output_pixels, output_h * (output_stride_in_bytes == 0 ? output_w * num_channels : (output_stride_in_bytes >> 2))); + check(alloc_context); + } + return nstbir_resize_float_generic(memAddress(input_pixels), input_w, input_h, input_stride_in_bytes, memAddress(output_pixels), output_w, output_h, output_stride_in_bytes, num_channels, alpha_channel, flags, edge_wrap_mode, filter, space, alloc_context) != 0; + } + + /** + * Float version of {@link #stbir_resize_uint8_generic resize_uint8_generic}. + * + * @param input_pixels the source image data + * @param input_w the source image width + * @param input_h the source image height + * @param input_stride_in_bytes the offset between successive rows of the source image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param output_pixels returns the scaled image data + * @param output_w the resized image width + * @param output_h the resized image height + * @param output_stride_in_bytes the offset between successive rows of the resized image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param num_channels the number of channels in the image (e.g. RGB=3, RGBA=4) + * @param alpha_channel the alpha channel index, or {@link #STBIR_ALPHA_CHANNEL_NONE ALPHA_CHANNEL_NONE} if there is no alpha channel + * @param flags the alpha channel flags. 0 will propably do the right thing if you're not sure what the flags mean. One of:
{@link #STBIR_FLAG_ALPHA_PREMULTIPLIED FLAG_ALPHA_PREMULTIPLIED}{@link #STBIR_FLAG_ALPHA_USES_COLORSPACE FLAG_ALPHA_USES_COLORSPACE}
+ * @param edge_wrap_mode the edge wrap mode. One of:
{@link #STBIR_EDGE_CLAMP EDGE_CLAMP}{@link #STBIR_EDGE_REFLECT EDGE_REFLECT}{@link #STBIR_EDGE_WRAP EDGE_WRAP}{@link #STBIR_EDGE_ZERO EDGE_ZERO}
+ * @param filter the scale filter. One of:
{@link #STBIR_FILTER_DEFAULT FILTER_DEFAULT}{@link #STBIR_FILTER_BOX FILTER_BOX}{@link #STBIR_FILTER_TRIANGLE FILTER_TRIANGLE}{@link #STBIR_FILTER_CUBICBSPLINE FILTER_CUBICBSPLINE}{@link #STBIR_FILTER_CATMULLROM FILTER_CATMULLROM}
{@link #STBIR_FILTER_MITCHELL FILTER_MITCHELL}
+ * @param space the image colorspace. One of:
{@link #STBIR_COLORSPACE_LINEAR COLORSPACE_LINEAR}{@link #STBIR_COLORSPACE_SRGB COLORSPACE_SRGB}
+ * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbir_resize_float_generic(@NativeType("float const *") FloatBuffer input_pixels, int input_w, int input_h, int input_stride_in_bytes, @NativeType("float *") FloatBuffer output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels, int alpha_channel, int flags, @NativeType("stbir_edge") int edge_wrap_mode, @NativeType("stbir_filter") int filter, @NativeType("stbir_colorspace") int space) { + if (CHECKS) { + check(input_pixels, input_h * (input_stride_in_bytes == 0 ? input_w * num_channels : (input_stride_in_bytes >> 2))); + check(output_pixels, output_h * (output_stride_in_bytes == 0 ? output_w * num_channels : (output_stride_in_bytes >> 2))); + } + return nstbir_resize_float_generic(memAddress(input_pixels), input_w, input_h, input_stride_in_bytes, memAddress(output_pixels), output_w, output_h, output_stride_in_bytes, num_channels, alpha_channel, flags, edge_wrap_mode, filter, space, NULL) != 0; + } + + // --- [ stbir_resize ] --- + + /** Unsafe version of: {@link #stbir_resize resize} */ + public static native int nstbir_resize(long input_pixels, int input_w, int input_h, int input_stride_in_bytes, long output_pixels, int output_w, int output_h, int output_stride_in_bytes, int datatype, int num_channels, int alpha_channel, int flags, int edge_mode_horizontal, int edge_mode_vertical, int filter_horizontal, int filter_vertical, int space, long alloc_context); + + /** + * Full-complexity version of {@link #stbir_resize_uint8_generic resize_uint8_generic}. + * + * @param input_pixels the source image data + * @param input_w the source image width + * @param input_h the source image height + * @param input_stride_in_bytes the offset between successive rows of the source image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param output_pixels returns the scaled image data + * @param output_w the resized image width + * @param output_h the resized image height + * @param output_stride_in_bytes the offset between successive rows of the resized image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param datatype the image data type. One of:
{@link #STBIR_TYPE_UINT8 TYPE_UINT8}{@link #STBIR_TYPE_UINT16 TYPE_UINT16}{@link #STBIR_TYPE_UINT32 TYPE_UINT32}{@link #STBIR_TYPE_FLOAT TYPE_FLOAT}
+ * @param num_channels the number of channels in the image (e.g. RGB=3, RGBA=4) + * @param alpha_channel the alpha channel index, or {@link #STBIR_ALPHA_CHANNEL_NONE ALPHA_CHANNEL_NONE} if there is no alpha channel + * @param flags the alpha channel flags. 0 will propably do the right thing if you're not sure what the flags mean. One of:
{@link #STBIR_FLAG_ALPHA_PREMULTIPLIED FLAG_ALPHA_PREMULTIPLIED}{@link #STBIR_FLAG_ALPHA_USES_COLORSPACE FLAG_ALPHA_USES_COLORSPACE}
+ * @param edge_mode_horizontal the horizontal edge wrap mode + * @param edge_mode_vertical the vertical edge wrap mode + * @param filter_horizontal the horizontal scale filter + * @param filter_vertical the vertical scale filter + * @param space the image colorspace. One of:
{@link #STBIR_COLORSPACE_LINEAR COLORSPACE_LINEAR}{@link #STBIR_COLORSPACE_SRGB COLORSPACE_SRGB}
+ * @param alloc_context pointer to the allocation context + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbir_resize(@NativeType("void const *") ByteBuffer input_pixels, int input_w, int input_h, int input_stride_in_bytes, @NativeType("void *") ByteBuffer output_pixels, int output_w, int output_h, int output_stride_in_bytes, @NativeType("stbir_datatype") int datatype, int num_channels, int alpha_channel, int flags, @NativeType("stbir_edge") int edge_mode_horizontal, @NativeType("stbir_edge") int edge_mode_vertical, @NativeType("stbir_filter") int filter_horizontal, @NativeType("stbir_filter") int filter_vertical, @NativeType("stbir_colorspace") int space, @NativeType("void *") long alloc_context) { + if (CHECKS) { + check(input_pixels, input_h * (input_stride_in_bytes == 0 ? (input_w * num_channels) << getTypeShift(datatype) : input_stride_in_bytes)); + check(output_pixels, output_h * (output_stride_in_bytes == 0 ? (output_w * num_channels) << getTypeShift(datatype) : output_stride_in_bytes)); + check(alloc_context); + } + return nstbir_resize(memAddress(input_pixels), input_w, input_h, input_stride_in_bytes, memAddress(output_pixels), output_w, output_h, output_stride_in_bytes, datatype, num_channels, alpha_channel, flags, edge_mode_horizontal, edge_mode_vertical, filter_horizontal, filter_vertical, space, alloc_context) != 0; + } + + /** + * Full-complexity version of {@link #stbir_resize_uint8_generic resize_uint8_generic}. + * + * @param input_pixels the source image data + * @param input_w the source image width + * @param input_h the source image height + * @param input_stride_in_bytes the offset between successive rows of the source image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param output_pixels returns the scaled image data + * @param output_w the resized image width + * @param output_h the resized image height + * @param output_stride_in_bytes the offset between successive rows of the resized image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param datatype the image data type. One of:
{@link #STBIR_TYPE_UINT8 TYPE_UINT8}{@link #STBIR_TYPE_UINT16 TYPE_UINT16}{@link #STBIR_TYPE_UINT32 TYPE_UINT32}{@link #STBIR_TYPE_FLOAT TYPE_FLOAT}
+ * @param num_channels the number of channels in the image (e.g. RGB=3, RGBA=4) + * @param alpha_channel the alpha channel index, or {@link #STBIR_ALPHA_CHANNEL_NONE ALPHA_CHANNEL_NONE} if there is no alpha channel + * @param flags the alpha channel flags. 0 will propably do the right thing if you're not sure what the flags mean. One of:
{@link #STBIR_FLAG_ALPHA_PREMULTIPLIED FLAG_ALPHA_PREMULTIPLIED}{@link #STBIR_FLAG_ALPHA_USES_COLORSPACE FLAG_ALPHA_USES_COLORSPACE}
+ * @param edge_mode_horizontal the horizontal edge wrap mode + * @param edge_mode_vertical the vertical edge wrap mode + * @param filter_horizontal the horizontal scale filter + * @param filter_vertical the vertical scale filter + * @param space the image colorspace. One of:
{@link #STBIR_COLORSPACE_LINEAR COLORSPACE_LINEAR}{@link #STBIR_COLORSPACE_SRGB COLORSPACE_SRGB}
+ * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbir_resize(@NativeType("void const *") ByteBuffer input_pixels, int input_w, int input_h, int input_stride_in_bytes, @NativeType("void *") ByteBuffer output_pixels, int output_w, int output_h, int output_stride_in_bytes, @NativeType("stbir_datatype") int datatype, int num_channels, int alpha_channel, int flags, @NativeType("stbir_edge") int edge_mode_horizontal, @NativeType("stbir_edge") int edge_mode_vertical, @NativeType("stbir_filter") int filter_horizontal, @NativeType("stbir_filter") int filter_vertical, @NativeType("stbir_colorspace") int space) { + if (CHECKS) { + check(input_pixels, input_h * (input_stride_in_bytes == 0 ? (input_w * num_channels) << getTypeShift(datatype) : input_stride_in_bytes)); + check(output_pixels, output_h * (output_stride_in_bytes == 0 ? (output_w * num_channels) << getTypeShift(datatype) : output_stride_in_bytes)); + } + return nstbir_resize(memAddress(input_pixels), input_w, input_h, input_stride_in_bytes, memAddress(output_pixels), output_w, output_h, output_stride_in_bytes, datatype, num_channels, alpha_channel, flags, edge_mode_horizontal, edge_mode_vertical, filter_horizontal, filter_vertical, space, NULL) != 0; + } + + // --- [ stbir_resize_subpixel ] --- + + /** Unsafe version of: {@link #stbir_resize_subpixel resize_subpixel} */ + public static native int nstbir_resize_subpixel(long input_pixels, int input_w, int input_h, int input_stride_in_bytes, long output_pixels, int output_w, int output_h, int output_stride_in_bytes, int datatype, int num_channels, int alpha_channel, int flags, int edge_mode_horizontal, int edge_mode_vertical, int filter_horizontal, int filter_vertical, int space, long alloc_context, float x_scale, float y_scale, float x_offset, float y_offset); + + /** + * Subpixel version of {@link #stbir_resize resize}. + * + * @param input_pixels the source image data + * @param input_w the source image width + * @param input_h the source image height + * @param input_stride_in_bytes the offset between successive rows of the source image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param output_pixels returns the scaled image data + * @param output_w the resized image width + * @param output_h the resized image height + * @param output_stride_in_bytes the offset between successive rows of the resized image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param datatype the image data type. One of:
{@link #STBIR_TYPE_UINT8 TYPE_UINT8}{@link #STBIR_TYPE_UINT16 TYPE_UINT16}{@link #STBIR_TYPE_UINT32 TYPE_UINT32}{@link #STBIR_TYPE_FLOAT TYPE_FLOAT}
+ * @param num_channels the number of channels in the image (e.g. RGB=3, RGBA=4) + * @param alpha_channel the alpha channel index, or {@link #STBIR_ALPHA_CHANNEL_NONE ALPHA_CHANNEL_NONE} if there is no alpha channel + * @param flags the alpha channel flags. 0 will propably do the right thing if you're not sure what the flags mean. One of:
{@link #STBIR_FLAG_ALPHA_PREMULTIPLIED FLAG_ALPHA_PREMULTIPLIED}{@link #STBIR_FLAG_ALPHA_USES_COLORSPACE FLAG_ALPHA_USES_COLORSPACE}
+ * @param edge_mode_horizontal the horizontal edge wrap mode + * @param edge_mode_vertical the vertical edge wrap mode + * @param filter_horizontal the horizontal scale filter + * @param filter_vertical the vertical scale filter + * @param space the image colorspace. One of:
{@link #STBIR_COLORSPACE_LINEAR COLORSPACE_LINEAR}{@link #STBIR_COLORSPACE_SRGB COLORSPACE_SRGB}
+ * @param alloc_context pointer to the allocation context + * @param x_scale horizontal scale for subpixel correctness + * @param y_scale vertical scale for subpixel correctness + * @param x_offset horizontal offset for subpixel correctness + * @param y_offset vertical offset for subpixel correctness + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbir_resize_subpixel(@NativeType("void const *") ByteBuffer input_pixels, int input_w, int input_h, int input_stride_in_bytes, @NativeType("void *") ByteBuffer output_pixels, int output_w, int output_h, int output_stride_in_bytes, @NativeType("stbir_datatype") int datatype, int num_channels, int alpha_channel, int flags, @NativeType("stbir_edge") int edge_mode_horizontal, @NativeType("stbir_edge") int edge_mode_vertical, @NativeType("stbir_filter") int filter_horizontal, @NativeType("stbir_filter") int filter_vertical, @NativeType("stbir_colorspace") int space, @NativeType("void *") long alloc_context, float x_scale, float y_scale, float x_offset, float y_offset) { + if (CHECKS) { + check(input_pixels, input_h * (input_stride_in_bytes == 0 ? (input_w * num_channels) << getTypeShift(datatype) : input_stride_in_bytes)); + check(output_pixels, output_h * (output_stride_in_bytes == 0 ? (output_w * num_channels) << getTypeShift(datatype) : output_stride_in_bytes)); + check(alloc_context); + } + return nstbir_resize_subpixel(memAddress(input_pixels), input_w, input_h, input_stride_in_bytes, memAddress(output_pixels), output_w, output_h, output_stride_in_bytes, datatype, num_channels, alpha_channel, flags, edge_mode_horizontal, edge_mode_vertical, filter_horizontal, filter_vertical, space, alloc_context, x_scale, y_scale, x_offset, y_offset) != 0; + } + + /** + * Subpixel version of {@link #stbir_resize resize}. + * + * @param input_pixels the source image data + * @param input_w the source image width + * @param input_h the source image height + * @param input_stride_in_bytes the offset between successive rows of the source image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param output_pixels returns the scaled image data + * @param output_w the resized image width + * @param output_h the resized image height + * @param output_stride_in_bytes the offset between successive rows of the resized image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param datatype the image data type. One of:
{@link #STBIR_TYPE_UINT8 TYPE_UINT8}{@link #STBIR_TYPE_UINT16 TYPE_UINT16}{@link #STBIR_TYPE_UINT32 TYPE_UINT32}{@link #STBIR_TYPE_FLOAT TYPE_FLOAT}
+ * @param num_channels the number of channels in the image (e.g. RGB=3, RGBA=4) + * @param alpha_channel the alpha channel index, or {@link #STBIR_ALPHA_CHANNEL_NONE ALPHA_CHANNEL_NONE} if there is no alpha channel + * @param flags the alpha channel flags. 0 will propably do the right thing if you're not sure what the flags mean. One of:
{@link #STBIR_FLAG_ALPHA_PREMULTIPLIED FLAG_ALPHA_PREMULTIPLIED}{@link #STBIR_FLAG_ALPHA_USES_COLORSPACE FLAG_ALPHA_USES_COLORSPACE}
+ * @param edge_mode_horizontal the horizontal edge wrap mode + * @param edge_mode_vertical the vertical edge wrap mode + * @param filter_horizontal the horizontal scale filter + * @param filter_vertical the vertical scale filter + * @param space the image colorspace. One of:
{@link #STBIR_COLORSPACE_LINEAR COLORSPACE_LINEAR}{@link #STBIR_COLORSPACE_SRGB COLORSPACE_SRGB}
+ * @param x_scale horizontal scale for subpixel correctness + * @param y_scale vertical scale for subpixel correctness + * @param x_offset horizontal offset for subpixel correctness + * @param y_offset vertical offset for subpixel correctness + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbir_resize_subpixel(@NativeType("void const *") ByteBuffer input_pixels, int input_w, int input_h, int input_stride_in_bytes, @NativeType("void *") ByteBuffer output_pixels, int output_w, int output_h, int output_stride_in_bytes, @NativeType("stbir_datatype") int datatype, int num_channels, int alpha_channel, int flags, @NativeType("stbir_edge") int edge_mode_horizontal, @NativeType("stbir_edge") int edge_mode_vertical, @NativeType("stbir_filter") int filter_horizontal, @NativeType("stbir_filter") int filter_vertical, @NativeType("stbir_colorspace") int space, float x_scale, float y_scale, float x_offset, float y_offset) { + if (CHECKS) { + check(input_pixels, input_h * (input_stride_in_bytes == 0 ? (input_w * num_channels) << getTypeShift(datatype) : input_stride_in_bytes)); + check(output_pixels, output_h * (output_stride_in_bytes == 0 ? (output_w * num_channels) << getTypeShift(datatype) : output_stride_in_bytes)); + } + return nstbir_resize_subpixel(memAddress(input_pixels), input_w, input_h, input_stride_in_bytes, memAddress(output_pixels), output_w, output_h, output_stride_in_bytes, datatype, num_channels, alpha_channel, flags, edge_mode_horizontal, edge_mode_vertical, filter_horizontal, filter_vertical, space, NULL, x_scale, y_scale, x_offset, y_offset) != 0; + } + + // --- [ stbir_resize_region ] --- + + /** Unsafe version of: {@link #stbir_resize_region resize_region} */ + public static native int nstbir_resize_region(long input_pixels, int input_w, int input_h, int input_stride_in_bytes, long output_pixels, int output_w, int output_h, int output_stride_in_bytes, int datatype, int num_channels, int alpha_channel, int flags, int edge_mode_horizontal, int edge_mode_vertical, int filter_horizontal, int filter_vertical, int space, long alloc_context, float s0, float t0, float s1, float t1); + + /** + * Region version of {@link #stbir_resize resize}, using texture coordinates. + * + * @param input_pixels the source image data + * @param input_w the source image width + * @param input_h the source image height + * @param input_stride_in_bytes the offset between successive rows of the source image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param output_pixels returns the scaled image data + * @param output_w the resized image width + * @param output_h the resized image height + * @param output_stride_in_bytes the offset between successive rows of the resized image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param datatype the image data type. One of:
{@link #STBIR_TYPE_UINT8 TYPE_UINT8}{@link #STBIR_TYPE_UINT16 TYPE_UINT16}{@link #STBIR_TYPE_UINT32 TYPE_UINT32}{@link #STBIR_TYPE_FLOAT TYPE_FLOAT}
+ * @param num_channels the number of channels in the image (e.g. RGB=3, RGBA=4) + * @param alpha_channel the alpha channel index, or {@link #STBIR_ALPHA_CHANNEL_NONE ALPHA_CHANNEL_NONE} if there is no alpha channel + * @param flags the alpha channel flags. 0 will propably do the right thing if you're not sure what the flags mean. One of:
{@link #STBIR_FLAG_ALPHA_PREMULTIPLIED FLAG_ALPHA_PREMULTIPLIED}{@link #STBIR_FLAG_ALPHA_USES_COLORSPACE FLAG_ALPHA_USES_COLORSPACE}
+ * @param edge_mode_horizontal the horizontal edge wrap mode + * @param edge_mode_vertical the vertical edge wrap mode + * @param filter_horizontal the horizontal scale filter + * @param filter_vertical the vertical scale filter + * @param space the image colorspace. One of:
{@link #STBIR_COLORSPACE_LINEAR COLORSPACE_LINEAR}{@link #STBIR_COLORSPACE_SRGB COLORSPACE_SRGB}
+ * @param alloc_context pointer to the allocation context + * @param s0 the left texture coordinate of the region to scale + * @param t0 the top texture coordinate of the region to scale + * @param s1 the right texture coordinate of the region to scale + * @param t1 the bottom texture coordinate of the region to scale + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbir_resize_region(@NativeType("void const *") ByteBuffer input_pixels, int input_w, int input_h, int input_stride_in_bytes, @NativeType("void *") ByteBuffer output_pixels, int output_w, int output_h, int output_stride_in_bytes, @NativeType("stbir_datatype") int datatype, int num_channels, int alpha_channel, int flags, @NativeType("stbir_edge") int edge_mode_horizontal, @NativeType("stbir_edge") int edge_mode_vertical, @NativeType("stbir_filter") int filter_horizontal, @NativeType("stbir_filter") int filter_vertical, @NativeType("stbir_colorspace") int space, @NativeType("void *") long alloc_context, float s0, float t0, float s1, float t1) { + if (CHECKS) { + check(input_pixels, input_h * (input_stride_in_bytes == 0 ? (input_w * num_channels) << getTypeShift(datatype) : input_stride_in_bytes)); + check(output_pixels, output_h * (output_stride_in_bytes == 0 ? (output_w * num_channels) << getTypeShift(datatype) : output_stride_in_bytes)); + check(alloc_context); + } + return nstbir_resize_region(memAddress(input_pixels), input_w, input_h, input_stride_in_bytes, memAddress(output_pixels), output_w, output_h, output_stride_in_bytes, datatype, num_channels, alpha_channel, flags, edge_mode_horizontal, edge_mode_vertical, filter_horizontal, filter_vertical, space, alloc_context, s0, t0, s1, t1) != 0; + } + + /** + * Region version of {@link #stbir_resize resize}, using texture coordinates. + * + * @param input_pixels the source image data + * @param input_w the source image width + * @param input_h the source image height + * @param input_stride_in_bytes the offset between successive rows of the source image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param output_pixels returns the scaled image data + * @param output_w the resized image width + * @param output_h the resized image height + * @param output_stride_in_bytes the offset between successive rows of the resized image data in memory, in bytes. You can specify 0 to mean packed continuously in memory + * @param datatype the image data type. One of:
{@link #STBIR_TYPE_UINT8 TYPE_UINT8}{@link #STBIR_TYPE_UINT16 TYPE_UINT16}{@link #STBIR_TYPE_UINT32 TYPE_UINT32}{@link #STBIR_TYPE_FLOAT TYPE_FLOAT}
+ * @param num_channels the number of channels in the image (e.g. RGB=3, RGBA=4) + * @param alpha_channel the alpha channel index, or {@link #STBIR_ALPHA_CHANNEL_NONE ALPHA_CHANNEL_NONE} if there is no alpha channel + * @param flags the alpha channel flags. 0 will propably do the right thing if you're not sure what the flags mean. One of:
{@link #STBIR_FLAG_ALPHA_PREMULTIPLIED FLAG_ALPHA_PREMULTIPLIED}{@link #STBIR_FLAG_ALPHA_USES_COLORSPACE FLAG_ALPHA_USES_COLORSPACE}
+ * @param edge_mode_horizontal the horizontal edge wrap mode + * @param edge_mode_vertical the vertical edge wrap mode + * @param filter_horizontal the horizontal scale filter + * @param filter_vertical the vertical scale filter + * @param space the image colorspace. One of:
{@link #STBIR_COLORSPACE_LINEAR COLORSPACE_LINEAR}{@link #STBIR_COLORSPACE_SRGB COLORSPACE_SRGB}
+ * @param s0 the left texture coordinate of the region to scale + * @param t0 the top texture coordinate of the region to scale + * @param s1 the right texture coordinate of the region to scale + * @param t1 the bottom texture coordinate of the region to scale + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbir_resize_region(@NativeType("void const *") ByteBuffer input_pixels, int input_w, int input_h, int input_stride_in_bytes, @NativeType("void *") ByteBuffer output_pixels, int output_w, int output_h, int output_stride_in_bytes, @NativeType("stbir_datatype") int datatype, int num_channels, int alpha_channel, int flags, @NativeType("stbir_edge") int edge_mode_horizontal, @NativeType("stbir_edge") int edge_mode_vertical, @NativeType("stbir_filter") int filter_horizontal, @NativeType("stbir_filter") int filter_vertical, @NativeType("stbir_colorspace") int space, float s0, float t0, float s1, float t1) { + if (CHECKS) { + check(input_pixels, input_h * (input_stride_in_bytes == 0 ? (input_w * num_channels) << getTypeShift(datatype) : input_stride_in_bytes)); + check(output_pixels, output_h * (output_stride_in_bytes == 0 ? (output_w * num_channels) << getTypeShift(datatype) : output_stride_in_bytes)); + } + return nstbir_resize_region(memAddress(input_pixels), input_w, input_h, input_stride_in_bytes, memAddress(output_pixels), output_w, output_h, output_stride_in_bytes, datatype, num_channels, alpha_channel, flags, edge_mode_horizontal, edge_mode_vertical, filter_horizontal, filter_vertical, space, NULL, s0, t0, s1, t1) != 0; + } + + /** Array version of: {@link #nstbir_resize_float} */ + public static native int nstbir_resize_float(float[] input_pixels, int input_w, int input_h, int input_stride_in_bytes, float[] output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels); + + /** Array version of: {@link #stbir_resize_float resize_float} */ + @NativeType("int") + public static boolean stbir_resize_float(@NativeType("float const *") float[] input_pixels, int input_w, int input_h, int input_stride_in_bytes, @NativeType("float *") float[] output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels) { + if (CHECKS) { + check(input_pixels, input_h * (input_stride_in_bytes == 0 ? input_w * num_channels : (input_stride_in_bytes >> 2))); + check(output_pixels, output_h * (output_stride_in_bytes == 0 ? output_w * num_channels : (output_stride_in_bytes >> 2))); + } + return nstbir_resize_float(input_pixels, input_w, input_h, input_stride_in_bytes, output_pixels, output_w, output_h, output_stride_in_bytes, num_channels) != 0; + } + + /** Array version of: {@link #nstbir_resize_uint16_generic} */ + public static native int nstbir_resize_uint16_generic(short[] input_pixels, int input_w, int input_h, int input_stride_in_bytes, short[] output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels, int alpha_channel, int flags, int edge_wrap_mode, int filter, int space, long alloc_context); + + /** Array version of: {@link #stbir_resize_uint16_generic resize_uint16_generic} */ + @NativeType("int") + public static boolean stbir_resize_uint16_generic(@NativeType("stbir_uint16 const *") short[] input_pixels, int input_w, int input_h, int input_stride_in_bytes, @NativeType("stbir_uint16 *") short[] output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels, int alpha_channel, int flags, @NativeType("stbir_edge") int edge_wrap_mode, @NativeType("stbir_filter") int filter, @NativeType("stbir_colorspace") int space, @NativeType("void *") long alloc_context) { + if (CHECKS) { + check(input_pixels, input_h * (input_stride_in_bytes == 0 ? input_w * num_channels : (input_stride_in_bytes >> 1))); + check(output_pixels, output_h * (output_stride_in_bytes == 0 ? output_w * num_channels : (output_stride_in_bytes >> 1))); + check(alloc_context); + } + return nstbir_resize_uint16_generic(input_pixels, input_w, input_h, input_stride_in_bytes, output_pixels, output_w, output_h, output_stride_in_bytes, num_channels, alpha_channel, flags, edge_wrap_mode, filter, space, alloc_context) != 0; + } + + /** Array version of: {@link #stbir_resize_uint16_generic resize_uint16_generic} */ + @NativeType("int") + public static boolean stbir_resize_uint16_generic(@NativeType("stbir_uint16 const *") short[] input_pixels, int input_w, int input_h, int input_stride_in_bytes, @NativeType("stbir_uint16 *") short[] output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels, int alpha_channel, int flags, @NativeType("stbir_edge") int edge_wrap_mode, @NativeType("stbir_filter") int filter, @NativeType("stbir_colorspace") int space) { + if (CHECKS) { + check(input_pixels, input_h * (input_stride_in_bytes == 0 ? input_w * num_channels : (input_stride_in_bytes >> 1))); + check(output_pixels, output_h * (output_stride_in_bytes == 0 ? output_w * num_channels : (output_stride_in_bytes >> 1))); + } + return nstbir_resize_uint16_generic(input_pixels, input_w, input_h, input_stride_in_bytes, output_pixels, output_w, output_h, output_stride_in_bytes, num_channels, alpha_channel, flags, edge_wrap_mode, filter, space, NULL) != 0; + } + + /** Array version of: {@link #nstbir_resize_float_generic} */ + public static native int nstbir_resize_float_generic(float[] input_pixels, int input_w, int input_h, int input_stride_in_bytes, float[] output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels, int alpha_channel, int flags, int edge_wrap_mode, int filter, int space, long alloc_context); + + /** Array version of: {@link #stbir_resize_float_generic resize_float_generic} */ + @NativeType("int") + public static boolean stbir_resize_float_generic(@NativeType("float const *") float[] input_pixels, int input_w, int input_h, int input_stride_in_bytes, @NativeType("float *") float[] output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels, int alpha_channel, int flags, @NativeType("stbir_edge") int edge_wrap_mode, @NativeType("stbir_filter") int filter, @NativeType("stbir_colorspace") int space, @NativeType("void *") long alloc_context) { + if (CHECKS) { + check(input_pixels, input_h * (input_stride_in_bytes == 0 ? input_w * num_channels : (input_stride_in_bytes >> 2))); + check(output_pixels, output_h * (output_stride_in_bytes == 0 ? output_w * num_channels : (output_stride_in_bytes >> 2))); + check(alloc_context); + } + return nstbir_resize_float_generic(input_pixels, input_w, input_h, input_stride_in_bytes, output_pixels, output_w, output_h, output_stride_in_bytes, num_channels, alpha_channel, flags, edge_wrap_mode, filter, space, alloc_context) != 0; + } + + /** Array version of: {@link #stbir_resize_float_generic resize_float_generic} */ + @NativeType("int") + public static boolean stbir_resize_float_generic(@NativeType("float const *") float[] input_pixels, int input_w, int input_h, int input_stride_in_bytes, @NativeType("float *") float[] output_pixels, int output_w, int output_h, int output_stride_in_bytes, int num_channels, int alpha_channel, int flags, @NativeType("stbir_edge") int edge_wrap_mode, @NativeType("stbir_filter") int filter, @NativeType("stbir_colorspace") int space) { + if (CHECKS) { + check(input_pixels, input_h * (input_stride_in_bytes == 0 ? input_w * num_channels : (input_stride_in_bytes >> 2))); + check(output_pixels, output_h * (output_stride_in_bytes == 0 ? output_w * num_channels : (output_stride_in_bytes >> 2))); + } + return nstbir_resize_float_generic(input_pixels, input_w, input_h, input_stride_in_bytes, output_pixels, output_w, output_h, output_stride_in_bytes, num_channels, alpha_channel, flags, edge_wrap_mode, filter, space, NULL) != 0; + } + + private static int getTypeShift(int type) { + switch (type) { + case STBIR_TYPE_UINT8: + return 0; + case STBIR_TYPE_UINT16: + return 1; + default: + return 2; + } + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBImageWrite.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBImageWrite.java new file mode 100644 index 00000000..20c6edf5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBImageWrite.java @@ -0,0 +1,611 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to stb_image_write.h from the stb library. + * + *

ABOUT

+ * + *

This header file is a library for writing images to C stdio.

+ * + *

The PNG output is not optimal; it is 20-50% larger than the file written by a decent optimizing implementation; though providing a custom zlib compress + * function (see {@link #stbi_zlib_compress zlib_compress}) can mitigate that. This library is designed for source code compactness and simplicity, not optimal image + * file size or run-time performance.

+ * + *

USAGE

+ * + *

There are five functions, one for each image file format:

+ * + *

+ * int stbi_write_png(char const *filename, int w, int h, int comp, const void *data, int stride_in_bytes);
+ * int stbi_write_bmp(char const *filename, int w, int h, int comp, const void *data);
+ * int stbi_write_tga(char const *filename, int w, int h, int comp, const void *data);
+ * int stbi_write_hdr(char const *filename, int w, int h, int comp, const void *data);
+ * int stbi_write_jpg(char const *filename, int w, int h, int comp, const float *data, int quality);
+ * 
+ * void stbi_flip_vertically_on_write(int flag); // flag is non-zero to flip data vertically
+ * + *

There are also five equivalent functions that use an arbitrary write function. You are expected to open/close your file-equivalent before and after + * calling these:

+ * + *

+ * int stbi_write_png_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void  *data, int stride_in_bytes);
+ * int stbi_write_bmp_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void  *data);
+ * int stbi_write_tga_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const void  *data);
+ * int stbi_write_hdr_to_func(stbi_write_func *func, void *context, int w, int h, int comp, const float *data);
+ * int stbi_write_jpg_to_func(stbi_write_func *func, void *context, int x, int y, int comp, const void *data, int quality);
+ * + *

where the callback is:

+ * + *

+ * void stbi_write_func(void *context, void *data, int size);
+ * + *

You can configure it with these global variables:

+ * + *

+ * int stbi_write_tga_with_rle;             // defaults to true; set to 0 to disable RLE
+ * int stbi_write_png_compression_level;    // defaults to 8; set to higher for more compression
+ * int stbi_write_force_png_filter;         // defaults to -1; set to 0..5 to force a filter mode
+ * + *

The functions create an image file defined by the parameters. The image is a rectangle of pixels stored from left-to-right, top-to-bottom. Each pixel + * contains {@code comp} channels of data stored interleaved with 8-bits per channel, in the following order: 1=Y, 2=YA, 3=RGB, 4=RGBA. (Y is monochrome + * color.) The rectangle is {@code w} pixels wide and {@code h} pixels tall. The {@code *data} pointer points to the first byte of the top-left-most + * pixel.

+ */ +public class STBImageWrite { + + static { LibSTB.initialize(); } + + protected STBImageWrite() { + throw new UnsupportedOperationException(); + } + + // --- [ stbi_write_png ] --- + + /** Unsafe version of: {@link #stbi_write_png write_png} */ + public static native int nstbi_write_png(long filename, int w, int h, int comp, long data, int stride_in_bytes); + + /** + * Writes a PNR image file. + * + *

PNG creates output files with the same number of components as the input.

+ * + *

PNG supports writing rectangles of data even when the bytes storing rows of data are not consecutive in memory (e.g. sub-rectangles of a larger image), + * by supplying the stride between the beginning of adjacent rows. The other formats do not. (Thus you cannot write a native-format BMP through the BMP + * writer, both because it is in BGR order and because it may have padding at the end of the line.)

+ * + *

PNG allows you to set the deflate compression level by setting the global variable {@link #stbi_write_png_compression_level write_png_compression_level} (it defaults to 8).

+ * + * @param filename the image file path + * @param w the image width, in pixels + * @param h the image height, in pixels + * @param comp the number of channels in each pixel + * @param data the image data + * @param stride_in_bytes the distance in bytes from the first byte of a row of pixels to the first byte of the next row of pixels + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbi_write_png(@NativeType("char const *") ByteBuffer filename, int w, int h, int comp, @NativeType("void const *") ByteBuffer data, int stride_in_bytes) { + if (CHECKS) { + checkNT1(filename); + check(data, (stride_in_bytes != 0 ? stride_in_bytes : w * comp) * h); + } + return nstbi_write_png(memAddress(filename), w, h, comp, memAddress(data), stride_in_bytes) != 0; + } + + /** + * Writes a PNR image file. + * + *

PNG creates output files with the same number of components as the input.

+ * + *

PNG supports writing rectangles of data even when the bytes storing rows of data are not consecutive in memory (e.g. sub-rectangles of a larger image), + * by supplying the stride between the beginning of adjacent rows. The other formats do not. (Thus you cannot write a native-format BMP through the BMP + * writer, both because it is in BGR order and because it may have padding at the end of the line.)

+ * + *

PNG allows you to set the deflate compression level by setting the global variable {@link #stbi_write_png_compression_level write_png_compression_level} (it defaults to 8).

+ * + * @param filename the image file path + * @param w the image width, in pixels + * @param h the image height, in pixels + * @param comp the number of channels in each pixel + * @param data the image data + * @param stride_in_bytes the distance in bytes from the first byte of a row of pixels to the first byte of the next row of pixels + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbi_write_png(@NativeType("char const *") CharSequence filename, int w, int h, int comp, @NativeType("void const *") ByteBuffer data, int stride_in_bytes) { + if (CHECKS) { + check(data, (stride_in_bytes != 0 ? stride_in_bytes : w * comp) * h); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(filename, true); + long filenameEncoded = stack.getPointerAddress(); + return nstbi_write_png(filenameEncoded, w, h, comp, memAddress(data), stride_in_bytes) != 0; + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stbi_write_png_compression_level ] --- + + private static native long nstbi_write_png_compression_level(); + + @NativeType("int *") + private static IntBuffer stbi_write_png_compression_level() { + long __result = nstbi_write_png_compression_level(); + return memIntBuffer(__result, 1); + } + + /** Returns the address of the global variable {@code stbi_write_png_compression_level}. */ + public static final IntBuffer stbi_write_png_compression_level = stbi_write_png_compression_level(); + + // --- [ stbi_write_force_png_filter ] --- + + private static native long nstbi_write_force_png_filter(); + + @NativeType("int *") + private static IntBuffer stbi_write_force_png_filter() { + long __result = nstbi_write_force_png_filter(); + return memIntBuffer(__result, 1); + } + + /** Returns the address of the global variable {@code stbi_write_force_png_filter}. */ + public static final IntBuffer stbi_write_force_png_filter = stbi_write_force_png_filter(); + + // --- [ stbi_zlib_compress ] --- + + private static native long nstbi_zlib_compress(); + + @NativeType("unsigned char * (*) (unsigned char *, int, int *, int) *") + private static PointerBuffer stbi_zlib_compress() { + long __result = nstbi_zlib_compress(); + return memPointerBuffer(__result, 1); + } + + /** + * Returns the address of the global variable {@code stbi_zlib_compress}. + * + *

The address of an {@link STBIZlibCompress} instance may be set to this variable, in order to override the Zlib compression implementation.

+ */ + public static final PointerBuffer stbi_zlib_compress = stbi_zlib_compress(); + + // --- [ stbi_write_bmp ] --- + + /** Unsafe version of: {@link #stbi_write_bmp write_bmp} */ + public static native int nstbi_write_bmp(long filename, int w, int h, int comp, long data); + + /** + * Writes a BMP image file. + * + *

The BMP format expands Y to RGB in the file format and does not output alpha.

+ * + * @param filename the image file path + * @param w the image width, in pixels + * @param h the image height, in pixels + * @param comp the number of channels in each pixel + * @param data the image data + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbi_write_bmp(@NativeType("char const *") ByteBuffer filename, int w, int h, int comp, @NativeType("void const *") ByteBuffer data) { + if (CHECKS) { + checkNT1(filename); + check(data, w * h * comp); + } + return nstbi_write_bmp(memAddress(filename), w, h, comp, memAddress(data)) != 0; + } + + /** + * Writes a BMP image file. + * + *

The BMP format expands Y to RGB in the file format and does not output alpha.

+ * + * @param filename the image file path + * @param w the image width, in pixels + * @param h the image height, in pixels + * @param comp the number of channels in each pixel + * @param data the image data + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbi_write_bmp(@NativeType("char const *") CharSequence filename, int w, int h, int comp, @NativeType("void const *") ByteBuffer data) { + if (CHECKS) { + check(data, w * h * comp); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(filename, true); + long filenameEncoded = stack.getPointerAddress(); + return nstbi_write_bmp(filenameEncoded, w, h, comp, memAddress(data)) != 0; + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stbi_write_tga ] --- + + /** Unsafe version of: {@link #stbi_write_tga write_tga} */ + public static native int nstbi_write_tga(long filename, int w, int h, int comp, long data); + + /** + * Writes a TGA image file. + * + *

TGA supports RLE or non-RLE compressed data. To use non-RLE-compressed data, set the global variable {@code stbi_write_tga_with_rle} to 0. The variable + * can be accessed with {@link #stbi_write_tga_with_rle write_tga_with_rle}.

+ * + * @param filename the image file path + * @param w the image width, in pixels + * @param h the image height, in pixels + * @param comp the number of channels in each pixel + * @param data the image data + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbi_write_tga(@NativeType("char const *") ByteBuffer filename, int w, int h, int comp, @NativeType("void const *") ByteBuffer data) { + if (CHECKS) { + checkNT1(filename); + check(data, w * h * comp); + } + return nstbi_write_tga(memAddress(filename), w, h, comp, memAddress(data)) != 0; + } + + /** + * Writes a TGA image file. + * + *

TGA supports RLE or non-RLE compressed data. To use non-RLE-compressed data, set the global variable {@code stbi_write_tga_with_rle} to 0. The variable + * can be accessed with {@link #stbi_write_tga_with_rle write_tga_with_rle}.

+ * + * @param filename the image file path + * @param w the image width, in pixels + * @param h the image height, in pixels + * @param comp the number of channels in each pixel + * @param data the image data + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbi_write_tga(@NativeType("char const *") CharSequence filename, int w, int h, int comp, @NativeType("void const *") ByteBuffer data) { + if (CHECKS) { + check(data, w * h * comp); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(filename, true); + long filenameEncoded = stack.getPointerAddress(); + return nstbi_write_tga(filenameEncoded, w, h, comp, memAddress(data)) != 0; + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stbi_write_tga_with_rle ] --- + + private static native long nstbi_write_tga_with_rle(); + + @NativeType("int *") + private static IntBuffer stbi_write_tga_with_rle() { + long __result = nstbi_write_tga_with_rle(); + return memIntBuffer(__result, 1); + } + + /** Returns the address of the global variable {@code stbi_write_tga_with_rle}. */ + public static final IntBuffer stbi_write_tga_with_rle = stbi_write_tga_with_rle(); + + // --- [ stbi_write_hdr ] --- + + /** Unsafe version of: {@link #stbi_write_hdr write_hdr} */ + public static native int nstbi_write_hdr(long filename, int w, int h, int comp, long data); + + /** + * Writes an HDR image file. + * + *

HDR expects linear float data. Since the format is always 32-bit rgb(e) data, alpha (if provided) is discarded, and for monochrome data it is + * replicated across all three channels.

+ * + * @param filename the image file path + * @param w the image width, in pixels + * @param h the image height, in pixels + * @param comp the number of channels in each pixel + * @param data the image data + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbi_write_hdr(@NativeType("char const *") ByteBuffer filename, int w, int h, int comp, @NativeType("float const *") FloatBuffer data) { + if (CHECKS) { + checkNT1(filename); + check(data, w * h * comp); + } + return nstbi_write_hdr(memAddress(filename), w, h, comp, memAddress(data)) != 0; + } + + /** + * Writes an HDR image file. + * + *

HDR expects linear float data. Since the format is always 32-bit rgb(e) data, alpha (if provided) is discarded, and for monochrome data it is + * replicated across all three channels.

+ * + * @param filename the image file path + * @param w the image width, in pixels + * @param h the image height, in pixels + * @param comp the number of channels in each pixel + * @param data the image data + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbi_write_hdr(@NativeType("char const *") CharSequence filename, int w, int h, int comp, @NativeType("float const *") FloatBuffer data) { + if (CHECKS) { + check(data, w * h * comp); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(filename, true); + long filenameEncoded = stack.getPointerAddress(); + return nstbi_write_hdr(filenameEncoded, w, h, comp, memAddress(data)) != 0; + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stbi_write_jpg ] --- + + /** Unsafe version of: {@link #stbi_write_jpg write_jpg} */ + public static native int nstbi_write_jpg(long filename, int w, int h, int comp, long data, int quality); + + /** + * Writes a JPEG image file. + * + *

JPEG does ignore alpha channels in input data; quality is between 1 and 100. Higher quality looks better but results in a bigger image. JPEG baseline + * (no JPEG progressive).

+ * + * @param filename the image file path + * @param w the image width, in pixels + * @param h the image height, in pixels + * @param comp the number of channels in each pixel + * @param data the image data + * @param quality the compression quality + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbi_write_jpg(@NativeType("char const *") ByteBuffer filename, int w, int h, int comp, @NativeType("void const *") ByteBuffer data, int quality) { + if (CHECKS) { + checkNT1(filename); + check(data, w * h * comp); + } + return nstbi_write_jpg(memAddress(filename), w, h, comp, memAddress(data), quality) != 0; + } + + /** + * Writes a JPEG image file. + * + *

JPEG does ignore alpha channels in input data; quality is between 1 and 100. Higher quality looks better but results in a bigger image. JPEG baseline + * (no JPEG progressive).

+ * + * @param filename the image file path + * @param w the image width, in pixels + * @param h the image height, in pixels + * @param comp the number of channels in each pixel + * @param data the image data + * @param quality the compression quality + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbi_write_jpg(@NativeType("char const *") CharSequence filename, int w, int h, int comp, @NativeType("void const *") ByteBuffer data, int quality) { + if (CHECKS) { + check(data, w * h * comp); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(filename, true); + long filenameEncoded = stack.getPointerAddress(); + return nstbi_write_jpg(filenameEncoded, w, h, comp, memAddress(data), quality) != 0; + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stbi_write_png_to_func ] --- + + /** Unsafe version of: {@link #stbi_write_png_to_func write_png_to_func} */ + public static native int nstbi_write_png_to_func(long func, long context, int w, int h, int comp, long data, int stride_in_bytes); + + /** + * Callback version of {@link #stbi_write_png write_png}. + * + * @param func the callback function + * @param context a context that will be passed to {@code func} + * @param w the image width, in pixels + * @param h the image height, in pixels + * @param comp the number of channels in each pixel + * @param data the image data + * @param stride_in_bytes the distance in bytes from the first byte of a row of pixels to the first byte of the next row of pixels + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbi_write_png_to_func(@NativeType("stbi_write_func *") STBIWriteCallbackI func, @NativeType("void *") long context, int w, int h, int comp, @NativeType("void const *") ByteBuffer data, int stride_in_bytes) { + if (CHECKS) { + check(data, (stride_in_bytes != 0 ? stride_in_bytes : w * comp) * h); + } + return nstbi_write_png_to_func(func.address(), context, w, h, comp, memAddress(data), stride_in_bytes) != 0; + } + + // --- [ stbi_write_bmp_to_func ] --- + + /** Unsafe version of: {@link #stbi_write_bmp_to_func write_bmp_to_func} */ + public static native int nstbi_write_bmp_to_func(long func, long context, int w, int h, int comp, long data); + + /** + * Callback version of {@link #stbi_write_bmp write_bmp}. + * + * @param func the callback function + * @param context a context that will be passed to {@code func} + * @param w the image width, in pixels + * @param h the image height, in pixels + * @param comp the number of channels in each pixel + * @param data the image data + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbi_write_bmp_to_func(@NativeType("stbi_write_func *") STBIWriteCallbackI func, @NativeType("void *") long context, int w, int h, int comp, @NativeType("void const *") ByteBuffer data) { + if (CHECKS) { + check(data, w * h * comp); + } + return nstbi_write_bmp_to_func(func.address(), context, w, h, comp, memAddress(data)) != 0; + } + + // --- [ stbi_write_tga_to_func ] --- + + /** Unsafe version of: {@link #stbi_write_tga_to_func write_tga_to_func} */ + public static native int nstbi_write_tga_to_func(long func, long context, int w, int h, int comp, long data); + + /** + * Callback version of {@link #stbi_write_tga write_tga}. + * + * @param func the callback function + * @param context a context that will be passed to {@code func} + * @param w the image width, in pixels + * @param h the image height, in pixels + * @param comp the number of channels in each pixel + * @param data the image data + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbi_write_tga_to_func(@NativeType("stbi_write_func *") STBIWriteCallbackI func, @NativeType("void *") long context, int w, int h, int comp, @NativeType("void const *") ByteBuffer data) { + if (CHECKS) { + check(data, w * h * comp); + } + return nstbi_write_tga_to_func(func.address(), context, w, h, comp, memAddress(data)) != 0; + } + + // --- [ stbi_write_hdr_to_func ] --- + + /** Unsafe version of: {@link #stbi_write_hdr_to_func write_hdr_to_func} */ + public static native int nstbi_write_hdr_to_func(long func, long context, int w, int h, int comp, long data); + + /** + * Callback version of {@link #stbi_write_hdr write_hdr}. + * + * @param func the callback function + * @param context a context that will be passed to {@code func} + * @param w the image width, in pixels + * @param h the image height, in pixels + * @param comp the number of channels in each pixel + * @param data the image data + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbi_write_hdr_to_func(@NativeType("stbi_write_func *") STBIWriteCallbackI func, @NativeType("void *") long context, int w, int h, int comp, @NativeType("float const *") FloatBuffer data) { + if (CHECKS) { + check(data, w * h * comp); + } + return nstbi_write_hdr_to_func(func.address(), context, w, h, comp, memAddress(data)) != 0; + } + + // --- [ stbi_write_jpg_to_func ] --- + + /** Unsafe version of: {@link #stbi_write_jpg_to_func write_jpg_to_func} */ + public static native int nstbi_write_jpg_to_func(long func, long context, int w, int h, int comp, long data, int quality); + + /** + * Callback version of {@link #stbi_write_jpg write_jpg}. + * + * @param func the callback function + * @param context a context that will be passed to {@code func} + * @param w the image width, in pixels + * @param h the image height, in pixels + * @param comp the number of channels in each pixel + * @param data the image data + * @param quality the compression quality + * + * @return 1 on success, 0 on failure + */ + public static int stbi_write_jpg_to_func(@NativeType("stbi_write_func *") STBIWriteCallbackI func, @NativeType("void *") long context, int w, int h, int comp, @NativeType("void const *") ByteBuffer data, int quality) { + if (CHECKS) { + check(data, w * h * comp); + } + return nstbi_write_jpg_to_func(func.address(), context, w, h, comp, memAddress(data), quality); + } + + // --- [ stbi_flip_vertically_on_write ] --- + + /** Unsafe version of: {@link #stbi_flip_vertically_on_write flip_vertically_on_write} */ + public static native void nstbi_flip_vertically_on_write(int flip_boolean); + + /** + * Configures if the written image should flipped vertically. + * + * @param flip_boolean true to flip data vertically + */ + public static void stbi_flip_vertically_on_write(@NativeType("int") boolean flip_boolean) { + nstbi_flip_vertically_on_write(flip_boolean ? 1 : 0); + } + + /** Array version of: {@link #nstbi_write_hdr} */ + public static native int nstbi_write_hdr(long filename, int w, int h, int comp, float[] data); + + /** Array version of: {@link #stbi_write_hdr write_hdr} */ + @NativeType("int") + public static boolean stbi_write_hdr(@NativeType("char const *") ByteBuffer filename, int w, int h, int comp, @NativeType("float const *") float[] data) { + if (CHECKS) { + checkNT1(filename); + check(data, w * h * comp); + } + return nstbi_write_hdr(memAddress(filename), w, h, comp, data) != 0; + } + + /** Array version of: {@link #stbi_write_hdr write_hdr} */ + @NativeType("int") + public static boolean stbi_write_hdr(@NativeType("char const *") CharSequence filename, int w, int h, int comp, @NativeType("float const *") float[] data) { + if (CHECKS) { + check(data, w * h * comp); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(filename, true); + long filenameEncoded = stack.getPointerAddress(); + return nstbi_write_hdr(filenameEncoded, w, h, comp, data) != 0; + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #nstbi_write_hdr_to_func} */ + public static native int nstbi_write_hdr_to_func(long func, long context, int w, int h, int comp, float[] data); + + /** Array version of: {@link #stbi_write_hdr_to_func write_hdr_to_func} */ + @NativeType("int") + public static boolean stbi_write_hdr_to_func(@NativeType("stbi_write_func *") STBIWriteCallbackI func, @NativeType("void *") long context, int w, int h, int comp, @NativeType("float const *") float[] data) { + if (CHECKS) { + check(data, w * h * comp); + } + return nstbi_write_hdr_to_func(func.address(), context, w, h, comp, data) != 0; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBPerlin.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBPerlin.java new file mode 100644 index 00000000..399d0fae --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBPerlin.java @@ -0,0 +1,108 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import org.lwjgl.system.*; + + +/** + * Native bindings to stb_perlin.h from the stb library. + * + *

Revised Perlin noise (3D input, 1D output).

+ */ +public class STBPerlin { + + static { LibSTB.initialize(); } + + protected STBPerlin() { + throw new UnsupportedOperationException(); + } + + // --- [ stb_perlin_noise3 ] --- + + /** + * Computes a random value at the coordinate (x,y,z). + * + *

Adjacent random values are continuous but the noise fluctuates its randomness with period 1, i.e. takes on wholly unrelated values at integer points. + * Specifically, this implements Ken Perlin's revised noise function from 2002.

+ * + *

The "wrap" parameters can be used to create wraparound noise that wraps at powers of two. The numbers MUST be powers of two. Specify 0 to mean "don't + * care". (The noise always wraps every 256 due details of the implementation, even if you ask for larger or no wrapping.)

+ * + * @param x the x coordinate + * @param y the y coordinate + * @param z the z coordinate + * @param x_wrap 0, or a power of two value that specifies the x wraparound coordinate + * @param y_wrap 0, or a power of two value that specifies the y wraparound coordinate + * @param z_wrap 0, or a power of two value that specifies the z wraparound coordinate + */ + public static native float stb_perlin_noise3(float x, float y, float z, int x_wrap, int y_wrap, int z_wrap); + + // --- [ stb_perlin_noise3_seed ] --- + + /** + * As {@link #stb_perlin_noise3 perlin_noise3}, but {@code seed} selects from multiple different variations of the noise function. + * + *

The current implementation only uses the bottom 8 bits of {@code seed}, but possibly in the future more bits will be used.

+ * + * @param x the x coordinate + * @param y the y coordinate + * @param z the z coordinate + * @param x_wrap 0, or a power of two value that specifies the x wraparound coordinate + * @param y_wrap 0, or a power of two value that specifies the y wraparound coordinate + * @param z_wrap 0, or a power of two value that specifies the z wraparound coordinate + * @param seed selects from multiple different variations of the noise function + */ + public static native float stb_perlin_noise3_seed(float x, float y, float z, int x_wrap, int y_wrap, int z_wrap, int seed); + + // --- [ stb_perlin_ridge_noise3 ] --- + + /** + * Computes ridged noise. Calls {@link #stb_perlin_noise3 perlin_noise3} {@code octaves} times, so this parameter will affect runtime. + * + * @param x the x coordinate + * @param y the y coordinate + * @param z the z coordinate + * @param lacunarity spacing between successive octaves (use exactly 2.0 for wrapping output) + * @param gain relative weighting applied to each successive octave + * @param offset used to invert the ridges, may need to be larger, not sure + * @param octaves number of "octaves" of {@code noise3()} to sum + */ + public static native float stb_perlin_ridge_noise3(float x, float y, float z, float lacunarity, float gain, float offset, int octaves); + + // --- [ stb_perlin_fbm_noise3 ] --- + + /** + * Computes Fractal Brownian Motion noise. Calls {@link #stb_perlin_noise3 perlin_noise3} {@code octaves} times, so this parameter will affect runtime. + * + * @param x the x coordinate + * @param y the y coordinate + * @param z the z coordinate + * @param lacunarity spacing between successive octaves (use exactly 2.0 for wrapping output) + * @param gain relative weighting applied to each successive octave + * @param octaves number of "octaves" of {@code noise3()} to sum + */ + public static native float stb_perlin_fbm_noise3(float x, float y, float z, float lacunarity, float gain, int octaves); + + // --- [ stb_perlin_turbulence_noise3 ] --- + + /** + * Computes turbulence noise. Calls {@link #stb_perlin_noise3 perlin_noise3} {@code octaves} times, so this parameter will affect runtime. + * + * @param x the x coordinate + * @param y the y coordinate + * @param z the z coordinate + * @param lacunarity spacing between successive octaves (use exactly 2.0 for wrapping output) + * @param gain relative weighting applied to each successive octave + * @param octaves number of "octaves" of {@code noise3()} to sum + */ + public static native float stb_perlin_turbulence_noise3(float x, float y, float z, float lacunarity, float gain, int octaves); + + // --- [ stb_perlin_noise3_wrap_nonpow2 ] --- + + public static native float stb_perlin_noise3_wrap_nonpow2(float x, float y, float z, int x_wrap, int y_wrap, int z_wrap, @NativeType("unsigned char") byte seed); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBRPContext.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBRPContext.java new file mode 100644 index 00000000..37e2ff76 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBRPContext.java @@ -0,0 +1,364 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * The opaque {@code stbrp_context} struct. + * + *

Member documentation

+ * + *
    + *
  • {@code extra[2]} – we allocate two extra nodes so optimal user-node-count is {@code width} not {@code width+2}
  • + *
+ * + *

Layout

+ * + *

+ * struct stbrp_context {
+ *     int width;
+ *     int height;
+ *     int align;
+ *     int init_mode;
+ *     int heuristic;
+ *     int num_nodes;
+ *     {@link STBRPNode stbrp_node} * active_head;
+ *     {@link STBRPNode stbrp_node} * free_head;
+ *     {@link STBRPNode stbrp_node} extra[2];
+ * }
+ */ +@NativeType("struct stbrp_context") +public class STBRPContext extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + WIDTH, + HEIGHT, + ALIGN, + INIT_MODE, + HEURISTIC, + NUM_NODES, + ACTIVE_HEAD, + FREE_HEAD, + EXTRA; + + static { + Layout layout = __struct( + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __array(STBRPNode.SIZEOF, STBRPNode.ALIGNOF, 2) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + WIDTH = layout.offsetof(0); + HEIGHT = layout.offsetof(1); + ALIGN = layout.offsetof(2); + INIT_MODE = layout.offsetof(3); + HEURISTIC = layout.offsetof(4); + NUM_NODES = layout.offsetof(5); + ACTIVE_HEAD = layout.offsetof(6); + FREE_HEAD = layout.offsetof(7); + EXTRA = layout.offsetof(8); + } + + /** + * Creates a {@code STBRPContext} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public STBRPContext(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code width} field. */ + public int width() { return nwidth(address()); } + /** Returns the value of the {@code height} field. */ + public int height() { return nheight(address()); } + /** Returns the value of the {@code align} field. */ + public int align() { return nalign(address()); } + /** Returns the value of the {@code init_mode} field. */ + public int init_mode() { return ninit_mode(address()); } + /** Returns the value of the {@code heuristic} field. */ + public int heuristic() { return nheuristic(address()); } + /** Returns the value of the {@code num_nodes} field. */ + public int num_nodes() { return nnum_nodes(address()); } + /** Returns a {@link STBRPNode} view of the struct pointed to by the {@code active_head} field. */ + @Nullable + @NativeType("stbrp_node *") + public STBRPNode active_head() { return nactive_head(address()); } + /** Returns a {@link STBRPNode} view of the struct pointed to by the {@code free_head} field. */ + @Nullable + @NativeType("stbrp_node *") + public STBRPNode free_head() { return nfree_head(address()); } + /** Returns a {@link STBRPNode}.Buffer view of the {@code extra} field. */ + @NativeType("stbrp_node[2]") + public STBRPNode.Buffer extra() { return nextra(address()); } + /** Returns a {@link STBRPNode} view of the struct at the specified index of the {@code extra} field. */ + @NativeType("stbrp_node") + public STBRPNode extra(int index) { return nextra(address(), index); } + + // ----------------------------------- + + /** Returns a new {@code STBRPContext} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static STBRPContext malloc() { + return wrap(STBRPContext.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code STBRPContext} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static STBRPContext calloc() { + return wrap(STBRPContext.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code STBRPContext} instance allocated with {@link BufferUtils}. */ + public static STBRPContext create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(STBRPContext.class, memAddress(container), container); + } + + /** Returns a new {@code STBRPContext} instance for the specified memory address. */ + public static STBRPContext create(long address) { + return wrap(STBRPContext.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static STBRPContext createSafe(long address) { + return address == NULL ? null : wrap(STBRPContext.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code STBRPContext} instance allocated on the thread-local {@link MemoryStack}. */ + public static STBRPContext mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code STBRPContext} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static STBRPContext callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code STBRPContext} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static STBRPContext mallocStack(MemoryStack stack) { + return wrap(STBRPContext.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code STBRPContext} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static STBRPContext callocStack(MemoryStack stack) { + return wrap(STBRPContext.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #width}. */ + public static int nwidth(long struct) { return UNSAFE.getInt(null, struct + STBRPContext.WIDTH); } + /** Unsafe version of {@link #height}. */ + public static int nheight(long struct) { return UNSAFE.getInt(null, struct + STBRPContext.HEIGHT); } + /** Unsafe version of {@link #align}. */ + public static int nalign(long struct) { return UNSAFE.getInt(null, struct + STBRPContext.ALIGN); } + /** Unsafe version of {@link #init_mode}. */ + public static int ninit_mode(long struct) { return UNSAFE.getInt(null, struct + STBRPContext.INIT_MODE); } + /** Unsafe version of {@link #heuristic}. */ + public static int nheuristic(long struct) { return UNSAFE.getInt(null, struct + STBRPContext.HEURISTIC); } + /** Unsafe version of {@link #num_nodes}. */ + public static int nnum_nodes(long struct) { return UNSAFE.getInt(null, struct + STBRPContext.NUM_NODES); } + /** Unsafe version of {@link #active_head}. */ + @Nullable public static STBRPNode nactive_head(long struct) { return STBRPNode.createSafe(memGetAddress(struct + STBRPContext.ACTIVE_HEAD)); } + /** Unsafe version of {@link #free_head}. */ + @Nullable public static STBRPNode nfree_head(long struct) { return STBRPNode.createSafe(memGetAddress(struct + STBRPContext.FREE_HEAD)); } + /** Unsafe version of {@link #extra}. */ + public static STBRPNode.Buffer nextra(long struct) { return STBRPNode.create(struct + STBRPContext.EXTRA, 2); } + /** Unsafe version of {@link #extra(int) extra}. */ + public static STBRPNode nextra(long struct, int index) { + return STBRPNode.create(struct + STBRPContext.EXTRA + check(index, 2) * STBRPNode.SIZEOF); + } + + // ----------------------------------- + + /** An array of {@link STBRPContext} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final STBRPContext ELEMENT_FACTORY = STBRPContext.create(-1L); + + /** + * Creates a new {@code STBRPContext.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link STBRPContext#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected STBRPContext getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code width} field. */ + public int width() { return STBRPContext.nwidth(address()); } + /** Returns the value of the {@code height} field. */ + public int height() { return STBRPContext.nheight(address()); } + /** Returns the value of the {@code align} field. */ + public int align() { return STBRPContext.nalign(address()); } + /** Returns the value of the {@code init_mode} field. */ + public int init_mode() { return STBRPContext.ninit_mode(address()); } + /** Returns the value of the {@code heuristic} field. */ + public int heuristic() { return STBRPContext.nheuristic(address()); } + /** Returns the value of the {@code num_nodes} field. */ + public int num_nodes() { return STBRPContext.nnum_nodes(address()); } + /** Returns a {@link STBRPNode} view of the struct pointed to by the {@code active_head} field. */ + @Nullable + @NativeType("stbrp_node *") + public STBRPNode active_head() { return STBRPContext.nactive_head(address()); } + /** Returns a {@link STBRPNode} view of the struct pointed to by the {@code free_head} field. */ + @Nullable + @NativeType("stbrp_node *") + public STBRPNode free_head() { return STBRPContext.nfree_head(address()); } + /** Returns a {@link STBRPNode}.Buffer view of the {@code extra} field. */ + @NativeType("stbrp_node[2]") + public STBRPNode.Buffer extra() { return STBRPContext.nextra(address()); } + /** Returns a {@link STBRPNode} view of the struct at the specified index of the {@code extra} field. */ + @NativeType("stbrp_node") + public STBRPNode extra(int index) { return STBRPContext.nextra(address(), index); } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBRPNode.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBRPNode.java new file mode 100644 index 00000000..96475f4c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBRPNode.java @@ -0,0 +1,285 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * The opaque {@code stbrp_node} struct. + * + *

Layout

+ * + *

+ * struct stbrp_node {
+ *     stbrp_coord x;
+ *     stbrp_coord y;
+ *     {@link STBRPNode stbrp_node} * next;
+ * }
+ */ +@NativeType("struct stbrp_node") +public class STBRPNode extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + X, + Y, + NEXT; + + static { + Layout layout = __struct( + __member(2), + __member(2), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + X = layout.offsetof(0); + Y = layout.offsetof(1); + NEXT = layout.offsetof(2); + } + + /** + * Creates a {@code STBRPNode} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public STBRPNode(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code x} field. */ + @NativeType("stbrp_coord") + public short x() { return nx(address()); } + /** Returns the value of the {@code y} field. */ + @NativeType("stbrp_coord") + public short y() { return ny(address()); } + /** Returns a {@link STBRPNode} view of the struct pointed to by the {@code next} field. */ + @Nullable + @NativeType("stbrp_node *") + public STBRPNode next() { return nnext(address()); } + + // ----------------------------------- + + /** Returns a new {@code STBRPNode} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static STBRPNode malloc() { + return wrap(STBRPNode.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code STBRPNode} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static STBRPNode calloc() { + return wrap(STBRPNode.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code STBRPNode} instance allocated with {@link BufferUtils}. */ + public static STBRPNode create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(STBRPNode.class, memAddress(container), container); + } + + /** Returns a new {@code STBRPNode} instance for the specified memory address. */ + public static STBRPNode create(long address) { + return wrap(STBRPNode.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static STBRPNode createSafe(long address) { + return address == NULL ? null : wrap(STBRPNode.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code STBRPNode} instance allocated on the thread-local {@link MemoryStack}. */ + public static STBRPNode mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code STBRPNode} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static STBRPNode callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code STBRPNode} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static STBRPNode mallocStack(MemoryStack stack) { + return wrap(STBRPNode.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code STBRPNode} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static STBRPNode callocStack(MemoryStack stack) { + return wrap(STBRPNode.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #x}. */ + public static short nx(long struct) { return UNSAFE.getShort(null, struct + STBRPNode.X); } + /** Unsafe version of {@link #y}. */ + public static short ny(long struct) { return UNSAFE.getShort(null, struct + STBRPNode.Y); } + /** Unsafe version of {@link #next}. */ + @Nullable public static STBRPNode nnext(long struct) { return STBRPNode.createSafe(memGetAddress(struct + STBRPNode.NEXT)); } + + // ----------------------------------- + + /** An array of {@link STBRPNode} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final STBRPNode ELEMENT_FACTORY = STBRPNode.create(-1L); + + /** + * Creates a new {@code STBRPNode.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link STBRPNode#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected STBRPNode getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code x} field. */ + @NativeType("stbrp_coord") + public short x() { return STBRPNode.nx(address()); } + /** Returns the value of the {@code y} field. */ + @NativeType("stbrp_coord") + public short y() { return STBRPNode.ny(address()); } + /** Returns a {@link STBRPNode} view of the struct pointed to by the {@code next} field. */ + @Nullable + @NativeType("stbrp_node *") + public STBRPNode next() { return STBRPNode.nnext(address()); } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBRPRect.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBRPRect.java new file mode 100644 index 00000000..acbe04ab --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBRPRect.java @@ -0,0 +1,398 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A packed rectangle. + * + *

Member documentation

+ * + *
    + *
  • {@code id} – reserved for your use
  • + *
  • {@code w} – input width
  • + *
  • {@code h} – input height
  • + *
  • {@code x} – output x coordinate
  • + *
  • {@code y} – output y coordinate
  • + *
  • {@code was_packed} – non-zero if valid packing
  • + *
+ * + *

Layout

+ * + *

+ * struct stbrp_rect {
+ *     int id;
+ *     stbrp_coord w;
+ *     stbrp_coord h;
+ *     stbrp_coord x;
+ *     stbrp_coord y;
+ *     int was_packed;
+ * }
+ */ +@NativeType("struct stbrp_rect") +public class STBRPRect extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + ID, + W, + H, + X, + Y, + WAS_PACKED; + + static { + Layout layout = __struct( + __member(4), + __member(2), + __member(2), + __member(2), + __member(2), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + ID = layout.offsetof(0); + W = layout.offsetof(1); + H = layout.offsetof(2); + X = layout.offsetof(3); + Y = layout.offsetof(4); + WAS_PACKED = layout.offsetof(5); + } + + /** + * Creates a {@code STBRPRect} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public STBRPRect(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code id} field. */ + public int id() { return nid(address()); } + /** Returns the value of the {@code w} field. */ + @NativeType("stbrp_coord") + public short w() { return nw(address()); } + /** Returns the value of the {@code h} field. */ + @NativeType("stbrp_coord") + public short h() { return nh(address()); } + /** Returns the value of the {@code x} field. */ + @NativeType("stbrp_coord") + public short x() { return nx(address()); } + /** Returns the value of the {@code y} field. */ + @NativeType("stbrp_coord") + public short y() { return ny(address()); } + /** Returns the value of the {@code was_packed} field. */ + @NativeType("int") + public boolean was_packed() { return nwas_packed(address()) != 0; } + + /** Sets the specified value to the {@code id} field. */ + public STBRPRect id(int value) { nid(address(), value); return this; } + /** Sets the specified value to the {@code w} field. */ + public STBRPRect w(@NativeType("stbrp_coord") short value) { nw(address(), value); return this; } + /** Sets the specified value to the {@code h} field. */ + public STBRPRect h(@NativeType("stbrp_coord") short value) { nh(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public STBRPRect x(@NativeType("stbrp_coord") short value) { nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public STBRPRect y(@NativeType("stbrp_coord") short value) { ny(address(), value); return this; } + /** Sets the specified value to the {@code was_packed} field. */ + public STBRPRect was_packed(@NativeType("int") boolean value) { nwas_packed(address(), value ? 1 : 0); return this; } + + /** Initializes this struct with the specified values. */ + public STBRPRect set( + int id, + short w, + short h, + short x, + short y, + boolean was_packed + ) { + id(id); + w(w); + h(h); + x(x); + y(y); + was_packed(was_packed); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public STBRPRect set(STBRPRect src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code STBRPRect} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static STBRPRect malloc() { + return wrap(STBRPRect.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code STBRPRect} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static STBRPRect calloc() { + return wrap(STBRPRect.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code STBRPRect} instance allocated with {@link BufferUtils}. */ + public static STBRPRect create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(STBRPRect.class, memAddress(container), container); + } + + /** Returns a new {@code STBRPRect} instance for the specified memory address. */ + public static STBRPRect create(long address) { + return wrap(STBRPRect.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static STBRPRect createSafe(long address) { + return address == NULL ? null : wrap(STBRPRect.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code STBRPRect} instance allocated on the thread-local {@link MemoryStack}. */ + public static STBRPRect mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code STBRPRect} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static STBRPRect callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code STBRPRect} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static STBRPRect mallocStack(MemoryStack stack) { + return wrap(STBRPRect.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code STBRPRect} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static STBRPRect callocStack(MemoryStack stack) { + return wrap(STBRPRect.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #id}. */ + public static int nid(long struct) { return UNSAFE.getInt(null, struct + STBRPRect.ID); } + /** Unsafe version of {@link #w}. */ + public static short nw(long struct) { return UNSAFE.getShort(null, struct + STBRPRect.W); } + /** Unsafe version of {@link #h}. */ + public static short nh(long struct) { return UNSAFE.getShort(null, struct + STBRPRect.H); } + /** Unsafe version of {@link #x}. */ + public static short nx(long struct) { return UNSAFE.getShort(null, struct + STBRPRect.X); } + /** Unsafe version of {@link #y}. */ + public static short ny(long struct) { return UNSAFE.getShort(null, struct + STBRPRect.Y); } + /** Unsafe version of {@link #was_packed}. */ + public static int nwas_packed(long struct) { return UNSAFE.getInt(null, struct + STBRPRect.WAS_PACKED); } + + /** Unsafe version of {@link #id(int) id}. */ + public static void nid(long struct, int value) { UNSAFE.putInt(null, struct + STBRPRect.ID, value); } + /** Unsafe version of {@link #w(short) w}. */ + public static void nw(long struct, short value) { UNSAFE.putShort(null, struct + STBRPRect.W, value); } + /** Unsafe version of {@link #h(short) h}. */ + public static void nh(long struct, short value) { UNSAFE.putShort(null, struct + STBRPRect.H, value); } + /** Unsafe version of {@link #x(short) x}. */ + public static void nx(long struct, short value) { UNSAFE.putShort(null, struct + STBRPRect.X, value); } + /** Unsafe version of {@link #y(short) y}. */ + public static void ny(long struct, short value) { UNSAFE.putShort(null, struct + STBRPRect.Y, value); } + /** Unsafe version of {@link #was_packed(boolean) was_packed}. */ + public static void nwas_packed(long struct, int value) { UNSAFE.putInt(null, struct + STBRPRect.WAS_PACKED, value); } + + // ----------------------------------- + + /** An array of {@link STBRPRect} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final STBRPRect ELEMENT_FACTORY = STBRPRect.create(-1L); + + /** + * Creates a new {@code STBRPRect.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link STBRPRect#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected STBRPRect getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code id} field. */ + public int id() { return STBRPRect.nid(address()); } + /** Returns the value of the {@code w} field. */ + @NativeType("stbrp_coord") + public short w() { return STBRPRect.nw(address()); } + /** Returns the value of the {@code h} field. */ + @NativeType("stbrp_coord") + public short h() { return STBRPRect.nh(address()); } + /** Returns the value of the {@code x} field. */ + @NativeType("stbrp_coord") + public short x() { return STBRPRect.nx(address()); } + /** Returns the value of the {@code y} field. */ + @NativeType("stbrp_coord") + public short y() { return STBRPRect.ny(address()); } + /** Returns the value of the {@code was_packed} field. */ + @NativeType("int") + public boolean was_packed() { return STBRPRect.nwas_packed(address()) != 0; } + + /** Sets the specified value to the {@code id} field. */ + public Buffer id(int value) { STBRPRect.nid(address(), value); return this; } + /** Sets the specified value to the {@code w} field. */ + public Buffer w(@NativeType("stbrp_coord") short value) { STBRPRect.nw(address(), value); return this; } + /** Sets the specified value to the {@code h} field. */ + public Buffer h(@NativeType("stbrp_coord") short value) { STBRPRect.nh(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public Buffer x(@NativeType("stbrp_coord") short value) { STBRPRect.nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public Buffer y(@NativeType("stbrp_coord") short value) { STBRPRect.ny(address(), value); return this; } + /** Sets the specified value to the {@code was_packed} field. */ + public Buffer was_packed(@NativeType("int") boolean value) { STBRPRect.nwas_packed(address(), value ? 1 : 0); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBRectPack.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBRectPack.java new file mode 100644 index 00000000..b90470d4 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBRectPack.java @@ -0,0 +1,147 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import org.lwjgl.system.*; + + +/** + * Native bindings to stb_rect_pack.h from the stb library. + * + *

Useful for e.g. packing rectangular textures into an atlas. Does not do rotation.

+ * + *

This library currently uses the Skyline Bottom-Left algorithm. Not necessarily the awesomest packing method, but better than the totally naive one in + * stb_truetype (which is primarily what this is meant to replace).

+ */ +public class STBRectPack { + + /** + * Packing heuristics + * + *
Enum values:
+ * + *
    + *
  • {@link #STBRP_HEURISTIC_Skyline_default HEURISTIC_Skyline_default}
  • + *
  • {@link #STBRP_HEURISTIC_Skyline_BL_sortHeight HEURISTIC_Skyline_BL_sortHeight}
  • + *
  • {@link #STBRP_HEURISTIC_Skyline_BF_sortHeight HEURISTIC_Skyline_BF_sortHeight}
  • + *
+ */ + public static final int + STBRP_HEURISTIC_Skyline_default = 0, + STBRP_HEURISTIC_Skyline_BL_sortHeight = STBRP_HEURISTIC_Skyline_default, + STBRP_HEURISTIC_Skyline_BF_sortHeight = 1; + + static { LibSTB.initialize(); } + + protected STBRectPack() { + throw new UnsupportedOperationException(); + } + + // --- [ stbrp_pack_rects ] --- + + /** + * Unsafe version of: {@link #stbrp_pack_rects pack_rects} + * + * @param num_rects the number of structs in {@code rects} + */ + public static native int nstbrp_pack_rects(long context, long rects, int num_rects); + + /** + * Assigns packed locations to rectangles. The rectangles are of type {@link STBRPRect}, stored in the array {@code rects}, and there are {@code num_rects} many + * of them. + * + *

Rectangles which are successfully packed have the {@code was_packed} flag set to a non-zero value and {@code x} and {@code y} store the minimum + * location on each axis (i.e. bottom-left in cartesian coordinates, top-left if you imagine y increasing downwards). Rectangles which do not fit have the + * {@code was_packed} flag set to 0.

+ * + *

You should not try to access the {@code rects} array from another thread while this function is running, as the function temporarily reorders the array + * while it executes.

+ * + *

To pack into another rectangle, you need to call {@link #stbrp_init_target init_target} again. To continue packing into the same rectangle, you can call this function again. + * Calling this multiple times with multiple rect arrays will probably produce worse packing results than calling it a single time with the full rectangle + * array, but the option is available.

+ * + * @param context an {@link STBRPContext} struct + * @param rects an array of {@link STBRPRect} structs + * + * @return 1 if all of the rectangles were successfully packed and 0 otherwise + */ + public static int stbrp_pack_rects(@NativeType("stbrp_context *") STBRPContext context, @NativeType("stbrp_rect *") STBRPRect.Buffer rects) { + return nstbrp_pack_rects(context.address(), rects.address(), rects.remaining()); + } + + // --- [ stbrp_init_target ] --- + + /** + * Unsafe version of: {@link #stbrp_init_target init_target} + * + * @param num_nodes the number of structs in {@code nodes} + */ + public static native void nstbrp_init_target(long context, int width, int height, long nodes, int num_nodes); + + /** + * Initialize a rectangle packer to: pack a rectangle that is {@code width} by {@code height} in dimensions using temporary storage provided by the array + * {@code nodes}, which is {@code num_nodes} long. + * + *

You must call this function every time you start packing into a new target.

+ * + *

There is no "shutdown" function. The {@code nodes} memory must stay valid for the following {@link #stbrp_pack_rects pack_rects} call (or calls), but can be freed after the + * call (or calls) finish.

+ * + *

Note: to guarantee best results, either:

+ * + *
    + *
  1. make sure {@code num_nodes ≥ width}
  2. + *
  3. or, call {@link #stbrp_setup_allow_out_of_mem setup_allow_out_of_mem} with {@code allow_out_of_mem = 1}
  4. + *
+ * + *

If you don't do either of the above things, widths will be quantized to multiples of small integers to guarantee the algorithm doesn't run out of + * temporary storage.

+ * + *

If you do #2, then the non-quantized algorithm will be used, but the algorithm may run out of temporary storage and be unable to pack some rectangles.

+ * + * @param context an {@link STBRPContext} struct + * @param width the rectangle width + * @param height the rectangle height + * @param nodes an array of {@link STBRPNode} structs + */ + public static void stbrp_init_target(@NativeType("stbrp_context *") STBRPContext context, int width, int height, @NativeType("stbrp_node *") STBRPNode.Buffer nodes) { + nstbrp_init_target(context.address(), width, height, nodes.address(), nodes.remaining()); + } + + // --- [ stbrp_setup_allow_out_of_mem ] --- + + /** Unsafe version of: {@link #stbrp_setup_allow_out_of_mem setup_allow_out_of_mem} */ + public static native void nstbrp_setup_allow_out_of_mem(long context, int allow_out_of_mem); + + /** + * Optionally call this function after init but before doing any packing to change the handling of the out-of-temp-memory scenario, described in + * {@link #stbrp_init_target init_target}. If you call init again, this will be reset to the default (false). + * + * @param context an {@link STBRPContext} struct + * @param allow_out_of_mem 1 to allow running out of temporary storage + */ + public static void stbrp_setup_allow_out_of_mem(@NativeType("stbrp_context *") STBRPContext context, @NativeType("int") boolean allow_out_of_mem) { + nstbrp_setup_allow_out_of_mem(context.address(), allow_out_of_mem ? 1 : 0); + } + + // --- [ stbrp_setup_heuristic ] --- + + /** Unsafe version of: {@link #stbrp_setup_heuristic setup_heuristic} */ + public static native void nstbrp_setup_heuristic(long context, int heuristic); + + /** + * Optionally select which packing heuristic the library should use. Different heuristics will produce better/worse results for different data sets. If + * you call init again, this will be reset to the default. + * + * @param context an {@link STBRPContext} struct + * @param heuristic the packing heuristic + */ + public static void stbrp_setup_heuristic(@NativeType("stbrp_context *") STBRPContext context, int heuristic) { + nstbrp_setup_heuristic(context.address(), heuristic); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTAlignedQuad.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTAlignedQuad.java new file mode 100644 index 00000000..bd5c36d4 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTAlignedQuad.java @@ -0,0 +1,327 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Quad used for drawing a baked character, returned by {@link STBTruetype#stbtt_GetBakedQuad GetBakedQuad}. + * + *

Layout

+ * + *

+ * struct stbtt_aligned_quad {
+ *     float x0;
+ *     float y0;
+ *     float s0;
+ *     float t0;
+ *     float x1;
+ *     float y1;
+ *     float s1;
+ *     float t1;
+ * }
+ */ +@NativeType("struct stbtt_aligned_quad") +public class STBTTAlignedQuad extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + X0, + Y0, + S0, + T0, + X1, + Y1, + S1, + T1; + + static { + Layout layout = __struct( + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + X0 = layout.offsetof(0); + Y0 = layout.offsetof(1); + S0 = layout.offsetof(2); + T0 = layout.offsetof(3); + X1 = layout.offsetof(4); + Y1 = layout.offsetof(5); + S1 = layout.offsetof(6); + T1 = layout.offsetof(7); + } + + /** + * Creates a {@code STBTTAlignedQuad} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public STBTTAlignedQuad(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code x0} field. */ + public float x0() { return nx0(address()); } + /** Returns the value of the {@code y0} field. */ + public float y0() { return ny0(address()); } + /** Returns the value of the {@code s0} field. */ + public float s0() { return ns0(address()); } + /** Returns the value of the {@code t0} field. */ + public float t0() { return nt0(address()); } + /** Returns the value of the {@code x1} field. */ + public float x1() { return nx1(address()); } + /** Returns the value of the {@code y1} field. */ + public float y1() { return ny1(address()); } + /** Returns the value of the {@code s1} field. */ + public float s1() { return ns1(address()); } + /** Returns the value of the {@code t1} field. */ + public float t1() { return nt1(address()); } + + // ----------------------------------- + + /** Returns a new {@code STBTTAlignedQuad} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static STBTTAlignedQuad malloc() { + return wrap(STBTTAlignedQuad.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code STBTTAlignedQuad} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static STBTTAlignedQuad calloc() { + return wrap(STBTTAlignedQuad.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code STBTTAlignedQuad} instance allocated with {@link BufferUtils}. */ + public static STBTTAlignedQuad create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(STBTTAlignedQuad.class, memAddress(container), container); + } + + /** Returns a new {@code STBTTAlignedQuad} instance for the specified memory address. */ + public static STBTTAlignedQuad create(long address) { + return wrap(STBTTAlignedQuad.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static STBTTAlignedQuad createSafe(long address) { + return address == NULL ? null : wrap(STBTTAlignedQuad.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code STBTTAlignedQuad} instance allocated on the thread-local {@link MemoryStack}. */ + public static STBTTAlignedQuad mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code STBTTAlignedQuad} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static STBTTAlignedQuad callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code STBTTAlignedQuad} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static STBTTAlignedQuad mallocStack(MemoryStack stack) { + return wrap(STBTTAlignedQuad.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code STBTTAlignedQuad} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static STBTTAlignedQuad callocStack(MemoryStack stack) { + return wrap(STBTTAlignedQuad.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #x0}. */ + public static float nx0(long struct) { return UNSAFE.getFloat(null, struct + STBTTAlignedQuad.X0); } + /** Unsafe version of {@link #y0}. */ + public static float ny0(long struct) { return UNSAFE.getFloat(null, struct + STBTTAlignedQuad.Y0); } + /** Unsafe version of {@link #s0}. */ + public static float ns0(long struct) { return UNSAFE.getFloat(null, struct + STBTTAlignedQuad.S0); } + /** Unsafe version of {@link #t0}. */ + public static float nt0(long struct) { return UNSAFE.getFloat(null, struct + STBTTAlignedQuad.T0); } + /** Unsafe version of {@link #x1}. */ + public static float nx1(long struct) { return UNSAFE.getFloat(null, struct + STBTTAlignedQuad.X1); } + /** Unsafe version of {@link #y1}. */ + public static float ny1(long struct) { return UNSAFE.getFloat(null, struct + STBTTAlignedQuad.Y1); } + /** Unsafe version of {@link #s1}. */ + public static float ns1(long struct) { return UNSAFE.getFloat(null, struct + STBTTAlignedQuad.S1); } + /** Unsafe version of {@link #t1}. */ + public static float nt1(long struct) { return UNSAFE.getFloat(null, struct + STBTTAlignedQuad.T1); } + + // ----------------------------------- + + /** An array of {@link STBTTAlignedQuad} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final STBTTAlignedQuad ELEMENT_FACTORY = STBTTAlignedQuad.create(-1L); + + /** + * Creates a new {@code STBTTAlignedQuad.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link STBTTAlignedQuad#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected STBTTAlignedQuad getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code x0} field. */ + public float x0() { return STBTTAlignedQuad.nx0(address()); } + /** Returns the value of the {@code y0} field. */ + public float y0() { return STBTTAlignedQuad.ny0(address()); } + /** Returns the value of the {@code s0} field. */ + public float s0() { return STBTTAlignedQuad.ns0(address()); } + /** Returns the value of the {@code t0} field. */ + public float t0() { return STBTTAlignedQuad.nt0(address()); } + /** Returns the value of the {@code x1} field. */ + public float x1() { return STBTTAlignedQuad.nx1(address()); } + /** Returns the value of the {@code y1} field. */ + public float y1() { return STBTTAlignedQuad.ny1(address()); } + /** Returns the value of the {@code s1} field. */ + public float s1() { return STBTTAlignedQuad.ns1(address()); } + /** Returns the value of the {@code t1} field. */ + public float t1() { return STBTTAlignedQuad.nt1(address()); } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTBakedChar.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTBakedChar.java new file mode 100644 index 00000000..9b3ada22 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTBakedChar.java @@ -0,0 +1,325 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Baked character data, returned by {@link STBTruetype#stbtt_BakeFontBitmap BakeFontBitmap}. + * + *

Layout

+ * + *

+ * struct stbtt_bakedchar {
+ *     unsigned short x0;
+ *     unsigned short y0;
+ *     unsigned short x1;
+ *     unsigned short y1;
+ *     float xoff;
+ *     float yoff;
+ *     float xadvance;
+ * }
+ */ +@NativeType("struct stbtt_bakedchar") +public class STBTTBakedChar extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + X0, + Y0, + X1, + Y1, + XOFF, + YOFF, + XADVANCE; + + static { + Layout layout = __struct( + __member(2), + __member(2), + __member(2), + __member(2), + __member(4), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + X0 = layout.offsetof(0); + Y0 = layout.offsetof(1); + X1 = layout.offsetof(2); + Y1 = layout.offsetof(3); + XOFF = layout.offsetof(4); + YOFF = layout.offsetof(5); + XADVANCE = layout.offsetof(6); + } + + /** + * Creates a {@code STBTTBakedChar} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public STBTTBakedChar(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code x0} field. */ + @NativeType("unsigned short") + public short x0() { return nx0(address()); } + /** Returns the value of the {@code y0} field. */ + @NativeType("unsigned short") + public short y0() { return ny0(address()); } + /** Returns the value of the {@code x1} field. */ + @NativeType("unsigned short") + public short x1() { return nx1(address()); } + /** Returns the value of the {@code y1} field. */ + @NativeType("unsigned short") + public short y1() { return ny1(address()); } + /** Returns the value of the {@code xoff} field. */ + public float xoff() { return nxoff(address()); } + /** Returns the value of the {@code yoff} field. */ + public float yoff() { return nyoff(address()); } + /** Returns the value of the {@code xadvance} field. */ + public float xadvance() { return nxadvance(address()); } + + // ----------------------------------- + + /** Returns a new {@code STBTTBakedChar} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static STBTTBakedChar malloc() { + return wrap(STBTTBakedChar.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code STBTTBakedChar} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static STBTTBakedChar calloc() { + return wrap(STBTTBakedChar.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code STBTTBakedChar} instance allocated with {@link BufferUtils}. */ + public static STBTTBakedChar create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(STBTTBakedChar.class, memAddress(container), container); + } + + /** Returns a new {@code STBTTBakedChar} instance for the specified memory address. */ + public static STBTTBakedChar create(long address) { + return wrap(STBTTBakedChar.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static STBTTBakedChar createSafe(long address) { + return address == NULL ? null : wrap(STBTTBakedChar.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code STBTTBakedChar} instance allocated on the thread-local {@link MemoryStack}. */ + public static STBTTBakedChar mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code STBTTBakedChar} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static STBTTBakedChar callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code STBTTBakedChar} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static STBTTBakedChar mallocStack(MemoryStack stack) { + return wrap(STBTTBakedChar.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code STBTTBakedChar} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static STBTTBakedChar callocStack(MemoryStack stack) { + return wrap(STBTTBakedChar.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #x0}. */ + public static short nx0(long struct) { return UNSAFE.getShort(null, struct + STBTTBakedChar.X0); } + /** Unsafe version of {@link #y0}. */ + public static short ny0(long struct) { return UNSAFE.getShort(null, struct + STBTTBakedChar.Y0); } + /** Unsafe version of {@link #x1}. */ + public static short nx1(long struct) { return UNSAFE.getShort(null, struct + STBTTBakedChar.X1); } + /** Unsafe version of {@link #y1}. */ + public static short ny1(long struct) { return UNSAFE.getShort(null, struct + STBTTBakedChar.Y1); } + /** Unsafe version of {@link #xoff}. */ + public static float nxoff(long struct) { return UNSAFE.getFloat(null, struct + STBTTBakedChar.XOFF); } + /** Unsafe version of {@link #yoff}. */ + public static float nyoff(long struct) { return UNSAFE.getFloat(null, struct + STBTTBakedChar.YOFF); } + /** Unsafe version of {@link #xadvance}. */ + public static float nxadvance(long struct) { return UNSAFE.getFloat(null, struct + STBTTBakedChar.XADVANCE); } + + // ----------------------------------- + + /** An array of {@link STBTTBakedChar} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final STBTTBakedChar ELEMENT_FACTORY = STBTTBakedChar.create(-1L); + + /** + * Creates a new {@code STBTTBakedChar.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link STBTTBakedChar#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected STBTTBakedChar getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code x0} field. */ + @NativeType("unsigned short") + public short x0() { return STBTTBakedChar.nx0(address()); } + /** Returns the value of the {@code y0} field. */ + @NativeType("unsigned short") + public short y0() { return STBTTBakedChar.ny0(address()); } + /** Returns the value of the {@code x1} field. */ + @NativeType("unsigned short") + public short x1() { return STBTTBakedChar.nx1(address()); } + /** Returns the value of the {@code y1} field. */ + @NativeType("unsigned short") + public short y1() { return STBTTBakedChar.ny1(address()); } + /** Returns the value of the {@code xoff} field. */ + public float xoff() { return STBTTBakedChar.nxoff(address()); } + /** Returns the value of the {@code yoff} field. */ + public float yoff() { return STBTTBakedChar.nyoff(address()); } + /** Returns the value of the {@code xadvance} field. */ + public float xadvance() { return STBTTBakedChar.nxadvance(address()); } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTBitmap.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTBitmap.java new file mode 100644 index 00000000..c5d70216 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTBitmap.java @@ -0,0 +1,382 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Bitmap data. + * + *

Member documentation

+ * + *
    + *
  • {@code w} – the bitmap width
  • + *
  • {@code h} – the bitmap height
  • + *
  • {@code stride} – the row stride, in bytes
  • + *
  • {@code pixels} – the bitmap data
  • + *
+ * + *

Layout

+ * + *

+ * struct stbtt__bitmap {
+ *     int w;
+ *     int h;
+ *     int stride;
+ *     unsigned char * pixels;
+ * }
+ */ +@NativeType("struct stbtt__bitmap") +public class STBTTBitmap extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + W, + H, + STRIDE, + PIXELS; + + static { + Layout layout = __struct( + __member(4), + __member(4), + __member(4), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + W = layout.offsetof(0); + H = layout.offsetof(1); + STRIDE = layout.offsetof(2); + PIXELS = layout.offsetof(3); + } + + /** + * Creates a {@code STBTTBitmap} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public STBTTBitmap(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code w} field. */ + public int w() { return nw(address()); } + /** Returns the value of the {@code h} field. */ + public int h() { return nh(address()); } + /** Returns the value of the {@code stride} field. */ + public int stride() { return nstride(address()); } + /** + * Returns a {@link ByteBuffer} view of the data pointed to by the {@code pixels} field. + * + * @param capacity the number of elements in the returned buffer + */ + @NativeType("unsigned char *") + public ByteBuffer pixels(int capacity) { return npixels(address(), capacity); } + + /** Sets the specified value to the {@code w} field. */ + public STBTTBitmap w(int value) { nw(address(), value); return this; } + /** Sets the specified value to the {@code h} field. */ + public STBTTBitmap h(int value) { nh(address(), value); return this; } + /** Sets the specified value to the {@code stride} field. */ + public STBTTBitmap stride(int value) { nstride(address(), value); return this; } + /** Sets the address of the specified {@link ByteBuffer} to the {@code pixels} field. */ + public STBTTBitmap pixels(@NativeType("unsigned char *") ByteBuffer value) { npixels(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public STBTTBitmap set( + int w, + int h, + int stride, + ByteBuffer pixels + ) { + w(w); + h(h); + stride(stride); + pixels(pixels); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public STBTTBitmap set(STBTTBitmap src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code STBTTBitmap} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static STBTTBitmap malloc() { + return wrap(STBTTBitmap.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code STBTTBitmap} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static STBTTBitmap calloc() { + return wrap(STBTTBitmap.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code STBTTBitmap} instance allocated with {@link BufferUtils}. */ + public static STBTTBitmap create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(STBTTBitmap.class, memAddress(container), container); + } + + /** Returns a new {@code STBTTBitmap} instance for the specified memory address. */ + public static STBTTBitmap create(long address) { + return wrap(STBTTBitmap.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static STBTTBitmap createSafe(long address) { + return address == NULL ? null : wrap(STBTTBitmap.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code STBTTBitmap} instance allocated on the thread-local {@link MemoryStack}. */ + public static STBTTBitmap mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code STBTTBitmap} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static STBTTBitmap callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code STBTTBitmap} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static STBTTBitmap mallocStack(MemoryStack stack) { + return wrap(STBTTBitmap.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code STBTTBitmap} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static STBTTBitmap callocStack(MemoryStack stack) { + return wrap(STBTTBitmap.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #w}. */ + public static int nw(long struct) { return UNSAFE.getInt(null, struct + STBTTBitmap.W); } + /** Unsafe version of {@link #h}. */ + public static int nh(long struct) { return UNSAFE.getInt(null, struct + STBTTBitmap.H); } + /** Unsafe version of {@link #stride}. */ + public static int nstride(long struct) { return UNSAFE.getInt(null, struct + STBTTBitmap.STRIDE); } + /** Unsafe version of {@link #pixels(int) pixels}. */ + public static ByteBuffer npixels(long struct, int capacity) { return memByteBuffer(memGetAddress(struct + STBTTBitmap.PIXELS), capacity); } + + /** Unsafe version of {@link #w(int) w}. */ + public static void nw(long struct, int value) { UNSAFE.putInt(null, struct + STBTTBitmap.W, value); } + /** Unsafe version of {@link #h(int) h}. */ + public static void nh(long struct, int value) { UNSAFE.putInt(null, struct + STBTTBitmap.H, value); } + /** Unsafe version of {@link #stride(int) stride}. */ + public static void nstride(long struct, int value) { UNSAFE.putInt(null, struct + STBTTBitmap.STRIDE, value); } + /** Unsafe version of {@link #pixels(ByteBuffer) pixels}. */ + public static void npixels(long struct, ByteBuffer value) { memPutAddress(struct + STBTTBitmap.PIXELS, memAddress(value)); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + STBTTBitmap.PIXELS)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link STBTTBitmap} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final STBTTBitmap ELEMENT_FACTORY = STBTTBitmap.create(-1L); + + /** + * Creates a new {@code STBTTBitmap.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link STBTTBitmap#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected STBTTBitmap getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code w} field. */ + public int w() { return STBTTBitmap.nw(address()); } + /** Returns the value of the {@code h} field. */ + public int h() { return STBTTBitmap.nh(address()); } + /** Returns the value of the {@code stride} field. */ + public int stride() { return STBTTBitmap.nstride(address()); } + /** + * Returns a {@link ByteBuffer} view of the data pointed to by the {@code pixels} field. + * + * @param capacity the number of elements in the returned buffer + */ + @NativeType("unsigned char *") + public ByteBuffer pixels(int capacity) { return STBTTBitmap.npixels(address(), capacity); } + + /** Sets the specified value to the {@code w} field. */ + public Buffer w(int value) { STBTTBitmap.nw(address(), value); return this; } + /** Sets the specified value to the {@code h} field. */ + public Buffer h(int value) { STBTTBitmap.nh(address(), value); return this; } + /** Sets the specified value to the {@code stride} field. */ + public Buffer stride(int value) { STBTTBitmap.nstride(address(), value); return this; } + /** Sets the address of the specified {@link ByteBuffer} to the {@code pixels} field. */ + public Buffer pixels(@NativeType("unsigned char *") ByteBuffer value) { STBTTBitmap.npixels(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTFontinfo.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTFontinfo.java new file mode 100644 index 00000000..2a170218 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTFontinfo.java @@ -0,0 +1,236 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** An opaque structure that contains font information. */ +@NativeType("struct stbtt_fontinfo") +public class STBTTFontinfo extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + static { + LibSTB.initialize(); + + try (MemoryStack stack = stackPush()) { + IntBuffer offsets = stack.mallocInt(1); + SIZEOF = offsets(memAddress(offsets)); + ALIGNOF = offsets.get(0); + } + } + + private static native int offsets(long buffer); + + /** + * Creates a {@code STBTTFontinfo} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public STBTTFontinfo(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + // ----------------------------------- + + /** Returns a new {@code STBTTFontinfo} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static STBTTFontinfo malloc() { + return wrap(STBTTFontinfo.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code STBTTFontinfo} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static STBTTFontinfo calloc() { + return wrap(STBTTFontinfo.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code STBTTFontinfo} instance allocated with {@link BufferUtils}. */ + public static STBTTFontinfo create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(STBTTFontinfo.class, memAddress(container), container); + } + + /** Returns a new {@code STBTTFontinfo} instance for the specified memory address. */ + public static STBTTFontinfo create(long address) { + return wrap(STBTTFontinfo.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static STBTTFontinfo createSafe(long address) { + return address == NULL ? null : wrap(STBTTFontinfo.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code STBTTFontinfo} instance allocated on the thread-local {@link MemoryStack}. */ + public static STBTTFontinfo mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code STBTTFontinfo} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static STBTTFontinfo callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code STBTTFontinfo} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static STBTTFontinfo mallocStack(MemoryStack stack) { + return wrap(STBTTFontinfo.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code STBTTFontinfo} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static STBTTFontinfo callocStack(MemoryStack stack) { + return wrap(STBTTFontinfo.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + // ----------------------------------- + + /** An array of {@link STBTTFontinfo} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final STBTTFontinfo ELEMENT_FACTORY = STBTTFontinfo.create(-1L); + + /** + * Creates a new {@code STBTTFontinfo.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link STBTTFontinfo#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected STBTTFontinfo getElementFactory() { + return ELEMENT_FACTORY; + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTPackContext.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTPackContext.java new file mode 100644 index 00000000..7d0467d7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTPackContext.java @@ -0,0 +1,387 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * An opaque structure which holds all the context needed from {@link STBTruetype#stbtt_PackBegin PackBegin} to {@link STBTruetype#stbtt_PackEnd PackEnd}. + * + *

Layout

+ * + *

+ * struct stbtt_pack_context {
+ *     void * user_allocator_context;
+ *     {@link STBRPContext stbrp_context} * pack_info;
+ *     int width;
+ *     int height;
+ *     int stride_in_bytes;
+ *     int padding;
+ *     int skip_missing;
+ *     unsigned int h_oversample;
+ *     unsigned int v_oversample;
+ *     unsigned char * pixels;
+ *     {@link STBRPNode stbrp_node} * nodes;
+ * }
+ */ +@NativeType("struct stbtt_pack_context") +public class STBTTPackContext extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + USER_ALLOCATOR_CONTEXT, + PACK_INFO, + WIDTH, + HEIGHT, + STRIDE_IN_BYTES, + PADDING, + SKIP_MISSING, + H_OVERSAMPLE, + V_OVERSAMPLE, + PIXELS, + NODES; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + USER_ALLOCATOR_CONTEXT = layout.offsetof(0); + PACK_INFO = layout.offsetof(1); + WIDTH = layout.offsetof(2); + HEIGHT = layout.offsetof(3); + STRIDE_IN_BYTES = layout.offsetof(4); + PADDING = layout.offsetof(5); + SKIP_MISSING = layout.offsetof(6); + H_OVERSAMPLE = layout.offsetof(7); + V_OVERSAMPLE = layout.offsetof(8); + PIXELS = layout.offsetof(9); + NODES = layout.offsetof(10); + } + + /** + * Creates a {@code STBTTPackContext} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public STBTTPackContext(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code user_allocator_context} field. */ + @NativeType("void *") + public long user_allocator_context() { return nuser_allocator_context(address()); } + /** Returns a {@link STBRPContext} view of the struct pointed to by the {@code pack_info} field. */ + @NativeType("stbrp_context *") + public STBRPContext pack_info() { return npack_info(address()); } + /** Returns the value of the {@code width} field. */ + public int width() { return nwidth(address()); } + /** Returns the value of the {@code height} field. */ + public int height() { return nheight(address()); } + /** Returns the value of the {@code stride_in_bytes} field. */ + public int stride_in_bytes() { return nstride_in_bytes(address()); } + /** Returns the value of the {@code padding} field. */ + public int padding() { return npadding(address()); } + /** Returns the value of the {@code skip_missing} field. */ + @NativeType("int") + public boolean skip_missing() { return nskip_missing(address()) != 0; } + /** Returns the value of the {@code h_oversample} field. */ + @NativeType("unsigned int") + public int h_oversample() { return nh_oversample(address()); } + /** Returns the value of the {@code v_oversample} field. */ + @NativeType("unsigned int") + public int v_oversample() { return nv_oversample(address()); } + /** + * Returns a {@link ByteBuffer} view of the data pointed to by the {@code pixels} field. + * + * @param capacity the number of elements in the returned buffer + */ + @NativeType("unsigned char *") + public ByteBuffer pixels(int capacity) { return npixels(address(), capacity); } + /** + * Returns a {@link STBRPNode.Buffer} view of the struct array pointed to by the {@code nodes} field. + * + * @param capacity the number of elements in the returned buffer + */ + @NativeType("stbrp_node *") + public STBRPNode.Buffer nodes(int capacity) { return nnodes(address(), capacity); } + + // ----------------------------------- + + /** Returns a new {@code STBTTPackContext} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static STBTTPackContext malloc() { + return wrap(STBTTPackContext.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code STBTTPackContext} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static STBTTPackContext calloc() { + return wrap(STBTTPackContext.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code STBTTPackContext} instance allocated with {@link BufferUtils}. */ + public static STBTTPackContext create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(STBTTPackContext.class, memAddress(container), container); + } + + /** Returns a new {@code STBTTPackContext} instance for the specified memory address. */ + public static STBTTPackContext create(long address) { + return wrap(STBTTPackContext.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static STBTTPackContext createSafe(long address) { + return address == NULL ? null : wrap(STBTTPackContext.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code STBTTPackContext} instance allocated on the thread-local {@link MemoryStack}. */ + public static STBTTPackContext mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code STBTTPackContext} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static STBTTPackContext callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code STBTTPackContext} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static STBTTPackContext mallocStack(MemoryStack stack) { + return wrap(STBTTPackContext.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code STBTTPackContext} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static STBTTPackContext callocStack(MemoryStack stack) { + return wrap(STBTTPackContext.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #user_allocator_context}. */ + public static long nuser_allocator_context(long struct) { return memGetAddress(struct + STBTTPackContext.USER_ALLOCATOR_CONTEXT); } + /** Unsafe version of {@link #pack_info}. */ + public static STBRPContext npack_info(long struct) { return STBRPContext.create(memGetAddress(struct + STBTTPackContext.PACK_INFO)); } + /** Unsafe version of {@link #width}. */ + public static int nwidth(long struct) { return UNSAFE.getInt(null, struct + STBTTPackContext.WIDTH); } + /** Unsafe version of {@link #height}. */ + public static int nheight(long struct) { return UNSAFE.getInt(null, struct + STBTTPackContext.HEIGHT); } + /** Unsafe version of {@link #stride_in_bytes}. */ + public static int nstride_in_bytes(long struct) { return UNSAFE.getInt(null, struct + STBTTPackContext.STRIDE_IN_BYTES); } + /** Unsafe version of {@link #padding}. */ + public static int npadding(long struct) { return UNSAFE.getInt(null, struct + STBTTPackContext.PADDING); } + /** Unsafe version of {@link #skip_missing}. */ + public static int nskip_missing(long struct) { return UNSAFE.getInt(null, struct + STBTTPackContext.SKIP_MISSING); } + /** Unsafe version of {@link #h_oversample}. */ + public static int nh_oversample(long struct) { return UNSAFE.getInt(null, struct + STBTTPackContext.H_OVERSAMPLE); } + /** Unsafe version of {@link #v_oversample}. */ + public static int nv_oversample(long struct) { return UNSAFE.getInt(null, struct + STBTTPackContext.V_OVERSAMPLE); } + /** Unsafe version of {@link #pixels(int) pixels}. */ + public static ByteBuffer npixels(long struct, int capacity) { return memByteBuffer(memGetAddress(struct + STBTTPackContext.PIXELS), capacity); } + /** Unsafe version of {@link #nodes}. */ + public static STBRPNode.Buffer nnodes(long struct, int capacity) { return STBRPNode.create(memGetAddress(struct + STBTTPackContext.NODES), capacity); } + + // ----------------------------------- + + /** An array of {@link STBTTPackContext} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final STBTTPackContext ELEMENT_FACTORY = STBTTPackContext.create(-1L); + + /** + * Creates a new {@code STBTTPackContext.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link STBTTPackContext#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected STBTTPackContext getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code user_allocator_context} field. */ + @NativeType("void *") + public long user_allocator_context() { return STBTTPackContext.nuser_allocator_context(address()); } + /** Returns a {@link STBRPContext} view of the struct pointed to by the {@code pack_info} field. */ + @NativeType("stbrp_context *") + public STBRPContext pack_info() { return STBTTPackContext.npack_info(address()); } + /** Returns the value of the {@code width} field. */ + public int width() { return STBTTPackContext.nwidth(address()); } + /** Returns the value of the {@code height} field. */ + public int height() { return STBTTPackContext.nheight(address()); } + /** Returns the value of the {@code stride_in_bytes} field. */ + public int stride_in_bytes() { return STBTTPackContext.nstride_in_bytes(address()); } + /** Returns the value of the {@code padding} field. */ + public int padding() { return STBTTPackContext.npadding(address()); } + /** Returns the value of the {@code skip_missing} field. */ + @NativeType("int") + public boolean skip_missing() { return STBTTPackContext.nskip_missing(address()) != 0; } + /** Returns the value of the {@code h_oversample} field. */ + @NativeType("unsigned int") + public int h_oversample() { return STBTTPackContext.nh_oversample(address()); } + /** Returns the value of the {@code v_oversample} field. */ + @NativeType("unsigned int") + public int v_oversample() { return STBTTPackContext.nv_oversample(address()); } + /** + * Returns a {@link ByteBuffer} view of the data pointed to by the {@code pixels} field. + * + * @param capacity the number of elements in the returned buffer + */ + @NativeType("unsigned char *") + public ByteBuffer pixels(int capacity) { return STBTTPackContext.npixels(address(), capacity); } + /** + * Returns a {@link STBRPNode.Buffer} view of the struct array pointed to by the {@code nodes} field. + * + * @param capacity the number of elements in the returned buffer + */ + @NativeType("stbrp_node *") + public STBRPNode.Buffer nodes(int capacity) { return STBTTPackContext.nnodes(address(), capacity); } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTPackRange.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTPackRange.java new file mode 100644 index 00000000..3e8e434b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTPackRange.java @@ -0,0 +1,439 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A range of packed character data, used by {@link STBTruetype#stbtt_PackFontRanges PackFontRanges} + * + *

Member documentation

+ * + *
    + *
  • {@code font_size} – the font size
  • + *
  • {@code first_unicode_codepoint_in_range} – if non-zero, then the chars are continuous, and this is the first codepoint
  • + *
  • {@code array_of_unicode_codepoints} – if non-zero, then this is an array of unicode codepoints
  • + *
  • {@code num_chars} – the number of codepoints in the range
  • + *
  • {@code chardata_for_range} – output
  • + *
  • {@code h_oversample} – used internally
  • + *
  • {@code v_oversample} – used internally
  • + *
+ * + *

Layout

+ * + *

+ * struct stbtt_pack_range {
+ *     float font_size;
+ *     int first_unicode_codepoint_in_range;
+ *     int * array_of_unicode_codepoints;
+ *     int num_chars;
+ *     {@link STBTTPackedchar stbtt_packedchar} * chardata_for_range;
+ *     unsigned char h_oversample;
+ *     unsigned char v_oversample;
+ * }
+ */ +@NativeType("struct stbtt_pack_range") +public class STBTTPackRange extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + FONT_SIZE, + FIRST_UNICODE_CODEPOINT_IN_RANGE, + ARRAY_OF_UNICODE_CODEPOINTS, + NUM_CHARS, + CHARDATA_FOR_RANGE, + H_OVERSAMPLE, + V_OVERSAMPLE; + + static { + Layout layout = __struct( + __member(4), + __member(4), + __member(POINTER_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(1), + __member(1) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + FONT_SIZE = layout.offsetof(0); + FIRST_UNICODE_CODEPOINT_IN_RANGE = layout.offsetof(1); + ARRAY_OF_UNICODE_CODEPOINTS = layout.offsetof(2); + NUM_CHARS = layout.offsetof(3); + CHARDATA_FOR_RANGE = layout.offsetof(4); + H_OVERSAMPLE = layout.offsetof(5); + V_OVERSAMPLE = layout.offsetof(6); + } + + /** + * Creates a {@code STBTTPackRange} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public STBTTPackRange(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code font_size} field. */ + public float font_size() { return nfont_size(address()); } + /** Returns the value of the {@code first_unicode_codepoint_in_range} field. */ + public int first_unicode_codepoint_in_range() { return nfirst_unicode_codepoint_in_range(address()); } + /** Returns a {@link IntBuffer} view of the data pointed to by the {@code array_of_unicode_codepoints} field. */ + @Nullable + @NativeType("int *") + public IntBuffer array_of_unicode_codepoints() { return narray_of_unicode_codepoints(address()); } + /** Returns the value of the {@code num_chars} field. */ + public int num_chars() { return nnum_chars(address()); } + /** Returns a {@link STBTTPackedchar.Buffer} view of the struct array pointed to by the {@code chardata_for_range} field. */ + @NativeType("stbtt_packedchar *") + public STBTTPackedchar.Buffer chardata_for_range() { return nchardata_for_range(address()); } + /** Returns the value of the {@code h_oversample} field. */ + @NativeType("unsigned char") + public byte h_oversample() { return nh_oversample(address()); } + /** Returns the value of the {@code v_oversample} field. */ + @NativeType("unsigned char") + public byte v_oversample() { return nv_oversample(address()); } + + /** Sets the specified value to the {@code font_size} field. */ + public STBTTPackRange font_size(float value) { nfont_size(address(), value); return this; } + /** Sets the specified value to the {@code first_unicode_codepoint_in_range} field. */ + public STBTTPackRange first_unicode_codepoint_in_range(int value) { nfirst_unicode_codepoint_in_range(address(), value); return this; } + /** Sets the address of the specified {@link IntBuffer} to the {@code array_of_unicode_codepoints} field. */ + public STBTTPackRange array_of_unicode_codepoints(@Nullable @NativeType("int *") IntBuffer value) { narray_of_unicode_codepoints(address(), value); return this; } + /** Sets the specified value to the {@code num_chars} field. */ + public STBTTPackRange num_chars(int value) { nnum_chars(address(), value); return this; } + /** Sets the address of the specified {@link STBTTPackedchar.Buffer} to the {@code chardata_for_range} field. */ + public STBTTPackRange chardata_for_range(@NativeType("stbtt_packedchar *") STBTTPackedchar.Buffer value) { nchardata_for_range(address(), value); return this; } + /** Sets the specified value to the {@code h_oversample} field. */ + public STBTTPackRange h_oversample(@NativeType("unsigned char") byte value) { nh_oversample(address(), value); return this; } + /** Sets the specified value to the {@code v_oversample} field. */ + public STBTTPackRange v_oversample(@NativeType("unsigned char") byte value) { nv_oversample(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public STBTTPackRange set( + float font_size, + int first_unicode_codepoint_in_range, + @Nullable IntBuffer array_of_unicode_codepoints, + int num_chars, + STBTTPackedchar.Buffer chardata_for_range, + byte h_oversample, + byte v_oversample + ) { + font_size(font_size); + first_unicode_codepoint_in_range(first_unicode_codepoint_in_range); + array_of_unicode_codepoints(array_of_unicode_codepoints); + num_chars(num_chars); + chardata_for_range(chardata_for_range); + h_oversample(h_oversample); + v_oversample(v_oversample); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public STBTTPackRange set(STBTTPackRange src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code STBTTPackRange} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static STBTTPackRange malloc() { + return wrap(STBTTPackRange.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code STBTTPackRange} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static STBTTPackRange calloc() { + return wrap(STBTTPackRange.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code STBTTPackRange} instance allocated with {@link BufferUtils}. */ + public static STBTTPackRange create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(STBTTPackRange.class, memAddress(container), container); + } + + /** Returns a new {@code STBTTPackRange} instance for the specified memory address. */ + public static STBTTPackRange create(long address) { + return wrap(STBTTPackRange.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static STBTTPackRange createSafe(long address) { + return address == NULL ? null : wrap(STBTTPackRange.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code STBTTPackRange} instance allocated on the thread-local {@link MemoryStack}. */ + public static STBTTPackRange mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code STBTTPackRange} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static STBTTPackRange callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code STBTTPackRange} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static STBTTPackRange mallocStack(MemoryStack stack) { + return wrap(STBTTPackRange.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code STBTTPackRange} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static STBTTPackRange callocStack(MemoryStack stack) { + return wrap(STBTTPackRange.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #font_size}. */ + public static float nfont_size(long struct) { return UNSAFE.getFloat(null, struct + STBTTPackRange.FONT_SIZE); } + /** Unsafe version of {@link #first_unicode_codepoint_in_range}. */ + public static int nfirst_unicode_codepoint_in_range(long struct) { return UNSAFE.getInt(null, struct + STBTTPackRange.FIRST_UNICODE_CODEPOINT_IN_RANGE); } + /** Unsafe version of {@link #array_of_unicode_codepoints() array_of_unicode_codepoints}. */ + @Nullable public static IntBuffer narray_of_unicode_codepoints(long struct) { return memIntBufferSafe(memGetAddress(struct + STBTTPackRange.ARRAY_OF_UNICODE_CODEPOINTS), nnum_chars(struct)); } + /** Unsafe version of {@link #num_chars}. */ + public static int nnum_chars(long struct) { return UNSAFE.getInt(null, struct + STBTTPackRange.NUM_CHARS); } + /** Unsafe version of {@link #chardata_for_range}. */ + public static STBTTPackedchar.Buffer nchardata_for_range(long struct) { return STBTTPackedchar.create(memGetAddress(struct + STBTTPackRange.CHARDATA_FOR_RANGE), nnum_chars(struct)); } + /** Unsafe version of {@link #h_oversample}. */ + public static byte nh_oversample(long struct) { return UNSAFE.getByte(null, struct + STBTTPackRange.H_OVERSAMPLE); } + /** Unsafe version of {@link #v_oversample}. */ + public static byte nv_oversample(long struct) { return UNSAFE.getByte(null, struct + STBTTPackRange.V_OVERSAMPLE); } + + /** Unsafe version of {@link #font_size(float) font_size}. */ + public static void nfont_size(long struct, float value) { UNSAFE.putFloat(null, struct + STBTTPackRange.FONT_SIZE, value); } + /** Unsafe version of {@link #first_unicode_codepoint_in_range(int) first_unicode_codepoint_in_range}. */ + public static void nfirst_unicode_codepoint_in_range(long struct, int value) { UNSAFE.putInt(null, struct + STBTTPackRange.FIRST_UNICODE_CODEPOINT_IN_RANGE, value); } + /** Unsafe version of {@link #array_of_unicode_codepoints(IntBuffer) array_of_unicode_codepoints}. */ + public static void narray_of_unicode_codepoints(long struct, @Nullable IntBuffer value) { memPutAddress(struct + STBTTPackRange.ARRAY_OF_UNICODE_CODEPOINTS, memAddressSafe(value)); } + /** Sets the specified value to the {@code num_chars} field of the specified {@code struct}. */ + public static void nnum_chars(long struct, int value) { UNSAFE.putInt(null, struct + STBTTPackRange.NUM_CHARS, value); } + /** Unsafe version of {@link #chardata_for_range(STBTTPackedchar.Buffer) chardata_for_range}. */ + public static void nchardata_for_range(long struct, STBTTPackedchar.Buffer value) { memPutAddress(struct + STBTTPackRange.CHARDATA_FOR_RANGE, value.address()); } + /** Unsafe version of {@link #h_oversample(byte) h_oversample}. */ + public static void nh_oversample(long struct, byte value) { UNSAFE.putByte(null, struct + STBTTPackRange.H_OVERSAMPLE, value); } + /** Unsafe version of {@link #v_oversample(byte) v_oversample}. */ + public static void nv_oversample(long struct, byte value) { UNSAFE.putByte(null, struct + STBTTPackRange.V_OVERSAMPLE, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + STBTTPackRange.CHARDATA_FOR_RANGE)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link STBTTPackRange} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final STBTTPackRange ELEMENT_FACTORY = STBTTPackRange.create(-1L); + + /** + * Creates a new {@code STBTTPackRange.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link STBTTPackRange#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected STBTTPackRange getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code font_size} field. */ + public float font_size() { return STBTTPackRange.nfont_size(address()); } + /** Returns the value of the {@code first_unicode_codepoint_in_range} field. */ + public int first_unicode_codepoint_in_range() { return STBTTPackRange.nfirst_unicode_codepoint_in_range(address()); } + /** Returns a {@link IntBuffer} view of the data pointed to by the {@code array_of_unicode_codepoints} field. */ + @Nullable + @NativeType("int *") + public IntBuffer array_of_unicode_codepoints() { return STBTTPackRange.narray_of_unicode_codepoints(address()); } + /** Returns the value of the {@code num_chars} field. */ + public int num_chars() { return STBTTPackRange.nnum_chars(address()); } + /** Returns a {@link STBTTPackedchar.Buffer} view of the struct array pointed to by the {@code chardata_for_range} field. */ + @NativeType("stbtt_packedchar *") + public STBTTPackedchar.Buffer chardata_for_range() { return STBTTPackRange.nchardata_for_range(address()); } + /** Returns the value of the {@code h_oversample} field. */ + @NativeType("unsigned char") + public byte h_oversample() { return STBTTPackRange.nh_oversample(address()); } + /** Returns the value of the {@code v_oversample} field. */ + @NativeType("unsigned char") + public byte v_oversample() { return STBTTPackRange.nv_oversample(address()); } + + /** Sets the specified value to the {@code font_size} field. */ + public Buffer font_size(float value) { STBTTPackRange.nfont_size(address(), value); return this; } + /** Sets the specified value to the {@code first_unicode_codepoint_in_range} field. */ + public Buffer first_unicode_codepoint_in_range(int value) { STBTTPackRange.nfirst_unicode_codepoint_in_range(address(), value); return this; } + /** Sets the address of the specified {@link IntBuffer} to the {@code array_of_unicode_codepoints} field. */ + public Buffer array_of_unicode_codepoints(@Nullable @NativeType("int *") IntBuffer value) { STBTTPackRange.narray_of_unicode_codepoints(address(), value); return this; } + /** Sets the specified value to the {@code num_chars} field. */ + public Buffer num_chars(int value) { STBTTPackRange.nnum_chars(address(), value); return this; } + /** Sets the address of the specified {@link STBTTPackedchar.Buffer} to the {@code chardata_for_range} field. */ + public Buffer chardata_for_range(@NativeType("stbtt_packedchar *") STBTTPackedchar.Buffer value) { STBTTPackRange.nchardata_for_range(address(), value); return this; } + /** Sets the specified value to the {@code h_oversample} field. */ + public Buffer h_oversample(@NativeType("unsigned char") byte value) { STBTTPackRange.nh_oversample(address(), value); return this; } + /** Sets the specified value to the {@code v_oversample} field. */ + public Buffer v_oversample(@NativeType("unsigned char") byte value) { STBTTPackRange.nv_oversample(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTPackedchar.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTPackedchar.java new file mode 100644 index 00000000..2fb03507 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTPackedchar.java @@ -0,0 +1,439 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Packed character data, returned by {@link STBTruetype#stbtt_PackFontRange PackFontRange} + * + *

Layout

+ * + *

+ * struct stbtt_packedchar {
+ *     unsigned short x0;
+ *     unsigned short y0;
+ *     unsigned short x1;
+ *     unsigned short y1;
+ *     float xoff;
+ *     float yoff;
+ *     float xadvance;
+ *     float xoff2;
+ *     float yoff2;
+ * }
+ */ +@NativeType("struct stbtt_packedchar") +public class STBTTPackedchar extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + X0, + Y0, + X1, + Y1, + XOFF, + YOFF, + XADVANCE, + XOFF2, + YOFF2; + + static { + Layout layout = __struct( + __member(2), + __member(2), + __member(2), + __member(2), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + X0 = layout.offsetof(0); + Y0 = layout.offsetof(1); + X1 = layout.offsetof(2); + Y1 = layout.offsetof(3); + XOFF = layout.offsetof(4); + YOFF = layout.offsetof(5); + XADVANCE = layout.offsetof(6); + XOFF2 = layout.offsetof(7); + YOFF2 = layout.offsetof(8); + } + + /** + * Creates a {@code STBTTPackedchar} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public STBTTPackedchar(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code x0} field. */ + @NativeType("unsigned short") + public short x0() { return nx0(address()); } + /** Returns the value of the {@code y0} field. */ + @NativeType("unsigned short") + public short y0() { return ny0(address()); } + /** Returns the value of the {@code x1} field. */ + @NativeType("unsigned short") + public short x1() { return nx1(address()); } + /** Returns the value of the {@code y1} field. */ + @NativeType("unsigned short") + public short y1() { return ny1(address()); } + /** Returns the value of the {@code xoff} field. */ + public float xoff() { return nxoff(address()); } + /** Returns the value of the {@code yoff} field. */ + public float yoff() { return nyoff(address()); } + /** Returns the value of the {@code xadvance} field. */ + public float xadvance() { return nxadvance(address()); } + /** Returns the value of the {@code xoff2} field. */ + public float xoff2() { return nxoff2(address()); } + /** Returns the value of the {@code yoff2} field. */ + public float yoff2() { return nyoff2(address()); } + + /** Sets the specified value to the {@code x0} field. */ + public STBTTPackedchar x0(@NativeType("unsigned short") short value) { nx0(address(), value); return this; } + /** Sets the specified value to the {@code y0} field. */ + public STBTTPackedchar y0(@NativeType("unsigned short") short value) { ny0(address(), value); return this; } + /** Sets the specified value to the {@code x1} field. */ + public STBTTPackedchar x1(@NativeType("unsigned short") short value) { nx1(address(), value); return this; } + /** Sets the specified value to the {@code y1} field. */ + public STBTTPackedchar y1(@NativeType("unsigned short") short value) { ny1(address(), value); return this; } + /** Sets the specified value to the {@code xoff} field. */ + public STBTTPackedchar xoff(float value) { nxoff(address(), value); return this; } + /** Sets the specified value to the {@code yoff} field. */ + public STBTTPackedchar yoff(float value) { nyoff(address(), value); return this; } + /** Sets the specified value to the {@code xadvance} field. */ + public STBTTPackedchar xadvance(float value) { nxadvance(address(), value); return this; } + /** Sets the specified value to the {@code xoff2} field. */ + public STBTTPackedchar xoff2(float value) { nxoff2(address(), value); return this; } + /** Sets the specified value to the {@code yoff2} field. */ + public STBTTPackedchar yoff2(float value) { nyoff2(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public STBTTPackedchar set( + short x0, + short y0, + short x1, + short y1, + float xoff, + float yoff, + float xadvance, + float xoff2, + float yoff2 + ) { + x0(x0); + y0(y0); + x1(x1); + y1(y1); + xoff(xoff); + yoff(yoff); + xadvance(xadvance); + xoff2(xoff2); + yoff2(yoff2); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public STBTTPackedchar set(STBTTPackedchar src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code STBTTPackedchar} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static STBTTPackedchar malloc() { + return wrap(STBTTPackedchar.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code STBTTPackedchar} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static STBTTPackedchar calloc() { + return wrap(STBTTPackedchar.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code STBTTPackedchar} instance allocated with {@link BufferUtils}. */ + public static STBTTPackedchar create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(STBTTPackedchar.class, memAddress(container), container); + } + + /** Returns a new {@code STBTTPackedchar} instance for the specified memory address. */ + public static STBTTPackedchar create(long address) { + return wrap(STBTTPackedchar.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static STBTTPackedchar createSafe(long address) { + return address == NULL ? null : wrap(STBTTPackedchar.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code STBTTPackedchar} instance allocated on the thread-local {@link MemoryStack}. */ + public static STBTTPackedchar mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code STBTTPackedchar} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static STBTTPackedchar callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code STBTTPackedchar} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static STBTTPackedchar mallocStack(MemoryStack stack) { + return wrap(STBTTPackedchar.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code STBTTPackedchar} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static STBTTPackedchar callocStack(MemoryStack stack) { + return wrap(STBTTPackedchar.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #x0}. */ + public static short nx0(long struct) { return UNSAFE.getShort(null, struct + STBTTPackedchar.X0); } + /** Unsafe version of {@link #y0}. */ + public static short ny0(long struct) { return UNSAFE.getShort(null, struct + STBTTPackedchar.Y0); } + /** Unsafe version of {@link #x1}. */ + public static short nx1(long struct) { return UNSAFE.getShort(null, struct + STBTTPackedchar.X1); } + /** Unsafe version of {@link #y1}. */ + public static short ny1(long struct) { return UNSAFE.getShort(null, struct + STBTTPackedchar.Y1); } + /** Unsafe version of {@link #xoff}. */ + public static float nxoff(long struct) { return UNSAFE.getFloat(null, struct + STBTTPackedchar.XOFF); } + /** Unsafe version of {@link #yoff}. */ + public static float nyoff(long struct) { return UNSAFE.getFloat(null, struct + STBTTPackedchar.YOFF); } + /** Unsafe version of {@link #xadvance}. */ + public static float nxadvance(long struct) { return UNSAFE.getFloat(null, struct + STBTTPackedchar.XADVANCE); } + /** Unsafe version of {@link #xoff2}. */ + public static float nxoff2(long struct) { return UNSAFE.getFloat(null, struct + STBTTPackedchar.XOFF2); } + /** Unsafe version of {@link #yoff2}. */ + public static float nyoff2(long struct) { return UNSAFE.getFloat(null, struct + STBTTPackedchar.YOFF2); } + + /** Unsafe version of {@link #x0(short) x0}. */ + public static void nx0(long struct, short value) { UNSAFE.putShort(null, struct + STBTTPackedchar.X0, value); } + /** Unsafe version of {@link #y0(short) y0}. */ + public static void ny0(long struct, short value) { UNSAFE.putShort(null, struct + STBTTPackedchar.Y0, value); } + /** Unsafe version of {@link #x1(short) x1}. */ + public static void nx1(long struct, short value) { UNSAFE.putShort(null, struct + STBTTPackedchar.X1, value); } + /** Unsafe version of {@link #y1(short) y1}. */ + public static void ny1(long struct, short value) { UNSAFE.putShort(null, struct + STBTTPackedchar.Y1, value); } + /** Unsafe version of {@link #xoff(float) xoff}. */ + public static void nxoff(long struct, float value) { UNSAFE.putFloat(null, struct + STBTTPackedchar.XOFF, value); } + /** Unsafe version of {@link #yoff(float) yoff}. */ + public static void nyoff(long struct, float value) { UNSAFE.putFloat(null, struct + STBTTPackedchar.YOFF, value); } + /** Unsafe version of {@link #xadvance(float) xadvance}. */ + public static void nxadvance(long struct, float value) { UNSAFE.putFloat(null, struct + STBTTPackedchar.XADVANCE, value); } + /** Unsafe version of {@link #xoff2(float) xoff2}. */ + public static void nxoff2(long struct, float value) { UNSAFE.putFloat(null, struct + STBTTPackedchar.XOFF2, value); } + /** Unsafe version of {@link #yoff2(float) yoff2}. */ + public static void nyoff2(long struct, float value) { UNSAFE.putFloat(null, struct + STBTTPackedchar.YOFF2, value); } + + // ----------------------------------- + + /** An array of {@link STBTTPackedchar} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final STBTTPackedchar ELEMENT_FACTORY = STBTTPackedchar.create(-1L); + + /** + * Creates a new {@code STBTTPackedchar.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link STBTTPackedchar#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected STBTTPackedchar getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code x0} field. */ + @NativeType("unsigned short") + public short x0() { return STBTTPackedchar.nx0(address()); } + /** Returns the value of the {@code y0} field. */ + @NativeType("unsigned short") + public short y0() { return STBTTPackedchar.ny0(address()); } + /** Returns the value of the {@code x1} field. */ + @NativeType("unsigned short") + public short x1() { return STBTTPackedchar.nx1(address()); } + /** Returns the value of the {@code y1} field. */ + @NativeType("unsigned short") + public short y1() { return STBTTPackedchar.ny1(address()); } + /** Returns the value of the {@code xoff} field. */ + public float xoff() { return STBTTPackedchar.nxoff(address()); } + /** Returns the value of the {@code yoff} field. */ + public float yoff() { return STBTTPackedchar.nyoff(address()); } + /** Returns the value of the {@code xadvance} field. */ + public float xadvance() { return STBTTPackedchar.nxadvance(address()); } + /** Returns the value of the {@code xoff2} field. */ + public float xoff2() { return STBTTPackedchar.nxoff2(address()); } + /** Returns the value of the {@code yoff2} field. */ + public float yoff2() { return STBTTPackedchar.nyoff2(address()); } + + /** Sets the specified value to the {@code x0} field. */ + public Buffer x0(@NativeType("unsigned short") short value) { STBTTPackedchar.nx0(address(), value); return this; } + /** Sets the specified value to the {@code y0} field. */ + public Buffer y0(@NativeType("unsigned short") short value) { STBTTPackedchar.ny0(address(), value); return this; } + /** Sets the specified value to the {@code x1} field. */ + public Buffer x1(@NativeType("unsigned short") short value) { STBTTPackedchar.nx1(address(), value); return this; } + /** Sets the specified value to the {@code y1} field. */ + public Buffer y1(@NativeType("unsigned short") short value) { STBTTPackedchar.ny1(address(), value); return this; } + /** Sets the specified value to the {@code xoff} field. */ + public Buffer xoff(float value) { STBTTPackedchar.nxoff(address(), value); return this; } + /** Sets the specified value to the {@code yoff} field. */ + public Buffer yoff(float value) { STBTTPackedchar.nyoff(address(), value); return this; } + /** Sets the specified value to the {@code xadvance} field. */ + public Buffer xadvance(float value) { STBTTPackedchar.nxadvance(address(), value); return this; } + /** Sets the specified value to the {@code xoff2} field. */ + public Buffer xoff2(float value) { STBTTPackedchar.nxoff2(address(), value); return this; } + /** Sets the specified value to the {@code yoff2} field. */ + public Buffer yoff2(float value) { STBTTPackedchar.nyoff2(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTVertex.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTVertex.java new file mode 100644 index 00000000..5c5d7651 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTTVertex.java @@ -0,0 +1,331 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Vertex data. + * + *

Layout

+ * + *

+ * struct stbtt_vertex {
+ *     stbtt_vertex_type x;
+ *     stbtt_vertex_type y;
+ *     stbtt_vertex_type cx;
+ *     stbtt_vertex_type cy;
+ *     stbtt_vertex_type cx1;
+ *     stbtt_vertex_type cy1;
+ *     unsigned char type;
+ * }
+ */ +@NativeType("struct stbtt_vertex") +public class STBTTVertex extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + X, + Y, + CX, + CY, + CX1, + CY1, + TYPE; + + static { + Layout layout = __struct( + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(1) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + X = layout.offsetof(0); + Y = layout.offsetof(1); + CX = layout.offsetof(2); + CY = layout.offsetof(3); + CX1 = layout.offsetof(4); + CY1 = layout.offsetof(5); + TYPE = layout.offsetof(6); + } + + /** + * Creates a {@code STBTTVertex} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public STBTTVertex(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code x} field. */ + @NativeType("stbtt_vertex_type") + public short x() { return nx(address()); } + /** Returns the value of the {@code y} field. */ + @NativeType("stbtt_vertex_type") + public short y() { return ny(address()); } + /** Returns the value of the {@code cx} field. */ + @NativeType("stbtt_vertex_type") + public short cx() { return ncx(address()); } + /** Returns the value of the {@code cy} field. */ + @NativeType("stbtt_vertex_type") + public short cy() { return ncy(address()); } + /** Returns the value of the {@code cx1} field. */ + @NativeType("stbtt_vertex_type") + public short cx1() { return ncx1(address()); } + /** Returns the value of the {@code cy1} field. */ + @NativeType("stbtt_vertex_type") + public short cy1() { return ncy1(address()); } + /** Returns the value of the {@code type} field. */ + @NativeType("unsigned char") + public byte type() { return ntype(address()); } + + // ----------------------------------- + + /** Returns a new {@code STBTTVertex} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static STBTTVertex malloc() { + return wrap(STBTTVertex.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code STBTTVertex} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static STBTTVertex calloc() { + return wrap(STBTTVertex.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code STBTTVertex} instance allocated with {@link BufferUtils}. */ + public static STBTTVertex create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(STBTTVertex.class, memAddress(container), container); + } + + /** Returns a new {@code STBTTVertex} instance for the specified memory address. */ + public static STBTTVertex create(long address) { + return wrap(STBTTVertex.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static STBTTVertex createSafe(long address) { + return address == NULL ? null : wrap(STBTTVertex.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code STBTTVertex} instance allocated on the thread-local {@link MemoryStack}. */ + public static STBTTVertex mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code STBTTVertex} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static STBTTVertex callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code STBTTVertex} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static STBTTVertex mallocStack(MemoryStack stack) { + return wrap(STBTTVertex.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code STBTTVertex} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static STBTTVertex callocStack(MemoryStack stack) { + return wrap(STBTTVertex.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #x}. */ + public static short nx(long struct) { return UNSAFE.getShort(null, struct + STBTTVertex.X); } + /** Unsafe version of {@link #y}. */ + public static short ny(long struct) { return UNSAFE.getShort(null, struct + STBTTVertex.Y); } + /** Unsafe version of {@link #cx}. */ + public static short ncx(long struct) { return UNSAFE.getShort(null, struct + STBTTVertex.CX); } + /** Unsafe version of {@link #cy}. */ + public static short ncy(long struct) { return UNSAFE.getShort(null, struct + STBTTVertex.CY); } + /** Unsafe version of {@link #cx1}. */ + public static short ncx1(long struct) { return UNSAFE.getShort(null, struct + STBTTVertex.CX1); } + /** Unsafe version of {@link #cy1}. */ + public static short ncy1(long struct) { return UNSAFE.getShort(null, struct + STBTTVertex.CY1); } + /** Unsafe version of {@link #type}. */ + public static byte ntype(long struct) { return UNSAFE.getByte(null, struct + STBTTVertex.TYPE); } + + // ----------------------------------- + + /** An array of {@link STBTTVertex} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final STBTTVertex ELEMENT_FACTORY = STBTTVertex.create(-1L); + + /** + * Creates a new {@code STBTTVertex.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link STBTTVertex#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected STBTTVertex getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code x} field. */ + @NativeType("stbtt_vertex_type") + public short x() { return STBTTVertex.nx(address()); } + /** Returns the value of the {@code y} field. */ + @NativeType("stbtt_vertex_type") + public short y() { return STBTTVertex.ny(address()); } + /** Returns the value of the {@code cx} field. */ + @NativeType("stbtt_vertex_type") + public short cx() { return STBTTVertex.ncx(address()); } + /** Returns the value of the {@code cy} field. */ + @NativeType("stbtt_vertex_type") + public short cy() { return STBTTVertex.ncy(address()); } + /** Returns the value of the {@code cx1} field. */ + @NativeType("stbtt_vertex_type") + public short cx1() { return STBTTVertex.ncx1(address()); } + /** Returns the value of the {@code cy1} field. */ + @NativeType("stbtt_vertex_type") + public short cy1() { return STBTTVertex.ncy1(address()); } + /** Returns the value of the {@code type} field. */ + @NativeType("unsigned char") + public byte type() { return STBTTVertex.ntype(address()); } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTruetype.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTruetype.java new file mode 100644 index 00000000..ce3ffc00 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBTruetype.java @@ -0,0 +1,2157 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to stb_truetype.h from the stb library. + * + *

This library processes TrueType files:

+ * + *
    + *
  • parse files
  • + *
  • extract glyph metrics
  • + *
  • extract glyph shapes
  • + *
  • render glyphs to one-channel bitmaps with antialiasing (box filter)
  • + *
+ * + *

ADDITIONAL DOCUMENTATION

+ * + *

Some important concepts to understand to use this library:

+ * + *

Codepoint

+ * + *

Characters are defined by unicode codepoints, e.g. 65 is uppercase A, 231 is lowercase c with a cedilla, 0x7e30 is the hiragana for "ma".

+ * + *

Glyph

+ * + *

A visual character shape (every codepoint is rendered as some glyph)

+ * + *

Glyph index

+ * + *

A font-specific integer ID representing a glyph

+ * + *

Baseline

+ * + *

Glyph shapes are defined relative to a baseline, which is the bottom of uppercase characters. Characters extend both above and below the baseline.

+ * + *

Current Point

+ * + *

As you draw text to the screen, you keep track of a "current point" which is the origin of each character. The current point's vertical position is the + * baseline. Even "baked fonts" use this model.

+ * + *

Vertical Font Metrics

+ * + *

The vertical qualities of the font, used to vertically position and space the characters. See docs for {@link #stbtt_GetFontVMetrics GetFontVMetrics}.

+ * + *

Font Size in Pixels or Points

+ * + *

The preferred interface for specifying font sizes in stb_truetype is to specify how tall the font's vertical extent should be in pixels. If that sounds + * good enough, skip the next paragraph.

+ * + *

Most font APIs instead use "points", which are a common typographic measurement for describing font size, defined as 72 points per inch. stb_truetype + * provides a point API for compatibility. However, true "per inch" conventions don't make much sense on computer displays since different monitors have + * different number of pixels per inch. For example, Windows traditionally uses a convention that there are 96 pixels per inch, thus making 'inch' + * measurements have nothing to do with inches, and thus effectively defining a point to be 1.333 pixels. Additionally, the TrueType font data provides an + * explicit scale factor to scale a given font's glyphs to points, but the author has observed that this scale factor is often wrong for non-commercial + * fonts, thus making fonts scaled in points according to the TrueType spec incoherently sized in practice.

+ * + *

DETAILED USAGE

+ * + *

Scale:

+ * + *

Select how high you want the font to be, in points or pixels. Call #()ScaleForPixelHeight or {@link #stbtt_ScaleForMappingEmToPixels ScaleForMappingEmToPixels} to compute a scale factor + * {@code SF} that will be used by all other functions.

+ * + *

Baseline:

+ * + *

You need to select a y-coordinate that is the baseline of where your text will appear. Call {@link #stbtt_GetFontBoundingBox GetFontBoundingBox} to get the baseline-relative bounding + * box for all characters. {@code SF*-y0} will be the distance in pixels that the worst-case character could extend above the baseline, so if you want the + * top edge of characters to appear at the top of the screen where {@code y=0}, then you would set the baseline to {@code SF*-y0}.

+ * + *

Current point:

+ * + *

Set the current point where the first character will appear. The first character could extend left of the current point; this is font dependent. You + * can either choose a current point that is the leftmost point and hope, or add some padding, or check the bounding box or left-side-bearing of the first + * character to be displayed and set the current point based on that.

+ * + *

Displaying a character:

+ * + *

Compute the bounding box of the character. It will contain signed values relative to {@code }. I.e. if it returns + * {@code x0,y0,x1,y1}, then the character should be displayed in the rectangle from {@code } to + * {@code + * + *

Advancing for the next character:

+ * + *

Call {@link #stbtt_GetGlyphHMetrics GetGlyphHMetrics}, and compute {@code current_point += SF * advance}.

+ * + *

ADVANCED USAGE

+ * + *

Quality:

+ * + *
    + *
  • Use the functions with Subpixel at the end to allow your characters to have subpixel positioning. Since the font is anti-aliased, not hinted, this + * is very important for quality. (This is not possible with baked fonts.)
  • + *
  • Kerning is now supported, and if you're supporting subpixel rendering then kerning is worth using to give your text a polished look.
  • + *
+ * + *

Performance:

+ * + *
    + *
  • Convert Unicode codepoints to glyph indexes and operate on the glyphs; if you don't do this, stb_truetype is forced to do the conversion on every + * call.
  • + *
  • There are a lot of memory allocations. We should modify it to take a temp buffer and allocate from the temp buffer (without freeing), should help + * performance a lot.
  • + *
+ * + *

NOTES

+ * + *

The system uses the raw data found in the .ttf file without changing it and without building auxiliary data structures. This is a bit inefficient on + * little-endian systems (the data is big-endian), but assuming you're caching the bitmaps or glyph shapes this shouldn't be a big deal.

+ * + *

It appears to be very hard to programmatically determine what font a given file is in a general way. I provide an API for this, but I don't recommend + * it.

+ * + *

SAMPLE PROGRAMS

+ * + *

Incomplete text-in-3d-api example, which draws quads properly aligned to be lossless:

+ * + *

+ * unsigned char ttf_buffer[1<<20];
+ * unsigned char temp_bitmap[512*512];
+ * 
+ * stbtt_bakedchar cdata[96]; // ASCII 32..126 is 95 glyphs
+ * GLuint ftex;
+ * 
+ * void my_stbtt_initfont(void)
+ * {
+ *    fread(ttf_buffer, 1, 1<<20, fopen("c:/windows/fonts/times.ttf", "rb"));
+ *    stbtt_BakeFontBitmap(ttf_buffer,0, 32.0, temp_bitmap,512,512, 32,96, cdata); // no guarantee this fits!
+ *    // can free ttf_buffer at this point
+ *    glGenTextures(1, &ftex);
+ *    glBindTexture(GL_TEXTURE_2D, ftex);
+ *    glTexImage2D(GL_TEXTURE_2D, 0, GL_ALPHA, 512,512, 0, GL_ALPHA, GL_UNSIGNED_BYTE, temp_bitmap);
+ *    // can free temp_bitmap at this point
+ *    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ * }
+ * 
+ * void my_stbtt_print(float x, float y, char *text)
+ * {
+ *    // assume orthographic projection with units = screen pixels, origin at top left
+ *    glEnable(GL_TEXTURE_2D);
+ *    glBindTexture(GL_TEXTURE_2D, ftex);
+ *    glBegin(GL_QUADS);
+ *    while (*text) {
+ *       if (*text >= 32 && *text < 128) {
+ *          stbtt_aligned_quad q;
+ *          stbtt_GetBakedQuad(cdata, 512,512, *text-32, &x,&y,&q,1);//1=opengl & d3d10+,0=d3d9
+ *          glTexCoord2f(q.s0,q.t1); glVertex2f(q.x0,q.y0);
+ *          glTexCoord2f(q.s1,q.t1); glVertex2f(q.x1,q.y0);
+ *          glTexCoord2f(q.s1,q.t0); glVertex2f(q.x1,q.y1);
+ *          glTexCoord2f(q.s0,q.t0); glVertex2f(q.x0,q.y1);
+ *       }
+ *       ++text;
+ *    }
+ *    glEnd();
+ * }
+ * + *

Complete program (this compiles): get a single bitmap, print as ASCII art:

+ * + *

+ * char ttf_buffer[1<<25];
+ * 
+ * int main(int argc, char **argv)
+ * {
+ *    stbtt_fontinfo font;
+ *    unsigned char *bitmap;
+ *    int w,h,i,j,c = (argc > 1 ? atoi(argv[1]) : 'a'), s = (argc > 2 ? atoi(argv[2]) : 20);
+ * 
+ *    fread(ttf_buffer, 1, 1<<25, fopen(argc > 3 ? argv[3] : "c:/windows/fonts/arialbd.ttf", "rb"));
+ * 
+ *    stbtt_InitFont(&font, ttf_buffer, stbtt_GetFontOffsetForIndex(ttf_buffer,0));
+ *    bitmap = stbtt_GetCodepointBitmap(&font, 0,stbtt_ScaleForPixelHeight(&font, s), c, &w, &h, 0,0);
+ * 
+ *    for (j=0; j < h; ++j) {
+ *       for (i=0; i < w; ++i)
+ *          putchar(" .:ioVM@"[bitmap[j*w+i]>>5]);
+ *       putchar('\n');
+ *    }
+ *    return 0;
+ * }
+ * + *

Complete program: print "Hello World!" banner, with bugs:

+ * + *

+ * char buffer[24<<20];
+ * unsigned char screen[20][79];
+ * 
+ * int main(int arg, char **argv)
+ * {
+ *    stbtt_fontinfo font;
+ *    int i,j,ascent,baseline,ch=0;
+ *    float scale, xpos=2; // leave a little padding in case the character extends left
+ *    char *text = "Heljo World!";
+ * 
+ *    fread(buffer, 1, 1000000, fopen("c:/windows/fonts/arialbd.ttf", "rb"));
+ *    stbtt_InitFont(&font, buffer, 0);
+ * 
+ *    scale = stbtt_ScaleForPixelHeight(&font, 15);
+ *    stbtt_GetFontVMetrics(&font, &ascent,0,0);
+ *    baseline = (int) (ascent*scale);
+ * 
+ *    while (text[ch]) {
+ *       int advance,lsb,x0,y0,x1,y1;
+ *       float x_shift = xpos - (float) floor(xpos);
+ *       stbtt_GetCodepointHMetrics(&font, text[ch], &advance, &lsb);
+ *       stbtt_GetCodepointBitmapBoxSubpixel(&font, text[ch], scale,scale,x_shift,0, &x0,&y0,&x1,&y1);
+ *       stbtt_MakeCodepointBitmapSubpixel(&font, &screen[baseline + y0][(int) xpos + x0], x1-x0,y1-y0, 79, scale,scale,x_shift,0, text[ch]);
+ *       // note that this stomps the old data, so where character boxes overlap (e.g. 'lj') it's wrong
+ *       // because this API is really for baking character bitmaps into textures. if you want to render
+ *       // a sequence of characters, you really need to render each bitmap to a temp buffer, then
+ *       // "alpha blend" that into the working buffer
+ *       xpos += (advance * scale);
+ *       if (text[ch+1])
+ *          xpos += scale*stbtt_GetCodepointKernAdvance(&font, text[ch],text[ch+1]);
+ *       ++ch;
+ *    }
+ * 
+ *    for (j=0; j < 20; ++j) {
+ *       for (i=0; i < 78; ++i)
+ *          putchar(" .:ioVM@"[screen[j][i]>>5]);
+ *       putchar('\n');
+ *    }
+ * 
+ *    return 0;
+ * }
+ * + *

Finding the right font...

+ * + *

You should really just solve this offline, keep your own tables of what font is what, and don't try to get it out of the .ttf file. That's because + * getting it out of the .ttf file is really hard, because the names in the file can appear in many possible encodings, in many possible languages, and + * e.g. if you need a case-insensitive comparison, the details of that depend on the encoding & language in a complex way (actually underspecified in + * truetype, but also gigantic).

+ * + *

But you can use the provided functions in two possible ways:

+ * + *
    + *
  • {@link #stbtt_FindMatchingFont FindMatchingFont} will use *case-sensitive* comparisons on unicode-encoded names to try to find the font you want; you can run this before + * calling {@link #stbtt_InitFont InitFont}
  • + *
  • {@link #stbtt_GetFontNameString GetFontNameString} lets you get any of the various strings from the file yourself and do your own comparisons on them. You have to have called + * {@link #stbtt_InitFont InitFont} first.
  • + *
+ */ +public class STBTruetype { + + /** Vertex type. */ + public static final byte + STBTT_vmove = 1, + STBTT_vline = 2, + STBTT_vcurve = 3, + STBTT_vcubic = 4; + + /** Style flags, use in {@link #stbtt_FindMatchingFont FindMatchingFont}. */ + public static final int + STBTT_MACSTYLE_DONTCARE = 0, + STBTT_MACSTYLE_BOLD = 1, + STBTT_MACSTYLE_ITALIC = 2, + STBTT_MACSTYLE_UNDERSCORE = 4, + STBTT_MACSTYLE_NONE = 8; + + /** Platform IDs. */ + public static final int + STBTT_PLATFORM_ID_UNICODE = 0, + STBTT_PLATFORM_ID_MAC = 1, + STBTT_PLATFORM_ID_ISO = 2, + STBTT_PLATFORM_ID_MICROSOFT = 3; + + /** Encoding IDs for {@link #STBTT_PLATFORM_ID_UNICODE PLATFORM_ID_UNICODE}. */ + public static final int + STBTT_UNICODE_EID_UNICODE_1_0 = 0, + STBTT_UNICODE_EID_UNICODE_1_1 = 1, + STBTT_UNICODE_EID_ISO_10646 = 2, + STBTT_UNICODE_EID_UNICODE_2_0_BMP = 3, + STBTT_UNICODE_EID_UNICODE_2_0_FULL = 4; + + /** Encoding IDs for {@link #STBTT_PLATFORM_ID_MICROSOFT PLATFORM_ID_MICROSOFT}. */ + public static final int + STBTT_MS_EID_SYMBOL = 0, + STBTT_MS_EID_UNICODE_BMP = 1, + STBTT_MS_EID_SHIFTJIS = 2, + STBTT_MS_EID_UNICODE_FULL = 10; + + /** Encoding IDs for {@link #STBTT_PLATFORM_ID_MAC PLATFORM_ID_MAC}. */ + public static final int + STBTT_MAC_EID_ROMAN = 0, + STBTT_MAC_EID_JAPANESE = 1, + STBTT_MAC_EID_CHINESE_TRAD = 2, + STBTT_MAC_EID_KOREAN = 3, + STBTT_MAC_EID_ARABIC = 4, + STBTT_MAC_EID_HEBREW = 5, + STBTT_MAC_EID_GREEK = 6, + STBTT_MAC_EID_RUSSIAN = 7; + + /** Language ID for {@link #STBTT_PLATFORM_ID_MICROSOFT PLATFORM_ID_MICROSOFT}. */ + public static final int + STBTT_MS_LANG_ENGLISH = 0x409, + STBTT_MS_LANG_CHINESE = 0x804, + STBTT_MS_LANG_DUTCH = 0x413, + STBTT_MS_LANG_FRENCH = 0x40C, + STBTT_MS_LANG_GERMAN = 0x407, + STBTT_MS_LANG_HEBREW = 0x40D, + STBTT_MS_LANG_ITALIAN = 0x410, + STBTT_MS_LANG_JAPANESE = 0x411, + STBTT_MS_LANG_KOREAN = 0x412, + STBTT_MS_LANG_RUSSIAN = 0x419, + STBTT_MS_LANG_SPANISH = 0x409, + STBTT_MS_LANG_SWEDISH = 0x41D; + + /** Language ID for {@link #STBTT_PLATFORM_ID_MAC PLATFORM_ID_MAC}. */ + public static final int + STBTT_MAC_LANG_ENGLISH = 0, + STBTT_MAC_LANG_ARABIC = 12, + STBTT_MAC_LANG_DUTCH = 4, + STBTT_MAC_LANG_FRENCH = 1, + STBTT_MAC_LANG_GERMAN = 2, + STBTT_MAC_LANG_HEBREW = 10, + STBTT_MAC_LANG_ITALIAN = 3, + STBTT_MAC_LANG_JAPANESE = 11, + STBTT_MAC_LANG_KOREAN = 23, + STBTT_MAC_LANG_RUSSIAN = 32, + STBTT_MAC_LANG_SPANISH = 6, + STBTT_MAC_LANG_SWEDISH = 5, + STBTT_MAC_LANG_CHINESE_SIMPLIFIED = 33, + STBTT_MAC_LANG_CHINESE_TRAD = 19; + + static { LibSTB.initialize(); } + + protected STBTruetype() { + throw new UnsupportedOperationException(); + } + + // --- [ stbtt_BakeFontBitmap ] --- + + /** + * Unsafe version of: {@link #stbtt_BakeFontBitmap BakeFontBitmap} + * + * @param num_chars the number of characters to bake, starting at {@code first_char} + */ + public static native int nstbtt_BakeFontBitmap(long data, int offset, float pixel_height, long pixels, int pw, int ph, int first_char, int num_chars, long chardata); + + /** + * Bakes a font to a bitmap for use as texture. + * + *

This uses a very simply packing, use with {@link #stbtt_GetBakedQuad GetBakedQuad}.

+ * + * @param data the font data + * @param pixel_height the font height, in pixels + * @param pixels a buffer in which to write the font bitmap + * @param pw the bitmap width, in pixels + * @param ph the bitmap height, in pixels + * @param first_char the first character to bake + * @param chardata an array of {@link STBTTBakedChar} structs, it's {@code num_chars} long + * + * @return if positive, the first unused row of the bitmap. If negative, returns the negative of the number of characters that fit. If 0, no characters fit and no + * rows were used. + */ + public static int stbtt_BakeFontBitmap(@NativeType("unsigned char const *") ByteBuffer data, float pixel_height, @NativeType("unsigned char *") ByteBuffer pixels, int pw, int ph, int first_char, @NativeType("stbtt_bakedchar *") STBTTBakedChar.Buffer chardata) { + if (CHECKS) { + check(pixels, pw * ph); + } + return nstbtt_BakeFontBitmap(memAddress(data), 0, pixel_height, memAddress(pixels), pw, ph, first_char, chardata.remaining(), chardata.address()); + } + + // --- [ stbtt_GetBakedQuad ] --- + + /** Unsafe version of: {@link #stbtt_GetBakedQuad GetBakedQuad} */ + public static native void nstbtt_GetBakedQuad(long chardata, int pw, int ph, int char_index, long xpos, long ypos, long q, int opengl_fillrule); + + /** + * Computes quad to draw for a given char and advances the current position. + * + *

The coordinate system used assumes y increases downwards. Characters will extend both above and below the current position; see discussion of + * "BASELINE" above.

+ * + * @param chardata an array of {@link STBTTBakedChar} structs + * @param pw the bitmap width, in pixels + * @param ph the bitmap height, in pixels + * @param char_index the character index in the {@code chardata} array + * @param xpos the current x position, in screen pixel space + * @param ypos the current y position, in screen pixel space + * @param q an {@link STBTTAlignedQuad} struct in which to return the quad to draw + * @param opengl_fillrule 1 if opengl fill rule; 0 if DX9 or earlier + */ + public static void stbtt_GetBakedQuad(@NativeType("stbtt_bakedchar const *") STBTTBakedChar.Buffer chardata, int pw, int ph, int char_index, @NativeType("float *") FloatBuffer xpos, @NativeType("float *") FloatBuffer ypos, @NativeType("stbtt_aligned_quad *") STBTTAlignedQuad q, @NativeType("int") boolean opengl_fillrule) { + if (CHECKS) { + check(chardata, char_index + 1); + check(xpos, 1); + check(ypos, 1); + } + nstbtt_GetBakedQuad(chardata.address(), pw, ph, char_index, memAddress(xpos), memAddress(ypos), q.address(), opengl_fillrule ? 1 : 0); + } + + // --- [ stbtt_GetScaledFontVMetrics ] --- + + /** Unsafe version of: {@link #stbtt_GetScaledFontVMetrics GetScaledFontVMetrics} */ + public static native void nstbtt_GetScaledFontVMetrics(long fontdata, int index, float size, long ascent, long descent, long lineGap); + + /** + * Query the font vertical metrics without having to create a font first. + * + * @param index the font index (use 0 if you don't know what that is) + * @param size the font height, in pixels + * @param ascent returns the coordinate above the baseline the font extends + * @param descent returns the coordinate below the baseline the font extends (i.e. it is typically negative) + * @param lineGap returns the spacing between one row's descent and the next row's ascent + */ + public static void stbtt_GetScaledFontVMetrics(@NativeType("unsigned char const *") ByteBuffer fontdata, int index, float size, @NativeType("float *") FloatBuffer ascent, @NativeType("float *") FloatBuffer descent, @NativeType("float *") FloatBuffer lineGap) { + if (CHECKS) { + check(ascent, 1); + check(descent, 1); + check(lineGap, 1); + } + nstbtt_GetScaledFontVMetrics(memAddress(fontdata), index, size, memAddress(ascent), memAddress(descent), memAddress(lineGap)); + } + + // --- [ stbtt_PackBegin ] --- + + /** Unsafe version of: {@link #stbtt_PackBegin PackBegin} */ + public static native int nstbtt_PackBegin(long spc, long pixels, int width, int height, int stride_in_bytes, int padding, long alloc_context); + + /** + * Initializes a packing context stored in the passed-in {@code stbtt_pack_context}. Future calls using this context will pack characters into the bitmap + * passed in here: a 1-channel bitmap that is width x height. + * + * @param spc an {@link STBTTPackContext} struct + * @param pixels a buffer in which to store the bitmap data + * @param width the bitmap width, in pixels + * @param height the bitmap height, in pixels + * @param stride_in_bytes the distance from one row to the next (or 0 to mean they are packed tightly together) + * @param padding the amount of padding to leave between each character (normally you want '1' for bitmaps you'll use as textures with bilinear filtering) + * @param alloc_context a pointer to an allocation context + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbtt_PackBegin(@NativeType("stbtt_pack_context *") STBTTPackContext spc, @Nullable @NativeType("unsigned char *") ByteBuffer pixels, int width, int height, int stride_in_bytes, int padding, @NativeType("void *") long alloc_context) { + if (CHECKS) { + checkSafe(pixels, (stride_in_bytes != 0 ? stride_in_bytes : width) * height); + } + return nstbtt_PackBegin(spc.address(), memAddressSafe(pixels), width, height, stride_in_bytes, padding, alloc_context) != 0; + } + + /** + * Initializes a packing context stored in the passed-in {@code stbtt_pack_context}. Future calls using this context will pack characters into the bitmap + * passed in here: a 1-channel bitmap that is width x height. + * + * @param spc an {@link STBTTPackContext} struct + * @param pixels a buffer in which to store the bitmap data + * @param width the bitmap width, in pixels + * @param height the bitmap height, in pixels + * @param stride_in_bytes the distance from one row to the next (or 0 to mean they are packed tightly together) + * @param padding the amount of padding to leave between each character (normally you want '1' for bitmaps you'll use as textures with bilinear filtering) + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbtt_PackBegin(@NativeType("stbtt_pack_context *") STBTTPackContext spc, @Nullable @NativeType("unsigned char *") ByteBuffer pixels, int width, int height, int stride_in_bytes, int padding) { + if (CHECKS) { + checkSafe(pixels, (stride_in_bytes != 0 ? stride_in_bytes : width) * height); + } + return nstbtt_PackBegin(spc.address(), memAddressSafe(pixels), width, height, stride_in_bytes, padding, NULL) != 0; + } + + // --- [ stbtt_PackEnd ] --- + + /** Unsafe version of: {@link #stbtt_PackEnd PackEnd} */ + public static native void nstbtt_PackEnd(long spc); + + /** + * Cleans up the packing context and frees all memory. + * + * @param spc an {@link STBTTPackContext} struct + */ + public static void stbtt_PackEnd(@NativeType("stbtt_pack_context *") STBTTPackContext spc) { + nstbtt_PackEnd(spc.address()); + } + + // --- [ STBTT_POINT_SIZE ] --- + + /** + * Converts the full height of a character from ascender to descender, as computed by {@link #stbtt_ScaleForPixelHeight ScaleForPixelHeight}, to a point size as computed by + * {@link #stbtt_ScaleForMappingEmToPixels ScaleForMappingEmToPixels}. + * + * @param font_size the full height of a character + * + * @return the point size of the character + */ + public static int STBTT_POINT_SIZE(int font_size) { + return -font_size; + } + + // --- [ stbtt_PackFontRange ] --- + + /** + * Unsafe version of: {@link #stbtt_PackFontRange PackFontRange} + * + * @param num_chars_in_range the number of unicode code points in the range + */ + public static native int nstbtt_PackFontRange(long spc, long fontdata, int font_index, float font_size, int first_unicode_char_in_range, int num_chars_in_range, long chardata_for_range); + + /** + * Creates character bitmaps from the {@code font_index}'th font found in fontdata (use {@code font_index=0} if you don't know what that is). It creates + * {@code num_chars_in_range} bitmaps for characters with unicode values starting at {@code first_unicode_char_in_range} and increasing. Data for how to + * render them is stored in {@code chardata_for_range}; pass these to {@link #stbtt_GetPackedQuad GetPackedQuad} to get back renderable quads. + * + * @param spc an {@link STBTTPackContext} struct + * @param fontdata the font data + * @param font_index the font index (use 0 if you don't know what that is + * @param font_size the full height of the character from ascender to descender, as computed by {@link #stbtt_ScaleForPixelHeight ScaleForPixelHeight}. To use a point size as computed by + * {@link #stbtt_ScaleForMappingEmToPixels ScaleForMappingEmToPixels}, wrap the font size in {@link #STBTT_POINT_SIZE} and pass the result, i.e.: + * + *

+     *                                    ...,                  20 , ... // font max minus min y is 20 pixels tall
+     *                                    ..., STBTT_POINT_SIZE(20), ... // 'M' is 20 pixels tall
+ * @param first_unicode_char_in_range the first unicode code point in the range + * @param chardata_for_range an array of {@link STBTTPackedchar} structs + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbtt_PackFontRange(@NativeType("stbtt_pack_context *") STBTTPackContext spc, @NativeType("unsigned char const *") ByteBuffer fontdata, int font_index, float font_size, int first_unicode_char_in_range, @NativeType("stbtt_packedchar *") STBTTPackedchar.Buffer chardata_for_range) { + return nstbtt_PackFontRange(spc.address(), memAddress(fontdata), font_index, font_size, first_unicode_char_in_range, chardata_for_range.remaining(), chardata_for_range.address()) != 0; + } + + // --- [ stbtt_PackFontRanges ] --- + + /** + * Unsafe version of: {@link #stbtt_PackFontRanges PackFontRanges} + * + * @param num_ranges the number of {@link STBTTPackRange} structs in {@code ranges} + */ + public static native int nstbtt_PackFontRanges(long spc, long fontdata, int font_index, long ranges, int num_ranges); + + /** + * Creates character bitmaps from multiple ranges of characters stored in ranges. This will usually create a better-packed bitmap than multiple calls to + * {@link #stbtt_PackFontRange PackFontRange}. Note that you can call this multiple times within a single {@link #stbtt_PackBegin PackBegin}/{@link #stbtt_PackEnd PackEnd}. + * + * @param spc an {@link STBTTPackContext} struct + * @param fontdata the font data + * @param font_index the font index (use 0 if you don't know what that is) + * @param ranges an array of {@link STBTTPackRange} structs + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbtt_PackFontRanges(@NativeType("stbtt_pack_context *") STBTTPackContext spc, @NativeType("unsigned char const *") ByteBuffer fontdata, int font_index, @NativeType("stbtt_pack_range *") STBTTPackRange.Buffer ranges) { + if (CHECKS) { + STBTTPackRange.validate(ranges.address(), ranges.remaining()); + } + return nstbtt_PackFontRanges(spc.address(), memAddress(fontdata), font_index, ranges.address(), ranges.remaining()) != 0; + } + + // --- [ stbtt_PackSetOversampling ] --- + + /** Unsafe version of: {@link #stbtt_PackSetOversampling PackSetOversampling} */ + public static native void nstbtt_PackSetOversampling(long spc, int h_oversample, int v_oversample); + + /** + * Oversampling a font increases the quality by allowing higher-quality subpixel positioning, and is especially valuable at smaller text sizes. + * + *

This function sets the amount of oversampling for all following calls to {@link #stbtt_PackFontRange PackFontRange} or {@link #stbtt_PackFontRangesGatherRects PackFontRangesGatherRects} for a given pack context. The + * default (no oversampling) is achieved by {@code h_oversample=1, v_oversample=1}. The total number of pixels required is + * {@code h_oversample*v_oversample} larger than the default; for example, 2x2 oversampling requires 4x the storage of 1x1. For best results, render + * oversampled textures with bilinear filtering. Look at the readme in + * stb/tests/oversample for information about oversampled fonts.

+ * + *

To use with PackFontRangesGather etc., you must set it before calls to {@link #stbtt_PackFontRangesGatherRects PackFontRangesGatherRects}.

+ * + * @param spc an {@link STBTTPackContext} struct + * @param h_oversample the horizontal oversampling amount + * @param v_oversample the vertical oversampling amount + */ + public static void stbtt_PackSetOversampling(@NativeType("stbtt_pack_context *") STBTTPackContext spc, @NativeType("unsigned int") int h_oversample, @NativeType("unsigned int") int v_oversample) { + nstbtt_PackSetOversampling(spc.address(), h_oversample, v_oversample); + } + + // --- [ stbtt_PackSetSkipMissingCodepoints ] --- + + /** Unsafe version of: {@link #stbtt_PackSetSkipMissingCodepoints PackSetSkipMissingCodepoints} */ + public static native void nstbtt_PackSetSkipMissingCodepoints(long spc, int skip); + + /** + * If {@code skip != 0}, this tells stb_truetype to skip any codepoints for which there is no corresponding glyph. If {@code skip=0}, which is the + * default, then codepoints without a glyph recived the font's "missing character" glyph, typically an empty box by convention. + * + * @param spc an {@link STBTTPackContext} struct + * @param skip the skip flag + */ + public static void stbtt_PackSetSkipMissingCodepoints(@NativeType("stbtt_pack_context *") STBTTPackContext spc, @NativeType("int") boolean skip) { + nstbtt_PackSetSkipMissingCodepoints(spc.address(), skip ? 1 : 0); + } + + // --- [ stbtt_GetPackedQuad ] --- + + /** Unsafe version of: {@link #stbtt_GetPackedQuad GetPackedQuad} */ + public static native void nstbtt_GetPackedQuad(long chardata, int pw, int ph, int char_index, long xpos, long ypos, long q, int align_to_integer); + + /** + * Computes quad to draw for a given char and advances the current position. + * + *

The coordinate system used assumes y increases downwards. Characters will extend both above and below the current position; see discussion of + * "BASELINE" above.

+ * + * @param chardata an array of {@link STBTTPackedchar} structs + * @param pw the bitmap width, in pixels + * @param ph the bitmap height, in pixels + * @param char_index the character index in the {@code chardata} array + * @param xpos the current x position, in screen pixel space + * @param ypos the current y position, in screen pixel space + * @param q an {@link STBTTAlignedQuad} struct in which to return the quad to draw + * @param align_to_integer 1 to align the quad to integer coordinates + */ + public static void stbtt_GetPackedQuad(@NativeType("stbtt_packedchar const *") STBTTPackedchar.Buffer chardata, int pw, int ph, int char_index, @NativeType("float *") FloatBuffer xpos, @NativeType("float *") FloatBuffer ypos, @NativeType("stbtt_aligned_quad *") STBTTAlignedQuad q, @NativeType("int") boolean align_to_integer) { + if (CHECKS) { + check(chardata, char_index + 1); + check(xpos, 1); + check(ypos, 1); + } + nstbtt_GetPackedQuad(chardata.address(), pw, ph, char_index, memAddress(xpos), memAddress(ypos), q.address(), align_to_integer ? 1 : 0); + } + + // --- [ stbtt_PackFontRangesGatherRects ] --- + + /** + * Unsafe version of: {@link #stbtt_PackFontRangesGatherRects PackFontRangesGatherRects} + * + * @param num_ranges the number of {@link STBTTPackRange} structs in {@code ranges} + */ + public static native int nstbtt_PackFontRangesGatherRects(long spc, long info, long ranges, int num_ranges, long rects); + + /** + * Calling these functions in sequence is roughly equivalent to calling {@link #stbtt_PackFontRanges PackFontRanges}. If you want more control over the packing of multiple fonts, or + * if you want to pack custom data into a font texture, take a look at the source of {@link #stbtt_PackFontRanges PackFontRanges} and create a custom version using these functions, + * e.g. call {@link #stbtt_PackFontRangesGatherRects PackFontRangesGatherRects} multiple times, building up a single array of rects, then call {@link #stbtt_PackFontRangesPackRects PackFontRangesPackRects} once, then call + * {@link #stbtt_PackFontRangesRenderIntoRects PackFontRangesRenderIntoRects} repeatedly. This may result in a better packing than calling {@link #stbtt_PackFontRanges PackFontRanges} multiple times (or it may not). + * + * @param spc an {@link STBTTPackContext} struct + * @param info an {@link STBTTFontinfo} struct + * @param ranges an array of {@link STBTTPackRange} structs + * @param rects an array of {@link STBRPRect} structs. It must be big enough to accommodate all characters in the given ranges. + * + * @return the number of structs written in {@code rects} + */ + public static int stbtt_PackFontRangesGatherRects(@NativeType("stbtt_pack_context *") STBTTPackContext spc, @NativeType("stbtt_fontinfo *") STBTTFontinfo info, @NativeType("stbtt_pack_range *") STBTTPackRange.Buffer ranges, @NativeType("stbrp_rect *") STBRPRect.Buffer rects) { + if (CHECKS) { + STBTTPackRange.validate(ranges.address(), ranges.remaining()); + } + return nstbtt_PackFontRangesGatherRects(spc.address(), info.address(), ranges.address(), ranges.remaining(), rects.address()); + } + + // --- [ stbtt_PackFontRangesPackRects ] --- + + /** + * Unsafe version of: {@link #stbtt_PackFontRangesPackRects PackFontRangesPackRects} + * + * @param num_rects the number of structs in {@code rects} + */ + public static native void nstbtt_PackFontRangesPackRects(long spc, long rects, int num_rects); + + /** + * See {@link #stbtt_PackFontRangesGatherRects PackFontRangesGatherRects}. + * + * @param spc an {@link STBTTPackContext} struct + * @param rects an array of {@link STBRPRect} structs + */ + public static void stbtt_PackFontRangesPackRects(@NativeType("stbtt_pack_context *") STBTTPackContext spc, @NativeType("stbrp_rect *") STBRPRect.Buffer rects) { + nstbtt_PackFontRangesPackRects(spc.address(), rects.address(), rects.remaining()); + } + + // --- [ stbtt_PackFontRangesRenderIntoRects ] --- + + /** + * Unsafe version of: {@link #stbtt_PackFontRangesRenderIntoRects PackFontRangesRenderIntoRects} + * + * @param num_ranges the number of {@link STBTTPackRange} structs in {@code ranges} + */ + public static native int nstbtt_PackFontRangesRenderIntoRects(long spc, long info, long ranges, int num_ranges, long rects); + + /** + * See {@link #stbtt_PackFontRangesGatherRects PackFontRangesGatherRects}. + * + * @param spc an {@link STBTTPackContext} struct + * @param info an {@link STBTTFontinfo} struct + * @param ranges an array of {@link STBTTPackRange} structs + * @param rects an array of {@link STBRPRect} structs. It must be big enough to accommodate all characters in the given ranges. + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbtt_PackFontRangesRenderIntoRects(@NativeType("stbtt_pack_context *") STBTTPackContext spc, @NativeType("stbtt_fontinfo *") STBTTFontinfo info, @NativeType("stbtt_pack_range *") STBTTPackRange.Buffer ranges, @NativeType("stbrp_rect *") STBRPRect.Buffer rects) { + if (CHECKS) { + STBTTPackRange.validate(ranges.address(), ranges.remaining()); + } + return nstbtt_PackFontRangesRenderIntoRects(spc.address(), info.address(), ranges.address(), ranges.remaining(), rects.address()) != 0; + } + + // --- [ stbtt_GetNumberOfFonts ] --- + + /** Unsafe version of: {@link #stbtt_GetNumberOfFonts GetNumberOfFonts} */ + public static native int nstbtt_GetNumberOfFonts(long data); + + /** + * Determines the number of fonts in a font file. + * + *

TrueType collection (.ttc) files may contain multiple fonts, while TrueType font (.ttf) files only contain one font. The number of fonts can be used + * for indexing with {@link #stbtt_GetFontOffsetForIndex GetFontOffsetForIndex} where the index is between zero and one less than the total fonts. If an error occurs, -1 is returned.

+ * + * @param data the font data + */ + public static int stbtt_GetNumberOfFonts(@NativeType("unsigned char const *") ByteBuffer data) { + return nstbtt_GetNumberOfFonts(memAddress(data)); + } + + // --- [ stbtt_GetFontOffsetForIndex ] --- + + /** Unsafe version of: {@link #stbtt_GetFontOffsetForIndex GetFontOffsetForIndex} */ + public static native int nstbtt_GetFontOffsetForIndex(long data, int index); + + /** + * Each .ttf/.ttc file may have more than one font. Each font has a sequential index number starting from 0. Call this function to get the font offset for + * a given index; it returns -1 if the index is out of range. A regular .ttf file will only define one font and it always be at offset 0, so it will + * return '0' for index 0, and -1 for all other indices. + * + * @param data the font data + * @param index the font index + */ + public static int stbtt_GetFontOffsetForIndex(@NativeType("unsigned char const *") ByteBuffer data, int index) { + return nstbtt_GetFontOffsetForIndex(memAddress(data), index); + } + + // --- [ stbtt_InitFont ] --- + + /** Unsafe version of: {@link #stbtt_InitFont InitFont} */ + public static native int nstbtt_InitFont(long info, long data, int offset); + + /** + * Given an offset into the file that defines a font, this function builds the necessary cached info for the rest of the system. You must allocate the + * {@link STBTTFontinfo} yourself, and stbtt_InitFont will fill it out. You don't need to do anything special to free it, because the contents are pure value + * data with no additional data structures. + * + * @param info an {@link STBTTFontinfo} struct + * @param data the font data + * @param offset the font data offset + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbtt_InitFont(@NativeType("stbtt_fontinfo *") STBTTFontinfo info, @NativeType("unsigned char const *") ByteBuffer data, int offset) { + return nstbtt_InitFont(info.address(), memAddress(data), offset) != 0; + } + + /** + * Given an offset into the file that defines a font, this function builds the necessary cached info for the rest of the system. You must allocate the + * {@link STBTTFontinfo} yourself, and stbtt_InitFont will fill it out. You don't need to do anything special to free it, because the contents are pure value + * data with no additional data structures. + * + * @param info an {@link STBTTFontinfo} struct + * @param data the font data + * + * @return 1 on success, 0 on failure + */ + @NativeType("int") + public static boolean stbtt_InitFont(@NativeType("stbtt_fontinfo *") STBTTFontinfo info, @NativeType("unsigned char const *") ByteBuffer data) { + return nstbtt_InitFont(info.address(), memAddress(data), 0) != 0; + } + + // --- [ stbtt_FindGlyphIndex ] --- + + /** Unsafe version of: {@link #stbtt_FindGlyphIndex FindGlyphIndex} */ + public static native int nstbtt_FindGlyphIndex(long info, int unicode_codepoint); + + /** + * If you're going to perform multiple operations on the same character and you want a speed-up, call this function with the character you're going to + * process, then use glyph-based functions instead of the codepoint-based functions. + * + * @param info an {@link STBTTFontinfo} struct + * @param unicode_codepoint the unicode code point + * + * @return the glyph index or 0 if the character codepoint is not defined in the font + */ + public static int stbtt_FindGlyphIndex(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, int unicode_codepoint) { + return nstbtt_FindGlyphIndex(info.address(), unicode_codepoint); + } + + // --- [ stbtt_ScaleForPixelHeight ] --- + + /** Unsafe version of: {@link #stbtt_ScaleForPixelHeight ScaleForPixelHeight} */ + public static native float nstbtt_ScaleForPixelHeight(long info, float pixels); + + /** + * Computes a scale factor to produce a font whose "height" is {@code pixels} tall. Height is measured as the distance from the highest ascender to the + * lowest descender; in other words, it's equivalent to calling {@link #stbtt_GetFontVMetrics GetFontVMetrics} and computing: + * + *

+     * scale = pixels / (ascent - descent)
+ * + *

so if you prefer to measure height by the ascent only, use a similar calculation.

+ * + * @param info an {@link STBTTFontinfo} struct + * @param pixels the font height, in pixels + * + * @return the scale factor + */ + public static float stbtt_ScaleForPixelHeight(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, float pixels) { + return nstbtt_ScaleForPixelHeight(info.address(), pixels); + } + + // --- [ stbtt_ScaleForMappingEmToPixels ] --- + + /** Unsafe version of: {@link #stbtt_ScaleForMappingEmToPixels ScaleForMappingEmToPixels} */ + public static native float nstbtt_ScaleForMappingEmToPixels(long info, float pixels); + + /** + * Computes a scale factor to produce a font whose EM size is mapped to {@code pixels} tall. This is probably what traditional APIs compute, but I'm not + * positive. + * + * @param info an {@link STBTTFontinfo} struct + * @param pixels the font height, in pixels + * + * @return the scale factor + */ + public static float stbtt_ScaleForMappingEmToPixels(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, float pixels) { + return nstbtt_ScaleForMappingEmToPixels(info.address(), pixels); + } + + // --- [ stbtt_GetFontVMetrics ] --- + + /** Unsafe version of: {@link #stbtt_GetFontVMetrics GetFontVMetrics} */ + public static native void nstbtt_GetFontVMetrics(long info, long ascent, long descent, long lineGap); + + /** + * Returns vertical metrics for the specified font. You should advance the vertical position by {@code *ascent - *descent + *lineGap} + * + *

The returned values are expressed in unscaled coordinates, so you must multiply by the scale factor for a given size.

+ * + * @param info an {@link STBTTFontinfo} struct + * @param ascent returns the coordinate above the baseline the font extends + * @param descent returns the coordinate below the baseline the font extends (i.e. it is typically negative) + * @param lineGap returns the spacing between one row's descent and the next row's ascent + */ + public static void stbtt_GetFontVMetrics(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, @Nullable @NativeType("int *") IntBuffer ascent, @Nullable @NativeType("int *") IntBuffer descent, @Nullable @NativeType("int *") IntBuffer lineGap) { + if (CHECKS) { + checkSafe(ascent, 1); + checkSafe(descent, 1); + checkSafe(lineGap, 1); + } + nstbtt_GetFontVMetrics(info.address(), memAddressSafe(ascent), memAddressSafe(descent), memAddressSafe(lineGap)); + } + + // --- [ stbtt_GetFontVMetricsOS2 ] --- + + /** Unsafe version of: {@link #stbtt_GetFontVMetricsOS2 GetFontVMetricsOS2} */ + public static native int nstbtt_GetFontVMetricsOS2(long info, long typoAscent, long typoDescent, long typoLineGap); + + /** + * Analogous to {@link #stbtt_GetFontVMetrics GetFontVMetrics}, but returns the "typographic" values from the OS/2 table (specific to MS/Windows TTF files). + * + * @param info an {@link STBTTFontinfo} struct + * @param typoAscent returns the coordinate above the baseline the font extends + * @param typoDescent returns the coordinate below the baseline the font extends (i.e. it is typically negative) + * @param typoLineGap returns the spacing between one row's descent and the next row's ascent + * + * @return 1 on success (table present), 0 on failure + */ + @NativeType("int") + public static boolean stbtt_GetFontVMetricsOS2(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, @Nullable @NativeType("int *") IntBuffer typoAscent, @Nullable @NativeType("int *") IntBuffer typoDescent, @Nullable @NativeType("int *") IntBuffer typoLineGap) { + if (CHECKS) { + checkSafe(typoAscent, 1); + checkSafe(typoDescent, 1); + checkSafe(typoLineGap, 1); + } + return nstbtt_GetFontVMetricsOS2(info.address(), memAddressSafe(typoAscent), memAddressSafe(typoDescent), memAddressSafe(typoLineGap)) != 0; + } + + // --- [ stbtt_GetFontBoundingBox ] --- + + /** Unsafe version of: {@link #stbtt_GetFontBoundingBox GetFontBoundingBox} */ + public static native void nstbtt_GetFontBoundingBox(long info, long x0, long y0, long x1, long y1); + + /** + * Returns the bounding box around all possible characters. + * + * @param info an {@link STBTTFontinfo} struct + * @param x0 the left coordinate + * @param y0 the bottom coordinate + * @param x1 the right coordinate + * @param y1 the top coordinate + */ + public static void stbtt_GetFontBoundingBox(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, @NativeType("int *") IntBuffer x0, @NativeType("int *") IntBuffer y0, @NativeType("int *") IntBuffer x1, @NativeType("int *") IntBuffer y1) { + if (CHECKS) { + check(x0, 1); + check(y0, 1); + check(x1, 1); + check(y1, 1); + } + nstbtt_GetFontBoundingBox(info.address(), memAddress(x0), memAddress(y0), memAddress(x1), memAddress(y1)); + } + + // --- [ stbtt_GetCodepointHMetrics ] --- + + /** Unsafe version of: {@link #stbtt_GetCodepointHMetrics GetCodepointHMetrics} */ + public static native void nstbtt_GetCodepointHMetrics(long info, int codepoint, long advanceWidth, long leftSideBearing); + + /** + * Returns horizontal metrics for the specified codepoint. + * + *

The returned values are expressed in unscaled coordinates.

+ * + * @param info an {@link STBTTFontinfo} struct + * @param codepoint the unicode codepoint + * @param advanceWidth the offset from the current horizontal position to the next horizontal position + * @param leftSideBearing the offset from the current horizontal position to the left edge of the character + */ + public static void stbtt_GetCodepointHMetrics(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, int codepoint, @Nullable @NativeType("int *") IntBuffer advanceWidth, @Nullable @NativeType("int *") IntBuffer leftSideBearing) { + if (CHECKS) { + checkSafe(advanceWidth, 1); + checkSafe(leftSideBearing, 1); + } + nstbtt_GetCodepointHMetrics(info.address(), codepoint, memAddressSafe(advanceWidth), memAddressSafe(leftSideBearing)); + } + + // --- [ stbtt_GetCodepointKernAdvance ] --- + + /** Unsafe version of: {@link #stbtt_GetCodepointKernAdvance GetCodepointKernAdvance} */ + public static native int nstbtt_GetCodepointKernAdvance(long info, int ch1, int ch2); + + /** + * Returns the additional amount to add to the {@code advance} value between {@code ch1} and {@code ch2}. + * + * @param info an {@link STBTTFontinfo} struct + * @param ch1 the first unicode codepoint + * @param ch2 the second unicode codepoint + */ + public static int stbtt_GetCodepointKernAdvance(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, int ch1, int ch2) { + return nstbtt_GetCodepointKernAdvance(info.address(), ch1, ch2); + } + + // --- [ stbtt_GetCodepointBox ] --- + + /** Unsafe version of: {@link #stbtt_GetCodepointBox GetCodepointBox} */ + public static native int nstbtt_GetCodepointBox(long info, int codepoint, long x0, long y0, long x1, long y1); + + /** + * Gets the bounding box of the visible part of the glyph, in unscaled coordinates. + * + * @param info an {@link STBTTFontinfo} struct + * @param codepoint the unicode codepoint + * @param x0 returns the left coordinate + * @param y0 returns the bottom coordinate + * @param x1 returns the right coordinate + * @param y1 returns the top coordinate + */ + @NativeType("int") + public static boolean stbtt_GetCodepointBox(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, int codepoint, @Nullable @NativeType("int *") IntBuffer x0, @Nullable @NativeType("int *") IntBuffer y0, @Nullable @NativeType("int *") IntBuffer x1, @Nullable @NativeType("int *") IntBuffer y1) { + if (CHECKS) { + checkSafe(x0, 1); + checkSafe(y0, 1); + checkSafe(x1, 1); + checkSafe(y1, 1); + } + return nstbtt_GetCodepointBox(info.address(), codepoint, memAddressSafe(x0), memAddressSafe(y0), memAddressSafe(x1), memAddressSafe(y1)) != 0; + } + + // --- [ stbtt_GetGlyphHMetrics ] --- + + /** Unsafe version of: {@link #stbtt_GetGlyphHMetrics GetGlyphHMetrics} */ + public static native void nstbtt_GetGlyphHMetrics(long info, int glyph_index, long advanceWidth, long leftSideBearing); + + /** + * Glyph version of {@link #stbtt_GetCodepointHMetrics GetCodepointHMetrics}, for greater efficiency. + * + * @param info an {@link STBTTFontinfo} struct + * @param glyph_index the glyph index + * @param advanceWidth the offset from the current horizontal position to the next horizontal position + * @param leftSideBearing the offset from the current horizontal position to the left edge of the character + */ + public static void stbtt_GetGlyphHMetrics(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, int glyph_index, @Nullable @NativeType("int *") IntBuffer advanceWidth, @Nullable @NativeType("int *") IntBuffer leftSideBearing) { + if (CHECKS) { + checkSafe(advanceWidth, 1); + checkSafe(leftSideBearing, 1); + } + nstbtt_GetGlyphHMetrics(info.address(), glyph_index, memAddressSafe(advanceWidth), memAddressSafe(leftSideBearing)); + } + + // --- [ stbtt_GetGlyphKernAdvance ] --- + + /** Unsafe version of: {@link #stbtt_GetGlyphKernAdvance GetGlyphKernAdvance} */ + public static native int nstbtt_GetGlyphKernAdvance(long info, int glyph1, int glyph2); + + /** + * Glyph version of {@link #stbtt_GetCodepointKernAdvance GetCodepointKernAdvance}, for greater efficiency. + * + * @param info an {@link STBTTFontinfo} struct + * @param glyph1 the first glyph index + * @param glyph2 the second glyph index + */ + public static int stbtt_GetGlyphKernAdvance(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, int glyph1, int glyph2) { + return nstbtt_GetGlyphKernAdvance(info.address(), glyph1, glyph2); + } + + // --- [ stbtt_GetGlyphBox ] --- + + /** Unsafe version of: {@link #stbtt_GetGlyphBox GetGlyphBox} */ + public static native int nstbtt_GetGlyphBox(long info, int glyph_index, long x0, long y0, long x1, long y1); + + /** + * Glyph version of {@link #stbtt_GetCodepointBox GetCodepointBox}, for greater efficiency. + * + * @param info an {@link STBTTFontinfo} struct + * @param glyph_index the glyph index + * @param x0 returns the left coordinate + * @param y0 returns the bottom coordinate + * @param x1 returns the right coordinate + * @param y1 returns the top coordinate + */ + @NativeType("int") + public static boolean stbtt_GetGlyphBox(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, int glyph_index, @Nullable @NativeType("int *") IntBuffer x0, @Nullable @NativeType("int *") IntBuffer y0, @Nullable @NativeType("int *") IntBuffer x1, @Nullable @NativeType("int *") IntBuffer y1) { + if (CHECKS) { + checkSafe(x0, 1); + checkSafe(y0, 1); + checkSafe(x1, 1); + checkSafe(y1, 1); + } + return nstbtt_GetGlyphBox(info.address(), glyph_index, memAddressSafe(x0), memAddressSafe(y0), memAddressSafe(x1), memAddressSafe(y1)) != 0; + } + + // --- [ stbtt_IsGlyphEmpty ] --- + + /** Unsafe version of: {@link #stbtt_IsGlyphEmpty IsGlyphEmpty} */ + public static native int nstbtt_IsGlyphEmpty(long info, int glyph_index); + + /** + * Returns non-zero if nothing is drawn for this glyph. + * + * @param info an {@link STBTTFontinfo} struct + * @param glyph_index the glyph index + */ + @NativeType("int") + public static boolean stbtt_IsGlyphEmpty(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, int glyph_index) { + return nstbtt_IsGlyphEmpty(info.address(), glyph_index) != 0; + } + + // --- [ stbtt_GetCodepointShape ] --- + + /** Unsafe version of: {@link #stbtt_GetCodepointShape GetCodepointShape} */ + public static native int nstbtt_GetCodepointShape(long info, int unicode_codepoint, long vertices); + + /** + * Returns number of vertices and fills {@code *vertices} with the pointer to them + * + *

The shape is a series of contours. Each one starts with a {@link #STBTT_vmove vmove}, then consists of a series of mixed {@link #STBTT_vline vline} and {@link #STBTT_vcurve vcurve} segments. A {@link #STBTT_vline vline} draws a + * line from previous endpoint to its {@code x,y}; a {@link #STBTT_vcurve vcurve} draws a quadratic bezier from previous endpoint to its {@code x,y}, using {@code cx,cy} as + * the bezier control point.

+ * + *

The {@link STBTTVertex} values are expressed in "unscaled" coordinates.

+ * + * @param info an {@link STBTTFontinfo} struct + * @param unicode_codepoint the unicode codepoint + * @param vertices returns a pointer to an array of {@link STBTTVertex} structs + */ + public static int stbtt_GetCodepointShape(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, int unicode_codepoint, @NativeType("stbtt_vertex **") PointerBuffer vertices) { + if (CHECKS) { + check(vertices, 1); + } + return nstbtt_GetCodepointShape(info.address(), unicode_codepoint, memAddress(vertices)); + } + + /** + * Returns number of vertices and fills {@code *vertices} with the pointer to them + * + *

The shape is a series of contours. Each one starts with a {@link #STBTT_vmove vmove}, then consists of a series of mixed {@link #STBTT_vline vline} and {@link #STBTT_vcurve vcurve} segments. A {@link #STBTT_vline vline} draws a + * line from previous endpoint to its {@code x,y}; a {@link #STBTT_vcurve vcurve} draws a quadratic bezier from previous endpoint to its {@code x,y}, using {@code cx,cy} as + * the bezier control point.

+ * + *

The {@link STBTTVertex} values are expressed in "unscaled" coordinates.

+ * + * @param info an {@link STBTTFontinfo} struct + * @param unicode_codepoint the unicode codepoint + */ + @Nullable + @NativeType("int") + public static STBTTVertex.Buffer stbtt_GetCodepointShape(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, int unicode_codepoint) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + PointerBuffer vertices = stack.pointers(NULL); + int __result = nstbtt_GetCodepointShape(info.address(), unicode_codepoint, memAddress(vertices)); + return STBTTVertex.createSafe(vertices.get(0), __result); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stbtt_GetGlyphShape ] --- + + /** Unsafe version of: {@link #stbtt_GetGlyphShape GetGlyphShape} */ + public static native int nstbtt_GetGlyphShape(long info, int glyph_index, long vertices); + + /** + * Glyph version of {@link #stbtt_GetCodepointShape GetCodepointShape}, for greater efficiency. + * + * @param info an {@link STBTTFontinfo} struct + * @param glyph_index the unicode codepoint + * @param vertices returns a pointer to an array of {@link STBTTVertex} structs + */ + public static int stbtt_GetGlyphShape(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, int glyph_index, @NativeType("stbtt_vertex **") PointerBuffer vertices) { + if (CHECKS) { + check(vertices, 1); + } + return nstbtt_GetGlyphShape(info.address(), glyph_index, memAddress(vertices)); + } + + /** + * Glyph version of {@link #stbtt_GetCodepointShape GetCodepointShape}, for greater efficiency. + * + * @param info an {@link STBTTFontinfo} struct + * @param glyph_index the unicode codepoint + */ + @Nullable + @NativeType("int") + public static STBTTVertex.Buffer stbtt_GetGlyphShape(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, int glyph_index) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + PointerBuffer vertices = stack.pointers(NULL); + int __result = nstbtt_GetGlyphShape(info.address(), glyph_index, memAddress(vertices)); + return STBTTVertex.createSafe(vertices.get(0), __result); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stbtt_FreeShape ] --- + + /** Unsafe version of: {@link #stbtt_FreeShape FreeShape} */ + public static native void nstbtt_FreeShape(long info, long vertices); + + /** + * Frees the data allocated by {@link #stbtt_GetCodepointShape GetCodepointShape} and {@link #stbtt_GetGlyphShape GetGlyphShape}. + * + * @param info an {@link STBTTFontinfo} struct + * @param vertices the array of {@link STBTTVertex} structs to free + */ + public static void stbtt_FreeShape(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, @NativeType("stbtt_vertex *") STBTTVertex.Buffer vertices) { + if (CHECKS) { + check(vertices, 1); + } + nstbtt_FreeShape(info.address(), vertices.address()); + } + + // --- [ stbtt_FreeBitmap ] --- + + /** Unsafe version of: {@link #stbtt_FreeBitmap FreeBitmap} */ + public static native void nstbtt_FreeBitmap(long bitmap, long userdata); + + /** + * Frees a bitmap allocated by {@link #stbtt_GetCodepointBitmap GetCodepointBitmap}, {@link #stbtt_GetCodepointBitmapSubpixel GetCodepointBitmapSubpixel}, {@link #stbtt_GetGlyphBitmap GetGlyphBitmap} or {@link #stbtt_GetGlyphBitmapSubpixel GetGlyphBitmapSubpixel}. + * + * @param bitmap the bitmap to free + * @param userdata a pointer to an allocation context + */ + public static void stbtt_FreeBitmap(@NativeType("unsigned char *") ByteBuffer bitmap, @NativeType("void *") long userdata) { + nstbtt_FreeBitmap(memAddress(bitmap), userdata); + } + + /** + * Frees a bitmap allocated by {@link #stbtt_GetCodepointBitmap GetCodepointBitmap}, {@link #stbtt_GetCodepointBitmapSubpixel GetCodepointBitmapSubpixel}, {@link #stbtt_GetGlyphBitmap GetGlyphBitmap} or {@link #stbtt_GetGlyphBitmapSubpixel GetGlyphBitmapSubpixel}. + * + * @param bitmap the bitmap to free + */ + public static void stbtt_FreeBitmap(@NativeType("unsigned char *") ByteBuffer bitmap) { + nstbtt_FreeBitmap(memAddress(bitmap), NULL); + } + + // --- [ stbtt_GetCodepointBitmap ] --- + + /** Unsafe version of: {@link #stbtt_GetCodepointBitmap GetCodepointBitmap} */ + public static native long nstbtt_GetCodepointBitmap(long info, float scale_x, float scale_y, int codepoint, long width, long height, long xoff, long yoff); + + /** + * Allocates a large-enough single-channel 8bpp bitmap and renders the specified character/glyph at the specified scale into it, with antialiasing. + * + * @param info an {@link STBTTFontinfo} struct + * @param scale_x the horizontal scale + * @param scale_y the vertical scale + * @param codepoint the unicode codepoint to render + * @param width returns the bitmap width + * @param height returns the bitmap height + * @param xoff returns the horizontal offset in pixel space from the glyph origin to the left of the bitmap + * @param yoff returns the vertical offset in pixel space from the glyph origin to the top of the bitmap + */ + @Nullable + @NativeType("unsigned char *") + public static ByteBuffer stbtt_GetCodepointBitmap(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, float scale_x, float scale_y, int codepoint, @NativeType("int *") IntBuffer width, @NativeType("int *") IntBuffer height, @Nullable @NativeType("int *") IntBuffer xoff, @Nullable @NativeType("int *") IntBuffer yoff) { + if (CHECKS) { + check(width, 1); + check(height, 1); + checkSafe(xoff, 1); + checkSafe(yoff, 1); + } + long __result = nstbtt_GetCodepointBitmap(info.address(), scale_x, scale_y, codepoint, memAddress(width), memAddress(height), memAddressSafe(xoff), memAddressSafe(yoff)); + return memByteBufferSafe(__result, width.get(width.position()) * height.get(height.position())); + } + + // --- [ stbtt_GetCodepointBitmapSubpixel ] --- + + /** Unsafe version of: {@link #stbtt_GetCodepointBitmapSubpixel GetCodepointBitmapSubpixel} */ + public static native long nstbtt_GetCodepointBitmapSubpixel(long info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, long width, long height, long xoff, long yoff); + + /** + * Same as {@link #stbtt_GetCodepointBitmap GetCodepointBitmap}, but you can specify a subpixel shift for the character. + * + * @param info an {@link STBTTFontinfo} struct + * @param scale_x the horizontal scale + * @param scale_y the vertical scale + * @param shift_x the horizontal subpixel shift + * @param shift_y the vertical subpixel shift + * @param codepoint the unicode codepoint to render + * @param width returns the bitmap width + * @param height returns the bitmap height + * @param xoff returns the horizontal offset in pixel space from the glyph origin to the left of the bitmap + * @param yoff returns the vertical offset in pixel space from the glyph origin to the top of the bitmap + */ + @Nullable + @NativeType("unsigned char *") + public static ByteBuffer stbtt_GetCodepointBitmapSubpixel(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, @NativeType("int *") IntBuffer width, @NativeType("int *") IntBuffer height, @Nullable @NativeType("int *") IntBuffer xoff, @Nullable @NativeType("int *") IntBuffer yoff) { + if (CHECKS) { + check(width, 1); + check(height, 1); + checkSafe(xoff, 1); + checkSafe(yoff, 1); + } + long __result = nstbtt_GetCodepointBitmapSubpixel(info.address(), scale_x, scale_y, shift_x, shift_y, codepoint, memAddress(width), memAddress(height), memAddressSafe(xoff), memAddressSafe(yoff)); + return memByteBufferSafe(__result, width.get(width.position()) * height.get(height.position())); + } + + // --- [ stbtt_MakeCodepointBitmap ] --- + + /** Unsafe version of: {@link #stbtt_MakeCodepointBitmap MakeCodepointBitmap} */ + public static native void nstbtt_MakeCodepointBitmap(long info, long output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint); + + /** + * Same as {@link #stbtt_GetCodepointBitmap GetCodepointBitmap}, but you pass in storage for the bitmap in the form of {@code output}, with row spacing of {@code out_stride} bytes. The + * bitmap is clipped to {@code out_w/out_h} bytes. Call {@link #stbtt_GetCodepointBitmapBox GetCodepointBitmapBox} to get the width and height and positioning info for it first. + * + * @param info an {@link STBTTFontinfo} struct + * @param output the bitmap storage + * @param out_w the bitmap width + * @param out_h the bitmap height + * @param out_stride the row stride, in bytes + * @param scale_x the horizontal scale + * @param scale_y the vertical scale + * @param codepoint the unicode codepoint to render + */ + public static void stbtt_MakeCodepointBitmap(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, @NativeType("unsigned char *") ByteBuffer output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int codepoint) { + if (CHECKS) { + check(output, (out_stride != 0 ? out_stride : out_w) * out_h); + } + nstbtt_MakeCodepointBitmap(info.address(), memAddress(output), out_w, out_h, out_stride, scale_x, scale_y, codepoint); + } + + // --- [ stbtt_MakeCodepointBitmapSubpixel ] --- + + /** Unsafe version of: {@link #stbtt_MakeCodepointBitmapSubpixel MakeCodepointBitmapSubpixel} */ + public static native void nstbtt_MakeCodepointBitmapSubpixel(long info, long output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint); + + /** + * Same as {@link #stbtt_MakeCodepointBitmap MakeCodepointBitmap}, but you can specify a subpixel shift for the character. + * + * @param info an {@link STBTTFontinfo} struct + * @param output the bitmap storage + * @param out_w the bitmap width + * @param out_h the bitmap height + * @param out_stride the row stride, in bytes + * @param scale_x the horizontal scale + * @param scale_y the vertical scale + * @param shift_x the horizontal subpixel shift + * @param shift_y the vertical subpixel shift + * @param codepoint the unicode codepoint to render + */ + public static void stbtt_MakeCodepointBitmapSubpixel(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, @NativeType("unsigned char *") ByteBuffer output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint) { + if (CHECKS) { + check(output, (out_stride != 0 ? out_stride : out_w) * out_h); + } + nstbtt_MakeCodepointBitmapSubpixel(info.address(), memAddress(output), out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, codepoint); + } + + // --- [ stbtt_MakeCodepointBitmapSubpixelPrefilter ] --- + + /** Unsafe version of: {@link #stbtt_MakeCodepointBitmapSubpixelPrefilter MakeCodepointBitmapSubpixelPrefilter} */ + public static native void nstbtt_MakeCodepointBitmapSubpixelPrefilter(long info, long output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, long sub_x, long sub_y, int codepoint); + + /** + * Same as {@link #stbtt_MakeCodepointBitmapSubpixel MakeCodepointBitmapSubpixel}, but prefiltering is performed (see {@link #stbtt_PackSetOversampling PackSetOversampling}). + * + * @param info an {@link STBTTFontinfo} struct + * @param output the bitmap storage + * @param out_w the bitmap width + * @param out_h the bitmap height + * @param out_stride the row stride, in bytes + * @param scale_x the horizontal scale + * @param scale_y the vertical scale + * @param shift_x the horizontal subpixel shift + * @param shift_y the vertical subpixel shift + * @param oversample_x the horizontal oversampling amount + * @param oversample_y the vertical oversampling amount + * @param sub_x returns the horizontal oversample shift + * @param sub_y returns the vertical oversample shift + * @param codepoint the unicode codepoint to render + */ + public static void stbtt_MakeCodepointBitmapSubpixelPrefilter(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, @NativeType("unsigned char *") ByteBuffer output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, @NativeType("float *") FloatBuffer sub_x, @NativeType("float *") FloatBuffer sub_y, int codepoint) { + if (CHECKS) { + check(output, (out_stride != 0 ? out_stride : out_w) * out_h); + check(sub_x, 1); + check(sub_y, 1); + } + nstbtt_MakeCodepointBitmapSubpixelPrefilter(info.address(), memAddress(output), out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, oversample_x, oversample_y, memAddress(sub_x), memAddress(sub_y), codepoint); + } + + // --- [ stbtt_GetCodepointBitmapBox ] --- + + /** Unsafe version of: {@link #stbtt_GetCodepointBitmapBox GetCodepointBitmapBox} */ + public static native void nstbtt_GetCodepointBitmapBox(long font, int codepoint, float scale_x, float scale_y, long ix0, long iy0, long ix1, long iy1); + + /** + * Get the bbox of the bitmap centered around the glyph origin; so the bitmap width is {@code ix1-ix0}, height is {@code iy1-iy0}, and location to place + * the bitmap top left is {@code (leftSideBearing*scale,iy0)}. + * + *

Note that the bitmap uses y-increases-down, but the shape uses y-increases-up, so {@code CodepointBitmapBox} and {@code CodepointBox} are inverted.

+ * + * @param font an {@link STBTTFontinfo} struct + * @param codepoint the unicode codepoint + * @param scale_x the horizontal scale + * @param scale_y the vertical scale + * @param ix0 returns the left coordinate + * @param iy0 returns the bottom coordinate + * @param ix1 returns the right coordinate + * @param iy1 returns the top coordinate + */ + public static void stbtt_GetCodepointBitmapBox(@NativeType("stbtt_fontinfo const *") STBTTFontinfo font, int codepoint, float scale_x, float scale_y, @Nullable @NativeType("int *") IntBuffer ix0, @Nullable @NativeType("int *") IntBuffer iy0, @Nullable @NativeType("int *") IntBuffer ix1, @Nullable @NativeType("int *") IntBuffer iy1) { + if (CHECKS) { + checkSafe(ix0, 1); + checkSafe(iy0, 1); + checkSafe(ix1, 1); + checkSafe(iy1, 1); + } + nstbtt_GetCodepointBitmapBox(font.address(), codepoint, scale_x, scale_y, memAddressSafe(ix0), memAddressSafe(iy0), memAddressSafe(ix1), memAddressSafe(iy1)); + } + + // --- [ stbtt_GetCodepointBitmapBoxSubpixel ] --- + + /** Unsafe version of: {@link #stbtt_GetCodepointBitmapBoxSubpixel GetCodepointBitmapBoxSubpixel} */ + public static native void nstbtt_GetCodepointBitmapBoxSubpixel(long font, int codepoint, float scale_x, float scale_y, float shift_x, float shift_y, long ix0, long iy0, long ix1, long iy1); + + /** + * Same as {@link #stbtt_GetCodepointBitmapBox GetCodepointBitmapBox}, but you can specify a subpixel shift for the character. + * + * @param font an {@link STBTTFontinfo} struct + * @param codepoint the unicode codepoint + * @param scale_x the horizontal scale + * @param scale_y the vertical scale + * @param shift_x the horizontal subpixel shift + * @param shift_y the vertical subpixel shift + * @param ix0 returns the left coordinate + * @param iy0 returns the bottom coordinate + * @param ix1 returns the right coordinate + * @param iy1 returns the top coordinate + */ + public static void stbtt_GetCodepointBitmapBoxSubpixel(@NativeType("stbtt_fontinfo const *") STBTTFontinfo font, int codepoint, float scale_x, float scale_y, float shift_x, float shift_y, @Nullable @NativeType("int *") IntBuffer ix0, @Nullable @NativeType("int *") IntBuffer iy0, @Nullable @NativeType("int *") IntBuffer ix1, @Nullable @NativeType("int *") IntBuffer iy1) { + if (CHECKS) { + checkSafe(ix0, 1); + checkSafe(iy0, 1); + checkSafe(ix1, 1); + checkSafe(iy1, 1); + } + nstbtt_GetCodepointBitmapBoxSubpixel(font.address(), codepoint, scale_x, scale_y, shift_x, shift_y, memAddressSafe(ix0), memAddressSafe(iy0), memAddressSafe(ix1), memAddressSafe(iy1)); + } + + // --- [ stbtt_GetGlyphBitmap ] --- + + /** Unsafe version of: {@link #stbtt_GetGlyphBitmap GetGlyphBitmap} */ + public static native long nstbtt_GetGlyphBitmap(long info, float scale_x, float scale_y, int glyph, long width, long height, long xoff, long yoff); + + /** + * Allocates a large-enough single-channel 8bpp bitmap and renders the specified character/glyph at the specified scale into it, with antialiasing. + * + * @param info an {@link STBTTFontinfo} struct + * @param scale_x the horizontal scale + * @param scale_y the vertical scale + * @param glyph the glyph index to render + * @param width returns the bitmap width + * @param height returns the bitmap height + * @param xoff returns the horizontal offset in pixel space from the glyph origin to the left of the bitmap + * @param yoff returns the vertical offset in pixel space from the glyph origin to the top of the bitmap + */ + @Nullable + @NativeType("unsigned char *") + public static ByteBuffer stbtt_GetGlyphBitmap(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, float scale_x, float scale_y, int glyph, @NativeType("int *") IntBuffer width, @NativeType("int *") IntBuffer height, @Nullable @NativeType("int *") IntBuffer xoff, @Nullable @NativeType("int *") IntBuffer yoff) { + if (CHECKS) { + check(width, 1); + check(height, 1); + checkSafe(xoff, 1); + checkSafe(yoff, 1); + } + long __result = nstbtt_GetGlyphBitmap(info.address(), scale_x, scale_y, glyph, memAddress(width), memAddress(height), memAddressSafe(xoff), memAddressSafe(yoff)); + return memByteBufferSafe(__result, width.get(width.position()) * height.get(height.position())); + } + + // --- [ stbtt_GetGlyphBitmapSubpixel ] --- + + /** Unsafe version of: {@link #stbtt_GetGlyphBitmapSubpixel GetGlyphBitmapSubpixel} */ + public static native long nstbtt_GetGlyphBitmapSubpixel(long info, float scale_x, float scale_y, float shift_x, float shift_y, int glyph, long width, long height, long xoff, long yoff); + + /** + * Same as {@link #stbtt_GetGlyphBitmap GetGlyphBitmap}, but you can specify a subpixel shift for the character. + * + * @param info an {@link STBTTFontinfo} struct + * @param scale_x the horizontal scale + * @param scale_y the vertical scale + * @param shift_x the horizontal subpixel shift + * @param shift_y the vertical subpixel shift + * @param glyph the glyph index to render + * @param width returns the bitmap width + * @param height returns the bitmap height + * @param xoff returns the horizontal offset in pixel space from the glyph origin to the left of the bitmap + * @param yoff returns the vertical offset in pixel space from the glyph origin to the top of the bitmap + */ + @Nullable + @NativeType("unsigned char *") + public static ByteBuffer stbtt_GetGlyphBitmapSubpixel(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, float scale_x, float scale_y, float shift_x, float shift_y, int glyph, @NativeType("int *") IntBuffer width, @NativeType("int *") IntBuffer height, @Nullable @NativeType("int *") IntBuffer xoff, @Nullable @NativeType("int *") IntBuffer yoff) { + if (CHECKS) { + check(width, 1); + check(height, 1); + checkSafe(xoff, 1); + checkSafe(yoff, 1); + } + long __result = nstbtt_GetGlyphBitmapSubpixel(info.address(), scale_x, scale_y, shift_x, shift_y, glyph, memAddress(width), memAddress(height), memAddressSafe(xoff), memAddressSafe(yoff)); + return memByteBufferSafe(__result, width.get(width.position()) * height.get(height.position())); + } + + // --- [ stbtt_MakeGlyphBitmap ] --- + + /** Unsafe version of: {@link #stbtt_MakeGlyphBitmap MakeGlyphBitmap} */ + public static native void nstbtt_MakeGlyphBitmap(long info, long output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int glyph); + + /** + * Same as {@link #stbtt_GetGlyphBitmap GetGlyphBitmap}, but you pass in storage for the bitmap in the form of {@code output}, with row spacing of {@code out_stride} bytes. The + * bitmap is clipped to {@code out_w/out_h} bytes. Call {@link #stbtt_GetGlyphBitmapBox GetGlyphBitmapBox} to get the width and height and positioning info for it first. + * + * @param info an {@link STBTTFontinfo} struct + * @param output the bitmap storage + * @param out_w the bitmap width + * @param out_h the bitmap height + * @param out_stride the row stride, in bytes + * @param scale_x the horizontal scale + * @param scale_y the vertical scale + * @param glyph the glyph index to render + */ + public static void stbtt_MakeGlyphBitmap(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, @NativeType("unsigned char *") ByteBuffer output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, int glyph) { + if (CHECKS) { + check(output, (out_stride != 0 ? out_stride : out_w) * out_h); + } + nstbtt_MakeGlyphBitmap(info.address(), memAddress(output), out_w, out_h, out_stride, scale_x, scale_y, glyph); + } + + // --- [ stbtt_MakeGlyphBitmapSubpixel ] --- + + /** Unsafe version of: {@link #stbtt_MakeGlyphBitmapSubpixel MakeGlyphBitmapSubpixel} */ + public static native void nstbtt_MakeGlyphBitmapSubpixel(long info, long output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int glyph); + + /** + * Same as {@link #stbtt_MakeGlyphBitmap MakeGlyphBitmap}, but you can specify a subpixel shift for the character. + * + * @param info an {@link STBTTFontinfo} struct + * @param output the bitmap storage + * @param out_w the bitmap width + * @param out_h the bitmap height + * @param out_stride the row stride, in bytes + * @param scale_x the horizontal scale + * @param scale_y the vertical scale + * @param shift_x the horizontal subpixel shift + * @param shift_y the vertical subpixel shift + * @param glyph the glyph index to render + */ + public static void stbtt_MakeGlyphBitmapSubpixel(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, @NativeType("unsigned char *") ByteBuffer output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int glyph) { + if (CHECKS) { + check(output, (out_stride != 0 ? out_stride : out_w) * out_h); + } + nstbtt_MakeGlyphBitmapSubpixel(info.address(), memAddress(output), out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, glyph); + } + + // --- [ stbtt_MakeGlyphBitmapSubpixelPrefilter ] --- + + /** Unsafe version of: {@link #stbtt_MakeGlyphBitmapSubpixelPrefilter MakeGlyphBitmapSubpixelPrefilter} */ + public static native void nstbtt_MakeGlyphBitmapSubpixelPrefilter(long info, long output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, long sub_x, long sub_y, int glyph); + + /** + * Same as {@link #stbtt_MakeGlyphBitmapSubpixel MakeGlyphBitmapSubpixel}, but prefiltering is performed (see {@link #stbtt_PackSetOversampling PackSetOversampling}). + * + * @param info an {@link STBTTFontinfo} struct + * @param output the bitmap storage + * @param out_w the bitmap width + * @param out_h the bitmap height + * @param out_stride the row stride, in bytes + * @param scale_x the horizontal scale + * @param scale_y the vertical scale + * @param shift_x the horizontal subpixel shift + * @param shift_y the vertical subpixel shift + * @param oversample_x the horizontal oversampling amount + * @param oversample_y the vertical oversampling amount + * @param sub_x returns the horizontal oversample shift + * @param sub_y returns the vertical oversample shift + * @param glyph the glyph index to render + */ + public static void stbtt_MakeGlyphBitmapSubpixelPrefilter(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, @NativeType("unsigned char *") ByteBuffer output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, @NativeType("float *") FloatBuffer sub_x, @NativeType("float *") FloatBuffer sub_y, int glyph) { + if (CHECKS) { + check(output, (out_stride != 0 ? out_stride : out_w) * out_h); + check(sub_x, 1); + check(sub_y, 1); + } + nstbtt_MakeGlyphBitmapSubpixelPrefilter(info.address(), memAddress(output), out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, oversample_x, oversample_y, memAddress(sub_x), memAddress(sub_y), glyph); + } + + // --- [ stbtt_GetGlyphBitmapBox ] --- + + /** Unsafe version of: {@link #stbtt_GetGlyphBitmapBox GetGlyphBitmapBox} */ + public static native void nstbtt_GetGlyphBitmapBox(long font, int glyph, float scale_x, float scale_y, long ix0, long iy0, long ix1, long iy1); + + /** + * Get the bbox of the bitmap centered around the glyph origin; so the bitmap width is {@code ix1-ix0}, height is {@code iy1-iy0}, and location to place + * the bitmap top left is {@code (leftSideBearing*scale,iy0)}. + * + *

Note that the bitmap uses y-increases-down, but the shape uses y-increases-up, so {@code GlyphBitmapBox} and {@code GlyphBox} are inverted.

+ * + * @param font an {@link STBTTFontinfo} struct + * @param glyph the glyph index + * @param scale_x the horizontal scale + * @param scale_y the vertical scale + * @param ix0 returns the left coordinate + * @param iy0 returns the bottom coordinate + * @param ix1 returns the right coordinate + * @param iy1 returns the top coordinate + */ + public static void stbtt_GetGlyphBitmapBox(@NativeType("stbtt_fontinfo const *") STBTTFontinfo font, int glyph, float scale_x, float scale_y, @Nullable @NativeType("int *") IntBuffer ix0, @Nullable @NativeType("int *") IntBuffer iy0, @Nullable @NativeType("int *") IntBuffer ix1, @Nullable @NativeType("int *") IntBuffer iy1) { + if (CHECKS) { + checkSafe(ix0, 1); + checkSafe(iy0, 1); + checkSafe(ix1, 1); + checkSafe(iy1, 1); + } + nstbtt_GetGlyphBitmapBox(font.address(), glyph, scale_x, scale_y, memAddressSafe(ix0), memAddressSafe(iy0), memAddressSafe(ix1), memAddressSafe(iy1)); + } + + // --- [ stbtt_GetGlyphBitmapBoxSubpixel ] --- + + /** Unsafe version of: {@link #stbtt_GetGlyphBitmapBoxSubpixel GetGlyphBitmapBoxSubpixel} */ + public static native void nstbtt_GetGlyphBitmapBoxSubpixel(long font, int glyph, float scale_x, float scale_y, float shift_x, float shift_y, long ix0, long iy0, long ix1, long iy1); + + /** + * Same as {@link #stbtt_GetGlyphBitmapBox GetGlyphBitmapBox}, but you can specify a subpixel shift for the character. + * + * @param font an {@link STBTTFontinfo} struct + * @param glyph the glyph index + * @param scale_x the horizontal scale + * @param scale_y the vertical scale + * @param shift_x the horizontal subpixel shift + * @param shift_y the vertical subpixel shift + * @param ix0 returns the left coordinate + * @param iy0 returns the bottom coordinate + * @param ix1 returns the right coordinate + * @param iy1 returns the top coordinate + */ + public static void stbtt_GetGlyphBitmapBoxSubpixel(@NativeType("stbtt_fontinfo const *") STBTTFontinfo font, int glyph, float scale_x, float scale_y, float shift_x, float shift_y, @Nullable @NativeType("int *") IntBuffer ix0, @Nullable @NativeType("int *") IntBuffer iy0, @Nullable @NativeType("int *") IntBuffer ix1, @Nullable @NativeType("int *") IntBuffer iy1) { + if (CHECKS) { + checkSafe(ix0, 1); + checkSafe(iy0, 1); + checkSafe(ix1, 1); + checkSafe(iy1, 1); + } + nstbtt_GetGlyphBitmapBoxSubpixel(font.address(), glyph, scale_x, scale_y, shift_x, shift_y, memAddressSafe(ix0), memAddressSafe(iy0), memAddressSafe(ix1), memAddressSafe(iy1)); + } + + // --- [ stbtt_Rasterize ] --- + + /** + * Unsafe version of: {@link #stbtt_Rasterize Rasterize} + * + * @param num_verts number of vertices in above array + */ + public static native void nstbtt_Rasterize(long result, float flatness_in_pixels, long vertices, int num_verts, float scale_x, float scale_y, float shift_x, float shift_y, int x_off, int y_off, int invert, long alloc_context); + + /** + * Rasterize a shape with quadratic beziers into a bitmap. + * + * @param result 1-channel bitmap to draw into + * @param flatness_in_pixels allowable error of curve in pixels + * @param vertices array of vertices defining shape + * @param scale_x horizontal scale applied to input vertices + * @param scale_y vertical scale applied to input vertices + * @param shift_x horizontal translation applied to input vertices + * @param shift_y vertical translation applied to input vertices + * @param x_off another horizontal translation applied to input + * @param y_off another vertical translation applied to input + * @param invert if non-zero, vertically flip shape + */ + public static void stbtt_Rasterize(@NativeType("stbtt__bitmap *") STBTTBitmap result, float flatness_in_pixels, @NativeType("stbtt_vertex *") STBTTVertex.Buffer vertices, float scale_x, float scale_y, float shift_x, float shift_y, int x_off, int y_off, @NativeType("int") boolean invert) { + nstbtt_Rasterize(result.address(), flatness_in_pixels, vertices.address(), vertices.remaining(), scale_x, scale_y, shift_x, shift_y, x_off, y_off, invert ? 1 : 0, NULL); + } + + // --- [ stbtt_FreeSDF ] --- + + /** Unsafe version of: {@link #stbtt_FreeSDF FreeSDF} */ + public static native void nstbtt_FreeSDF(long bitmap, long userdata); + + /** + * Frees an SDF bitmap. + * + * @param bitmap the SDF bitmap to free + * @param userdata a pointer to an allocation context + */ + public static void stbtt_FreeSDF(@NativeType("unsigned char *") ByteBuffer bitmap, @NativeType("void *") long userdata) { + nstbtt_FreeSDF(memAddress(bitmap), userdata); + } + + /** + * Frees an SDF bitmap. + * + * @param bitmap the SDF bitmap to free + */ + public static void stbtt_FreeSDF(@NativeType("unsigned char *") ByteBuffer bitmap) { + nstbtt_FreeSDF(memAddress(bitmap), NULL); + } + + // --- [ stbtt_GetGlyphSDF ] --- + + /** Unsafe version of: {@link #stbtt_GetGlyphSDF GetGlyphSDF} */ + public static native long nstbtt_GetGlyphSDF(long font, float scale, int glyph, int padding, byte onedge_value, float pixel_dist_scale, long width, long height, long xoff, long yoff); + + /** + * Computes a discretized SDF field for a single character, suitable for storing in a single-channel texture, sampling with bilinear filtering, and + * testing against larger than some threshold to produce scalable fonts. + * + *

{@code pixel_dist_scale} & {@code onedge_value} are a scale & bias that allows you to make optimal use of the limited {@code 0..255} for your + * application, trading off precision and special effects. SDF values outside the range {@code 0..255} are clamped to {@code 0..255}.

+ * + *

Example:

+ * + *

+     * scale = stbtt_ScaleForPixelHeight(22)
+     * padding = 5
+     * onedge_value = 180
+     * pixel_dist_scale = 180/5.0 = 36.0
+ * + *

This will create an SDF bitmap in which the character is about 22 pixels high but the whole bitmap is about {@code 22+5+5=32} pixels high. To produce a + * filled shape, sample the SDF at each pixel and fill the pixel if the SDF value is greater than or equal to {@code 180/255}. (You'll actually want to + * antialias, which is beyond the scope of this example.) Additionally, you can compute offset outlines (e.g. to stroke the character border inside & + * outside, or only outside). For example, to fill outside the character up to 3 SDF pixels, you would compare against {@code (180-36.0*3)/255 = 72/255}. + * The above choice of variables maps a range from 5 pixels outside the shape to 2 pixels inside the shape to {@code 0..255}; this is intended primarily + * for apply outside effects only (the interior range is needed to allow proper antialiasing of the font at smaller sizes).

+ * + *

The function computes the SDF analytically at each SDF pixel, not by e.g. building a higher-res bitmap and approximating it. In theory the quality + * should be as high as possible for an SDF of this size & representation, but unclear if this is true in practice (perhaps building a higher-res + * bitmap and computing from that can allow drop-out prevention).

+ * + *

The algorithm has not been optimized at all, so expect it to be slow if computing lots of characters or very large sizes.

+ * + * @param font an {@link STBTTFontinfo} struct + * @param scale controls the size of the resulting SDF bitmap, same as it would be creating a regular bitmap + * @param glyph the glyph to generate the SDF for + * @param padding extra "pixels" around the character which are filled with the distance to the character (not 0), which allows effects like bit outlines + * @param onedge_value value 0-255 to test the SDF against to reconstruct the character (i.e. the isocontour of the character) + * @param pixel_dist_scale what value the SDF should increase by when moving one SDF "pixel" away from the edge (on the 0..255 scale). If positive, > {@code onedge_value} + * is inside; if negative, < {@code onedge_value} is inside. + * @param width output width of the SDF bitmap (including padding) + * @param height output height of the SDF bitmap (including padding) + * @param xoff output horizontal origin of the character + * @param yoff output vertical origin of the character + */ + @Nullable + @NativeType("unsigned char *") + public static ByteBuffer stbtt_GetGlyphSDF(@NativeType("stbtt_fontinfo const *") STBTTFontinfo font, float scale, int glyph, int padding, @NativeType("unsigned char") byte onedge_value, float pixel_dist_scale, @NativeType("int *") IntBuffer width, @NativeType("int *") IntBuffer height, @NativeType("int *") IntBuffer xoff, @NativeType("int *") IntBuffer yoff) { + if (CHECKS) { + check(width, 1); + check(height, 1); + check(xoff, 1); + check(yoff, 1); + } + long __result = nstbtt_GetGlyphSDF(font.address(), scale, glyph, padding, onedge_value, pixel_dist_scale, memAddress(width), memAddress(height), memAddress(xoff), memAddress(yoff)); + return memByteBufferSafe(__result, width.get(width.position()) * height.get(height.position())); + } + + // --- [ stbtt_GetCodepointSDF ] --- + + /** Unsafe version of: {@link #stbtt_GetCodepointSDF GetCodepointSDF} */ + public static native long nstbtt_GetCodepointSDF(long font, float scale, int codepoint, int padding, byte onedge_value, float pixel_dist_scale, long width, long height, long xoff, long yoff); + + /** + * Codepoint version of {@link #stbtt_GetGlyphSDF GetGlyphSDF}. + * + * @param font an {@link STBTTFontinfo} struct + * @param scale controls the size of the resulting SDF bitmap, same as it would be creating a regular bitmap + * @param codepoint the codepoint to generate the SDF for + * @param padding extra "pixels" around the character which are filled with the distance to the character (not 0), which allows effects like bit outlines + * @param onedge_value value 0-255 to test the SDF against to reconstruct the character (i.e. the isocontour of the character) + * @param pixel_dist_scale what value the SDF should increase by when moving one SDF "pixel" away from the edge (on the 0..255 scale). If positive, > {@code onedge_value} + * is inside; if negative, < {@code onedge_value} is inside. + * @param width output width of the SDF bitmap (including padding) + * @param height output height of the SDF bitmap (including padding) + * @param xoff output horizontal origin of the character + * @param yoff output vertical origin of the character + */ + @Nullable + @NativeType("unsigned char *") + public static ByteBuffer stbtt_GetCodepointSDF(@NativeType("stbtt_fontinfo const *") STBTTFontinfo font, float scale, int codepoint, int padding, @NativeType("unsigned char") byte onedge_value, float pixel_dist_scale, @NativeType("int *") IntBuffer width, @NativeType("int *") IntBuffer height, @NativeType("int *") IntBuffer xoff, @NativeType("int *") IntBuffer yoff) { + if (CHECKS) { + check(width, 1); + check(height, 1); + check(xoff, 1); + check(yoff, 1); + } + long __result = nstbtt_GetCodepointSDF(font.address(), scale, codepoint, padding, onedge_value, pixel_dist_scale, memAddress(width), memAddress(height), memAddress(xoff), memAddress(yoff)); + return memByteBufferSafe(__result, width.get(width.position()) * height.get(height.position())); + } + + // --- [ stbtt_FindMatchingFont ] --- + + /** Unsafe version of: {@link #stbtt_FindMatchingFont FindMatchingFont} */ + public static native int nstbtt_FindMatchingFont(long fontdata, long name, int flags); + + /** + * Returns the offset (not index) of the font that matches, or -1 if none. + * + *

If you use STBTT_MACSTYLE_DONTCARE, use a font name like "Arial Bold". If you use any other flag, use a font name like "Arial"; this checks the + * {@code macStyle} header field; I don't know if fonts set this consistently.

+ * + * @param fontdata the font data + * @param name the font name + * @param flags the style flags. One of:
{@link #STBTT_MACSTYLE_DONTCARE MACSTYLE_DONTCARE}{@link #STBTT_MACSTYLE_BOLD MACSTYLE_BOLD}{@link #STBTT_MACSTYLE_ITALIC MACSTYLE_ITALIC}{@link #STBTT_MACSTYLE_UNDERSCORE MACSTYLE_UNDERSCORE}{@link #STBTT_MACSTYLE_NONE MACSTYLE_NONE}
+ */ + public static int stbtt_FindMatchingFont(@NativeType("unsigned char const *") ByteBuffer fontdata, @NativeType("char const *") ByteBuffer name, int flags) { + if (CHECKS) { + checkNT1(name); + } + return nstbtt_FindMatchingFont(memAddress(fontdata), memAddress(name), flags); + } + + /** + * Returns the offset (not index) of the font that matches, or -1 if none. + * + *

If you use STBTT_MACSTYLE_DONTCARE, use a font name like "Arial Bold". If you use any other flag, use a font name like "Arial"; this checks the + * {@code macStyle} header field; I don't know if fonts set this consistently.

+ * + * @param fontdata the font data + * @param name the font name + * @param flags the style flags. One of:
{@link #STBTT_MACSTYLE_DONTCARE MACSTYLE_DONTCARE}{@link #STBTT_MACSTYLE_BOLD MACSTYLE_BOLD}{@link #STBTT_MACSTYLE_ITALIC MACSTYLE_ITALIC}{@link #STBTT_MACSTYLE_UNDERSCORE MACSTYLE_UNDERSCORE}{@link #STBTT_MACSTYLE_NONE MACSTYLE_NONE}
+ */ + public static int stbtt_FindMatchingFont(@NativeType("unsigned char const *") ByteBuffer fontdata, @NativeType("char const *") CharSequence name, int flags) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(name, true); + long nameEncoded = stack.getPointerAddress(); + return nstbtt_FindMatchingFont(memAddress(fontdata), nameEncoded, flags); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stbtt_CompareUTF8toUTF16_bigendian ] --- + + /** + * Unsafe version of: {@link #stbtt_CompareUTF8toUTF16_bigendian CompareUTF8toUTF16_bigendian} + * + * @param len1 the length of the first string, in bytes + * @param len2 the length of the second string, in bytes + */ + public static native int nstbtt_CompareUTF8toUTF16_bigendian(long s1, int len1, long s2, int len2); + + /** + * Returns 1/0 whether the first string interpreted as utf8 is identical to the second string interpreted as big-endian utf16... useful for strings + * returned from {@link #stbtt_GetFontNameString GetFontNameString}. + * + * @param s1 the first string + * @param s2 the second string + */ + @NativeType("int") + public static boolean stbtt_CompareUTF8toUTF16_bigendian(@NativeType("char const *") ByteBuffer s1, @NativeType("char const *") ByteBuffer s2) { + return nstbtt_CompareUTF8toUTF16_bigendian(memAddress(s1), s1.remaining(), memAddress(s2), s2.remaining()) != 0; + } + + // --- [ stbtt_GetFontNameString ] --- + + /** + * Unsafe version of: {@link #stbtt_GetFontNameString GetFontNameString} + * + * @param length returns the string length, in bytes + */ + public static native long nstbtt_GetFontNameString(long font, long length, int platformID, int encodingID, int languageID, int nameID); + + /** + * Returns the string (which may be big-endian double byte, e.g. for unicode) and puts the length in bytes in {@code *length}. + * + *

See the truetype spec:

+ * + * + * + * @param font an {@link STBTTFontinfo} struct + * @param platformID the platform ID. One of:
{@link #STBTT_PLATFORM_ID_UNICODE PLATFORM_ID_UNICODE}{@link #STBTT_PLATFORM_ID_MAC PLATFORM_ID_MAC}{@link #STBTT_PLATFORM_ID_ISO PLATFORM_ID_ISO}{@link #STBTT_PLATFORM_ID_MICROSOFT PLATFORM_ID_MICROSOFT}
+ * @param encodingID the encoding ID. One of:
{@link #STBTT_UNICODE_EID_UNICODE_1_0 UNICODE_EID_UNICODE_1_0}{@link #STBTT_UNICODE_EID_UNICODE_1_1 UNICODE_EID_UNICODE_1_1}{@link #STBTT_UNICODE_EID_ISO_10646 UNICODE_EID_ISO_10646}{@link #STBTT_UNICODE_EID_UNICODE_2_0_BMP UNICODE_EID_UNICODE_2_0_BMP}
{@link #STBTT_UNICODE_EID_UNICODE_2_0_FULL UNICODE_EID_UNICODE_2_0_FULL}{@link #STBTT_MS_EID_SYMBOL MS_EID_SYMBOL}{@link #STBTT_MS_EID_UNICODE_BMP MS_EID_UNICODE_BMP}{@link #STBTT_MS_EID_SHIFTJIS MS_EID_SHIFTJIS}
{@link #STBTT_MS_EID_UNICODE_FULL MS_EID_UNICODE_FULL}{@link #STBTT_MAC_EID_ROMAN MAC_EID_ROMAN}{@link #STBTT_MAC_EID_JAPANESE MAC_EID_JAPANESE}{@link #STBTT_MAC_EID_CHINESE_TRAD MAC_EID_CHINESE_TRAD}
{@link #STBTT_MAC_EID_KOREAN MAC_EID_KOREAN}{@link #STBTT_MAC_EID_ARABIC MAC_EID_ARABIC}{@link #STBTT_MAC_EID_HEBREW MAC_EID_HEBREW}{@link #STBTT_MAC_EID_GREEK MAC_EID_GREEK}
{@link #STBTT_MAC_EID_RUSSIAN MAC_EID_RUSSIAN}
+ * @param languageID the language ID. One of:
{@link #STBTT_MS_LANG_ENGLISH MS_LANG_ENGLISH}{@link #STBTT_MS_LANG_CHINESE MS_LANG_CHINESE}{@link #STBTT_MS_LANG_DUTCH MS_LANG_DUTCH}{@link #STBTT_MS_LANG_FRENCH MS_LANG_FRENCH}{@link #STBTT_MS_LANG_GERMAN MS_LANG_GERMAN}
{@link #STBTT_MS_LANG_HEBREW MS_LANG_HEBREW}{@link #STBTT_MS_LANG_ITALIAN MS_LANG_ITALIAN}{@link #STBTT_MS_LANG_JAPANESE MS_LANG_JAPANESE}{@link #STBTT_MS_LANG_KOREAN MS_LANG_KOREAN}{@link #STBTT_MS_LANG_RUSSIAN MS_LANG_RUSSIAN}
{@link #STBTT_MS_LANG_SPANISH MS_LANG_SPANISH}{@link #STBTT_MS_LANG_SWEDISH MS_LANG_SWEDISH}{@link #STBTT_MAC_LANG_ENGLISH MAC_LANG_ENGLISH}{@link #STBTT_MAC_LANG_ARABIC MAC_LANG_ARABIC}{@link #STBTT_MAC_LANG_DUTCH MAC_LANG_DUTCH}
{@link #STBTT_MAC_LANG_FRENCH MAC_LANG_FRENCH}{@link #STBTT_MAC_LANG_GERMAN MAC_LANG_GERMAN}{@link #STBTT_MAC_LANG_HEBREW MAC_LANG_HEBREW}{@link #STBTT_MAC_LANG_ITALIAN MAC_LANG_ITALIAN}{@link #STBTT_MAC_LANG_JAPANESE MAC_LANG_JAPANESE}
{@link #STBTT_MAC_LANG_KOREAN MAC_LANG_KOREAN}{@link #STBTT_MAC_LANG_RUSSIAN MAC_LANG_RUSSIAN}{@link #STBTT_MAC_LANG_SPANISH MAC_LANG_SPANISH}{@link #STBTT_MAC_LANG_SWEDISH MAC_LANG_SWEDISH}{@link #STBTT_MAC_LANG_CHINESE_SIMPLIFIED MAC_LANG_CHINESE_SIMPLIFIED}
{@link #STBTT_MAC_LANG_CHINESE_TRAD MAC_LANG_CHINESE_TRAD}
+ * @param nameID the name ID + */ + @Nullable + @NativeType("char const *") + public static ByteBuffer stbtt_GetFontNameString(@NativeType("stbtt_fontinfo const *") STBTTFontinfo font, int platformID, int encodingID, int languageID, int nameID) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + IntBuffer length = stack.callocInt(1); + try { + long __result = nstbtt_GetFontNameString(font.address(), memAddress(length), platformID, encodingID, languageID, nameID); + return memByteBufferSafe(__result, length.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #nstbtt_GetBakedQuad} */ + public static native void nstbtt_GetBakedQuad(long chardata, int pw, int ph, int char_index, float[] xpos, float[] ypos, long q, int opengl_fillrule); + + /** Array version of: {@link #stbtt_GetBakedQuad GetBakedQuad} */ + public static void stbtt_GetBakedQuad(@NativeType("stbtt_bakedchar const *") STBTTBakedChar.Buffer chardata, int pw, int ph, int char_index, @NativeType("float *") float[] xpos, @NativeType("float *") float[] ypos, @NativeType("stbtt_aligned_quad *") STBTTAlignedQuad q, @NativeType("int") boolean opengl_fillrule) { + if (CHECKS) { + check(chardata, char_index + 1); + check(xpos, 1); + check(ypos, 1); + } + nstbtt_GetBakedQuad(chardata.address(), pw, ph, char_index, xpos, ypos, q.address(), opengl_fillrule ? 1 : 0); + } + + /** Array version of: {@link #nstbtt_GetScaledFontVMetrics} */ + public static native void nstbtt_GetScaledFontVMetrics(long fontdata, int index, float size, float[] ascent, float[] descent, float[] lineGap); + + /** Array version of: {@link #stbtt_GetScaledFontVMetrics GetScaledFontVMetrics} */ + public static void stbtt_GetScaledFontVMetrics(@NativeType("unsigned char const *") ByteBuffer fontdata, int index, float size, @NativeType("float *") float[] ascent, @NativeType("float *") float[] descent, @NativeType("float *") float[] lineGap) { + if (CHECKS) { + check(ascent, 1); + check(descent, 1); + check(lineGap, 1); + } + nstbtt_GetScaledFontVMetrics(memAddress(fontdata), index, size, ascent, descent, lineGap); + } + + /** Array version of: {@link #nstbtt_GetPackedQuad} */ + public static native void nstbtt_GetPackedQuad(long chardata, int pw, int ph, int char_index, float[] xpos, float[] ypos, long q, int align_to_integer); + + /** Array version of: {@link #stbtt_GetPackedQuad GetPackedQuad} */ + public static void stbtt_GetPackedQuad(@NativeType("stbtt_packedchar const *") STBTTPackedchar.Buffer chardata, int pw, int ph, int char_index, @NativeType("float *") float[] xpos, @NativeType("float *") float[] ypos, @NativeType("stbtt_aligned_quad *") STBTTAlignedQuad q, @NativeType("int") boolean align_to_integer) { + if (CHECKS) { + check(chardata, char_index + 1); + check(xpos, 1); + check(ypos, 1); + } + nstbtt_GetPackedQuad(chardata.address(), pw, ph, char_index, xpos, ypos, q.address(), align_to_integer ? 1 : 0); + } + + /** Array version of: {@link #nstbtt_GetFontVMetrics} */ + public static native void nstbtt_GetFontVMetrics(long info, int[] ascent, int[] descent, int[] lineGap); + + /** Array version of: {@link #stbtt_GetFontVMetrics GetFontVMetrics} */ + public static void stbtt_GetFontVMetrics(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, @Nullable @NativeType("int *") int[] ascent, @Nullable @NativeType("int *") int[] descent, @Nullable @NativeType("int *") int[] lineGap) { + if (CHECKS) { + checkSafe(ascent, 1); + checkSafe(descent, 1); + checkSafe(lineGap, 1); + } + nstbtt_GetFontVMetrics(info.address(), ascent, descent, lineGap); + } + + /** Array version of: {@link #nstbtt_GetFontVMetricsOS2} */ + public static native int nstbtt_GetFontVMetricsOS2(long info, int[] typoAscent, int[] typoDescent, int[] typoLineGap); + + /** Array version of: {@link #stbtt_GetFontVMetricsOS2 GetFontVMetricsOS2} */ + @NativeType("int") + public static boolean stbtt_GetFontVMetricsOS2(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, @Nullable @NativeType("int *") int[] typoAscent, @Nullable @NativeType("int *") int[] typoDescent, @Nullable @NativeType("int *") int[] typoLineGap) { + if (CHECKS) { + checkSafe(typoAscent, 1); + checkSafe(typoDescent, 1); + checkSafe(typoLineGap, 1); + } + return nstbtt_GetFontVMetricsOS2(info.address(), typoAscent, typoDescent, typoLineGap) != 0; + } + + /** Array version of: {@link #nstbtt_GetFontBoundingBox} */ + public static native void nstbtt_GetFontBoundingBox(long info, int[] x0, int[] y0, int[] x1, int[] y1); + + /** Array version of: {@link #stbtt_GetFontBoundingBox GetFontBoundingBox} */ + public static void stbtt_GetFontBoundingBox(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, @NativeType("int *") int[] x0, @NativeType("int *") int[] y0, @NativeType("int *") int[] x1, @NativeType("int *") int[] y1) { + if (CHECKS) { + check(x0, 1); + check(y0, 1); + check(x1, 1); + check(y1, 1); + } + nstbtt_GetFontBoundingBox(info.address(), x0, y0, x1, y1); + } + + /** Array version of: {@link #nstbtt_GetCodepointHMetrics} */ + public static native void nstbtt_GetCodepointHMetrics(long info, int codepoint, int[] advanceWidth, int[] leftSideBearing); + + /** Array version of: {@link #stbtt_GetCodepointHMetrics GetCodepointHMetrics} */ + public static void stbtt_GetCodepointHMetrics(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, int codepoint, @Nullable @NativeType("int *") int[] advanceWidth, @Nullable @NativeType("int *") int[] leftSideBearing) { + if (CHECKS) { + checkSafe(advanceWidth, 1); + checkSafe(leftSideBearing, 1); + } + nstbtt_GetCodepointHMetrics(info.address(), codepoint, advanceWidth, leftSideBearing); + } + + /** Array version of: {@link #nstbtt_GetCodepointBox} */ + public static native int nstbtt_GetCodepointBox(long info, int codepoint, int[] x0, int[] y0, int[] x1, int[] y1); + + /** Array version of: {@link #stbtt_GetCodepointBox GetCodepointBox} */ + @NativeType("int") + public static boolean stbtt_GetCodepointBox(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, int codepoint, @Nullable @NativeType("int *") int[] x0, @Nullable @NativeType("int *") int[] y0, @Nullable @NativeType("int *") int[] x1, @Nullable @NativeType("int *") int[] y1) { + if (CHECKS) { + checkSafe(x0, 1); + checkSafe(y0, 1); + checkSafe(x1, 1); + checkSafe(y1, 1); + } + return nstbtt_GetCodepointBox(info.address(), codepoint, x0, y0, x1, y1) != 0; + } + + /** Array version of: {@link #nstbtt_GetGlyphHMetrics} */ + public static native void nstbtt_GetGlyphHMetrics(long info, int glyph_index, int[] advanceWidth, int[] leftSideBearing); + + /** Array version of: {@link #stbtt_GetGlyphHMetrics GetGlyphHMetrics} */ + public static void stbtt_GetGlyphHMetrics(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, int glyph_index, @Nullable @NativeType("int *") int[] advanceWidth, @Nullable @NativeType("int *") int[] leftSideBearing) { + if (CHECKS) { + checkSafe(advanceWidth, 1); + checkSafe(leftSideBearing, 1); + } + nstbtt_GetGlyphHMetrics(info.address(), glyph_index, advanceWidth, leftSideBearing); + } + + /** Array version of: {@link #nstbtt_GetGlyphBox} */ + public static native int nstbtt_GetGlyphBox(long info, int glyph_index, int[] x0, int[] y0, int[] x1, int[] y1); + + /** Array version of: {@link #stbtt_GetGlyphBox GetGlyphBox} */ + @NativeType("int") + public static boolean stbtt_GetGlyphBox(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, int glyph_index, @Nullable @NativeType("int *") int[] x0, @Nullable @NativeType("int *") int[] y0, @Nullable @NativeType("int *") int[] x1, @Nullable @NativeType("int *") int[] y1) { + if (CHECKS) { + checkSafe(x0, 1); + checkSafe(y0, 1); + checkSafe(x1, 1); + checkSafe(y1, 1); + } + return nstbtt_GetGlyphBox(info.address(), glyph_index, x0, y0, x1, y1) != 0; + } + + /** Array version of: {@link #nstbtt_GetCodepointBitmap} */ + public static native long nstbtt_GetCodepointBitmap(long info, float scale_x, float scale_y, int codepoint, int[] width, int[] height, int[] xoff, int[] yoff); + + /** Array version of: {@link #stbtt_GetCodepointBitmap GetCodepointBitmap} */ + @Nullable + @NativeType("unsigned char *") + public static ByteBuffer stbtt_GetCodepointBitmap(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, float scale_x, float scale_y, int codepoint, @NativeType("int *") int[] width, @NativeType("int *") int[] height, @Nullable @NativeType("int *") int[] xoff, @Nullable @NativeType("int *") int[] yoff) { + if (CHECKS) { + check(width, 1); + check(height, 1); + checkSafe(xoff, 1); + checkSafe(yoff, 1); + } + long __result = nstbtt_GetCodepointBitmap(info.address(), scale_x, scale_y, codepoint, width, height, xoff, yoff); + return memByteBufferSafe(__result, width[0] * height[0]); + } + + /** Array version of: {@link #nstbtt_GetCodepointBitmapSubpixel} */ + public static native long nstbtt_GetCodepointBitmapSubpixel(long info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, int[] width, int[] height, int[] xoff, int[] yoff); + + /** Array version of: {@link #stbtt_GetCodepointBitmapSubpixel GetCodepointBitmapSubpixel} */ + @Nullable + @NativeType("unsigned char *") + public static ByteBuffer stbtt_GetCodepointBitmapSubpixel(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, float scale_x, float scale_y, float shift_x, float shift_y, int codepoint, @NativeType("int *") int[] width, @NativeType("int *") int[] height, @Nullable @NativeType("int *") int[] xoff, @Nullable @NativeType("int *") int[] yoff) { + if (CHECKS) { + check(width, 1); + check(height, 1); + checkSafe(xoff, 1); + checkSafe(yoff, 1); + } + long __result = nstbtt_GetCodepointBitmapSubpixel(info.address(), scale_x, scale_y, shift_x, shift_y, codepoint, width, height, xoff, yoff); + return memByteBufferSafe(__result, width[0] * height[0]); + } + + /** Array version of: {@link #nstbtt_MakeCodepointBitmapSubpixelPrefilter} */ + public static native void nstbtt_MakeCodepointBitmapSubpixelPrefilter(long info, long output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, float[] sub_x, float[] sub_y, int codepoint); + + /** Array version of: {@link #stbtt_MakeCodepointBitmapSubpixelPrefilter MakeCodepointBitmapSubpixelPrefilter} */ + public static void stbtt_MakeCodepointBitmapSubpixelPrefilter(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, @NativeType("unsigned char *") ByteBuffer output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, @NativeType("float *") float[] sub_x, @NativeType("float *") float[] sub_y, int codepoint) { + if (CHECKS) { + check(output, (out_stride != 0 ? out_stride : out_w) * out_h); + check(sub_x, 1); + check(sub_y, 1); + } + nstbtt_MakeCodepointBitmapSubpixelPrefilter(info.address(), memAddress(output), out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, oversample_x, oversample_y, sub_x, sub_y, codepoint); + } + + /** Array version of: {@link #nstbtt_GetCodepointBitmapBox} */ + public static native void nstbtt_GetCodepointBitmapBox(long font, int codepoint, float scale_x, float scale_y, int[] ix0, int[] iy0, int[] ix1, int[] iy1); + + /** Array version of: {@link #stbtt_GetCodepointBitmapBox GetCodepointBitmapBox} */ + public static void stbtt_GetCodepointBitmapBox(@NativeType("stbtt_fontinfo const *") STBTTFontinfo font, int codepoint, float scale_x, float scale_y, @Nullable @NativeType("int *") int[] ix0, @Nullable @NativeType("int *") int[] iy0, @Nullable @NativeType("int *") int[] ix1, @Nullable @NativeType("int *") int[] iy1) { + if (CHECKS) { + checkSafe(ix0, 1); + checkSafe(iy0, 1); + checkSafe(ix1, 1); + checkSafe(iy1, 1); + } + nstbtt_GetCodepointBitmapBox(font.address(), codepoint, scale_x, scale_y, ix0, iy0, ix1, iy1); + } + + /** Array version of: {@link #nstbtt_GetCodepointBitmapBoxSubpixel} */ + public static native void nstbtt_GetCodepointBitmapBoxSubpixel(long font, int codepoint, float scale_x, float scale_y, float shift_x, float shift_y, int[] ix0, int[] iy0, int[] ix1, int[] iy1); + + /** Array version of: {@link #stbtt_GetCodepointBitmapBoxSubpixel GetCodepointBitmapBoxSubpixel} */ + public static void stbtt_GetCodepointBitmapBoxSubpixel(@NativeType("stbtt_fontinfo const *") STBTTFontinfo font, int codepoint, float scale_x, float scale_y, float shift_x, float shift_y, @Nullable @NativeType("int *") int[] ix0, @Nullable @NativeType("int *") int[] iy0, @Nullable @NativeType("int *") int[] ix1, @Nullable @NativeType("int *") int[] iy1) { + if (CHECKS) { + checkSafe(ix0, 1); + checkSafe(iy0, 1); + checkSafe(ix1, 1); + checkSafe(iy1, 1); + } + nstbtt_GetCodepointBitmapBoxSubpixel(font.address(), codepoint, scale_x, scale_y, shift_x, shift_y, ix0, iy0, ix1, iy1); + } + + /** Array version of: {@link #nstbtt_GetGlyphBitmap} */ + public static native long nstbtt_GetGlyphBitmap(long info, float scale_x, float scale_y, int glyph, int[] width, int[] height, int[] xoff, int[] yoff); + + /** Array version of: {@link #stbtt_GetGlyphBitmap GetGlyphBitmap} */ + @Nullable + @NativeType("unsigned char *") + public static ByteBuffer stbtt_GetGlyphBitmap(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, float scale_x, float scale_y, int glyph, @NativeType("int *") int[] width, @NativeType("int *") int[] height, @Nullable @NativeType("int *") int[] xoff, @Nullable @NativeType("int *") int[] yoff) { + if (CHECKS) { + check(width, 1); + check(height, 1); + checkSafe(xoff, 1); + checkSafe(yoff, 1); + } + long __result = nstbtt_GetGlyphBitmap(info.address(), scale_x, scale_y, glyph, width, height, xoff, yoff); + return memByteBufferSafe(__result, width[0] * height[0]); + } + + /** Array version of: {@link #nstbtt_GetGlyphBitmapSubpixel} */ + public static native long nstbtt_GetGlyphBitmapSubpixel(long info, float scale_x, float scale_y, float shift_x, float shift_y, int glyph, int[] width, int[] height, int[] xoff, int[] yoff); + + /** Array version of: {@link #stbtt_GetGlyphBitmapSubpixel GetGlyphBitmapSubpixel} */ + @Nullable + @NativeType("unsigned char *") + public static ByteBuffer stbtt_GetGlyphBitmapSubpixel(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, float scale_x, float scale_y, float shift_x, float shift_y, int glyph, @NativeType("int *") int[] width, @NativeType("int *") int[] height, @Nullable @NativeType("int *") int[] xoff, @Nullable @NativeType("int *") int[] yoff) { + if (CHECKS) { + check(width, 1); + check(height, 1); + checkSafe(xoff, 1); + checkSafe(yoff, 1); + } + long __result = nstbtt_GetGlyphBitmapSubpixel(info.address(), scale_x, scale_y, shift_x, shift_y, glyph, width, height, xoff, yoff); + return memByteBufferSafe(__result, width[0] * height[0]); + } + + /** Array version of: {@link #nstbtt_MakeGlyphBitmapSubpixelPrefilter} */ + public static native void nstbtt_MakeGlyphBitmapSubpixelPrefilter(long info, long output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, float[] sub_x, float[] sub_y, int glyph); + + /** Array version of: {@link #stbtt_MakeGlyphBitmapSubpixelPrefilter MakeGlyphBitmapSubpixelPrefilter} */ + public static void stbtt_MakeGlyphBitmapSubpixelPrefilter(@NativeType("stbtt_fontinfo const *") STBTTFontinfo info, @NativeType("unsigned char *") ByteBuffer output, int out_w, int out_h, int out_stride, float scale_x, float scale_y, float shift_x, float shift_y, int oversample_x, int oversample_y, @NativeType("float *") float[] sub_x, @NativeType("float *") float[] sub_y, int glyph) { + if (CHECKS) { + check(output, (out_stride != 0 ? out_stride : out_w) * out_h); + check(sub_x, 1); + check(sub_y, 1); + } + nstbtt_MakeGlyphBitmapSubpixelPrefilter(info.address(), memAddress(output), out_w, out_h, out_stride, scale_x, scale_y, shift_x, shift_y, oversample_x, oversample_y, sub_x, sub_y, glyph); + } + + /** Array version of: {@link #nstbtt_GetGlyphBitmapBox} */ + public static native void nstbtt_GetGlyphBitmapBox(long font, int glyph, float scale_x, float scale_y, int[] ix0, int[] iy0, int[] ix1, int[] iy1); + + /** Array version of: {@link #stbtt_GetGlyphBitmapBox GetGlyphBitmapBox} */ + public static void stbtt_GetGlyphBitmapBox(@NativeType("stbtt_fontinfo const *") STBTTFontinfo font, int glyph, float scale_x, float scale_y, @Nullable @NativeType("int *") int[] ix0, @Nullable @NativeType("int *") int[] iy0, @Nullable @NativeType("int *") int[] ix1, @Nullable @NativeType("int *") int[] iy1) { + if (CHECKS) { + checkSafe(ix0, 1); + checkSafe(iy0, 1); + checkSafe(ix1, 1); + checkSafe(iy1, 1); + } + nstbtt_GetGlyphBitmapBox(font.address(), glyph, scale_x, scale_y, ix0, iy0, ix1, iy1); + } + + /** Array version of: {@link #nstbtt_GetGlyphBitmapBoxSubpixel} */ + public static native void nstbtt_GetGlyphBitmapBoxSubpixel(long font, int glyph, float scale_x, float scale_y, float shift_x, float shift_y, int[] ix0, int[] iy0, int[] ix1, int[] iy1); + + /** Array version of: {@link #stbtt_GetGlyphBitmapBoxSubpixel GetGlyphBitmapBoxSubpixel} */ + public static void stbtt_GetGlyphBitmapBoxSubpixel(@NativeType("stbtt_fontinfo const *") STBTTFontinfo font, int glyph, float scale_x, float scale_y, float shift_x, float shift_y, @Nullable @NativeType("int *") int[] ix0, @Nullable @NativeType("int *") int[] iy0, @Nullable @NativeType("int *") int[] ix1, @Nullable @NativeType("int *") int[] iy1) { + if (CHECKS) { + checkSafe(ix0, 1); + checkSafe(iy0, 1); + checkSafe(ix1, 1); + checkSafe(iy1, 1); + } + nstbtt_GetGlyphBitmapBoxSubpixel(font.address(), glyph, scale_x, scale_y, shift_x, shift_y, ix0, iy0, ix1, iy1); + } + + /** Array version of: {@link #nstbtt_GetGlyphSDF} */ + public static native long nstbtt_GetGlyphSDF(long font, float scale, int glyph, int padding, byte onedge_value, float pixel_dist_scale, int[] width, int[] height, int[] xoff, int[] yoff); + + /** Array version of: {@link #stbtt_GetGlyphSDF GetGlyphSDF} */ + @Nullable + @NativeType("unsigned char *") + public static ByteBuffer stbtt_GetGlyphSDF(@NativeType("stbtt_fontinfo const *") STBTTFontinfo font, float scale, int glyph, int padding, @NativeType("unsigned char") byte onedge_value, float pixel_dist_scale, @NativeType("int *") int[] width, @NativeType("int *") int[] height, @NativeType("int *") int[] xoff, @NativeType("int *") int[] yoff) { + if (CHECKS) { + check(width, 1); + check(height, 1); + check(xoff, 1); + check(yoff, 1); + } + long __result = nstbtt_GetGlyphSDF(font.address(), scale, glyph, padding, onedge_value, pixel_dist_scale, width, height, xoff, yoff); + return memByteBufferSafe(__result, width[0] * height[0]); + } + + /** Array version of: {@link #nstbtt_GetCodepointSDF} */ + public static native long nstbtt_GetCodepointSDF(long font, float scale, int codepoint, int padding, byte onedge_value, float pixel_dist_scale, int[] width, int[] height, int[] xoff, int[] yoff); + + /** Array version of: {@link #stbtt_GetCodepointSDF GetCodepointSDF} */ + @Nullable + @NativeType("unsigned char *") + public static ByteBuffer stbtt_GetCodepointSDF(@NativeType("stbtt_fontinfo const *") STBTTFontinfo font, float scale, int codepoint, int padding, @NativeType("unsigned char") byte onedge_value, float pixel_dist_scale, @NativeType("int *") int[] width, @NativeType("int *") int[] height, @NativeType("int *") int[] xoff, @NativeType("int *") int[] yoff) { + if (CHECKS) { + check(width, 1); + check(height, 1); + check(xoff, 1); + check(yoff, 1); + } + long __result = nstbtt_GetCodepointSDF(font.address(), scale, codepoint, padding, onedge_value, pixel_dist_scale, width, height, xoff, yoff); + return memByteBufferSafe(__result, width[0] * height[0]); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBVorbis.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBVorbis.java new file mode 100644 index 00000000..3ef94620 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBVorbis.java @@ -0,0 +1,967 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +import org.lwjgl.system.libc.LibCStdlib; + +/** + * Native bindings to stb_vorbis.c from the stb library. + * + *

Ogg Vorbis audio decoder.

+ * + *

Limitations

+ * + *
    + *
  • floor 0 not supported (used in old ogg vorbis files pre-2004)
  • + *
  • lossless sample-truncation at beginning ignored
  • + *
  • cannot concatenate multiple vorbis streams
  • + *
  • sample positions are 32-bit, limiting seekable 192Khz files to around 6 hours (Ogg supports 64-bit)
  • + *
+ * + *

THREAD SAFETY

+ * + *

Individual stb_vorbis* handles are not thread-safe; you cannot decode from them from multiple threads at the same time. However, you can have multiple + * {@code stb_vorbis*} handles and decode from them independently in multiple threads.

+ * + *

PUSHDATA API

+ * + *

This API allows you to get blocks of data from any source and hand them to stb_vorbis. you have to buffer them; stb_vorbis will tell you how much it + * used, and you have to give it the rest next time; and stb_vorbis may not have enough data to work with and you will need to give it the same data + * again PLUS more. Note that the Vorbis specification does not bound the size of an individual frame.

+ * + *

PULLING INPUT API

+ * + *

This API assumes stb_vorbis is allowed to pull data from a source -- either a block of memory containing the _entire_ vorbis stream, or a FILE * that + * you or it create, or possibly some other reading mechanism if you go modify the source to replace the FILE * case with some kind of callback to your + * code. (But if you don't support seeking, you may just want to go ahead and use pushdata.)

+ */ +public class STBVorbis { + + /** + * Error code. + * + *
Enum values:
+ * + *
    + *
  • {@link #VORBIS__no_error _no_error}
  • + *
  • {@link #VORBIS_need_more_data need_more_data}
  • + *
  • {@link #VORBIS_invalid_api_mixing invalid_api_mixing}
  • + *
  • {@link #VORBIS_outofmem outofmem}
  • + *
  • {@link #VORBIS_feature_not_supported feature_not_supported}
  • + *
  • {@link #VORBIS_too_many_channels too_many_channels}
  • + *
  • {@link #VORBIS_file_open_failure file_open_failure}
  • + *
  • {@link #VORBIS_seek_without_length seek_without_length}
  • + *
  • {@link #VORBIS_unexpected_eof unexpected_eof}
  • + *
  • {@link #VORBIS_seek_invalid seek_invalid}
  • + *
  • {@link #VORBIS_invalid_setup invalid_setup}
  • + *
  • {@link #VORBIS_invalid_stream invalid_stream}
  • + *
  • {@link #VORBIS_missing_capture_pattern missing_capture_pattern}
  • + *
  • {@link #VORBIS_invalid_stream_structure_version invalid_stream_structure_version}
  • + *
  • {@link #VORBIS_continued_packet_flag_invalid continued_packet_flag_invalid}
  • + *
  • {@link #VORBIS_incorrect_stream_serial_number incorrect_stream_serial_number}
  • + *
  • {@link #VORBIS_invalid_first_page invalid_first_page}
  • + *
  • {@link #VORBIS_bad_packet_type bad_packet_type}
  • + *
  • {@link #VORBIS_cant_find_last_page cant_find_last_page}
  • + *
  • {@link #VORBIS_seek_failed seek_failed}
  • + *
  • {@link #VORBIS_ogg_skeleton_not_supported ogg_skeleton_not_supported}
  • + *
+ */ + public static final int + VORBIS__no_error = 0, + VORBIS_need_more_data = 1, + VORBIS_invalid_api_mixing = 2, + VORBIS_outofmem = 3, + VORBIS_feature_not_supported = 4, + VORBIS_too_many_channels = 5, + VORBIS_file_open_failure = 6, + VORBIS_seek_without_length = 7, + VORBIS_unexpected_eof = 10, + VORBIS_seek_invalid = 11, + VORBIS_invalid_setup = 20, + VORBIS_invalid_stream = 21, + VORBIS_missing_capture_pattern = 30, + VORBIS_invalid_stream_structure_version = 31, + VORBIS_continued_packet_flag_invalid = 32, + VORBIS_incorrect_stream_serial_number = 33, + VORBIS_invalid_first_page = 34, + VORBIS_bad_packet_type = 35, + VORBIS_cant_find_last_page = 36, + VORBIS_seek_failed = 37, + VORBIS_ogg_skeleton_not_supported = 38; + + static { LibSTB.initialize(); } + + protected STBVorbis() { + throw new UnsupportedOperationException(); + } + + // --- [ stb_vorbis_get_info ] --- + + /** Unsafe version of: {@link #stb_vorbis_get_info get_info} */ + public static native void nstb_vorbis_get_info(long f, long __result); + + /** + * Returns general information about the specified file. + * + * @param f an ogg vorbis file decoder + */ + @NativeType("stb_vorbis_info") + public static STBVorbisInfo stb_vorbis_get_info(@NativeType("stb_vorbis *") long f, @NativeType("stb_vorbis_info") STBVorbisInfo __result) { + if (CHECKS) { + check(f); + } + nstb_vorbis_get_info(f, __result.address()); + return __result; + } + + // --- [ stb_vorbis_get_error ] --- + + /** Unsafe version of: {@link #stb_vorbis_get_error get_error} */ + public static native int nstb_vorbis_get_error(long f); + + /** + * Returns the last error detected (clears it, too). + * + * @param f an ogg vorbis file decoder + */ + public static int stb_vorbis_get_error(@NativeType("stb_vorbis *") long f) { + if (CHECKS) { + check(f); + } + return nstb_vorbis_get_error(f); + } + + // --- [ stb_vorbis_close ] --- + + /** Unsafe version of: {@link #stb_vorbis_close close} */ + public static native void nstb_vorbis_close(long f); + + /** + * Closes an ogg vorbis file and free all memory in use + * + * @param f an ogg vorbis file decoder + */ + public static void stb_vorbis_close(@NativeType("stb_vorbis *") long f) { + if (CHECKS) { + check(f); + } + nstb_vorbis_close(f); + } + + // --- [ stb_vorbis_get_sample_offset ] --- + + /** Unsafe version of: {@link #stb_vorbis_get_sample_offset get_sample_offset} */ + public static native int nstb_vorbis_get_sample_offset(long f); + + /** + * Returns the offset (in samples) from the beginning of the file that will be returned by the next decode, if it is known, or -1 otherwise. After a + * {@link #stb_vorbis_flush_pushdata flush_pushdata} call, this may take a while before it becomes valid again. + * + *

NOT WORKING YET after a seek with PULLDATA API.

+ * + * @param f an ogg vorbis file decoder + */ + public static int stb_vorbis_get_sample_offset(@NativeType("stb_vorbis *") long f) { + if (CHECKS) { + check(f); + } + return nstb_vorbis_get_sample_offset(f); + } + + // --- [ stb_vorbis_get_file_offset ] --- + + /** Unsafe version of: {@link #stb_vorbis_get_file_offset get_file_offset} */ + public static native int nstb_vorbis_get_file_offset(long f); + + /** + * Returns the current seek point within the file, or offset from the beginning of the memory buffer. In pushdata mode it returns 0. + * + * @param f an ogg vorbis file decoder + */ + @NativeType("unsigned int") + public static int stb_vorbis_get_file_offset(@NativeType("stb_vorbis *") long f) { + if (CHECKS) { + check(f); + } + return nstb_vorbis_get_file_offset(f); + } + + // --- [ stb_vorbis_open_pushdata ] --- + + /** + * Unsafe version of: {@link #stb_vorbis_open_pushdata open_pushdata} + * + * @param datablock_length_in_bytes the length of {@code datablock}, in bytes + */ + public static native long nstb_vorbis_open_pushdata(long datablock, int datablock_length_in_bytes, long datablock_memory_consumed_in_bytes, long error, long alloc_buffer); + + /** + * Creates a vorbis decoder by passing in the initial data block containing the ogg&vorbis headers (you don't need to do parse them, just provide the + * first N bytes of the file -- you're told if it's not enough, see below) + * + * @param datablock the data block containing the ogg vorbis headers + * @param datablock_memory_consumed_in_bytes returns the amount of data parsed/consumed, in bytes + * @param error returns the error code + * @param alloc_buffer an {@link STBVorbisAlloc} struct + * + * @return On success, returns an {@code stb_vorbis *}, does not set error, returns the amount of data parsed/consumed on this call in + * {@code *datablock_memory_consumed_in_bytes}; On failure, returns {@code NULL} on error and sets {@code *error}, does not change + * {@code *datablock_memory_consumed}. If it returns {@code NULL} and {@code *error} is {@link #VORBIS_need_more_data need_more_data}, then the input block was incomplete and you need to pass + * in a larger block from the start of the file. + */ + @NativeType("stb_vorbis *") + public static long stb_vorbis_open_pushdata(@NativeType("unsigned char const *") ByteBuffer datablock, @NativeType("int *") IntBuffer datablock_memory_consumed_in_bytes, @NativeType("int *") IntBuffer error, @Nullable @NativeType("stb_vorbis_alloc const *") STBVorbisAlloc alloc_buffer) { + if (CHECKS) { + check(datablock_memory_consumed_in_bytes, 1); + check(error, 1); + if (alloc_buffer != null) { STBVorbisAlloc.validate(alloc_buffer.address()); } + } + return nstb_vorbis_open_pushdata(memAddress(datablock), datablock.remaining(), memAddress(datablock_memory_consumed_in_bytes), memAddress(error), memAddressSafe(alloc_buffer)); + } + + // --- [ stb_vorbis_decode_frame_pushdata ] --- + + /** + * Unsafe version of: {@link #stb_vorbis_decode_frame_pushdata decode_frame_pushdata} + * + * @param datablock_length_in_bytes the length of {@code datablock}, in bytes + */ + public static native int nstb_vorbis_decode_frame_pushdata(long f, long datablock, int datablock_length_in_bytes, long channels, long output, long samples); + + /** + * Decodes a frame of audio sample data if possible from the passed-in data block. + * + *

Note that on resynch, stb_vorbis will rarely consume all of the buffer, instead only {@code datablock_length_in_bytes-3} or less. This is because it + * wants to avoid missing parts of a page header if they cross a datablock boundary, without writing state-machiney code to record a partial detection.

+ * + *

The number of channels returned are stored in *channels (which can be {@code NULL} -- it is always the same as the number of channels reported by {@link #stb_vorbis_get_info get_info}). + * {@code *output} will contain an array of {@code float*} buffers, one per channel. In other words, {@code (*output)[0][0]} contains the first sample + * from the first channel, and {@code (*output)[1][0]} contains the first sample from the second channel.

+ * + * @param f an ogg vorbis file decoder + * @param datablock the data block containing the audio sample data + * @param channels place to write number of {@code float *} buffers + * @param output place to write float ** array of float * buffers + * @param samples place to write number of output samples + * + * @return the number of bytes we used from datablock. Possible cases: + * + *
    + *
  • 0 bytes used, 0 samples output (need more data)
  • + *
  • N bytes used, 0 samples output (resynching the stream, keep going)
  • + *
  • N bytes used, M samples output (one frame of data)
  • + *
+ * + *

Note that after opening a file, you will ALWAYS get one N-bytes,0-sample frame, because Vorbis always "discards" the first frame.

+ */ + public static int stb_vorbis_decode_frame_pushdata(@NativeType("stb_vorbis *") long f, @NativeType("unsigned char const *") ByteBuffer datablock, @Nullable @NativeType("int *") IntBuffer channels, @NativeType("float ***") PointerBuffer output, @NativeType("int *") IntBuffer samples) { + if (CHECKS) { + check(f); + checkSafe(channels, 1); + check(output, 1); + check(samples, 1); + } + return nstb_vorbis_decode_frame_pushdata(f, memAddress(datablock), datablock.remaining(), memAddressSafe(channels), memAddress(output), memAddress(samples)); + } + + // --- [ stb_vorbis_flush_pushdata ] --- + + /** Unsafe version of: {@link #stb_vorbis_flush_pushdata flush_pushdata} */ + public static native void nstb_vorbis_flush_pushdata(long f); + + /** + * Inform stb_vorbis that your next datablock will not be contiguous with previous ones (e.g. you've seeked in the data); future attempts to decode frames + * will cause stb_vorbis to resynchronize (as noted above), and once it sees a valid Ogg page (typically 4-8KB, as large as 64KB), it will begin decoding + * the next frame. + * + *

If you want to seek using pushdata, you need to seek in your file, then call stb_vorbis_flush_pushdata(), then start calling decoding, then once + * decoding is returning you data, call {@link #stb_vorbis_get_sample_offset get_sample_offset}, and if you don't like the result, seek your file again and repeat.

+ * + * @param f an ogg vorbis file decoder + */ + public static void stb_vorbis_flush_pushdata(@NativeType("stb_vorbis *") long f) { + if (CHECKS) { + check(f); + } + nstb_vorbis_flush_pushdata(f); + } + + // --- [ stb_vorbis_decode_filename ] --- + + /** Unsafe version of: {@link #stb_vorbis_decode_filename decode_filename} */ + public static native int nstb_vorbis_decode_filename(long filename, long channels, long sample_rate, long output); + + /** + * Decode an entire file and output the data interleaved into a {@code malloc()ed} buffer stored in {@code *output}. When you're done with it, just + * {@link LibCStdlib#free} the pointer returned in {@code *output}. + * + * @param filename the file name + * @param channels returns the number of channels + * @param sample_rate returns the sample rate + * @param output returns a pointer to the decoded data + * + * @return the number of samples decoded, or -1 if the file could not be opened or was not an ogg vorbis file + */ + public static int stb_vorbis_decode_filename(@NativeType("char const *") ByteBuffer filename, @NativeType("int *") IntBuffer channels, @NativeType("int *") IntBuffer sample_rate, @NativeType("short **") PointerBuffer output) { + if (CHECKS) { + checkNT1(filename); + check(channels, 1); + check(sample_rate, 1); + check(output, 1); + } + return nstb_vorbis_decode_filename(memAddress(filename), memAddress(channels), memAddress(sample_rate), memAddress(output)); + } + + /** + * Decode an entire file and output the data interleaved into a {@code malloc()ed} buffer stored in {@code *output}. When you're done with it, just + * {@link LibCStdlib#free} the pointer returned in {@code *output}. + * + * @param filename the file name + * @param channels returns the number of channels + * @param sample_rate returns the sample rate + * @param output returns a pointer to the decoded data + * + * @return the number of samples decoded, or -1 if the file could not be opened or was not an ogg vorbis file + */ + public static int stb_vorbis_decode_filename(@NativeType("char const *") CharSequence filename, @NativeType("int *") IntBuffer channels, @NativeType("int *") IntBuffer sample_rate, @NativeType("short **") PointerBuffer output) { + if (CHECKS) { + check(channels, 1); + check(sample_rate, 1); + check(output, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(filename, true); + long filenameEncoded = stack.getPointerAddress(); + return nstb_vorbis_decode_filename(filenameEncoded, memAddress(channels), memAddress(sample_rate), memAddress(output)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Decode an entire file and output the data interleaved into a {@code malloc()ed} buffer stored in {@code *output}. When you're done with it, just + * {@link LibCStdlib#free} the pointer returned in {@code *output}. + * + * @param filename the file name + * @param channels returns the number of channels + * @param sample_rate returns the sample rate + * + * @return the number of samples decoded, or -1 if the file could not be opened or was not an ogg vorbis file + */ + @Nullable + @NativeType("int") + public static ShortBuffer stb_vorbis_decode_filename(@NativeType("char const *") CharSequence filename, @NativeType("int *") IntBuffer channels, @NativeType("int *") IntBuffer sample_rate) { + if (CHECKS) { + check(channels, 1); + check(sample_rate, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(filename, true); + long filenameEncoded = stack.getPointerAddress(); + PointerBuffer output = stack.pointers(NULL); + int __result = nstb_vorbis_decode_filename(filenameEncoded, memAddress(channels), memAddress(sample_rate), memAddress(output)); + return memShortBufferSafe(output.get(0), __result * channels.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stb_vorbis_decode_memory ] --- + + /** + * Unsafe version of: {@link #stb_vorbis_decode_memory decode_memory} + * + * @param len the {@code data} length, in bytes + */ + public static native int nstb_vorbis_decode_memory(long mem, int len, long channels, long sample_rate, long output); + + /** + * In-memory version of {@link #stb_vorbis_decode_filename decode_filename}. + * + * @param mem the data to decode + * @param channels returns the number of channels + * @param sample_rate returns the sample rate + * @param output returns a pointer to the decoded data + */ + public static int stb_vorbis_decode_memory(@NativeType("unsigned char const *") ByteBuffer mem, @NativeType("int *") IntBuffer channels, @NativeType("int *") IntBuffer sample_rate, @NativeType("short **") PointerBuffer output) { + if (CHECKS) { + check(channels, 1); + check(sample_rate, 1); + check(output, 1); + } + return nstb_vorbis_decode_memory(memAddress(mem), mem.remaining(), memAddress(channels), memAddress(sample_rate), memAddress(output)); + } + + /** + * In-memory version of {@link #stb_vorbis_decode_filename decode_filename}. + * + * @param mem the data to decode + * @param channels returns the number of channels + * @param sample_rate returns the sample rate + */ + @Nullable + @NativeType("int") + public static ShortBuffer stb_vorbis_decode_memory(@NativeType("unsigned char const *") ByteBuffer mem, @NativeType("int *") IntBuffer channels, @NativeType("int *") IntBuffer sample_rate) { + if (CHECKS) { + check(channels, 1); + check(sample_rate, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + PointerBuffer output = stack.pointers(NULL); + int __result = nstb_vorbis_decode_memory(memAddress(mem), mem.remaining(), memAddress(channels), memAddress(sample_rate), memAddress(output)); + return memShortBufferSafe(output.get(0), __result * channels.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stb_vorbis_open_memory ] --- + + /** + * Unsafe version of: {@link #stb_vorbis_open_memory open_memory} + * + * @param len the {@code data} length, in bytes + */ + public static native long nstb_vorbis_open_memory(long mem, int len, long error, long alloc_buffer); + + /** + * Creates an ogg vorbis decoder from an ogg vorbis stream in memory (note this must be the entire stream!). + * + * @param mem the data to decode + * @param error returns an error code + * @param alloc_buffer an {@link STBVorbisAlloc} struct + * + * @return the ogg vorbis decoder. On failure, returns {@code NULL} and sets {@code *error}. + */ + @NativeType("stb_vorbis *") + public static long stb_vorbis_open_memory(@NativeType("unsigned char const *") ByteBuffer mem, @NativeType("int *") IntBuffer error, @Nullable @NativeType("stb_vorbis_alloc const *") STBVorbisAlloc alloc_buffer) { + if (CHECKS) { + check(error, 1); + if (alloc_buffer != null) { STBVorbisAlloc.validate(alloc_buffer.address()); } + } + return nstb_vorbis_open_memory(memAddress(mem), mem.remaining(), memAddress(error), memAddressSafe(alloc_buffer)); + } + + // --- [ stb_vorbis_open_filename ] --- + + /** Unsafe version of: {@link #stb_vorbis_open_filename open_filename} */ + public static native long nstb_vorbis_open_filename(long filename, long error, long alloc_buffer); + + /** + * Creates an ogg vorbis decoder from a file name. + * + * @param filename the file name + * @param error returns an error code + * @param alloc_buffer an {@link STBVorbisAlloc} struct + * + * @return the ogg vorbis decoder. On failure, returns {@code NULL} and sets {@code *error}. + */ + @NativeType("stb_vorbis *") + public static long stb_vorbis_open_filename(@NativeType("char const *") ByteBuffer filename, @NativeType("int *") IntBuffer error, @Nullable @NativeType("stb_vorbis_alloc const *") STBVorbisAlloc alloc_buffer) { + if (CHECKS) { + checkNT1(filename); + check(error, 1); + if (alloc_buffer != null) { STBVorbisAlloc.validate(alloc_buffer.address()); } + } + return nstb_vorbis_open_filename(memAddress(filename), memAddress(error), memAddressSafe(alloc_buffer)); + } + + /** + * Creates an ogg vorbis decoder from a file name. + * + * @param filename the file name + * @param error returns an error code + * @param alloc_buffer an {@link STBVorbisAlloc} struct + * + * @return the ogg vorbis decoder. On failure, returns {@code NULL} and sets {@code *error}. + */ + @NativeType("stb_vorbis *") + public static long stb_vorbis_open_filename(@NativeType("char const *") CharSequence filename, @NativeType("int *") IntBuffer error, @Nullable @NativeType("stb_vorbis_alloc const *") STBVorbisAlloc alloc_buffer) { + if (CHECKS) { + check(error, 1); + if (alloc_buffer != null) { STBVorbisAlloc.validate(alloc_buffer.address()); } + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(filename, true); + long filenameEncoded = stack.getPointerAddress(); + return nstb_vorbis_open_filename(filenameEncoded, memAddress(error), memAddressSafe(alloc_buffer)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ stb_vorbis_seek_frame ] --- + + /** Unsafe version of: {@link #stb_vorbis_seek_frame seek_frame} */ + public static native int nstb_vorbis_seek_frame(long f, int sample_number); + + /** + * Seeks in the Vorbis file to (approximately) {@code sample_number}. After calling seek_frame(), the next call to {@code get_frame_*()} will include the + * specified sample. + * + * @param f an ogg vorbis file decoder + * @param sample_number the sample index + */ + @NativeType("int") + public static boolean stb_vorbis_seek_frame(@NativeType("stb_vorbis *") long f, @NativeType("unsigned int") int sample_number) { + if (CHECKS) { + check(f); + } + return nstb_vorbis_seek_frame(f, sample_number) != 0; + } + + // --- [ stb_vorbis_seek ] --- + + /** Unsafe version of: {@link #stb_vorbis_seek seek} */ + public static native int nstb_vorbis_seek(long f, int sample_number); + + /** + * Seeks in the Vorbis file to (approximately) {@code sample_number}. After calling stb_vorbis_seek(), the next call to {@code stb_vorbis_get_samples_*} + * will start with the specified sample. + * + * @param f an ogg vorbis file decoder + * @param sample_number the sample index + */ + @NativeType("int") + public static boolean stb_vorbis_seek(@NativeType("stb_vorbis *") long f, @NativeType("unsigned int") int sample_number) { + if (CHECKS) { + check(f); + } + return nstb_vorbis_seek(f, sample_number) != 0; + } + + // --- [ stb_vorbis_seek_start ] --- + + /** Unsafe version of: {@link #stb_vorbis_seek_start seek_start} */ + public static native int nstb_vorbis_seek_start(long f); + + /** + * This function is equivalent to {@link #stb_vorbis_seek seek}(f,0). + * + * @param f an ogg vorbis file decoder + */ + @NativeType("int") + public static boolean stb_vorbis_seek_start(@NativeType("stb_vorbis *") long f) { + if (CHECKS) { + check(f); + } + return nstb_vorbis_seek_start(f) != 0; + } + + // --- [ stb_vorbis_stream_length_in_samples ] --- + + /** Unsafe version of: {@link #stb_vorbis_stream_length_in_samples stream_length_in_samples} */ + public static native int nstb_vorbis_stream_length_in_samples(long f); + + /** + * Returns the total length of the vorbis stream, in samples. + * + * @param f an ogg vorbis file decoder + */ + @NativeType("unsigned int") + public static int stb_vorbis_stream_length_in_samples(@NativeType("stb_vorbis *") long f) { + if (CHECKS) { + check(f); + } + return nstb_vorbis_stream_length_in_samples(f); + } + + // --- [ stb_vorbis_stream_length_in_seconds ] --- + + /** Unsafe version of: {@link #stb_vorbis_stream_length_in_seconds stream_length_in_seconds} */ + public static native float nstb_vorbis_stream_length_in_seconds(long f); + + /** + * Returns the total length of the vorbis stream, in samples. + * + * @param f an ogg vorbis file decoder + */ + public static float stb_vorbis_stream_length_in_seconds(@NativeType("stb_vorbis *") long f) { + if (CHECKS) { + check(f); + } + return nstb_vorbis_stream_length_in_seconds(f); + } + + // --- [ stb_vorbis_get_frame_float ] --- + + /** Unsafe version of: {@link #stb_vorbis_get_frame_float get_frame_float} */ + public static native int nstb_vorbis_get_frame_float(long f, long channels, long output); + + /** + * Decodes the next frame and return the number of samples. + * + *

You generally should not intermix calls to {@code stb_vorbis_get_frame_*()} and {@code stb_vorbis_get_samples_*()}, since the latter calls the former.

+ * + * @param f an ogg vorbis file decoder + * @param channels returns the number of channels. Can be {@code NULL} -- it is always the same as the number of channels reported by {@link #stb_vorbis_get_info get_info}. + * @param output returns a pointer to an array of float* buffers, one per channel. These outputs will be overwritten on the next call to + * {@code stb_vorbis_get_frame_*}. + * + * @return the number of samples per channel + */ + public static int stb_vorbis_get_frame_float(@NativeType("stb_vorbis *") long f, @Nullable @NativeType("int *") IntBuffer channels, @NativeType("float ***") PointerBuffer output) { + if (CHECKS) { + check(f); + checkSafe(channels, 1); + check(output, 1); + } + return nstb_vorbis_get_frame_float(f, memAddressSafe(channels), memAddress(output)); + } + + // --- [ stb_vorbis_get_frame_short ] --- + + /** + * Unsafe version of: {@link #stb_vorbis_get_frame_short get_frame_short} + * + * @param num_c the number of channels + */ + public static native int nstb_vorbis_get_frame_short(long f, int num_c, long buffer, int num_samples); + + /** + * Decodes the next frame and returns the number of samples per channel. Note that for interleaved data, you pass in the number of shorts (the size + * of your array), but the return value is the number of samples per channel, not the total number of samples. + * + *

The data is coerced to the number of channels you request according to the channel coercion rules (see below). You must pass in the size of your + * buffer(s) so that stb_vorbis will not overwrite the end of the buffer. The maximum buffer size needed can be gotten from {@link #stb_vorbis_get_info get_info}; however, the + * Vorbis I specification implies an absolute maximum of 4096 samples per channel.

+ * + *

Channel coercion rules

+ * + *

Let M be the number of channels requested, and N the number of channels present, and Cn be the nth channel; let stereo L be the sum of all L and center + * channels, and stereo R be the sum of all R and center channels (channel assignment from the vorbis spec).

+ * + *

+     * M    N      output
+     * 1    k      sum(Ck) for all k
+     * 2    *      stereo L, stereo R
+     * k    l      k > l, the first l channels, then 0s
+     * k    l      k <= l, the first k channels
+ * + *

Note that this is not good surround etc. mixing at all! It's just so you get something useful.

+ * + * @param f an ogg vorbis file decoder + * @param buffer the output buffer, an array of pointers with length {@code num_c}, each pointing to a short array with length {@code num_samples} + * @param num_samples the number of samples + * + * @return the number of samples per channel + */ + public static int stb_vorbis_get_frame_short(@NativeType("stb_vorbis *") long f, @NativeType("short **") PointerBuffer buffer, int num_samples) { + if (CHECKS) { + check(f); + } + return nstb_vorbis_get_frame_short(f, buffer.remaining(), memAddress(buffer), num_samples); + } + + // --- [ stb_vorbis_get_frame_short_interleaved ] --- + + /** + * Unsafe version of: {@link #stb_vorbis_get_frame_short_interleaved get_frame_short_interleaved} + * + * @param num_shorts the size of {@code buffer} + */ + public static native int nstb_vorbis_get_frame_short_interleaved(long f, int num_c, long buffer, int num_shorts); + + /** + * Interleaved version of {@link #stb_vorbis_get_frame_short get_frame_short}. + * + *

Note that for interleaved data, you pass in the number of shorts (the size of your array), but the return value is the number of samples per channel, + * not the total number of samples.

+ * + * @param f an ogg vorbis file decoder + * @param num_c the number of channels + * @param buffer the output buffer + * + * @return the number of samples per channel + */ + public static int stb_vorbis_get_frame_short_interleaved(@NativeType("stb_vorbis *") long f, int num_c, @NativeType("short *") ShortBuffer buffer) { + if (CHECKS) { + check(f); + } + return nstb_vorbis_get_frame_short_interleaved(f, num_c, memAddress(buffer), buffer.remaining()); + } + + // --- [ stb_vorbis_get_samples_float ] --- + + /** + * Unsafe version of: {@link #stb_vorbis_get_samples_float get_samples_float} + * + * @param channels the number of channels to decode + */ + public static native int nstb_vorbis_get_samples_float(long f, int channels, long buffer, int num_samples); + + /** + * Gets {@code num_samples} samples, not necessarily on a frame boundary -- this requires buffering so you have to supply the buffers. DOES NOT APPLY THE + * COERCION RULES. + * + * @param f an ogg vorbis file decoder + * @param buffer the output buffer, an array of pointers with length {@code channels}, each pointing to a float array with length {@code num_samples} + * @param num_samples the number of samples to decode + * + * @return the number of samples stored per channel; it may be less than requested at the end of the file. If there are no more samples in the file, returns 0. + */ + public static int stb_vorbis_get_samples_float(@NativeType("stb_vorbis *") long f, @NativeType("float **") PointerBuffer buffer, int num_samples) { + if (CHECKS) { + check(f); + } + return nstb_vorbis_get_samples_float(f, buffer.remaining(), memAddress(buffer), num_samples); + } + + // --- [ stb_vorbis_get_samples_float_interleaved ] --- + + /** + * Unsafe version of: {@link #stb_vorbis_get_samples_float_interleaved get_samples_float_interleaved} + * + * @param num_floats the size of {@code buffer} + */ + public static native int nstb_vorbis_get_samples_float_interleaved(long f, int channels, long buffer, int num_floats); + + /** + * Interleaved version of {@link #stb_vorbis_get_samples_float get_samples_float}. + * + * @param f an ogg vorbis file decoder + * @param channels the number of channels + * @param buffer the output buffer + * + * @return the number of samples stored per channel; it may be less than requested at the end of the file. If there are no more samples in the file, returns 0. + */ + public static int stb_vorbis_get_samples_float_interleaved(@NativeType("stb_vorbis *") long f, int channels, @NativeType("float *") FloatBuffer buffer) { + if (CHECKS) { + check(f); + } + return nstb_vorbis_get_samples_float_interleaved(f, channels, memAddress(buffer), buffer.remaining()); + } + + // --- [ stb_vorbis_get_samples_short ] --- + + /** + * Unsafe version of: {@link #stb_vorbis_get_samples_short get_samples_short} + * + * @param channels the number of channels + */ + public static native int nstb_vorbis_get_samples_short(long f, int channels, long buffer, int num_samples); + + /** + * Gets {@code num_samples} samples, not necessarily on a frame boundary -- this requires buffering so you have to supply the buffers. Applies the + * coercion rules above to produce {@code channels} channels. + * + * @param f an ogg vorbis file decoder + * @param buffer the output buffer, an array of pointers with length {@code channels}, each pointing to a short array with length {@code num_samples} + * @param num_samples the number of samples + * + * @return the number of samples stored per channel; it may be less than requested at the end of the file. If there are no more samples in the file, returns 0. + */ + public static int stb_vorbis_get_samples_short(@NativeType("stb_vorbis *") long f, @NativeType("short **") PointerBuffer buffer, int num_samples) { + if (CHECKS) { + check(f); + } + return nstb_vorbis_get_samples_short(f, buffer.remaining(), memAddress(buffer), num_samples); + } + + // --- [ stb_vorbis_get_samples_short_interleaved ] --- + + /** + * Unsafe version of: {@link #stb_vorbis_get_samples_short_interleaved get_samples_short_interleaved} + * + * @param num_shorts the size of {@code buffer} + */ + public static native int nstb_vorbis_get_samples_short_interleaved(long f, int channels, long buffer, int num_shorts); + + /** + * Interleaved version of {@link #stb_vorbis_get_samples_short get_samples_short}. + * + * @param f an ogg vorbis file decoder + * @param channels the number of channels + * @param buffer the output buffer + * + * @return the number of samples stored per channel; it may be less than requested at the end of the file. If there are no more samples in the file, returns 0. + */ + public static int stb_vorbis_get_samples_short_interleaved(@NativeType("stb_vorbis *") long f, int channels, @NativeType("short *") ShortBuffer buffer) { + if (CHECKS) { + check(f); + } + return nstb_vorbis_get_samples_short_interleaved(f, channels, memAddress(buffer), buffer.remaining()); + } + + /** Array version of: {@link #nstb_vorbis_open_pushdata} */ + public static native long nstb_vorbis_open_pushdata(long datablock, int datablock_length_in_bytes, int[] datablock_memory_consumed_in_bytes, int[] error, long alloc_buffer); + + /** Array version of: {@link #stb_vorbis_open_pushdata open_pushdata} */ + @NativeType("stb_vorbis *") + public static long stb_vorbis_open_pushdata(@NativeType("unsigned char const *") ByteBuffer datablock, @NativeType("int *") int[] datablock_memory_consumed_in_bytes, @NativeType("int *") int[] error, @Nullable @NativeType("stb_vorbis_alloc const *") STBVorbisAlloc alloc_buffer) { + if (CHECKS) { + check(datablock_memory_consumed_in_bytes, 1); + check(error, 1); + if (alloc_buffer != null) { STBVorbisAlloc.validate(alloc_buffer.address()); } + } + return nstb_vorbis_open_pushdata(memAddress(datablock), datablock.remaining(), datablock_memory_consumed_in_bytes, error, memAddressSafe(alloc_buffer)); + } + + /** Array version of: {@link #nstb_vorbis_decode_frame_pushdata} */ + public static native int nstb_vorbis_decode_frame_pushdata(long f, long datablock, int datablock_length_in_bytes, int[] channels, long output, int[] samples); + + /** Array version of: {@link #stb_vorbis_decode_frame_pushdata decode_frame_pushdata} */ + public static int stb_vorbis_decode_frame_pushdata(@NativeType("stb_vorbis *") long f, @NativeType("unsigned char const *") ByteBuffer datablock, @Nullable @NativeType("int *") int[] channels, @NativeType("float ***") PointerBuffer output, @NativeType("int *") int[] samples) { + if (CHECKS) { + check(f); + checkSafe(channels, 1); + check(output, 1); + check(samples, 1); + } + return nstb_vorbis_decode_frame_pushdata(f, memAddress(datablock), datablock.remaining(), channels, memAddress(output), samples); + } + + /** Array version of: {@link #nstb_vorbis_decode_filename} */ + public static native int nstb_vorbis_decode_filename(long filename, int[] channels, int[] sample_rate, long output); + + /** Array version of: {@link #stb_vorbis_decode_filename decode_filename} */ + public static int stb_vorbis_decode_filename(@NativeType("char const *") ByteBuffer filename, @NativeType("int *") int[] channels, @NativeType("int *") int[] sample_rate, @NativeType("short **") PointerBuffer output) { + if (CHECKS) { + checkNT1(filename); + check(channels, 1); + check(sample_rate, 1); + check(output, 1); + } + return nstb_vorbis_decode_filename(memAddress(filename), channels, sample_rate, memAddress(output)); + } + + /** Array version of: {@link #stb_vorbis_decode_filename decode_filename} */ + public static int stb_vorbis_decode_filename(@NativeType("char const *") CharSequence filename, @NativeType("int *") int[] channels, @NativeType("int *") int[] sample_rate, @NativeType("short **") PointerBuffer output) { + if (CHECKS) { + check(channels, 1); + check(sample_rate, 1); + check(output, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(filename, true); + long filenameEncoded = stack.getPointerAddress(); + return nstb_vorbis_decode_filename(filenameEncoded, channels, sample_rate, memAddress(output)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #nstb_vorbis_decode_memory} */ + public static native int nstb_vorbis_decode_memory(long mem, int len, int[] channels, int[] sample_rate, long output); + + /** Array version of: {@link #stb_vorbis_decode_memory decode_memory} */ + public static int stb_vorbis_decode_memory(@NativeType("unsigned char const *") ByteBuffer mem, @NativeType("int *") int[] channels, @NativeType("int *") int[] sample_rate, @NativeType("short **") PointerBuffer output) { + if (CHECKS) { + check(channels, 1); + check(sample_rate, 1); + check(output, 1); + } + return nstb_vorbis_decode_memory(memAddress(mem), mem.remaining(), channels, sample_rate, memAddress(output)); + } + + /** Array version of: {@link #nstb_vorbis_open_memory} */ + public static native long nstb_vorbis_open_memory(long mem, int len, int[] error, long alloc_buffer); + + /** Array version of: {@link #stb_vorbis_open_memory open_memory} */ + @NativeType("stb_vorbis *") + public static long stb_vorbis_open_memory(@NativeType("unsigned char const *") ByteBuffer mem, @NativeType("int *") int[] error, @Nullable @NativeType("stb_vorbis_alloc const *") STBVorbisAlloc alloc_buffer) { + if (CHECKS) { + check(error, 1); + if (alloc_buffer != null) { STBVorbisAlloc.validate(alloc_buffer.address()); } + } + return nstb_vorbis_open_memory(memAddress(mem), mem.remaining(), error, memAddressSafe(alloc_buffer)); + } + + /** Array version of: {@link #nstb_vorbis_open_filename} */ + public static native long nstb_vorbis_open_filename(long filename, int[] error, long alloc_buffer); + + /** Array version of: {@link #stb_vorbis_open_filename open_filename} */ + @NativeType("stb_vorbis *") + public static long stb_vorbis_open_filename(@NativeType("char const *") ByteBuffer filename, @NativeType("int *") int[] error, @Nullable @NativeType("stb_vorbis_alloc const *") STBVorbisAlloc alloc_buffer) { + if (CHECKS) { + checkNT1(filename); + check(error, 1); + if (alloc_buffer != null) { STBVorbisAlloc.validate(alloc_buffer.address()); } + } + return nstb_vorbis_open_filename(memAddress(filename), error, memAddressSafe(alloc_buffer)); + } + + /** Array version of: {@link #stb_vorbis_open_filename open_filename} */ + @NativeType("stb_vorbis *") + public static long stb_vorbis_open_filename(@NativeType("char const *") CharSequence filename, @NativeType("int *") int[] error, @Nullable @NativeType("stb_vorbis_alloc const *") STBVorbisAlloc alloc_buffer) { + if (CHECKS) { + check(error, 1); + if (alloc_buffer != null) { STBVorbisAlloc.validate(alloc_buffer.address()); } + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(filename, true); + long filenameEncoded = stack.getPointerAddress(); + return nstb_vorbis_open_filename(filenameEncoded, error, memAddressSafe(alloc_buffer)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** Array version of: {@link #nstb_vorbis_get_frame_float} */ + public static native int nstb_vorbis_get_frame_float(long f, int[] channels, long output); + + /** Array version of: {@link #stb_vorbis_get_frame_float get_frame_float} */ + public static int stb_vorbis_get_frame_float(@NativeType("stb_vorbis *") long f, @Nullable @NativeType("int *") int[] channels, @NativeType("float ***") PointerBuffer output) { + if (CHECKS) { + check(f); + checkSafe(channels, 1); + check(output, 1); + } + return nstb_vorbis_get_frame_float(f, channels, memAddress(output)); + } + + /** Array version of: {@link #nstb_vorbis_get_frame_short_interleaved} */ + public static native int nstb_vorbis_get_frame_short_interleaved(long f, int num_c, short[] buffer, int num_shorts); + + /** Array version of: {@link #stb_vorbis_get_frame_short_interleaved get_frame_short_interleaved} */ + public static int stb_vorbis_get_frame_short_interleaved(@NativeType("stb_vorbis *") long f, int num_c, @NativeType("short *") short[] buffer) { + if (CHECKS) { + check(f); + } + return nstb_vorbis_get_frame_short_interleaved(f, num_c, buffer, buffer.length); + } + + /** Array version of: {@link #nstb_vorbis_get_samples_float_interleaved} */ + public static native int nstb_vorbis_get_samples_float_interleaved(long f, int channels, float[] buffer, int num_floats); + + /** Array version of: {@link #stb_vorbis_get_samples_float_interleaved get_samples_float_interleaved} */ + public static int stb_vorbis_get_samples_float_interleaved(@NativeType("stb_vorbis *") long f, int channels, @NativeType("float *") float[] buffer) { + if (CHECKS) { + check(f); + } + return nstb_vorbis_get_samples_float_interleaved(f, channels, buffer, buffer.length); + } + + /** Array version of: {@link #nstb_vorbis_get_samples_short_interleaved} */ + public static native int nstb_vorbis_get_samples_short_interleaved(long f, int channels, short[] buffer, int num_shorts); + + /** Array version of: {@link #stb_vorbis_get_samples_short_interleaved get_samples_short_interleaved} */ + public static int stb_vorbis_get_samples_short_interleaved(@NativeType("stb_vorbis *") long f, int channels, @NativeType("short *") short[] buffer) { + if (CHECKS) { + check(f); + } + return nstb_vorbis_get_samples_short_interleaved(f, channels, buffer, buffer.length); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBVorbisAlloc.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBVorbisAlloc.java new file mode 100644 index 00000000..62ecdd34 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBVorbisAlloc.java @@ -0,0 +1,314 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A buffer to use for allocations by {@link STBVorbis} + * + *

Layout

+ * + *

+ * struct stb_vorbis_alloc {
+ *     char * alloc_buffer;
+ *     int alloc_buffer_length_in_bytes;
+ * }
+ */ +@NativeType("struct stb_vorbis_alloc") +public class STBVorbisAlloc extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + ALLOC_BUFFER, + ALLOC_BUFFER_LENGTH_IN_BYTES; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + ALLOC_BUFFER = layout.offsetof(0); + ALLOC_BUFFER_LENGTH_IN_BYTES = layout.offsetof(1); + } + + /** + * Creates a {@code STBVorbisAlloc} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public STBVorbisAlloc(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns a {@link ByteBuffer} view of the data pointed to by the {@code alloc_buffer} field. */ + @NativeType("char *") + public ByteBuffer alloc_buffer() { return nalloc_buffer(address()); } + /** Returns the value of the {@code alloc_buffer_length_in_bytes} field. */ + public int alloc_buffer_length_in_bytes() { return nalloc_buffer_length_in_bytes(address()); } + + /** Sets the address of the specified {@link ByteBuffer} to the {@code alloc_buffer} field. */ + public STBVorbisAlloc alloc_buffer(@NativeType("char *") ByteBuffer value) { nalloc_buffer(address(), value); return this; } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public STBVorbisAlloc set(STBVorbisAlloc src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code STBVorbisAlloc} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static STBVorbisAlloc malloc() { + return wrap(STBVorbisAlloc.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code STBVorbisAlloc} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static STBVorbisAlloc calloc() { + return wrap(STBVorbisAlloc.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code STBVorbisAlloc} instance allocated with {@link BufferUtils}. */ + public static STBVorbisAlloc create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(STBVorbisAlloc.class, memAddress(container), container); + } + + /** Returns a new {@code STBVorbisAlloc} instance for the specified memory address. */ + public static STBVorbisAlloc create(long address) { + return wrap(STBVorbisAlloc.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static STBVorbisAlloc createSafe(long address) { + return address == NULL ? null : wrap(STBVorbisAlloc.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code STBVorbisAlloc} instance allocated on the thread-local {@link MemoryStack}. */ + public static STBVorbisAlloc mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code STBVorbisAlloc} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static STBVorbisAlloc callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code STBVorbisAlloc} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static STBVorbisAlloc mallocStack(MemoryStack stack) { + return wrap(STBVorbisAlloc.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code STBVorbisAlloc} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static STBVorbisAlloc callocStack(MemoryStack stack) { + return wrap(STBVorbisAlloc.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #alloc_buffer() alloc_buffer}. */ + public static ByteBuffer nalloc_buffer(long struct) { return memByteBuffer(memGetAddress(struct + STBVorbisAlloc.ALLOC_BUFFER), nalloc_buffer_length_in_bytes(struct)); } + /** Unsafe version of {@link #alloc_buffer_length_in_bytes}. */ + public static int nalloc_buffer_length_in_bytes(long struct) { return UNSAFE.getInt(null, struct + STBVorbisAlloc.ALLOC_BUFFER_LENGTH_IN_BYTES); } + + /** Unsafe version of {@link #alloc_buffer(ByteBuffer) alloc_buffer}. */ + public static void nalloc_buffer(long struct, ByteBuffer value) { memPutAddress(struct + STBVorbisAlloc.ALLOC_BUFFER, memAddress(value)); nalloc_buffer_length_in_bytes(struct, value.remaining()); } + /** Sets the specified value to the {@code alloc_buffer_length_in_bytes} field of the specified {@code struct}. */ + public static void nalloc_buffer_length_in_bytes(long struct, int value) { UNSAFE.putInt(null, struct + STBVorbisAlloc.ALLOC_BUFFER_LENGTH_IN_BYTES, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + STBVorbisAlloc.ALLOC_BUFFER)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link STBVorbisAlloc} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final STBVorbisAlloc ELEMENT_FACTORY = STBVorbisAlloc.create(-1L); + + /** + * Creates a new {@code STBVorbisAlloc.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link STBVorbisAlloc#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected STBVorbisAlloc getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns a {@link ByteBuffer} view of the data pointed to by the {@code alloc_buffer} field. */ + @NativeType("char *") + public ByteBuffer alloc_buffer() { return STBVorbisAlloc.nalloc_buffer(address()); } + /** Returns the value of the {@code alloc_buffer_length_in_bytes} field. */ + public int alloc_buffer_length_in_bytes() { return STBVorbisAlloc.nalloc_buffer_length_in_bytes(address()); } + + /** Sets the address of the specified {@link ByteBuffer} to the {@code alloc_buffer} field. */ + public Buffer alloc_buffer(@NativeType("char *") ByteBuffer value) { STBVorbisAlloc.nalloc_buffer(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBVorbisInfo.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBVorbisInfo.java new file mode 100644 index 00000000..1e8e2f9b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/STBVorbisInfo.java @@ -0,0 +1,315 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.stb; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Information about a Vorbis stream. + * + *

Layout

+ * + *

+ * struct stb_vorbis_info {
+ *     unsigned int sample_rate;
+ *     int channels;
+ *     unsigned int setup_memory_required;
+ *     unsigned int setup_temp_memory_required;
+ *     unsigned int temp_memory_required;
+ *     int max_frame_size;
+ * }
+ */ +@NativeType("struct stb_vorbis_info") +public class STBVorbisInfo extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + SAMPLE_RATE, + CHANNELS, + SETUP_MEMORY_REQUIRED, + SETUP_TEMP_MEMORY_REQUIRED, + TEMP_MEMORY_REQUIRED, + MAX_FRAME_SIZE; + + static { + Layout layout = __struct( + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + SAMPLE_RATE = layout.offsetof(0); + CHANNELS = layout.offsetof(1); + SETUP_MEMORY_REQUIRED = layout.offsetof(2); + SETUP_TEMP_MEMORY_REQUIRED = layout.offsetof(3); + TEMP_MEMORY_REQUIRED = layout.offsetof(4); + MAX_FRAME_SIZE = layout.offsetof(5); + } + + /** + * Creates a {@code STBVorbisInfo} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public STBVorbisInfo(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code sample_rate} field. */ + @NativeType("unsigned int") + public int sample_rate() { return nsample_rate(address()); } + /** Returns the value of the {@code channels} field. */ + public int channels() { return nchannels(address()); } + /** Returns the value of the {@code setup_memory_required} field. */ + @NativeType("unsigned int") + public int setup_memory_required() { return nsetup_memory_required(address()); } + /** Returns the value of the {@code setup_temp_memory_required} field. */ + @NativeType("unsigned int") + public int setup_temp_memory_required() { return nsetup_temp_memory_required(address()); } + /** Returns the value of the {@code temp_memory_required} field. */ + @NativeType("unsigned int") + public int temp_memory_required() { return ntemp_memory_required(address()); } + /** Returns the value of the {@code max_frame_size} field. */ + public int max_frame_size() { return nmax_frame_size(address()); } + + // ----------------------------------- + + /** Returns a new {@code STBVorbisInfo} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static STBVorbisInfo malloc() { + return wrap(STBVorbisInfo.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code STBVorbisInfo} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static STBVorbisInfo calloc() { + return wrap(STBVorbisInfo.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code STBVorbisInfo} instance allocated with {@link BufferUtils}. */ + public static STBVorbisInfo create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(STBVorbisInfo.class, memAddress(container), container); + } + + /** Returns a new {@code STBVorbisInfo} instance for the specified memory address. */ + public static STBVorbisInfo create(long address) { + return wrap(STBVorbisInfo.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static STBVorbisInfo createSafe(long address) { + return address == NULL ? null : wrap(STBVorbisInfo.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code STBVorbisInfo} instance allocated on the thread-local {@link MemoryStack}. */ + public static STBVorbisInfo mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code STBVorbisInfo} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static STBVorbisInfo callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code STBVorbisInfo} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static STBVorbisInfo mallocStack(MemoryStack stack) { + return wrap(STBVorbisInfo.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code STBVorbisInfo} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static STBVorbisInfo callocStack(MemoryStack stack) { + return wrap(STBVorbisInfo.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #sample_rate}. */ + public static int nsample_rate(long struct) { return UNSAFE.getInt(null, struct + STBVorbisInfo.SAMPLE_RATE); } + /** Unsafe version of {@link #channels}. */ + public static int nchannels(long struct) { return UNSAFE.getInt(null, struct + STBVorbisInfo.CHANNELS); } + /** Unsafe version of {@link #setup_memory_required}. */ + public static int nsetup_memory_required(long struct) { return UNSAFE.getInt(null, struct + STBVorbisInfo.SETUP_MEMORY_REQUIRED); } + /** Unsafe version of {@link #setup_temp_memory_required}. */ + public static int nsetup_temp_memory_required(long struct) { return UNSAFE.getInt(null, struct + STBVorbisInfo.SETUP_TEMP_MEMORY_REQUIRED); } + /** Unsafe version of {@link #temp_memory_required}. */ + public static int ntemp_memory_required(long struct) { return UNSAFE.getInt(null, struct + STBVorbisInfo.TEMP_MEMORY_REQUIRED); } + /** Unsafe version of {@link #max_frame_size}. */ + public static int nmax_frame_size(long struct) { return UNSAFE.getInt(null, struct + STBVorbisInfo.MAX_FRAME_SIZE); } + + // ----------------------------------- + + /** An array of {@link STBVorbisInfo} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final STBVorbisInfo ELEMENT_FACTORY = STBVorbisInfo.create(-1L); + + /** + * Creates a new {@code STBVorbisInfo.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link STBVorbisInfo#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected STBVorbisInfo getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code sample_rate} field. */ + @NativeType("unsigned int") + public int sample_rate() { return STBVorbisInfo.nsample_rate(address()); } + /** Returns the value of the {@code channels} field. */ + public int channels() { return STBVorbisInfo.nchannels(address()); } + /** Returns the value of the {@code setup_memory_required} field. */ + @NativeType("unsigned int") + public int setup_memory_required() { return STBVorbisInfo.nsetup_memory_required(address()); } + /** Returns the value of the {@code setup_temp_memory_required} field. */ + @NativeType("unsigned int") + public int setup_temp_memory_required() { return STBVorbisInfo.nsetup_temp_memory_required(address()); } + /** Returns the value of the {@code temp_memory_required} field. */ + @NativeType("unsigned int") + public int temp_memory_required() { return STBVorbisInfo.ntemp_memory_required(address()); } + /** Returns the value of the {@code max_frame_size} field. */ + public int max_frame_size() { return STBVorbisInfo.nmax_frame_size(address()); } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/stb/package-info.java b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/package-info.java new file mode 100644 index 00000000..e75ca57d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/stb/package-info.java @@ -0,0 +1,24 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ + +/** + * Contains bindings to stb, a set of single-file public domain libraries. + * + *

The functionality provided by stb includes:

+ * + *
    + *
  • Parsing TrueType files, extract glyph metrics and rendering packed font textures.
  • + *
  • Easy rendering of bitmap fonts.
  • + *
  • Reading/writing image files and resizing images (e.g. for gamma-correct MIP map creation).
  • + *
  • Decoding Ogg Vorbis audio files.
  • + *
  • Compressing DXT textures at runtime.
  • + *
  • Packing rectangular textures into texture atlases.
  • + *
  • Computing Perlin noise.
  • + *
+ */ +@org.lwjgl.system.NonnullDefault +package org.lwjgl.stb; + diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/APIUtil.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/APIUtil.java new file mode 100644 index 00000000..753a17a9 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/APIUtil.java @@ -0,0 +1,520 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import org.lwjgl.*; +import org.lwjgl.system.fcl.*; +import org.lwjgl.system.linux.*; +import org.lwjgl.system.macosx.*; +import org.lwjgl.system.windows.*; + +import javax.annotation.*; +import java.io.*; +import java.lang.reflect.*; +import java.net.*; +import java.nio.*; +import java.nio.file.*; +import java.util.*; +import java.util.function.*; +import java.util.jar.*; +import java.util.regex.*; +import java.util.stream.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.Pointer.*; + +/** + * Utility class useful to API bindings. [INTERNAL USE ONLY] + * + *

Method names in this class are prefixed with {@code api} to avoid ambiguities when used with static imports.

+ * + * @see Configuration#DEBUG_STREAM + */ +public final class APIUtil { + + /** + * The {@link PrintStream} used by LWJGL to print debug information and non-fatal errors. Defaults to {@link System#err} which can be changed with + * {@link Configuration#DEBUG_STREAM}. + */ + public static final PrintStream DEBUG_STREAM = getDebugStream(); + + @SuppressWarnings({"unchecked", "resource", "UseOfSystemOutOrSystemErr"}) + private static PrintStream getDebugStream() { + PrintStream debugStream = System.err; + + Object state = Configuration.DEBUG_STREAM.get(); + if (state instanceof String) { + try { + Supplier factory = (Supplier)Class.forName((String)state).getConstructor().newInstance(); + debugStream = factory.get(); + } catch (Exception e) { + e.printStackTrace(); + } + } else if (state instanceof Supplier) { + debugStream = ((Supplier)state).get(); + } else if (state instanceof PrintStream) { + debugStream = (PrintStream)state; + } + + return debugStream; + } + + private APIUtil() { + } + + /** + * Prints the specified message to the {@link #DEBUG_STREAM} if {@link Checks#DEBUG} is true. + * + * @param msg the message to print + */ + public static void apiLog(@Nullable CharSequence msg) { + if (DEBUG) { + DEBUG_STREAM.print("[LWJGL] "); + DEBUG_STREAM.println(msg); + } + } + + /** + * Returns the value of the specified manifest attribute in the LWJGL JAR file. + * + * @param attributeName the attribute name + * + * @return the attribute value or null if the attribute was not found or there is no LWJGL JAR file + */ + public static Optional apiGetManifestValue(String attributeName) { + URL url = APIUtil.class.getClassLoader().getResource("org/lwjgl/system/APIUtil.class"); + if (url != null) { + String classURL = url.toString(); + if (classURL.startsWith("jar:")) { + try (InputStream stream = new URL(classURL.substring(0, classURL.lastIndexOf('!') + 1) + '/' + JarFile.MANIFEST_NAME).openStream()) { + return Optional.ofNullable(new Manifest(stream).getMainAttributes().getValue(attributeName)); + } catch (Exception e) { + e.printStackTrace(DEBUG_STREAM); + } + } + } + + return Optional.empty(); + } + + public static String apiFindLibrary(String start, String name) { + String libName = Platform.get().mapLibraryName(name); + try (Stream paths = Files.find( + Paths.get(start).toAbsolutePath(), + Integer.MAX_VALUE, + (path, attributes) -> attributes.isRegularFile() && path.getFileName().toString().equals(libName) + )) { + return paths + .findFirst() + .map(Path::toString) + .orElse(name); + } catch (IOException e) { + return name; + } + } + + public static SharedLibrary apiCreateLibrary(String name) { + switch (Platform.get()) { + case WINDOWS: + return new WindowsLibrary(name); + case FCL: + return new FCLLibrary(name); + case LINUX: + return new LinuxLibrary(name); + case MACOSX: + return MacOSXLibrary.create(name); + default: + throw new IllegalStateException(); + } + } + + public static long apiGetFunctionAddress(FunctionProvider provider, String functionName) { + long a = provider.getFunctionAddress(functionName); + if (a == NULL) { + requiredFunctionMissing(functionName); + } + return a; + } + + private static void requiredFunctionMissing(String functionName) { + if (!Configuration.DISABLE_FUNCTION_CHECKS.get(false)) { + throw new NullPointerException("A required function is missing: " + functionName); + } + } + + @Nullable + public static ByteBuffer apiGetMappedBuffer(@Nullable ByteBuffer buffer, long mappedAddress, int capacity) { + if (buffer != null && memAddress(buffer) == mappedAddress && buffer.capacity() == capacity) { + return buffer; + } + return mappedAddress == NULL ? null : wrap(BUFFER_BYTE, mappedAddress, capacity).order(NATIVE_ORDER); + } + + public static long apiGetBytes(int elements, int elementShift) { + return (elements & 0xFFFF_FFFFL) << elementShift; + } + + public static long apiCheckAllocation(int elements, long bytes, long maxBytes) { + if (DEBUG) { + if (elements < 0) { + throw new IllegalArgumentException("Invalid number of elements"); + } + if ((maxBytes + Long.MIN_VALUE) < (bytes + Long.MIN_VALUE)) { // unsigned comparison + throw new IllegalArgumentException("The request allocation is too large"); + } + } + return bytes; + } + + /** A data class for API versioning information. */ + public static class APIVersion implements Comparable { + + /** Returns the API major version. */ + public final int major; + /** Returns the API minor version. */ + public final int minor; + + /** Returns the API revision. May be null. */ + @Nullable + public final String revision; + /** Returns the API implementation-specific versioning information. May be null. */ + @Nullable + public final String implementation; + + public APIVersion(int major, int minor) { + this(major, minor, null, null); + } + + public APIVersion(int major, int minor, @Nullable String revision, @Nullable String implementation) { + this.major = major; + this.minor = minor; + this.revision = revision; + this.implementation = implementation; + } + + @Override + public String toString() { + StringBuilder sb = new StringBuilder(16); + sb.append(major).append('.').append(minor); + if (revision != null) { + sb.append('.').append(revision); + } + if (implementation != null) { + sb.append(" (").append(implementation).append(')'); + } + return sb.toString(); + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof APIVersion)) { + return false; + } + + APIVersion that = (APIVersion)o; + + return this.major == that.major && + this.minor == that.major && + Objects.equals(this.revision, that.revision) && + Objects.equals(this.implementation, that.implementation); + } + + @Override + public int hashCode() { + int result = major; + result = 31 * result + minor; + result = 31 * result + (revision != null ? revision.hashCode() : 0); + result = 31 * result + (implementation != null ? implementation.hashCode() : 0); + return result; + } + + @Override + public int compareTo(APIVersion other) { + if (this.major != other.major) { + return Integer.compare(this.major, other.major); + } + + if (this.minor != other.minor) { + return Integer.compare(this.minor, other.minor); + } + + return 0; + } + } + + /** + * Returns the {@link APIVersion} value of the specified option. + * + * @param option the option to query + */ + @Nullable + public static APIVersion apiParseVersion(Configuration option) { + APIVersion version; + + Object state = option.get(); + if (state instanceof String) { + version = apiParseVersion((String)state, null); + } else if (state instanceof APIVersion) { + version = (APIVersion)state; + } else { + version = null; + } + + return version; + } + + /** + * Parses a version string. The version string must have the format {@code MAJOR.MINOR.REVISION IMPL}, where {@code MAJOR} is the major version (integer), + * {@code MINOR} is the minor version (integer), {@code REVISION} is the revision version (string, optional) and {@code IMPL} is implementation-specific + * information (string, optional). + * + * @param version the API version string + * + * @return the parsed {@link APIVersion} + */ + public static APIVersion apiParseVersion(String version) { + return apiParseVersion(version, null); + } + + /** + * Parses a version string. The version string must have the format {@code PREFIX MAJOR.MINOR.REVISION IMPL}, where {@code PREFIX} is the specified prefix + * (string, optional), {@code MAJOR} is the major version (integer), {@code MINOR} is the minor version (integer), {@code REVISION} is the revision version + * (string, optional) and {@code IMPL} is implementation-specific information (string, optional). + * + * @param version the version string + * @param prefix the version string prefix, may be null + * + * @return the parsed {@link APIVersion} + */ + public static APIVersion apiParseVersion(String version, @Nullable String prefix) { + String pattern = "([0-9]+)[.]([0-9]+)([.]\\S+)?\\s*(.+)?"; + if (prefix != null) { + pattern = "(?:" + prefix + "\\s+)?" + pattern; + } + + Matcher matcher = Pattern.compile(pattern).matcher(version); + if (!matcher.matches()) { + throw new IllegalArgumentException(String.format("Malformed API version string [%s]", version)); + } + + return new APIVersion( + Integer.parseInt(matcher.group(1)), + Integer.parseInt(matcher.group(2)), + matcher.group(3), + matcher.group(4) + ); + } + + public static String apiUnknownToken(int token) { + return apiUnknownToken("Unknown", token); + } + + public static String apiUnknownToken(String description, int token) { + return String.format("%s [0x%X]", description, token); + } + + /** + * Returns a map of public static final integer fields in the specified classes, to their String representations. An optional filter can be specified to + * only include specific fields. The target map may be null, in which case a new map is allocated and returned. + * + *

This method is useful when debugging to quickly identify values returned from an API.

+ * + * @param filter the filter to use (optional) + * @param target the target map (optional) + * @param tokenClasses the classes to get tokens from + * + * @return the token map + */ + public static Map apiClassTokens(@Nullable BiPredicate filter, @Nullable Map target, Class... tokenClasses) { + if (target == null) { + //noinspection AssignmentToMethodParameter + target = new HashMap<>(64); + } + + int TOKEN_MODIFIERS = Modifier.PUBLIC | Modifier.STATIC | Modifier.FINAL; + + for (Class tokenClass : tokenClasses) { + if (tokenClass == null) { + continue; + } + + for (Field field : tokenClass.getDeclaredFields()) { + // Get only fields. + if ((field.getModifiers() & TOKEN_MODIFIERS) == TOKEN_MODIFIERS && field.getType() == int.class) { + try { + Integer value = field.getInt(null); + if (filter != null && !filter.test(field, value)) { + continue; + } + + String name = target.get(value); + target.put(value, name == null ? field.getName() : name + "|" + field.getName()); + } catch (IllegalAccessException e) { + // Ignore + } + } + } + } + + return target; + } + + // ---------------------------------------- + + /** + * Stores the specified array of pointer addresses on the specified {@link MemoryStack}. + * + * @param stack the stack to use + * @param addresses the pointer addresses to store + * + * @return the pointer array address on the stack + */ + public static long apiArray(MemoryStack stack, long... addresses) { + PointerBuffer pointers = memPointerBuffer(stack.nmalloc(POINTER_SIZE, addresses.length << POINTER_SHIFT), addresses.length); + + for (long address : addresses) { + pointers.put(address); + } + + return pointers.address; + } + + /** + * Stores the addresses of the specified array of buffers on the specified {@link MemoryStack}. + * + * @param stack the stack to use + * @param buffers the buffers to store + * + * @return the pointer array address on the stack + */ + public static long apiArray(MemoryStack stack, ByteBuffer... buffers) { + PointerBuffer pointers = memPointerBuffer(stack.nmalloc(POINTER_SIZE, buffers.length << POINTER_SHIFT), buffers.length); + + for (ByteBuffer buffer : buffers) { + pointers.put(buffer); + } + + return pointers.address; + } + + /** + * Stores the addresses of the specified array of buffers on the specified {@link MemoryStack}. A second array that contains the buffer remaining bytes is + * stored immediately after the pointer array. Length values are pointer-sized integers. + * + * @param stack the stack to use + * @param buffers the buffers to store + * + * @return the pointer array address on the stack + */ + public static long apiArrayp(MemoryStack stack, ByteBuffer... buffers) { + long pointers = apiArray(stack, buffers); + + PointerBuffer lengths = stack.mallocPointer(buffers.length); + for (ByteBuffer buffer : buffers) { + lengths.put(buffer.remaining()); + } + + return pointers; + } + + // ---------------------------------------- + + public interface Encoder { + ByteBuffer encode(CharSequence text, boolean nullTerminated); + } + + /** + * Encodes the specified strings with the specified {@link Encoder} and stores an array of pointers to the encoded data on the specified + * {@link MemoryStack}. The encoded strings include null-termination. + * + * @param stack the stack to use + * @param encoder the encoder to use + * @param strings the strings to encode + * + * @return the pointer array address on the stack + */ + public static long apiArray(MemoryStack stack, Encoder encoder, CharSequence... strings) { + PointerBuffer pointers = stack.mallocPointer(strings.length); + + for (CharSequence s : strings) { + pointers.put(encoder.encode(s, true)); + } + + return pointers.address; + } + + /** + * Encodes the specified strings with the specified {@link Encoder} and stores an array of pointers to the encoded data on the specified + * {@link MemoryStack}. A second array that contains the string lengths is stored immediately after the pointer array. Length values are 4-byte integers. + * + *

The encoded buffers must be freed with {@link #apiArrayFree}.

+ * + * @param stack the stack to use + * @param encoder the encoder to use + * @param strings the strings to encode + * + * @return the pointer array address on the stack + */ + public static long apiArrayi(MemoryStack stack, Encoder encoder, CharSequence... strings) { + // Alignment rules guarantee these two will be contiguous + PointerBuffer pointers = stack.mallocPointer(strings.length); + IntBuffer lengths = stack.mallocInt(strings.length); + + for (CharSequence s : strings) { + ByteBuffer buffer = encoder.encode(s, false); + + pointers.put(buffer); + lengths.put(buffer.capacity()); + } + + return pointers.address; + } + + /** + * Encodes the specified strings with the specified {@link Encoder} and stores an array of pointers to the encoded data on the specified + * {@link MemoryStack}. A second array that contains the string lengths is stored immediately after the pointer array. Length values are pointer-sized + * integers. + * + *

The encoded buffers must be freed with {@link #apiArrayFree}.

+ * + * @param stack the stack to use + * @param encoder the encoder to use + * @param strings the strings to encode + * + * @return the pointer array address on the stack + */ + public static long apiArrayp(MemoryStack stack, Encoder encoder, CharSequence... strings) { + PointerBuffer pointers = stack.mallocPointer(strings.length); + PointerBuffer lengths = stack.mallocPointer(strings.length); + + for (CharSequence s : strings) { + ByteBuffer buffer = encoder.encode(s, false); + + pointers.put(buffer); + lengths.put(buffer.capacity()); + } + + return pointers.address; + } + + /** + * Frees the specified array of pointers. + * + * @param pointers the pointer array to free + * @param length the pointer array length + */ + public static void apiArrayFree(long pointers, int length) { + for (int i = length; --i >= 0; ) { + nmemFree(memGetAddress(pointers + Integer.toUnsignedLong(i) * POINTER_SIZE)); + } + } + + // ---------------------------------------- + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/Callback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/Callback.java new file mode 100644 index 00000000..f1688e1a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/Callback.java @@ -0,0 +1,223 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import org.lwjgl.*; + +import javax.annotation.*; +import java.lang.reflect.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.dyncall.DynCallback.*; +import static org.lwjgl.system.jni.JNINativeInterface.*; + +/** + * Base class for dynamically created native functions that call into Java code. + * + *

Callback instances use native resources and must be explicitly freed when no longer used by calling the {@link #free} method.

+ */ +public abstract class Callback implements Pointer, NativeResource { + + private static final boolean DEBUG_ALLOCATOR = Configuration.DEBUG_MEMORY_ALLOCATOR.get(false); + + private static final long + VOID, + BOOLEAN, + BYTE, + SHORT, + INT, + LONG, + CLONG, + FLOAT, + DOUBLE, + PTR; + + static { + // Setup native callbacks + try (MemoryStack stack = stackPush()) { + Class[] params = new Class[] {long.class}; + + Method[] methods = { + CallbackI.V.class.getDeclaredMethod("callback", params), + CallbackI.Z.class.getDeclaredMethod("callback", params), + CallbackI.B.class.getDeclaredMethod("callback", params), + CallbackI.S.class.getDeclaredMethod("callback", params), + CallbackI.I.class.getDeclaredMethod("callback", params), + CallbackI.J.class.getDeclaredMethod("callback", params), + CallbackI.N.class.getDeclaredMethod("callback", params), + CallbackI.F.class.getDeclaredMethod("callback", params), + CallbackI.D.class.getDeclaredMethod("callback", params), + CallbackI.P.class.getDeclaredMethod("callback", params) + }; + + PointerBuffer callbacks = stack.mallocPointer(methods.length); + + getNativeCallbacks(methods, memAddress(callbacks)); + + VOID = callbacks.get(); + BOOLEAN = callbacks.get(); + BYTE = callbacks.get(); + SHORT = callbacks.get(); + INT = callbacks.get(); + LONG = callbacks.get(); + CLONG = callbacks.get(); + FLOAT = callbacks.get(); + DOUBLE = callbacks.get(); + PTR = callbacks.get(); + } catch (Exception e) { + throw new IllegalStateException("Failed to initialize native callbacks.", e); + } + + MemoryUtil.getAllocator(); + } + + private long address; + + /** + * Creates a callback instance using the specified dyncall signature + * + * @param signature the dyncall signature + */ + protected Callback(String signature) { + this.address = create(signature, this); + } + + /** + * Creates a callback instance using the specified function address + * + * @param address the function address + */ + protected Callback(long address) { + if (CHECKS) { + check(address); + } + this.address = address; + } + + @Override + public long address() { + return address; + } + + @Override + public void free() { + free(address()); + } + + private static native long getNativeCallbacks(Method[] methods, long callbacks); + + public static String __stdcall(String signature) { + return Platform.get() == Platform.WINDOWS && Pointer.BITS32 ? "_s" + signature : signature; + } + + /** + * Creates a native function that delegates to the specified instance when called. + * + *

The native function uses the default calling convention.

+ * + * @param signature the {@code dyncall} function signature + * @param instance the callback instance + * + * @return the dynamically generated native function + */ + static long create(String signature, Object instance) { + long funcptr = getNativeFunction(signature.charAt(signature.length() - 1)); + + long handle = dcbNewCallback(signature, funcptr, NewGlobalRef(instance)); + if (handle == NULL) { + throw new IllegalStateException("Failed to create the DCCallback object"); + } + + if (DEBUG_ALLOCATOR) { + MemoryManage.DebugAllocator.track(handle, 2L * POINTER_SIZE); + } + + return handle; + } + + private static long getNativeFunction(char type) { + switch (type) { + case 'v': + return VOID; + case 'B': + return BOOLEAN; + case 'c': + return BYTE; + case 's': + return SHORT; + case 'i': + return INT; + case 'l': + return LONG; + case 'j': + return CLONG; + case 'p': + return PTR; + case 'f': + return FLOAT; + case 'd': + return DOUBLE; + default: + throw new IllegalArgumentException(); + } + } + + /** + * Converts the specified function pointer to the {@code CallbackI} instance associated with it. + * + * @param functionPointer a function pointer + * @param the {@code CallbackI} instance type + * + * @return the {@code CallbackI} instance + */ + public static T get(long functionPointer) { + return memGlobalRefToObject(dcbGetUserData(functionPointer)); + } + + /** Like {@link #get}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static T getSafe(long functionPointer) { + return functionPointer == NULL ? null : get(functionPointer); + } + + /** + * Frees any resources held by the specified function pointer. + * + * @param functionPointer the function pointer + */ + public static void free(long functionPointer) { + if (DEBUG_ALLOCATOR) { + MemoryManage.DebugAllocator.untrack(functionPointer); + } + + DeleteGlobalRef(dcbGetUserData(functionPointer)); + dcbFreeCallback(functionPointer); + } + + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (!(o instanceof Callback)) { + return false; + } + + Callback that = (Callback)o; + + return address == that.address(); + } + + public int hashCode() { + return (int)(address ^ (address >>> 32)); + } + + @Override + public String toString() { + return String.format("%s pointer [0x%X]", getClass().getSimpleName(), address); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/CallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/CallbackI.java new file mode 100644 index 00000000..19906a0a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/CallbackI.java @@ -0,0 +1,156 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +/** + *

Base interface for dynamically created native functions that call into Java code. Pointers to such functions can be passed to native APIs as callbacks.

+ * + *

This interface does not define a callback method, therefore it should not be implemented directly. The following inner interfaces should be used instead:

+ *
    + *
  • {@link V}
  • + *
  • {@link Z}
  • + *
  • {@link B}
  • + *
  • {@link S}
  • + *
  • {@link I}
  • + *
  • {@link J}
  • + *
  • {@link F}
  • + *
  • {@link D}
  • + *
  • {@link P}
  • + *
+ */ +public interface CallbackI extends Pointer { + + /** + * Returns the dyncall signature for this callback function. [INTERNAL API] + * + * @return the dyncall signature + */ + String getSignature(); + + @Override + default long address() { + return Callback.create(getSignature(), this); + } + + /** A {@code Callback} with no return value. */ + interface V extends CallbackI { + /** + * Will be called by native code. + * + * @param args pointer to a {@code DCArgs} iterator + */ + void callback(long args); + } + + /** A {@code Callback} that returns a boolean value. */ + interface Z extends CallbackI { + /** + * Will be called by native code. + * + * @param args pointer to a {@code DCArgs} iterator + * + * @return the value to store to the result {@code DCValue} + */ + boolean callback(long args); + } + + /** A {@code Callback} that returns a byte value. */ + interface B extends CallbackI { + /** + * Will be called by native code. + * + * @param args pointer to a {@code DCArgs} iterator + * + * @return the value to store to the result {@code DCValue} + */ + byte callback(long args); + } + + /** A {@code Callback} that returns a short value. */ + interface S extends CallbackI { + /** + * Will be called by native code. + * + * @param args pointer to a {@code DCArgs} iterator + * + * @return the value to store to the result {@code DCValue} + */ + short callback(long args); + } + + /** A {@code Callback} that returns an int value. */ + interface I extends CallbackI { + /** + * Will be called by native code. + * + * @param args pointer to a {@code DCArgs} iterator + * + * @return the value to store to the result {@code DCValue} + */ + int callback(long args); + } + + /** A {@code Callback} that returns a long value. */ + interface J extends CallbackI { + /** + * Will be called by native code. + * + * @param args pointer to a {@code DCArgs} iterator + * + * @return the value to store to the result {@code DCValue} + */ + long callback(long args); + } + + /** A {@code Callback} that returns a C long value. */ + interface N extends CallbackI { + /** + * Will be called by native code. + * + * @param args pointer to a {@code DCArgs} iterator + * + * @return the value to store to the result {@code DCValue} + */ + long callback(long args); + } + + /** A {@code Callback} that returns a float value. */ + interface F extends CallbackI { + /** + * Will be called by native code. + * + * @param args pointer to a {@code DCArgs} iterator + * + * @return the value to store to the result {@code DCValue} + */ + float callback(long args); + } + + /** A {@code Callback} that returns a double value. */ + interface D extends CallbackI { + /** + * Will be called by native code. + * + * @param args pointer to a {@code DCArgs} iterator + * + * @return the value to store to the result {@code DCValue} + */ + double callback(long args); + } + + /** A {@code Callback} that returns a pointer value. */ + interface P extends CallbackI { + /** + * Will be called by native code. + * + * @param args pointer to a {@code DCArgs} iterator + * + * @return the value to store to the result {@code DCValue} + */ + long callback(long args); + } + +} + diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/CheckIntrinsics.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/CheckIntrinsics.java new file mode 100644 index 00000000..1aa3f14b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/CheckIntrinsics.java @@ -0,0 +1,38 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +/** + * Simple index checks. + * + *

On Java 9 these checks are replaced with the corresponding {@link java.util.Objects} methods, which perform better.

+ */ +public final class CheckIntrinsics { + + private CheckIntrinsics() { + } + + public static int checkIndex(int index, int length) { + if (index < 0 || length <= index) { + throw new IndexOutOfBoundsException(); + } + return index; + } + + public static int checkFromToIndex(int fromIndex, int toIndex, int length) { + if (fromIndex < 0 || toIndex < fromIndex || length < toIndex) { + throw new IndexOutOfBoundsException(); + } + return fromIndex; + } + + public static int checkFromIndexSize(int fromIndex, int size, int length) { + if ((length | fromIndex | size) < 0 || length - fromIndex < size) { + throw new IndexOutOfBoundsException(); + } + return fromIndex; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/Checks.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/Checks.java new file mode 100644 index 00000000..3f161a4e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/Checks.java @@ -0,0 +1,464 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import org.lwjgl.*; + +import javax.annotation.*; +import java.nio.*; + +import static org.lwjgl.system.CheckIntrinsics.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A class to check buffer boundaries in general. If there is insufficient space in the buffer when the call is made then a buffer overflow would otherwise + * occur and cause unexpected behaviour, a crash, or worse, a security risk. + * + *

Internal class, don't use.

+ * + * @see Configuration#DISABLE_CHECKS + * @see Configuration#DEBUG + * @see Configuration#DEBUG_FUNCTIONS + */ +public final class Checks { + + /** + * Runtime checks flag. + * + *

When enabled, LWJGL will perform basic checks during its operation, mainly to avoid crashes in native code. Examples of such checks are: + * context-specific function address validation, buffer capacity checks, null-termination checks, etc. These checks are generally low-overhead and should + * not have a measurable effect on performance, so its recommended to have them enabled both during development and in production releases.

+ * + *

If maximum performance is required, they can be disabled by setting {@link Configuration#DISABLE_CHECKS} to true.

+ */ + public static final boolean CHECKS = !Configuration.DISABLE_CHECKS.get(false); + + /** + * Debug mode flag. + * + *

When enabled, LWJGL will perform additional checks during its operation. These checks are more expensive than the ones enabled with {@link #CHECKS} + * and will have a noticeable effect on performance, so they are disabled by default. Examples of such checks are: buffer object binding state check (GL), + * buffer capacity checks for texture images (GL & CL), etc. LWJGL will also print additional information, mainly during start-up.

+ * + *

Can be enabled by setting {@link Configuration#DEBUG} to true.

+ */ + public static final boolean DEBUG = Configuration.DEBUG.get(false); + + /** + * Debug functions flag. + * + *

When enabled, capabilities classes will print an error message when they fail to retrieve a function pointer.

+ * + *

Can be enabled by setting {@link Configuration#DEBUG_FUNCTIONS} to true.

+ */ + public static final boolean DEBUG_FUNCTIONS = Configuration.DEBUG_FUNCTIONS.get(false); + + static { + if (DEBUG_FUNCTIONS && !DEBUG) { + APIUtil.DEBUG_STREAM.println("[LWJGL] The DEBUG_FUNCTIONS option requires DEBUG to produce output."); + } + } + + private Checks() { + } + + public static int lengthSafe(@Nullable short[] array) { return array == null ? 0 : array.length;} + public static int lengthSafe(@Nullable int[] array) { return array == null ? 0 : array.length;} + public static int lengthSafe(@Nullable long[] array) { return array == null ? 0 : array.length; } + public static int lengthSafe(@Nullable float[] array) { return array == null ? 0 : array.length;} + public static int lengthSafe(@Nullable double[] array) { return array == null ? 0 : array.length;} + public static int remainingSafe(@Nullable Buffer buffer) { return buffer == null ? 0 : buffer.remaining(); } + public static int remainingSafe(@Nullable CustomBuffer buffer) { return buffer == null ? 0 : buffer.remaining(); } + + /** + * Checks if any of the specified functions pointers is {@code NULL}. + * + * @param functions the function pointers to check + * + * @return true if all function pointers are valid, false otherwise. + */ + public static boolean checkFunctions(long... functions) { + for (long pointer : functions) { + if (pointer == NULL) { + return false; + } + } + return true; + } + + /** + * Ensures that the specified pointer is not {@code NULL} (0L). + * + * @param pointer the pointer to check + * + * @throws NullPointerException if {@code pointer} is {@code NULL} + */ + public static long check(long pointer) { + if (pointer == NULL) { + throw new NullPointerException(); + } + + return pointer; + } + + private static void assertNT(boolean found) { + if (!found) { + throw new IllegalArgumentException("Missing termination"); + } + } + + /** Ensures that the specified array is null-terminated. */ + public static void checkNT(int[] buf) { + checkBuffer(buf.length, 1); + assertNT(buf[buf.length - 1] == 0); + } + + /** Ensures that the specified array is terminated with the specified terminator. */ + public static void checkNT(int[] buf, int terminator) { + checkBuffer(buf.length, 1); + assertNT(buf[buf.length - 1] == terminator); + } + + /** Ensures that the specified array is null-terminated. */ + public static void checkNT(long[] buf) { + checkBuffer(buf.length, 1); + assertNT(buf[buf.length - 1] == NULL); + } + + /** Ensures that the specified array is null-terminated. */ + public static void checkNT(float[] buf) { + checkBuffer(buf.length, 1); + assertNT(buf[buf.length - 1] == 0.0f); + } + + /** Ensures that the specified ByteBuffer is null-terminated (last byte equal to 0). */ + public static void checkNT1(ByteBuffer buf) { + checkBuffer(buf.remaining(), 1); + assertNT(buf.get(buf.limit() - 1) == 0); + } + + /** Ensures that the specified ByteBuffer is null-terminated (last 2 bytes equal to 0). */ + public static void checkNT2(ByteBuffer buf) { + checkBuffer(buf.remaining(), 2); + assertNT(buf.get(buf.limit() - 2) == 0); + } + + /** Ensures that the specified IntBuffer is null-terminated. */ + public static void checkNT(IntBuffer buf) { + checkBuffer(buf.remaining(), 1); + assertNT(buf.get(buf.limit() - 1) == 0); + } + + /** Ensures that the specified IntBuffer is terminated with the specified terminator. */ + public static void checkNT(IntBuffer buf, int terminator) { + checkBuffer(buf.remaining(), 1); + assertNT(buf.get(buf.limit() - 1) == terminator); + } + + /** Ensures that the specified LongBuffer is null-terminated. */ + public static void checkNT(LongBuffer buf) { + checkBuffer(buf.remaining(), 1); + assertNT(buf.get(buf.limit() - 1) == NULL); + } + + /** Ensures that the specified FloatBuffer is null-terminated. */ + public static void checkNT(FloatBuffer buf) { + checkBuffer(buf.remaining(), 1); + assertNT(buf.get(buf.limit() - 1) == 0.0f); + } + + /** Ensures that the specified PointerBuffer is null-terminated. */ + public static void checkNT(PointerBuffer buf) { + checkBuffer(buf.remaining(), 1); + assertNT(buf.get(buf.limit() - 1) == NULL); + } + + /** Ensures that the specified PointerBuffer is terminated with the specified terminator. */ + public static void checkNT(PointerBuffer buf, long terminator) { + checkBuffer(buf.remaining(), 1); + assertNT(buf.get(buf.limit() - 1) == terminator); + } + + public static void checkNTSafe(@Nullable int[] buf) { + if (buf != null) { + checkBuffer(buf.length, 1); + assertNT(buf[buf.length - 1] == 0); + } + } + public static void checkNTSafe(@Nullable int[] buf, int terminator) { + if (buf != null) { + checkBuffer(buf.length, 1); + assertNT(buf[buf.length - 1] == terminator); + } + } + public static void checkNTSafe(@Nullable long[] buf) { + if (buf != null) { + checkBuffer(buf.length, 1); + assertNT(buf[buf.length - 1] == NULL); + } + } + public static void checkNTSafe(@Nullable float[] buf) { + if (buf != null) { + checkBuffer(buf.length, 1); + assertNT(buf[buf.length - 1] == 0.0f); + } + } + public static void checkNT1Safe(@Nullable ByteBuffer buf) { + if (buf != null) { + checkBuffer(buf.remaining(), 1); + assertNT(buf.get(buf.limit() - 1) == 0); + } + } + public static void checkNT2Safe(@Nullable ByteBuffer buf) { + if (buf != null) { + checkBuffer(buf.remaining(), 2); + assertNT(buf.get(buf.limit() - 2) == 0); + } + } + public static void checkNTSafe(@Nullable IntBuffer buf) { + if (buf != null) { + checkBuffer(buf.remaining(), 1); + assertNT(buf.get(buf.limit() - 1) == 0); + } + } + public static void checkNTSafe(@Nullable IntBuffer buf, int terminator) { + if (buf != null) { + checkBuffer(buf.remaining(), 1); + assertNT(buf.get(buf.limit() - 1) == terminator); + } + } + public static void checkNTSafe(@Nullable LongBuffer buf) { + if (buf != null) { + checkBuffer(buf.remaining(), 1); + assertNT(buf.get(buf.limit() - 1) == NULL); + } + } + public static void checkNTSafe(@Nullable FloatBuffer buf) { + if (buf != null) { + checkBuffer(buf.remaining(), 1); + assertNT(buf.get(buf.limit() - 1) == 0.0f); + } + } + public static void checkNTSafe(@Nullable PointerBuffer buf) { + if (buf != null) { + checkBuffer(buf.remaining(), 1); + assertNT(buf.get(buf.limit() - 1) == NULL); + } + } + public static void checkNTSafe(@Nullable PointerBuffer buf, long terminator) { + if (buf != null) { + checkBuffer(buf.remaining(), 1); + assertNT(buf.get(buf.limit() - 1) == terminator); + } + } + + private static void checkBuffer(int bufferSize, int minimumSize) { + if (bufferSize < minimumSize) { + throwIAE(bufferSize, minimumSize); + } + } + + /** + * Helper method to ensure a array has enough capacity. + * + * @param buf the array to check + * @param size the minimum array capacity + * + * @throws IllegalArgumentException if {@code buf.length < size} + */ + public static void check(byte[] buf, int size) { + checkBuffer(buf.length, size); + } + + /** + * Helper method to ensure a array has enough capacity. + * + * @param buf the array to check + * @param size the minimum array capacity + * + * @throws IllegalArgumentException if {@code buf.length < size} + */ + public static void check(short[] buf, int size) { + checkBuffer(buf.length, size); + } + + /** + * Helper method to ensure a array has enough capacity. + * + * @param buf the array to check + * @param size the minimum array capacity + * + * @throws IllegalArgumentException if {@code buf.length < size} + */ + public static void check(int[] buf, int size) { + checkBuffer(buf.length, size); + } + + /** + * Helper method to ensure a array has enough capacity. + * + * @param buf the array to check + * @param size the minimum array capacity + * + * @throws IllegalArgumentException if {@code buf.length < size} + */ + public static void check(long[] buf, int size) { + checkBuffer(buf.length, size); + } + + /** + * Helper method to ensure a array has enough capacity. + * + * @param buf the array to check + * @param size the minimum array capacity + * + * @throws IllegalArgumentException if {@code buf.length < size} + */ + public static void check(float[] buf, int size) { + checkBuffer(buf.length, size); + } + + /** + * Helper method to ensure a array has enough capacity. + * + * @param buf the array to check + * @param size the minimum array capacity + * + * @throws IllegalArgumentException if {@code buf.length < size} + */ + public static void check(double[] buf, int size) { + checkBuffer(buf.length, size); + } + + /** + * Helper method to ensure a CharSequence has enough characters. + * + * @param text the text to check + * @param size the minimum number of characters + * + * @throws IllegalArgumentException if {@code text.length() < size} + */ + public static void check(CharSequence text, int size) { + checkBuffer(text.length(), size); + } + + /** + * Helper method to ensure a buffer has enough capacity. + * + * @param buf the buffer to check + * @param size the minimum buffer capacity + * + * @throws IllegalArgumentException if {@code buf.remaining() < size} + */ + public static void check(Buffer buf, int size) { + checkBuffer(buf.remaining(), size); + } + + /** @see #check(Buffer, int) */ + public static void check(Buffer buf, long size) { + checkBuffer(buf.remaining(), (int)size); + } + + /** + * Helper method to ensure a {@link CustomBuffer} has enough capacity. + * + * @param buf the buffer to check + * @param size the minimum buffer capacity + * + * @throws IllegalArgumentException if {@code buf.remaining() < size} + */ + public static void check(CustomBuffer buf, int size) { + checkBuffer(buf.remaining(), size); + } + + /** @see #check(CustomBuffer, int) */ + public static void check(CustomBuffer buf, long size) { + checkBuffer(buf.remaining(), (int)size); + } + + public static void checkSafe(@Nullable short[] buf, int size) { + if (buf != null) { + checkBuffer(buf.length, size); + } + } + public static void checkSafe(@Nullable int[] buf, int size) { + if (buf != null) { + checkBuffer(buf.length, size); + } + } + public static void checkSafe(@Nullable long[] buf, int size) { + if (buf != null) { + checkBuffer(buf.length, size); + } + } + public static void checkSafe(@Nullable float[] buf, int size) { + if (buf != null) { + checkBuffer(buf.length, size); + } + } + public static void checkSafe(@Nullable double[] buf, int size) { + if (buf != null) { + checkBuffer(buf.length, size); + } + } + public static void checkSafe(@Nullable Buffer buf, int size) { + if (buf != null) { + checkBuffer(buf.remaining(), size); + } + } + public static void checkSafe(@Nullable Buffer buf, long size) { + if (buf != null) { + checkBuffer(buf.remaining(), (int)size); + } + } + public static void checkSafe(@Nullable CustomBuffer buf, int size) { + if (buf != null) { + checkBuffer(buf.remaining(), size); + } + } + public static void checkSafe(@Nullable CustomBuffer buf, long size) { + if (buf != null) { + checkBuffer(buf.remaining(), (int)size); + } + } + + public static void check(Object[] array, int size) { + checkBuffer(array.length, size); + } + + private static void checkBufferGT(int bufferSize, int maximumSize) { + if (maximumSize < bufferSize) { + throwIAEGT(bufferSize, maximumSize); + } + } + + public static void checkGT(Buffer buf, int size) { + checkBufferGT(buf.remaining(), size); + } + + public static void checkGT(CustomBuffer buf, int size) { + checkBufferGT(buf.remaining(), size); + } + + public static long check(int index, int length) { + if (CHECKS) { + checkIndex(index, length); + } + // Convert to long to support addressing up to 2^31-1 elements, regardless of sizeof(element). + // The unsigned conversion helps the JIT produce code that is as fast as if int was returned. + return Integer.toUnsignedLong(index); + } + + // Separate calls to help inline check. + + private static void throwIAE(int bufferSize, int minimumSize) { + throw new IllegalArgumentException("Number of remaining elements is " + bufferSize + ", must be at least " + minimumSize); + } + + private static void throwIAEGT(int bufferSize, int maximumSize) { + throw new IllegalArgumentException("Number of remaining buffer elements is " + bufferSize + ", must be at most " + maximumSize); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/Configuration.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/Configuration.java new file mode 100644 index 00000000..41a9de8a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/Configuration.java @@ -0,0 +1,526 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import org.lwjgl.system.MemoryUtil.*; + +import javax.annotation.*; +import java.io.*; +import java.util.function.*; + +/** + * This class can be used to programmatically set the LWJGL runtime configuration. It is an alternative to using system properties. + * + *

Care must be taken when setting static options. Such options are only read once or cached in {@code static final} fields. They must be + * configured through this class before touching any other LWJGL class.

+ */ +public class Configuration { + + /** + * Takes priority over {@code java.library.path}. It may contain one or more directory paths, separated by {@link File#pathSeparator}. + * + *

+ * Property: org.lwjgl.librarypath
+ *    Usage: Dynamic
+ */ + public static final Configuration LIBRARY_PATH = new Configuration<>("org.lwjgl.librarypath", StateInit.STRING); + + /** + * Sets the mapping algorithm used to resolve the name of bundled shared libraries. Supported values: + * + *

    + *
  • default - Maps {@code } to {@code }.
  • + *
  • legacy - Maps {@code } to {@code is64bit(arch) ? : 32}.
  • + *
  • <classpath> - A class that implements the {@link Function Function<String, String>} interface. It will be instantiated using reflection.
  • + *
+ * + *

When set programmatically, it can also be a {@link Function Function<String, String>} instance.

+ * + *

+ * Property: org.lwjgl.system.bundledLibrary.nameMapper
+ *     Type: String or a {@link Function Function<String, String>} instance
+ *    Usage: Static

+ */ + public static final Configuration BUNDLED_LIBRARY_NAME_MAPPER = + new Configuration<>("org.lwjgl.system.bundledLibrary.nameMapper", StateInit.STRING); + + /** + * Sets the mapping algorithm used to resolve bundled shared libraries in the classpath/modulepath. Supported values: + * + *
    + *
  • default - Maps {@code } to {@code /}.
  • + *
  • legacy - Maps {@code } to {@code }.
  • + *
  • <classpath> - A class that implements the {@link Function Function<String, String>} interface. It will be instantiated using reflection.
  • + *
+ * + *

When set programmatically, it can also be a {@link Function Function<String, String>} instance.

+ * + *

+ * Property: org.lwjgl.system.bundledLibrary.nameMapper
+ *     Type: String or a {@link Function Function<String, String>} instance
+ *    Usage: Static

+ */ + public static final Configuration BUNDLED_LIBRARY_PATH_MAPPER = + new Configuration<>("org.lwjgl.system.bundledLibrary.pathMapper", StateInit.STRING); + + /** + * Changes the temporary directory name created by LWJGL when extracting shared libraries from JAR files. If this option is not set, it defaults to + * lwjgl<user name>. + * + *

+ * Property: org.lwjgl.system.SharedLibraryExtractDirectory
+ *    Usage: Dynamic
+ */ + public static final Configuration SHARED_LIBRARY_EXTRACT_DIRECTORY = new Configuration<>( + "org.lwjgl.system.SharedLibraryExtractDirectory", + StateInit.STRING + ); + + /** + * Changes the path where LWJGL extracts shared libraries from JAR files. If this option is not set, LWJGL will try the following paths and the first + * successful will be used: + * + *

    + *
  • {@code System.getProperty("java.io.tmpdir")}/extractDir/version/
  • + *
  • {@code System.getProperty("user.home")}/.extractDir/version/
  • + *
  • .extractDir/version/
  • + *
  • {@code Files.createTempFile("lwjgl", "")}
  • + *
+ * + * where: + * + *

+     * extractDir = Configuration.SHARED_LIBRARY_EXTRACT_DIRECTORY
+     * version = Version.getVersion().replace(' ', '-')
+     * 
+ * + *

+ * Property: org.lwjgl.system.SharedLibraryExtractPath
+ *    Usage: Dynamic

+ */ + public static final Configuration SHARED_LIBRARY_EXTRACT_PATH = new Configuration<>( + "org.lwjgl.system.SharedLibraryExtractPath", + StateInit.STRING + ); + + /** + * EXPERIMENTAL: Emulates {@link System#loadLibrary} behavior in {@link Library#loadNative}. + * + *

+ * Property: org.lwjgl.system.EmulateSystemLoadLibrary
+ *    Usage: Dynamic

+ */ + public static final Configuration EMULATE_SYSTEM_LOADLIBRARY = new Configuration<>( + "org.lwjgl.system.EmulateSystemLoadLibrary", + StateInit.BOOLEAN + ); + + /** + * Can be used to override the LWJGL library name. It can be an absolute path. + * + *

+ * Property: org.lwjgl.libname
+ *    Usage: Dynamic

+ */ + public static final Configuration LIBRARY_NAME = new Configuration<>("org.lwjgl.libname", StateInit.STRING); + + /** + * Sets the allocator used for the {@link MemoryUtil} explicit memory management API + * ({@link MemoryUtil#memAlloc memAlloc}/{@link MemoryUtil#memFree memFree}/etc). Supported values: + * + *
    + *
  • jemalloc - The allocator provided by the jemalloc library
  • + *
  • rpmalloc - The allocator provided by the rpmalloc library.
    + *

    LWJGL calls {@code rpmalloc_initialize} once, when the allocator is + * created. It never calls {@code rpmalloc_finalize}. The user is responsible for calling {@code rpmalloc_thread_initialize} and + * {@code rpmalloc_thread_finalize} when appropriate.

  • + *
  • system - The default system memory allocator
  • + *
  • <classpath> - A class that implements the {@link MemoryAllocator MemoryAllocator} interface. It will be instantiated using reflection.
  • + *
+ * + *

When set programmatically, it can also be a {@link MemoryAllocator MemoryAllocator} instance.

+ * + *

+ * Property: org.lwjgl.system.allocator
+ *     Type: String or a {@link MemoryAllocator} instance
+ *    Usage: Static

+ */ + public static final Configuration MEMORY_ALLOCATOR = new Configuration<>("org.lwjgl.system.allocator", StateInit.STRING); + + /** + * Sets the stack size, in kilobytes, that will be used in the default {@link MemoryStack} constructor. This value is also used for the LWJGL-managed, + * thread-local, {@link MemoryStack} instances. + * + *

If this option is not set, it defaults to 64.

+ * + *

+ * Property: org.lwjgl.system.stackSize
+ *    Usage: Static

+ */ + public static final Configuration STACK_SIZE = new Configuration<>("org.lwjgl.system.stackSize", StateInit.INT); + + /** + * Sets the size of arrays cached in thread-local storage to minimize allocations while decoding text. + * + *

The memory cost for the cache is up to two arrays per thread that does text decoding. When the text length is up to this value, a cached array will + * be used. When the text length is longer than this value, a new array buffer will be allocated.

+ * + *

If this option is not set, it defaults to 8192. Setting the value to 0 will disable the array cache.

+ * + *

+ * Property: org.lwjgl.system.arrayTLCSize
+ *    Usage: Static

+ */ + public static final Configuration ARRAY_TLC_SIZE = new Configuration<>("org.lwjgl.system.arrayTLCSize", StateInit.INT); + + /** + * Set to true to disable LWJGL's basic checks. These are trivial checks that LWJGL performs to avoid JVM crashes, very useful during development. + * Their performance impact is usually minimal, but they may be disabled for release builds. + * + *

+ * Property: org.lwjgl.util.NoChecks
+ *    Usage: Static

+ */ + public static final Configuration DISABLE_CHECKS = new Configuration<>("org.lwjgl.util.NoChecks", StateInit.BOOLEAN); + + /** + * Set to true to disable LWJGL's function lookup checks. These checks ensure that required functions are not missing from dynamically loaded shared + * libraries. This setting is useful when a trusted incompatible library must be loaded. + * + *

+ * Property: org.lwjgl.util.NoFunctionChecks
+ *    Usage: Dynamic

+ */ + public static final Configuration DISABLE_FUNCTION_CHECKS = new Configuration<>("org.lwjgl.util.NoFunctionChecks", StateInit.BOOLEAN); + + /** + * Set to true to enable LWJGL's debug mode. Information messages will be printed to the {@link APIUtil#DEBUG_STREAM} and extra runtime checks will + * be performed (some potentially expensive, performance-wise). + * + *

+ * Property: org.lwjgl.util.Debug
+ *    Usage: Static

+ */ + public static final Configuration DEBUG = new Configuration<>("org.lwjgl.util.Debug", StateInit.BOOLEAN); + + /** + * When enabled, ShaderLibraryLoader exceptions will be printed to the {@link #DEBUG_STREAM}. + * + *

This option requires {@link #DEBUG} to be enabled.

+ * + *

+ * Property: org.lwjgl.util.DebugLoader
+ *    Usage: Static

+ */ + public static final Configuration DEBUG_LOADER = new Configuration<>("org.lwjgl.util.DebugLoader", StateInit.BOOLEAN); + + /** + * Can be set to override the default {@link APIUtil#DEBUG_STREAM}. It must be the name of a class that implements the + * {@link Supplier Supplier<PrintStream>} interface. The class will be instantiated using reflection and the result of {@link Supplier#get get} will + * become the {@code #DEBUG_STREAM} used by LWJGL. + * + *

When set programmatically, it can also be a {@link PrintStream} instance.

+ * + *

+ * Property: org.lwjgl.util.DebugStream
+ *     Type: String or a {@link PrintStream} instance
+ *    Usage: Static

+ */ + public static final Configuration DEBUG_STREAM = new Configuration<>("org.lwjgl.util.DebugStream", StateInit.STRING); + + /** + * Set to true to enable LWJGL's debug mode for the {@link MemoryUtil} explicit memory management API + * ({@link MemoryUtil#memAlloc memAlloc}/{@link MemoryUtil#memFree memFree}/etc). All memory allocations through that API will be tracked and leaks + * will be reported on JVM exit. The {@code memReport} methods can also be used. + * + *

When this option is enabled, a stacktrace is generated on every allocation, which may negatively impact performance. If this becomes a serious issue, + * the JVM option {@code -XX:MaxJavaStackTraceDepth=d} (where {@code d >= 6}) can be used to reduce the overhead.

+ * + *

+ * Property: org.lwjgl.util.DebugAllocator
+ *    Usage: Static

+ */ + public static final Configuration DEBUG_MEMORY_ALLOCATOR = new Configuration<>("org.lwjgl.util.DebugAllocator", StateInit.BOOLEAN); + + /** + * Set to false to disable tracking of internal memory allocations, in native shared libraries that have been set up to use the LWJGL memory allocator. + * + *

If this option is not set, it defaults to true.

+ * + *

+ * Property: org.lwjgl.util.DebugAllocator.internal
+ *    Usage: Static

+ */ + public static final Configuration DEBUG_MEMORY_ALLOCATOR_INTERNAL = new Configuration<>("org.lwjgl.util.DebugAllocator.internal", StateInit.BOOLEAN); + + /** + * Set to true to enable LWJGL's debug mode for the {@link MemoryStack}. When using the stack, each frame should be popped in the same method that pushed + * it. If this symmetry is broken, this mode will report it immediately. + * + *

When this option is enabled, a stacktrace is generated on every push or pop to the stack, which may negatively impact performance. If this becomes a + * serious issue, the JVM option {@code -XX:MaxJavaStackTraceDepth=d} (where {@code d >= 5}) can be used to reduce the overhead.

+ * + *

+ * Property: org.lwjgl.util.DebugStack
+ *    Usage: Static

+ */ + public static final Configuration DEBUG_STACK = new Configuration<>("org.lwjgl.util.DebugStack", StateInit.BOOLEAN); + + /** + * When enabled, capabilities classes will print an error message when they fail to retrieve a function pointer. + * + *

Function pointers in such classes are retrieved unconditionally, so this option may generate a lot of output and many false negatives.

+ * + *

This option requires {@link #DEBUG} to be enabled.

+ * + *

+ * Property: org.lwjgl.util.DebugFunctions
+ *    Usage: Static

+ */ + public static final Configuration DEBUG_FUNCTIONS = new Configuration<>("org.lwjgl.util.DebugFunctions", StateInit.BOOLEAN); + + // -- ASSIMP + + /** Similar to {@link #LIBRARY_NAME} for the AssImp library (org.lwjgl.assimp.libname). */ + public static final Configuration ASSIMP_LIBRARY_NAME = new Configuration<>("org.lwjgl.assimp.libname", StateInit.STRING); + + // -- BGFX + + /** Similar to {@link #LIBRARY_NAME} for the BGFX library (org.lwjgl.bgfx.libname). */ + public static final Configuration BGFX_LIBRARY_NAME = new Configuration<>("org.lwjgl.bgfx.libname", StateInit.STRING); + + // -- CUDA + + /** Similar to {@link #LIBRARY_NAME} for the CUDA Driver library – nvcuda (org.lwjgl.cuda.libname). */ + public static final Configuration CUDA_LIBRARY_NAME = new Configuration<>("org.lwjgl.cuda.libname", StateInit.STRING); + + /** + * By default, when LWJGL detects multiple CUDA Toolkits, it will use the toolkit with the greatest version. This option can be used to force a specific + * CUDA Toolkit version. + * + *

+ * Property: org.lwjgl.cuda.toolkit.version
+ *    Usage: Static

+ */ + public static final Configuration CUDA_TOOLKIT_VERSION = new Configuration<>("org.lwjgl.cuda.toolkit.version", StateInit.STRING); + + /** + * By default, LWJGL will try to detect CUDA Toolkits in the default installation folder. This option can be used to load toolkit libraries from a + * non-standard installation folder. + * + *

+ * Property: org.lwjgl.cuda.toolkit.path
+ *    Usage: Static

+ */ + public static final Configuration CUDA_TOOLKIT_PATH = new Configuration<>("org.lwjgl.cuda.toolkit.path", StateInit.STRING); + + /** Similar to {@link #LIBRARY_NAME} for the CUDA NVRTC library (org.lwjgl.cuda.nvrtc.libname). */ + public static final Configuration CUDA_NVRTC_LIBRARY_NAME = new Configuration<>("org.lwjgl.cuda.nvrtc.libname", StateInit.STRING); + + /** Similar to {@link #LIBRARY_NAME} for the CUDA NVRTC Builtins library (org.lwjgl.cuda.nvrtc-builtins.libname). */ + public static final Configuration CUDA_NVRTC_BUILTINS_LIBRARY_NAME = new Configuration<>("org.lwjgl.cuda.nvrtc-builtins.libname", StateInit.STRING); + + /** + * By default, CUDA uses the legacy default stream. To enable per-thread synchronization, set this option to {@code true} before initializing the CUDA + * driver. + * + *

To check if the CUDA driver supports PTDS, call {@code org.lwjgl.cuda.CUDA.isPerThreadDefaultStreamSupported()}

+ * + *

+ * Property: org.lwjgl.cuda.ptds
+ *    Usage: Static

+ */ + public static final Configuration CUDA_API_PER_THREAD_DEFAULT_STREAM = new Configuration<>("org.lwjgl.cuda.ptds", StateInit.BOOLEAN); + + // -- EGL + + /** + * By default, LWJGL will automatically initialize the EGL library, when it is first accessed. Set this property to disable this behavior. + * + *

+ * Property: org.lwjgl.egl.explicitInit
+ *    Usage: Static

+ */ + public static final Configuration EGL_EXPLICIT_INIT = new Configuration<>("org.lwjgl.egl.explicitInit", StateInit.BOOLEAN); + + /** Similar to {@link #LIBRARY_NAME} for the EGL library (org.lwjgl.egl.libname). */ + public static final Configuration EGL_LIBRARY_NAME = new Configuration<>("org.lwjgl.egl.libname", StateInit.STRING); + + // -- GLFW + + /** Similar to {@link #LIBRARY_NAME} for the GLFW library (org.lwjgl.glfw.libname). */ + public static final Configuration GLFW_LIBRARY_NAME = new Configuration<>("org.lwjgl.glfw.libname", StateInit.STRING); + + /** + * By default, LWJGL will check if certain GLFW functions are called on the first thread of the process and fail if that is not the case. Set this property + * to false to disable this behavior. + * + *

+ * Property: org.lwjgl.glfw.checkThread0
+ *    Usage: Static

+ */ + public static final Configuration GLFW_CHECK_THREAD0 = new Configuration<>("org.lwjgl.glfw.checkThread0", StateInit.BOOLEAN); + + // -- JAWT + + /** Similar to {@link #LIBRARY_NAME} for the jawt library (org.lwjgl.system.jawt.libname). */ + public static final Configuration JAWT_LIBRARY_NAME = new Configuration<>("org.lwjgl.system.jawt.libname", StateInit.STRING); + + // -- JEMALLOC + + /** Similar to {@link #LIBRARY_NAME} for the jemalloc library (org.lwjgl.system.jemalloc.libname). */ + public static final Configuration JEMALLOC_LIBRARY_NAME = new Configuration<>("org.lwjgl.system.jemalloc.libname", StateInit.STRING); + + // -- LLVM + + /** Similar to {@link #LIBRARY_NAME} for the LLVM library (org.lwjgl.llvm.libname). */ + public static final Configuration LLVM_LIBRARY_NAME = new Configuration<>("org.lwjgl.llvm.libname", StateInit.STRING); + + /** Similar to {@link #LIBRARY_NAME} for the LLVM/Clang Library (org.lwjgl.llvm.clang.libname). */ + public static final Configuration LLVM_CLANG_LIBRARY_NAME = new Configuration<>("org.lwjgl.llvm.clang.libname", StateInit.STRING); + + /** Similar to {@link #LIBRARY_NAME} for the LLVM/LTO library (org.lwjgl.llvm.clang.libname). */ + public static final Configuration LLVM_LTO_LIBRARY_NAME = new Configuration<>("org.lwjgl.llvm.lto.libname", StateInit.STRING); + + // -- ODBC + + /** Similar to {@link #LIBRARY_NAME} for the ODBC library (org.lwjgl.odbc.libname). */ + public static final Configuration ODBC_LIBRARY_NAME = new Configuration<>("org.lwjgl.odbc.libname", StateInit.STRING); + + // -- OPENAL + + /** Similar to {@link #EGL_EXPLICIT_INIT} for the OpenAL library (org.lwjgl.openal.explicitInit). */ + public static final Configuration OPENAL_EXPLICIT_INIT = new Configuration<>("org.lwjgl.openal.explicitInit", StateInit.BOOLEAN); + + /** Similar to {@link #LIBRARY_NAME} for the OpenAL library (org.lwjgl.openal.libname). */ + public static final Configuration OPENAL_LIBRARY_NAME = new Configuration<>("org.lwjgl.openal.libname", StateInit.STRING); + + // -- OPENCL + + /** Similar to {@link #EGL_EXPLICIT_INIT} for the OpenCL library (org.lwjgl.opencl.explicitInit). */ + public static final Configuration OPENCL_EXPLICIT_INIT = new Configuration<>("org.lwjgl.opencl.explicitInit", StateInit.BOOLEAN); + + /** Similar to {@link #LIBRARY_NAME} for the OpenCL library (org.lwjgl.opencl.libname). */ + public static final Configuration OPENCL_LIBRARY_NAME = new Configuration<>("org.lwjgl.opencl.libname", StateInit.STRING); + + // -- OPENGL + + /** Similar to {@link #EGL_EXPLICIT_INIT} for the OpenGL library (org.lwjgl.opengl.explicitInit). */ + public static final Configuration OPENGL_EXPLICIT_INIT = new Configuration<>("org.lwjgl.opengl.explicitInit", StateInit.BOOLEAN); + + /** Similar to {@link #LIBRARY_NAME} for the OpenGL library (org.lwjgl.opengl.libname). */ + public static final Configuration OPENGL_LIBRARY_NAME = new Configuration<>("org.lwjgl.opengl.libname", StateInit.STRING); + + /** + * Can be used to limit the maximum available OpenGL version. This can be useful to ensure that an application has not accidentally used features only + * available in a higher OpenGL version. + * + *

When set programmatically, it can also be an {@link APIUtil.APIVersion} instance.

+ * + *

+ * Property: org.lwjgl.opengl.maxVersion
+ *     Type: String (M.n) or an {@link APIUtil.APIVersion} instance
+ *    Usage: Static

+ */ + public static final Configuration OPENGL_MAXVERSION = new Configuration<>("org.lwjgl.opengl.maxVersion", StateInit.STRING); + + // -- OPENGL ES + + /** Similar to {@link #EGL_EXPLICIT_INIT} for the OpenGL ES library (org.lwjgl.opengles.explicitInit). */ + public static final Configuration OPENGLES_EXPLICIT_INIT = new Configuration<>("org.lwjgl.opengles.explicitInit", StateInit.BOOLEAN); + + /** Similar to {@link #LIBRARY_NAME} for the OpenGL ES library (org.lwjgl.opengles.libname). */ + public static final Configuration OPENGLES_LIBRARY_NAME = new Configuration<>("org.lwjgl.opengles.libname", StateInit.STRING); + + /** Similar to {@link #OPENGL_MAXVERSION} for the OpenGL ES library (org.lwjgl.opengles.maxVersion). */ + public static final Configuration OPENGLES_MAXVERSION = new Configuration<>("org.lwjgl.opengles.maxVersion", StateInit.STRING); + + // -- OPENVR + + /** Similar to {@link #LIBRARY_NAME} for the OpenVR library (org.lwjgl.openvr.libname). */ + public static final Configuration OPENVR_LIBRARY_NAME = new Configuration<>("org.lwjgl.openvr.libname", StateInit.STRING); + + // -- OPUS + + /** Similar to {@link #LIBRARY_NAME} for the Opus library (org.lwjgl.opus.libname). */ + public static final Configuration OPUS_LIBRARY_NAME = new Configuration<>("org.lwjgl.opus.libname", StateInit.STRING); + + // -- SHADERC + + /** Similar to {@link #LIBRARY_NAME} for the Shaderc libshaderc library (org.lwjgl.shaderc.libname). */ + public static final Configuration SHADERC_LIBRARY_NAME = new Configuration<>("org.lwjgl.shaderc.libname", StateInit.STRING); + + /** Similar to {@link #LIBRARY_NAME} for the Shaderc libshaderc_spvc library (org.lwjgl.shaderc_spvc.libname). */ + public static final Configuration SHADERC_SPVC_LIBRARY_NAME = new Configuration<>("org.lwjgl.shaderc.spvc.libname", StateInit.STRING); + + // -- VULKAN + + /** Similar to {@link #EGL_EXPLICIT_INIT} for the Vulkan library (org.lwjgl.vulkan.explicitInit). */ + public static final Configuration VULKAN_EXPLICIT_INIT = new Configuration<>("org.lwjgl.vulkan.explicitInit", StateInit.BOOLEAN); + + /** Similar to {@link #LIBRARY_NAME} for the Vulkan library (org.lwjgl.vulkan.libname). */ + public static final Configuration VULKAN_LIBRARY_NAME = new Configuration<>("org.lwjgl.vulkan.libname", StateInit.STRING); + + private interface StateInit extends Function { + StateInit BOOLEAN = property -> { + String value = System.getProperty(property); + return value == null ? null : Boolean.parseBoolean(value); + }; + + StateInit INT = Integer::getInteger; + + StateInit STRING = System::getProperty; + } + + private final String property; + + @Nullable + private T state; + + Configuration(String property, StateInit init) { + this.property = property; + this.state = init.apply(property); + } + + public String getProperty() { + return property; + } + + /** + * Sets the option value. + * + * @param value the value to set + */ + public void set(@Nullable T value) { + this.state = value; + } + + /** + * Returns the option value. + * + *

If the option value has not been set, null will be returned.

+ */ + @Nullable + public T get() { + return state; + } + + /** + * Returns the option value. + * + *

If the option value has not been set, the specified default value will be returned.

+ * + * @param defaultValue the default value + */ + public T get(T defaultValue) { + T state = this.state; + if (state == null) { + state = defaultValue; + } + + return state; + } + +} diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/CustomBuffer.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/CustomBuffer.java new file mode 100644 index 00000000..ae914cb2 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/CustomBuffer.java @@ -0,0 +1,433 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import javax.annotation.*; +import java.nio.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** Base class of custom buffers with an API that mirrors {@code java.nio} for convenience. */ +public abstract class CustomBuffer> extends Pointer.Default { + + @Nullable + protected ByteBuffer container; + + protected int + mark, + position, + limit, + capacity; + + protected CustomBuffer(long address, @Nullable ByteBuffer container, int mark, int position, int limit, int capacity) { + super(address); + + this.container = container; + + this.mark = mark; + this.position = position; + this.limit = limit; + this.capacity = capacity; + } + + /** Returns the {@code sizeof} a single element in the buffer. */ + public abstract int sizeof(); + + /** Returns the buffer's base address. [INTERNAL USE ONLY] */ + public long address0() { + return address; + } + + /** Returns the memory address at the current buffer position. */ + @Override + public long address() { + return address + Integer.toUnsignedLong(position) * sizeof(); + } + + /** Returns the memory address at the specified buffer position. */ + public long address(int position) { + return address + Integer.toUnsignedLong(position) * sizeof(); + } + + /** + * Frees the buffer allocation. + * + *

This method should not be used if the memory backing this buffer is not owned by the buffer.

+ */ + public void free() { + nmemFree(address); + } + + /** + * Returns this buffer's capacity. + * + * @return the capacity of this buffer + */ + public int capacity() { + return capacity; + } + + /** + * Returns this buffer's position. + * + * @return the position of this buffer + */ + public int position() { + return position; + } + + /** + * Sets this buffer's position. If the mark is defined and larger than the new position then it is discarded. + * + * @param position the new position value; must be non-negative and no larger than the current limit + * + * @return This buffer + * + * @throws IllegalArgumentException If the preconditions on {@code newPosition} do not hold + */ + public SELF position(int position) { + if (position < 0 || limit < position) { + throw new IllegalArgumentException(); + } + this.position = position; + if (position < mark) { + mark = -1; + } + return self(); + } + + /** + * Returns this buffer's limit. + * + * @return the limit of this buffer + */ + public int limit() { + return limit; + } + + /** + * Sets this buffer's limit. If the position is larger than the new limit then it is set to the new limit. If the mark is defined and larger than the new + * limit then it is discarded. + * + * @param limit the new limit value; must be non-negative and no larger than this buffer's capacity + * + * @return This buffer + * + * @throws IllegalArgumentException If the preconditions on {@code newLimit} do not hold + */ + public SELF limit(int limit) { + if (limit < 0 || capacity < limit) { + throw new IllegalArgumentException(); + } + this.limit = limit; + if (limit < position) { + position = limit; + } + if (limit < mark) { + mark = -1; + } + return self(); + } + + /** + * Sets this buffer's mark at its position. + * + * @return This buffer + */ + public SELF mark() { + mark = position; + return self(); + } + + /** + * Resets this buffer's position to the previously-marked position. + * + *

Invoking this method neither changes nor discards the mark's value.

+ * + * @return This buffer + * + * @throws InvalidMarkException If the mark has not been set + */ + public SELF reset() { + int m = mark; + if (m < 0) { + throw new InvalidMarkException(); + } + position = m; + return self(); + } + + /** + * Clears this buffer. The position is set to zero, the limit is set to the capacity, and the mark is discarded. + * + *

Invoke this method before using a sequence of channel-read or put operations to fill this buffer. For example:

+ * + *
+     * buf.clear();     // Prepare buffer for reading
+     * in.read(buf);    // Read data
+ * + *

This method does not actually erase the data in the buffer, but it is named as if it did because it will most often be used in situations in which + * that might as well be the case.

+ * + * @return This buffer + */ + public SELF clear() { + position = 0; + limit = capacity; + mark = -1; + return self(); + } + + /** + * Flips this buffer. The limit is set to the current position and then the position is set to zero. If the mark is defined then it is discarded. + * + *

After a sequence of channel-read or put operations, invoke this method to prepare for a sequence of channel-write or relative get + * operations. For example:

+ * + *
+     * buf.put(magic);    // Prepend header
+     * in.read(buf);      // Read data into rest of buffer
+     * buf.flip();        // Flip buffer
+     * out.write(buf);    // Write header + data to channel
+ * + *

This method is often used in conjunction with the {@link #compact} method when transferring data from one place to another.

+ * + * @return This buffer + */ + public SELF flip() { + limit = position; + position = 0; + mark = -1; + return self(); + } + + /** + * Rewinds this buffer. The position is set to zero and the mark is discarded. + * + *

Invoke this method before a sequence of channel-write or get operations, assuming that the limit has already been set appropriately. For + * example:

+ * + *
+     * out.write(buf);    // Write remaining data
+     * buf.rewind();      // Rewind buffer
+     * buf.get(array);    // Copy data into array
+ * + * @return This buffer + */ + public SELF rewind() { + position = 0; + mark = -1; + return self(); + } + + /** + * Returns the number of elements between the current position and the limit. + * + * @return the number of elements remaining in this buffer + */ + public int remaining() { + return limit - position; + } + + /** + * Tells whether there are any elements between the current position and the limit. + * + * @return {@code true} if, and only if, there is at least one element remaining in this buffer + */ + public boolean hasRemaining() { + return position < limit; + } + + /** + * Creates a new buffer whose content is a shared subsequence of this buffer's content. + * + *

The content of the new buffer will start at this buffer's current position. Changes to this buffer's content will be visible in the new buffer, and + * vice versa; the two buffers' position, limit, and mark values will be independent.

+ * + *

The new buffer's position will be zero, its capacity and its limit will be the number of elements remaining in this buffer, and its mark will be + * undefined. The new buffer will be read-only if, and only if, this buffer is read-only.

+ * + * @return the new buffer + */ + @SuppressWarnings("unchecked") + public SELF slice() { + SELF slice; + try { + slice = (SELF)UNSAFE.allocateInstance(this.getClass()); + } catch (InstantiationException e) { + throw new UnsupportedOperationException(e); + } + + UNSAFE.putLong(slice, ADDRESS, address + Integer.toUnsignedLong(position) * sizeof()); + UNSAFE.putInt(slice, BUFFER_MARK, -1); + UNSAFE.putInt(slice, BUFFER_LIMIT, remaining()); + UNSAFE.putInt(slice, BUFFER_CAPACITY, remaining()); + UNSAFE.putObject(slice, BUFFER_CONTAINER, container); + + return slice; + } + + /** + * Returns a slice of this buffer between {@code (buffer.position() + offset)} and {@code (buffer.position() + offset + capacity)}. + * + *

The position and limit of this buffer are preserved after a call to this method.

+ * + * @param offset the slice offset, it must be ≤ {@code this.remaining()} + * @param capacity the slice length, it must be ≤ {@code this.capacity() - (this.position() + offset)} + * + * @return the sliced buffer + */ + @SuppressWarnings("unchecked") + public SELF slice(int offset, int capacity) { + int position = this.position + offset; + if (offset < 0 || this.limit < offset) { + throw new IllegalArgumentException(); + } + + if (capacity < 0 || this.capacity - position < capacity) { + throw new IllegalArgumentException(); + } + + SELF slice; + try { + slice = (SELF)UNSAFE.allocateInstance(this.getClass()); + } catch (InstantiationException e) { + throw new UnsupportedOperationException(e); + } + + UNSAFE.putLong(slice, ADDRESS, address + Integer.toUnsignedLong(position) * sizeof()); + UNSAFE.putInt(slice, BUFFER_MARK, -1); + UNSAFE.putInt(slice, BUFFER_LIMIT, capacity); + UNSAFE.putInt(slice, BUFFER_CAPACITY, capacity); + UNSAFE.putObject(slice, BUFFER_CONTAINER, container); + + return slice; + } + + /** + * Creates a new buffer that shares this buffer's content. + * + *

The content of the new buffer will be that of this buffer. Changes to this buffer's content will be visible in the new buffer, and vice versa; the + * two buffers' position, limit, and mark values will be independent. + * + *

The new buffer's capacity, limit and position will be identical to those of this buffer.

+ * + * @return the new buffer + */ + @SuppressWarnings("unchecked") + public SELF duplicate() { + SELF dup; + try { + dup = (SELF)UNSAFE.allocateInstance(this.getClass()); + } catch (InstantiationException e) { + throw new UnsupportedOperationException(e); + } + + UNSAFE.putLong(dup, ADDRESS, address); + UNSAFE.putInt(dup, BUFFER_MARK, mark); + UNSAFE.putInt(dup, BUFFER_POSITION, position); + UNSAFE.putInt(dup, BUFFER_LIMIT, limit); + UNSAFE.putInt(dup, BUFFER_CAPACITY, capacity); + UNSAFE.putObject(dup, BUFFER_CONTAINER, container); + + return dup; + } + + // -- Bulk get operations -- + + /** + * Relative bulk put method  (optional operation). + * + *

This method transfers the elements remaining in the specified source buffer into this buffer. If there are more elements remaining in the source + * buffer than in this buffer, that is, if {@code src.remaining()} {@code >} {@code remaining()}, then no elements are transferred and a + * {@link BufferOverflowException} is thrown. + * + *

Otherwise, this method copies n = {@code src.remaining()} elements from the specified buffer into this buffer, starting at each + * buffer's current position. The positions of both buffers are then incremented by n.

+ * + *

In other words, an invocation of this method of the form {@code dst.put(src)} has exactly the same effect as the loop

+ * + *
+     *     while (src.hasRemaining())
+     *         dst.put(src.get()); 
+ * + *

except that it first checks that there is sufficient space in this buffer and it is potentially much more efficient.

+ * + * @param src the source buffer from which elements are to be read; must not be this buffer + * + * @return This buffer + * + * @throws BufferOverflowException If there is insufficient space in this buffer for the remaining elements in the source buffer + * @throws IllegalArgumentException If the source buffer is this buffer + * @throws ReadOnlyBufferException If this buffer is read-only + */ + public SELF put(SELF src) { + if (src == this) { + throw new IllegalArgumentException(); + } + int n = src.remaining(); + if (remaining() < n) { + throw new BufferOverflowException(); + } + + memCopy(src.address(), this.address(), Integer.toUnsignedLong(n) * sizeof()); + position += n; + + return self(); + } + + /** + * Compacts this buffer  (optional operation). + * + *

The elements between the buffer's current position and its limit, if any, are copied to the beginning of the buffer. That is, the element at index + * p = {@code position()} is copied to index zero, the element at index p + 1 is copied to index one, and so forth until + * the element at index {@code limit()} - 1 is copied to index n = {@code limit()} - {@code 1} -  + * p. + * The buffer's position is then set to n+1 and its limit is set to its capacity. The mark, if defined, is discarded. + * + *

The buffer's position is set to the number of elements copied, rather than to zero, so that an invocation of this method can be followed + * immediately by an invocation of another relative put method.

+ * + * @return This buffer + * + * @throws ReadOnlyBufferException If this buffer is read-only + */ + public SELF compact() { + memCopy(address(), address, Integer.toUnsignedLong(remaining()) * sizeof()); + position(remaining()); + limit(capacity()); + mark = -1; + + return self(); + } + + /** + * Returns a string summarizing the state of this buffer. + * + * @return A summary string + */ + public String toString() { + return getClass().getName() + "[pos=" + position() + " lim=" + limit() + " cap=" + capacity() + "]"; + } + + // ----------------------------- + + protected abstract SELF self(); + + protected final int nextGetIndex() { + if (position < limit) { + return position++; + } + throw new BufferUnderflowException(); + } + + protected final int nextPutIndex() { + if (position < limit) { + return position++; + } + throw new BufferOverflowException(); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/FunctionProvider.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/FunctionProvider.java new file mode 100644 index 00000000..51483ad7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/FunctionProvider.java @@ -0,0 +1,31 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import java.nio.*; + +import static org.lwjgl.system.MemoryStack.*; + +/** A provider of native function addresses. */ +@FunctionalInterface +public interface FunctionProvider { + + /** {@link CharSequence} version of {@link #getFunctionAddress(ByteBuffer)}. */ + default long getFunctionAddress(CharSequence functionName) { + try (MemoryStack stack = stackPush()) { + return getFunctionAddress(stack.ASCII(functionName)); + } + } + + /** + * Returns the function address of the specified function. If the function is not supported, returns 0L. + * + * @param functionName the encoded name of the function to query + * + * @return the function address or 0L if the function is not supported + */ + long getFunctionAddress(ByteBuffer functionName); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/FunctionProviderLocal.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/FunctionProviderLocal.java new file mode 100644 index 00000000..4242c4a9 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/FunctionProviderLocal.java @@ -0,0 +1,31 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import java.nio.*; + +import static org.lwjgl.system.MemoryStack.*; + +/** A platform/device/context specific provider of native function addresses. */ +public interface FunctionProviderLocal extends FunctionProvider { + + /** {@link CharSequence} version of {@link #getFunctionAddress(long, ByteBuffer)}. */ + default long getFunctionAddress(long handle, CharSequence functionName) { + try (MemoryStack stack = stackPush()) { + return getFunctionAddress(handle, stack.ASCII(functionName)); + } + } + + /** + * Returns the function address of the specified function for the specified {@code handle}. If the function is not supported, returns 0L. + * + * @param handle the handle to a platform/device/context + * @param functionName the encoded name of the function to query + * + * @return the function address or 0L if the function is not supported + */ + long getFunctionAddress(long handle, ByteBuffer functionName); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/JNI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/JNI.java new file mode 100644 index 00000000..a7066fbd --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/JNI.java @@ -0,0 +1,800 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system; + +import javax.annotation.*; + +/** + * This class contains native methods that can be used to call dynamically loaded functions. It is used internally by the LWJGL bindings, but can also + * be used to call other dynamically loaded functions. Not all possible signatures are available, only those needed by the LWJGL bindings. To call a + * function that does not have a matching JNI method, {@link org.lwjgl.system.dyncall.DynCall DynCall} can used. + * + *

All JNI methods in this class take an extra parameter, called {@code __functionAddress}. This must be a valid pointer to a native function with a + * matching signature. Due to overloading, method names are partially mangled:

+ * + *
    + *
  • {@code call} or {@code invoke} + * + *

    Methods with the {@code invoke} prefix will invoke the native function with the default calling convention. Methods with the {@code call} + * prefix will invoke the native function with the {@code __stdcall} calling convention on Windows and the default calling convention on other + * systems.

  • + *
  • a {@code J} or a {@code P} for each {@code long} parameter + * + *

    {@code J} parameters represent 64-bit integer values. {@code P} parameters represent pointer addresses. A pointer address is a 32-bit value on + * 32-bit architectures and a 64-bit value on 64-bit architectures.

  • + *
  • the return value JNI type signature
  • + *
+ */ +public final class JNI { + + static { + Library.initialize(); + } + + private JNI() {} + + // Pointer API + + public static native String invokeString(int param0, long __functionAddress); + public static native double invokeD(long __functionAddress); + public static native double invokeD(int param0, long __functionAddress); + public static native double invokePD(long param0, int param1, long __functionAddress); + public static native float invokeF(int param0, long __functionAddress); + public static native float invokePF(long param0, long __functionAddress); + public static native int invokeI(long __functionAddress); + public static native int invokeI(int param0, long __functionAddress); + public static native int invokePI(long param0, long __functionAddress); + public static native int invokePI(int param0, long param1, long __functionAddress); + public static native int invokePI(long param0, int param1, long __functionAddress); + public static native int invokePNI(long param0, long param1, long __functionAddress); + public static native int invokePPI(long param0, long param1, long __functionAddress); + public static native int invokePPI(int param0, long param1, long param2, long __functionAddress); + public static native int invokePPI(long param0, long param1, int param2, long __functionAddress); + public static native int invokePPPI(long param0, long param1, long param2, long __functionAddress); + public static native int invokePPPPI(long param0, long param1, long param2, long param3, long __functionAddress); + public static native int invokePNNPI(long param0, long param1, int param2, long param3, long param4, long __functionAddress); + public static native int invokePPPPPI(long param0, long param1, long param2, long param3, long param4, long __functionAddress); + public static native int invokePPPPPPI(long param0, long param1, long param2, long param3, long param4, long param5, long __functionAddress); + public static native int invokePNNPPPI(long param0, long param1, long param2, int param3, int param4, long param5, long param6, long param7, long __functionAddress); + public static native long invokeJ(long __functionAddress); + public static native long invokePJ(long param0, long __functionAddress); + public static native long invokePJ(long param0, int param1, long __functionAddress); + public static native long invokePN(long param0, long __functionAddress); + public static native long invokePN(long param0, int param1, long __functionAddress); + public static native long invokePNPN(long param0, long param1, long param2, int param3, long __functionAddress); + public static native long invokePNPNPN(long param0, long param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, long param9, long param10, long param11, long __functionAddress); + public static native long invokeP(long __functionAddress); + public static native long invokeP(int param0, long __functionAddress); + public static native long invokeP(int param0, int param1, long __functionAddress); + public static native long invokePP(long param0, long __functionAddress); + public static native long invokePP(int param0, long param1, long __functionAddress); + public static native long invokePP(long param0, int param1, long __functionAddress); + public static native long invokePP(long param0, int param1, int param2, long __functionAddress); + public static native long invokePP(long param0, short param1, boolean param2, long __functionAddress); + public static native long invokePP(long param0, int param1, int param2, int param3, long __functionAddress); + public static native long invokePP(long param0, int param1, int param2, int param3, int param4, int param5, long __functionAddress); + public static native long invokePPP(long param0, long param1, long __functionAddress); + public static native long invokePPP(long param0, long param1, int param2, long __functionAddress); + public static native long invokePPP(long param0, int param1, long param2, int param3, long __functionAddress); + public static native long invokePPP(long param0, long param1, boolean param2, boolean param3, long __functionAddress); + public static native long invokePPP(long param0, boolean param1, boolean param2, long param3, long __functionAddress); + public static native long invokePPPP(long param0, long param1, long param2, long __functionAddress); + public static native long invokePPPP(long param0, int param1, long param2, long param3, long __functionAddress); + public static native long invokePPPP(long param0, long param1, long param2, int param3, long __functionAddress); + public static native long invokePPPP(int param0, int param1, long param2, long param3, long param4, long __functionAddress); + public static native long invokeJPPP(int param0, int param1, int param2, long param3, long param4, long param5, long __functionAddress); + public static native long invokePPPPP(long param0, long param1, long param2, long param3, long __functionAddress); + public static native long invokePPPPP(long param0, long param1, int param2, long param3, long param4, long __functionAddress); + public static native long invokePJPPP(long param0, int param1, int param2, long param3, long param4, long param5, long __functionAddress); + public static native long invokePNNNPP(long param0, long param1, long param2, long param3, long param4, long __functionAddress); + public static native long invokePPPPPPP(long param0, long param1, long param2, int param3, long param4, long param5, long param6, long __functionAddress); + public static native long invokePPPPPPP(long param0, long param1, long param2, long param3, long param4, long param5, int param6, long __functionAddress); + public static native void invokeV(long __functionAddress); + public static native void invokeV(double param0, long __functionAddress); + public static native void invokeV(float param0, long __functionAddress); + public static native void invokeV(int param0, long __functionAddress); + public static native void invokeV(int param0, float param1, long __functionAddress); + public static native void invokeV(int param0, int param1, long __functionAddress); + public static native void invokeV(int param0, int param1, double param2, long __functionAddress); + public static native void invokeV(int param0, int param1, float param2, long __functionAddress); + public static native void invokeV(int param0, int param1, int param2, long __functionAddress); + public static native void invokeV(int param0, float param1, float param2, float param3, long __functionAddress); + public static native void invokeV(int param0, int param1, int param2, int param3, long __functionAddress); + public static native void invokeV(int param0, int param1, double param2, double param3, double param4, long __functionAddress); + public static native void invokeV(int param0, int param1, float param2, float param3, float param4, long __functionAddress); + public static native void invokeV(int param0, int param1, int param2, int param3, int param4, long __functionAddress); + public static native void invokePV(long param0, long __functionAddress); + public static native void invokePV(int param0, long param1, long __functionAddress); + public static native void invokePV(long param0, float param1, long __functionAddress); + public static native void invokePV(long param0, int param1, long __functionAddress); + public static native void invokePV(long param0, boolean param1, long __functionAddress); + public static native void invokeJV(int param0, int param1, long param2, long __functionAddress); + public static native void invokePV(int param0, int param1, long param2, long __functionAddress); + public static native void invokePV(long param0, double param1, double param2, long __functionAddress); + public static native void invokePV(long param0, float param1, float param2, long __functionAddress); + public static native void invokePV(long param0, int param1, double param2, long __functionAddress); + public static native void invokePV(long param0, int param1, int param2, long __functionAddress); + public static native void invokePV(long param0, int param1, int param2, int param3, long __functionAddress); + public static native void invokePV(int param0, int param1, long param2, int param3, int param4, long __functionAddress); + public static native void invokePV(long param0, int param1, int param2, int param3, int param4, long __functionAddress); + public static native void invokePJV(long param0, long param1, long __functionAddress); + public static native void invokePPV(long param0, long param1, long __functionAddress); + public static native void invokePJV(long param0, int param1, long param2, long __functionAddress); + public static native void invokePPV(long param0, int param1, long param2, long __functionAddress); + public static native void invokePPV(long param0, long param1, int param2, long __functionAddress); + public static native void invokePPV(long param0, long param1, boolean param2, long __functionAddress); + public static native void invokePPV(long param0, int param1, int param2, long param3, long __functionAddress); + public static native void invokePPV(long param0, long param1, int param2, int param3, int param4, int param5, int param6, long __functionAddress); + public static native void invokePNPV(long param0, long param1, long param2, long __functionAddress); + public static native void invokePPPV(long param0, long param1, long param2, long __functionAddress); + public static native void invokePPPV(int param0, long param1, long param2, long param3, long __functionAddress); + public static native void invokePPPV(long param0, int param1, long param2, long param3, long __functionAddress); + public static native void invokePPPV(long param0, long param1, long param2, int param3, long __functionAddress); + public static native void invokeJJJV(int param0, int param1, long param2, long param3, long param4, long __functionAddress); + public static native void invokePPPV(int param0, int param1, long param2, long param3, long param4, long __functionAddress); + public static native void invokePPPV(long param0, long param1, long param2, boolean param3, boolean param4, long __functionAddress); + public static native void invokePPPV(long param0, long param1, long param2, int param3, boolean param4, boolean param5, long __functionAddress); + public static native void invokePNPPV(long param0, long param1, long param2, long param3, long __functionAddress); + public static native void invokePPPPV(long param0, long param1, long param2, long param3, long __functionAddress); + public static native void invokePPPPV(long param0, int param1, long param2, long param3, long param4, long __functionAddress); + public static native void invokePPPPPV(long param0, long param1, long param2, long param3, long param4, long __functionAddress); + public static native boolean invokeZ(int param0, long __functionAddress); + public static native boolean invokePZ(long param0, long __functionAddress); + public static native boolean invokePZ(long param0, int param1, int param2, int param3, long __functionAddress); + public static native boolean invokePPZ(long param0, long param1, long __functionAddress); + public static native boolean invokePPPZ(long param0, long param1, long param2, long __functionAddress); + public static native boolean invokePPPZ(long param0, long param1, long param2, int param3, long __functionAddress); + public static native boolean invokePPPZ(long param0, long param1, long param2, boolean param3, int param4, long __functionAddress); + public static native boolean invokePPPPZ(long param0, long param1, long param2, long param3, long __functionAddress); + public static native boolean invokePPPPZ(long param0, long param1, long param2, byte param3, long param4, long __functionAddress); + public static native boolean invokePPPPPZ(long param0, long param1, long param2, long param3, long param4, int param5, long __functionAddress); + public static native boolean invokePPPPPZ(long param0, long param1, long param2, long param3, long param4, boolean param5, int param6, long __functionAddress); + public static native float callF(int param0, int param1, int param2, long __functionAddress); + public static native int callI(long __functionAddress); + public static native int callI(int param0, long __functionAddress); + public static native int callI(int param0, int param1, long __functionAddress); + public static native int callI(int param0, int param1, int param2, long __functionAddress); + public static native int callPI(long param0, long __functionAddress); + public static native int callPI(int param0, long param1, long __functionAddress); + public static native int callPI(long param0, float param1, long __functionAddress); + public static native int callPI(long param0, int param1, long __functionAddress); + public static native int callPI(int param0, int param1, long param2, long __functionAddress); + public static native int callPI(int param0, long param1, int param2, long __functionAddress); + public static native int callPI(long param0, int param1, int param2, long __functionAddress); + public static native int callPI(int param0, int param1, int param2, long param3, long __functionAddress); + public static native int callPI(int param0, int param1, int param2, int param3, long param4, long __functionAddress); + public static native int callPI(long param0, int param1, int param2, int param3, int param4, long __functionAddress); + public static native int callPI(int param0, int param1, int param2, int param3, int param4, long param5, long __functionAddress); + public static native int callPI(int param0, long param1, int param2, int param3, float param4, int param5, long __functionAddress); + public static native int callPI(long param0, int param1, int param2, int param3, int param4, int param5, int param6, long __functionAddress); + public static native int callPI(int param0, int param1, long param2, int param3, int param4, int param5, int param6, float param7, long __functionAddress); + public static native int callPJI(long param0, long param1, long __functionAddress); + public static native int callPPI(long param0, long param1, long __functionAddress); + public static native int callPJI(long param0, int param1, long param2, long __functionAddress); + public static native int callPJI(long param0, long param1, int param2, long __functionAddress); + public static native int callPPI(int param0, long param1, long param2, long __functionAddress); + public static native int callPPI(long param0, int param1, long param2, long __functionAddress); + public static native int callPPI(long param0, long param1, float param2, long __functionAddress); + public static native int callPPI(long param0, long param1, int param2, long __functionAddress); + public static native int callPPI(int param0, int param1, long param2, long param3, long __functionAddress); + public static native int callPPI(long param0, int param1, int param2, long param3, long __functionAddress); + public static native int callPPI(long param0, int param1, long param2, int param3, long __functionAddress); + public static native int callPPI(long param0, long param1, int param2, int param3, long __functionAddress); + public static native int callPPI(long param0, int param1, int param2, int param3, long param4, long __functionAddress); + public static native int callPPI(long param0, long param1, int param2, int param3, int param4, long __functionAddress); + public static native int callPPI(long param0, long param1, int param2, int param3, int param4, int param5, long __functionAddress); + public static native int callPPI(long param0, int param1, int param2, int param3, int param4, int param5, long param6, long __functionAddress); + public static native int callPPI(long param0, int param1, int param2, int param3, int param4, int param5, int param6, long param7, long __functionAddress); + public static native int callPPI(int param0, int param1, long param2, long param3, int param4, int param5, int param6, int param7, float param8, long __functionAddress); + public static native int callPPI(long param0, int param1, int param2, int param3, int param4, int param5, int param6, long param7, int param8, int param9, int param10, int param11, int param12, int param13, int param14, int param15, int param16, long __functionAddress); + public static native int callPJPI(long param0, long param1, long param2, long __functionAddress); + public static native int callPPJI(long param0, long param1, long param2, long __functionAddress); + public static native int callPPPI(long param0, long param1, long param2, long __functionAddress); + public static native int callPJPI(long param0, int param1, long param2, long param3, long __functionAddress); + public static native int callPJPI(long param0, long param1, int param2, long param3, long __functionAddress); + public static native int callPPJI(long param0, int param1, long param2, long param3, long __functionAddress); + public static native int callPPJI(long param0, long param1, int param2, long param3, long __functionAddress); + public static native int callPPNI(long param0, int param1, long param2, long param3, long __functionAddress); + public static native int callPPPI(long param0, int param1, long param2, long param3, long __functionAddress); + public static native int callPPPI(long param0, long param1, int param2, long param3, long __functionAddress); + public static native int callPPPI(long param0, long param1, long param2, int param3, long __functionAddress); + public static native int callPPJI(long param0, int param1, long param2, int param3, long param4, long __functionAddress); + public static native int callPPPI(long param0, int param1, int param2, int param3, long param4, long param5, long __functionAddress); + public static native int callPPPI(long param0, long param1, int param2, int param3, int param4, long param5, long __functionAddress); + public static native int callPPPI(long param0, long param1, int param2, int param3, int param4, int param5, long param6, long __functionAddress); + public static native int callPJJJI(long param0, long param1, long param2, long param3, long __functionAddress); + public static native int callPJPPI(long param0, long param1, long param2, long param3, long __functionAddress); + public static native int callPPNPI(long param0, long param1, long param2, long param3, long __functionAddress); + public static native int callPPPPI(long param0, long param1, long param2, long param3, long __functionAddress); + public static native int callPJPPI(long param0, long param1, int param2, long param3, long param4, long __functionAddress); + public static native int callPPPPI(long param0, int param1, long param2, long param3, long param4, long __functionAddress); + public static native int callPPPPI(long param0, long param1, long param2, int param3, long param4, long __functionAddress); + public static native int callPJPPI(long param0, long param1, int param2, int param3, long param4, long param5, long __functionAddress); + public static native int callPPPPI(long param0, int param1, int param2, long param3, long param4, long param5, long __functionAddress); + public static native int callPPPPI(int param0, long param1, long param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, int param11, int param12, int param13, int param14, int param15, int param16, int param17, int param18, int param19, int param20, long param21, long param22, long __functionAddress); + public static native int callPJPPPI(long param0, long param1, long param2, long param3, long param4, long __functionAddress); + public static native int callPPPPPI(long param0, long param1, long param2, long param3, long param4, long __functionAddress); + public static native int callPJJJPI(long param0, long param1, long param2, long param3, int param4, long param5, long __functionAddress); + public static native int callPJPPPI(long param0, long param1, int param2, long param3, long param4, long param5, long __functionAddress); + public static native int callPPPPPI(long param0, long param1, long param2, int param3, long param4, long param5, long __functionAddress); + public static native int callPPPPPI(int param0, int param1, long param2, long param3, long param4, long param5, long param6, long __functionAddress); + public static native int callJPPPPI(int param0, int param1, long param2, long param3, int param4, long param5, long param6, long param7, long __functionAddress); + public static native int callPJPPJI(long param0, long param1, int param2, int param3, long param4, long param5, long param6, int param7, long __functionAddress); + public static native int callPJJJJPI(long param0, long param1, long param2, long param3, long param4, long param5, long __functionAddress); + public static native int callPPPPPPI(long param0, long param1, long param2, long param3, long param4, long param5, long __functionAddress); + public static native int callPPPPPPI(int param0, int param1, long param2, long param3, long param4, long param5, long param6, long param7, long __functionAddress); + public static native long callJ(long __functionAddress); + public static native long callJ(int param0, long __functionAddress); + public static native long callJ(int param0, int param1, long __functionAddress); + public static native long callJ(int param0, int param1, boolean param2, int param3, int param4, long __functionAddress); + public static native long callPPJ(long param0, long param1, long __functionAddress); + public static native long callPN(long param0, long __functionAddress); + public static native long callP(long __functionAddress); + public static native long callP(int param0, long __functionAddress); + public static native long callP(int param0, int param1, long __functionAddress); + public static native long callP(int param0, float param1, float param2, float param3, long __functionAddress); + public static native long callPP(long param0, long __functionAddress); + public static native long callPP(int param0, long param1, long __functionAddress); + public static native long callPP(long param0, int param1, long __functionAddress); + public static native long callPP(int param0, long param1, int param2, long __functionAddress); + public static native long callPP(long param0, int param1, int param2, long __functionAddress); + public static native long callPNP(long param0, long param1, long __functionAddress); + public static native long callPPP(long param0, long param1, long __functionAddress); + public static native long callPPP(int param0, long param1, long param2, long __functionAddress); + public static native long callPPP(long param0, int param1, long param2, long __functionAddress); + public static native long callPPP(long param0, long param1, int param2, long __functionAddress); + public static native long callPPP(int param0, long param1, long param2, int param3, long __functionAddress); + public static native long callPPP(int param0, int param1, int param2, long param3, long param4, long __functionAddress); + public static native long callPPP(long param0, int param1, int param2, int param3, long param4, long __functionAddress); + public static native long callPPP(long param0, long param1, int param2, int param3, int param4, long __functionAddress); + public static native long callPPNP(long param0, long param1, long param2, long __functionAddress); + public static native long callPPPP(long param0, long param1, long param2, long __functionAddress); + public static native long callPPPP(long param0, int param1, long param2, long param3, long __functionAddress); + public static native long callPPPP(long param0, long param1, int param2, long param3, long __functionAddress); + public static native long callPPPP(long param0, long param1, long param2, int param3, long __functionAddress); + public static native long callPPPP(long param0, long param1, int param2, int param3, long param4, long __functionAddress); + public static native long callPPPP(long param0, long param1, int param2, long param3, int param4, long __functionAddress); + public static native long callPPNPP(long param0, long param1, long param2, long param3, long __functionAddress); + public static native long callPPPPP(long param0, long param1, long param2, long param3, long __functionAddress); + public static native long callPPPPP(long param0, int param1, long param2, long param3, long param4, long __functionAddress); + public static native long callPPPPP(long param0, long param1, int param2, long param3, long param4, long __functionAddress); + public static native long callPPPPP(long param0, long param1, long param2, int param3, long param4, long __functionAddress); + public static native long callPPPPP(long param0, long param1, long param2, long param3, int param4, long __functionAddress); + public static native long callPPPPPPPP(int param0, long param1, long param2, int param3, int param4, int param5, int param6, long param7, long param8, long param9, int param10, long param11, long param12, long __functionAddress); + public static native short callS(int param0, long __functionAddress); + public static native void callV(long __functionAddress); + public static native void callV(byte param0, long __functionAddress); + public static native void callV(double param0, long __functionAddress); + public static native void callV(float param0, long __functionAddress); + public static native void callV(int param0, long __functionAddress); + public static native void callV(short param0, long __functionAddress); + public static native void callV(boolean param0, long __functionAddress); + public static native void callV(double param0, double param1, long __functionAddress); + public static native void callV(float param0, float param1, long __functionAddress); + public static native void callV(float param0, boolean param1, long __functionAddress); + public static native void callV(int param0, double param1, long __functionAddress); + public static native void callV(int param0, float param1, long __functionAddress); + public static native void callV(int param0, int param1, long __functionAddress); + public static native void callV(int param0, short param1, long __functionAddress); + public static native void callV(int param0, boolean param1, long __functionAddress); + public static native void callV(short param0, short param1, long __functionAddress); + public static native void callV(byte param0, byte param1, byte param2, long __functionAddress); + public static native void callV(double param0, double param1, double param2, long __functionAddress); + public static native void callV(float param0, float param1, float param2, long __functionAddress); + public static native void callV(int param0, double param1, double param2, long __functionAddress); + public static native void callV(int param0, float param1, float param2, long __functionAddress); + public static native void callV(int param0, int param1, double param2, long __functionAddress); + public static native void callV(int param0, int param1, float param2, long __functionAddress); + public static native void callV(int param0, int param1, int param2, long __functionAddress); + public static native void callV(int param0, int param1, boolean param2, long __functionAddress); + public static native void callV(int param0, short param1, short param2, long __functionAddress); + public static native void callV(short param0, short param1, short param2, long __functionAddress); + public static native void callV(byte param0, byte param1, byte param2, byte param3, long __functionAddress); + public static native void callV(double param0, double param1, double param2, double param3, long __functionAddress); + public static native void callV(float param0, float param1, float param2, float param3, long __functionAddress); + public static native void callV(int param0, double param1, double param2, double param3, long __functionAddress); + public static native void callV(int param0, float param1, float param2, float param3, long __functionAddress); + public static native void callV(int param0, int param1, double param2, double param3, long __functionAddress); + public static native void callV(int param0, int param1, float param2, float param3, long __functionAddress); + public static native void callV(int param0, int param1, float param2, int param3, long __functionAddress); + public static native void callV(int param0, int param1, int param2, double param3, long __functionAddress); + public static native void callV(int param0, int param1, int param2, float param3, long __functionAddress); + public static native void callV(int param0, int param1, int param2, int param3, long __functionAddress); + public static native void callV(int param0, int param1, int param2, boolean param3, long __functionAddress); + public static native void callV(int param0, int param1, boolean param2, int param3, long __functionAddress); + public static native void callV(int param0, short param1, short param2, short param3, long __functionAddress); + public static native void callV(short param0, short param1, short param2, short param3, long __functionAddress); + public static native void callV(boolean param0, boolean param1, boolean param2, boolean param3, long __functionAddress); + public static native void callV(int param0, byte param1, byte param2, byte param3, byte param4, long __functionAddress); + public static native void callV(int param0, double param1, double param2, double param3, double param4, long __functionAddress); + public static native void callV(int param0, float param1, float param2, float param3, float param4, long __functionAddress); + public static native void callV(int param0, int param1, double param2, double param3, double param4, long __functionAddress); + public static native void callV(int param0, int param1, float param2, float param3, float param4, long __functionAddress); + public static native void callV(int param0, int param1, int param2, float param3, int param4, long __functionAddress); + public static native void callV(int param0, int param1, int param2, int param3, int param4, long __functionAddress); + public static native void callV(int param0, int param1, int param2, boolean param3, int param4, long __functionAddress); + public static native void callV(int param0, short param1, short param2, short param3, short param4, long __functionAddress); + public static native void callV(int param0, boolean param1, boolean param2, boolean param3, boolean param4, long __functionAddress); + public static native void callV(double param0, double param1, double param2, double param3, double param4, double param5, long __functionAddress); + public static native void callV(int param0, double param1, double param2, int param3, double param4, double param5, long __functionAddress); + public static native void callV(int param0, float param1, float param2, int param3, float param4, float param5, long __functionAddress); + public static native void callV(int param0, int param1, double param2, double param3, double param4, double param5, long __functionAddress); + public static native void callV(int param0, int param1, float param2, float param3, float param4, float param5, long __functionAddress); + public static native void callV(int param0, int param1, int param2, int param3, int param4, int param5, long __functionAddress); + public static native void callV(int param0, int param1, int param2, int param3, int param4, boolean param5, long __functionAddress); + public static native void callV(int param0, int param1, int param2, int param3, boolean param4, int param5, long __functionAddress); + public static native void callV(int param0, double param1, double param2, double param3, double param4, double param5, double param6, long __functionAddress); + public static native void callV(int param0, int param1, int param2, double param3, double param4, double param5, double param6, long __functionAddress); + public static native void callV(int param0, int param1, int param2, float param3, float param4, float param5, float param6, long __functionAddress); + public static native void callV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, long __functionAddress); + public static native void callV(int param0, int param1, int param2, int param3, int param4, int param5, boolean param6, long __functionAddress); + public static native void callV(int param0, int param1, int param2, boolean param3, int param4, int param5, int param6, long __functionAddress); + public static native void callV(float param0, float param1, float param2, float param3, float param4, float param5, float param6, float param7, long __functionAddress); + public static native void callV(int param0, int param1, int param2, float param3, float param4, float param5, float param6, float param7, long __functionAddress); + public static native void callV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, long __functionAddress); + public static native void callV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, boolean param7, long __functionAddress); + public static native void callV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, long __functionAddress); + public static native void callV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, boolean param8, long __functionAddress); + public static native void callV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, long __functionAddress); + public static native void callV(int param0, int param1, float param2, float param3, float param4, float param5, float param6, float param7, float param8, float param9, float param10, long __functionAddress); + public static native void callV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, int param11, long __functionAddress); + public static native void callV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, int param11, int param12, int param13, int param14, long __functionAddress); + public static native void callV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, int param11, int param12, int param13, int param14, int param15, int param16, long __functionAddress); + public static native void callJV(long param0, long __functionAddress); + public static native void callPV(long param0, long __functionAddress); + public static native void callJV(int param0, long param1, long __functionAddress); + public static native void callJV(long param0, int param1, long __functionAddress); + public static native void callPV(int param0, long param1, long __functionAddress); + public static native void callPV(long param0, float param1, long __functionAddress); + public static native void callPV(long param0, int param1, long __functionAddress); + public static native void callJV(int param0, int param1, long param2, long __functionAddress); + public static native void callPV(int param0, int param1, long param2, long __functionAddress); + public static native void callPV(int param0, long param1, int param2, long __functionAddress); + public static native void callPV(long param0, float param1, float param2, long __functionAddress); + public static native void callPV(long param0, int param1, int param2, long __functionAddress); + public static native void callPV(long param0, int param1, short param2, long __functionAddress); + public static native void callJV(int param0, long param1, int param2, int param3, long __functionAddress); + public static native void callNV(long param0, int param1, int param2, int param3, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, long param3, long __functionAddress); + public static native void callPV(int param0, int param1, long param2, int param3, long __functionAddress); + public static native void callPV(int param0, int param1, boolean param2, long param3, long __functionAddress); + public static native void callPV(int param0, long param1, int param2, int param3, long __functionAddress); + public static native void callPV(long param0, float param1, float param2, float param3, long __functionAddress); + public static native void callPV(long param0, int param1, int param2, int param3, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, long param4, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, long param3, int param4, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, long param3, boolean param4, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, boolean param3, long param4, long __functionAddress); + public static native void callPV(int param0, int param1, long param2, int param3, int param4, long __functionAddress); + public static native void callPV(int param0, long param1, int param2, int param3, int param4, long __functionAddress); + public static native void callPV(int param0, boolean param1, int param2, int param3, long param4, long __functionAddress); + public static native void callPV(long param0, int param1, int param2, int param3, int param4, long __functionAddress); + public static native void callJV(int param0, int param1, int param2, int param3, int param4, long param5, long __functionAddress); + public static native void callPV(int param0, double param1, double param2, int param3, int param4, long param5, long __functionAddress); + public static native void callPV(int param0, float param1, float param2, int param3, int param4, long param5, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, long param5, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, long param4, boolean param5, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, long param3, int param4, int param5, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, boolean param3, int param4, long param5, long __functionAddress); + public static native void callPV(int param0, int param1, long param2, int param3, int param4, int param5, long __functionAddress); + public static native void callPV(int param0, boolean param1, int param2, int param3, int param4, long param5, long __functionAddress); + public static native void callPV(long param0, int param1, int param2, int param3, int param4, int param5, long __functionAddress); + public static native void callJV(int param0, int param1, int param2, int param3, int param4, int param5, long param6, long __functionAddress); + public static native void callPV(int param0, int param1, float param2, float param3, float param4, float param5, long param6, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, long param6, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, long param5, int param6, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, long param3, int param4, int param5, int param6, long __functionAddress); + public static native void callPV(int param0, int param1, long param2, int param3, int param4, int param5, int param6, long __functionAddress); + public static native void callPV(long param0, int param1, int param2, int param3, int param4, int param5, int param6, long __functionAddress); + public static native void callJV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, long param7, long __functionAddress); + public static native void callJV(int param0, int param1, int param2, int param3, int param4, boolean param5, int param6, long param7, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, long param7, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, boolean param5, int param6, long param7, long __functionAddress); + public static native void callJV(int param0, int param1, int param2, int param3, int param4, int param5, boolean param6, int param7, long param8, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, long param8, long __functionAddress); + public static native void callPV(int param0, int param1, long param2, int param3, int param4, int param5, int param6, int param7, float param8, long __functionAddress); + public static native void callPV(int param0, double param1, double param2, int param3, int param4, double param5, double param6, int param7, int param8, long param9, long __functionAddress); + public static native void callPV(int param0, float param1, float param2, int param3, int param4, float param5, float param6, int param7, int param8, long param9, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, long param9, long __functionAddress); + public static native void callJV(long param0, int param1, float param2, float param3, float param4, float param5, float param6, float param7, float param8, float param9, float param10, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, long param10, long __functionAddress); + public static native void callPV(long param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, long param11, long __functionAddress); + public static native void callPJV(long param0, long param1, long __functionAddress); + public static native void callPPV(long param0, long param1, long __functionAddress); + public static native void callJJV(int param0, long param1, long param2, long __functionAddress); + public static native void callPJV(long param0, int param1, long param2, long __functionAddress); + public static native void callPJV(long param0, long param1, int param2, long __functionAddress); + public static native void callPPV(int param0, long param1, long param2, long __functionAddress); + public static native void callPPV(long param0, int param1, long param2, long __functionAddress); + public static native void callPPV(long param0, long param1, int param2, long __functionAddress); + public static native void callJJV(int param0, int param1, long param2, long param3, long __functionAddress); + public static native void callJPV(int param0, int param1, long param2, long param3, long __functionAddress); + public static native void callJPV(int param0, long param1, int param2, long param3, long __functionAddress); + public static native void callPJV(int param0, long param1, int param2, long param3, long __functionAddress); + public static native void callPJV(long param0, int param1, long param2, int param3, long __functionAddress); + public static native void callPJV(long param0, long param1, int param2, int param3, long __functionAddress); + public static native void callPPV(int param0, int param1, long param2, long param3, long __functionAddress); + public static native void callPPV(int param0, long param1, int param2, long param3, long __functionAddress); + public static native void callPPV(int param0, long param1, long param2, int param3, long __functionAddress); + public static native void callPPV(int param0, long param1, long param2, boolean param3, long __functionAddress); + public static native void callPPV(long param0, int param1, int param2, long param3, long __functionAddress); + public static native void callPPV(long param0, long param1, int param2, int param3, long __functionAddress); + public static native void callPJV(long param0, long param1, int param2, int param3, int param4, long __functionAddress); + public static native void callPPV(int param0, int param1, int param2, long param3, long param4, long __functionAddress); + public static native void callPPV(int param0, int param1, long param2, int param3, long param4, long __functionAddress); + public static native void callPPV(int param0, int param1, long param2, long param3, int param4, long __functionAddress); + public static native void callPPV(int param0, long param1, int param2, long param3, int param4, long __functionAddress); + public static native void callPPV(int param0, long param1, long param2, int param3, int param4, long __functionAddress); + public static native void callPPV(long param0, int param1, int param2, int param3, long param4, long __functionAddress); + public static native void callPPV(int param0, int param1, int param2, int param3, long param4, long param5, long __functionAddress); + public static native void callPPV(int param0, int param1, long param2, int param3, int param4, long param5, long __functionAddress); + public static native void callPPV(int param0, int param1, long param2, long param3, int param4, int param5, long __functionAddress); + public static native void callPPV(int param0, long param1, long param2, int param3, int param4, int param5, long __functionAddress); + public static native void callPPV(int param0, int param1, int param2, int param3, int param4, long param5, long param6, long __functionAddress); + public static native void callPPV(int param0, int param1, int param2, long param3, int param4, int param5, long param6, long __functionAddress); + public static native void callPPV(int param0, int param1, long param2, int param3, int param4, int param5, long param6, long __functionAddress); + public static native void callPPV(int param0, int param1, long param2, long param3, int param4, int param5, int param6, long __functionAddress); + public static native void callPPV(int param0, int param1, int param2, int param3, int param4, int param5, long param6, long param7, long __functionAddress); + public static native void callPPV(int param0, int param1, int param2, int param3, long param4, int param5, int param6, long param7, long __functionAddress); + public static native void callPPV(int param0, int param1, long param2, int param3, int param4, int param5, int param6, long param7, long __functionAddress); + public static native void callPPV(int param0, int param1, int param2, long param3, int param4, float param5, float param6, int param7, long param8, long __functionAddress); + public static native void callPPV(int param0, int param1, long param2, int param3, int param4, int param5, int param6, int param7, long param8, long __functionAddress); + public static native void callPPV(int param0, int param1, long param2, int param3, int param4, int param5, long param6, int param7, int param8, float param9, long __functionAddress); + public static native void callPJJV(long param0, long param1, long param2, long __functionAddress); + public static native void callPJPV(long param0, long param1, long param2, long __functionAddress); + public static native void callPPNV(long param0, long param1, long param2, long __functionAddress); + public static native void callPPPV(long param0, long param1, long param2, long __functionAddress); + public static native void callJJJV(int param0, long param1, long param2, long param3, long __functionAddress); + public static native void callPJJV(long param0, long param1, long param2, int param3, long __functionAddress); + public static native void callPJPV(long param0, long param1, int param2, long param3, long __functionAddress); + public static native void callPPPV(int param0, long param1, long param2, long param3, long __functionAddress); + public static native void callPPPV(long param0, int param1, long param2, long param3, long __functionAddress); + public static native void callPPPV(long param0, long param1, int param2, long param3, long __functionAddress); + public static native void callJJJV(int param0, int param1, long param2, long param3, long param4, long __functionAddress); + public static native void callPJJV(long param0, int param1, long param2, long param3, int param4, long __functionAddress); + public static native void callPJJV(long param0, long param1, long param2, int param3, int param4, long __functionAddress); + public static native void callPPPV(int param0, int param1, long param2, long param3, long param4, long __functionAddress); + public static native void callPPPV(int param0, long param1, int param2, long param3, long param4, long __functionAddress); + public static native void callPPPV(int param0, long param1, long param2, int param3, long param4, long __functionAddress); + public static native void callPPPV(int param0, long param1, long param2, long param3, int param4, long __functionAddress); + public static native void callPPPV(long param0, int param1, int param2, long param3, long param4, long __functionAddress); + public static native void callPPPV(long param0, int param1, long param2, int param3, long param4, long __functionAddress); + public static native void callPJPV(long param0, int param1, long param2, int param3, int param4, long param5, long __functionAddress); + public static native void callPJPV(long param0, long param1, int param2, int param3, int param4, long param5, long __functionAddress); + public static native void callPPJV(long param0, int param1, long param2, int param3, long param4, int param5, long __functionAddress); + public static native void callPPPV(int param0, int param1, int param2, long param3, long param4, long param5, long __functionAddress); + public static native void callPPPV(int param0, int param1, long param2, int param3, long param4, long param5, long __functionAddress); + public static native void callPPPV(int param0, long param1, int param2, long param3, int param4, long param5, long __functionAddress); + public static native void callPJJV(long param0, int param1, int param2, long param3, long param4, int param5, int param6, long __functionAddress); + public static native void callPPPV(int param0, int param1, int param2, int param3, long param4, long param5, long param6, long __functionAddress); + public static native void callPPPV(int param0, int param1, long param2, long param3, int param4, int param5, long param6, long __functionAddress); + public static native void callPPPV(int param0, int param1, int param2, int param3, long param4, int param5, long param6, long param7, long __functionAddress); + public static native void callPPPV(long param0, int param1, int param2, int param3, int param4, int param5, long param6, long param7, long __functionAddress); + public static native void callPPPV(long param0, long param1, int param2, int param3, int param4, int param5, int param6, int param7, long param8, int param9, int param10, int param11, int param12, int param13, int param14, int param15, int param16, int param17, long __functionAddress); + public static native void callPJJPV(long param0, long param1, long param2, long param3, long __functionAddress); + public static native void callPJPPV(long param0, long param1, long param2, long param3, long __functionAddress); + public static native void callPPPNV(long param0, long param1, long param2, long param3, long __functionAddress); + public static native void callPPPPV(long param0, long param1, long param2, long param3, long __functionAddress); + public static native void callJJJJV(int param0, long param1, long param2, long param3, long param4, long __functionAddress); + public static native void callPJJJV(long param0, long param1, long param2, long param3, int param4, long __functionAddress); + public static native void callPJJPV(long param0, long param1, long param2, int param3, long param4, long __functionAddress); + public static native void callPPPPV(long param0, long param1, long param2, long param3, int param4, long __functionAddress); + public static native void callJJJJV(int param0, int param1, long param2, long param3, long param4, long param5, long __functionAddress); + public static native void callPJJPV(long param0, long param1, int param2, long param3, int param4, long param5, long __functionAddress); + public static native void callPJJPV(long param0, long param1, long param2, int param3, int param4, long param5, long __functionAddress); + public static native void callPJPPV(long param0, long param1, int param2, long param3, int param4, long param5, long __functionAddress); + public static native void callPPPPV(int param0, long param1, int param2, long param3, long param4, long param5, long __functionAddress); + public static native void callPPPPV(int param0, long param1, long param2, long param3, long param4, int param5, long __functionAddress); + public static native void callPPPPV(long param0, int param1, int param2, long param3, long param4, long param5, long __functionAddress); + public static native void callPJJPV(long param0, long param1, int param2, long param3, int param4, int param5, long param6, long __functionAddress); + public static native void callPPPPV(int param0, int param1, int param2, long param3, long param4, long param5, long param6, long __functionAddress); + public static native void callPPPPV(int param0, int param1, long param2, long param3, long param4, long param5, int param6, long __functionAddress); + public static native void callPJJPV(long param0, long param1, int param2, long param3, int param4, int param5, long param6, int param7, long __functionAddress); + public static native void callPJPPV(long param0, int param1, long param2, int param3, int param4, long param5, int param6, long param7, long __functionAddress); + public static native void callPPPPV(long param0, int param1, int param2, int param3, int param4, long param5, int param6, long param7, int param8, long param9, long __functionAddress); + public static native void callPJJJPV(long param0, long param1, long param2, long param3, long param4, long __functionAddress); + public static native void callPJJJJV(long param0, long param1, long param2, long param3, long param4, int param5, int param6, long __functionAddress); + public static native void callPPPPPV(int param0, int param1, long param2, long param3, long param4, long param5, long param6, long __functionAddress); + public static native void callPJJJJV(long param0, long param1, int param2, int param3, long param4, long param5, long param6, int param7, long __functionAddress); + public static native void callPJPPPV(long param0, int param1, int param2, long param3, long param4, int param5, long param6, long param7, long __functionAddress); + public static native void callPPPPPV(long param0, int param1, long param2, int param3, int param4, int param5, long param6, int param7, long param8, int param9, long param10, long __functionAddress); + public static native void callPPPPPPV(long param0, long param1, long param2, int param3, int param4, long param5, long param6, long param7, long __functionAddress); + public static native void callPPPPPPPV(int param0, int param1, int param2, long param3, int param4, long param5, long param6, long param7, long param8, long param9, long param10, long __functionAddress); + public static native void callPPJJJJJJV(long param0, long param1, long param2, long param3, int param4, long param5, long param6, long param7, long param8, long __functionAddress); + public static native void callPJJJJJJJJJJJV(long param0, long param1, long param2, long param3, long param4, long param5, long param6, long param7, long param8, long param9, long param10, long param11, int param12, int param13, int param14, long __functionAddress); + public static native boolean callZ(int param0, long __functionAddress); + public static native boolean callZ(int param0, int param1, long __functionAddress); + public static native boolean callZ(int param0, float param1, float param2, long __functionAddress); + public static native boolean callZ(int param0, int param1, float param2, float param3, long __functionAddress); + public static native boolean callJZ(long param0, long __functionAddress); + public static native boolean callPZ(long param0, long __functionAddress); + public static native boolean callJZ(int param0, long param1, long __functionAddress); + public static native boolean callPZ(int param0, long param1, long __functionAddress); + public static native boolean callJZ(int param0, long param1, int param2, long __functionAddress); + public static native boolean callPPZ(int param0, long param1, long param2, long __functionAddress); + public static native boolean callPPPPZ(int param0, int param1, int param2, float param3, long param4, long param5, long param6, long param7, long __functionAddress); + + // Array API + + public static native int invokePPI(int param0, long param1, @Nullable int[] param2, long __functionAddress); + public static native int invokePPPPI(long param0, long param1, long param2, @Nullable long[] param3, long __functionAddress); + public static native int invokePNNPPPI(long param0, long param1, long param2, int param3, int param4, @Nullable int[] param5, @Nullable int[] param6, long param7, long __functionAddress); + public static native long invokePPP(long param0, @Nullable int[] param1, long __functionAddress); + public static native void invokePV(int param0, @Nullable double[] param1, long __functionAddress); + public static native void invokePV(int param0, @Nullable float[] param1, long __functionAddress); + public static native void invokePV(int param0, @Nullable int[] param1, long __functionAddress); + public static native void invokePV(int param0, int param1, @Nullable double[] param2, long __functionAddress); + public static native void invokePV(int param0, int param1, @Nullable float[] param2, long __functionAddress); + public static native void invokePV(int param0, int param1, @Nullable int[] param2, long __functionAddress); + public static native void invokePV(int param0, int param1, @Nullable long[] param2, long __functionAddress); + public static native void invokePV(int param0, int param1, @Nullable float[] param2, int param3, int param4, long __functionAddress); + public static native void invokePV(int param0, int param1, @Nullable int[] param2, int param3, int param4, long __functionAddress); + public static native void invokePV(int param0, int param1, @Nullable short[] param2, int param3, int param4, long __functionAddress); + public static native void invokePPV(long param0, @Nullable float[] param1, int param2, long __functionAddress); + public static native void invokePPV(long param0, @Nullable int[] param1, int param2, long __functionAddress); + public static native void invokePPV(long param0, @Nullable short[] param1, int param2, long __functionAddress); + public static native void invokePPV(long param0, int param1, int param2, @Nullable int[] param3, long __functionAddress); + public static native void invokePPV(long param0, int param1, int param2, @Nullable long[] param3, long __functionAddress); + public static native void invokePNPV(long param0, long param1, @Nullable short[] param2, long __functionAddress); + public static native void invokePPPV(long param0, @Nullable double[] param1, @Nullable double[] param2, long __functionAddress); + public static native void invokePPPV(long param0, @Nullable float[] param1, @Nullable float[] param2, long __functionAddress); + public static native void invokePPPV(long param0, @Nullable int[] param1, @Nullable int[] param2, long __functionAddress); + public static native void invokePPPV(@Nullable int[] param0, @Nullable int[] param1, @Nullable int[] param2, long __functionAddress); + public static native void invokePPPV(int param0, @Nullable float[] param1, @Nullable float[] param2, @Nullable float[] param3, long __functionAddress); + public static native void invokePPPV(int param0, int param1, @Nullable double[] param2, @Nullable double[] param3, @Nullable double[] param4, long __functionAddress); + public static native void invokePPPV(int param0, int param1, @Nullable float[] param2, @Nullable float[] param3, @Nullable float[] param4, long __functionAddress); + public static native void invokePPPV(int param0, int param1, @Nullable long[] param2, @Nullable long[] param3, @Nullable long[] param4, long __functionAddress); + public static native void invokePNPPV(long param0, long param1, long param2, @Nullable short[] param3, long __functionAddress); + public static native void invokePPPPPV(long param0, @Nullable int[] param1, @Nullable int[] param2, @Nullable int[] param3, @Nullable int[] param4, long __functionAddress); + public static native boolean invokePPZ(long param0, @Nullable int[] param1, long __functionAddress); + public static native int callPI(@Nullable int[] param0, long __functionAddress); + public static native int callPI(int param0, @Nullable int[] param1, long __functionAddress); + public static native int callPI(@Nullable int[] param0, int param1, long __functionAddress); + public static native int callPI(int param0, int param1, @Nullable int[] param2, long __functionAddress); + public static native int callPI(int param0, @Nullable int[] param1, int param2, long __functionAddress); + public static native int callPI(int param0, int param1, int param2, @Nullable int[] param3, long __functionAddress); + public static native int callPI(int param0, int param1, int param2, int param3, @Nullable float[] param4, long __functionAddress); + public static native int callPI(int param0, int param1, int param2, int param3, @Nullable int[] param4, long __functionAddress); + public static native int callPPI(long param0, @Nullable int[] param1, long __functionAddress); + public static native int callPPI(@Nullable int[] param0, long param1, long __functionAddress); + public static native int callPPI(int param0, long param1, @Nullable int[] param2, long __functionAddress); + public static native int callPPI(long param0, int param1, @Nullable int[] param2, long __functionAddress); + public static native int callPPI(long param0, int param1, @Nullable long[] param2, long __functionAddress); + public static native int callPPI(long param0, int param1, int param2, @Nullable int[] param3, long __functionAddress); + public static native int callPJPI(long param0, long param1, @Nullable int[] param2, long __functionAddress); + public static native int callPPPI(long param0, long param1, @Nullable int[] param2, long __functionAddress); + public static native int callPPPI(long param0, long param1, @Nullable long[] param2, long __functionAddress); + public static native int callPPPI(long param0, @Nullable int[] param1, long param2, long __functionAddress); + public static native int callPPPI(long param0, @Nullable int[] param1, @Nullable int[] param2, long __functionAddress); + public static native int callPPPI(@Nullable int[] param0, long param1, @Nullable int[] param2, long __functionAddress); + public static native int callPJPI(long param0, int param1, long param2, @Nullable int[] param3, long __functionAddress); + public static native int callPJPI(long param0, long param1, int param2, @Nullable long[] param3, long __functionAddress); + public static native int callPPPI(long param0, int param1, @Nullable int[] param2, @Nullable int[] param3, long __functionAddress); + public static native int callPPPI(long param0, int param1, @Nullable int[] param2, @Nullable long[] param3, long __functionAddress); + public static native int callPPPI(long param0, long param1, int param2, @Nullable int[] param3, long __functionAddress); + public static native int callPPPI(long param0, long param1, int param2, @Nullable long[] param3, long __functionAddress); + public static native int callPPPI(long param0, long param1, @Nullable int[] param2, int param3, long __functionAddress); + public static native int callPPJI(long param0, int param1, @Nullable long[] param2, int param3, long param4, long __functionAddress); + public static native int callPPPI(long param0, int param1, int param2, int param3, @Nullable int[] param4, @Nullable float[] param5, long __functionAddress); + public static native int callPPPI(long param0, int param1, int param2, int param3, @Nullable int[] param4, @Nullable int[] param5, long __functionAddress); + public static native int callPJPPI(long param0, long param1, long param2, @Nullable long[] param3, long __functionAddress); + public static native int callPJPPI(long param0, long param1, @Nullable int[] param2, long param3, long __functionAddress); + public static native int callPJPPI(long param0, long param1, @Nullable int[] param2, @Nullable int[] param3, long __functionAddress); + public static native int callPJPPI(long param0, long param1, @Nullable int[] param2, @Nullable long[] param3, long __functionAddress); + public static native int callPPNPI(long param0, long param1, long param2, @Nullable long[] param3, long __functionAddress); + public static native int callPPPPI(long param0, long param1, long param2, @Nullable long[] param3, long __functionAddress); + public static native int callPPPPI(long param0, long param1, @Nullable int[] param2, long param3, long __functionAddress); + public static native int callPPPPI(long param0, long param1, @Nullable int[] param2, @Nullable int[] param3, long __functionAddress); + public static native int callPJPPI(long param0, long param1, int param2, long param3, @Nullable int[] param4, long __functionAddress); + public static native int callPJPPI(long param0, long param1, int param2, @Nullable int[] param3, @Nullable int[] param4, long __functionAddress); + public static native int callPPPPI(long param0, int param1, long param2, long param3, @Nullable long[] param4, long __functionAddress); + public static native int callPPPPI(long param0, int param1, long param2, @Nullable long[] param3, @Nullable long[] param4, long __functionAddress); + public static native int callPPPPI(long param0, long param1, long param2, int param3, @Nullable int[] param4, long __functionAddress); + public static native int callPPPPI(long param0, @Nullable int[] param1, long param2, int param3, @Nullable int[] param4, long __functionAddress); + public static native int callPPPPI(long param0, int param1, int param2, @Nullable long[] param3, @Nullable int[] param4, @Nullable int[] param5, long __functionAddress); + public static native int callPPPPI(int param0, @Nullable int[] param1, @Nullable long[] param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, int param11, int param12, int param13, int param14, int param15, int param16, int param17, int param18, int param19, int param20, @Nullable int[] param21, @Nullable long[] param22, long __functionAddress); + public static native int callPJPPPI(long param0, long param1, long param2, long param3, @Nullable long[] param4, long __functionAddress); + public static native int callPPPPPI(long param0, long param1, @Nullable int[] param2, @Nullable int[] param3, @Nullable int[] param4, long __functionAddress); + public static native int callPPPPPI(long param0, long param1, @Nullable int[] param2, @Nullable int[] param3, @Nullable long[] param4, long __functionAddress); + public static native int callPPPPPI(long param0, @Nullable int[] param1, @Nullable int[] param2, @Nullable int[] param3, long param4, long __functionAddress); + public static native int callPJPPPI(long param0, long param1, int param2, long param3, long param4, @Nullable long[] param5, long __functionAddress); + public static native int callPPPPPI(long param0, @Nullable int[] param1, @Nullable float[] param2, int param3, @Nullable int[] param4, @Nullable int[] param5, long __functionAddress); + public static native int callPPPPPI(int param0, int param1, @Nullable int[] param2, @Nullable int[] param3, @Nullable int[] param4, @Nullable int[] param5, long param6, long __functionAddress); + public static native int callPJPPJI(long param0, long param1, int param2, int param3, long param4, @Nullable int[] param5, long param6, int param7, long __functionAddress); + public static native int callPJPPJI(long param0, long param1, int param2, int param3, long param4, @Nullable long[] param5, long param6, int param7, long __functionAddress); + public static native int callPJJJJPI(long param0, long param1, long param2, long param3, long param4, @Nullable int[] param5, long __functionAddress); + public static native int callPPPPPPI(long param0, @Nullable int[] param1, @Nullable int[] param2, @Nullable int[] param3, @Nullable int[] param4, @Nullable int[] param5, long __functionAddress); + public static native int callPPPPPPI(int param0, int param1, @Nullable int[] param2, @Nullable int[] param3, @Nullable int[] param4, @Nullable int[] param5, @Nullable int[] param6, long param7, long __functionAddress); + public static native long callPP(@Nullable int[] param0, long __functionAddress); + public static native long callPPP(long param0, @Nullable int[] param1, long __functionAddress); + public static native long callPPP(int param0, long param1, @Nullable int[] param2, long __functionAddress); + public static native long callPPP(long param0, int param1, @Nullable int[] param2, long __functionAddress); + public static native long callPPP(int param0, int param1, int param2, @Nullable int[] param3, @Nullable int[] param4, long __functionAddress); + public static native long callPPP(long param0, int param1, int param2, int param3, @Nullable int[] param4, long __functionAddress); + public static native long callPPPP(long param0, long param1, @Nullable int[] param2, long __functionAddress); + public static native long callPPPP(long param0, int param1, @Nullable int[] param2, long param3, long __functionAddress); + public static native long callPPPP(long param0, long param1, int param2, @Nullable int[] param3, long __functionAddress); + public static native long callPPPP(long param0, long param1, int param2, int param3, @Nullable int[] param4, long __functionAddress); + public static native long callPPNPP(long param0, long param1, long param2, @Nullable int[] param3, long __functionAddress); + public static native long callPPPPP(long param0, long param1, long param2, @Nullable int[] param3, long __functionAddress); + public static native long callPPPPP(long param0, int param1, long param2, long param3, @Nullable int[] param4, long __functionAddress); + public static native long callPPPPP(long param0, long param1, int param2, long param3, @Nullable int[] param4, long __functionAddress); + public static native long callPPPPP(long param0, long param1, long param2, int param3, @Nullable int[] param4, long __functionAddress); + public static native long callPPPPPPPP(int param0, @Nullable int[] param1, @Nullable long[] param2, int param3, int param4, int param5, int param6, long param7, long param8, long param9, int param10, @Nullable int[] param11, @Nullable long[] param12, long __functionAddress); + public static native void callPV(@Nullable double[] param0, long __functionAddress); + public static native void callPV(@Nullable float[] param0, long __functionAddress); + public static native void callPV(@Nullable int[] param0, long __functionAddress); + public static native void callPV(@Nullable short[] param0, long __functionAddress); + public static native void callPV(int param0, @Nullable double[] param1, long __functionAddress); + public static native void callPV(int param0, @Nullable float[] param1, long __functionAddress); + public static native void callPV(int param0, @Nullable int[] param1, long __functionAddress); + public static native void callPV(int param0, @Nullable long[] param1, long __functionAddress); + public static native void callPV(int param0, @Nullable short[] param1, long __functionAddress); + public static native void callPV(int param0, int param1, @Nullable double[] param2, long __functionAddress); + public static native void callPV(int param0, int param1, @Nullable float[] param2, long __functionAddress); + public static native void callPV(int param0, int param1, @Nullable int[] param2, long __functionAddress); + public static native void callPV(int param0, int param1, @Nullable long[] param2, long __functionAddress); + public static native void callPV(int param0, int param1, @Nullable short[] param2, long __functionAddress); + public static native void callPV(int param0, @Nullable int[] param1, int param2, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, @Nullable double[] param3, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, @Nullable float[] param3, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, @Nullable int[] param3, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, @Nullable long[] param3, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, @Nullable short[] param3, long __functionAddress); + public static native void callPV(int param0, int param1, boolean param2, @Nullable double[] param3, long __functionAddress); + public static native void callPV(int param0, int param1, boolean param2, @Nullable float[] param3, long __functionAddress); + public static native void callPV(int param0, int param1, boolean param2, @Nullable int[] param3, long __functionAddress); + public static native void callPV(int param0, int param1, @Nullable int[] param2, int param3, long __functionAddress); + public static native void callPV(int param0, @Nullable int[] param1, int param2, int param3, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, @Nullable double[] param4, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, @Nullable float[] param4, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, @Nullable int[] param4, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, @Nullable long[] param4, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, @Nullable short[] param4, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, boolean param3, @Nullable double[] param4, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, boolean param3, @Nullable float[] param4, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, @Nullable int[] param3, boolean param4, long __functionAddress); + public static native void callPV(int param0, int param1, @Nullable int[] param2, int param3, int param4, long __functionAddress); + public static native void callPV(int param0, boolean param1, int param2, int param3, @Nullable int[] param4, long __functionAddress); + public static native void callPV(int param0, double param1, double param2, int param3, int param4, @Nullable double[] param5, long __functionAddress); + public static native void callPV(int param0, float param1, float param2, int param3, int param4, @Nullable float[] param5, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, @Nullable double[] param5, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, @Nullable float[] param5, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, @Nullable int[] param5, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, @Nullable short[] param5, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, @Nullable int[] param4, boolean param5, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, boolean param3, int param4, @Nullable float[] param5, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, boolean param3, int param4, @Nullable int[] param5, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, boolean param3, int param4, @Nullable short[] param5, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, @Nullable double[] param6, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, @Nullable float[] param6, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, @Nullable int[] param6, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, @Nullable short[] param6, long __functionAddress); + public static native void callPV(int param0, int param1, @Nullable int[] param2, int param3, int param4, int param5, int param6, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, @Nullable double[] param7, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, @Nullable float[] param7, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, @Nullable int[] param7, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, @Nullable short[] param7, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, @Nullable double[] param8, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, @Nullable float[] param8, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, @Nullable int[] param8, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, @Nullable short[] param8, long __functionAddress); + public static native void callPV(int param0, double param1, double param2, int param3, int param4, double param5, double param6, int param7, int param8, @Nullable double[] param9, long __functionAddress); + public static native void callPV(int param0, float param1, float param2, int param3, int param4, float param5, float param6, int param7, int param8, @Nullable float[] param9, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, @Nullable double[] param9, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, @Nullable float[] param9, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, @Nullable int[] param9, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, @Nullable short[] param9, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, @Nullable double[] param10, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, @Nullable float[] param10, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, @Nullable int[] param10, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, @Nullable short[] param10, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, @Nullable double[] param11, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, @Nullable float[] param11, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, @Nullable int[] param11, long __functionAddress); + public static native void callPV(int param0, int param1, int param2, int param3, int param4, int param5, int param6, int param7, int param8, int param9, int param10, @Nullable short[] param11, long __functionAddress); + public static native void callPPV(long param0, @Nullable float[] param1, long __functionAddress); + public static native void callPPV(long param0, @Nullable int[] param1, long __functionAddress); + public static native void callPPV(@Nullable double[] param0, @Nullable double[] param1, long __functionAddress); + public static native void callPPV(@Nullable float[] param0, @Nullable float[] param1, long __functionAddress); + public static native void callPPV(@Nullable int[] param0, @Nullable int[] param1, long __functionAddress); + public static native void callPPV(@Nullable short[] param0, @Nullable short[] param1, long __functionAddress); + public static native void callPPV(int param0, long param1, @Nullable int[] param2, long __functionAddress); + public static native void callPPV(int param0, @Nullable int[] param1, @Nullable float[] param2, long __functionAddress); + public static native void callPPV(int param0, @Nullable int[] param1, @Nullable int[] param2, long __functionAddress); + public static native void callPPV(int param0, @Nullable int[] param1, @Nullable long[] param2, long __functionAddress); + public static native void callPPV(@Nullable int[] param0, int param1, @Nullable int[] param2, long __functionAddress); + public static native void callPPV(int param0, int param1, long param2, @Nullable int[] param3, long __functionAddress); + public static native void callPPV(int param0, int param1, @Nullable int[] param2, long param3, long __functionAddress); + public static native void callPPV(int param0, int param1, @Nullable int[] param2, @Nullable float[] param3, long __functionAddress); + public static native void callPPV(int param0, int param1, @Nullable int[] param2, @Nullable int[] param3, long __functionAddress); + public static native void callPPV(int param0, int param1, @Nullable int[] param2, @Nullable long[] param3, long __functionAddress); + public static native void callPPV(int param0, long param1, int param2, @Nullable int[] param3, long __functionAddress); + public static native void callPPV(int param0, long param1, @Nullable double[] param2, int param3, long __functionAddress); + public static native void callPPV(int param0, long param1, @Nullable float[] param2, int param3, long __functionAddress); + public static native void callPPV(int param0, long param1, @Nullable int[] param2, int param3, long __functionAddress); + public static native void callPPV(int param0, long param1, @Nullable long[] param2, int param3, long __functionAddress); + public static native void callPPV(int param0, long param1, @Nullable short[] param2, int param3, long __functionAddress); + public static native void callPPV(int param0, @Nullable int[] param1, @Nullable int[] param2, int param3, long __functionAddress); + public static native void callPPV(int param0, @Nullable long[] param1, @Nullable int[] param2, int param3, long __functionAddress); + public static native void callPPV(int param0, int param1, int param2, long param3, @Nullable int[] param4, long __functionAddress); + public static native void callPPV(int param0, int param1, int param2, @Nullable int[] param3, long param4, long __functionAddress); + public static native void callPPV(int param0, int param1, int param2, @Nullable int[] param3, @Nullable int[] param4, long __functionAddress); + public static native void callPPV(int param0, int param1, long param2, @Nullable int[] param3, int param4, long __functionAddress); + public static native void callPPV(int param0, int param1, @Nullable int[] param2, int param3, @Nullable int[] param4, long __functionAddress); + public static native void callPPV(int param0, @Nullable int[] param1, int param2, long param3, int param4, long __functionAddress); + public static native void callPPV(int param0, @Nullable int[] param1, int param2, @Nullable int[] param3, int param4, long __functionAddress); + public static native void callPPV(int param0, @Nullable int[] param1, long param2, int param3, int param4, long __functionAddress); + public static native void callPPV(long param0, int param1, int param2, int param3, @Nullable int[] param4, long __functionAddress); + public static native void callPPV(int param0, int param1, int param2, int param3, @Nullable int[] param4, long param5, long __functionAddress); + public static native void callPPV(int param0, int param1, long param2, int param3, int param4, @Nullable float[] param5, long __functionAddress); + public static native void callPPV(int param0, int param1, long param2, int param3, int param4, @Nullable short[] param5, long __functionAddress); + public static native void callPPV(int param0, int param1, @Nullable int[] param2, long param3, int param4, int param5, long __functionAddress); + public static native void callPPV(int param0, int param1, int param2, long param3, int param4, int param5, @Nullable float[] param6, long __functionAddress); + public static native void callPPV(int param0, int param1, long param2, int param3, int param4, int param5, @Nullable float[] param6, long __functionAddress); + public static native void callPPV(int param0, int param1, int param2, int param3, long param4, int param5, int param6, @Nullable float[] param7, long __functionAddress); + public static native void callPPV(int param0, int param1, int param2, int param3, long param4, int param5, int param6, @Nullable short[] param7, long __functionAddress); + public static native void callPPV(int param0, int param1, long param2, int param3, int param4, int param5, int param6, @Nullable float[] param7, long __functionAddress); + public static native void callPPV(int param0, int param1, int param2, long param3, int param4, float param5, float param6, int param7, @Nullable float[] param8, long __functionAddress); + public static native void callPPV(int param0, int param1, long param2, int param3, int param4, int param5, int param6, int param7, @Nullable float[] param8, long __functionAddress); + public static native void callPJPV(long param0, long param1, @Nullable long[] param2, long __functionAddress); + public static native void callPPPV(long param0, @Nullable int[] param1, long param2, long __functionAddress); + public static native void callPPPV(int param0, long param1, long param2, @Nullable double[] param3, long __functionAddress); + public static native void callPPPV(int param0, long param1, long param2, @Nullable float[] param3, long __functionAddress); + public static native void callPPPV(int param0, long param1, long param2, @Nullable int[] param3, long __functionAddress); + public static native void callPPPV(int param0, long param1, long param2, @Nullable long[] param3, long __functionAddress); + public static native void callPPPV(int param0, long param1, long param2, @Nullable short[] param3, long __functionAddress); + public static native void callPPPV(long param0, int param1, @Nullable int[] param2, long param3, long __functionAddress); + public static native void callPPPV(long param0, int param1, @Nullable long[] param2, long param3, long __functionAddress); + public static native void callPPPV(long param0, long param1, int param2, @Nullable int[] param3, long __functionAddress); + public static native void callPPPV(int param0, int param1, long param2, long param3, @Nullable double[] param4, long __functionAddress); + public static native void callPPPV(int param0, int param1, long param2, long param3, @Nullable float[] param4, long __functionAddress); + public static native void callPPPV(int param0, int param1, long param2, long param3, @Nullable int[] param4, long __functionAddress); + public static native void callPPPV(int param0, int param1, long param2, long param3, @Nullable short[] param4, long __functionAddress); + public static native void callPPPV(int param0, int param1, @Nullable int[] param2, long param3, @Nullable int[] param4, long __functionAddress); + public static native void callPPPV(int param0, int param1, @Nullable int[] param2, @Nullable int[] param3, long param4, long __functionAddress); + public static native void callPPPV(int param0, long param1, int param2, @Nullable int[] param3, long param4, long __functionAddress); + public static native void callPPPV(int param0, long param1, int param2, @Nullable int[] param3, @Nullable int[] param4, long __functionAddress); + public static native void callPPPV(int param0, @Nullable int[] param1, @Nullable int[] param2, int param3, @Nullable int[] param4, long __functionAddress); + public static native void callPPPV(long param0, int param1, int param2, @Nullable int[] param3, @Nullable int[] param4, long __functionAddress); + public static native void callPPPV(long param0, int param1, int param2, @Nullable long[] param3, @Nullable long[] param4, long __functionAddress); + public static native void callPJPV(long param0, long param1, int param2, int param3, int param4, @Nullable double[] param5, long __functionAddress); + public static native void callPJPV(long param0, long param1, int param2, int param3, int param4, @Nullable float[] param5, long __functionAddress); + public static native void callPJPV(long param0, long param1, int param2, int param3, int param4, @Nullable int[] param5, long __functionAddress); + public static native void callPJPV(long param0, long param1, int param2, int param3, int param4, @Nullable long[] param5, long __functionAddress); + public static native void callPJPV(long param0, long param1, int param2, int param3, int param4, @Nullable short[] param5, long __functionAddress); + public static native void callPPJV(long param0, int param1, @Nullable long[] param2, int param3, long param4, int param5, long __functionAddress); + public static native void callPPPV(int param0, int param1, int param2, @Nullable int[] param3, long param4, long param5, long __functionAddress); + public static native void callPPPV(int param0, int param1, int param2, @Nullable int[] param3, long param4, @Nullable int[] param5, long __functionAddress); + public static native void callPPPV(int param0, int param1, @Nullable int[] param2, int param3, @Nullable int[] param4, @Nullable int[] param5, long __functionAddress); + public static native void callPPPV(int param0, @Nullable int[] param1, int param2, long param3, int param4, @Nullable int[] param5, long __functionAddress); + public static native void callPPPV(int param0, int param1, long param2, long param3, int param4, int param5, @Nullable float[] param6, long __functionAddress); + public static native void callPPPV(int param0, int param1, long param2, long param3, int param4, int param5, @Nullable int[] param6, long __functionAddress); + public static native void callPPPV(int param0, int param1, long param2, long param3, int param4, int param5, @Nullable short[] param6, long __functionAddress); + public static native void callPPPV(int param0, int param1, int param2, int param3, @Nullable int[] param4, int param5, @Nullable int[] param6, @Nullable float[] param7, long __functionAddress); + public static native void callPPPV(int param0, int param1, int param2, int param3, @Nullable int[] param4, int param5, @Nullable int[] param6, @Nullable int[] param7, long __functionAddress); + public static native void callPPPV(long param0, int param1, int param2, int param3, int param4, int param5, @Nullable int[] param6, long param7, long __functionAddress); + public static native void callPJPPV(long param0, long param1, @Nullable int[] param2, long param3, long __functionAddress); + public static native void callPPPPV(long param0, long param1, @Nullable int[] param2, long param3, long __functionAddress); + public static native void callPPPPV(@Nullable long[] param0, @Nullable int[] param1, @Nullable int[] param2, @Nullable int[] param3, int param4, long __functionAddress); + public static native void callPPPPV(int param0, long param1, @Nullable int[] param2, @Nullable int[] param3, @Nullable int[] param4, int param5, long __functionAddress); + public static native void callPPPPV(long param0, int param1, int param2, @Nullable long[] param3, @Nullable long[] param4, @Nullable long[] param5, long __functionAddress); + public static native void callPPPPV(int param0, int param1, int param2, @Nullable int[] param3, @Nullable int[] param4, @Nullable int[] param5, long param6, long __functionAddress); + public static native void callPPPPV(int param0, int param1, long param2, long param3, @Nullable int[] param4, @Nullable int[] param5, int param6, long __functionAddress); + public static native void callPJPPV(long param0, int param1, long param2, int param3, int param4, @Nullable long[] param5, int param6, @Nullable int[] param7, long __functionAddress); + public static native void callPJJJPV(long param0, long param1, long param2, long param3, @Nullable double[] param4, long __functionAddress); + public static native void callPJJJPV(long param0, long param1, long param2, long param3, @Nullable float[] param4, long __functionAddress); + public static native void callPJJJPV(long param0, long param1, long param2, long param3, @Nullable int[] param4, long __functionAddress); + public static native void callPJJJPV(long param0, long param1, long param2, long param3, @Nullable long[] param4, long __functionAddress); + public static native void callPJJJPV(long param0, long param1, long param2, long param3, @Nullable short[] param4, long __functionAddress); + public static native void callPPPPPV(int param0, int param1, long param2, @Nullable int[] param3, @Nullable int[] param4, @Nullable int[] param5, @Nullable int[] param6, long __functionAddress); + public static native void callPPPPPV(long param0, int param1, @Nullable long[] param2, int param3, int param4, int param5, long param6, int param7, long param8, int param9, long param10, long __functionAddress); + public static native void callPPPPPPPV(int param0, int param1, int param2, long param3, int param4, long param5, @Nullable int[] param6, @Nullable int[] param7, @Nullable int[] param8, @Nullable int[] param9, @Nullable long[] param10, long __functionAddress); + public static native boolean callPPZ(int param0, @Nullable int[] param1, long param2, long __functionAddress); + public static native boolean callPPPPZ(int param0, int param1, int param2, float param3, @Nullable float[] param4, @Nullable float[] param5, @Nullable float[] param6, @Nullable float[] param7, long __functionAddress); + +} diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/Library.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/Library.java new file mode 100644 index 00000000..3ef66d06 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/Library.java @@ -0,0 +1,578 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import org.lwjgl.*; + +import javax.annotation.*; +import java.io.*; +import java.lang.reflect.*; +import java.net.*; +import java.nio.channels.*; +import java.nio.file.*; +import java.security.*; +import java.util.*; +import java.util.function.*; +import java.util.regex.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; + +/** + * Initializes the LWJGL shared library and handles loading additional shared libraries. + * + * @see Configuration#LIBRARY_NAME + * @see Configuration#LIBRARY_PATH + */ +public final class Library { + + /** The LWJGL shared library name. */ + public static final String JNI_LIBRARY_NAME = Configuration.LIBRARY_NAME.get(Platform.mapLibraryNameBundled("lwjgl")); + + static final String JAVA_LIBRARY_PATH = "java.library.path"; + + private static final Pattern PATH_SEPARATOR = Pattern.compile(File.pathSeparator); + + private static final Pattern NATIVES_JAR = Pattern.compile("/[\\w-]+?-natives-\\w+.jar!/"); + + static { + if (DEBUG) { + apiLog(("JNI_LIBRARY_NAME: "+JNI_LIBRARY_NAME)); + apiLog("Version: " + Version.getVersion()); + apiLog("\t OS: " + System.getProperty("os.name") + " v" + System.getProperty("os.version")); + apiLog("\tJRE: " + System.getProperty("java.version") + " " + System.getProperty("os.arch")); + apiLog( + "\tJVM: " + System.getProperty("java.vm.name") + " v" + System.getProperty("java.vm.version") + " by " + System.getProperty("java.vm.vendor") + ); + } + + loadSystem("org.lwjgl", JNI_LIBRARY_NAME); + } + + private Library() {} + + /** Ensures that the LWJGL shared library has been loaded. */ + public static void initialize() { + // intentionally empty to trigger static initializer + } + + /** Calls {@link #loadSystem(Consumer, Consumer, Class, String, String)} using {@code Library.class} as the context parameter. */ + public static void loadSystem(String module, String name) throws UnsatisfiedLinkError { + loadSystem(System::load, System::loadLibrary, Library.class, module, name); + } + + /** + * Loads a JNI shared library. + * + * @param load should be the {@code System::load} expression. This ensures that {@code System.load} has the same caller as this method. + * @param loadLibrary should be the {@code System::loadLibrary} expression. This ensures that {@code System.loadLibrary} has the same caller as this + * method. + * @param context the class to use to discover the shared library in the classpath + * @param module the module to which the shared library belongs + * @param name the library name. If not an absolute path, it must be the plain library name, without an OS specific prefix or file extension (e.g. + * GL, not libGL.so) + * + * @throws UnsatisfiedLinkError if the library could not be loaded + */ + @SuppressWarnings("try") + public static void loadSystem( + Consumer load, + Consumer loadLibrary, + Class context, + String module, + String name + ) throws UnsatisfiedLinkError { + apiLog("Loading JNI library: " + name); + apiLog("\tModule: " + module); + + // METHOD 1: absolute path + if (Paths.get(name).isAbsolute()) { + load.accept(name); + apiLog("\tSuccess"); + return; + } + + String libName = Platform.get().mapLibraryName(name); + + boolean bundledWithLWJGL = name.contains("lwjgl"); + + // METHOD 2: org.lwjgl.librarypath + URL libURL = findResource(context, module, libName, bundledWithLWJGL); + if (libURL == null) { + if (loadSystemFromLibraryPath(load, context, module, libName, bundledWithLWJGL)) { + return; + } + } else { + // Always use the SLL if the library is found in the classpath, + // so that newer versions can be detected. + boolean debugLoader = Configuration.DEBUG_LOADER.get(false); + try { + String regular = getRegularFilePath(libURL); + if (regular != null) { + load.accept(regular); + apiLog("\tLoaded from classpath: " + regular); + return; + } + + if (debugLoader) { + apiLog("\tUsing SharedLibraryLoader..."); + } + // Extract from classpath and try org.lwjgl.librarypath + try (FileChannel ignored = SharedLibraryLoader.load(name, libName, libURL)) { + if (loadSystemFromLibraryPath(load, context, module, libName, bundledWithLWJGL)) { + return; + } + } + } catch (Exception e) { + if (debugLoader) { + e.printStackTrace(DEBUG_STREAM); + } + } + } + + String javaLibraryPath = System.getProperty(JAVA_LIBRARY_PATH); + + // METHOD 3: java.library.path (bundled only) + if (bundledWithLWJGL && javaLibraryPath != null) { + if (loadSystem(load, context, module, getBundledPath(module, libName), false, JAVA_LIBRARY_PATH, javaLibraryPath)) { + return; + } + } + + // METHOD 4: System.loadLibrary + try { + loadLibrary.accept(name); + + // Success, but java.library.path might be empty, or not include the library. + // In that case, ClassLoader::findLibrary was used to return the library path (e.g. OSGi does this with native libraries in bundles). + Path libFile = javaLibraryPath == null ? null : findFile(javaLibraryPath, module, libName, bundledWithLWJGL); + if (libFile != null) { + apiLog(String.format("\tLoaded from %s: %s", JAVA_LIBRARY_PATH, libFile)); + checkHash(context, libFile); + } else { + apiLog("\tLoaded from a ClassLoader provided path."); + } + return; + } catch (Throwable t) { + apiLog(String.format("\t%s not found in %s", libName, JAVA_LIBRARY_PATH)); + } + + printError(true); + throw new UnsatisfiedLinkError("Failed to locate library: " + libName); + } + + private static boolean loadSystemFromLibraryPath(Consumer load, Class context, String module, String libName, boolean bundledWithLWJGL) { + String paths = Configuration.LIBRARY_PATH.get(); + return paths != null && loadSystem(load, context, module, libName, bundledWithLWJGL, Configuration.LIBRARY_PATH.getProperty(), paths); + } + + private static boolean loadSystem(Consumer load, Class context, String module, String libName, boolean bundledWithLWJGL, String property, String paths) { + Path libFile = findFile(paths, module, libName, bundledWithLWJGL); + if (libFile == null) { + apiLog(String.format("\t%s not found in %s=%s", libName, property, paths)); + return false; + } + + load.accept(libFile.toAbsolutePath().toString()); + apiLog(String.format("\tLoaded from %s: %s", property, libFile)); + checkHash(context, libFile); + return true; + } + + /** Calls {@link #loadNative(Class, String, String)} using {@code Library.class} as the context parameter. */ + public static SharedLibrary loadNative(String module, String name) { + return loadNative(Library.class, module, name); + } + + /** + * Loads a shared library using OS-specific APIs (e.g. {@link org.lwjgl.system.windows.WinBase#LoadLibrary LoadLibrary} or + * {@link org.lwjgl.system.linux.DynamicLinkLoader#dlopen dlopen}). + * + * @param context the class to use to discover the shared library in the classpath + * @param module the module to which the shared library belongs + * @param name the library name. OS-specific prefixes and file extensions are optional (e.g. both {@code "GL"} and {@code "libGL.so.1"} are + * valid on Linux) + * + * @return the shared library + * + * @throws UnsatisfiedLinkError if the library could not be loaded + */ + @SuppressWarnings("try") + public static SharedLibrary loadNative(Class context, String module, String name) { + return loadNative(context, module, name, false); + } + + /** + * Loads a shared library using OS-specific APIs (e.g. {@link org.lwjgl.system.windows.WinBase#LoadLibrary LoadLibrary} or + * {@link org.lwjgl.system.linux.DynamicLinkLoader#dlopen dlopen}). + * + * @param context the class to use to discover the shared library in the classpath + * @param module the module to which the shared library belongs + * @param name the library name. OS-specific prefixes and file extensions are optional (e.g. both {@code "GL"} and {@code "libGL.so.1"} are + * valid on Linux) + * @param bundledWithLWJGL whether the default LWJGL distribution includes the shared library. If true, LWJGL will also try to find the shared library under + * the {@code //} subfolder. + * + * @return the shared library + * + * @throws UnsatisfiedLinkError if the library could not be loaded + */ + public static SharedLibrary loadNative(Class context, String module, String name, boolean bundledWithLWJGL) { + return loadNative(context, module, name, bundledWithLWJGL, true); + } + + @SuppressWarnings("try") + private static SharedLibrary loadNative(Class context, String module, String name, boolean bundledWithLWJGL, boolean printError) { + apiLog("Loading library: " + name); + apiLog("\tModule: " + module); + + // METHOD 1: absolute path + if (Paths.get(name).isAbsolute()) { + SharedLibrary lib = apiCreateLibrary(name); + apiLog("\tSuccess"); + return lib; + } + + String libName = Platform.get().mapLibraryName(name); + SharedLibrary lib; + + // METHOD 2: org.lwjgl.librarypath + URL libURL = findResource(context, module, libName, bundledWithLWJGL); + if (libURL == null) { + lib = loadNativeFromLibraryPath(context, module, libName, bundledWithLWJGL); + if (lib != null) { + return lib; + } + } else { + boolean debugLoader = Configuration.DEBUG_LOADER.get(false); + try { + String regular = getRegularFilePath(libURL); + if (regular != null) { + lib = apiCreateLibrary(regular); + apiLog("\tLoaded from classpath: " + regular); + return lib; + } + + // Always use the SLL if the library is found in the classpath, + // so that newer versions can be detected. + if (debugLoader) { + apiLog("\tUsing SharedLibraryLoader..."); + } + // Extract from classpath and try org.lwjgl.librarypath + try (FileChannel ignored = SharedLibraryLoader.load(name, libName, libURL)) { + lib = loadNativeFromLibraryPath(context, module, libName, bundledWithLWJGL); + if (lib != null) { + return lib; + } + } + } catch (Exception e) { + if (debugLoader) { + e.printStackTrace(DEBUG_STREAM); + } + } + } + + // Use method 4 before 3 for libraries not bundled with LWJGL. + if (!bundledWithLWJGL) { + lib = loadNativeFromSystem(libName); + if (lib != null) { + return lib; + } + } + + // METHOD 3: System.loadLibrary (emulated) + { + if (Configuration.EMULATE_SYSTEM_LOADLIBRARY.get(false)) { + // Try ClassLoader::findLibrary (e.g. OSGi bundle) + try { + Method findLibrary = ClassLoader.class.getDeclaredMethod("findLibrary", String.class); + findLibrary.setAccessible(true); + + String libPath = (String)findLibrary.invoke(context.getClassLoader(), name); + if (libPath != null) { + lib = apiCreateLibrary(libPath); + apiLog(String.format("\tLoaded from ClassLoader provided path: %s", libPath)); + return lib; + } + } catch (Exception ignored) { + // This will fail on JDK 9 without --add-opens java.base/java.lang=ALL-UNNAMED + } + } + + // Then java.library.path + String paths = System.getProperty(JAVA_LIBRARY_PATH); + if (paths != null) { + lib = loadNative(context, module, libName, bundledWithLWJGL, JAVA_LIBRARY_PATH, paths); + if (lib != null) { + return lib; + } + } + } + + // METHOD 4: system-specific + if (bundledWithLWJGL) { + lib = loadNativeFromSystem(libName); + if (lib != null) { + return lib; + } + } + + if (printError) { + printError(bundledWithLWJGL); + } + throw new UnsatisfiedLinkError("Failed to locate library: " + libName); + } + + @Nullable + private static SharedLibrary loadNativeFromSystem(String libName) { + SharedLibrary lib; + try { + lib = apiCreateLibrary(libName); + String path = lib.getPath(); + apiLog(path == null + ? "\tLoaded from system paths" + : "\tLoaded from system paths: " + path); + } catch (UnsatisfiedLinkError e) { + lib = null; + apiLog(String.format("\t%s not found in system paths", libName)); + } + return lib; + } + + @Nullable + private static SharedLibrary loadNativeFromLibraryPath(Class context, String module, String libName, boolean bundledWithLWJGL) { + String paths = Configuration.LIBRARY_PATH.get(); + if (paths == null) { + return null; + } + return loadNative(context, module, libName, bundledWithLWJGL, Configuration.LIBRARY_PATH.getProperty(), paths); + } + + @Nullable + private static SharedLibrary loadNative(Class context, String module, String libName, boolean bundledWithLWJGL, String property, String paths) { + Path libFile = findFile(paths, module, libName, bundledWithLWJGL); + if (libFile == null) { + apiLog(String.format("\t%s not found in %s=%s", libName, property, paths)); + return null; + } + + SharedLibrary lib = apiCreateLibrary(libFile.toAbsolutePath().toString()); + apiLog(String.format("\tLoaded from %s: %s", property, libFile)); + checkHash(context, libFile); + return lib; + } + + /** + * Loads a shared library using {@link #loadNative(String, String)} with the name specified by {@code name}. If {@code name} is not set, + * {@link #loadNative(String, String)} will be called with the names specified by {@code defaultNames}. The first successful will be returned. + * + * @param name a {@link Configuration} that specifies the library name + * @param defaultNames the default library name(s) + * + * @return the shared library + * + * @throws UnsatisfiedLinkError if the library could not be loaded + */ + public static SharedLibrary loadNative(Class context, String module, @Nullable Configuration name, String... defaultNames) { + return loadNative(context, module, name, null, defaultNames); + } + + /** + * Loads a shared library using {@link #loadNative(String, String)} with the name specified by {@code name}. If {@code name} is not set, + * {@link #loadNative(String, String)} will be called with the names specified by {@code defaultNames}. The first successful will be returned. If the library could + * not be loaded, the {@code fallback} will be called. + * + * @param name a {@link Configuration} that specifies the library name + * @param fallback fallback to use if everything else fails + * @param defaultNames the default library name(s) + * + * @return the shared library + * + * @throws UnsatisfiedLinkError if the library could not be loaded + */ + public static SharedLibrary loadNative(Class context, String module, @Nullable Configuration name, @Nullable Supplier fallback, String... defaultNames) { + if (defaultNames.length == 0) { + throw new IllegalArgumentException("No default names specified."); + } + + if (name != null) { + String libraryName = name.get(); + if (libraryName != null) { + return loadNative(context, module, libraryName); + } + } + + if (fallback == null && defaultNames.length <= 1) { + return loadNative(context, module, defaultNames[0]); + } + + try { + return loadNative(context, module, defaultNames[0], false, false); // try first + } catch (Throwable t) { + for (int i = 1; i < defaultNames.length; i++) { // try alternatives + try { + return loadNative(context, module, defaultNames[i], false, fallback == null && i == defaultNames.length - 1); + } catch (Throwable ignored) { + } + } + if (fallback != null) { + return fallback.get(); + } + throw t; // original error + } + } + + private static String getBundledPath(String module, String resource) { + return Platform.mapLibraryPathBundled(module.replace('.', '/') + "/" + resource); + } + + @Nullable + static URL findResource(Class context, String module, String resource, boolean bundledWithLWJGL) { + URL url = null; + if (bundledWithLWJGL) { + String bundledResource = getBundledPath(module, resource); + if (!bundledResource.equals(resource)) { + url = context.getClassLoader().getResource(bundledResource); + } + } + return url == null ? context.getClassLoader().getResource(resource) : url; + } + + @Nullable + static String getRegularFilePath(URL url) { + if (url.getProtocol().equals("file")) { + try { + Path path = Paths.get(url.toURI()); + if (path.isAbsolute() && Files.isReadable(path)) { + return path.toString(); + } + } catch (URISyntaxException ignored) { + } + } + return null; + } + + @Nullable + static Path findFile(String path, String module, String file, boolean bundledWithLWJGL) { + if (bundledWithLWJGL) { + String bundledFile = getBundledPath(module, file); + if (!bundledFile.equals(file)) { + Path p = findFile(path, bundledFile); + if (p != null) { + return p; + } + } + } + return findFile(path, file); + } + + @Nullable + private static Path findFile(String path, String file) { + for (String directory : PATH_SEPARATOR.split(path)) { + Path p = Paths.get(directory, file); + if (Files.isReadable(p)) { + return p; + } + } + return null; + } + + private static void printError(boolean bundledWithLWJGL) { + printError( + "[LWJGL] Failed to load a library. Possible solutions:\n" + (bundledWithLWJGL + ? "\ta) Add the directory that contains the shared library to -Djava.library.path or -Dorg.lwjgl.librarypath.\n" + + "\tb) Add the JAR that contains the shared library to the classpath." + : "\ta) Install the library or the driver that provides the library.\n" + + "\tb) Ensure that the library is accessible from the system library paths." + ) + ); + } + + static void printError(String message) { + DEBUG_STREAM.println(message); + if (!DEBUG) { + DEBUG_STREAM.println("[LWJGL] Enable debug mode with -Dorg.lwjgl.util.Debug=true for better diagnostics."); + if (!Configuration.DEBUG_LOADER.get(false)) { + DEBUG_STREAM.println("[LWJGL] Enable the SharedLibraryLoader debug mode with -Dorg.lwjgl.util.DebugLoader=true for better diagnostics."); + } + } + } + + /** + * Compares the shared library hash stored in the classpath, with the hash of the actual library loaded at runtime. + * + *

This check prints a simple warning when there's a hash mismatch, to help diagnose installation/classpath issues. It is not a security feature.

+ * + * @param context the class to use to discover the shared library hash in the classpath + * @param libFile the library file loaded + */ + private static void checkHash(Class context, Path libFile) { + if (!CHECKS) { + return; + } + + try { + URL classesURL = null; + URL nativesURL = null; + + Enumeration resources = context.getClassLoader().getResources(libFile.getFileName() + ".sha1"); + while (resources.hasMoreElements()) { + URL url = resources.nextElement(); + if (NATIVES_JAR.matcher(url.toExternalForm()).find()) { + nativesURL = url; + } else { + classesURL = url; + } + } + if (classesURL == null) { + return; + } + + byte[] expected = getSHA1(classesURL); + byte[] actual = DEBUG || nativesURL == null + ? getSHA1(libFile) + : getSHA1(nativesURL); + + if (!Arrays.equals(expected, actual)) { + DEBUG_STREAM.println( + "[LWJGL] [ERROR] Incompatible Java and native library versions detected.\n" + + "Possible reasons:\n" + + "\ta) -Djava.library.path is set to a folder containing shared libraries of an older LWJGL version.\n" + + "\tb) The classpath contains jar files of an older LWJGL version.\n" + + "Possible solutions:\n" + + "\ta) Make sure to not set -Djava.library.path (it is not needed for developing with LWJGL 3) or make\n" + + "\t sure the folder it points to contains the shared libraries of the correct LWJGL version.\n" + + "\tb) Check the classpath and make sure to only have jar files of the same LWJGL version in it."); + } + } catch (Throwable t) { + if (DEBUG) { + apiLog("Failed to verify native library."); + t.printStackTrace(); + } + } + } + + private static byte[] getSHA1(URL hashURL) throws IOException { + byte[] hash = new byte[20]; + try (InputStream sha1 = hashURL.openStream()) { + for (int i = 0; i < 20; i++) { + hash[i] = (byte)((Character.digit(sha1.read(), 16) << 4) | Character.digit(sha1.read(), 16)); + } + } + return hash; + } + + private static byte[] getSHA1(Path libFile) throws NoSuchAlgorithmException, IOException { + MessageDigest digest = MessageDigest.getInstance("SHA-1"); + try (InputStream input = Files.newInputStream(libFile)) { + byte[] buffer = new byte[8 * 1024]; + for (int n; (n = input.read(buffer)) != -1; ) { + digest.update(buffer, 0, n); + } + } + return digest.digest(); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/LibraryResource.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/LibraryResource.java new file mode 100644 index 00000000..c0a8b647 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/LibraryResource.java @@ -0,0 +1,224 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import javax.annotation.*; +import java.net.*; +import java.nio.channels.*; +import java.nio.file.*; +import java.util.function.*; + +import static org.lwjgl.system.APIUtil.*; + +/** + * Handles loading of native resources in LWJGL. [INTERNAL USE ONLY] + * + *

This class uses the same mechanism as {@link Library} for loading shared libraries. The resource name could be an absolute path, or a relative path that + * is resolved via {@code org.lwjgl.librarypath}, {@code java.library.path}, or even the class/module-path. When the resource is detected in the + * class/module-path, it is extracted automatically to {@code org.lwjgl.librarypath} via the {@code SharedLibraryLoader}.

+ */ +public final class LibraryResource { + + static { + Library.initialize(); + } + + private LibraryResource() {} + + /** Calls {@link #load(Class, String, String)} using {@code LibraryResource.class} as the context parameter. */ + public static Path load(String module, String name) { + return load(LibraryResource.class, module, name); + } + + /** + * Loads a library resource. + * + * @param context the class to use to discover the library resource in the classpath + * @param module the module to which the resource belongs + * @param name the resource name + * + * @return the library resource path + * + * @throws IllegalStateException if the resource could not be found + */ + @SuppressWarnings("try") + public static Path load(Class context, String module, String name) { + return load(context, module, name, false, true); + } + + /** + * Loads a library resource. + * + * @param context the class to use to discover the library resource in the classpath + * @param module the module to which the resource belongs + * @param name the resource name + * @param bundledWithLWJGL whether the default LWJGL distribution includes the resource. If true, LWJGL will also try to find the shared library under the + * {@code //} subfolder. + * + * @return the library resource path + * + * @throws IllegalStateException if the resource could not be found + */ + @SuppressWarnings("try") + public static Path load(Class context, String module, String name, boolean bundledWithLWJGL) { + return load(context, module, name, bundledWithLWJGL, true); + } + + @SuppressWarnings("try") + private static Path load(Class context, String module, String name, boolean bundledWithLWJGL, boolean printError) { + apiLog("Loading library resource: " + name); + apiLog("\tModule: " + module); + + // METHOD 1: absolute path + Path path = Paths.get(name); + if (path.isAbsolute()) { + if (!Files.exists(path)) { + if (printError) { + printError(); + } + throw new IllegalStateException("Failed to locate library resource: " + name); + } + apiLog("\tSuccess"); + return path; + } + + // METHOD 2: org.lwjgl.librarypath + URL resourceURL = Library.findResource(context, module, name, bundledWithLWJGL); + if (resourceURL == null) { + path = loadFromLibraryPath(module, name, bundledWithLWJGL); + if (path != null) { + return path; + } + } else { + boolean debugLoader = Configuration.DEBUG_LOADER.get(false); + try { + String regular = Library.getRegularFilePath(resourceURL); + if (regular != null) { + apiLog("\tLoaded from classpath: " + regular); + return Paths.get(regular); + } + + // Always use the SLL if the resource is found in the classpath, + // so that newer versions can be detected. + if (debugLoader) { + apiLog("\tUsing SharedLibraryLoader..."); + } + // Extract from classpath and try org.lwjgl.librarypath + try (FileChannel ignored = SharedLibraryLoader.load(name, name, resourceURL)) { + path = loadFromLibraryPath(module, name, bundledWithLWJGL); + if (path != null) { + return path; + } + } + } catch (Exception e) { + if (debugLoader) { + e.printStackTrace(DEBUG_STREAM); + } + } + } + + // METHOD 3: java.library.path + String paths = System.getProperty(Library.JAVA_LIBRARY_PATH); + if (paths != null) { + path = load(module, name, bundledWithLWJGL, Library.JAVA_LIBRARY_PATH, paths); + if (path != null) { + return path; + } + } + + if (printError) { + printError(); + } + throw new IllegalStateException("Failed to locate library resource: " + name); + } + + @Nullable + private static Path loadFromLibraryPath(String module, String libName, boolean bundledWithLWJGL) { + String paths = Configuration.LIBRARY_PATH.get(); + if (paths == null) { + return null; + } + return load(module, libName, bundledWithLWJGL, Configuration.LIBRARY_PATH.getProperty(), paths); + } + + @Nullable + private static Path load(String module, String name, boolean bundledWithLWJGL, String property, String paths) { + Path resource = Library.findFile(paths, module, name, bundledWithLWJGL); + if (resource == null) { + apiLog(String.format("\t%s not found in %s=%s", name, property, paths)); + return null; + } + + apiLog(String.format("\tLoaded from %s: %s", property, resource)); + return resource; + } + + /** + * Loads a library resource using {@link #load(String, String)} with the name specified by {@code name}. If {@code name} is not set, + * {@link #load(String, String)} will be called with the names specified by {@code defaultNames}. The first successful will be returned. + * + * @param name a {@link Configuration} that specifies the resource name + * @param defaultNames the default resource name(s) + * + * @return the library resource path + * + * @throws IllegalStateException if the resource could not be found + */ + public static Path load(Class context, String module, Configuration name, String... defaultNames) { + return load(context, module, name, null, defaultNames); + } + + /** + * Loads a library resource using {@link #load(Class, String, String) load} with the name specified by {@code name}. If {@code name} is not set, + * {@code load} will be called with the names specified by {@code defaultNames}. The first successful will be returned. If the resource could + * not be found, the {@code fallback} will be called. + * + * @param name a {@link Configuration} that specifies the resource name + * @param fallback fallback to use if everything else fails + * @param defaultNames the default resource name(s) + * + * @return the library resource path + * + * @throws UnsatisfiedLinkError if the resource could not be found + */ + public static Path load(Class context, String module, Configuration name, @Nullable Supplier fallback, String... defaultNames) { + if (defaultNames.length == 0) { + throw new IllegalArgumentException("No default names specified."); + } + + String resourceName = name.get(); + if (resourceName != null) { + return load(context, module, resourceName); + } + + if (fallback == null && defaultNames.length <= 1) { + return load(context, module, defaultNames[0]); + } + + try { + return load(context, module, defaultNames[0], false, false); // try first + } catch (Throwable t) { + for (int i = 1; i < defaultNames.length; i++) { // try alternatives + try { + return load(context, module, defaultNames[i], false, fallback == null && i == defaultNames.length - 1); + } catch (Throwable ignored) { + } + } + if (fallback != null) { + return fallback.get(); + } + throw t; // original error + } + } + + private static void printError() { + Library.printError( + "[LWJGL] Failed to load a library resource. Possible solutions:\n" + + "\ta) Add the directory that contains the resource to -Djava.library.path or -Dorg.lwjgl.librarypath.\n" + + "\tb) Add the JAR that contains the resource to the classpath." + ); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/MathUtil.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/MathUtil.java new file mode 100644 index 00000000..13b5e674 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/MathUtil.java @@ -0,0 +1,171 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import java.math.*; + +/** + * Math utility class. + * + *

Method names in this class are prefixed with {@code math} to avoid ambiguities when used with static imports.

+ */ +public final class MathUtil { + + private MathUtil() { + } + + /** + * Returns true if the specified integer {@code value} is a power-of-two + * number. + * + * @param value the value to test + * + * @return true if the value if a power-of-two number. + */ + public static boolean mathIsPoT(int value) { + return Integer.bitCount(value) == 1; + } + + /** + * Rounds the specified integer {@code value} up to the next power-of-two + * number. The returned value will be equal to {@code value} if it already + * is a power-of-two number. + * + * @param value the value to round-up. Must be a number between {@code 1} and + * 1 << 30. + * + * @return the power-of-two rounded value + */ + public static int mathRoundPoT(int value) { + return 1 << (32 - Integer.numberOfLeadingZeros(value - 1)); + } + + public static boolean mathHasZeroByte(int value) { + return ((value - 0x01010101) & ~value & 0x80808080) != 0; + } + + public static boolean mathHasZeroByte(long value) { + return ((value - 0x0101010101010101L) & ~value & 0x8080808080808080L) != 0L; + } + + public static boolean mathHasZeroShort(int value) { + return (value & 0xFFFF) == 0 || (value >>> 16) == 0; + } + + public static boolean mathHasZeroShort(long value) { + return ((value - 0x0001000100010001L) & ~value & 0x8000800080008000L) != 0L; + } + + /** + * Returns as the most significant 64 bits of the 128-bit product of two {@code uint64_t} factors. + * + * @param x the first value + * @param y the second value + * + * @return the result + */ + public static long mathMultiplyHighU64(long x, long y) { + long x0 = x & 0xFFFF_FFFFL; + long x1 = x >>> 32; + long y0 = y & 0xFFFF_FFFFL; + long y1 = y >>> 32; + + long t = x1 * y0 + ((x0 * y0) >>> 32); + + return x1 * y1 + (t >>> 32) + (((t & 0xFFFF_FFFFL) + x0 * y1) >>> 32); + } + + /** + * Returns as the most significant 64 bits of the 128-bit product of two {@code int64_t} factors. + * + * @param x the first value + * @param y the second value + * + * @return the result + */ + public static long mathMultiplyHighS64(long x, long y) { + long x0 = x & 0xFFFF_FFFFL; + long x1 = x >> 32; + long y0 = y & 0xFFFF_FFFFL; + long y1 = y >> 32; + + long t = x1 * y0 + ((x0 * y0) >>> 32); + + return x1 * y1 + (t >> 32) + (((t & 0xFFFF_FFFFL) + x0 * y1) >> 32); + } + + /** + * Returns the unsigned quotient of dividing the first argument by the second where each argument and the result is interpreted as an unsigned value. + * + *

When either argument is negative (i.e. a {@code uint64_t} value higher than {@code 0x8000_0000_0000_0000L}), this method uses bit twiddling to + * implement the division. The JDK implementation uses {@link BigInteger} for this case, which has a negative impact on performance.

+ * + * @param dividend the value to be divided + * @param divisor the value doing the dividing + * + * @return the unsigned quotient of the first argument divided by the second argument + */ + public static long mathDivideUnsigned(long dividend, long divisor) { + if (0L <= divisor) { + return 0L <= dividend + ? dividend / divisor + : udivdi3(dividend, divisor); + } else { + return Long.compareUnsigned(dividend, divisor) < 0 ? 0L : 1L; + } + } + + /** + * Returns the unsigned remainder from dividing the first argument by the second where each argument and the result is interpreted as an unsigned value. + * + *

When either argument is negative (i.e. a {@code uint64_t} value higher than {@code 0x8000_0000_0000_0000L}), this method uses bit twiddling to + * implement the remainder. The JDK implementation uses {@link BigInteger} for this case, which has a negative impact on performance.

+ * + * @param dividend the value to be divided + * @param divisor the value doing the dividing + * + * @return the unsigned remainder of the first argument divided by the second argument + */ + public static long mathRemainderUnsigned(long dividend, long divisor) { + if (0L < dividend && 0L < divisor) { + return dividend % divisor; + } else { + return Long.compareUnsigned(dividend, divisor) < 0 + ? dividend + : dividend - divisor * udivdi3(dividend, divisor); + } + } + + // Implements uint64_t / uint64_t ==> uint64_t division + // Ported from Hacker's Delight (https://github.com/hcs0/Hackers-Delight/blob/master/divDouble.c.txt) + private static long udivdi3(long u, long v) { + if (v >>> 32 == 0) { + // u < 0L in here + if (u >>> 32 < v) { + long q0 = (((u >>> 1) / v) << Long.numberOfLeadingZeros(v)) >>> 31; + if ((u - q0 * v) >= v) { + q0++; + } + return q0; + } else { + long u1 = u >>> 32; + long q1 = u1 / v; + long q0 = (((u1 - q1 * v) << 32) | (u & 0xFFFF_FFFFL)) / v; + return (q1 << 32) | q0; + } + } + + int n = Long.numberOfLeadingZeros(v); + long q0 = (((u >>> 1) / ((v << n) >>> 32)) << n) >>> 31; + if (q0 != 0) { + q0--; + } + if (Long.compareUnsigned((u - q0 * v), v) >= 0) { + q0++; + } + return q0; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/MemoryAccessJNI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/MemoryAccessJNI.java new file mode 100644 index 00000000..8d197bbc --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/MemoryAccessJNI.java @@ -0,0 +1,322 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system; + +import static org.lwjgl.system.Checks.*; + +/** Memory access utilities. */ +final class MemoryAccessJNI { + + static { Library.initialize(); } + + private MemoryAccessJNI() { + throw new UnsupportedOperationException(); + } + + // --- [ getPointerSize ] --- + + /** Returns the {@code sizeof(void *)}. */ + static native int getPointerSize(); + + // --- [ malloc ] --- + + @NativeType("void * (*) (size_t)") + private static native long malloc(); + + /** Returns the address of the stdlib {@code malloc} function. */ + static final long malloc = malloc(); + + // --- [ calloc ] --- + + @NativeType("void * (*) (size_t, size_t)") + private static native long calloc(); + + /** Returns the address of the stdlib {@code calloc} function. */ + static final long calloc = calloc(); + + // --- [ realloc ] --- + + @NativeType("void * (*) (void *, size_t)") + private static native long realloc(); + + /** Returns the address of the stdlib {@code realloc} function. */ + static final long realloc = realloc(); + + // --- [ free ] --- + + @NativeType("void (*) (void *)") + private static native long free(); + + /** Returns the address of the stdlib {@code free} function. */ + static final long free = free(); + + // --- [ aligned_alloc ] --- + + @NativeType("void * (*) (size_t, size_t)") + private static native long aligned_alloc(); + + /** Returns the address of the stdlib {@code aligned_alloc} function. */ + static final long aligned_alloc = aligned_alloc(); + + // --- [ aligned_free ] --- + + @NativeType("void (*) (void *)") + private static native long aligned_free(); + + /** Returns the address of the stdlib {@code aligned_free} function. */ + static final long aligned_free = aligned_free(); + + // --- [ getByte ] --- + + /** Unsafe version of: {@link #getByte} */ + static native byte ngetByte(long ptr); + + /** + * Reads a byte value from the specified memory address. + * + * @param ptr the memory address to read + */ + @NativeType("int8_t") + static byte getByte(@NativeType("void *") long ptr) { + if (CHECKS) { + check(ptr); + } + return ngetByte(ptr); + } + + // --- [ getShort ] --- + + /** Unsafe version of: {@link #getShort} */ + static native short ngetShort(long ptr); + + /** + * Reads a short value from the specified memory address. + * + * @param ptr the memory address to read + */ + @NativeType("int16_t") + static short getShort(@NativeType("void *") long ptr) { + if (CHECKS) { + check(ptr); + } + return ngetShort(ptr); + } + + // --- [ getInt ] --- + + /** Unsafe version of: {@link #getInt} */ + static native int ngetInt(long ptr); + + /** + * Reads an int value from the specified memory address. + * + * @param ptr the memory address to read + */ + @NativeType("int32_t") + static int getInt(@NativeType("void *") long ptr) { + if (CHECKS) { + check(ptr); + } + return ngetInt(ptr); + } + + // --- [ getLong ] --- + + /** Unsafe version of: {@link #getLong} */ + static native long ngetLong(long ptr); + + /** + * Reads a long value from the specified memory address. + * + * @param ptr the memory address to read + */ + @NativeType("int64_t") + static long getLong(@NativeType("void *") long ptr) { + if (CHECKS) { + check(ptr); + } + return ngetLong(ptr); + } + + // --- [ getFloat ] --- + + /** Unsafe version of: {@link #getFloat} */ + static native float ngetFloat(long ptr); + + /** + * Reads a float value from the specified memory address. + * + * @param ptr the memory address to read + */ + static float getFloat(@NativeType("void *") long ptr) { + if (CHECKS) { + check(ptr); + } + return ngetFloat(ptr); + } + + // --- [ getDouble ] --- + + /** Unsafe version of: {@link #getDouble} */ + static native double ngetDouble(long ptr); + + /** + * Reads a double value from the specified memory address. + * + * @param ptr the memory address to read + */ + static double getDouble(@NativeType("void *") long ptr) { + if (CHECKS) { + check(ptr); + } + return ngetDouble(ptr); + } + + // --- [ getAddress ] --- + + /** Unsafe version of: {@link #getAddress} */ + static native long ngetAddress(long ptr); + + /** + * Reads a pointer address from the specified memory address. + * + * @param ptr the memory address to read + */ + @NativeType("intptr_t") + static long getAddress(@NativeType("void *") long ptr) { + if (CHECKS) { + check(ptr); + } + return ngetAddress(ptr); + } + + // --- [ putByte ] --- + + /** Unsafe version of: {@link #putByte} */ + static native void nputByte(long ptr, byte value); + + /** + * Writes a byte value to the specified memory address. + * + * @param ptr the memory address to write + * @param value the value to write + */ + static void putByte(@NativeType("void *") long ptr, @NativeType("int8_t") byte value) { + if (CHECKS) { + check(ptr); + } + nputByte(ptr, value); + } + + // --- [ putShort ] --- + + /** Unsafe version of: {@link #putShort} */ + static native void nputShort(long ptr, short value); + + /** + * Writes a short value to the specified memory address. + * + * @param ptr the memory address to write + * @param value the value to write + */ + static void putShort(@NativeType("void *") long ptr, @NativeType("int16_t") short value) { + if (CHECKS) { + check(ptr); + } + nputShort(ptr, value); + } + + // --- [ putInt ] --- + + /** Unsafe version of: {@link #putInt} */ + static native void nputInt(long ptr, int value); + + /** + * Writes an int value to the specified memory address. + * + * @param ptr the memory address to write + * @param value the value to write + */ + static void putInt(@NativeType("void *") long ptr, @NativeType("int32_t") int value) { + if (CHECKS) { + check(ptr); + } + nputInt(ptr, value); + } + + // --- [ putLong ] --- + + /** Unsafe version of: {@link #putLong} */ + static native void nputLong(long ptr, long value); + + /** + * Writes a long value to the specified memory address. + * + * @param ptr the memory address to write + * @param value the value to write + */ + static void putLong(@NativeType("void *") long ptr, @NativeType("int64_t") long value) { + if (CHECKS) { + check(ptr); + } + nputLong(ptr, value); + } + + // --- [ putFloat ] --- + + /** Unsafe version of: {@link #putFloat} */ + static native void nputFloat(long ptr, float value); + + /** + * Writes a float value to the specified memory address. + * + * @param ptr the memory address to write + * @param value the value to write + */ + static void putFloat(@NativeType("void *") long ptr, float value) { + if (CHECKS) { + check(ptr); + } + nputFloat(ptr, value); + } + + // --- [ putDouble ] --- + + /** Unsafe version of: {@link #putDouble} */ + static native void nputDouble(long ptr, double value); + + /** + * Writes a double value to the specified memory address. + * + * @param ptr the memory address to write + * @param value the value to write + */ + static void putDouble(@NativeType("void *") long ptr, double value) { + if (CHECKS) { + check(ptr); + } + nputDouble(ptr, value); + } + + // --- [ putAddress ] --- + + /** Unsafe version of: {@link #putAddress} */ + static native void nputAddress(long ptr, long value); + + /** + * Writes a pointer address to the specified memory address. + * + * @param ptr the memory address to write + * @param value the value to write + */ + static void putAddress(@NativeType("void *") long ptr, @NativeType("intptr_t") long value) { + if (CHECKS) { + check(ptr); + } + nputAddress(ptr, value); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/MemoryManage.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/MemoryManage.java new file mode 100644 index 00000000..31ae1ae9 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/MemoryManage.java @@ -0,0 +1,405 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import javax.annotation.*; +import java.util.*; +import java.util.Map.*; +import java.util.concurrent.*; +import java.util.concurrent.atomic.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.StackWalkUtil.*; +import static org.lwjgl.system.dyncall.DynCallback.*; +import static org.lwjgl.system.libc.LibCStdlib.*; + +/** Provides {@link MemoryAllocator} implementations for {@link MemoryUtil} to use. */ +final class MemoryManage { + + private MemoryManage() { + } + + static MemoryAllocator getInstance() { + Object allocator = Configuration.MEMORY_ALLOCATOR.get(); + if (allocator instanceof MemoryAllocator) { + return (MemoryAllocator)allocator; + } + + if (!"system".equals(allocator)) { + String className; + if (allocator == null || "jemalloc".equals(allocator)) { + className = "org.lwjgl.system.jemalloc.JEmallocAllocator"; + } else if ("rpmalloc".equals(allocator)) { + className = "org.lwjgl.system.rpmalloc.RPmallocAllocator"; + } else { + className = allocator.toString(); + } + + try { + Class allocatorClass = Class.forName(className); + return (MemoryAllocator)allocatorClass.getConstructor().newInstance(); + } catch (Throwable t) { + if (Checks.DEBUG && allocator != null) { + t.printStackTrace(DEBUG_STREAM); + } + apiLog(String.format("Warning: Failed to instantiate memory allocator: %s. Using the system default.", className)); + } + } + + return new StdlibAllocator(); + } + + /** stdlib memory allocator. */ + private static class StdlibAllocator implements MemoryAllocator { + + @Override public long getMalloc() { return MemoryAccessJNI.malloc; } + @Override public long getCalloc() { return MemoryAccessJNI.calloc; } + @Override public long getRealloc() { return MemoryAccessJNI.realloc; } + @Override public long getFree() { return MemoryAccessJNI.free; } + @Override public long getAlignedAlloc() { return MemoryAccessJNI.aligned_alloc; } + @Override public long getAlignedFree() { return MemoryAccessJNI.aligned_free; } + + @Override public long malloc(long size) { return nmalloc(size); } + @Override public long calloc(long num, long size) { return ncalloc(num, size); } + @Override public long realloc(long ptr, long size) { return nrealloc(ptr, size); } + @Override public void free(long ptr) { nfree(ptr); } + @Override public long aligned_alloc(long alignment, long size) { return naligned_alloc(alignment, size); } + @Override public void aligned_free(long ptr) { naligned_free(ptr); } + + } + + /** Wraps a MemoryAllocator to track allocations and detect memory leaks. */ + static class DebugAllocator implements MemoryAllocator { + + private static final ConcurrentMap ALLOCATIONS = new ConcurrentHashMap<>(); + private static final ConcurrentMap THREADS = new ConcurrentHashMap<>(); + + private final MemoryAllocator allocator; + + private final long[] callbacks; + + DebugAllocator(MemoryAllocator allocator) { + this.allocator = allocator; + + this.callbacks = new long[] { + new CallbackI.P() { + @Override public String getSignature() { + return "(p)p"; + } + @Override public long callback(long args) { + long size = dcbArgPointer(args); + return malloc(size); + } + }.address(), + new CallbackI.P() { + @Override public String getSignature() { + return "(pp)p"; + } + @Override public long callback(long args) { + long num = dcbArgPointer(args); + long size = dcbArgPointer(args); + return calloc(num, size); + } + }.address(), + new CallbackI.P() { + @Override public String getSignature() { + return "(pp)p"; + } + @Override public long callback(long args) { + long ptr = dcbArgPointer(args); + long size = dcbArgPointer(args); + return realloc(ptr, size); + } + }.address(), + new CallbackI.V() { + @Override public String getSignature() { + return "(p)v"; + } + @Override public void callback(long args) { + long ptr = dcbArgPointer(args); + free(ptr); + } + }.address(), + new CallbackI.P() { + @Override public String getSignature() { + return "(pp)p"; + } + @Override public long callback(long args) { + long alignment = dcbArgPointer(args); + long size = dcbArgPointer(args); + return aligned_alloc(alignment, size); + } + }.address(), + new CallbackI.V() { + @Override public String getSignature() { + return "(p)v"; + } + @Override public void callback(long args) { + long ptr = dcbArgPointer(args); + aligned_free(ptr); + } + }.address() + }; + + Runtime.getRuntime().addShutdownHook(new Thread(() -> { + for (long callback : callbacks) { + Callback.free(callback); + } + + if (ALLOCATIONS.isEmpty()) { + return; + } + + for (Entry entry : ALLOCATIONS.entrySet()) { + Long address = entry.getKey(); + Allocation allocation = entry.getValue(); + + DEBUG_STREAM.format( + "[LWJGL] %d bytes leaked, thread %d (%s), address: 0x%s\n", + allocation.size, + allocation.threadId, + THREADS.get(allocation.threadId), + Long.toHexString(address).toUpperCase() + ); + for (Object el : allocation.stackTrace) { + DEBUG_STREAM.format("\tat %s\n", el.toString()); + } + } + })); + } + + @Override public long getMalloc() { return callbacks[0]; } + @Override public long getCalloc() { return callbacks[1]; } + @Override public long getRealloc() { return callbacks[2]; } + @Override public long getFree() { return callbacks[3]; } + @Override public long getAlignedAlloc() { return callbacks[4]; } + @Override public long getAlignedFree() { return callbacks[5]; } + + @Override public long malloc(long size) { + return track(allocator.malloc(size), size); + } + + @Override + public long calloc(long num, long size) { + return track(allocator.calloc(num, size), num * size); + } + + @Override + public long realloc(long ptr, long size) { + /* + realloc semantics: + a) if size == 0 and ptr != NULL => free(ptr), return NULL + b) if size != 0 and ptr == NULL => malloc(size), return new address + c) if ptr != NULL and size < oldSize => + 1) reduce size, return ptr + 2) malloc new address, memcpy, free(ptr), return new address + d) if ptr != NULL and oldSize < size => + 1) expand size, return ptr + 2) malloc new address, memcpy, free(ptr), return new address + 3) malloc fails, return NULL + */ + + long oldSize = untrack(ptr); + + long address = allocator.realloc(ptr, size); + + if (address != NULL) { + track(address, size); + } else if (size != 0L) { + track(ptr, oldSize); // d3 + } + + return address; + } + + @Override + public void free(long ptr) { + untrack(ptr); + allocator.free(ptr); + } + + @Override + public long aligned_alloc(long alignment, long size) { + return track(allocator.aligned_alloc(alignment, size), size); + } + + @Override + public void aligned_free(long ptr) { + untrack(ptr); + allocator.aligned_free(ptr); + } + + static long track(long address, long size) { + if (address != NULL) { + Thread t = Thread.currentThread(); + Long threadId = t.getId(); + if (!THREADS.containsKey(threadId)) { + THREADS.put(threadId, t.getName()); + } + + Allocation allocation = ALLOCATIONS.put(address, new Allocation(stackWalkGetTrace(), size)); + if (allocation != null) { + throw new IllegalStateException("The memory address specified is already being tracked: 0x" + Long.toHexString(address).toUpperCase()); + } + } + + return address; + } + + static long untrack(long address) { + if (address == NULL) { + return 0L; + } + + Allocation allocation = ALLOCATIONS.remove(address); + if (allocation == null) { + throw new IllegalStateException("The memory address specified is not being tracked: 0x" + Long.toHexString(address).toUpperCase()); + } + + return allocation.size; + } + + private static class Allocation { + + private final Object[] stackTrace; + + @Nullable + private StackTraceElement[] elements; // lazy init + + final long size; + final long threadId; + + Allocation(Object[] stackTrace, long size) { + this.stackTrace = stackTrace; + this.size = size; + this.threadId = Thread.currentThread().getId(); + } + + private StackTraceElement[] getElements() { + if (elements == null) { + elements = stackWalkArray(stackTrace); + } + + return elements; + } + + @Override + public boolean equals(Object o) { + if (this == o) { + return true; + } + if (o == null || getClass() != o.getClass()) { + return false; + } + + Allocation that = (Allocation)o; + + return Arrays.equals(this.getElements(), that.getElements()); + } + + @Override + public int hashCode() { + return Arrays.hashCode(getElements()); + } + + } + + static void report(MemoryAllocationReport report) { + for (Entry entry : ALLOCATIONS.entrySet()) { + Allocation allocation = entry.getValue(); + report.invoke(entry.getKey(), allocation.size, allocation.threadId, THREADS.get(allocation.threadId), allocation.getElements()); + } + } + + private static void aggregate(T t, long size, Map map) { + AtomicLong node = map.computeIfAbsent(t, k -> new AtomicLong()); + node.set(node.get() + size); + } + + static void report( + MemoryAllocationReport report, + MemoryAllocationReport.Aggregate groupByStackTrace, + boolean groupByThread + ) { + // Using atomic long for the mutability, no concurrency here + switch (groupByStackTrace) { + case ALL: + if (groupByThread) { + Map mapThread = new HashMap<>(); + for (Allocation allocation : ALLOCATIONS.values()) { + aggregate(allocation.threadId, allocation.size, mapThread); + } + for (Entry entry : mapThread.entrySet()) { + report.invoke(NULL, entry.getValue().get(), entry.getKey(), THREADS.get(entry.getKey()), (StackTraceElement[])null); + } + } else { + long total = 0L; + for (Allocation allocation : ALLOCATIONS.values()) { + total += allocation.size; + } + report.invoke(NULL, total, NULL, null, (StackTraceElement[])null); + } + break; + case GROUP_BY_METHOD: + // Group by stackTrace[0] + if (groupByThread) { + Map> mapThreadMethod = new HashMap<>(); + for (Allocation allocation : ALLOCATIONS.values()) { + Map mapMethod = mapThreadMethod.computeIfAbsent(allocation.threadId, k -> new HashMap<>()); + aggregate(allocation.getElements()[0], allocation.size, mapMethod); + } + + for (Entry> tms : mapThreadMethod.entrySet()) { + long threadId = tms.getKey(); + Map mapmapMethod = tms.getValue(); + + for (Entry ms : mapmapMethod.entrySet()) { + report.invoke(NULL, ms.getValue().get(), threadId, THREADS.get(threadId), ms.getKey()); + } + } + } else { + Map mapMethod = new HashMap<>(); + for (Allocation allocation : ALLOCATIONS.values()) { + aggregate(allocation.getElements()[0], allocation.size, mapMethod); + } + for (Entry ms : mapMethod.entrySet()) { + report.invoke(NULL, ms.getValue().get(), NULL, null, ms.getKey()); + } + } + break; + case GROUP_BY_STACKTRACE: + // Group by stackTrace[] + if (groupByThread) { + Map> mapThreadStackTrace = new HashMap<>(); + for (Allocation allocation : ALLOCATIONS.values()) { + Map mapStackTrace = mapThreadStackTrace.computeIfAbsent(allocation.threadId, k -> new HashMap<>()); + aggregate(allocation, allocation.size, mapStackTrace); + } + + for (Entry> tss : mapThreadStackTrace.entrySet()) { + long threadId = tss.getKey(); + Map mapStackTrace = tss.getValue(); + + for (Entry ss : mapStackTrace.entrySet()) { + report.invoke(NULL, ss.getValue().get(), threadId, THREADS.get(threadId), ss.getKey().getElements()); + } + } + } else { + Map mapStackTrace = new HashMap<>(); + for (Allocation allocation : ALLOCATIONS.values()) { + aggregate(allocation, allocation.size, mapStackTrace); + } + for (Entry ss : mapStackTrace.entrySet()) { + report.invoke(NULL, ss.getValue().get(), NULL, null, ss.getKey().getElements()); + } + } + break; + } + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/MemoryStack.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/MemoryStack.java new file mode 100644 index 00000000..63a74aed --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/MemoryStack.java @@ -0,0 +1,1011 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import org.lwjgl.*; + +import javax.annotation.*; +import java.nio.*; +import java.util.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.StackWalkUtil.*; + +/** + * An off-heap memory stack. + * + *

This class should be used in a thread-local manner for stack allocations.

+ * + * @see Configuration#STACK_SIZE + * @see Configuration#DEBUG_STACK + */ +public class MemoryStack extends Pointer.Default implements AutoCloseable { + + private static final int DEFAULT_STACK_SIZE = Configuration.STACK_SIZE.get(64) * 1024; + private static final int DEFAULT_STACK_FRAMES = 8; + + private static final ThreadLocal TLS = ThreadLocal.withInitial(MemoryStack::create); + + static { + if (DEFAULT_STACK_SIZE < 0) { + throw new IllegalStateException("Invalid stack size."); + } + } + + @SuppressWarnings({"FieldCanBeLocal", "unused"}) + @Nullable + private final ByteBuffer container; + + private final int size; + + private int pointer; + + private int[] frames; + protected int frameIndex; + + /** + * Creates a new {@code MemoryStack} backed by the specified memory region. + * + *

In the initial state, there is no active stack frame. The {@link #push} method must be used before any allocations.

+ * + * @param container the backing memory buffer, may be null + * @param address the backing memory address + * @param size the backing memory size + */ + protected MemoryStack(@Nullable ByteBuffer container, long address, int size) { + super(address); + this.container = container; + + this.size = size; + this.pointer = size; + + this.frames = new int[DEFAULT_STACK_FRAMES]; + } + + /** + * Creates a new {@code MemoryStack} with the default size. + * + *

In the initial state, there is no active stack frame. The {@link #push} method must be used before any allocations.

+ */ + public static MemoryStack create() { + return create(DEFAULT_STACK_SIZE); + } + + /** + * Creates a new {@code MemoryStack} with the specified size. + * + *

In the initial state, there is no active stack frame. The {@link #push} method must be used before any allocations.

+ * + * @param capacity the maximum number of bytes that may be allocated on the stack + */ + public static MemoryStack create(int capacity) { + return create(BufferUtils.createByteBuffer(capacity)); + } + + /** + * Creates a new {@code MemoryStack} backed by the specified memory buffer. + * + *

In the initial state, there is no active stack frame. The {@link #push} method must be used before any allocations.

+ * + * @param buffer the backing memory buffer + */ + public static MemoryStack create(ByteBuffer buffer) { + long address = memAddress(buffer); + int size = buffer.remaining(); + return Configuration.DEBUG_STACK.get(false) + ? new DebugMemoryStack(buffer, address, size) + : new MemoryStack(buffer, address, size); + } + + /** + * Creates a new {@code MemoryStack} backed by the specified memory region. + * + *

In the initial state, there is no active stack frame. The {@link #push} method must be used before any allocations.

+ * + * @param address the backing memory address + * @param size the backing memory size + */ + public static MemoryStack ncreate(long address, int size) { + return Configuration.DEBUG_STACK.get(false) + ? new DebugMemoryStack(null, address, size) + : new MemoryStack(null, address, size); + } + + /** + * Stores the current stack pointer and pushes a new frame to the stack. + * + *

This method should be called when entering a method, before doing any stack allocations. When exiting a method, call the {@link #pop} method to + * restore the previous stack frame.

+ * + *

Pairs of push/pop calls may be nested. Care must be taken to:

+ *
    + *
  • match every push with a pop
  • + *
  • not call pop before push has been called at least once
  • + *
  • not nest push calls to more than the maximum supported depth
  • + *
+ * + * @return this stack + */ + public MemoryStack push() { + if (frameIndex == frames.length) { + frameOverflow(); + } + + frames[frameIndex++] = pointer; + return this; + } + + private void frameOverflow() { + if (DEBUG) { + apiLog("[WARNING] Out of frame stack space (" + frames.length + ") in thread: " + Thread.currentThread()); + } + frames = Arrays.copyOf(frames, frames.length * 3 / 2); + } + + /** + * Pops the current stack frame and moves the stack pointer to the end of the previous stack frame. + * + * @return this stack + */ + public MemoryStack pop() { + pointer = frames[--frameIndex]; + return this; + } + + /** + * Calls {@link #pop} on this {@code MemoryStack}. + * + *

This method should not be used directly. It is called automatically when the {@code MemoryStack} is used as a resource in a try-with-resources + * statement.

+ */ + @Override + public void close() { + pop(); + } + + /** Stores the method that pushed a frame and checks if it is the same method when the frame is popped. */ + private static class DebugMemoryStack extends MemoryStack { + + private Object[] debugFrames; + + DebugMemoryStack(@Nullable ByteBuffer buffer, long address, int size) { + super(buffer, address, size); + debugFrames = new Object[DEFAULT_STACK_FRAMES]; + } + + @Override + public MemoryStack push() { + if (frameIndex == debugFrames.length) { + frameOverflow(); + } + + debugFrames[frameIndex] = stackWalkGetMethod(MemoryStack.class); + + return super.push(); + } + + private void frameOverflow() { + debugFrames = Arrays.copyOf(debugFrames, debugFrames.length * 3 / 2); + } + + @Override + public MemoryStack pop() { + Object pushed = debugFrames[frameIndex - 1]; + Object popped = stackWalkCheckPop(MemoryStack.class, pushed); + if (popped != null) { + reportAsymmetricPop(pushed, popped); + } + debugFrames[frameIndex - 1] = null; + + return super.pop(); + } + + private static void reportAsymmetricPop(Object pushed, Object popped) { + DEBUG_STREAM.format( + "[LWJGL] Asymmetric pop detected:\n\tPUSHED: %s\n\tPOPPED: %s\n\tTHREAD: %s\n", + pushed.toString(), + popped.toString(), + Thread.currentThread() + ); + } + + } + + /** + * Returns the address of the backing off-heap memory. + * + *

The stack grows "downwards", so the bottom of the stack is at {@code address + size}, while the top is at {@code address}.

+ */ + public long getAddress() { + return address; + } + + /** + * Returns the size of the backing off-heap memory. + * + *

This is the maximum number of bytes that may be allocated on the stack.

+ */ + public int getSize() { + return size; + } + + /** + * Returns the current frame index. + * + *

This is the current number of nested {@link #push} calls.

+ */ + public int getFrameIndex() { + return frameIndex; + } + + /** Returns the memory address at the current stack pointer. */ + public long getPointerAddress() { + return address + (pointer & 0xFFFF_FFFFL); + } + + /** + * Returns the current stack pointer. + * + *

The stack grows "downwards", so when the stack is empty {@code pointer} is equal to {@code size}. On every allocation {@code pointer} is reduced by + * the allocated size (after alignment) and {@code address + pointer} points to the first byte of the last allocation.

+ * + *

Effectively, this methods returns how many more bytes may be allocated on the stack.

+ */ + public int getPointer() { + return pointer; + } + + /** + * Sets the current stack pointer. + * + *

This method directly manipulates the stack pointer. Using it irresponsibly may break the internal state of the stack. It should only be used in rare + * cases or in auto-generated code.

+ */ + public void setPointer(int pointer) { + if (CHECKS) { + checkPointer(pointer); + } + + this.pointer = pointer; + } + + private void checkPointer(int pointer) { + if (pointer < 0 || size < pointer) { + throw new IndexOutOfBoundsException("Invalid stack pointer"); + } + } + + private static void checkAlignment(int alignment) { + if (Integer.bitCount(alignment) != 1) { + throw new IllegalArgumentException("Alignment must be a power-of-two value."); + } + } + + /** + * Calls {@link #nmalloc(int, int)} with {@code alignment} equal to 1. + * + * @param size the allocation size + * + * @return the memory address on the stack for the requested allocation + */ + public long nmalloc(int size) { + return nmalloc(1, size); + } + + /** + * Allocates a block of {@code size} bytes of memory on the stack. The content of the newly allocated block of memory is not initialized, remaining with + * indeterminate values. + * + * @param alignment the required alignment + * @param size the allocation size + * + * @return the memory address on the stack for the requested allocation + */ + public long nmalloc(int alignment, int size) { + // Align address to the specified alignment + long address = (this.address + pointer - size) & ~Integer.toUnsignedLong(alignment - 1); + + pointer = (int)(address - this.address); + if (CHECKS && pointer < 0) { + throw new OutOfMemoryError("Out of stack space."); + } + + return address; + } + + /** + * Allocates a block of memory on the stack for an array of {@code num} elements, each of them {@code size} bytes long, and initializes all its bits to + * zero. + * + * @param alignment the required element alignment + * @param num num the number of elements to allocate + * @param size the size of each element + * + * @return the memory address on the stack for the requested allocation + */ + public long ncalloc(int alignment, int num, int size) { + int bytes = num * size; + long address = nmalloc(alignment, bytes); + memSet(address, 0, bytes); + return address; + } + + // ------------------------------------------------- + + /** + * Allocates an aligned {@link ByteBuffer} on the stack. + * + * @param alignment the required buffer alignment + * @param size the number of elements in the buffer + * + * @return the allocated buffer + */ + public ByteBuffer malloc(int alignment, int size) { + if (DEBUG) { + checkAlignment(alignment); + } + return MemoryUtil.wrap(BUFFER_BYTE, nmalloc(alignment, size), size).order(NATIVE_ORDER); + } + /** Calloc version of {@link #malloc(int, int)}. */ + public ByteBuffer calloc(int alignment, int size) { + if (DEBUG) { + checkAlignment(alignment); + } + return MemoryUtil.wrap(BUFFER_BYTE, ncalloc(alignment, size, 1), size).order(NATIVE_ORDER); + } + + /** + * Allocates a {@link ByteBuffer} on the stack. + * + * @param size the number of elements in the buffer + * + * @return the allocated buffer + */ + public ByteBuffer malloc(int size) { return malloc(1, size); } + /** Calloc version of {@link #malloc(int)}. */ + public ByteBuffer calloc(int size) { return calloc(1, size); } + + /** Single value version of {@link #malloc}. */ + public ByteBuffer bytes(byte x) { return malloc(1, 1).put(0, x); } + /** Two value version of {@link #malloc}. */ + public ByteBuffer bytes(byte x, byte y) { return malloc(1, 2).put(0, x).put(1, y); } + /** Three value version of {@link #malloc}. */ + public ByteBuffer bytes(byte x, byte y, byte z) { return malloc(1, 3).put(0, x).put(1, y).put(2, z); } + /** Four value version of {@link #malloc}. */ + public ByteBuffer bytes(byte x, byte y, byte z, byte w) { return malloc(1, 4).put(0, x).put(1, y).put(2, z).put(3, w); } + /** Vararg version of {@link #malloc}. */ + public ByteBuffer bytes(byte... values) { + ByteBuffer buffer = malloc(1, values.length).put(values); + buffer.flip(); + return buffer; + } + + // ------------------------------------------------- + + /** Short version of {@link #malloc(int)}. */ + public ShortBuffer mallocShort(int size) { return MemoryUtil.wrap(BUFFER_SHORT, nmalloc(2, size << 1), size); } + /** Short version of {@link #calloc(int)}. */ + public ShortBuffer callocShort(int size) { + int bytes = size * 2; + long address = nmalloc(2, bytes); + memSet(address, 0, bytes); + return MemoryUtil.wrap(BUFFER_SHORT, address, size); + } + + /** Single value version of {@link #mallocShort}. */ + public ShortBuffer shorts(short x) { return mallocShort(1).put(0, x); } + /** Two value version of {@link #mallocShort}. */ + public ShortBuffer shorts(short x, short y) { return mallocShort(2).put(0, x).put(1, y); } + /** Three value version of {@link #mallocShort}. */ + public ShortBuffer shorts(short x, short y, short z) { return mallocShort(3).put(0, x).put(1, y).put(2, z); } + /** Four value version of {@link #mallocShort}. */ + public ShortBuffer shorts(short x, short y, short z, short w) { return mallocShort(4).put(0, x).put(1, y).put(2, z).put(3, w); } + /** Vararg version of {@link #mallocShort}. */ + public ShortBuffer shorts(short... values) { + ShortBuffer buffer = mallocShort(values.length).put(values); + buffer.flip(); + return buffer; + } + + // ------------------------------------------------- + + /** Int version of {@link #malloc(int)}. */ + public IntBuffer mallocInt(int size) { return MemoryUtil.wrap(BUFFER_INT, nmalloc(4, size << 2), size); } + /** Int version of {@link #calloc(int)}. */ + public IntBuffer callocInt(int size) { + int bytes = size * 4; + long address = nmalloc(4, bytes); + memSet(address, 0, bytes); + return MemoryUtil.wrap(BUFFER_INT, address, size); + } + + /** Single value version of {@link #mallocInt}. */ + public IntBuffer ints(int x) { return mallocInt(1).put(0, x); } + /** Two value version of {@link #mallocInt}. */ + public IntBuffer ints(int x, int y) { return mallocInt(2).put(0, x).put(1, y); } + /** Three value version of {@link #mallocInt}. */ + public IntBuffer ints(int x, int y, int z) { return mallocInt(3).put(0, x).put(1, y).put(2, z); } + /** Four value version of {@link #mallocInt}. */ + public IntBuffer ints(int x, int y, int z, int w) { return mallocInt(4).put(0, x).put(1, y).put(2, z).put(3, w); } + /** Vararg version of {@link #mallocInt}. */ + public IntBuffer ints(int... values) { + IntBuffer buffer = mallocInt(values.length).put(values); + buffer.flip(); + return buffer; + } + + // ------------------------------------------------- + + /** Long version of {@link #malloc(int)}. */ + public LongBuffer mallocLong(int size) { return MemoryUtil.wrap(BUFFER_LONG, nmalloc(8, size << 3), size); } + /** Long version of {@link #calloc(int)}. */ + public LongBuffer callocLong(int size) { + int bytes = size * 8; + long address = nmalloc(8, bytes); + memSet(address, 0, bytes); + return MemoryUtil.wrap(BUFFER_LONG, address, size); + } + + /** Single value version of {@link #mallocLong}. */ + public LongBuffer longs(long x) { return mallocLong(1).put(0, x); } + /** Two value version of {@link #mallocLong}. */ + public LongBuffer longs(long x, long y) { return mallocLong(2).put(0, x).put(1, y); } + /** Three value version of {@link #mallocLong}. */ + public LongBuffer longs(long x, long y, long z) { return mallocLong(3).put(0, x).put(1, y).put(2, z); } + /** Four value version of {@link #mallocLong}. */ + public LongBuffer longs(long x, long y, long z, long w) { return mallocLong(4).put(0, x).put(1, y).put(2, z).put(3, w); } + /** Vararg version of {@link #mallocLong}. */ + public LongBuffer longs(long... more) { + LongBuffer buffer = mallocLong(more.length).put(more); + buffer.flip(); + return buffer; + } + + // ------------------------------------------------- + + /** CLong version of {@link #malloc(int)}. */ + public CLongBuffer mallocCLong(int size) { return wrap(CLongBuffer.class, nmalloc(CLONG_SIZE, size << CLONG_SHIFT), size); } + /** CLong version of {@link #calloc(int)}. */ + public CLongBuffer callocCLong(int size) { + int bytes = size * CLONG_SIZE; + long address = nmalloc(CLONG_SIZE, bytes); + memSet(address, 0, bytes); + return wrap(CLongBuffer.class, address, size); + } + + /** Single value version of {@link #mallocCLong}. */ + public CLongBuffer clongs(long x) { return mallocCLong(1).put(0, x); } + /** Two value version of {@link #mallocCLong}. */ + public CLongBuffer clongs(long x, long y) { return mallocCLong(2).put(0, x).put(1, y); } + /** Three value version of {@link #mallocCLong}. */ + public CLongBuffer clongs(long x, long y, long z) { return mallocCLong(3).put(0, x).put(1, y).put(2, z); } + /** Four value version of {@link #mallocCLong}. */ + public CLongBuffer clongs(long x, long y, long z, long w) { return mallocCLong(4).put(0, x).put(1, y).put(2, z).put(3, w); } + /** Vararg version of {@link #mallocCLong}. */ + public CLongBuffer clongs(long... values) { + CLongBuffer buffer = mallocCLong(values.length).put(values); + buffer.flip(); + return buffer; + } + + // ------------------------------------------------- + + /** Float version of {@link #malloc(int)}. */ + public FloatBuffer mallocFloat(int size) { return MemoryUtil.wrap(BUFFER_FLOAT, nmalloc(4, size << 2), size); } + /** Float version of {@link #calloc(int)}. */ + public FloatBuffer callocFloat(int size) { + int bytes = size * 4; + long address = nmalloc(4, bytes); + memSet(address, 0, bytes); + return MemoryUtil.wrap(BUFFER_FLOAT, address, size); + } + + /** Single value version of {@link #mallocFloat}. */ + public FloatBuffer floats(float x) { return mallocFloat(1).put(0, x); } + /** Two value version of {@link #mallocFloat}. */ + public FloatBuffer floats(float x, float y) { return mallocFloat(2).put(0, x).put(1, y); } + /** Three value version of {@link #mallocFloat}. */ + public FloatBuffer floats(float x, float y, float z) { return mallocFloat(3).put(0, x).put(1, y).put(2, z); } + /** Four value version of {@link #mallocFloat}. */ + public FloatBuffer floats(float x, float y, float z, float w) { return mallocFloat(4).put(0, x).put(1, y).put(2, z).put(3, w); } + /** Vararg version of {@link #mallocFloat}. */ + public FloatBuffer floats(float... values) { + FloatBuffer buffer = mallocFloat(values.length).put(values); + buffer.flip(); + return buffer; + } + + // ------------------------------------------------- + + /** Double version of {@link #malloc(int)}. */ + public DoubleBuffer mallocDouble(int size) { return MemoryUtil.wrap(BUFFER_DOUBLE, nmalloc(8, size << 3), size); } + /** Double version of {@link #calloc(int)}. */ + public DoubleBuffer callocDouble(int size) { + int bytes = size * 8; + long address = nmalloc(8, bytes); + memSet(address, 0, bytes); + return MemoryUtil.wrap(BUFFER_DOUBLE, address, size); + } + + /** Single value version of {@link #mallocDouble}. */ + public DoubleBuffer doubles(double x) { return mallocDouble(1).put(0, x); } + /** Two value version of {@link #mallocDouble}. */ + public DoubleBuffer doubles(double x, double y) { return mallocDouble(2).put(0, x).put(1, y); } + /** Three value version of {@link #mallocDouble}. */ + public DoubleBuffer doubles(double x, double y, double z) { return mallocDouble(3).put(0, x).put(1, y).put(2, z); } + /** Four value version of {@link #mallocDouble}. */ + public DoubleBuffer doubles(double x, double y, double z, double w) { return mallocDouble(4).put(0, x).put(1, y).put(2, z).put(3, w); } + /** Vararg version of {@link #mallocDouble}. */ + public DoubleBuffer doubles(double... values) { + DoubleBuffer buffer = mallocDouble(values.length).put(values); + buffer.flip(); + return buffer; + } + + // ------------------------------------------------- + + /** Pointer version of {@link #malloc(int)}. */ + public PointerBuffer mallocPointer(int size) { return wrap(PointerBuffer.class, nmalloc(POINTER_SIZE, size << POINTER_SHIFT), size); } + /** Pointer version of {@link #calloc(int)}. */ + public PointerBuffer callocPointer(int size) { + int bytes = size * POINTER_SIZE; + long address = nmalloc(POINTER_SIZE, bytes); + memSet(address, 0, bytes); + return wrap(PointerBuffer.class, address, size); + } + + /** Single value version of {@link #mallocPointer}. */ + public PointerBuffer pointers(long x) { return mallocPointer(1).put(0, x); } + /** Two value version of {@link #mallocPointer}. */ + public PointerBuffer pointers(long x, long y) { return mallocPointer(2).put(0, x).put(1, y); } + /** Three value version of {@link #mallocPointer}. */ + public PointerBuffer pointers(long x, long y, long z) { return mallocPointer(3).put(0, x).put(1, y).put(2, z); } + /** Four value version of {@link #mallocPointer}. */ + public PointerBuffer pointers(long x, long y, long z, long w) { return mallocPointer(4).put(0, x).put(1, y).put(2, z).put(3, w); } + /** Vararg version of {@link #mallocPointer}. */ + public PointerBuffer pointers(long... values) { + PointerBuffer buffer = mallocPointer(values.length).put(values); + buffer.flip(); + return buffer; + } + + /** Single value version of {@link #mallocPointer}. */ + public PointerBuffer pointers(Pointer x) { return mallocPointer(1).put(0, x); } + /** Two value version of {@link #mallocPointer}. */ + public PointerBuffer pointers(Pointer x, Pointer y) { return mallocPointer(2).put(0, x).put(1, y); } + /** Three value version of {@link #mallocPointer}. */ + public PointerBuffer pointers(Pointer x, Pointer y, Pointer z) { return mallocPointer(3).put(0, x).put(1, y).put(2, z); } + /** Four value version of {@link #mallocPointer}. */ + public PointerBuffer pointers(Pointer x, Pointer y, Pointer z, Pointer w) { return mallocPointer(4).put(0, x).put(1, y).put(2, z).put(3, w); } + /** Vararg version of {@link #mallocPointer}. */ + public PointerBuffer pointers(Pointer... values) { + PointerBuffer buffer = mallocPointer(values.length); + for (int i = 0; i < values.length; i++) { + buffer.put(i, values[i]); + } + return buffer; + } + + /** Single value version of {@link #mallocPointer}. */ + public PointerBuffer pointers(Buffer x) { + return mallocPointer(1) + .put(0, memAddress(x)); + } + /** Two value version of {@link #mallocPointer}. */ + public PointerBuffer pointers(Buffer x, Buffer y) { + return mallocPointer(2) + .put(0, memAddress(x)) + .put(1, memAddress(y)); + } + /** Three value version of {@link #mallocPointer}. */ + public PointerBuffer pointers(Buffer x, Buffer y, Buffer z) { + return mallocPointer(3) + .put(0, memAddress(x)) + .put(1, memAddress(y)) + .put(2, memAddress(z)); + } + /** Four value version of {@link #mallocPointer}. */ + public PointerBuffer pointers(Buffer x, Buffer y, Buffer z, Buffer w) { + return mallocPointer(4) + .put(0, memAddress(x)) + .put(1, memAddress(y)) + .put(2, memAddress(z)) + .put(3, memAddress(w)); + } + /** Vararg version of {@link #mallocPointer}. */ + public PointerBuffer pointers(Buffer... values) { + PointerBuffer buffer = mallocPointer(values.length); + for (int i = 0; i < values.length; i++) { + buffer.put(i, memAddress(values[i])); + } + return buffer; + } + + // ------------------------------------------------- + + /** + * Encodes the specified text on the stack using ASCII encoding and returns a ByteBuffer that points to the encoded text, including a null-terminator. + * + * @param text the text to encode + */ + public ByteBuffer ASCII(CharSequence text) { + return ASCII(text, true); + } + + /** + * Encodes the specified text on the stack using ASCII encoding and returns a ByteBuffer that points to the encoded text. + * + * @param text the text to encode + * @param nullTerminated if true, a null-terminator is included at the end of the encoded text + */ + public ByteBuffer ASCII(CharSequence text, boolean nullTerminated) { + int length = memLengthASCII(text, nullTerminated); + long target = nmalloc(1, length); + encodeASCII(text, nullTerminated, target); + + return MemoryUtil.wrap(BUFFER_BYTE, target, length).order(NATIVE_ORDER); + } + + /** + * Encodes the specified text on the stack using ASCII encoding and returns the encoded text length, in bytes. + * + *

Use {@link #getPointerAddress} immediately after this method to get the encoded text address.

+ * + * @param text the text to encode + * @param nullTerminated if true, a null-terminator is included at the end of the encoded text + */ + public int nASCII(CharSequence text, boolean nullTerminated) { + return encodeASCII(text, nullTerminated, nmalloc(1, memLengthASCII(text, nullTerminated))); + } + + /** Like {@link #ASCII(CharSequence) ASCII}, but returns {@code null} if {@code text} is {@code null}. */ + @Nullable + public ByteBuffer ASCIISafe(@Nullable CharSequence text) { + return ASCIISafe(text, true); + } + + /** Like {@link #ASCII(CharSequence, boolean) ASCII}, but returns {@code null} if {@code text} is {@code null}. */ + @Nullable + public ByteBuffer ASCIISafe(@Nullable CharSequence text, boolean nullTerminated) { + return text == null ? null : ASCII(text, nullTerminated); + } + + /** Like {@link #nASCII(CharSequence, boolean) nASCII}, but returns 0 if {@code text} is {@code null}. */ + public int nASCIISafe(@Nullable CharSequence text, boolean nullTerminated) { + return text == null ? 0 : nASCII(text, nullTerminated); + } + + /** + * Encodes the specified text on the stack using UTF8 encoding and returns a ByteBuffer that points to the encoded text, including a null-terminator. + * + * @param text the text to encode + */ + public ByteBuffer UTF8(CharSequence text) { + return UTF8(text, true); + } + + /** + * Encodes the specified text on the stack using UTF8 encoding and returns a ByteBuffer that points to the encoded text. + * + * @param text the text to encode + * @param nullTerminated if true, a null-terminator is included at the end of the encoded text + */ + public ByteBuffer UTF8(CharSequence text, boolean nullTerminated) { + int length = memLengthUTF8(text, nullTerminated); + long target = nmalloc(1, length); + encodeUTF8(text, nullTerminated, target); + return MemoryUtil.wrap(BUFFER_BYTE, target, length).order(NATIVE_ORDER); + } + + /** + * Encodes the specified text on the stack using UTF8 encoding and returns the encoded text length, in bytes. + * + *

Use {@link #getPointerAddress} immediately after this method to get the encoded text address.

+ * + * @param text the text to encode + * @param nullTerminated if true, a null-terminator is included at the end of the encoded text + */ + public int nUTF8(CharSequence text, boolean nullTerminated) { + return encodeUTF8(text, nullTerminated, nmalloc(1, memLengthUTF8(text, nullTerminated))); + } + + /** Like {@link #UTF8(CharSequence) UTF8}, but returns {@code null} if {@code text} is {@code null}. */ + @Nullable + public ByteBuffer UTF8Safe(@Nullable CharSequence text) { + return UTF8Safe(text, true); + } + + /** Like {@link #UTF8(CharSequence, boolean) UTF8}, but returns {@code null} if {@code text} is {@code null}. */ + @Nullable + public ByteBuffer UTF8Safe(@Nullable CharSequence text, boolean nullTerminated) { + return text == null ? null : UTF8(text, nullTerminated); + } + + /** Like {@link #nUTF8(CharSequence, boolean) nUTF8}, but returns 0 if {@code text} is {@code null}. */ + public int nUTF8Safe(@Nullable CharSequence text, boolean nullTerminated) { + return text == null ? 0 : nUTF8(text, nullTerminated); + } + + /** + * Encodes the specified text on the stack using UTF16 encoding and returns a ByteBuffer that points to the encoded text, including a null-terminator. + * + * @param text the text to encode + */ + public ByteBuffer UTF16(CharSequence text) { + return UTF16(text, true); + } + + /** + * Encodes the specified text on the stack using UTF16 encoding and returns a ByteBuffer that points to the encoded text. + * + * @param text the text to encode + * @param nullTerminated if true, a null-terminator is included at the end of the encoded text + */ + public ByteBuffer UTF16(CharSequence text, boolean nullTerminated) { + int length = memLengthUTF16(text, nullTerminated); + long target = nmalloc(2, length); + encodeUTF16(text, nullTerminated, target); + return MemoryUtil.wrap(BUFFER_BYTE, target, length).order(NATIVE_ORDER); + } + + /** + * Encodes the specified text on the stack using UTF16 encoding and returns the encoded text length, in bytes. + * + *

Use {@link #getPointerAddress} immediately after this method to get the encoded text address.

+ * + * @param text the text to encode + * @param nullTerminated if true, a null-terminator is included at the end of the encoded text + */ + public int nUTF16(CharSequence text, boolean nullTerminated) { + return encodeUTF16(text, nullTerminated, nmalloc(2, memLengthUTF16(text, nullTerminated))); + } + + /** Like {@link #UTF16(CharSequence) UTF16}, but returns {@code null} if {@code text} is {@code null}. */ + @Nullable + public ByteBuffer UTF16Safe(@Nullable CharSequence text) { + return UTF16Safe(text, true); + } + + /** Like {@link #UTF16(CharSequence, boolean) UTF16}, but returns {@code null} if {@code text} is {@code null}. */ + @Nullable + public ByteBuffer UTF16Safe(@Nullable CharSequence text, boolean nullTerminated) { + return text == null ? null : UTF16(text, nullTerminated); + } + + /** Like {@link #nUTF16(CharSequence, boolean) nUTF16}, but returns 0 if {@code text} is {@code null}. */ + public int nUTF16Safe(@Nullable CharSequence text, boolean nullTerminated) { + return text == null ? 0 : nUTF16(text, nullTerminated); + } + + // ----------------------------------------------------- + // ----------------------------------------------------- + // ----------------------------------------------------- + + /** Returns the stack of the current thread. */ + public static MemoryStack stackGet() { + return TLS.get(); + } + + /** + * Calls {@link #push} on the stack of the current thread. + * + * @return the stack of the current thread. + */ + public static MemoryStack stackPush() { + return stackGet().push(); + } + + /** + * Calls {@link #pop} on the stack of the current thread. + * + * @return the stack of the current thread. + */ + public static MemoryStack stackPop() { + return stackGet().pop(); + } + + /** Thread-local version of {@link #nmalloc(int)}. */ + public static long nstackMalloc(int size) { return stackGet().nmalloc(size); } + /** Thread-local version of {@link #nmalloc(int, int)}. */ + public static long nstackMalloc(int alignment, int size) { return stackGet().nmalloc(alignment, size); } + /** Thread-local version of {@link #ncalloc}. */ + public static long nstackCalloc(int alignment, int num, int size) { return stackGet().ncalloc(alignment, num, size); } + + // ------------------------------------------------- + + /** Thread-local version of {@link #malloc}. */ + public static ByteBuffer stackMalloc(int size) { return stackGet().malloc(size); } + /** Thread-local version of {@link #calloc}. */ + public static ByteBuffer stackCalloc(int size) { return stackGet().calloc(size); } + + /** Thread-local version of {@link #bytes(byte)}. */ + public static ByteBuffer stackBytes(byte x) { return stackGet().bytes(x); } + /** Thread-local version of {@link #bytes(byte, byte)}. */ + public static ByteBuffer stackBytes(byte x, byte y) { return stackGet().bytes(x, y); } + /** Thread-local version of {@link #bytes(byte, byte, byte)}. */ + public static ByteBuffer stackBytes(byte x, byte y, byte z) { return stackGet().bytes(x, y, z); } + /** Thread-local version of {@link #bytes(byte, byte, byte, byte)}. */ + public static ByteBuffer stackBytes(byte x, byte y, byte z, byte w) { return stackGet().bytes(x, y, z, w); } + /** Thread-local version of {@link #bytes(byte...)}. */ + public static ByteBuffer stackBytes(byte... values) { return stackGet().bytes(values); } + + // ------------------------------------------------- + + /** Thread-local version of {@link #mallocShort}. */ + public static ShortBuffer stackMallocShort(int size) { return stackGet().mallocShort(size); } + /** Thread-local version of {@link #callocShort}. */ + public static ShortBuffer stackCallocShort(int size) { return stackGet().callocShort(size); } + + /** Thread-local version of {@link #shorts(short)}. */ + public static ShortBuffer stackShorts(short x) { return stackGet().shorts(x); } + /** Thread-local version of {@link #shorts(short, short)}. */ + public static ShortBuffer stackShorts(short x, short y) { return stackGet().shorts(x, y); } + /** Thread-local version of {@link #shorts(short, short, short)}. */ + public static ShortBuffer stackShorts(short x, short y, short z) { return stackGet().shorts(x, y, z); } + /** Thread-local version of {@link #shorts(short, short, short, short)}. */ + public static ShortBuffer stackShorts(short x, short y, short z, short w) { return stackGet().shorts(x, y, z, w); } + /** Thread-local version of {@link #shorts(short...)}. */ + public static ShortBuffer stackShorts(short... values) { return stackGet().shorts(values); } + + // ------------------------------------------------- + + /** Thread-local version of {@link #mallocInt}. */ + public static IntBuffer stackMallocInt(int size) { return stackGet().mallocInt(size); } + /** Thread-local version of {@link #callocInt}. */ + public static IntBuffer stackCallocInt(int size) { return stackGet().callocInt(size); } + + /** Thread-local version of {@link #ints(int)}. */ + public static IntBuffer stackInts(int x) { return stackGet().ints(x); } + /** Thread-local version of {@link #ints(int, int)}. */ + public static IntBuffer stackInts(int x, int y) { return stackGet().ints(x, y); } + /** Thread-local version of {@link #ints(int, int, int)}. */ + public static IntBuffer stackInts(int x, int y, int z) { return stackGet().ints(x, y, z); } + /** Thread-local version of {@link #ints(int, int, int, int)}. */ + public static IntBuffer stackInts(int x, int y, int z, int w) { return stackGet().ints(x, y, z, w); } + /** Thread-local version of {@link #ints(int...)}. */ + public static IntBuffer stackInts(int... values) { return stackGet().ints(values); } + + // ------------------------------------------------- + + /** Thread-local version of {@link #mallocLong}. */ + public static LongBuffer stackMallocLong(int size) { return stackGet().mallocLong(size); } + /** Thread-local version of {@link #callocLong}. */ + public static LongBuffer stackCallocLong(int size) { return stackGet().callocLong(size); } + + /** Thread-local version of {@link #longs(long)}. */ + public static LongBuffer stackLongs(long x) { return stackGet().longs(x); } + /** Thread-local version of {@link #longs(long, long)}. */ + public static LongBuffer stackLongs(long x, long y) { return stackGet().longs(x, y); } + /** Thread-local version of {@link #longs(long, long, long)}. */ + public static LongBuffer stackLongs(long x, long y, long z) { return stackGet().longs(x, y, z); } + /** Thread-local version of {@link #longs(long, long, long, long)}. */ + public static LongBuffer stackLongs(long x, long y, long z, long w) { return stackGet().longs(x, y, z, w); } + /** Thread-local version of {@link #longs(long...)}. */ + public static LongBuffer stackLongs(long... values) { return stackGet().longs(values); } + + // ------------------------------------------------- + + /** Thread-local version of {@link #mallocCLong}. */ + public static CLongBuffer stackMallocCLong(int size) { return stackGet().mallocCLong(size); } + /** Thread-local version of {@link #callocCLong}. */ + public static CLongBuffer stackCallocCLong(int size) { return stackGet().callocCLong(size); } + + /** Thread-local version of {@link #longs(long)}. */ + public static CLongBuffer stackCLongs(long x) { return stackGet().clongs(x); } + /** Thread-local version of {@link #longs(long, long)}. */ + public static CLongBuffer stackCLongs(long x, long y) { return stackGet().clongs(x, y); } + /** Thread-local version of {@link #longs(long, long, long)}. */ + public static CLongBuffer stackCLongs(long x, long y, long z) { return stackGet().clongs(x, y, z); } + /** Thread-local version of {@link #longs(long, long, long, long)}. */ + public static CLongBuffer stackCLongs(long x, long y, long z, long w) { return stackGet().clongs(x, y, z, w); } + /** Thread-local version of {@link #longs(long...)}. */ + public static CLongBuffer stackCLongs(long... values) { return stackGet().clongs(values); } + + // ------------------------------------------------- + + /** Thread-local version of {@link #mallocFloat}. */ + public static FloatBuffer stackMallocFloat(int size) { return stackGet().mallocFloat(size); } + /** Thread-local version of {@link #callocFloat}. */ + public static FloatBuffer stackCallocFloat(int size) { return stackGet().callocFloat(size); } + + /** Thread-local version of {@link #floats(float)}. */ + public static FloatBuffer stackFloats(float x) { return stackGet().floats(x); } + /** Thread-local version of {@link #floats(float, float)}. */ + public static FloatBuffer stackFloats(float x, float y) { return stackGet().floats(x, y); } + /** Thread-local version of {@link #floats(float, float, float)}. */ + public static FloatBuffer stackFloats(float x, float y, float z) { return stackGet().floats(x, y, z); } + /** Thread-local version of {@link #floats(float, float, float, float)}. */ + public static FloatBuffer stackFloats(float x, float y, float z, float w) { return stackGet().floats(x, y, z, w); } + /** Thread-local version of {@link #floats(float...)}. */ + public static FloatBuffer stackFloats(float... values) { return stackGet().floats(values); } + + // ------------------------------------------------- + + /** Thread-local version of {@link #mallocDouble}. */ + public static DoubleBuffer stackMallocDouble(int size) { return stackGet().mallocDouble(size); } + /** Thread-local version of {@link #callocDouble}. */ + public static DoubleBuffer stackCallocDouble(int size) { return stackGet().callocDouble(size); } + + /** Thread-local version of {@link #doubles(double)}. */ + public static DoubleBuffer stackDoubles(double x) { return stackGet().doubles(x); } + /** Thread-local version of {@link #doubles(double, double)}. */ + public static DoubleBuffer stackDoubles(double x, double y) { return stackGet().doubles(x, y); } + /** Thread-local version of {@link #doubles(double, double, double)}. */ + public static DoubleBuffer stackDoubles(double x, double y, double z) { return stackGet().doubles(x, y, z); } + /** Thread-local version of {@link #doubles(double, double, double, double)}. */ + public static DoubleBuffer stackDoubles(double x, double y, double z, double w) { return stackGet().doubles(x, y, z, w); } + /** Thread-local version of {@link #doubles(double...)}. */ + public static DoubleBuffer stackDoubles(double... values) { return stackGet().doubles(values); } + + // ------------------------------------------------- + + /** Thread-local version of {@link #mallocPointer}. */ + public static PointerBuffer stackMallocPointer(int size) { return stackGet().mallocPointer(size); } + /** Thread-local version of {@link #callocPointer}. */ + public static PointerBuffer stackCallocPointer(int size) { return stackGet().callocPointer(size); } + + /** Thread-local version of {@link #pointers(long)}. */ + public static PointerBuffer stackPointers(long x) { return stackGet().pointers(x); } + /** Thread-local version of {@link #pointers(long, long)}. */ + public static PointerBuffer stackPointers(long x, long y) { return stackGet().pointers(x, y); } + /** Thread-local version of {@link #pointers(long, long, long)}. */ + public static PointerBuffer stackPointers(long x, long y, long z) { return stackGet().pointers(x, y, z); } + /** Thread-local version of {@link #pointers(long, long, long, long)}. */ + public static PointerBuffer stackPointers(long x, long y, long z, long w) { return stackGet().pointers(x, y, z, w); } + /** Thread-local version of {@link #pointers(long...)}. */ + public static PointerBuffer stackPointers(long... values) { return stackGet().pointers(values); } + + /** Thread-local version of {@link #pointers(Pointer)}. */ + public static PointerBuffer stackPointers(Pointer x) { return stackGet().pointers(x); } + /** Thread-local version of {@link #pointers(Pointer, Pointer)}. */ + public static PointerBuffer stackPointers(Pointer x, Pointer y) { return stackGet().pointers(x, y); } + /** Thread-local version of {@link #pointers(Pointer, Pointer, Pointer)}. */ + public static PointerBuffer stackPointers(Pointer x, Pointer y, Pointer z) { return stackGet().pointers(x, y, z); } + /** Thread-local version of {@link #pointers(Pointer, Pointer, Pointer, Pointer)}. */ + public static PointerBuffer stackPointers(Pointer x, Pointer y, Pointer z, Pointer w) { return stackGet().pointers(x, y, z, w); } + /** Thread-local version of {@link #pointers(Pointer...)}. */ + public static PointerBuffer stackPointers(Pointer... values) { return stackGet().pointers(values); } + + // ------------------------------------------------- + + /** Thread-local version of {@link #ASCII(CharSequence)}. */ + public static ByteBuffer stackASCII(CharSequence text) { return stackGet().ASCII(text); } + + /** Thread-local version of {@link #ASCII(CharSequence, boolean)}. */ + public static ByteBuffer stackASCII(CharSequence text, boolean nullTerminated) { return stackGet().ASCII(text, nullTerminated); } + + /** Thread-local version of {@link #UTF8(CharSequence)}. */ + public static ByteBuffer stackUTF8(CharSequence text) { return stackGet().UTF8(text); } + + /** Thread-local version of {@link #UTF8(CharSequence, boolean)}. */ + public static ByteBuffer stackUTF8(CharSequence text, boolean nullTerminated) { return stackGet().UTF8(text, nullTerminated); } + + /** Thread-local version of {@link #UTF16(CharSequence)}. */ + public static ByteBuffer stackUTF16(CharSequence text) { return stackGet().UTF16(text); } + + /** Thread-local version of {@link #UTF16(CharSequence, boolean)}. */ + public static ByteBuffer stackUTF16(CharSequence text, boolean nullTerminated) { return stackGet().UTF16(text, nullTerminated); } + + /** Thread-local version of {@link #ASCII(CharSequence)}. */ + @Nullable public static ByteBuffer stackASCIISafe(@Nullable CharSequence text) { return stackGet().ASCIISafe(text); } + + /** Thread-local version of {@link #ASCII(CharSequence, boolean)}. */ + @Nullable public static ByteBuffer stackASCIISafe(@Nullable CharSequence text, boolean nullTerminated) { return stackGet().ASCIISafe(text, nullTerminated); } + + /** Thread-local version of {@link #UTF8(CharSequence)}. */ + @Nullable public static ByteBuffer stackUTF8Safe(@Nullable CharSequence text) { return stackGet().UTF8Safe(text); } + + /** Thread-local version of {@link #UTF8(CharSequence, boolean)}. */ + @Nullable public static ByteBuffer stackUTF8Safe(@Nullable CharSequence text, boolean nullTerminated) { return stackGet().UTF8Safe(text, nullTerminated); } + + /** Thread-local version of {@link #UTF16(CharSequence)}. */ + @Nullable public static ByteBuffer stackUTF16Safe(@Nullable CharSequence text) { return stackGet().UTF16Safe(text); } + + /** Thread-local version of {@link #UTF16(CharSequence, boolean)}. */ + @Nullable public static ByteBuffer stackUTF16Safe(@Nullable CharSequence text, boolean nullTerminated) { return stackGet().UTF16Safe(text, nullTerminated); } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/MemoryUtil.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/MemoryUtil.java new file mode 100644 index 00000000..76c46abe --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/MemoryUtil.java @@ -0,0 +1,3013 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import org.lwjgl.*; +import org.lwjgl.system.MemoryManage.*; +import org.lwjgl.system.MemoryUtil.MemoryAllocationReport.*; +import org.lwjgl.system.jni.*; + +import javax.annotation.*; +import java.nio.*; +import java.nio.charset.*; +import java.util.*; + +import static java.lang.Character.*; +import static java.lang.Math.*; +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MathUtil.*; +import static org.lwjgl.system.MemoryUtil.LazyInit.*; +import static org.lwjgl.system.Pointer.*; +import static org.lwjgl.system.jni.JNINativeInterface.*; +import static org.lwjgl.system.libc.LibCString.*; + +/** + * This class provides functionality for managing native memory. + * + *

All methods in this class will make use of {@link sun.misc.Unsafe} if it's available, for performance. If Unsafe is not available, the fallback + * implementations make use of reflection and, in the worst-case, JNI.

+ * + *

Method names in this class are prefixed with {@code mem} to avoid ambiguities when used with static imports.

+ * + *

Text encoding/decoding

+ * + * Three codecs are available, each with a different postfix: + *
    + *
  • UTF16 - Direct mapping of 2 bytes to Java char and vice versa
  • + *
  • UTF8 - custom UTF-8 codec without intermediate allocations
  • + *
  • ASCII - Not the original 7bit ASCII, but any character set with a single byte encoding (ISO 8859-1, Windows-1252, etc.)
  • + *
+ * + *

Methods in bindings that accept/return {@code CharSequence}/{@code String} also support {@code ByteBuffer}, so custom codecs can be used if necessary.

+ * + * @see Configuration#MEMORY_ALLOCATOR + * @see Configuration#DEBUG_MEMORY_ALLOCATOR + */ +public final class MemoryUtil { + + /** Alias for the null pointer address. */ + public static final long NULL = 0L; + + /** The memory page size, in bytes. This value is always a power-of-two. */ + public static final int PAGE_SIZE; + + /** The cache-line size, in bytes. This value is always a power-of-two. */ + public static final int CACHE_LINE_SIZE; + + static final int ARRAY_TLC_SIZE = Configuration.ARRAY_TLC_SIZE.get(8192); + + static final ThreadLocal ARRAY_TLC_BYTE = ThreadLocal.withInitial(() -> new byte[ARRAY_TLC_SIZE]); + static final ThreadLocal ARRAY_TLC_CHAR = ThreadLocal.withInitial(() -> new char[ARRAY_TLC_SIZE]); + + static final sun.misc.Unsafe UNSAFE; + + static final ByteOrder NATIVE_ORDER = ByteOrder.nativeOrder(); + + private static final Charset UTF16 = NATIVE_ORDER == ByteOrder.LITTLE_ENDIAN + ? StandardCharsets.UTF_16LE + : StandardCharsets.UTF_16BE; + + static final Class BUFFER_BYTE; + static final Class BUFFER_SHORT; + static final Class BUFFER_CHAR; + static final Class BUFFER_INT; + static final Class BUFFER_LONG; + static final Class BUFFER_FLOAT; + static final Class BUFFER_DOUBLE; + + private static final long MARK; + private static final long POSITION; + private static final long LIMIT; + private static final long CAPACITY; + + private static final long ADDRESS; + + private static final long PARENT_BYTE; + private static final long PARENT_SHORT; + private static final long PARENT_CHAR; + private static final long PARENT_INT; + private static final long PARENT_LONG; + private static final long PARENT_FLOAT; + private static final long PARENT_DOUBLE; + + static { + Library.initialize(); + + //ACCESSOR = MemoryAccess.getInstance(); + ByteBuffer bb = ByteBuffer.allocateDirect(0).order(NATIVE_ORDER); + + BUFFER_BYTE = bb.getClass(); + BUFFER_SHORT = bb.asShortBuffer().getClass(); + BUFFER_CHAR = bb.asCharBuffer().getClass(); + BUFFER_INT = bb.asIntBuffer().getClass(); + BUFFER_LONG = bb.asLongBuffer().getClass(); + BUFFER_FLOAT = bb.asFloatBuffer().getClass(); + BUFFER_DOUBLE = bb.asDoubleBuffer().getClass(); + + UNSAFE = getUnsafeInstance(); + + try { + MARK = getMarkOffset(); + POSITION = getPositionOffset(); + LIMIT = getLimitOffset(); + CAPACITY = getCapacityOffset(); + + ADDRESS = getAddressOffset(); + + int oopSize = UNSAFE.arrayIndexScale(Object[].class); + + long offset = (max(max(max(MARK, POSITION), LIMIT), CAPACITY) + 4 + (oopSize - 1)) & ~Integer.toUnsignedLong(oopSize - 1); + long a = memAddress(bb); + + PARENT_BYTE = getParentOffset(offset, oopSize, bb, bb.duplicate().order(bb.order())); + PARENT_SHORT = getParentOffset(offset, oopSize, memShortBuffer(a, 0), bb.asShortBuffer()); + PARENT_CHAR = getParentOffset(offset, oopSize, memCharBuffer(a, 0), bb.asCharBuffer()); + PARENT_INT = getParentOffset(offset, oopSize, memIntBuffer(a, 0), bb.asIntBuffer()); + PARENT_LONG = getParentOffset(offset, oopSize, memLongBuffer(a, 0), bb.asLongBuffer()); + PARENT_FLOAT = getParentOffset(offset, oopSize, memFloatBuffer(a, 0), bb.asFloatBuffer()); + PARENT_DOUBLE = getParentOffset(offset, oopSize, memDoubleBuffer(a, 0), bb.asDoubleBuffer()); + } catch (Throwable t) { + throw new UnsupportedOperationException(t); + } + + PAGE_SIZE = UNSAFE.pageSize(); + CACHE_LINE_SIZE = 64; // TODO: Can we do better? + } + + static final class LazyInit { + + private LazyInit() { + } + + static final MemoryAllocator ALLOCATOR_IMPL; + static final MemoryAllocator ALLOCATOR; + + static { + ALLOCATOR_IMPL = MemoryManage.getInstance(); + ALLOCATOR = Configuration.DEBUG_MEMORY_ALLOCATOR.get(false) + ? new DebugAllocator(ALLOCATOR_IMPL) + : ALLOCATOR_IMPL; + + apiLog("MemoryUtil allocator: " + ALLOCATOR.getClass().getSimpleName()); + } + } + + private MemoryUtil() { + } + + /* ------------------------------------- + ------------------------------------- + EXPLICIT MEMORY MANAGEMENT API + ------------------------------------- + ------------------------------------- */ + + /** The interface implemented by the memory allocator used by the explicit memory management API ({@link #memAlloc}, {@link #memFree}, etc). */ + public interface MemoryAllocator { + + /** Returns a pointer to the malloc function. */ + long getMalloc(); + /** Returns a pointer to the calloc function. */ + long getCalloc(); + /** Returns a pointer to the realloc function. */ + long getRealloc(); + /** Returns a pointer to the free function. */ + long getFree(); + /** Returns a pointer to the aligned_alloc function. */ + long getAlignedAlloc(); + /** Returns a pointer to the aligned_free function. */ + long getAlignedFree(); + + /** Called by {@link MemoryUtil#memAlloc}. */ + long malloc(long size); + /** Called by {@link MemoryUtil#memCalloc}. */ + long calloc(long num, long size); + /** Called by {@link MemoryUtil#memRealloc}. */ + long realloc(long ptr, long size); + /** Called by {@link MemoryUtil#memFree}. */ + void free(long ptr); + + /** Called by {@link MemoryUtil#memAlignedAlloc}. */ + long aligned_alloc(long alignment, long size); + /** Called by {@link MemoryUtil#memAlignedFree}. */ + void aligned_free(long ptr); + + } + + /** + * Returns the {@link MemoryAllocator} instance used internally by the explicit memory management API ({@link #memAlloc}, {@link #memFree}, etc). + * + *

Allocations made through the returned instance will not be tracked for memory leaks, even if {@link Configuration#DEBUG_MEMORY_ALLOCATOR} is enabled. + * This can be useful for {@code static final} allocations that live throughout the application's lifetime and will never be freed until the process is + * terminated. Normally such allocations would be reported as memory leaks by the debug allocator.

+ * + *

The expectation is that this method will rarely be used, so it does not have the {@code mem} prefix to avoid pollution of auto-complete lists.

+ * + * @return the {@link MemoryAllocator} instance + */ + public static MemoryAllocator getAllocator() { + return getAllocator(false); + } + + /** + * Returns the {@link MemoryAllocator} instance used internally by the explicit memory management API ({@link #memAlloc}, {@link #memFree}, etc). + * + * @param tracked whether allocations will be tracked for memory leaks, if {@link Configuration#DEBUG_MEMORY_ALLOCATOR} is enabled. + * + * @return the {@link MemoryAllocator} instance + */ + public static MemoryAllocator getAllocator(boolean tracked) { + return tracked + ? ALLOCATOR + : ALLOCATOR_IMPL; + } + + // --- [ memAlloc ] --- + + /** Unsafe version of {@link #memAlloc}. May return {@link #NULL} if {@code size} is zero or the allocation failed. */ + public static long nmemAlloc(long size) { + return ALLOCATOR.malloc(size); + } + + /** + * Unsafe version of {@link #memAlloc} that checks the returned pointer. + * + * @return a pointer to the memory block allocated by the function on success. This pointer will never be {@link #NULL}, even if {@code size} is zero. + * + * @throws OutOfMemoryError if the function failed to allocate the requested block of memory + */ + public static long nmemAllocChecked(long size) { + long address = nmemAlloc(size != 0 ? size : 1L); + if (CHECKS && address == NULL) { + throw new OutOfMemoryError(); + } + return address; + } + + private static long getAllocationSize(int elements, int elementShift) { + return apiCheckAllocation(elements, Integer.toUnsignedLong(elements) << elementShift, BITS64 ? Long.MAX_VALUE : 0xFFFF_FFFFL); + } + + /** + * The standard C malloc function. + * + *

Allocates a block of {@code size} bytes of memory, returning a pointer to the beginning of the block. The content of the newly allocated block of + * memory is not initialized, remaining with indeterminate values.

+ * + *

Memory allocated with this method must be freed with {@link #memFree}.

+ * + * @param size the size of the memory block to allocate, in bytes. If {@code size} is zero, the returned pointer shall not be dereferenced. + * + * @return on success, a pointer to the memory block allocated by the function + * + * @throws OutOfMemoryError if the function failed to allocate the requested block of memory + */ + public static ByteBuffer memAlloc(int size) { + return wrap(BUFFER_BYTE, nmemAllocChecked(size), size).order(NATIVE_ORDER); + } + + /** + * ShortBuffer version of {@link #memAlloc}. + * + * @param size the number of short values to allocate. + */ + public static ShortBuffer memAllocShort(int size) { + return wrap(BUFFER_SHORT, nmemAllocChecked(getAllocationSize(size, 1)), size); + } + + /** + * IntBuffer version of {@link #memAlloc}. + * + * @param size the number of int values to allocate. + */ + public static IntBuffer memAllocInt(int size) { + return wrap(BUFFER_INT, nmemAllocChecked(getAllocationSize(size, 2)), size); + } + + /** + * FloatBuffer version of {@link #memAlloc}. + * + * @param size the number of float values to allocate. + */ + public static FloatBuffer memAllocFloat(int size) { + return wrap(BUFFER_FLOAT, nmemAllocChecked(getAllocationSize(size, 2)), size); + } + + /** + * LongBuffer version of {@link #memAlloc}. + * + * @param size the number of long values to allocate. + */ + public static LongBuffer memAllocLong(int size) { + return wrap(BUFFER_LONG, nmemAllocChecked(getAllocationSize(size, 3)), size); + } + + /** + * {@code CLongBuffer} version of {@link #memAlloc}. + * + * @param size the number of C long values to allocate. + */ + public static CLongBuffer memAllocCLong(int size) { + return Default.wrap(CLongBuffer.class, nmemAllocChecked(getAllocationSize(size, CLONG_SHIFT)), size); + } + + /** + * DoubleBuffer version of {@link #memAlloc}. + * + * @param size the number of double values to allocate. + */ + public static DoubleBuffer memAllocDouble(int size) { + return wrap(BUFFER_DOUBLE, nmemAllocChecked(getAllocationSize(size, 3)), size); + } + + /** + * PointerBuffer version of {@link #memAlloc}. + * + * @param size the number of pointer values to allocate. + */ + public static PointerBuffer memAllocPointer(int size) { + return Default.wrap(PointerBuffer.class, nmemAllocChecked(getAllocationSize(size, POINTER_SHIFT)), size); + } + + /** Unsafe version of {@link #memFree}. */ + public static void nmemFree(long ptr) { + ALLOCATOR.free(ptr); + } + + /** + * The standard C free function. + * + *

A block of memory previously allocated by a call to {@link #memAlloc}, {@link #memCalloc} or {@link #memRealloc} is deallocated, making it available + * again for further allocations.

+ * + * @param ptr pointer to a memory block previously allocated with {@link #memAlloc}, {@link #memCalloc} or {@link #memRealloc}. If {@code ptr} does not + * point to a block of memory allocated with the above functions, it causes undefined behavior. If {@code ptr} is a {@link #NULL} pointer, the + * function does nothing. + */ + public static void memFree(@Nullable Buffer ptr) { + if (ptr != null) { + nmemFree(UNSAFE.getLong(ptr, ADDRESS)); + } + } + + /** {@code CustomBuffer} version of {@link #memFree}. */ + public static void memFree(@Nullable CustomBuffer ptr) { + if (ptr != null) { + nmemFree(ptr.address); + } + } + + // --- [ memCalloc ] --- + + /** Unsafe version of {@link #memCalloc}. May return {@link #NULL} if {@code num} or {@code size} are zero or the allocation failed. */ + public static long nmemCalloc(long num, long size) { + return ALLOCATOR.calloc(num, size); + } + + /** + * Unsafe version of {@link #memCalloc} that checks the returned pointer. + * + * @return a pointer to the memory block allocated by the function on success. This pointer will never be {@link #NULL}, even if {@code num} or + * {@code size} are zero. + * + * @throws OutOfMemoryError if the function failed to allocate the requested block of memory + */ + public static long nmemCallocChecked(long num, long size) { + if (num == 0L || size == 0L) { + num = 1L; + size = 1L; + } + + long address = nmemCalloc(num, size); + if (CHECKS && address == NULL) { + throw new OutOfMemoryError(); + } + return address; + } + + /** + * The standard C calloc function. + * + *

Allocates a block of memory for an array of {@code num} elements, each of them {@code size} bytes long, and initializes all its bits to zero. The + * effective result is the allocation of a zero-initialized memory block of {@code (num*size)} bytes.

+ * + *

Memory allocated with this method must be freed with {@link #memFree}.

+ * + * @param num the number of elements to allocate. + * @param size the size of each element. If {@code size} is zero, the return value depends on the particular library implementation (it may or may not be + * a null pointer), but the returned pointer shall not be dereferenced. + * + * @return on success, a pointer to the memory block allocated by the function + * + * @throws OutOfMemoryError if the function failed to allocate the requested block of memory + */ + public static ByteBuffer memCalloc(int num, int size) { + return wrap(BUFFER_BYTE, nmemCallocChecked(num, size), num * size).order(NATIVE_ORDER); + } + + /** + * Alternative version of {@link #memCalloc}. + * + * @param num the number of bytes to allocate. + */ + public static ByteBuffer memCalloc(int num) { + return wrap(BUFFER_BYTE, nmemCallocChecked(num, 1), num).order(NATIVE_ORDER); + } + + /** + * ShortBuffer version of {@link #memCalloc}. + * + * @param num the number of short values to allocate. + */ + public static ShortBuffer memCallocShort(int num) { + return wrap(BUFFER_SHORT, nmemCallocChecked(num, 2), num); + } + + /** + * IntBuffer version of {@link #memCalloc}. + * + * @param num the number of int values to allocate. + */ + public static IntBuffer memCallocInt(int num) { + return wrap(BUFFER_INT, nmemCallocChecked(num, 4), num); + } + + /** + * FloatBuffer version of {@link #memCalloc}. + * + * @param num the number of float values to allocate. + */ + public static FloatBuffer memCallocFloat(int num) { + return wrap(BUFFER_FLOAT, nmemCallocChecked(num, 4), num); + } + + /** + * LongBuffer version of {@link #memCalloc}. + * + * @param num the number of long values to allocate. + */ + public static LongBuffer memCallocLong(int num) { + return wrap(BUFFER_LONG, nmemCallocChecked(num, 8), num); + } + + /** + * {@code CLongBuffer} version of {@link #memCalloc}. + * + * @param num the number of C long values to allocate. + */ + public static CLongBuffer memCallocCLong(int num) { + return Default.wrap(CLongBuffer.class, nmemCallocChecked(num, CLONG_SIZE), num); + } + + /** + * DoubleBuffer version of {@link #memCalloc}. + * + * @param num the number of double values to allocate. + */ + public static DoubleBuffer memCallocDouble(int num) { + return wrap(BUFFER_DOUBLE, nmemCallocChecked(num, 8), num); + } + + /** + * PointerBuffer version of {@link #memCalloc}. + * + * @param num the number of pointer values to allocate. + */ + public static PointerBuffer memCallocPointer(int num) { + return Default.wrap(PointerBuffer.class, nmemCallocChecked(num, POINTER_SIZE), num); + } + + // --- [ memRealloc] --- + + /** Unsafe version of {@link #memRealloc}. May return {@link #NULL} if {@code size} is zero or the allocation failed. */ + public static long nmemRealloc(long ptr, long size) { + return ALLOCATOR.realloc(ptr, size); + } + + /** + * Unsafe version of {@link #memRealloc} that checks the returned pointer. + * + * @return a pointer to the memory block reallocated by the function on success. This pointer will never be {@link #NULL}, even if {@code size} is zero. + * + * @throws OutOfMemoryError if the function failed to allocate the requested block of memory + */ + public static long nmemReallocChecked(long ptr, long size) { + long address = nmemRealloc(ptr, size != 0 ? size : 1L); + if (CHECKS && address == NULL) { + throw new OutOfMemoryError(); + } + return address; + } + + private static T realloc(@Nullable T old_p, T new_p, int size) { + if (old_p != null) { + new_p.position(min(old_p.position(), size)); + } + return new_p; + } + + /** + * The standard C realloc function. + * + *

Changes the size of the memory block pointed to by {@code ptr}. The function may move the memory block to a new location (whose address is returned + * by the function). The content of the memory block is preserved up to the lesser of the new and old sizes, even if the block is moved to a new location. + * If the new size is larger, the value of the newly allocated portion is indeterminate.

+ * + *

The memory address used is always the address at the start of {@code ptr}, so the current position of {@code ptr} does not need to be set to 0 for + * this function to work. The current position is preserved, even if the memory block is moved to a new location, unless {@code size} is less than the + * current position in which case position will be equal to capacity. The limit is set to the capacity, and the mark is discarded.

+ * + * @param ptr a pointer to a memory block previously allocated with {@link #memAlloc}, {@link #memCalloc} or {@link #memRealloc}. Alternatively, this can + * be a {@link #NULL} pointer, in which case a new block is allocated (as if {@link #memAlloc} was called). + * @param size the new size for the memory block, in bytes. + * + * @return a pointer to the reallocated memory block, which may be either the same as {@code ptr} or a new location + * + * @throws OutOfMemoryError if the function failed to allocate the requested block of memory. The memory block pointed to by argument {@code ptr} is not + * deallocated (it is still valid, and with its contents unchanged). + */ + public static ByteBuffer memRealloc(@Nullable ByteBuffer ptr, int size) { + return realloc(ptr, memByteBuffer(nmemReallocChecked(ptr == null ? NULL : UNSAFE.getLong(ptr, ADDRESS), size), size), size); + } + + /** + * ShortBuffer version of {@link #memRealloc}. + * + * @param size the number of short values to allocate. + */ + public static ShortBuffer memRealloc(@Nullable ShortBuffer ptr, int size) { + return realloc(ptr, memShortBuffer(nmemReallocChecked(ptr == null ? NULL : UNSAFE.getLong(ptr, ADDRESS), getAllocationSize(size, 1)), size), size); + } + + /** + * IntBuffer version of {@link #memRealloc}. + * + * @param size the number of int values to allocate. + */ + public static IntBuffer memRealloc(@Nullable IntBuffer ptr, int size) { + return realloc(ptr, memIntBuffer(nmemReallocChecked(ptr == null ? NULL : UNSAFE.getLong(ptr, ADDRESS), getAllocationSize(size, 2)), size), size); + } + + /** + * LongBuffer version of {@link #memRealloc}. + * + * @param size the number of long values to allocate. + */ + public static LongBuffer memRealloc(@Nullable LongBuffer ptr, int size) { + return realloc(ptr, memLongBuffer(nmemReallocChecked(ptr == null ? NULL : UNSAFE.getLong(ptr, ADDRESS), getAllocationSize(size, 3)), size), size); + } + + /** + * {@code CLongBuffer} version of {@link #memRealloc}. + * + * @param size the number of C long values to allocate. + */ + public static CLongBuffer memRealloc(@Nullable CLongBuffer ptr, int size) { + CLongBuffer buffer = memCLongBuffer(nmemReallocChecked(ptr == null ? NULL : ptr.address, getAllocationSize(size, CLONG_SIZE)), size); + if (ptr != null) { + buffer.position(min(ptr.position(), size)); + } + return buffer; + } + + /** + * FloatBuffer version of {@link #memRealloc}. + * + * @param size the number of float values to allocate. + */ + public static FloatBuffer memRealloc(@Nullable FloatBuffer ptr, int size) { + return realloc(ptr, memFloatBuffer(nmemReallocChecked(ptr == null ? NULL : UNSAFE.getLong(ptr, ADDRESS), getAllocationSize(size, 2)), size), size); + } + + /** + * DoubleBuffer version of {@link #memRealloc}. + * + * @param size the number of double values to allocate. + */ + public static DoubleBuffer memRealloc(@Nullable DoubleBuffer ptr, int size) { + return realloc(ptr, memDoubleBuffer(nmemReallocChecked(ptr == null ? NULL : UNSAFE.getLong(ptr, ADDRESS), getAllocationSize(size, 3)), size), size); + } + + /** + * PointerBuffer version of {@link #memRealloc}. + * + * @param size the number of pointer values to allocate. + */ + public static PointerBuffer memRealloc(@Nullable PointerBuffer ptr, int size) { + PointerBuffer buffer = memPointerBuffer(nmemReallocChecked(ptr == null ? NULL : ptr.address, getAllocationSize(size, POINTER_SHIFT)), size); + if (ptr != null) { + buffer.position(min(ptr.position(), size)); + } + return buffer; + } + + // --- [ memAlignedAlloc ] --- + + /** Unsafe version of {@link #memAlignedAlloc}. May return {@link #NULL} if {@code size} is zero or the allocation failed. */ + public static long nmemAlignedAlloc(long alignment, long size) { + return ALLOCATOR.aligned_alloc(alignment, size); + } + + /** + * Unsafe version of {@link #memAlignedAlloc} that checks the returned pointer. + * + * @return a pointer to the memory block allocated by the function on success. This pointer will never be {@link #NULL}, even if {@code size} is zero. + * + * @throws OutOfMemoryError if the function failed to allocate the requested block of memory + */ + public static long nmemAlignedAllocChecked(long alignment, long size) { + long address = nmemAlignedAlloc(alignment, size != 0 ? size : 1L); + if (CHECKS && address == NULL) { + throw new OutOfMemoryError(); + } + return address; + } + + /** + * The standard C aligned_alloc function. + * + *

Allocate {@code size} bytes of uninitialized storage whose alignment is specified by {@code alignment}. The size parameter must be an integral + * multiple of alignment. Memory allocated with memAlignedAlloc() must be freed with {@link #memAlignedFree}.

+ * + * @param alignment the alignment. Must be a power of two value and a multiple of {@code sizeof(void *)}. + * @param size the number of bytes to allocate. Must be a multiple of {@code alignment}. + */ + public static ByteBuffer memAlignedAlloc(int alignment, int size) { + return wrap(BUFFER_BYTE, nmemAlignedAllocChecked(alignment, size), size).order(NATIVE_ORDER); + } + + // --- [ memAlignedFree ] --- + + /** Unsafe version of {@link #memAlignedFree}. */ + public static void nmemAlignedFree(long ptr) { + ALLOCATOR.aligned_free(ptr); + } + + /** + * Frees a block of memory that was allocated with {@link #memAlignedAlloc}. If ptr is {@code NULL}, no operation is performed. + * + * @param ptr the aligned block of memory to free + */ + public static void memAlignedFree(@Nullable ByteBuffer ptr) { + if (ptr != null) { + nmemAlignedFree(UNSAFE.getLong(ptr, ADDRESS)); + } + } + + // --- [ DebugAllocator ] --- + + /** The memory allocation report callback. */ + public interface MemoryAllocationReport { + + /** + * Reports allocated memory. + * + * @param address the address of the memory allocated. May be {@link #NULL}. + * @param memory the amount of memory allocated, in bytes + * @param threadId id of the thread that allocated the memory. May be {@link #NULL}. + * @param threadName name of the thread that allocated the memory. May be {@code null}. + * @param stacktrace the allocation stacktrace. May be {@code null}. + */ + void invoke(long address, long memory, long threadId, @Nullable String threadName, @Nullable StackTraceElement... stacktrace); + + /** Specifies how to aggregate the reported allocations. */ + enum Aggregate { + /** Allocations are aggregated over the whole process or thread. */ + ALL, + /** + * Allocations are aggregated based on the first stack trace element. This will return an allocation aggregate per method/line number, regardless + * of how many different code paths lead to that specific method and line number. + */ + GROUP_BY_METHOD, + /** The allocations are aggregated based on the full stack trace chain. */ + GROUP_BY_STACKTRACE + } + } + + /** + * Reports all live allocations. + * + *

This method can only be used if the {@link Configuration#DEBUG_MEMORY_ALLOCATOR} option has been set to true.

+ * + * @param report the report callback + */ + public static void memReport(MemoryAllocationReport report) { + DebugAllocator.report(report); + } + + /** + * Reports aggregates for the live allocations. + * + *

This method can only be used if the {@link Configuration#DEBUG_MEMORY_ALLOCATOR} option has been set to true.

+ * + * @param report the report callback + * @param groupByStackTrace how to aggregate the reported allocations + * @param groupByThread if the reported allocations should be grouped by thread + */ + public static void memReport(MemoryAllocationReport report, Aggregate groupByStackTrace, boolean groupByThread) { + DebugAllocator.report(report, groupByStackTrace, groupByThread); + } + + /* ------------------------------------- + ------------------------------------- + BUFFER MANAGEMENT API + ------------------------------------- + ------------------------------------- */ + + // --- [ memAddress0 ] --- + + /** + * Returns the memory address of the specified buffer. [INTERNAL USE ONLY] + * + * @param buffer the buffer + * + * @return the memory address + */ + public static long memAddress0(Buffer buffer) { return UNSAFE.getLong(buffer, ADDRESS); } + + // --- [ Buffer address ] --- + + /** + * Returns the memory address at the current position of the specified buffer. This is effectively a pointer value that can be used in native function + * calls. + * + * @param buffer the buffer + * + * @return the memory address + */ + public static long memAddress(ByteBuffer buffer) { return buffer.position() + memAddress0(buffer); } + + /** + * Returns the memory address at the specified position of the specified buffer. + * + * @param buffer the buffer + * @param position the buffer position + * + * @return the memory address + * + * @see #memAddress(ByteBuffer) + */ + public static long memAddress(ByteBuffer buffer, int position) { + Objects.requireNonNull(buffer); + return memAddress0(buffer) + Integer.toUnsignedLong(position); + } + + private static long address(int position, int elementShift, long address) { + return address + ((position & 0xFFFF_FFFFL) << elementShift); + } + + /** ShortBuffer version of {@link #memAddress(ByteBuffer)}. */ + public static long memAddress(ShortBuffer buffer) { return address(buffer.position(), 1, memAddress0(buffer)); } + /** ShortBuffer version of {@link #memAddress(ByteBuffer, int)}. */ + public static long memAddress(ShortBuffer buffer, int position) { + Objects.requireNonNull(buffer); + return address(position, 1, memAddress0(buffer)); + } + + /** CharBuffer version of {@link #memAddress(ByteBuffer)}. */ + public static long memAddress(CharBuffer buffer) { return address(buffer.position(), 1, memAddress0(buffer)); } + /** CharBuffer version of {@link #memAddress(ByteBuffer, int)}. */ + public static long memAddress(CharBuffer buffer, int position) { + Objects.requireNonNull(buffer); + return address(position, 1, memAddress0(buffer)); + } + + /** IntBuffer version of {@link #memAddress(ByteBuffer)}. */ + public static long memAddress(IntBuffer buffer) { return address(buffer.position(), 2, memAddress0(buffer)); } + /** IntBuffer version of {@link #memAddress(ByteBuffer, int)}. */ + public static long memAddress(IntBuffer buffer, int position) { + Objects.requireNonNull(buffer); + return address(position, 2, memAddress0(buffer)); + } + + /** FloatBuffer version of {@link #memAddress(ByteBuffer)}. */ + public static long memAddress(FloatBuffer buffer) { return address(buffer.position(), 2, memAddress0(buffer)); } + /** FloatBuffer version of {@link #memAddress(ByteBuffer, int)}. */ + public static long memAddress(FloatBuffer buffer, int position) { + Objects.requireNonNull(buffer); + return address(position, 2, memAddress0(buffer)); + } + + /** LongBuffer version of {@link #memAddress(ByteBuffer)}. */ + public static long memAddress(LongBuffer buffer) { return address(buffer.position(), 3, memAddress0(buffer)); } + /** LongBuffer version of {@link #memAddress(ByteBuffer, int)}. */ + public static long memAddress(LongBuffer buffer, int position) { + Objects.requireNonNull(buffer); + return address(position, 3, memAddress0(buffer)); + } + + /** DoubleBuffer version of {@link #memAddress(ByteBuffer)}. */ + public static long memAddress(DoubleBuffer buffer) { return address(buffer.position(), 3, memAddress0(buffer)); } + /** DoubleBuffer version of {@link #memAddress(ByteBuffer, int)}. */ + public static long memAddress(DoubleBuffer buffer, int position) { + Objects.requireNonNull(buffer); + return address(position, 3, memAddress0(buffer)); + } + + /** Polymorphic version of {@link #memAddress(ByteBuffer)}. */ + public static long memAddress(Buffer buffer) { + int elementShift; + if (buffer instanceof ByteBuffer) { + elementShift = 0; + } else if (buffer instanceof ShortBuffer || buffer instanceof CharBuffer) { + elementShift = 1; + } else if (buffer instanceof IntBuffer || buffer instanceof FloatBuffer) { + elementShift = 2; + } else { + elementShift = 3; + } + return address(buffer.position(), elementShift, memAddress0(buffer)); + } + + /** CustomBuffer version of {@link #memAddress(ByteBuffer)}. */ + public static long memAddress(CustomBuffer buffer) { return buffer.address(); } + /** CustomBuffer version of {@link #memAddress(ByteBuffer, int)}. */ + public static long memAddress(CustomBuffer buffer, int position) { return buffer.address(position); } + + // --- [ Buffer address - Safe ] --- + + /** Null-safe version of {@link #memAddress(ByteBuffer)}. Returns {@link #NULL} if the specified buffer is null. */ + public static long memAddressSafe(@Nullable ByteBuffer buffer) { return buffer == null ? NULL : memAddress0(buffer) + buffer.position(); } + + /** ShortBuffer version of {@link #memAddressSafe(ByteBuffer)}. */ + public static long memAddressSafe(@Nullable ShortBuffer buffer) { return buffer == null ? NULL : address(buffer.position(), 1, memAddress0(buffer)); } + + /** CharBuffer version of {@link #memAddressSafe(ByteBuffer)}. */ + public static long memAddressSafe(@Nullable CharBuffer buffer) { return buffer == null ? NULL : address(buffer.position(), 1, memAddress0(buffer)); } + + /** IntBuffer version of {@link #memAddressSafe(ByteBuffer)}. */ + public static long memAddressSafe(@Nullable IntBuffer buffer) { return buffer == null ? NULL : address(buffer.position(), 2, memAddress0(buffer)); } + + /** FloatBuffer version of {@link #memAddressSafe(ByteBuffer)}. */ + public static long memAddressSafe(@Nullable FloatBuffer buffer) { return buffer == null ? NULL : address(buffer.position(), 2, memAddress0(buffer)); } + + /** LongBuffer version of {@link #memAddressSafe(ByteBuffer)}. */ + public static long memAddressSafe(@Nullable LongBuffer buffer) { return buffer == null ? NULL : address(buffer.position(), 3, memAddress0(buffer)); } + + /** DoubleBuffer version of {@link #memAddressSafe(ByteBuffer)}. */ + public static long memAddressSafe(@Nullable DoubleBuffer buffer) { return buffer == null ? NULL : address(buffer.position(), 3, memAddress0(buffer)); } + + /** Pointer version of {@link #memAddressSafe(ByteBuffer)}. */ + public static long memAddressSafe(@Nullable Pointer pointer) { return pointer == null ? NULL : pointer.address(); } + + // --- [ Buffer allocation ] --- + + /** + * Creates a new direct ByteBuffer that starts at the specified memory address and has the specified capacity. The returned ByteBuffer instance will be set + * to the native {@link ByteOrder}. + * + * @param address the starting memory address + * @param capacity the buffer capacity + * + * @return the new ByteBuffer + */ + public static ByteBuffer memByteBuffer(long address, int capacity) { + if (CHECKS) { + check(address); + } + return wrap(BUFFER_BYTE, address, capacity).order(NATIVE_ORDER); + } + + /** Like {@link #memByteBuffer}, but returns {@code null} if {@code address} is {@link #NULL}. */ + @Nullable + public static ByteBuffer memByteBufferSafe(long address, int capacity) { + return address == NULL ? null : wrap(BUFFER_BYTE, address, capacity).order(NATIVE_ORDER); + } + + /** + * Creates a {@link ByteBuffer} instance as a view of the specified {@link ShortBuffer} between its current position and limit. + * + *

This operation is the inverse of {@link ByteBuffer#asShortBuffer()}. The returned {@code ByteBuffer} instance will be set to the native + * {@link ByteOrder}.

+ * + * @param buffer the source buffer + * + * @return the {@code ByteBuffer} view + */ + public static ByteBuffer memByteBuffer(ShortBuffer buffer) { + if (CHECKS && (Integer.MAX_VALUE >> 1) < buffer.remaining()) { + throw new IllegalArgumentException("The source buffer range is too wide"); + } + return wrap(BUFFER_BYTE, memAddress(buffer), buffer.remaining() << 1).order(NATIVE_ORDER); + } + + /** + * Creates a {@link ByteBuffer} instance as a view of the specified {@link CharBuffer} between its current position and limit. + * + *

This operation is the inverse of {@link ByteBuffer#asCharBuffer()}. The returned {@code ByteBuffer} instance will be set to the native + * {@link ByteOrder}.

+ * + * @param buffer the source buffer + * + * @return the {@code ByteBuffer} view + */ + public static ByteBuffer memByteBuffer(CharBuffer buffer) { + if (CHECKS && (Integer.MAX_VALUE >> 1) < buffer.remaining()) { + throw new IllegalArgumentException("The source buffer range is too wide"); + } + return wrap(BUFFER_BYTE, memAddress(buffer), buffer.remaining() << 1).order(NATIVE_ORDER); + } + + /** + * Creates a {@link ByteBuffer} instance as a view of the specified {@link IntBuffer} between its current position and limit. + * + *

This operation is the inverse of {@link ByteBuffer#asIntBuffer()}. The returned {@code ByteBuffer} instance will be set to the native + * {@link ByteOrder}.

+ * + * @param buffer the source buffer + * + * @return the {@code ByteBuffer} view + */ + public static ByteBuffer memByteBuffer(IntBuffer buffer) { + if (CHECKS && (Integer.MAX_VALUE >> 2) < buffer.remaining()) { + throw new IllegalArgumentException("The source buffer range is too wide"); + } + return wrap(BUFFER_BYTE, memAddress(buffer), buffer.remaining() << 2).order(NATIVE_ORDER); + } + + /** + * Creates a {@link ByteBuffer} instance as a view of the specified {@link LongBuffer} between its current position and limit. + * + *

This operation is the inverse of {@link ByteBuffer#asLongBuffer()}. The returned {@code ByteBuffer} instance will be set to the native + * {@link ByteOrder}.

+ * + * @param buffer the source buffer + * + * @return the {@code ByteBuffer} view + */ + public static ByteBuffer memByteBuffer(LongBuffer buffer) { + if (CHECKS && (Integer.MAX_VALUE >> 3) < buffer.remaining()) { + throw new IllegalArgumentException("The source buffer range is too wide"); + } + return wrap(BUFFER_BYTE, memAddress(buffer), buffer.remaining() << 3).order(NATIVE_ORDER); + } + + /** + * Creates a {@link ByteBuffer} instance as a view of the specified {@link FloatBuffer} between its current position and limit. + * + *

This operation is the inverse of {@link ByteBuffer#asFloatBuffer()}. The returned {@code ByteBuffer} instance will be set to the native + * {@link ByteOrder}.

+ * + * @param buffer the source buffer + * + * @return the {@code ByteBuffer} view + */ + public static ByteBuffer memByteBuffer(FloatBuffer buffer) { + if (CHECKS && (Integer.MAX_VALUE >> 2) < buffer.remaining()) { + throw new IllegalArgumentException("The source buffer range is too wide"); + } + return wrap(BUFFER_BYTE, memAddress(buffer), buffer.remaining() << 2).order(NATIVE_ORDER); + } + + /** + * Creates a {@link ByteBuffer} instance as a view of the specified {@link DoubleBuffer} between its current position and limit. + * + *

This operation is the inverse of {@link ByteBuffer#asDoubleBuffer()}. The returned {@code ByteBuffer} instance will be set to the native + * {@link ByteOrder}.

+ * + * @param buffer the source buffer + * + * @return the {@code ByteBuffer} view + */ + public static ByteBuffer memByteBuffer(DoubleBuffer buffer) { + if (CHECKS && (Integer.MAX_VALUE >> 3) < buffer.remaining()) { + throw new IllegalArgumentException("The source buffer range is too wide"); + } + return wrap(BUFFER_BYTE, memAddress(buffer), buffer.remaining() << 3).order(NATIVE_ORDER); + } + + /** + * Creates a {@link ByteBuffer} instance as a view of the specified {@link CustomBuffer} between its current position and limit. + * + *

The returned {@code ByteBuffer} instance will be set to the native {@link ByteOrder}.

+ * + * @param buffer the source buffer + * + * @return the {@code ByteBuffer} view + */ + public static ByteBuffer memByteBuffer(CustomBuffer buffer) { + if (CHECKS && (Integer.MAX_VALUE / buffer.sizeof()) < buffer.remaining()) { + throw new IllegalArgumentException("The source buffer range is too wide"); + } + return wrap(BUFFER_BYTE, memAddress(buffer), buffer.remaining() * buffer.sizeof()).order(NATIVE_ORDER); + } + + /** + * Creates a new direct ShortBuffer that starts at the specified memory address and has the specified capacity. + * + *

The {@code address} specified must be aligned to 2 bytes. If not, use {@code memByteBuffer(address, capacity * 2).asShortBuffer()}.

+ * + * @param address the starting memory address + * @param capacity the buffer capacity + * + * @return the new ShortBuffer + */ + public static ShortBuffer memShortBuffer(long address, int capacity) { + if (CHECKS) { + check(address); + } + return wrap(BUFFER_SHORT, address, capacity); + } + + /** Like {@link #memShortBuffer}, but returns {@code null} if {@code address} is {@link #NULL}. */ + @Nullable + public static ShortBuffer memShortBufferSafe(long address, int capacity) { + return address == NULL ? null : wrap(BUFFER_SHORT, address, capacity); + } + + /** + * Creates a new direct CharBuffer that starts at the specified memory address and has the specified capacity. + * + *

The {@code address} specified must be aligned to 2 bytes. If not, use {@code memByteBuffer(address, capacity * 2).asCharBuffer()}.

+ * + * @param address the starting memory address + * @param capacity the buffer capacity + * + * @return the new CharBuffer + */ + public static CharBuffer memCharBuffer(long address, int capacity) { + if (CHECKS) { + check(address); + } + return wrap(BUFFER_CHAR, address, capacity); + } + + /** Like {@link #memCharBuffer}, but returns {@code null} if {@code address} is {@link #NULL}. */ + @Nullable + public static CharBuffer memCharBufferSafe(long address, int capacity) { + return address == NULL ? null : wrap(BUFFER_CHAR, address, capacity); + } + + /** + * Creates a new direct IntBuffer that starts at the specified memory address and has the specified capacity. + * + *

The {@code address} specified must be aligned to 4 bytes. If not, use {@code memByteBuffer(address, capacity * 4).asIntBuffer()}.

+ * + * @param address the starting memory address + * @param capacity the buffer capacity + * + * @return the new IntBuffer + */ + public static IntBuffer memIntBuffer(long address, int capacity) { + if (CHECKS) { + check(address); + } + return wrap(BUFFER_INT, address, capacity); + } + + /** Like {@link #memIntBuffer}, but returns {@code null} if {@code address} is {@link #NULL}. */ + @Nullable + public static IntBuffer memIntBufferSafe(long address, int capacity) { + return address == NULL ? null : wrap(BUFFER_INT, address, capacity); + } + + /** + * Creates a new direct LongBuffer that starts at the specified memory address and has the specified capacity. + * + *

The {@code address} specified must be aligned to 8 bytes. If not, use {@code memByteBuffer(address, capacity * 8).asLongBuffer()}.

+ * + * @param address the starting memory address + * @param capacity the buffer capacity + * + * @return the new LongBuffer + */ + public static LongBuffer memLongBuffer(long address, int capacity) { + if (CHECKS) { + check(address); + } + return wrap(BUFFER_LONG, address, capacity); + } + + /** Like {@link #memLongBuffer}, but returns {@code null} if {@code address} is {@link #NULL}. */ + @Nullable + public static LongBuffer memLongBufferSafe(long address, int capacity) { + return address == NULL ? null : wrap(BUFFER_LONG, address, capacity); + } + + /** + * Creates a new direct {@code CLongBuffer} that starts at the specified memory address and has the specified capacity. + * + *

The {@code address} specified must be aligned to 8 bytes. If not, use {@code memByteBuffer(address, capacity * 8).asLongBuffer()}.

+ * + * @param address the starting memory address + * @param capacity the buffer capacity + * + * @return the new {@code CLongBuffer} + */ + public static CLongBuffer memCLongBuffer(long address, int capacity) { + if (CHECKS) { + check(address); + } + return Default.wrap(CLongBuffer.class, address, capacity); + } + + /** Like {@link #memCLongBuffer}, but returns {@code null} if {@code address} is {@link #NULL}. */ + @Nullable + public static CLongBuffer memCLongBufferSafe(long address, int capacity) { + return address == NULL ? null : Default.wrap(CLongBuffer.class, address, capacity); + } + + /** + * Creates a new direct FloatBuffer that starts at the specified memory address and has the specified capacity. + * + *

The {@code address} specified must be aligned to 4 bytes. If not, use {@code memByteBuffer(address, capacity * 4).asFloatBuffer()}.

+ * + * @param address the starting memory address + * @param capacity the buffer capacity + * + * @return the new FloatBuffer + */ + public static FloatBuffer memFloatBuffer(long address, int capacity) { + if (CHECKS) { + check(address); + } + return wrap(BUFFER_FLOAT, address, capacity); + } + + /** Like {@link #memFloatBuffer}, but returns {@code null} if {@code address} is {@link #NULL}. */ + @Nullable + public static FloatBuffer memFloatBufferSafe(long address, int capacity) { + return address == NULL ? null : wrap(BUFFER_FLOAT, address, capacity); + } + + /** + * Creates a new direct DoubleBuffer that starts at the specified memory address and has the specified capacity. + * + *

The {@code address} specified must be aligned to 8 bytes. If not, use {@code memByteBuffer(address, capacity * 8).asDoubleBuffer()}.

+ * + * @param address the starting memory address + * @param capacity the buffer capacity + * + * @return the new DoubleBuffer + */ + public static DoubleBuffer memDoubleBuffer(long address, int capacity) { + if (CHECKS) { + check(address); + } + return wrap(BUFFER_DOUBLE, address, capacity); + } + + /** Like {@link #memDoubleBuffer}, but returns {@code null} if {@code address} is {@link #NULL}. */ + @Nullable + public static DoubleBuffer memDoubleBufferSafe(long address, int capacity) { + return address == NULL ? null : wrap(BUFFER_DOUBLE, address, capacity); + } + + /** + * Creates a new PointerBuffer that starts at the specified memory address and has the specified capacity. + * + *

The {@code address} specified must be aligned to the pointer size. If not, use {@code PointerBuffer.create(memByteBuffer(address, capacity * + * POINTER_SIZE))}.

+ * + * @param address the starting memory address + * @param capacity the buffer capacity + * + * @return the new PointerBuffer + */ + public static PointerBuffer memPointerBuffer(long address, int capacity) { + if (CHECKS) { + check(address); + } + return Default.wrap(PointerBuffer.class, address, capacity); + } + + /** Like {@link #memPointerBuffer}, but returns {@code null} if {@code address} is {@link #NULL}. */ + @Nullable + public static PointerBuffer memPointerBufferSafe(long address, int capacity) { + return address == NULL ? null : Default.wrap(PointerBuffer.class, address, capacity); + } + + // --- [ Buffer duplication ] --- + + /** + * Duplicates the specified buffer. The returned buffer will have the same {@link ByteOrder} as the source buffer. + * + *

This method should be preferred over {@link ByteBuffer#duplicate} because it has a much shorter call chain. Long call chains may fail to inline due + * to JVM limits, disabling important optimizations (e.g. scalar replacement via Escape Analysis).

+ * + * @param buffer the buffer to duplicate + * + * @return the duplicated buffer + */ + public static ByteBuffer memDuplicate(ByteBuffer buffer) { + ByteBuffer target; + try { + target = (ByteBuffer)UNSAFE.allocateInstance(BUFFER_BYTE); + } catch (InstantiationException e) { + throw new UnsupportedOperationException(e); + } + + UNSAFE.putLong(target, ADDRESS, UNSAFE.getLong(buffer, ADDRESS)); + UNSAFE.putInt(target, MARK, UNSAFE.getInt(buffer, MARK)); + UNSAFE.putInt(target, POSITION, UNSAFE.getInt(buffer, POSITION)); + UNSAFE.putInt(target, LIMIT, UNSAFE.getInt(buffer, LIMIT)); + UNSAFE.putInt(target, CAPACITY, UNSAFE.getInt(buffer, CAPACITY)); + + Object attachment = UNSAFE.getObject(buffer, PARENT_BYTE); + UNSAFE.putObject(target, PARENT_BYTE, attachment == null ? buffer : attachment); + + return target.order(buffer.order()); + } + + /** + * Duplicates the specified buffer. + * + *

This method should be preferred over {@link ShortBuffer#duplicate} because it has a much shorter call chain. Long call chains may fail to inline due + * to JVM limits, disabling important optimizations (e.g. scalar replacement via Escape Analysis).

+ * + * @param buffer the buffer to duplicate + * + * @return the duplicated buffer + */ + public static ShortBuffer memDuplicate(ShortBuffer buffer) { return duplicate(BUFFER_SHORT, buffer, PARENT_SHORT); } + + /** + * Duplicates the specified buffer. + * + *

This method should be preferred over {@link CharBuffer#duplicate} because it has a much shorter call chain. Long call chains may fail to inline due + * to JVM limits, disabling important optimizations (e.g. scalar replacement via Escape Analysis).

+ * + * @param buffer the buffer to duplicate + * + * @return the duplicated buffer + */ + public static CharBuffer memDuplicate(CharBuffer buffer) { return duplicate(BUFFER_CHAR, buffer, PARENT_CHAR); } + + /** + * Duplicates the specified buffer. + * + *

This method should be preferred over {@link IntBuffer#duplicate} because it has a much shorter call chain. Long call chains may fail to inline due + * to JVM limits, disabling important optimizations (e.g. scalar replacement via Escape Analysis).

+ * + * @param buffer the buffer to duplicate + * + * @return the duplicated buffer + */ + public static IntBuffer memDuplicate(IntBuffer buffer) { return duplicate(BUFFER_INT, buffer, PARENT_INT); } + + /** + * Duplicates the specified buffer. + * + *

This method should be preferred over {@link LongBuffer#duplicate} because it has a much shorter call chain. Long call chains may fail to inline due + * to JVM limits, disabling important optimizations (e.g. scalar replacement via Escape Analysis).

+ * + * @param buffer the buffer to duplicate + * + * @return the duplicated buffer + */ + public static LongBuffer memDuplicate(LongBuffer buffer) { return duplicate(BUFFER_LONG, buffer, PARENT_LONG); } + + /** + * Duplicates the specified buffer. + * + *

This method should be preferred over {@link FloatBuffer#duplicate} because it has a much shorter call chain. Long call chains may fail to inline due + * to JVM limits, disabling important optimizations (e.g. scalar replacement via Escape Analysis).

+ * + * @param buffer the buffer to duplicate + * + * @return the duplicated buffer + */ + public static FloatBuffer memDuplicate(FloatBuffer buffer) { return duplicate(BUFFER_FLOAT, buffer, PARENT_FLOAT); } + + /** + * Duplicates the specified buffer. + * + *

This method should be preferred over {@link DoubleBuffer#duplicate} because it has a much shorter call chain. Long call chains may fail to inline due + * to JVM limits, disabling important optimizations (e.g. scalar replacement via Escape Analysis).

+ * + * @param buffer the buffer to duplicate + * + * @return the duplicated buffer + */ + public static DoubleBuffer memDuplicate(DoubleBuffer buffer) { return duplicate(BUFFER_DOUBLE, buffer, PARENT_DOUBLE); } + + // --- [ Buffer slicing ] --- + + /** + * Slices the specified buffer. The returned buffer will have the same {@link ByteOrder} as the source buffer. + * + *

This method should be preferred over {@link ByteBuffer#slice} because it has a much shorter call chain. Long call chains may fail to inline due to + * JVM limits, disabling important optimizations (e.g. scalar replacement via Escape Analysis).

+ * + * @param buffer the buffer to slice + * + * @return the sliced buffer + */ + public static ByteBuffer memSlice(ByteBuffer buffer) { + return slice(buffer, memAddress0(buffer) + buffer.position(), buffer.remaining()); + } + + /** + * Slices the specified buffer. + * + *

This method should be preferred over {@link ShortBuffer#slice} because it has a much shorter call chain. Long call chains may fail to inline due to + * JVM limits, disabling important optimizations (e.g. scalar replacement via Escape Analysis).

+ * + * @param buffer the buffer to slice + * + * @return the sliced buffer + */ + public static ShortBuffer memSlice(ShortBuffer buffer) { + return slice(BUFFER_SHORT, buffer, address(buffer.position(), 1, memAddress0(buffer)), buffer.remaining(), PARENT_SHORT); + } + + /** + * Slices the specified buffer. + * + *

This method should be preferred over {@link CharBuffer#slice} because it has a much shorter call chain. Long call chains may fail to inline due to + * JVM limits, disabling important optimizations (e.g. scalar replacement via Escape Analysis).

+ * + * @param buffer the buffer to slice + * + * @return the sliced buffer + */ + public static CharBuffer memSlice(CharBuffer buffer) { + return slice(BUFFER_CHAR, buffer, address(buffer.position(), 1, memAddress0(buffer)), buffer.remaining(), PARENT_CHAR); + } + + /** + * Slices the specified buffer. + * + *

This method should be preferred over {@link IntBuffer#slice} because it has a much shorter call chain. Long call chains may fail to inline due to + * JVM limits, disabling important optimizations (e.g. scalar replacement via Escape Analysis).

+ * + * @param buffer the buffer to slice + * + * @return the sliced buffer + */ + public static IntBuffer memSlice(IntBuffer buffer) { + return slice(BUFFER_INT, buffer, address(buffer.position(), 2, memAddress0(buffer)), buffer.remaining(), PARENT_INT); + } + + /** + * Slices the specified buffer. + * + *

This method should be preferred over {@link LongBuffer#slice} because it has a much shorter call chain. Long call chains may fail to inline due to + * JVM limits, disabling important optimizations (e.g. scalar replacement via Escape Analysis).

+ * + * @param buffer the buffer to slice + * + * @return the sliced buffer + */ + public static LongBuffer memSlice(LongBuffer buffer) { + return slice(BUFFER_LONG, buffer, address(buffer.position(), 3, memAddress0(buffer)), buffer.remaining(), PARENT_LONG); + } + + /** + * Slices the specified buffer. + * + *

This method should be preferred over {@link FloatBuffer#slice} because it has a much shorter call chain. Long call chains may fail to inline due to + * JVM limits, disabling important optimizations (e.g. scalar replacement via Escape Analysis).

+ * + * @param buffer the buffer to slice + * + * @return the sliced buffer + */ + public static FloatBuffer memSlice(FloatBuffer buffer) { + return slice(BUFFER_FLOAT, buffer, address(buffer.position(), 2, memAddress0(buffer)), buffer.remaining(), PARENT_FLOAT); + } + + /** + * Slices the specified buffer. + * + *

This method should be preferred over {@link DoubleBuffer#slice} because it has a much shorter call chain. Long call chains may fail to inline due to + * JVM limits, disabling important optimizations (e.g. scalar replacement via Escape Analysis).

+ * + * @param buffer the buffer to slice + * + * @return the sliced buffer + */ + public static DoubleBuffer memSlice(DoubleBuffer buffer) { + return slice(BUFFER_DOUBLE, buffer, address(buffer.position(), 3, memAddress0(buffer)), buffer.remaining(), PARENT_DOUBLE); + } + /** + * Returns a slice of the specified buffer between {@code (buffer.position() + offset)} and {@code (buffer.position() + offset + capacity)}. The returned + * buffer will have the same {@link ByteOrder} as the original buffer. + * + *

The position and limit of the original buffer are preserved after a call to this method.

+ * + * @param buffer the buffer to slice + * @param offset the slice offset, it must be ≤ {@code buffer.remaining()} + * @param capacity the slice length, it must be ≤ {@code buffer.capacity() - (buffer.position() + offset)} + * + * @return the sliced buffer + */ + public static ByteBuffer memSlice(ByteBuffer buffer, int offset, int capacity) { + int position = buffer.position() + offset; + if (offset < 0 || buffer.limit() < position) { + throw new IllegalArgumentException(); + } + if (capacity < 0 || buffer.capacity() - position < capacity) { + throw new IllegalArgumentException(); + } + return slice(buffer, memAddress0(buffer) + position, capacity); + } + + /** + * Returns a slice of the specified buffer between {@code (buffer.position() + offset)} and {@code (buffer.position() + offset + capacity)}. + * + *

The position and limit of the original buffer are preserved after a call to this method.

+ * + * @param buffer the buffer to slice + * @param offset the slice offset, it must be ≤ {@code buffer.remaining()} + * @param capacity the slice length, it must be ≤ {@code buffer.capacity() - (buffer.position() + offset)} + * + * @return the sliced buffer + */ + public static ShortBuffer memSlice(ShortBuffer buffer, int offset, int capacity) { + int position = buffer.position() + offset; + if (offset < 0 || buffer.limit() < position) { + throw new IllegalArgumentException(); + } + if (capacity < 0 || buffer.capacity() - position < capacity) { + throw new IllegalArgumentException(); + } + return slice(BUFFER_SHORT, buffer, address(position, 1, memAddress0(buffer)), capacity, PARENT_SHORT); + } + + /** + * Returns a slice of the specified buffer between {@code (buffer.position() + offset)} and {@code (buffer.position() + offset + capacity)}. + * + *

The position and limit of the original buffer are preserved after a call to this method.

+ * + * @param buffer the buffer to slice + * @param offset the slice offset, it must be ≤ {@code buffer.remaining()} + * @param capacity the slice length, it must be ≤ {@code buffer.capacity() - (buffer.position() + offset)} + * + * @return the sliced buffer + */ + public static CharBuffer memSlice(CharBuffer buffer, int offset, int capacity) { + int position = buffer.position() + offset; + if (offset < 0 || buffer.limit() < position) { + throw new IllegalArgumentException(); + } + if (capacity < 0 || buffer.capacity() - position < capacity) { + throw new IllegalArgumentException(); + } + return slice(BUFFER_CHAR, buffer, address(position, 1, memAddress0(buffer)), capacity, PARENT_CHAR); + } + + /** + * Returns a slice of the specified buffer between {@code (buffer.position() + offset)} and {@code (buffer.position() + offset + capacity)}. + * + *

The position and limit of the original buffer are preserved after a call to this method.

+ * + * @param buffer the buffer to slice + * @param offset the slice offset, it must be ≤ {@code buffer.remaining()} + * @param capacity the slice length, it must be ≤ {@code buffer.capacity() - (buffer.position() + offset)} + * + * @return the sliced buffer + */ + public static IntBuffer memSlice(IntBuffer buffer, int offset, int capacity) { + int position = buffer.position() + offset; + if (offset < 0 || buffer.limit() < position) { + throw new IllegalArgumentException(); + } + if (capacity < 0 || buffer.capacity() - position < capacity) { + throw new IllegalArgumentException(); + } + return slice(BUFFER_INT, buffer, address(position, 2, memAddress0(buffer)), capacity, PARENT_INT); + } + + /** + * Returns a slice of the specified buffer between {@code (buffer.position() + offset)} and {@code (buffer.position() + offset + capacity)}. + * + *

The position and limit of the original buffer are preserved after a call to this method.

+ * + * @param buffer the buffer to slice + * @param offset the slice offset, it must be ≤ {@code buffer.remaining()} + * @param capacity the slice length, it must be ≤ {@code buffer.capacity() - (buffer.position() + offset)} + * + * @return the sliced buffer + */ + public static LongBuffer memSlice(LongBuffer buffer, int offset, int capacity) { + int position = buffer.position() + offset; + if (offset < 0 || buffer.limit() < position) { + throw new IllegalArgumentException(); + } + if (capacity < 0 || buffer.capacity() - position < capacity) { + throw new IllegalArgumentException(); + } + return slice(BUFFER_LONG, buffer, address(position, 3, memAddress0(buffer)), capacity, PARENT_LONG); + } + + /** + * Returns a slice of the specified buffer between {@code (buffer.position() + offset)} and {@code (buffer.position() + offset + capacity)}. + * + *

The position and limit of the original buffer are preserved after a call to this method.

+ * + * @param buffer the buffer to slice + * @param offset the slice offset, it must be ≤ {@code buffer.remaining()} + * @param capacity the slice length, it must be ≤ {@code buffer.capacity() - (buffer.position() + offset)} + * + * @return the sliced buffer + */ + public static FloatBuffer memSlice(FloatBuffer buffer, int offset, int capacity) { + int position = buffer.position() + offset; + if (offset < 0 || buffer.limit() < position) { + throw new IllegalArgumentException(); + } + if (capacity < 0 || buffer.capacity() - position < capacity) { + throw new IllegalArgumentException(); + } + return slice(BUFFER_FLOAT, buffer, address(position, 2, memAddress0(buffer)), capacity, PARENT_FLOAT); + } + + /** + * Returns a slice of the specified buffer between {@code (buffer.position() + offset)} and {@code (buffer.position() + offset + capacity)}. + * + *

The position and limit of the original buffer are preserved after a call to this method.

+ * + * @param buffer the buffer to slice + * @param offset the slice offset, it must be ≤ {@code buffer.remaining()} + * @param capacity the slice length, it must be ≤ {@code buffer.capacity() - (buffer.position() + offset)} + * + * @return the sliced buffer + */ + public static DoubleBuffer memSlice(DoubleBuffer buffer, int offset, int capacity) { + int position = buffer.position() + offset; + if (offset < 0 || buffer.limit() < position) { + throw new IllegalArgumentException(); + } + if (capacity < 0 || buffer.capacity() - position < capacity) { + throw new IllegalArgumentException(); + } + return slice(BUFFER_DOUBLE, buffer, address(position, 3, memAddress0(buffer)), capacity, PARENT_DOUBLE); + } + + /** + * Returns a slice of the specified buffer between {@code (buffer.position() + offset)} and {@code (buffer.position() + offset + capacity)}. + * + *

The position and limit of the original buffer are preserved after a call to this method.

+ * + * @param buffer the buffer to slice + * @param offset the slice offset, it must be ≤ {@code buffer.remaining()} + * @param capacity the slice length, it must be ≤ {@code buffer.capacity() - (buffer.position() + offset)} + * + * @return the sliced buffer + */ + public static > T memSlice(T buffer, int offset, int capacity) { return buffer.slice(offset, capacity); } + + // --- [ memset ] --- + + /** + * Sets all bytes in a specified block of memory to a fixed value (usually zero). + * + * @param ptr the starting memory address + * @param value the value to set (memSet will convert it to unsigned byte) + */ + public static void memSet(ByteBuffer ptr, int value) { memSet(memAddress(ptr), value, ptr.remaining()); } + + /** + * Sets all bytes in a specified block of memory to a fixed value (usually zero). + * + * @param ptr the starting memory address + * @param value the value to set (memSet will convert it to unsigned byte) + */ + public static void memSet(ShortBuffer ptr, int value) { memSet(memAddress(ptr), value, apiGetBytes(ptr.remaining(), 1)); } + + /** + * Sets all bytes in a specified block of memory to a fixed value (usually zero). + * + * @param ptr the starting memory address + * @param value the value to set (memSet will convert it to unsigned byte) + */ + public static void memSet(CharBuffer ptr, int value) { memSet(memAddress(ptr), value, apiGetBytes(ptr.remaining(), 1)); } + + /** + * Sets all bytes in a specified block of memory to a fixed value (usually zero). + * + * @param ptr the starting memory address + * @param value the value to set (memSet will convert it to unsigned byte) + */ + public static void memSet(IntBuffer ptr, int value) { memSet(memAddress(ptr), value, apiGetBytes(ptr.remaining(), 2)); } + + /** + * Sets all bytes in a specified block of memory to a fixed value (usually zero). + * + * @param ptr the starting memory address + * @param value the value to set (memSet will convert it to unsigned byte) + */ + public static void memSet(LongBuffer ptr, int value) { memSet(memAddress(ptr), value, apiGetBytes(ptr.remaining(), 3)); } + + /** + * Sets all bytes in a specified block of memory to a fixed value (usually zero). + * + * @param ptr the starting memory address + * @param value the value to set (memSet will convert it to unsigned byte) + */ + public static void memSet(FloatBuffer ptr, int value) { memSet(memAddress(ptr), value, apiGetBytes(ptr.remaining(), 2)); } + + /** + * Sets all bytes in a specified block of memory to a fixed value (usually zero). + * + * @param ptr the starting memory address + * @param value the value to set (memSet will convert it to unsigned byte) + */ + public static void memSet(DoubleBuffer ptr, int value) { memSet(memAddress(ptr), value, apiGetBytes(ptr.remaining(), 3)); } + + /** + * Sets all bytes in a specified block of memory to a fixed value (usually zero). + * + * @param ptr the starting memory address + * @param value the value to set (memSet will convert it to unsigned byte) + * @param the buffer type + */ + public static > void memSet(T ptr, int value) { memSet(memAddress(ptr), value, Integer.toUnsignedLong(ptr.remaining()) * ptr.sizeof()); } + + /** + * Sets all bytes in a specified block of memory to a fixed value (usually zero). + * + * @param ptr the starting memory address + * @param value the value to set (memSet will convert it to unsigned byte) + * @param the struct type + */ + public static void memSet(T ptr, int value) { memSet(ptr.address, value, ptr.sizeof()); } + + // --- [ memcpy ] --- + + /** + * Sets all bytes in a specified block of memory to a copy of another block. + * + * @param src the source memory address + * @param dst the destination memory address + */ + public static void memCopy(ByteBuffer src, ByteBuffer dst) { + if (CHECKS) { + check(dst, src.remaining()); + } + MultiReleaseMemCopy.copy(memAddress(src), memAddress(dst), src.remaining()); + } + + /** + * Sets all bytes in a specified block of memory to a copy of another block. + * + * @param src the source memory address + * @param dst the destination memory address + */ + public static void memCopy(ShortBuffer src, ShortBuffer dst) { + if (CHECKS) { + check(dst, src.remaining()); + } + MultiReleaseMemCopy.copy(memAddress(src), memAddress(dst), apiGetBytes(src.remaining(), 1)); + } + + /** + * Sets all bytes in a specified block of memory to a copy of another block. + * + * @param src the source memory address + * @param dst the destination memory address + */ + public static void memCopy(CharBuffer src, CharBuffer dst) { + if (CHECKS) { + check((Buffer)dst, src.remaining()); + } + MultiReleaseMemCopy.copy(memAddress(src), memAddress(dst), apiGetBytes(src.remaining(), 1)); + } + + /** + * Sets all bytes in a specified block of memory to a copy of another block. + * + * @param src the source memory address + * @param dst the destination memory address + */ + public static void memCopy(IntBuffer src, IntBuffer dst) { + if (CHECKS) { + check(dst, src.remaining()); + } + MultiReleaseMemCopy.copy(memAddress(src), memAddress(dst), apiGetBytes(src.remaining(), 2)); + } + + /** + * Sets all bytes in a specified block of memory to a copy of another block. + * + * @param src the source memory address + * @param dst the destination memory address + */ + public static void memCopy(LongBuffer src, LongBuffer dst) { + if (CHECKS) { + check(dst, src.remaining()); + } + MultiReleaseMemCopy.copy(memAddress(src), memAddress(dst), apiGetBytes(src.remaining(), 3)); + } + + /** + * Sets all bytes in a specified block of memory to a copy of another block. + * + * @param src the source memory address + * @param dst the destination memory address + */ + public static void memCopy(FloatBuffer src, FloatBuffer dst) { + if (CHECKS) { + check(dst, src.remaining()); + } + MultiReleaseMemCopy.copy(memAddress(src), memAddress(dst), apiGetBytes(src.remaining(), 2)); + } + + /** + * Sets all bytes in a specified block of memory to a copy of another block. + * + * @param src the source memory address + * @param dst the destination memory address + */ + public static void memCopy(DoubleBuffer src, DoubleBuffer dst) { + if (CHECKS) { + check(dst, src.remaining()); + } + MultiReleaseMemCopy.copy(memAddress(src), memAddress(dst), apiGetBytes(src.remaining(), 3)); + } + + /** + * Sets all bytes in a specified block of memory to a copy of another block. + * + * @param src the source memory address + * @param dst the destination memory address + * @param the buffer type + */ + public static > void memCopy(T src, T dst) { + if (CHECKS) { + check(dst, src.remaining()); + } + MultiReleaseMemCopy.copy(memAddress(src), memAddress(dst), Integer.toUnsignedLong(src.remaining()) * src.sizeof()); + } + + /** + * Sets all bytes of a struct to a copy of another struct. + * + * @param src the source struct + * @param dst the destination struct + * @param the struct type + */ + public static void memCopy(T src, T dst) { + MultiReleaseMemCopy.copy(src.address, dst.address, src.sizeof()); + } + + /* ------------------------------------- + ------------------------------------- + UNSAFE MEMORY ACCESS API + ------------------------------------- + ------------------------------------- */ + + private interface NativeShift { + long left(long value, int bytes); + long right(long value, int bytes); + } + + private static final NativeShift SHIFT = NATIVE_ORDER == ByteOrder.BIG_ENDIAN ? + new NativeShift() { + @Override public long left(long value, int bytes) { return value << (bytes << 3); } + @Override public long right(long value, int bytes) { return value >>> (bytes << 3); } + } : + new NativeShift() { + @Override public long left(long value, int bytes) { return value >>> (bytes << 3); } + @Override public long right(long value, int bytes) { return value << (bytes << 3); } + }; + + private static final long FILL_PATTERN = Long.divideUnsigned(-1L, 255L); + + /** + * Sets all bytes in a specified block of memory to a fixed value (usually zero). + * + * @param ptr the starting memory address + * @param value the value to set (memSet will convert it to unsigned byte) + * @param bytes the number of bytes to set + */ + public static void memSet(long ptr, int value, long bytes) { + if (DEBUG && (ptr == NULL || bytes < 0)) { + throw new IllegalArgumentException(); + } + + /* + - Unsafe.setMemory is very slow. + - A custom Java loop is fastest at small sizes, approximately up to 256 bytes. + - The native memset becomes fastest at bigger sizes, when the JNI overhead becomes negligible. + */ + + //UNSAFE.setMemory(dst, bytes, (byte)(value & 0xFF)); + if (256L <= bytes) { + nmemset(ptr, value, bytes); + return; + } + + long fill = (value & 0xFF) * FILL_PATTERN; + + int i = 0, + length = (int)bytes & 0xFF; + + if (length != 0) { + int misalignment = (int)ptr & 7; + if (misalignment != 0) { + long aligned = ptr - misalignment; + UNSAFE.putLong(null, aligned, merge( + UNSAFE.getLong(null, aligned), + fill, + SHIFT.right(SHIFT.left(-1L, max(0, 8 - length)), misalignment) // 0x0000FFFFFFFF0000 + )); + i += 8 - misalignment; + } + } + + // Aligned longs for performance + for (; i <= length - 8; i += 8) { + UNSAFE.putLong(null, ptr + i, fill); + } + + int tail = length - i; + if (0 < tail) { + // Aligned tail + UNSAFE.putLong(null, ptr + i, merge( + fill, + UNSAFE.getLong(null, ptr + i), + SHIFT.right(-1L, tail) // 0x00000000FFFFFFFF + )); + } + } + + // Bit from a where mask bit is 0, bit from b where mask bit is 1. + static long merge(long a, long b, long mask) { + return a ^ ((a ^ b) & mask); + } + + /** + * Sets all bytes in a specified block of memory to a copy of another block. + * + * @param src the source memory address + * @param dst the destination memory address + * @param bytes the number of bytes to copy + */ + public static void memCopy(long src, long dst, long bytes) { + if (DEBUG && (src == NULL || dst == NULL || bytes < 0)) { + throw new IllegalArgumentException(); + } + + MultiReleaseMemCopy.copy(src, dst, bytes); + } + + static void memCopyAligned(long src, long dst, int bytes) { + int i = 0; + + // Aligned longs for performance + for (; i <= bytes - 8; i += 8) { + UNSAFE.putLong(null, dst + i, UNSAFE.getLong(null, src + i)); + } + + // Aligned tail + if (i < bytes) { + UNSAFE.putLong(null, dst + i, merge( + UNSAFE.getLong(null, src + i), + UNSAFE.getLong(null, dst + i), + SHIFT.right(-1L, bytes - i) + )); + } + } + + public static boolean memGetBoolean(long ptr) { return UNSAFE.getByte(null, ptr) != 0; } + public static byte memGetByte(long ptr) { return UNSAFE.getByte(null, ptr); } + public static short memGetShort(long ptr) { return UNSAFE.getShort(null, ptr); } + public static int memGetInt(long ptr) { return UNSAFE.getInt(null, ptr); } + public static long memGetLong(long ptr) { return UNSAFE.getLong(null, ptr); } + public static float memGetFloat(long ptr) { return UNSAFE.getFloat(null, ptr); } + public static double memGetDouble(long ptr) { return UNSAFE.getDouble(null, ptr); } + public static long memGetCLong(long ptr) { + return CLONG_SIZE == 8 + ? UNSAFE.getLong(null, ptr) + : UNSAFE.getInt(null, ptr); + } + + public static long memGetAddress(long ptr) { + return BITS64 + ? UNSAFE.getLong(null, ptr) + : UNSAFE.getInt(null, ptr) & 0xFFFF_FFFFL; + } + + public static void memPutByte(long ptr, byte value) { UNSAFE.putByte(null, ptr, value); } + public static void memPutShort(long ptr, short value) { UNSAFE.putShort(null, ptr, value); } + public static void memPutInt(long ptr, int value) { UNSAFE.putInt(null, ptr, value); } + public static void memPutLong(long ptr, long value) { UNSAFE.putLong(null, ptr, value); } + public static void memPutFloat(long ptr, float value) { UNSAFE.putFloat(null, ptr, value); } + public static void memPutDouble(long ptr, double value) { UNSAFE.putDouble(null, ptr, value); } + public static void memPutCLong(long ptr, long value) { + if (CLONG_SIZE == 8) { + UNSAFE.putLong(null, ptr, value); + } else { + UNSAFE.putInt(null, ptr, (int)value); + } + } + + public static void memPutAddress(long ptr, long value) { + if (BITS64) { + UNSAFE.putLong(null, ptr, value); + } else { + UNSAFE.putInt(null, ptr, (int)value); + } + } + + /* ------------------------------------- + ------------------------------------- + JNI UTILITIES API + ------------------------------------- + ------------------------------------- */ + + /** + * Returns the object that the specified global reference points to. + * + * @param globalRef the global reference + * @param the object type + * + * @return the object pointed to by {@code globalRef} + */ + public static native T memGlobalRefToObject(long globalRef); + + /** Deprecated, use {@link JNINativeInterface#NewGlobalRef} instead. */ + @Deprecated public static long memNewGlobalRef(Object obj) { return NewGlobalRef(obj); } + + /** Deprecated, use {@link JNINativeInterface#DeleteGlobalRef} instead. */ + @Deprecated public static void memDeleteGlobalRef(long globalRef) { DeleteGlobalRef(globalRef); } + + /** Deprecated, use {@link JNINativeInterface#NewWeakGlobalRef} instead. */ + @Deprecated public static long memNewWeakGlobalRef(Object obj) { return NewWeakGlobalRef(obj); } + + /** Deprecated, use {@link JNINativeInterface#DeleteWeakGlobalRef} instead. */ + @Deprecated public static void memDeleteWeakGlobalRef(long globalRef) { DeleteWeakGlobalRef(globalRef);} + + /* ------------------------------------- + ------------------------------------- + TEXT ENCODING API + ------------------------------------- + ------------------------------------- */ + + /** + * Returns a ByteBuffer containing the specified text ASCII encoded and null-terminated. + * + * @param text the text to encode + * + * @return the encoded text. The returned buffer must be deallocated manually with {@link #memFree}. + */ + public static ByteBuffer memASCII(CharSequence text) { + return memASCII(text, true); + } + + /** Like {@link #memASCII(CharSequence) memASCII}, but returns {@code null} if {@code text} is {@code null}. */ + @Nullable + public static ByteBuffer memASCIISafe(@Nullable CharSequence text) { + return text == null ? null : memASCII(text, true); + } + + /** + * Returns a ByteBuffer containing the specified text ASCII encoded and optionally null-terminated. + * + * @param text the text to encode + * @param nullTerminated if true, the text will be terminated with a '\0'. + * + * @return the encoded text. The returned buffer must be deallocated manually with {@link #memFree}. + */ + public static ByteBuffer memASCII(CharSequence text, boolean nullTerminated) { + int length = memLengthASCII(text, nullTerminated); + long target = nmemAlloc(length); + encodeASCII(text, nullTerminated, target); + return wrap(BUFFER_BYTE, target, length).order(NATIVE_ORDER); + } + + /** Like {@link #memASCII(CharSequence, boolean) memASCII}, but returns {@code null} if {@code text} is {@code null}. */ + @Nullable + public static ByteBuffer memASCIISafe(@Nullable CharSequence text, boolean nullTerminated) { + return text == null ? null : memASCII(text, nullTerminated); + } + + /** + * Encodes and optionally null-terminates the specified text using ASCII encoding. The encoded text is stored in the specified {@link ByteBuffer}, at the + * current buffer position. The current buffer position is not modified by this operation. The {@code target} buffer is assumed to have enough remaining + * space to store the encoded text. + * + * @param text the text to encode + * @param nullTerminated if true, the text will be terminated with a '\0'. + * + * @return the number of bytes of the encoded string + */ + public static int memASCII(CharSequence text, boolean nullTerminated, ByteBuffer target) { + return encodeASCII(text, nullTerminated, memAddress(target)); + } + + /** + * Encodes and optionally null-terminates the specified text using ASCII encoding. The encoded text is stored in the specified {@link ByteBuffer} at the + * specified {@code position} offset. The current buffer position is not modified by this operation. The {@code target} buffer is assumed to have enough + * remaining space to store the encoded text. + * + * @param text the text to encode + * @param nullTerminated if true, the text will be terminated with a '\0'. + * @param offset the buffer position to which the string will be encoded + * + * @return the number of bytes of the encoded string + */ + public static int memASCII(CharSequence text, boolean nullTerminated, ByteBuffer target, int offset) { + return encodeASCII(text, nullTerminated, memAddress(target, offset)); + } + + static int encodeASCII(CharSequence text, boolean nullTerminated, long target) { + int len = text.length(); + for (int p = 0; p < len; p++) { + UNSAFE.putByte(target + p, (byte)text.charAt(p)); + } + if (nullTerminated) { + UNSAFE.putByte(target + len++, (byte)0); + } + return len; + } + + /** + * Returns the number of bytes required to encode the specified text in the ASCII encoding. + * + * @param value the text to encode + * @param nullTerminated if true, add the number of bytes required for null-termination + * + * @return the number of bytes + */ + public static int memLengthASCII(CharSequence value, boolean nullTerminated) { + return value.length() + (nullTerminated ? 1 : 0); + } + + /** + * Returns a ByteBuffer containing the specified text UTF-8 encoded and null-terminated. + * + * @param text the text to encode + * + * @return the encoded text. The returned buffer must be deallocated manually with {@link #memFree}. + */ + public static ByteBuffer memUTF8(CharSequence text) { + return memUTF8(text, true); + } + + /** Like {@link #memUTF8(CharSequence) memASCII}, but returns {@code null} if {@code text} is {@code null}. */ + @Nullable + public static ByteBuffer memUTF8Safe(@Nullable CharSequence text) { + return text == null ? null : memUTF8(text, true); + } + + /** + * Returns a ByteBuffer containing the specified text UTF-8 encoded and optionally null-terminated. + * + * @param text the text to encode + * @param nullTerminated if true, the text will be terminated with a '\0'. + * + * @return the encoded text. The returned buffer must be deallocated manually with {@link #memFree}. + */ + public static ByteBuffer memUTF8(CharSequence text, boolean nullTerminated) { + int length = memLengthUTF8(text, nullTerminated); + long target = nmemAlloc(length); + encodeUTF8(text, nullTerminated, target); + return wrap(BUFFER_BYTE, target, length).order(NATIVE_ORDER); + } + + /** Like {@link #memUTF8(CharSequence, boolean) memASCII}, but returns {@code null} if {@code text} is {@code null}. */ + @Nullable + public static ByteBuffer memUTF8Safe(@Nullable CharSequence text, boolean nullTerminated) { + return text == null ? null : memUTF8(text, nullTerminated); + } + + /** + * Encodes and optionally null-terminates the specified text using UTF-8 encoding. The encoded text is stored in the specified {@link ByteBuffer}, at the + * current buffer position. The current buffer position is not modified by this operation. The {@code target} buffer is assumed to have enough remaining + * space to store the encoded text. The specified text is assumed to be a valid UTF-16 string. + * + * @param text the text to encode + * @param nullTerminated if true, the text will be terminated with a '\0'. + * @param target the buffer in which to store the encoded text + * + * @return the number of bytes of the encoded string + */ + public static int memUTF8(CharSequence text, boolean nullTerminated, ByteBuffer target) { + return encodeUTF8(text, nullTerminated, memAddress(target)); + } + + /** + * Encodes and optionally null-terminates the specified text using UTF-8 encoding. The encoded text is stored in the specified {@link ByteBuffer}, at the + * specified {@code position} offset. The current buffer position is not modified by this operation. The {@code target} buffer is assumed to have enough + * remaining space to store the encoded text. The specified text is assumed to be a valid UTF-16 string. + * + * @param text the text to encode + * @param nullTerminated if true, the text will be terminated with a '\0'. + * @param target the buffer in which to store the encoded text + * @param offset the buffer position to which the string will be encoded + * + * @return the number of bytes of the encoded string + */ + public static int memUTF8(CharSequence text, boolean nullTerminated, ByteBuffer target, int offset) { + return encodeUTF8(text, nullTerminated, memAddress(target, offset)); + } + + static int encodeUTF8(CharSequence text, boolean nullTerminated, long target) { + int i = 0, len = text.length(), p = 0; + + char c; + + // ASCII fast path + while (i < len && (c = text.charAt(i)) < 0x80) { + UNSAFE.putByte(target + p++, (byte)c); + i++; + } + + // Slow path + while (i < len) { + c = text.charAt(i++); + if (c < 0x80) { + UNSAFE.putByte(target + p++, (byte)c); + } else { + int cp = c; + if (c < 0x800) { + UNSAFE.putByte(target + p++, (byte)(0xC0 | cp >> 6)); + } else { + if (!isHighSurrogate(c)) { + UNSAFE.putByte(target + p++, (byte)(0xE0 | cp >> 12)); + } else { + cp = toCodePoint(c, text.charAt(i++)); + + UNSAFE.putByte(target + p++, (byte)(0xF0 | cp >> 18)); + UNSAFE.putByte(target + p++, (byte)(0x80 | cp >> 12 & 0x3F)); + } + UNSAFE.putByte(target + p++, (byte)(0x80 | cp >> 6 & 0x3F)); + } + UNSAFE.putByte(target + p++, (byte)(0x80 | cp & 0x3F)); + } + } + + if (nullTerminated) { + UNSAFE.putByte(target + p++, (byte)0); // TODO: did we have a bug here? + } + + return p; + } + + /** + * Returns the number of bytes required to encode the specified text in the UTF-8 encoding. + * + * @param value the text to encode + * @param nullTerminated if true, add the number of bytes required for null-termination + * + * @return the number of bytes + */ + public static int memLengthUTF8(CharSequence value, boolean nullTerminated) { + int i, len = value.length(), bytes = len; // start with 1:1 + + // ASCII fast path + for (i = 0; i < len; i++) { + if (0x80 <= value.charAt(i)) { + break; + } + } + + // 1 or 2 bytes fast path + for (; i < len; i++) { + char c = value.charAt(i); + + // fallback to slow path + if (0x800 <= c) { + bytes += encodeUTF8LengthSlow(value, i, len); + break; + } + + // c <= 127: 0 + // c >= 128: 1 + bytes += (0x7F - c) >>> 31; + } + + return bytes + (nullTerminated ? 1 : 0); + } + + private static int encodeUTF8LengthSlow(CharSequence value, int offset, int len) { + int bytes = 0; + + for (int i = offset; i < len; i++) { + char c = value.charAt(i); + if (c < 0x800) { + bytes += (0x7F - c) >>> 31; + } else if (c < MIN_SURROGATE || MAX_SURROGATE < c) { + bytes += 2; + } else { + bytes += 2; // the byte count already includes 2 bytes for the surrogate pair, add 2 more + i++; + } + } + + return bytes; + } + + /** + * Returns a ByteBuffer containing the specified text UTF-16 encoded and null-terminated. + * + * @param text the text to encode + * + * @return the encoded text. The returned buffer must be deallocated manually with {@link #memFree}. + */ + public static ByteBuffer memUTF16(CharSequence text) { + return memUTF16(text, true); + } + + /** Like {@link #memUTF16(CharSequence) memASCII}, but returns {@code null} if {@code text} is {@code null}. */ + @Nullable + public static ByteBuffer memUTF16Safe(@Nullable CharSequence text) { + return text == null ? null : memUTF16(text, true); + } + + /** + * Returns a ByteBuffer containing the specified text UTF-16 encoded and optionally null-terminated. + * + * @param text the text to encode + * @param nullTerminated if true, the text will be terminated with a '\0'. + * + * @return the encoded text. The returned buffer must be deallocated manually with {@link #memFree}. + */ + public static ByteBuffer memUTF16(CharSequence text, boolean nullTerminated) { + int length = memLengthUTF16(text, nullTerminated); + long target = nmemAlloc(length); + encodeUTF16(text, nullTerminated, target); + return wrap(BUFFER_BYTE, target, length).order(NATIVE_ORDER); + } + + /** Like {@link #memUTF16(CharSequence, boolean) memASCII}, but returns {@code null} if {@code text} is {@code null}. */ + @Nullable + public static ByteBuffer memUTF16Safe(@Nullable CharSequence text, boolean nullTerminated) { + return text == null ? null : memUTF16(text, nullTerminated); + } + + /** + * Encodes and optionally null-terminates the specified text using UTF-16 encoding. The encoded text is stored in the specified {@link ByteBuffer}, at the + * current buffer position. The current buffer position is not modified by this operation. The {@code target} buffer is assumed to have enough remaining + * space to store the encoded text. + * + * @param text the text to encode + * @param nullTerminated if true, the text will be terminated with a '\0'. + * @param target the buffer in which to store the encoded text + * + * @return the number of bytes of the encoded string + */ + public static int memUTF16(CharSequence text, boolean nullTerminated, ByteBuffer target) { + return encodeUTF16(text, nullTerminated, memAddress(target)); + } + + /** + * Encodes and optionally null-terminates the specified text using UTF-16 encoding. The encoded text is stored in the specified {@link ByteBuffer} at the + * specified {@code position} offset. The current buffer position is not modified by this operation. The {@code target} buffer is assumed to have enough + * remaining space to store the encoded text. + * + * @param text the text to encode + * @param nullTerminated if true, the text will be terminated with a '\0'. + * @param target the buffer in which to store the encoded text + * @param offset the buffer position to which the string will be encoded + * + * @return the number of bytes of the encoded string + */ + public static int memUTF16(CharSequence text, boolean nullTerminated, ByteBuffer target, int offset) { + return encodeUTF16(text, nullTerminated, memAddress(target, offset)); + } + + static int encodeUTF16(CharSequence text, boolean nullTerminated, long target) { + int len = text.length(); + for (int i = 0; i < len; i++) { + UNSAFE.putShort(target + Integer.toUnsignedLong(i) * 2, (short)text.charAt(i)); + } + if (nullTerminated) { + UNSAFE.putShort(target + Integer.toUnsignedLong(len++) * 2, (short)0); + } + return 2 * len; + } + + /** + * Returns the number of bytes required to encode the specified text in the UTF-16 encoding. + * + * @param value the text to encode + * @param nullTerminated if true, add the number of bytes required for null-termination + * + * @return the number of bytes + */ + public static int memLengthUTF16(CharSequence value, boolean nullTerminated) { + return (value.length() + (nullTerminated ? 1 : 0)) << 1; + } + + /* ------------------------------------- + ------------------------------------- + TEXT DECODING API + ------------------------------------- + ------------------------------------- */ + + private static int memLengthNT1(long address, int maxLength) { + if (CHECKS) { + check(address); + } + return BITS64 + ? strlen64NT1(address, maxLength) + : strlen32NT1(address, maxLength); + } + + private static int strlen64NT1(long address, int maxLength) { + int i = 0; + + if (8 <= maxLength) { + int misalignment = (int)address & 7; + if (misalignment != 0) { + // Align to 8 bytes + for (int len = 8 - misalignment; i < len; i++) { + if (UNSAFE.getByte(null, address + i) == 0) { + return i; + } + } + } + + // Aligned longs for performance + while (i <= maxLength - 8) { + if (mathHasZeroByte(UNSAFE.getLong(null, address + i))) { + break; + } + i += 8; + } + } + + // Tail + for (; i < maxLength; i++) { + if (UNSAFE.getByte(null, address + i) == 0) { + break; + } + } + + return i; + } + + private static int strlen32NT1(long address, int maxLength) { + int i = 0; + + if (4 <= maxLength) { + int misalignment = (int)address & 3; + if (misalignment != 0) { + // Align to 4 bytes + for (int len = 4 - misalignment; i < len; i++) { + if (UNSAFE.getByte(null, address + i) == 0) { + return i; + } + } + } + + // Aligned ints for performance + while (i <= maxLength - 4) { + if (mathHasZeroByte(UNSAFE.getInt(null, address + i))) { + break; + } + i += 4; + } + } + + // Tail + for (; i < maxLength; i++) { + if (UNSAFE.getByte(null, address + i) == 0) { + break; + } + } + + return i; + } + + /** + * Calculates the length, in bytes, of the null-terminated string that starts at the current position of the specified buffer. A single \0 character will + * terminate the string. The returned length will NOT include the \0 byte. + * + *

This method is useful for reading ASCII and UTF8 encoded text.

+ * + * @param buffer the buffer containing the null-terminated string + * + * @return the string length, in bytes + */ + public static int memLengthNT1(ByteBuffer buffer) { + return memLengthNT1(memAddress(buffer), buffer.remaining()); + } + + private static int memLengthNT2(long address, int maxLength) { + if (CHECKS) { + check(address); + } + return BITS64 + ? strlen64NT2(address, maxLength) + : strlen32NT2(address, maxLength); + } + + private static int strlen64NT2(long address, int maxLength) { + int i = 0; + + if (8 <= maxLength) { + int misalignment = (int)address & 7; + if (misalignment != 0) { + // Align to 8 bytes + for (int len = 8 - misalignment; i < len; i += 2) { + if (UNSAFE.getShort(null, address + i) == 0) { + return i; + } + } + } + + // Aligned longs for performance + while (i <= maxLength - 8) { + if (mathHasZeroShort(UNSAFE.getLong(null, address + i))) { + break; + } + i += 8; + } + } + + // Tail + for (; i < maxLength; i += 2) { + if (UNSAFE.getShort(null, address + i) == 0) { + break; + } + } + + return i; + } + + private static int strlen32NT2(long address, int maxLength) { + int i = 0; + + if (4 <= maxLength) { + int misalignment = (int)address & 3; + if (misalignment != 0) { + // Align to 4 bytes + for (int len = 4 - misalignment; i < len; i += 2) { + if (UNSAFE.getShort(null, address + i) == 0) { + return i; + } + } + } + + // Aligned longs for performance + while (i <= maxLength - 4) { + if (mathHasZeroShort(UNSAFE.getInt(null, address + i))) { + break; + } + i += 4; + } + } + + // Tail + for (; i < maxLength; i += 2) { + if (UNSAFE.getShort(null, address + i) == 0) { + break; + } + } + + return i; + } + + /** + * Calculates the length, in bytes, of the null-terminated string that starts at the current position of the specified buffer. Two \0 characters will + * terminate the string. The returned buffer will NOT include the \0 bytes. + * + *

This method is useful for reading UTF16 encoded text.

+ * + * @param buffer the buffer containing the null-terminated string + * + * @return the string length, in bytes + */ + public static int memLengthNT2(ByteBuffer buffer) { + return memLengthNT2(memAddress(buffer), buffer.remaining()); + } + + /** + * Creates a new direct ByteBuffer that starts at the specified memory address and has capacity equal to the null-terminated string starting at that + * address. A single \0 character will terminate the string. The returned buffer will NOT include the \0 byte. + * + *

This method is useful for reading ASCII and UTF8 encoded text.

+ * + * @param address the starting memory address + * + * @return the new ByteBuffer + */ + public static ByteBuffer memByteBufferNT1(long address) { + return memByteBuffer(address, memLengthNT1(address, Integer.MAX_VALUE)); + } + + /** + * Creates a new direct ByteBuffer that starts at the specified memory address and has capacity equal to the null-terminated string starting at that + * address, up to a maximum of {@code maxLength} bytes. A single \0 character will terminate the string. The returned buffer will NOT include the \0 byte. + * + *

This method is useful for reading ASCII and UTF8 encoded text.

+ * + * @param address the starting memory address + * @param maxLength the maximum string length, in bytes + * + * @return the new ByteBuffer + */ + public static ByteBuffer memByteBufferNT1(long address, int maxLength) { + return memByteBuffer(address, memLengthNT1(address, maxLength)); + } + + /** Like {@link #memByteBufferNT1(long) memByteBufferNT1}, but returns {@code null} if {@code address} is {@link #NULL}. */ + @Nullable + public static ByteBuffer memByteBufferNT1Safe(long address) { + return address == NULL ? null : memByteBuffer(address, memLengthNT1(address, Integer.MAX_VALUE)); + } + + /** Like {@link #memByteBufferNT1(long, int) memByteBufferNT1}, but returns {@code null} if {@code address} is {@link #NULL}. */ + @Nullable + public static ByteBuffer memByteBufferNT1Safe(long address, int maxLength) { + return address == NULL ? null : memByteBuffer(address, memLengthNT1(address, maxLength)); + } + + /** + * Creates a new direct ByteBuffer that starts at the specified memory address and has capacity equal to the null-terminated string starting at that + * address. Two \0 characters will terminate the string. The returned buffer will NOT include the \0 bytes. + * + *

This method is useful for reading UTF16 encoded text.

+ * + * @param address the starting memory address + * + * @return the new ByteBuffer + */ + public static ByteBuffer memByteBufferNT2(long address) { + return memByteBufferNT2(address, Integer.MAX_VALUE - 1); + } + + /** + * Creates a new direct ByteBuffer that starts at the specified memory address and has capacity equal to the null-terminated string starting at that + * address, up to a maximum of {@code maxLength} bytes. Two \0 characters will terminate the string. The returned buffer will NOT include the \0 bytes. + * + *

This method is useful for reading UTF16 encoded text.

+ * + * @param address the starting memory address + * + * @return the new ByteBuffer + */ + public static ByteBuffer memByteBufferNT2(long address, int maxLength) { + if (DEBUG) { + if ((maxLength & 1) != 0) { + throw new IllegalArgumentException("The maximum length must be an even number."); + } + } + return memByteBuffer(address, memLengthNT2(address, maxLength)); + } + + /** Like {@link #memByteBufferNT2(long) memByteBufferNT2}, but returns {@code null} if {@code address} is {@link #NULL}. */ + @Nullable + public static ByteBuffer memByteBufferNT2Safe(long address) { + return address == NULL ? null : memByteBufferNT2(address, Integer.MAX_VALUE - 1); + } + + /** Like {@link #memByteBufferNT2(long, int) memByteBufferNT2}, but returns {@code null} if {@code address} is {@link #NULL}. */ + @Nullable + public static ByteBuffer memByteBufferNT2Safe(long address, int maxLength) { + return address == NULL ? null : memByteBufferNT2(address, maxLength); + } + + /** + * Converts the null-terminated ASCII encoded string at the specified memory address to a {@link String}. + * + * @param address the string memory address + * + * @return the decoded {@link String} + */ + public static String memASCII(long address) { + return memASCII(address, memLengthNT1(address, Integer.MAX_VALUE)); + } + + /** + * Converts the ASCII encoded string at the specified memory address to a {@link String}. + * + * @param address the string memory address + * @param length the number of bytes to decode + * + * @return the decoded {@link String} + */ + @SuppressWarnings("deprecation") + public static String memASCII(long address, int length) { + if (length <= 0) { + return ""; + } + + byte[] ascii = length <= ARRAY_TLC_SIZE ? ARRAY_TLC_BYTE.get() : new byte[length]; + memByteBuffer(address, length).get(ascii, 0, length); + return new String(ascii, 0, 0, length); + } + + /** + * Decodes the bytes with index {@code [position(), position()+remaining()}) in {@code buffer}, as an ASCII string. + * + *

The current {@code position} and {@code limit} of the specified {@code buffer} are not affected by this operation.

+ * + * @param buffer the {@link ByteBuffer} to decode + * + * @return the decoded {@link String} + */ + public static String memASCII(ByteBuffer buffer) { + return memASCII(memAddress(buffer), buffer.remaining()); + } + + /** Like {@link #memASCII(long) memASCII}, but returns {@code null} if {@code address} is {@link #NULL}. */ + @Nullable + public static String memASCIISafe(long address) { + return address == NULL ? null : memASCII(address, memLengthNT1(address, Integer.MAX_VALUE)); + } + + /** Like {@link #memASCII(long, int) memASCII}, but returns {@code null} if {@code address} is {@link #NULL}. */ + @Nullable + public static String memASCIISafe(long address, int length) { + return address == NULL ? null : memASCII(address, length); + } + + /** Like {@link #memASCII(ByteBuffer) memASCII}, but returns {@code null} if {@code buffer} is {@code null}. */ + @Nullable + public static String memASCIISafe(@Nullable ByteBuffer buffer) { + return buffer == null ? null : memASCII(memAddress(buffer), buffer.remaining()); + } + + /** + * Decodes the bytes with index {@code [position(), position()+length}) in {@code buffer}, as an ASCII string. + * + *

The current {@code position} and {@code limit} of the specified {@code buffer} are not affected by this operation.

+ * + * @param buffer the {@link ByteBuffer} to decode + * @param length the number of bytes to decode + * + * @return the decoded {@link String} + */ + public static String memASCII(ByteBuffer buffer, int length) { + return memASCII(memAddress(buffer), length); + } + + /** + * Decodes the bytes with index {@code [offset, offset+length}) in {@code buffer}, as an ASCII string. + * + *

The current {@code position} and {@code limit} of the specified {@code buffer} are not affected by this operation.

+ * + * @param buffer the {@link ByteBuffer} to decode + * @param length the number of bytes to decode + * @param offset the offset at which to start decoding. + * + * @return the decoded {@link String} + */ + public static String memASCII(ByteBuffer buffer, int length, int offset) { + return memASCII(memAddress(buffer, offset), length); + } + + /** + * Converts the null-terminated UTF-8 encoded string at the specified memory address to a {@link String}. + * + * @param address the string memory address + * + * @return the decoded {@link String} + */ + public static String memUTF8(long address) { + return MultiReleaseTextDecoding.decodeUTF8(address, memLengthNT1(address, Integer.MAX_VALUE)); + } + + /** + * Converts the UTF-8 encoded string at the specified memory address to a {@link String}. + * + * @param address the string memory address + * @param length the number of bytes to decode + * + * @return the decoded {@link String} + */ + public static String memUTF8(long address, int length) { + return MultiReleaseTextDecoding.decodeUTF8(address, length); + } + + /** + * Decodes the bytes with index {@code [position(), position()+remaining()}) in {@code buffer}, as a UTF-8 string. + * + *

The current {@code position} and {@code limit} of the specified {@code buffer} are not affected by this operation.

+ * + * @param buffer the {@link ByteBuffer} to decode + * + * @return the decoded {@link String} + */ + public static String memUTF8(ByteBuffer buffer) { + return MultiReleaseTextDecoding.decodeUTF8(memAddress(buffer), buffer.remaining()); + } + + /** Like {@link #memUTF8(long) memUTF8}, but returns {@code null} if {@code address} is {@link #NULL}. */ + @Nullable + public static String memUTF8Safe(long address) { + return address == NULL ? null : MultiReleaseTextDecoding.decodeUTF8(address, memLengthNT1(address, Integer.MAX_VALUE)); + } + + /** Like {@link #memUTF8(long, int) memUTF8}, but returns {@code null} if {@code address} is {@link #NULL}. */ + @Nullable + public static String memUTF8Safe(long address, int length) { + return address == NULL ? null : MultiReleaseTextDecoding.decodeUTF8(address, length); + } + + /** Like {@link #memUTF8(ByteBuffer) memUTF8}, but returns {@code null} if {@code buffer} is {@code null}. */ + @Nullable + public static String memUTF8Safe(@Nullable ByteBuffer buffer) { + return buffer == null ? null : MultiReleaseTextDecoding.decodeUTF8(memAddress(buffer), buffer.remaining()); + } + + /** + * Decodes the bytes with index {@code [position(), position()+length}) in {@code buffer}, as a UTF-8 string. + * + *

The current {@code position} and {@code limit} of the specified {@code buffer} are not affected by this operation.

+ * + * @param buffer the {@link ByteBuffer} to decode + * @param length the number of bytes to decode + * + * @return the decoded {@link String} + */ + public static String memUTF8(ByteBuffer buffer, int length) { + return MultiReleaseTextDecoding.decodeUTF8(memAddress(buffer), length); + } + + /** + * Decodes the bytes with index {@code [offset, offset+length}) in {@code buffer}, as a UTF-8 string. + * + *

The current {@code position} and {@code limit} of the specified {@code buffer} are not affected by this operation.

+ * + * @param buffer the {@link ByteBuffer} to decode + * @param length the number of bytes to decode + * @param offset the offset at which to start decoding. + * + * @return the decoded {@link String} + */ + public static String memUTF8(ByteBuffer buffer, int length, int offset) { + return MultiReleaseTextDecoding.decodeUTF8(memAddress(buffer, offset), length); + } + + /** + * Converts the null-terminated UTF-16 encoded string at the specified memory address to a {@link String}. + * + * @param address the string memory address + * + * @return the decoded {@link String} + */ + public static String memUTF16(long address) { + return memUTF16(address, memLengthNT2(address, Integer.MAX_VALUE - 1) >> 1); + } + + /** + * Converts the UTF-16 encoded string at the specified memory address to a {@link String}. + * + * @param address the string memory address + * @param length the number of characters to decode + * + * @return the decoded {@link String} + */ + public static String memUTF16(long address, int length) { + if (length <= 0) { + return ""; + } + + if (DEBUG) { + // The implementation below does no codepoint validation. + int len = length << 1; + byte[] bytes = len <= ARRAY_TLC_SIZE ? ARRAY_TLC_BYTE.get() : new byte[len]; + memByteBuffer(address, len).get(bytes, 0, len); + return new String(bytes, 0, len, UTF16); + } + + char[] chars = length <= ARRAY_TLC_SIZE ? ARRAY_TLC_CHAR.get() : new char[length]; + memCharBuffer(address, length).get(chars, 0, length); + return new String(chars, 0, length); + } + + /** + * Decodes the bytes with index {@code [position(), position()+remaining()}) in {@code buffer}, as a UTF-16 string. + * + *

The current {@code position} and {@code limit} of the specified {@code buffer} are not affected by this operation.

+ * + * @param buffer the {@link ByteBuffer} to decode + * + * @return the decoded {@link String} + */ + public static String memUTF16(ByteBuffer buffer) { + return memUTF16(memAddress(buffer), buffer.remaining() >> 1); + } + + /** Like {@link #memUTF16(long) memUTF16}, but returns {@code null} if {@code address} is {@link #NULL}. */ + @Nullable + public static String memUTF16Safe(long address) { + return address == NULL ? null : memUTF16(address, memLengthNT2(address, Integer.MAX_VALUE - 1) >> 1); + } + + /** Like {@link #memUTF16(long, int) memUTF16}, but returns {@code null} if {@code address} is {@link #NULL}. */ + @Nullable + public static String memUTF16Safe(long address, int length) { + return address == NULL ? null : memUTF16(address, length); + } + + /** Like {@link #memUTF16(ByteBuffer) memUTF16}, but returns {@code null} if {@code buffer} is {@code null}. */ + @Nullable + public static String memUTF16Safe(@Nullable ByteBuffer buffer) { + return buffer == null ? null : memUTF16(memAddress(buffer), buffer.remaining() >> 1); + } + + /** + * Decodes the bytes with index {@code [position(), position()+(length*2)}) in {@code buffer}, as a UTF-16 string. + * + *

The current {@code position} and {@code limit} of the specified {@code buffer} are not affected by this operation.

+ * + * @param buffer the {@link ByteBuffer} to decode + * @param length the number of characters to decode + * + * @return the decoded {@link String} + */ + public static String memUTF16(ByteBuffer buffer, int length) { + return memUTF16(memAddress(buffer), length); + } + + /** + * Decodes the bytes with index {@code [offset, offset+(length*2)}) in {@code buffer}, as a UTF-16 string. + * + *

The current {@code position} and {@code limit} of the specified {@code buffer} are not affected by this operation.

+ * + * @param buffer the {@link ByteBuffer} to decode + * @param length the number of characters to decode + * @param offset the offset at which to start decoding, in bytes. + * + * @return the decoded {@link String} + */ + public static String memUTF16(ByteBuffer buffer, int length, int offset) { + return memUTF16(memAddress(buffer, offset), length); + } + + // ------------------------------------------------- + // ------------------------------------------------- + // ------------------------------------------------- + + private static sun.misc.Unsafe getUnsafeInstance() { + java.lang.reflect.Field[] fields = sun.misc.Unsafe.class.getDeclaredFields(); + + /* + Different runtimes use different names for the Unsafe singleton, + so we cannot use .getDeclaredField and we scan instead. For example: + + Oracle: theUnsafe + PERC : m_unsafe_instance + Android: THE_ONE + */ + for (java.lang.reflect.Field field : fields) { + if (!field.getType().equals(sun.misc.Unsafe.class)) { + continue; + } + + int modifiers = field.getModifiers(); + if (!(java.lang.reflect.Modifier.isStatic(modifiers) && java.lang.reflect.Modifier.isFinal(modifiers))) { + continue; + } + + try { + field.setAccessible(true); + return (sun.misc.Unsafe)field.get(null); + } catch (Exception ignored) { + } + break; + } + + throw new UnsupportedOperationException("LWJGL requires sun.misc.Unsafe to be available."); + } + + private static long getAddressOffset() { + long MAGIC_ADDRESS = 0xDEADBEEF8BADF00DL; + if (BITS32) { + MAGIC_ADDRESS &= 0xFFFFFFFFL; + } + + ByteBuffer bb = Objects.requireNonNull(NewDirectByteBuffer(MAGIC_ADDRESS, 0)); + + long offset = 8L; // 8 byte aligned, cannot be at 0 + while (true) { + if (UNSAFE.getLong(bb, offset) == MAGIC_ADDRESS) { + return offset; + } + offset += 8L; + } + } + + private static final int MAGIC_CAPACITY = 0x0D15EA5E; + private static final int MAGIC_POSITION = 0x00FACADE; + + private static long getIntFieldOffset(ByteBuffer bb, int magicValue) { + long offset = 4L; // 4 byte aligned, cannot be at 0 + while (true) { + if (UNSAFE.getInt(bb, offset) == magicValue) { + return offset; + } + offset += 4L; + } + } + + private static long getMarkOffset() { + ByteBuffer bb = Objects.requireNonNull(NewDirectByteBuffer(1L, 0)); + return getIntFieldOffset(bb, -1); + } + + private static long getPositionOffset() { + ByteBuffer bb = Objects.requireNonNull(NewDirectByteBuffer(-1L, MAGIC_CAPACITY)); + bb.position(MAGIC_POSITION); + return getIntFieldOffset(bb, MAGIC_POSITION); + } + + private static long getLimitOffset() { + ByteBuffer bb = Objects.requireNonNull(NewDirectByteBuffer(-1L, MAGIC_CAPACITY)); + bb.limit(MAGIC_POSITION); + return getIntFieldOffset(bb, MAGIC_POSITION); + } + + private static long getCapacityOffset() { + ByteBuffer bb = Objects.requireNonNull(NewDirectByteBuffer(-1L, MAGIC_CAPACITY)); + bb.limit(0); + return getIntFieldOffset(bb, MAGIC_CAPACITY); + } + + private static long getParentOffset(long offset, int oopSize, T buffer, T bufferWithAttachment) { + switch (oopSize) { + case Integer.BYTES: // 32-bit or 64-bit with compressed oops + while (true) { + if (UNSAFE.getInt(buffer, offset) != UNSAFE.getInt(bufferWithAttachment, offset)) { + return offset; + } + offset += oopSize; + } + case Long.BYTES: // 64-bit with uncompressed oops + while (true) { + if (UNSAFE.getLong(buffer, offset) != UNSAFE.getLong(bufferWithAttachment, offset)) { + return offset; + } + offset += oopSize; + } + default: + throw new IllegalStateException(); + } + } + + @SuppressWarnings("unchecked") + static T wrap(Class clazz, long address, int capacity) { + T buffer; + try { + buffer = (T)UNSAFE.allocateInstance(clazz); + } catch (InstantiationException e) { + throw new UnsupportedOperationException(e); + } + + UNSAFE.putLong(buffer, ADDRESS, address); + UNSAFE.putInt(buffer, MARK, -1); + UNSAFE.putInt(buffer, LIMIT, capacity); + UNSAFE.putInt(buffer, CAPACITY, capacity); + + return buffer; + } + + static ByteBuffer slice(ByteBuffer source, long address, int capacity) { + ByteBuffer target; + try { + target = (ByteBuffer)UNSAFE.allocateInstance(BUFFER_BYTE); + } catch (InstantiationException e) { + throw new UnsupportedOperationException(e); + } + + UNSAFE.putLong(target, ADDRESS, address); + UNSAFE.putInt(target, MARK, -1); + UNSAFE.putInt(target, LIMIT, capacity); + UNSAFE.putInt(target, CAPACITY, capacity); + + Object attachment = UNSAFE.getObject(source, PARENT_BYTE); + UNSAFE.putObject(target, PARENT_BYTE, attachment == null ? source : attachment); + + return target.order(source.order()); + } + + @SuppressWarnings("unchecked") + static T slice(Class clazz, T source, long address, int capacity, long attachmentOffset) { + T target; + try { + target = (T)UNSAFE.allocateInstance(clazz); + } catch (InstantiationException e) { + throw new UnsupportedOperationException(e); + } + + UNSAFE.putLong(target, ADDRESS, address); + UNSAFE.putInt(target, MARK, -1); + UNSAFE.putInt(target, LIMIT, capacity); + UNSAFE.putInt(target, CAPACITY, capacity); + + UNSAFE.putObject(target, attachmentOffset, UNSAFE.getObject(source, attachmentOffset)); + + return target; + } + + @SuppressWarnings("unchecked") + static T duplicate(Class clazz, T source, long attachmentOffset) { + T target; + try { + target = (T)UNSAFE.allocateInstance(clazz); + } catch (InstantiationException e) { + throw new UnsupportedOperationException(e); + } + + UNSAFE.putLong(target, ADDRESS, UNSAFE.getLong(source, ADDRESS)); + UNSAFE.putInt(target, MARK, UNSAFE.getInt(source, MARK)); + UNSAFE.putInt(target, POSITION, UNSAFE.getInt(source, POSITION)); + UNSAFE.putInt(target, LIMIT, UNSAFE.getInt(source, LIMIT)); + UNSAFE.putInt(target, CAPACITY, UNSAFE.getInt(source, CAPACITY)); + + UNSAFE.putObject(target, attachmentOffset, UNSAFE.getObject(source, attachmentOffset)); + + return target; + } + +} diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/MultiReleaseMemCopy.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/MultiReleaseMemCopy.java new file mode 100644 index 00000000..02eeebcb --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/MultiReleaseMemCopy.java @@ -0,0 +1,30 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.libc.LibCString.*; + +final class MultiReleaseMemCopy { + + private MultiReleaseMemCopy() { + } + + static void copy(long src, long dst, long bytes) { + if (bytes < 384) { + // A custom Java loop is fastest at small sizes, approximately up to 384 bytes. + if (((int)src & 7) == 0 && ((int)dst & 7) == 0) { // both src and dst must be aligned to 8 bytes + memCopyAligned(src, dst, (int)bytes & 0x1FF); + } else { + // Unaligned fallback. Poor performance until Java 10. + UNSAFE.copyMemory(src, dst, bytes); + } + } else { + // Fastest at bigger sizes, when the JNI overhead becomes negligible. + nmemcpy(dst, src, bytes); + } + } + +} diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/MultiReleaseTextDecoding.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/MultiReleaseTextDecoding.java new file mode 100644 index 00000000..7b8cb407 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/MultiReleaseTextDecoding.java @@ -0,0 +1,73 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import java.nio.*; +import java.nio.charset.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * String decoding utilities. + * + *

On Java 9 different implementations are used that work better with compact strings (JEP 254).

+ */ +final class MultiReleaseTextDecoding { + + private MultiReleaseTextDecoding() { + } + + /** @see MemoryUtil#memUTF8(ByteBuffer, int, int) */ + static String decodeUTF8(long source, int length) { + if (length <= 0) { + return ""; + } + + if (DEBUG) { + // The implementation below does no codepoint validation. + byte[] bytes = length <= ARRAY_TLC_SIZE ? ARRAY_TLC_BYTE.get() : new byte[length]; + memByteBuffer(source, length).get(bytes, 0, length); + return new String(bytes, 0, length, StandardCharsets.UTF_8); + } + + char[] string = length <= ARRAY_TLC_SIZE ? ARRAY_TLC_CHAR.get() : new char[length]; + + int i = 0, position = 0; + + while (position < length) { + char c; + + int b0 = UNSAFE.getByte(null, source + position++) & 0xFF; + if (b0 < 0x80) { + c = (char)b0; + } else { + int b1 = UNSAFE.getByte(null, source + position++) & 0x3F; + if ((b0 & 0xE0) == 0xC0) { + c = (char)(((b0 & 0x1F) << 6) | b1); + } else { + int b2 = UNSAFE.getByte(null, source + position++) & 0x3F; + if ((b0 & 0xF0) == 0xE0) { + c = (char)(((b0 & 0x0F) << 12) | (b1 << 6) | b2); + } else { + int b3 = UNSAFE.getByte(null, source + position++) & 0x3F; + int cp = ((b0 & 0x07) << 18) | (b1 << 12) | (b2 << 6) | b3; + + if (i < length) { + string[i++] = (char)((cp >>> 10) + 0xD7C0); + } + c = (char)((cp & 0x3FF) + 0xDC00); + } + } + } + if (i < length) { + string[i++] = c; + } + } + + return new String(string, 0, Math.min(i, length)); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/NativeResource.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/NativeResource.java new file mode 100644 index 00000000..ae8462bb --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/NativeResource.java @@ -0,0 +1,23 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +/** + * Classes that implement this interface are associated with one or more native resources. These resources must be explicitly freed when a class instance is + * no longer used, by calling the {@link #free} method. + * + *

This interface extends {@link AutoCloseable}, which means that implementations may be used as resources in try-with-resources statements.

+ */ +public interface NativeResource extends AutoCloseable { + + /** Frees any native resources held by this object. */ + void free(); + + @Override + default void close() { + free(); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/NativeType.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/NativeType.java new file mode 100644 index 00000000..f8894cc3 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/NativeType.java @@ -0,0 +1,14 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import java.lang.annotation.*; + +/** Annotates parameter and return types in LWJGL bindings with the C type as defined in the native function. */ +@Retention(RetentionPolicy.RUNTIME) +@Target({ElementType.TYPE, ElementType.METHOD, ElementType.PARAMETER}) +public @interface NativeType { + String value(); +} diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/NonnullDefault.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/NonnullDefault.java new file mode 100644 index 00000000..7ceef49e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/NonnullDefault.java @@ -0,0 +1,15 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import javax.annotation.*; +import javax.annotation.meta.*; +import java.lang.annotation.*; + +@Documented +@Nonnull +@TypeQualifierDefault({ ElementType.FIELD, ElementType.METHOD, ElementType.PARAMETER }) +@Retention(RetentionPolicy.RUNTIME) +public @interface NonnullDefault {} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/Platform.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/Platform.java new file mode 100644 index 00000000..def2e6cc --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/Platform.java @@ -0,0 +1,189 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import javax.annotation.*; +import java.util.function.*; +import java.util.regex.*; + +import static org.lwjgl.system.APIUtil.*; + +/** The platforms supported by LWJGL. */ +public enum Platform { + + FCL("FCL", "fcl") { + private final Pattern SO = Pattern.compile("(?:^|/)lib\\w+[.]so(?:[.]\\d+)*$"); + + @Override + String mapLibraryName(String name) { + if (SO.matcher(name).find()) { + return name; + } + + return System.mapLibraryName(name); + } + }, + LINUX("Linux", "linux") { + private final Pattern SO = Pattern.compile("(?:^|/)lib\\w+[.]so(?:[.]\\d+)*$"); + + @Override + String mapLibraryName(String name) { + if (SO.matcher(name).find()) { + return name; + } + + return System.mapLibraryName(name); + } + }, + // TODO: Rename to MACOS in LWJGL 4 + MACOSX("macOS", "macos") { + private final Pattern DYLIB = Pattern.compile("(?:^|/)lib\\w+(?:[.]\\d+)*[.]dylib$"); + + @Override + String mapLibraryName(String name) { + if (DYLIB.matcher(name).find()) { + return name; + } + + return System.mapLibraryName(name); + } + }, + WINDOWS("Windows", "windows") { + @Override + String mapLibraryName(String name) { + if (name.endsWith(".dll")) { + return name; + } + + return System.mapLibraryName(name); + } + }; + + /** The architectures supported by LWJGL. */ + public enum Architecture { + X64(true), + X86(false), + ARM64(true), + ARM32(false); + + static final Architecture current; + + final boolean is64Bit; + + static { + String osArch = System.getProperty("os.arch"); + boolean is64Bit = osArch.contains("64") || osArch.startsWith("armv8"); + + current = osArch.startsWith("arm") || osArch.startsWith("aarch64") + ? (is64Bit ? Architecture.ARM64 : Architecture.ARM32) + : (is64Bit ? Architecture.X64 : Architecture.X86); + } + + Architecture(boolean is64Bit) { + this.is64Bit = is64Bit; + } + } + + private static final Platform current; + + private static final Function bundledLibraryNameMapper; + private static final Function bundledLibraryPathMapper; + + static { + String osName = System.getProperty("os.name"); + if (osName.startsWith("Windows")) { + current = WINDOWS; + } else if (osName.startsWith("Linux") || osName.startsWith("FreeBSD") || osName.startsWith("SunOS") || osName.startsWith("Unix")) { + String platformName = System.getProperty("lwjgl.platform"); + if (platformName != null && platformName.startsWith("FCL")) { + current = FCL; + } else { + current = LINUX; + } + } else if (osName.startsWith("Mac OS X") || osName.startsWith("Darwin")) { + current = MACOSX; + } else { + throw new LinkageError("Unknown platform: " + osName); + } + + bundledLibraryNameMapper = getMapper( + Configuration.BUNDLED_LIBRARY_NAME_MAPPER.get("default"), + name -> name, + name -> Architecture.current.is64Bit ? name : name + "32" + ); + bundledLibraryPathMapper = getMapper( + Configuration.BUNDLED_LIBRARY_PATH_MAPPER.get("default"), + name -> current.nativePath + "/" + Architecture.current.name().toLowerCase() + "/" + name, + name -> name.substring(name.lastIndexOf('/')) + ); + } + + private final String name; + private final String nativePath; + + Platform(String name, String nativePath) { + this.name = name; + this.nativePath = nativePath; + } + + /** Returns the platform name. */ + public String getName() { + return name; + } + + abstract String mapLibraryName(String name); + + /** Returns the platform on which the library is running. */ + public static Platform get() { + return current; + } + + /** Returns the architecture on which the library is running. */ + public static Architecture getArchitecture() { + return Architecture.current; + } + + public static String mapLibraryNameBundled(String name) { + return bundledLibraryNameMapper.apply(name); + } + + static String mapLibraryPathBundled(String name) { + return bundledLibraryPathMapper.apply(name); + } + + @SuppressWarnings("unchecked") + private static Function getMapper( + @Nullable Object mapper, + Function defaultMapper, + Function legacyMapper + ) { + if (mapper == null || "default".equals(mapper)) { + return defaultMapper; + } + + if ("legacy".equals(mapper)) { + return legacyMapper; + } + + if (mapper instanceof Function) { + return (Function)mapper; + } + + String className = mapper.toString(); + try { + return (Function)Class + .forName(className) + .getConstructor() + .newInstance(); + } catch (Throwable t) { + if (Checks.DEBUG) { + t.printStackTrace(DEBUG_STREAM); + } + apiLog(String.format("Warning: Failed to instantiate bundled library mapper: %s. Using the default.", className)); + return defaultMapper; + } + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/Pointer.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/Pointer.java new file mode 100644 index 00000000..327b2950 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/Pointer.java @@ -0,0 +1,157 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import org.lwjgl.*; + +import javax.annotation.*; +import java.nio.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Pointer interface. + * + *

LWJGL can run on both 32bit and 64bit architectures. Since LWJGL applications deal with native memory directly, this interface provides necessary + * information about the underlying architecture of the running JVM process.

+ * + *

When interacting with native functions, pointer values are mapped to Java {@code long}. LWJGL automatically converts long values to the correct pointer + * addresses when used in native code. Native functions sometimes require arrays of pointer values; the {@link PointerBuffer} class may be used for that + * purpose. It has an API similar to a {@link LongBuffer} but handles pointer casts automatically.

+ */ +public interface Pointer { + + /** The pointer size in bytes. Will be 4 on a 32bit JVM and 8 on a 64bit one. */ + int POINTER_SIZE = MemoryAccessJNI.getPointerSize(); + + /** The pointer size power-of-two. Will be 2 on a 32bit JVM and 3 on a 64bit one. */ + int POINTER_SHIFT = POINTER_SIZE == 8 ? 3 : 2; + + /** The value of {@code sizeof(long)} for the current platform. */ + int CLONG_SIZE = POINTER_SIZE == 8 && Platform.get() == Platform.WINDOWS ? 4 : POINTER_SIZE; + + /** The value of {@code sizeof(long)} as a power-of-two. */ + int CLONG_SHIFT = CLONG_SIZE == 8 ? 3 : 2; + + /** Will be true on a 32bit JVM. */ + boolean BITS32 = POINTER_SIZE * 8 == 32; + + /** Will be true on a 64bit JVM. */ + boolean BITS64 = POINTER_SIZE * 8 == 64; + + /** + * Returns the raw pointer address as a {@code long} value. + * + * @return the pointer address + */ + long address(); + + /** Default {@link Pointer} implementation. */ + abstract class Default implements Pointer { + + protected static final sun.misc.Unsafe UNSAFE; + + protected static final long ADDRESS; + + protected static final long BUFFER_CONTAINER; + + protected static final long BUFFER_MARK; + protected static final long BUFFER_POSITION; + protected static final long BUFFER_LIMIT; + protected static final long BUFFER_CAPACITY; + + static { + UNSAFE = MemoryUtil.UNSAFE; + + try { + ADDRESS = UNSAFE.objectFieldOffset(Default.class.getDeclaredField("address")); + + BUFFER_CONTAINER = UNSAFE.objectFieldOffset(CustomBuffer.class.getDeclaredField("container")); + + BUFFER_MARK = UNSAFE.objectFieldOffset(CustomBuffer.class.getDeclaredField("mark")); + BUFFER_POSITION = UNSAFE.objectFieldOffset(CustomBuffer.class.getDeclaredField("position")); + BUFFER_LIMIT = UNSAFE.objectFieldOffset(CustomBuffer.class.getDeclaredField("limit")); + BUFFER_CAPACITY = UNSAFE.objectFieldOffset(CustomBuffer.class.getDeclaredField("capacity")); + } catch (Throwable t) { + throw new UnsupportedOperationException(t); + } + } + + // Removed final due to JDK-8139758. TODO: Restore if the fix is backported to JDK 8. + protected long address; + + protected Default(long address) { + if (CHECKS && address == NULL) { + throw new NullPointerException(); + } + this.address = address; + } + + @Override + public long address() { + return address; + } + + public boolean equals(@Nullable Object o) { + if (this == o) { + return true; + } + if (!(o instanceof Pointer)) { + return false; + } + + Pointer that = (Pointer)o; + + return address == that.address(); + } + + public int hashCode() { + return (int)(address ^ (address >>> 32)); + } + + @Override + public String toString() { + return String.format("%s pointer [0x%X]", getClass().getSimpleName(), address); + } + + @SuppressWarnings("unchecked") + protected static > T wrap(Class clazz, long address, int capacity) { + T buffer; + try { + buffer = (T)UNSAFE.allocateInstance(clazz); + } catch (InstantiationException e) { + throw new UnsupportedOperationException(e); + } + + UNSAFE.putLong(buffer, ADDRESS, address); + UNSAFE.putInt(buffer, BUFFER_MARK, -1); + UNSAFE.putInt(buffer, BUFFER_LIMIT, capacity); + UNSAFE.putInt(buffer, BUFFER_CAPACITY, capacity); + + return buffer; + } + + @SuppressWarnings("unchecked") + protected static > T wrap(Class clazz, long address, int capacity, ByteBuffer container) { + T buffer; + try { + buffer = (T)UNSAFE.allocateInstance(clazz); + } catch (InstantiationException e) { + throw new UnsupportedOperationException(e); + } + + UNSAFE.putLong(buffer, ADDRESS, address); + UNSAFE.putInt(buffer, BUFFER_MARK, -1); + UNSAFE.putInt(buffer, BUFFER_LIMIT, capacity); + UNSAFE.putInt(buffer, BUFFER_CAPACITY, capacity); + UNSAFE.putObject(buffer, BUFFER_CONTAINER, container); + + return buffer; + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/SharedLibrary.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/SharedLibrary.java new file mode 100644 index 00000000..097668ec --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/SharedLibrary.java @@ -0,0 +1,76 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import javax.annotation.*; + +import static org.lwjgl.system.dyncall.DynLoad.*; + +/** A {@link FunctionProvider} implementation that opens a platform-specific shared library and returns functions pointers from it. */ +public interface SharedLibrary extends FunctionProvider, NativeResource, Pointer { + + /** Returns the library name. */ + String getName(); + + /** + * Returns the library path, if available. + * + * @return the library path, or {@code null} if the path is not available. + */ + @Nullable + String getPath(); + + abstract class Default extends Pointer.Default implements SharedLibrary { + + private final String name; + + protected Default(String name, long handle) { + super(handle); + this.name = name; + } + + @Override + public String getName() { + return name; + } + + @Nullable + @Override public String getPath() { + String path = dlGetLibraryPath(address(), 256); + return path.isEmpty() ? null : path; + } + } + + abstract class Delegate implements SharedLibrary { + + protected final SharedLibrary library; + + protected Delegate(SharedLibrary library) { + this.library = library; + } + + @Override + public String getName() { + return library.getName(); + } + + @Nullable + @Override public String getPath() { + return library.getPath(); + } + + @Override + public long address() { + return library.address(); + } + + @Override + public void free() { + library.free(); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/SharedLibraryLoader.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/SharedLibraryLoader.java new file mode 100644 index 00000000..77bc4ca4 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/SharedLibraryLoader.java @@ -0,0 +1,321 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import org.lwjgl.*; + +import javax.annotation.*; +import javax.annotation.concurrent.*; +import java.io.*; +import java.net.*; +import java.nio.channels.*; +import java.nio.file.*; +import java.util.concurrent.locks.*; +import java.util.stream.*; +import java.util.zip.*; + +import static org.lwjgl.system.APIUtil.*; + +/** + * Loads shared libraries and native resources from the classpath. + * + *

The libraries may be packed in JAR files, in which case they will be extracted to a temporary directory and that directory will be prepended to + * {@link Configuration#LIBRARY_PATH}. + *

+ * + * @author Mario Zechner (https://github.com/badlogic) + * @author Nathan Sweet (https://github.com/NathanSweet) + * @see Configuration#SHARED_LIBRARY_EXTRACT_DIRECTORY + * @see Configuration#SHARED_LIBRARY_EXTRACT_PATH + */ +final class SharedLibraryLoader { + + private static final Lock EXTRACT_PATH_LOCK = new ReentrantLock(); + + @GuardedBy("EXTRACT_PATH_LOCK") + @Nullable + private static Path extractPath; + + private SharedLibraryLoader() { + } + + /** + * Extracts the specified shared library or native resource from the classpath to a temporary directory. + * + * @param name the resource name + * @param filename the resource filename + * @param resource the classpath {@link URL} were the resource can be found + * + * @return a {@link FileChannel} that has locked the resource file + */ + static FileChannel load(String name, String filename, URL resource) { + try { + Path extractedFile; + + EXTRACT_PATH_LOCK.lock(); + try { + if (extractPath != null) { + // Reuse the lwjgl shared library location + extractedFile = extractPath.resolve(filename); + } else { + extractedFile = getExtractPath(filename, resource); + // Do not store unless the test for JDK-8195129 has passed + if (Platform.get() != Platform.WINDOWS || workaroundJDK8195129(extractedFile)) { + initExtractPath(extractPath = extractedFile.getParent()); + } + } + } finally { + EXTRACT_PATH_LOCK.unlock(); + } + + return extract(extractedFile, resource); + } catch (Exception e) { + throw new RuntimeException("\tFailed to extract " + name + " library", e); + } + } + + private static void initExtractPath(Path extractPath) { + String newLibPath = extractPath.toAbsolutePath().toString(); + + // Prepend the path in which the libraries were extracted to org.lwjgl.librarypath + String libPath = Configuration.LIBRARY_PATH.get(); + if (libPath != null && !libPath.isEmpty()) { + newLibPath += File.pathSeparator + libPath; + } + + System.setProperty(Configuration.LIBRARY_PATH.getProperty(), newLibPath); + Configuration.LIBRARY_PATH.set(newLibPath); + } + + /** + * Returns a path to a file that can be written. Tries multiple locations and verifies writing succeeds. + * + * @param filename the resource filename + * + * @return the extracted library + */ + private static Path getExtractPath(String filename, URL resource) { + String override = Configuration.SHARED_LIBRARY_EXTRACT_PATH.get(); + if (override != null) { + return Paths.get(override, filename); + } + + String version = Version.getVersion().replace(' ', '-'); + + Path tempDirectory; + Path root, file; + + // Temp directory with username in path + tempDirectory = Paths.get(Configuration.SHARED_LIBRARY_EXTRACT_DIRECTORY.get("lwjgl" + System.getProperty("user.name")), version, filename); + file = (root = Paths.get(System.getProperty("java.io.tmpdir"))).resolve(tempDirectory); + if (canWrite(root, file, resource)) { + return file; + } + + // User home + tempDirectory = Paths.get(Configuration.SHARED_LIBRARY_EXTRACT_DIRECTORY.get("lwjgl"), version, filename); + file = (root = Paths.get(System.getProperty("user.home"))).resolve(tempDirectory); + if (canWrite(root, file, resource)) { + return file; + } + + // Working directory + file = (root = Paths.get("").toAbsolutePath()).resolve(tempDirectory); + if (canWrite(root, file, resource)) { + return file; + } + + if (Platform.get() == Platform.WINDOWS) { + // C:\Windows\Temp + String env = System.getenv("SystemRoot"); + if (env != null) { + file = (root = Paths.get(env, "Temp")).resolve(tempDirectory); + if (canWrite(root, file, resource)) { + return file; + } + } + + // C:\Temp + env = System.getenv("SystemDrive"); + if (env != null) { + file = (root = Paths.get(env + "/")).resolve(Paths.get("Temp").resolve(tempDirectory)); + if (canWrite(root, file, resource)) { + return file; + } + } + } + + // System provided temp directory (in java.io.tmpdir) + try { + file = Files.createTempDirectory("lwjgl"); + root = file.getParent(); + file = file.resolve(filename); + if (canWrite(root, file, resource)) { + return file; + } + } catch (IOException ignored) { + } + + throw new RuntimeException("Failed to find an appropriate directory to extract the native library"); + } + + /** + * Extracts a native library resource if it does not already exist or the CRC does not match. + * + * @param resource the resource to extract + * @param file the extracted file + * + * @return a {@link FileChannel} that has locked the resource + * + * @throws IOException if an IO error occurs + */ + private static FileChannel extract(Path file, URL resource) throws IOException { + if (Files.exists(file)) { + try ( + InputStream source = resource.openStream(); + InputStream target = Files.newInputStream(file) + ) { + if (crc(source) == crc(target)) { + if (Configuration.DEBUG_LOADER.get(false)) { + apiLog(String.format("\tFound at: %s", file)); + } + return lock(file); + } + } + } + + // If file doesn't exist or the CRC doesn't match, extract it to the temp dir. + apiLog(String.format(" Extracting: %s", resource.getPath())); + //noinspection FieldAccessNotGuarded (already inside the lock) + if (extractPath == null) { + apiLog(String.format(" to: %s", file)); + } + + Files.createDirectories(file.getParent()); + try (InputStream source = resource.openStream()) { + Files.copy(source, file, StandardCopyOption.REPLACE_EXISTING); + } + + return lock(file); + } + + /** + * Locks a file. + * + * @param file the file to lock + */ + private static FileChannel lock(Path file) { + // Wait for other processes (usually antivirus software) to unlock the extracted file + // before attempting to load it. + try { + FileChannel fc = FileChannel.open(file); + + //noinspection resource + if (fc.tryLock(0L, Long.MAX_VALUE, true) == null) { + if (Configuration.DEBUG_LOADER.get(false)) { + apiLog("\tFile is locked by another process, waiting..."); + } + + //noinspection resource + fc.lock(0L, Long.MAX_VALUE, true); // this will block until the file is locked + } + + // the lock will be released when the channel is closed + return fc; + } catch (Exception e) { + throw new RuntimeException("Failed to lock file.", e); + } + } + + /** + * Returns a CRC of the remaining bytes in a stream. + * + * @param input the stream + * + * @return the CRC + */ + private static long crc(InputStream input) throws IOException { + CRC32 crc = new CRC32(); + + byte[] buffer = new byte[8 * 1024]; + for (int n; (n = input.read(buffer)) != -1; ) { + crc.update(buffer, 0, n); + } + + return crc.getValue(); + } + + /** + * Returns true if the parent directories of the file can be created and the file can be written. + * + * @param file the file to test + * + * @return true if the file is writable + */ + private static boolean canWrite(Path root, Path file, URL resource) { + Path testFile; + if (Files.exists(file)) { + if (!Files.isWritable(file)) { + return false; + } + + // Don't overwrite existing file just to check if we can write to directory. + testFile = file.getParent().resolve(".lwjgl.test"); + } else { + try { + Files.createDirectories(file.getParent()); + } catch (IOException ignored) { + return false; + } + testFile = file; + } + + try { + Files.write(testFile, new byte[0]); + Files.delete(testFile); + + if (workaroundJDK8195129(file)) { + // We have full access, the JVM has locked the file, but System.load can still fail if + // the path contains unicode characters, due to JDK-8195129. Test for this here and + // return false if it fails to try other paths. + try (FileChannel ignored = extract(file, resource)) { + System.load(file.toAbsolutePath().toString()); + } + } + + return true; + } catch (Throwable ignored) { + if (file == testFile) { + canWriteCleanup(root, file); + } + return false; + } + } + + private static void canWriteCleanup(Path root, Path file) { + try { + // remove any files or directories created by canWrite + Files.deleteIfExists(file); + + // delete empty directories from parent down to root (exclusive) + Path parent = file.getParent(); + while (!Files.isSameFile(parent, root)) { + try (Stream dir = Files.list(parent)) { + if (dir.findAny().isPresent()) { + break; + } + } + Files.delete(parent); + parent = parent.getParent(); + } + } catch (IOException ignored) { + } + } + + private static boolean workaroundJDK8195129(Path file) { + return Platform.get() == Platform.WINDOWS && file.toString().endsWith(".dll"); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/StackWalkUtil.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/StackWalkUtil.java new file mode 100644 index 00000000..4a5531e5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/StackWalkUtil.java @@ -0,0 +1,104 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import javax.annotation.*; +import java.util.*; + +/** + * Stack-walking utilities. + * + *

On Java 9 these methods are implemented using {@code java.lang.StackWalker}, which has much lower overhead.

+ */ +final class StackWalkUtil { + + private StackWalkUtil() { + } + + static StackTraceElement[] stackWalkArray(Object[] a) { + return (StackTraceElement[])a; + } + + static Object stackWalkGetMethod(Class after) { + StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); + + for (int i = 3; i < stackTrace.length; i++) { + if (!stackTrace[i].getClassName().startsWith(after.getName())) { + return stackTrace[i]; + } + } + + throw new IllegalStateException(); + } + + private static boolean isSameMethod(StackTraceElement a, StackTraceElement b) { + return isSameMethod(a, b, b.getMethodName()); + } + + private static boolean isSameMethod(StackTraceElement a, StackTraceElement b, String methodName) { + return a.getMethodName().equals(methodName) && + a.getClassName().equals(b.getClassName()) && + a.getFileName().equals(b.getFileName()); + } + + private static boolean isAutoCloseable(StackTraceElement element, StackTraceElement pushed) { + // Java 9 try-with-resources: synthetic $closeResource + if (isSameMethod(element, pushed, "$closeResource")) { + return true; + } + + // Kotlin T.use: kotlin.AutoCloseable::closeFinally + if ("closeFinally".equals(element.getMethodName()) && "AutoCloseable.kt".equals(element.getFileName())) { + return true; + } + + return false; + } + + @Nullable + static Object stackWalkCheckPop(Class after, Object pushedObj) { + StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); + + for (int i = 3; i < stackTrace.length; i++) { + StackTraceElement element = stackTrace[i]; + if (element.getClassName().startsWith(after.getName())) { + continue; + } + + StackTraceElement pushed = (StackTraceElement)pushedObj; + if (isSameMethod(element, pushed)) { + return null; + } + + if (isAutoCloseable(element, pushed) && i + 1 < stackTrace.length) { + // Some runtimes use a separate method to call AutoCloseable::close in try-with-resources blocks. + // That method suppresses any exceptions thrown by close if necessary. + // When that happens, the pop is 1 level deeper than expected. + element = stackTrace[i + 1]; + if (isSameMethod(pushed, stackTrace[i + 1])) { + return null; + } + } + + return element; + } + + throw new IllegalStateException(); + } + + static Object[] stackWalkGetTrace() { + StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace(); + + int i = 3; + for (; i < stackTrace.length; i++) { + if (!stackTrace[i].getClassName().startsWith("org.lwjgl.system.Memory")) { + break; + } + } + + return Arrays.copyOfRange(stackTrace, i, stackTrace.length); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/Struct.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/Struct.java new file mode 100644 index 00000000..592ef898 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/Struct.java @@ -0,0 +1,283 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import javax.annotation.*; +import java.nio.*; +import java.util.*; + +import static java.lang.Math.*; +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Base class of all struct implementations. */ +public abstract class Struct extends Pointer.Default { + + protected static final int DEFAULT_PACK_ALIGNMENT = Platform.get() == Platform.WINDOWS ? 8 : 0x4000_0000; + protected static final int DEFAULT_ALIGN_AS = 0; + + private static final long CONTAINER; + + static { + Library.initialize(); + + try { + CONTAINER = UNSAFE.objectFieldOffset(Struct.class.getDeclaredField("container")); + } catch (Throwable t) { + throw new UnsupportedOperationException(t); + } + } + + @SuppressWarnings({"unused", "FieldCanBeLocal"}) + @Nullable + private ByteBuffer container; + + protected Struct(long address, @Nullable ByteBuffer container) { + super(address); + this.container = container; + } + + /** Returns {@code sizeof(struct)}. */ + public abstract int sizeof(); + + /** Zeroes-out the struct data. */ + public void clear() { + memSet(address(), 0, sizeof()); + } + + /** + * Frees the struct allocation. + * + *

This method should not be used if the memory backing this struct is not owned by the struct.

+ */ + public void free() { + nmemFree(address()); + } + + /** + * Returns true if the pointer member that corresponds to the specified {@code memberOffset} is {@code NULL}. + * + *

This is useful to verify that not nullable members of an untrusted struct instance are indeed not {@code NULL}.

+ * + * @param memberOffset the byte offset of the member to query + * + * @return true if the member is {@code NULL} + */ + public boolean isNull(int memberOffset) { + if (DEBUG) { + checkMemberOffset(memberOffset); + } + return memGetAddress(address() + memberOffset) == NULL; + } + + // ---------------- Implementation utilities ---------------- + + @SuppressWarnings("unchecked") + protected static T wrap(Class clazz, long address) { + T struct; + try { + struct = (T)UNSAFE.allocateInstance(clazz); + } catch (InstantiationException e) { + throw new UnsupportedOperationException(e); + } + + UNSAFE.putLong(struct, ADDRESS, address); + + return struct; + } + + @SuppressWarnings("unchecked") + protected static T wrap(Class clazz, long address, ByteBuffer container) { + T struct; + try { + struct = (T)UNSAFE.allocateInstance(clazz); + } catch (InstantiationException e) { + throw new UnsupportedOperationException(e); + } + + UNSAFE.putLong(struct, ADDRESS, address); + UNSAFE.putObject(struct, CONTAINER, container); + + return struct; + } + + @SuppressWarnings("unchecked") + T wrap(long address, int index, @Nullable ByteBuffer container) { + T struct; + try { + struct = (T)UNSAFE.allocateInstance(this.getClass()); + } catch (InstantiationException e) { + throw new UnsupportedOperationException(e); + } + + UNSAFE.putLong(struct, ADDRESS, address + Integer.toUnsignedLong(index) * sizeof()); + UNSAFE.putObject(struct, CONTAINER, container); + + return struct; + } + + private void checkMemberOffset(int memberOffset) { + if (memberOffset < 0 || sizeof() - memberOffset < POINTER_SIZE) { + throw new IllegalArgumentException("Invalid member offset."); + } + } + + protected static ByteBuffer __checkContainer(ByteBuffer container, int sizeof) { + if (CHECKS) { + check(container, sizeof); + } + return container; + } + + private static long getBytes(int elements, int elementSize) { + return (elements & 0xFFFF_FFFFL) * elementSize; + } + + protected static long __checkMalloc(int elements, int elementSize) { + long bytes = (elements & 0xFFFF_FFFFL) * elementSize; + if (DEBUG) { + if (elements < 0) { + throw new IllegalArgumentException("Invalid number of elements"); + } + if (BITS32 && 0xFFFF_FFFFL < bytes) { + throw new IllegalArgumentException("The request allocation is too large"); + } + } + return bytes; + } + + protected static ByteBuffer __create(int elements, int elementSize) { + apiCheckAllocation(elements, getBytes(elements, elementSize), 0x7FFF_FFFFL); + return ByteBuffer.allocateDirect(elements * elementSize).order(ByteOrder.nativeOrder()); + } + + // ---------------- Struct Member Layout ---------------- + + protected static class Member { + final int size; + final int alignment; + final boolean forcedAlignment; + + int offset; + + Member(int size, int alignment, boolean forcedAlignment) { + this.size = size; + this.alignment = alignment; + this.forcedAlignment = forcedAlignment; + } + + public int getSize() { + return size; + } + + public int getAlignment() { + return alignment; + } + + public int getAlignment(int packAlignment) { + return forcedAlignment ? alignment : min(alignment, packAlignment); + } + } + + protected static class Layout extends Member { + final Member[] members; + + Layout(int size, int alignment, boolean forceAlignment, Member[] members) { + super(size, alignment, forceAlignment); + this.members = members; + } + + public int offsetof(int member) { + return members[member].offset; + } + } + + protected static Member __padding(int size, boolean condition) { + return __member(condition ? size : 0, 1); + } + + protected static Member __member(int size) { + return __member(size, size); + } + + protected static Member __member(int size, int alignment) { + return __member(size, alignment, false); + } + + protected static Member __member(int size, int alignment, boolean forceAlignment) { + return new Member(size, alignment, forceAlignment); + } + + protected static Member __array(int size, int length) { + return __array(size, size, length); + } + protected static Member __array(int size, int alignment, int length) { + return new Member(size * length, alignment, false); + } + protected static Member __array(int size, int alignment, boolean forceAlignment, int length) { + return new Member(size * length, alignment, forceAlignment); + } + + protected static Layout __union(Member... members) { return __union(DEFAULT_PACK_ALIGNMENT, DEFAULT_ALIGN_AS, members); } + protected static Layout __union(int packAlignment, int alignas, Member... members) { + List union = new ArrayList<>(members.length); + + int size = 0; + int alignment = alignas; + for (Member m : members) { + size = max(size, m.size); + alignment = max(alignment, m.getAlignment(packAlignment)); + + m.offset = 0; + union.add(m); + if (m instanceof Layout) { + addNestedMembers(m, union, 0); + } + } + + return new Layout(size, alignment, alignas != 0, union.toArray(new Member[0])); + } + + protected static Layout __struct(Member... members) { return __struct(DEFAULT_PACK_ALIGNMENT, DEFAULT_ALIGN_AS, members); } + protected static Layout __struct(int packAlignment, int alignas, Member... members) { + List struct = new ArrayList<>(members.length); + + int size = 0; + int alignment = alignas; + for (Member m : members) { + int memberAlignment = m.getAlignment(packAlignment); + + m.offset = align(size, memberAlignment); + + size = m.offset + m.size; + alignment = max(alignment, memberAlignment); + + struct.add(m); + if (m instanceof Layout) { + addNestedMembers(m, struct, m.offset); + } + } + + // tail padding + size = align(size, alignment); + + return new Layout(size, alignment, alignas != 0, struct.toArray(new Member[0])); + } + + private static void addNestedMembers(Member nested, List members, int offset) { + Layout layout = (Layout)nested; + + for (Member m : layout.members) { + m.offset += offset; + members.add(m); + } + } + + private static int align(int offset, int alignment) { + return ((offset - 1) | (alignment - 1)) + 1; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/StructBuffer.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/StructBuffer.java new file mode 100644 index 00000000..dbf9b39f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/StructBuffer.java @@ -0,0 +1,316 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import javax.annotation.*; +import java.nio.*; +import java.util.*; +import java.util.function.*; +import java.util.stream.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Base class of struct custom buffers. */ +public abstract class StructBuffer> extends CustomBuffer implements Iterable { + + protected StructBuffer(ByteBuffer container, int remaining) { + super(memAddress(container), container, -1, 0, remaining, remaining); + } + + protected StructBuffer(long address, @Nullable ByteBuffer container, int mark, int position, int limit, int capacity) { + super(address, container, mark, position, limit, capacity); + } + + @Override + public int sizeof() { + return getElementFactory().sizeof(); + } + + /** + * Relative get method. Reads the struct at this buffer's current position, and then increments the position. + * + *

The struct instance returned is a view of the buffer at the current position. Changes to this buffer's content will be visible in the struct instance + * and vice versa.

+ * + * @return the struct at the buffer's current position + * + * @throws BufferUnderflowException If the buffer's current position is not smaller than its limit + */ + public T get() { + return getElementFactory().wrap(address, nextGetIndex(), container); + } + + /** + * Relative get method. Reads the struct data at this buffer's current position into the specified struct, and then increments the position. + * + * @return the struct at the buffer's current position + * + * @throws BufferUnderflowException If the buffer's current position is not smaller than its limit + */ + public SELF get(T value) { + int sizeof = getElementFactory().sizeof(); + memCopy(address + Integer.toUnsignedLong(nextGetIndex()) * sizeof, value.address(), sizeof); + return self(); + } + + /** + * Relative put method  (optional operation). + * + *

Writes the specified struct into this buffer at the current position, and then increments the position.

+ * + * @param value the struct to be written + * + * @return This buffer + * + * @throws BufferOverflowException If this buffer's current position is not smaller than its limit + * @throws ReadOnlyBufferException If this buffer is read-only + */ + public SELF put(T value) { + int sizeof = getElementFactory().sizeof(); + memCopy(value.address(), address + Integer.toUnsignedLong(nextPutIndex()) * sizeof, sizeof); + return self(); + } + + /** + * Absolute get method. Reads the struct at the specified index. + * + *

The struct instance returned is a view of the buffer at the specified position. Changes to this buffer's content will be visible in the struct + * instance and vice versa.

+ * + * @param index the index from which the struct will be read + * + * @return the struct at the specified index + * + * @throws IndexOutOfBoundsException If {@code index} is negative or not smaller than the buffer's limit + */ + public T get(int index) { + return getElementFactory().wrap(address, check(index, limit), container); + } + + /** + * Absolute get method. Reads the struct data at the specified index into the specified struct. + * + * @param index the index from which the struct will be read + * + * @return the struct at the specified index + * + * @throws IndexOutOfBoundsException If {@code index} is negative or not smaller than the buffer's limit + */ + public SELF get(int index, T value) { + int sizeof = getElementFactory().sizeof(); + memCopy(address + Checks.check(index, limit) * sizeof, value.address(), sizeof); + return self(); + } + + /** + * Absolute put method  (optional operation). + * + *

Writes the specified struct into this buffer at the specified index.

+ * + * @param index the index at which the struct will be written + * @param value the struct value to be written + * + * @return This buffer + * + * @throws IndexOutOfBoundsException If {@code index} is negative or not smaller than the buffer's limit + * @throws ReadOnlyBufferException If this buffer is read-only + */ + public SELF put(int index, T value) { + int sizeof = getElementFactory().sizeof(); + memCopy(value.address(), address + Checks.check(index, limit) * sizeof, sizeof); + return self(); + } + + /** + * Relative apply method. + * + *

Passes the struct at the buffer's current position to the specified {@link Consumer}, and then increments the position.

+ * + * @return This buffer + * + * @throws BufferUnderflowException If the buffer's current position is not smaller than its limit + */ + public SELF apply(Consumer consumer) { + consumer.accept(get()); + return self(); + } + + /** + * Absolute apply method. + * + *

Passes the struct at the specified position to the specified {@link Consumer}.

+ * + * @param index the index where the {@code consumer} will be applied. + * + * @return This buffer + * + * @throws IndexOutOfBoundsException If {@code index} is negative or not smaller than the buffer's limit + */ + public SELF apply(int index, Consumer consumer) { + consumer.accept(get(index)); + return self(); + } + + // -------------------------------------- + + @Override + public Iterator iterator() { + return new StructIterator<>(address, container, getElementFactory(), position, limit); + } + + // This class is static to avoid capturing the StructBuffer instance. Hotspot trivially marks the instance + // as escaping when this happens, even if the iterator instance is not escaping and scalar replaced. This + // is not a problem on Graal. Also, see JDK-8166840. + private static class StructIterator> implements Iterator { + private long address; + + @Nullable + private ByteBuffer container; + + private T factory; + + private int index; + private int fence; + + StructIterator(long address, @Nullable ByteBuffer container, T factory, int position, int limit) { + this.address = address; + this.container = container; + this.factory = factory; + this.index = position; + this.fence = limit; + } + + @Override public boolean hasNext() { + return index < fence; + } + + @Override public T next() { + if (CHECKS && fence <= index) { + throw new NoSuchElementException(); + } + return factory.wrap(address, index++, container); + } + + @Override public void forEachRemaining(Consumer action) { + Objects.requireNonNull(action); + int i = index; + try { + for (; i < fence; i++) { + action.accept(factory.wrap(address, i, container)); + } + } finally { + index = i; + } + } + } + + @Override + public void forEach(Consumer action) { + Objects.requireNonNull(action); + T factory = getElementFactory(); + for (int i = position, fence = limit; i < fence; i++) { + action.accept(factory.wrap(address, i, container)); + } + } + + @Override + public Spliterator spliterator() { + return new StructSpliterator<>(address, container, getElementFactory(), position, limit); + } + + private static class StructSpliterator> implements Spliterator { + private long address; + + @Nullable + private ByteBuffer container; + + private T factory; + + private int index; + private int fence; + + StructSpliterator(long address, @Nullable ByteBuffer container, T factory, int position, int limit) { + this.address = address; + this.container = container; + this.factory = factory; + this.index = position; + this.fence = limit; + } + + @Override + public boolean tryAdvance(Consumer action) { + Objects.requireNonNull(action); + + if (index < fence) { + action.accept(factory.wrap(address, index++, container)); + return true; + } + + return false; + } + + @Override + @Nullable + public Spliterator trySplit() { + int lo = index, + mid = (lo + fence) >>> 1; + + return lo < mid + ? new StructSpliterator<>(address, container, factory, lo, index = mid) + : null; + } + + @Override + public long estimateSize() { + return fence - index; + } + + @Override + public int characteristics() { + return Spliterator.ORDERED | Spliterator.IMMUTABLE | Spliterator.NONNULL | Spliterator.SIZED | Spliterator.SUBSIZED; + } + + @Override + public void forEachRemaining(Consumer action) { + Objects.requireNonNull(action); + int i = index; + try { + for (; i < fence; i++) { + action.accept(factory.wrap(address, i, container)); + } + } finally { + index = i; + } + } + + @Override + public Comparator getComparator() { + throw new IllegalStateException(); + } + } + + /** Returns a sequential {@code Stream} with this struct buffer as its source. */ + public Stream stream() { + return StreamSupport.stream(spliterator(), false); + } + + /** Returns a parallel {@code Stream} with this struct buffer as its source. */ + public Stream parallelStream() { + return StreamSupport.stream(spliterator(), true); + } + + // -------------------------------------- + + protected abstract T getElementFactory(); + + private static int check(int index, int length) { + if (CHECKS && (index < 0 || length <= index)) { + throw new IndexOutOfBoundsException(); + } + return index; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/ThreadLocalUtil.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/ThreadLocalUtil.java new file mode 100644 index 00000000..ba79034b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/ThreadLocalUtil.java @@ -0,0 +1,228 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system; + +import org.lwjgl.*; + +import javax.annotation.*; +import java.lang.reflect.*; +import java.util.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.Pointer.*; +import static org.lwjgl.system.jni.JNINativeInterface.*; + +/** This class supports bindings with thread-local contexts. [INTERNAL USE ONLY] */ +public final class ThreadLocalUtil { + + /* + The following applies to GL and GLES only: + + OpenGL contexts may have different capabilities (core versions, supported extensions, deprecated functionality) and different function pointers (usually + in multi-GPU setups). A ThreadLocal is used to store the current capabilities instance for each thread. The thread-local lookup that is required for each + function call hurts JIT code generation. We employ two strategies to eliminate this overhead: + + 1) The first capabilities instance encountered is stored in a static write-once holder. This is optimistically assumed to be compatible with all other (if + any) instances we encounter, which is indeed the case for the vast majority of programs. If an incompatible instance is encountered, there is a fall back + to the thread-local lookup. + + The above is applicable to methods with Critical Natives (i.e. array overloads). All other methods use the following technique: + + 2) The function pointers of a capabilities instance are stored in an off-heap array, which is then stored in one of the reserved members of the + jniNativeInterface struct. This struct is then injected to the Hotspot native thread that corresponds to the Java thread in which the capabilities instance + was made current. When a JNI method is invoked in that thread, it passes its JNIEnv copy to the JNI function, which can then retrieve the correct function + pointer. + + It works like so: + + typedef struct JNINativeInterface_ { + void *reserved0; + void *reserved1; + void *reserved2; + void *reserved3; + + // JNI function pointers + } jniNativeInterface; + + typedef const jniNativeInterface *JNIEnv; + + // Hotspot C++ class + class JavaThread: public Thread { + ... + JNIEnv _jni_environment; + JNIEnv* jni_environment() { return &_jni_environment; } + .. + } + + The injection works because what we get in the JNI function is not a direct pointer to the struct, but a pointer to the JavaThread field that contains the + pointer to the struct. + + Note that all threads point to the same jniNativeInterface struct. Also note that even though reserved0-3 is public API, the size of the struct is not + known. New Java versions may add new function pointers at the end of the struct. JVMTI's GetJNIFunctionTable function could be used to return a valid copy, + but JVMTI is an optional JVM feature and may not be available (e.g. with AOT compilation). The workaround is to call JNI's GetVersion and assume the struct + has as many function pointers as were available in the corresponding JNI version. + + - On startup, a pointer to the global jniNativeInterface is stored. + - On setCapabilities: + * If necessary, a jniNativeInterface copy is created and injected to the current thread (JavaThread::_jni_environment points to the copy). + * A pointer to the capabilities function pointer array is set to jniNativeInterface::reserved3. + - On setCapabilities(null): + * JavaThread::_jni_environment is reset to the global jniNativeInterface. + * The jniNativeInterface copy is freed. + + The above has the following advantages: + + - Eliminates the thread-local lookup. + - Less bytecode and perfectly clean JITed code. + - Works when different threads have incompatible contexts. + + And the following disadvantages: + + - Depends on Hotspot implementation details. + - Requires custom JNI code for each function. + - (minor) Function pointers are not checked anymore. Calling an unsupported function causes a segfault. + - (minor) Critical Natives cannot use it, there's no JNIEnv* parameter. + - (minor) JVMTI has the ability to intercept JNI functions with SetJNIFunctionTable. This interacts badly with the jniNativeInterface copies, but it should + be easy to workaround (attaching the agent at startup, making sure no contexts are current when the agent is attached, clearing and setting again the + capabilities instance). + */ + + /** The global JNIEnv. */ + private static final long JNI_NATIVE_INTERFACE = getThreadJNIEnv(); + + /** A function to delegate to when an unsupported function is called. */ + private static final long FUNCTION_MISSING_ABORT = getFunctionMissingAbort(); + + private static final long SIZE_OF_JNI_NATIVE_INTERFACE; + + static { + int JNI_VERSION = GetVersion(); + + int reservedCount; + switch (JNI_VERSION) { + case JNI_VERSION_1_1: + reservedCount = 12; + break; + default: + reservedCount = 4; + } + + int jniCallCount; + switch (JNI_VERSION) { + case JNI_VERSION_1_1: + jniCallCount = 208; + break; + case JNI_VERSION_1_2: + jniCallCount = 225; + break; + case JNI_VERSION_1_4: + jniCallCount = 228; + break; + case JNI_VERSION_1_6: + case JNI_VERSION_1_8: + jniCallCount = 229; + break; + case JNI_VERSION_9: + case JNI_VERSION_10: + jniCallCount = 230; + break; + default: + jniCallCount = 230; + DEBUG_STREAM + .println("[LWJGL] [ThreadLocalUtil] Unsupported JNI version detected, this may result in a crash. Please inform LWJGL developers."); + } + SIZE_OF_JNI_NATIVE_INTERFACE = Integer.toUnsignedLong((reservedCount + jniCallCount)) * POINTER_SIZE; + } + + private ThreadLocalUtil() { + } + + private static native long getThreadJNIEnv(); + + private static native void setThreadJNIEnv(long JNIEnv); + + private static native long getFunctionMissingAbort(); + + public static void setEnv(long capabilities, int index) { + if (index < 0 || 3 < index) { // reserved0-3 + throw new IndexOutOfBoundsException(); + } + + // Get thread's JNIEnv + long env = getThreadJNIEnv(); + + if (capabilities == NULL) { + if (env != JNI_NATIVE_INTERFACE) { + setThreadJNIEnv(JNI_NATIVE_INTERFACE); + nmemFree(env); + } + } else { + if (env == JNI_NATIVE_INTERFACE) { + long newEnv = nmemAllocChecked(SIZE_OF_JNI_NATIVE_INTERFACE); + memCopy(env, newEnv, SIZE_OF_JNI_NATIVE_INTERFACE); + setThreadJNIEnv(env = newEnv); + } + + memPutAddress(env + Integer.toUnsignedLong(index) * POINTER_SIZE, capabilities); + } + } + + private static List getFieldsFromCapabilities(Class capabilitiesClass) { + List fields = new ArrayList<>(); + for (Field field : capabilitiesClass.getFields()) { + if (field.getType() == long.class) { + fields.add(field); + } + } + return fields; + } + + // Ensures FUNCTION_MISSING_ABORT will be called even if no context is current, + public static void setFunctionMissingAddresses(@Nullable Class capabilitiesClass, int index) { + if (capabilitiesClass == null) { + long missingCaps = memGetAddress(JNI_NATIVE_INTERFACE + Integer.toUnsignedLong(index) * POINTER_SIZE); + if (missingCaps != NULL) { + getAllocator().free(missingCaps); + memPutAddress(JNI_NATIVE_INTERFACE + Integer.toUnsignedLong(index) * POINTER_SIZE, NULL); + } + } else { + int functionCount = getFieldsFromCapabilities(capabilitiesClass).size(); + + long missingCaps = getAllocator().malloc(Integer.toUnsignedLong(functionCount) * POINTER_SIZE); + for (int i = 0; i < functionCount; i++) { + memPutAddress(missingCaps + Integer.toUnsignedLong(i) * POINTER_SIZE, FUNCTION_MISSING_ABORT); + } + + memPutAddress(JNI_NATIVE_INTERFACE + Integer.toUnsignedLong(index) * POINTER_SIZE, missingCaps); + } + } + + public static PointerBuffer getAddressesFromCapabilities(Object caps) { + List fields = getFieldsFromCapabilities(caps.getClass()); + PointerBuffer addresses = BufferUtils.createPointerBuffer(fields.size()); + + try { + for (int i = 0; i < fields.size(); i++) { + long a = fields.get(i).getLong(caps); + addresses.put(i, a != NULL ? a : FUNCTION_MISSING_ABORT); + } + } catch (IllegalAccessException e) { + throw new RuntimeException(e); + } + + return addresses; + } + + public static boolean areCapabilitiesDifferent(PointerBuffer ref, PointerBuffer caps) { + for (int i = 0; i < ref.remaining(); i++) { + if (ref.get(i) != caps.get(i) && caps.get(i) != NULL) { + return true; + } + } + return false; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/dyncall/DynCall.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/dyncall/DynCall.java new file mode 100644 index 00000000..f824fb55 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/dyncall/DynCall.java @@ -0,0 +1,789 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.dyncall; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to \"dyncall.h\". + * + *

The dyncall library encapsulates architecture-, OS- and compiler-specific function call semantics in a virtual "bind argument parameters from left to + * right and then call" interface allowing programmers to call C functions in a completely dynamic manner.

+ * + *

In other words, instead of calling a function directly, the dyncall library provides a mechanism to push the function parameters manually and to issue + * the call afterwards.

+ * + *

Since the idea behind this concept is similar to call dispatching mechanisms of virtual machines, the object that can be dynamically loaded with + * arguments, and then used to actually invoke the call, is called {@code CallVM}. It is possible to change the calling convention used by the + * {@code CallVM} at run-time. Due to the fact that nearly every platform comes with one or more distinct calling conventions, the dyncall library project + * intends to be a portable and open-source approach to the variety of compiler-specific binary interfaces, platform specific subtleties, and so on...

+ */ +public class DynCall { + + /** Supported calling convention modes. */ + public static final int + DC_CALL_C_DEFAULT = 0, + DC_CALL_C_ELLIPSIS = 100, + DC_CALL_C_ELLIPSIS_VARARGS = 101, + DC_CALL_C_X86_CDECL = 1, + DC_CALL_C_X86_WIN32_STD = 2, + DC_CALL_C_X86_WIN32_FAST_MS = 3, + DC_CALL_C_X86_WIN32_FAST_GNU = 4, + DC_CALL_C_X86_WIN32_THIS_MS = 5, + DC_CALL_C_X86_WIN32_THIS_GNU = 6, + DC_CALL_C_X64_WIN64 = 7, + DC_CALL_C_X64_SYSV = 8, + DC_CALL_C_PPC32_DARWIN = 9, + DC_CALL_C_PPC32_OSX = DC_CALL_C_PPC32_DARWIN, + DC_CALL_C_ARM_ARM_EABI = 10, + DC_CALL_C_ARM_THUMB_EABI = 11, + DC_CALL_C_ARM_ARMHF = 30, + DC_CALL_C_MIPS32_EABI = 12, + DC_CALL_C_PPC32_SYSV = 13, + DC_CALL_C_PPC32_LINUX = DC_CALL_C_PPC32_SYSV, + DC_CALL_C_ARM_ARM = 14, + DC_CALL_C_ARM_THUMB = 15, + DC_CALL_C_MIPS32_O32 = 16, + DC_CALL_C_MIPS64_N32 = 17, + DC_CALL_C_MIPS64_N64 = 18, + DC_CALL_C_X86_PLAN9 = 19, + DC_CALL_C_SPARC32 = 20, + DC_CALL_C_SPARC64 = 21, + DC_CALL_C_ARM64 = 22, + DC_CALL_C_PPC64 = 23, + DC_CALL_C_PPC64_LINUX = DC_CALL_C_PPC64, + DC_CALL_SYS_DEFAULT = 200, + DC_CALL_SYS_X86_INT80H_LINUX = 201, + DC_CALL_SYS_X86_INT80H_BSD = 202, + DC_CALL_SYS_PPC32 = 210, + DC_CALL_SYS_PPC64 = 211; + + /** Error codes. */ + public static final int + DC_ERROR_NONE = 0, + DC_ERROR_UNSUPPORTED_MODE = -1; + + /** Boolean values. */ + public static final int + DC_TRUE = 1, + DC_FALSE = 0; + + /** Signatures. */ + public static final char + DC_SIGCHAR_VOID = 'v', + DC_SIGCHAR_BOOL = 'B', + DC_SIGCHAR_CHAR = 'c', + DC_SIGCHAR_UCHAR = 'C', + DC_SIGCHAR_SHORT = 's', + DC_SIGCHAR_USHORT = 'S', + DC_SIGCHAR_INT = 'i', + DC_SIGCHAR_UINT = 'I', + DC_SIGCHAR_LONG = 'j', + DC_SIGCHAR_ULONG = 'J', + DC_SIGCHAR_LONGLONG = 'l', + DC_SIGCHAR_ULONGLONG = 'L', + DC_SIGCHAR_FLOAT = 'f', + DC_SIGCHAR_DOUBLE = 'd', + DC_SIGCHAR_POINTER = 'p', + DC_SIGCHAR_STRING = 'Z', + DC_SIGCHAR_STRUCT = 'T', + DC_SIGCHAR_ENDARG = ')'; + + static { Library.initialize(); } + + protected DynCall() { + throw new UnsupportedOperationException(); + } + + // --- [ dcNewCallVM ] --- + + /** + * Creates a new {@code CallVM} object. + * + *

Use {@link #dcFree Free} to destroy the {@code CallVM} object.

+ * + * @param size the max size of the internal stack that will be allocated and used to bind arguments to + */ + @NativeType("DCCallVM *") + public static native long dcNewCallVM(@NativeType("DCsize") long size); + + // --- [ dcFree ] --- + + /** Unsafe version of: {@link #dcFree Free} */ + public static native void ndcFree(long vm); + + /** + * Frees a {@code CallVM} object. + * + * @param vm a {@code CallVM} instance + */ + public static void dcFree(@NativeType("DCCallVM *") long vm) { + if (CHECKS) { + check(vm); + } + ndcFree(vm); + } + + // --- [ dcReset ] --- + + /** Unsafe version of: {@link #dcReset Reset} */ + public static native void ndcReset(long vm); + + /** + * Resets the internal stack of arguments and prepares it for a new call. This function should be called after setting the call mode (using {@link #dcMode Mode}), but + * prior to binding arguments to the {@code CallVM}. Use it also when reusing a {@code CallVM}, as arguments don’t get flushed automatically after a + * function call invocation. + * + *

Note: you should also call this function after initial creation of the a {@code CallVM} object, as {@link #dcNewCallVM NewCallVM} doesn’t do this, implicitly.

+ * + * @param vm a {@code CallVM} instance + */ + public static void dcReset(@NativeType("DCCallVM *") long vm) { + if (CHECKS) { + check(vm); + } + ndcReset(vm); + } + + // --- [ dcMode ] --- + + /** Unsafe version of: {@link #dcMode Mode} */ + public static native void ndcMode(long vm, int mode); + + /** + * Sets the calling convention to use. + * + *

{@link #DC_CALL_C_DEFAULT CALL_C_DEFAULT} is the default standard C call on the target platform. It uses the standard C calling convention. {@link #DC_CALL_C_ELLIPSIS CALL_C_ELLIPSIS} is used for C + * ellipsis calls which allow to build up a variable argument list. On many platforms, there is only one C calling convention. The X86 platform provides a + * rich family of different calling conventions.

+ * + * @param vm a {@code CallVM} instance + * @param mode the calling convention. One of:
{@link #DC_CALL_C_DEFAULT CALL_C_DEFAULT}{@link #DC_CALL_C_ELLIPSIS CALL_C_ELLIPSIS}{@link #DC_CALL_C_ELLIPSIS_VARARGS CALL_C_ELLIPSIS_VARARGS}{@link #DC_CALL_C_X86_CDECL CALL_C_X86_CDECL}
{@link #DC_CALL_C_X86_WIN32_STD CALL_C_X86_WIN32_STD}{@link #DC_CALL_C_X86_WIN32_FAST_MS CALL_C_X86_WIN32_FAST_MS}{@link #DC_CALL_C_X86_WIN32_FAST_GNU CALL_C_X86_WIN32_FAST_GNU}{@link #DC_CALL_C_X86_WIN32_THIS_MS CALL_C_X86_WIN32_THIS_MS}
{@link #DC_CALL_C_X86_WIN32_THIS_GNU CALL_C_X86_WIN32_THIS_GNU}{@link #DC_CALL_C_X64_WIN64 CALL_C_X64_WIN64}{@link #DC_CALL_C_X64_SYSV CALL_C_X64_SYSV}{@link #DC_CALL_C_PPC32_DARWIN CALL_C_PPC32_DARWIN}
{@link #DC_CALL_C_PPC32_OSX CALL_C_PPC32_OSX}{@link #DC_CALL_C_ARM_ARM_EABI CALL_C_ARM_ARM_EABI}{@link #DC_CALL_C_ARM_THUMB_EABI CALL_C_ARM_THUMB_EABI}{@link #DC_CALL_C_ARM_ARMHF CALL_C_ARM_ARMHF}
{@link #DC_CALL_C_MIPS32_EABI CALL_C_MIPS32_EABI}{@link #DC_CALL_C_PPC32_SYSV CALL_C_PPC32_SYSV}{@link #DC_CALL_C_PPC32_LINUX CALL_C_PPC32_LINUX}{@link #DC_CALL_C_ARM_ARM CALL_C_ARM_ARM}
{@link #DC_CALL_C_ARM_THUMB CALL_C_ARM_THUMB}{@link #DC_CALL_C_MIPS32_O32 CALL_C_MIPS32_O32}{@link #DC_CALL_C_MIPS64_N32 CALL_C_MIPS64_N32}{@link #DC_CALL_C_MIPS64_N64 CALL_C_MIPS64_N64}
{@link #DC_CALL_C_X86_PLAN9 CALL_C_X86_PLAN9}{@link #DC_CALL_C_SPARC32 CALL_C_SPARC32}{@link #DC_CALL_C_SPARC64 CALL_C_SPARC64}{@link #DC_CALL_C_ARM64 CALL_C_ARM64}
{@link #DC_CALL_C_PPC64 CALL_C_PPC64}{@link #DC_CALL_C_PPC64_LINUX CALL_C_PPC64_LINUX}{@link #DC_CALL_SYS_DEFAULT CALL_SYS_DEFAULT}{@link #DC_CALL_SYS_X86_INT80H_LINUX CALL_SYS_X86_INT80H_LINUX}
{@link #DC_CALL_SYS_X86_INT80H_BSD CALL_SYS_X86_INT80H_BSD}{@link #DC_CALL_SYS_PPC32 CALL_SYS_PPC32}{@link #DC_CALL_SYS_PPC64 CALL_SYS_PPC64}
+ */ + public static void dcMode(@NativeType("DCCallVM *") long vm, @NativeType("DCint") int mode) { + if (CHECKS) { + check(vm); + } + ndcMode(vm, mode); + } + + // --- [ dcArgBool ] --- + + /** Unsafe version of: {@link #dcArgBool ArgBool} */ + public static native void ndcArgBool(long vm, int value); + + /** + * Binds a {@code bool} argument. + * + * @param vm a {@code CallVM} instance + * @param value the argument value + */ + public static void dcArgBool(@NativeType("DCCallVM *") long vm, @NativeType("DCbool") boolean value) { + if (CHECKS) { + check(vm); + } + ndcArgBool(vm, value ? 1 : 0); + } + + // --- [ dcArgChar ] --- + + /** Unsafe version of: {@link #dcArgChar ArgChar} */ + public static native void ndcArgChar(long vm, byte value); + + /** + * Binds a {@code char} argument. + * + * @param vm a {@code CallVM} instance + * @param value the argument value + */ + public static void dcArgChar(@NativeType("DCCallVM *") long vm, @NativeType("DCchar") byte value) { + if (CHECKS) { + check(vm); + } + ndcArgChar(vm, value); + } + + // --- [ dcArgShort ] --- + + /** Unsafe version of: {@link #dcArgShort ArgShort} */ + public static native void ndcArgShort(long vm, short value); + + /** + * Binds a {@code short} argument. + * + * @param vm a {@code CallVM} instance + * @param value the argument value + */ + public static void dcArgShort(@NativeType("DCCallVM *") long vm, @NativeType("DCshort") short value) { + if (CHECKS) { + check(vm); + } + ndcArgShort(vm, value); + } + + // --- [ dcArgInt ] --- + + /** Unsafe version of: {@link #dcArgInt ArgInt} */ + public static native void ndcArgInt(long vm, int value); + + /** + * Binds an {@code int} argument. + * + * @param vm a {@code CallVM} instance + * @param value the argument value + */ + public static void dcArgInt(@NativeType("DCCallVM *") long vm, @NativeType("DCint") int value) { + if (CHECKS) { + check(vm); + } + ndcArgInt(vm, value); + } + + // --- [ dcArgLong ] --- + + /** Unsafe version of: {@link #dcArgLong ArgLong} */ + public static native void ndcArgLong(long vm, long value); + + /** + * Binds a {@code long} argument. + * + * @param vm a {@code CallVM} instance + * @param value the argument value + */ + public static void dcArgLong(@NativeType("DCCallVM *") long vm, @NativeType("DClong") long value) { + if (CHECKS) { + check(vm); + } + ndcArgLong(vm, value); + } + + // --- [ dcArgLongLong ] --- + + /** Unsafe version of: {@link #dcArgLongLong ArgLongLong} */ + public static native void ndcArgLongLong(long vm, long value); + + /** + * Binds a {@code long long} argument. + * + * @param vm a {@code CallVM} instance + * @param value the argument value + */ + public static void dcArgLongLong(@NativeType("DCCallVM *") long vm, @NativeType("DClonglong") long value) { + if (CHECKS) { + check(vm); + } + ndcArgLongLong(vm, value); + } + + // --- [ dcArgFloat ] --- + + /** Unsafe version of: {@link #dcArgFloat ArgFloat} */ + public static native void ndcArgFloat(long vm, float value); + + /** + * Binds a {@code float} argument. + * + * @param vm a {@code CallVM} instance + * @param value the argument value + */ + public static void dcArgFloat(@NativeType("DCCallVM *") long vm, @NativeType("DCfloat") float value) { + if (CHECKS) { + check(vm); + } + ndcArgFloat(vm, value); + } + + // --- [ dcArgDouble ] --- + + /** Unsafe version of: {@link #dcArgDouble ArgDouble} */ + public static native void ndcArgDouble(long vm, double value); + + /** + * Binds a {@code double} argument. + * + * @param vm a {@code CallVM} instance + * @param value the argument value + */ + public static void dcArgDouble(@NativeType("DCCallVM *") long vm, @NativeType("DCdouble") double value) { + if (CHECKS) { + check(vm); + } + ndcArgDouble(vm, value); + } + + // --- [ dcArgPointer ] --- + + /** Unsafe version of: {@link #dcArgPointer ArgPointer} */ + public static native void ndcArgPointer(long vm, long value); + + /** + * Binds a pointer argument. + * + * @param vm a {@code CallVM} instance + * @param value the argument value + */ + public static void dcArgPointer(@NativeType("DCCallVM *") long vm, @NativeType("DCpointer") long value) { + if (CHECKS) { + check(vm); + } + ndcArgPointer(vm, value); + } + + // --- [ dcArgStruct ] --- + + /** Unsafe version of: {@link #dcArgStruct ArgStruct} */ + public static native void ndcArgStruct(long vm, long s, long value); + + /** + * Binds a struct argument. + * + * @param vm a {@code CallVM} instance + * @param value the argument value + */ + public static void dcArgStruct(@NativeType("DCCallVM *") long vm, @NativeType("DCstruct *") long s, @NativeType("DCpointer") long value) { + if (CHECKS) { + check(vm); + check(s); + check(value); + } + ndcArgStruct(vm, s, value); + } + + // --- [ dcCallVoid ] --- + + /** Unsafe version of: {@link #dcCallVoid CallVoid} */ + public static native void ndcCallVoid(long vm, long funcptr); + + /** + * Calls the function specified by {@code funcptr} with the arguments bound to the {@code CallVM} and returns. + * + *

After the invocation of the foreign function call, the argument values are still bound and a second call using the same arguments can be issued. If you + * need to clear the argument bindings, you have to reset the {@code CallVM}.

+ * + * @param vm a {@code CallVM} instance + * @param funcptr the function pointer + */ + @NativeType("DCvoid") + public static void dcCallVoid(@NativeType("DCCallVM *") long vm, @NativeType("DCpointer") long funcptr) { + if (CHECKS) { + check(vm); + check(funcptr); + } + ndcCallVoid(vm, funcptr); + } + + // --- [ dcCallBool ] --- + + /** Unsafe version of: {@link #dcCallBool CallBool} */ + public static native int ndcCallBool(long vm, long funcptr); + + /** + * Calls the function specified by {@code funcptr} with the arguments bound to the {@code CallVM} and returns. + * + *

After the invocation of the foreign function call, the argument values are still bound and a second call using the same arguments can be issued. If you + * need to clear the argument bindings, you have to reset the {@code CallVM}.

+ * + * @param vm a {@code CallVM} instance + * @param funcptr the function pointer + */ + @NativeType("DCbool") + public static boolean dcCallBool(@NativeType("DCCallVM *") long vm, @NativeType("DCpointer") long funcptr) { + if (CHECKS) { + check(vm); + check(funcptr); + } + return ndcCallBool(vm, funcptr) != 0; + } + + // --- [ dcCallChar ] --- + + /** Unsafe version of: {@link #dcCallChar CallChar} */ + public static native byte ndcCallChar(long vm, long funcptr); + + /** + * Calls the function specified by {@code funcptr} with the arguments bound to the {@code CallVM} and returns. + * + *

After the invocation of the foreign function call, the argument values are still bound and a second call using the same arguments can be issued. If you + * need to clear the argument bindings, you have to reset the {@code CallVM}.

+ * + * @param vm a {@code CallVM} instance + * @param funcptr the function pointer + */ + @NativeType("DCchar") + public static byte dcCallChar(@NativeType("DCCallVM *") long vm, @NativeType("DCpointer") long funcptr) { + if (CHECKS) { + check(vm); + check(funcptr); + } + return ndcCallChar(vm, funcptr); + } + + // --- [ dcCallShort ] --- + + /** Unsafe version of: {@link #dcCallShort CallShort} */ + public static native short ndcCallShort(long vm, long funcptr); + + /** + * Calls the function specified by {@code funcptr} with the arguments bound to the {@code CallVM} and returns. + * + *

After the invocation of the foreign function call, the argument values are still bound and a second call using the same arguments can be issued. If you + * need to clear the argument bindings, you have to reset the {@code CallVM}.

+ * + * @param vm a {@code CallVM} instance + * @param funcptr the function pointer + */ + @NativeType("DCshort") + public static short dcCallShort(@NativeType("DCCallVM *") long vm, @NativeType("DCpointer") long funcptr) { + if (CHECKS) { + check(vm); + check(funcptr); + } + return ndcCallShort(vm, funcptr); + } + + // --- [ dcCallInt ] --- + + /** Unsafe version of: {@link #dcCallInt CallInt} */ + public static native int ndcCallInt(long vm, long funcptr); + + /** + * Calls the function specified by {@code funcptr} with the arguments bound to the {@code CallVM} and returns. + * + *

After the invocation of the foreign function call, the argument values are still bound and a second call using the same arguments can be issued. If you + * need to clear the argument bindings, you have to reset the {@code CallVM}.

+ * + * @param vm a {@code CallVM} instance + * @param funcptr the function pointer + */ + @NativeType("DCint") + public static int dcCallInt(@NativeType("DCCallVM *") long vm, @NativeType("DCpointer") long funcptr) { + if (CHECKS) { + check(vm); + check(funcptr); + } + return ndcCallInt(vm, funcptr); + } + + // --- [ dcCallLong ] --- + + /** Unsafe version of: {@link #dcCallLong CallLong} */ + public static native long ndcCallLong(long vm, long funcptr); + + /** + * Calls the function specified by {@code funcptr} with the arguments bound to the {@code CallVM} and returns. + * + *

After the invocation of the foreign function call, the argument values are still bound and a second call using the same arguments can be issued. If you + * need to clear the argument bindings, you have to reset the {@code CallVM}.

+ * + * @param vm a {@code CallVM} instance + * @param funcptr the function pointer + */ + @NativeType("DClong") + public static long dcCallLong(@NativeType("DCCallVM *") long vm, @NativeType("DCpointer") long funcptr) { + if (CHECKS) { + check(vm); + check(funcptr); + } + return ndcCallLong(vm, funcptr); + } + + // --- [ dcCallLongLong ] --- + + /** Unsafe version of: {@link #dcCallLongLong CallLongLong} */ + public static native long ndcCallLongLong(long vm, long funcptr); + + /** + * Calls the function specified by {@code funcptr} with the arguments bound to the {@code CallVM} and returns. + * + *

After the invocation of the foreign function call, the argument values are still bound and a second call using the same arguments can be issued. If you + * need to clear the argument bindings, you have to reset the {@code CallVM}.

+ * + * @param vm a {@code CallVM} instance + * @param funcptr the function pointer + */ + @NativeType("DClonglong") + public static long dcCallLongLong(@NativeType("DCCallVM *") long vm, @NativeType("DCpointer") long funcptr) { + if (CHECKS) { + check(vm); + check(funcptr); + } + return ndcCallLongLong(vm, funcptr); + } + + // --- [ dcCallFloat ] --- + + /** Unsafe version of: {@link #dcCallFloat CallFloat} */ + public static native float ndcCallFloat(long vm, long funcptr); + + /** + * Calls the function specified by {@code funcptr} with the arguments bound to the {@code CallVM} and returns. + * + *

After the invocation of the foreign function call, the argument values are still bound and a second call using the same arguments can be issued. If you + * need to clear the argument bindings, you have to reset the {@code CallVM}.

+ * + * @param vm a {@code CallVM} instance + * @param funcptr the function pointer + */ + @NativeType("DCfloat") + public static float dcCallFloat(@NativeType("DCCallVM *") long vm, @NativeType("DCpointer") long funcptr) { + if (CHECKS) { + check(vm); + check(funcptr); + } + return ndcCallFloat(vm, funcptr); + } + + // --- [ dcCallDouble ] --- + + /** Unsafe version of: {@link #dcCallDouble CallDouble} */ + public static native double ndcCallDouble(long vm, long funcptr); + + /** + * Calls the function specified by {@code funcptr} with the arguments bound to the {@code CallVM} and returns. + * + *

After the invocation of the foreign function call, the argument values are still bound and a second call using the same arguments can be issued. If you + * need to clear the argument bindings, you have to reset the {@code CallVM}.

+ * + * @param vm a {@code CallVM} instance + * @param funcptr the function pointer + */ + @NativeType("DCdouble") + public static double dcCallDouble(@NativeType("DCCallVM *") long vm, @NativeType("DCpointer") long funcptr) { + if (CHECKS) { + check(vm); + check(funcptr); + } + return ndcCallDouble(vm, funcptr); + } + + // --- [ dcCallPointer ] --- + + /** Unsafe version of: {@link #dcCallPointer CallPointer} */ + public static native long ndcCallPointer(long vm, long funcptr); + + /** + * Calls the function specified by {@code funcptr} with the arguments bound to the {@code CallVM} and returns. + * + *

After the invocation of the foreign function call, the argument values are still bound and a second call using the same arguments can be issued. If you + * need to clear the argument bindings, you have to reset the {@code CallVM}.

+ * + * @param vm a {@code CallVM} instance + * @param funcptr the function pointer + */ + @NativeType("DCpointer") + public static long dcCallPointer(@NativeType("DCCallVM *") long vm, @NativeType("DCpointer") long funcptr) { + if (CHECKS) { + check(vm); + check(funcptr); + } + return ndcCallPointer(vm, funcptr); + } + + // --- [ dcCallStruct ] --- + + /** Unsafe version of: {@link #dcCallStruct CallStruct} */ + public static native void ndcCallStruct(long vm, long funcptr, long s, long returnValue); + + /** + * Calls the function specified by {@code funcptr} with the arguments bound to the {@code CallVM} and returns. + * + *

After the invocation of the foreign function call, the argument values are still bound and a second call using the same arguments can be issued. If you + * need to clear the argument bindings, you have to reset the {@code CallVM}.

+ * + * @param vm a {@code CallVM} instance + * @param funcptr the function pointer + */ + public static void dcCallStruct(@NativeType("DCCallVM *") long vm, @NativeType("DCpointer") long funcptr, @NativeType("DCstruct *") long s, @NativeType("DCpointer") long returnValue) { + if (CHECKS) { + check(vm); + check(funcptr); + check(s); + check(returnValue); + } + ndcCallStruct(vm, funcptr, s, returnValue); + } + + // --- [ dcGetError ] --- + + /** Unsafe version of: {@link #dcGetError GetError} */ + public static native int ndcGetError(long vm); + + /** + * Returns the most recent error state code. + * + * @param vm a {@code CallVM} instance + */ + @NativeType("DCint") + public static int dcGetError(@NativeType("DCCallVM *") long vm) { + if (CHECKS) { + check(vm); + } + return ndcGetError(vm); + } + + // --- [ dcNewStruct ] --- + + /** + * Creates a new struct type. + * + * @param fieldCount the number of fields + * @param alignment a custom struct alignment, or 0 to calculate automatically + */ + @NativeType("DCstruct *") + public static native long dcNewStruct(@NativeType("DCsize") long fieldCount, @NativeType("DCint") int alignment); + + // --- [ dcStructField ] --- + + /** Unsafe version of: {@link #dcStructField StructField} */ + public static native void ndcStructField(long s, int type, int alignment, long arrayLength); + + /** + * Adds a field to the specified struct. + * + * @param s the struct + * @param type the field type. One of:
{@link #DC_SIGCHAR_VOID SIGCHAR_VOID}{@link #DC_SIGCHAR_BOOL SIGCHAR_BOOL}{@link #DC_SIGCHAR_CHAR SIGCHAR_CHAR}{@link #DC_SIGCHAR_UCHAR SIGCHAR_UCHAR}{@link #DC_SIGCHAR_SHORT SIGCHAR_SHORT}{@link #DC_SIGCHAR_USHORT SIGCHAR_USHORT}
{@link #DC_SIGCHAR_INT SIGCHAR_INT}{@link #DC_SIGCHAR_UINT SIGCHAR_UINT}{@link #DC_SIGCHAR_LONG SIGCHAR_LONG}{@link #DC_SIGCHAR_ULONG SIGCHAR_ULONG}{@link #DC_SIGCHAR_LONGLONG SIGCHAR_LONGLONG}{@link #DC_SIGCHAR_ULONGLONG SIGCHAR_ULONGLONG}
{@link #DC_SIGCHAR_FLOAT SIGCHAR_FLOAT}{@link #DC_SIGCHAR_DOUBLE SIGCHAR_DOUBLE}{@link #DC_SIGCHAR_POINTER SIGCHAR_POINTER}{@link #DC_SIGCHAR_STRING SIGCHAR_STRING}{@link #DC_SIGCHAR_STRUCT SIGCHAR_STRUCT}{@link #DC_SIGCHAR_ENDARG SIGCHAR_ENDARG}
+ * @param alignment a custom field alignment, or 0 to calculate automatically + * @param arrayLength 1 or a higher value if the field is an array + */ + public static void dcStructField(@NativeType("DCstruct *") long s, @NativeType("DCint") int type, @NativeType("DCint") int alignment, @NativeType("DCsize") long arrayLength) { + if (CHECKS) { + check(s); + } + ndcStructField(s, type, alignment, arrayLength); + } + + // --- [ dcSubStruct ] --- + + /** Unsafe version of: {@link #dcSubStruct SubStruct} */ + public static native void ndcSubStruct(long s, long fieldCount, int alignment, long arrayLength); + + /** + * Adds a nested struct to the specified struct + * + * @param s the struct + * @param fieldCount the number of fields in the nested struct + * @param alignment a custom nested struct alignment, or 0 to calculate automatically + * @param arrayLength 1 or a higher value if the nested struct is an array + */ + public static void dcSubStruct(@NativeType("DCstruct *") long s, @NativeType("DCsize") long fieldCount, @NativeType("DCint") int alignment, @NativeType("DCsize") long arrayLength) { + if (CHECKS) { + check(s); + } + ndcSubStruct(s, fieldCount, alignment, arrayLength); + } + + // --- [ dcCloseStruct ] --- + + /** Unsafe version of: {@link #dcCloseStruct CloseStruct} */ + public static native void ndcCloseStruct(long s); + + /** + * Completes the struct definition. + * + * @param s the struct to close + */ + public static void dcCloseStruct(@NativeType("DCstruct *") long s) { + if (CHECKS) { + check(s); + } + ndcCloseStruct(s); + } + + // --- [ dcStructSize ] --- + + /** Unsafe version of: {@link #dcStructSize StructSize} */ + public static native long ndcStructSize(long s); + + /** + * Returns the size, in bytes, of the specified struct. + * + * @param s the struct + */ + @NativeType("DCsize") + public static long dcStructSize(@NativeType("DCstruct *") long s) { + if (CHECKS) { + check(s); + } + return ndcStructSize(s); + } + + // --- [ dcStructAlignment ] --- + + /** Unsafe version of: {@link #dcStructAlignment StructAlignment} */ + public static native long ndcStructAlignment(long s); + + /** + * Returns the alignment, in bytes, of the specified struct. + * + * @param s the struct + */ + @NativeType("DCsize") + public static long dcStructAlignment(@NativeType("DCstruct *") long s) { + if (CHECKS) { + check(s); + } + return ndcStructAlignment(s); + } + + // --- [ dcFreeStruct ] --- + + /** Unsafe version of: {@link #dcFreeStruct FreeStruct} */ + public static native void ndcFreeStruct(long s); + + /** + * Frees the specified struct object. + * + * @param s the struct to free + */ + public static void dcFreeStruct(@NativeType("DCstruct *") long s) { + if (CHECKS) { + check(s); + } + ndcFreeStruct(s); + } + + // --- [ dcDefineStruct ] --- + + /** Unsafe version of: {@link #dcDefineStruct DefineStruct} */ + public static native long ndcDefineStruct(long signature); + + /** + * Creates a new struct type using a signature string. + * + * @param signature the struct signature + */ + @NativeType("DCstruct *") + public static long dcDefineStruct(@NativeType("char const *") ByteBuffer signature) { + if (CHECKS) { + checkNT1(signature); + } + return ndcDefineStruct(memAddress(signature)); + } + + /** + * Creates a new struct type using a signature string. + * + * @param signature the struct signature + */ + @NativeType("DCstruct *") + public static long dcDefineStruct(@NativeType("char const *") CharSequence signature) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(signature, true); + long signatureEncoded = stack.getPointerAddress(); + return ndcDefineStruct(signatureEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/dyncall/DynCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/dyncall/DynCallback.java new file mode 100644 index 00000000..32ffa7b8 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/dyncall/DynCallback.java @@ -0,0 +1,422 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.dyncall; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to \"dyncall_callback.h\". + * + *

The dyncallback dyncall library has an interface to create callback objects, that can be passed to functions as callback arguments. In other words, a + * pointer to the callback object can be "called", directly. The callback handler then allows iterating dynamically over the arguments once called back.

+ */ +public class DynCallback { + + /** Callback signatures. */ + public static final char + DCB_SIGCHAR_CC_PREFIX = '_', + DCB_SIGCHAR_CC_ELLIPSIS = 'e', + DCB_SIGCHAR_CC_STDCALL = 's', + DCB_SIGCHAR_CC_FASTCALL_GNU = 'f', + DCB_SIGCHAR_CC_FASTCALL_MS = 'F', + DCB_SIGCHAR_CC_THISCALL_MS = '+'; + + static { Library.initialize(); } + + protected DynCallback() { + throw new UnsupportedOperationException(); + } + + // --- [ dcbNewCallback ] --- + + /** Unsafe version of: {@link #dcbNewCallback NewCallback} */ + public static native long ndcbNewCallback(long signature, long funcptr, long userdata); + + /** + * Creates and initializes a new {@code Callback} object. + * + *

Use {@link #dcbFreeCallback FreeCallback} to destroy the {@code Callback} object.

+ * + * @param signature the function signature of the function to mimic + * @param funcptr a pointer to a callback handler + * @param userdata a pointer to custom data that might be useful in the handler + */ + @NativeType("DCCallback *") + public static long dcbNewCallback(@NativeType("char const *") ByteBuffer signature, @NativeType("DCCallbackHandler *") long funcptr, @NativeType("void *") long userdata) { + if (CHECKS) { + checkNT1(signature); + check(funcptr); + check(userdata); + } + return ndcbNewCallback(memAddress(signature), funcptr, userdata); + } + + /** + * Creates and initializes a new {@code Callback} object. + * + *

Use {@link #dcbFreeCallback FreeCallback} to destroy the {@code Callback} object.

+ * + * @param signature the function signature of the function to mimic + * @param funcptr a pointer to a callback handler + * @param userdata a pointer to custom data that might be useful in the handler + */ + @NativeType("DCCallback *") + public static long dcbNewCallback(@NativeType("char const *") CharSequence signature, @NativeType("DCCallbackHandler *") long funcptr, @NativeType("void *") long userdata) { + if (CHECKS) { + check(funcptr); + check(userdata); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(signature, true); + long signatureEncoded = stack.getPointerAddress(); + return ndcbNewCallback(signatureEncoded, funcptr, userdata); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ dcbInitCallback ] --- + + /** Unsafe version of: {@link #dcbInitCallback InitCallback} */ + public static native void ndcbInitCallback(long pcb, long signature, long handler, long userdata); + + /** + * (Re)initializes a callback object. + * + * @param pcb the callback object + * @param signature the function signature of the function to mimic + * @param handler a pointer to a callback handler + * @param userdata a pointer to custom data that might be useful in the handler + */ + public static void dcbInitCallback(@NativeType("DCCallback *") long pcb, @NativeType("char const *") ByteBuffer signature, @NativeType("DCCallbackHandler *") long handler, @NativeType("void *") long userdata) { + if (CHECKS) { + check(pcb); + checkNT1(signature); + check(handler); + check(userdata); + } + ndcbInitCallback(pcb, memAddress(signature), handler, userdata); + } + + /** + * (Re)initializes a callback object. + * + * @param pcb the callback object + * @param signature the function signature of the function to mimic + * @param handler a pointer to a callback handler + * @param userdata a pointer to custom data that might be useful in the handler + */ + public static void dcbInitCallback(@NativeType("DCCallback *") long pcb, @NativeType("char const *") CharSequence signature, @NativeType("DCCallbackHandler *") long handler, @NativeType("void *") long userdata) { + if (CHECKS) { + check(pcb); + check(handler); + check(userdata); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(signature, true); + long signatureEncoded = stack.getPointerAddress(); + ndcbInitCallback(pcb, signatureEncoded, handler, userdata); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ dcbFreeCallback ] --- + + /** Unsafe version of: {@link #dcbFreeCallback FreeCallback} */ + public static native void ndcbFreeCallback(long pcb); + + /** + * Destroys and frees the callback object. + * + * @param pcb the callback object + */ + public static void dcbFreeCallback(@NativeType("DCCallback *") long pcb) { + if (CHECKS) { + check(pcb); + } + ndcbFreeCallback(pcb); + } + + // --- [ dcbGetUserData ] --- + + /** Unsafe version of: {@link #dcbGetUserData GetUserData} */ + public static native long ndcbGetUserData(long pcb); + + /** + * Returns a pointer to the {@code userdata} passed to the callback object on creation or initialization. + * + * @param pcb the callback object + */ + @NativeType("void *") + public static long dcbGetUserData(@NativeType("DCCallback *") long pcb) { + if (CHECKS) { + check(pcb); + } + return ndcbGetUserData(pcb); + } + + // --- [ dcbArgBool ] --- + + /** Unsafe version of: {@link #dcbArgBool ArgBool} */ + public static native int ndcbArgBool(long args); + + /** + * Returns the next {@code bool} argument. + * + * @param args the function arguments + */ + @NativeType("DCbool") + public static boolean dcbArgBool(@NativeType("DCArgs *") long args) { + if (CHECKS) { + check(args); + } + return ndcbArgBool(args) != 0; + } + + // --- [ dcbArgChar ] --- + + /** Unsafe version of: {@link #dcbArgChar ArgChar} */ + public static native byte ndcbArgChar(long args); + + /** + * Returns the next {@code char} argument. + * + * @param args the function arguments + */ + @NativeType("DCchar") + public static byte dcbArgChar(@NativeType("DCArgs *") long args) { + if (CHECKS) { + check(args); + } + return ndcbArgChar(args); + } + + // --- [ dcbArgShort ] --- + + /** Unsafe version of: {@link #dcbArgShort ArgShort} */ + public static native short ndcbArgShort(long args); + + /** + * Returns the next {@code short} argument. + * + * @param args the function arguments + */ + @NativeType("DCshort") + public static short dcbArgShort(@NativeType("DCArgs *") long args) { + if (CHECKS) { + check(args); + } + return ndcbArgShort(args); + } + + // --- [ dcbArgInt ] --- + + /** Unsafe version of: {@link #dcbArgInt ArgInt} */ + public static native int ndcbArgInt(long args); + + /** + * Returns the next {@code int} argument. + * + * @param args the function arguments + */ + @NativeType("DCint") + public static int dcbArgInt(@NativeType("DCArgs *") long args) { + if (CHECKS) { + check(args); + } + return ndcbArgInt(args); + } + + // --- [ dcbArgLong ] --- + + /** Unsafe version of: {@link #dcbArgLong ArgLong} */ + public static native long ndcbArgLong(long args); + + /** + * Returns the next {@code long} argument. + * + * @param args the function arguments + */ + @NativeType("DClong") + public static long dcbArgLong(@NativeType("DCArgs *") long args) { + if (CHECKS) { + check(args); + } + return ndcbArgLong(args); + } + + // --- [ dcbArgLongLong ] --- + + /** Unsafe version of: {@link #dcbArgLongLong ArgLongLong} */ + public static native long ndcbArgLongLong(long args); + + /** + * Returns the next {@code long long} argument. + * + * @param args the function arguments + */ + @NativeType("DClonglong") + public static long dcbArgLongLong(@NativeType("DCArgs *") long args) { + if (CHECKS) { + check(args); + } + return ndcbArgLongLong(args); + } + + // --- [ dcbArgUChar ] --- + + /** Unsafe version of: {@link #dcbArgUChar ArgUChar} */ + public static native byte ndcbArgUChar(long args); + + /** + * Returns the next {@code unsigned char} argument. + * + * @param args the function arguments + */ + @NativeType("DCchar") + public static byte dcbArgUChar(@NativeType("DCArgs *") long args) { + if (CHECKS) { + check(args); + } + return ndcbArgUChar(args); + } + + // --- [ dcbArgUShort ] --- + + /** Unsafe version of: {@link #dcbArgUShort ArgUShort} */ + public static native short ndcbArgUShort(long args); + + /** + * Returns the next {@code unsigned short} argument. + * + * @param args the function arguments + */ + @NativeType("DCshort") + public static short dcbArgUShort(@NativeType("DCArgs *") long args) { + if (CHECKS) { + check(args); + } + return ndcbArgUShort(args); + } + + // --- [ dcbArgUInt ] --- + + /** Unsafe version of: {@link #dcbArgUInt ArgUInt} */ + public static native int ndcbArgUInt(long args); + + /** + * Returns the next {@code unsigned int} argument. + * + * @param args the function arguments + */ + @NativeType("DCint") + public static int dcbArgUInt(@NativeType("DCArgs *") long args) { + if (CHECKS) { + check(args); + } + return ndcbArgUInt(args); + } + + // --- [ dcbArgULong ] --- + + /** Unsafe version of: {@link #dcbArgULong ArgULong} */ + public static native long ndcbArgULong(long args); + + /** + * Returns the next {@code unsigned long} argument. + * + * @param args the function arguments + */ + @NativeType("DClong") + public static long dcbArgULong(@NativeType("DCArgs *") long args) { + if (CHECKS) { + check(args); + } + return ndcbArgULong(args); + } + + // --- [ dcbArgULongLong ] --- + + /** Unsafe version of: {@link #dcbArgULongLong ArgULongLong} */ + public static native long ndcbArgULongLong(long args); + + /** + * Returns the next {@code unsigned long long} argument. + * + * @param args the function arguments + */ + @NativeType("DClonglong") + public static long dcbArgULongLong(@NativeType("DCArgs *") long args) { + if (CHECKS) { + check(args); + } + return ndcbArgULongLong(args); + } + + // --- [ dcbArgFloat ] --- + + /** Unsafe version of: {@link #dcbArgFloat ArgFloat} */ + public static native float ndcbArgFloat(long args); + + /** + * Returns the next {@code float} argument. + * + * @param args the function arguments + */ + @NativeType("DCfloat") + public static float dcbArgFloat(@NativeType("DCArgs *") long args) { + if (CHECKS) { + check(args); + } + return ndcbArgFloat(args); + } + + // --- [ dcbArgDouble ] --- + + /** Unsafe version of: {@link #dcbArgDouble ArgDouble} */ + public static native double ndcbArgDouble(long args); + + /** + * Returns the next {@code double} argument. + * + * @param args the function arguments + */ + @NativeType("DCdouble") + public static double dcbArgDouble(@NativeType("DCArgs *") long args) { + if (CHECKS) { + check(args); + } + return ndcbArgDouble(args); + } + + // --- [ dcbArgPointer ] --- + + /** Unsafe version of: {@link #dcbArgPointer ArgPointer} */ + public static native long ndcbArgPointer(long args); + + /** + * Returns the next {@code pointer} argument. + * + * @param args the function arguments + */ + @NativeType("DCpointer") + public static long dcbArgPointer(@NativeType("DCArgs *") long args) { + if (CHECKS) { + check(args); + } + return ndcbArgPointer(args); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/dyncall/DynLoad.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/dyncall/DynLoad.java new file mode 100644 index 00000000..f190b9ad --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/dyncall/DynLoad.java @@ -0,0 +1,290 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.dyncall; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to \"dynload.h\". + * + *

The dynload library provides an interface to load foreign dynamic libraries and access to their symbols.

+ */ +public class DynLoad { + + static { Library.initialize(); } + + protected DynLoad() { + throw new UnsupportedOperationException(); + } + + // --- [ dlLoadLibrary ] --- + + /** Unsafe version of: {@link #dlLoadLibrary LoadLibrary} */ + public static native long ndlLoadLibrary(long libpath); + + /** + * Loads a dynamic library at {@code libpath} and returns a handle to it. + * + * @param libpath the dynamic library path + */ + @NativeType("DLLib *") + public static long dlLoadLibrary(@NativeType("char const *") ByteBuffer libpath) { + if (CHECKS) { + checkNT1(libpath); + } + return ndlLoadLibrary(memAddress(libpath)); + } + + /** + * Loads a dynamic library at {@code libpath} and returns a handle to it. + * + * @param libpath the dynamic library path + */ + @NativeType("DLLib *") + public static long dlLoadLibrary(@NativeType("char const *") CharSequence libpath) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(libpath, true); + long libpathEncoded = stack.getPointerAddress(); + return ndlLoadLibrary(libpathEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ dlFreeLibrary ] --- + + /** Unsafe version of: {@link #dlFreeLibrary FreeLibrary} */ + public static native void ndlFreeLibrary(long pLib); + + /** + * Frees a loaded library. + * + * @param pLib the dynamic library to free + */ + public static void dlFreeLibrary(@NativeType("DLLib *") long pLib) { + if (CHECKS) { + check(pLib); + } + ndlFreeLibrary(pLib); + } + + // --- [ dlFindSymbol ] --- + + /** Unsafe version of: {@link #dlFindSymbol FindSymbol} */ + public static native long ndlFindSymbol(long pLib, long pSymbolName); + + /** + * Returns a pointer to a symbol with name {@code pSymbolName} in the library with handle {@code pLib}, or returns a null pointer if the symbol cannot be + * found. + * + * @param pLib the dynamic library + * @param pSymbolName the symbol name + */ + @NativeType("void *") + public static long dlFindSymbol(@NativeType("DLLib *") long pLib, @NativeType("char const *") ByteBuffer pSymbolName) { + if (CHECKS) { + check(pLib); + checkNT1(pSymbolName); + } + return ndlFindSymbol(pLib, memAddress(pSymbolName)); + } + + /** + * Returns a pointer to a symbol with name {@code pSymbolName} in the library with handle {@code pLib}, or returns a null pointer if the symbol cannot be + * found. + * + * @param pLib the dynamic library + * @param pSymbolName the symbol name + */ + @NativeType("void *") + public static long dlFindSymbol(@NativeType("DLLib *") long pLib, @NativeType("char const *") CharSequence pSymbolName) { + if (CHECKS) { + check(pLib); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(pSymbolName, true); + long pSymbolNameEncoded = stack.getPointerAddress(); + return ndlFindSymbol(pLib, pSymbolNameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ dlGetLibraryPath ] --- + + /** + * Unsafe version of: {@link #dlGetLibraryPath GetLibraryPath} + * + * @param bufSize the size of {@code sOut}, in bytes + */ + public static native int ndlGetLibraryPath(long pLib, long sOut, int bufSize); + + /** + * Gets a copy of the path to the library loaded with handle {@code pLib}. + * + *

The parameter {@code sOut} is a pointer to a buffer of size {@code bufSize} (in bytes), to hold the output string. The return value is the size of the + * buffer (in bytes) needed to hold the null-terminated string, or 0 if it can't be looked up. If {@code bufSize >= return value > 1}, a null-terminated + * string with the path to the library should be in {@code sOut}. If it returns 0, the library name wasn't able to be found. Please note that this might + * happen in some rare cases, so make sure to always check.

+ * + * @param pLib the dynamic library + * @param sOut pointer to a buffer where the library path will be stored + */ + public static int dlGetLibraryPath(@NativeType("DLLib *") long pLib, @NativeType("char *") ByteBuffer sOut) { + if (CHECKS) { + check(pLib); + } + return ndlGetLibraryPath(pLib, memAddress(sOut), sOut.remaining()); + } + + /** + * Gets a copy of the path to the library loaded with handle {@code pLib}. + * + *

The parameter {@code sOut} is a pointer to a buffer of size {@code bufSize} (in bytes), to hold the output string. The return value is the size of the + * buffer (in bytes) needed to hold the null-terminated string, or 0 if it can't be looked up. If {@code bufSize >= return value > 1}, a null-terminated + * string with the path to the library should be in {@code sOut}. If it returns 0, the library name wasn't able to be found. Please note that this might + * happen in some rare cases, so make sure to always check.

+ * + * @param pLib the dynamic library + * @param bufSize the size of {@code sOut}, in bytes + */ + @NativeType("int") + public static String dlGetLibraryPath(@NativeType("DLLib *") long pLib, int bufSize) { + if (CHECKS) { + check(pLib); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + ByteBuffer sOut = stack.malloc(bufSize); + int __result = ndlGetLibraryPath(pLib, memAddress(sOut), bufSize); + return memASCII(sOut, __result - 1); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ dlSymsInit ] --- + + /** Unsafe version of: {@link #dlSymsInit SymsInit} */ + public static native long ndlSymsInit(long libPath); + + /** + * Creates a new {@code DLSyms} object. + * + * @param libPath the dynamic library path + */ + @NativeType("DLSyms *") + public static long dlSymsInit(@NativeType("char const *") ByteBuffer libPath) { + if (CHECKS) { + checkNT1(libPath); + } + return ndlSymsInit(memAddress(libPath)); + } + + /** + * Creates a new {@code DLSyms} object. + * + * @param libPath the dynamic library path + */ + @NativeType("DLSyms *") + public static long dlSymsInit(@NativeType("char const *") CharSequence libPath) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(libPath, true); + long libPathEncoded = stack.getPointerAddress(); + return ndlSymsInit(libPathEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ dlSymsCleanup ] --- + + /** Unsafe version of: {@link #dlSymsCleanup SymsCleanup} */ + public static native void ndlSymsCleanup(long pSyms); + + /** + * Frees the specified {@code DLSyms} object. + * + * @param pSyms the {@code DLSyms} object to free + */ + public static void dlSymsCleanup(@NativeType("DLSyms *") long pSyms) { + if (CHECKS) { + check(pSyms); + } + ndlSymsCleanup(pSyms); + } + + // --- [ dlSymsCount ] --- + + /** Unsafe version of: {@link #dlSymsCount SymsCount} */ + public static native int ndlSymsCount(long pSyms); + + /** + * Returns the number of symbols exported by the specified library. + * + * @param pSyms a {@code DLSyms} object + */ + public static int dlSymsCount(@NativeType("DLSyms *") long pSyms) { + if (CHECKS) { + check(pSyms); + } + return ndlSymsCount(pSyms); + } + + // --- [ dlSymsName ] --- + + /** Unsafe version of: {@link #dlSymsName SymsName} */ + public static native long ndlSymsName(long pSyms, int index); + + /** + * Returns the symbol name exported by the specified library at the specified index. + * + * @param pSyms a {@code DLSyms} object + */ + @Nullable + @NativeType("char const *") + public static String dlSymsName(@NativeType("DLSyms *") long pSyms, int index) { + if (CHECKS) { + check(pSyms); + } + long __result = ndlSymsName(pSyms, index); + return memASCIISafe(__result); + } + + // --- [ dlSymsNameFromValue ] --- + + /** Unsafe version of: {@link #dlSymsNameFromValue SymsNameFromValue} */ + public static native long ndlSymsNameFromValue(long pSyms, long value); + + /** + * Returns the symbol name exported by the specified library at the specified address. + * + * @param pSyms a {@code DLSyms} object + * @param value the symbol address + */ + @Nullable + @NativeType("char const *") + public static String dlSymsNameFromValue(@NativeType("DLSyms *") long pSyms, @NativeType("void *") long value) { + if (CHECKS) { + check(pSyms); + check(value); + } + long __result = ndlSymsNameFromValue(pSyms, value); + return memASCIISafe(__result); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/dyncall/package-info.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/dyncall/package-info.java new file mode 100644 index 00000000..7dff170d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/dyncall/package-info.java @@ -0,0 +1,26 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ + +/** + * Contains bindings to the dyncall library. + * + *

The dyncall library encapsulates architecture-, OS- and compiler-specific function call semantics in a virtual bind argument parameters from left to + * right and then call interface allowing programmers to call C functions in a completely dynamic manner. In other words, instead of calling a function + * directly, the dyncall library provides a mechanism to push the function parameters manually and to issue the call afterwards.

+ * + *

This means, that a program can determine at runtime what function to call, and what parameters to pass to it. The library is written in C and assembly + * and provides a very simple C interface to program against.

+ * + *

The library comes in very handy to power flexible message systems, dynamic function call dispatch mechanisms, closure implementations, to bridge + * different programming languages, or to simply wrap a "vararg" function.

+ * + *

When it comes to language bindings, the dyncall library provides a clean and portable C interface to dynamically issue calls to foreign code using + * small call kernels written in assembly. Instead of providing code for every bridged function call, which unnecessarily results in code bloat, only a + * couple of instructions are used to invoke every possible call.

+ */ +@org.lwjgl.system.NonnullDefault +package org.lwjgl.system.dyncall; + diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/fcl/DynamicLinkLoader.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/fcl/DynamicLinkLoader.java new file mode 100644 index 00000000..fc8a5f2d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/fcl/DynamicLinkLoader.java @@ -0,0 +1,168 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.fcl; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to <dlfcn.h>. */ +public class DynamicLinkLoader { + + /** The {@code mode} argument to {@link #dlopen} contains one of the following. */ + public static final int + RTLD_LAZY = 0x1, + RTLD_NOW = 0x2, + RTLD_BINDING_MASK = 0x3, + RTLD_NOLOAD = 0x4, + RTLD_DEEPBIND = 0x8; + + /** + * If the following bit is set in the {@code mode} argument to {@link #dlopen}, the symbols of the loaded object and its dependencies are made visible as + * if the object were linked directly into the program. + */ + public static final int RTLD_GLOBAL = 0x100; + + /** + * Unix98 demands the following flag which is the inverse to {@link #RTLD_GLOBAL}. The implementation does this by default and so we can define the value + * to zero. + */ + public static final int RTLD_LOCAL = 0; + + /** Do not delete object when closed. */ + public static final int RTLD_NODELETE = 0x1000; + + static { Library.initialize(); } + + protected DynamicLinkLoader() { + throw new UnsupportedOperationException(); + } + + // --- [ dlopen ] --- + + /** Unsafe version of: {@link #dlopen} */ + public static native long ndlopen(long filename, int mode); + + /** + * Loads the dynamic library file named by the null-terminated string {@code filename} and returns an opaque "handle" for the dynamic library. If + * {@code filename} is {@code NULL}, then the returned handle is for the main program. + * + * @param filename the name of the dynamic library to open, or {@code NULL} + * @param mode a bitfield. One or more of:
{@link #RTLD_LAZY}{@link #RTLD_NOW}{@link #RTLD_BINDING_MASK}{@link #RTLD_NOLOAD}{@link #RTLD_DEEPBIND}{@link #RTLD_GLOBAL}
{@link #RTLD_LOCAL}{@link #RTLD_NODELETE}
+ */ + @NativeType("void *") + public static long dlopen(@Nullable @NativeType("char const *") ByteBuffer filename, int mode) { + if (CHECKS) { + checkNT1Safe(filename); + } + return ndlopen(memAddressSafe(filename), mode); + } + + /** + * Loads the dynamic library file named by the null-terminated string {@code filename} and returns an opaque "handle" for the dynamic library. If + * {@code filename} is {@code NULL}, then the returned handle is for the main program. + * + * @param filename the name of the dynamic library to open, or {@code NULL} + * @param mode a bitfield. One or more of:
{@link #RTLD_LAZY}{@link #RTLD_NOW}{@link #RTLD_BINDING_MASK}{@link #RTLD_NOLOAD}{@link #RTLD_DEEPBIND}{@link #RTLD_GLOBAL}
{@link #RTLD_LOCAL}{@link #RTLD_NODELETE}
+ */ + @NativeType("void *") + public static long dlopen(@Nullable @NativeType("char const *") CharSequence filename, int mode) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCIISafe(filename, true); + long filenameEncoded = filename == null ? NULL : stack.getPointerAddress(); + return ndlopen(filenameEncoded, mode); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ dlerror ] --- + + /** Unsafe version of: {@link #dlerror} */ + public static native long ndlerror(); + + /** + * Returns a human readable string describing the most recent error that occurred from {@link #dlopen}, {@link #dlsym} or {@link #dlclose} since + * the last call to {@code dlerror()}. It returns {@code NULL} if no errors have occurred since initialization or since it was last called. + */ + @Nullable + @NativeType("char *") + public static String dlerror() { + long __result = ndlerror(); + return memASCIISafe(__result); + } + + // --- [ dlsym ] --- + + /** Unsafe version of: {@link #dlsym} */ + public static native long ndlsym(long handle, long name); + + /** + * Takes a "handle" of a dynamic library returned by {@link #dlopen} and the null-terminated symbol name, returning the address where that symbol is loaded + * into memory. If the symbol is not found, in the specified library or any of the libraries that were automatically loaded by {@link #dlopen} when that + * library was loaded, {@code dlsym()} returns {@code NULL}. + * + * @param handle the dynamic library handle + * @param name the symbol name + */ + @NativeType("void *") + public static long dlsym(@NativeType("void *") long handle, @NativeType("char const *") ByteBuffer name) { + if (CHECKS) { + check(handle); + checkNT1(name); + } + return ndlsym(handle, memAddress(name)); + } + + /** + * Takes a "handle" of a dynamic library returned by {@link #dlopen} and the null-terminated symbol name, returning the address where that symbol is loaded + * into memory. If the symbol is not found, in the specified library or any of the libraries that were automatically loaded by {@link #dlopen} when that + * library was loaded, {@code dlsym()} returns {@code NULL}. + * + * @param handle the dynamic library handle + * @param name the symbol name + */ + @NativeType("void *") + public static long dlsym(@NativeType("void *") long handle, @NativeType("char const *") CharSequence name) { + if (CHECKS) { + check(handle); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + return ndlsym(handle, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ dlclose ] --- + + /** Unsafe version of: {@link #dlclose} */ + public static native int ndlclose(long handle); + + /** + * Decrements the reference count on the dynamic library handle handle. If the reference count drops to zero and no other loaded libraries use symbols in + * it, then the dynamic library is unloaded. + * + * @param handle the dynamic library to close + */ + public static int dlclose(@NativeType("void *") long handle) { + if (CHECKS) { + check(handle); + } + return ndlclose(handle); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/fcl/FCLLibrary.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/fcl/FCLLibrary.java new file mode 100644 index 00000000..c029108a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/fcl/FCLLibrary.java @@ -0,0 +1,47 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system.fcl; + +import org.lwjgl.system.*; + +import java.nio.*; + +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.fcl.DynamicLinkLoader.*; + +/** Implements a {@link SharedLibrary} on the FCL. */ +public class FCLLibrary extends SharedLibrary.Default { + + public FCLLibrary(String name) { + this(name, loadLibrary(name)); + } + + public FCLLibrary(String name, long handle) { + super(name, handle); + } + + private static long loadLibrary(String name) { + long handle; + try (MemoryStack stack = stackPush()) { + handle = dlopen(stack.ASCII(name), RTLD_LAZY | RTLD_LOCAL); + } + if (handle == NULL) { + throw new UnsatisfiedLinkError("Failed to dynamically load library: " + name + "(error = " + dlerror() + ")"); + } + return handle; + } + + @Override + public long getFunctionAddress(ByteBuffer functionName) { + return dlsym(address(), functionName); + } + + @Override + public void free() { + dlclose(address()); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/fcl/package-info.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/fcl/package-info.java new file mode 100644 index 00000000..af0e9d97 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/fcl/package-info.java @@ -0,0 +1,10 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ + +/** Contains bindings to native APIs specific to the FCL platform. */ +@org.lwjgl.system.NonnullDefault +package org.lwjgl.system.fcl; + diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentAlloc.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentAlloc.java new file mode 100644 index 00000000..20ba9de9 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentAlloc.java @@ -0,0 +1,81 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jemalloc; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Instances of this class may be set to the {@link ExtentHooks} struct. + * + *

Type

+ * + *

+ * void * (*) (
+ *     extent_hooks_t *extent_hooks,
+ *     void *new_addr,
+ *     size_t size,
+ *     size_t alignment,
+ *     bool *zero,
+ *     bool *commit,
+ *     unsigned int arena_ind
+ * )
+ */ +public abstract class ExtentAlloc extends Callback implements ExtentAllocI { + + /** + * Creates a {@code ExtentAlloc} instance from the specified function pointer. + * + * @return the new {@code ExtentAlloc} + */ + public static ExtentAlloc create(long functionPointer) { + ExtentAllocI instance = Callback.get(functionPointer); + return instance instanceof ExtentAlloc + ? (ExtentAlloc)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static ExtentAlloc createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code ExtentAlloc} instance that delegates to the specified {@code ExtentAllocI} instance. */ + public static ExtentAlloc create(ExtentAllocI instance) { + return instance instanceof ExtentAlloc + ? (ExtentAlloc)instance + : new Container(instance.address(), instance); + } + + protected ExtentAlloc() { + super(SIGNATURE); + } + + ExtentAlloc(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends ExtentAlloc { + + private final ExtentAllocI delegate; + + Container(long functionPointer, ExtentAllocI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public long invoke(long extent_hooks, long new_addr, long size, long alignment, long zero, long commit, int arena_ind) { + return delegate.invoke(extent_hooks, new_addr, size, alignment, zero, commit, arena_ind); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentAllocI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentAllocI.java new file mode 100644 index 00000000..d6bfbcd9 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentAllocI.java @@ -0,0 +1,65 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jemalloc; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be set to the {@link ExtentHooks} struct. + * + *

Type

+ * + *

+ * void * (*) (
+ *     extent_hooks_t *extent_hooks,
+ *     void *new_addr,
+ *     size_t size,
+ *     size_t alignment,
+ *     bool *zero,
+ *     bool *commit,
+ *     unsigned int arena_ind
+ * )
+ */ +@FunctionalInterface +@NativeType("extent_alloc_t") +public interface ExtentAllocI extends CallbackI.P { + + String SIGNATURE = "(ppppppi)p"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default long callback(long args) { + return invoke( + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgInt(args) + ); + } + + /** + * Extent allocation hook. + * + *

An extent allocation function conforms to the {@code extent_alloc_t} type and upon success returns a pointer to {@code size} bytes of mapped memory on + * behalf of arena {@code arena_ind} such that the extent's base address is a multiple of {@code alignment}, as well as setting {@code *zero} to indicate + * whether the extent is zeroed and {@code *commit} to indicate whether the extent is committed. Upon error the function returns {@code NULL} and leaves + * {@code *zero} and {@code *commit} unmodified. The {@code size} parameter is always a multiple of the page size. The {@code alignment} parameter is always a + * power of two at least as large as the page size. Zeroing is mandatory if {@code *zero} is true upon function entry. Committing is mandatory if + * {@code *commit} is true upon function entry. If {@code new_addr} is not {@code NULL}, the returned pointer must be {@code new_addr} on success or {@code NULL} on error. + * Committed memory may be committed in absolute terms as on a system that does not overcommit, or in implicit terms as on a system that overcommits and + * satisfies physical memory needs on demand via soft page faults. Note that replacing the default extent allocation function makes the arena's + * {@code arena.i.dss} setting irrelevant.

+ */ + @NativeType("void *") long invoke(@NativeType("extent_hooks_t *") long extent_hooks, @NativeType("void *") long new_addr, @NativeType("size_t") long size, @NativeType("size_t") long alignment, @NativeType("bool *") long zero, @NativeType("bool *") long commit, @NativeType("unsigned int") int arena_ind); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentCommit.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentCommit.java new file mode 100644 index 00000000..2e4a4e8e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentCommit.java @@ -0,0 +1,80 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jemalloc; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Instances of this class may be set to the {@link ExtentHooks} struct. + * + *

Type

+ * + *

+ * bool (*) (
+ *     extent_hooks_t *extent_hooks,
+ *     void *addr,
+ *     size_t size,
+ *     size_t offset,
+ *     size_t length,
+ *     unsigned int arena_ind
+ * )
+ */ +public abstract class ExtentCommit extends Callback implements ExtentCommitI { + + /** + * Creates a {@code ExtentCommit} instance from the specified function pointer. + * + * @return the new {@code ExtentCommit} + */ + public static ExtentCommit create(long functionPointer) { + ExtentCommitI instance = Callback.get(functionPointer); + return instance instanceof ExtentCommit + ? (ExtentCommit)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static ExtentCommit createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code ExtentCommit} instance that delegates to the specified {@code ExtentCommitI} instance. */ + public static ExtentCommit create(ExtentCommitI instance) { + return instance instanceof ExtentCommit + ? (ExtentCommit)instance + : new Container(instance.address(), instance); + } + + protected ExtentCommit() { + super(SIGNATURE); + } + + ExtentCommit(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends ExtentCommit { + + private final ExtentCommitI delegate; + + Container(long functionPointer, ExtentCommitI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public boolean invoke(long extent_hooks, long addr, long size, long offset, long length, int arena_ind) { + return delegate.invoke(extent_hooks, addr, size, offset, length, arena_ind); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentCommitI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentCommitI.java new file mode 100644 index 00000000..7b413bc3 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentCommitI.java @@ -0,0 +1,59 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jemalloc; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be set to the {@link ExtentHooks} struct. + * + *

Type

+ * + *

+ * bool (*) (
+ *     extent_hooks_t *extent_hooks,
+ *     void *addr,
+ *     size_t size,
+ *     size_t offset,
+ *     size_t length,
+ *     unsigned int arena_ind
+ * )
+ */ +@FunctionalInterface +@NativeType("extent_commit_t") +public interface ExtentCommitI extends CallbackI.Z { + + String SIGNATURE = "(pppppi)B"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default boolean callback(long args) { + return invoke( + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgInt(args) + ); + } + + /** + * Extent commit hook. + * + *

An extent commit function conforms to the {@code extent_commit_t} type and commits zeroed physical memory to back pages within an extent at given + * {@code addr} and {@code size} at {@code offset} bytes, extending for {@code length} on behalf of arena {@code arena_ind}, returning false upon success. + * Committed memory may be committed in absolute terms as on a system that does not overcommit, or in implicit terms as on a system that overcommits and + * satisfies physical memory needs on demand via soft page faults. If the function returns true, this indicates insufficient physical memory to satisfy the + * request.

+ */ + @NativeType("bool") boolean invoke(@NativeType("extent_hooks_t *") long extent_hooks, @NativeType("void *") long addr, @NativeType("size_t") long size, @NativeType("size_t") long offset, @NativeType("size_t") long length, @NativeType("unsigned int") int arena_ind); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDalloc.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDalloc.java new file mode 100644 index 00000000..63850aed --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDalloc.java @@ -0,0 +1,79 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jemalloc; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Instances of this class may be set to the {@link ExtentHooks} struct. + * + *

Type

+ * + *

+ * bool (*) (
+ *     extent_hooks_t *extent_hooks,
+ *     void *addr,
+ *     size_t size,
+ *     bool committed,
+ *     unsigned int arena_ind
+ * )
+ */ +public abstract class ExtentDalloc extends Callback implements ExtentDallocI { + + /** + * Creates a {@code ExtentDalloc} instance from the specified function pointer. + * + * @return the new {@code ExtentDalloc} + */ + public static ExtentDalloc create(long functionPointer) { + ExtentDallocI instance = Callback.get(functionPointer); + return instance instanceof ExtentDalloc + ? (ExtentDalloc)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static ExtentDalloc createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code ExtentDalloc} instance that delegates to the specified {@code ExtentDallocI} instance. */ + public static ExtentDalloc create(ExtentDallocI instance) { + return instance instanceof ExtentDalloc + ? (ExtentDalloc)instance + : new Container(instance.address(), instance); + } + + protected ExtentDalloc() { + super(SIGNATURE); + } + + ExtentDalloc(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends ExtentDalloc { + + private final ExtentDallocI delegate; + + Container(long functionPointer, ExtentDallocI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public boolean invoke(long extent_hooks, long addr, long size, boolean committed, int arena_ind) { + return delegate.invoke(extent_hooks, addr, size, committed, arena_ind); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDallocI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDallocI.java new file mode 100644 index 00000000..944dca5b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDallocI.java @@ -0,0 +1,56 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jemalloc; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be set to the {@link ExtentHooks} struct. + * + *

Type

+ * + *

+ * bool (*) (
+ *     extent_hooks_t *extent_hooks,
+ *     void *addr,
+ *     size_t size,
+ *     bool committed,
+ *     unsigned int arena_ind
+ * )
+ */ +@FunctionalInterface +@NativeType("extent_dalloc_t") +public interface ExtentDallocI extends CallbackI.Z { + + String SIGNATURE = "(pppBi)B"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default boolean callback(long args) { + return invoke( + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgBool(args), + dcbArgInt(args) + ); + } + + /** + * Extent deallocation hook. + * + *

An extent deallocation function conforms to the {@code extent_dalloc_t} type and deallocates an extent at given {@code addr} and {@code size} with + * {@code committed}/decommited memory as indicated, on behalf of arena {@code arena_ind}, returning false upon success. If the function returns true, this + * indicates opt-out from deallocation; the virtual memory mapping associated with the extent remains mapped, in the same commit state, and available for + * future use, in which case it will be automatically retained for later reuse.

+ */ + @NativeType("bool") boolean invoke(@NativeType("extent_hooks_t *") long extent_hooks, @NativeType("void *") long addr, @NativeType("size_t") long size, @NativeType("bool") boolean committed, @NativeType("unsigned int") int arena_ind); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDecommit.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDecommit.java new file mode 100644 index 00000000..a4a8b80a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDecommit.java @@ -0,0 +1,80 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jemalloc; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Instances of this class may be set to the {@link ExtentHooks} struct. + * + *

Type

+ * + *

+ * bool (*) (
+ *     extent_hooks_t *extent_hooks,
+ *     void *addr,
+ *     size_t size,
+ *     size_t offset,
+ *     size_t length,
+ *     unsigned int arena_ind
+ * )
+ */ +public abstract class ExtentDecommit extends Callback implements ExtentDecommitI { + + /** + * Creates a {@code ExtentDecommit} instance from the specified function pointer. + * + * @return the new {@code ExtentDecommit} + */ + public static ExtentDecommit create(long functionPointer) { + ExtentDecommitI instance = Callback.get(functionPointer); + return instance instanceof ExtentDecommit + ? (ExtentDecommit)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static ExtentDecommit createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code ExtentDecommit} instance that delegates to the specified {@code ExtentDecommitI} instance. */ + public static ExtentDecommit create(ExtentDecommitI instance) { + return instance instanceof ExtentDecommit + ? (ExtentDecommit)instance + : new Container(instance.address(), instance); + } + + protected ExtentDecommit() { + super(SIGNATURE); + } + + ExtentDecommit(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends ExtentDecommit { + + private final ExtentDecommitI delegate; + + Container(long functionPointer, ExtentDecommitI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public boolean invoke(long extent_hooks, long addr, long size, long offset, long length, int arena_ind) { + return delegate.invoke(extent_hooks, addr, size, offset, length, arena_ind); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDecommitI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDecommitI.java new file mode 100644 index 00000000..e2a23497 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDecommitI.java @@ -0,0 +1,58 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jemalloc; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be set to the {@link ExtentHooks} struct. + * + *

Type

+ * + *

+ * bool (*) (
+ *     extent_hooks_t *extent_hooks,
+ *     void *addr,
+ *     size_t size,
+ *     size_t offset,
+ *     size_t length,
+ *     unsigned int arena_ind
+ * )
+ */ +@FunctionalInterface +@NativeType("extent_decommit_t") +public interface ExtentDecommitI extends CallbackI.Z { + + String SIGNATURE = "(pppppi)B"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default boolean callback(long args) { + return invoke( + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgInt(args) + ); + } + + /** + * Extent decommit hook. + * + *

An extent decommit function conforms to the {@code extent_decommit_t} type and decommits any physical memory that is backing pages within an extent at + * given {@code addr} and {@code size} at {@code offset} bytes, extending for {@code length} on behalf of arena {@code arena_ind}, returning false upon + * success, in which case the pages will be committed via the extent commit function before being reused. If the function returns true, this indicates + * opt-out from decommit; the memory remains committed and available for future use, in which case it will be automatically retained for later reuse.

+ */ + @NativeType("bool") boolean invoke(@NativeType("extent_hooks_t *") long extent_hooks, @NativeType("void *") long addr, @NativeType("size_t") long size, @NativeType("size_t") long offset, @NativeType("size_t") long length, @NativeType("unsigned int") int arena_ind); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDestroy.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDestroy.java new file mode 100644 index 00000000..5f054454 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDestroy.java @@ -0,0 +1,79 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jemalloc; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Instances of this class may be set to the {@link ExtentHooks} struct. + * + *

Type

+ * + *

+ * bool (*) (
+ *     extent_hooks_t *extent_hooks,
+ *     void *addr,
+ *     size_t size,
+ *     bool committed,
+ *     unsigned int arena_ind
+ * )
+ */ +public abstract class ExtentDestroy extends Callback implements ExtentDestroyI { + + /** + * Creates a {@code ExtentDestroy} instance from the specified function pointer. + * + * @return the new {@code ExtentDestroy} + */ + public static ExtentDestroy create(long functionPointer) { + ExtentDestroyI instance = Callback.get(functionPointer); + return instance instanceof ExtentDestroy + ? (ExtentDestroy)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static ExtentDestroy createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code ExtentDestroy} instance that delegates to the specified {@code ExtentDestroyI} instance. */ + public static ExtentDestroy create(ExtentDestroyI instance) { + return instance instanceof ExtentDestroy + ? (ExtentDestroy)instance + : new Container(instance.address(), instance); + } + + protected ExtentDestroy() { + super(SIGNATURE); + } + + ExtentDestroy(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends ExtentDestroy { + + private final ExtentDestroyI delegate; + + Container(long functionPointer, ExtentDestroyI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public boolean invoke(long extent_hooks, long addr, long size, boolean committed, int arena_ind) { + return delegate.invoke(extent_hooks, addr, size, committed, arena_ind); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDestroyI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDestroyI.java new file mode 100644 index 00000000..7460ef55 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentDestroyI.java @@ -0,0 +1,55 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jemalloc; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be set to the {@link ExtentHooks} struct. + * + *

Type

+ * + *

+ * bool (*) (
+ *     extent_hooks_t *extent_hooks,
+ *     void *addr,
+ *     size_t size,
+ *     bool committed,
+ *     unsigned int arena_ind
+ * )
+ */ +@FunctionalInterface +@NativeType("extent_destroy_t") +public interface ExtentDestroyI extends CallbackI.Z { + + String SIGNATURE = "(pppBi)B"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default boolean callback(long args) { + return invoke( + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgBool(args), + dcbArgInt(args) + ); + } + + /** + * Extent destruction hook. + * + *

An extent destruction function conforms to the {@code extent_destroy_t} type and unconditionally destroys an extent at given {@code addr} and {@code size} + * with {@code committed}/decommited memory as indicated, on behalf of arena {@code arena_ind}. This function may be called to destroy retained extents during + * arena destruction (see {@code arena.i.destroy}).

+ */ + @NativeType("bool") boolean invoke(@NativeType("extent_hooks_t *") long extent_hooks, @NativeType("void *") long addr, @NativeType("size_t") long size, @NativeType("bool") boolean committed, @NativeType("unsigned int") int arena_ind); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentHooks.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentHooks.java new file mode 100644 index 00000000..93ea8931 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentHooks.java @@ -0,0 +1,329 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jemalloc; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * The {@code extent_hooks_t} structure comprises function pointers which are described individually below. jemalloc uses these functions to manage extent + * lifetime, which starts off with allocation of mapped committed memory, in the simplest case followed by deallocation. However, there are performance + * and platform reasons to retain extents for later reuse. Cleanup attempts cascade from deallocation to decommit to forced purging to lazy purging, which + * gives the extent management functions opportunities to reject the most permanent cleanup operations in favor of less permanent (and often less costly) + * operations. All operations except allocation can be universally opted out of by setting the hook pointers to {@code NULL}, or selectively opted out of by + * returning failure. + * + *

Member documentation

+ * + *
    + *
  • {@code alloc} – the extent allocation hook
  • + *
  • {@code dalloc} – the extent deallocation hook
  • + *
  • {@code destroy} – the extent destruction hook
  • + *
  • {@code commit} – the extent commit hook
  • + *
  • {@code decommit} – the extent decommit hook
  • + *
  • {@code purge_lazy} – the extent lazy purge hook
  • + *
  • {@code purge_forced} – the extent forced purge hook
  • + *
  • {@code split} – the extent split hook
  • + *
  • {@code merge} – the extent merge hook
  • + *
+ * + *

Layout

+ * + *

+ * struct extent_hooks_t {
+ *     {@link ExtentAllocI extent_alloc_t} alloc;
+ *     {@link ExtentDallocI extent_dalloc_t} dalloc;
+ *     {@link ExtentDestroyI extent_destroy_t} destroy;
+ *     {@link ExtentCommitI extent_commit_t} commit;
+ *     {@link ExtentDecommitI extent_decommit_t} decommit;
+ *     {@link ExtentPurgeI extent_purge_t} purge_lazy;
+ *     {@link ExtentPurgeI extent_purge_t} purge_forced;
+ *     {@link ExtentSplitI extent_split_t} split;
+ *     {@link ExtentMergeI extent_merge_t} merge;
+ * }
+ */ +@NativeType("struct extent_hooks_t") +public class ExtentHooks extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + ALLOC, + DALLOC, + DESTROY, + COMMIT, + DECOMMIT, + PURGE_LAZY, + PURGE_FORCED, + SPLIT, + MERGE; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + ALLOC = layout.offsetof(0); + DALLOC = layout.offsetof(1); + DESTROY = layout.offsetof(2); + COMMIT = layout.offsetof(3); + DECOMMIT = layout.offsetof(4); + PURGE_LAZY = layout.offsetof(5); + PURGE_FORCED = layout.offsetof(6); + SPLIT = layout.offsetof(7); + MERGE = layout.offsetof(8); + } + + /** + * Creates a {@code ExtentHooks} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public ExtentHooks(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code alloc} field. */ + @NativeType("extent_alloc_t") + public ExtentAlloc alloc() { return nalloc(address()); } + /** Returns the value of the {@code dalloc} field. */ + @Nullable + @NativeType("extent_dalloc_t") + public ExtentDalloc dalloc() { return ndalloc(address()); } + /** Returns the value of the {@code destroy} field. */ + @Nullable + @NativeType("extent_destroy_t") + public ExtentDestroy destroy() { return ndestroy(address()); } + /** Returns the value of the {@code commit} field. */ + @Nullable + @NativeType("extent_commit_t") + public ExtentCommit commit() { return ncommit(address()); } + /** Returns the value of the {@code decommit} field. */ + @Nullable + @NativeType("extent_decommit_t") + public ExtentDecommit decommit() { return ndecommit(address()); } + /** Returns the value of the {@code purge_lazy} field. */ + @Nullable + @NativeType("extent_purge_t") + public ExtentPurge purge_lazy() { return npurge_lazy(address()); } + /** Returns the value of the {@code purge_forced} field. */ + @Nullable + @NativeType("extent_purge_t") + public ExtentPurge purge_forced() { return npurge_forced(address()); } + /** Returns the value of the {@code split} field. */ + @Nullable + @NativeType("extent_split_t") + public ExtentSplit split() { return nsplit(address()); } + /** Returns the value of the {@code merge} field. */ + @Nullable + @NativeType("extent_merge_t") + public ExtentMerge merge() { return nmerge(address()); } + + /** Sets the specified value to the {@code alloc} field. */ + public ExtentHooks alloc(@NativeType("extent_alloc_t") ExtentAllocI value) { nalloc(address(), value); return this; } + /** Sets the specified value to the {@code dalloc} field. */ + public ExtentHooks dalloc(@Nullable @NativeType("extent_dalloc_t") ExtentDallocI value) { ndalloc(address(), value); return this; } + /** Sets the specified value to the {@code destroy} field. */ + public ExtentHooks destroy(@Nullable @NativeType("extent_destroy_t") ExtentDestroyI value) { ndestroy(address(), value); return this; } + /** Sets the specified value to the {@code commit} field. */ + public ExtentHooks commit(@Nullable @NativeType("extent_commit_t") ExtentCommitI value) { ncommit(address(), value); return this; } + /** Sets the specified value to the {@code decommit} field. */ + public ExtentHooks decommit(@Nullable @NativeType("extent_decommit_t") ExtentDecommitI value) { ndecommit(address(), value); return this; } + /** Sets the specified value to the {@code purge_lazy} field. */ + public ExtentHooks purge_lazy(@Nullable @NativeType("extent_purge_t") ExtentPurgeI value) { npurge_lazy(address(), value); return this; } + /** Sets the specified value to the {@code purge_forced} field. */ + public ExtentHooks purge_forced(@Nullable @NativeType("extent_purge_t") ExtentPurgeI value) { npurge_forced(address(), value); return this; } + /** Sets the specified value to the {@code split} field. */ + public ExtentHooks split(@Nullable @NativeType("extent_split_t") ExtentSplitI value) { nsplit(address(), value); return this; } + /** Sets the specified value to the {@code merge} field. */ + public ExtentHooks merge(@Nullable @NativeType("extent_merge_t") ExtentMergeI value) { nmerge(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public ExtentHooks set( + ExtentAllocI alloc, + ExtentDallocI dalloc, + ExtentDestroyI destroy, + ExtentCommitI commit, + ExtentDecommitI decommit, + ExtentPurgeI purge_lazy, + ExtentPurgeI purge_forced, + ExtentSplitI split, + ExtentMergeI merge + ) { + alloc(alloc); + dalloc(dalloc); + destroy(destroy); + commit(commit); + decommit(decommit); + purge_lazy(purge_lazy); + purge_forced(purge_forced); + split(split); + merge(merge); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public ExtentHooks set(ExtentHooks src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code ExtentHooks} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static ExtentHooks malloc() { + return wrap(ExtentHooks.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code ExtentHooks} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static ExtentHooks calloc() { + return wrap(ExtentHooks.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code ExtentHooks} instance allocated with {@link BufferUtils}. */ + public static ExtentHooks create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(ExtentHooks.class, memAddress(container), container); + } + + /** Returns a new {@code ExtentHooks} instance for the specified memory address. */ + public static ExtentHooks create(long address) { + return wrap(ExtentHooks.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static ExtentHooks createSafe(long address) { + return address == NULL ? null : wrap(ExtentHooks.class, address); + } + + // ----------------------------------- + + /** Returns a new {@code ExtentHooks} instance allocated on the thread-local {@link MemoryStack}. */ + public static ExtentHooks mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code ExtentHooks} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static ExtentHooks callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code ExtentHooks} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static ExtentHooks mallocStack(MemoryStack stack) { + return wrap(ExtentHooks.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code ExtentHooks} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static ExtentHooks callocStack(MemoryStack stack) { + return wrap(ExtentHooks.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + // ----------------------------------- + + /** Unsafe version of {@link #alloc}. */ + public static ExtentAlloc nalloc(long struct) { return ExtentAlloc.create(memGetAddress(struct + ExtentHooks.ALLOC)); } + /** Unsafe version of {@link #dalloc}. */ + @Nullable public static ExtentDalloc ndalloc(long struct) { return ExtentDalloc.createSafe(memGetAddress(struct + ExtentHooks.DALLOC)); } + /** Unsafe version of {@link #destroy}. */ + @Nullable public static ExtentDestroy ndestroy(long struct) { return ExtentDestroy.createSafe(memGetAddress(struct + ExtentHooks.DESTROY)); } + /** Unsafe version of {@link #commit}. */ + @Nullable public static ExtentCommit ncommit(long struct) { return ExtentCommit.createSafe(memGetAddress(struct + ExtentHooks.COMMIT)); } + /** Unsafe version of {@link #decommit}. */ + @Nullable public static ExtentDecommit ndecommit(long struct) { return ExtentDecommit.createSafe(memGetAddress(struct + ExtentHooks.DECOMMIT)); } + /** Unsafe version of {@link #purge_lazy}. */ + @Nullable public static ExtentPurge npurge_lazy(long struct) { return ExtentPurge.createSafe(memGetAddress(struct + ExtentHooks.PURGE_LAZY)); } + /** Unsafe version of {@link #purge_forced}. */ + @Nullable public static ExtentPurge npurge_forced(long struct) { return ExtentPurge.createSafe(memGetAddress(struct + ExtentHooks.PURGE_FORCED)); } + /** Unsafe version of {@link #split}. */ + @Nullable public static ExtentSplit nsplit(long struct) { return ExtentSplit.createSafe(memGetAddress(struct + ExtentHooks.SPLIT)); } + /** Unsafe version of {@link #merge}. */ + @Nullable public static ExtentMerge nmerge(long struct) { return ExtentMerge.createSafe(memGetAddress(struct + ExtentHooks.MERGE)); } + + /** Unsafe version of {@link #alloc(ExtentAllocI) alloc}. */ + public static void nalloc(long struct, ExtentAllocI value) { memPutAddress(struct + ExtentHooks.ALLOC, value.address()); } + /** Unsafe version of {@link #dalloc(ExtentDallocI) dalloc}. */ + public static void ndalloc(long struct, @Nullable ExtentDallocI value) { memPutAddress(struct + ExtentHooks.DALLOC, memAddressSafe(value)); } + /** Unsafe version of {@link #destroy(ExtentDestroyI) destroy}. */ + public static void ndestroy(long struct, @Nullable ExtentDestroyI value) { memPutAddress(struct + ExtentHooks.DESTROY, memAddressSafe(value)); } + /** Unsafe version of {@link #commit(ExtentCommitI) commit}. */ + public static void ncommit(long struct, @Nullable ExtentCommitI value) { memPutAddress(struct + ExtentHooks.COMMIT, memAddressSafe(value)); } + /** Unsafe version of {@link #decommit(ExtentDecommitI) decommit}. */ + public static void ndecommit(long struct, @Nullable ExtentDecommitI value) { memPutAddress(struct + ExtentHooks.DECOMMIT, memAddressSafe(value)); } + /** Unsafe version of {@link #purge_lazy(ExtentPurgeI) purge_lazy}. */ + public static void npurge_lazy(long struct, @Nullable ExtentPurgeI value) { memPutAddress(struct + ExtentHooks.PURGE_LAZY, memAddressSafe(value)); } + /** Unsafe version of {@link #purge_forced(ExtentPurgeI) purge_forced}. */ + public static void npurge_forced(long struct, @Nullable ExtentPurgeI value) { memPutAddress(struct + ExtentHooks.PURGE_FORCED, memAddressSafe(value)); } + /** Unsafe version of {@link #split(ExtentSplitI) split}. */ + public static void nsplit(long struct, @Nullable ExtentSplitI value) { memPutAddress(struct + ExtentHooks.SPLIT, memAddressSafe(value)); } + /** Unsafe version of {@link #merge(ExtentMergeI) merge}. */ + public static void nmerge(long struct, @Nullable ExtentMergeI value) { memPutAddress(struct + ExtentHooks.MERGE, memAddressSafe(value)); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + ExtentHooks.ALLOC)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentMerge.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentMerge.java new file mode 100644 index 00000000..47b32a27 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentMerge.java @@ -0,0 +1,81 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jemalloc; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Instances of this class may be set to the {@link ExtentHooks} struct. + * + *

Type

+ * + *

+ * bool (*) (
+ *     extent_hooks_t *extent_hooks,
+ *     void *addr_a,
+ *     size_t size_a,
+ *     void *addr_b,
+ *     size_t size_b,
+ *     bool committed,
+ *     unsigned int arena_ind
+ * )
+ */ +public abstract class ExtentMerge extends Callback implements ExtentMergeI { + + /** + * Creates a {@code ExtentMerge} instance from the specified function pointer. + * + * @return the new {@code ExtentMerge} + */ + public static ExtentMerge create(long functionPointer) { + ExtentMergeI instance = Callback.get(functionPointer); + return instance instanceof ExtentMerge + ? (ExtentMerge)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static ExtentMerge createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code ExtentMerge} instance that delegates to the specified {@code ExtentMergeI} instance. */ + public static ExtentMerge create(ExtentMergeI instance) { + return instance instanceof ExtentMerge + ? (ExtentMerge)instance + : new Container(instance.address(), instance); + } + + protected ExtentMerge() { + super(SIGNATURE); + } + + ExtentMerge(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends ExtentMerge { + + private final ExtentMergeI delegate; + + Container(long functionPointer, ExtentMergeI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public boolean invoke(long extent_hooks, long addr_a, long size_a, long addr_b, long size_b, boolean committed, int arena_ind) { + return delegate.invoke(extent_hooks, addr_a, size_a, addr_b, size_b, committed, arena_ind); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentMergeI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentMergeI.java new file mode 100644 index 00000000..de44a504 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentMergeI.java @@ -0,0 +1,60 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jemalloc; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be set to the {@link ExtentHooks} struct. + * + *

Type

+ * + *

+ * bool (*) (
+ *     extent_hooks_t *extent_hooks,
+ *     void *addr_a,
+ *     size_t size_a,
+ *     void *addr_b,
+ *     size_t size_b,
+ *     bool committed,
+ *     unsigned int arena_ind
+ * )
+ */ +@FunctionalInterface +@NativeType("extent_merge_t") +public interface ExtentMergeI extends CallbackI.Z { + + String SIGNATURE = "(pppppBi)B"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default boolean callback(long args) { + return invoke( + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgBool(args), + dcbArgInt(args) + ); + } + + /** + * Extent merge hook. + * + *

An extent merge function conforms to the {@code extent_merge_t} type and optionally merges adjacent extents, at given {@code addr_a} and {@code size_a} + * with given {@code addr_b} and {@code size_b} into one contiguous extent, operating on {@code committed}/decommitted memory as indicated, on behalf of arena + * {@code arena_ind}, returning false upon success. If the function returns true, this indicates that the extents remain distinct mappings and therefore + * should continue to be operated on independently.

+ */ + @NativeType("bool") boolean invoke(@NativeType("extent_hooks_t *") long extent_hooks, @NativeType("void *") long addr_a, @NativeType("size_t") long size_a, @NativeType("void *") long addr_b, @NativeType("size_t") long size_b, @NativeType("bool") boolean committed, @NativeType("unsigned int") int arena_ind); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentPurge.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentPurge.java new file mode 100644 index 00000000..fcdaa530 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentPurge.java @@ -0,0 +1,80 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jemalloc; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Instances of this class may be set to the {@link ExtentHooks} struct. + * + *

Type

+ * + *

+ * bool (*) (
+ *     extent_hooks_t *extent_hooks,
+ *     void *addr,
+ *     size_t size,
+ *     size_t offset,
+ *     size_t length,
+ *     unsigned int arena_ind
+ * )
+ */ +public abstract class ExtentPurge extends Callback implements ExtentPurgeI { + + /** + * Creates a {@code ExtentPurge} instance from the specified function pointer. + * + * @return the new {@code ExtentPurge} + */ + public static ExtentPurge create(long functionPointer) { + ExtentPurgeI instance = Callback.get(functionPointer); + return instance instanceof ExtentPurge + ? (ExtentPurge)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static ExtentPurge createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code ExtentPurge} instance that delegates to the specified {@code ExtentPurgeI} instance. */ + public static ExtentPurge create(ExtentPurgeI instance) { + return instance instanceof ExtentPurge + ? (ExtentPurge)instance + : new Container(instance.address(), instance); + } + + protected ExtentPurge() { + super(SIGNATURE); + } + + ExtentPurge(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends ExtentPurge { + + private final ExtentPurgeI delegate; + + Container(long functionPointer, ExtentPurgeI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public boolean invoke(long extent_hooks, long addr, long size, long offset, long length, int arena_ind) { + return delegate.invoke(extent_hooks, addr, size, offset, length, arena_ind); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentPurgeI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentPurgeI.java new file mode 100644 index 00000000..05d65b42 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentPurgeI.java @@ -0,0 +1,59 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jemalloc; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be set to the {@link ExtentHooks} struct. + * + *

Type

+ * + *

+ * bool (*) (
+ *     extent_hooks_t *extent_hooks,
+ *     void *addr,
+ *     size_t size,
+ *     size_t offset,
+ *     size_t length,
+ *     unsigned int arena_ind
+ * )
+ */ +@FunctionalInterface +@NativeType("extent_purge_t") +public interface ExtentPurgeI extends CallbackI.Z { + + String SIGNATURE = "(pppppi)B"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default boolean callback(long args) { + return invoke( + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgInt(args) + ); + } + + /** + * Extent purge hook. + * + *

An extent purge function conforms to the {@code extent_purge_t} type and discards physical pages within the virtual memory mapping associated with an + * extent at given {@code addr} and {@code size} at {@code offset} bytes, extending for {@code length} on behalf of arena {@code arena_ind}. A lazy extent + * purge function (e.g. implemented via {@code madvise(..., MADV_FREE)}) can delay purging indefinitely and leave the pages within the purged virtual memory + * range in an indeterminite state, whereas a forced extent purge function immediately purges, and the pages within the virtual memory range will be + * zero-filled the next time they are accessed. If the function returns true, this indicates failure to purge.

+ */ + @NativeType("bool") boolean invoke(@NativeType("extent_hooks_t *") long extent_hooks, @NativeType("void *") long addr, @NativeType("size_t") long size, @NativeType("size_t") long offset, @NativeType("size_t") long length, @NativeType("unsigned int") int arena_ind); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentSplit.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentSplit.java new file mode 100644 index 00000000..9c43b566 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentSplit.java @@ -0,0 +1,81 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jemalloc; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Instances of this class may be set to the {@link ExtentHooks} struct. + * + *

Type

+ * + *

+ * bool (*) (
+ *     extent_hooks_t *extent_hooks,
+ *     void *addr,
+ *     size_t size,
+ *     size_t size_a,
+ *     size_t size_b,
+ *     bool committed,
+ *     unsigned int arena_ind
+ * )
+ */ +public abstract class ExtentSplit extends Callback implements ExtentSplitI { + + /** + * Creates a {@code ExtentSplit} instance from the specified function pointer. + * + * @return the new {@code ExtentSplit} + */ + public static ExtentSplit create(long functionPointer) { + ExtentSplitI instance = Callback.get(functionPointer); + return instance instanceof ExtentSplit + ? (ExtentSplit)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static ExtentSplit createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code ExtentSplit} instance that delegates to the specified {@code ExtentSplitI} instance. */ + public static ExtentSplit create(ExtentSplitI instance) { + return instance instanceof ExtentSplit + ? (ExtentSplit)instance + : new Container(instance.address(), instance); + } + + protected ExtentSplit() { + super(SIGNATURE); + } + + ExtentSplit(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends ExtentSplit { + + private final ExtentSplitI delegate; + + Container(long functionPointer, ExtentSplitI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public boolean invoke(long extent_hooks, long addr, long size, long size_a, long size_b, boolean committed, int arena_ind) { + return delegate.invoke(extent_hooks, addr, size, size_a, size_b, committed, arena_ind); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentSplitI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentSplitI.java new file mode 100644 index 00000000..07e81bab --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/ExtentSplitI.java @@ -0,0 +1,60 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jemalloc; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be set to the {@link ExtentHooks} struct. + * + *

Type

+ * + *

+ * bool (*) (
+ *     extent_hooks_t *extent_hooks,
+ *     void *addr,
+ *     size_t size,
+ *     size_t size_a,
+ *     size_t size_b,
+ *     bool committed,
+ *     unsigned int arena_ind
+ * )
+ */ +@FunctionalInterface +@NativeType("extent_split_t") +public interface ExtentSplitI extends CallbackI.Z { + + String SIGNATURE = "(pppppBi)B"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default boolean callback(long args) { + return invoke( + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgPointer(args), + dcbArgBool(args), + dcbArgInt(args) + ); + } + + /** + * Extent split hook. + * + *

An extent split function conforms to the {@code extent_split_t} type and optionally splits an extent at given {@code addr} and {@code size} into two + * adjacent extents, the first of {@code size_a} bytes, and the second of {@code size_b} bytes, operating on {@code committed}/decommitted memory as + * indicated, on behalf of arena {@code arena_ind}, returning false upon success. If the function returns true, this indicates that the extent remains unsplit + * and therefore should continue to be operated on as a whole.

+ */ + @NativeType("bool") boolean invoke(@NativeType("extent_hooks_t *") long extent_hooks, @NativeType("void *") long addr, @NativeType("size_t") long size, @NativeType("size_t") long size_a, @NativeType("size_t") long size_b, @NativeType("bool") boolean committed, @NativeType("unsigned int") int arena_ind); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/JEmalloc.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/JEmalloc.java new file mode 100644 index 00000000..9baa815c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/JEmalloc.java @@ -0,0 +1,882 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jemalloc; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.Pointer.*; + +/** + * Native bindings to jemalloc. + * + *

jemalloc is a general purpose malloc implementation that emphasizes fragmentation avoidance and scalable concurrency support. jemalloc first came into + * use as the FreeBSD libc allocator in 2005, and since then it has found its way into numerous applications that rely on its predictable behavior. In + * 2010 jemalloc development efforts broadened to include developer support features such as heap profiling, Valgrind integration, and extensive + * monitoring/tuning hooks. Modern jemalloc releases continue to be integrated back into FreeBSD, and therefore versatility remains critical. Ongoing + * development efforts trend toward making jemalloc among the best allocators for a broad range of demanding applications, and eliminating/mitigating + * weaknesses that have practical repercussions for real world applications.

+ */ +public class JEmalloc { + + /** The major version. */ + public static final int JEMALLOC_VERSION_MAJOR = 5; + + /** The minor version. */ + public static final int JEMALLOC_VERSION_MINOR = 2; + + /** The bugfix version. */ + public static final int JEMALLOC_VERSION_BUGFIX = 0; + + /** The revision number. */ + public static final int JEMALLOC_VERSION_NREV = 0; + + /** The globally unique identifier (git commit hash). */ + public static final String JEMALLOC_VERSION_GID = "b0b3e49a54ec29e32636f4577d9d5a896d67fd20"; + + /** The version string. */ + public static final String JEMALLOC_VERSION = JEMALLOC_VERSION_MAJOR + "." + JEMALLOC_VERSION_MINOR + "." + JEMALLOC_VERSION_BUGFIX + "-" + JEMALLOC_VERSION_NREV + "-g" + JEMALLOC_VERSION_GID; + + /** + * Initialize newly allocated memory to contain zero bytes. In the growing reallocation case, the real size prior to reallocation defines the boundary + * between untouched bytes and those that are initialized to contain zero bytes. If this macro is absent, newly allocated memory is uninitialized. + */ + public static final int MALLOCX_ZERO = 0x40; + + /** + * Do not use a thread-specific cache (tcache). Unless {@link #MALLOCX_TCACHE} or {@code MALLOCX_TCACHE_NONE} is specified, an automatically managed + * tcache will be used under many circumstances. This macro cannot be used in the same {@code flags} argument as {@code MALLOCX_TCACHE(tc)}. + */ + public static final int MALLOCX_TCACHE_NONE = MALLOCX_TCACHE(-1); + + /** Use as arena index in "arena.<i>.{purge,decay,dss}" and "stats.arenas.<i>.*" mallctl interfaces to select all arenas. */ + public static final int MALLCTL_ARENAS_ALL = 0x1000; + + /** Use as arena index in "stats.arenas.<i>.*" mallctl interfaces to select destroyed arenas. */ + public static final int MALLCTL_ARENAS_DESTROYED = 0x1001; + + protected JEmalloc() { + throw new UnsupportedOperationException(); + } + + private static final SharedLibrary JEMALLOC = Library.loadNative(JEmalloc.class, "org.lwjgl.jemalloc", Configuration.JEMALLOC_LIBRARY_NAME.get(Platform.mapLibraryNameBundled("jemalloc")), true); + + /** Contains the function pointers loaded from the jemalloc {@link SharedLibrary}. */ + public static final class Functions { + + private Functions() {} + + /** Function address. */ + public static final long + malloc_message = apiGetFunctionAddress(JEMALLOC, "je_malloc_message"), + malloc = apiGetFunctionAddress(JEMALLOC, "je_malloc"), + calloc = apiGetFunctionAddress(JEMALLOC, "je_calloc"), + posix_memalign = apiGetFunctionAddress(JEMALLOC, "je_posix_memalign"), + aligned_alloc = apiGetFunctionAddress(JEMALLOC, "je_aligned_alloc"), + realloc = apiGetFunctionAddress(JEMALLOC, "je_realloc"), + free = apiGetFunctionAddress(JEMALLOC, "je_free"), + mallocx = apiGetFunctionAddress(JEMALLOC, "je_mallocx"), + rallocx = apiGetFunctionAddress(JEMALLOC, "je_rallocx"), + xallocx = apiGetFunctionAddress(JEMALLOC, "je_xallocx"), + sallocx = apiGetFunctionAddress(JEMALLOC, "je_sallocx"), + dallocx = apiGetFunctionAddress(JEMALLOC, "je_dallocx"), + sdallocx = apiGetFunctionAddress(JEMALLOC, "je_sdallocx"), + nallocx = apiGetFunctionAddress(JEMALLOC, "je_nallocx"), + mallctl = apiGetFunctionAddress(JEMALLOC, "je_mallctl"), + mallctlnametomib = apiGetFunctionAddress(JEMALLOC, "je_mallctlnametomib"), + mallctlbymib = apiGetFunctionAddress(JEMALLOC, "je_mallctlbymib"), + malloc_stats_print = apiGetFunctionAddress(JEMALLOC, "je_malloc_stats_print"), + malloc_usable_size = apiGetFunctionAddress(JEMALLOC, "je_malloc_usable_size"); + + } + + /** Returns the jemalloc {@link SharedLibrary}. */ + public static SharedLibrary getLibrary() { + return JEMALLOC; + } + + static { + // Force jemalloc to initialize before anyone else uses it. + // This avoids a dangerous race when the first jemalloc functions are called concurrently. + if (Platform.get() == Platform.WINDOWS) { + nje_free(nje_malloc(8)); + } + } + + // --- [ je_malloc_message ] --- + + /** Returns the {@code je_malloc_message} variable. */ + @NativeType("void (*) (void *, char const *) *") + public static PointerBuffer je_malloc_message() { + long __result = Functions.malloc_message; + return memPointerBuffer(__result, 1); + } + + // --- [ je_malloc ] --- + + /** Unsafe version of: {@link #je_malloc malloc} */ + public static long nje_malloc(long size) { + long __functionAddress = Functions.malloc; + return invokePP(size, __functionAddress); + } + + /** + * Allocates {@code size} bytes of uninitialized memory. The allocated space is suitably aligned (after possible pointer coercion) for storage of any type + * of object. + * + * @param size the number of bytes to allocate + */ + @Nullable + @NativeType("void *") + public static ByteBuffer je_malloc(@NativeType("size_t") long size) { + long __result = nje_malloc(size); + return memByteBufferSafe(__result, (int)size); + } + + // --- [ je_calloc ] --- + + /** Unsafe version of: {@link #je_calloc calloc} */ + public static long nje_calloc(long num, long size) { + long __functionAddress = Functions.calloc; + return invokePPP(num, size, __functionAddress); + } + + /** + * Allocates space for {@code num} objects, each {@code size} bytes in length. The result is identical to calling {@link #je_malloc malloc} with an argument of + * {@code num * size}, with the exception that the allocated memory is explicitly initialized to zero bytes. + * + * @param num the number of objects to allocate + * @param size the size of each object, in bytes + */ + @Nullable + @NativeType("void *") + public static ByteBuffer je_calloc(@NativeType("size_t") long num, @NativeType("size_t") long size) { + long __result = nje_calloc(num, size); + return memByteBufferSafe(__result, (int)num * (int)size); + } + + // --- [ je_posix_memalign ] --- + + /** Unsafe version of: {@link #je_posix_memalign posix_memalign} */ + public static int nje_posix_memalign(long memptr, long alignment, long size) { + long __functionAddress = Functions.posix_memalign; + return invokePPPI(memptr, alignment, size, __functionAddress); + } + + /** + * Allocates {@code size} bytes of memory such that the allocation's base address is an even multiple of {@code alignment}, and returns the allocation in + * the value pointed to by {@code memptr}. The requested alignment must be a power of 2 at least as large as {@code sizeof(void *)}. + * + * @param memptr returns the allocated memory + * @param alignment the allocation alignment, in bytes + * @param size the number of bytes to allocate + */ + public static int je_posix_memalign(@NativeType("void **") PointerBuffer memptr, @NativeType("size_t") long alignment, @NativeType("size_t") long size) { + if (CHECKS) { + check(memptr, 1); + } + return nje_posix_memalign(memAddress(memptr), alignment, size); + } + + // --- [ je_aligned_alloc ] --- + + /** Unsafe version of: {@link #je_aligned_alloc aligned_alloc} */ + public static long nje_aligned_alloc(long alignment, long size) { + long __functionAddress = Functions.aligned_alloc; + return invokePPP(alignment, size, __functionAddress); + } + + /** + * Allocates {@code size} bytes of memory such that the allocation's base address is an even multiple of {@code alignment}. The requested alignment must + * be a power of 2. Behavior is undefined if {@code size} is not an integral multiple of {@code alignment}. + * + * @param alignment the allocation alignment, in bytes + * @param size the number of bytes to allocate + */ + @Nullable + @NativeType("void *") + public static ByteBuffer je_aligned_alloc(@NativeType("size_t") long alignment, @NativeType("size_t") long size) { + long __result = nje_aligned_alloc(alignment, size); + return memByteBufferSafe(__result, (int)size); + } + + // --- [ je_realloc ] --- + + /** Unsafe version of: {@link #je_realloc realloc} */ + public static long nje_realloc(long ptr, long size) { + long __functionAddress = Functions.realloc; + return invokePPP(ptr, size, __functionAddress); + } + + /** + * Changes the size of the previously allocated memory referenced by {@code ptr} to {@code size} bytes. The contents of the memory are unchanged up to the + * lesser of the new and old sizes. If the new size is larger, the contents of the newly allocated portion of the memory are undefined. Upon success, the + * memory referenced by {@code ptr} is freed and a pointer to the newly allocated memory is returned. Note that realloc() may move the memory allocation, + * resulting in a different return value than {@code ptr}. If {@code ptr} is {@code NULL}, the realloc() function behaves identically to malloc() for the + * specified size. + * + * @param ptr the previously allocated memory or {@code NULL} + * @param size the number of bytes to allocate + */ + @Nullable + @NativeType("void *") + public static ByteBuffer je_realloc(@Nullable @NativeType("void *") ByteBuffer ptr, @NativeType("size_t") long size) { + long __result = nje_realloc(memAddressSafe(ptr), size); + return memByteBufferSafe(__result, (int)size); + } + + // --- [ je_free ] --- + + /** Unsafe version of: {@link #je_free free} */ + public static void nje_free(long ptr) { + long __functionAddress = Functions.free; + invokePV(ptr, __functionAddress); + } + + /** + * Causes the allocated memory referenced by {@code ptr} to be made available for future allocations. If {@code ptr} is {@code NULL}, no action occurs. + * + * @param ptr the allocated memory to free + */ + public static void je_free(@Nullable @NativeType("void *") ByteBuffer ptr) { + nje_free(memAddressSafe(ptr)); + } + + /** + * Causes the allocated memory referenced by {@code ptr} to be made available for future allocations. If {@code ptr} is {@code NULL}, no action occurs. + * + * @param ptr the allocated memory to free + */ + public static void je_free(@Nullable @NativeType("void *") ShortBuffer ptr) { + nje_free(memAddressSafe(ptr)); + } + + /** + * Causes the allocated memory referenced by {@code ptr} to be made available for future allocations. If {@code ptr} is {@code NULL}, no action occurs. + * + * @param ptr the allocated memory to free + */ + public static void je_free(@Nullable @NativeType("void *") IntBuffer ptr) { + nje_free(memAddressSafe(ptr)); + } + + /** + * Causes the allocated memory referenced by {@code ptr} to be made available for future allocations. If {@code ptr} is {@code NULL}, no action occurs. + * + * @param ptr the allocated memory to free + */ + public static void je_free(@Nullable @NativeType("void *") LongBuffer ptr) { + nje_free(memAddressSafe(ptr)); + } + + /** + * Causes the allocated memory referenced by {@code ptr} to be made available for future allocations. If {@code ptr} is {@code NULL}, no action occurs. + * + * @param ptr the allocated memory to free + */ + public static void je_free(@Nullable @NativeType("void *") FloatBuffer ptr) { + nje_free(memAddressSafe(ptr)); + } + + /** + * Causes the allocated memory referenced by {@code ptr} to be made available for future allocations. If {@code ptr} is {@code NULL}, no action occurs. + * + * @param ptr the allocated memory to free + */ + public static void je_free(@Nullable @NativeType("void *") DoubleBuffer ptr) { + nje_free(memAddressSafe(ptr)); + } + + /** + * Causes the allocated memory referenced by {@code ptr} to be made available for future allocations. If {@code ptr} is {@code NULL}, no action occurs. + * + * @param ptr the allocated memory to free + */ + public static void je_free(@Nullable @NativeType("void *") PointerBuffer ptr) { + nje_free(memAddressSafe(ptr)); + } + + // --- [ je_mallocx ] --- + + /** Unsafe version of: {@link #je_mallocx mallocx} */ + public static long nje_mallocx(long size, int flags) { + long __functionAddress = Functions.mallocx; + return invokePP(size, flags, __functionAddress); + } + + /** + * Allocates at least {@code size} bytes of memory, and returns a pointer to the base address of the allocation. Behavior is undefined if {@code size} is + * 0, or if request size overflows due to size class and/or alignment constraints. + * + * @param size the number of bytes to allocate + * @param flags a bitfield of zero or more of the {@code MALLOCX} macros + */ + @Nullable + @NativeType("void *") + public static ByteBuffer je_mallocx(@NativeType("size_t") long size, int flags) { + long __result = nje_mallocx(size, flags); + return memByteBufferSafe(__result, (int)size); + } + + // --- [ je_rallocx ] --- + + /** Unsafe version of: {@link #je_rallocx rallocx} */ + public static long nje_rallocx(long ptr, long size, int flags) { + long __functionAddress = Functions.rallocx; + return invokePPP(ptr, size, flags, __functionAddress); + } + + /** + * Resizes the allocation at {@code ptr} to be at least {@code size} bytes, and returns a pointer to the base address of the resulting allocation, which + * may or may not have moved from its original location. Behavior is undefined if {@code size} is 0, or if request size overflows due to size class and/or + * alignment constraints. + * + * @param ptr the previously allocated memory or {@code NULL} + * @param size the number of bytes to allocate + * @param flags a bitfield of zero or more of the {@code MALLOCX} macros + */ + @Nullable + @NativeType("void *") + public static ByteBuffer je_rallocx(@Nullable @NativeType("void *") ByteBuffer ptr, @NativeType("size_t") long size, int flags) { + long __result = nje_rallocx(memAddressSafe(ptr), size, flags); + return memByteBufferSafe(__result, (int)size); + } + + // --- [ je_xallocx ] --- + + /** Unsafe version of: {@link #je_xallocx xallocx} */ + public static long nje_xallocx(long ptr, long size, long extra, int flags) { + long __functionAddress = Functions.xallocx; + return invokePPPP(ptr, size, extra, flags, __functionAddress); + } + + /** + * Resizes the allocation at {@code ptr} in place to be at least size bytes, and returns the real size of the allocation. If {@code extra} is non-zero, an + * attempt is made to resize the allocation to be at least {@code (size + extra)} bytes, though inability to allocate the extra byte(s) will not by itself + * result in failure to resize. Behavior is undefined if {@code size} is 0, or if {@code (size + extra > SIZE_T_MAX)}. + * + * @param ptr the previously allocated memory or {@code NULL} + * @param size the number of bytes to allocate + * @param extra the number of extra bytes to allocate + * @param flags a bitfield of zero or more of the {@code MALLOCX} macros + */ + @NativeType("size_t") + public static long je_xallocx(@Nullable @NativeType("void *") ByteBuffer ptr, @NativeType("size_t") long size, @NativeType("size_t") long extra, int flags) { + return nje_xallocx(memAddressSafe(ptr), size, extra, flags); + } + + // --- [ je_sallocx ] --- + + /** Unsafe version of: {@link #je_sallocx sallocx} */ + public static long nje_sallocx(long ptr, int flags) { + long __functionAddress = Functions.sallocx; + return invokePP(ptr, flags, __functionAddress); + } + + /** + * Returns the real size of the allocation at {@code ptr}. + * + * @param ptr the allocated memory to query + * @param flags a bitfield of zero or more of the {@code MALLOCX} macros + */ + @NativeType("size_t") + public static long je_sallocx(@NativeType("void const *") ByteBuffer ptr, int flags) { + return nje_sallocx(memAddress(ptr), flags); + } + + // --- [ je_dallocx ] --- + + /** Unsafe version of: {@link #je_dallocx dallocx} */ + public static void nje_dallocx(long ptr, int flags) { + long __functionAddress = Functions.dallocx; + invokePV(ptr, flags, __functionAddress); + } + + /** + * Causes the memory referenced by {@code ptr} to be made available for future allocations. + * + * @param ptr the allocated memory to deallocate + * @param flags a bitfield of zero or more of the {@code MALLOCX} macros + */ + public static void je_dallocx(@NativeType("void *") ByteBuffer ptr, int flags) { + nje_dallocx(memAddress(ptr), flags); + } + + /** + * Causes the memory referenced by {@code ptr} to be made available for future allocations. + * + * @param ptr the allocated memory to deallocate + * @param flags a bitfield of zero or more of the {@code MALLOCX} macros + */ + public static void je_dallocx(@NativeType("void *") ShortBuffer ptr, int flags) { + nje_dallocx(memAddress(ptr), flags); + } + + /** + * Causes the memory referenced by {@code ptr} to be made available for future allocations. + * + * @param ptr the allocated memory to deallocate + * @param flags a bitfield of zero or more of the {@code MALLOCX} macros + */ + public static void je_dallocx(@NativeType("void *") IntBuffer ptr, int flags) { + nje_dallocx(memAddress(ptr), flags); + } + + /** + * Causes the memory referenced by {@code ptr} to be made available for future allocations. + * + * @param ptr the allocated memory to deallocate + * @param flags a bitfield of zero or more of the {@code MALLOCX} macros + */ + public static void je_dallocx(@NativeType("void *") LongBuffer ptr, int flags) { + nje_dallocx(memAddress(ptr), flags); + } + + /** + * Causes the memory referenced by {@code ptr} to be made available for future allocations. + * + * @param ptr the allocated memory to deallocate + * @param flags a bitfield of zero or more of the {@code MALLOCX} macros + */ + public static void je_dallocx(@NativeType("void *") FloatBuffer ptr, int flags) { + nje_dallocx(memAddress(ptr), flags); + } + + /** + * Causes the memory referenced by {@code ptr} to be made available for future allocations. + * + * @param ptr the allocated memory to deallocate + * @param flags a bitfield of zero or more of the {@code MALLOCX} macros + */ + public static void je_dallocx(@NativeType("void *") DoubleBuffer ptr, int flags) { + nje_dallocx(memAddress(ptr), flags); + } + + /** + * Causes the memory referenced by {@code ptr} to be made available for future allocations. + * + * @param ptr the allocated memory to deallocate + * @param flags a bitfield of zero or more of the {@code MALLOCX} macros + */ + public static void je_dallocx(@NativeType("void *") PointerBuffer ptr, int flags) { + nje_dallocx(memAddress(ptr), flags); + } + + // --- [ je_sdallocx ] --- + + /** + * Unsafe version of: {@link #je_sdallocx sdallocx} + * + * @param size the number of bytes in {@code ptr} + */ + public static void nje_sdallocx(long ptr, long size, int flags) { + long __functionAddress = Functions.sdallocx; + invokePPV(ptr, size, flags, __functionAddress); + } + + /** + * Sized version of {@link #je_dallocx dallocx}. The primary optimization over {@code dallocx()} is the removal of a metadata read, which often suffers an L1 cache miss. + * + * @param ptr the allocated memory to deallocate + * @param flags a bitfield of zero or more of the {@code MALLOCX} macros + */ + public static void je_sdallocx(@NativeType("void *") ByteBuffer ptr, int flags) { + nje_sdallocx(memAddress(ptr), ptr.remaining(), flags); + } + + /** + * Sized version of {@link #je_dallocx dallocx}. The primary optimization over {@code dallocx()} is the removal of a metadata read, which often suffers an L1 cache miss. + * + * @param ptr the allocated memory to deallocate + * @param flags a bitfield of zero or more of the {@code MALLOCX} macros + */ + public static void je_sdallocx(@NativeType("void *") ShortBuffer ptr, int flags) { + nje_sdallocx(memAddress(ptr), Integer.toUnsignedLong(ptr.remaining()) << 1, flags); + } + + /** + * Sized version of {@link #je_dallocx dallocx}. The primary optimization over {@code dallocx()} is the removal of a metadata read, which often suffers an L1 cache miss. + * + * @param ptr the allocated memory to deallocate + * @param flags a bitfield of zero or more of the {@code MALLOCX} macros + */ + public static void je_sdallocx(@NativeType("void *") IntBuffer ptr, int flags) { + nje_sdallocx(memAddress(ptr), Integer.toUnsignedLong(ptr.remaining()) << 2, flags); + } + + /** + * Sized version of {@link #je_dallocx dallocx}. The primary optimization over {@code dallocx()} is the removal of a metadata read, which often suffers an L1 cache miss. + * + * @param ptr the allocated memory to deallocate + * @param flags a bitfield of zero or more of the {@code MALLOCX} macros + */ + public static void je_sdallocx(@NativeType("void *") LongBuffer ptr, int flags) { + nje_sdallocx(memAddress(ptr), Integer.toUnsignedLong(ptr.remaining()) << 3, flags); + } + + /** + * Sized version of {@link #je_dallocx dallocx}. The primary optimization over {@code dallocx()} is the removal of a metadata read, which often suffers an L1 cache miss. + * + * @param ptr the allocated memory to deallocate + * @param flags a bitfield of zero or more of the {@code MALLOCX} macros + */ + public static void je_sdallocx(@NativeType("void *") FloatBuffer ptr, int flags) { + nje_sdallocx(memAddress(ptr), Integer.toUnsignedLong(ptr.remaining()) << 2, flags); + } + + /** + * Sized version of {@link #je_dallocx dallocx}. The primary optimization over {@code dallocx()} is the removal of a metadata read, which often suffers an L1 cache miss. + * + * @param ptr the allocated memory to deallocate + * @param flags a bitfield of zero or more of the {@code MALLOCX} macros + */ + public static void je_sdallocx(@NativeType("void *") DoubleBuffer ptr, int flags) { + nje_sdallocx(memAddress(ptr), Integer.toUnsignedLong(ptr.remaining()) << 3, flags); + } + + /** + * Sized version of {@link #je_dallocx dallocx}. The primary optimization over {@code dallocx()} is the removal of a metadata read, which often suffers an L1 cache miss. + * + * @param ptr the allocated memory to deallocate + * @param flags a bitfield of zero or more of the {@code MALLOCX} macros + */ + public static void je_sdallocx(@NativeType("void *") PointerBuffer ptr, int flags) { + nje_sdallocx(memAddress(ptr), Integer.toUnsignedLong(ptr.remaining()) << POINTER_SHIFT, flags); + } + + // --- [ je_nallocx ] --- + + /** Unsafe version of: {@link #je_nallocx nallocx} */ + public static long nje_nallocx(long size, int flags) { + long __functionAddress = Functions.nallocx; + return invokePP(size, flags, __functionAddress); + } + + /** + * Allocates no memory, but it performs the same size computation as the {@link #je_mallocx mallocx} function, and returns the real size of the allocation that would + * result from the equivalent {@code mallocx()} function call. Behavior is undefined if {@code size} is 0, or if request size overflows due to size class + * and/or alignment constraints. + * + * @param size the number of bytes to allocate + * @param flags a bitfield of zero or more of the {@code MALLOCX} macros + */ + @Nullable + @NativeType("void *") + public static ByteBuffer je_nallocx(@NativeType("size_t") long size, int flags) { + long __result = nje_nallocx(size, flags); + return memByteBufferSafe(__result, (int)size); + } + + // --- [ je_mallctl ] --- + + /** + * Unsafe version of: {@link #je_mallctl mallctl} + * + * @param newlen the new value length + */ + public static int nje_mallctl(long name, long oldp, long oldlenp, long newp, long newlen) { + long __functionAddress = Functions.mallctl; + return invokePPPPPI(name, oldp, oldlenp, newp, newlen, __functionAddress); + } + + /** + * Provides a general interface for introspecting the memory allocator, as well as setting modifiable parameters and triggering actions. The + * period-separated {@code name} argument specifies a location in a tree-structured namespace; see the + * MALLCTL NAMESPACE section for + * documentation on the tree contents. To read a value, pass a pointer via {@code oldp} to adequate space to contain the value, and a pointer to its + * length via {@code oldlenp}; otherwise pass {@code NULL} and {@code NULL}. Similarly, to write a value, pass a pointer to the value via {@code newp}, and its length + * via {@code newlen}; otherwise pass {@code NULL} and {@code 0}. + * + * @param name the namespace location + * @param oldp returns a value + * @param oldlenp returns the value length + * @param newp the new value + */ + public static int je_mallctl(@NativeType("char const *") ByteBuffer name, @Nullable @NativeType("void *") ByteBuffer oldp, @Nullable @NativeType("size_t *") PointerBuffer oldlenp, @Nullable @NativeType("void *") ByteBuffer newp) { + if (CHECKS) { + checkNT1(name); + checkSafe(oldlenp, 1); + } + return nje_mallctl(memAddress(name), memAddressSafe(oldp), memAddressSafe(oldlenp), memAddressSafe(newp), remainingSafe(newp)); + } + + /** + * Provides a general interface for introspecting the memory allocator, as well as setting modifiable parameters and triggering actions. The + * period-separated {@code name} argument specifies a location in a tree-structured namespace; see the + * MALLCTL NAMESPACE section for + * documentation on the tree contents. To read a value, pass a pointer via {@code oldp} to adequate space to contain the value, and a pointer to its + * length via {@code oldlenp}; otherwise pass {@code NULL} and {@code NULL}. Similarly, to write a value, pass a pointer to the value via {@code newp}, and its length + * via {@code newlen}; otherwise pass {@code NULL} and {@code 0}. + * + * @param name the namespace location + * @param oldp returns a value + * @param oldlenp returns the value length + * @param newp the new value + */ + public static int je_mallctl(@NativeType("char const *") CharSequence name, @Nullable @NativeType("void *") ByteBuffer oldp, @Nullable @NativeType("size_t *") PointerBuffer oldlenp, @Nullable @NativeType("void *") ByteBuffer newp) { + if (CHECKS) { + checkSafe(oldlenp, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + return nje_mallctl(nameEncoded, memAddressSafe(oldp), memAddressSafe(oldlenp), memAddressSafe(newp), remainingSafe(newp)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ je_mallctlnametomib ] --- + + /** + * Unsafe version of: {@link #je_mallctlnametomib mallctlnametomib} + * + * @param miblenp the number of components in {@code mibp} + */ + public static int nje_mallctlnametomib(long name, long mibp, long miblenp) { + long __functionAddress = Functions.mallctlnametomib; + return invokePPPI(name, mibp, miblenp, __functionAddress); + } + + /** + * Provides a way to avoid repeated name lookups for applications that repeatedly query the same portion of the namespace, by translating a name to a + * “Management Information Base” (MIB) that can be passed repeatedly to {@link #je_mallctlbymib mallctlbymib}. Upon successful return from {@code mallctlnametomib()}, + * {@code mibp} contains an array of {@code *miblenp} integers, where {@code *miblenp} is the lesser of the number of components in name and the input + * value of {@code *miblenp}. Thus it is possible to pass a {@code *miblenp} that is smaller than the number of period-separated name components, which + * results in a partial MIB that can be used as the basis for constructing a complete MIB. For name components that are integers (e.g. the 2 in + * "arenas.bin.2.size"), the corresponding MIB component will always be that integer. Therefore, it is legitimate to construct code like the following: + * + *

+     * unsigned nbins, i;
+     * size_t mib[4];
+     * size_t len, miblen;
+     * 
+     * len = sizeof(nbins);
+     * mallctl("arenas.nbins", &nbins, &len, NULL, 0);
+     * 
+     * miblen = 4;
+     * mallctlnametomib("arenas.bin.0.size", mib, &miblen);
+     * for (i = 0; i < nbins; i++) {
+     *     size_t bin_size;
+     * 
+     *     mib[2] = i;
+     *     len = sizeof(bin_size);
+     *     mallctlbymib(mib, miblen, &bin_size, &len, NULL, 0);
+     *     // Do something with bin_size...
+     * }
+ * + * @param name the namespace location + * @param mibp an array of integers + * @param miblenp the number of components in {@code mibp} + */ + public static int je_mallctlnametomib(@NativeType("char const *") ByteBuffer name, @NativeType("size_t *") PointerBuffer mibp, @NativeType("size_t *") PointerBuffer miblenp) { + if (CHECKS) { + checkNT1(name); + check(miblenp, 1); + check(mibp, miblenp.get(miblenp.position())); + } + return nje_mallctlnametomib(memAddress(name), memAddress(mibp), memAddress(miblenp)); + } + + /** + * Provides a way to avoid repeated name lookups for applications that repeatedly query the same portion of the namespace, by translating a name to a + * “Management Information Base” (MIB) that can be passed repeatedly to {@link #je_mallctlbymib mallctlbymib}. Upon successful return from {@code mallctlnametomib()}, + * {@code mibp} contains an array of {@code *miblenp} integers, where {@code *miblenp} is the lesser of the number of components in name and the input + * value of {@code *miblenp}. Thus it is possible to pass a {@code *miblenp} that is smaller than the number of period-separated name components, which + * results in a partial MIB that can be used as the basis for constructing a complete MIB. For name components that are integers (e.g. the 2 in + * "arenas.bin.2.size"), the corresponding MIB component will always be that integer. Therefore, it is legitimate to construct code like the following: + * + *

+     * unsigned nbins, i;
+     * size_t mib[4];
+     * size_t len, miblen;
+     * 
+     * len = sizeof(nbins);
+     * mallctl("arenas.nbins", &nbins, &len, NULL, 0);
+     * 
+     * miblen = 4;
+     * mallctlnametomib("arenas.bin.0.size", mib, &miblen);
+     * for (i = 0; i < nbins; i++) {
+     *     size_t bin_size;
+     * 
+     *     mib[2] = i;
+     *     len = sizeof(bin_size);
+     *     mallctlbymib(mib, miblen, &bin_size, &len, NULL, 0);
+     *     // Do something with bin_size...
+     * }
+ * + * @param name the namespace location + * @param mibp an array of integers + * @param miblenp the number of components in {@code mibp} + */ + public static int je_mallctlnametomib(@NativeType("char const *") CharSequence name, @NativeType("size_t *") PointerBuffer mibp, @NativeType("size_t *") PointerBuffer miblenp) { + if (CHECKS) { + check(miblenp, 1); + check(mibp, miblenp.get(miblenp.position())); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + return nje_mallctlnametomib(nameEncoded, memAddress(mibp), memAddress(miblenp)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ je_mallctlbymib ] --- + + /** + * Unsafe version of: {@link #je_mallctlbymib mallctlbymib} + * + * @param miblen the number of elements in {@code mib} + * @param newlen the new value length + */ + public static int nje_mallctlbymib(long mib, long miblen, long oldp, long oldlenp, long newp, long newlen) { + long __functionAddress = Functions.mallctlbymib; + return invokePPPPPPI(mib, miblen, oldp, oldlenp, newp, newlen, __functionAddress); + } + + /** + * Similar to {@link #je_mallctl mallctl}, but uses MIBs instead of names. See {@link #je_mallctlnametomib mallctlnametomib} for details. + * + * @param mib a MIB + * @param oldp returns a value + * @param oldlenp returns the value length + * @param newp the new value + */ + public static int je_mallctlbymib(@NativeType("size_t const *") PointerBuffer mib, @Nullable @NativeType("void *") ByteBuffer oldp, @Nullable @NativeType("size_t *") PointerBuffer oldlenp, @Nullable @NativeType("void *") ByteBuffer newp) { + if (CHECKS) { + checkSafe(oldlenp, 1); + } + return nje_mallctlbymib(memAddress(mib), mib.remaining(), memAddressSafe(oldp), memAddressSafe(oldlenp), memAddressSafe(newp), remainingSafe(newp)); + } + + // --- [ je_malloc_stats_print ] --- + + /** Unsafe version of: {@link #je_malloc_stats_print malloc_stats_print} */ + public static void nje_malloc_stats_print(long write_cb, long cbopaque, long opts) { + long __functionAddress = Functions.malloc_stats_print; + invokePPPV(write_cb, cbopaque, opts, __functionAddress); + } + + /** + * Writes human-readable summary statistics via the {@code write_cb} callback function pointer and {@code cbopaque} data passed to {@code write_cb}, or + * {@code malloc_message()} if {@code write_cb} is {@code NULL}. This function can be called repeatedly. General information that never changes during execution + * can be omitted by specifying "g" as a character within the {@code opts} string. Note that {@code malloc_message()} uses the {@code mallctl*()} + * functions internally, so inconsistent statistics can be reported if multiple threads use these functions simultaneously. If {@code --enable-stats} is + * specified during configuration, “m” and “a” can be specified to omit merged arena and per arena statistics, respectively; “b” and “l” can be specified to + * omit per size class statistics for bins and large objects, respectively. Unrecognized characters are silently ignored. Note that thread caching may + * prevent some statistics from being completely up to date, since extra locking would be required to merge counters that track thread cache operations. + * + * @param write_cb the print callback, or {@code NULL} to use {@code malloc_message()} + * @param cbopaque an opaque pointer that will be passed to {@code write_cb} + * @param opts an options string + */ + public static void je_malloc_stats_print(@Nullable @NativeType("void (*) (void *, char const *)") MallocMessageCallbackI write_cb, @NativeType("void *") long cbopaque, @Nullable @NativeType("char const *") ByteBuffer opts) { + if (CHECKS) { + checkNT1Safe(opts); + } + nje_malloc_stats_print(memAddressSafe(write_cb), cbopaque, memAddressSafe(opts)); + } + + /** + * Writes human-readable summary statistics via the {@code write_cb} callback function pointer and {@code cbopaque} data passed to {@code write_cb}, or + * {@code malloc_message()} if {@code write_cb} is {@code NULL}. This function can be called repeatedly. General information that never changes during execution + * can be omitted by specifying "g" as a character within the {@code opts} string. Note that {@code malloc_message()} uses the {@code mallctl*()} + * functions internally, so inconsistent statistics can be reported if multiple threads use these functions simultaneously. If {@code --enable-stats} is + * specified during configuration, “m” and “a” can be specified to omit merged arena and per arena statistics, respectively; “b” and “l” can be specified to + * omit per size class statistics for bins and large objects, respectively. Unrecognized characters are silently ignored. Note that thread caching may + * prevent some statistics from being completely up to date, since extra locking would be required to merge counters that track thread cache operations. + * + * @param write_cb the print callback, or {@code NULL} to use {@code malloc_message()} + * @param cbopaque an opaque pointer that will be passed to {@code write_cb} + * @param opts an options string + */ + public static void je_malloc_stats_print(@Nullable @NativeType("void (*) (void *, char const *)") MallocMessageCallbackI write_cb, @NativeType("void *") long cbopaque, @Nullable @NativeType("char const *") CharSequence opts) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCIISafe(opts, true); + long optsEncoded = opts == null ? NULL : stack.getPointerAddress(); + nje_malloc_stats_print(memAddressSafe(write_cb), cbopaque, optsEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ je_malloc_usable_size ] --- + + /** Unsafe version of: {@link #je_malloc_usable_size malloc_usable_size} */ + public static long nje_malloc_usable_size(long ptr) { + long __functionAddress = Functions.malloc_usable_size; + return invokePP(ptr, __functionAddress); + } + + /** + * Returns the usable size of the allocation pointed to by {@code ptr}. The return value may be larger than the size that was requested during allocation. + * The {@code malloc_usable_size()} function is not a mechanism for in-place {@link #je_realloc realloc}; rather it is provided solely as a tool for introspection + * purposes. Any discrepancy between the requested allocation size and the size reported by {@code malloc_usable_size()} should not be depended on, since + * such behavior is entirely implementation-dependent. + * + * @param ptr the allocated memory to query + */ + @NativeType("size_t") + public static long je_malloc_usable_size(@NativeType("void const *") ByteBuffer ptr) { + return nje_malloc_usable_size(memAddress(ptr)); + } + + /** + * Align the memory allocation to start at an address that is a multiple of {@code (1 << la)}. This macro does not validate that {@code la} is within the + * valid range. + * + * @param la the alignment shift + */ + public static int MALLOCX_LG_ALIGN(int la) { + return la; + } + + /** + * Align the memory allocation to start at an address that is a multiple of {@code a}, where {@code a} is a power of two. This macro does not validate + * that {@code a} is a power of 2. + * + * @param a the alignment + */ + public static int MALLOCX_ALIGN(int a) { + return Integer.numberOfTrailingZeros(a); + } + + /** + * Use the thread-specific cache (tcache) specified by the identifier {@code tc}, which must have been acquired via the {@code tcache.create} mallctl. + * This macro does not validate that {@code tc} specifies a valid identifier. + * + * @param tc the thread-specific cache + */ + public static int MALLOCX_TCACHE(int tc) { + return (tc + 2) << 8; + } + + /** + * Use the arena specified by the index {@code a} (and by necessity bypass the thread cache). This macro has no effect for huge regions, nor for regions + * that were allocated via an arena other than the one specified. This macro does not validate that {@code a} specifies an arena index in the valid range. + * + * @param a the arena index + */ + public static int MALLOCX_ARENA(int a) { + return (a + 1) << 20; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/JEmallocAllocator.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/JEmallocAllocator.java new file mode 100644 index 00000000..83efa997 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/JEmallocAllocator.java @@ -0,0 +1,68 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jemalloc; + +import org.lwjgl.system.MemoryUtil.*; + +import static org.lwjgl.system.jemalloc.JEmalloc.*; + +/** A {@link MemoryAllocator} implementation using the jemalloc library. */ +public class JEmallocAllocator implements MemoryAllocator { + + static { + // initialize jemalloc + JEmalloc.getLibrary(); + } + + @Override + public long getMalloc() { return Functions.malloc; } + + @Override + public long getCalloc() { return Functions.calloc; } + + @Override + public long getRealloc() { return Functions.realloc; } + + @Override + public long getFree() { return Functions.free; } + + @Override + public long getAlignedAlloc() { return Functions.aligned_alloc; } + + @Override + public long getAlignedFree() { return Functions.free; } + + @Override + public long malloc(long size) { + return nje_malloc(size); + } + + @Override + public long calloc(long num, long size) { + return nje_calloc(num, size); + } + + @Override + public long realloc(long ptr, long size) { + return nje_realloc(ptr, size); + } + + @Override + public void free(long ptr) { + nje_free(ptr); + } + + @Override + public long aligned_alloc(long alignment, long size) { + return nje_aligned_alloc(alignment, size); + } + + @Override + public void aligned_free(long ptr) { + nje_free(ptr); + } + +} diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/MallocMessageCallback.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/MallocMessageCallback.java new file mode 100644 index 00000000..dedea9db --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/MallocMessageCallback.java @@ -0,0 +1,89 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jemalloc; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Instances of this class may be passed to the {@link JEmalloc#je_malloc_usable_size malloc_usable_size} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     void *cbopaque,
+ *     char const *s
+ * )
+ */ +public abstract class MallocMessageCallback extends Callback implements MallocMessageCallbackI { + + /** + * Creates a {@code MallocMessageCallback} instance from the specified function pointer. + * + * @return the new {@code MallocMessageCallback} + */ + public static MallocMessageCallback create(long functionPointer) { + MallocMessageCallbackI instance = Callback.get(functionPointer); + return instance instanceof MallocMessageCallback + ? (MallocMessageCallback)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static MallocMessageCallback createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code MallocMessageCallback} instance that delegates to the specified {@code MallocMessageCallbackI} instance. */ + public static MallocMessageCallback create(MallocMessageCallbackI instance) { + return instance instanceof MallocMessageCallback + ? (MallocMessageCallback)instance + : new Container(instance.address(), instance); + } + + protected MallocMessageCallback() { + super(SIGNATURE); + } + + MallocMessageCallback(long functionPointer) { + super(functionPointer); + } + + /** + * Converts the specified {@link MallocMessageCallback} arguments to a String. + * + *

This method may only be used inside a MallocMessageCallback invocation.

+ * + * @param s the MallocMessageCallback {@code s} argument + * + * @return the message as a String + */ + public static String getMessage(long s) { + return memASCII(s); + } + + private static final class Container extends MallocMessageCallback { + + private final MallocMessageCallbackI delegate; + + Container(long functionPointer, MallocMessageCallbackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long cbopaque, long s) { + delegate.invoke(cbopaque, s); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/MallocMessageCallbackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/MallocMessageCallbackI.java new file mode 100644 index 00000000..f3e2cf13 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/MallocMessageCallbackI.java @@ -0,0 +1,48 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jemalloc; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link JEmalloc#je_malloc_usable_size malloc_usable_size} method. + * + *

Type

+ * + *

+ * void (*) (
+ *     void *cbopaque,
+ *     char const *s
+ * )
+ */ +@FunctionalInterface +@NativeType("void (*) (void *, char const *)") +public interface MallocMessageCallbackI extends CallbackI.V { + + String SIGNATURE = "(pp)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgPointer(args), + dcbArgPointer(args) + ); + } + + /** + * Will be called by the {@link JEmalloc#je_malloc_usable_size malloc_usable_size} method. + * + * @param cbopaque the opaque pointer passed to {@link JEmalloc#je_malloc_usable_size malloc_usable_size} + * @param s the message + */ + void invoke(@NativeType("void *") long cbopaque, @NativeType("char const *") long s); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/package-info.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/package-info.java new file mode 100644 index 00000000..609f02fd --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jemalloc/package-info.java @@ -0,0 +1,33 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ + +/** + * Contains bindings to the jemalloc library. jemalloc is a general purpose malloc implementation that emphasizes + * fragmentation avoidance and scalable concurrency support. + * + *

The jemalloc documentation can be found here. The jemalloc + * wiki also contains useful information.

+ * + *

The jemalloc shared library that comes with LWJGL is configured with:

+ * + *
    + *
  • --with-jemalloc-prefix=je_
  • + *
  • --enable-lazy-lock (Linux)
  • + *
  • --disable-stats
  • + *
  • --disable-fill
  • + *
  • --disable-cxx
  • + *
  • --disable-initial-exec-tls (Linux & macOS)
  • + *
  • --disable-zone-allocator (macOS)
  • + *
+ * + *

The shared library may be replaced with a custom build that has more features enabled.

+ * + *

Dynamic configuration (for enabled features) is also possible, using either the {@code MALLOC_CONF} environment variable or the + * MALLCTL NAMESPACE and the {@code mallctl*} functions.

+ */ +@org.lwjgl.system.NonnullDefault +package org.lwjgl.system.jemalloc; + diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jni/JNINativeInterface.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jni/JNINativeInterface.java new file mode 100644 index 00000000..9c3ca153 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jni/JNINativeInterface.java @@ -0,0 +1,1133 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jni; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +import java.lang.reflect.*; + +/** + * Bindings to the Java Native Interface (JNI). + * + *

The JNI is a native programming interface. It allows Java code that runs inside a Java Virtual Machine (VM) to interoperate with applications and + * libraries written in other programming languages, such as C, C++, and assembly.

+ * + *

The most important benefit of the JNI is that it imposes no restrictions on the implementation of the underlying Java VM. Therefore, Java VM vendors + * can add support for the JNI without affecting other parts of the VM. Programmers can write one version of a native application or library and expect it + * to work with all Java VMs supporting the JNI.

+ * + *

LWJGL: Only functions that can reasonably be called from Java are exposed.

+ */ +public class JNINativeInterface { + + /** JNI versions. */ + public static final int + JNI_VERSION_1_1 = 0x10001, + JNI_VERSION_1_2 = 0x10002, + JNI_VERSION_1_4 = 0x10004, + JNI_VERSION_1_6 = 0x10006, + JNI_VERSION_1_8 = 0x10008, + JNI_VERSION_9 = 0x90000, + JNI_VERSION_10 = 0xA0000; + + /** + * {@code jobjectRefType}: Return values from {@link #GetObjectRefType}. + * + *
Enum values:
+ * + *
    + *
  • {@link #JNIInvalidRefType JNIInvalidRefType}
  • + *
  • {@link #JNILocalRefType JNILocalRefType}
  • + *
  • {@link #JNIGlobalRefType JNIGlobalRefType}
  • + *
  • {@link #JNIWeakGlobalRefType JNIWeakGlobalRefType}
  • + *
+ */ + public static final int + JNIInvalidRefType = 0, + JNILocalRefType = 1, + JNIGlobalRefType = 2, + JNIWeakGlobalRefType = 3; + + /** jboolean constants. */ + public static final int + JNI_FALSE = 0, + JNI_TRUE = 1; + + /** + * Possible return values for JNI functions. + * + *
Enum values:
+ * + *
    + *
  • {@link #JNI_OK OK} - success
  • + *
  • {@link #JNI_ERR ERR} - unknown error
  • + *
  • {@link #JNI_EDETACHED EDETACHED} - thread detached from the VM
  • + *
  • {@link #JNI_EVERSION EVERSION} - JNI version error
  • + *
  • {@link #JNI_ENOMEM ENOMEM} - not enough memory
  • + *
  • {@link #JNI_EEXIST EEXIST} - VM already created
  • + *
  • {@link #JNI_EINVAL EINVAL} - invalid arguments
  • + *
+ */ + public static final int + JNI_OK = 0, + JNI_ERR = (-1), + JNI_EDETACHED = (-2), + JNI_EVERSION = (-3), + JNI_ENOMEM = (-4), + JNI_EEXIST = (-5), + JNI_EINVAL = (-6); + + /** Used in {@code ReleaseScalarArrayElements}. */ + public static final int + JNI_COMMIT = 1, + JNI_ABORT = 2; + + static { Library.initialize(); } + + protected JNINativeInterface() { + throw new UnsupportedOperationException(); + } + + // --- [ GetVersion ] --- + + /** + * Returns the version of the native method interface. + * + * @return the major version number in the higher 16 bits and the minor version number in the lower 16 bits + */ + @NativeType("jint") + public static native int GetVersion(); + + // --- [ FromReflectedMethod ] --- + + /** Converts a {@link Method} or {@link Constructor} object to a method ID. */ + @NativeType("jmethodID") + public static native long FromReflectedMethod(@NativeType("jobject") Method method); + + // --- [ FromReflectedField ] --- + + /** Converts a {@link Field} to a field ID. */ + @NativeType("jfieldID") + public static native long FromReflectedField(@NativeType("jobject") Field field); + + // --- [ ToReflectedMethod ] --- + + /** Unsafe version of: {@link #ToReflectedMethod} */ + @Nullable + public static native Method nToReflectedMethod(Class cls, long methodID, boolean isStatic); + + /** + * Converts a method ID derived from {@code cls} to a {@link Method} or {@link Constructor} object. + * + * @param isStatic must be set to {@link #JNI_TRUE TRUE} if the method ID refers to a static field, and # FALSE otherwise + */ + @Nullable + @NativeType("jobject") + public static Method ToReflectedMethod(@NativeType("jclass") Class cls, @NativeType("jmethodID") long methodID, @NativeType("jboolean") boolean isStatic) { + if (CHECKS) { + check(methodID); + } + return nToReflectedMethod(cls, methodID, isStatic); + } + + // --- [ ToReflectedField ] --- + + /** Unsafe version of: {@link #ToReflectedField} */ + @Nullable + public static native Field nToReflectedField(Class cls, long fieldID, boolean isStatic); + + /** + * Converts a field ID derived from {@code cls} to a {@link Field} object. + * + * @param isStatic must be set to {@link #JNI_TRUE TRUE} if {@code fieldID} refers to a static field, and {@link #JNI_FALSE FALSE} otherwise + */ + @Nullable + @NativeType("jobject") + public static Field ToReflectedField(@NativeType("jclass") Class cls, @NativeType("jfieldID") long fieldID, @NativeType("jboolean") boolean isStatic) { + if (CHECKS) { + check(fieldID); + } + return nToReflectedField(cls, fieldID, isStatic); + } + + // --- [ NewGlobalRef ] --- + + /** + * Creates a new global reference to the object referred to by the {@code obj} argument. The {@code obj} argument may be a global or local reference. + * Global references must be explicitly disposed of by calling {@link #DeleteGlobalRef}. + * + * @param obj a global or local reference + * + * @return a global reference, or {@code NULL} if the system runs out of memory + */ + @NativeType("void *") + public static native long NewGlobalRef(@NativeType("jobject") Object obj); + + // --- [ DeleteGlobalRef ] --- + + /** Unsafe version of: {@link #DeleteGlobalRef} */ + public static native void nDeleteGlobalRef(long globalRef); + + /** + * Deletes the global reference pointed to by {@code globalRef}. + * + * @param globalRef a global reference + */ + public static void DeleteGlobalRef(@NativeType("void *") long globalRef) { + if (CHECKS) { + check(globalRef); + } + nDeleteGlobalRef(globalRef); + } + + // --- [ GetBooleanArrayElements ] --- + + /** Unsafe version of: {@link #GetBooleanArrayElements} */ + public static native long nGetBooleanArrayElements(byte[] array, long isCopy); + + /** + * Returns the body of the primitive array. The result is valid until the {@link #ReleaseBooleanArrayElements} function is called. Since the returned array + * may be a copy of the Java array, changes made to the returned array will not necessarily be reflected in the original array until + * {@link #ReleaseBooleanArrayElements} is called. + * + *

If {@code isCopy} is not {@code NULL}, then {@code *isCopy} is set to {@link #JNI_TRUE TRUE} if a copy is made; or it is set to {@link #JNI_FALSE FALSE} if no copy is made.

+ * + * @param array the primitive array + * @param isCopy a pointer to a boolean + * + * @return a pointer to the array elements, or {@code NULL} if the operation fails + */ + @Nullable + @NativeType("jboolean *") + public static ByteBuffer GetBooleanArrayElements(@NativeType("jbooleanArray") byte[] array, @Nullable @NativeType("jboolean *") ByteBuffer isCopy) { + if (CHECKS) { + checkSafe(isCopy, 1); + } + long __result = nGetBooleanArrayElements(array, memAddressSafe(isCopy)); + return memByteBufferSafe(__result, array.length); + } + + // --- [ ReleaseBooleanArrayElements ] --- + + /** Unsafe version of: {@link #ReleaseBooleanArrayElements} */ + public static native void nReleaseBooleanArrayElements(byte[] array, long elems, int mode); + + /** + * Informs the VM that the native code no longer needs access to {@code elems}. The {@code elems} argument is a pointer derived from array using the + * {@link #GetBooleanArrayElements} function. If necessary, this function copies back all changes made to elems to the original array. + * + *

The {@code mode} argument provides information on how the array buffer should be released. {@code mode} has no effect if {@code elems} is not a + * copy of the elements in array. Otherwise, mode has the following impact, as shown in the following table:

+ * + * + * + * + * + * + *
modeactions
0copy back the content and free the elems buffer
{@link #JNI_COMMIT COMMIT}copy back the content but do not free the elems buffer
{@link #JNI_ABORT ABORT}free the buffer without copying back the possible changes
+ * + *

In most cases, programmers pass “0” to the mode argument to ensure consistent behavior for both pinned and copied arrays. The other options give + * the programmer more control over memory management and should be used with extreme care.

+ * + * @param array a Java array object + * @param elems a pointer to array elements + * @param mode the release mode. One of:
0{@link #JNI_COMMIT COMMIT}{@link #JNI_ABORT ABORT}
+ */ + public static void ReleaseBooleanArrayElements(@NativeType("jbooleanArray") byte[] array, @NativeType("jboolean *") ByteBuffer elems, @NativeType("jint") int mode) { + nReleaseBooleanArrayElements(array, memAddress(elems), mode); + } + + // --- [ GetByteArrayElements ] --- + + /** Unsafe version of: {@link #GetByteArrayElements} */ + public static native long nGetByteArrayElements(byte[] array, long isCopy); + + /** + * Returns the body of the primitive array. The result is valid until the {@link #ReleaseByteArrayElements} function is called. Since the returned array + * may be a copy of the Java array, changes made to the returned array will not necessarily be reflected in the original array until + * {@link #ReleaseByteArrayElements} is called. + * + *

If {@code isCopy} is not {@code NULL}, then {@code *isCopy} is set to {@link #JNI_TRUE TRUE} if a copy is made; or it is set to {@link #JNI_FALSE FALSE} if no copy is made.

+ * + * @param array the primitive array + * @param isCopy a pointer to a boolean + * + * @return a pointer to the array elements, or {@code NULL} if the operation fails + */ + @Nullable + @NativeType("jbyte *") + public static ByteBuffer GetByteArrayElements(@NativeType("jbyteArray") byte[] array, @Nullable @NativeType("jboolean *") ByteBuffer isCopy) { + if (CHECKS) { + checkSafe(isCopy, 1); + } + long __result = nGetByteArrayElements(array, memAddressSafe(isCopy)); + return memByteBufferSafe(__result, array.length); + } + + // --- [ ReleaseByteArrayElements ] --- + + /** Unsafe version of: {@link #ReleaseByteArrayElements} */ + public static native void nReleaseByteArrayElements(byte[] array, long elems, int mode); + + /** + * Informs the VM that the native code no longer needs access to {@code elems}. The {@code elems} argument is a pointer derived from array using the + * {@link #GetByteArrayElements} function. If necessary, this function copies back all changes made to elems to the original array. + * + *

The {@code mode} argument provides information on how the array buffer should be released. {@code mode} has no effect if {@code elems} is not a + * copy of the elements in array. Otherwise, mode has the following impact, as shown in the following table:

+ * + * + * + * + * + * + *
modeactions
0copy back the content and free the elems buffer
{@link #JNI_COMMIT COMMIT}copy back the content but do not free the elems buffer
{@link #JNI_ABORT ABORT}free the buffer without copying back the possible changes
+ * + *

In most cases, programmers pass “0” to the mode argument to ensure consistent behavior for both pinned and copied arrays. The other options give + * the programmer more control over memory management and should be used with extreme care.

+ * + * @param array a Java array object + * @param elems a pointer to array elements + * @param mode the release mode. One of:
0{@link #JNI_COMMIT COMMIT}{@link #JNI_ABORT ABORT}
+ */ + public static void ReleaseByteArrayElements(@NativeType("jbyteArray") byte[] array, @NativeType("jbyte *") ByteBuffer elems, @NativeType("jint") int mode) { + nReleaseByteArrayElements(array, memAddress(elems), mode); + } + + // --- [ GetCharArrayElements ] --- + + /** Unsafe version of: {@link #GetCharArrayElements} */ + public static native long nGetCharArrayElements(char[] array, long isCopy); + + /** + * Returns the body of the primitive array. The result is valid until the {@link #ReleaseCharArrayElements} function is called. Since the returned array + * may be a copy of the Java array, changes made to the returned array will not necessarily be reflected in the original array until + * {@link #ReleaseCharArrayElements} is called. + * + *

If {@code isCopy} is not {@code NULL}, then {@code *isCopy} is set to {@link #JNI_TRUE TRUE} if a copy is made; or it is set to {@link #JNI_FALSE FALSE} if no copy is made.

+ * + * @param array the primitive array + * @param isCopy a pointer to a boolean + * + * @return a pointer to the array elements, or {@code NULL} if the operation fails + */ + @Nullable + @NativeType("jchar *") + public static ShortBuffer GetCharArrayElements(@NativeType("jcharArray") char[] array, @Nullable @NativeType("jboolean *") ByteBuffer isCopy) { + if (CHECKS) { + checkSafe(isCopy, 1); + } + long __result = nGetCharArrayElements(array, memAddressSafe(isCopy)); + return memShortBufferSafe(__result, array.length); + } + + // --- [ ReleaseCharArrayElements ] --- + + /** Unsafe version of: {@link #ReleaseCharArrayElements} */ + public static native void nReleaseCharArrayElements(char[] array, long elems, int mode); + + /** + * Informs the VM that the native code no longer needs access to {@code elems}. The {@code elems} argument is a pointer derived from array using the + * {@link #GetCharArrayElements} function. If necessary, this function copies back all changes made to elems to the original array. + * + *

The {@code mode} argument provides information on how the array buffer should be released. {@code mode} has no effect if {@code elems} is not a + * copy of the elements in array. Otherwise, mode has the following impact, as shown in the following table:

+ * + * + * + * + * + * + *
modeactions
0copy back the content and free the elems buffer
{@link #JNI_COMMIT COMMIT}copy back the content but do not free the elems buffer
{@link #JNI_ABORT ABORT}free the buffer without copying back the possible changes
+ * + *

In most cases, programmers pass “0” to the mode argument to ensure consistent behavior for both pinned and copied arrays. The other options give + * the programmer more control over memory management and should be used with extreme care.

+ * + * @param array a Java array object + * @param elems a pointer to array elements + * @param mode the release mode. One of:
0{@link #JNI_COMMIT COMMIT}{@link #JNI_ABORT ABORT}
+ */ + public static void ReleaseCharArrayElements(@NativeType("jcharArray") char[] array, @NativeType("jchar *") ShortBuffer elems, @NativeType("jint") int mode) { + nReleaseCharArrayElements(array, memAddress(elems), mode); + } + + // --- [ GetShortArrayElements ] --- + + /** Unsafe version of: {@link #GetShortArrayElements} */ + public static native long nGetShortArrayElements(short[] array, long isCopy); + + /** + * Returns the body of the primitive array. The result is valid until the {@link #ReleaseShortArrayElements} function is called. Since the returned array + * may be a copy of the Java array, changes made to the returned array will not necessarily be reflected in the original array until + * {@link #ReleaseShortArrayElements} is called. + * + *

If {@code isCopy} is not {@code NULL}, then {@code *isCopy} is set to {@link #JNI_TRUE TRUE} if a copy is made; or it is set to {@link #JNI_FALSE FALSE} if no copy is made.

+ * + * @param array the primitive array + * @param isCopy a pointer to a boolean + * + * @return a pointer to the array elements, or {@code NULL} if the operation fails + */ + @Nullable + @NativeType("jshort *") + public static ShortBuffer GetShortArrayElements(@NativeType("jshortArray") short[] array, @Nullable @NativeType("jboolean *") ByteBuffer isCopy) { + if (CHECKS) { + checkSafe(isCopy, 1); + } + long __result = nGetShortArrayElements(array, memAddressSafe(isCopy)); + return memShortBufferSafe(__result, array.length); + } + + // --- [ ReleaseShortArrayElements ] --- + + /** Unsafe version of: {@link #ReleaseShortArrayElements} */ + public static native void nReleaseShortArrayElements(short[] array, long elems, int mode); + + /** + * Informs the VM that the native code no longer needs access to {@code elems}. The {@code elems} argument is a pointer derived from array using the + * {@link #GetShortArrayElements} function. If necessary, this function copies back all changes made to elems to the original array. + * + *

The {@code mode} argument provides information on how the array buffer should be released. {@code mode} has no effect if {@code elems} is not a + * copy of the elements in array. Otherwise, mode has the following impact, as shown in the following table:

+ * + * + * + * + * + * + *
modeactions
0copy back the content and free the elems buffer
{@link #JNI_COMMIT COMMIT}copy back the content but do not free the elems buffer
{@link #JNI_ABORT ABORT}free the buffer without copying back the possible changes
+ * + *

In most cases, programmers pass “0” to the mode argument to ensure consistent behavior for both pinned and copied arrays. The other options give + * the programmer more control over memory management and should be used with extreme care.

+ * + * @param array a Java array object + * @param elems a pointer to array elements + * @param mode the release mode. One of:
0{@link #JNI_COMMIT COMMIT}{@link #JNI_ABORT ABORT}
+ */ + public static void ReleaseShortArrayElements(@NativeType("jshortArray") short[] array, @NativeType("jshort *") ShortBuffer elems, @NativeType("jint") int mode) { + nReleaseShortArrayElements(array, memAddress(elems), mode); + } + + // --- [ GetIntArrayElements ] --- + + /** Unsafe version of: {@link #GetIntArrayElements} */ + public static native long nGetIntArrayElements(int[] array, long isCopy); + + /** + * Returns the body of the primitive array. The result is valid until the {@link #ReleaseIntArrayElements} function is called. Since the returned array + * may be a copy of the Java array, changes made to the returned array will not necessarily be reflected in the original array until + * {@link #ReleaseIntArrayElements} is called. + * + *

If {@code isCopy} is not {@code NULL}, then {@code *isCopy} is set to {@link #JNI_TRUE TRUE} if a copy is made; or it is set to {@link #JNI_FALSE FALSE} if no copy is made.

+ * + * @param array the primitive array + * @param isCopy a pointer to a boolean + * + * @return a pointer to the array elements, or {@code NULL} if the operation fails + */ + @Nullable + @NativeType("jint *") + public static IntBuffer GetIntArrayElements(@NativeType("jintArray") int[] array, @Nullable @NativeType("jboolean *") ByteBuffer isCopy) { + if (CHECKS) { + checkSafe(isCopy, 1); + } + long __result = nGetIntArrayElements(array, memAddressSafe(isCopy)); + return memIntBufferSafe(__result, array.length); + } + + // --- [ ReleaseIntArrayElements ] --- + + /** Unsafe version of: {@link #ReleaseIntArrayElements} */ + public static native void nReleaseIntArrayElements(int[] array, long elems, int mode); + + /** + * Informs the VM that the native code no longer needs access to {@code elems}. The {@code elems} argument is a pointer derived from array using the + * {@link #GetIntArrayElements} function. If necessary, this function copies back all changes made to elems to the original array. + * + *

The {@code mode} argument provides information on how the array buffer should be released. {@code mode} has no effect if {@code elems} is not a + * copy of the elements in array. Otherwise, mode has the following impact, as shown in the following table:

+ * + * + * + * + * + * + *
modeactions
0copy back the content and free the elems buffer
{@link #JNI_COMMIT COMMIT}copy back the content but do not free the elems buffer
{@link #JNI_ABORT ABORT}free the buffer without copying back the possible changes
+ * + *

In most cases, programmers pass “0” to the mode argument to ensure consistent behavior for both pinned and copied arrays. The other options give + * the programmer more control over memory management and should be used with extreme care.

+ * + * @param array a Java array object + * @param elems a pointer to array elements + * @param mode the release mode. One of:
0{@link #JNI_COMMIT COMMIT}{@link #JNI_ABORT ABORT}
+ */ + public static void ReleaseIntArrayElements(@NativeType("jintArray") int[] array, @NativeType("jint *") IntBuffer elems, @NativeType("jint") int mode) { + nReleaseIntArrayElements(array, memAddress(elems), mode); + } + + // --- [ GetLongArrayElements ] --- + + /** Unsafe version of: {@link #GetLongArrayElements} */ + public static native long nGetLongArrayElements(long[] array, long isCopy); + + /** + * Returns the body of the primitive array. The result is valid until the {@link #ReleaseLongArrayElements} function is called. Since the returned array + * may be a copy of the Java array, changes made to the returned array will not necessarily be reflected in the original array until + * {@link #ReleaseLongArrayElements} is called. + * + *

If {@code isCopy} is not {@code NULL}, then {@code *isCopy} is set to {@link #JNI_TRUE TRUE} if a copy is made; or it is set to {@link #JNI_FALSE FALSE} if no copy is made.

+ * + * @param array the primitive array + * @param isCopy a pointer to a boolean + * + * @return a pointer to the array elements, or {@code NULL} if the operation fails + */ + @Nullable + @NativeType("jlong *") + public static LongBuffer GetLongArrayElements(@NativeType("jlongArray") long[] array, @Nullable @NativeType("jboolean *") ByteBuffer isCopy) { + if (CHECKS) { + checkSafe(isCopy, 1); + } + long __result = nGetLongArrayElements(array, memAddressSafe(isCopy)); + return memLongBufferSafe(__result, array.length); + } + + // --- [ ReleaseLongArrayElements ] --- + + /** Unsafe version of: {@link #ReleaseLongArrayElements} */ + public static native void nReleaseLongArrayElements(long[] array, long elems, int mode); + + /** + * Informs the VM that the native code no longer needs access to {@code elems}. The {@code elems} argument is a pointer derived from array using the + * {@link #GetLongArrayElements} function. If necessary, this function copies back all changes made to elems to the original array. + * + *

The {@code mode} argument provides information on how the array buffer should be released. {@code mode} has no effect if {@code elems} is not a + * copy of the elements in array. Otherwise, mode has the following impact, as shown in the following table:

+ * + * + * + * + * + * + *
modeactions
0copy back the content and free the elems buffer
{@link #JNI_COMMIT COMMIT}copy back the content but do not free the elems buffer
{@link #JNI_ABORT ABORT}free the buffer without copying back the possible changes
+ * + *

In most cases, programmers pass “0” to the mode argument to ensure consistent behavior for both pinned and copied arrays. The other options give + * the programmer more control over memory management and should be used with extreme care.

+ * + * @param array a Java array object + * @param elems a pointer to array elements + * @param mode the release mode. One of:
0{@link #JNI_COMMIT COMMIT}{@link #JNI_ABORT ABORT}
+ */ + public static void ReleaseLongArrayElements(@NativeType("jlongArray") long[] array, @NativeType("jlong *") LongBuffer elems, @NativeType("jint") int mode) { + nReleaseLongArrayElements(array, memAddress(elems), mode); + } + + // --- [ GetFloatArrayElements ] --- + + /** Unsafe version of: {@link #GetFloatArrayElements} */ + public static native long nGetFloatArrayElements(float[] array, long isCopy); + + /** + * Returns the body of the primitive array. The result is valid until the {@link #ReleaseFloatArrayElements} function is called. Since the returned array + * may be a copy of the Java array, changes made to the returned array will not necessarily be reflected in the original array until + * {@link #ReleaseFloatArrayElements} is called. + * + *

If {@code isCopy} is not {@code NULL}, then {@code *isCopy} is set to {@link #JNI_TRUE TRUE} if a copy is made; or it is set to {@link #JNI_FALSE FALSE} if no copy is made.

+ * + * @param array the primitive array + * @param isCopy a pointer to a boolean + * + * @return a pointer to the array elements, or {@code NULL} if the operation fails + */ + @Nullable + @NativeType("jfloat *") + public static FloatBuffer GetFloatArrayElements(@NativeType("jfloatArray") float[] array, @Nullable @NativeType("jboolean *") ByteBuffer isCopy) { + if (CHECKS) { + checkSafe(isCopy, 1); + } + long __result = nGetFloatArrayElements(array, memAddressSafe(isCopy)); + return memFloatBufferSafe(__result, array.length); + } + + // --- [ ReleaseFloatArrayElements ] --- + + /** Unsafe version of: {@link #ReleaseFloatArrayElements} */ + public static native void nReleaseFloatArrayElements(float[] array, long elems, int mode); + + /** + * Informs the VM that the native code no longer needs access to {@code elems}. The {@code elems} argument is a pointer derived from array using the + * {@link #GetFloatArrayElements} function. If necessary, this function copies back all changes made to elems to the original array. + * + *

The {@code mode} argument provides information on how the array buffer should be released. {@code mode} has no effect if {@code elems} is not a + * copy of the elements in array. Otherwise, mode has the following impact, as shown in the following table:

+ * + * + * + * + * + * + *
modeactions
0copy back the content and free the elems buffer
{@link #JNI_COMMIT COMMIT}copy back the content but do not free the elems buffer
{@link #JNI_ABORT ABORT}free the buffer without copying back the possible changes
+ * + *

In most cases, programmers pass “0” to the mode argument to ensure consistent behavior for both pinned and copied arrays. The other options give + * the programmer more control over memory management and should be used with extreme care.

+ * + * @param array a Java array object + * @param elems a pointer to array elements + * @param mode the release mode. One of:
0{@link #JNI_COMMIT COMMIT}{@link #JNI_ABORT ABORT}
+ */ + public static void ReleaseFloatArrayElements(@NativeType("jfloatArray") float[] array, @NativeType("jfloat *") FloatBuffer elems, @NativeType("jint") int mode) { + nReleaseFloatArrayElements(array, memAddress(elems), mode); + } + + // --- [ GetDoubleArrayElements ] --- + + /** Unsafe version of: {@link #GetDoubleArrayElements} */ + public static native long nGetDoubleArrayElements(double[] array, long isCopy); + + /** + * Returns the body of the primitive array. The result is valid until the {@link #ReleaseDoubleArrayElements} function is called. Since the returned array + * may be a copy of the Java array, changes made to the returned array will not necessarily be reflected in the original array until + * {@link #ReleaseDoubleArrayElements} is called. + * + *

If {@code isCopy} is not {@code NULL}, then {@code *isCopy} is set to {@link #JNI_TRUE TRUE} if a copy is made; or it is set to {@link #JNI_FALSE FALSE} if no copy is made.

+ * + * @param array the primitive array + * @param isCopy a pointer to a boolean + * + * @return a pointer to the array elements, or {@code NULL} if the operation fails + */ + @Nullable + @NativeType("jdouble *") + public static DoubleBuffer GetDoubleArrayElements(@NativeType("jdoubleArray") double[] array, @Nullable @NativeType("jboolean *") ByteBuffer isCopy) { + if (CHECKS) { + checkSafe(isCopy, 1); + } + long __result = nGetDoubleArrayElements(array, memAddressSafe(isCopy)); + return memDoubleBufferSafe(__result, array.length); + } + + // --- [ ReleaseDoubleArrayElements ] --- + + /** Unsafe version of: {@link #ReleaseDoubleArrayElements} */ + public static native void nReleaseDoubleArrayElements(double[] array, long elems, int mode); + + /** + * Informs the VM that the native code no longer needs access to {@code elems}. The {@code elems} argument is a pointer derived from array using the + * {@link #GetDoubleArrayElements} function. If necessary, this function copies back all changes made to elems to the original array. + * + *

The {@code mode} argument provides information on how the array buffer should be released. {@code mode} has no effect if {@code elems} is not a + * copy of the elements in array. Otherwise, mode has the following impact, as shown in the following table:

+ * + * + * + * + * + * + *
modeactions
0copy back the content and free the elems buffer
{@link #JNI_COMMIT COMMIT}copy back the content but do not free the elems buffer
{@link #JNI_ABORT ABORT}free the buffer without copying back the possible changes
+ * + *

In most cases, programmers pass “0” to the mode argument to ensure consistent behavior for both pinned and copied arrays. The other options give + * the programmer more control over memory management and should be used with extreme care.

+ * + * @param array a Java array object + * @param elems a pointer to array elements + * @param mode the release mode. One of:
0{@link #JNI_COMMIT COMMIT}{@link #JNI_ABORT ABORT}
+ */ + public static void ReleaseDoubleArrayElements(@NativeType("jdoubleArray") double[] array, @NativeType("jdouble *") DoubleBuffer elems, @NativeType("jint") int mode) { + nReleaseDoubleArrayElements(array, memAddress(elems), mode); + } + + // --- [ GetBooleanArrayRegion ] --- + + /** + * Unsafe version of: {@link #GetBooleanArrayRegion} + * + * @param len the number of elements to be copied + */ + public static native void nGetBooleanArrayRegion(byte[] array, int start, int len, long buf); + + /** + * Copies a region of a primitive array into a buffer. + * + * @param array a Java array + * @param start the starting index + * @param buf the destination buffer + */ + public static void GetBooleanArrayRegion(@NativeType("jbooleanArray") byte[] array, @NativeType("jsize") int start, @NativeType("jboolean *") ByteBuffer buf) { + nGetBooleanArrayRegion(array, start, buf.remaining(), memAddress(buf)); + } + + // --- [ SetBooleanArrayRegion ] --- + + /** + * Unsafe version of: {@link #SetBooleanArrayRegion} + * + * @param len the number of elements to be copied + */ + public static native void nSetBooleanArrayRegion(byte[] array, int start, int len, long buf); + + /** + * Copies back a region of a primitive array from a buffer. + * + * @param array a Java array + * @param start the starting index + * @param buf the source buffer + */ + public static void SetBooleanArrayRegion(@NativeType("jbooleanArray") byte[] array, @NativeType("jsize") int start, @NativeType("jboolean const *") ByteBuffer buf) { + nSetBooleanArrayRegion(array, start, buf.remaining(), memAddress(buf)); + } + + // --- [ GetByteArrayRegion ] --- + + /** + * Unsafe version of: {@link #GetByteArrayRegion} + * + * @param len the number of elements to be copied + */ + public static native void nGetByteArrayRegion(byte[] array, int start, int len, long buf); + + /** + * Copies a region of a primitive array into a buffer. + * + * @param array a Java array + * @param start the starting index + * @param buf the destination buffer + */ + public static void GetByteArrayRegion(@NativeType("jbyteArray") byte[] array, @NativeType("jsize") int start, @NativeType("jbyte *") ByteBuffer buf) { + nGetByteArrayRegion(array, start, buf.remaining(), memAddress(buf)); + } + + // --- [ SetByteArrayRegion ] --- + + /** + * Unsafe version of: {@link #SetByteArrayRegion} + * + * @param len the number of elements to be copied + */ + public static native void nSetByteArrayRegion(byte[] array, int start, int len, long buf); + + /** + * Copies back a region of a primitive array from a buffer. + * + * @param array a Java array + * @param start the starting index + * @param buf the source buffer + */ + public static void SetByteArrayRegion(@NativeType("jbyteArray") byte[] array, @NativeType("jsize") int start, @NativeType("jbyte const *") ByteBuffer buf) { + nSetByteArrayRegion(array, start, buf.remaining(), memAddress(buf)); + } + + // --- [ GetCharArrayRegion ] --- + + /** + * Unsafe version of: {@link #GetCharArrayRegion} + * + * @param len the number of elements to be copied + */ + public static native void nGetCharArrayRegion(char[] array, int start, int len, long buf); + + /** + * Copies a region of a primitive array into a buffer. + * + * @param array a Java array + * @param start the starting index + * @param buf the destination buffer + */ + public static void GetCharArrayRegion(@NativeType("jcharArray") char[] array, @NativeType("jsize") int start, @NativeType("jchar *") ShortBuffer buf) { + nGetCharArrayRegion(array, start, buf.remaining(), memAddress(buf)); + } + + // --- [ SetCharArrayRegion ] --- + + /** + * Unsafe version of: {@link #SetCharArrayRegion} + * + * @param len the number of elements to be copied + */ + public static native void nSetCharArrayRegion(char[] array, int start, int len, long buf); + + /** + * Copies back a region of a primitive array from a buffer. + * + * @param array a Java array + * @param start the starting index + * @param buf the source buffer + */ + public static void SetCharArrayRegion(@NativeType("jcharArray") char[] array, @NativeType("jsize") int start, @NativeType("jchar const *") ShortBuffer buf) { + nSetCharArrayRegion(array, start, buf.remaining(), memAddress(buf)); + } + + // --- [ GetShortArrayRegion ] --- + + /** + * Unsafe version of: {@link #GetShortArrayRegion} + * + * @param len the number of elements to be copied + */ + public static native void nGetShortArrayRegion(short[] array, int start, int len, long buf); + + /** + * Copies a region of a primitive array into a buffer. + * + * @param array a Java array + * @param start the starting index + * @param buf the destination buffer + */ + public static void GetShortArrayRegion(@NativeType("jshortArray") short[] array, @NativeType("jsize") int start, @NativeType("jshort *") ShortBuffer buf) { + nGetShortArrayRegion(array, start, buf.remaining(), memAddress(buf)); + } + + // --- [ SetShortArrayRegion ] --- + + /** + * Unsafe version of: {@link #SetShortArrayRegion} + * + * @param len the number of elements to be copied + */ + public static native void nSetShortArrayRegion(short[] array, int start, int len, long buf); + + /** + * Copies back a region of a primitive array from a buffer. + * + * @param array a Java array + * @param start the starting index + * @param buf the source buffer + */ + public static void SetShortArrayRegion(@NativeType("jshortArray") short[] array, @NativeType("jsize") int start, @NativeType("jshort const *") ShortBuffer buf) { + nSetShortArrayRegion(array, start, buf.remaining(), memAddress(buf)); + } + + // --- [ GetIntArrayRegion ] --- + + /** + * Unsafe version of: {@link #GetIntArrayRegion} + * + * @param len the number of elements to be copied + */ + public static native void nGetIntArrayRegion(int[] array, int start, int len, long buf); + + /** + * Copies a region of a primitive array into a buffer. + * + * @param array a Java array + * @param start the starting index + * @param buf the destination buffer + */ + public static void GetIntArrayRegion(@NativeType("jintArray") int[] array, @NativeType("jsize") int start, @NativeType("jint *") IntBuffer buf) { + nGetIntArrayRegion(array, start, buf.remaining(), memAddress(buf)); + } + + // --- [ SetIntArrayRegion ] --- + + /** + * Unsafe version of: {@link #SetIntArrayRegion} + * + * @param len the number of elements to be copied + */ + public static native void nSetIntArrayRegion(int[] array, int start, int len, long buf); + + /** + * Copies back a region of a primitive array from a buffer. + * + * @param array a Java array + * @param start the starting index + * @param buf the source buffer + */ + public static void SetIntArrayRegion(@NativeType("jintArray") int[] array, @NativeType("jsize") int start, @NativeType("jint const *") IntBuffer buf) { + nSetIntArrayRegion(array, start, buf.remaining(), memAddress(buf)); + } + + // --- [ GetLongArrayRegion ] --- + + /** + * Unsafe version of: {@link #GetLongArrayRegion} + * + * @param len the number of elements to be copied + */ + public static native void nGetLongArrayRegion(long[] array, int start, int len, long buf); + + /** + * Copies a region of a primitive array into a buffer. + * + * @param array a Java array + * @param start the starting index + * @param buf the destination buffer + */ + public static void GetLongArrayRegion(@NativeType("jlongArray") long[] array, @NativeType("jsize") int start, @NativeType("jlong *") LongBuffer buf) { + nGetLongArrayRegion(array, start, buf.remaining(), memAddress(buf)); + } + + // --- [ SetLongArrayRegion ] --- + + /** + * Unsafe version of: {@link #SetLongArrayRegion} + * + * @param len the number of elements to be copied + */ + public static native void nSetLongArrayRegion(long[] array, int start, int len, long buf); + + /** + * Copies back a region of a primitive array from a buffer. + * + * @param array a Java array + * @param start the starting index + * @param buf the source buffer + */ + public static void SetLongArrayRegion(@NativeType("jlongArray") long[] array, @NativeType("jsize") int start, @NativeType("jlong const *") LongBuffer buf) { + nSetLongArrayRegion(array, start, buf.remaining(), memAddress(buf)); + } + + // --- [ GetFloatArrayRegion ] --- + + /** + * Unsafe version of: {@link #GetFloatArrayRegion} + * + * @param len the number of elements to be copied + */ + public static native void nGetFloatArrayRegion(float[] array, int start, int len, long buf); + + /** + * Copies a region of a primitive array into a buffer. + * + * @param array a Java array + * @param start the starting index + * @param buf the destination buffer + */ + public static void GetFloatArrayRegion(@NativeType("jfloatArray") float[] array, @NativeType("jsize") int start, @NativeType("jfloat *") FloatBuffer buf) { + nGetFloatArrayRegion(array, start, buf.remaining(), memAddress(buf)); + } + + // --- [ SetFloatArrayRegion ] --- + + /** + * Unsafe version of: {@link #SetFloatArrayRegion} + * + * @param len the number of elements to be copied + */ + public static native void nSetFloatArrayRegion(float[] array, int start, int len, long buf); + + /** + * Copies back a region of a primitive array from a buffer. + * + * @param array a Java array + * @param start the starting index + * @param buf the source buffer + */ + public static void SetFloatArrayRegion(@NativeType("jfloatArray") float[] array, @NativeType("jsize") int start, @NativeType("jfloat const *") FloatBuffer buf) { + nSetFloatArrayRegion(array, start, buf.remaining(), memAddress(buf)); + } + + // --- [ GetDoubleArrayRegion ] --- + + /** + * Unsafe version of: {@link #GetDoubleArrayRegion} + * + * @param len the number of elements to be copied + */ + public static native void nGetDoubleArrayRegion(double[] array, int start, int len, long buf); + + /** + * Copies a region of a primitive array into a buffer. + * + * @param array a Java array + * @param start the starting index + * @param buf the destination buffer + */ + public static void GetDoubleArrayRegion(@NativeType("jdoubleArray") double[] array, @NativeType("jsize") int start, @NativeType("jdouble *") DoubleBuffer buf) { + nGetDoubleArrayRegion(array, start, buf.remaining(), memAddress(buf)); + } + + // --- [ SetDoubleArrayRegion ] --- + + /** + * Unsafe version of: {@link #SetDoubleArrayRegion} + * + * @param len the number of elements to be copied + */ + public static native void nSetDoubleArrayRegion(double[] array, int start, int len, long buf); + + /** + * Copies back a region of a primitive array from a buffer. + * + * @param array a Java array + * @param start the starting index + * @param buf the source buffer + */ + public static void SetDoubleArrayRegion(@NativeType("jdoubleArray") double[] array, @NativeType("jsize") int start, @NativeType("jdouble const *") DoubleBuffer buf) { + nSetDoubleArrayRegion(array, start, buf.remaining(), memAddress(buf)); + } + + // --- [ RegisterNatives ] --- + + /** + * Unsafe version of: {@link #RegisterNatives} + * + * @param nMethods the number of native methods in the class + */ + public static native int nRegisterNatives(Class targetClass, long methods, int nMethods); + + /** + * Registers native methods with the class specified by the {@code targetClass} argument. The methods parameter specifies an array of JNINativeMethod + * structures that contain the names, signatures, and function pointers of the native methods. The name and signature fields of the {@link JNINativeMethod} + * structure are pointers to modified UTF-8 strings. The {@code nMethods} parameter specifies the number of native methods in the array. + * + * @param methods the native methods in the class + * + * @return “0” on success; returns a negative value on failure + */ + @NativeType("jint") + public static int RegisterNatives(@NativeType("jclass") Class targetClass, @NativeType("JNINativeMethod const *") JNINativeMethod.Buffer methods) { + if (CHECKS) { + JNINativeMethod.validate(methods.address(), methods.remaining()); + } + return nRegisterNatives(targetClass, methods.address(), methods.remaining()); + } + + // --- [ UnregisterNatives ] --- + + /** + * Unregisters native methods of a class. The class goes back to the state before it was linked or registered with its native method functions. + * + *

This function should not be used in normal native code. Instead, it provides special programs a way to reload and relink native libraries.

+ * + * @param targetClass a Java class object + * + * @return “0” on success; returns a negative value on failure + */ + @NativeType("jint") + public static native int UnregisterNatives(@NativeType("jclass") Class targetClass); + + // --- [ GetJavaVM ] --- + + /** Unsafe version of: {@link #GetJavaVM} */ + public static native int nGetJavaVM(long vm); + + /** + * Returns the Java VM interface (used in the Invocation API) associated with the current thread. The result is placed at the location pointed to by the + * second argument, {@code vm}. + * + * @param vm a pointer to where the result should be placed + */ + @NativeType("jint") + public static int GetJavaVM(@NativeType("JavaVM **") PointerBuffer vm) { + if (CHECKS) { + check(vm, 1); + } + return nGetJavaVM(memAddress(vm)); + } + + // --- [ GetStringRegion ] --- + + /** Unsafe version of: {@link #GetStringRegion} */ + public static native void nGetStringRegion(String str, int start, int len, long buf); + + /** Copies {@code len} number of Unicode characters beginning at offset {@code start} to the given buffer {@code buf}. */ + public static void GetStringRegion(@NativeType("jstring") String str, @NativeType("jsize") int start, @NativeType("jchar *") ByteBuffer buf) { + nGetStringRegion(str, start, buf.remaining() >> 1, memAddress(buf)); + } + + // --- [ GetStringUTFRegion ] --- + + /** Unsafe version of: {@link #GetStringUTFRegion} */ + public static native void nGetStringUTFRegion(String str, int start, int len, long buf); + + /** + * Translates {@code len} number of Unicode characters beginning at offset start into modified UTF-8 encoding and place the result in the given buffer + * {@code buf}. + */ + public static void GetStringUTFRegion(@NativeType("jstring") String str, @NativeType("jsize") int start, @NativeType("jsize") int len, @NativeType("char *") ByteBuffer buf) { + if (CHECKS) { + check(buf, len); + } + nGetStringUTFRegion(str, start, len, memAddress(buf)); + } + + // --- [ NewWeakGlobalRef ] --- + + /** + * Creates a new weak global reference. Returns {@code NULL} if {@code obj} refers to null, or if the VM runs out of memory. If the VM runs out of memory, an + * {@code OutOfMemoryError} will be thrown. + */ + @NativeType("void *") + public static native long NewWeakGlobalRef(@NativeType("jobject") Object obj); + + // --- [ DeleteWeakGlobalRef ] --- + + /** Unsafe version of: {@link #DeleteWeakGlobalRef} */ + public static native void nDeleteWeakGlobalRef(long weakGlobalRef); + + /** Delete the VM resources needed for the given weak global reference. */ + public static void DeleteWeakGlobalRef(@NativeType("void *") long weakGlobalRef) { + if (CHECKS) { + check(weakGlobalRef); + } + nDeleteWeakGlobalRef(weakGlobalRef); + } + + // --- [ NewDirectByteBuffer ] --- + + /** Unsafe version of: {@link #NewDirectByteBuffer} */ + @Nullable + public static native ByteBuffer nNewDirectByteBuffer(long address, long capacity); + + /** + * Allocates and returns a direct {@code java.nio.ByteBuffer} referring to the block of memory starting at the memory address address and extending + * capacity bytes. + * + *

Native code that calls this function and returns the resulting byte-buffer object to Java-level code should ensure that the buffer refers to a valid + * region of memory that is accessible for reading and, if appropriate, writing. An attempt to access an invalid memory location from Java code will + * either return an arbitrary value, have no visible effect, or cause an unspecified exception to be thrown.

+ * + * @param address the starting address of the memory region (must not be {@code NULL}) + * @param capacity the size in bytes of the memory region (must be positive) + * + * @return a local reference to the newly-instantiated {@code java.nio.ByteBuffer} object. Returns {@code NULL} if an exception occurs, or if JNI access to direct + * buffers is not supported by this virtual machine. + */ + @Nullable + @NativeType("jobject") + public static ByteBuffer NewDirectByteBuffer(@NativeType("void *") long address, @NativeType("jlong") long capacity) { + if (CHECKS) { + check(address); + } + return nNewDirectByteBuffer(address, capacity); + } + + // --- [ GetDirectBufferAddress ] --- + + /** + * Fetches and returns the starting address of the memory region referenced by the given direct {@code java.nio.Buffer}. + * + *

This function allows native code to access the same memory region that is accessible to Java code via the buffer object.

+ * + * @param buf a direct {@code java.nio.Buffer} object (must not be {@code NULL}) + * + * @return the starting address of the memory region referenced by the buffer. Returns {@code NULL} if the memory region is undefined, if the given object is not a + * direct {@code java.nio.Buffer}, or if JNI access to direct buffers is not supported by this virtual machine. + */ + @NativeType("void *") + public static native long GetDirectBufferAddress(@NativeType("jobject") Buffer buf); + + // --- [ GetObjectRefType ] --- + + /** + * Returns the type of the object referred to by the {@code obj} argument. The argument {@code obj} can either be a local, global or weak global + * reference. + * + * @param obj a local, global or weak global reference + */ + @NativeType("jobjectRefType") + public static native int GetObjectRefType(@NativeType("jobject") Object obj); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jni/JNINativeMethod.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jni/JNINativeMethod.java new file mode 100644 index 00000000..81b90307 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jni/JNINativeMethod.java @@ -0,0 +1,372 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.jni; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Layout

+ * + *

+ * struct JNINativeMethod {
+ *     char * name;
+ *     char * signature;
+ *     void * fnPtr;
+ * }
+ */ +public class JNINativeMethod extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + NAME, + SIGNATURE, + FNPTR; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + NAME = layout.offsetof(0); + SIGNATURE = layout.offsetof(1); + FNPTR = layout.offsetof(2); + } + + /** + * Creates a {@code JNINativeMethod} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public JNINativeMethod(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code name} field. */ + @NativeType("char *") + public ByteBuffer name() { return nname(address()); } + /** Decodes the null-terminated string pointed to by the {@code name} field. */ + @NativeType("char *") + public String nameString() { return nnameString(address()); } + /** Returns a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code signature} field. */ + @NativeType("char *") + public ByteBuffer signature() { return nsignature(address()); } + /** Decodes the null-terminated string pointed to by the {@code signature} field. */ + @NativeType("char *") + public String signatureString() { return nsignatureString(address()); } + /** Returns the value of the {@code fnPtr} field. */ + @NativeType("void *") + public long fnPtr() { return nfnPtr(address()); } + + /** Sets the address of the specified encoded string to the {@code name} field. */ + public JNINativeMethod name(@NativeType("char *") ByteBuffer value) { nname(address(), value); return this; } + /** Sets the address of the specified encoded string to the {@code signature} field. */ + public JNINativeMethod signature(@NativeType("char *") ByteBuffer value) { nsignature(address(), value); return this; } + /** Sets the specified value to the {@code fnPtr} field. */ + public JNINativeMethod fnPtr(@NativeType("void *") long value) { nfnPtr(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public JNINativeMethod set( + ByteBuffer name, + ByteBuffer signature, + long fnPtr + ) { + name(name); + signature(signature); + fnPtr(fnPtr); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public JNINativeMethod set(JNINativeMethod src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code JNINativeMethod} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static JNINativeMethod malloc() { + return wrap(JNINativeMethod.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code JNINativeMethod} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static JNINativeMethod calloc() { + return wrap(JNINativeMethod.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code JNINativeMethod} instance allocated with {@link BufferUtils}. */ + public static JNINativeMethod create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(JNINativeMethod.class, memAddress(container), container); + } + + /** Returns a new {@code JNINativeMethod} instance for the specified memory address. */ + public static JNINativeMethod create(long address) { + return wrap(JNINativeMethod.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static JNINativeMethod createSafe(long address) { + return address == NULL ? null : wrap(JNINativeMethod.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code JNINativeMethod} instance allocated on the thread-local {@link MemoryStack}. */ + public static JNINativeMethod mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code JNINativeMethod} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static JNINativeMethod callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code JNINativeMethod} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static JNINativeMethod mallocStack(MemoryStack stack) { + return wrap(JNINativeMethod.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code JNINativeMethod} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static JNINativeMethod callocStack(MemoryStack stack) { + return wrap(JNINativeMethod.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #name}. */ + public static ByteBuffer nname(long struct) { return memByteBufferNT1(memGetAddress(struct + JNINativeMethod.NAME)); } + /** Unsafe version of {@link #nameString}. */ + public static String nnameString(long struct) { return memUTF8(memGetAddress(struct + JNINativeMethod.NAME)); } + /** Unsafe version of {@link #signature}. */ + public static ByteBuffer nsignature(long struct) { return memByteBufferNT1(memGetAddress(struct + JNINativeMethod.SIGNATURE)); } + /** Unsafe version of {@link #signatureString}. */ + public static String nsignatureString(long struct) { return memUTF8(memGetAddress(struct + JNINativeMethod.SIGNATURE)); } + /** Unsafe version of {@link #fnPtr}. */ + public static long nfnPtr(long struct) { return memGetAddress(struct + JNINativeMethod.FNPTR); } + + /** Unsafe version of {@link #name(ByteBuffer) name}. */ + public static void nname(long struct, ByteBuffer value) { + if (CHECKS) { checkNT1(value); } + memPutAddress(struct + JNINativeMethod.NAME, memAddress(value)); + } + /** Unsafe version of {@link #signature(ByteBuffer) signature}. */ + public static void nsignature(long struct, ByteBuffer value) { + if (CHECKS) { checkNT1(value); } + memPutAddress(struct + JNINativeMethod.SIGNATURE, memAddress(value)); + } + /** Unsafe version of {@link #fnPtr(long) fnPtr}. */ + public static void nfnPtr(long struct, long value) { memPutAddress(struct + JNINativeMethod.FNPTR, check(value)); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + JNINativeMethod.NAME)); + check(memGetAddress(struct + JNINativeMethod.SIGNATURE)); + check(memGetAddress(struct + JNINativeMethod.FNPTR)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link JNINativeMethod} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final JNINativeMethod ELEMENT_FACTORY = JNINativeMethod.create(-1L); + + /** + * Creates a new {@code JNINativeMethod.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link JNINativeMethod#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected JNINativeMethod getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code name} field. */ + @NativeType("char *") + public ByteBuffer name() { return JNINativeMethod.nname(address()); } + /** Decodes the null-terminated string pointed to by the {@code name} field. */ + @NativeType("char *") + public String nameString() { return JNINativeMethod.nnameString(address()); } + /** Returns a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code signature} field. */ + @NativeType("char *") + public ByteBuffer signature() { return JNINativeMethod.nsignature(address()); } + /** Decodes the null-terminated string pointed to by the {@code signature} field. */ + @NativeType("char *") + public String signatureString() { return JNINativeMethod.nsignatureString(address()); } + /** Returns the value of the {@code fnPtr} field. */ + @NativeType("void *") + public long fnPtr() { return JNINativeMethod.nfnPtr(address()); } + + /** Sets the address of the specified encoded string to the {@code name} field. */ + public Buffer name(@NativeType("char *") ByteBuffer value) { JNINativeMethod.nname(address(), value); return this; } + /** Sets the address of the specified encoded string to the {@code signature} field. */ + public Buffer signature(@NativeType("char *") ByteBuffer value) { JNINativeMethod.nsignature(address(), value); return this; } + /** Sets the specified value to the {@code fnPtr} field. */ + public Buffer fnPtr(@NativeType("void *") long value) { JNINativeMethod.nfnPtr(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/jni/package-info.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jni/package-info.java new file mode 100644 index 00000000..f5560b2d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/jni/package-info.java @@ -0,0 +1,10 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ + +/** Contains bindings to the Java Native Interface (JNI). */ +@org.lwjgl.system.NonnullDefault +package org.lwjgl.system.jni; + diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/LibCErrno.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/LibCErrno.java new file mode 100644 index 00000000..b56f0cfc --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/LibCErrno.java @@ -0,0 +1,134 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.libc; + +import org.lwjgl.system.*; + + +/** Native bindings to errno.h. */ +public class LibCErrno { + + /** + * Standard error codes. + * + *
Enum values:
+ * + *
    + *
  • {@link #EPERM EPERM} - Operation not permitted
  • + *
  • {@link #ENOENT ENOENT} - No such file or directory
  • + *
  • {@link #ESRCH ESRCH} - No such process
  • + *
  • {@link #EINTR EINTR} - Interrupted function
  • + *
  • {@link #EIO EIO} - I/O error
  • + *
  • {@link #ENXIO ENXIO} - No such device or address
  • + *
  • {@link #E2BIG E2BIG} - Argument list too long
  • + *
  • {@link #ENOEXEC ENOEXEC} - Exec format error
  • + *
  • {@link #EBADF EBADF} - Bad file number
  • + *
  • {@link #ECHILD ECHILD} - No spawned processes
  • + *
  • {@link #EAGAIN EAGAIN} - No more processes or not enough memory or maximum nesting level reached
  • + *
  • {@link #ENOMEM ENOMEM} - Not enough memory
  • + *
  • {@link #EACCES EACCES} - Permission denied
  • + *
  • {@link #EFAULT EFAULT} - Bad address
  • + *
  • {@link #EBUSY EBUSY} - Device or resource busy
  • + *
  • {@link #EEXIST EEXIST} - File exists
  • + *
  • {@link #EXDEV EXDEV} - Cross-device link
  • + *
  • {@link #ENODEV ENODEV} - No such device
  • + *
  • {@link #ENOTDIR ENOTDIR} - Not a directory
  • + *
  • {@link #EISDIR EISDIR} - Is a directory
  • + *
  • {@link #EINVAL EINVAL} - Invalid argument
  • + *
  • {@link #ENFILE ENFILE} - Too many files open in system
  • + *
  • {@link #EMFILE EMFILE} - Too many open files
  • + *
  • {@link #ENOTTY ENOTTY} - Inappropriate I/O control operation
  • + *
  • {@link #EFBIG EFBIG} - File too large
  • + *
  • {@link #ENOSPC ENOSPC} - No space left on device
  • + *
  • {@link #ESPIPE ESPIPE} - Invalid seek
  • + *
  • {@link #EROFS EROFS} - Read-only file system
  • + *
  • {@link #EMLINK EMLINK} - Too many links
  • + *
  • {@link #EPIPE EPIPE} - Broken pipe
  • + *
  • {@link #EDOM EDOM} - Math argument
  • + *
  • {@link #ERANGE ERANGE} - Result too large
  • + *
  • {@link #EDEADLK EDEADLK} - Resource deadlock would occur
  • + *
  • {@link #EDEADLOCK EDEADLOCK} - Same as EDEADLK for compatibility with older Microsoft C versions
  • + *
  • {@link #ENAMETOOLONG ENAMETOOLONG} - Filename too long
  • + *
  • {@link #ENOLCK ENOLCK} - No locks available
  • + *
  • {@link #ENOSYS ENOSYS} - Function not supported
  • + *
  • {@link #ENOTEMPTY ENOTEMPTY} - Directory not empty
  • + *
  • {@link #EILSEQ EILSEQ} - Illegal byte sequence
  • + *
  • {@link #STRUNCATE STRUNCATE} - String was truncated
  • + *
+ */ + public static final int + EPERM = 0x1, + ENOENT = 0x2, + ESRCH = 0x3, + EINTR = 0x4, + EIO = 0x5, + ENXIO = 0x6, + E2BIG = 0x7, + ENOEXEC = 0x8, + EBADF = 0x9, + ECHILD = 0xA, + EAGAIN = 0xB, + ENOMEM = 0xC, + EACCES = 0xD, + EFAULT = 0xE, + EBUSY = 0x10, + EEXIST = 0x11, + EXDEV = 0x12, + ENODEV = 0x13, + ENOTDIR = 0x14, + EISDIR = 0x15, + EINVAL = 0x16, + ENFILE = 0x17, + EMFILE = 0x18, + ENOTTY = 0x19, + EFBIG = 0x1B, + ENOSPC = 0x1C, + ESPIPE = 0x1D, + EROFS = 0x1E, + EMLINK = 0x1F, + EPIPE = 0x20, + EDOM = 0x21, + ERANGE = 0x22, + EDEADLK = 0x24, + EDEADLOCK = 0x24, + ENAMETOOLONG = 0x26, + ENOLCK = 0x27, + ENOSYS = 0x28, + ENOTEMPTY = 0x29, + EILSEQ = 0x2A, + STRUNCATE = 0x50; + + static { Library.initialize(); } + + protected LibCErrno() { + throw new UnsupportedOperationException(); + } + + // --- [ errno ] --- + + /** + * Returns the integer variable {@code errno}, which is set by system calls and some library functions in the event of an error to indicate what went + * wrong. Its value is significant only when the return value of the call indicated an error (i.e., -1 from most system calls; -1 or {@code NULL} from most + * library functions); a function that succeeds is allowed to change errno. + * + *

LWJGL note: This function cannot be used after another JNI call to a function, because the last error resets before that call returns. For this + * reason, LWJGL stores the last error in thread-local storage, you can use {@link #getErrno} to access it.

+ */ + public static native int errno(); + + // --- [ getErrno ] --- + + /** + * Returns the integer variable {@code errno}, which is set by system calls and some library functions in the event of an error to indicate what went + * wrong. Its value is significant only when the return value of the call indicated an error (i.e., -1 from most system calls; -1 or {@code NULL} from most + * library functions); a function that succeeds is allowed to change errno. + * + *

LWJGL note: This method has a meaningful value only after another LWJGL JNI call. It does not return {@code errno} from errno.h, but the + * thread-local error code stored by a previous JNI call.

+ */ + public static native int getErrno(); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/LibCLocale.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/LibCLocale.java new file mode 100644 index 00000000..31751d57 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/LibCLocale.java @@ -0,0 +1,128 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.libc; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to locale.h. */ +public class LibCLocale { + + static { Library.initialize(); } + + protected LibCLocale() { + throw new UnsupportedOperationException(); + } + + // --- [ LC_ALL ] --- + + private static native int LC_ALL(); + + /** Selects the entire C locale. */ + public static final int LC_ALL = LC_ALL(); + + // --- [ LC_COLLATE ] --- + + private static native int LC_COLLATE(); + + /** Selects the collation category of the C locale. */ + public static final int LC_COLLATE = LC_COLLATE(); + + // --- [ LC_CTYPE ] --- + + private static native int LC_CTYPE(); + + /** Selects the character classification category of the C locale. */ + public static final int LC_CTYPE = LC_CTYPE(); + + // --- [ LC_MONETARY ] --- + + private static native int LC_MONETARY(); + + /** Selects the monetary formatting category of the C locale. */ + public static final int LC_MONETARY = LC_MONETARY(); + + // --- [ LC_NUMERIC ] --- + + private static native int LC_NUMERIC(); + + /** Selects the numeric formatting category of the C locale. */ + public static final int LC_NUMERIC = LC_NUMERIC(); + + // --- [ LC_TIME ] --- + + private static native int LC_TIME(); + + /** Selects the time formatting category of the C locale. */ + public static final int LC_TIME = LC_TIME(); + + // --- [ setlocale ] --- + + /** Unsafe version of: {@link #setlocale} */ + public static native long nsetlocale(int category, long locale); + + /** + * Gets and sets the current C locale. + * + *

The {@code setlocale} function installs the specified system locale or its portion as the new C locale. The modifications remain in effect and + * influences the execution of all locale-sensitive C library functions until the next call to {@code setlocale}. If {@code locale} is a null pointer, + * {@code setlocale} queries the current C locale without modifying it.

+ * + * @param category the locale category identifier, may by null. One of:
{@link #LC_ALL}{@link #LC_COLLATE}{@link #LC_CTYPE}{@link #LC_MONETARY}{@link #LC_NUMERIC}{@link #LC_TIME}
+ * @param locale system-specific locale identifier. Can be "" for the user-preferred locale or "C" for the minimal locale. + * + * @return a pointer to a narrow null-terminated string identifying the C locale after applying the changes, if any, or null pointer on failure. + * + *

A copy of the returned string along with the category used in this call to {@code setlocale} may be used later in the program to restore the locale + * back to the state at the end of this call.

+ */ + @Nullable + @NativeType("char *") + public static String setlocale(int category, @NativeType("char const *") ByteBuffer locale) { + if (CHECKS) { + checkNT1(locale); + } + long __result = nsetlocale(category, memAddress(locale)); + return memASCIISafe(__result); + } + + /** + * Gets and sets the current C locale. + * + *

The {@code setlocale} function installs the specified system locale or its portion as the new C locale. The modifications remain in effect and + * influences the execution of all locale-sensitive C library functions until the next call to {@code setlocale}. If {@code locale} is a null pointer, + * {@code setlocale} queries the current C locale without modifying it.

+ * + * @param category the locale category identifier, may by null. One of:
{@link #LC_ALL}{@link #LC_COLLATE}{@link #LC_CTYPE}{@link #LC_MONETARY}{@link #LC_NUMERIC}{@link #LC_TIME}
+ * @param locale system-specific locale identifier. Can be "" for the user-preferred locale or "C" for the minimal locale. + * + * @return a pointer to a narrow null-terminated string identifying the C locale after applying the changes, if any, or null pointer on failure. + * + *

A copy of the returned string along with the category used in this call to {@code setlocale} may be used later in the program to restore the locale + * back to the state at the end of this call.

+ */ + @Nullable + @NativeType("char *") + public static String setlocale(int category, @NativeType("char const *") CharSequence locale) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(locale, true); + long localeEncoded = stack.getPointerAddress(); + long __result = nsetlocale(category, localeEncoded); + return memASCIISafe(__result); + } finally { + stack.setPointer(stackPointer); + } + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/LibCStdio.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/LibCStdio.java new file mode 100644 index 00000000..2d7d9112 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/LibCStdio.java @@ -0,0 +1,156 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.libc; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to stdio.h. */ +public class LibCStdio { + + static { Library.initialize(); } + + protected LibCStdio() { + throw new UnsupportedOperationException(); + } + + // --- [ sscanf ] --- + + @NativeType("void *") + private static native long sscanf(); + + /** The address of the {@code sscanf} function. */ + public static final long sscanf = sscanf(); + + // --- [ vsscanf ] --- + + /** Unsafe version of: {@link #vsscanf} */ + public static native int nvsscanf(long buffer, long format, long vlist); + + /** + * Reads data from the null-terminated character string {@code buffer}, interprets it according to {@code format} and stores the results into locations + * defined by {@code vlist}. + * + * @param buffer pointer to a null-terminated character string to read from + * @param format pointer to a null-terminated character string specifying how to read the input + * @param vlist variable argument list containing the receiving arguments + * + * @return the number of receiving arguments successfully assigned, or {@code EOF} if read failure occurs before the first receiving argument was assigned + */ + public static int vsscanf(@NativeType("char const *") ByteBuffer buffer, @NativeType("char const *") ByteBuffer format, @NativeType("va_list") long vlist) { + if (CHECKS) { + checkNT1(buffer); + checkNT1(format); + check(vlist); + } + return nvsscanf(memAddress(buffer), memAddress(format), vlist); + } + + /** + * Reads data from the null-terminated character string {@code buffer}, interprets it according to {@code format} and stores the results into locations + * defined by {@code vlist}. + * + * @param buffer pointer to a null-terminated character string to read from + * @param format pointer to a null-terminated character string specifying how to read the input + * @param vlist variable argument list containing the receiving arguments + * + * @return the number of receiving arguments successfully assigned, or {@code EOF} if read failure occurs before the first receiving argument was assigned + */ + public static int vsscanf(@NativeType("char const *") CharSequence buffer, @NativeType("char const *") CharSequence format, @NativeType("va_list") long vlist) { + if (CHECKS) { + check(vlist); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(buffer, true); + long bufferEncoded = stack.getPointerAddress(); + stack.nASCII(format, true); + long formatEncoded = stack.getPointerAddress(); + return nvsscanf(bufferEncoded, formatEncoded, vlist); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ sprintf ] --- + + @NativeType("void *") + private static native long sprintf(); + + /** The address of the {@code sprintf} function. */ + public static final long sprintf = sprintf(); + + // --- [ snprintf ] --- + + @NativeType("void *") + private static native long snprintf(); + + /** The address of the {@code snprintf} function. */ + public static final long snprintf = snprintf(); + + // --- [ vsnprintf ] --- + + /** + * Unsafe version of: {@link #vsnprintf} + * + * @param buf_size up to {@code buf_size - 1} characters may be written, plus the null terminator + */ + public static native int nvsnprintf(long buffer, long buf_size, long format, long vlist); + + /** + * Loads the data from the locations, defined by {@code vlist}, converts them to character string equivalents and writes the results to a character string + * buffer. + * + * @param buffer pointer to a character string to write to + * @param format pointer to a null-terminated character string specifying how to interpret the data + * @param vlist variable argument list containing the data to print + * + * @return the number of characters written if successful or negative value if an error occurred. If the resulting string gets truncated due to {@code buf_size} + * limit, function returns the total number of characters (not including the terminating null-byte) which would have been written, if the limit was not + * imposed. + */ + public static int vsnprintf(@Nullable @NativeType("char *") ByteBuffer buffer, @NativeType("char const *") ByteBuffer format, @NativeType("va_list") long vlist) { + if (CHECKS) { + checkNT1(format); + check(vlist); + } + return nvsnprintf(memAddressSafe(buffer), remainingSafe(buffer), memAddress(format), vlist); + } + + /** + * Loads the data from the locations, defined by {@code vlist}, converts them to character string equivalents and writes the results to a character string + * buffer. + * + * @param buffer pointer to a character string to write to + * @param format pointer to a null-terminated character string specifying how to interpret the data + * @param vlist variable argument list containing the data to print + * + * @return the number of characters written if successful or negative value if an error occurred. If the resulting string gets truncated due to {@code buf_size} + * limit, function returns the total number of characters (not including the terminating null-byte) which would have been written, if the limit was not + * imposed. + */ + public static int vsnprintf(@Nullable @NativeType("char *") ByteBuffer buffer, @NativeType("char const *") CharSequence format, @NativeType("va_list") long vlist) { + if (CHECKS) { + check(vlist); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(format, true); + long formatEncoded = stack.getPointerAddress(); + return nvsnprintf(memAddressSafe(buffer), remainingSafe(buffer), formatEncoded, vlist); + } finally { + stack.setPointer(stackPointer); + } + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/LibCStdlib.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/LibCStdlib.java new file mode 100644 index 00000000..1b67d78f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/LibCStdlib.java @@ -0,0 +1,249 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.libc; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to stdlib.h. */ +public class LibCStdlib { + + static { Library.initialize(); } + + protected LibCStdlib() { + throw new UnsupportedOperationException(); + } + + // --- [ malloc ] --- + + /** Unsafe version of: {@link #malloc} */ + public static native long nmalloc(long size); + + /** + * Allocates {@code size} bytes and returns a pointer to the allocated memory. The memory is not initialized. If {@code size} is 0, then malloc() returns + * either {@code NULL}, or a unique pointer value that can later be successfully passed to {@link #free}. + * + * @param size the number of bytes to allocate + */ + @Nullable + @NativeType("void *") + public static ByteBuffer malloc(@NativeType("size_t") long size) { + long __result = nmalloc(size); + return memByteBufferSafe(__result, (int)size); + } + + // --- [ calloc ] --- + + /** Unsafe version of: {@link #calloc} */ + public static native long ncalloc(long nmemb, long size); + + /** + * Allocates memory for an array of {@code nmemb} elements of {@code size} bytes each and returns a pointer to the allocated memory. The memory is set to + * zero. If {@code nmemb} or {@code size} is 0, then calloc() returns either {@code NULL}, or a unique pointer value that can later be successfully passed to + * {@link #free}. + * + * @param nmemb the number of elements to allocate + * @param size the number of bytes to allocate per element + */ + @Nullable + @NativeType("void *") + public static ByteBuffer calloc(@NativeType("size_t") long nmemb, @NativeType("size_t") long size) { + long __result = ncalloc(nmemb, size); + return memByteBufferSafe(__result, (int)nmemb * (int)size); + } + + // --- [ realloc ] --- + + /** Unsafe version of: {@link #realloc} */ + public static native long nrealloc(long ptr, long size); + + /** + * Changes the size of the memory block pointed to by {@code ptr} to {@code size} bytes The contents will be unchanged in the range from the start of the + * region up to the minimum of the old and new sizes. If the new size is larger than the old size, the added memory will not be initialized. If + * {@code ptr} is {@code NULL}, then the call is equivalent to {@code malloc(size)}, for all values of {@code size}; if {@code size} is equal to zero, and + * {@code ptr} is not {@code NULL}, then the call is equivalent to {@code free(ptr)}. Unless {@code ptr} is {@code NULL}, it must have been returned by an earlier call + * to {@link #malloc}, {@link #calloc} or {@link #realloc}. If the area pointed to was moved, a {@code free(ptr)} is done. + * + * @param ptr the memory block to reallocate + * @param size the new memory block size, in bytes + */ + @Nullable + @NativeType("void *") + public static ByteBuffer realloc(@Nullable @NativeType("void *") ByteBuffer ptr, @NativeType("size_t") long size) { + long __result = nrealloc(memAddressSafe(ptr), size); + return memByteBufferSafe(__result, (int)size); + } + + // --- [ free ] --- + + /** Unsafe version of: {@link #free} */ + public static native void nfree(long ptr); + + /** + * Frees the memory space pointed to by {@code ptr}, which must have been returned by a previous call to {@link #malloc}, {@link #calloc}, or {@link #realloc}. Otherwise, + * or if {@code free(ptr)} has already been called before, undefined behavior occurs. If ptr is {@code NULL}, no operation is performed. + * + * @param ptr the memory space to free + */ + public static void free(@Nullable @NativeType("void *") ByteBuffer ptr) { + nfree(memAddressSafe(ptr)); + } + + /** + * Frees the memory space pointed to by {@code ptr}, which must have been returned by a previous call to {@link #malloc}, {@link #calloc}, or {@link #realloc}. Otherwise, + * or if {@code free(ptr)} has already been called before, undefined behavior occurs. If ptr is {@code NULL}, no operation is performed. + * + * @param ptr the memory space to free + */ + public static void free(@Nullable @NativeType("void *") ShortBuffer ptr) { + nfree(memAddressSafe(ptr)); + } + + /** + * Frees the memory space pointed to by {@code ptr}, which must have been returned by a previous call to {@link #malloc}, {@link #calloc}, or {@link #realloc}. Otherwise, + * or if {@code free(ptr)} has already been called before, undefined behavior occurs. If ptr is {@code NULL}, no operation is performed. + * + * @param ptr the memory space to free + */ + public static void free(@Nullable @NativeType("void *") IntBuffer ptr) { + nfree(memAddressSafe(ptr)); + } + + /** + * Frees the memory space pointed to by {@code ptr}, which must have been returned by a previous call to {@link #malloc}, {@link #calloc}, or {@link #realloc}. Otherwise, + * or if {@code free(ptr)} has already been called before, undefined behavior occurs. If ptr is {@code NULL}, no operation is performed. + * + * @param ptr the memory space to free + */ + public static void free(@Nullable @NativeType("void *") LongBuffer ptr) { + nfree(memAddressSafe(ptr)); + } + + /** + * Frees the memory space pointed to by {@code ptr}, which must have been returned by a previous call to {@link #malloc}, {@link #calloc}, or {@link #realloc}. Otherwise, + * or if {@code free(ptr)} has already been called before, undefined behavior occurs. If ptr is {@code NULL}, no operation is performed. + * + * @param ptr the memory space to free + */ + public static void free(@Nullable @NativeType("void *") FloatBuffer ptr) { + nfree(memAddressSafe(ptr)); + } + + /** + * Frees the memory space pointed to by {@code ptr}, which must have been returned by a previous call to {@link #malloc}, {@link #calloc}, or {@link #realloc}. Otherwise, + * or if {@code free(ptr)} has already been called before, undefined behavior occurs. If ptr is {@code NULL}, no operation is performed. + * + * @param ptr the memory space to free + */ + public static void free(@Nullable @NativeType("void *") DoubleBuffer ptr) { + nfree(memAddressSafe(ptr)); + } + + /** + * Frees the memory space pointed to by {@code ptr}, which must have been returned by a previous call to {@link #malloc}, {@link #calloc}, or {@link #realloc}. Otherwise, + * or if {@code free(ptr)} has already been called before, undefined behavior occurs. If ptr is {@code NULL}, no operation is performed. + * + * @param ptr the memory space to free + */ + public static void free(@Nullable @NativeType("void *") PointerBuffer ptr) { + nfree(memAddressSafe(ptr)); + } + + // --- [ aligned_alloc ] --- + + /** Unsafe version of: {@link #aligned_alloc} */ + public static native long naligned_alloc(long alignment, long size); + + /** + * Allocates {@code size} bytes of uninitialized storage whose alignment is specified by {@code alignment}. The size parameter must be an integral multiple + * of alignment. Memory allocated with aligned_alloc() must be freed with {@link #aligned_free}. + * + * @param alignment the alignment. Must be a power of two value. + * @param size the number of bytes to allocate. Must be a multiple of {@code alignment}. + */ + @Nullable + @NativeType("void *") + public static ByteBuffer aligned_alloc(@NativeType("size_t") long alignment, @NativeType("size_t") long size) { + long __result = naligned_alloc(alignment, size); + return memByteBufferSafe(__result, (int)size); + } + + // --- [ aligned_free ] --- + + /** Unsafe version of: {@link #aligned_free} */ + public static native void naligned_free(long ptr); + + /** + * Frees a block of memory that was allocated with {@link #aligned_alloc}. If ptr is {@code NULL}, no operation is performed. + * + * @param ptr the aligned block of memory to free + */ + public static void aligned_free(@Nullable @NativeType("void *") ByteBuffer ptr) { + naligned_free(memAddressSafe(ptr)); + } + + /** + * Frees a block of memory that was allocated with {@link #aligned_alloc}. If ptr is {@code NULL}, no operation is performed. + * + * @param ptr the aligned block of memory to free + */ + public static void aligned_free(@Nullable @NativeType("void *") ShortBuffer ptr) { + naligned_free(memAddressSafe(ptr)); + } + + /** + * Frees a block of memory that was allocated with {@link #aligned_alloc}. If ptr is {@code NULL}, no operation is performed. + * + * @param ptr the aligned block of memory to free + */ + public static void aligned_free(@Nullable @NativeType("void *") IntBuffer ptr) { + naligned_free(memAddressSafe(ptr)); + } + + /** + * Frees a block of memory that was allocated with {@link #aligned_alloc}. If ptr is {@code NULL}, no operation is performed. + * + * @param ptr the aligned block of memory to free + */ + public static void aligned_free(@Nullable @NativeType("void *") LongBuffer ptr) { + naligned_free(memAddressSafe(ptr)); + } + + /** + * Frees a block of memory that was allocated with {@link #aligned_alloc}. If ptr is {@code NULL}, no operation is performed. + * + * @param ptr the aligned block of memory to free + */ + public static void aligned_free(@Nullable @NativeType("void *") FloatBuffer ptr) { + naligned_free(memAddressSafe(ptr)); + } + + /** + * Frees a block of memory that was allocated with {@link #aligned_alloc}. If ptr is {@code NULL}, no operation is performed. + * + * @param ptr the aligned block of memory to free + */ + public static void aligned_free(@Nullable @NativeType("void *") DoubleBuffer ptr) { + naligned_free(memAddressSafe(ptr)); + } + + /** + * Frees a block of memory that was allocated with {@link #aligned_alloc}. If ptr is {@code NULL}, no operation is performed. + * + * @param ptr the aligned block of memory to free + */ + public static void aligned_free(@Nullable @NativeType("void *") PointerBuffer ptr) { + naligned_free(memAddressSafe(ptr)); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/LibCString.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/LibCString.java new file mode 100644 index 00000000..d530e362 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/LibCString.java @@ -0,0 +1,585 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.libc; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to string.h. */ +public class LibCString { + + static { Library.initialize(); } + + protected LibCString() { + throw new UnsupportedOperationException(); + } + + // --- [ memset ] --- + + /** + * Unsafe version of: {@link #memset} + * + * @param count number of bytes to fill + */ + public static native long nmemset(long dest, int c, long count); + + /** + * Fills a memory area with a constant byte. + * + * @param dest pointer to the memory area to fill + * @param c byte to set + * + * @return the value of {@code dest} + */ + @NativeType("void *") + public static long memset(@NativeType("void *") ByteBuffer dest, int c) { + return nmemset(memAddress(dest), c, dest.remaining()); + } + + /** + * Fills a memory area with a constant byte. + * + * @param dest pointer to the memory area to fill + * @param c byte to set + * + * @return the value of {@code dest} + */ + @NativeType("void *") + public static long memset(@NativeType("void *") ShortBuffer dest, int c) { + return nmemset(memAddress(dest), c, Integer.toUnsignedLong(dest.remaining()) << 1); + } + + /** + * Fills a memory area with a constant byte. + * + * @param dest pointer to the memory area to fill + * @param c byte to set + * + * @return the value of {@code dest} + */ + @NativeType("void *") + public static long memset(@NativeType("void *") IntBuffer dest, int c) { + return nmemset(memAddress(dest), c, Integer.toUnsignedLong(dest.remaining()) << 2); + } + + /** + * Fills a memory area with a constant byte. + * + * @param dest pointer to the memory area to fill + * @param c byte to set + * + * @return the value of {@code dest} + */ + @NativeType("void *") + public static long memset(@NativeType("void *") LongBuffer dest, int c) { + return nmemset(memAddress(dest), c, Integer.toUnsignedLong(dest.remaining()) << 3); + } + + /** + * Fills a memory area with a constant byte. + * + * @param dest pointer to the memory area to fill + * @param c byte to set + * + * @return the value of {@code dest} + */ + @NativeType("void *") + public static long memset(@NativeType("void *") FloatBuffer dest, int c) { + return nmemset(memAddress(dest), c, Integer.toUnsignedLong(dest.remaining()) << 2); + } + + /** + * Fills a memory area with a constant byte. + * + * @param dest pointer to the memory area to fill + * @param c byte to set + * + * @return the value of {@code dest} + */ + @NativeType("void *") + public static long memset(@NativeType("void *") DoubleBuffer dest, int c) { + return nmemset(memAddress(dest), c, Integer.toUnsignedLong(dest.remaining()) << 3); + } + + // --- [ memcpy ] --- + + /** + * Unsafe version of: {@link #memcpy} + * + * @param count the number of bytes to be copied + */ + public static native long nmemcpy(long dest, long src, long count); + + /** + * Copies bytes between memory areas that must not overlap. + * + * @param dest pointer to the destination memory area + * @param src pointer to the source memory area + * + * @return the value of {@code dest} + */ + @NativeType("void *") + public static long memcpy(@NativeType("void *") ByteBuffer dest, @NativeType("void const *") ByteBuffer src) { + if (CHECKS) { + check(dest, src.remaining()); + } + return nmemcpy(memAddress(dest), memAddress(src), src.remaining()); + } + + /** + * Copies bytes between memory areas that must not overlap. + * + * @param dest pointer to the destination memory area + * @param src pointer to the source memory area + * + * @return the value of {@code dest} + */ + @NativeType("void *") + public static long memcpy(@NativeType("void *") ShortBuffer dest, @NativeType("void const *") ShortBuffer src) { + if (CHECKS) { + check(dest, src.remaining()); + } + return nmemcpy(memAddress(dest), memAddress(src), Integer.toUnsignedLong(src.remaining()) << 1); + } + + /** + * Copies bytes between memory areas that must not overlap. + * + * @param dest pointer to the destination memory area + * @param src pointer to the source memory area + * + * @return the value of {@code dest} + */ + @NativeType("void *") + public static long memcpy(@NativeType("void *") IntBuffer dest, @NativeType("void const *") IntBuffer src) { + if (CHECKS) { + check(dest, src.remaining()); + } + return nmemcpy(memAddress(dest), memAddress(src), Integer.toUnsignedLong(src.remaining()) << 2); + } + + /** + * Copies bytes between memory areas that must not overlap. + * + * @param dest pointer to the destination memory area + * @param src pointer to the source memory area + * + * @return the value of {@code dest} + */ + @NativeType("void *") + public static long memcpy(@NativeType("void *") LongBuffer dest, @NativeType("void const *") LongBuffer src) { + if (CHECKS) { + check(dest, src.remaining()); + } + return nmemcpy(memAddress(dest), memAddress(src), Integer.toUnsignedLong(src.remaining()) << 3); + } + + /** + * Copies bytes between memory areas that must not overlap. + * + * @param dest pointer to the destination memory area + * @param src pointer to the source memory area + * + * @return the value of {@code dest} + */ + @NativeType("void *") + public static long memcpy(@NativeType("void *") FloatBuffer dest, @NativeType("void const *") FloatBuffer src) { + if (CHECKS) { + check(dest, src.remaining()); + } + return nmemcpy(memAddress(dest), memAddress(src), Integer.toUnsignedLong(src.remaining()) << 2); + } + + /** + * Copies bytes between memory areas that must not overlap. + * + * @param dest pointer to the destination memory area + * @param src pointer to the source memory area + * + * @return the value of {@code dest} + */ + @NativeType("void *") + public static long memcpy(@NativeType("void *") DoubleBuffer dest, @NativeType("void const *") DoubleBuffer src) { + if (CHECKS) { + check(dest, src.remaining()); + } + return nmemcpy(memAddress(dest), memAddress(src), Integer.toUnsignedLong(src.remaining()) << 3); + } + + // --- [ memmove ] --- + + /** + * Unsafe version of: {@link #memmove} + * + * @param count the number of bytes to be copied + */ + public static native long nmemmove(long dest, long src, long count); + + /** + * Copies {@code count} bytes from memory area {@code src} to memory area {@code dest}. + * + *

The memory areas may overlap: copying takes place as though the bytes in {@code src} are first copied into a temporary array that does not overlap + * {@code src} or {@code dest}, and the bytes are then copied from the temporary array to {@code dest}.

+ * + * @param dest pointer to the destination memory area + * @param src pointer to the source memory area + * + * @return the value of {@code dest} + */ + @NativeType("void *") + public static long memmove(@NativeType("void *") ByteBuffer dest, @NativeType("void const *") ByteBuffer src) { + if (CHECKS) { + check(dest, src.remaining()); + } + return nmemmove(memAddress(dest), memAddress(src), src.remaining()); + } + + /** + * Copies {@code count} bytes from memory area {@code src} to memory area {@code dest}. + * + *

The memory areas may overlap: copying takes place as though the bytes in {@code src} are first copied into a temporary array that does not overlap + * {@code src} or {@code dest}, and the bytes are then copied from the temporary array to {@code dest}.

+ * + * @param dest pointer to the destination memory area + * @param src pointer to the source memory area + * + * @return the value of {@code dest} + */ + @NativeType("void *") + public static long memmove(@NativeType("void *") ShortBuffer dest, @NativeType("void const *") ShortBuffer src) { + if (CHECKS) { + check(dest, src.remaining()); + } + return nmemmove(memAddress(dest), memAddress(src), Integer.toUnsignedLong(src.remaining()) << 1); + } + + /** + * Copies {@code count} bytes from memory area {@code src} to memory area {@code dest}. + * + *

The memory areas may overlap: copying takes place as though the bytes in {@code src} are first copied into a temporary array that does not overlap + * {@code src} or {@code dest}, and the bytes are then copied from the temporary array to {@code dest}.

+ * + * @param dest pointer to the destination memory area + * @param src pointer to the source memory area + * + * @return the value of {@code dest} + */ + @NativeType("void *") + public static long memmove(@NativeType("void *") IntBuffer dest, @NativeType("void const *") IntBuffer src) { + if (CHECKS) { + check(dest, src.remaining()); + } + return nmemmove(memAddress(dest), memAddress(src), Integer.toUnsignedLong(src.remaining()) << 2); + } + + /** + * Copies {@code count} bytes from memory area {@code src} to memory area {@code dest}. + * + *

The memory areas may overlap: copying takes place as though the bytes in {@code src} are first copied into a temporary array that does not overlap + * {@code src} or {@code dest}, and the bytes are then copied from the temporary array to {@code dest}.

+ * + * @param dest pointer to the destination memory area + * @param src pointer to the source memory area + * + * @return the value of {@code dest} + */ + @NativeType("void *") + public static long memmove(@NativeType("void *") LongBuffer dest, @NativeType("void const *") LongBuffer src) { + if (CHECKS) { + check(dest, src.remaining()); + } + return nmemmove(memAddress(dest), memAddress(src), Integer.toUnsignedLong(src.remaining()) << 3); + } + + /** + * Copies {@code count} bytes from memory area {@code src} to memory area {@code dest}. + * + *

The memory areas may overlap: copying takes place as though the bytes in {@code src} are first copied into a temporary array that does not overlap + * {@code src} or {@code dest}, and the bytes are then copied from the temporary array to {@code dest}.

+ * + * @param dest pointer to the destination memory area + * @param src pointer to the source memory area + * + * @return the value of {@code dest} + */ + @NativeType("void *") + public static long memmove(@NativeType("void *") FloatBuffer dest, @NativeType("void const *") FloatBuffer src) { + if (CHECKS) { + check(dest, src.remaining()); + } + return nmemmove(memAddress(dest), memAddress(src), Integer.toUnsignedLong(src.remaining()) << 2); + } + + /** + * Copies {@code count} bytes from memory area {@code src} to memory area {@code dest}. + * + *

The memory areas may overlap: copying takes place as though the bytes in {@code src} are first copied into a temporary array that does not overlap + * {@code src} or {@code dest}, and the bytes are then copied from the temporary array to {@code dest}.

+ * + * @param dest pointer to the destination memory area + * @param src pointer to the source memory area + * + * @return the value of {@code dest} + */ + @NativeType("void *") + public static long memmove(@NativeType("void *") DoubleBuffer dest, @NativeType("void const *") DoubleBuffer src) { + if (CHECKS) { + check(dest, src.remaining()); + } + return nmemmove(memAddress(dest), memAddress(src), Integer.toUnsignedLong(src.remaining()) << 3); + } + + /** Array version of: {@link #nmemset} */ + public static native long nmemset(byte[] dest, int c, long count); + + /** Array version of: {@link #memset} */ + @NativeType("void *") + public static long memset(@NativeType("void *") byte[] dest, int c) { + return nmemset(dest, c, Integer.toUnsignedLong(dest.length) << 0); + } + + /** Array version of: {@link #nmemset} */ + public static native long nmemset(short[] dest, int c, long count); + + /** Array version of: {@link #memset} */ + @NativeType("void *") + public static long memset(@NativeType("void *") short[] dest, int c) { + return nmemset(dest, c, Integer.toUnsignedLong(dest.length) << 1); + } + + /** Array version of: {@link #nmemset} */ + public static native long nmemset(int[] dest, int c, long count); + + /** Array version of: {@link #memset} */ + @NativeType("void *") + public static long memset(@NativeType("void *") int[] dest, int c) { + return nmemset(dest, c, Integer.toUnsignedLong(dest.length) << 2); + } + + /** Array version of: {@link #nmemset} */ + public static native long nmemset(long[] dest, int c, long count); + + /** Array version of: {@link #memset} */ + @NativeType("void *") + public static long memset(@NativeType("void *") long[] dest, int c) { + return nmemset(dest, c, Integer.toUnsignedLong(dest.length) << 3); + } + + /** Array version of: {@link #nmemset} */ + public static native long nmemset(float[] dest, int c, long count); + + /** Array version of: {@link #memset} */ + @NativeType("void *") + public static long memset(@NativeType("void *") float[] dest, int c) { + return nmemset(dest, c, Integer.toUnsignedLong(dest.length) << 2); + } + + /** Array version of: {@link #nmemset} */ + public static native long nmemset(double[] dest, int c, long count); + + /** Array version of: {@link #memset} */ + @NativeType("void *") + public static long memset(@NativeType("void *") double[] dest, int c) { + return nmemset(dest, c, Integer.toUnsignedLong(dest.length) << 3); + } + + /** Array version of: {@link #nmemcpy} */ + public static native long nmemcpy(byte[] dest, byte[] src, long count); + + /** Array version of: {@link #memcpy} */ + @NativeType("void *") + public static long memcpy(@NativeType("void *") byte[] dest, @NativeType("void const *") byte[] src) { + if (CHECKS) { + check(dest, src.length); + } + return nmemcpy(dest, src, Integer.toUnsignedLong(src.length) << 0); + } + + /** Array version of: {@link #nmemcpy} */ + public static native long nmemcpy(short[] dest, short[] src, long count); + + /** Array version of: {@link #memcpy} */ + @NativeType("void *") + public static long memcpy(@NativeType("void *") short[] dest, @NativeType("void const *") short[] src) { + if (CHECKS) { + check(dest, src.length); + } + return nmemcpy(dest, src, Integer.toUnsignedLong(src.length) << 1); + } + + /** Array version of: {@link #nmemcpy} */ + public static native long nmemcpy(int[] dest, int[] src, long count); + + /** Array version of: {@link #memcpy} */ + @NativeType("void *") + public static long memcpy(@NativeType("void *") int[] dest, @NativeType("void const *") int[] src) { + if (CHECKS) { + check(dest, src.length); + } + return nmemcpy(dest, src, Integer.toUnsignedLong(src.length) << 2); + } + + /** Array version of: {@link #nmemcpy} */ + public static native long nmemcpy(long[] dest, long[] src, long count); + + /** Array version of: {@link #memcpy} */ + @NativeType("void *") + public static long memcpy(@NativeType("void *") long[] dest, @NativeType("void const *") long[] src) { + if (CHECKS) { + check(dest, src.length); + } + return nmemcpy(dest, src, Integer.toUnsignedLong(src.length) << 3); + } + + /** Array version of: {@link #nmemcpy} */ + public static native long nmemcpy(float[] dest, float[] src, long count); + + /** Array version of: {@link #memcpy} */ + @NativeType("void *") + public static long memcpy(@NativeType("void *") float[] dest, @NativeType("void const *") float[] src) { + if (CHECKS) { + check(dest, src.length); + } + return nmemcpy(dest, src, Integer.toUnsignedLong(src.length) << 2); + } + + /** Array version of: {@link #nmemcpy} */ + public static native long nmemcpy(double[] dest, double[] src, long count); + + /** Array version of: {@link #memcpy} */ + @NativeType("void *") + public static long memcpy(@NativeType("void *") double[] dest, @NativeType("void const *") double[] src) { + if (CHECKS) { + check(dest, src.length); + } + return nmemcpy(dest, src, Integer.toUnsignedLong(src.length) << 3); + } + + /** Array version of: {@link #nmemmove} */ + public static native long nmemmove(byte[] dest, byte[] src, long count); + + /** Array version of: {@link #memmove} */ + @NativeType("void *") + public static long memmove(@NativeType("void *") byte[] dest, @NativeType("void const *") byte[] src) { + if (CHECKS) { + check(dest, src.length); + } + return nmemmove(dest, src, Integer.toUnsignedLong(src.length) << 0); + } + + /** Array version of: {@link #nmemmove} */ + public static native long nmemmove(short[] dest, short[] src, long count); + + /** Array version of: {@link #memmove} */ + @NativeType("void *") + public static long memmove(@NativeType("void *") short[] dest, @NativeType("void const *") short[] src) { + if (CHECKS) { + check(dest, src.length); + } + return nmemmove(dest, src, Integer.toUnsignedLong(src.length) << 1); + } + + /** Array version of: {@link #nmemmove} */ + public static native long nmemmove(int[] dest, int[] src, long count); + + /** Array version of: {@link #memmove} */ + @NativeType("void *") + public static long memmove(@NativeType("void *") int[] dest, @NativeType("void const *") int[] src) { + if (CHECKS) { + check(dest, src.length); + } + return nmemmove(dest, src, Integer.toUnsignedLong(src.length) << 2); + } + + /** Array version of: {@link #nmemmove} */ + public static native long nmemmove(long[] dest, long[] src, long count); + + /** Array version of: {@link #memmove} */ + @NativeType("void *") + public static long memmove(@NativeType("void *") long[] dest, @NativeType("void const *") long[] src) { + if (CHECKS) { + check(dest, src.length); + } + return nmemmove(dest, src, Integer.toUnsignedLong(src.length) << 3); + } + + /** Array version of: {@link #nmemmove} */ + public static native long nmemmove(float[] dest, float[] src, long count); + + /** Array version of: {@link #memmove} */ + @NativeType("void *") + public static long memmove(@NativeType("void *") float[] dest, @NativeType("void const *") float[] src) { + if (CHECKS) { + check(dest, src.length); + } + return nmemmove(dest, src, Integer.toUnsignedLong(src.length) << 2); + } + + /** Array version of: {@link #nmemmove} */ + public static native long nmemmove(double[] dest, double[] src, long count); + + /** Array version of: {@link #memmove} */ + @NativeType("void *") + public static long memmove(@NativeType("void *") double[] dest, @NativeType("void const *") double[] src) { + if (CHECKS) { + check(dest, src.length); + } + return nmemmove(dest, src, Integer.toUnsignedLong(src.length) << 3); + } + + /** + * Fills memory with a constant byte. + * + * @param dest pointer to destination + * @param c character to set + * + * @return the value of {@code dest} + */ + @NativeType("void *") + public static > long memset(@NativeType("void *") T dest, @NativeType("int") int c) { + return nmemset(memAddress(dest), c, Integer.toUnsignedLong(dest.remaining()) * dest.sizeof()); + } + + /** + * Copies bytes between memory areas that must not overlap. + * + * @param dest pointer to the destination memory area + * @param src pointer to the source memory area + * + * @return the value of {@code dest} + */ + @NativeType("void *") + public static > long memcpy(@NativeType("void *") T dest, @NativeType("void const *") T src) { + if (CHECKS) { + check(src, dest.remaining()); + } + return nmemcpy(memAddress(dest), memAddress(src), (long)src.remaining() * src.sizeof()); + } + + /** + * Copies {@code count} bytes from memory area {@code src} to memory area {@code dest}. + * + *

The memory areas may overlap: copying takes place as though the bytes in {@code src} are first copied into a temporary array that does not overlap + * {@code src} or {@code dest}, and the bytes are then copied from the temporary array to {@code dest}.

+ * + * @param dest pointer to the destination memory area + * @param src pointer to the source memory area + * + * @return the value of {@code dest} + */ + @NativeType("void *") + public static > long memmove(@NativeType("void *") T dest, @NativeType("void const *") T src) { + if (CHECKS) { + check(src, dest.remaining()); + } + return nmemmove(memAddress(dest), memAddress(src), (long)src.remaining() * src.sizeof()); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/package-info.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/package-info.java new file mode 100644 index 00000000..f5b4138f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/libc/package-info.java @@ -0,0 +1,10 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ + +/** Contains bindings to standard C library APIs. */ +@org.lwjgl.system.NonnullDefault +package org.lwjgl.system.libc; + diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/DynamicLinkLoader.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/DynamicLinkLoader.java new file mode 100644 index 00000000..d37add82 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/DynamicLinkLoader.java @@ -0,0 +1,168 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to <dlfcn.h>. */ +public class DynamicLinkLoader { + + /** The {@code mode} argument to {@link #dlopen} contains one of the following. */ + public static final int + RTLD_LAZY = 0x1, + RTLD_NOW = 0x2, + RTLD_BINDING_MASK = 0x3, + RTLD_NOLOAD = 0x4, + RTLD_DEEPBIND = 0x8; + + /** + * If the following bit is set in the {@code mode} argument to {@link #dlopen}, the symbols of the loaded object and its dependencies are made visible as + * if the object were linked directly into the program. + */ + public static final int RTLD_GLOBAL = 0x100; + + /** + * Unix98 demands the following flag which is the inverse to {@link #RTLD_GLOBAL}. The implementation does this by default and so we can define the value + * to zero. + */ + public static final int RTLD_LOCAL = 0; + + /** Do not delete object when closed. */ + public static final int RTLD_NODELETE = 0x1000; + + static { Library.initialize(); } + + protected DynamicLinkLoader() { + throw new UnsupportedOperationException(); + } + + // --- [ dlopen ] --- + + /** Unsafe version of: {@link #dlopen} */ + public static native long ndlopen(long filename, int mode); + + /** + * Loads the dynamic library file named by the null-terminated string {@code filename} and returns an opaque "handle" for the dynamic library. If + * {@code filename} is {@code NULL}, then the returned handle is for the main program. + * + * @param filename the name of the dynamic library to open, or {@code NULL} + * @param mode a bitfield. One or more of:
{@link #RTLD_LAZY}{@link #RTLD_NOW}{@link #RTLD_BINDING_MASK}{@link #RTLD_NOLOAD}{@link #RTLD_DEEPBIND}{@link #RTLD_GLOBAL}
{@link #RTLD_LOCAL}{@link #RTLD_NODELETE}
+ */ + @NativeType("void *") + public static long dlopen(@Nullable @NativeType("char const *") ByteBuffer filename, int mode) { + if (CHECKS) { + checkNT1Safe(filename); + } + return ndlopen(memAddressSafe(filename), mode); + } + + /** + * Loads the dynamic library file named by the null-terminated string {@code filename} and returns an opaque "handle" for the dynamic library. If + * {@code filename} is {@code NULL}, then the returned handle is for the main program. + * + * @param filename the name of the dynamic library to open, or {@code NULL} + * @param mode a bitfield. One or more of:
{@link #RTLD_LAZY}{@link #RTLD_NOW}{@link #RTLD_BINDING_MASK}{@link #RTLD_NOLOAD}{@link #RTLD_DEEPBIND}{@link #RTLD_GLOBAL}
{@link #RTLD_LOCAL}{@link #RTLD_NODELETE}
+ */ + @NativeType("void *") + public static long dlopen(@Nullable @NativeType("char const *") CharSequence filename, int mode) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCIISafe(filename, true); + long filenameEncoded = filename == null ? NULL : stack.getPointerAddress(); + return ndlopen(filenameEncoded, mode); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ dlerror ] --- + + /** Unsafe version of: {@link #dlerror} */ + public static native long ndlerror(); + + /** + * Returns a human readable string describing the most recent error that occurred from {@link #dlopen}, {@link #dlsym} or {@link #dlclose} since + * the last call to {@code dlerror()}. It returns {@code NULL} if no errors have occurred since initialization or since it was last called. + */ + @Nullable + @NativeType("char *") + public static String dlerror() { + long __result = ndlerror(); + return memASCIISafe(__result); + } + + // --- [ dlsym ] --- + + /** Unsafe version of: {@link #dlsym} */ + public static native long ndlsym(long handle, long name); + + /** + * Takes a "handle" of a dynamic library returned by {@link #dlopen} and the null-terminated symbol name, returning the address where that symbol is loaded + * into memory. If the symbol is not found, in the specified library or any of the libraries that were automatically loaded by {@link #dlopen} when that + * library was loaded, {@code dlsym()} returns {@code NULL}. + * + * @param handle the dynamic library handle + * @param name the symbol name + */ + @NativeType("void *") + public static long dlsym(@NativeType("void *") long handle, @NativeType("char const *") ByteBuffer name) { + if (CHECKS) { + check(handle); + checkNT1(name); + } + return ndlsym(handle, memAddress(name)); + } + + /** + * Takes a "handle" of a dynamic library returned by {@link #dlopen} and the null-terminated symbol name, returning the address where that symbol is loaded + * into memory. If the symbol is not found, in the specified library or any of the libraries that were automatically loaded by {@link #dlopen} when that + * library was loaded, {@code dlsym()} returns {@code NULL}. + * + * @param handle the dynamic library handle + * @param name the symbol name + */ + @NativeType("void *") + public static long dlsym(@NativeType("void *") long handle, @NativeType("char const *") CharSequence name) { + if (CHECKS) { + check(handle); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + return ndlsym(handle, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ dlclose ] --- + + /** Unsafe version of: {@link #dlclose} */ + public static native int ndlclose(long handle); + + /** + * Decrements the reference count on the dynamic library handle handle. If the reference count drops to zero and no other loaded libraries use symbols in + * it, then the dynamic library is unloaded. + * + * @param handle the dynamic library to close + */ + public static int dlclose(@NativeType("void *") long handle) { + if (CHECKS) { + check(handle); + } + return ndlclose(handle); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/LinuxLibrary.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/LinuxLibrary.java new file mode 100644 index 00000000..1dc93e1d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/LinuxLibrary.java @@ -0,0 +1,47 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system.linux; + +import org.lwjgl.system.*; + +import java.nio.*; + +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.linux.DynamicLinkLoader.*; + +/** Implements a {@link SharedLibrary} on the Linux OS. */ +public class LinuxLibrary extends SharedLibrary.Default { + + public LinuxLibrary(String name) { + this(name, loadLibrary(name)); + } + + public LinuxLibrary(String name, long handle) { + super(name, handle); + } + + private static long loadLibrary(String name) { + long handle; + try (MemoryStack stack = stackPush()) { + handle = dlopen(stack.ASCII(name), RTLD_LAZY | RTLD_LOCAL); + } + if (handle == NULL) { + throw new UnsatisfiedLinkError("Failed to dynamically load library: " + name + "(error = " + dlerror() + ")"); + } + return handle; + } + + @Override + public long getFunctionAddress(ByteBuffer functionName) { + return dlsym(address(), functionName); + } + + @Override + public void free() { + dlclose(address()); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/Visual.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/Visual.java new file mode 100644 index 00000000..2108dd81 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/Visual.java @@ -0,0 +1,422 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Visual structure; contains information about colormapping possible. + * + *

Layout

+ * + *

+ * struct Visual {
+ *     void * ext_data;
+ *     VisualID visualid;
+ *     int class;
+ *     unsigned long red_mask;
+ *     unsigned long green_mask;
+ *     unsigned long blue_mask;
+ *     int bits_per_rgb;
+ *     int map_entries;
+ * }
+ */ +public class Visual extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + EXT_DATA, + VISUALID, + CLASS, + RED_MASK, + GREEN_MASK, + BLUE_MASK, + BITS_PER_RGB, + MAP_ENTRIES; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + EXT_DATA = layout.offsetof(0); + VISUALID = layout.offsetof(1); + CLASS = layout.offsetof(2); + RED_MASK = layout.offsetof(3); + GREEN_MASK = layout.offsetof(4); + BLUE_MASK = layout.offsetof(5); + BITS_PER_RGB = layout.offsetof(6); + MAP_ENTRIES = layout.offsetof(7); + } + + /** + * Creates a {@code Visual} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public Visual(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code ext_data} field. */ + @NativeType("void *") + public long ext_data() { return next_data(address()); } + /** Returns the value of the {@code visualid} field. */ + @NativeType("VisualID") + public long visualid() { return nvisualid(address()); } + /** Returns the value of the {@code class} field. */ + public int class$() { return nclass$(address()); } + /** Returns the value of the {@code red_mask} field. */ + @NativeType("unsigned long") + public long red_mask() { return nred_mask(address()); } + /** Returns the value of the {@code green_mask} field. */ + @NativeType("unsigned long") + public long green_mask() { return ngreen_mask(address()); } + /** Returns the value of the {@code blue_mask} field. */ + @NativeType("unsigned long") + public long blue_mask() { return nblue_mask(address()); } + /** Returns the value of the {@code bits_per_rgb} field. */ + public int bits_per_rgb() { return nbits_per_rgb(address()); } + /** Returns the value of the {@code map_entries} field. */ + public int map_entries() { return nmap_entries(address()); } + + /** Sets the specified value to the {@code ext_data} field. */ + public Visual ext_data(@NativeType("void *") long value) { next_data(address(), value); return this; } + /** Sets the specified value to the {@code visualid} field. */ + public Visual visualid(@NativeType("VisualID") long value) { nvisualid(address(), value); return this; } + /** Sets the specified value to the {@code class} field. */ + public Visual class$(int value) { nclass$(address(), value); return this; } + /** Sets the specified value to the {@code red_mask} field. */ + public Visual red_mask(@NativeType("unsigned long") long value) { nred_mask(address(), value); return this; } + /** Sets the specified value to the {@code green_mask} field. */ + public Visual green_mask(@NativeType("unsigned long") long value) { ngreen_mask(address(), value); return this; } + /** Sets the specified value to the {@code blue_mask} field. */ + public Visual blue_mask(@NativeType("unsigned long") long value) { nblue_mask(address(), value); return this; } + /** Sets the specified value to the {@code bits_per_rgb} field. */ + public Visual bits_per_rgb(int value) { nbits_per_rgb(address(), value); return this; } + /** Sets the specified value to the {@code map_entries} field. */ + public Visual map_entries(int value) { nmap_entries(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public Visual set( + long ext_data, + long visualid, + int class$, + long red_mask, + long green_mask, + long blue_mask, + int bits_per_rgb, + int map_entries + ) { + ext_data(ext_data); + visualid(visualid); + class$(class$); + red_mask(red_mask); + green_mask(green_mask); + blue_mask(blue_mask); + bits_per_rgb(bits_per_rgb); + map_entries(map_entries); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public Visual set(Visual src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code Visual} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static Visual malloc() { + return wrap(Visual.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code Visual} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static Visual calloc() { + return wrap(Visual.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code Visual} instance allocated with {@link BufferUtils}. */ + public static Visual create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(Visual.class, memAddress(container), container); + } + + /** Returns a new {@code Visual} instance for the specified memory address. */ + public static Visual create(long address) { + return wrap(Visual.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Visual createSafe(long address) { + return address == NULL ? null : wrap(Visual.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code Visual} instance allocated on the thread-local {@link MemoryStack}. */ + public static Visual mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code Visual} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static Visual callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code Visual} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static Visual mallocStack(MemoryStack stack) { + return wrap(Visual.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code Visual} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static Visual callocStack(MemoryStack stack) { + return wrap(Visual.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #ext_data}. */ + public static long next_data(long struct) { return memGetAddress(struct + Visual.EXT_DATA); } + /** Unsafe version of {@link #visualid}. */ + public static long nvisualid(long struct) { return memGetCLong(struct + Visual.VISUALID); } + /** Unsafe version of {@link #class$}. */ + public static int nclass$(long struct) { return UNSAFE.getInt(null, struct + Visual.CLASS); } + /** Unsafe version of {@link #red_mask}. */ + public static long nred_mask(long struct) { return memGetCLong(struct + Visual.RED_MASK); } + /** Unsafe version of {@link #green_mask}. */ + public static long ngreen_mask(long struct) { return memGetCLong(struct + Visual.GREEN_MASK); } + /** Unsafe version of {@link #blue_mask}. */ + public static long nblue_mask(long struct) { return memGetCLong(struct + Visual.BLUE_MASK); } + /** Unsafe version of {@link #bits_per_rgb}. */ + public static int nbits_per_rgb(long struct) { return UNSAFE.getInt(null, struct + Visual.BITS_PER_RGB); } + /** Unsafe version of {@link #map_entries}. */ + public static int nmap_entries(long struct) { return UNSAFE.getInt(null, struct + Visual.MAP_ENTRIES); } + + /** Unsafe version of {@link #ext_data(long) ext_data}. */ + public static void next_data(long struct, long value) { memPutAddress(struct + Visual.EXT_DATA, value); } + /** Unsafe version of {@link #visualid(long) visualid}. */ + public static void nvisualid(long struct, long value) { memPutCLong(struct + Visual.VISUALID, value); } + /** Unsafe version of {@link #class$(int) class$}. */ + public static void nclass$(long struct, int value) { UNSAFE.putInt(null, struct + Visual.CLASS, value); } + /** Unsafe version of {@link #red_mask(long) red_mask}. */ + public static void nred_mask(long struct, long value) { memPutCLong(struct + Visual.RED_MASK, value); } + /** Unsafe version of {@link #green_mask(long) green_mask}. */ + public static void ngreen_mask(long struct, long value) { memPutCLong(struct + Visual.GREEN_MASK, value); } + /** Unsafe version of {@link #blue_mask(long) blue_mask}. */ + public static void nblue_mask(long struct, long value) { memPutCLong(struct + Visual.BLUE_MASK, value); } + /** Unsafe version of {@link #bits_per_rgb(int) bits_per_rgb}. */ + public static void nbits_per_rgb(long struct, int value) { UNSAFE.putInt(null, struct + Visual.BITS_PER_RGB, value); } + /** Unsafe version of {@link #map_entries(int) map_entries}. */ + public static void nmap_entries(long struct, int value) { UNSAFE.putInt(null, struct + Visual.MAP_ENTRIES, value); } + + // ----------------------------------- + + /** An array of {@link Visual} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final Visual ELEMENT_FACTORY = Visual.create(-1L); + + /** + * Creates a new {@code Visual.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link Visual#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected Visual getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code ext_data} field. */ + @NativeType("void *") + public long ext_data() { return Visual.next_data(address()); } + /** Returns the value of the {@code visualid} field. */ + @NativeType("VisualID") + public long visualid() { return Visual.nvisualid(address()); } + /** Returns the value of the {@code class} field. */ + public int class$() { return Visual.nclass$(address()); } + /** Returns the value of the {@code red_mask} field. */ + @NativeType("unsigned long") + public long red_mask() { return Visual.nred_mask(address()); } + /** Returns the value of the {@code green_mask} field. */ + @NativeType("unsigned long") + public long green_mask() { return Visual.ngreen_mask(address()); } + /** Returns the value of the {@code blue_mask} field. */ + @NativeType("unsigned long") + public long blue_mask() { return Visual.nblue_mask(address()); } + /** Returns the value of the {@code bits_per_rgb} field. */ + public int bits_per_rgb() { return Visual.nbits_per_rgb(address()); } + /** Returns the value of the {@code map_entries} field. */ + public int map_entries() { return Visual.nmap_entries(address()); } + + /** Sets the specified value to the {@code ext_data} field. */ + public Buffer ext_data(@NativeType("void *") long value) { Visual.next_data(address(), value); return this; } + /** Sets the specified value to the {@code visualid} field. */ + public Buffer visualid(@NativeType("VisualID") long value) { Visual.nvisualid(address(), value); return this; } + /** Sets the specified value to the {@code class} field. */ + public Buffer class$(int value) { Visual.nclass$(address(), value); return this; } + /** Sets the specified value to the {@code red_mask} field. */ + public Buffer red_mask(@NativeType("unsigned long") long value) { Visual.nred_mask(address(), value); return this; } + /** Sets the specified value to the {@code green_mask} field. */ + public Buffer green_mask(@NativeType("unsigned long") long value) { Visual.ngreen_mask(address(), value); return this; } + /** Sets the specified value to the {@code blue_mask} field. */ + public Buffer blue_mask(@NativeType("unsigned long") long value) { Visual.nblue_mask(address(), value); return this; } + /** Sets the specified value to the {@code bits_per_rgb} field. */ + public Buffer bits_per_rgb(int value) { Visual.nbits_per_rgb(address(), value); return this; } + /** Sets the specified value to the {@code map_entries} field. */ + public Buffer map_entries(int value) { Visual.nmap_entries(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/X11.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/X11.java new file mode 100644 index 00000000..9a7f3973 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/X11.java @@ -0,0 +1,839 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to libX11. */ +public class X11 { + + /** Boolean values */ + public static final int + True = 1, + False = 0; + + /** RESERVED RESOURCE AND CONSTANT DEFINITIONS */ + public static final int + None = 0, + ParentRelative = 1, + CopyFromParent = 0, + PointerWindow = 0, + InputFocus = 1, + PointerRoot = 1, + AnyPropertyType = 0, + AnyKey = 0, + AnyButton = 0, + AllTemporary = 0, + CurrentTime = 0, + NoSymbol = 0; + + /** ERROR CODES */ + public static final int + Success = 0, + BadRequest = 1, + BadValue = 2, + BadWindow = 3, + BadPixmap = 4, + BadAtom = 5, + BadCursor = 6, + BadFont = 7, + BadMatch = 8, + BadDrawable = 9, + BadAccess = 10, + BadAlloc = 11, + BadColor = 12, + BadGC = 13, + BadIDChoice = 14, + BadName = 15, + BadLength = 16, + BadImplementation = 17, + FirstExtensionError = 128, + LastExtensionError = 255; + + /** Window attributes for CreateWindow and ChangeWindowAttributes */ + public static final int + CWBackPixmap = 1 << 0, + CWBackPixel = 1 << 1, + CWBorderPixmap = 1 << 2, + CWBorderPixel = 1 << 3, + CWBitGravity = 1 << 4, + CWWinGravity = 1 << 5, + CWBackingStore = 1 << 6, + CWBackingPlanes = 1 << 7, + CWBackingPixel = 1 << 8, + CWOverrideRedirect = 1 << 9, + CWSaveUnder = 1 << 10, + CWEventMask = 1 << 11, + CWDontPropagate = 1 << 12, + CWColormap = 1 << 13, + CWCursor = 1 << 14; + + /** Input Event Masks. Used as event-mask window attribute and as arguments to Grab requests. Not to be confused with event names. */ + public static final int + NoEventMask = 0, + KeyPressMask = 1 << 0, + KeyReleaseMask = 1 << 1, + ButtonPressMask = 1 << 2, + ButtonReleaseMask = 1 << 3, + EnterWindowMask = 1 << 4, + LeaveWindowMask = 1 << 5, + PointerMotionMask = 1 << 6, + PointerMotionHintMask = 1 << 7, + Button1MotionMask = 1 << 8, + Button2MotionMask = 1 << 9, + Button3MotionMask = 1 << 10, + Button4MotionMask = 1 << 11, + Button5MotionMask = 1 << 12, + ButtonMotionMask = 1 << 13, + KeymapStateMask = 1 << 14, + ExposureMask = 1 << 15, + VisibilityChangeMask = 1 << 16, + StructureNotifyMask = 1 << 17, + ResizeRedirectMask = 1 << 18, + SubstructureNotifyMask = 1 << 19, + SubstructureRedirectMask = 1 << 20, + FocusChangeMask = 1 << 21, + PropertyChangeMask = 1 << 22, + ColormapChangeMask = 1 << 23, + OwnerGrabButtonMask = 1 << 24; + + /** + * Event names. Used in "type" field in {@code XEvent} structures. Not to be confused with event masks above. They start from 2 because 0 and 1 are reserved in + * the protocol for errors and replies. + */ + public static final int + KeyPress = 2, + KeyRelease = 3, + ButtonPress = 4, + ButtonRelease = 5, + MotionNotify = 6, + EnterNotify = 7, + LeaveNotify = 8, + FocusIn = 9, + FocusOut = 10, + KeymapNotify = 11, + Expose = 12, + GraphicsExpose = 13, + NoExpose = 14, + VisibilityNotify = 15, + CreateNotify = 16, + DestroyNotify = 17, + UnmapNotify = 18, + MapNotify = 19, + MapRequest = 20, + ReparentNotify = 21, + ConfigureNotify = 22, + ConfigureRequest = 23, + GravityNotify = 24, + ResizeRequest = 25, + CirculateNotify = 26, + CirculateRequest = 27, + PropertyNotify = 28, + SelectionClear = 29, + SelectionRequest = 30, + SelectionNotify = 31, + ColormapNotify = 32, + ClientMessage = 33, + MappingNotify = 34, + GenericEvent = 35, + LASTEvent = 36; + + /** Key masks. Used as modifiers to GrabButton and GrabKey, results of QueryPointer, state in various key-, mouse-, and button-related events. */ + public static final int + ShiftMask = 1<<0, + LockMask = 1<<1, + ControlMask = 1<<2, + Mod1Mask = 1<<3, + Mod2Mask = 1<<4, + Mod3Mask = 1<<5, + Mod4Mask = 1<<6, + Mod5Mask = 1<<7; + + /** modifier names. Used to build a SetModifierMapping request or to read a GetModifierMapping request. These correspond to the masks defined above. */ + public static final int + ShiftMapIndex = 0, + LockMapIndex = 1, + ControlMapIndex = 2, + Mod1MapIndex = 3, + Mod2MapIndex = 4, + Mod3MapIndex = 5, + Mod4MapIndex = 6, + Mod5MapIndex = 7; + + /** button masks. Used in same manner as Key masks above. Not to be confused with button names below. */ + public static final int + Button1Mask = 1<<8, + Button2Mask = 1<<9, + Button3Mask = 1<<10, + Button4Mask = 1<<11, + Button5Mask = 1<<12, + AnyModifier = 1<<15; + + /** + * button names. Used as arguments to GrabButton and as detail in ButtonPress and ButtonRelease events. Not to be confused with button masks above. Note + * that 0 is already defined above as "AnyButton". + */ + public static final int + Button1 = 1, + Button2 = 2, + Button3 = 3, + Button4 = 4, + Button5 = 5; + + /** Notify modes */ + public static final int + NotifyNormal = 0, + NotifyGrab = 1, + NotifyUngrab = 2, + NotifyWhileGrabbed = 3, + NotifyHint = 1; + + /** Notify detail */ + public static final int + NotifyAncestor = 0, + NotifyVirtual = 1, + NotifyInferior = 2, + NotifyNonlinear = 3, + NotifyNonlinearVirtual = 4, + NotifyPointer = 5, + NotifyPointerRoot = 6, + NotifyDetailNone = 7; + + /** Visibility notify */ + public static final int + VisibilityUnobscured = 0, + VisibilityPartiallyObscured = 1, + VisibilityFullyObscured = 2; + + /** Circulation request */ + public static final int + PlaceOnTop = 0, + PlaceOnBottom = 1; + + /** Property notification */ + public static final int + PropertyNewValue = 0, + PropertyDelete = 1; + + /** Color Map notification */ + public static final int + ColormapUninstalled = 0, + ColormapInstalled = 1; + + /** GrabPointer, GrabButton, GrabKeyboard, GrabKey Modes */ + public static final int + GrabModeSync = 0, + GrabModeAsync = 1; + + /** GrabPointer, GrabKeyboard reply status */ + public static final int + GrabSuccess = 0, + AlreadyGrabbed = 1, + GrabInvalidTime = 2, + GrabNotViewable = 3, + GrabFrozen = 4; + + /** AllowEvents modes */ + public static final int + AsyncPointer = 0, + SyncPointer = 1, + ReplayPointer = 2, + AsyncKeyboard = 3, + SyncKeyboard = 4, + ReplayKeyboard = 5, + AsyncBoth = 6, + SyncBoth = 7; + + /** For {@link #XCreateColormap}. */ + public static final int + AllocNone = 0, + AllocAll = 1; + + /** Used in XSetInputFocus(), XGetInputFocus(). */ + public static final int + RevertToNone = None, + RevertToPointerRoot = PointerRoot, + RevertToParent = 2; + + /** Window classes used by {@link #XCreateWindow}. */ + public static final int + InputOutput = 1, + InputOnly = 2; + + /** SCREEN SAVER STUFF */ + public static final int + DontPreferBlanking = 0, + PreferBlanking = 1, + DefaultBlanking = 2, + DisableScreenSaver = 0, + DisableScreenInterval = 0, + DontAllowExposures = 0, + AllowExposures = 1, + DefaultExposures = 2, + ScreenSaverReset = 0, + ScreenSaverActive = 1; + + /** Property modes */ + public static final int + PropModeReplace = 0, + PropModePrepend = 1, + PropModeAppend = 2; + + /** graphics functions, as in GC.alu */ + public static final int + GXclear = 0x0, + GXand = 0x1, + GXandReverse = 0x2, + GXcopy = 0x3, + GXandInverted = 0x4, + GXnoop = 0x5, + GXxor = 0x6, + GXor = 0x7, + GXnor = 0x8, + GXequiv = 0x9, + GXinvert = 0xA, + GXorReverse = 0xB, + GXcopyInverted = 0xC, + GXorInverted = 0xD, + GXnand = 0xE, + GXset = 0xF; + + /** LineStyle */ + public static final int + LineSolid = 0, + LineOnOffDash = 1, + LineDoubleDash = 2; + + /** capStyle */ + public static final int + CapNotLast = 0, + CapButt = 1, + CapRound = 2, + CapProjecting = 3; + + /** joinStyle */ + public static final int + JoinMiter = 0, + JoinRound = 1, + JoinBevel = 2; + + /** fillStyle */ + public static final int + FillSolid = 0, + FillTiled = 1, + FillStippled = 2, + FillOpaqueStippled = 3; + + /** fillRule */ + public static final int + EvenOddRule = 0, + WindingRule = 1; + + /** subwindow mode */ + public static final int + ClipByChildren = 0, + IncludeInferiors = 1; + + /** SetClipRectangles ordering */ + public static final int + Unsorted = 0, + YSorted = 1, + YXSorted = 2, + YXBanded = 3; + + /** CoordinateMode for drawing routines */ + public static final int + CoordModeOrigin = 0, + CoordModePrevious = 1; + + /** Polygon shapes */ + public static final int + Complex = 0, + Nonconvex = 1, + Convex = 2; + + /** Arc modes for PolyFillArc */ + public static final int + ArcChord = 0, + ArcPieSlice = 1; + + /** GC components: masks used in CreateGC, CopyGC, ChangeGC, OR'ed into GC.stateChanges */ + public static final int + GCFunction = 1<<0, + GCPlaneMask = 1<<1, + GCForeground = 1<<2, + GCBackground = 1<<3, + GCLineWidth = 1<<4, + GCLineStyle = 1<<5, + GCCapStyle = 1<<6, + GCJoinStyle = 1<<7, + GCFillStyle = 1<<8, + GCFillRule = 1<<9, + GCTile = 1<<10, + GCStipple = 1<<11, + GCTileStipXOrigin = 1<<12, + GCTileStipYOrigin = 1<<13, + GCFont = 1<<14, + GCSubwindowMode = 1<<15, + GCGraphicsExposures = 1<<16, + GCClipXOrigin = 1<<17, + GCClipYOrigin = 1<<18, + GCClipMask = 1<<19, + GCDashOffset = 1<<20, + GCDashList = 1<<21, + GCArcMode = 1<<22, + GCLastBit = 22; + + public static final int + Above = 0, + Below = 1, + TopIf = 2, + BottomIf = 3, + Opposite = 4; + + public static final int + MappingModifier = 0, + MappingKeyboard = 1, + MappingPointer = 2; + + protected X11() { + throw new UnsupportedOperationException(); + } + + private static final SharedLibrary X11 = Library.loadNative(X11.class, "org.lwjgl", null, "libX11.so.6", "libX11.so"); + + /** Contains the function pointers loaded from the X11 {@link SharedLibrary}. */ + public static final class Functions { + + private Functions() {} + + /** Function address. */ + public static final long + XOpenDisplay = apiGetFunctionAddress(X11, "XOpenDisplay"), + XCloseDisplay = apiGetFunctionAddress(X11, "XCloseDisplay"), + XDefaultScreen = apiGetFunctionAddress(X11, "XDefaultScreen"), + XRootWindow = apiGetFunctionAddress(X11, "XRootWindow"), + XCreateColormap = apiGetFunctionAddress(X11, "XCreateColormap"), + XFreeColormap = apiGetFunctionAddress(X11, "XFreeColormap"), + XCreateWindow = apiGetFunctionAddress(X11, "XCreateWindow"), + XDestroyWindow = apiGetFunctionAddress(X11, "XDestroyWindow"), + XFree = apiGetFunctionAddress(X11, "XFree"), + XSendEvent = apiGetFunctionAddress(X11, "XSendEvent"), + XDisplayMotionBufferSize = apiGetFunctionAddress(X11, "XDisplayMotionBufferSize"), + XGetMotionEvents = apiGetFunctionAddress(X11, "XGetMotionEvents"), + XTranslateCoordinates = apiGetFunctionAddress(X11, "XTranslateCoordinates"); + + } + + /** Returns the X11 {@link SharedLibrary}. */ + public static SharedLibrary getLibrary() { + return X11; + } + + // --- [ XOpenDisplay ] --- + + /** Unsafe version of: {@link #XOpenDisplay} */ + public static long nXOpenDisplay(long display_name) { + long __functionAddress = Functions.XOpenDisplay; + return invokePP(display_name, __functionAddress); + } + + /** + * Returns a Display structure that serves as the connection to the X server and that contains all the information about that X server. {@code XOpenDisplay} + * connects your application to the X server through TCP or DECnet communications protocols, or through some local inter-process communication protocol. + * If the hostname is a host machine name and a single colon (:) separates the hostname and display number, {@code XOpenDisplay} connects using TCP streams. + * If the hostname is not specified, Xlib uses whatever it believes is the fastest transport. If the hostname is a host machine name and a double colon + * (::) separates the hostname and display number, {@code XOpenDisplay} connects using DECnet. A single X server can support any or all of these transport + * mechanisms simultaneously. A particular Xlib implementation can support many more of these transport mechanisms. + * + * @param display_name the hardware display name, which determines the display and communications domain to be used. On a POSIX-conformant system, if the + * {@code display_name} is {@code NULL}, it defaults to the value of the DISPLAY environment variable. + */ + @NativeType("Display *") + public static long XOpenDisplay(@Nullable @NativeType("char const *") ByteBuffer display_name) { + if (CHECKS) { + checkNT1Safe(display_name); + } + return nXOpenDisplay(memAddressSafe(display_name)); + } + + /** + * Returns a Display structure that serves as the connection to the X server and that contains all the information about that X server. {@code XOpenDisplay} + * connects your application to the X server through TCP or DECnet communications protocols, or through some local inter-process communication protocol. + * If the hostname is a host machine name and a single colon (:) separates the hostname and display number, {@code XOpenDisplay} connects using TCP streams. + * If the hostname is not specified, Xlib uses whatever it believes is the fastest transport. If the hostname is a host machine name and a double colon + * (::) separates the hostname and display number, {@code XOpenDisplay} connects using DECnet. A single X server can support any or all of these transport + * mechanisms simultaneously. A particular Xlib implementation can support many more of these transport mechanisms. + * + * @param display_name the hardware display name, which determines the display and communications domain to be used. On a POSIX-conformant system, if the + * {@code display_name} is {@code NULL}, it defaults to the value of the DISPLAY environment variable. + */ + @NativeType("Display *") + public static long XOpenDisplay(@Nullable @NativeType("char const *") CharSequence display_name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCIISafe(display_name, true); + long display_nameEncoded = display_name == null ? NULL : stack.getPointerAddress(); + return nXOpenDisplay(display_nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ XCloseDisplay ] --- + + /** + * Closes the connection to the X server for the display specified in the {@code Display} structure and destroys all windows, resource IDs (Window, Font, + * Pixmap, Colormap, Cursor, and GContext), or other resources that the client has created on this display, unless the close-down mode of the resource has + * been changed (see {@code XSetCloseDownMode()}). Therefore, these windows, resource IDs, and other resources should never be referenced again or an error will + * be generated. Before exiting, you should call {@code XCloseDisplay()} explicitly so that any pending errors are reported as {@code XCloseDisplay()} + * performs a final {@code XSync()} operation. + * + * @param display the connection to the X server + */ + public static void XCloseDisplay(@NativeType("Display *") long display) { + long __functionAddress = Functions.XCloseDisplay; + if (CHECKS) { + check(display); + } + invokePV(display, __functionAddress); + } + + // --- [ XDefaultScreen ] --- + + /** + * Returns a pointer to the default screen. + * + * @param display the connection to the X server + */ + public static int XDefaultScreen(@NativeType("Display *") long display) { + long __functionAddress = Functions.XDefaultScreen; + if (CHECKS) { + check(display); + } + return invokePI(display, __functionAddress); + } + + // --- [ XRootWindow ] --- + + /** + * Returns the root window of the specified screen. + * + * @param display the connection to the X server + * @param screen_number the appropriate screen number on the host server + */ + @NativeType("Window") + public static long XRootWindow(@NativeType("Display *") long display, int screen_number) { + long __functionAddress = Functions.XRootWindow; + if (CHECKS) { + check(display); + } + return invokePN(display, screen_number, __functionAddress); + } + + // --- [ XCreateColormap ] --- + + /** Unsafe version of: {@link #XCreateColormap} */ + public static long nXCreateColormap(long display, long w, long visual, int alloc) { + long __functionAddress = Functions.XCreateColormap; + if (CHECKS) { + check(display); + } + return invokePNPN(display, w, visual, alloc, __functionAddress); + } + + /** + * Creates a colormap of the specified visual type for the screen on which the specified window resides and returns the colormap ID associated with it. + * Note that the specified window is only used to determine the screen. + * + * @param display the connection to the X server + * @param w the window + * @param visual a visual type supported on the screen. If the visual type is not one supported by the screen, a {@code BadMatch} error results. + * @param alloc the colormap entries to be allocated. You can pass AllocNone or AllocAll. + */ + @NativeType("Colormap") + public static long XCreateColormap(@NativeType("Display *") long display, @NativeType("Window") long w, @NativeType("Visual *") Visual visual, int alloc) { + return nXCreateColormap(display, w, visual.address(), alloc); + } + + // --- [ XFreeColormap ] --- + + /** + * Deletes the association between the {@code colormap} resource ID and the {@code colormap} and frees the {@code colormap} storage. However, this function + * has no effect on the default colormap for a screen. If the specified {@code colormap} is an installed map for a screen, it is uninstalled. If the + * specified {@code colormap} is defined as the {@code colormap} for a window, {@code XFreeColormap()} changes the colormap associated with the window to + * {@link #None} and generates a {@code ColormapNotify} event. X does not define the colors displayed for a window with a colormap of {@link #None}. + * + * @param display the connection to the X server + * @param colormap the colormap to destroy + */ + public static int XFreeColormap(@NativeType("Display *") long display, @NativeType("Colormap") long colormap) { + long __functionAddress = Functions.XFreeColormap; + if (CHECKS) { + check(display); + } + return invokePNI(display, colormap, __functionAddress); + } + + // --- [ XCreateWindow ] --- + + /** Unsafe version of: {@link #XCreateWindow} */ + public static long nXCreateWindow(long display, long parent, int x, int y, int width, int height, int border_width, int depth, int windowClass, long visual, long valuemask, long attributes) { + long __functionAddress = Functions.XCreateWindow; + if (CHECKS) { + check(display); + } + return invokePNPNPN(display, parent, x, y, width, height, border_width, depth, windowClass, visual, valuemask, attributes, __functionAddress); + } + + /** + * Creates an unmapped subwindow for a specified parent window, returns the window ID of the created window, and causes the X server to generate a + * {@code CreateNotify }event. The created window is placed on top in the stacking order with respect to siblings. + * + *

The coordinate system has the X axis horizontal and the Y axis vertical with the origin [0, 0] at the upper-left corner. Coordinates are integral, in + * terms of pixels, and coincide with pixel centers. Each window and pixmap has its own coordinate system. For a window, the origin is inside the border at + * the inside, upper-left corner.

+ * + *

The x and y coordinates are the top-left outside corner of the window's borders and are relative to the inside of the parent window's borders.

+ * + *

The width and height are the created window's inside dimensions and do not include the created window's borders.

+ * + * @param display the connection to the X server + * @param parent the parent window + * @param x the window x-coordinate + * @param y the window y-coordinate + * @param width the window width + * @param height the window height + * @param border_width the border width + * @param depth the window's depth. A depth of {@link #CopyFromParent} means the depth is taken from the parent. + * @param windowClass the created window's class. One of:
{@link #InputOutput}{@link #InputOnly}{@link #CopyFromParent}
+ * @param visual the visual type. A visual of {@link #CopyFromParent} means the visual type is taken from the parent. + * @param valuemask which window attributes are defined in the attributes argument. This mask is the bitwise inclusive OR of the valid attribute mask bits. If + * {@code valuemask} is zero, the attributes are ignored and are not referenced. + * @param attributes the structure from which the values (as specified by the value mask) are to be taken + */ + @NativeType("Window") + public static long XCreateWindow(@NativeType("Display *") long display, @NativeType("Window") long parent, int x, int y, @NativeType("unsigned int") int width, @NativeType("unsigned int") int height, @NativeType("unsigned int") int border_width, int depth, @NativeType("unsigned int") int windowClass, @NativeType("Visual *") Visual visual, @NativeType("unsigned long") long valuemask, @NativeType("XSetWindowAttributes *") XSetWindowAttributes attributes) { + return nXCreateWindow(display, parent, x, y, width, height, border_width, depth, windowClass, visual.address(), valuemask, attributes.address()); + } + + // --- [ XDestroyWindow ] --- + + /** + * Destroys the specified window as well as all of its subwindows and causes the X server to generate a {@code DestroyNotify} event for each window. The + * window should never be referenced again. If the window specified by the {@code w} argument is mapped, it is unmapped automatically. The ordering of the + * {@code DestroyNotify} events is such that for any given window being destroyed, {@code DestroyNotify} is generated on any inferiors of the window before + * being generated on the window itself. The ordering among siblings and across subhierarchies is not otherwise constrained. If the window you specified is + * a root window, no windows are destroyed. Destroying a mapped window will generate {@code Expose} events on other windows that were obscured by the + * window being destroyed. + * + * @param display the connection to the X server + * @param w the window + */ + public static int XDestroyWindow(@NativeType("Display *") long display, @NativeType("Window") long w) { + long __functionAddress = Functions.XDestroyWindow; + if (CHECKS) { + check(display); + } + return invokePNI(display, w, __functionAddress); + } + + // --- [ XFree ] --- + + /** Unsafe version of: {@link #XFree} */ + public static int nXFree(long data) { + long __functionAddress = Functions.XFree; + return invokePI(data, __functionAddress); + } + + /** + * Free in-memory data that was created by an Xlib function. + * + * @param data the data that is to be freed + */ + public static int XFree(@NativeType("void *") ByteBuffer data) { + return nXFree(memAddress(data)); + } + + /** + * Free in-memory data that was created by an Xlib function. + * + * @param data the data that is to be freed + */ + public static int XFree(@NativeType("void *") PointerBuffer data) { + return nXFree(memAddress(data)); + } + + // --- [ XSendEvent ] --- + + /** Unsafe version of: {@link #XSendEvent} */ + public static int nXSendEvent(long display, long w, int propagate, long event_mask, long event_send) { + long __functionAddress = Functions.XSendEvent; + if (CHECKS) { + check(display); + } + return invokePNNPI(display, w, propagate, event_mask, event_send, __functionAddress); + } + + /** + * The {@code XSendEvent} function identifies the destination window, determines which clients should receive the specified events, and ignores any active + * grabs. This function requires you to pass an event mask. This function uses the {@code w} argument to identify the destination window as follows: + * + *
    + *
  • If {@code w} is {@code PointerWindow}, the destination window is the window that contains the pointer.
  • + *
  • If {@code w} is {@code InputFocus} and if the focus window contains the pointer, the destination window is the window that contains the pointer; + * otherwise, the destination window is the focus window.
  • + *
+ * + *

To determine which clients should receive the specified events, {@code XSendEvent} uses the propagate argument as follows:

+ * + *
    + *
  • If {@code event_mask} is the empty set, the event is sent to the client that created the destination window. If that client no longer exists, no + * event is sent.
  • + *
  • If {@code propagate} is {@link #False}, the event is sent to every client selecting on destination any of the event types in the {@code event_mask} + * argument.
  • + *
  • If {@code propagate} is {@link #True} and no clients have selected on destination any of the event types in event-mask, the destination is replaced with + * the closest ancestor of destination for which some client has selected a type in event-mask and for which no intervening window has that type in + * its do-not-propagate-mask. If no such window exists or if the window is an ancestor of the focus window and {@link #InputFocus} was originally specified as + * the destination, the event is not sent to any clients. Otherwise, the event is reported to every client selecting on the final destination any of + * the types specified in {@code event_mask}.
  • + *
+ * + *

The event in the {@code XEvent} structure must be one of the core events or one of the events defined by an extension (or a {@link #BadValue} error results) so + * that the X server can correctly byte-swap the contents as necessary. The contents of the event are otherwise unaltered and unchecked by the X server + * except to force {@code send_event} to {@link #True} in the forwarded event and to set the serial number in the event correctly; therefore these fields and the + * display field are ignored by {@code XSendEvent}.

+ * + *

{@code XSendEvent} returns zero if the conversion to wire protocol format failed and returns nonzero otherwise. {@code XSendEvent} can generate + * {@link #BadValue} and {@link #BadWindow} errors.

+ * + *

The server may retain the recent history of the pointer motion and do so to a finer granularity than is reported by {@link #MotionNotify} events. The + * {@link #XGetMotionEvents} function makes this history available.

+ * + * @param display the connection to the X server + * @param w specifies the window the event is to be sent to + * @param propagate specifies a {@code Boolean} value + * @param event_mask specifies the event mask + * @param event_send specifies the event that is to be sent + */ + @NativeType("Status") + public static int XSendEvent(@NativeType("Display *") long display, @NativeType("Window") long w, @NativeType("Bool") boolean propagate, long event_mask, @NativeType("XEvent *") XEvent event_send) { + return nXSendEvent(display, w, propagate ? 1 : 0, event_mask, event_send.address()); + } + + // --- [ XDisplayMotionBufferSize ] --- + + /** @param display the connection to the X server */ + @NativeType("unsigned long") + public static long XDisplayMotionBufferSize(@NativeType("Display *") long display) { + long __functionAddress = Functions.XDisplayMotionBufferSize; + if (CHECKS) { + check(display); + } + return invokePN(display, __functionAddress); + } + + // --- [ XGetMotionEvents ] --- + + /** Unsafe version of: {@link #XGetMotionEvents} */ + public static long nXGetMotionEvents(long display, long w, long start, long stop, long nevents_return) { + long __functionAddress = Functions.XGetMotionEvents; + if (CHECKS) { + check(display); + } + return invokePNNNPP(display, w, start, stop, nevents_return, __functionAddress); + } + + /** + * The {@code XGetMotionEvents} function returns all events in the motion history buffer that fall between the specified start and stop times, inclusive, + * and that have coordinates that lie within the specified window (including its borders) at its present placement. + * + *

If the server does not support motion history, if the start time is later than the stop time, or if the start time is in the future, no events are + * returned; {@code XGetMotionEvents} returns {@code NULL}. If the stop time is in the future, it is equivalent to specifying {@link #CurrentTime}. + * {@code XGetMotionEvents} can generate a {@link #BadWindow} error.

+ * + * @param display the connection to the X server + */ + @Nullable + @NativeType("XTimeCoord *") + public static XTimeCoord.Buffer XGetMotionEvents(@NativeType("Display *") long display, @NativeType("Window") long w, @NativeType("Time") long start, @NativeType("Time") long stop) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + IntBuffer nevents_return = stack.callocInt(1); + try { + long __result = nXGetMotionEvents(display, w, start, stop, memAddress(nevents_return)); + return XTimeCoord.createSafe(__result, nevents_return.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ XTranslateCoordinates ] --- + + /** Unsafe version of: {@link #XTranslateCoordinates} */ + public static int nXTranslateCoordinates(long display, long src_w, long dest_w, int src_x, int src_y, long dest_x_return, long dest_y_return, long child_return) { + long __functionAddress = Functions.XTranslateCoordinates; + if (CHECKS) { + check(display); + } + return invokePNNPPPI(display, src_w, dest_w, src_x, src_y, dest_x_return, dest_y_return, child_return, __functionAddress); + } + + /** + * Translates window coordinates. + * + *

If {@code XTranslateCoordinates} returns {@link #True}, it takes the {@code src_x} and {@code src_y} coordinates relative to the source window's origin and + * returns these coordinates to {@code dest_x_return} and {@code dest_y_return} relative to the destination window's origin. If + * {@code XTranslateCoordinates} returns {@link #False}, {@code src_w} and {@code dest_w} are on different screens, and {@code dest_x_return} and + * {@code dest_y_return} are zero. If the coordinates are contained in a mapped child of {@code dest_w}, that child is returned to {@code child_return}. + * Otherwise, {@code child_return} is set to {@link #None}.

+ * + *

{@code XTranslateCoordinates} can generate a {@link #BadWindow} error.

+ * + * @param display the connection to the X server + * @param src_w specifies the source window + * @param dest_w specifies the destination window + * @param src_x specifies the x coordinate within the source window + * @param src_y specifies the x coordinate within the source window + * @param dest_x_return returns the x coordinate within the destination window + * @param dest_y_return returns the y coordinate within the destination window + * @param child_return returns the child if the coordinates are contained in a mapped child of the destination window + */ + @NativeType("Bool") + public static boolean XTranslateCoordinates(@NativeType("Display *") long display, @NativeType("Window") long src_w, @NativeType("Window") long dest_w, int src_x, int src_y, @NativeType("int *") IntBuffer dest_x_return, @NativeType("int *") IntBuffer dest_y_return, @NativeType("Window *") CLongBuffer child_return) { + if (CHECKS) { + check(dest_x_return, 1); + check(dest_y_return, 1); + check(child_return, 1); + } + return nXTranslateCoordinates(display, src_w, dest_w, src_x, src_y, memAddress(dest_x_return), memAddress(dest_y_return), memAddress(child_return)) != 0; + } + + /** Array version of: {@link #XTranslateCoordinates} */ + @NativeType("Bool") + public static boolean XTranslateCoordinates(@NativeType("Display *") long display, @NativeType("Window") long src_w, @NativeType("Window") long dest_w, int src_x, int src_y, @NativeType("int *") int[] dest_x_return, @NativeType("int *") int[] dest_y_return, @NativeType("Window *") CLongBuffer child_return) { + long __functionAddress = Functions.XTranslateCoordinates; + if (CHECKS) { + check(display); + check(dest_x_return, 1); + check(dest_y_return, 1); + check(child_return, 1); + } + return invokePNNPPPI(display, src_w, dest_w, src_x, src_y, dest_x_return, dest_y_return, memAddress(child_return), __functionAddress) != 0; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XAnyEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XAnyEvent.java new file mode 100644 index 00000000..00762d77 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XAnyEvent.java @@ -0,0 +1,398 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Generic X event. + * + *

Member documentation

+ * + *
    + *
  • {@code type} – the event type constant name that uniquely identifies it
  • + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code window} – window it reported relative to
  • + *
+ * + *

Layout

+ * + *

+ * struct XAnyEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window window;
+ * }
+ */ +public class XAnyEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + WINDOW; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + WINDOW = layout.offsetof(4); + } + + /** + * Creates a {@code XAnyEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XAnyEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XAnyEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XAnyEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XAnyEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XAnyEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XAnyEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XAnyEvent set( + int type, + long serial, + boolean send_event, + long display, + long window + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + window(window); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XAnyEvent set(XAnyEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XAnyEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XAnyEvent malloc() { + return wrap(XAnyEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XAnyEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XAnyEvent calloc() { + return wrap(XAnyEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XAnyEvent} instance allocated with {@link BufferUtils}. */ + public static XAnyEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XAnyEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XAnyEvent} instance for the specified memory address. */ + public static XAnyEvent create(long address) { + return wrap(XAnyEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XAnyEvent createSafe(long address) { + return address == NULL ? null : wrap(XAnyEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XAnyEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XAnyEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XAnyEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XAnyEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XAnyEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XAnyEvent mallocStack(MemoryStack stack) { + return wrap(XAnyEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XAnyEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XAnyEvent callocStack(MemoryStack stack) { + return wrap(XAnyEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XAnyEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XAnyEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XAnyEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XAnyEvent.DISPLAY); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XAnyEvent.WINDOW); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XAnyEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XAnyEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XAnyEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XAnyEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XAnyEvent.WINDOW, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XAnyEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XAnyEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XAnyEvent ELEMENT_FACTORY = XAnyEvent.create(-1L); + + /** + * Creates a new {@code XAnyEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XAnyEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XAnyEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XAnyEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XAnyEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XAnyEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XAnyEvent.ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XAnyEvent.nwindow(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XAnyEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XAnyEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XAnyEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XAnyEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XAnyEvent.nwindow(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XButtonEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XButtonEvent.java new file mode 100644 index 00000000..bd01992a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XButtonEvent.java @@ -0,0 +1,600 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Button event. + * + *

Member documentation

+ * + *
    + *
  • {@code type} – the event type. One of:
    {@link X11#ButtonPress}{@link X11#ButtonRelease}
  • + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code window} – window it reported relative to
  • + *
  • {@code root} – root window that the event occurred on
  • + *
  • {@code subwindow} – child window
  • + *
  • {@code time} – milliseconds
  • + *
  • {@code x} – pointer x coordinate in event window
  • + *
  • {@code y} – pointer y coordinate in event window
  • + *
  • {@code x_root} – x coordinate relative to {@code root}
  • + *
  • {@code y_root} – y coordinate relative to {@code root}
  • + *
  • {@code state} – button mask
  • + *
  • {@code button} – detail
  • + *
  • {@code same_screen} – same screen flag
  • + *
+ * + *

Layout

+ * + *

+ * struct XButtonEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window window;
+ *     Window root;
+ *     Window subwindow;
+ *     Time time;
+ *     int x;
+ *     int y;
+ *     int x_root;
+ *     int y_root;
+ *     unsigned int state;
+ *     unsigned int button;
+ *     Bool same_screen;
+ * }
+ */ +public class XButtonEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + WINDOW, + ROOT, + SUBWINDOW, + TIME, + X, + Y, + X_ROOT, + Y_ROOT, + STATE, + BUTTON, + SAME_SCREEN; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + WINDOW = layout.offsetof(4); + ROOT = layout.offsetof(5); + SUBWINDOW = layout.offsetof(6); + TIME = layout.offsetof(7); + X = layout.offsetof(8); + Y = layout.offsetof(9); + X_ROOT = layout.offsetof(10); + Y_ROOT = layout.offsetof(11); + STATE = layout.offsetof(12); + BUTTON = layout.offsetof(13); + SAME_SCREEN = layout.offsetof(14); + } + + /** + * Creates a {@code XButtonEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XButtonEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code root} field. */ + @NativeType("Window") + public long root() { return nroot(address()); } + /** Returns the value of the {@code subwindow} field. */ + @NativeType("Window") + public long subwindow() { return nsubwindow(address()); } + /** Returns the value of the {@code time} field. */ + @NativeType("Time") + public long time() { return ntime(address()); } + /** Returns the value of the {@code x} field. */ + public int x() { return nx(address()); } + /** Returns the value of the {@code y} field. */ + public int y() { return ny(address()); } + /** Returns the value of the {@code x_root} field. */ + public int x_root() { return nx_root(address()); } + /** Returns the value of the {@code y_root} field. */ + public int y_root() { return ny_root(address()); } + /** Returns the value of the {@code state} field. */ + @NativeType("unsigned int") + public int state() { return nstate(address()); } + /** Returns the value of the {@code button} field. */ + @NativeType("unsigned int") + public int button() { return nbutton(address()); } + /** Returns the value of the {@code same_screen} field. */ + @NativeType("Bool") + public boolean same_screen() { return nsame_screen(address()) != 0; } + + /** Sets the specified value to the {@code type} field. */ + public XButtonEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XButtonEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XButtonEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XButtonEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XButtonEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Sets the specified value to the {@code root} field. */ + public XButtonEvent root(@NativeType("Window") long value) { nroot(address(), value); return this; } + /** Sets the specified value to the {@code subwindow} field. */ + public XButtonEvent subwindow(@NativeType("Window") long value) { nsubwindow(address(), value); return this; } + /** Sets the specified value to the {@code time} field. */ + public XButtonEvent time(@NativeType("Time") long value) { ntime(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public XButtonEvent x(int value) { nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public XButtonEvent y(int value) { ny(address(), value); return this; } + /** Sets the specified value to the {@code x_root} field. */ + public XButtonEvent x_root(int value) { nx_root(address(), value); return this; } + /** Sets the specified value to the {@code y_root} field. */ + public XButtonEvent y_root(int value) { ny_root(address(), value); return this; } + /** Sets the specified value to the {@code state} field. */ + public XButtonEvent state(@NativeType("unsigned int") int value) { nstate(address(), value); return this; } + /** Sets the specified value to the {@code button} field. */ + public XButtonEvent button(@NativeType("unsigned int") int value) { nbutton(address(), value); return this; } + /** Sets the specified value to the {@code same_screen} field. */ + public XButtonEvent same_screen(@NativeType("Bool") boolean value) { nsame_screen(address(), value ? 1 : 0); return this; } + + /** Initializes this struct with the specified values. */ + public XButtonEvent set( + int type, + long serial, + boolean send_event, + long display, + long window, + long root, + long subwindow, + long time, + int x, + int y, + int x_root, + int y_root, + int state, + int button, + boolean same_screen + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + window(window); + root(root); + subwindow(subwindow); + time(time); + x(x); + y(y); + x_root(x_root); + y_root(y_root); + state(state); + button(button); + same_screen(same_screen); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XButtonEvent set(XButtonEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XButtonEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XButtonEvent malloc() { + return wrap(XButtonEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XButtonEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XButtonEvent calloc() { + return wrap(XButtonEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XButtonEvent} instance allocated with {@link BufferUtils}. */ + public static XButtonEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XButtonEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XButtonEvent} instance for the specified memory address. */ + public static XButtonEvent create(long address) { + return wrap(XButtonEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XButtonEvent createSafe(long address) { + return address == NULL ? null : wrap(XButtonEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XButtonEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XButtonEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XButtonEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XButtonEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XButtonEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XButtonEvent mallocStack(MemoryStack stack) { + return wrap(XButtonEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XButtonEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XButtonEvent callocStack(MemoryStack stack) { + return wrap(XButtonEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XButtonEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XButtonEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XButtonEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XButtonEvent.DISPLAY); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XButtonEvent.WINDOW); } + /** Unsafe version of {@link #root}. */ + public static long nroot(long struct) { return memGetCLong(struct + XButtonEvent.ROOT); } + /** Unsafe version of {@link #subwindow}. */ + public static long nsubwindow(long struct) { return memGetCLong(struct + XButtonEvent.SUBWINDOW); } + /** Unsafe version of {@link #time}. */ + public static long ntime(long struct) { return memGetCLong(struct + XButtonEvent.TIME); } + /** Unsafe version of {@link #x}. */ + public static int nx(long struct) { return UNSAFE.getInt(null, struct + XButtonEvent.X); } + /** Unsafe version of {@link #y}. */ + public static int ny(long struct) { return UNSAFE.getInt(null, struct + XButtonEvent.Y); } + /** Unsafe version of {@link #x_root}. */ + public static int nx_root(long struct) { return UNSAFE.getInt(null, struct + XButtonEvent.X_ROOT); } + /** Unsafe version of {@link #y_root}. */ + public static int ny_root(long struct) { return UNSAFE.getInt(null, struct + XButtonEvent.Y_ROOT); } + /** Unsafe version of {@link #state}. */ + public static int nstate(long struct) { return UNSAFE.getInt(null, struct + XButtonEvent.STATE); } + /** Unsafe version of {@link #button}. */ + public static int nbutton(long struct) { return UNSAFE.getInt(null, struct + XButtonEvent.BUTTON); } + /** Unsafe version of {@link #same_screen}. */ + public static int nsame_screen(long struct) { return UNSAFE.getInt(null, struct + XButtonEvent.SAME_SCREEN); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XButtonEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XButtonEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XButtonEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XButtonEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XButtonEvent.WINDOW, value); } + /** Unsafe version of {@link #root(long) root}. */ + public static void nroot(long struct, long value) { memPutCLong(struct + XButtonEvent.ROOT, value); } + /** Unsafe version of {@link #subwindow(long) subwindow}. */ + public static void nsubwindow(long struct, long value) { memPutCLong(struct + XButtonEvent.SUBWINDOW, value); } + /** Unsafe version of {@link #time(long) time}. */ + public static void ntime(long struct, long value) { memPutCLong(struct + XButtonEvent.TIME, value); } + /** Unsafe version of {@link #x(int) x}. */ + public static void nx(long struct, int value) { UNSAFE.putInt(null, struct + XButtonEvent.X, value); } + /** Unsafe version of {@link #y(int) y}. */ + public static void ny(long struct, int value) { UNSAFE.putInt(null, struct + XButtonEvent.Y, value); } + /** Unsafe version of {@link #x_root(int) x_root}. */ + public static void nx_root(long struct, int value) { UNSAFE.putInt(null, struct + XButtonEvent.X_ROOT, value); } + /** Unsafe version of {@link #y_root(int) y_root}. */ + public static void ny_root(long struct, int value) { UNSAFE.putInt(null, struct + XButtonEvent.Y_ROOT, value); } + /** Unsafe version of {@link #state(int) state}. */ + public static void nstate(long struct, int value) { UNSAFE.putInt(null, struct + XButtonEvent.STATE, value); } + /** Unsafe version of {@link #button(int) button}. */ + public static void nbutton(long struct, int value) { UNSAFE.putInt(null, struct + XButtonEvent.BUTTON, value); } + /** Unsafe version of {@link #same_screen(boolean) same_screen}. */ + public static void nsame_screen(long struct, int value) { UNSAFE.putInt(null, struct + XButtonEvent.SAME_SCREEN, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XButtonEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XButtonEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XButtonEvent ELEMENT_FACTORY = XButtonEvent.create(-1L); + + /** + * Creates a new {@code XButtonEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XButtonEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XButtonEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XButtonEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XButtonEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XButtonEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XButtonEvent.ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XButtonEvent.nwindow(address()); } + /** Returns the value of the {@code root} field. */ + @NativeType("Window") + public long root() { return XButtonEvent.nroot(address()); } + /** Returns the value of the {@code subwindow} field. */ + @NativeType("Window") + public long subwindow() { return XButtonEvent.nsubwindow(address()); } + /** Returns the value of the {@code time} field. */ + @NativeType("Time") + public long time() { return XButtonEvent.ntime(address()); } + /** Returns the value of the {@code x} field. */ + public int x() { return XButtonEvent.nx(address()); } + /** Returns the value of the {@code y} field. */ + public int y() { return XButtonEvent.ny(address()); } + /** Returns the value of the {@code x_root} field. */ + public int x_root() { return XButtonEvent.nx_root(address()); } + /** Returns the value of the {@code y_root} field. */ + public int y_root() { return XButtonEvent.ny_root(address()); } + /** Returns the value of the {@code state} field. */ + @NativeType("unsigned int") + public int state() { return XButtonEvent.nstate(address()); } + /** Returns the value of the {@code button} field. */ + @NativeType("unsigned int") + public int button() { return XButtonEvent.nbutton(address()); } + /** Returns the value of the {@code same_screen} field. */ + @NativeType("Bool") + public boolean same_screen() { return XButtonEvent.nsame_screen(address()) != 0; } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XButtonEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XButtonEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XButtonEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XButtonEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XButtonEvent.nwindow(address(), value); return this; } + /** Sets the specified value to the {@code root} field. */ + public Buffer root(@NativeType("Window") long value) { XButtonEvent.nroot(address(), value); return this; } + /** Sets the specified value to the {@code subwindow} field. */ + public Buffer subwindow(@NativeType("Window") long value) { XButtonEvent.nsubwindow(address(), value); return this; } + /** Sets the specified value to the {@code time} field. */ + public Buffer time(@NativeType("Time") long value) { XButtonEvent.ntime(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public Buffer x(int value) { XButtonEvent.nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public Buffer y(int value) { XButtonEvent.ny(address(), value); return this; } + /** Sets the specified value to the {@code x_root} field. */ + public Buffer x_root(int value) { XButtonEvent.nx_root(address(), value); return this; } + /** Sets the specified value to the {@code y_root} field. */ + public Buffer y_root(int value) { XButtonEvent.ny_root(address(), value); return this; } + /** Sets the specified value to the {@code state} field. */ + public Buffer state(@NativeType("unsigned int") int value) { XButtonEvent.nstate(address(), value); return this; } + /** Sets the specified value to the {@code button} field. */ + public Buffer button(@NativeType("unsigned int") int value) { XButtonEvent.nbutton(address(), value); return this; } + /** Sets the specified value to the {@code same_screen} field. */ + public Buffer same_screen(@NativeType("Bool") boolean value) { XButtonEvent.nsame_screen(address(), value ? 1 : 0); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XCirculateEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XCirculateEvent.java new file mode 100644 index 00000000..92663468 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XCirculateEvent.java @@ -0,0 +1,433 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code place} – one of:
    {@link X11#PlaceOnTop}{@link X11#PlaceOnBottom}
  • + *
+ * + *

Layout

+ * + *

+ * struct XCirculateEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window event;
+ *     Window window;
+ *     int place;
+ * }
+ */ +public class XCirculateEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + EVENT, + WINDOW, + PLACE; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + EVENT = layout.offsetof(4); + WINDOW = layout.offsetof(5); + PLACE = layout.offsetof(6); + } + + /** + * Creates a {@code XCirculateEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XCirculateEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code event} field. */ + @NativeType("Window") + public long event() { return nevent(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code place} field. */ + public int place() { return nplace(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XCirculateEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XCirculateEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XCirculateEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XCirculateEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code event} field. */ + public XCirculateEvent event(@NativeType("Window") long value) { nevent(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XCirculateEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Sets the specified value to the {@code place} field. */ + public XCirculateEvent place(int value) { nplace(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XCirculateEvent set( + int type, + long serial, + boolean send_event, + long display, + long event, + long window, + int place + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + event(event); + window(window); + place(place); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XCirculateEvent set(XCirculateEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XCirculateEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XCirculateEvent malloc() { + return wrap(XCirculateEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XCirculateEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XCirculateEvent calloc() { + return wrap(XCirculateEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XCirculateEvent} instance allocated with {@link BufferUtils}. */ + public static XCirculateEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XCirculateEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XCirculateEvent} instance for the specified memory address. */ + public static XCirculateEvent create(long address) { + return wrap(XCirculateEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XCirculateEvent createSafe(long address) { + return address == NULL ? null : wrap(XCirculateEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XCirculateEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XCirculateEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XCirculateEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XCirculateEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XCirculateEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XCirculateEvent mallocStack(MemoryStack stack) { + return wrap(XCirculateEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XCirculateEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XCirculateEvent callocStack(MemoryStack stack) { + return wrap(XCirculateEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XCirculateEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XCirculateEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XCirculateEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XCirculateEvent.DISPLAY); } + /** Unsafe version of {@link #event}. */ + public static long nevent(long struct) { return memGetCLong(struct + XCirculateEvent.EVENT); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XCirculateEvent.WINDOW); } + /** Unsafe version of {@link #place}. */ + public static int nplace(long struct) { return UNSAFE.getInt(null, struct + XCirculateEvent.PLACE); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XCirculateEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XCirculateEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XCirculateEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XCirculateEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #event(long) event}. */ + public static void nevent(long struct, long value) { memPutCLong(struct + XCirculateEvent.EVENT, value); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XCirculateEvent.WINDOW, value); } + /** Unsafe version of {@link #place(int) place}. */ + public static void nplace(long struct, int value) { UNSAFE.putInt(null, struct + XCirculateEvent.PLACE, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XCirculateEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XCirculateEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XCirculateEvent ELEMENT_FACTORY = XCirculateEvent.create(-1L); + + /** + * Creates a new {@code XCirculateEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XCirculateEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XCirculateEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XCirculateEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XCirculateEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XCirculateEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XCirculateEvent.ndisplay(address()); } + /** Returns the value of the {@code event} field. */ + @NativeType("Window") + public long event() { return XCirculateEvent.nevent(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XCirculateEvent.nwindow(address()); } + /** Returns the value of the {@code place} field. */ + public int place() { return XCirculateEvent.nplace(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XCirculateEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XCirculateEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XCirculateEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XCirculateEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code event} field. */ + public Buffer event(@NativeType("Window") long value) { XCirculateEvent.nevent(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XCirculateEvent.nwindow(address(), value); return this; } + /** Sets the specified value to the {@code place} field. */ + public Buffer place(int value) { XCirculateEvent.nplace(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XCirculateRequestEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XCirculateRequestEvent.java new file mode 100644 index 00000000..37e7bf33 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XCirculateRequestEvent.java @@ -0,0 +1,433 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code place} – one of:
    {@link X11#PlaceOnTop}{@link X11#PlaceOnBottom}
  • + *
+ * + *

Layout

+ * + *

+ * struct XCirculateRequestEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window parent;
+ *     Window window;
+ *     int place;
+ * }
+ */ +public class XCirculateRequestEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + PARENT, + WINDOW, + PLACE; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + PARENT = layout.offsetof(4); + WINDOW = layout.offsetof(5); + PLACE = layout.offsetof(6); + } + + /** + * Creates a {@code XCirculateRequestEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XCirculateRequestEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code parent} field. */ + @NativeType("Window") + public long parent() { return nparent(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code place} field. */ + public int place() { return nplace(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XCirculateRequestEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XCirculateRequestEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XCirculateRequestEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XCirculateRequestEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code parent} field. */ + public XCirculateRequestEvent parent(@NativeType("Window") long value) { nparent(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XCirculateRequestEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Sets the specified value to the {@code place} field. */ + public XCirculateRequestEvent place(int value) { nplace(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XCirculateRequestEvent set( + int type, + long serial, + boolean send_event, + long display, + long parent, + long window, + int place + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + parent(parent); + window(window); + place(place); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XCirculateRequestEvent set(XCirculateRequestEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XCirculateRequestEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XCirculateRequestEvent malloc() { + return wrap(XCirculateRequestEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XCirculateRequestEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XCirculateRequestEvent calloc() { + return wrap(XCirculateRequestEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XCirculateRequestEvent} instance allocated with {@link BufferUtils}. */ + public static XCirculateRequestEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XCirculateRequestEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XCirculateRequestEvent} instance for the specified memory address. */ + public static XCirculateRequestEvent create(long address) { + return wrap(XCirculateRequestEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XCirculateRequestEvent createSafe(long address) { + return address == NULL ? null : wrap(XCirculateRequestEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XCirculateRequestEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XCirculateRequestEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XCirculateRequestEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XCirculateRequestEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XCirculateRequestEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XCirculateRequestEvent mallocStack(MemoryStack stack) { + return wrap(XCirculateRequestEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XCirculateRequestEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XCirculateRequestEvent callocStack(MemoryStack stack) { + return wrap(XCirculateRequestEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XCirculateRequestEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XCirculateRequestEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XCirculateRequestEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XCirculateRequestEvent.DISPLAY); } + /** Unsafe version of {@link #parent}. */ + public static long nparent(long struct) { return memGetCLong(struct + XCirculateRequestEvent.PARENT); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XCirculateRequestEvent.WINDOW); } + /** Unsafe version of {@link #place}. */ + public static int nplace(long struct) { return UNSAFE.getInt(null, struct + XCirculateRequestEvent.PLACE); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XCirculateRequestEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XCirculateRequestEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XCirculateRequestEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XCirculateRequestEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #parent(long) parent}. */ + public static void nparent(long struct, long value) { memPutCLong(struct + XCirculateRequestEvent.PARENT, value); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XCirculateRequestEvent.WINDOW, value); } + /** Unsafe version of {@link #place(int) place}. */ + public static void nplace(long struct, int value) { UNSAFE.putInt(null, struct + XCirculateRequestEvent.PLACE, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XCirculateRequestEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XCirculateRequestEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XCirculateRequestEvent ELEMENT_FACTORY = XCirculateRequestEvent.create(-1L); + + /** + * Creates a new {@code XCirculateRequestEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XCirculateRequestEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XCirculateRequestEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XCirculateRequestEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XCirculateRequestEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XCirculateRequestEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XCirculateRequestEvent.ndisplay(address()); } + /** Returns the value of the {@code parent} field. */ + @NativeType("Window") + public long parent() { return XCirculateRequestEvent.nparent(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XCirculateRequestEvent.nwindow(address()); } + /** Returns the value of the {@code place} field. */ + public int place() { return XCirculateRequestEvent.nplace(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XCirculateRequestEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XCirculateRequestEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XCirculateRequestEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XCirculateRequestEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code parent} field. */ + public Buffer parent(@NativeType("Window") long value) { XCirculateRequestEvent.nparent(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XCirculateRequestEvent.nwindow(address(), value); return this; } + /** Sets the specified value to the {@code place} field. */ + public Buffer place(int value) { XCirculateRequestEvent.nplace(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XClientMessageEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XClientMessageEvent.java new file mode 100644 index 00000000..1e196a6f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XClientMessageEvent.java @@ -0,0 +1,566 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Client message event. + * + *

The {@code message_type} member is set to an atom that indicates how the data should be interpreted by the receiving client. The {@code format} + * member is set to 8, 16, or 32 and specifies whether the data should be viewed as a list of bytes, shorts, or longs. The {@code data} member is a + * union that contains the members {@code b}, {@code s}, and {@code l}. The {@code b}, {@code s}, and {@code l} members represent data of twenty 8-bit + * values, ten 16-bit values, and five 32-bit values. Particular message types might not make use of all these values. The X server places no + * interpretation on the values in the {@code window}, {@code message_type}, or {@code data} members.

+ * + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code window} – window it reported relative to
  • + *
+ * + *

Layout

+ * + *

+ * struct XClientMessageEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window window;
+ *     Atom message_type;
+ *     int format;
+ *     struct {
+ *         char b[20];
+ *         short s[10];
+ *         long l[5];
+ *     } data;
+ * }
+ */ +public class XClientMessageEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + WINDOW, + MESSAGE_TYPE, + FORMAT, + DATA, + DATA_B, + DATA_S, + DATA_L; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(4), + __struct( + __array(1, 20), + __array(2, 10), + __array(CLONG_SIZE, 5) + ) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + WINDOW = layout.offsetof(4); + MESSAGE_TYPE = layout.offsetof(5); + FORMAT = layout.offsetof(6); + DATA = layout.offsetof(7); + DATA_B = layout.offsetof(8); + DATA_S = layout.offsetof(9); + DATA_L = layout.offsetof(10); + } + + /** + * Creates a {@code XClientMessageEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XClientMessageEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code message_type} field. */ + @NativeType("Atom") + public long message_type() { return nmessage_type(address()); } + /** Returns the value of the {@code format} field. */ + public int format() { return nformat(address()); } + /** Returns a {@link ByteBuffer} view of the {@code data.b} field. */ + @NativeType("char[20]") + public ByteBuffer data_b() { return ndata_b(address()); } + /** Returns the value at the specified index of the {@code data.b} field. */ + @NativeType("char") + public byte data_b(int index) { return ndata_b(address(), index); } + /** Returns a {@link ShortBuffer} view of the {@code data.s} field. */ + @NativeType("short[10]") + public ShortBuffer data_s() { return ndata_s(address()); } + /** Returns the value at the specified index of the {@code data.s} field. */ + public short data_s(int index) { return ndata_s(address(), index); } + /** Returns a {@link CLongBuffer} view of the {@code data.l} field. */ + @NativeType("long[5]") + public CLongBuffer data_l() { return ndata_l(address()); } + /** Returns the value at the specified index of the {@code data.l} field. */ + public long data_l(int index) { return ndata_l(address(), index); } + + /** Sets the specified value to the {@code type} field. */ + public XClientMessageEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XClientMessageEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XClientMessageEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XClientMessageEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XClientMessageEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Sets the specified value to the {@code message_type} field. */ + public XClientMessageEvent message_type(@NativeType("Atom") long value) { nmessage_type(address(), value); return this; } + /** Sets the specified value to the {@code format} field. */ + public XClientMessageEvent format(int value) { nformat(address(), value); return this; } + /** Copies the specified {@link ByteBuffer} to the {@code data.b} field. */ + public XClientMessageEvent data_b(@NativeType("char[20]") ByteBuffer value) { ndata_b(address(), value); return this; } + /** Sets the specified value at the specified index of the {@code data.b} field. */ + public XClientMessageEvent data_b(int index, @NativeType("char") byte value) { ndata_b(address(), index, value); return this; } + /** Copies the specified {@link ShortBuffer} to the {@code data.s} field. */ + public XClientMessageEvent data_s(@NativeType("short[10]") ShortBuffer value) { ndata_s(address(), value); return this; } + /** Sets the specified value at the specified index of the {@code data.s} field. */ + public XClientMessageEvent data_s(int index, short value) { ndata_s(address(), index, value); return this; } + /** Copies the specified {@link CLongBuffer} to the {@code data.l} field. */ + public XClientMessageEvent data_l(@NativeType("long[5]") CLongBuffer value) { ndata_l(address(), value); return this; } + /** Sets the specified value at the specified index of the {@code data.l} field. */ + public XClientMessageEvent data_l(int index, long value) { ndata_l(address(), index, value); return this; } + + /** Initializes this struct with the specified values. */ + public XClientMessageEvent set( + int type, + long serial, + boolean send_event, + long display, + long window, + long message_type, + int format, + ByteBuffer data_b, + ShortBuffer data_s, + CLongBuffer data_l + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + window(window); + message_type(message_type); + format(format); + data_b(data_b); + data_s(data_s); + data_l(data_l); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XClientMessageEvent set(XClientMessageEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XClientMessageEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XClientMessageEvent malloc() { + return wrap(XClientMessageEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XClientMessageEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XClientMessageEvent calloc() { + return wrap(XClientMessageEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XClientMessageEvent} instance allocated with {@link BufferUtils}. */ + public static XClientMessageEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XClientMessageEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XClientMessageEvent} instance for the specified memory address. */ + public static XClientMessageEvent create(long address) { + return wrap(XClientMessageEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XClientMessageEvent createSafe(long address) { + return address == NULL ? null : wrap(XClientMessageEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XClientMessageEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XClientMessageEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XClientMessageEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XClientMessageEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XClientMessageEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XClientMessageEvent mallocStack(MemoryStack stack) { + return wrap(XClientMessageEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XClientMessageEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XClientMessageEvent callocStack(MemoryStack stack) { + return wrap(XClientMessageEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XClientMessageEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XClientMessageEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XClientMessageEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XClientMessageEvent.DISPLAY); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XClientMessageEvent.WINDOW); } + /** Unsafe version of {@link #message_type}. */ + public static long nmessage_type(long struct) { return memGetCLong(struct + XClientMessageEvent.MESSAGE_TYPE); } + /** Unsafe version of {@link #format}. */ + public static int nformat(long struct) { return UNSAFE.getInt(null, struct + XClientMessageEvent.FORMAT); } + /** Unsafe version of {@link #data_b}. */ + public static ByteBuffer ndata_b(long struct) { return memByteBuffer(struct + XClientMessageEvent.DATA_B, 20); } + /** Unsafe version of {@link #data_b(int) data_b}. */ + public static byte ndata_b(long struct, int index) { + return UNSAFE.getByte(null, struct + XClientMessageEvent.DATA_B + check(index, 20) * 1); + } + /** Unsafe version of {@link #data_s}. */ + public static ShortBuffer ndata_s(long struct) { return memShortBuffer(struct + XClientMessageEvent.DATA_S, 10); } + /** Unsafe version of {@link #data_s(int) data_s}. */ + public static short ndata_s(long struct, int index) { + return UNSAFE.getShort(null, struct + XClientMessageEvent.DATA_S + check(index, 10) * 2); + } + /** Unsafe version of {@link #data_l}. */ + public static CLongBuffer ndata_l(long struct) { return memCLongBuffer(struct + XClientMessageEvent.DATA_L, 5); } + /** Unsafe version of {@link #data_l(int) data_l}. */ + public static long ndata_l(long struct, int index) { + return memGetCLong(struct + XClientMessageEvent.DATA_L + check(index, 5) * CLONG_SIZE); + } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XClientMessageEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XClientMessageEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XClientMessageEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XClientMessageEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XClientMessageEvent.WINDOW, value); } + /** Unsafe version of {@link #message_type(long) message_type}. */ + public static void nmessage_type(long struct, long value) { memPutCLong(struct + XClientMessageEvent.MESSAGE_TYPE, value); } + /** Unsafe version of {@link #format(int) format}. */ + public static void nformat(long struct, int value) { UNSAFE.putInt(null, struct + XClientMessageEvent.FORMAT, value); } + /** Unsafe version of {@link #data_b(ByteBuffer) data_b}. */ + public static void ndata_b(long struct, ByteBuffer value) { + if (CHECKS) { checkGT(value, 20); } + memCopy(memAddress(value), struct + XClientMessageEvent.DATA_B, value.remaining() * 1); + } + /** Unsafe version of {@link #data_b(int, byte) data_b}. */ + public static void ndata_b(long struct, int index, byte value) { + UNSAFE.putByte(null, struct + XClientMessageEvent.DATA_B + check(index, 20) * 1, value); + } + /** Unsafe version of {@link #data_s(ShortBuffer) data_s}. */ + public static void ndata_s(long struct, ShortBuffer value) { + if (CHECKS) { checkGT(value, 10); } + memCopy(memAddress(value), struct + XClientMessageEvent.DATA_S, value.remaining() * 2); + } + /** Unsafe version of {@link #data_s(int, short) data_s}. */ + public static void ndata_s(long struct, int index, short value) { + UNSAFE.putShort(null, struct + XClientMessageEvent.DATA_S + check(index, 10) * 2, value); + } + /** Unsafe version of {@link #data_l(CLongBuffer) data_l}. */ + public static void ndata_l(long struct, CLongBuffer value) { + if (CHECKS) { checkGT(value, 5); } + memCopy(memAddress(value), struct + XClientMessageEvent.DATA_L, value.remaining() * CLONG_SIZE); + } + /** Unsafe version of {@link #data_l(int, long) data_l}. */ + public static void ndata_l(long struct, int index, long value) { + memPutCLong(struct + XClientMessageEvent.DATA_L + check(index, 5) * CLONG_SIZE, value); + } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XClientMessageEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XClientMessageEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XClientMessageEvent ELEMENT_FACTORY = XClientMessageEvent.create(-1L); + + /** + * Creates a new {@code XClientMessageEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XClientMessageEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XClientMessageEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XClientMessageEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XClientMessageEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XClientMessageEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XClientMessageEvent.ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XClientMessageEvent.nwindow(address()); } + /** Returns the value of the {@code message_type} field. */ + @NativeType("Atom") + public long message_type() { return XClientMessageEvent.nmessage_type(address()); } + /** Returns the value of the {@code format} field. */ + public int format() { return XClientMessageEvent.nformat(address()); } + /** Returns a {@link ByteBuffer} view of the {@code data.b} field. */ + @NativeType("char[20]") + public ByteBuffer data_b() { return XClientMessageEvent.ndata_b(address()); } + /** Returns the value at the specified index of the {@code data.b} field. */ + @NativeType("char") + public byte data_b(int index) { return XClientMessageEvent.ndata_b(address(), index); } + /** Returns a {@link ShortBuffer} view of the {@code data.s} field. */ + @NativeType("short[10]") + public ShortBuffer data_s() { return XClientMessageEvent.ndata_s(address()); } + /** Returns the value at the specified index of the {@code data.s} field. */ + public short data_s(int index) { return XClientMessageEvent.ndata_s(address(), index); } + /** Returns a {@link CLongBuffer} view of the {@code data.l} field. */ + @NativeType("long[5]") + public CLongBuffer data_l() { return XClientMessageEvent.ndata_l(address()); } + /** Returns the value at the specified index of the {@code data.l} field. */ + public long data_l(int index) { return XClientMessageEvent.ndata_l(address(), index); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XClientMessageEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XClientMessageEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XClientMessageEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XClientMessageEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XClientMessageEvent.nwindow(address(), value); return this; } + /** Sets the specified value to the {@code message_type} field. */ + public Buffer message_type(@NativeType("Atom") long value) { XClientMessageEvent.nmessage_type(address(), value); return this; } + /** Sets the specified value to the {@code format} field. */ + public Buffer format(int value) { XClientMessageEvent.nformat(address(), value); return this; } + /** Copies the specified {@link ByteBuffer} to the {@code data.b} field. */ + public Buffer data_b(@NativeType("char[20]") ByteBuffer value) { XClientMessageEvent.ndata_b(address(), value); return this; } + /** Sets the specified value at the specified index of the {@code data.b} field. */ + public Buffer data_b(int index, @NativeType("char") byte value) { XClientMessageEvent.ndata_b(address(), index, value); return this; } + /** Copies the specified {@link ShortBuffer} to the {@code data.s} field. */ + public Buffer data_s(@NativeType("short[10]") ShortBuffer value) { XClientMessageEvent.ndata_s(address(), value); return this; } + /** Sets the specified value at the specified index of the {@code data.s} field. */ + public Buffer data_s(int index, short value) { XClientMessageEvent.ndata_s(address(), index, value); return this; } + /** Copies the specified {@link CLongBuffer} to the {@code data.l} field. */ + public Buffer data_l(@NativeType("long[5]") CLongBuffer value) { XClientMessageEvent.ndata_l(address(), value); return this; } + /** Sets the specified value at the specified index of the {@code data.l} field. */ + public Buffer data_l(int index, long value) { XClientMessageEvent.ndata_l(address(), index, value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XColormapEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XColormapEvent.java new file mode 100644 index 00000000..90304779 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XColormapEvent.java @@ -0,0 +1,453 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code window} – window it reported relative to
  • + *
  • {@code colormap} – colormap or {@link X11#None}
  • + *
  • {@code state} – one of:
    {@link X11#ColormapInstalled}{@link X11#ColormapUninstalled}
  • + *
+ * + *

Layout

+ * + *

+ * struct XColormapEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window window;
+ *     Colormap colormap;
+ *     int new;
+ *     int state;
+ * }
+ */ +public class XColormapEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + WINDOW, + COLORMAP, + NEW, + STATE; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + WINDOW = layout.offsetof(4); + COLORMAP = layout.offsetof(5); + NEW = layout.offsetof(6); + STATE = layout.offsetof(7); + } + + /** + * Creates a {@code XColormapEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XColormapEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code colormap} field. */ + @NativeType("Colormap") + public long colormap() { return ncolormap(address()); } + /** Returns the value of the {@code new} field. */ + public int new$() { return nnew$(address()); } + /** Returns the value of the {@code state} field. */ + public int state() { return nstate(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XColormapEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XColormapEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XColormapEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XColormapEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XColormapEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Sets the specified value to the {@code colormap} field. */ + public XColormapEvent colormap(@NativeType("Colormap") long value) { ncolormap(address(), value); return this; } + /** Sets the specified value to the {@code new} field. */ + public XColormapEvent new$(int value) { nnew$(address(), value); return this; } + /** Sets the specified value to the {@code state} field. */ + public XColormapEvent state(int value) { nstate(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XColormapEvent set( + int type, + long serial, + boolean send_event, + long display, + long window, + long colormap, + int new$, + int state + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + window(window); + colormap(colormap); + new$(new$); + state(state); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XColormapEvent set(XColormapEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XColormapEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XColormapEvent malloc() { + return wrap(XColormapEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XColormapEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XColormapEvent calloc() { + return wrap(XColormapEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XColormapEvent} instance allocated with {@link BufferUtils}. */ + public static XColormapEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XColormapEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XColormapEvent} instance for the specified memory address. */ + public static XColormapEvent create(long address) { + return wrap(XColormapEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XColormapEvent createSafe(long address) { + return address == NULL ? null : wrap(XColormapEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XColormapEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XColormapEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XColormapEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XColormapEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XColormapEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XColormapEvent mallocStack(MemoryStack stack) { + return wrap(XColormapEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XColormapEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XColormapEvent callocStack(MemoryStack stack) { + return wrap(XColormapEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XColormapEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XColormapEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XColormapEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XColormapEvent.DISPLAY); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XColormapEvent.WINDOW); } + /** Unsafe version of {@link #colormap}. */ + public static long ncolormap(long struct) { return memGetCLong(struct + XColormapEvent.COLORMAP); } + /** Unsafe version of {@link #new$}. */ + public static int nnew$(long struct) { return UNSAFE.getInt(null, struct + XColormapEvent.NEW); } + /** Unsafe version of {@link #state}. */ + public static int nstate(long struct) { return UNSAFE.getInt(null, struct + XColormapEvent.STATE); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XColormapEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XColormapEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XColormapEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XColormapEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XColormapEvent.WINDOW, value); } + /** Unsafe version of {@link #colormap(long) colormap}. */ + public static void ncolormap(long struct, long value) { memPutCLong(struct + XColormapEvent.COLORMAP, value); } + /** Unsafe version of {@link #new$(int) new$}. */ + public static void nnew$(long struct, int value) { UNSAFE.putInt(null, struct + XColormapEvent.NEW, value); } + /** Unsafe version of {@link #state(int) state}. */ + public static void nstate(long struct, int value) { UNSAFE.putInt(null, struct + XColormapEvent.STATE, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XColormapEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XColormapEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XColormapEvent ELEMENT_FACTORY = XColormapEvent.create(-1L); + + /** + * Creates a new {@code XColormapEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XColormapEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XColormapEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XColormapEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XColormapEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XColormapEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XColormapEvent.ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XColormapEvent.nwindow(address()); } + /** Returns the value of the {@code colormap} field. */ + @NativeType("Colormap") + public long colormap() { return XColormapEvent.ncolormap(address()); } + /** Returns the value of the {@code new} field. */ + public int new$() { return XColormapEvent.nnew$(address()); } + /** Returns the value of the {@code state} field. */ + public int state() { return XColormapEvent.nstate(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XColormapEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XColormapEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XColormapEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XColormapEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XColormapEvent.nwindow(address(), value); return this; } + /** Sets the specified value to the {@code colormap} field. */ + public Buffer colormap(@NativeType("Colormap") long value) { XColormapEvent.ncolormap(address(), value); return this; } + /** Sets the specified value to the {@code new} field. */ + public Buffer new$(int value) { XColormapEvent.nnew$(address(), value); return this; } + /** Sets the specified value to the {@code state} field. */ + public Buffer state(int value) { XColormapEvent.nstate(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XConfigureEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XConfigureEvent.java new file mode 100644 index 00000000..6da2cff7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XConfigureEvent.java @@ -0,0 +1,527 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Motion event. + * + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code window} – window it reported relative to
  • + *
+ * + *

Layout

+ * + *

+ * struct XConfigureEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window window;
+ *     int x;
+ *     int y;
+ *     int width;
+ *     int height;
+ *     int border_width;
+ *     Window above;
+ *     Bool override_redirect;
+ * }
+ */ +public class XConfigureEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + WINDOW, + X, + Y, + WIDTH, + HEIGHT, + BORDER_WIDTH, + ABOVE, + OVERRIDE_REDIRECT; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(CLONG_SIZE), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + WINDOW = layout.offsetof(4); + X = layout.offsetof(5); + Y = layout.offsetof(6); + WIDTH = layout.offsetof(7); + HEIGHT = layout.offsetof(8); + BORDER_WIDTH = layout.offsetof(9); + ABOVE = layout.offsetof(10); + OVERRIDE_REDIRECT = layout.offsetof(11); + } + + /** + * Creates a {@code XConfigureEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XConfigureEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code x} field. */ + public int x() { return nx(address()); } + /** Returns the value of the {@code y} field. */ + public int y() { return ny(address()); } + /** Returns the value of the {@code width} field. */ + public int width() { return nwidth(address()); } + /** Returns the value of the {@code height} field. */ + public int height() { return nheight(address()); } + /** Returns the value of the {@code border_width} field. */ + public int border_width() { return nborder_width(address()); } + /** Returns the value of the {@code above} field. */ + @NativeType("Window") + public long above() { return nabove(address()); } + /** Returns the value of the {@code override_redirect} field. */ + @NativeType("Bool") + public boolean override_redirect() { return noverride_redirect(address()) != 0; } + + /** Sets the specified value to the {@code type} field. */ + public XConfigureEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XConfigureEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XConfigureEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XConfigureEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XConfigureEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public XConfigureEvent x(int value) { nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public XConfigureEvent y(int value) { ny(address(), value); return this; } + /** Sets the specified value to the {@code width} field. */ + public XConfigureEvent width(int value) { nwidth(address(), value); return this; } + /** Sets the specified value to the {@code height} field. */ + public XConfigureEvent height(int value) { nheight(address(), value); return this; } + /** Sets the specified value to the {@code border_width} field. */ + public XConfigureEvent border_width(int value) { nborder_width(address(), value); return this; } + /** Sets the specified value to the {@code above} field. */ + public XConfigureEvent above(@NativeType("Window") long value) { nabove(address(), value); return this; } + /** Sets the specified value to the {@code override_redirect} field. */ + public XConfigureEvent override_redirect(@NativeType("Bool") boolean value) { noverride_redirect(address(), value ? 1 : 0); return this; } + + /** Initializes this struct with the specified values. */ + public XConfigureEvent set( + int type, + long serial, + boolean send_event, + long display, + long window, + int x, + int y, + int width, + int height, + int border_width, + long above, + boolean override_redirect + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + window(window); + x(x); + y(y); + width(width); + height(height); + border_width(border_width); + above(above); + override_redirect(override_redirect); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XConfigureEvent set(XConfigureEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XConfigureEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XConfigureEvent malloc() { + return wrap(XConfigureEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XConfigureEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XConfigureEvent calloc() { + return wrap(XConfigureEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XConfigureEvent} instance allocated with {@link BufferUtils}. */ + public static XConfigureEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XConfigureEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XConfigureEvent} instance for the specified memory address. */ + public static XConfigureEvent create(long address) { + return wrap(XConfigureEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XConfigureEvent createSafe(long address) { + return address == NULL ? null : wrap(XConfigureEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XConfigureEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XConfigureEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XConfigureEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XConfigureEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XConfigureEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XConfigureEvent mallocStack(MemoryStack stack) { + return wrap(XConfigureEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XConfigureEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XConfigureEvent callocStack(MemoryStack stack) { + return wrap(XConfigureEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XConfigureEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XConfigureEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XConfigureEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XConfigureEvent.DISPLAY); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XConfigureEvent.WINDOW); } + /** Unsafe version of {@link #x}. */ + public static int nx(long struct) { return UNSAFE.getInt(null, struct + XConfigureEvent.X); } + /** Unsafe version of {@link #y}. */ + public static int ny(long struct) { return UNSAFE.getInt(null, struct + XConfigureEvent.Y); } + /** Unsafe version of {@link #width}. */ + public static int nwidth(long struct) { return UNSAFE.getInt(null, struct + XConfigureEvent.WIDTH); } + /** Unsafe version of {@link #height}. */ + public static int nheight(long struct) { return UNSAFE.getInt(null, struct + XConfigureEvent.HEIGHT); } + /** Unsafe version of {@link #border_width}. */ + public static int nborder_width(long struct) { return UNSAFE.getInt(null, struct + XConfigureEvent.BORDER_WIDTH); } + /** Unsafe version of {@link #above}. */ + public static long nabove(long struct) { return memGetCLong(struct + XConfigureEvent.ABOVE); } + /** Unsafe version of {@link #override_redirect}. */ + public static int noverride_redirect(long struct) { return UNSAFE.getInt(null, struct + XConfigureEvent.OVERRIDE_REDIRECT); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XConfigureEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XConfigureEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XConfigureEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XConfigureEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XConfigureEvent.WINDOW, value); } + /** Unsafe version of {@link #x(int) x}. */ + public static void nx(long struct, int value) { UNSAFE.putInt(null, struct + XConfigureEvent.X, value); } + /** Unsafe version of {@link #y(int) y}. */ + public static void ny(long struct, int value) { UNSAFE.putInt(null, struct + XConfigureEvent.Y, value); } + /** Unsafe version of {@link #width(int) width}. */ + public static void nwidth(long struct, int value) { UNSAFE.putInt(null, struct + XConfigureEvent.WIDTH, value); } + /** Unsafe version of {@link #height(int) height}. */ + public static void nheight(long struct, int value) { UNSAFE.putInt(null, struct + XConfigureEvent.HEIGHT, value); } + /** Unsafe version of {@link #border_width(int) border_width}. */ + public static void nborder_width(long struct, int value) { UNSAFE.putInt(null, struct + XConfigureEvent.BORDER_WIDTH, value); } + /** Unsafe version of {@link #above(long) above}. */ + public static void nabove(long struct, long value) { memPutCLong(struct + XConfigureEvent.ABOVE, value); } + /** Unsafe version of {@link #override_redirect(boolean) override_redirect}. */ + public static void noverride_redirect(long struct, int value) { UNSAFE.putInt(null, struct + XConfigureEvent.OVERRIDE_REDIRECT, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XConfigureEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XConfigureEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XConfigureEvent ELEMENT_FACTORY = XConfigureEvent.create(-1L); + + /** + * Creates a new {@code XConfigureEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XConfigureEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XConfigureEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XConfigureEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XConfigureEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XConfigureEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XConfigureEvent.ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XConfigureEvent.nwindow(address()); } + /** Returns the value of the {@code x} field. */ + public int x() { return XConfigureEvent.nx(address()); } + /** Returns the value of the {@code y} field. */ + public int y() { return XConfigureEvent.ny(address()); } + /** Returns the value of the {@code width} field. */ + public int width() { return XConfigureEvent.nwidth(address()); } + /** Returns the value of the {@code height} field. */ + public int height() { return XConfigureEvent.nheight(address()); } + /** Returns the value of the {@code border_width} field. */ + public int border_width() { return XConfigureEvent.nborder_width(address()); } + /** Returns the value of the {@code above} field. */ + @NativeType("Window") + public long above() { return XConfigureEvent.nabove(address()); } + /** Returns the value of the {@code override_redirect} field. */ + @NativeType("Bool") + public boolean override_redirect() { return XConfigureEvent.noverride_redirect(address()) != 0; } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XConfigureEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XConfigureEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XConfigureEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XConfigureEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XConfigureEvent.nwindow(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public Buffer x(int value) { XConfigureEvent.nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public Buffer y(int value) { XConfigureEvent.ny(address(), value); return this; } + /** Sets the specified value to the {@code width} field. */ + public Buffer width(int value) { XConfigureEvent.nwidth(address(), value); return this; } + /** Sets the specified value to the {@code height} field. */ + public Buffer height(int value) { XConfigureEvent.nheight(address(), value); return this; } + /** Sets the specified value to the {@code border_width} field. */ + public Buffer border_width(int value) { XConfigureEvent.nborder_width(address(), value); return this; } + /** Sets the specified value to the {@code above} field. */ + public Buffer above(@NativeType("Window") long value) { XConfigureEvent.nabove(address(), value); return this; } + /** Sets the specified value to the {@code override_redirect} field. */ + public Buffer override_redirect(@NativeType("Bool") boolean value) { XConfigureEvent.noverride_redirect(address(), value ? 1 : 0); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XConfigureRequestEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XConfigureRequestEvent.java new file mode 100644 index 00000000..d968f64f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XConfigureRequestEvent.java @@ -0,0 +1,563 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code detail} – one of:
    {@link X11#Above}{@link X11#Below}{@link X11#TopIf}{@link X11#BottomIf}{@link X11#Opposite}
  • + *
+ * + *

Layout

+ * + *

+ * struct XConfigureRequestEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window parent;
+ *     Window window;
+ *     int x;
+ *     int y;
+ *     int width;
+ *     int height;
+ *     int border_width;
+ *     Window above;
+ *     int detail;
+ *     unsigned long value_mask;
+ * }
+ */ +public class XConfigureRequestEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + PARENT, + WINDOW, + X, + Y, + WIDTH, + HEIGHT, + BORDER_WIDTH, + ABOVE, + DETAIL, + VALUE_MASK; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + PARENT = layout.offsetof(4); + WINDOW = layout.offsetof(5); + X = layout.offsetof(6); + Y = layout.offsetof(7); + WIDTH = layout.offsetof(8); + HEIGHT = layout.offsetof(9); + BORDER_WIDTH = layout.offsetof(10); + ABOVE = layout.offsetof(11); + DETAIL = layout.offsetof(12); + VALUE_MASK = layout.offsetof(13); + } + + /** + * Creates a {@code XConfigureRequestEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XConfigureRequestEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code parent} field. */ + @NativeType("Window") + public long parent() { return nparent(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code x} field. */ + public int x() { return nx(address()); } + /** Returns the value of the {@code y} field. */ + public int y() { return ny(address()); } + /** Returns the value of the {@code width} field. */ + public int width() { return nwidth(address()); } + /** Returns the value of the {@code height} field. */ + public int height() { return nheight(address()); } + /** Returns the value of the {@code border_width} field. */ + public int border_width() { return nborder_width(address()); } + /** Returns the value of the {@code above} field. */ + @NativeType("Window") + public long above() { return nabove(address()); } + /** Returns the value of the {@code detail} field. */ + public int detail() { return ndetail(address()); } + /** Returns the value of the {@code value_mask} field. */ + @NativeType("unsigned long") + public long value_mask() { return nvalue_mask(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XConfigureRequestEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XConfigureRequestEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XConfigureRequestEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XConfigureRequestEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code parent} field. */ + public XConfigureRequestEvent parent(@NativeType("Window") long value) { nparent(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XConfigureRequestEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public XConfigureRequestEvent x(int value) { nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public XConfigureRequestEvent y(int value) { ny(address(), value); return this; } + /** Sets the specified value to the {@code width} field. */ + public XConfigureRequestEvent width(int value) { nwidth(address(), value); return this; } + /** Sets the specified value to the {@code height} field. */ + public XConfigureRequestEvent height(int value) { nheight(address(), value); return this; } + /** Sets the specified value to the {@code border_width} field. */ + public XConfigureRequestEvent border_width(int value) { nborder_width(address(), value); return this; } + /** Sets the specified value to the {@code above} field. */ + public XConfigureRequestEvent above(@NativeType("Window") long value) { nabove(address(), value); return this; } + /** Sets the specified value to the {@code detail} field. */ + public XConfigureRequestEvent detail(int value) { ndetail(address(), value); return this; } + /** Sets the specified value to the {@code value_mask} field. */ + public XConfigureRequestEvent value_mask(@NativeType("unsigned long") long value) { nvalue_mask(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XConfigureRequestEvent set( + int type, + long serial, + boolean send_event, + long display, + long parent, + long window, + int x, + int y, + int width, + int height, + int border_width, + long above, + int detail, + long value_mask + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + parent(parent); + window(window); + x(x); + y(y); + width(width); + height(height); + border_width(border_width); + above(above); + detail(detail); + value_mask(value_mask); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XConfigureRequestEvent set(XConfigureRequestEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XConfigureRequestEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XConfigureRequestEvent malloc() { + return wrap(XConfigureRequestEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XConfigureRequestEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XConfigureRequestEvent calloc() { + return wrap(XConfigureRequestEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XConfigureRequestEvent} instance allocated with {@link BufferUtils}. */ + public static XConfigureRequestEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XConfigureRequestEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XConfigureRequestEvent} instance for the specified memory address. */ + public static XConfigureRequestEvent create(long address) { + return wrap(XConfigureRequestEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XConfigureRequestEvent createSafe(long address) { + return address == NULL ? null : wrap(XConfigureRequestEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XConfigureRequestEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XConfigureRequestEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XConfigureRequestEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XConfigureRequestEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XConfigureRequestEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XConfigureRequestEvent mallocStack(MemoryStack stack) { + return wrap(XConfigureRequestEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XConfigureRequestEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XConfigureRequestEvent callocStack(MemoryStack stack) { + return wrap(XConfigureRequestEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XConfigureRequestEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XConfigureRequestEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XConfigureRequestEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XConfigureRequestEvent.DISPLAY); } + /** Unsafe version of {@link #parent}. */ + public static long nparent(long struct) { return memGetCLong(struct + XConfigureRequestEvent.PARENT); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XConfigureRequestEvent.WINDOW); } + /** Unsafe version of {@link #x}. */ + public static int nx(long struct) { return UNSAFE.getInt(null, struct + XConfigureRequestEvent.X); } + /** Unsafe version of {@link #y}. */ + public static int ny(long struct) { return UNSAFE.getInt(null, struct + XConfigureRequestEvent.Y); } + /** Unsafe version of {@link #width}. */ + public static int nwidth(long struct) { return UNSAFE.getInt(null, struct + XConfigureRequestEvent.WIDTH); } + /** Unsafe version of {@link #height}. */ + public static int nheight(long struct) { return UNSAFE.getInt(null, struct + XConfigureRequestEvent.HEIGHT); } + /** Unsafe version of {@link #border_width}. */ + public static int nborder_width(long struct) { return UNSAFE.getInt(null, struct + XConfigureRequestEvent.BORDER_WIDTH); } + /** Unsafe version of {@link #above}. */ + public static long nabove(long struct) { return memGetCLong(struct + XConfigureRequestEvent.ABOVE); } + /** Unsafe version of {@link #detail}. */ + public static int ndetail(long struct) { return UNSAFE.getInt(null, struct + XConfigureRequestEvent.DETAIL); } + /** Unsafe version of {@link #value_mask}. */ + public static long nvalue_mask(long struct) { return memGetCLong(struct + XConfigureRequestEvent.VALUE_MASK); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XConfigureRequestEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XConfigureRequestEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XConfigureRequestEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XConfigureRequestEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #parent(long) parent}. */ + public static void nparent(long struct, long value) { memPutCLong(struct + XConfigureRequestEvent.PARENT, value); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XConfigureRequestEvent.WINDOW, value); } + /** Unsafe version of {@link #x(int) x}. */ + public static void nx(long struct, int value) { UNSAFE.putInt(null, struct + XConfigureRequestEvent.X, value); } + /** Unsafe version of {@link #y(int) y}. */ + public static void ny(long struct, int value) { UNSAFE.putInt(null, struct + XConfigureRequestEvent.Y, value); } + /** Unsafe version of {@link #width(int) width}. */ + public static void nwidth(long struct, int value) { UNSAFE.putInt(null, struct + XConfigureRequestEvent.WIDTH, value); } + /** Unsafe version of {@link #height(int) height}. */ + public static void nheight(long struct, int value) { UNSAFE.putInt(null, struct + XConfigureRequestEvent.HEIGHT, value); } + /** Unsafe version of {@link #border_width(int) border_width}. */ + public static void nborder_width(long struct, int value) { UNSAFE.putInt(null, struct + XConfigureRequestEvent.BORDER_WIDTH, value); } + /** Unsafe version of {@link #above(long) above}. */ + public static void nabove(long struct, long value) { memPutCLong(struct + XConfigureRequestEvent.ABOVE, value); } + /** Unsafe version of {@link #detail(int) detail}. */ + public static void ndetail(long struct, int value) { UNSAFE.putInt(null, struct + XConfigureRequestEvent.DETAIL, value); } + /** Unsafe version of {@link #value_mask(long) value_mask}. */ + public static void nvalue_mask(long struct, long value) { memPutCLong(struct + XConfigureRequestEvent.VALUE_MASK, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XConfigureRequestEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XConfigureRequestEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XConfigureRequestEvent ELEMENT_FACTORY = XConfigureRequestEvent.create(-1L); + + /** + * Creates a new {@code XConfigureRequestEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XConfigureRequestEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XConfigureRequestEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XConfigureRequestEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XConfigureRequestEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XConfigureRequestEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XConfigureRequestEvent.ndisplay(address()); } + /** Returns the value of the {@code parent} field. */ + @NativeType("Window") + public long parent() { return XConfigureRequestEvent.nparent(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XConfigureRequestEvent.nwindow(address()); } + /** Returns the value of the {@code x} field. */ + public int x() { return XConfigureRequestEvent.nx(address()); } + /** Returns the value of the {@code y} field. */ + public int y() { return XConfigureRequestEvent.ny(address()); } + /** Returns the value of the {@code width} field. */ + public int width() { return XConfigureRequestEvent.nwidth(address()); } + /** Returns the value of the {@code height} field. */ + public int height() { return XConfigureRequestEvent.nheight(address()); } + /** Returns the value of the {@code border_width} field. */ + public int border_width() { return XConfigureRequestEvent.nborder_width(address()); } + /** Returns the value of the {@code above} field. */ + @NativeType("Window") + public long above() { return XConfigureRequestEvent.nabove(address()); } + /** Returns the value of the {@code detail} field. */ + public int detail() { return XConfigureRequestEvent.ndetail(address()); } + /** Returns the value of the {@code value_mask} field. */ + @NativeType("unsigned long") + public long value_mask() { return XConfigureRequestEvent.nvalue_mask(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XConfigureRequestEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XConfigureRequestEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XConfigureRequestEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XConfigureRequestEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code parent} field. */ + public Buffer parent(@NativeType("Window") long value) { XConfigureRequestEvent.nparent(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XConfigureRequestEvent.nwindow(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public Buffer x(int value) { XConfigureRequestEvent.nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public Buffer y(int value) { XConfigureRequestEvent.ny(address(), value); return this; } + /** Sets the specified value to the {@code width} field. */ + public Buffer width(int value) { XConfigureRequestEvent.nwidth(address(), value); return this; } + /** Sets the specified value to the {@code height} field. */ + public Buffer height(int value) { XConfigureRequestEvent.nheight(address(), value); return this; } + /** Sets the specified value to the {@code border_width} field. */ + public Buffer border_width(int value) { XConfigureRequestEvent.nborder_width(address(), value); return this; } + /** Sets the specified value to the {@code above} field. */ + public Buffer above(@NativeType("Window") long value) { XConfigureRequestEvent.nabove(address(), value); return this; } + /** Sets the specified value to the {@code detail} field. */ + public Buffer detail(int value) { XConfigureRequestEvent.ndetail(address(), value); return this; } + /** Sets the specified value to the {@code value_mask} field. */ + public Buffer value_mask(@NativeType("unsigned long") long value) { XConfigureRequestEvent.nvalue_mask(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XCreateWindowEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XCreateWindowEvent.java new file mode 100644 index 00000000..56c9c095 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XCreateWindowEvent.java @@ -0,0 +1,530 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code parent} – parent of the window
  • + *
  • {@code window} – window id of window created
  • + *
  • {@code x} – window location
  • + *
  • {@code y} – window location
  • + *
  • {@code width} – size of window
  • + *
  • {@code height} – size of window
  • + *
  • {@code border_width} – border width
  • + *
  • {@code override_redirect} – creation should be overridden
  • + *
+ * + *

Layout

+ * + *

+ * struct XCreateWindowEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window parent;
+ *     Window window;
+ *     int x;
+ *     int y;
+ *     int width;
+ *     int height;
+ *     int border_width;
+ *     int override_redirect;
+ * }
+ */ +public class XCreateWindowEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + PARENT, + WINDOW, + X, + Y, + WIDTH, + HEIGHT, + BORDER_WIDTH, + OVERRIDE_REDIRECT; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + PARENT = layout.offsetof(4); + WINDOW = layout.offsetof(5); + X = layout.offsetof(6); + Y = layout.offsetof(7); + WIDTH = layout.offsetof(8); + HEIGHT = layout.offsetof(9); + BORDER_WIDTH = layout.offsetof(10); + OVERRIDE_REDIRECT = layout.offsetof(11); + } + + /** + * Creates a {@code XCreateWindowEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XCreateWindowEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code parent} field. */ + @NativeType("Window") + public long parent() { return nparent(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code x} field. */ + public int x() { return nx(address()); } + /** Returns the value of the {@code y} field. */ + public int y() { return ny(address()); } + /** Returns the value of the {@code width} field. */ + public int width() { return nwidth(address()); } + /** Returns the value of the {@code height} field. */ + public int height() { return nheight(address()); } + /** Returns the value of the {@code border_width} field. */ + public int border_width() { return nborder_width(address()); } + /** Returns the value of the {@code override_redirect} field. */ + public int override_redirect() { return noverride_redirect(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XCreateWindowEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XCreateWindowEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XCreateWindowEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XCreateWindowEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code parent} field. */ + public XCreateWindowEvent parent(@NativeType("Window") long value) { nparent(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XCreateWindowEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public XCreateWindowEvent x(int value) { nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public XCreateWindowEvent y(int value) { ny(address(), value); return this; } + /** Sets the specified value to the {@code width} field. */ + public XCreateWindowEvent width(int value) { nwidth(address(), value); return this; } + /** Sets the specified value to the {@code height} field. */ + public XCreateWindowEvent height(int value) { nheight(address(), value); return this; } + /** Sets the specified value to the {@code border_width} field. */ + public XCreateWindowEvent border_width(int value) { nborder_width(address(), value); return this; } + /** Sets the specified value to the {@code override_redirect} field. */ + public XCreateWindowEvent override_redirect(int value) { noverride_redirect(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XCreateWindowEvent set( + int type, + long serial, + boolean send_event, + long display, + long parent, + long window, + int x, + int y, + int width, + int height, + int border_width, + int override_redirect + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + parent(parent); + window(window); + x(x); + y(y); + width(width); + height(height); + border_width(border_width); + override_redirect(override_redirect); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XCreateWindowEvent set(XCreateWindowEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XCreateWindowEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XCreateWindowEvent malloc() { + return wrap(XCreateWindowEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XCreateWindowEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XCreateWindowEvent calloc() { + return wrap(XCreateWindowEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XCreateWindowEvent} instance allocated with {@link BufferUtils}. */ + public static XCreateWindowEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XCreateWindowEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XCreateWindowEvent} instance for the specified memory address. */ + public static XCreateWindowEvent create(long address) { + return wrap(XCreateWindowEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XCreateWindowEvent createSafe(long address) { + return address == NULL ? null : wrap(XCreateWindowEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XCreateWindowEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XCreateWindowEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XCreateWindowEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XCreateWindowEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XCreateWindowEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XCreateWindowEvent mallocStack(MemoryStack stack) { + return wrap(XCreateWindowEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XCreateWindowEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XCreateWindowEvent callocStack(MemoryStack stack) { + return wrap(XCreateWindowEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XCreateWindowEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XCreateWindowEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XCreateWindowEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XCreateWindowEvent.DISPLAY); } + /** Unsafe version of {@link #parent}. */ + public static long nparent(long struct) { return memGetCLong(struct + XCreateWindowEvent.PARENT); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XCreateWindowEvent.WINDOW); } + /** Unsafe version of {@link #x}. */ + public static int nx(long struct) { return UNSAFE.getInt(null, struct + XCreateWindowEvent.X); } + /** Unsafe version of {@link #y}. */ + public static int ny(long struct) { return UNSAFE.getInt(null, struct + XCreateWindowEvent.Y); } + /** Unsafe version of {@link #width}. */ + public static int nwidth(long struct) { return UNSAFE.getInt(null, struct + XCreateWindowEvent.WIDTH); } + /** Unsafe version of {@link #height}. */ + public static int nheight(long struct) { return UNSAFE.getInt(null, struct + XCreateWindowEvent.HEIGHT); } + /** Unsafe version of {@link #border_width}. */ + public static int nborder_width(long struct) { return UNSAFE.getInt(null, struct + XCreateWindowEvent.BORDER_WIDTH); } + /** Unsafe version of {@link #override_redirect}. */ + public static int noverride_redirect(long struct) { return UNSAFE.getInt(null, struct + XCreateWindowEvent.OVERRIDE_REDIRECT); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XCreateWindowEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XCreateWindowEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XCreateWindowEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XCreateWindowEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #parent(long) parent}. */ + public static void nparent(long struct, long value) { memPutCLong(struct + XCreateWindowEvent.PARENT, value); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XCreateWindowEvent.WINDOW, value); } + /** Unsafe version of {@link #x(int) x}. */ + public static void nx(long struct, int value) { UNSAFE.putInt(null, struct + XCreateWindowEvent.X, value); } + /** Unsafe version of {@link #y(int) y}. */ + public static void ny(long struct, int value) { UNSAFE.putInt(null, struct + XCreateWindowEvent.Y, value); } + /** Unsafe version of {@link #width(int) width}. */ + public static void nwidth(long struct, int value) { UNSAFE.putInt(null, struct + XCreateWindowEvent.WIDTH, value); } + /** Unsafe version of {@link #height(int) height}. */ + public static void nheight(long struct, int value) { UNSAFE.putInt(null, struct + XCreateWindowEvent.HEIGHT, value); } + /** Unsafe version of {@link #border_width(int) border_width}. */ + public static void nborder_width(long struct, int value) { UNSAFE.putInt(null, struct + XCreateWindowEvent.BORDER_WIDTH, value); } + /** Unsafe version of {@link #override_redirect(int) override_redirect}. */ + public static void noverride_redirect(long struct, int value) { UNSAFE.putInt(null, struct + XCreateWindowEvent.OVERRIDE_REDIRECT, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XCreateWindowEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XCreateWindowEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XCreateWindowEvent ELEMENT_FACTORY = XCreateWindowEvent.create(-1L); + + /** + * Creates a new {@code XCreateWindowEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XCreateWindowEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XCreateWindowEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XCreateWindowEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XCreateWindowEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XCreateWindowEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XCreateWindowEvent.ndisplay(address()); } + /** Returns the value of the {@code parent} field. */ + @NativeType("Window") + public long parent() { return XCreateWindowEvent.nparent(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XCreateWindowEvent.nwindow(address()); } + /** Returns the value of the {@code x} field. */ + public int x() { return XCreateWindowEvent.nx(address()); } + /** Returns the value of the {@code y} field. */ + public int y() { return XCreateWindowEvent.ny(address()); } + /** Returns the value of the {@code width} field. */ + public int width() { return XCreateWindowEvent.nwidth(address()); } + /** Returns the value of the {@code height} field. */ + public int height() { return XCreateWindowEvent.nheight(address()); } + /** Returns the value of the {@code border_width} field. */ + public int border_width() { return XCreateWindowEvent.nborder_width(address()); } + /** Returns the value of the {@code override_redirect} field. */ + public int override_redirect() { return XCreateWindowEvent.noverride_redirect(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XCreateWindowEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XCreateWindowEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XCreateWindowEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XCreateWindowEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code parent} field. */ + public Buffer parent(@NativeType("Window") long value) { XCreateWindowEvent.nparent(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XCreateWindowEvent.nwindow(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public Buffer x(int value) { XCreateWindowEvent.nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public Buffer y(int value) { XCreateWindowEvent.ny(address(), value); return this; } + /** Sets the specified value to the {@code width} field. */ + public Buffer width(int value) { XCreateWindowEvent.nwidth(address(), value); return this; } + /** Sets the specified value to the {@code height} field. */ + public Buffer height(int value) { XCreateWindowEvent.nheight(address(), value); return this; } + /** Sets the specified value to the {@code border_width} field. */ + public Buffer border_width(int value) { XCreateWindowEvent.nborder_width(address(), value); return this; } + /** Sets the specified value to the {@code override_redirect} field. */ + public Buffer override_redirect(int value) { XCreateWindowEvent.noverride_redirect(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XCrossingEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XCrossingEvent.java new file mode 100644 index 00000000..8f09efcf --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XCrossingEvent.java @@ -0,0 +1,631 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Member documentation

+ * + *
    + *
  • {@code type} – of event
  • + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code window} – window it reported relative to
  • + *
  • {@code root} – root window that the event occurred on
  • + *
  • {@code subwindow} – child window
  • + *
  • {@code time} – milliseconds
  • + *
  • {@code x} – pointer x coordinate in event window
  • + *
  • {@code y} – pointer y coordinate in event window
  • + *
  • {@code x_root} – x coordinate relative to {@code root}
  • + *
  • {@code y_root} – y coordinate relative to {@code root}
  • + *
  • {@code mode} – one of:
    {@link X11#NotifyNormal}{@link X11#NotifyGrab}{@link X11#NotifyUngrab}
  • + *
  • {@code same_screen} – same screen flag
  • + *
  • {@code focus} – boolean focus
  • + *
  • {@code state} – key or button mask
  • + *
+ * + *

Layout

+ * + *

+ * struct XCrossingEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window window;
+ *     Window root;
+ *     Window subwindow;
+ *     Time time;
+ *     int x;
+ *     int y;
+ *     int x_root;
+ *     int y_root;
+ *     int mode;
+ *     int detail;
+ *     int same_screen;
+ *     int focus;
+ *     unsigned int state;
+ * }
+ */ +public class XCrossingEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + WINDOW, + ROOT, + SUBWINDOW, + TIME, + X, + Y, + X_ROOT, + Y_ROOT, + MODE, + DETAIL, + SAME_SCREEN, + FOCUS, + STATE; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + WINDOW = layout.offsetof(4); + ROOT = layout.offsetof(5); + SUBWINDOW = layout.offsetof(6); + TIME = layout.offsetof(7); + X = layout.offsetof(8); + Y = layout.offsetof(9); + X_ROOT = layout.offsetof(10); + Y_ROOT = layout.offsetof(11); + MODE = layout.offsetof(12); + DETAIL = layout.offsetof(13); + SAME_SCREEN = layout.offsetof(14); + FOCUS = layout.offsetof(15); + STATE = layout.offsetof(16); + } + + /** + * Creates a {@code XCrossingEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XCrossingEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code root} field. */ + @NativeType("Window") + public long root() { return nroot(address()); } + /** Returns the value of the {@code subwindow} field. */ + @NativeType("Window") + public long subwindow() { return nsubwindow(address()); } + /** Returns the value of the {@code time} field. */ + @NativeType("Time") + public long time() { return ntime(address()); } + /** Returns the value of the {@code x} field. */ + public int x() { return nx(address()); } + /** Returns the value of the {@code y} field. */ + public int y() { return ny(address()); } + /** Returns the value of the {@code x_root} field. */ + public int x_root() { return nx_root(address()); } + /** Returns the value of the {@code y_root} field. */ + public int y_root() { return ny_root(address()); } + /** Returns the value of the {@code mode} field. */ + public int mode() { return nmode(address()); } + /** Returns the value of the {@code detail} field. */ + public int detail() { return ndetail(address()); } + /** Returns the value of the {@code same_screen} field. */ + public int same_screen() { return nsame_screen(address()); } + /** Returns the value of the {@code focus} field. */ + public int focus() { return nfocus(address()); } + /** Returns the value of the {@code state} field. */ + @NativeType("unsigned int") + public int state() { return nstate(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XCrossingEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XCrossingEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XCrossingEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XCrossingEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XCrossingEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Sets the specified value to the {@code root} field. */ + public XCrossingEvent root(@NativeType("Window") long value) { nroot(address(), value); return this; } + /** Sets the specified value to the {@code subwindow} field. */ + public XCrossingEvent subwindow(@NativeType("Window") long value) { nsubwindow(address(), value); return this; } + /** Sets the specified value to the {@code time} field. */ + public XCrossingEvent time(@NativeType("Time") long value) { ntime(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public XCrossingEvent x(int value) { nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public XCrossingEvent y(int value) { ny(address(), value); return this; } + /** Sets the specified value to the {@code x_root} field. */ + public XCrossingEvent x_root(int value) { nx_root(address(), value); return this; } + /** Sets the specified value to the {@code y_root} field. */ + public XCrossingEvent y_root(int value) { ny_root(address(), value); return this; } + /** Sets the specified value to the {@code mode} field. */ + public XCrossingEvent mode(int value) { nmode(address(), value); return this; } + /** Sets the specified value to the {@code detail} field. */ + public XCrossingEvent detail(int value) { ndetail(address(), value); return this; } + /** Sets the specified value to the {@code same_screen} field. */ + public XCrossingEvent same_screen(int value) { nsame_screen(address(), value); return this; } + /** Sets the specified value to the {@code focus} field. */ + public XCrossingEvent focus(int value) { nfocus(address(), value); return this; } + /** Sets the specified value to the {@code state} field. */ + public XCrossingEvent state(@NativeType("unsigned int") int value) { nstate(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XCrossingEvent set( + int type, + long serial, + boolean send_event, + long display, + long window, + long root, + long subwindow, + long time, + int x, + int y, + int x_root, + int y_root, + int mode, + int detail, + int same_screen, + int focus, + int state + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + window(window); + root(root); + subwindow(subwindow); + time(time); + x(x); + y(y); + x_root(x_root); + y_root(y_root); + mode(mode); + detail(detail); + same_screen(same_screen); + focus(focus); + state(state); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XCrossingEvent set(XCrossingEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XCrossingEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XCrossingEvent malloc() { + return wrap(XCrossingEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XCrossingEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XCrossingEvent calloc() { + return wrap(XCrossingEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XCrossingEvent} instance allocated with {@link BufferUtils}. */ + public static XCrossingEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XCrossingEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XCrossingEvent} instance for the specified memory address. */ + public static XCrossingEvent create(long address) { + return wrap(XCrossingEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XCrossingEvent createSafe(long address) { + return address == NULL ? null : wrap(XCrossingEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XCrossingEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XCrossingEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XCrossingEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XCrossingEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XCrossingEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XCrossingEvent mallocStack(MemoryStack stack) { + return wrap(XCrossingEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XCrossingEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XCrossingEvent callocStack(MemoryStack stack) { + return wrap(XCrossingEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XCrossingEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XCrossingEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XCrossingEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XCrossingEvent.DISPLAY); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XCrossingEvent.WINDOW); } + /** Unsafe version of {@link #root}. */ + public static long nroot(long struct) { return memGetCLong(struct + XCrossingEvent.ROOT); } + /** Unsafe version of {@link #subwindow}. */ + public static long nsubwindow(long struct) { return memGetCLong(struct + XCrossingEvent.SUBWINDOW); } + /** Unsafe version of {@link #time}. */ + public static long ntime(long struct) { return memGetCLong(struct + XCrossingEvent.TIME); } + /** Unsafe version of {@link #x}. */ + public static int nx(long struct) { return UNSAFE.getInt(null, struct + XCrossingEvent.X); } + /** Unsafe version of {@link #y}. */ + public static int ny(long struct) { return UNSAFE.getInt(null, struct + XCrossingEvent.Y); } + /** Unsafe version of {@link #x_root}. */ + public static int nx_root(long struct) { return UNSAFE.getInt(null, struct + XCrossingEvent.X_ROOT); } + /** Unsafe version of {@link #y_root}. */ + public static int ny_root(long struct) { return UNSAFE.getInt(null, struct + XCrossingEvent.Y_ROOT); } + /** Unsafe version of {@link #mode}. */ + public static int nmode(long struct) { return UNSAFE.getInt(null, struct + XCrossingEvent.MODE); } + /** Unsafe version of {@link #detail}. */ + public static int ndetail(long struct) { return UNSAFE.getInt(null, struct + XCrossingEvent.DETAIL); } + /** Unsafe version of {@link #same_screen}. */ + public static int nsame_screen(long struct) { return UNSAFE.getInt(null, struct + XCrossingEvent.SAME_SCREEN); } + /** Unsafe version of {@link #focus}. */ + public static int nfocus(long struct) { return UNSAFE.getInt(null, struct + XCrossingEvent.FOCUS); } + /** Unsafe version of {@link #state}. */ + public static int nstate(long struct) { return UNSAFE.getInt(null, struct + XCrossingEvent.STATE); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XCrossingEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XCrossingEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XCrossingEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XCrossingEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XCrossingEvent.WINDOW, value); } + /** Unsafe version of {@link #root(long) root}. */ + public static void nroot(long struct, long value) { memPutCLong(struct + XCrossingEvent.ROOT, value); } + /** Unsafe version of {@link #subwindow(long) subwindow}. */ + public static void nsubwindow(long struct, long value) { memPutCLong(struct + XCrossingEvent.SUBWINDOW, value); } + /** Unsafe version of {@link #time(long) time}. */ + public static void ntime(long struct, long value) { memPutCLong(struct + XCrossingEvent.TIME, value); } + /** Unsafe version of {@link #x(int) x}. */ + public static void nx(long struct, int value) { UNSAFE.putInt(null, struct + XCrossingEvent.X, value); } + /** Unsafe version of {@link #y(int) y}. */ + public static void ny(long struct, int value) { UNSAFE.putInt(null, struct + XCrossingEvent.Y, value); } + /** Unsafe version of {@link #x_root(int) x_root}. */ + public static void nx_root(long struct, int value) { UNSAFE.putInt(null, struct + XCrossingEvent.X_ROOT, value); } + /** Unsafe version of {@link #y_root(int) y_root}. */ + public static void ny_root(long struct, int value) { UNSAFE.putInt(null, struct + XCrossingEvent.Y_ROOT, value); } + /** Unsafe version of {@link #mode(int) mode}. */ + public static void nmode(long struct, int value) { UNSAFE.putInt(null, struct + XCrossingEvent.MODE, value); } + /** Unsafe version of {@link #detail(int) detail}. */ + public static void ndetail(long struct, int value) { UNSAFE.putInt(null, struct + XCrossingEvent.DETAIL, value); } + /** Unsafe version of {@link #same_screen(int) same_screen}. */ + public static void nsame_screen(long struct, int value) { UNSAFE.putInt(null, struct + XCrossingEvent.SAME_SCREEN, value); } + /** Unsafe version of {@link #focus(int) focus}. */ + public static void nfocus(long struct, int value) { UNSAFE.putInt(null, struct + XCrossingEvent.FOCUS, value); } + /** Unsafe version of {@link #state(int) state}. */ + public static void nstate(long struct, int value) { UNSAFE.putInt(null, struct + XCrossingEvent.STATE, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XCrossingEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XCrossingEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XCrossingEvent ELEMENT_FACTORY = XCrossingEvent.create(-1L); + + /** + * Creates a new {@code XCrossingEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XCrossingEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XCrossingEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XCrossingEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XCrossingEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XCrossingEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XCrossingEvent.ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XCrossingEvent.nwindow(address()); } + /** Returns the value of the {@code root} field. */ + @NativeType("Window") + public long root() { return XCrossingEvent.nroot(address()); } + /** Returns the value of the {@code subwindow} field. */ + @NativeType("Window") + public long subwindow() { return XCrossingEvent.nsubwindow(address()); } + /** Returns the value of the {@code time} field. */ + @NativeType("Time") + public long time() { return XCrossingEvent.ntime(address()); } + /** Returns the value of the {@code x} field. */ + public int x() { return XCrossingEvent.nx(address()); } + /** Returns the value of the {@code y} field. */ + public int y() { return XCrossingEvent.ny(address()); } + /** Returns the value of the {@code x_root} field. */ + public int x_root() { return XCrossingEvent.nx_root(address()); } + /** Returns the value of the {@code y_root} field. */ + public int y_root() { return XCrossingEvent.ny_root(address()); } + /** Returns the value of the {@code mode} field. */ + public int mode() { return XCrossingEvent.nmode(address()); } + /** Returns the value of the {@code detail} field. */ + public int detail() { return XCrossingEvent.ndetail(address()); } + /** Returns the value of the {@code same_screen} field. */ + public int same_screen() { return XCrossingEvent.nsame_screen(address()); } + /** Returns the value of the {@code focus} field. */ + public int focus() { return XCrossingEvent.nfocus(address()); } + /** Returns the value of the {@code state} field. */ + @NativeType("unsigned int") + public int state() { return XCrossingEvent.nstate(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XCrossingEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XCrossingEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XCrossingEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XCrossingEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XCrossingEvent.nwindow(address(), value); return this; } + /** Sets the specified value to the {@code root} field. */ + public Buffer root(@NativeType("Window") long value) { XCrossingEvent.nroot(address(), value); return this; } + /** Sets the specified value to the {@code subwindow} field. */ + public Buffer subwindow(@NativeType("Window") long value) { XCrossingEvent.nsubwindow(address(), value); return this; } + /** Sets the specified value to the {@code time} field. */ + public Buffer time(@NativeType("Time") long value) { XCrossingEvent.ntime(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public Buffer x(int value) { XCrossingEvent.nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public Buffer y(int value) { XCrossingEvent.ny(address(), value); return this; } + /** Sets the specified value to the {@code x_root} field. */ + public Buffer x_root(int value) { XCrossingEvent.nx_root(address(), value); return this; } + /** Sets the specified value to the {@code y_root} field. */ + public Buffer y_root(int value) { XCrossingEvent.ny_root(address(), value); return this; } + /** Sets the specified value to the {@code mode} field. */ + public Buffer mode(int value) { XCrossingEvent.nmode(address(), value); return this; } + /** Sets the specified value to the {@code detail} field. */ + public Buffer detail(int value) { XCrossingEvent.ndetail(address(), value); return this; } + /** Sets the specified value to the {@code same_screen} field. */ + public Buffer same_screen(int value) { XCrossingEvent.nsame_screen(address(), value); return this; } + /** Sets the specified value to the {@code focus} field. */ + public Buffer focus(int value) { XCrossingEvent.nfocus(address(), value); return this; } + /** Sets the specified value to the {@code state} field. */ + public Buffer state(@NativeType("unsigned int") int value) { XCrossingEvent.nstate(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XDestroyWindowEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XDestroyWindowEvent.java new file mode 100644 index 00000000..0c5be52d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XDestroyWindowEvent.java @@ -0,0 +1,414 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
+ * + *

Layout

+ * + *

+ * struct XDestroyWindowEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window event;
+ *     Window window;
+ * }
+ */ +public class XDestroyWindowEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + EVENT, + WINDOW; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + EVENT = layout.offsetof(4); + WINDOW = layout.offsetof(5); + } + + /** + * Creates a {@code XDestroyWindowEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XDestroyWindowEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code event} field. */ + @NativeType("Window") + public long event() { return nevent(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XDestroyWindowEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XDestroyWindowEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XDestroyWindowEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XDestroyWindowEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code event} field. */ + public XDestroyWindowEvent event(@NativeType("Window") long value) { nevent(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XDestroyWindowEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XDestroyWindowEvent set( + int type, + long serial, + boolean send_event, + long display, + long event, + long window + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + event(event); + window(window); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XDestroyWindowEvent set(XDestroyWindowEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XDestroyWindowEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XDestroyWindowEvent malloc() { + return wrap(XDestroyWindowEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XDestroyWindowEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XDestroyWindowEvent calloc() { + return wrap(XDestroyWindowEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XDestroyWindowEvent} instance allocated with {@link BufferUtils}. */ + public static XDestroyWindowEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XDestroyWindowEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XDestroyWindowEvent} instance for the specified memory address. */ + public static XDestroyWindowEvent create(long address) { + return wrap(XDestroyWindowEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XDestroyWindowEvent createSafe(long address) { + return address == NULL ? null : wrap(XDestroyWindowEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XDestroyWindowEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XDestroyWindowEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XDestroyWindowEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XDestroyWindowEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XDestroyWindowEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XDestroyWindowEvent mallocStack(MemoryStack stack) { + return wrap(XDestroyWindowEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XDestroyWindowEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XDestroyWindowEvent callocStack(MemoryStack stack) { + return wrap(XDestroyWindowEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XDestroyWindowEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XDestroyWindowEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XDestroyWindowEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XDestroyWindowEvent.DISPLAY); } + /** Unsafe version of {@link #event}. */ + public static long nevent(long struct) { return memGetCLong(struct + XDestroyWindowEvent.EVENT); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XDestroyWindowEvent.WINDOW); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XDestroyWindowEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XDestroyWindowEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XDestroyWindowEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XDestroyWindowEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #event(long) event}. */ + public static void nevent(long struct, long value) { memPutCLong(struct + XDestroyWindowEvent.EVENT, value); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XDestroyWindowEvent.WINDOW, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XDestroyWindowEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XDestroyWindowEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XDestroyWindowEvent ELEMENT_FACTORY = XDestroyWindowEvent.create(-1L); + + /** + * Creates a new {@code XDestroyWindowEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XDestroyWindowEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XDestroyWindowEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XDestroyWindowEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XDestroyWindowEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XDestroyWindowEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XDestroyWindowEvent.ndisplay(address()); } + /** Returns the value of the {@code event} field. */ + @NativeType("Window") + public long event() { return XDestroyWindowEvent.nevent(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XDestroyWindowEvent.nwindow(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XDestroyWindowEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XDestroyWindowEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XDestroyWindowEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XDestroyWindowEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code event} field. */ + public Buffer event(@NativeType("Window") long value) { XDestroyWindowEvent.nevent(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XDestroyWindowEvent.nwindow(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XErrorEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XErrorEvent.java new file mode 100644 index 00000000..e331ea99 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XErrorEvent.java @@ -0,0 +1,439 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Error event. + * + *

Member documentation

+ * + *
    + *
  • {@code display} – display the event was read from
  • + *
  • {@code resourceid} – resource id
  • + *
  • {@code serial} – serial number of failed request
  • + *
  • {@code error_code} – error code of failed request
  • + *
  • {@code request_code} – major op-code of failed request
  • + *
  • {@code minor_code} – minor op-code of failed request
  • + *
+ * + *

Layout

+ * + *

+ * struct XErrorEvent {
+ *     int type;
+ *     Display * display;
+ *     XID resourceid;
+ *     unsigned long serial;
+ *     unsigned char error_code;
+ *     unsigned char request_code;
+ *     unsigned char minor_code;
+ * }
+ */ +public class XErrorEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + DISPLAY, + RESOURCEID, + SERIAL, + ERROR_CODE, + REQUEST_CODE, + MINOR_CODE; + + static { + Layout layout = __struct( + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(1), + __member(1), + __member(1) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + DISPLAY = layout.offsetof(1); + RESOURCEID = layout.offsetof(2); + SERIAL = layout.offsetof(3); + ERROR_CODE = layout.offsetof(4); + REQUEST_CODE = layout.offsetof(5); + MINOR_CODE = layout.offsetof(6); + } + + /** + * Creates a {@code XErrorEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XErrorEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code resourceid} field. */ + @NativeType("XID") + public long resourceid() { return nresourceid(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code error_code} field. */ + @NativeType("unsigned char") + public byte error_code() { return nerror_code(address()); } + /** Returns the value of the {@code request_code} field. */ + @NativeType("unsigned char") + public byte request_code() { return nrequest_code(address()); } + /** Returns the value of the {@code minor_code} field. */ + @NativeType("unsigned char") + public byte minor_code() { return nminor_code(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XErrorEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code display} field. */ + public XErrorEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code resourceid} field. */ + public XErrorEvent resourceid(@NativeType("XID") long value) { nresourceid(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XErrorEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code error_code} field. */ + public XErrorEvent error_code(@NativeType("unsigned char") byte value) { nerror_code(address(), value); return this; } + /** Sets the specified value to the {@code request_code} field. */ + public XErrorEvent request_code(@NativeType("unsigned char") byte value) { nrequest_code(address(), value); return this; } + /** Sets the specified value to the {@code minor_code} field. */ + public XErrorEvent minor_code(@NativeType("unsigned char") byte value) { nminor_code(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XErrorEvent set( + int type, + long display, + long resourceid, + long serial, + byte error_code, + byte request_code, + byte minor_code + ) { + type(type); + display(display); + resourceid(resourceid); + serial(serial); + error_code(error_code); + request_code(request_code); + minor_code(minor_code); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XErrorEvent set(XErrorEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XErrorEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XErrorEvent malloc() { + return wrap(XErrorEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XErrorEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XErrorEvent calloc() { + return wrap(XErrorEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XErrorEvent} instance allocated with {@link BufferUtils}. */ + public static XErrorEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XErrorEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XErrorEvent} instance for the specified memory address. */ + public static XErrorEvent create(long address) { + return wrap(XErrorEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XErrorEvent createSafe(long address) { + return address == NULL ? null : wrap(XErrorEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XErrorEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XErrorEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XErrorEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XErrorEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XErrorEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XErrorEvent mallocStack(MemoryStack stack) { + return wrap(XErrorEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XErrorEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XErrorEvent callocStack(MemoryStack stack) { + return wrap(XErrorEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XErrorEvent.TYPE); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XErrorEvent.DISPLAY); } + /** Unsafe version of {@link #resourceid}. */ + public static long nresourceid(long struct) { return memGetCLong(struct + XErrorEvent.RESOURCEID); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XErrorEvent.SERIAL); } + /** Unsafe version of {@link #error_code}. */ + public static byte nerror_code(long struct) { return UNSAFE.getByte(null, struct + XErrorEvent.ERROR_CODE); } + /** Unsafe version of {@link #request_code}. */ + public static byte nrequest_code(long struct) { return UNSAFE.getByte(null, struct + XErrorEvent.REQUEST_CODE); } + /** Unsafe version of {@link #minor_code}. */ + public static byte nminor_code(long struct) { return UNSAFE.getByte(null, struct + XErrorEvent.MINOR_CODE); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XErrorEvent.TYPE, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XErrorEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #resourceid(long) resourceid}. */ + public static void nresourceid(long struct, long value) { memPutCLong(struct + XErrorEvent.RESOURCEID, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XErrorEvent.SERIAL, value); } + /** Unsafe version of {@link #error_code(byte) error_code}. */ + public static void nerror_code(long struct, byte value) { UNSAFE.putByte(null, struct + XErrorEvent.ERROR_CODE, value); } + /** Unsafe version of {@link #request_code(byte) request_code}. */ + public static void nrequest_code(long struct, byte value) { UNSAFE.putByte(null, struct + XErrorEvent.REQUEST_CODE, value); } + /** Unsafe version of {@link #minor_code(byte) minor_code}. */ + public static void nminor_code(long struct, byte value) { UNSAFE.putByte(null, struct + XErrorEvent.MINOR_CODE, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XErrorEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XErrorEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XErrorEvent ELEMENT_FACTORY = XErrorEvent.create(-1L); + + /** + * Creates a new {@code XErrorEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XErrorEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XErrorEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XErrorEvent.ntype(address()); } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XErrorEvent.ndisplay(address()); } + /** Returns the value of the {@code resourceid} field. */ + @NativeType("XID") + public long resourceid() { return XErrorEvent.nresourceid(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XErrorEvent.nserial(address()); } + /** Returns the value of the {@code error_code} field. */ + @NativeType("unsigned char") + public byte error_code() { return XErrorEvent.nerror_code(address()); } + /** Returns the value of the {@code request_code} field. */ + @NativeType("unsigned char") + public byte request_code() { return XErrorEvent.nrequest_code(address()); } + /** Returns the value of the {@code minor_code} field. */ + @NativeType("unsigned char") + public byte minor_code() { return XErrorEvent.nminor_code(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XErrorEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XErrorEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code resourceid} field. */ + public Buffer resourceid(@NativeType("XID") long value) { XErrorEvent.nresourceid(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XErrorEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code error_code} field. */ + public Buffer error_code(@NativeType("unsigned char") byte value) { XErrorEvent.nerror_code(address(), value); return this; } + /** Sets the specified value to the {@code request_code} field. */ + public Buffer request_code(@NativeType("unsigned char") byte value) { XErrorEvent.nrequest_code(address(), value); return this; } + /** Sets the specified value to the {@code minor_code} field. */ + public Buffer minor_code(@NativeType("unsigned char") byte value) { XErrorEvent.nminor_code(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XEvent.java new file mode 100644 index 00000000..40ccfe3c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XEvent.java @@ -0,0 +1,595 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * This union is defined so Xlib can always use the same sized event structure internally, to avoid memory fragmentation. + * + *

Layout

+ * + *

+ * union XEvent {
+ *     int type;
+ *     {@link XAnyEvent XAnyEvent} xany;
+ *     {@link XKeyEvent XKeyEvent} xkey;
+ *     {@link XButtonEvent XButtonEvent} xbutton;
+ *     {@link XMotionEvent XMotionEvent} xmotion;
+ *     {@link XCrossingEvent XCrossingEvent} xcrossing;
+ *     {@link XFocusChangeEvent XFocusChangeEvent} xfocus;
+ *     {@link XExposeEvent XExposeEvent} xexpose;
+ *     {@link XGraphicsExposeEvent XGraphicsExposeEvent} xgraphicsexpose;
+ *     {@link XNoExposeEvent XNoExposeEvent} xnoexpose;
+ *     {@link XVisibilityEvent XVisibilityEvent} xvisibility;
+ *     {@link XCreateWindowEvent XCreateWindowEvent} xcreatewindow;
+ *     {@link XDestroyWindowEvent XDestroyWindowEvent} xdestroywindow;
+ *     {@link XUnmapEvent XUnmapEvent} xunmap;
+ *     {@link XMapEvent XMapEvent} xmap;
+ *     {@link XMapRequestEvent XMapRequestEvent} xmaprequest;
+ *     {@link XReparentEvent XReparentEvent} xreparent;
+ *     {@link XConfigureEvent XConfigureEvent} xconfigure;
+ *     {@link XGravityEvent XGravityEvent} xgravity;
+ *     {@link XResizeRequestEvent XResizeRequestEvent} xresizerequest;
+ *     {@link XConfigureRequestEvent XConfigureRequestEvent} xconfigurerequest;
+ *     {@link XCirculateEvent XCirculateEvent} xcirculate;
+ *     {@link XCirculateRequestEvent XCirculateRequestEvent} xcirculaterequest;
+ *     {@link XPropertyEvent XPropertyEvent} xproperty;
+ *     {@link XSelectionClearEvent XSelectionClearEvent} xselectionclear;
+ *     {@link XSelectionRequestEvent XSelectionRequestEvent} xselectionrequest;
+ *     {@link XSelectionEvent XSelectionEvent} xselection;
+ *     {@link XColormapEvent XColormapEvent} xcolormap;
+ *     {@link XClientMessageEvent XClientMessageEvent} xclient;
+ *     {@link XMappingEvent XMappingEvent} xmapping;
+ *     {@link XErrorEvent XErrorEvent} xerror;
+ *     {@link XKeymapEvent XKeymapEvent} xkeymap;
+ *     {@link XGenericEvent XGenericEvent} xgeneric;
+ *     {@link XGenericEventCookie XGenericEventCookie} xcookie;
+ *     long pad[24];
+ * }
+ */ +public class XEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + XANY, + XKEY, + XBUTTON, + XMOTION, + XCROSSING, + XFOCUS, + XEXPOSE, + XGRAPHICSEXPOSE, + XNOEXPOSE, + XVISIBILITY, + XCREATEWINDOW, + XDESTROYWINDOW, + XUNMAP, + XMAP, + XMAPREQUEST, + XREPARENT, + XCONFIGURE, + XGRAVITY, + XRESIZEREQUEST, + XCONFIGUREREQUEST, + XCIRCULATE, + XCIRCULATEREQUEST, + XPROPERTY, + XSELECTIONCLEAR, + XSELECTIONREQUEST, + XSELECTION, + XCOLORMAP, + XCLIENT, + XMAPPING, + XERROR, + XKEYMAP, + XGENERIC, + XCOOKIE, + PAD; + + static { + Layout layout = __union( + __member(4), + __member(XAnyEvent.SIZEOF, XAnyEvent.ALIGNOF), + __member(XKeyEvent.SIZEOF, XKeyEvent.ALIGNOF), + __member(XButtonEvent.SIZEOF, XButtonEvent.ALIGNOF), + __member(XMotionEvent.SIZEOF, XMotionEvent.ALIGNOF), + __member(XCrossingEvent.SIZEOF, XCrossingEvent.ALIGNOF), + __member(XFocusChangeEvent.SIZEOF, XFocusChangeEvent.ALIGNOF), + __member(XExposeEvent.SIZEOF, XExposeEvent.ALIGNOF), + __member(XGraphicsExposeEvent.SIZEOF, XGraphicsExposeEvent.ALIGNOF), + __member(XNoExposeEvent.SIZEOF, XNoExposeEvent.ALIGNOF), + __member(XVisibilityEvent.SIZEOF, XVisibilityEvent.ALIGNOF), + __member(XCreateWindowEvent.SIZEOF, XCreateWindowEvent.ALIGNOF), + __member(XDestroyWindowEvent.SIZEOF, XDestroyWindowEvent.ALIGNOF), + __member(XUnmapEvent.SIZEOF, XUnmapEvent.ALIGNOF), + __member(XMapEvent.SIZEOF, XMapEvent.ALIGNOF), + __member(XMapRequestEvent.SIZEOF, XMapRequestEvent.ALIGNOF), + __member(XReparentEvent.SIZEOF, XReparentEvent.ALIGNOF), + __member(XConfigureEvent.SIZEOF, XConfigureEvent.ALIGNOF), + __member(XGravityEvent.SIZEOF, XGravityEvent.ALIGNOF), + __member(XResizeRequestEvent.SIZEOF, XResizeRequestEvent.ALIGNOF), + __member(XConfigureRequestEvent.SIZEOF, XConfigureRequestEvent.ALIGNOF), + __member(XCirculateEvent.SIZEOF, XCirculateEvent.ALIGNOF), + __member(XCirculateRequestEvent.SIZEOF, XCirculateRequestEvent.ALIGNOF), + __member(XPropertyEvent.SIZEOF, XPropertyEvent.ALIGNOF), + __member(XSelectionClearEvent.SIZEOF, XSelectionClearEvent.ALIGNOF), + __member(XSelectionRequestEvent.SIZEOF, XSelectionRequestEvent.ALIGNOF), + __member(XSelectionEvent.SIZEOF, XSelectionEvent.ALIGNOF), + __member(XColormapEvent.SIZEOF, XColormapEvent.ALIGNOF), + __member(XClientMessageEvent.SIZEOF, XClientMessageEvent.ALIGNOF), + __member(XMappingEvent.SIZEOF, XMappingEvent.ALIGNOF), + __member(XErrorEvent.SIZEOF, XErrorEvent.ALIGNOF), + __member(XKeymapEvent.SIZEOF, XKeymapEvent.ALIGNOF), + __member(XGenericEvent.SIZEOF, XGenericEvent.ALIGNOF), + __member(XGenericEventCookie.SIZEOF, XGenericEventCookie.ALIGNOF), + __array(CLONG_SIZE, 24) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + XANY = layout.offsetof(1); + XKEY = layout.offsetof(2); + XBUTTON = layout.offsetof(3); + XMOTION = layout.offsetof(4); + XCROSSING = layout.offsetof(5); + XFOCUS = layout.offsetof(6); + XEXPOSE = layout.offsetof(7); + XGRAPHICSEXPOSE = layout.offsetof(8); + XNOEXPOSE = layout.offsetof(9); + XVISIBILITY = layout.offsetof(10); + XCREATEWINDOW = layout.offsetof(11); + XDESTROYWINDOW = layout.offsetof(12); + XUNMAP = layout.offsetof(13); + XMAP = layout.offsetof(14); + XMAPREQUEST = layout.offsetof(15); + XREPARENT = layout.offsetof(16); + XCONFIGURE = layout.offsetof(17); + XGRAVITY = layout.offsetof(18); + XRESIZEREQUEST = layout.offsetof(19); + XCONFIGUREREQUEST = layout.offsetof(20); + XCIRCULATE = layout.offsetof(21); + XCIRCULATEREQUEST = layout.offsetof(22); + XPROPERTY = layout.offsetof(23); + XSELECTIONCLEAR = layout.offsetof(24); + XSELECTIONREQUEST = layout.offsetof(25); + XSELECTION = layout.offsetof(26); + XCOLORMAP = layout.offsetof(27); + XCLIENT = layout.offsetof(28); + XMAPPING = layout.offsetof(29); + XERROR = layout.offsetof(30); + XKEYMAP = layout.offsetof(31); + XGENERIC = layout.offsetof(32); + XCOOKIE = layout.offsetof(33); + PAD = layout.offsetof(34); + } + + /** + * Creates a {@code XEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns a {@link XAnyEvent} view of the {@code xany} field. */ + public XAnyEvent xany() { return nxany(address()); } + /** Returns a {@link XKeyEvent} view of the {@code xkey} field. */ + public XKeyEvent xkey() { return nxkey(address()); } + /** Returns a {@link XButtonEvent} view of the {@code xbutton} field. */ + public XButtonEvent xbutton() { return nxbutton(address()); } + /** Returns a {@link XMotionEvent} view of the {@code xmotion} field. */ + public XMotionEvent xmotion() { return nxmotion(address()); } + /** Returns a {@link XCrossingEvent} view of the {@code xcrossing} field. */ + public XCrossingEvent xcrossing() { return nxcrossing(address()); } + /** Returns a {@link XFocusChangeEvent} view of the {@code xfocus} field. */ + public XFocusChangeEvent xfocus() { return nxfocus(address()); } + /** Returns a {@link XExposeEvent} view of the {@code xexpose} field. */ + public XExposeEvent xexpose() { return nxexpose(address()); } + /** Returns a {@link XGraphicsExposeEvent} view of the {@code xgraphicsexpose} field. */ + public XGraphicsExposeEvent xgraphicsexpose() { return nxgraphicsexpose(address()); } + /** Returns a {@link XNoExposeEvent} view of the {@code xnoexpose} field. */ + public XNoExposeEvent xnoexpose() { return nxnoexpose(address()); } + /** Returns a {@link XVisibilityEvent} view of the {@code xvisibility} field. */ + public XVisibilityEvent xvisibility() { return nxvisibility(address()); } + /** Returns a {@link XCreateWindowEvent} view of the {@code xcreatewindow} field. */ + public XCreateWindowEvent xcreatewindow() { return nxcreatewindow(address()); } + /** Returns a {@link XDestroyWindowEvent} view of the {@code xdestroywindow} field. */ + public XDestroyWindowEvent xdestroywindow() { return nxdestroywindow(address()); } + /** Returns a {@link XUnmapEvent} view of the {@code xunmap} field. */ + public XUnmapEvent xunmap() { return nxunmap(address()); } + /** Returns a {@link XMapEvent} view of the {@code xmap} field. */ + public XMapEvent xmap() { return nxmap(address()); } + /** Returns a {@link XMapRequestEvent} view of the {@code xmaprequest} field. */ + public XMapRequestEvent xmaprequest() { return nxmaprequest(address()); } + /** Returns a {@link XReparentEvent} view of the {@code xreparent} field. */ + public XReparentEvent xreparent() { return nxreparent(address()); } + /** Returns a {@link XConfigureEvent} view of the {@code xconfigure} field. */ + public XConfigureEvent xconfigure() { return nxconfigure(address()); } + /** Returns a {@link XGravityEvent} view of the {@code xgravity} field. */ + public XGravityEvent xgravity() { return nxgravity(address()); } + /** Returns a {@link XResizeRequestEvent} view of the {@code xresizerequest} field. */ + public XResizeRequestEvent xresizerequest() { return nxresizerequest(address()); } + /** Returns a {@link XConfigureRequestEvent} view of the {@code xconfigurerequest} field. */ + public XConfigureRequestEvent xconfigurerequest() { return nxconfigurerequest(address()); } + /** Returns a {@link XCirculateEvent} view of the {@code xcirculate} field. */ + public XCirculateEvent xcirculate() { return nxcirculate(address()); } + /** Returns a {@link XCirculateRequestEvent} view of the {@code xcirculaterequest} field. */ + public XCirculateRequestEvent xcirculaterequest() { return nxcirculaterequest(address()); } + /** Returns a {@link XPropertyEvent} view of the {@code xproperty} field. */ + public XPropertyEvent xproperty() { return nxproperty(address()); } + /** Returns a {@link XSelectionClearEvent} view of the {@code xselectionclear} field. */ + public XSelectionClearEvent xselectionclear() { return nxselectionclear(address()); } + /** Returns a {@link XSelectionRequestEvent} view of the {@code xselectionrequest} field. */ + public XSelectionRequestEvent xselectionrequest() { return nxselectionrequest(address()); } + /** Returns a {@link XSelectionEvent} view of the {@code xselection} field. */ + public XSelectionEvent xselection() { return nxselection(address()); } + /** Returns a {@link XColormapEvent} view of the {@code xcolormap} field. */ + public XColormapEvent xcolormap() { return nxcolormap(address()); } + /** Returns a {@link XClientMessageEvent} view of the {@code xclient} field. */ + public XClientMessageEvent xclient() { return nxclient(address()); } + /** Returns a {@link XMappingEvent} view of the {@code xmapping} field. */ + public XMappingEvent xmapping() { return nxmapping(address()); } + /** Returns a {@link XErrorEvent} view of the {@code xerror} field. */ + public XErrorEvent xerror() { return nxerror(address()); } + /** Returns a {@link XKeymapEvent} view of the {@code xkeymap} field. */ + public XKeymapEvent xkeymap() { return nxkeymap(address()); } + /** Returns a {@link XGenericEvent} view of the {@code xgeneric} field. */ + public XGenericEvent xgeneric() { return nxgeneric(address()); } + /** Returns a {@link XGenericEventCookie} view of the {@code xcookie} field. */ + public XGenericEventCookie xcookie() { return nxcookie(address()); } + + // ----------------------------------- + + /** Returns a new {@code XEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XEvent malloc() { + return wrap(XEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XEvent calloc() { + return wrap(XEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XEvent} instance allocated with {@link BufferUtils}. */ + public static XEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XEvent} instance for the specified memory address. */ + public static XEvent create(long address) { + return wrap(XEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XEvent createSafe(long address) { + return address == NULL ? null : wrap(XEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XEvent mallocStack(MemoryStack stack) { + return wrap(XEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XEvent callocStack(MemoryStack stack) { + return wrap(XEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XEvent.TYPE); } + /** Unsafe version of {@link #xany}. */ + public static XAnyEvent nxany(long struct) { return XAnyEvent.create(struct + XEvent.XANY); } + /** Unsafe version of {@link #xkey}. */ + public static XKeyEvent nxkey(long struct) { return XKeyEvent.create(struct + XEvent.XKEY); } + /** Unsafe version of {@link #xbutton}. */ + public static XButtonEvent nxbutton(long struct) { return XButtonEvent.create(struct + XEvent.XBUTTON); } + /** Unsafe version of {@link #xmotion}. */ + public static XMotionEvent nxmotion(long struct) { return XMotionEvent.create(struct + XEvent.XMOTION); } + /** Unsafe version of {@link #xcrossing}. */ + public static XCrossingEvent nxcrossing(long struct) { return XCrossingEvent.create(struct + XEvent.XCROSSING); } + /** Unsafe version of {@link #xfocus}. */ + public static XFocusChangeEvent nxfocus(long struct) { return XFocusChangeEvent.create(struct + XEvent.XFOCUS); } + /** Unsafe version of {@link #xexpose}. */ + public static XExposeEvent nxexpose(long struct) { return XExposeEvent.create(struct + XEvent.XEXPOSE); } + /** Unsafe version of {@link #xgraphicsexpose}. */ + public static XGraphicsExposeEvent nxgraphicsexpose(long struct) { return XGraphicsExposeEvent.create(struct + XEvent.XGRAPHICSEXPOSE); } + /** Unsafe version of {@link #xnoexpose}. */ + public static XNoExposeEvent nxnoexpose(long struct) { return XNoExposeEvent.create(struct + XEvent.XNOEXPOSE); } + /** Unsafe version of {@link #xvisibility}. */ + public static XVisibilityEvent nxvisibility(long struct) { return XVisibilityEvent.create(struct + XEvent.XVISIBILITY); } + /** Unsafe version of {@link #xcreatewindow}. */ + public static XCreateWindowEvent nxcreatewindow(long struct) { return XCreateWindowEvent.create(struct + XEvent.XCREATEWINDOW); } + /** Unsafe version of {@link #xdestroywindow}. */ + public static XDestroyWindowEvent nxdestroywindow(long struct) { return XDestroyWindowEvent.create(struct + XEvent.XDESTROYWINDOW); } + /** Unsafe version of {@link #xunmap}. */ + public static XUnmapEvent nxunmap(long struct) { return XUnmapEvent.create(struct + XEvent.XUNMAP); } + /** Unsafe version of {@link #xmap}. */ + public static XMapEvent nxmap(long struct) { return XMapEvent.create(struct + XEvent.XMAP); } + /** Unsafe version of {@link #xmaprequest}. */ + public static XMapRequestEvent nxmaprequest(long struct) { return XMapRequestEvent.create(struct + XEvent.XMAPREQUEST); } + /** Unsafe version of {@link #xreparent}. */ + public static XReparentEvent nxreparent(long struct) { return XReparentEvent.create(struct + XEvent.XREPARENT); } + /** Unsafe version of {@link #xconfigure}. */ + public static XConfigureEvent nxconfigure(long struct) { return XConfigureEvent.create(struct + XEvent.XCONFIGURE); } + /** Unsafe version of {@link #xgravity}. */ + public static XGravityEvent nxgravity(long struct) { return XGravityEvent.create(struct + XEvent.XGRAVITY); } + /** Unsafe version of {@link #xresizerequest}. */ + public static XResizeRequestEvent nxresizerequest(long struct) { return XResizeRequestEvent.create(struct + XEvent.XRESIZEREQUEST); } + /** Unsafe version of {@link #xconfigurerequest}. */ + public static XConfigureRequestEvent nxconfigurerequest(long struct) { return XConfigureRequestEvent.create(struct + XEvent.XCONFIGUREREQUEST); } + /** Unsafe version of {@link #xcirculate}. */ + public static XCirculateEvent nxcirculate(long struct) { return XCirculateEvent.create(struct + XEvent.XCIRCULATE); } + /** Unsafe version of {@link #xcirculaterequest}. */ + public static XCirculateRequestEvent nxcirculaterequest(long struct) { return XCirculateRequestEvent.create(struct + XEvent.XCIRCULATEREQUEST); } + /** Unsafe version of {@link #xproperty}. */ + public static XPropertyEvent nxproperty(long struct) { return XPropertyEvent.create(struct + XEvent.XPROPERTY); } + /** Unsafe version of {@link #xselectionclear}. */ + public static XSelectionClearEvent nxselectionclear(long struct) { return XSelectionClearEvent.create(struct + XEvent.XSELECTIONCLEAR); } + /** Unsafe version of {@link #xselectionrequest}. */ + public static XSelectionRequestEvent nxselectionrequest(long struct) { return XSelectionRequestEvent.create(struct + XEvent.XSELECTIONREQUEST); } + /** Unsafe version of {@link #xselection}. */ + public static XSelectionEvent nxselection(long struct) { return XSelectionEvent.create(struct + XEvent.XSELECTION); } + /** Unsafe version of {@link #xcolormap}. */ + public static XColormapEvent nxcolormap(long struct) { return XColormapEvent.create(struct + XEvent.XCOLORMAP); } + /** Unsafe version of {@link #xclient}. */ + public static XClientMessageEvent nxclient(long struct) { return XClientMessageEvent.create(struct + XEvent.XCLIENT); } + /** Unsafe version of {@link #xmapping}. */ + public static XMappingEvent nxmapping(long struct) { return XMappingEvent.create(struct + XEvent.XMAPPING); } + /** Unsafe version of {@link #xerror}. */ + public static XErrorEvent nxerror(long struct) { return XErrorEvent.create(struct + XEvent.XERROR); } + /** Unsafe version of {@link #xkeymap}. */ + public static XKeymapEvent nxkeymap(long struct) { return XKeymapEvent.create(struct + XEvent.XKEYMAP); } + /** Unsafe version of {@link #xgeneric}. */ + public static XGenericEvent nxgeneric(long struct) { return XGenericEvent.create(struct + XEvent.XGENERIC); } + /** Unsafe version of {@link #xcookie}. */ + public static XGenericEventCookie nxcookie(long struct) { return XGenericEventCookie.create(struct + XEvent.XCOOKIE); } + public static CLongBuffer npad(long struct) { return memCLongBuffer(struct + XEvent.PAD, 24); } + public static long npad(long struct, int index) { + return memGetCLong(struct + XEvent.PAD + check(index, 24) * CLONG_SIZE); + } + + // ----------------------------------- + + /** An array of {@link XEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XEvent ELEMENT_FACTORY = XEvent.create(-1L); + + /** + * Creates a new {@code XEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XEvent.ntype(address()); } + /** Returns a {@link XAnyEvent} view of the {@code xany} field. */ + public XAnyEvent xany() { return XEvent.nxany(address()); } + /** Returns a {@link XKeyEvent} view of the {@code xkey} field. */ + public XKeyEvent xkey() { return XEvent.nxkey(address()); } + /** Returns a {@link XButtonEvent} view of the {@code xbutton} field. */ + public XButtonEvent xbutton() { return XEvent.nxbutton(address()); } + /** Returns a {@link XMotionEvent} view of the {@code xmotion} field. */ + public XMotionEvent xmotion() { return XEvent.nxmotion(address()); } + /** Returns a {@link XCrossingEvent} view of the {@code xcrossing} field. */ + public XCrossingEvent xcrossing() { return XEvent.nxcrossing(address()); } + /** Returns a {@link XFocusChangeEvent} view of the {@code xfocus} field. */ + public XFocusChangeEvent xfocus() { return XEvent.nxfocus(address()); } + /** Returns a {@link XExposeEvent} view of the {@code xexpose} field. */ + public XExposeEvent xexpose() { return XEvent.nxexpose(address()); } + /** Returns a {@link XGraphicsExposeEvent} view of the {@code xgraphicsexpose} field. */ + public XGraphicsExposeEvent xgraphicsexpose() { return XEvent.nxgraphicsexpose(address()); } + /** Returns a {@link XNoExposeEvent} view of the {@code xnoexpose} field. */ + public XNoExposeEvent xnoexpose() { return XEvent.nxnoexpose(address()); } + /** Returns a {@link XVisibilityEvent} view of the {@code xvisibility} field. */ + public XVisibilityEvent xvisibility() { return XEvent.nxvisibility(address()); } + /** Returns a {@link XCreateWindowEvent} view of the {@code xcreatewindow} field. */ + public XCreateWindowEvent xcreatewindow() { return XEvent.nxcreatewindow(address()); } + /** Returns a {@link XDestroyWindowEvent} view of the {@code xdestroywindow} field. */ + public XDestroyWindowEvent xdestroywindow() { return XEvent.nxdestroywindow(address()); } + /** Returns a {@link XUnmapEvent} view of the {@code xunmap} field. */ + public XUnmapEvent xunmap() { return XEvent.nxunmap(address()); } + /** Returns a {@link XMapEvent} view of the {@code xmap} field. */ + public XMapEvent xmap() { return XEvent.nxmap(address()); } + /** Returns a {@link XMapRequestEvent} view of the {@code xmaprequest} field. */ + public XMapRequestEvent xmaprequest() { return XEvent.nxmaprequest(address()); } + /** Returns a {@link XReparentEvent} view of the {@code xreparent} field. */ + public XReparentEvent xreparent() { return XEvent.nxreparent(address()); } + /** Returns a {@link XConfigureEvent} view of the {@code xconfigure} field. */ + public XConfigureEvent xconfigure() { return XEvent.nxconfigure(address()); } + /** Returns a {@link XGravityEvent} view of the {@code xgravity} field. */ + public XGravityEvent xgravity() { return XEvent.nxgravity(address()); } + /** Returns a {@link XResizeRequestEvent} view of the {@code xresizerequest} field. */ + public XResizeRequestEvent xresizerequest() { return XEvent.nxresizerequest(address()); } + /** Returns a {@link XConfigureRequestEvent} view of the {@code xconfigurerequest} field. */ + public XConfigureRequestEvent xconfigurerequest() { return XEvent.nxconfigurerequest(address()); } + /** Returns a {@link XCirculateEvent} view of the {@code xcirculate} field. */ + public XCirculateEvent xcirculate() { return XEvent.nxcirculate(address()); } + /** Returns a {@link XCirculateRequestEvent} view of the {@code xcirculaterequest} field. */ + public XCirculateRequestEvent xcirculaterequest() { return XEvent.nxcirculaterequest(address()); } + /** Returns a {@link XPropertyEvent} view of the {@code xproperty} field. */ + public XPropertyEvent xproperty() { return XEvent.nxproperty(address()); } + /** Returns a {@link XSelectionClearEvent} view of the {@code xselectionclear} field. */ + public XSelectionClearEvent xselectionclear() { return XEvent.nxselectionclear(address()); } + /** Returns a {@link XSelectionRequestEvent} view of the {@code xselectionrequest} field. */ + public XSelectionRequestEvent xselectionrequest() { return XEvent.nxselectionrequest(address()); } + /** Returns a {@link XSelectionEvent} view of the {@code xselection} field. */ + public XSelectionEvent xselection() { return XEvent.nxselection(address()); } + /** Returns a {@link XColormapEvent} view of the {@code xcolormap} field. */ + public XColormapEvent xcolormap() { return XEvent.nxcolormap(address()); } + /** Returns a {@link XClientMessageEvent} view of the {@code xclient} field. */ + public XClientMessageEvent xclient() { return XEvent.nxclient(address()); } + /** Returns a {@link XMappingEvent} view of the {@code xmapping} field. */ + public XMappingEvent xmapping() { return XEvent.nxmapping(address()); } + /** Returns a {@link XErrorEvent} view of the {@code xerror} field. */ + public XErrorEvent xerror() { return XEvent.nxerror(address()); } + /** Returns a {@link XKeymapEvent} view of the {@code xkeymap} field. */ + public XKeymapEvent xkeymap() { return XEvent.nxkeymap(address()); } + /** Returns a {@link XGenericEvent} view of the {@code xgeneric} field. */ + public XGenericEvent xgeneric() { return XEvent.nxgeneric(address()); } + /** Returns a {@link XGenericEventCookie} view of the {@code xcookie} field. */ + public XGenericEventCookie xcookie() { return XEvent.nxcookie(address()); } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XExposeEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XExposeEvent.java new file mode 100644 index 00000000..2e9b14de --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XExposeEvent.java @@ -0,0 +1,486 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code window} – window it reported relative to
  • + *
  • {@code count} – if non-zero, at least this many more
  • + *
+ * + *

Layout

+ * + *

+ * struct XExposeEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window window;
+ *     int x;
+ *     int y;
+ *     int width;
+ *     int height;
+ *     int count;
+ * }
+ */ +public class XExposeEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + WINDOW, + X, + Y, + WIDTH, + HEIGHT, + COUNT; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + WINDOW = layout.offsetof(4); + X = layout.offsetof(5); + Y = layout.offsetof(6); + WIDTH = layout.offsetof(7); + HEIGHT = layout.offsetof(8); + COUNT = layout.offsetof(9); + } + + /** + * Creates a {@code XExposeEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XExposeEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code x} field. */ + public int x() { return nx(address()); } + /** Returns the value of the {@code y} field. */ + public int y() { return ny(address()); } + /** Returns the value of the {@code width} field. */ + public int width() { return nwidth(address()); } + /** Returns the value of the {@code height} field. */ + public int height() { return nheight(address()); } + /** Returns the value of the {@code count} field. */ + public int count() { return ncount(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XExposeEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XExposeEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XExposeEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XExposeEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XExposeEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public XExposeEvent x(int value) { nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public XExposeEvent y(int value) { ny(address(), value); return this; } + /** Sets the specified value to the {@code width} field. */ + public XExposeEvent width(int value) { nwidth(address(), value); return this; } + /** Sets the specified value to the {@code height} field. */ + public XExposeEvent height(int value) { nheight(address(), value); return this; } + /** Sets the specified value to the {@code count} field. */ + public XExposeEvent count(int value) { ncount(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XExposeEvent set( + int type, + long serial, + boolean send_event, + long display, + long window, + int x, + int y, + int width, + int height, + int count + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + window(window); + x(x); + y(y); + width(width); + height(height); + count(count); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XExposeEvent set(XExposeEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XExposeEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XExposeEvent malloc() { + return wrap(XExposeEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XExposeEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XExposeEvent calloc() { + return wrap(XExposeEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XExposeEvent} instance allocated with {@link BufferUtils}. */ + public static XExposeEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XExposeEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XExposeEvent} instance for the specified memory address. */ + public static XExposeEvent create(long address) { + return wrap(XExposeEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XExposeEvent createSafe(long address) { + return address == NULL ? null : wrap(XExposeEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XExposeEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XExposeEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XExposeEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XExposeEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XExposeEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XExposeEvent mallocStack(MemoryStack stack) { + return wrap(XExposeEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XExposeEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XExposeEvent callocStack(MemoryStack stack) { + return wrap(XExposeEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XExposeEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XExposeEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XExposeEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XExposeEvent.DISPLAY); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XExposeEvent.WINDOW); } + /** Unsafe version of {@link #x}. */ + public static int nx(long struct) { return UNSAFE.getInt(null, struct + XExposeEvent.X); } + /** Unsafe version of {@link #y}. */ + public static int ny(long struct) { return UNSAFE.getInt(null, struct + XExposeEvent.Y); } + /** Unsafe version of {@link #width}. */ + public static int nwidth(long struct) { return UNSAFE.getInt(null, struct + XExposeEvent.WIDTH); } + /** Unsafe version of {@link #height}. */ + public static int nheight(long struct) { return UNSAFE.getInt(null, struct + XExposeEvent.HEIGHT); } + /** Unsafe version of {@link #count}. */ + public static int ncount(long struct) { return UNSAFE.getInt(null, struct + XExposeEvent.COUNT); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XExposeEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XExposeEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XExposeEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XExposeEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XExposeEvent.WINDOW, value); } + /** Unsafe version of {@link #x(int) x}. */ + public static void nx(long struct, int value) { UNSAFE.putInt(null, struct + XExposeEvent.X, value); } + /** Unsafe version of {@link #y(int) y}. */ + public static void ny(long struct, int value) { UNSAFE.putInt(null, struct + XExposeEvent.Y, value); } + /** Unsafe version of {@link #width(int) width}. */ + public static void nwidth(long struct, int value) { UNSAFE.putInt(null, struct + XExposeEvent.WIDTH, value); } + /** Unsafe version of {@link #height(int) height}. */ + public static void nheight(long struct, int value) { UNSAFE.putInt(null, struct + XExposeEvent.HEIGHT, value); } + /** Unsafe version of {@link #count(int) count}. */ + public static void ncount(long struct, int value) { UNSAFE.putInt(null, struct + XExposeEvent.COUNT, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XExposeEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XExposeEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XExposeEvent ELEMENT_FACTORY = XExposeEvent.create(-1L); + + /** + * Creates a new {@code XExposeEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XExposeEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XExposeEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XExposeEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XExposeEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XExposeEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XExposeEvent.ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XExposeEvent.nwindow(address()); } + /** Returns the value of the {@code x} field. */ + public int x() { return XExposeEvent.nx(address()); } + /** Returns the value of the {@code y} field. */ + public int y() { return XExposeEvent.ny(address()); } + /** Returns the value of the {@code width} field. */ + public int width() { return XExposeEvent.nwidth(address()); } + /** Returns the value of the {@code height} field. */ + public int height() { return XExposeEvent.nheight(address()); } + /** Returns the value of the {@code count} field. */ + public int count() { return XExposeEvent.ncount(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XExposeEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XExposeEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XExposeEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XExposeEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XExposeEvent.nwindow(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public Buffer x(int value) { XExposeEvent.nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public Buffer y(int value) { XExposeEvent.ny(address(), value); return this; } + /** Sets the specified value to the {@code width} field. */ + public Buffer width(int value) { XExposeEvent.nwidth(address(), value); return this; } + /** Sets the specified value to the {@code height} field. */ + public Buffer height(int value) { XExposeEvent.nheight(address(), value); return this; } + /** Sets the specified value to the {@code count} field. */ + public Buffer count(int value) { XExposeEvent.ncount(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XFocusChangeEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XFocusChangeEvent.java new file mode 100644 index 00000000..2f046bd8 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XFocusChangeEvent.java @@ -0,0 +1,434 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Member documentation

+ * + *
    + *
  • {@code type} – one of:
    {@link X11#FocusIn}{@link X11#FocusOut}
  • + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code window} – window it reported relative to
  • + *
  • {@code mode} – one of:
    {@link X11#NotifyNormal}{@link X11#NotifyWhileGrabbed}{@link X11#NotifyGrab}{@link X11#NotifyUngrab}
  • + *
  • {@code detail} – one of:
    {@link X11#NotifyAncestor}{@link X11#NotifyVirtual}{@link X11#NotifyInferior}{@link X11#NotifyNonlinear}{@link X11#NotifyNonlinearVirtual}
    {@link X11#NotifyPointer}{@link X11#NotifyPointerRoot}{@link X11#NotifyDetailNone}
  • + *
+ * + *

Layout

+ * + *

+ * struct XFocusChangeEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window window;
+ *     int mode;
+ *     int detail;
+ * }
+ */ +public class XFocusChangeEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + WINDOW, + MODE, + DETAIL; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + WINDOW = layout.offsetof(4); + MODE = layout.offsetof(5); + DETAIL = layout.offsetof(6); + } + + /** + * Creates a {@code XFocusChangeEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XFocusChangeEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code mode} field. */ + public int mode() { return nmode(address()); } + /** Returns the value of the {@code detail} field. */ + public int detail() { return ndetail(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XFocusChangeEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XFocusChangeEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XFocusChangeEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XFocusChangeEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XFocusChangeEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Sets the specified value to the {@code mode} field. */ + public XFocusChangeEvent mode(int value) { nmode(address(), value); return this; } + /** Sets the specified value to the {@code detail} field. */ + public XFocusChangeEvent detail(int value) { ndetail(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XFocusChangeEvent set( + int type, + long serial, + boolean send_event, + long display, + long window, + int mode, + int detail + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + window(window); + mode(mode); + detail(detail); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XFocusChangeEvent set(XFocusChangeEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XFocusChangeEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XFocusChangeEvent malloc() { + return wrap(XFocusChangeEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XFocusChangeEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XFocusChangeEvent calloc() { + return wrap(XFocusChangeEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XFocusChangeEvent} instance allocated with {@link BufferUtils}. */ + public static XFocusChangeEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XFocusChangeEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XFocusChangeEvent} instance for the specified memory address. */ + public static XFocusChangeEvent create(long address) { + return wrap(XFocusChangeEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XFocusChangeEvent createSafe(long address) { + return address == NULL ? null : wrap(XFocusChangeEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XFocusChangeEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XFocusChangeEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XFocusChangeEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XFocusChangeEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XFocusChangeEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XFocusChangeEvent mallocStack(MemoryStack stack) { + return wrap(XFocusChangeEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XFocusChangeEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XFocusChangeEvent callocStack(MemoryStack stack) { + return wrap(XFocusChangeEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XFocusChangeEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XFocusChangeEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XFocusChangeEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XFocusChangeEvent.DISPLAY); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XFocusChangeEvent.WINDOW); } + /** Unsafe version of {@link #mode}. */ + public static int nmode(long struct) { return UNSAFE.getInt(null, struct + XFocusChangeEvent.MODE); } + /** Unsafe version of {@link #detail}. */ + public static int ndetail(long struct) { return UNSAFE.getInt(null, struct + XFocusChangeEvent.DETAIL); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XFocusChangeEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XFocusChangeEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XFocusChangeEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XFocusChangeEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XFocusChangeEvent.WINDOW, value); } + /** Unsafe version of {@link #mode(int) mode}. */ + public static void nmode(long struct, int value) { UNSAFE.putInt(null, struct + XFocusChangeEvent.MODE, value); } + /** Unsafe version of {@link #detail(int) detail}. */ + public static void ndetail(long struct, int value) { UNSAFE.putInt(null, struct + XFocusChangeEvent.DETAIL, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XFocusChangeEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XFocusChangeEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XFocusChangeEvent ELEMENT_FACTORY = XFocusChangeEvent.create(-1L); + + /** + * Creates a new {@code XFocusChangeEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XFocusChangeEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XFocusChangeEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XFocusChangeEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XFocusChangeEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XFocusChangeEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XFocusChangeEvent.ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XFocusChangeEvent.nwindow(address()); } + /** Returns the value of the {@code mode} field. */ + public int mode() { return XFocusChangeEvent.nmode(address()); } + /** Returns the value of the {@code detail} field. */ + public int detail() { return XFocusChangeEvent.ndetail(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XFocusChangeEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XFocusChangeEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XFocusChangeEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XFocusChangeEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XFocusChangeEvent.nwindow(address(), value); return this; } + /** Sets the specified value to the {@code mode} field. */ + public Buffer mode(int value) { XFocusChangeEvent.nmode(address(), value); return this; } + /** Sets the specified value to the {@code detail} field. */ + public Buffer detail(int value) { XFocusChangeEvent.ndetail(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XGenericEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XGenericEvent.java new file mode 100644 index 00000000..83e2db3f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XGenericEvent.java @@ -0,0 +1,415 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * GenericEvent. This event is the standard event for all newer extensions. + * + *

Member documentation

+ * + *
    + *
  • {@code type} – of event. Must be:
    {@link X11#GenericEvent}
  • + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code extension} – major opcode of extension that caused the event
  • + *
  • {@code evtype} – actual event type
  • + *
+ * + *

Layout

+ * + *

+ * struct XGenericEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     int extension;
+ *     int evtype;
+ * }
+ */ +public class XGenericEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + EXTENSION, + EVTYPE; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + EXTENSION = layout.offsetof(4); + EVTYPE = layout.offsetof(5); + } + + /** + * Creates a {@code XGenericEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XGenericEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code extension} field. */ + public int extension() { return nextension(address()); } + /** Returns the value of the {@code evtype} field. */ + public int evtype() { return nevtype(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XGenericEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XGenericEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XGenericEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XGenericEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code extension} field. */ + public XGenericEvent extension(int value) { nextension(address(), value); return this; } + /** Sets the specified value to the {@code evtype} field. */ + public XGenericEvent evtype(int value) { nevtype(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XGenericEvent set( + int type, + long serial, + boolean send_event, + long display, + int extension, + int evtype + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + extension(extension); + evtype(evtype); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XGenericEvent set(XGenericEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XGenericEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XGenericEvent malloc() { + return wrap(XGenericEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XGenericEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XGenericEvent calloc() { + return wrap(XGenericEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XGenericEvent} instance allocated with {@link BufferUtils}. */ + public static XGenericEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XGenericEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XGenericEvent} instance for the specified memory address. */ + public static XGenericEvent create(long address) { + return wrap(XGenericEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XGenericEvent createSafe(long address) { + return address == NULL ? null : wrap(XGenericEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XGenericEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XGenericEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XGenericEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XGenericEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XGenericEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XGenericEvent mallocStack(MemoryStack stack) { + return wrap(XGenericEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XGenericEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XGenericEvent callocStack(MemoryStack stack) { + return wrap(XGenericEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XGenericEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XGenericEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XGenericEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XGenericEvent.DISPLAY); } + /** Unsafe version of {@link #extension}. */ + public static int nextension(long struct) { return UNSAFE.getInt(null, struct + XGenericEvent.EXTENSION); } + /** Unsafe version of {@link #evtype}. */ + public static int nevtype(long struct) { return UNSAFE.getInt(null, struct + XGenericEvent.EVTYPE); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XGenericEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XGenericEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XGenericEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XGenericEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #extension(int) extension}. */ + public static void nextension(long struct, int value) { UNSAFE.putInt(null, struct + XGenericEvent.EXTENSION, value); } + /** Unsafe version of {@link #evtype(int) evtype}. */ + public static void nevtype(long struct, int value) { UNSAFE.putInt(null, struct + XGenericEvent.EVTYPE, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XGenericEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XGenericEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XGenericEvent ELEMENT_FACTORY = XGenericEvent.create(-1L); + + /** + * Creates a new {@code XGenericEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XGenericEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XGenericEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XGenericEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XGenericEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XGenericEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XGenericEvent.ndisplay(address()); } + /** Returns the value of the {@code extension} field. */ + public int extension() { return XGenericEvent.nextension(address()); } + /** Returns the value of the {@code evtype} field. */ + public int evtype() { return XGenericEvent.nevtype(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XGenericEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XGenericEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XGenericEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XGenericEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code extension} field. */ + public Buffer extension(int value) { XGenericEvent.nextension(address(), value); return this; } + /** Sets the specified value to the {@code evtype} field. */ + public Buffer evtype(int value) { XGenericEvent.nevtype(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XGenericEventCookie.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XGenericEventCookie.java new file mode 100644 index 00000000..052eb720 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XGenericEventCookie.java @@ -0,0 +1,464 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Additional information for an {@code XGenericEvent}. + * + *

Member documentation

+ * + *
    + *
  • {@code type} – of event. Must be:
    {@link X11#GenericEvent}
  • + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code extension} – major opcode of extension that caused the event
  • + *
  • {@code evtype} – actual event type
  • + *
+ * + *

Layout

+ * + *

+ * struct XGenericEventCookie {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     int extension;
+ *     int evtype;
+ *     unsigned int cookie;
+ *     void * data;
+ * }
+ */ +public class XGenericEventCookie extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + EXTENSION, + EVTYPE, + COOKIE, + DATA; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(4), + __member(4), + __member(4), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + EXTENSION = layout.offsetof(4); + EVTYPE = layout.offsetof(5); + COOKIE = layout.offsetof(6); + DATA = layout.offsetof(7); + } + + /** + * Creates a {@code XGenericEventCookie} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XGenericEventCookie(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code extension} field. */ + public int extension() { return nextension(address()); } + /** Returns the value of the {@code evtype} field. */ + public int evtype() { return nevtype(address()); } + /** Returns the value of the {@code cookie} field. */ + @NativeType("unsigned int") + public int cookie() { return ncookie(address()); } + /** + * Returns a {@link ByteBuffer} view of the data pointed to by the {@code data} field. + * + * @param capacity the number of elements in the returned buffer + */ + @NativeType("void *") + public ByteBuffer data(int capacity) { return ndata(address(), capacity); } + + /** Sets the specified value to the {@code type} field. */ + public XGenericEventCookie type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XGenericEventCookie serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XGenericEventCookie send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XGenericEventCookie display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code extension} field. */ + public XGenericEventCookie extension(int value) { nextension(address(), value); return this; } + /** Sets the specified value to the {@code evtype} field. */ + public XGenericEventCookie evtype(int value) { nevtype(address(), value); return this; } + /** Sets the specified value to the {@code cookie} field. */ + public XGenericEventCookie cookie(@NativeType("unsigned int") int value) { ncookie(address(), value); return this; } + /** Sets the address of the specified {@link ByteBuffer} to the {@code data} field. */ + public XGenericEventCookie data(@NativeType("void *") ByteBuffer value) { ndata(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XGenericEventCookie set( + int type, + long serial, + boolean send_event, + long display, + int extension, + int evtype, + int cookie, + ByteBuffer data + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + extension(extension); + evtype(evtype); + cookie(cookie); + data(data); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XGenericEventCookie set(XGenericEventCookie src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XGenericEventCookie} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XGenericEventCookie malloc() { + return wrap(XGenericEventCookie.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XGenericEventCookie} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XGenericEventCookie calloc() { + return wrap(XGenericEventCookie.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XGenericEventCookie} instance allocated with {@link BufferUtils}. */ + public static XGenericEventCookie create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XGenericEventCookie.class, memAddress(container), container); + } + + /** Returns a new {@code XGenericEventCookie} instance for the specified memory address. */ + public static XGenericEventCookie create(long address) { + return wrap(XGenericEventCookie.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XGenericEventCookie createSafe(long address) { + return address == NULL ? null : wrap(XGenericEventCookie.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XGenericEventCookie} instance allocated on the thread-local {@link MemoryStack}. */ + public static XGenericEventCookie mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XGenericEventCookie} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XGenericEventCookie callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XGenericEventCookie} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XGenericEventCookie mallocStack(MemoryStack stack) { + return wrap(XGenericEventCookie.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XGenericEventCookie} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XGenericEventCookie callocStack(MemoryStack stack) { + return wrap(XGenericEventCookie.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XGenericEventCookie.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XGenericEventCookie.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XGenericEventCookie.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XGenericEventCookie.DISPLAY); } + /** Unsafe version of {@link #extension}. */ + public static int nextension(long struct) { return UNSAFE.getInt(null, struct + XGenericEventCookie.EXTENSION); } + /** Unsafe version of {@link #evtype}. */ + public static int nevtype(long struct) { return UNSAFE.getInt(null, struct + XGenericEventCookie.EVTYPE); } + /** Unsafe version of {@link #cookie}. */ + public static int ncookie(long struct) { return UNSAFE.getInt(null, struct + XGenericEventCookie.COOKIE); } + /** Unsafe version of {@link #data(int) data}. */ + public static ByteBuffer ndata(long struct, int capacity) { return memByteBuffer(memGetAddress(struct + XGenericEventCookie.DATA), capacity); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XGenericEventCookie.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XGenericEventCookie.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XGenericEventCookie.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XGenericEventCookie.DISPLAY, check(value)); } + /** Unsafe version of {@link #extension(int) extension}. */ + public static void nextension(long struct, int value) { UNSAFE.putInt(null, struct + XGenericEventCookie.EXTENSION, value); } + /** Unsafe version of {@link #evtype(int) evtype}. */ + public static void nevtype(long struct, int value) { UNSAFE.putInt(null, struct + XGenericEventCookie.EVTYPE, value); } + /** Unsafe version of {@link #cookie(int) cookie}. */ + public static void ncookie(long struct, int value) { UNSAFE.putInt(null, struct + XGenericEventCookie.COOKIE, value); } + /** Unsafe version of {@link #data(ByteBuffer) data}. */ + public static void ndata(long struct, ByteBuffer value) { memPutAddress(struct + XGenericEventCookie.DATA, memAddress(value)); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XGenericEventCookie.DISPLAY)); + check(memGetAddress(struct + XGenericEventCookie.DATA)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XGenericEventCookie} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XGenericEventCookie ELEMENT_FACTORY = XGenericEventCookie.create(-1L); + + /** + * Creates a new {@code XGenericEventCookie.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XGenericEventCookie#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XGenericEventCookie getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XGenericEventCookie.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XGenericEventCookie.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XGenericEventCookie.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XGenericEventCookie.ndisplay(address()); } + /** Returns the value of the {@code extension} field. */ + public int extension() { return XGenericEventCookie.nextension(address()); } + /** Returns the value of the {@code evtype} field. */ + public int evtype() { return XGenericEventCookie.nevtype(address()); } + /** Returns the value of the {@code cookie} field. */ + @NativeType("unsigned int") + public int cookie() { return XGenericEventCookie.ncookie(address()); } + /** + * Returns a {@link ByteBuffer} view of the data pointed to by the {@code data} field. + * + * @param capacity the number of elements in the returned buffer + */ + @NativeType("void *") + public ByteBuffer data(int capacity) { return XGenericEventCookie.ndata(address(), capacity); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XGenericEventCookie.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XGenericEventCookie.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XGenericEventCookie.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XGenericEventCookie.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code extension} field. */ + public Buffer extension(int value) { XGenericEventCookie.nextension(address(), value); return this; } + /** Sets the specified value to the {@code evtype} field. */ + public Buffer evtype(int value) { XGenericEventCookie.nevtype(address(), value); return this; } + /** Sets the specified value to the {@code cookie} field. */ + public Buffer cookie(@NativeType("unsigned int") int value) { XGenericEventCookie.ncookie(address(), value); return this; } + /** Sets the address of the specified {@link ByteBuffer} to the {@code data} field. */ + public Buffer data(@NativeType("void *") ByteBuffer value) { XGenericEventCookie.ndata(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XGraphicsExposeEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XGraphicsExposeEvent.java new file mode 100644 index 00000000..7e1c53b3 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XGraphicsExposeEvent.java @@ -0,0 +1,523 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code count} – if non-zero, at least this many more
  • + *
  • {@code major_code} – core is {@code CopyArea} or {@code CopyPlane}
  • + *
  • {@code minor_code} – not defined in the core
  • + *
+ * + *

Layout

+ * + *

+ * struct XGraphicsExposeEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Drawable drawable;
+ *     int x;
+ *     int y;
+ *     int width;
+ *     int height;
+ *     int count;
+ *     int major_code;
+ *     int minor_code;
+ * }
+ */ +public class XGraphicsExposeEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + DRAWABLE, + X, + Y, + WIDTH, + HEIGHT, + COUNT, + MAJOR_CODE, + MINOR_CODE; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + DRAWABLE = layout.offsetof(4); + X = layout.offsetof(5); + Y = layout.offsetof(6); + WIDTH = layout.offsetof(7); + HEIGHT = layout.offsetof(8); + COUNT = layout.offsetof(9); + MAJOR_CODE = layout.offsetof(10); + MINOR_CODE = layout.offsetof(11); + } + + /** + * Creates a {@code XGraphicsExposeEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XGraphicsExposeEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code drawable} field. */ + @NativeType("Drawable") + public long drawable() { return ndrawable(address()); } + /** Returns the value of the {@code x} field. */ + public int x() { return nx(address()); } + /** Returns the value of the {@code y} field. */ + public int y() { return ny(address()); } + /** Returns the value of the {@code width} field. */ + public int width() { return nwidth(address()); } + /** Returns the value of the {@code height} field. */ + public int height() { return nheight(address()); } + /** Returns the value of the {@code count} field. */ + public int count() { return ncount(address()); } + /** Returns the value of the {@code major_code} field. */ + public int major_code() { return nmajor_code(address()); } + /** Returns the value of the {@code minor_code} field. */ + public int minor_code() { return nminor_code(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XGraphicsExposeEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XGraphicsExposeEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XGraphicsExposeEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XGraphicsExposeEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code drawable} field. */ + public XGraphicsExposeEvent drawable(@NativeType("Drawable") long value) { ndrawable(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public XGraphicsExposeEvent x(int value) { nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public XGraphicsExposeEvent y(int value) { ny(address(), value); return this; } + /** Sets the specified value to the {@code width} field. */ + public XGraphicsExposeEvent width(int value) { nwidth(address(), value); return this; } + /** Sets the specified value to the {@code height} field. */ + public XGraphicsExposeEvent height(int value) { nheight(address(), value); return this; } + /** Sets the specified value to the {@code count} field. */ + public XGraphicsExposeEvent count(int value) { ncount(address(), value); return this; } + /** Sets the specified value to the {@code major_code} field. */ + public XGraphicsExposeEvent major_code(int value) { nmajor_code(address(), value); return this; } + /** Sets the specified value to the {@code minor_code} field. */ + public XGraphicsExposeEvent minor_code(int value) { nminor_code(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XGraphicsExposeEvent set( + int type, + long serial, + boolean send_event, + long display, + long drawable, + int x, + int y, + int width, + int height, + int count, + int major_code, + int minor_code + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + drawable(drawable); + x(x); + y(y); + width(width); + height(height); + count(count); + major_code(major_code); + minor_code(minor_code); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XGraphicsExposeEvent set(XGraphicsExposeEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XGraphicsExposeEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XGraphicsExposeEvent malloc() { + return wrap(XGraphicsExposeEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XGraphicsExposeEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XGraphicsExposeEvent calloc() { + return wrap(XGraphicsExposeEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XGraphicsExposeEvent} instance allocated with {@link BufferUtils}. */ + public static XGraphicsExposeEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XGraphicsExposeEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XGraphicsExposeEvent} instance for the specified memory address. */ + public static XGraphicsExposeEvent create(long address) { + return wrap(XGraphicsExposeEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XGraphicsExposeEvent createSafe(long address) { + return address == NULL ? null : wrap(XGraphicsExposeEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XGraphicsExposeEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XGraphicsExposeEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XGraphicsExposeEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XGraphicsExposeEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XGraphicsExposeEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XGraphicsExposeEvent mallocStack(MemoryStack stack) { + return wrap(XGraphicsExposeEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XGraphicsExposeEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XGraphicsExposeEvent callocStack(MemoryStack stack) { + return wrap(XGraphicsExposeEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XGraphicsExposeEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XGraphicsExposeEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XGraphicsExposeEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XGraphicsExposeEvent.DISPLAY); } + /** Unsafe version of {@link #drawable}. */ + public static long ndrawable(long struct) { return memGetCLong(struct + XGraphicsExposeEvent.DRAWABLE); } + /** Unsafe version of {@link #x}. */ + public static int nx(long struct) { return UNSAFE.getInt(null, struct + XGraphicsExposeEvent.X); } + /** Unsafe version of {@link #y}. */ + public static int ny(long struct) { return UNSAFE.getInt(null, struct + XGraphicsExposeEvent.Y); } + /** Unsafe version of {@link #width}. */ + public static int nwidth(long struct) { return UNSAFE.getInt(null, struct + XGraphicsExposeEvent.WIDTH); } + /** Unsafe version of {@link #height}. */ + public static int nheight(long struct) { return UNSAFE.getInt(null, struct + XGraphicsExposeEvent.HEIGHT); } + /** Unsafe version of {@link #count}. */ + public static int ncount(long struct) { return UNSAFE.getInt(null, struct + XGraphicsExposeEvent.COUNT); } + /** Unsafe version of {@link #major_code}. */ + public static int nmajor_code(long struct) { return UNSAFE.getInt(null, struct + XGraphicsExposeEvent.MAJOR_CODE); } + /** Unsafe version of {@link #minor_code}. */ + public static int nminor_code(long struct) { return UNSAFE.getInt(null, struct + XGraphicsExposeEvent.MINOR_CODE); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XGraphicsExposeEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XGraphicsExposeEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XGraphicsExposeEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XGraphicsExposeEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #drawable(long) drawable}. */ + public static void ndrawable(long struct, long value) { memPutCLong(struct + XGraphicsExposeEvent.DRAWABLE, value); } + /** Unsafe version of {@link #x(int) x}. */ + public static void nx(long struct, int value) { UNSAFE.putInt(null, struct + XGraphicsExposeEvent.X, value); } + /** Unsafe version of {@link #y(int) y}. */ + public static void ny(long struct, int value) { UNSAFE.putInt(null, struct + XGraphicsExposeEvent.Y, value); } + /** Unsafe version of {@link #width(int) width}. */ + public static void nwidth(long struct, int value) { UNSAFE.putInt(null, struct + XGraphicsExposeEvent.WIDTH, value); } + /** Unsafe version of {@link #height(int) height}. */ + public static void nheight(long struct, int value) { UNSAFE.putInt(null, struct + XGraphicsExposeEvent.HEIGHT, value); } + /** Unsafe version of {@link #count(int) count}. */ + public static void ncount(long struct, int value) { UNSAFE.putInt(null, struct + XGraphicsExposeEvent.COUNT, value); } + /** Unsafe version of {@link #major_code(int) major_code}. */ + public static void nmajor_code(long struct, int value) { UNSAFE.putInt(null, struct + XGraphicsExposeEvent.MAJOR_CODE, value); } + /** Unsafe version of {@link #minor_code(int) minor_code}. */ + public static void nminor_code(long struct, int value) { UNSAFE.putInt(null, struct + XGraphicsExposeEvent.MINOR_CODE, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XGraphicsExposeEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XGraphicsExposeEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XGraphicsExposeEvent ELEMENT_FACTORY = XGraphicsExposeEvent.create(-1L); + + /** + * Creates a new {@code XGraphicsExposeEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XGraphicsExposeEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XGraphicsExposeEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XGraphicsExposeEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XGraphicsExposeEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XGraphicsExposeEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XGraphicsExposeEvent.ndisplay(address()); } + /** Returns the value of the {@code drawable} field. */ + @NativeType("Drawable") + public long drawable() { return XGraphicsExposeEvent.ndrawable(address()); } + /** Returns the value of the {@code x} field. */ + public int x() { return XGraphicsExposeEvent.nx(address()); } + /** Returns the value of the {@code y} field. */ + public int y() { return XGraphicsExposeEvent.ny(address()); } + /** Returns the value of the {@code width} field. */ + public int width() { return XGraphicsExposeEvent.nwidth(address()); } + /** Returns the value of the {@code height} field. */ + public int height() { return XGraphicsExposeEvent.nheight(address()); } + /** Returns the value of the {@code count} field. */ + public int count() { return XGraphicsExposeEvent.ncount(address()); } + /** Returns the value of the {@code major_code} field. */ + public int major_code() { return XGraphicsExposeEvent.nmajor_code(address()); } + /** Returns the value of the {@code minor_code} field. */ + public int minor_code() { return XGraphicsExposeEvent.nminor_code(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XGraphicsExposeEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XGraphicsExposeEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XGraphicsExposeEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XGraphicsExposeEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code drawable} field. */ + public Buffer drawable(@NativeType("Drawable") long value) { XGraphicsExposeEvent.ndrawable(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public Buffer x(int value) { XGraphicsExposeEvent.nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public Buffer y(int value) { XGraphicsExposeEvent.ny(address(), value); return this; } + /** Sets the specified value to the {@code width} field. */ + public Buffer width(int value) { XGraphicsExposeEvent.nwidth(address(), value); return this; } + /** Sets the specified value to the {@code height} field. */ + public Buffer height(int value) { XGraphicsExposeEvent.nheight(address(), value); return this; } + /** Sets the specified value to the {@code count} field. */ + public Buffer count(int value) { XGraphicsExposeEvent.ncount(address(), value); return this; } + /** Sets the specified value to the {@code major_code} field. */ + public Buffer major_code(int value) { XGraphicsExposeEvent.nmajor_code(address(), value); return this; } + /** Sets the specified value to the {@code minor_code} field. */ + public Buffer minor_code(int value) { XGraphicsExposeEvent.nminor_code(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XGravityEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XGravityEvent.java new file mode 100644 index 00000000..629184b2 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XGravityEvent.java @@ -0,0 +1,450 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
+ * + *

Layout

+ * + *

+ * struct XGravityEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window event;
+ *     Window window;
+ *     int x;
+ *     int y;
+ * }
+ */ +public class XGravityEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + EVENT, + WINDOW, + X, + Y; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + EVENT = layout.offsetof(4); + WINDOW = layout.offsetof(5); + X = layout.offsetof(6); + Y = layout.offsetof(7); + } + + /** + * Creates a {@code XGravityEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XGravityEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code event} field. */ + @NativeType("Window") + public long event() { return nevent(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code x} field. */ + public int x() { return nx(address()); } + /** Returns the value of the {@code y} field. */ + public int y() { return ny(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XGravityEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XGravityEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XGravityEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XGravityEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code event} field. */ + public XGravityEvent event(@NativeType("Window") long value) { nevent(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XGravityEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public XGravityEvent x(int value) { nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public XGravityEvent y(int value) { ny(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XGravityEvent set( + int type, + long serial, + boolean send_event, + long display, + long event, + long window, + int x, + int y + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + event(event); + window(window); + x(x); + y(y); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XGravityEvent set(XGravityEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XGravityEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XGravityEvent malloc() { + return wrap(XGravityEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XGravityEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XGravityEvent calloc() { + return wrap(XGravityEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XGravityEvent} instance allocated with {@link BufferUtils}. */ + public static XGravityEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XGravityEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XGravityEvent} instance for the specified memory address. */ + public static XGravityEvent create(long address) { + return wrap(XGravityEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XGravityEvent createSafe(long address) { + return address == NULL ? null : wrap(XGravityEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XGravityEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XGravityEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XGravityEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XGravityEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XGravityEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XGravityEvent mallocStack(MemoryStack stack) { + return wrap(XGravityEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XGravityEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XGravityEvent callocStack(MemoryStack stack) { + return wrap(XGravityEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XGravityEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XGravityEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XGravityEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XGravityEvent.DISPLAY); } + /** Unsafe version of {@link #event}. */ + public static long nevent(long struct) { return memGetCLong(struct + XGravityEvent.EVENT); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XGravityEvent.WINDOW); } + /** Unsafe version of {@link #x}. */ + public static int nx(long struct) { return UNSAFE.getInt(null, struct + XGravityEvent.X); } + /** Unsafe version of {@link #y}. */ + public static int ny(long struct) { return UNSAFE.getInt(null, struct + XGravityEvent.Y); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XGravityEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XGravityEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XGravityEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XGravityEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #event(long) event}. */ + public static void nevent(long struct, long value) { memPutCLong(struct + XGravityEvent.EVENT, value); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XGravityEvent.WINDOW, value); } + /** Unsafe version of {@link #x(int) x}. */ + public static void nx(long struct, int value) { UNSAFE.putInt(null, struct + XGravityEvent.X, value); } + /** Unsafe version of {@link #y(int) y}. */ + public static void ny(long struct, int value) { UNSAFE.putInt(null, struct + XGravityEvent.Y, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XGravityEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XGravityEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XGravityEvent ELEMENT_FACTORY = XGravityEvent.create(-1L); + + /** + * Creates a new {@code XGravityEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XGravityEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XGravityEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XGravityEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XGravityEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XGravityEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XGravityEvent.ndisplay(address()); } + /** Returns the value of the {@code event} field. */ + @NativeType("Window") + public long event() { return XGravityEvent.nevent(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XGravityEvent.nwindow(address()); } + /** Returns the value of the {@code x} field. */ + public int x() { return XGravityEvent.nx(address()); } + /** Returns the value of the {@code y} field. */ + public int y() { return XGravityEvent.ny(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XGravityEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XGravityEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XGravityEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XGravityEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code event} field. */ + public Buffer event(@NativeType("Window") long value) { XGravityEvent.nevent(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XGravityEvent.nwindow(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public Buffer x(int value) { XGravityEvent.nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public Buffer y(int value) { XGravityEvent.ny(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XKeyEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XKeyEvent.java new file mode 100644 index 00000000..3c26f15a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XKeyEvent.java @@ -0,0 +1,600 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Key event. + * + *

Member documentation

+ * + *
    + *
  • {@code type} – the event type. One of:
    {@link X11#KeyPress}{@link X11#KeyRelease}
  • + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code window} – window it reported relative to
  • + *
  • {@code root} – root window that the event occurred on
  • + *
  • {@code subwindow} – child window
  • + *
  • {@code time} – milliseconds
  • + *
  • {@code x} – pointer x coordinate in event window
  • + *
  • {@code y} – pointer y coordinate in event window
  • + *
  • {@code x_root} – x coordinate relative to {@code root}
  • + *
  • {@code y_root} – y coordinate relative to {@code root}
  • + *
  • {@code state} – key mask
  • + *
  • {@code keycode} – detail
  • + *
  • {@code same_screen} – same screen flag
  • + *
+ * + *

Layout

+ * + *

+ * struct XKeyEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window window;
+ *     Window root;
+ *     Window subwindow;
+ *     Time time;
+ *     int x;
+ *     int y;
+ *     int x_root;
+ *     int y_root;
+ *     unsigned int state;
+ *     unsigned int keycode;
+ *     Bool same_screen;
+ * }
+ */ +public class XKeyEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + WINDOW, + ROOT, + SUBWINDOW, + TIME, + X, + Y, + X_ROOT, + Y_ROOT, + STATE, + KEYCODE, + SAME_SCREEN; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + WINDOW = layout.offsetof(4); + ROOT = layout.offsetof(5); + SUBWINDOW = layout.offsetof(6); + TIME = layout.offsetof(7); + X = layout.offsetof(8); + Y = layout.offsetof(9); + X_ROOT = layout.offsetof(10); + Y_ROOT = layout.offsetof(11); + STATE = layout.offsetof(12); + KEYCODE = layout.offsetof(13); + SAME_SCREEN = layout.offsetof(14); + } + + /** + * Creates a {@code XKeyEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XKeyEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code root} field. */ + @NativeType("Window") + public long root() { return nroot(address()); } + /** Returns the value of the {@code subwindow} field. */ + @NativeType("Window") + public long subwindow() { return nsubwindow(address()); } + /** Returns the value of the {@code time} field. */ + @NativeType("Time") + public long time() { return ntime(address()); } + /** Returns the value of the {@code x} field. */ + public int x() { return nx(address()); } + /** Returns the value of the {@code y} field. */ + public int y() { return ny(address()); } + /** Returns the value of the {@code x_root} field. */ + public int x_root() { return nx_root(address()); } + /** Returns the value of the {@code y_root} field. */ + public int y_root() { return ny_root(address()); } + /** Returns the value of the {@code state} field. */ + @NativeType("unsigned int") + public int state() { return nstate(address()); } + /** Returns the value of the {@code keycode} field. */ + @NativeType("unsigned int") + public int keycode() { return nkeycode(address()); } + /** Returns the value of the {@code same_screen} field. */ + @NativeType("Bool") + public boolean same_screen() { return nsame_screen(address()) != 0; } + + /** Sets the specified value to the {@code type} field. */ + public XKeyEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XKeyEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XKeyEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XKeyEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XKeyEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Sets the specified value to the {@code root} field. */ + public XKeyEvent root(@NativeType("Window") long value) { nroot(address(), value); return this; } + /** Sets the specified value to the {@code subwindow} field. */ + public XKeyEvent subwindow(@NativeType("Window") long value) { nsubwindow(address(), value); return this; } + /** Sets the specified value to the {@code time} field. */ + public XKeyEvent time(@NativeType("Time") long value) { ntime(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public XKeyEvent x(int value) { nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public XKeyEvent y(int value) { ny(address(), value); return this; } + /** Sets the specified value to the {@code x_root} field. */ + public XKeyEvent x_root(int value) { nx_root(address(), value); return this; } + /** Sets the specified value to the {@code y_root} field. */ + public XKeyEvent y_root(int value) { ny_root(address(), value); return this; } + /** Sets the specified value to the {@code state} field. */ + public XKeyEvent state(@NativeType("unsigned int") int value) { nstate(address(), value); return this; } + /** Sets the specified value to the {@code keycode} field. */ + public XKeyEvent keycode(@NativeType("unsigned int") int value) { nkeycode(address(), value); return this; } + /** Sets the specified value to the {@code same_screen} field. */ + public XKeyEvent same_screen(@NativeType("Bool") boolean value) { nsame_screen(address(), value ? 1 : 0); return this; } + + /** Initializes this struct with the specified values. */ + public XKeyEvent set( + int type, + long serial, + boolean send_event, + long display, + long window, + long root, + long subwindow, + long time, + int x, + int y, + int x_root, + int y_root, + int state, + int keycode, + boolean same_screen + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + window(window); + root(root); + subwindow(subwindow); + time(time); + x(x); + y(y); + x_root(x_root); + y_root(y_root); + state(state); + keycode(keycode); + same_screen(same_screen); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XKeyEvent set(XKeyEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XKeyEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XKeyEvent malloc() { + return wrap(XKeyEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XKeyEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XKeyEvent calloc() { + return wrap(XKeyEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XKeyEvent} instance allocated with {@link BufferUtils}. */ + public static XKeyEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XKeyEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XKeyEvent} instance for the specified memory address. */ + public static XKeyEvent create(long address) { + return wrap(XKeyEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XKeyEvent createSafe(long address) { + return address == NULL ? null : wrap(XKeyEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XKeyEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XKeyEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XKeyEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XKeyEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XKeyEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XKeyEvent mallocStack(MemoryStack stack) { + return wrap(XKeyEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XKeyEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XKeyEvent callocStack(MemoryStack stack) { + return wrap(XKeyEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XKeyEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XKeyEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XKeyEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XKeyEvent.DISPLAY); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XKeyEvent.WINDOW); } + /** Unsafe version of {@link #root}. */ + public static long nroot(long struct) { return memGetCLong(struct + XKeyEvent.ROOT); } + /** Unsafe version of {@link #subwindow}. */ + public static long nsubwindow(long struct) { return memGetCLong(struct + XKeyEvent.SUBWINDOW); } + /** Unsafe version of {@link #time}. */ + public static long ntime(long struct) { return memGetCLong(struct + XKeyEvent.TIME); } + /** Unsafe version of {@link #x}. */ + public static int nx(long struct) { return UNSAFE.getInt(null, struct + XKeyEvent.X); } + /** Unsafe version of {@link #y}. */ + public static int ny(long struct) { return UNSAFE.getInt(null, struct + XKeyEvent.Y); } + /** Unsafe version of {@link #x_root}. */ + public static int nx_root(long struct) { return UNSAFE.getInt(null, struct + XKeyEvent.X_ROOT); } + /** Unsafe version of {@link #y_root}. */ + public static int ny_root(long struct) { return UNSAFE.getInt(null, struct + XKeyEvent.Y_ROOT); } + /** Unsafe version of {@link #state}. */ + public static int nstate(long struct) { return UNSAFE.getInt(null, struct + XKeyEvent.STATE); } + /** Unsafe version of {@link #keycode}. */ + public static int nkeycode(long struct) { return UNSAFE.getInt(null, struct + XKeyEvent.KEYCODE); } + /** Unsafe version of {@link #same_screen}. */ + public static int nsame_screen(long struct) { return UNSAFE.getInt(null, struct + XKeyEvent.SAME_SCREEN); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XKeyEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XKeyEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XKeyEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XKeyEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XKeyEvent.WINDOW, value); } + /** Unsafe version of {@link #root(long) root}. */ + public static void nroot(long struct, long value) { memPutCLong(struct + XKeyEvent.ROOT, value); } + /** Unsafe version of {@link #subwindow(long) subwindow}. */ + public static void nsubwindow(long struct, long value) { memPutCLong(struct + XKeyEvent.SUBWINDOW, value); } + /** Unsafe version of {@link #time(long) time}. */ + public static void ntime(long struct, long value) { memPutCLong(struct + XKeyEvent.TIME, value); } + /** Unsafe version of {@link #x(int) x}. */ + public static void nx(long struct, int value) { UNSAFE.putInt(null, struct + XKeyEvent.X, value); } + /** Unsafe version of {@link #y(int) y}. */ + public static void ny(long struct, int value) { UNSAFE.putInt(null, struct + XKeyEvent.Y, value); } + /** Unsafe version of {@link #x_root(int) x_root}. */ + public static void nx_root(long struct, int value) { UNSAFE.putInt(null, struct + XKeyEvent.X_ROOT, value); } + /** Unsafe version of {@link #y_root(int) y_root}. */ + public static void ny_root(long struct, int value) { UNSAFE.putInt(null, struct + XKeyEvent.Y_ROOT, value); } + /** Unsafe version of {@link #state(int) state}. */ + public static void nstate(long struct, int value) { UNSAFE.putInt(null, struct + XKeyEvent.STATE, value); } + /** Unsafe version of {@link #keycode(int) keycode}. */ + public static void nkeycode(long struct, int value) { UNSAFE.putInt(null, struct + XKeyEvent.KEYCODE, value); } + /** Unsafe version of {@link #same_screen(boolean) same_screen}. */ + public static void nsame_screen(long struct, int value) { UNSAFE.putInt(null, struct + XKeyEvent.SAME_SCREEN, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XKeyEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XKeyEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XKeyEvent ELEMENT_FACTORY = XKeyEvent.create(-1L); + + /** + * Creates a new {@code XKeyEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XKeyEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XKeyEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XKeyEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XKeyEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XKeyEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XKeyEvent.ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XKeyEvent.nwindow(address()); } + /** Returns the value of the {@code root} field. */ + @NativeType("Window") + public long root() { return XKeyEvent.nroot(address()); } + /** Returns the value of the {@code subwindow} field. */ + @NativeType("Window") + public long subwindow() { return XKeyEvent.nsubwindow(address()); } + /** Returns the value of the {@code time} field. */ + @NativeType("Time") + public long time() { return XKeyEvent.ntime(address()); } + /** Returns the value of the {@code x} field. */ + public int x() { return XKeyEvent.nx(address()); } + /** Returns the value of the {@code y} field. */ + public int y() { return XKeyEvent.ny(address()); } + /** Returns the value of the {@code x_root} field. */ + public int x_root() { return XKeyEvent.nx_root(address()); } + /** Returns the value of the {@code y_root} field. */ + public int y_root() { return XKeyEvent.ny_root(address()); } + /** Returns the value of the {@code state} field. */ + @NativeType("unsigned int") + public int state() { return XKeyEvent.nstate(address()); } + /** Returns the value of the {@code keycode} field. */ + @NativeType("unsigned int") + public int keycode() { return XKeyEvent.nkeycode(address()); } + /** Returns the value of the {@code same_screen} field. */ + @NativeType("Bool") + public boolean same_screen() { return XKeyEvent.nsame_screen(address()) != 0; } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XKeyEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XKeyEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XKeyEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XKeyEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XKeyEvent.nwindow(address(), value); return this; } + /** Sets the specified value to the {@code root} field. */ + public Buffer root(@NativeType("Window") long value) { XKeyEvent.nroot(address(), value); return this; } + /** Sets the specified value to the {@code subwindow} field. */ + public Buffer subwindow(@NativeType("Window") long value) { XKeyEvent.nsubwindow(address(), value); return this; } + /** Sets the specified value to the {@code time} field. */ + public Buffer time(@NativeType("Time") long value) { XKeyEvent.ntime(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public Buffer x(int value) { XKeyEvent.nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public Buffer y(int value) { XKeyEvent.ny(address(), value); return this; } + /** Sets the specified value to the {@code x_root} field. */ + public Buffer x_root(int value) { XKeyEvent.nx_root(address(), value); return this; } + /** Sets the specified value to the {@code y_root} field. */ + public Buffer y_root(int value) { XKeyEvent.ny_root(address(), value); return this; } + /** Sets the specified value to the {@code state} field. */ + public Buffer state(@NativeType("unsigned int") int value) { XKeyEvent.nstate(address(), value); return this; } + /** Sets the specified value to the {@code keycode} field. */ + public Buffer keycode(@NativeType("unsigned int") int value) { XKeyEvent.nkeycode(address(), value); return this; } + /** Sets the specified value to the {@code same_screen} field. */ + public Buffer same_screen(@NativeType("Bool") boolean value) { XKeyEvent.nsame_screen(address(), value ? 1 : 0); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XKeymapEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XKeymapEvent.java new file mode 100644 index 00000000..dd5cf904 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XKeymapEvent.java @@ -0,0 +1,438 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Generated on {@code EnterWindow} and {@code FocusIn} when {@code KeyMapState} selected. + * + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code window} – window it reported relative to
  • + *
+ * + *

Layout

+ * + *

+ * struct XKeymapEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window window;
+ *     char key_vector[32];
+ * }
+ */ +public class XKeymapEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + WINDOW, + KEY_VECTOR; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __array(1, 32) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + WINDOW = layout.offsetof(4); + KEY_VECTOR = layout.offsetof(5); + } + + /** + * Creates a {@code XKeymapEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XKeymapEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns a {@link ByteBuffer} view of the {@code key_vector} field. */ + @NativeType("char[32]") + public ByteBuffer key_vector() { return nkey_vector(address()); } + /** Returns the value at the specified index of the {@code key_vector} field. */ + @NativeType("char") + public byte key_vector(int index) { return nkey_vector(address(), index); } + + /** Sets the specified value to the {@code type} field. */ + public XKeymapEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XKeymapEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XKeymapEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XKeymapEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XKeymapEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Copies the specified {@link ByteBuffer} to the {@code key_vector} field. */ + public XKeymapEvent key_vector(@NativeType("char[32]") ByteBuffer value) { nkey_vector(address(), value); return this; } + /** Sets the specified value at the specified index of the {@code key_vector} field. */ + public XKeymapEvent key_vector(int index, @NativeType("char") byte value) { nkey_vector(address(), index, value); return this; } + + /** Initializes this struct with the specified values. */ + public XKeymapEvent set( + int type, + long serial, + boolean send_event, + long display, + long window, + ByteBuffer key_vector + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + window(window); + key_vector(key_vector); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XKeymapEvent set(XKeymapEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XKeymapEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XKeymapEvent malloc() { + return wrap(XKeymapEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XKeymapEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XKeymapEvent calloc() { + return wrap(XKeymapEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XKeymapEvent} instance allocated with {@link BufferUtils}. */ + public static XKeymapEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XKeymapEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XKeymapEvent} instance for the specified memory address. */ + public static XKeymapEvent create(long address) { + return wrap(XKeymapEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XKeymapEvent createSafe(long address) { + return address == NULL ? null : wrap(XKeymapEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XKeymapEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XKeymapEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XKeymapEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XKeymapEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XKeymapEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XKeymapEvent mallocStack(MemoryStack stack) { + return wrap(XKeymapEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XKeymapEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XKeymapEvent callocStack(MemoryStack stack) { + return wrap(XKeymapEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XKeymapEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XKeymapEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XKeymapEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XKeymapEvent.DISPLAY); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XKeymapEvent.WINDOW); } + /** Unsafe version of {@link #key_vector}. */ + public static ByteBuffer nkey_vector(long struct) { return memByteBuffer(struct + XKeymapEvent.KEY_VECTOR, 32); } + /** Unsafe version of {@link #key_vector(int) key_vector}. */ + public static byte nkey_vector(long struct, int index) { + return UNSAFE.getByte(null, struct + XKeymapEvent.KEY_VECTOR + check(index, 32) * 1); + } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XKeymapEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XKeymapEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XKeymapEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XKeymapEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XKeymapEvent.WINDOW, value); } + /** Unsafe version of {@link #key_vector(ByteBuffer) key_vector}. */ + public static void nkey_vector(long struct, ByteBuffer value) { + if (CHECKS) { checkGT(value, 32); } + memCopy(memAddress(value), struct + XKeymapEvent.KEY_VECTOR, value.remaining() * 1); + } + /** Unsafe version of {@link #key_vector(int, byte) key_vector}. */ + public static void nkey_vector(long struct, int index, byte value) { + UNSAFE.putByte(null, struct + XKeymapEvent.KEY_VECTOR + check(index, 32) * 1, value); + } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XKeymapEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XKeymapEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XKeymapEvent ELEMENT_FACTORY = XKeymapEvent.create(-1L); + + /** + * Creates a new {@code XKeymapEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XKeymapEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XKeymapEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XKeymapEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XKeymapEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XKeymapEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XKeymapEvent.ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XKeymapEvent.nwindow(address()); } + /** Returns a {@link ByteBuffer} view of the {@code key_vector} field. */ + @NativeType("char[32]") + public ByteBuffer key_vector() { return XKeymapEvent.nkey_vector(address()); } + /** Returns the value at the specified index of the {@code key_vector} field. */ + @NativeType("char") + public byte key_vector(int index) { return XKeymapEvent.nkey_vector(address(), index); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XKeymapEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XKeymapEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XKeymapEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XKeymapEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XKeymapEvent.nwindow(address(), value); return this; } + /** Copies the specified {@link ByteBuffer} to the {@code key_vector} field. */ + public Buffer key_vector(@NativeType("char[32]") ByteBuffer value) { XKeymapEvent.nkey_vector(address(), value); return this; } + /** Sets the specified value at the specified index of the {@code key_vector} field. */ + public Buffer key_vector(int index, @NativeType("char") byte value) { XKeymapEvent.nkey_vector(address(), index, value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XMapEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XMapEvent.java new file mode 100644 index 00000000..782589d9 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XMapEvent.java @@ -0,0 +1,433 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code override_redirect} – boolean, is override set...
  • + *
+ * + *

Layout

+ * + *

+ * struct XMapEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window event;
+ *     Window window;
+ *     int override_redirect;
+ * }
+ */ +public class XMapEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + EVENT, + WINDOW, + OVERRIDE_REDIRECT; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + EVENT = layout.offsetof(4); + WINDOW = layout.offsetof(5); + OVERRIDE_REDIRECT = layout.offsetof(6); + } + + /** + * Creates a {@code XMapEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XMapEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code event} field. */ + @NativeType("Window") + public long event() { return nevent(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code override_redirect} field. */ + public int override_redirect() { return noverride_redirect(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XMapEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XMapEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XMapEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XMapEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code event} field. */ + public XMapEvent event(@NativeType("Window") long value) { nevent(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XMapEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Sets the specified value to the {@code override_redirect} field. */ + public XMapEvent override_redirect(int value) { noverride_redirect(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XMapEvent set( + int type, + long serial, + boolean send_event, + long display, + long event, + long window, + int override_redirect + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + event(event); + window(window); + override_redirect(override_redirect); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XMapEvent set(XMapEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XMapEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XMapEvent malloc() { + return wrap(XMapEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XMapEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XMapEvent calloc() { + return wrap(XMapEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XMapEvent} instance allocated with {@link BufferUtils}. */ + public static XMapEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XMapEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XMapEvent} instance for the specified memory address. */ + public static XMapEvent create(long address) { + return wrap(XMapEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XMapEvent createSafe(long address) { + return address == NULL ? null : wrap(XMapEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XMapEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XMapEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XMapEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XMapEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XMapEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XMapEvent mallocStack(MemoryStack stack) { + return wrap(XMapEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XMapEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XMapEvent callocStack(MemoryStack stack) { + return wrap(XMapEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XMapEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XMapEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XMapEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XMapEvent.DISPLAY); } + /** Unsafe version of {@link #event}. */ + public static long nevent(long struct) { return memGetCLong(struct + XMapEvent.EVENT); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XMapEvent.WINDOW); } + /** Unsafe version of {@link #override_redirect}. */ + public static int noverride_redirect(long struct) { return UNSAFE.getInt(null, struct + XMapEvent.OVERRIDE_REDIRECT); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XMapEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XMapEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XMapEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XMapEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #event(long) event}. */ + public static void nevent(long struct, long value) { memPutCLong(struct + XMapEvent.EVENT, value); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XMapEvent.WINDOW, value); } + /** Unsafe version of {@link #override_redirect(int) override_redirect}. */ + public static void noverride_redirect(long struct, int value) { UNSAFE.putInt(null, struct + XMapEvent.OVERRIDE_REDIRECT, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XMapEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XMapEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XMapEvent ELEMENT_FACTORY = XMapEvent.create(-1L); + + /** + * Creates a new {@code XMapEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XMapEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XMapEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XMapEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XMapEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XMapEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XMapEvent.ndisplay(address()); } + /** Returns the value of the {@code event} field. */ + @NativeType("Window") + public long event() { return XMapEvent.nevent(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XMapEvent.nwindow(address()); } + /** Returns the value of the {@code override_redirect} field. */ + public int override_redirect() { return XMapEvent.noverride_redirect(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XMapEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XMapEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XMapEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XMapEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code event} field. */ + public Buffer event(@NativeType("Window") long value) { XMapEvent.nevent(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XMapEvent.nwindow(address(), value); return this; } + /** Sets the specified value to the {@code override_redirect} field. */ + public Buffer override_redirect(int value) { XMapEvent.noverride_redirect(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XMapRequestEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XMapRequestEvent.java new file mode 100644 index 00000000..a6a4c272 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XMapRequestEvent.java @@ -0,0 +1,414 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
+ * + *

Layout

+ * + *

+ * struct XMapRequestEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window parent;
+ *     Window window;
+ * }
+ */ +public class XMapRequestEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + PARENT, + WINDOW; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + PARENT = layout.offsetof(4); + WINDOW = layout.offsetof(5); + } + + /** + * Creates a {@code XMapRequestEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XMapRequestEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code parent} field. */ + @NativeType("Window") + public long parent() { return nparent(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XMapRequestEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XMapRequestEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XMapRequestEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XMapRequestEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code parent} field. */ + public XMapRequestEvent parent(@NativeType("Window") long value) { nparent(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XMapRequestEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XMapRequestEvent set( + int type, + long serial, + boolean send_event, + long display, + long parent, + long window + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + parent(parent); + window(window); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XMapRequestEvent set(XMapRequestEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XMapRequestEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XMapRequestEvent malloc() { + return wrap(XMapRequestEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XMapRequestEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XMapRequestEvent calloc() { + return wrap(XMapRequestEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XMapRequestEvent} instance allocated with {@link BufferUtils}. */ + public static XMapRequestEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XMapRequestEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XMapRequestEvent} instance for the specified memory address. */ + public static XMapRequestEvent create(long address) { + return wrap(XMapRequestEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XMapRequestEvent createSafe(long address) { + return address == NULL ? null : wrap(XMapRequestEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XMapRequestEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XMapRequestEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XMapRequestEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XMapRequestEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XMapRequestEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XMapRequestEvent mallocStack(MemoryStack stack) { + return wrap(XMapRequestEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XMapRequestEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XMapRequestEvent callocStack(MemoryStack stack) { + return wrap(XMapRequestEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XMapRequestEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XMapRequestEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XMapRequestEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XMapRequestEvent.DISPLAY); } + /** Unsafe version of {@link #parent}. */ + public static long nparent(long struct) { return memGetCLong(struct + XMapRequestEvent.PARENT); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XMapRequestEvent.WINDOW); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XMapRequestEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XMapRequestEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XMapRequestEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XMapRequestEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #parent(long) parent}. */ + public static void nparent(long struct, long value) { memPutCLong(struct + XMapRequestEvent.PARENT, value); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XMapRequestEvent.WINDOW, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XMapRequestEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XMapRequestEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XMapRequestEvent ELEMENT_FACTORY = XMapRequestEvent.create(-1L); + + /** + * Creates a new {@code XMapRequestEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XMapRequestEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XMapRequestEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XMapRequestEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XMapRequestEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XMapRequestEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XMapRequestEvent.ndisplay(address()); } + /** Returns the value of the {@code parent} field. */ + @NativeType("Window") + public long parent() { return XMapRequestEvent.nparent(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XMapRequestEvent.nwindow(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XMapRequestEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XMapRequestEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XMapRequestEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XMapRequestEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code parent} field. */ + public Buffer parent(@NativeType("Window") long value) { XMapRequestEvent.nparent(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XMapRequestEvent.nwindow(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XMappingEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XMappingEvent.java new file mode 100644 index 00000000..99a224d7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XMappingEvent.java @@ -0,0 +1,452 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code window} – window it reported relative to
  • + *
  • {@code request} – one of:
    {@link X11#MappingModifier}{@link X11#MappingKeyboard}{@link X11#MappingPointer}
  • + *
  • {@code first_keycode} – first keycode
  • + *
  • {@code count} – defines range of change w. {@code first_keycode}
  • + *
+ * + *

Layout

+ * + *

+ * struct XMappingEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window window;
+ *     int request;
+ *     int first_keycode;
+ *     int count;
+ * }
+ */ +public class XMappingEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + WINDOW, + REQUEST, + FIRST_KEYCODE, + COUNT; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + WINDOW = layout.offsetof(4); + REQUEST = layout.offsetof(5); + FIRST_KEYCODE = layout.offsetof(6); + COUNT = layout.offsetof(7); + } + + /** + * Creates a {@code XMappingEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XMappingEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code request} field. */ + public int request() { return nrequest(address()); } + /** Returns the value of the {@code first_keycode} field. */ + public int first_keycode() { return nfirst_keycode(address()); } + /** Returns the value of the {@code count} field. */ + public int count() { return ncount(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XMappingEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XMappingEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XMappingEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XMappingEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XMappingEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Sets the specified value to the {@code request} field. */ + public XMappingEvent request(int value) { nrequest(address(), value); return this; } + /** Sets the specified value to the {@code first_keycode} field. */ + public XMappingEvent first_keycode(int value) { nfirst_keycode(address(), value); return this; } + /** Sets the specified value to the {@code count} field. */ + public XMappingEvent count(int value) { ncount(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XMappingEvent set( + int type, + long serial, + boolean send_event, + long display, + long window, + int request, + int first_keycode, + int count + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + window(window); + request(request); + first_keycode(first_keycode); + count(count); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XMappingEvent set(XMappingEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XMappingEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XMappingEvent malloc() { + return wrap(XMappingEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XMappingEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XMappingEvent calloc() { + return wrap(XMappingEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XMappingEvent} instance allocated with {@link BufferUtils}. */ + public static XMappingEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XMappingEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XMappingEvent} instance for the specified memory address. */ + public static XMappingEvent create(long address) { + return wrap(XMappingEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XMappingEvent createSafe(long address) { + return address == NULL ? null : wrap(XMappingEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XMappingEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XMappingEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XMappingEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XMappingEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XMappingEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XMappingEvent mallocStack(MemoryStack stack) { + return wrap(XMappingEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XMappingEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XMappingEvent callocStack(MemoryStack stack) { + return wrap(XMappingEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XMappingEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XMappingEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XMappingEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XMappingEvent.DISPLAY); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XMappingEvent.WINDOW); } + /** Unsafe version of {@link #request}. */ + public static int nrequest(long struct) { return UNSAFE.getInt(null, struct + XMappingEvent.REQUEST); } + /** Unsafe version of {@link #first_keycode}. */ + public static int nfirst_keycode(long struct) { return UNSAFE.getInt(null, struct + XMappingEvent.FIRST_KEYCODE); } + /** Unsafe version of {@link #count}. */ + public static int ncount(long struct) { return UNSAFE.getInt(null, struct + XMappingEvent.COUNT); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XMappingEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XMappingEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XMappingEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XMappingEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XMappingEvent.WINDOW, value); } + /** Unsafe version of {@link #request(int) request}. */ + public static void nrequest(long struct, int value) { UNSAFE.putInt(null, struct + XMappingEvent.REQUEST, value); } + /** Unsafe version of {@link #first_keycode(int) first_keycode}. */ + public static void nfirst_keycode(long struct, int value) { UNSAFE.putInt(null, struct + XMappingEvent.FIRST_KEYCODE, value); } + /** Unsafe version of {@link #count(int) count}. */ + public static void ncount(long struct, int value) { UNSAFE.putInt(null, struct + XMappingEvent.COUNT, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XMappingEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XMappingEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XMappingEvent ELEMENT_FACTORY = XMappingEvent.create(-1L); + + /** + * Creates a new {@code XMappingEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XMappingEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XMappingEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XMappingEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XMappingEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XMappingEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XMappingEvent.ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XMappingEvent.nwindow(address()); } + /** Returns the value of the {@code request} field. */ + public int request() { return XMappingEvent.nrequest(address()); } + /** Returns the value of the {@code first_keycode} field. */ + public int first_keycode() { return XMappingEvent.nfirst_keycode(address()); } + /** Returns the value of the {@code count} field. */ + public int count() { return XMappingEvent.ncount(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XMappingEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XMappingEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XMappingEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XMappingEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XMappingEvent.nwindow(address(), value); return this; } + /** Sets the specified value to the {@code request} field. */ + public Buffer request(int value) { XMappingEvent.nrequest(address(), value); return this; } + /** Sets the specified value to the {@code first_keycode} field. */ + public Buffer first_keycode(int value) { XMappingEvent.nfirst_keycode(address(), value); return this; } + /** Sets the specified value to the {@code count} field. */ + public Buffer count(int value) { XMappingEvent.ncount(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XMotionEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XMotionEvent.java new file mode 100644 index 00000000..9c175707 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XMotionEvent.java @@ -0,0 +1,600 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Motion event. + * + *

Member documentation

+ * + *
    + *
  • {@code type} – the event type. Must be:
    {@link X11#MotionNotify}
  • + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code window} – window it reported relative to
  • + *
  • {@code root} – root window that the event occurred on
  • + *
  • {@code subwindow} – child window
  • + *
  • {@code time} – milliseconds
  • + *
  • {@code x} – pointer x coordinate in event window
  • + *
  • {@code y} – pointer y coordinate in event window
  • + *
  • {@code x_root} – x coordinate relative to {@code root}
  • + *
  • {@code y_root} – y coordinate relative to {@code root}
  • + *
  • {@code state} – key or button mask
  • + *
  • {@code is_hint} – detail
  • + *
  • {@code same_screen} – same screen flag
  • + *
+ * + *

Layout

+ * + *

+ * struct XMotionEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window window;
+ *     Window root;
+ *     Window subwindow;
+ *     Time time;
+ *     int x;
+ *     int y;
+ *     int x_root;
+ *     int y_root;
+ *     unsigned int state;
+ *     char is_hint;
+ *     Bool same_screen;
+ * }
+ */ +public class XMotionEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + WINDOW, + ROOT, + SUBWINDOW, + TIME, + X, + Y, + X_ROOT, + Y_ROOT, + STATE, + IS_HINT, + SAME_SCREEN; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(1), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + WINDOW = layout.offsetof(4); + ROOT = layout.offsetof(5); + SUBWINDOW = layout.offsetof(6); + TIME = layout.offsetof(7); + X = layout.offsetof(8); + Y = layout.offsetof(9); + X_ROOT = layout.offsetof(10); + Y_ROOT = layout.offsetof(11); + STATE = layout.offsetof(12); + IS_HINT = layout.offsetof(13); + SAME_SCREEN = layout.offsetof(14); + } + + /** + * Creates a {@code XMotionEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XMotionEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code root} field. */ + @NativeType("Window") + public long root() { return nroot(address()); } + /** Returns the value of the {@code subwindow} field. */ + @NativeType("Window") + public long subwindow() { return nsubwindow(address()); } + /** Returns the value of the {@code time} field. */ + @NativeType("Time") + public long time() { return ntime(address()); } + /** Returns the value of the {@code x} field. */ + public int x() { return nx(address()); } + /** Returns the value of the {@code y} field. */ + public int y() { return ny(address()); } + /** Returns the value of the {@code x_root} field. */ + public int x_root() { return nx_root(address()); } + /** Returns the value of the {@code y_root} field. */ + public int y_root() { return ny_root(address()); } + /** Returns the value of the {@code state} field. */ + @NativeType("unsigned int") + public int state() { return nstate(address()); } + /** Returns the value of the {@code is_hint} field. */ + @NativeType("char") + public byte is_hint() { return nis_hint(address()); } + /** Returns the value of the {@code same_screen} field. */ + @NativeType("Bool") + public boolean same_screen() { return nsame_screen(address()) != 0; } + + /** Sets the specified value to the {@code type} field. */ + public XMotionEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XMotionEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XMotionEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XMotionEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XMotionEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Sets the specified value to the {@code root} field. */ + public XMotionEvent root(@NativeType("Window") long value) { nroot(address(), value); return this; } + /** Sets the specified value to the {@code subwindow} field. */ + public XMotionEvent subwindow(@NativeType("Window") long value) { nsubwindow(address(), value); return this; } + /** Sets the specified value to the {@code time} field. */ + public XMotionEvent time(@NativeType("Time") long value) { ntime(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public XMotionEvent x(int value) { nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public XMotionEvent y(int value) { ny(address(), value); return this; } + /** Sets the specified value to the {@code x_root} field. */ + public XMotionEvent x_root(int value) { nx_root(address(), value); return this; } + /** Sets the specified value to the {@code y_root} field. */ + public XMotionEvent y_root(int value) { ny_root(address(), value); return this; } + /** Sets the specified value to the {@code state} field. */ + public XMotionEvent state(@NativeType("unsigned int") int value) { nstate(address(), value); return this; } + /** Sets the specified value to the {@code is_hint} field. */ + public XMotionEvent is_hint(@NativeType("char") byte value) { nis_hint(address(), value); return this; } + /** Sets the specified value to the {@code same_screen} field. */ + public XMotionEvent same_screen(@NativeType("Bool") boolean value) { nsame_screen(address(), value ? 1 : 0); return this; } + + /** Initializes this struct with the specified values. */ + public XMotionEvent set( + int type, + long serial, + boolean send_event, + long display, + long window, + long root, + long subwindow, + long time, + int x, + int y, + int x_root, + int y_root, + int state, + byte is_hint, + boolean same_screen + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + window(window); + root(root); + subwindow(subwindow); + time(time); + x(x); + y(y); + x_root(x_root); + y_root(y_root); + state(state); + is_hint(is_hint); + same_screen(same_screen); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XMotionEvent set(XMotionEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XMotionEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XMotionEvent malloc() { + return wrap(XMotionEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XMotionEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XMotionEvent calloc() { + return wrap(XMotionEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XMotionEvent} instance allocated with {@link BufferUtils}. */ + public static XMotionEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XMotionEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XMotionEvent} instance for the specified memory address. */ + public static XMotionEvent create(long address) { + return wrap(XMotionEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XMotionEvent createSafe(long address) { + return address == NULL ? null : wrap(XMotionEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XMotionEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XMotionEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XMotionEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XMotionEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XMotionEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XMotionEvent mallocStack(MemoryStack stack) { + return wrap(XMotionEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XMotionEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XMotionEvent callocStack(MemoryStack stack) { + return wrap(XMotionEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XMotionEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XMotionEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XMotionEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XMotionEvent.DISPLAY); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XMotionEvent.WINDOW); } + /** Unsafe version of {@link #root}. */ + public static long nroot(long struct) { return memGetCLong(struct + XMotionEvent.ROOT); } + /** Unsafe version of {@link #subwindow}. */ + public static long nsubwindow(long struct) { return memGetCLong(struct + XMotionEvent.SUBWINDOW); } + /** Unsafe version of {@link #time}. */ + public static long ntime(long struct) { return memGetCLong(struct + XMotionEvent.TIME); } + /** Unsafe version of {@link #x}. */ + public static int nx(long struct) { return UNSAFE.getInt(null, struct + XMotionEvent.X); } + /** Unsafe version of {@link #y}. */ + public static int ny(long struct) { return UNSAFE.getInt(null, struct + XMotionEvent.Y); } + /** Unsafe version of {@link #x_root}. */ + public static int nx_root(long struct) { return UNSAFE.getInt(null, struct + XMotionEvent.X_ROOT); } + /** Unsafe version of {@link #y_root}. */ + public static int ny_root(long struct) { return UNSAFE.getInt(null, struct + XMotionEvent.Y_ROOT); } + /** Unsafe version of {@link #state}. */ + public static int nstate(long struct) { return UNSAFE.getInt(null, struct + XMotionEvent.STATE); } + /** Unsafe version of {@link #is_hint}. */ + public static byte nis_hint(long struct) { return UNSAFE.getByte(null, struct + XMotionEvent.IS_HINT); } + /** Unsafe version of {@link #same_screen}. */ + public static int nsame_screen(long struct) { return UNSAFE.getInt(null, struct + XMotionEvent.SAME_SCREEN); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XMotionEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XMotionEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XMotionEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XMotionEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XMotionEvent.WINDOW, value); } + /** Unsafe version of {@link #root(long) root}. */ + public static void nroot(long struct, long value) { memPutCLong(struct + XMotionEvent.ROOT, value); } + /** Unsafe version of {@link #subwindow(long) subwindow}. */ + public static void nsubwindow(long struct, long value) { memPutCLong(struct + XMotionEvent.SUBWINDOW, value); } + /** Unsafe version of {@link #time(long) time}. */ + public static void ntime(long struct, long value) { memPutCLong(struct + XMotionEvent.TIME, value); } + /** Unsafe version of {@link #x(int) x}. */ + public static void nx(long struct, int value) { UNSAFE.putInt(null, struct + XMotionEvent.X, value); } + /** Unsafe version of {@link #y(int) y}. */ + public static void ny(long struct, int value) { UNSAFE.putInt(null, struct + XMotionEvent.Y, value); } + /** Unsafe version of {@link #x_root(int) x_root}. */ + public static void nx_root(long struct, int value) { UNSAFE.putInt(null, struct + XMotionEvent.X_ROOT, value); } + /** Unsafe version of {@link #y_root(int) y_root}. */ + public static void ny_root(long struct, int value) { UNSAFE.putInt(null, struct + XMotionEvent.Y_ROOT, value); } + /** Unsafe version of {@link #state(int) state}. */ + public static void nstate(long struct, int value) { UNSAFE.putInt(null, struct + XMotionEvent.STATE, value); } + /** Unsafe version of {@link #is_hint(byte) is_hint}. */ + public static void nis_hint(long struct, byte value) { UNSAFE.putByte(null, struct + XMotionEvent.IS_HINT, value); } + /** Unsafe version of {@link #same_screen(boolean) same_screen}. */ + public static void nsame_screen(long struct, int value) { UNSAFE.putInt(null, struct + XMotionEvent.SAME_SCREEN, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XMotionEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XMotionEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XMotionEvent ELEMENT_FACTORY = XMotionEvent.create(-1L); + + /** + * Creates a new {@code XMotionEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XMotionEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XMotionEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XMotionEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XMotionEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XMotionEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XMotionEvent.ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XMotionEvent.nwindow(address()); } + /** Returns the value of the {@code root} field. */ + @NativeType("Window") + public long root() { return XMotionEvent.nroot(address()); } + /** Returns the value of the {@code subwindow} field. */ + @NativeType("Window") + public long subwindow() { return XMotionEvent.nsubwindow(address()); } + /** Returns the value of the {@code time} field. */ + @NativeType("Time") + public long time() { return XMotionEvent.ntime(address()); } + /** Returns the value of the {@code x} field. */ + public int x() { return XMotionEvent.nx(address()); } + /** Returns the value of the {@code y} field. */ + public int y() { return XMotionEvent.ny(address()); } + /** Returns the value of the {@code x_root} field. */ + public int x_root() { return XMotionEvent.nx_root(address()); } + /** Returns the value of the {@code y_root} field. */ + public int y_root() { return XMotionEvent.ny_root(address()); } + /** Returns the value of the {@code state} field. */ + @NativeType("unsigned int") + public int state() { return XMotionEvent.nstate(address()); } + /** Returns the value of the {@code is_hint} field. */ + @NativeType("char") + public byte is_hint() { return XMotionEvent.nis_hint(address()); } + /** Returns the value of the {@code same_screen} field. */ + @NativeType("Bool") + public boolean same_screen() { return XMotionEvent.nsame_screen(address()) != 0; } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XMotionEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XMotionEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XMotionEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XMotionEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XMotionEvent.nwindow(address(), value); return this; } + /** Sets the specified value to the {@code root} field. */ + public Buffer root(@NativeType("Window") long value) { XMotionEvent.nroot(address(), value); return this; } + /** Sets the specified value to the {@code subwindow} field. */ + public Buffer subwindow(@NativeType("Window") long value) { XMotionEvent.nsubwindow(address(), value); return this; } + /** Sets the specified value to the {@code time} field. */ + public Buffer time(@NativeType("Time") long value) { XMotionEvent.ntime(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public Buffer x(int value) { XMotionEvent.nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public Buffer y(int value) { XMotionEvent.ny(address(), value); return this; } + /** Sets the specified value to the {@code x_root} field. */ + public Buffer x_root(int value) { XMotionEvent.nx_root(address(), value); return this; } + /** Sets the specified value to the {@code y_root} field. */ + public Buffer y_root(int value) { XMotionEvent.ny_root(address(), value); return this; } + /** Sets the specified value to the {@code state} field. */ + public Buffer state(@NativeType("unsigned int") int value) { XMotionEvent.nstate(address(), value); return this; } + /** Sets the specified value to the {@code is_hint} field. */ + public Buffer is_hint(@NativeType("char") byte value) { XMotionEvent.nis_hint(address(), value); return this; } + /** Sets the specified value to the {@code same_screen} field. */ + public Buffer same_screen(@NativeType("Bool") boolean value) { XMotionEvent.nsame_screen(address(), value ? 1 : 0); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XNoExposeEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XNoExposeEvent.java new file mode 100644 index 00000000..e8050a16 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XNoExposeEvent.java @@ -0,0 +1,432 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code major_code} – core is {@code CopyArea} or {@code CopyPlane}
  • + *
  • {@code minor_code} – not defined in the core
  • + *
+ * + *

Layout

+ * + *

+ * struct XNoExposeEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Drawable drawable;
+ *     int major_code;
+ *     int minor_code;
+ * }
+ */ +public class XNoExposeEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + DRAWABLE, + MAJOR_CODE, + MINOR_CODE; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + DRAWABLE = layout.offsetof(4); + MAJOR_CODE = layout.offsetof(5); + MINOR_CODE = layout.offsetof(6); + } + + /** + * Creates a {@code XNoExposeEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XNoExposeEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code drawable} field. */ + @NativeType("Drawable") + public long drawable() { return ndrawable(address()); } + /** Returns the value of the {@code major_code} field. */ + public int major_code() { return nmajor_code(address()); } + /** Returns the value of the {@code minor_code} field. */ + public int minor_code() { return nminor_code(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XNoExposeEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XNoExposeEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XNoExposeEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XNoExposeEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code drawable} field. */ + public XNoExposeEvent drawable(@NativeType("Drawable") long value) { ndrawable(address(), value); return this; } + /** Sets the specified value to the {@code major_code} field. */ + public XNoExposeEvent major_code(int value) { nmajor_code(address(), value); return this; } + /** Sets the specified value to the {@code minor_code} field. */ + public XNoExposeEvent minor_code(int value) { nminor_code(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XNoExposeEvent set( + int type, + long serial, + boolean send_event, + long display, + long drawable, + int major_code, + int minor_code + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + drawable(drawable); + major_code(major_code); + minor_code(minor_code); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XNoExposeEvent set(XNoExposeEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XNoExposeEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XNoExposeEvent malloc() { + return wrap(XNoExposeEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XNoExposeEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XNoExposeEvent calloc() { + return wrap(XNoExposeEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XNoExposeEvent} instance allocated with {@link BufferUtils}. */ + public static XNoExposeEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XNoExposeEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XNoExposeEvent} instance for the specified memory address. */ + public static XNoExposeEvent create(long address) { + return wrap(XNoExposeEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XNoExposeEvent createSafe(long address) { + return address == NULL ? null : wrap(XNoExposeEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XNoExposeEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XNoExposeEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XNoExposeEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XNoExposeEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XNoExposeEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XNoExposeEvent mallocStack(MemoryStack stack) { + return wrap(XNoExposeEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XNoExposeEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XNoExposeEvent callocStack(MemoryStack stack) { + return wrap(XNoExposeEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XNoExposeEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XNoExposeEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XNoExposeEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XNoExposeEvent.DISPLAY); } + /** Unsafe version of {@link #drawable}. */ + public static long ndrawable(long struct) { return memGetCLong(struct + XNoExposeEvent.DRAWABLE); } + /** Unsafe version of {@link #major_code}. */ + public static int nmajor_code(long struct) { return UNSAFE.getInt(null, struct + XNoExposeEvent.MAJOR_CODE); } + /** Unsafe version of {@link #minor_code}. */ + public static int nminor_code(long struct) { return UNSAFE.getInt(null, struct + XNoExposeEvent.MINOR_CODE); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XNoExposeEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XNoExposeEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XNoExposeEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XNoExposeEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #drawable(long) drawable}. */ + public static void ndrawable(long struct, long value) { memPutCLong(struct + XNoExposeEvent.DRAWABLE, value); } + /** Unsafe version of {@link #major_code(int) major_code}. */ + public static void nmajor_code(long struct, int value) { UNSAFE.putInt(null, struct + XNoExposeEvent.MAJOR_CODE, value); } + /** Unsafe version of {@link #minor_code(int) minor_code}. */ + public static void nminor_code(long struct, int value) { UNSAFE.putInt(null, struct + XNoExposeEvent.MINOR_CODE, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XNoExposeEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XNoExposeEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XNoExposeEvent ELEMENT_FACTORY = XNoExposeEvent.create(-1L); + + /** + * Creates a new {@code XNoExposeEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XNoExposeEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XNoExposeEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XNoExposeEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XNoExposeEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XNoExposeEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XNoExposeEvent.ndisplay(address()); } + /** Returns the value of the {@code drawable} field. */ + @NativeType("Drawable") + public long drawable() { return XNoExposeEvent.ndrawable(address()); } + /** Returns the value of the {@code major_code} field. */ + public int major_code() { return XNoExposeEvent.nmajor_code(address()); } + /** Returns the value of the {@code minor_code} field. */ + public int minor_code() { return XNoExposeEvent.nminor_code(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XNoExposeEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XNoExposeEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XNoExposeEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XNoExposeEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code drawable} field. */ + public Buffer drawable(@NativeType("Drawable") long value) { XNoExposeEvent.ndrawable(address(), value); return this; } + /** Sets the specified value to the {@code major_code} field. */ + public Buffer major_code(int value) { XNoExposeEvent.nmajor_code(address(), value); return this; } + /** Sets the specified value to the {@code minor_code} field. */ + public Buffer minor_code(int value) { XNoExposeEvent.nminor_code(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XPropertyEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XPropertyEvent.java new file mode 100644 index 00000000..1b455437 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XPropertyEvent.java @@ -0,0 +1,456 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Property event. + * + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code window} – window it reported relative to
  • + *
  • {@code state} – one of:
    {@link X11#PropertyNewValue}{@link X11#PropertyDelete}
  • + *
+ * + *

Layout

+ * + *

+ * struct XPropertyEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window window;
+ *     Atom atom;
+ *     Time time;
+ *     int state;
+ * }
+ */ +public class XPropertyEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + WINDOW, + ATOM, + TIME, + STATE; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + WINDOW = layout.offsetof(4); + ATOM = layout.offsetof(5); + TIME = layout.offsetof(6); + STATE = layout.offsetof(7); + } + + /** + * Creates a {@code XPropertyEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XPropertyEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code atom} field. */ + @NativeType("Atom") + public long atom() { return natom(address()); } + /** Returns the value of the {@code time} field. */ + @NativeType("Time") + public long time() { return ntime(address()); } + /** Returns the value of the {@code state} field. */ + public int state() { return nstate(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XPropertyEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XPropertyEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XPropertyEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XPropertyEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XPropertyEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Sets the specified value to the {@code atom} field. */ + public XPropertyEvent atom(@NativeType("Atom") long value) { natom(address(), value); return this; } + /** Sets the specified value to the {@code time} field. */ + public XPropertyEvent time(@NativeType("Time") long value) { ntime(address(), value); return this; } + /** Sets the specified value to the {@code state} field. */ + public XPropertyEvent state(int value) { nstate(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XPropertyEvent set( + int type, + long serial, + boolean send_event, + long display, + long window, + long atom, + long time, + int state + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + window(window); + atom(atom); + time(time); + state(state); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XPropertyEvent set(XPropertyEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XPropertyEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XPropertyEvent malloc() { + return wrap(XPropertyEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XPropertyEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XPropertyEvent calloc() { + return wrap(XPropertyEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XPropertyEvent} instance allocated with {@link BufferUtils}. */ + public static XPropertyEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XPropertyEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XPropertyEvent} instance for the specified memory address. */ + public static XPropertyEvent create(long address) { + return wrap(XPropertyEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XPropertyEvent createSafe(long address) { + return address == NULL ? null : wrap(XPropertyEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XPropertyEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XPropertyEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XPropertyEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XPropertyEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XPropertyEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XPropertyEvent mallocStack(MemoryStack stack) { + return wrap(XPropertyEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XPropertyEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XPropertyEvent callocStack(MemoryStack stack) { + return wrap(XPropertyEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XPropertyEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XPropertyEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XPropertyEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XPropertyEvent.DISPLAY); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XPropertyEvent.WINDOW); } + /** Unsafe version of {@link #atom}. */ + public static long natom(long struct) { return memGetCLong(struct + XPropertyEvent.ATOM); } + /** Unsafe version of {@link #time}. */ + public static long ntime(long struct) { return memGetCLong(struct + XPropertyEvent.TIME); } + /** Unsafe version of {@link #state}. */ + public static int nstate(long struct) { return UNSAFE.getInt(null, struct + XPropertyEvent.STATE); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XPropertyEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XPropertyEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XPropertyEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XPropertyEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XPropertyEvent.WINDOW, value); } + /** Unsafe version of {@link #atom(long) atom}. */ + public static void natom(long struct, long value) { memPutCLong(struct + XPropertyEvent.ATOM, value); } + /** Unsafe version of {@link #time(long) time}. */ + public static void ntime(long struct, long value) { memPutCLong(struct + XPropertyEvent.TIME, value); } + /** Unsafe version of {@link #state(int) state}. */ + public static void nstate(long struct, int value) { UNSAFE.putInt(null, struct + XPropertyEvent.STATE, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XPropertyEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XPropertyEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XPropertyEvent ELEMENT_FACTORY = XPropertyEvent.create(-1L); + + /** + * Creates a new {@code XPropertyEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XPropertyEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XPropertyEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XPropertyEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XPropertyEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XPropertyEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XPropertyEvent.ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XPropertyEvent.nwindow(address()); } + /** Returns the value of the {@code atom} field. */ + @NativeType("Atom") + public long atom() { return XPropertyEvent.natom(address()); } + /** Returns the value of the {@code time} field. */ + @NativeType("Time") + public long time() { return XPropertyEvent.ntime(address()); } + /** Returns the value of the {@code state} field. */ + public int state() { return XPropertyEvent.nstate(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XPropertyEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XPropertyEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XPropertyEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XPropertyEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XPropertyEvent.nwindow(address(), value); return this; } + /** Sets the specified value to the {@code atom} field. */ + public Buffer atom(@NativeType("Atom") long value) { XPropertyEvent.natom(address(), value); return this; } + /** Sets the specified value to the {@code time} field. */ + public Buffer time(@NativeType("Time") long value) { XPropertyEvent.ntime(address(), value); return this; } + /** Sets the specified value to the {@code state} field. */ + public Buffer state(int value) { XPropertyEvent.nstate(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XReparentEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XReparentEvent.java new file mode 100644 index 00000000..73658de5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XReparentEvent.java @@ -0,0 +1,488 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
+ * + *

Layout

+ * + *

+ * struct XReparentEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window event;
+ *     Window window;
+ *     Window parent;
+ *     int x;
+ *     int y;
+ *     int override_redirect;
+ * }
+ */ +public class XReparentEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + EVENT, + WINDOW, + PARENT, + X, + Y, + OVERRIDE_REDIRECT; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + EVENT = layout.offsetof(4); + WINDOW = layout.offsetof(5); + PARENT = layout.offsetof(6); + X = layout.offsetof(7); + Y = layout.offsetof(8); + OVERRIDE_REDIRECT = layout.offsetof(9); + } + + /** + * Creates a {@code XReparentEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XReparentEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code event} field. */ + @NativeType("Window") + public long event() { return nevent(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code parent} field. */ + @NativeType("Window") + public long parent() { return nparent(address()); } + /** Returns the value of the {@code x} field. */ + public int x() { return nx(address()); } + /** Returns the value of the {@code y} field. */ + public int y() { return ny(address()); } + /** Returns the value of the {@code override_redirect} field. */ + public int override_redirect() { return noverride_redirect(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XReparentEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XReparentEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XReparentEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XReparentEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code event} field. */ + public XReparentEvent event(@NativeType("Window") long value) { nevent(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XReparentEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Sets the specified value to the {@code parent} field. */ + public XReparentEvent parent(@NativeType("Window") long value) { nparent(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public XReparentEvent x(int value) { nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public XReparentEvent y(int value) { ny(address(), value); return this; } + /** Sets the specified value to the {@code override_redirect} field. */ + public XReparentEvent override_redirect(int value) { noverride_redirect(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XReparentEvent set( + int type, + long serial, + boolean send_event, + long display, + long event, + long window, + long parent, + int x, + int y, + int override_redirect + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + event(event); + window(window); + parent(parent); + x(x); + y(y); + override_redirect(override_redirect); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XReparentEvent set(XReparentEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XReparentEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XReparentEvent malloc() { + return wrap(XReparentEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XReparentEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XReparentEvent calloc() { + return wrap(XReparentEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XReparentEvent} instance allocated with {@link BufferUtils}. */ + public static XReparentEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XReparentEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XReparentEvent} instance for the specified memory address. */ + public static XReparentEvent create(long address) { + return wrap(XReparentEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XReparentEvent createSafe(long address) { + return address == NULL ? null : wrap(XReparentEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XReparentEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XReparentEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XReparentEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XReparentEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XReparentEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XReparentEvent mallocStack(MemoryStack stack) { + return wrap(XReparentEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XReparentEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XReparentEvent callocStack(MemoryStack stack) { + return wrap(XReparentEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XReparentEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XReparentEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XReparentEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XReparentEvent.DISPLAY); } + /** Unsafe version of {@link #event}. */ + public static long nevent(long struct) { return memGetCLong(struct + XReparentEvent.EVENT); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XReparentEvent.WINDOW); } + /** Unsafe version of {@link #parent}. */ + public static long nparent(long struct) { return memGetCLong(struct + XReparentEvent.PARENT); } + /** Unsafe version of {@link #x}. */ + public static int nx(long struct) { return UNSAFE.getInt(null, struct + XReparentEvent.X); } + /** Unsafe version of {@link #y}. */ + public static int ny(long struct) { return UNSAFE.getInt(null, struct + XReparentEvent.Y); } + /** Unsafe version of {@link #override_redirect}. */ + public static int noverride_redirect(long struct) { return UNSAFE.getInt(null, struct + XReparentEvent.OVERRIDE_REDIRECT); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XReparentEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XReparentEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XReparentEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XReparentEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #event(long) event}. */ + public static void nevent(long struct, long value) { memPutCLong(struct + XReparentEvent.EVENT, value); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XReparentEvent.WINDOW, value); } + /** Unsafe version of {@link #parent(long) parent}. */ + public static void nparent(long struct, long value) { memPutCLong(struct + XReparentEvent.PARENT, value); } + /** Unsafe version of {@link #x(int) x}. */ + public static void nx(long struct, int value) { UNSAFE.putInt(null, struct + XReparentEvent.X, value); } + /** Unsafe version of {@link #y(int) y}. */ + public static void ny(long struct, int value) { UNSAFE.putInt(null, struct + XReparentEvent.Y, value); } + /** Unsafe version of {@link #override_redirect(int) override_redirect}. */ + public static void noverride_redirect(long struct, int value) { UNSAFE.putInt(null, struct + XReparentEvent.OVERRIDE_REDIRECT, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XReparentEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XReparentEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XReparentEvent ELEMENT_FACTORY = XReparentEvent.create(-1L); + + /** + * Creates a new {@code XReparentEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XReparentEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XReparentEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XReparentEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XReparentEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XReparentEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XReparentEvent.ndisplay(address()); } + /** Returns the value of the {@code event} field. */ + @NativeType("Window") + public long event() { return XReparentEvent.nevent(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XReparentEvent.nwindow(address()); } + /** Returns the value of the {@code parent} field. */ + @NativeType("Window") + public long parent() { return XReparentEvent.nparent(address()); } + /** Returns the value of the {@code x} field. */ + public int x() { return XReparentEvent.nx(address()); } + /** Returns the value of the {@code y} field. */ + public int y() { return XReparentEvent.ny(address()); } + /** Returns the value of the {@code override_redirect} field. */ + public int override_redirect() { return XReparentEvent.noverride_redirect(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XReparentEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XReparentEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XReparentEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XReparentEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code event} field. */ + public Buffer event(@NativeType("Window") long value) { XReparentEvent.nevent(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XReparentEvent.nwindow(address(), value); return this; } + /** Sets the specified value to the {@code parent} field. */ + public Buffer parent(@NativeType("Window") long value) { XReparentEvent.nparent(address(), value); return this; } + /** Sets the specified value to the {@code x} field. */ + public Buffer x(int value) { XReparentEvent.nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public Buffer y(int value) { XReparentEvent.ny(address(), value); return this; } + /** Sets the specified value to the {@code override_redirect} field. */ + public Buffer override_redirect(int value) { XReparentEvent.noverride_redirect(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XResizeRequestEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XResizeRequestEvent.java new file mode 100644 index 00000000..2b0f80a9 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XResizeRequestEvent.java @@ -0,0 +1,431 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code window} – window it reported relative to
  • + *
+ * + *

Layout

+ * + *

+ * struct XResizeRequestEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window window;
+ *     int width;
+ *     int height;
+ * }
+ */ +public class XResizeRequestEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + WINDOW, + WIDTH, + HEIGHT; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + WINDOW = layout.offsetof(4); + WIDTH = layout.offsetof(5); + HEIGHT = layout.offsetof(6); + } + + /** + * Creates a {@code XResizeRequestEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XResizeRequestEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code width} field. */ + public int width() { return nwidth(address()); } + /** Returns the value of the {@code height} field. */ + public int height() { return nheight(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XResizeRequestEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XResizeRequestEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XResizeRequestEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XResizeRequestEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XResizeRequestEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Sets the specified value to the {@code width} field. */ + public XResizeRequestEvent width(int value) { nwidth(address(), value); return this; } + /** Sets the specified value to the {@code height} field. */ + public XResizeRequestEvent height(int value) { nheight(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XResizeRequestEvent set( + int type, + long serial, + boolean send_event, + long display, + long window, + int width, + int height + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + window(window); + width(width); + height(height); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XResizeRequestEvent set(XResizeRequestEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XResizeRequestEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XResizeRequestEvent malloc() { + return wrap(XResizeRequestEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XResizeRequestEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XResizeRequestEvent calloc() { + return wrap(XResizeRequestEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XResizeRequestEvent} instance allocated with {@link BufferUtils}. */ + public static XResizeRequestEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XResizeRequestEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XResizeRequestEvent} instance for the specified memory address. */ + public static XResizeRequestEvent create(long address) { + return wrap(XResizeRequestEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XResizeRequestEvent createSafe(long address) { + return address == NULL ? null : wrap(XResizeRequestEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XResizeRequestEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XResizeRequestEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XResizeRequestEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XResizeRequestEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XResizeRequestEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XResizeRequestEvent mallocStack(MemoryStack stack) { + return wrap(XResizeRequestEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XResizeRequestEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XResizeRequestEvent callocStack(MemoryStack stack) { + return wrap(XResizeRequestEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XResizeRequestEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XResizeRequestEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XResizeRequestEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XResizeRequestEvent.DISPLAY); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XResizeRequestEvent.WINDOW); } + /** Unsafe version of {@link #width}. */ + public static int nwidth(long struct) { return UNSAFE.getInt(null, struct + XResizeRequestEvent.WIDTH); } + /** Unsafe version of {@link #height}. */ + public static int nheight(long struct) { return UNSAFE.getInt(null, struct + XResizeRequestEvent.HEIGHT); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XResizeRequestEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XResizeRequestEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XResizeRequestEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XResizeRequestEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XResizeRequestEvent.WINDOW, value); } + /** Unsafe version of {@link #width(int) width}. */ + public static void nwidth(long struct, int value) { UNSAFE.putInt(null, struct + XResizeRequestEvent.WIDTH, value); } + /** Unsafe version of {@link #height(int) height}. */ + public static void nheight(long struct, int value) { UNSAFE.putInt(null, struct + XResizeRequestEvent.HEIGHT, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XResizeRequestEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XResizeRequestEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XResizeRequestEvent ELEMENT_FACTORY = XResizeRequestEvent.create(-1L); + + /** + * Creates a new {@code XResizeRequestEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XResizeRequestEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XResizeRequestEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XResizeRequestEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XResizeRequestEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XResizeRequestEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XResizeRequestEvent.ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XResizeRequestEvent.nwindow(address()); } + /** Returns the value of the {@code width} field. */ + public int width() { return XResizeRequestEvent.nwidth(address()); } + /** Returns the value of the {@code height} field. */ + public int height() { return XResizeRequestEvent.nheight(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XResizeRequestEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XResizeRequestEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XResizeRequestEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XResizeRequestEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XResizeRequestEvent.nwindow(address(), value); return this; } + /** Sets the specified value to the {@code width} field. */ + public Buffer width(int value) { XResizeRequestEvent.nwidth(address(), value); return this; } + /** Sets the specified value to the {@code height} field. */ + public Buffer height(int value) { XResizeRequestEvent.nheight(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XSelectionClearEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XSelectionClearEvent.java new file mode 100644 index 00000000..613e61a1 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XSelectionClearEvent.java @@ -0,0 +1,435 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code window} – window it reported relative to
  • + *
+ * + *

Layout

+ * + *

+ * struct XSelectionClearEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window window;
+ *     Atom selection;
+ *     Time time;
+ * }
+ */ +public class XSelectionClearEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + WINDOW, + SELECTION, + TIME; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + WINDOW = layout.offsetof(4); + SELECTION = layout.offsetof(5); + TIME = layout.offsetof(6); + } + + /** + * Creates a {@code XSelectionClearEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XSelectionClearEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code selection} field. */ + @NativeType("Atom") + public long selection() { return nselection(address()); } + /** Returns the value of the {@code time} field. */ + @NativeType("Time") + public long time() { return ntime(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XSelectionClearEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XSelectionClearEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XSelectionClearEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XSelectionClearEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XSelectionClearEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Sets the specified value to the {@code selection} field. */ + public XSelectionClearEvent selection(@NativeType("Atom") long value) { nselection(address(), value); return this; } + /** Sets the specified value to the {@code time} field. */ + public XSelectionClearEvent time(@NativeType("Time") long value) { ntime(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XSelectionClearEvent set( + int type, + long serial, + boolean send_event, + long display, + long window, + long selection, + long time + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + window(window); + selection(selection); + time(time); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XSelectionClearEvent set(XSelectionClearEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XSelectionClearEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XSelectionClearEvent malloc() { + return wrap(XSelectionClearEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XSelectionClearEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XSelectionClearEvent calloc() { + return wrap(XSelectionClearEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XSelectionClearEvent} instance allocated with {@link BufferUtils}. */ + public static XSelectionClearEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XSelectionClearEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XSelectionClearEvent} instance for the specified memory address. */ + public static XSelectionClearEvent create(long address) { + return wrap(XSelectionClearEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XSelectionClearEvent createSafe(long address) { + return address == NULL ? null : wrap(XSelectionClearEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XSelectionClearEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XSelectionClearEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XSelectionClearEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XSelectionClearEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XSelectionClearEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XSelectionClearEvent mallocStack(MemoryStack stack) { + return wrap(XSelectionClearEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XSelectionClearEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XSelectionClearEvent callocStack(MemoryStack stack) { + return wrap(XSelectionClearEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XSelectionClearEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XSelectionClearEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XSelectionClearEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XSelectionClearEvent.DISPLAY); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XSelectionClearEvent.WINDOW); } + /** Unsafe version of {@link #selection}. */ + public static long nselection(long struct) { return memGetCLong(struct + XSelectionClearEvent.SELECTION); } + /** Unsafe version of {@link #time}. */ + public static long ntime(long struct) { return memGetCLong(struct + XSelectionClearEvent.TIME); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XSelectionClearEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XSelectionClearEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XSelectionClearEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XSelectionClearEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XSelectionClearEvent.WINDOW, value); } + /** Unsafe version of {@link #selection(long) selection}. */ + public static void nselection(long struct, long value) { memPutCLong(struct + XSelectionClearEvent.SELECTION, value); } + /** Unsafe version of {@link #time(long) time}. */ + public static void ntime(long struct, long value) { memPutCLong(struct + XSelectionClearEvent.TIME, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XSelectionClearEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XSelectionClearEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XSelectionClearEvent ELEMENT_FACTORY = XSelectionClearEvent.create(-1L); + + /** + * Creates a new {@code XSelectionClearEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XSelectionClearEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XSelectionClearEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XSelectionClearEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XSelectionClearEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XSelectionClearEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XSelectionClearEvent.ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XSelectionClearEvent.nwindow(address()); } + /** Returns the value of the {@code selection} field. */ + @NativeType("Atom") + public long selection() { return XSelectionClearEvent.nselection(address()); } + /** Returns the value of the {@code time} field. */ + @NativeType("Time") + public long time() { return XSelectionClearEvent.ntime(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XSelectionClearEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XSelectionClearEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XSelectionClearEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XSelectionClearEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XSelectionClearEvent.nwindow(address(), value); return this; } + /** Sets the specified value to the {@code selection} field. */ + public Buffer selection(@NativeType("Atom") long value) { XSelectionClearEvent.nselection(address(), value); return this; } + /** Sets the specified value to the {@code time} field. */ + public Buffer time(@NativeType("Time") long value) { XSelectionClearEvent.ntime(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XSelectionEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XSelectionEvent.java new file mode 100644 index 00000000..d1f252f5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XSelectionEvent.java @@ -0,0 +1,477 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Selection event structure. + * + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code property} – atom or {@link X11#None}
  • + *
+ * + *

Layout

+ * + *

+ * struct XSelectionEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window requestor;
+ *     Atom selection;
+ *     Atom target;
+ *     Atom property;
+ *     Time time;
+ * }
+ */ +public class XSelectionEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + REQUESTOR, + SELECTION, + TARGET, + PROPERTY, + TIME; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + REQUESTOR = layout.offsetof(4); + SELECTION = layout.offsetof(5); + TARGET = layout.offsetof(6); + PROPERTY = layout.offsetof(7); + TIME = layout.offsetof(8); + } + + /** + * Creates a {@code XSelectionEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XSelectionEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code requestor} field. */ + @NativeType("Window") + public long requestor() { return nrequestor(address()); } + /** Returns the value of the {@code selection} field. */ + @NativeType("Atom") + public long selection() { return nselection(address()); } + /** Returns the value of the {@code target} field. */ + @NativeType("Atom") + public long target() { return ntarget(address()); } + /** Returns the value of the {@code property} field. */ + @NativeType("Atom") + public long property() { return nproperty(address()); } + /** Returns the value of the {@code time} field. */ + @NativeType("Time") + public long time() { return ntime(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XSelectionEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XSelectionEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XSelectionEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XSelectionEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code requestor} field. */ + public XSelectionEvent requestor(@NativeType("Window") long value) { nrequestor(address(), value); return this; } + /** Sets the specified value to the {@code selection} field. */ + public XSelectionEvent selection(@NativeType("Atom") long value) { nselection(address(), value); return this; } + /** Sets the specified value to the {@code target} field. */ + public XSelectionEvent target(@NativeType("Atom") long value) { ntarget(address(), value); return this; } + /** Sets the specified value to the {@code property} field. */ + public XSelectionEvent property(@NativeType("Atom") long value) { nproperty(address(), value); return this; } + /** Sets the specified value to the {@code time} field. */ + public XSelectionEvent time(@NativeType("Time") long value) { ntime(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XSelectionEvent set( + int type, + long serial, + boolean send_event, + long display, + long requestor, + long selection, + long target, + long property, + long time + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + requestor(requestor); + selection(selection); + target(target); + property(property); + time(time); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XSelectionEvent set(XSelectionEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XSelectionEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XSelectionEvent malloc() { + return wrap(XSelectionEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XSelectionEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XSelectionEvent calloc() { + return wrap(XSelectionEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XSelectionEvent} instance allocated with {@link BufferUtils}. */ + public static XSelectionEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XSelectionEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XSelectionEvent} instance for the specified memory address. */ + public static XSelectionEvent create(long address) { + return wrap(XSelectionEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XSelectionEvent createSafe(long address) { + return address == NULL ? null : wrap(XSelectionEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XSelectionEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XSelectionEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XSelectionEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XSelectionEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XSelectionEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XSelectionEvent mallocStack(MemoryStack stack) { + return wrap(XSelectionEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XSelectionEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XSelectionEvent callocStack(MemoryStack stack) { + return wrap(XSelectionEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XSelectionEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XSelectionEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XSelectionEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XSelectionEvent.DISPLAY); } + /** Unsafe version of {@link #requestor}. */ + public static long nrequestor(long struct) { return memGetCLong(struct + XSelectionEvent.REQUESTOR); } + /** Unsafe version of {@link #selection}. */ + public static long nselection(long struct) { return memGetCLong(struct + XSelectionEvent.SELECTION); } + /** Unsafe version of {@link #target}. */ + public static long ntarget(long struct) { return memGetCLong(struct + XSelectionEvent.TARGET); } + /** Unsafe version of {@link #property}. */ + public static long nproperty(long struct) { return memGetCLong(struct + XSelectionEvent.PROPERTY); } + /** Unsafe version of {@link #time}. */ + public static long ntime(long struct) { return memGetCLong(struct + XSelectionEvent.TIME); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XSelectionEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XSelectionEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XSelectionEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XSelectionEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #requestor(long) requestor}. */ + public static void nrequestor(long struct, long value) { memPutCLong(struct + XSelectionEvent.REQUESTOR, value); } + /** Unsafe version of {@link #selection(long) selection}. */ + public static void nselection(long struct, long value) { memPutCLong(struct + XSelectionEvent.SELECTION, value); } + /** Unsafe version of {@link #target(long) target}. */ + public static void ntarget(long struct, long value) { memPutCLong(struct + XSelectionEvent.TARGET, value); } + /** Unsafe version of {@link #property(long) property}. */ + public static void nproperty(long struct, long value) { memPutCLong(struct + XSelectionEvent.PROPERTY, value); } + /** Unsafe version of {@link #time(long) time}. */ + public static void ntime(long struct, long value) { memPutCLong(struct + XSelectionEvent.TIME, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XSelectionEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XSelectionEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XSelectionEvent ELEMENT_FACTORY = XSelectionEvent.create(-1L); + + /** + * Creates a new {@code XSelectionEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XSelectionEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XSelectionEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XSelectionEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XSelectionEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XSelectionEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XSelectionEvent.ndisplay(address()); } + /** Returns the value of the {@code requestor} field. */ + @NativeType("Window") + public long requestor() { return XSelectionEvent.nrequestor(address()); } + /** Returns the value of the {@code selection} field. */ + @NativeType("Atom") + public long selection() { return XSelectionEvent.nselection(address()); } + /** Returns the value of the {@code target} field. */ + @NativeType("Atom") + public long target() { return XSelectionEvent.ntarget(address()); } + /** Returns the value of the {@code property} field. */ + @NativeType("Atom") + public long property() { return XSelectionEvent.nproperty(address()); } + /** Returns the value of the {@code time} field. */ + @NativeType("Time") + public long time() { return XSelectionEvent.ntime(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XSelectionEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XSelectionEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XSelectionEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XSelectionEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code requestor} field. */ + public Buffer requestor(@NativeType("Window") long value) { XSelectionEvent.nrequestor(address(), value); return this; } + /** Sets the specified value to the {@code selection} field. */ + public Buffer selection(@NativeType("Atom") long value) { XSelectionEvent.nselection(address(), value); return this; } + /** Sets the specified value to the {@code target} field. */ + public Buffer target(@NativeType("Atom") long value) { XSelectionEvent.ntarget(address(), value); return this; } + /** Sets the specified value to the {@code property} field. */ + public Buffer property(@NativeType("Atom") long value) { XSelectionEvent.nproperty(address(), value); return this; } + /** Sets the specified value to the {@code time} field. */ + public Buffer time(@NativeType("Time") long value) { XSelectionEvent.ntime(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XSelectionRequestEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XSelectionRequestEvent.java new file mode 100644 index 00000000..ab141ea1 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XSelectionRequestEvent.java @@ -0,0 +1,496 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * SelectionRequest event structure. + * + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
+ * + *

Layout

+ * + *

+ * struct XSelectionRequestEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window owner;
+ *     Window requestor;
+ *     Atom selection;
+ *     Atom target;
+ *     Atom property;
+ *     Time time;
+ * }
+ */ +public class XSelectionRequestEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + OWNER, + REQUESTOR, + SELECTION, + TARGET, + PROPERTY, + TIME; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + OWNER = layout.offsetof(4); + REQUESTOR = layout.offsetof(5); + SELECTION = layout.offsetof(6); + TARGET = layout.offsetof(7); + PROPERTY = layout.offsetof(8); + TIME = layout.offsetof(9); + } + + /** + * Creates a {@code XSelectionRequestEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XSelectionRequestEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code owner} field. */ + @NativeType("Window") + public long owner() { return nowner(address()); } + /** Returns the value of the {@code requestor} field. */ + @NativeType("Window") + public long requestor() { return nrequestor(address()); } + /** Returns the value of the {@code selection} field. */ + @NativeType("Atom") + public long selection() { return nselection(address()); } + /** Returns the value of the {@code target} field. */ + @NativeType("Atom") + public long target() { return ntarget(address()); } + /** Returns the value of the {@code property} field. */ + @NativeType("Atom") + public long property() { return nproperty(address()); } + /** Returns the value of the {@code time} field. */ + @NativeType("Time") + public long time() { return ntime(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XSelectionRequestEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XSelectionRequestEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XSelectionRequestEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XSelectionRequestEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code owner} field. */ + public XSelectionRequestEvent owner(@NativeType("Window") long value) { nowner(address(), value); return this; } + /** Sets the specified value to the {@code requestor} field. */ + public XSelectionRequestEvent requestor(@NativeType("Window") long value) { nrequestor(address(), value); return this; } + /** Sets the specified value to the {@code selection} field. */ + public XSelectionRequestEvent selection(@NativeType("Atom") long value) { nselection(address(), value); return this; } + /** Sets the specified value to the {@code target} field. */ + public XSelectionRequestEvent target(@NativeType("Atom") long value) { ntarget(address(), value); return this; } + /** Sets the specified value to the {@code property} field. */ + public XSelectionRequestEvent property(@NativeType("Atom") long value) { nproperty(address(), value); return this; } + /** Sets the specified value to the {@code time} field. */ + public XSelectionRequestEvent time(@NativeType("Time") long value) { ntime(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XSelectionRequestEvent set( + int type, + long serial, + boolean send_event, + long display, + long owner, + long requestor, + long selection, + long target, + long property, + long time + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + owner(owner); + requestor(requestor); + selection(selection); + target(target); + property(property); + time(time); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XSelectionRequestEvent set(XSelectionRequestEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XSelectionRequestEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XSelectionRequestEvent malloc() { + return wrap(XSelectionRequestEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XSelectionRequestEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XSelectionRequestEvent calloc() { + return wrap(XSelectionRequestEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XSelectionRequestEvent} instance allocated with {@link BufferUtils}. */ + public static XSelectionRequestEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XSelectionRequestEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XSelectionRequestEvent} instance for the specified memory address. */ + public static XSelectionRequestEvent create(long address) { + return wrap(XSelectionRequestEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XSelectionRequestEvent createSafe(long address) { + return address == NULL ? null : wrap(XSelectionRequestEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XSelectionRequestEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XSelectionRequestEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XSelectionRequestEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XSelectionRequestEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XSelectionRequestEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XSelectionRequestEvent mallocStack(MemoryStack stack) { + return wrap(XSelectionRequestEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XSelectionRequestEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XSelectionRequestEvent callocStack(MemoryStack stack) { + return wrap(XSelectionRequestEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XSelectionRequestEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XSelectionRequestEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XSelectionRequestEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XSelectionRequestEvent.DISPLAY); } + /** Unsafe version of {@link #owner}. */ + public static long nowner(long struct) { return memGetCLong(struct + XSelectionRequestEvent.OWNER); } + /** Unsafe version of {@link #requestor}. */ + public static long nrequestor(long struct) { return memGetCLong(struct + XSelectionRequestEvent.REQUESTOR); } + /** Unsafe version of {@link #selection}. */ + public static long nselection(long struct) { return memGetCLong(struct + XSelectionRequestEvent.SELECTION); } + /** Unsafe version of {@link #target}. */ + public static long ntarget(long struct) { return memGetCLong(struct + XSelectionRequestEvent.TARGET); } + /** Unsafe version of {@link #property}. */ + public static long nproperty(long struct) { return memGetCLong(struct + XSelectionRequestEvent.PROPERTY); } + /** Unsafe version of {@link #time}. */ + public static long ntime(long struct) { return memGetCLong(struct + XSelectionRequestEvent.TIME); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XSelectionRequestEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XSelectionRequestEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XSelectionRequestEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XSelectionRequestEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #owner(long) owner}. */ + public static void nowner(long struct, long value) { memPutCLong(struct + XSelectionRequestEvent.OWNER, value); } + /** Unsafe version of {@link #requestor(long) requestor}. */ + public static void nrequestor(long struct, long value) { memPutCLong(struct + XSelectionRequestEvent.REQUESTOR, value); } + /** Unsafe version of {@link #selection(long) selection}. */ + public static void nselection(long struct, long value) { memPutCLong(struct + XSelectionRequestEvent.SELECTION, value); } + /** Unsafe version of {@link #target(long) target}. */ + public static void ntarget(long struct, long value) { memPutCLong(struct + XSelectionRequestEvent.TARGET, value); } + /** Unsafe version of {@link #property(long) property}. */ + public static void nproperty(long struct, long value) { memPutCLong(struct + XSelectionRequestEvent.PROPERTY, value); } + /** Unsafe version of {@link #time(long) time}. */ + public static void ntime(long struct, long value) { memPutCLong(struct + XSelectionRequestEvent.TIME, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XSelectionRequestEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XSelectionRequestEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XSelectionRequestEvent ELEMENT_FACTORY = XSelectionRequestEvent.create(-1L); + + /** + * Creates a new {@code XSelectionRequestEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XSelectionRequestEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XSelectionRequestEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XSelectionRequestEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XSelectionRequestEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XSelectionRequestEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XSelectionRequestEvent.ndisplay(address()); } + /** Returns the value of the {@code owner} field. */ + @NativeType("Window") + public long owner() { return XSelectionRequestEvent.nowner(address()); } + /** Returns the value of the {@code requestor} field. */ + @NativeType("Window") + public long requestor() { return XSelectionRequestEvent.nrequestor(address()); } + /** Returns the value of the {@code selection} field. */ + @NativeType("Atom") + public long selection() { return XSelectionRequestEvent.nselection(address()); } + /** Returns the value of the {@code target} field. */ + @NativeType("Atom") + public long target() { return XSelectionRequestEvent.ntarget(address()); } + /** Returns the value of the {@code property} field. */ + @NativeType("Atom") + public long property() { return XSelectionRequestEvent.nproperty(address()); } + /** Returns the value of the {@code time} field. */ + @NativeType("Time") + public long time() { return XSelectionRequestEvent.ntime(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XSelectionRequestEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XSelectionRequestEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XSelectionRequestEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XSelectionRequestEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code owner} field. */ + public Buffer owner(@NativeType("Window") long value) { XSelectionRequestEvent.nowner(address(), value); return this; } + /** Sets the specified value to the {@code requestor} field. */ + public Buffer requestor(@NativeType("Window") long value) { XSelectionRequestEvent.nrequestor(address(), value); return this; } + /** Sets the specified value to the {@code selection} field. */ + public Buffer selection(@NativeType("Atom") long value) { XSelectionRequestEvent.nselection(address(), value); return this; } + /** Sets the specified value to the {@code target} field. */ + public Buffer target(@NativeType("Atom") long value) { XSelectionRequestEvent.ntarget(address(), value); return this; } + /** Sets the specified value to the {@code property} field. */ + public Buffer property(@NativeType("Atom") long value) { XSelectionRequestEvent.nproperty(address(), value); return this; } + /** Sets the specified value to the {@code time} field. */ + public Buffer time(@NativeType("Time") long value) { XSelectionRequestEvent.ntime(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XSetWindowAttributes.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XSetWindowAttributes.java new file mode 100644 index 00000000..2f23f56c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XSetWindowAttributes.java @@ -0,0 +1,558 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Data structure for setting window attributes. + * + *

Layout

+ * + *

+ * struct XSetWindowAttributes {
+ *     Pixmap background_pixmap;
+ *     unsigned long background_pixel;
+ *     Pixmap border_pixmap;
+ *     unsigned long border_pixel;
+ *     int bit_gravity;
+ *     int win_gravity;
+ *     int backing_store;
+ *     unsigned long backing_planes;
+ *     unsigned long backing_pixel;
+ *     Bool save_under;
+ *     long event_mask;
+ *     long do_not_propagate_mask;
+ *     Bool override_redirect;
+ *     Colormap colormap;
+ *     Cursor cursor;
+ * }
+ */ +public class XSetWindowAttributes extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + BACKGROUND_PIXMAP, + BACKGROUND_PIXEL, + BORDER_PIXMAP, + BORDER_PIXEL, + BIT_GRAVITY, + WIN_GRAVITY, + BACKING_STORE, + BACKING_PLANES, + BACKING_PIXEL, + SAVE_UNDER, + EVENT_MASK, + DO_NOT_PROPAGATE_MASK, + OVERRIDE_REDIRECT, + COLORMAP, + CURSOR; + + static { + Layout layout = __struct( + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(4), + __member(4), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(CLONG_SIZE), + __member(CLONG_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + BACKGROUND_PIXMAP = layout.offsetof(0); + BACKGROUND_PIXEL = layout.offsetof(1); + BORDER_PIXMAP = layout.offsetof(2); + BORDER_PIXEL = layout.offsetof(3); + BIT_GRAVITY = layout.offsetof(4); + WIN_GRAVITY = layout.offsetof(5); + BACKING_STORE = layout.offsetof(6); + BACKING_PLANES = layout.offsetof(7); + BACKING_PIXEL = layout.offsetof(8); + SAVE_UNDER = layout.offsetof(9); + EVENT_MASK = layout.offsetof(10); + DO_NOT_PROPAGATE_MASK = layout.offsetof(11); + OVERRIDE_REDIRECT = layout.offsetof(12); + COLORMAP = layout.offsetof(13); + CURSOR = layout.offsetof(14); + } + + /** + * Creates a {@code XSetWindowAttributes} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XSetWindowAttributes(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code background_pixmap} field. */ + @NativeType("Pixmap") + public long background_pixmap() { return nbackground_pixmap(address()); } + /** Returns the value of the {@code background_pixel} field. */ + @NativeType("unsigned long") + public long background_pixel() { return nbackground_pixel(address()); } + /** Returns the value of the {@code border_pixmap} field. */ + @NativeType("Pixmap") + public long border_pixmap() { return nborder_pixmap(address()); } + /** Returns the value of the {@code border_pixel} field. */ + @NativeType("unsigned long") + public long border_pixel() { return nborder_pixel(address()); } + /** Returns the value of the {@code bit_gravity} field. */ + public int bit_gravity() { return nbit_gravity(address()); } + /** Returns the value of the {@code win_gravity} field. */ + public int win_gravity() { return nwin_gravity(address()); } + /** Returns the value of the {@code backing_store} field. */ + public int backing_store() { return nbacking_store(address()); } + /** Returns the value of the {@code backing_planes} field. */ + @NativeType("unsigned long") + public long backing_planes() { return nbacking_planes(address()); } + /** Returns the value of the {@code backing_pixel} field. */ + @NativeType("unsigned long") + public long backing_pixel() { return nbacking_pixel(address()); } + /** Returns the value of the {@code save_under} field. */ + @NativeType("Bool") + public boolean save_under() { return nsave_under(address()) != 0; } + /** Returns the value of the {@code event_mask} field. */ + public long event_mask() { return nevent_mask(address()); } + /** Returns the value of the {@code do_not_propagate_mask} field. */ + public long do_not_propagate_mask() { return ndo_not_propagate_mask(address()); } + /** Returns the value of the {@code override_redirect} field. */ + @NativeType("Bool") + public boolean override_redirect() { return noverride_redirect(address()) != 0; } + /** Returns the value of the {@code colormap} field. */ + @NativeType("Colormap") + public long colormap() { return ncolormap(address()); } + /** Returns the value of the {@code cursor} field. */ + @NativeType("Cursor") + public long cursor() { return ncursor(address()); } + + /** Sets the specified value to the {@code background_pixmap} field. */ + public XSetWindowAttributes background_pixmap(@NativeType("Pixmap") long value) { nbackground_pixmap(address(), value); return this; } + /** Sets the specified value to the {@code background_pixel} field. */ + public XSetWindowAttributes background_pixel(@NativeType("unsigned long") long value) { nbackground_pixel(address(), value); return this; } + /** Sets the specified value to the {@code border_pixmap} field. */ + public XSetWindowAttributes border_pixmap(@NativeType("Pixmap") long value) { nborder_pixmap(address(), value); return this; } + /** Sets the specified value to the {@code border_pixel} field. */ + public XSetWindowAttributes border_pixel(@NativeType("unsigned long") long value) { nborder_pixel(address(), value); return this; } + /** Sets the specified value to the {@code bit_gravity} field. */ + public XSetWindowAttributes bit_gravity(int value) { nbit_gravity(address(), value); return this; } + /** Sets the specified value to the {@code win_gravity} field. */ + public XSetWindowAttributes win_gravity(int value) { nwin_gravity(address(), value); return this; } + /** Sets the specified value to the {@code backing_store} field. */ + public XSetWindowAttributes backing_store(int value) { nbacking_store(address(), value); return this; } + /** Sets the specified value to the {@code backing_planes} field. */ + public XSetWindowAttributes backing_planes(@NativeType("unsigned long") long value) { nbacking_planes(address(), value); return this; } + /** Sets the specified value to the {@code backing_pixel} field. */ + public XSetWindowAttributes backing_pixel(@NativeType("unsigned long") long value) { nbacking_pixel(address(), value); return this; } + /** Sets the specified value to the {@code save_under} field. */ + public XSetWindowAttributes save_under(@NativeType("Bool") boolean value) { nsave_under(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code event_mask} field. */ + public XSetWindowAttributes event_mask(long value) { nevent_mask(address(), value); return this; } + /** Sets the specified value to the {@code do_not_propagate_mask} field. */ + public XSetWindowAttributes do_not_propagate_mask(long value) { ndo_not_propagate_mask(address(), value); return this; } + /** Sets the specified value to the {@code override_redirect} field. */ + public XSetWindowAttributes override_redirect(@NativeType("Bool") boolean value) { noverride_redirect(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code colormap} field. */ + public XSetWindowAttributes colormap(@NativeType("Colormap") long value) { ncolormap(address(), value); return this; } + /** Sets the specified value to the {@code cursor} field. */ + public XSetWindowAttributes cursor(@NativeType("Cursor") long value) { ncursor(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XSetWindowAttributes set( + long background_pixmap, + long background_pixel, + long border_pixmap, + long border_pixel, + int bit_gravity, + int win_gravity, + int backing_store, + long backing_planes, + long backing_pixel, + boolean save_under, + long event_mask, + long do_not_propagate_mask, + boolean override_redirect, + long colormap, + long cursor + ) { + background_pixmap(background_pixmap); + background_pixel(background_pixel); + border_pixmap(border_pixmap); + border_pixel(border_pixel); + bit_gravity(bit_gravity); + win_gravity(win_gravity); + backing_store(backing_store); + backing_planes(backing_planes); + backing_pixel(backing_pixel); + save_under(save_under); + event_mask(event_mask); + do_not_propagate_mask(do_not_propagate_mask); + override_redirect(override_redirect); + colormap(colormap); + cursor(cursor); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XSetWindowAttributes set(XSetWindowAttributes src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XSetWindowAttributes} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XSetWindowAttributes malloc() { + return wrap(XSetWindowAttributes.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XSetWindowAttributes} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XSetWindowAttributes calloc() { + return wrap(XSetWindowAttributes.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XSetWindowAttributes} instance allocated with {@link BufferUtils}. */ + public static XSetWindowAttributes create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XSetWindowAttributes.class, memAddress(container), container); + } + + /** Returns a new {@code XSetWindowAttributes} instance for the specified memory address. */ + public static XSetWindowAttributes create(long address) { + return wrap(XSetWindowAttributes.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XSetWindowAttributes createSafe(long address) { + return address == NULL ? null : wrap(XSetWindowAttributes.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XSetWindowAttributes} instance allocated on the thread-local {@link MemoryStack}. */ + public static XSetWindowAttributes mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XSetWindowAttributes} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XSetWindowAttributes callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XSetWindowAttributes} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XSetWindowAttributes mallocStack(MemoryStack stack) { + return wrap(XSetWindowAttributes.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XSetWindowAttributes} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XSetWindowAttributes callocStack(MemoryStack stack) { + return wrap(XSetWindowAttributes.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #background_pixmap}. */ + public static long nbackground_pixmap(long struct) { return memGetCLong(struct + XSetWindowAttributes.BACKGROUND_PIXMAP); } + /** Unsafe version of {@link #background_pixel}. */ + public static long nbackground_pixel(long struct) { return memGetCLong(struct + XSetWindowAttributes.BACKGROUND_PIXEL); } + /** Unsafe version of {@link #border_pixmap}. */ + public static long nborder_pixmap(long struct) { return memGetCLong(struct + XSetWindowAttributes.BORDER_PIXMAP); } + /** Unsafe version of {@link #border_pixel}. */ + public static long nborder_pixel(long struct) { return memGetCLong(struct + XSetWindowAttributes.BORDER_PIXEL); } + /** Unsafe version of {@link #bit_gravity}. */ + public static int nbit_gravity(long struct) { return UNSAFE.getInt(null, struct + XSetWindowAttributes.BIT_GRAVITY); } + /** Unsafe version of {@link #win_gravity}. */ + public static int nwin_gravity(long struct) { return UNSAFE.getInt(null, struct + XSetWindowAttributes.WIN_GRAVITY); } + /** Unsafe version of {@link #backing_store}. */ + public static int nbacking_store(long struct) { return UNSAFE.getInt(null, struct + XSetWindowAttributes.BACKING_STORE); } + /** Unsafe version of {@link #backing_planes}. */ + public static long nbacking_planes(long struct) { return memGetCLong(struct + XSetWindowAttributes.BACKING_PLANES); } + /** Unsafe version of {@link #backing_pixel}. */ + public static long nbacking_pixel(long struct) { return memGetCLong(struct + XSetWindowAttributes.BACKING_PIXEL); } + /** Unsafe version of {@link #save_under}. */ + public static int nsave_under(long struct) { return UNSAFE.getInt(null, struct + XSetWindowAttributes.SAVE_UNDER); } + /** Unsafe version of {@link #event_mask}. */ + public static long nevent_mask(long struct) { return memGetCLong(struct + XSetWindowAttributes.EVENT_MASK); } + /** Unsafe version of {@link #do_not_propagate_mask}. */ + public static long ndo_not_propagate_mask(long struct) { return memGetCLong(struct + XSetWindowAttributes.DO_NOT_PROPAGATE_MASK); } + /** Unsafe version of {@link #override_redirect}. */ + public static int noverride_redirect(long struct) { return UNSAFE.getInt(null, struct + XSetWindowAttributes.OVERRIDE_REDIRECT); } + /** Unsafe version of {@link #colormap}. */ + public static long ncolormap(long struct) { return memGetCLong(struct + XSetWindowAttributes.COLORMAP); } + /** Unsafe version of {@link #cursor}. */ + public static long ncursor(long struct) { return memGetCLong(struct + XSetWindowAttributes.CURSOR); } + + /** Unsafe version of {@link #background_pixmap(long) background_pixmap}. */ + public static void nbackground_pixmap(long struct, long value) { memPutCLong(struct + XSetWindowAttributes.BACKGROUND_PIXMAP, value); } + /** Unsafe version of {@link #background_pixel(long) background_pixel}. */ + public static void nbackground_pixel(long struct, long value) { memPutCLong(struct + XSetWindowAttributes.BACKGROUND_PIXEL, value); } + /** Unsafe version of {@link #border_pixmap(long) border_pixmap}. */ + public static void nborder_pixmap(long struct, long value) { memPutCLong(struct + XSetWindowAttributes.BORDER_PIXMAP, value); } + /** Unsafe version of {@link #border_pixel(long) border_pixel}. */ + public static void nborder_pixel(long struct, long value) { memPutCLong(struct + XSetWindowAttributes.BORDER_PIXEL, value); } + /** Unsafe version of {@link #bit_gravity(int) bit_gravity}. */ + public static void nbit_gravity(long struct, int value) { UNSAFE.putInt(null, struct + XSetWindowAttributes.BIT_GRAVITY, value); } + /** Unsafe version of {@link #win_gravity(int) win_gravity}. */ + public static void nwin_gravity(long struct, int value) { UNSAFE.putInt(null, struct + XSetWindowAttributes.WIN_GRAVITY, value); } + /** Unsafe version of {@link #backing_store(int) backing_store}. */ + public static void nbacking_store(long struct, int value) { UNSAFE.putInt(null, struct + XSetWindowAttributes.BACKING_STORE, value); } + /** Unsafe version of {@link #backing_planes(long) backing_planes}. */ + public static void nbacking_planes(long struct, long value) { memPutCLong(struct + XSetWindowAttributes.BACKING_PLANES, value); } + /** Unsafe version of {@link #backing_pixel(long) backing_pixel}. */ + public static void nbacking_pixel(long struct, long value) { memPutCLong(struct + XSetWindowAttributes.BACKING_PIXEL, value); } + /** Unsafe version of {@link #save_under(boolean) save_under}. */ + public static void nsave_under(long struct, int value) { UNSAFE.putInt(null, struct + XSetWindowAttributes.SAVE_UNDER, value); } + /** Unsafe version of {@link #event_mask(long) event_mask}. */ + public static void nevent_mask(long struct, long value) { memPutCLong(struct + XSetWindowAttributes.EVENT_MASK, value); } + /** Unsafe version of {@link #do_not_propagate_mask(long) do_not_propagate_mask}. */ + public static void ndo_not_propagate_mask(long struct, long value) { memPutCLong(struct + XSetWindowAttributes.DO_NOT_PROPAGATE_MASK, value); } + /** Unsafe version of {@link #override_redirect(boolean) override_redirect}. */ + public static void noverride_redirect(long struct, int value) { UNSAFE.putInt(null, struct + XSetWindowAttributes.OVERRIDE_REDIRECT, value); } + /** Unsafe version of {@link #colormap(long) colormap}. */ + public static void ncolormap(long struct, long value) { memPutCLong(struct + XSetWindowAttributes.COLORMAP, value); } + /** Unsafe version of {@link #cursor(long) cursor}. */ + public static void ncursor(long struct, long value) { memPutCLong(struct + XSetWindowAttributes.CURSOR, value); } + + // ----------------------------------- + + /** An array of {@link XSetWindowAttributes} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XSetWindowAttributes ELEMENT_FACTORY = XSetWindowAttributes.create(-1L); + + /** + * Creates a new {@code XSetWindowAttributes.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XSetWindowAttributes#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XSetWindowAttributes getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code background_pixmap} field. */ + @NativeType("Pixmap") + public long background_pixmap() { return XSetWindowAttributes.nbackground_pixmap(address()); } + /** Returns the value of the {@code background_pixel} field. */ + @NativeType("unsigned long") + public long background_pixel() { return XSetWindowAttributes.nbackground_pixel(address()); } + /** Returns the value of the {@code border_pixmap} field. */ + @NativeType("Pixmap") + public long border_pixmap() { return XSetWindowAttributes.nborder_pixmap(address()); } + /** Returns the value of the {@code border_pixel} field. */ + @NativeType("unsigned long") + public long border_pixel() { return XSetWindowAttributes.nborder_pixel(address()); } + /** Returns the value of the {@code bit_gravity} field. */ + public int bit_gravity() { return XSetWindowAttributes.nbit_gravity(address()); } + /** Returns the value of the {@code win_gravity} field. */ + public int win_gravity() { return XSetWindowAttributes.nwin_gravity(address()); } + /** Returns the value of the {@code backing_store} field. */ + public int backing_store() { return XSetWindowAttributes.nbacking_store(address()); } + /** Returns the value of the {@code backing_planes} field. */ + @NativeType("unsigned long") + public long backing_planes() { return XSetWindowAttributes.nbacking_planes(address()); } + /** Returns the value of the {@code backing_pixel} field. */ + @NativeType("unsigned long") + public long backing_pixel() { return XSetWindowAttributes.nbacking_pixel(address()); } + /** Returns the value of the {@code save_under} field. */ + @NativeType("Bool") + public boolean save_under() { return XSetWindowAttributes.nsave_under(address()) != 0; } + /** Returns the value of the {@code event_mask} field. */ + public long event_mask() { return XSetWindowAttributes.nevent_mask(address()); } + /** Returns the value of the {@code do_not_propagate_mask} field. */ + public long do_not_propagate_mask() { return XSetWindowAttributes.ndo_not_propagate_mask(address()); } + /** Returns the value of the {@code override_redirect} field. */ + @NativeType("Bool") + public boolean override_redirect() { return XSetWindowAttributes.noverride_redirect(address()) != 0; } + /** Returns the value of the {@code colormap} field. */ + @NativeType("Colormap") + public long colormap() { return XSetWindowAttributes.ncolormap(address()); } + /** Returns the value of the {@code cursor} field. */ + @NativeType("Cursor") + public long cursor() { return XSetWindowAttributes.ncursor(address()); } + + /** Sets the specified value to the {@code background_pixmap} field. */ + public Buffer background_pixmap(@NativeType("Pixmap") long value) { XSetWindowAttributes.nbackground_pixmap(address(), value); return this; } + /** Sets the specified value to the {@code background_pixel} field. */ + public Buffer background_pixel(@NativeType("unsigned long") long value) { XSetWindowAttributes.nbackground_pixel(address(), value); return this; } + /** Sets the specified value to the {@code border_pixmap} field. */ + public Buffer border_pixmap(@NativeType("Pixmap") long value) { XSetWindowAttributes.nborder_pixmap(address(), value); return this; } + /** Sets the specified value to the {@code border_pixel} field. */ + public Buffer border_pixel(@NativeType("unsigned long") long value) { XSetWindowAttributes.nborder_pixel(address(), value); return this; } + /** Sets the specified value to the {@code bit_gravity} field. */ + public Buffer bit_gravity(int value) { XSetWindowAttributes.nbit_gravity(address(), value); return this; } + /** Sets the specified value to the {@code win_gravity} field. */ + public Buffer win_gravity(int value) { XSetWindowAttributes.nwin_gravity(address(), value); return this; } + /** Sets the specified value to the {@code backing_store} field. */ + public Buffer backing_store(int value) { XSetWindowAttributes.nbacking_store(address(), value); return this; } + /** Sets the specified value to the {@code backing_planes} field. */ + public Buffer backing_planes(@NativeType("unsigned long") long value) { XSetWindowAttributes.nbacking_planes(address(), value); return this; } + /** Sets the specified value to the {@code backing_pixel} field. */ + public Buffer backing_pixel(@NativeType("unsigned long") long value) { XSetWindowAttributes.nbacking_pixel(address(), value); return this; } + /** Sets the specified value to the {@code save_under} field. */ + public Buffer save_under(@NativeType("Bool") boolean value) { XSetWindowAttributes.nsave_under(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code event_mask} field. */ + public Buffer event_mask(long value) { XSetWindowAttributes.nevent_mask(address(), value); return this; } + /** Sets the specified value to the {@code do_not_propagate_mask} field. */ + public Buffer do_not_propagate_mask(long value) { XSetWindowAttributes.ndo_not_propagate_mask(address(), value); return this; } + /** Sets the specified value to the {@code override_redirect} field. */ + public Buffer override_redirect(@NativeType("Bool") boolean value) { XSetWindowAttributes.noverride_redirect(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code colormap} field. */ + public Buffer colormap(@NativeType("Colormap") long value) { XSetWindowAttributes.ncolormap(address(), value); return this; } + /** Sets the specified value to the {@code cursor} field. */ + public Buffer cursor(@NativeType("Cursor") long value) { XSetWindowAttributes.ncursor(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XTimeCoord.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XTimeCoord.java new file mode 100644 index 00000000..48ade02b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XTimeCoord.java @@ -0,0 +1,170 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + *

Member documentation

+ * + *
    + *
  • {@code time} – the time, in milliseconds
  • + *
  • {@code x} – the x coordinate of the pointer relative to the origin of the specified window
  • + *
  • {@code y} – the y coordinate of the pointer relative to the origin of the specified window
  • + *
+ * + *

Layout

+ * + *

+ * struct XTimeCoord {
+ *     Time time;
+ *     short x;
+ *     short y;
+ * }
+ */ +public class XTimeCoord extends Struct { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TIME, + X, + Y; + + static { + Layout layout = __struct( + __member(CLONG_SIZE), + __member(2), + __member(2) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TIME = layout.offsetof(0); + X = layout.offsetof(1); + Y = layout.offsetof(2); + } + + /** + * Creates a {@code XTimeCoord} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XTimeCoord(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code time} field. */ + @NativeType("Time") + public long time() { return ntime(address()); } + /** Returns the value of the {@code x} field. */ + public short x() { return nx(address()); } + /** Returns the value of the {@code y} field. */ + public short y() { return ny(address()); } + + // ----------------------------------- + + /** Returns a new {@code XTimeCoord} instance for the specified memory address. */ + public static XTimeCoord create(long address) { + return wrap(XTimeCoord.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XTimeCoord createSafe(long address) { + return address == NULL ? null : wrap(XTimeCoord.class, address); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #time}. */ + public static long ntime(long struct) { return memGetCLong(struct + XTimeCoord.TIME); } + /** Unsafe version of {@link #x}. */ + public static short nx(long struct) { return UNSAFE.getShort(null, struct + XTimeCoord.X); } + /** Unsafe version of {@link #y}. */ + public static short ny(long struct) { return UNSAFE.getShort(null, struct + XTimeCoord.Y); } + + // ----------------------------------- + + /** An array of {@link XTimeCoord} structs. */ + public static class Buffer extends StructBuffer { + + private static final XTimeCoord ELEMENT_FACTORY = XTimeCoord.create(-1L); + + /** + * Creates a new {@code XTimeCoord.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XTimeCoord#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XTimeCoord getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code time} field. */ + @NativeType("Time") + public long time() { return XTimeCoord.ntime(address()); } + /** Returns the value of the {@code x} field. */ + public short x() { return XTimeCoord.nx(address()); } + /** Returns the value of the {@code y} field. */ + public short y() { return XTimeCoord.ny(address()); } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XUnmapEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XUnmapEvent.java new file mode 100644 index 00000000..2192ffc0 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XUnmapEvent.java @@ -0,0 +1,432 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
+ * + *

Layout

+ * + *

+ * struct XUnmapEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window event;
+ *     Window window;
+ *     int from_configure;
+ * }
+ */ +public class XUnmapEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + EVENT, + WINDOW, + FROM_CONFIGURE; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + EVENT = layout.offsetof(4); + WINDOW = layout.offsetof(5); + FROM_CONFIGURE = layout.offsetof(6); + } + + /** + * Creates a {@code XUnmapEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XUnmapEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code event} field. */ + @NativeType("Window") + public long event() { return nevent(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code from_configure} field. */ + public int from_configure() { return nfrom_configure(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XUnmapEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XUnmapEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XUnmapEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XUnmapEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code event} field. */ + public XUnmapEvent event(@NativeType("Window") long value) { nevent(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XUnmapEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Sets the specified value to the {@code from_configure} field. */ + public XUnmapEvent from_configure(int value) { nfrom_configure(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XUnmapEvent set( + int type, + long serial, + boolean send_event, + long display, + long event, + long window, + int from_configure + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + event(event); + window(window); + from_configure(from_configure); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XUnmapEvent set(XUnmapEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XUnmapEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XUnmapEvent malloc() { + return wrap(XUnmapEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XUnmapEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XUnmapEvent calloc() { + return wrap(XUnmapEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XUnmapEvent} instance allocated with {@link BufferUtils}. */ + public static XUnmapEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XUnmapEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XUnmapEvent} instance for the specified memory address. */ + public static XUnmapEvent create(long address) { + return wrap(XUnmapEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XUnmapEvent createSafe(long address) { + return address == NULL ? null : wrap(XUnmapEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XUnmapEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XUnmapEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XUnmapEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XUnmapEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XUnmapEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XUnmapEvent mallocStack(MemoryStack stack) { + return wrap(XUnmapEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XUnmapEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XUnmapEvent callocStack(MemoryStack stack) { + return wrap(XUnmapEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XUnmapEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XUnmapEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XUnmapEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XUnmapEvent.DISPLAY); } + /** Unsafe version of {@link #event}. */ + public static long nevent(long struct) { return memGetCLong(struct + XUnmapEvent.EVENT); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XUnmapEvent.WINDOW); } + /** Unsafe version of {@link #from_configure}. */ + public static int nfrom_configure(long struct) { return UNSAFE.getInt(null, struct + XUnmapEvent.FROM_CONFIGURE); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XUnmapEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XUnmapEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XUnmapEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XUnmapEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #event(long) event}. */ + public static void nevent(long struct, long value) { memPutCLong(struct + XUnmapEvent.EVENT, value); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XUnmapEvent.WINDOW, value); } + /** Unsafe version of {@link #from_configure(int) from_configure}. */ + public static void nfrom_configure(long struct, int value) { UNSAFE.putInt(null, struct + XUnmapEvent.FROM_CONFIGURE, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XUnmapEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XUnmapEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XUnmapEvent ELEMENT_FACTORY = XUnmapEvent.create(-1L); + + /** + * Creates a new {@code XUnmapEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XUnmapEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XUnmapEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XUnmapEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XUnmapEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XUnmapEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XUnmapEvent.ndisplay(address()); } + /** Returns the value of the {@code event} field. */ + @NativeType("Window") + public long event() { return XUnmapEvent.nevent(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XUnmapEvent.nwindow(address()); } + /** Returns the value of the {@code from_configure} field. */ + public int from_configure() { return XUnmapEvent.nfrom_configure(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XUnmapEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XUnmapEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XUnmapEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XUnmapEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code event} field. */ + public Buffer event(@NativeType("Window") long value) { XUnmapEvent.nevent(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XUnmapEvent.nwindow(address(), value); return this; } + /** Sets the specified value to the {@code from_configure} field. */ + public Buffer from_configure(int value) { XUnmapEvent.nfrom_configure(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XVisibilityEvent.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XVisibilityEvent.java new file mode 100644 index 00000000..47f97a92 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XVisibilityEvent.java @@ -0,0 +1,414 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + *

Member documentation

+ * + *
    + *
  • {@code serial} – # of last request processed by server
  • + *
  • {@code send_event} – true if this came from an {@link X11#XSendEvent} request
  • + *
  • {@code display} – {@code Display} the event was read from
  • + *
  • {@code window} – window it reported relative to
  • + *
  • {@code state} – visibility state
  • + *
+ * + *

Layout

+ * + *

+ * struct XVisibilityEvent {
+ *     int type;
+ *     unsigned long serial;
+ *     Bool send_event;
+ *     Display * display;
+ *     Window window;
+ *     int state;
+ * }
+ */ +public class XVisibilityEvent extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + SERIAL, + SEND_EVENT, + DISPLAY, + WINDOW, + STATE; + + static { + Layout layout = __struct( + __member(4), + __member(CLONG_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + SERIAL = layout.offsetof(1); + SEND_EVENT = layout.offsetof(2); + DISPLAY = layout.offsetof(3); + WINDOW = layout.offsetof(4); + STATE = layout.offsetof(5); + } + + /** + * Creates a {@code XVisibilityEvent} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XVisibilityEvent(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + public int type() { return ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return nwindow(address()); } + /** Returns the value of the {@code state} field. */ + public int state() { return nstate(address()); } + + /** Sets the specified value to the {@code type} field. */ + public XVisibilityEvent type(int value) { ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public XVisibilityEvent serial(@NativeType("unsigned long") long value) { nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public XVisibilityEvent send_event(@NativeType("Bool") boolean value) { nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public XVisibilityEvent display(@NativeType("Display *") long value) { ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public XVisibilityEvent window(@NativeType("Window") long value) { nwindow(address(), value); return this; } + /** Sets the specified value to the {@code state} field. */ + public XVisibilityEvent state(int value) { nstate(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XVisibilityEvent set( + int type, + long serial, + boolean send_event, + long display, + long window, + int state + ) { + type(type); + serial(serial); + send_event(send_event); + display(display); + window(window); + state(state); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XVisibilityEvent set(XVisibilityEvent src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XVisibilityEvent} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XVisibilityEvent malloc() { + return wrap(XVisibilityEvent.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XVisibilityEvent} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XVisibilityEvent calloc() { + return wrap(XVisibilityEvent.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XVisibilityEvent} instance allocated with {@link BufferUtils}. */ + public static XVisibilityEvent create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XVisibilityEvent.class, memAddress(container), container); + } + + /** Returns a new {@code XVisibilityEvent} instance for the specified memory address. */ + public static XVisibilityEvent create(long address) { + return wrap(XVisibilityEvent.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XVisibilityEvent createSafe(long address) { + return address == NULL ? null : wrap(XVisibilityEvent.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XVisibilityEvent} instance allocated on the thread-local {@link MemoryStack}. */ + public static XVisibilityEvent mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XVisibilityEvent} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XVisibilityEvent callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XVisibilityEvent} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XVisibilityEvent mallocStack(MemoryStack stack) { + return wrap(XVisibilityEvent.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XVisibilityEvent} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XVisibilityEvent callocStack(MemoryStack stack) { + return wrap(XVisibilityEvent.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + XVisibilityEvent.TYPE); } + /** Unsafe version of {@link #serial}. */ + public static long nserial(long struct) { return memGetCLong(struct + XVisibilityEvent.SERIAL); } + /** Unsafe version of {@link #send_event}. */ + public static int nsend_event(long struct) { return UNSAFE.getInt(null, struct + XVisibilityEvent.SEND_EVENT); } + /** Unsafe version of {@link #display}. */ + public static long ndisplay(long struct) { return memGetAddress(struct + XVisibilityEvent.DISPLAY); } + /** Unsafe version of {@link #window}. */ + public static long nwindow(long struct) { return memGetCLong(struct + XVisibilityEvent.WINDOW); } + /** Unsafe version of {@link #state}. */ + public static int nstate(long struct) { return UNSAFE.getInt(null, struct + XVisibilityEvent.STATE); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + XVisibilityEvent.TYPE, value); } + /** Unsafe version of {@link #serial(long) serial}. */ + public static void nserial(long struct, long value) { memPutCLong(struct + XVisibilityEvent.SERIAL, value); } + /** Unsafe version of {@link #send_event(boolean) send_event}. */ + public static void nsend_event(long struct, int value) { UNSAFE.putInt(null, struct + XVisibilityEvent.SEND_EVENT, value); } + /** Unsafe version of {@link #display(long) display}. */ + public static void ndisplay(long struct, long value) { memPutAddress(struct + XVisibilityEvent.DISPLAY, check(value)); } + /** Unsafe version of {@link #window(long) window}. */ + public static void nwindow(long struct, long value) { memPutCLong(struct + XVisibilityEvent.WINDOW, value); } + /** Unsafe version of {@link #state(int) state}. */ + public static void nstate(long struct, int value) { UNSAFE.putInt(null, struct + XVisibilityEvent.STATE, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XVisibilityEvent.DISPLAY)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XVisibilityEvent} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XVisibilityEvent ELEMENT_FACTORY = XVisibilityEvent.create(-1L); + + /** + * Creates a new {@code XVisibilityEvent.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XVisibilityEvent#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XVisibilityEvent getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + public int type() { return XVisibilityEvent.ntype(address()); } + /** Returns the value of the {@code serial} field. */ + @NativeType("unsigned long") + public long serial() { return XVisibilityEvent.nserial(address()); } + /** Returns the value of the {@code send_event} field. */ + @NativeType("Bool") + public boolean send_event() { return XVisibilityEvent.nsend_event(address()) != 0; } + /** Returns the value of the {@code display} field. */ + @NativeType("Display *") + public long display() { return XVisibilityEvent.ndisplay(address()); } + /** Returns the value of the {@code window} field. */ + @NativeType("Window") + public long window() { return XVisibilityEvent.nwindow(address()); } + /** Returns the value of the {@code state} field. */ + public int state() { return XVisibilityEvent.nstate(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(int value) { XVisibilityEvent.ntype(address(), value); return this; } + /** Sets the specified value to the {@code serial} field. */ + public Buffer serial(@NativeType("unsigned long") long value) { XVisibilityEvent.nserial(address(), value); return this; } + /** Sets the specified value to the {@code send_event} field. */ + public Buffer send_event(@NativeType("Bool") boolean value) { XVisibilityEvent.nsend_event(address(), value ? 1 : 0); return this; } + /** Sets the specified value to the {@code display} field. */ + public Buffer display(@NativeType("Display *") long value) { XVisibilityEvent.ndisplay(address(), value); return this; } + /** Sets the specified value to the {@code window} field. */ + public Buffer window(@NativeType("Window") long value) { XVisibilityEvent.nwindow(address(), value); return this; } + /** Sets the specified value to the {@code state} field. */ + public Buffer state(int value) { XVisibilityEvent.nstate(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XVisualInfo.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XVisualInfo.java new file mode 100644 index 00000000..436ecff6 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/XVisualInfo.java @@ -0,0 +1,480 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.linux; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Information used by the visual utility routines to find desired visual type from the many visuals a display may support. + * + *

Layout

+ * + *

+ * struct XVisualInfo {
+ *     {@link Visual Visual} * visual;
+ *     VisualID visualid;
+ *     int screen;
+ *     int depth;
+ *     int class;
+ *     unsigned long red_mask;
+ *     unsigned long green_mask;
+ *     unsigned long blue_mask;
+ *     int colormap_size;
+ *     int bits_per_rgb;
+ * }
+ */ +public class XVisualInfo extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + VISUAL, + VISUALID, + SCREEN, + DEPTH, + CLASS, + RED_MASK, + GREEN_MASK, + BLUE_MASK, + COLORMAP_SIZE, + BITS_PER_RGB; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(4), + __member(4), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(CLONG_SIZE), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + VISUAL = layout.offsetof(0); + VISUALID = layout.offsetof(1); + SCREEN = layout.offsetof(2); + DEPTH = layout.offsetof(3); + CLASS = layout.offsetof(4); + RED_MASK = layout.offsetof(5); + GREEN_MASK = layout.offsetof(6); + BLUE_MASK = layout.offsetof(7); + COLORMAP_SIZE = layout.offsetof(8); + BITS_PER_RGB = layout.offsetof(9); + } + + /** + * Creates a {@code XVisualInfo} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public XVisualInfo(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns a {@link Visual} view of the struct pointed to by the {@code visual} field. */ + @NativeType("Visual *") + public Visual visual() { return nvisual(address()); } + /** Returns the value of the {@code visualid} field. */ + @NativeType("VisualID") + public long visualid() { return nvisualid(address()); } + /** Returns the value of the {@code screen} field. */ + public int screen() { return nscreen(address()); } + /** Returns the value of the {@code depth} field. */ + public int depth() { return ndepth(address()); } + /** Returns the value of the {@code class} field. */ + public int class$() { return nclass$(address()); } + /** Returns the value of the {@code red_mask} field. */ + @NativeType("unsigned long") + public long red_mask() { return nred_mask(address()); } + /** Returns the value of the {@code green_mask} field. */ + @NativeType("unsigned long") + public long green_mask() { return ngreen_mask(address()); } + /** Returns the value of the {@code blue_mask} field. */ + @NativeType("unsigned long") + public long blue_mask() { return nblue_mask(address()); } + /** Returns the value of the {@code colormap_size} field. */ + public int colormap_size() { return ncolormap_size(address()); } + /** Returns the value of the {@code bits_per_rgb} field. */ + public int bits_per_rgb() { return nbits_per_rgb(address()); } + + /** Sets the address of the specified {@link Visual} to the {@code visual} field. */ + public XVisualInfo visual(@NativeType("Visual *") Visual value) { nvisual(address(), value); return this; } + /** Sets the specified value to the {@code visualid} field. */ + public XVisualInfo visualid(@NativeType("VisualID") long value) { nvisualid(address(), value); return this; } + /** Sets the specified value to the {@code screen} field. */ + public XVisualInfo screen(int value) { nscreen(address(), value); return this; } + /** Sets the specified value to the {@code depth} field. */ + public XVisualInfo depth(int value) { ndepth(address(), value); return this; } + /** Sets the specified value to the {@code class} field. */ + public XVisualInfo class$(int value) { nclass$(address(), value); return this; } + /** Sets the specified value to the {@code red_mask} field. */ + public XVisualInfo red_mask(@NativeType("unsigned long") long value) { nred_mask(address(), value); return this; } + /** Sets the specified value to the {@code green_mask} field. */ + public XVisualInfo green_mask(@NativeType("unsigned long") long value) { ngreen_mask(address(), value); return this; } + /** Sets the specified value to the {@code blue_mask} field. */ + public XVisualInfo blue_mask(@NativeType("unsigned long") long value) { nblue_mask(address(), value); return this; } + /** Sets the specified value to the {@code colormap_size} field. */ + public XVisualInfo colormap_size(int value) { ncolormap_size(address(), value); return this; } + /** Sets the specified value to the {@code bits_per_rgb} field. */ + public XVisualInfo bits_per_rgb(int value) { nbits_per_rgb(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public XVisualInfo set( + Visual visual, + long visualid, + int screen, + int depth, + int class$, + long red_mask, + long green_mask, + long blue_mask, + int colormap_size, + int bits_per_rgb + ) { + visual(visual); + visualid(visualid); + screen(screen); + depth(depth); + class$(class$); + red_mask(red_mask); + green_mask(green_mask); + blue_mask(blue_mask); + colormap_size(colormap_size); + bits_per_rgb(bits_per_rgb); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public XVisualInfo set(XVisualInfo src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code XVisualInfo} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static XVisualInfo malloc() { + return wrap(XVisualInfo.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code XVisualInfo} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static XVisualInfo calloc() { + return wrap(XVisualInfo.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code XVisualInfo} instance allocated with {@link BufferUtils}. */ + public static XVisualInfo create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(XVisualInfo.class, memAddress(container), container); + } + + /** Returns a new {@code XVisualInfo} instance for the specified memory address. */ + public static XVisualInfo create(long address) { + return wrap(XVisualInfo.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static XVisualInfo createSafe(long address) { + return address == NULL ? null : wrap(XVisualInfo.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code XVisualInfo} instance allocated on the thread-local {@link MemoryStack}. */ + public static XVisualInfo mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code XVisualInfo} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static XVisualInfo callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code XVisualInfo} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static XVisualInfo mallocStack(MemoryStack stack) { + return wrap(XVisualInfo.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code XVisualInfo} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static XVisualInfo callocStack(MemoryStack stack) { + return wrap(XVisualInfo.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #visual}. */ + public static Visual nvisual(long struct) { return Visual.create(memGetAddress(struct + XVisualInfo.VISUAL)); } + /** Unsafe version of {@link #visualid}. */ + public static long nvisualid(long struct) { return memGetCLong(struct + XVisualInfo.VISUALID); } + /** Unsafe version of {@link #screen}. */ + public static int nscreen(long struct) { return UNSAFE.getInt(null, struct + XVisualInfo.SCREEN); } + /** Unsafe version of {@link #depth}. */ + public static int ndepth(long struct) { return UNSAFE.getInt(null, struct + XVisualInfo.DEPTH); } + /** Unsafe version of {@link #class$}. */ + public static int nclass$(long struct) { return UNSAFE.getInt(null, struct + XVisualInfo.CLASS); } + /** Unsafe version of {@link #red_mask}. */ + public static long nred_mask(long struct) { return memGetCLong(struct + XVisualInfo.RED_MASK); } + /** Unsafe version of {@link #green_mask}. */ + public static long ngreen_mask(long struct) { return memGetCLong(struct + XVisualInfo.GREEN_MASK); } + /** Unsafe version of {@link #blue_mask}. */ + public static long nblue_mask(long struct) { return memGetCLong(struct + XVisualInfo.BLUE_MASK); } + /** Unsafe version of {@link #colormap_size}. */ + public static int ncolormap_size(long struct) { return UNSAFE.getInt(null, struct + XVisualInfo.COLORMAP_SIZE); } + /** Unsafe version of {@link #bits_per_rgb}. */ + public static int nbits_per_rgb(long struct) { return UNSAFE.getInt(null, struct + XVisualInfo.BITS_PER_RGB); } + + /** Unsafe version of {@link #visual(Visual) visual}. */ + public static void nvisual(long struct, Visual value) { memPutAddress(struct + XVisualInfo.VISUAL, value.address()); } + /** Unsafe version of {@link #visualid(long) visualid}. */ + public static void nvisualid(long struct, long value) { memPutCLong(struct + XVisualInfo.VISUALID, value); } + /** Unsafe version of {@link #screen(int) screen}. */ + public static void nscreen(long struct, int value) { UNSAFE.putInt(null, struct + XVisualInfo.SCREEN, value); } + /** Unsafe version of {@link #depth(int) depth}. */ + public static void ndepth(long struct, int value) { UNSAFE.putInt(null, struct + XVisualInfo.DEPTH, value); } + /** Unsafe version of {@link #class$(int) class$}. */ + public static void nclass$(long struct, int value) { UNSAFE.putInt(null, struct + XVisualInfo.CLASS, value); } + /** Unsafe version of {@link #red_mask(long) red_mask}. */ + public static void nred_mask(long struct, long value) { memPutCLong(struct + XVisualInfo.RED_MASK, value); } + /** Unsafe version of {@link #green_mask(long) green_mask}. */ + public static void ngreen_mask(long struct, long value) { memPutCLong(struct + XVisualInfo.GREEN_MASK, value); } + /** Unsafe version of {@link #blue_mask(long) blue_mask}. */ + public static void nblue_mask(long struct, long value) { memPutCLong(struct + XVisualInfo.BLUE_MASK, value); } + /** Unsafe version of {@link #colormap_size(int) colormap_size}. */ + public static void ncolormap_size(long struct, int value) { UNSAFE.putInt(null, struct + XVisualInfo.COLORMAP_SIZE, value); } + /** Unsafe version of {@link #bits_per_rgb(int) bits_per_rgb}. */ + public static void nbits_per_rgb(long struct, int value) { UNSAFE.putInt(null, struct + XVisualInfo.BITS_PER_RGB, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + XVisualInfo.VISUAL)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link XVisualInfo} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final XVisualInfo ELEMENT_FACTORY = XVisualInfo.create(-1L); + + /** + * Creates a new {@code XVisualInfo.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link XVisualInfo#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected XVisualInfo getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns a {@link Visual} view of the struct pointed to by the {@code visual} field. */ + @NativeType("Visual *") + public Visual visual() { return XVisualInfo.nvisual(address()); } + /** Returns the value of the {@code visualid} field. */ + @NativeType("VisualID") + public long visualid() { return XVisualInfo.nvisualid(address()); } + /** Returns the value of the {@code screen} field. */ + public int screen() { return XVisualInfo.nscreen(address()); } + /** Returns the value of the {@code depth} field. */ + public int depth() { return XVisualInfo.ndepth(address()); } + /** Returns the value of the {@code class} field. */ + public int class$() { return XVisualInfo.nclass$(address()); } + /** Returns the value of the {@code red_mask} field. */ + @NativeType("unsigned long") + public long red_mask() { return XVisualInfo.nred_mask(address()); } + /** Returns the value of the {@code green_mask} field. */ + @NativeType("unsigned long") + public long green_mask() { return XVisualInfo.ngreen_mask(address()); } + /** Returns the value of the {@code blue_mask} field. */ + @NativeType("unsigned long") + public long blue_mask() { return XVisualInfo.nblue_mask(address()); } + /** Returns the value of the {@code colormap_size} field. */ + public int colormap_size() { return XVisualInfo.ncolormap_size(address()); } + /** Returns the value of the {@code bits_per_rgb} field. */ + public int bits_per_rgb() { return XVisualInfo.nbits_per_rgb(address()); } + + /** Sets the address of the specified {@link Visual} to the {@code visual} field. */ + public Buffer visual(@NativeType("Visual *") Visual value) { XVisualInfo.nvisual(address(), value); return this; } + /** Sets the specified value to the {@code visualid} field. */ + public Buffer visualid(@NativeType("VisualID") long value) { XVisualInfo.nvisualid(address(), value); return this; } + /** Sets the specified value to the {@code screen} field. */ + public Buffer screen(int value) { XVisualInfo.nscreen(address(), value); return this; } + /** Sets the specified value to the {@code depth} field. */ + public Buffer depth(int value) { XVisualInfo.ndepth(address(), value); return this; } + /** Sets the specified value to the {@code class} field. */ + public Buffer class$(int value) { XVisualInfo.nclass$(address(), value); return this; } + /** Sets the specified value to the {@code red_mask} field. */ + public Buffer red_mask(@NativeType("unsigned long") long value) { XVisualInfo.nred_mask(address(), value); return this; } + /** Sets the specified value to the {@code green_mask} field. */ + public Buffer green_mask(@NativeType("unsigned long") long value) { XVisualInfo.ngreen_mask(address(), value); return this; } + /** Sets the specified value to the {@code blue_mask} field. */ + public Buffer blue_mask(@NativeType("unsigned long") long value) { XVisualInfo.nblue_mask(address(), value); return this; } + /** Sets the specified value to the {@code colormap_size} field. */ + public Buffer colormap_size(int value) { XVisualInfo.ncolormap_size(address(), value); return this; } + /** Sets the specified value to the {@code bits_per_rgb} field. */ + public Buffer bits_per_rgb(int value) { XVisualInfo.nbits_per_rgb(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/package-info.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/package-info.java new file mode 100644 index 00000000..0b733c21 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/linux/package-info.java @@ -0,0 +1,10 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ + +/** Contains bindings to native APIs specific to the Linux operating system. */ +@org.lwjgl.system.NonnullDefault +package org.lwjgl.system.linux; + diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CGEventTapCallBack.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CGEventTapCallBack.java new file mode 100644 index 00000000..4bf08eaa --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CGEventTapCallBack.java @@ -0,0 +1,78 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.macosx; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Instances of this class may be passed to the {@link CoreGraphics#CGEventTapCreate EventTapCreate} method. + * + *

Type

+ * + *

+ * CGEventRef (*) (
+ *     CGEventTapProxy proxy,
+ *     CGEventType type,
+ *     CGEventRef event,
+ *     void *userInfo
+ * )
+ */ +public abstract class CGEventTapCallBack extends Callback implements CGEventTapCallBackI { + + /** + * Creates a {@code CGEventTapCallBack} instance from the specified function pointer. + * + * @return the new {@code CGEventTapCallBack} + */ + public static CGEventTapCallBack create(long functionPointer) { + CGEventTapCallBackI instance = Callback.get(functionPointer); + return instance instanceof CGEventTapCallBack + ? (CGEventTapCallBack)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static CGEventTapCallBack createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code CGEventTapCallBack} instance that delegates to the specified {@code CGEventTapCallBackI} instance. */ + public static CGEventTapCallBack create(CGEventTapCallBackI instance) { + return instance instanceof CGEventTapCallBack + ? (CGEventTapCallBack)instance + : new Container(instance.address(), instance); + } + + protected CGEventTapCallBack() { + super(SIGNATURE); + } + + CGEventTapCallBack(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends CGEventTapCallBack { + + private final CGEventTapCallBackI delegate; + + Container(long functionPointer, CGEventTapCallBackI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public long invoke(long proxy, int type, long event, long userInfo) { + return delegate.invoke(proxy, type, event, userInfo); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CGEventTapCallBackI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CGEventTapCallBackI.java new file mode 100644 index 00000000..6e81f5b9 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CGEventTapCallBackI.java @@ -0,0 +1,55 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.macosx; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * Instances of this interface may be passed to the {@link CoreGraphics#CGEventTapCreate EventTapCreate} method. + * + *

Type

+ * + *

+ * CGEventRef (*) (
+ *     CGEventTapProxy proxy,
+ *     CGEventType type,
+ *     CGEventRef event,
+ *     void *userInfo
+ * )
+ */ +@FunctionalInterface +@NativeType("CGEventRef (*) (CGEventTapProxy, CGEventType, CGEventRef, void *)") +public interface CGEventTapCallBackI extends CallbackI.P { + + String SIGNATURE = "(pipp)p"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default long callback(long args) { + return invoke( + dcbArgPointer(args), + dcbArgInt(args), + dcbArgPointer(args), + dcbArgPointer(args) + ); + } + + /** + * A client-supplied callback function that’s invoked whenever an associated event tap receives a Quartz event. + * + *

The callback is passed a proxy for the tap, the event type, the incoming event, and the user-defined data specified when the event tap was created. The + * function should return the (possibly modified) passed-in event, a newly constructed event, or {@code NULL} if the event is to be deleted. The event passed to + * the callback is retained by the calling code, and is released after the callback returns and the data is passed back to the event system. If a + * different event is returned by the callback function, then that event will be released by the calling code along with the original event, after the + * event data has been passed back to the event system.

+ */ + @NativeType("CGEventRef") long invoke(@NativeType("CGEventTapProxy") long proxy, @NativeType("CGEventType") int type, @NativeType("CGEventRef") long event, @NativeType("void *") long userInfo); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CGEventTapInformation.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CGEventTapInformation.java new file mode 100644 index 00000000..4139b249 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CGEventTapInformation.java @@ -0,0 +1,374 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.macosx; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * The structure used to report information about event taps. + * + *

Member documentation

+ * + *
    + *
  • {@code tapPoint} – HID, session, annotated session
  • + *
  • {@code options} – listener, filter
  • + *
  • {@code eventsOfInterest} – mask of events being tapped
  • + *
  • {@code tappingProcess} – process that is tapping events
  • + *
  • {@code processBeingTapped} – zero if not a per-process tap
  • + *
  • {@code enabled} – true if tap is enabled
  • + *
  • {@code minUsecLatency} – minimum latency in microseconds
  • + *
  • {@code avgUsecLatency} – average latency in microseconds
  • + *
  • {@code maxUsecLatency} – maximum latency in microseconds
  • + *
+ * + *

Layout

+ * + *

+ * struct CGEventTapInformation {
+ *     uint32_t eventTapID;
+ *     CGEventTapLocation tapPoint;
+ *     CGEventTapOptions options;
+ *     CGEventMask eventsOfInterest;
+ *     pid_t tappingProcess;
+ *     pid_t processBeingTapped;
+ *     bool enabled;
+ *     float minUsecLatency;
+ *     float avgUsecLatency;
+ *     float maxUsecLatency;
+ * }
+ */ +public class CGEventTapInformation extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + EVENTTAPID, + TAPPOINT, + OPTIONS, + EVENTSOFINTEREST, + TAPPINGPROCESS, + PROCESSBEINGTAPPED, + ENABLED, + MINUSECLATENCY, + AVGUSECLATENCY, + MAXUSECLATENCY; + + static { + Layout layout = __struct( + __member(4), + __member(4), + __member(4), + __member(8), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(1), + __member(4), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + EVENTTAPID = layout.offsetof(0); + TAPPOINT = layout.offsetof(1); + OPTIONS = layout.offsetof(2); + EVENTSOFINTEREST = layout.offsetof(3); + TAPPINGPROCESS = layout.offsetof(4); + PROCESSBEINGTAPPED = layout.offsetof(5); + ENABLED = layout.offsetof(6); + MINUSECLATENCY = layout.offsetof(7); + AVGUSECLATENCY = layout.offsetof(8); + MAXUSECLATENCY = layout.offsetof(9); + } + + /** + * Creates a {@code CGEventTapInformation} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public CGEventTapInformation(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code eventTapID} field. */ + @NativeType("uint32_t") + public int eventTapID() { return neventTapID(address()); } + /** Returns the value of the {@code tapPoint} field. */ + @NativeType("CGEventTapLocation") + public int tapPoint() { return ntapPoint(address()); } + /** Returns the value of the {@code options} field. */ + @NativeType("CGEventTapOptions") + public int options() { return noptions(address()); } + /** Returns the value of the {@code eventsOfInterest} field. */ + @NativeType("CGEventMask") + public long eventsOfInterest() { return neventsOfInterest(address()); } + /** Returns the value of the {@code tappingProcess} field. */ + @NativeType("pid_t") + public long tappingProcess() { return ntappingProcess(address()); } + /** Returns the value of the {@code processBeingTapped} field. */ + @NativeType("pid_t") + public long processBeingTapped() { return nprocessBeingTapped(address()); } + /** Returns the value of the {@code enabled} field. */ + @NativeType("bool") + public boolean enabled() { return nenabled(address()); } + /** Returns the value of the {@code minUsecLatency} field. */ + public float minUsecLatency() { return nminUsecLatency(address()); } + /** Returns the value of the {@code avgUsecLatency} field. */ + public float avgUsecLatency() { return navgUsecLatency(address()); } + /** Returns the value of the {@code maxUsecLatency} field. */ + public float maxUsecLatency() { return nmaxUsecLatency(address()); } + + // ----------------------------------- + + /** Returns a new {@code CGEventTapInformation} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static CGEventTapInformation malloc() { + return wrap(CGEventTapInformation.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code CGEventTapInformation} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static CGEventTapInformation calloc() { + return wrap(CGEventTapInformation.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code CGEventTapInformation} instance allocated with {@link BufferUtils}. */ + public static CGEventTapInformation create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(CGEventTapInformation.class, memAddress(container), container); + } + + /** Returns a new {@code CGEventTapInformation} instance for the specified memory address. */ + public static CGEventTapInformation create(long address) { + return wrap(CGEventTapInformation.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static CGEventTapInformation createSafe(long address) { + return address == NULL ? null : wrap(CGEventTapInformation.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code CGEventTapInformation} instance allocated on the thread-local {@link MemoryStack}. */ + public static CGEventTapInformation mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code CGEventTapInformation} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static CGEventTapInformation callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code CGEventTapInformation} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static CGEventTapInformation mallocStack(MemoryStack stack) { + return wrap(CGEventTapInformation.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code CGEventTapInformation} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static CGEventTapInformation callocStack(MemoryStack stack) { + return wrap(CGEventTapInformation.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #eventTapID}. */ + public static int neventTapID(long struct) { return UNSAFE.getInt(null, struct + CGEventTapInformation.EVENTTAPID); } + /** Unsafe version of {@link #tapPoint}. */ + public static int ntapPoint(long struct) { return UNSAFE.getInt(null, struct + CGEventTapInformation.TAPPOINT); } + /** Unsafe version of {@link #options}. */ + public static int noptions(long struct) { return UNSAFE.getInt(null, struct + CGEventTapInformation.OPTIONS); } + /** Unsafe version of {@link #eventsOfInterest}. */ + public static long neventsOfInterest(long struct) { return UNSAFE.getLong(null, struct + CGEventTapInformation.EVENTSOFINTEREST); } + /** Unsafe version of {@link #tappingProcess}. */ + public static long ntappingProcess(long struct) { return memGetAddress(struct + CGEventTapInformation.TAPPINGPROCESS); } + /** Unsafe version of {@link #processBeingTapped}. */ + public static long nprocessBeingTapped(long struct) { return memGetAddress(struct + CGEventTapInformation.PROCESSBEINGTAPPED); } + /** Unsafe version of {@link #enabled}. */ + public static boolean nenabled(long struct) { return UNSAFE.getByte(null, struct + CGEventTapInformation.ENABLED) != 0; } + /** Unsafe version of {@link #minUsecLatency}. */ + public static float nminUsecLatency(long struct) { return UNSAFE.getFloat(null, struct + CGEventTapInformation.MINUSECLATENCY); } + /** Unsafe version of {@link #avgUsecLatency}. */ + public static float navgUsecLatency(long struct) { return UNSAFE.getFloat(null, struct + CGEventTapInformation.AVGUSECLATENCY); } + /** Unsafe version of {@link #maxUsecLatency}. */ + public static float nmaxUsecLatency(long struct) { return UNSAFE.getFloat(null, struct + CGEventTapInformation.MAXUSECLATENCY); } + + // ----------------------------------- + + /** An array of {@link CGEventTapInformation} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final CGEventTapInformation ELEMENT_FACTORY = CGEventTapInformation.create(-1L); + + /** + * Creates a new {@code CGEventTapInformation.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link CGEventTapInformation#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected CGEventTapInformation getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code eventTapID} field. */ + @NativeType("uint32_t") + public int eventTapID() { return CGEventTapInformation.neventTapID(address()); } + /** Returns the value of the {@code tapPoint} field. */ + @NativeType("CGEventTapLocation") + public int tapPoint() { return CGEventTapInformation.ntapPoint(address()); } + /** Returns the value of the {@code options} field. */ + @NativeType("CGEventTapOptions") + public int options() { return CGEventTapInformation.noptions(address()); } + /** Returns the value of the {@code eventsOfInterest} field. */ + @NativeType("CGEventMask") + public long eventsOfInterest() { return CGEventTapInformation.neventsOfInterest(address()); } + /** Returns the value of the {@code tappingProcess} field. */ + @NativeType("pid_t") + public long tappingProcess() { return CGEventTapInformation.ntappingProcess(address()); } + /** Returns the value of the {@code processBeingTapped} field. */ + @NativeType("pid_t") + public long processBeingTapped() { return CGEventTapInformation.nprocessBeingTapped(address()); } + /** Returns the value of the {@code enabled} field. */ + @NativeType("bool") + public boolean enabled() { return CGEventTapInformation.nenabled(address()); } + /** Returns the value of the {@code minUsecLatency} field. */ + public float minUsecLatency() { return CGEventTapInformation.nminUsecLatency(address()); } + /** Returns the value of the {@code avgUsecLatency} field. */ + public float avgUsecLatency() { return CGEventTapInformation.navgUsecLatency(address()); } + /** Returns the value of the {@code maxUsecLatency} field. */ + public float maxUsecLatency() { return CGEventTapInformation.nmaxUsecLatency(address()); } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CGPoint.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CGPoint.java new file mode 100644 index 00000000..245579b6 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CGPoint.java @@ -0,0 +1,315 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.macosx; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * A structure that contains a point in a two-dimensional coordinate system. + * + *

Member documentation

+ * + *
    + *
  • {@code x} – the x-coordinate of the point
  • + *
  • {@code y} – the y-coordinate of the point
  • + *
+ * + *

Layout

+ * + *

+ * struct CGPoint {
+ *     CGFloat x;
+ *     CGFloat y;
+ * }
+ */ +public class CGPoint extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + X, + Y; + + static { + Layout layout = __struct( + __member(8), + __member(8) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + X = layout.offsetof(0); + Y = layout.offsetof(1); + } + + /** + * Creates a {@code CGPoint} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public CGPoint(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code x} field. */ + @NativeType("CGFloat") + public double x() { return nx(address()); } + /** Returns the value of the {@code y} field. */ + @NativeType("CGFloat") + public double y() { return ny(address()); } + + /** Sets the specified value to the {@code x} field. */ + public CGPoint x(@NativeType("CGFloat") double value) { nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public CGPoint y(@NativeType("CGFloat") double value) { ny(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public CGPoint set( + double x, + double y + ) { + x(x); + y(y); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public CGPoint set(CGPoint src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code CGPoint} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static CGPoint malloc() { + return wrap(CGPoint.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code CGPoint} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static CGPoint calloc() { + return wrap(CGPoint.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code CGPoint} instance allocated with {@link BufferUtils}. */ + public static CGPoint create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(CGPoint.class, memAddress(container), container); + } + + /** Returns a new {@code CGPoint} instance for the specified memory address. */ + public static CGPoint create(long address) { + return wrap(CGPoint.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static CGPoint createSafe(long address) { + return address == NULL ? null : wrap(CGPoint.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code CGPoint} instance allocated on the thread-local {@link MemoryStack}. */ + public static CGPoint mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code CGPoint} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static CGPoint callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code CGPoint} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static CGPoint mallocStack(MemoryStack stack) { + return wrap(CGPoint.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code CGPoint} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static CGPoint callocStack(MemoryStack stack) { + return wrap(CGPoint.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #x}. */ + public static double nx(long struct) { return UNSAFE.getDouble(null, struct + CGPoint.X); } + /** Unsafe version of {@link #y}. */ + public static double ny(long struct) { return UNSAFE.getDouble(null, struct + CGPoint.Y); } + + /** Unsafe version of {@link #x(double) x}. */ + public static void nx(long struct, double value) { UNSAFE.putDouble(null, struct + CGPoint.X, value); } + /** Unsafe version of {@link #y(double) y}. */ + public static void ny(long struct, double value) { UNSAFE.putDouble(null, struct + CGPoint.Y, value); } + + // ----------------------------------- + + /** An array of {@link CGPoint} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final CGPoint ELEMENT_FACTORY = CGPoint.create(-1L); + + /** + * Creates a new {@code CGPoint.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link CGPoint#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected CGPoint getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code x} field. */ + @NativeType("CGFloat") + public double x() { return CGPoint.nx(address()); } + /** Returns the value of the {@code y} field. */ + @NativeType("CGFloat") + public double y() { return CGPoint.ny(address()); } + + /** Sets the specified value to the {@code x} field. */ + public Buffer x(@NativeType("CGFloat") double value) { CGPoint.nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public Buffer y(@NativeType("CGFloat") double value) { CGPoint.ny(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CoreFoundation.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CoreFoundation.java new file mode 100644 index 00000000..eebb5b42 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CoreFoundation.java @@ -0,0 +1,268 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.macosx; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to <CoreFoundation.h>. */ +public class CoreFoundation { + + /** Boolean values. */ + public static final byte + TRUE = 1, + FALSE = 0; + + /** Platform-independent built-in encodings; always available on all platforms. */ + public static final int + kCFStringEncodingMacRoman = 0, + kCFStringEncodingWindowsLatin1 = 0x500, + kCFStringEncodingISOLatin1 = 0x201, + kCFStringEncodingNextStepLatin = 0xB01, + kCFStringEncodingASCII = 0x600, + kCFStringEncodingUnicode = 0x100, + kCFStringEncodingUTF8 = 0x8000100, + kCFStringEncodingNonLossyASCII = 0xBFF, + kCFStringEncodingUTF16 = 0x100, + kCFStringEncodingUTF16BE = 0x10000100, + kCFStringEncodingUTF16LE = 0x14000100, + kCFStringEncodingUTF32 = 0xC000100, + kCFStringEncodingUTF32BE = 0x18000100, + kCFStringEncodingUTF32LE = 0x1C000100; + + /** URL path styles. */ + public static final int + kCFURLPOSIXPathStyle = 0, + kCFURLHFSPathStyle = 1, + kCFURLWindowsPathStyle = 2; + + static { Library.initialize(); } + + protected CoreFoundation() { + throw new UnsupportedOperationException(); + } + + // --- [ kCFAllocatorDefault ] --- + + @NativeType("CFAllocatorRef") + private static native long kCFAllocatorDefault(); + + /** This is a synonym for {@code NULL}, if you'd rather use a named constant. */ + public static final long kCFAllocatorDefault = kCFAllocatorDefault(); + + // --- [ kCFAllocatorSystemDefault ] --- + + @NativeType("CFAllocatorRef") + private static native long kCFAllocatorSystemDefault(); + + /** Default system allocator; you rarely need to use this. */ + public static final long kCFAllocatorSystemDefault = kCFAllocatorSystemDefault(); + + // --- [ kCFAllocatorMalloc ] --- + + @NativeType("CFAllocatorRef") + private static native long kCFAllocatorMalloc(); + + /** + * This allocator uses {@code malloc()}, {@code realloc()}, and {@code free()}. This should not be generally used; stick to {@link #kCFAllocatorDefault} + * whenever possible. This allocator is useful as the "bytesDeallocator" in {@code CFData} or "contentsDeallocator" in {@code CFString} where the memory + * was obtained as a result of {@code malloc()} type functions. + */ + public static final long kCFAllocatorMalloc = kCFAllocatorMalloc(); + + // --- [ kCFAllocatorMallocZone ] --- + + @NativeType("CFAllocatorRef") + private static native long kCFAllocatorMallocZone(); + + /** + * This allocator explicitly uses the default malloc zone, returned by {@code malloc_default_zone()}. It should only be used when an object is safe to be + * allocated in non-scanned memory. + */ + public static final long kCFAllocatorMallocZone = kCFAllocatorMallocZone(); + + // --- [ kCFAllocatorNull ] --- + + @NativeType("CFAllocatorRef") + private static native long kCFAllocatorNull(); + + /** + * Null allocator which does nothing and allocates no memory. This allocator is useful as the "bytesDeallocator" in {@code CFData} or "contentsDeallocator" + * in {@code CFString} where the memory should not be freed. + */ + public static final long kCFAllocatorNull = kCFAllocatorNull(); + + // --- [ kCFAllocatorUseContext ] --- + + @NativeType("CFAllocatorRef") + private static native long kCFAllocatorUseContext(); + + /** Special allocator argument to CFAllocatorCreate which means "use the functions given in the context to allocate the allocator itself as well". */ + public static final long kCFAllocatorUseContext = kCFAllocatorUseContext(); + + // --- [ CFRetain ] --- + + /** Unsafe version of: {@link #CFRetain} */ + public static native long nCFRetain(long cf); + + /** + * Retains a Core Foundation object. + * + *

You should retain a Core Foundation object when you receive it from elsewhere (that is, you did not create or copy it) and you want it to persist. If + * you retain a Core Foundation object you are responsible for releasing it.

+ * + * @param cf the CFType object to retain + */ + @NativeType("CFTypeRef") + public static long CFRetain(@NativeType("CFTypeRef") long cf) { + if (CHECKS) { + check(cf); + } + return nCFRetain(cf); + } + + // --- [ CFRelease ] --- + + /** Unsafe version of: {@link #CFRelease} */ + public static native void nCFRelease(long cf); + + /** + * Releases a Core Foundation object. + * + *

If the retain count of {@code cf} becomes zero the memory allocated to the object is deallocated and the object is destroyed. If you create, copy, or + * explicitly retain (see the {@link #CFRetain} function) a Core Foundation object, you are responsible for releasing it when you no longer need it.

+ * + * @param cf the CFType object to release + */ + public static void CFRelease(@NativeType("CFTypeRef") long cf) { + if (CHECKS) { + check(cf); + } + nCFRelease(cf); + } + + // --- [ CFBundleCreate ] --- + + /** Unsafe version of: {@link #CFBundleCreate} */ + public static native long nCFBundleCreate(long allocator, long bundleURL); + + /** + * Creates a {@code CFBundle} object. + * + * @param allocator the allocator to use to allocate memory for the new object. Pass {@code NULL} or {@code kCFAllocatorDefault} to use the current default allocator. + * @param bundleURL the location of the bundle for which to create a {@code CFBundle} object + */ + @NativeType("CFBundleRef") + public static long CFBundleCreate(@NativeType("CFAllocatorRef") long allocator, @NativeType("CFURLRef") long bundleURL) { + if (CHECKS) { + check(bundleURL); + } + return nCFBundleCreate(allocator, bundleURL); + } + + // --- [ CFBundleGetBundleWithIdentifier ] --- + + /** Unsafe version of: {@link #CFBundleGetBundleWithIdentifier} */ + public static native long nCFBundleGetBundleWithIdentifier(long bundleID); + + /** + * Locates a bundle given its program-defined identifier. + * + * @param bundleID the identifier of the bundle to locate. Note that identifier names are case-sensitive. + */ + @NativeType("CFBundleRef") + public static long CFBundleGetBundleWithIdentifier(@NativeType("CFStringRef") long bundleID) { + if (CHECKS) { + check(bundleID); + } + return nCFBundleGetBundleWithIdentifier(bundleID); + } + + // --- [ CFBundleGetFunctionPointerForName ] --- + + /** Unsafe version of: {@link #CFBundleGetFunctionPointerForName} */ + public static native long nCFBundleGetFunctionPointerForName(long bundle, long functionName); + + /** + * Returns a pointer to a function in a bundle’s executable code using the function name as the search key. + * + * @param bundle the bundle to examine + * @param functionName the name of the function to locate + */ + @NativeType("void *") + public static long CFBundleGetFunctionPointerForName(@NativeType("CFBundleRef") long bundle, @NativeType("CFStringRef") long functionName) { + if (CHECKS) { + check(bundle); + check(functionName); + } + return nCFBundleGetFunctionPointerForName(bundle, functionName); + } + + // --- [ CFStringCreateWithCString ] --- + + /** Unsafe version of: {@link #CFStringCreateWithCString} */ + public static native long nCFStringCreateWithCString(long allocator, long cStr, int encoding); + + /** + * Creates an immutable string from a C string. + * + * @param allocator the allocator to use to allocate memory for the new object. Pass {@code NULL} or {@code kCFAllocatorDefault} to use the current default allocator. + * @param cStr the {@code NULL}-terminated C string to be used to create the {@code CFString} object. The string must use an 8-bit encoding. + * @param encoding the encoding of the characters in the C string. The encoding must specify an 8-bit encoding. One of:
{@link #kCFStringEncodingMacRoman}{@link #kCFStringEncodingWindowsLatin1}{@link #kCFStringEncodingISOLatin1}
{@link #kCFStringEncodingNextStepLatin}{@link #kCFStringEncodingASCII}{@link #kCFStringEncodingUnicode}
{@link #kCFStringEncodingUTF8}{@link #kCFStringEncodingNonLossyASCII}{@link #kCFStringEncodingUTF16}
{@link #kCFStringEncodingUTF16BE}{@link #kCFStringEncodingUTF16LE}{@link #kCFStringEncodingUTF32}
{@link #kCFStringEncodingUTF32BE}{@link #kCFStringEncodingUTF32LE}
+ */ + @NativeType("CFStringRef") + public static long CFStringCreateWithCString(@NativeType("CFAllocatorRef") long allocator, @NativeType("char const *") ByteBuffer cStr, @NativeType("CFStringEncoding") int encoding) { + return nCFStringCreateWithCString(allocator, memAddress(cStr), encoding); + } + + // --- [ CFStringCreateWithCStringNoCopy ] --- + + /** Unsafe version of: {@link #CFStringCreateWithCStringNoCopy} */ + public static native long nCFStringCreateWithCStringNoCopy(long allocator, long cStr, int encoding, long contentsDeallocator); + + /** + * Creates a CFString object from an external C string buffer that might serve as the backing store for the object. + * + * @param allocator the allocator to use to allocate memory for the new object. Pass {@code NULL} or {@code kCFAllocatorDefault} to use the current default allocator. + * @param cStr the {@code NULL}-terminated C string to be used to create the {@code CFString} object. The string must use an 8-bit encoding. + * @param encoding the encoding of the characters in the C string. The encoding must specify an 8-bit encoding. One of:
{@link #kCFStringEncodingMacRoman}{@link #kCFStringEncodingWindowsLatin1}{@link #kCFStringEncodingISOLatin1}
{@link #kCFStringEncodingNextStepLatin}{@link #kCFStringEncodingASCII}{@link #kCFStringEncodingUnicode}
{@link #kCFStringEncodingUTF8}{@link #kCFStringEncodingNonLossyASCII}{@link #kCFStringEncodingUTF16}
{@link #kCFStringEncodingUTF16BE}{@link #kCFStringEncodingUTF16LE}{@link #kCFStringEncodingUTF32}
{@link #kCFStringEncodingUTF32BE}{@link #kCFStringEncodingUTF32LE}
+ * @param contentsDeallocator the {@code CFAllocator} object to use to deallocate the external string buffer when it is no longer needed. You can pass {@code NULL} or + * {@code kCFAllocatorDefault} to request the default allocator for this purpose. If the buffer does not need to be deallocated, or if you want to + * assume responsibility for deallocating the buffer (and not have the {@code CFString} object deallocate it), pass {@code kCFAllocatorNull}. + */ + @NativeType("CFStringRef") + public static long CFStringCreateWithCStringNoCopy(@NativeType("CFAllocatorRef") long allocator, @NativeType("char const *") ByteBuffer cStr, @NativeType("CFStringEncoding") int encoding, @NativeType("CFAllocatorRef") long contentsDeallocator) { + return nCFStringCreateWithCStringNoCopy(allocator, memAddress(cStr), encoding, contentsDeallocator); + } + + // --- [ CFURLCreateWithFileSystemPath ] --- + + /** Unsafe version of: {@link #CFURLCreateWithFileSystemPath} */ + public static native long nCFURLCreateWithFileSystemPath(long allocator, long filePath, long pathStyle, boolean isDirectory); + + /** + * Creates a {@code CFURL} object using a local file system path string. + * + * @param allocator the allocator to use to allocate memory for the new object. Pass {@code NULL} or {@code kCFAllocatorDefault} to use the current default allocator. + * @param filePath the path string to convert to a {@code CFURL} object. If {@code filePath} is not absolute, the resulting URL will be considered relative to the + * current working directory (evaluated when this function is being invoked). + * @param pathStyle the operating system path style used in {@code filePath}. One of:
{@link #kCFURLPOSIXPathStyle}{@link #kCFURLHFSPathStyle}{@link #kCFURLWindowsPathStyle}
+ * @param isDirectory a Boolean value that specifies whether filePath is treated as a directory path when resolving against relative path components. Pass true if the + * pathname indicates a directory, false otherwise. + */ + @NativeType("CFURLRef") + public static long CFURLCreateWithFileSystemPath(@NativeType("CFAllocatorRef") long allocator, @NativeType("CFStringRef") long filePath, @NativeType("CFURLPathStyle") long pathStyle, @NativeType("Boolean") boolean isDirectory) { + if (CHECKS) { + check(filePath); + } + return nCFURLCreateWithFileSystemPath(allocator, filePath, pathStyle, isDirectory); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CoreGraphics.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CoreGraphics.java new file mode 100644 index 00000000..265895ce --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/CoreGraphics.java @@ -0,0 +1,1001 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.macosx; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to <CoreGraphics.h>. */ +public class CoreGraphics { + + /** + * Types used for errors and error handlers. ({@code CGError}) + * + *
Enum values:
+ * + *
    + *
  • {@link #kCGErrorSuccess ErrorSuccess}
  • + *
  • {@link #kCGErrorFailure ErrorFailure}
  • + *
  • {@link #kCGErrorIllegalArgument ErrorIllegalArgument}
  • + *
  • {@link #kCGErrorInvalidConnection ErrorInvalidConnection}
  • + *
  • {@link #kCGErrorInvalidContext ErrorInvalidContext}
  • + *
  • {@link #kCGErrorCannotComplete ErrorCannotComplete}
  • + *
  • {@link #kCGErrorNotImplemented ErrorNotImplemented}
  • + *
  • {@link #kCGErrorRangeCheck ErrorRangeCheck}
  • + *
  • {@link #kCGErrorTypeCheck ErrorTypeCheck}
  • + *
  • {@link #kCGErrorInvalidOperation ErrorInvalidOperation}
  • + *
  • {@link #kCGErrorNoneAvailable ErrorNoneAvailable}
  • + *
+ */ + public static final int + kCGErrorSuccess = 0, + kCGErrorFailure = 1000, + kCGErrorIllegalArgument = 1001, + kCGErrorInvalidConnection = 1002, + kCGErrorInvalidContext = 1003, + kCGErrorCannotComplete = 1004, + kCGErrorNotImplemented = 1006, + kCGErrorRangeCheck = 1007, + kCGErrorTypeCheck = 1008, + kCGErrorInvalidOperation = 1010, + kCGErrorNoneAvailable = 1011; + + /** + * Event types. ({@code CGEventType}) + * + *
Enum values:
+ * + *
    + *
  • {@link #kCGEventNull EventNull}
  • + *
  • {@link #kCGEventLeftMouseDown EventLeftMouseDown}
  • + *
  • {@link #kCGEventLeftMouseUp EventLeftMouseUp}
  • + *
  • {@link #kCGEventRightMouseDown EventRightMouseDown}
  • + *
  • {@link #kCGEventRightMouseUp EventRightMouseUp}
  • + *
  • {@link #kCGEventMouseMoved EventMouseMoved}
  • + *
  • {@link #kCGEventLeftMouseDragged EventLeftMouseDragged}
  • + *
  • {@link #kCGEventRightMouseDragged EventRightMouseDragged}
  • + *
  • {@link #kCGEventKeyDown EventKeyDown}
  • + *
  • {@link #kCGEventKeyUp EventKeyUp}
  • + *
  • {@link #kCGEventFlagsChanged EventFlagsChanged}
  • + *
  • {@link #kCGEventScrollWheel EventScrollWheel}
  • + *
  • {@link #kCGEventTabletPointer EventTabletPointer}
  • + *
  • {@link #kCGEventTabletProximity EventTabletProximity}
  • + *
  • {@link #kCGEventOtherMouseDown EventOtherMouseDown}
  • + *
  • {@link #kCGEventOtherMouseUp EventOtherMouseUp}
  • + *
  • {@link #kCGEventOtherMouseDragged EventOtherMouseDragged}
  • + *
  • {@link #kCGEventTapDisabledByTimeout EventTapDisabledByTimeout}
  • + *
  • {@link #kCGEventTapDisabledByUserInput EventTapDisabledByUserInput}
  • + *
+ */ + public static final int + kCGEventNull = 0, + kCGEventLeftMouseDown = 1, + kCGEventLeftMouseUp = 2, + kCGEventRightMouseDown = 3, + kCGEventRightMouseUp = 4, + kCGEventMouseMoved = 5, + kCGEventLeftMouseDragged = 6, + kCGEventRightMouseDragged = 7, + kCGEventKeyDown = 0xA, + kCGEventKeyUp = 0xB, + kCGEventFlagsChanged = 0xC, + kCGEventScrollWheel = 0x16, + kCGEventTabletPointer = 0x17, + kCGEventTabletProximity = 0x18, + kCGEventOtherMouseDown = 0x19, + kCGEventOtherMouseUp = 0x1A, + kCGEventOtherMouseDragged = 0x1B, + kCGEventTapDisabledByTimeout = 0xFFFFFFFE, + kCGEventTapDisabledByUserInput = 0xFFFFFFFF; + + /** + * Constants that specify buttons on a one, two, or three-button mouse. ({@code CGMouseButton}) + * + *
Enum values:
+ * + *
    + *
  • {@link #kCGMouseButtonLeft MouseButtonLeft}
  • + *
  • {@link #kCGMouseButtonRight MouseButtonRight}
  • + *
  • {@link #kCGMouseButtonCenter MouseButtonCenter}
  • + *
+ */ + public static final int + kCGMouseButtonLeft = 0, + kCGMouseButtonRight = 1, + kCGMouseButtonCenter = 2; + + /** + * {@code CGEventTapLocation} + * + *
Enum values:
+ * + *
    + *
  • {@link #kCGHIDEventTap HIDEventTap} - Specifies that an event tap is placed at the point where HID system events enter the window server.
  • + *
  • {@link #kCGSessionEventTap SessionEventTap} - Specifies that an event tap is placed at the point where HID system and remote control events enter a login session.
  • + *
  • {@link #kCGAnnotatedSessionEventTap AnnotatedSessionEventTap} - Specifies that an event tap is placed at the point where session events have been annotated to flow to an application.
  • + *
+ */ + public static final int + kCGHIDEventTap = 0x0, + kCGSessionEventTap = 0x1, + kCGAnnotatedSessionEventTap = 0x2; + + /** + * Constants that specify the unit of measurement for a scrolling event. ({@code CGScrollEventUnit}) + * + *
Enum values:
+ * + *
    + *
  • {@link #kCGScrollEventUnitPixel ScrollEventUnitPixel} - Specifies that the unit of measurement is pixels.
  • + *
  • {@link #kCGScrollEventUnitLine ScrollEventUnitLine} - Specifies that the unit of measurement is lines.
  • + *
+ */ + public static final int + kCGScrollEventUnitPixel = 0, + kCGScrollEventUnitLine = 1; + + /** + * Constants used as keys to access specialized fields in low-level events. ({@code CGEventField}) + * + *
Enum values:
+ * + *
    + *
  • {@link #kCGMouseEventNumber MouseEventNumber} - + * Key to access an integer field that contains the mouse button event number. + * + *

    Matching mouse-down and mouse-up events will have the same event number.

    + *
  • + *
  • {@link #kCGMouseEventClickState MouseEventClickState} - + * Key to access an integer field that contains the mouse button click state. + * + *

    A click state of 1 represents a single click. A click state of 2 represents a double-click. A click state of 3 represents a triple-click.

    + *
  • + *
  • {@link #kCGMouseEventPressure MouseEventPressure} - + * Key to access a double field that contains the mouse button pressure. + * + *

    The pressure value may range from 0 to 1, with 0 representing the mouse being up. This value is commonly set by tablet pens mimicking a mouse.

    + *
  • + *
  • {@link #kCGMouseEventButtonNumber MouseEventButtonNumber} - Key to access an integer field that contains the mouse button number.
  • + *
  • {@link #kCGMouseEventDeltaX MouseEventDeltaX} - Key to access an integer field that contains the horizontal mouse delta since the last mouse movement event.
  • + *
  • {@link #kCGMouseEventDeltaY MouseEventDeltaY} - Key to access an integer field that contains the vertical mouse delta since the last mouse movement event.
  • + *
  • {@link #kCGMouseEventInstantMouser MouseEventInstantMouser} - Key to access an integer field. The value is non-zero if the event should be ignored by the Inkwell subsystem.
  • + *
  • {@link #kCGMouseEventSubtype MouseEventSubtype} - Key to access an integer field that encodes the mouse event subtype as a {@code kCFNumberIntType}.
  • + *
  • {@link #kCGKeyboardEventAutorepeat KeyboardEventAutorepeat} - Key to access an integer field, non-zero when this is an autorepeat of a key-down, and zero otherwise.
  • + *
  • {@link #kCGKeyboardEventKeycode KeyboardEventKeycode} - Key to access an integer field that contains the virtual keycode of the key-down or key-up event.
  • + *
  • {@link #kCGKeyboardEventKeyboardType KeyboardEventKeyboardType} - Key to access an integer field that contains the keyboard type identifier.
  • + *
  • {@link #kCGScrollWheelEventDeltaAxis1 ScrollWheelEventDeltaAxis1} - + * Key to access an integer field that contains scrolling data. + * + *

    This field typically contains the change in vertical position since the last scrolling event from a Mighty Mouse scroller or a single-wheel mouse + * scroller.

    + *
  • + *
  • {@link #kCGScrollWheelEventDeltaAxis2 ScrollWheelEventDeltaAxis2} - + * Key to access an integer field that contains scrolling data. + * + *

    This field typically contains the change in horizontal position since the last scrolling event from a Mighty Mouse scroller.

    + *
  • + *
  • {@link #kCGScrollWheelEventDeltaAxis3 ScrollWheelEventDeltaAxis3} - This field is not used.
  • + *
  • {@link #kCGScrollWheelEventFixedPtDeltaAxis1 ScrollWheelEventFixedPtDeltaAxis1} - + * Key to access a field that contains scrolling data. + * + *

    The scrolling data represents a line-based or pixel-based change in vertical position since the last scrolling event from a Mighty Mouse scroller + * or a single-wheel mouse scroller. The scrolling data uses a fixed-point 16.16 signed integer format. If this key is passed to + * {@link #CGEventGetDoubleValueField EventGetDoubleValueField}, the fixed-point value is converted to a double value.

    + *
  • + *
  • {@link #kCGScrollWheelEventFixedPtDeltaAxis2 ScrollWheelEventFixedPtDeltaAxis2} - + * Key to access a field that contains scrolling data. + * + *

    The scrolling data represents a line-based or pixel-based change in horizontal position since the last scrolling event from a Mighty Mouse + * scroller. The scrolling data uses a fixed-point 16.16 signed integer format. If this key is passed to {@link #CGEventGetDoubleValueField EventGetDoubleValueField}, the fixed-point + * value is converted to a double value.

    + *
  • + *
  • {@link #kCGScrollWheelEventFixedPtDeltaAxis3 ScrollWheelEventFixedPtDeltaAxis3} - This field is not used.
  • + *
  • {@link #kCGScrollWheelEventPointDeltaAxis1 ScrollWheelEventPointDeltaAxis1} - + * Key to access an integer field that contains pixel-based scrolling data. + * + *

    The scrolling data represents the change in vertical position since the last scrolling event from a Mighty Mouse scroller or a single-wheel mouse + * scroller.

    + *
  • + *
  • {@link #kCGScrollWheelEventPointDeltaAxis2 ScrollWheelEventPointDeltaAxis2} - + * Key to access an integer field that contains pixel-based scrolling data. + * + *

    The scrolling data represents the change in horizontal position since the last scrolling event from a Mighty Mouse scroller.

    + *
  • + *
  • {@link #kCGScrollWheelEventPointDeltaAxis3 ScrollWheelEventPointDeltaAxis3} - This field is not used.
  • + *
  • {@link #kCGScrollWheelEventScrollPhase ScrollWheelEventScrollPhase}
  • + *
  • {@link #kCGScrollWheelEventScrollCount ScrollWheelEventScrollCount} - rdar://11259169
  • + *
  • {@link #kCGScrollWheelEventMomentumPhase ScrollWheelEventMomentumPhase}
  • + *
  • {@link #kCGScrollWheelEventInstantMouser ScrollWheelEventInstantMouser} - + * Key to access an integer field that indicates whether the event should be ignored by the Inkwell subsystem. + * + *

    If the value is non-zero, the event should be ignored.

    + *
  • + *
  • {@link #kCGTabletEventPointX TabletEventPointX} - Key to access an integer field that contains the absolute X coordinate in tablet space at full tablet resolution.
  • + *
  • {@link #kCGTabletEventPointY TabletEventPointY} - Key to access an integer field that contains the absolute Y coordinate in tablet space at full tablet resolution.
  • + *
  • {@link #kCGTabletEventPointZ TabletEventPointZ} - Key to access an integer field that contains the absolute Z coordinate in tablet space at full tablet resolution.
  • + *
  • {@link #kCGTabletEventPointButtons TabletEventPointButtons} - + * Key to access an integer field that contains the tablet button state. + * + *

    Bit 0 is the first button, and a set bit represents a closed or pressed button. Up to 16 buttons are supported.

    + *
  • + *
  • {@link #kCGTabletEventPointPressure TabletEventPointPressure} - + * Key to access a double field that contains the tablet pen pressure. + * + *

    A value of 0.0 represents no pressure, and 1.0 represents maximum pressure.

    + *
  • + *
  • {@link #kCGTabletEventTiltX TabletEventTiltX} - + * Key to access a double field that contains the horizontal tablet pen tilt. + * + *

    A value of 0 represents no tilt, and 1 represents maximum tilt.

    + *
  • + *
  • {@link #kCGTabletEventTiltY TabletEventTiltY} - + * Key to access a double field that contains the vertical tablet pen tilt. + * + *

    A value of 0 represents no tilt, and 1 represents maximum tilt.

    + *
  • + *
  • {@link #kCGTabletEventRotation TabletEventRotation} - Key to access a double field that contains the tablet pen rotation.
  • + *
  • {@link #kCGTabletEventTangentialPressure TabletEventTangentialPressure} - + * Key to access a double field that contains the tangential pressure on the device. + * + *

    A value of 0.0 represents no pressure, and 1.0 represents maximum pressure.

    + *
  • + *
  • {@link #kCGTabletEventDeviceID TabletEventDeviceID} - Key to access an integer field that contains the system-assigned unique device ID.
  • + *
  • {@link #kCGTabletEventVendor1 TabletEventVendor1} - Key to access an integer field that contains a vendor-specified value.
  • + *
  • {@link #kCGTabletEventVendor2 TabletEventVendor2} - Key to access an integer field that contains a vendor-specified value.
  • + *
  • {@link #kCGTabletEventVendor3 TabletEventVendor3} - Key to access an integer field that contains a vendor-specified value.
  • + *
  • {@link #kCGTabletProximityEventVendorID TabletProximityEventVendorID} - Key to access an integer field that contains the vendor-defined ID, typically the USB vendor ID.
  • + *
  • {@link #kCGTabletProximityEventTabletID TabletProximityEventTabletID} - Key to access an integer field that contains the vendor-defined tablet ID, typically the USB product ID.
  • + *
  • {@link #kCGTabletProximityEventPointerID TabletProximityEventPointerID} - Key to access an integer field that contains the vendor-defined ID of the pointing device.
  • + *
  • {@link #kCGTabletProximityEventDeviceID TabletProximityEventDeviceID} - Key to access an integer field that contains the system-assigned device ID.
  • + *
  • {@link #kCGTabletProximityEventSystemTabletID TabletProximityEventSystemTabletID} - Key to access an integer field that contains the system-assigned unique tablet ID.
  • + *
  • {@link #kCGTabletProximityEventVendorPointerType TabletProximityEventVendorPointerType} - Key to access an integer field that contains the vendor-assigned pointer type.
  • + *
  • {@link #kCGTabletProximityEventVendorPointerSerialNumber TabletProximityEventVendorPointerSerialNumber} - Key to access an integer field that contains the vendor-defined pointer serial number.
  • + *
  • {@link #kCGTabletProximityEventVendorUniqueID TabletProximityEventVendorUniqueID} - Key to access an integer field that contains the vendor-defined unique ID.
  • + *
  • {@link #kCGTabletProximityEventCapabilityMask TabletProximityEventCapabilityMask} - Key to access an integer field that contains the device capabilities mask.
  • + *
  • {@link #kCGTabletProximityEventPointerType TabletProximityEventPointerType} - Key to access an integer field that contains the pointer type.
  • + *
  • {@link #kCGTabletProximityEventEnterProximity TabletProximityEventEnterProximity} - + * Key to access an integer field that indicates whether the pen is in proximity to the tablet. + * + *

    The value is non-zero if the pen is in proximity to the tablet and zero when leaving the tablet.

    + *
  • + *
  • {@link #kCGEventTargetProcessSerialNumber EventTargetProcessSerialNumber} - Key to access a field that contains the event target process serial number. The value is a 64-bit value.
  • + *
  • {@link #kCGEventTargetUnixProcessID EventTargetUnixProcessID} - Key to access a field that contains the event target Unix process ID.
  • + *
  • {@link #kCGEventSourceUnixProcessID EventSourceUnixProcessID} - Key to access a field that contains the event source Unix process ID.
  • + *
  • {@link #kCGEventSourceUserData EventSourceUserData} - Key to access a field that contains the event source user-supplied data, up to 64 bits.
  • + *
  • {@link #kCGEventSourceUserID EventSourceUserID} - Key to access a field that contains the event source Unix effective UID.
  • + *
  • {@link #kCGEventSourceGroupID EventSourceGroupID} - Key to access a field that contains the event source Unix effective GID.
  • + *
  • {@link #kCGEventSourceStateID EventSourceStateID} - Key to access a field that contains the event source state ID used to create this event.
  • + *
  • {@link #kCGScrollWheelEventIsContinuous ScrollWheelEventIsContinuous} - + * Key to access an integer field that indicates whether a scrolling event contains continuous, pixel-based scrolling data. + * + *

    The value is non-zero when the scrolling data is pixel-based and zero when the scrolling data is line-based.

    + *
  • + *
  • {@link #kCGMouseEventWindowUnderMousePointer MouseEventWindowUnderMousePointer}
  • + *
  • {@link #kCGMouseEventWindowUnderMousePointerThatCanHandleThisEvent MouseEventWindowUnderMousePointerThatCanHandleThisEvent}
  • + *
+ */ + public static final int + kCGMouseEventNumber = 0, + kCGMouseEventClickState = 1, + kCGMouseEventPressure = 2, + kCGMouseEventButtonNumber = 3, + kCGMouseEventDeltaX = 4, + kCGMouseEventDeltaY = 5, + kCGMouseEventInstantMouser = 6, + kCGMouseEventSubtype = 7, + kCGKeyboardEventAutorepeat = 8, + kCGKeyboardEventKeycode = 9, + kCGKeyboardEventKeyboardType = 10, + kCGScrollWheelEventDeltaAxis1 = 11, + kCGScrollWheelEventDeltaAxis2 = 12, + kCGScrollWheelEventDeltaAxis3 = 13, + kCGScrollWheelEventFixedPtDeltaAxis1 = 93, + kCGScrollWheelEventFixedPtDeltaAxis2 = 94, + kCGScrollWheelEventFixedPtDeltaAxis3 = 95, + kCGScrollWheelEventPointDeltaAxis1 = 96, + kCGScrollWheelEventPointDeltaAxis2 = 97, + kCGScrollWheelEventPointDeltaAxis3 = 98, + kCGScrollWheelEventScrollPhase = 99, + kCGScrollWheelEventScrollCount = 100, + kCGScrollWheelEventMomentumPhase = 123, + kCGScrollWheelEventInstantMouser = 14, + kCGTabletEventPointX = 15, + kCGTabletEventPointY = 16, + kCGTabletEventPointZ = 17, + kCGTabletEventPointButtons = 18, + kCGTabletEventPointPressure = 19, + kCGTabletEventTiltX = 20, + kCGTabletEventTiltY = 21, + kCGTabletEventRotation = 22, + kCGTabletEventTangentialPressure = 23, + kCGTabletEventDeviceID = 24, + kCGTabletEventVendor1 = 25, + kCGTabletEventVendor2 = 26, + kCGTabletEventVendor3 = 27, + kCGTabletProximityEventVendorID = 28, + kCGTabletProximityEventTabletID = 29, + kCGTabletProximityEventPointerID = 30, + kCGTabletProximityEventDeviceID = 31, + kCGTabletProximityEventSystemTabletID = 32, + kCGTabletProximityEventVendorPointerType = 33, + kCGTabletProximityEventVendorPointerSerialNumber = 34, + kCGTabletProximityEventVendorUniqueID = 35, + kCGTabletProximityEventCapabilityMask = 36, + kCGTabletProximityEventPointerType = 37, + kCGTabletProximityEventEnterProximity = 38, + kCGEventTargetProcessSerialNumber = 39, + kCGEventTargetUnixProcessID = 40, + kCGEventSourceUnixProcessID = 41, + kCGEventSourceUserData = 42, + kCGEventSourceUserID = 43, + kCGEventSourceGroupID = 44, + kCGEventSourceStateID = 45, + kCGScrollWheelEventIsContinuous = 88, + kCGMouseEventWindowUnderMousePointer = 91, + kCGMouseEventWindowUnderMousePointerThatCanHandleThisEvent = 92; + + /** + * Constants used with the {@link #kCGMouseEventSubtype MouseEventSubtype} event field. ({@code CGEventMouseSubtype}) + * + *
Enum values:
+ * + *
    + *
  • {@link #kCGEventMouseSubtypeDefault EventMouseSubtypeDefault}
  • + *
  • {@link #kCGEventMouseSubtypeTabletPoint EventMouseSubtypeTabletPoint}
  • + *
  • {@link #kCGEventMouseSubtypeTabletProximity EventMouseSubtypeTabletProximity}
  • + *
+ */ + public static final int + kCGEventMouseSubtypeDefault = 0, + kCGEventMouseSubtypeTabletPoint = 1, + kCGEventMouseSubtypeTabletProximity = 2; + + protected CoreGraphics() { + throw new UnsupportedOperationException(); + } + + private static final SharedLibrary COREGRAPHICS = Library.loadNative(CoreGraphics.class, "org.lwjgl", "/System/Library/Frameworks/CoreGraphics.framework"); + + /** Contains the function pointers loaded from the CoreGraphics {@link SharedLibrary}. */ + public static final class Functions { + + private Functions() {} + + /** Function address. */ + public static final long + EventGetTypeID = apiGetFunctionAddress(COREGRAPHICS, "CGEventGetTypeID"), + EventCreate = apiGetFunctionAddress(COREGRAPHICS, "CGEventCreate"), + EventCreateData = apiGetFunctionAddress(COREGRAPHICS, "CGEventCreateData"), + EventCreateFromData = apiGetFunctionAddress(COREGRAPHICS, "CGEventCreateFromData"), + EventCreateMouseEvent = apiGetFunctionAddress(COREGRAPHICS, "CGEventCreateMouseEvent"), + EventCreateKeyboardEvent = apiGetFunctionAddress(COREGRAPHICS, "CGEventCreateKeyboardEvent"), + EventCreateScrollWheelEvent = apiGetFunctionAddress(COREGRAPHICS, "CGEventCreateScrollWheelEvent"), + EventCreateScrollWheelEvent2 = COREGRAPHICS.getFunctionAddress("CGEventCreateScrollWheelEvent2"), + EventCreateCopy = apiGetFunctionAddress(COREGRAPHICS, "CGEventCreateCopy"), + EventCreateSourceFromEvent = apiGetFunctionAddress(COREGRAPHICS, "CGEventCreateSourceFromEvent"), + EventSetSource = apiGetFunctionAddress(COREGRAPHICS, "CGEventSetSource"), + EventGetType = apiGetFunctionAddress(COREGRAPHICS, "CGEventGetType"), + EventSetType = apiGetFunctionAddress(COREGRAPHICS, "CGEventSetType"), + EventGetTimestamp = apiGetFunctionAddress(COREGRAPHICS, "CGEventGetTimestamp"), + EventSetTimestamp = apiGetFunctionAddress(COREGRAPHICS, "CGEventSetTimestamp"), + EventGetLocation = apiGetFunctionAddress(COREGRAPHICS, "CGEventGetLocation"), + EventGetUnflippedLocation = apiGetFunctionAddress(COREGRAPHICS, "CGEventGetUnflippedLocation"), + EventSetLocation = apiGetFunctionAddress(COREGRAPHICS, "CGEventSetLocation"), + EventGetFlags = apiGetFunctionAddress(COREGRAPHICS, "CGEventGetFlags"), + EventSetFlags = apiGetFunctionAddress(COREGRAPHICS, "CGEventSetFlags"), + EventKeyboardGetUnicodeString = apiGetFunctionAddress(COREGRAPHICS, "CGEventKeyboardGetUnicodeString"), + EventKeyboardSetUnicodeString = apiGetFunctionAddress(COREGRAPHICS, "CGEventKeyboardSetUnicodeString"), + EventGetIntegerValueField = apiGetFunctionAddress(COREGRAPHICS, "CGEventGetIntegerValueField"), + EventSetIntegerValueField = apiGetFunctionAddress(COREGRAPHICS, "CGEventSetIntegerValueField"), + EventGetDoubleValueField = apiGetFunctionAddress(COREGRAPHICS, "CGEventGetDoubleValueField"), + EventSetDoubleValueField = apiGetFunctionAddress(COREGRAPHICS, "CGEventSetDoubleValueField"), + EventTapCreate = apiGetFunctionAddress(COREGRAPHICS, "CGEventTapCreate"), + EventTapCreateForPid = COREGRAPHICS.getFunctionAddress("CGEventTapCreateForPid"), + EventTapEnable = apiGetFunctionAddress(COREGRAPHICS, "CGEventTapEnable"), + EventTapIsEnabled = apiGetFunctionAddress(COREGRAPHICS, "CGEventTapIsEnabled"), + EventTapPostEvent = apiGetFunctionAddress(COREGRAPHICS, "CGEventTapPostEvent"), + EventPost = apiGetFunctionAddress(COREGRAPHICS, "CGEventPost"), + EventPostToPid = COREGRAPHICS.getFunctionAddress("CGEventPostToPid"), + GetEventTapList = apiGetFunctionAddress(COREGRAPHICS, "CGGetEventTapList"); + + } + + /** Returns the CoreGraphics {@link SharedLibrary}. */ + public static SharedLibrary getLibrary() { + return COREGRAPHICS; + } + + // --- [ CGEventGetTypeID ] --- + + /** Returns the type identifier for the opaque type {@code CGEventRef}. */ + @NativeType("CFTypeID") + public static long CGEventGetTypeID() { + long __functionAddress = Functions.EventGetTypeID; + return invokeJ(__functionAddress); + } + + // --- [ CGEventCreate ] --- + + /** Returns a new event using the event source {@code source}. If {@code source} is {@code NULL}, the default source is used. */ + @NativeType("CGEventRef") + public static long CGEventCreate(@NativeType("CGEventSourceRef") long source) { + long __functionAddress = Functions.EventCreate; + return invokePP(source, __functionAddress); + } + + // --- [ CGEventCreateData ] --- + + /** Return a "flattened" data representation of an event. */ + @NativeType("CFDataRef") + public static long CGEventCreateData(@NativeType("CFAllocatorRef") long allocator, @NativeType("CGEventRef") long event) { + long __functionAddress = Functions.EventCreateData; + return invokePPP(allocator, event, __functionAddress); + } + + // --- [ CGEventCreateFromData ] --- + + /** Returns an event created from a "flattened" data representation of the event. */ + @NativeType("CGEventRef") + public static long CGEventCreateFromData(@NativeType("CFAllocatorRef") long allocator, @NativeType("CFDataRef") long data) { + long __functionAddress = Functions.EventCreateFromData; + return invokePPP(allocator, data, __functionAddress); + } + + // --- [ CGEventCreateMouseEvent ] --- + + /** Unsafe version of: {@link #CGEventCreateMouseEvent EventCreateMouseEvent} */ + public static native long nCGEventCreateMouseEvent(long source, int mouseType, long mouseCursorPosition, int mouseButton, long __functionAddress); + + /** Unsafe version of: {@link #CGEventCreateMouseEvent EventCreateMouseEvent} */ + public static long nCGEventCreateMouseEvent(long source, int mouseType, long mouseCursorPosition, int mouseButton) { + long __functionAddress = Functions.EventCreateMouseEvent; + return nCGEventCreateMouseEvent(source, mouseType, mouseCursorPosition, mouseButton, __functionAddress); + } + + /** + * Returns a new mouse event. + * + *

The event source may be taken from another event, or may be {@code NULL}. {@code mouseType} should be one of the mouse event types. + * {@code mouseCursorPosition} should be the position of the mouse cursor in global coordinates. {@code mouseButton} should be the button that's changing + * state; {@code mouseButton} is ignored unless {@code mouseType} is one of {@link #kCGEventOtherMouseDown EventOtherMouseDown}, {@link #kCGEventOtherMouseDragged EventOtherMouseDragged}, or {@link #kCGEventOtherMouseUp EventOtherMouseUp}.

+ * + *

The current implemementation of the event system supports a maximum of thirty-two buttons. Mouse button 0 is the primary button on the mouse. Mouse + * button 1 is the secondary mouse button (right). Mouse button 2 is the center button, and the remaining buttons are in USB device order.

+ */ + @NativeType("CGEventRef") + public static long CGEventCreateMouseEvent(@NativeType("CGEventSourceRef") long source, @NativeType("CGEventType") int mouseType, CGPoint mouseCursorPosition, @NativeType("CGMouseButton") int mouseButton) { + return nCGEventCreateMouseEvent(source, mouseType, mouseCursorPosition.address(), mouseButton); + } + + // --- [ CGEventCreateKeyboardEvent ] --- + + /** + * Returns a new keyboard event. + * + *

The event source may be taken from another event, or may be {@code NULL}. Based on the virtual key code values entered, the appropriate key down, key up, or + * flags changed events are generated.

+ * + *

All keystrokes needed to generate a character must be entered, including SHIFT, CONTROL, OPTION, and COMMAND keys. For example, to produce a 'Z', the + * SHIFT key must be down, the 'z' key must go down, and then the SHIFT and 'z' key must be released:

+ * + *

+     * CGEventCreateKeyboardEvent(source, (CGKeyCode)56, true);  // shift down
+     * CGEventCreateKeyboardEvent(source, (CGKeyCode) 6, true);  // 'z' down
+     * CGEventCreateKeyboardEvent(source, (CGKeyCode) 6, false); // 'z' up
+     * CGEventCreateKeyboardEvent(source, (CGKeyCode)56, false); // 'shift up
+ */ + @NativeType("CGEventRef") + public static long CGEventCreateKeyboardEvent(@NativeType("CGEventSourceRef") long source, @NativeType("CGKeyCode") short virtualKey, @NativeType("bool") boolean keyDown) { + long __functionAddress = Functions.EventCreateKeyboardEvent; + return invokePP(source, virtualKey, keyDown, __functionAddress); + } + + // --- [ CGEventCreateScrollWheelEvent ] --- + + /** + * Returns a new scrollwheel event. + * + *

The event source may be taken from another event, or may be {@code NULL}. The scrolling units may be specified in lines using {@link #kCGScrollEventUnitLine ScrollEventUnitLine} or in + * pixels using {@link #kCGScrollEventUnitPixel ScrollEventUnitPixel}. {@link #kCGScrollEventUnitPixel ScrollEventUnitPixel} will produce an event that most applications interpret as a smooth scrolling event.

+ * + *

One or more wheels must be specified. The current implementation supports up to three wheels.

+ * + *

Every scrollwheel event can be interpreted to be scrolling by pixel or by line. The scale between the two is about 10 pixels per line by default. + * The scale can be altered by setting a custom value for the event source, using {@code CGEventSourceSetPixelsPerLine}.

+ */ + @NativeType("CGEventRef") + public static long CGEventCreateScrollWheelEvent(@NativeType("CGEventSourceRef") long source, @NativeType("CGScrollEventUnit") int units, @NativeType("uint32_t") int wheelCount, @NativeType("int32_t") int wheel1) { + long __functionAddress = Functions.EventCreateScrollWheelEvent; + return invokePP(source, units, wheelCount, wheel1, __functionAddress); + } + + /** + * Returns a new scrollwheel event. + * + *

The event source may be taken from another event, or may be {@code NULL}. The scrolling units may be specified in lines using {@link #kCGScrollEventUnitLine ScrollEventUnitLine} or in + * pixels using {@link #kCGScrollEventUnitPixel ScrollEventUnitPixel}. {@link #kCGScrollEventUnitPixel ScrollEventUnitPixel} will produce an event that most applications interpret as a smooth scrolling event.

+ * + *

One or more wheels must be specified. The current implementation supports up to three wheels.

+ * + *

Every scrollwheel event can be interpreted to be scrolling by pixel or by line. The scale between the two is about 10 pixels per line by default. + * The scale can be altered by setting a custom value for the event source, using {@code CGEventSourceSetPixelsPerLine}.

+ */ + @NativeType("CGEventRef") + public static long CGEventCreateScrollWheelEvent(@NativeType("CGEventSourceRef") long source, @NativeType("CGScrollEventUnit") int units, @NativeType("int32_t") int wheel1) { + long __functionAddress = Functions.EventCreateScrollWheelEvent; + return invokePP(source, units, 1, wheel1, __functionAddress); + } + + // --- [ CGEventCreateScrollWheelEvent2 ] --- + + /** + * A non-variadic variant version of {@link #CGEventCreateScrollWheelEvent EventCreateScrollWheelEvent}. + * + * @since macOS 10.13 + */ + @NativeType("CGEventRef") + public static long CGEventCreateScrollWheelEvent2(@NativeType("CGEventSourceRef") long source, @NativeType("CGScrollEventUnit") int units, @NativeType("uint32_t") int wheelCount, @NativeType("int32_t") int wheel1, @NativeType("int32_t") int wheel2, @NativeType("int32_t") int wheel3) { + long __functionAddress = Functions.EventCreateScrollWheelEvent2; + if (CHECKS) { + check(__functionAddress); + } + return invokePP(source, units, wheelCount, wheel1, wheel2, wheel3, __functionAddress); + } + + // --- [ CGEventCreateCopy ] --- + + /** Return a copy of {@code event}. */ + @NativeType("CGEventRef") + public static long CGEventCreateCopy(@NativeType("CGEventRef") long event) { + long __functionAddress = Functions.EventCreateCopy; + return invokePP(event, __functionAddress); + } + + // --- [ CGEventCreateSourceFromEvent ] --- + + /** + * Returns an event source created from an existing event. + * + *

Event filters may use the event source to generate events that are compatible with an event being filtered.

+ * + *

Note that {@code CGEventCreateSourceFromEvent} may return {@code NULL} if the event was generated with a private {@code CGEventSourceStateID} owned by another + * process. Such events should be filtered based on the public state.

+ */ + @NativeType("CGEventSourceRef") + public static long CGEventCreateSourceFromEvent(@NativeType("CGEventRef") long event) { + long __functionAddress = Functions.EventCreateSourceFromEvent; + return invokePP(event, __functionAddress); + } + + // --- [ CGEventSetSource ] --- + + /** Set the event source of an event. */ + public static void CGEventSetSource(@NativeType("CGEventRef") long event, @NativeType("CGEventSourceRef") long source) { + long __functionAddress = Functions.EventSetSource; + invokePPV(event, source, __functionAddress); + } + + // --- [ CGEventGetType ] --- + + /** Returns the event type of an event (left mouse down, for example). */ + @NativeType("CGEventType") + public static int CGEventGetType(@NativeType("CGEventRef") long event) { + long __functionAddress = Functions.EventGetType; + return invokePI(event, __functionAddress); + } + + // --- [ CGEventSetType ] --- + + /** Sets the event type of an event. */ + public static void CGEventSetType(@NativeType("CGEventRef") long event, @NativeType("CGEventType") int type) { + long __functionAddress = Functions.EventSetType; + invokePV(event, type, __functionAddress); + } + + // --- [ CGEventGetTimestamp ] --- + + /** Returns the timestamp of an event. */ + @NativeType("CGEventTimestamp") + public static long CGEventGetTimestamp(@NativeType("CGEventRef") long event) { + long __functionAddress = Functions.EventGetTimestamp; + return invokePJ(event, __functionAddress); + } + + // --- [ CGEventSetTimestamp ] --- + + /** Sets the timestamp of an event. */ + public static void CGEventSetTimestamp(@NativeType("CGEventRef") long event, @NativeType("CGEventTimestamp") long timestamp) { + long __functionAddress = Functions.EventSetTimestamp; + invokePJV(event, timestamp, __functionAddress); + } + + // --- [ CGEventGetLocation ] --- + + /** Unsafe version of: {@link #CGEventGetLocation EventGetLocation} */ + public static native void nCGEventGetLocation(long event, long __functionAddress, long __result); + + /** Unsafe version of: {@link #CGEventGetLocation EventGetLocation} */ + public static void nCGEventGetLocation(long event, long __result) { + long __functionAddress = Functions.EventGetLocation; + nCGEventGetLocation(event, __functionAddress, __result); + } + + /** + * Returns the location of an event in global display coordinates. + * + *

{@code CGPointZero} is returned if {@code event} is not a valid {@code CGEventRef}.

+ */ + public static CGPoint CGEventGetLocation(@NativeType("CGEventRef") long event, CGPoint __result) { + nCGEventGetLocation(event, __result.address()); + return __result; + } + + // --- [ CGEventGetUnflippedLocation ] --- + + /** Unsafe version of: {@link #CGEventGetUnflippedLocation EventGetUnflippedLocation} */ + public static native void nCGEventGetUnflippedLocation(long event, long __functionAddress, long __result); + + /** Unsafe version of: {@link #CGEventGetUnflippedLocation EventGetUnflippedLocation} */ + public static void nCGEventGetUnflippedLocation(long event, long __result) { + long __functionAddress = Functions.EventGetUnflippedLocation; + nCGEventGetUnflippedLocation(event, __functionAddress, __result); + } + + /** + * Return the location of an event relative to the lower-left corner of the main display. + * + *

{@code CGPointZero} is returned if {@code event} is not a valid {@code CGEventRef}.

+ */ + public static CGPoint CGEventGetUnflippedLocation(@NativeType("CGEventRef") long event, CGPoint __result) { + nCGEventGetUnflippedLocation(event, __result.address()); + return __result; + } + + // --- [ CGEventSetLocation ] --- + + /** Unsafe version of: {@link #CGEventSetLocation EventSetLocation} */ + public static native void nCGEventSetLocation(long event, long location, long __functionAddress); + + /** Unsafe version of: {@link #CGEventSetLocation EventSetLocation} */ + public static void nCGEventSetLocation(long event, long location) { + long __functionAddress = Functions.EventSetLocation; + nCGEventSetLocation(event, location, __functionAddress); + } + + /** Sets the location of an event in global display coordinates. */ + public static void CGEventSetLocation(@NativeType("CGEventRef") long event, CGPoint location) { + nCGEventSetLocation(event, location.address()); + } + + // --- [ CGEventGetFlags ] --- + + /** + * Returns the event flags of an event. + * + *

{@code (CGEventFlags)0} if {@code event} is not a valid {@code CGEventRef}.

+ */ + @NativeType("CGEventFlags") + public static long CGEventGetFlags(@NativeType("CGEventRef") long event) { + long __functionAddress = Functions.EventGetFlags; + return invokePJ(event, __functionAddress); + } + + // --- [ CGEventSetFlags ] --- + + /** Sets the event flags of an event. */ + public static void CGEventSetFlags(@NativeType("CGEventRef") long event, @NativeType("CGEventFlags") long flags) { + long __functionAddress = Functions.EventSetFlags; + invokePJV(event, flags, __functionAddress); + } + + // --- [ CGEventKeyboardGetUnicodeString ] --- + + /** Unsafe version of: {@link #CGEventKeyboardGetUnicodeString EventKeyboardGetUnicodeString} */ + public static void nCGEventKeyboardGetUnicodeString(long event, long maxStringLength, long actualStringLength, long unicodeString) { + long __functionAddress = Functions.EventKeyboardGetUnicodeString; + invokePNPPV(event, maxStringLength, actualStringLength, unicodeString, __functionAddress); + } + + /** + * Returns the Unicode string associated with a keyboard event. + * + *

When you call this function with a {@code NULL} string or a maximum string length of 0, the function still returns the actual count of Unicode characters in + * the event.

+ */ + public static void CGEventKeyboardGetUnicodeString(@NativeType("CGEventRef") long event, @Nullable @NativeType("UniCharCount *") CLongBuffer actualStringLength, @Nullable @NativeType("UniChar *") ShortBuffer unicodeString) { + if (CHECKS) { + checkSafe(actualStringLength, 1); + } + nCGEventKeyboardGetUnicodeString(event, remainingSafe(unicodeString), memAddressSafe(actualStringLength), memAddressSafe(unicodeString)); + } + + // --- [ CGEventKeyboardSetUnicodeString ] --- + + /** Unsafe version of: {@link #CGEventKeyboardSetUnicodeString EventKeyboardSetUnicodeString} */ + public static void nCGEventKeyboardSetUnicodeString(long event, long stringLength, long unicodeString) { + long __functionAddress = Functions.EventKeyboardSetUnicodeString; + invokePNPV(event, stringLength, unicodeString, __functionAddress); + } + + /** + * Sets the Unicode string associated with a keyboard event. + * + *

By default, the system translates the virtual key code in a keyboard event into a Unicode string based on the keyboard ID in the event source. This + * function allows you to manually override this string. Note that application frameworks may ignore the Unicode string in a keyboard event and do their + * own translation based on the virtual keycode and perceived event state.

+ */ + public static void CGEventKeyboardSetUnicodeString(@NativeType("CGEventRef") long event, @NativeType("UniChar const *") ShortBuffer unicodeString) { + nCGEventKeyboardSetUnicodeString(event, unicodeString.remaining(), memAddress(unicodeString)); + } + + // --- [ CGEventGetIntegerValueField ] --- + + /** Returns the integer value of a field in an event. */ + @NativeType("int64_t") + public static long CGEventGetIntegerValueField(@NativeType("CGEventRef") long event, @NativeType("CGEventField") int field) { + long __functionAddress = Functions.EventGetIntegerValueField; + return invokePJ(event, field, __functionAddress); + } + + // --- [ CGEventSetIntegerValueField ] --- + + /** + * Sets the integer value of a field in an event. + * + *

Before calling this function, the event type must be set using a typed event creation function such as {@link #CGEventCreateMouseEvent EventCreateMouseEvent}, or by calling + * {@link #CGEventSetType EventSetType}.

+ * + *

If you are creating a mouse event generated by a tablet, call this function and specify the field {@link #kCGMouseEventSubtype MouseEventSubtype} with a value of + * {@link #kCGEventMouseSubtypeTabletPoint EventMouseSubtypeTabletPoint} or {@link #kCGEventMouseSubtypeTabletProximity EventMouseSubtypeTabletProximity} before setting other parameters.

+ */ + public static void CGEventSetIntegerValueField(@NativeType("CGEventRef") long event, @NativeType("CGEventField") int field, @NativeType("int64_t") long value) { + long __functionAddress = Functions.EventSetIntegerValueField; + invokePJV(event, field, value, __functionAddress); + } + + // --- [ CGEventGetDoubleValueField ] --- + + /** + * Returns the floating-point value of a field in an event. + * + *

In cases where the field value is represented within the event by a fixed point number or an integer, the result is scaled to the appropriate range as + * part of creating the floating-point representation.

+ */ + public static double CGEventGetDoubleValueField(@NativeType("CGEventRef") long event, @NativeType("CGEventField") int field) { + long __functionAddress = Functions.EventGetDoubleValueField; + return invokePD(event, field, __functionAddress); + } + + // --- [ CGEventSetDoubleValueField ] --- + + /** + * Sets the floating-point value of a field in an event. + * + *

Before calling this function, the event type must be set using a typed event creation function such as {@link #CGEventCreateMouseEvent EventCreateMouseEvent}, or by calling + * {@link #CGEventSetType EventSetType}.

+ * + *

In cases where the field’s value is represented within the event by a fixed point number or integer, the value parameter is scaled as needed and + * converted to the appropriate type.

+ */ + public static void CGEventSetDoubleValueField(@NativeType("CGEventRef") long event, @NativeType("CGEventField") int field, double value) { + long __functionAddress = Functions.EventSetDoubleValueField; + invokePV(event, field, value, __functionAddress); + } + + // --- [ CGEventTapCreate ] --- + + /** Unsafe version of: {@link #CGEventTapCreate EventTapCreate} */ + public static long nCGEventTapCreate(int tap, int place, int options, long eventsOfInterest, long callback, long userInfo) { + long __functionAddress = Functions.EventTapCreate; + return invokeJPPP(tap, place, options, eventsOfInterest, callback, userInfo, __functionAddress); + } + + /** + * Creates an event tap. + * + *

Taps may be placed at the point where {@code HIDSystem} events enter the server, at the point where {@code HIDSystem} and remote control events enter a + * session, at the point where events have been annotated to flow to a specific application, or at the point where events are delivered to the + * application. Taps may be inserted at a specified point at the head of pre-existing filters, or appended after any pre-existing filters.

+ * + *

Taps may be passive event listeners, or active filters. An active filter may pass an event through unmodified, modify an event, or discard an event. + * When a tap is registered, it identifies the set of events to be observed with a mask, and indicates if it is a passive or active event filter. Multiple + * event type bitmasks may be ORed together.

+ * + *

Taps may only be placed at {@link #kCGHIDEventTap HIDEventTap} by a process running as the root user. {@code NULL} is returned for other users.

+ * + *

Taps placed at {@link #kCGHIDEventTap HIDEventTap}, {@link #kCGSessionEventTap SessionEventTap}, {@link #kCGAnnotatedSessionEventTap AnnotatedSessionEventTap}, or on a specific process may only receive key up and down events if access + * for assistive devices is enabled (Preferences Accessibility panel, Keyboard view) or the caller is enabled for assistive device access, as by + * {@code AXMakeProcessTrusted}. If the tap is not permitted to monitor these events when the tap is created, then the appropriate bits in the mask are + * cleared. If that results in an empty mask, then {@code NULL} is returned.

+ * + *

An event tap is represented as a {@code CFMachPortRef}. The event tap may be added to an appropriate run loop by calling {@code CFRunLoopAddSource}.

+ * + *

Releasing the {@code CFMachPortRef} will release the tap.

+ * + *

A {@code CGEventTapProxy} is an opaque reference to state within the client application associated with the tap. The tap function may pass this + * reference to other functions, such as the event-posting routines.

+ * + *

The event tap callback runs from the {@code CFRunLoop} to which the tap {@code CFMachPort} is added as a source. Thread safety is defined by the + * {@code CFRunLoop} and its environment.

+ */ + @NativeType("CFMachPortRef") + public static long CGEventTapCreate(@NativeType("CGEventTapLocation") int tap, @NativeType("CGEventTapPlacement") int place, @NativeType("CGEventTapOptions") int options, @NativeType("CGEventMask") long eventsOfInterest, @NativeType("CGEventRef (*) (CGEventTapProxy, CGEventType, CGEventRef, void *)") CGEventTapCallBackI callback, @NativeType("void *") long userInfo) { + return nCGEventTapCreate(tap, place, options, eventsOfInterest, callback.address(), userInfo); + } + + // --- [ CGEventTapCreateForPid ] --- + + /** Unsafe version of: {@link #CGEventTapCreateForPid EventTapCreateForPid} */ + public static long nCGEventTapCreateForPid(long pid, int place, int options, long eventsOfInterest, long callback, long userInfo) { + long __functionAddress = Functions.EventTapCreateForPid; + if (CHECKS) { + check(__functionAddress); + check(pid); + } + return invokePJPPP(pid, place, options, eventsOfInterest, callback, userInfo, __functionAddress); + } + + /** + * Create an event tap for a specified process. + * + *

Events routed to individual applications may be tapped using another function. {@code CGEventTapCreateForPSN} will report all events routed to the + * specified application.

+ * + * @since macOS 10.11 + */ + @NativeType("CFMachPortRef") + public static long CGEventTapCreateForPid(@NativeType("pid_t") long pid, @NativeType("CGEventTapPlacement") int place, @NativeType("CGEventTapOptions") int options, @NativeType("CGEventMask") long eventsOfInterest, @NativeType("CGEventRef (*) (CGEventTapProxy, CGEventType, CGEventRef, void *)") CGEventTapCallBackI callback, @NativeType("void *") long userInfo) { + return nCGEventTapCreateForPid(pid, place, options, eventsOfInterest, callback.address(), userInfo); + } + + // --- [ CGEventTapEnable ] --- + + /** + * Enables or disables an event tap. + * + *

Taps are normally enabled when created. If a tap becomes unresponsive or a user requests taps be disabled, an appropriate + * {@code kCGEventTapDisabled...} event is passed to the registered {@link CGEventTapCallBack} function. An event tap may be re-enabled by calling this + * function.

+ */ + public static void CGEventTapEnable(@NativeType("CFMachPortRef") long tap, @NativeType("bool") boolean enable) { + long __functionAddress = Functions.EventTapEnable; + if (CHECKS) { + check(tap); + } + invokePV(tap, enable, __functionAddress); + } + + // --- [ CGEventTapIsEnabled ] --- + + /** Return true if {@code tap} is enabled; false otherwise. */ + @NativeType("bool") + public static boolean CGEventTapIsEnabled(@NativeType("CFMachPortRef") long tap) { + long __functionAddress = Functions.EventTapIsEnabled; + if (CHECKS) { + check(tap); + } + return invokePZ(tap, __functionAddress); + } + + // --- [ CGEventTapPostEvent ] --- + + /** + * Post an event from an event tap into the event stream. + * + *

You can use this function to post a new event at the same point to which an event returned from an event tap callback function would be posted. The new + * event enters the system before the event returned by the callback enters the system. Events posted into the system will be seen by all taps placed + * after the tap posting the event.

+ */ + public static void CGEventTapPostEvent(@NativeType("CGEventTapProxy") long proxy, @NativeType("CGEventRef") long event) { + long __functionAddress = Functions.EventTapPostEvent; + invokePPV(proxy, event, __functionAddress); + } + + // --- [ CGEventPost ] --- + + /** + * Posts an event into the event stream at a specified location. + * + *

This function posts the specified event immediately before any event taps instantiated for that location, and the event passes through any such + * taps.

+ * + * @param tap the location at which to post the event + * @param event the event to post + */ + public static void CGEventPost(@NativeType("CGEventTapLocation") int tap, @NativeType("CGEventRef") long event) { + long __functionAddress = Functions.EventPost; + if (CHECKS) { + check(event); + } + invokePV(tap, event, __functionAddress); + } + + // --- [ CGEventPostToPid ] --- + + /** + * Post an event into the event stream for a specific application. + * + *

This function makes it possible for an application to establish an event routing policy, for example, by tapping events at the + * {@link #kCGAnnotatedSessionEventTap AnnotatedSessionEventTap} location and then posting the events to another desired process.

+ * + *

This function posts the specified event immediately before any event taps instantiated for the specified process, and the event passes through any such + * taps.

+ * + * @since macOS 10.11 + */ + public static void CGEventPostToPid(@NativeType("pid_t") long pid, @NativeType("CGEventRef") long event) { + long __functionAddress = Functions.EventPostToPid; + if (CHECKS) { + check(__functionAddress); + check(pid); + } + invokePPV(pid, event, __functionAddress); + } + + // --- [ CGGetEventTapList ] --- + + /** Unsafe version of: {@link #CGGetEventTapList GetEventTapList} */ + public static int nCGGetEventTapList(int maxNumberOfTaps, long tapList, long eventTapCount) { + long __functionAddress = Functions.GetEventTapList; + return invokePPI(maxNumberOfTaps, tapList, eventTapCount, __functionAddress); + } + + /** + * Gets a list of currently installed event taps. + * + *

{@code tapList} is an array of event tap information structures of length {@code maxNumberOfTaps}. You are responsible for allocating storage for this + * array. On return, your array contains a list of currently installed event taps. On return, the number of event taps that are currently installed is + * stored in {@code eventTapCount}. If you pass {@code NULL} in this parameter, the {@code maxNumberOfTaps} parameter is ignored, and the number of event taps + * that are currently installed is stored in {@code eventTapCount}.

+ * + *

Each call to this function has the side effect of resetting the minimum and maximum latencies in the {@code tapList} parameter to the corresponding + * average values. Values reported in these fields reflect the minimum and maximum values seen since the preceding call, or the instantiation of the tap. + * This allows a monitoring tool to evaluate the best and worst case latency over time and under various operating conditions.

+ */ + @NativeType("CGError") + public static int CGGetEventTapList(@Nullable @NativeType("CGEventTapInformation *") CGEventTapInformation.Buffer tapList, @Nullable @NativeType("uint32_t *") IntBuffer eventTapCount) { + if (CHECKS) { + checkSafe(eventTapCount, 1); + } + return nCGGetEventTapList(remainingSafe(tapList), memAddressSafe(tapList), memAddressSafe(eventTapCount)); + } + + /** Array version of: {@link #CGEventKeyboardGetUnicodeString EventKeyboardGetUnicodeString} */ + public static void CGEventKeyboardGetUnicodeString(@NativeType("CGEventRef") long event, @Nullable @NativeType("UniCharCount *") CLongBuffer actualStringLength, @Nullable @NativeType("UniChar *") short[] unicodeString) { + long __functionAddress = Functions.EventKeyboardGetUnicodeString; + if (CHECKS) { + checkSafe(actualStringLength, 1); + } + invokePNPPV(event, (long)lengthSafe(unicodeString), memAddressSafe(actualStringLength), unicodeString, __functionAddress); + } + + /** Array version of: {@link #CGEventKeyboardSetUnicodeString EventKeyboardSetUnicodeString} */ + public static void CGEventKeyboardSetUnicodeString(@NativeType("CGEventRef") long event, @NativeType("UniChar const *") short[] unicodeString) { + long __functionAddress = Functions.EventKeyboardSetUnicodeString; + invokePNPV(event, (long)unicodeString.length, unicodeString, __functionAddress); + } + + /** Array version of: {@link #CGGetEventTapList GetEventTapList} */ + @NativeType("CGError") + public static int CGGetEventTapList(@Nullable @NativeType("CGEventTapInformation *") CGEventTapInformation.Buffer tapList, @Nullable @NativeType("uint32_t *") int[] eventTapCount) { + long __functionAddress = Functions.GetEventTapList; + if (CHECKS) { + checkSafe(eventTapCount, 1); + } + return invokePPI(remainingSafe(tapList), memAddressSafe(tapList), eventTapCount, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/DynamicLinkLoader.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/DynamicLinkLoader.java new file mode 100644 index 00000000..2a96b82f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/DynamicLinkLoader.java @@ -0,0 +1,290 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.macosx; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to <dlfcn.h>. */ +public class DynamicLinkLoader { + + /** The {@code mode} argument to {@link #dlopen} contains one of the following. */ + public static final int + RTLD_LAZY = 0x1, + RTLD_NOW = 0x2, + RTLD_LOCAL = 0x4, + RTLD_GLOBAL = 0x8; + + /** Special-handle values for {@link #dlsym}. */ + public static final long + RTLD_NEXT = 0xFFFFFFFFFFFFFFFFL, + RTLD_DEFAULT = 0xFFFFFFFFFFFFFFFEL, + RTLD_SELF = 0xFFFFFFFFFFFFFFFDL, + RTLD_MAIN_ONLY = 0xFFFFFFFFFFFFFFFBL; + + static { Library.initialize(); } + + protected DynamicLinkLoader() { + throw new UnsupportedOperationException(); + } + + // --- [ dlopen ] --- + + /** Unsafe version of: {@link #dlopen} */ + public static native long ndlopen(long path, int mode); + + /** + * Loads and links a dynamic library or bundle. + * + *

This function examines the Mach-O file specified by path. If the image is compatible with the current process and has not already been loaded into the + * process, the image is loaded and linked. If the image contains initializer functions, they are executed before this function returns.

+ * + *

Subsequent calls to {@code dlopen} to load the same image return the same handle, but the internal reference count for the handle is incremented. + * Therefore, all {@code dlopen} calls must be balanced with {@link #dlclose} calls.

+ * + *

For efficiency, the {@link #RTLD_LAZY} binding mode is preferred over {@link #RTLD_NOW}. However, using {@link #RTLD_NOW} ensures that any undefined + * symbols are discovered during the call to {@code dlopen}.

+ * + *

The dynamic loader looks in the paths specified by a set of environment variables, and in the process's current directory, when it searches for a + * library. These paths are called dynamic loader search paths. The environment variables are {@code LD_LIBRARY_PATH}, {@code DYLD_LIBRARY_PATH}, and + * {@code DYLD_FALLBACK_LIBRARY_PATH}. The default value of {@code DYLD_FALLBACK_LIBRARY_PATH} (used when this variable is not set), is + * {@code $HOME/lib;/usr/local/lib;/usr/lib}.

+ * + *

The order in which the search paths are searched depends on whether path is a filename (it does not contain a slash) or a pathname (it contains at least + * one slash).

+ * + *

When path is a filename, the dynamic loader searches for the library in the search paths in the following order:

+ * + *
    + *
  • $LD_LIBRARY_PATH
  • + *
  • $DYLD_LIBRARY_PATH
  • + *
  • The process's working directory
  • + *
  • $DYLD_FALLBACK_LIBRARY_PATH
  • + *
+ * + *

When path is a pathname, the dynamic loader searches for the library in the search paths in the following order:

+ * + *
    + *
  • $DYLD_LIBRARY_PATH
  • + *
  • The given pathname
  • + *
  • $DYLD_FALLBACK_LIBRARY_PATH using the filename
  • + *
+ * + * @param path path to the image to open + * @param mode specifies when the loaded image's external symbols are bound to their definitions in dependent libraries (lazy or at load time) and the visibility + * of the image's exported symbols (global or local). The value of this parameter is made up by ORing one binding behavior value with one visibility + * specification value. + * + *

The following values specify the binding behavior:

+ * + *
    + *
  • {@link #RTLD_LAZY} (default): Each external symbol reference is bound the first time it's used.
  • + *
  • {@link #RTLD_NOW}: All external symbol references are bound immediately.
  • + *
+ * + *

The following values specify external symbol visibility:

+ * + *
    + *
  • {@link #RTLD_GLOBAL} (default): The loaded image's exported symbols are available to any images that use a flat namespace or to calls to + * dlsym when using a special handle (see {@link #dlsym} for details).
  • + *
  • {@link #RTLD_LOCAL}: The loaded image's exported symbols are generally hidden. They are available only to {@link #dlsym} invocations that + * use the handle returned by this function.
  • + *
+ */ + @NativeType("void *") + public static long dlopen(@Nullable @NativeType("char const *") ByteBuffer path, int mode) { + if (CHECKS) { + checkNT1Safe(path); + } + return ndlopen(memAddressSafe(path), mode); + } + + /** + * Loads and links a dynamic library or bundle. + * + *

This function examines the Mach-O file specified by path. If the image is compatible with the current process and has not already been loaded into the + * process, the image is loaded and linked. If the image contains initializer functions, they are executed before this function returns.

+ * + *

Subsequent calls to {@code dlopen} to load the same image return the same handle, but the internal reference count for the handle is incremented. + * Therefore, all {@code dlopen} calls must be balanced with {@link #dlclose} calls.

+ * + *

For efficiency, the {@link #RTLD_LAZY} binding mode is preferred over {@link #RTLD_NOW}. However, using {@link #RTLD_NOW} ensures that any undefined + * symbols are discovered during the call to {@code dlopen}.

+ * + *

The dynamic loader looks in the paths specified by a set of environment variables, and in the process's current directory, when it searches for a + * library. These paths are called dynamic loader search paths. The environment variables are {@code LD_LIBRARY_PATH}, {@code DYLD_LIBRARY_PATH}, and + * {@code DYLD_FALLBACK_LIBRARY_PATH}. The default value of {@code DYLD_FALLBACK_LIBRARY_PATH} (used when this variable is not set), is + * {@code $HOME/lib;/usr/local/lib;/usr/lib}.

+ * + *

The order in which the search paths are searched depends on whether path is a filename (it does not contain a slash) or a pathname (it contains at least + * one slash).

+ * + *

When path is a filename, the dynamic loader searches for the library in the search paths in the following order:

+ * + *
    + *
  • $LD_LIBRARY_PATH
  • + *
  • $DYLD_LIBRARY_PATH
  • + *
  • The process's working directory
  • + *
  • $DYLD_FALLBACK_LIBRARY_PATH
  • + *
+ * + *

When path is a pathname, the dynamic loader searches for the library in the search paths in the following order:

+ * + *
    + *
  • $DYLD_LIBRARY_PATH
  • + *
  • The given pathname
  • + *
  • $DYLD_FALLBACK_LIBRARY_PATH using the filename
  • + *
+ * + * @param path path to the image to open + * @param mode specifies when the loaded image's external symbols are bound to their definitions in dependent libraries (lazy or at load time) and the visibility + * of the image's exported symbols (global or local). The value of this parameter is made up by ORing one binding behavior value with one visibility + * specification value. + * + *

The following values specify the binding behavior:

+ * + *
    + *
  • {@link #RTLD_LAZY} (default): Each external symbol reference is bound the first time it's used.
  • + *
  • {@link #RTLD_NOW}: All external symbol references are bound immediately.
  • + *
+ * + *

The following values specify external symbol visibility:

+ * + *
    + *
  • {@link #RTLD_GLOBAL} (default): The loaded image's exported symbols are available to any images that use a flat namespace or to calls to + * dlsym when using a special handle (see {@link #dlsym} for details).
  • + *
  • {@link #RTLD_LOCAL}: The loaded image's exported symbols are generally hidden. They are available only to {@link #dlsym} invocations that + * use the handle returned by this function.
  • + *
+ */ + @NativeType("void *") + public static long dlopen(@Nullable @NativeType("char const *") CharSequence path, int mode) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCIISafe(path, true); + long pathEncoded = path == null ? NULL : stack.getPointerAddress(); + return ndlopen(pathEncoded, mode); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ dlerror ] --- + + /** Unsafe version of: {@link #dlerror} */ + public static native long ndlerror(); + + /** + * Provides diagnostic information corresponding to problems with calls to {@link #dlopen}, {@link #dlsym}, and {@link #dlclose} in the same thread. + * + *

When there's a problem to report, this function returns a pointer to a null-terminated string describing the problem. Otherwise, this function returns + * {@code NULL}.

+ * + *

Each call to {@code dlerror} resets its diagnostic buffer. If a program needs to keep a record of past error messages, it must store them itself. + * Subsequent calls to {@code dlerror} in the same thread with no calls to {@link #dlopen}, {@link #dlsym}, or {@link #dlclose}, return {@code NULL}.

+ */ + @Nullable + @NativeType("char const *") + public static String dlerror() { + long __result = ndlerror(); + return memASCIISafe(__result); + } + + // --- [ dlsym ] --- + + /** Unsafe version of: {@link #dlsym} */ + public static native long ndlsym(long handle, long name); + + /** + * Returns the address of a symbol. + * + *

The value of handle specifies what images this function searches for to locate the symbol specified by the symbol parameter. The following table + * describes the possible values for the handle parameter:

+ * + * + * + * + * + * + *
Handle valueSearch scope
{@code dlopen} handleImage associated with the {@link #dlopen} handle.
{@link #RTLD_DEFAULT}Every dependent library or {@link #RTLD_GLOBAL}–opened library in the current process, in the order they were loaded.
{@link #RTLD_NEXT}Dependent libraries that were loaded after the one calling this function. Libraries opened with {@link #dlopen} are not searched.
+ * + *

Unlike in the NS... functions, the symbol parameter doesn't require a leading underscore to be part of the symbol name.

+ * + * @param handle a handle obtained by a call to {@link #dlopen}, or a special handle. If the handle was obtained by a call to {@link #dlopen}, it must not have been + * closed with a call to {@link #dlclose}. These are the possible special-handle values: {@link #RTLD_DEFAULT}, and {@link #RTLD_NEXT}. + * @param name the null-terminated character string containing the C name of the symbol being sought + */ + @NativeType("void *") + public static long dlsym(@NativeType("void *") long handle, @NativeType("char const *") ByteBuffer name) { + if (CHECKS) { + check(handle); + checkNT1(name); + } + return ndlsym(handle, memAddress(name)); + } + + /** + * Returns the address of a symbol. + * + *

The value of handle specifies what images this function searches for to locate the symbol specified by the symbol parameter. The following table + * describes the possible values for the handle parameter:

+ * + * + * + * + * + * + *
Handle valueSearch scope
{@code dlopen} handleImage associated with the {@link #dlopen} handle.
{@link #RTLD_DEFAULT}Every dependent library or {@link #RTLD_GLOBAL}–opened library in the current process, in the order they were loaded.
{@link #RTLD_NEXT}Dependent libraries that were loaded after the one calling this function. Libraries opened with {@link #dlopen} are not searched.
+ * + *

Unlike in the NS... functions, the symbol parameter doesn't require a leading underscore to be part of the symbol name.

+ * + * @param handle a handle obtained by a call to {@link #dlopen}, or a special handle. If the handle was obtained by a call to {@link #dlopen}, it must not have been + * closed with a call to {@link #dlclose}. These are the possible special-handle values: {@link #RTLD_DEFAULT}, and {@link #RTLD_NEXT}. + * @param name the null-terminated character string containing the C name of the symbol being sought + */ + @NativeType("void *") + public static long dlsym(@NativeType("void *") long handle, @NativeType("char const *") CharSequence name) { + if (CHECKS) { + check(handle); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + return ndlsym(handle, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ dlclose ] --- + + /** Unsafe version of: {@link #dlclose} */ + public static native int ndlclose(long handle); + + /** + * Closes a dynamic library or bundle. + * + *

This function decreases the reference count of the image referenced by handle. When the reference count for handle becomes 0, the termination routines + * in the image are called, and the image is removed from the address space of the current process. After that point, handle is rendered invalid.

+ * + * @param handle a handle obtained through a call to {@link #dlopen}. + */ + public static int dlclose(@NativeType("void *") long handle) { + if (CHECKS) { + check(handle); + } + return ndlclose(handle); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/EnumerationMutationHandler.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/EnumerationMutationHandler.java new file mode 100644 index 00000000..65044f1d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/EnumerationMutationHandler.java @@ -0,0 +1,75 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.macosx; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * A mutation handler. + * + *

Type

+ * + *

+ * void (*) (
+ *     id id
+ * )
+ */ +public abstract class EnumerationMutationHandler extends Callback implements EnumerationMutationHandlerI { + + /** + * Creates a {@code EnumerationMutationHandler} instance from the specified function pointer. + * + * @return the new {@code EnumerationMutationHandler} + */ + public static EnumerationMutationHandler create(long functionPointer) { + EnumerationMutationHandlerI instance = Callback.get(functionPointer); + return instance instanceof EnumerationMutationHandler + ? (EnumerationMutationHandler)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static EnumerationMutationHandler createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code EnumerationMutationHandler} instance that delegates to the specified {@code EnumerationMutationHandlerI} instance. */ + public static EnumerationMutationHandler create(EnumerationMutationHandlerI instance) { + return instance instanceof EnumerationMutationHandler + ? (EnumerationMutationHandler)instance + : new Container(instance.address(), instance); + } + + protected EnumerationMutationHandler() { + super(SIGNATURE); + } + + EnumerationMutationHandler(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends EnumerationMutationHandler { + + private final EnumerationMutationHandlerI delegate; + + Container(long functionPointer, EnumerationMutationHandlerI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public void invoke(long id) { + delegate.invoke(id); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/EnumerationMutationHandlerI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/EnumerationMutationHandlerI.java new file mode 100644 index 00000000..48854681 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/EnumerationMutationHandlerI.java @@ -0,0 +1,45 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.macosx; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * A mutation handler. + * + *

Type

+ * + *

+ * void (*) (
+ *     id id
+ * )
+ */ +@FunctionalInterface +@NativeType("EnumerationMutationHandler") +public interface EnumerationMutationHandlerI extends CallbackI.V { + + String SIGNATURE = "(p)v"; + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default void callback(long args) { + invoke( + dcbArgPointer(args) + ); + } + + /** + * Will be called when an object is mutated during a foreach iteration. + * + * @param id the object that was mutated + */ + void invoke(@NativeType("id") long id); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/LibC.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/LibC.java new file mode 100644 index 00000000..1d9b36da --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/LibC.java @@ -0,0 +1,40 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.macosx; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.JNI.*; + +/** Native bindings to libc, the Standard C Library. */ +public class LibC { + + protected LibC() { + throw new UnsupportedOperationException(); + } + + /** Contains the function pointers loaded from {@code LibSystem.getLibrary()}. */ + public static final class Functions { + + private Functions() {} + + /** Function address. */ + public static final long + getpid = apiGetFunctionAddress(LibSystem.getLibrary(), "getpid"); + + } + + // --- [ getpid ] --- + + /** Returns the process ID of the calling process. */ + @NativeType("pid_t") + public static long getpid() { + long __functionAddress = Functions.getpid; + return invokeP(__functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/LibSystem.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/LibSystem.java new file mode 100644 index 00000000..72b49a7c --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/LibSystem.java @@ -0,0 +1,30 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.macosx; + +import org.lwjgl.system.*; + + +/** + * Native bindings to libSystem, the MacOS system library. + * + *

This class contains no functionality and is only responsible for loading the system library. Other libraries (contained in libSystem) reuse the library + * handle loaded by this class.

+ */ +public final class LibSystem { + + private LibSystem() { + throw new UnsupportedOperationException(); + } + + private static final SharedLibrary SYSTEM = Library.loadNative(LibSystem.class, "org.lwjgl", "System"); + + /** Returns the System {@link SharedLibrary}. */ + public static SharedLibrary getLibrary() { + return SYSTEM; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/MacOSXLibrary.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/MacOSXLibrary.java new file mode 100644 index 00000000..f7ee682d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/MacOSXLibrary.java @@ -0,0 +1,32 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system.macosx; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; + +/** Implements a {@link SharedLibrary} on the macOS. */ +public abstract class MacOSXLibrary extends SharedLibrary.Default { + + protected MacOSXLibrary(String name, long handle) { + super(name, handle); + } + + public static MacOSXLibrary getWithIdentifier(String bundleID) { + apiLog("Loading library: " + bundleID); + MacOSXLibraryBundle lib = MacOSXLibraryBundle.getWithIdentifier(bundleID); + apiLog("\tSuccess"); + return lib; + } + + public static MacOSXLibrary create(String name) { + return name.endsWith(".framework") + ? MacOSXLibraryBundle.create(name) + : new MacOSXLibraryDL(name); + } + +} + diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/MacOSXLibraryBundle.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/MacOSXLibraryBundle.java new file mode 100644 index 00000000..35db5c0e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/MacOSXLibraryBundle.java @@ -0,0 +1,90 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system.macosx; + +import org.lwjgl.system.*; + +import javax.annotation.*; +import java.nio.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.macosx.CoreFoundation.*; + +/** Implements a {@link SharedLibrary} on the macOS using {@code CFBundle}. */ +public class MacOSXLibraryBundle extends MacOSXLibrary { + + public MacOSXLibraryBundle(String name, long bundleRef) { + super(name, bundleRef); + } + + public static MacOSXLibraryBundle getWithIdentifier(String bundleID) { + long filePath = NULL; + try (MemoryStack stack = stackPush()) { + filePath = CString2CFString(stack.ASCII(bundleID), kCFStringEncodingASCII); + + long bundleRef = CFBundleGetBundleWithIdentifier(filePath); + if (bundleRef == NULL) { + throw new UnsatisfiedLinkError("Failed to retrieve bundle with identifier: " + bundleID); + } + + CFRetain(bundleRef); + return new MacOSXLibraryBundle(bundleID, bundleRef); + } finally { + if (filePath != NULL) { + CFRelease(filePath); + } + } + } + + public static MacOSXLibraryBundle create(String path) { + long filePath = NULL; + long url = NULL; + try (MemoryStack stack = stackPush()) { + filePath = CString2CFString(stack.UTF8(path), kCFStringEncodingUTF8); + url = check(CFURLCreateWithFileSystemPath(NULL, filePath, kCFURLPOSIXPathStyle, true)); + + long bundleRef = CFBundleCreate(NULL, url); + if (bundleRef == NULL) { + throw new UnsatisfiedLinkError("Failed to create bundle: " + path); + } + + return new MacOSXLibraryBundle(path, bundleRef); + } finally { + if (url != NULL) { + CFRelease(url); + } + if (filePath != NULL) { + CFRelease(filePath); + } + } + } + + @Nullable + @Override public String getPath() { + return null; + } + + @Override + public long getFunctionAddress(ByteBuffer functionName) { + long nameRef = CString2CFString(functionName, kCFStringEncodingASCII); + try { + return CFBundleGetFunctionPointerForName(address(), nameRef); + } finally { + CFRelease(nameRef); + } + } + + private static long CString2CFString(ByteBuffer name, int encoding) { + return check(CFStringCreateWithCStringNoCopy(NULL, name, encoding, kCFAllocatorNull)); + } + + @Override + public void free() { + CFRelease(address()); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/MacOSXLibraryDL.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/MacOSXLibraryDL.java new file mode 100644 index 00000000..b1c03893 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/MacOSXLibraryDL.java @@ -0,0 +1,47 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system.macosx; + +import org.lwjgl.system.*; + +import java.nio.*; + +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.macosx.DynamicLinkLoader.*; + +/** Implements a {@link SharedLibrary} on the macOS using {@link DynamicLinkLoader#dlopen dlopen}. */ +public class MacOSXLibraryDL extends MacOSXLibrary { + + public MacOSXLibraryDL(String name) { + this(name, loadLibrary(name)); + } + + public MacOSXLibraryDL(String name, long handle) { + super(name, handle); + } + + private static long loadLibrary(String name) { + long handle; + try (MemoryStack stack = stackPush()) { + handle = dlopen(stack.ASCII(name), RTLD_LAZY | RTLD_LOCAL); + } + if (handle == NULL) { + throw new UnsatisfiedLinkError("Failed to dynamically load library: " + name + "(error = " + dlerror() + ")"); + } + return handle; + } + + @Override + public long getFunctionAddress(ByteBuffer functionName) { + return dlsym(address(), functionName); + } + + @Override + public void free() { + dlclose(address()); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/ObjCMethodDescription.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/ObjCMethodDescription.java new file mode 100644 index 00000000..c20de532 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/ObjCMethodDescription.java @@ -0,0 +1,286 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.macosx; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Defines a method. + * + *

Member documentation

+ * + *
    + *
  • {@code name} – the name of the method at runtime
  • + *
  • {@code types} – the types of the method arguments
  • + *
+ * + *

Layout

+ * + *

+ * struct objc_method_description {
+ *     SEL name;
+ *     char * types;
+ * }
+ */ +@NativeType("struct objc_method_description") +public class ObjCMethodDescription extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + NAME, + TYPES; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + NAME = layout.offsetof(0); + TYPES = layout.offsetof(1); + } + + /** + * Creates a {@code ObjCMethodDescription} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public ObjCMethodDescription(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code name} field. */ + @NativeType("SEL") + public long name() { return nname(address()); } + /** Returns a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code types} field. */ + @NativeType("char *") + public ByteBuffer types() { return ntypes(address()); } + /** Decodes the null-terminated string pointed to by the {@code types} field. */ + @NativeType("char *") + public String typesString() { return ntypesString(address()); } + + // ----------------------------------- + + /** Returns a new {@code ObjCMethodDescription} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static ObjCMethodDescription malloc() { + return wrap(ObjCMethodDescription.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code ObjCMethodDescription} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static ObjCMethodDescription calloc() { + return wrap(ObjCMethodDescription.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code ObjCMethodDescription} instance allocated with {@link BufferUtils}. */ + public static ObjCMethodDescription create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(ObjCMethodDescription.class, memAddress(container), container); + } + + /** Returns a new {@code ObjCMethodDescription} instance for the specified memory address. */ + public static ObjCMethodDescription create(long address) { + return wrap(ObjCMethodDescription.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static ObjCMethodDescription createSafe(long address) { + return address == NULL ? null : wrap(ObjCMethodDescription.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code ObjCMethodDescription} instance allocated on the thread-local {@link MemoryStack}. */ + public static ObjCMethodDescription mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code ObjCMethodDescription} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static ObjCMethodDescription callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code ObjCMethodDescription} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static ObjCMethodDescription mallocStack(MemoryStack stack) { + return wrap(ObjCMethodDescription.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code ObjCMethodDescription} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static ObjCMethodDescription callocStack(MemoryStack stack) { + return wrap(ObjCMethodDescription.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #name}. */ + public static long nname(long struct) { return memGetAddress(struct + ObjCMethodDescription.NAME); } + /** Unsafe version of {@link #types}. */ + public static ByteBuffer ntypes(long struct) { return memByteBufferNT1(memGetAddress(struct + ObjCMethodDescription.TYPES)); } + /** Unsafe version of {@link #typesString}. */ + public static String ntypesString(long struct) { return memUTF8(memGetAddress(struct + ObjCMethodDescription.TYPES)); } + + // ----------------------------------- + + /** An array of {@link ObjCMethodDescription} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final ObjCMethodDescription ELEMENT_FACTORY = ObjCMethodDescription.create(-1L); + + /** + * Creates a new {@code ObjCMethodDescription.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link ObjCMethodDescription#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected ObjCMethodDescription getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code name} field. */ + @NativeType("SEL") + public long name() { return ObjCMethodDescription.nname(address()); } + /** Returns a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code types} field. */ + @NativeType("char *") + public ByteBuffer types() { return ObjCMethodDescription.ntypes(address()); } + /** Decodes the null-terminated string pointed to by the {@code types} field. */ + @NativeType("char *") + public String typesString() { return ObjCMethodDescription.ntypesString(address()); } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/ObjCPropertyAttribute.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/ObjCPropertyAttribute.java new file mode 100644 index 00000000..c9a761e6 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/ObjCPropertyAttribute.java @@ -0,0 +1,361 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.macosx; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Defines a property attribute. + * + *

Member documentation

+ * + *
    + *
  • {@code name} – the name of the attribute
  • + *
  • {@code value} – the value of the attribute (usually empty)
  • + *
+ * + *

Layout

+ * + *

+ * struct objc_property_attribute_t {
+ *     char * name;
+ *     char * value;
+ * }
+ */ +@NativeType("struct objc_property_attribute_t") +public class ObjCPropertyAttribute extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + NAME, + VALUE; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + NAME = layout.offsetof(0); + VALUE = layout.offsetof(1); + } + + /** + * Creates a {@code ObjCPropertyAttribute} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public ObjCPropertyAttribute(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code name} field. */ + @NativeType("char *") + public ByteBuffer name() { return nname(address()); } + /** Decodes the null-terminated string pointed to by the {@code name} field. */ + @NativeType("char *") + public String nameString() { return nnameString(address()); } + /** Returns a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code value} field. */ + @NativeType("char *") + public ByteBuffer value() { return nvalue(address()); } + /** Decodes the null-terminated string pointed to by the {@code value} field. */ + @NativeType("char *") + public String valueString() { return nvalueString(address()); } + + /** Sets the address of the specified encoded string to the {@code name} field. */ + public ObjCPropertyAttribute name(@NativeType("char *") ByteBuffer value) { nname(address(), value); return this; } + /** Sets the address of the specified encoded string to the {@code value} field. */ + public ObjCPropertyAttribute value(@NativeType("char *") ByteBuffer value) { nvalue(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public ObjCPropertyAttribute set( + ByteBuffer name, + ByteBuffer value + ) { + name(name); + value(value); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public ObjCPropertyAttribute set(ObjCPropertyAttribute src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code ObjCPropertyAttribute} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static ObjCPropertyAttribute malloc() { + return wrap(ObjCPropertyAttribute.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code ObjCPropertyAttribute} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static ObjCPropertyAttribute calloc() { + return wrap(ObjCPropertyAttribute.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code ObjCPropertyAttribute} instance allocated with {@link BufferUtils}. */ + public static ObjCPropertyAttribute create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(ObjCPropertyAttribute.class, memAddress(container), container); + } + + /** Returns a new {@code ObjCPropertyAttribute} instance for the specified memory address. */ + public static ObjCPropertyAttribute create(long address) { + return wrap(ObjCPropertyAttribute.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static ObjCPropertyAttribute createSafe(long address) { + return address == NULL ? null : wrap(ObjCPropertyAttribute.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code ObjCPropertyAttribute} instance allocated on the thread-local {@link MemoryStack}. */ + public static ObjCPropertyAttribute mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code ObjCPropertyAttribute} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static ObjCPropertyAttribute callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code ObjCPropertyAttribute} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static ObjCPropertyAttribute mallocStack(MemoryStack stack) { + return wrap(ObjCPropertyAttribute.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code ObjCPropertyAttribute} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static ObjCPropertyAttribute callocStack(MemoryStack stack) { + return wrap(ObjCPropertyAttribute.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #name}. */ + public static ByteBuffer nname(long struct) { return memByteBufferNT1(memGetAddress(struct + ObjCPropertyAttribute.NAME)); } + /** Unsafe version of {@link #nameString}. */ + public static String nnameString(long struct) { return memUTF8(memGetAddress(struct + ObjCPropertyAttribute.NAME)); } + /** Unsafe version of {@link #value}. */ + public static ByteBuffer nvalue(long struct) { return memByteBufferNT1(memGetAddress(struct + ObjCPropertyAttribute.VALUE)); } + /** Unsafe version of {@link #valueString}. */ + public static String nvalueString(long struct) { return memUTF8(memGetAddress(struct + ObjCPropertyAttribute.VALUE)); } + + /** Unsafe version of {@link #name(ByteBuffer) name}. */ + public static void nname(long struct, ByteBuffer value) { + if (CHECKS) { checkNT1(value); } + memPutAddress(struct + ObjCPropertyAttribute.NAME, memAddress(value)); + } + /** Unsafe version of {@link #value(ByteBuffer) value}. */ + public static void nvalue(long struct, ByteBuffer value) { + if (CHECKS) { checkNT1(value); } + memPutAddress(struct + ObjCPropertyAttribute.VALUE, memAddress(value)); + } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + ObjCPropertyAttribute.NAME)); + check(memGetAddress(struct + ObjCPropertyAttribute.VALUE)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link ObjCPropertyAttribute} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final ObjCPropertyAttribute ELEMENT_FACTORY = ObjCPropertyAttribute.create(-1L); + + /** + * Creates a new {@code ObjCPropertyAttribute.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link ObjCPropertyAttribute#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected ObjCPropertyAttribute getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code name} field. */ + @NativeType("char *") + public ByteBuffer name() { return ObjCPropertyAttribute.nname(address()); } + /** Decodes the null-terminated string pointed to by the {@code name} field. */ + @NativeType("char *") + public String nameString() { return ObjCPropertyAttribute.nnameString(address()); } + /** Returns a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code value} field. */ + @NativeType("char *") + public ByteBuffer value() { return ObjCPropertyAttribute.nvalue(address()); } + /** Decodes the null-terminated string pointed to by the {@code value} field. */ + @NativeType("char *") + public String valueString() { return ObjCPropertyAttribute.nvalueString(address()); } + + /** Sets the address of the specified encoded string to the {@code name} field. */ + public Buffer name(@NativeType("char *") ByteBuffer value) { ObjCPropertyAttribute.nname(address(), value); return this; } + /** Sets the address of the specified encoded string to the {@code value} field. */ + public Buffer value(@NativeType("char *") ByteBuffer value) { ObjCPropertyAttribute.nvalue(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/ObjCRuntime.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/ObjCRuntime.java new file mode 100644 index 00000000..d7273bf4 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/ObjCRuntime.java @@ -0,0 +1,3393 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.macosx; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Native bindings to the Objective-C Runtime. + * + *

Due to the nature of the {@code objc_msgSend*} functions, they are not directly exposed in this binding. Advanced users with good understanding of the + * complexity involved with using these functions, may access them via the {@link #getLibrary} method:

+ * + *

+ * SharedLibrary objc = ObjCRuntime.getLibrary();
+ * long objc_msgSend = objc.getFunctionAddress("objc_msgSend");
+ * 
+ * // example usage
+ * long NSThread = objc_getClass("NSThread");
+ * long currentThread = invokePPP(NSThread, sel_getUid("currentThread"), objc_msgSend);
+ * + *

The safe way to use objc_msgSend in C code is to cast it to an appropriate function pointer. This is exactly what the {@link JNI JNI} + * class does. If a particular function signature is not available, {@link org.lwjgl.system.dyncall.DynCall DynCall} may be used to invoke it.

+ * + *

The functions not exposed are:

+ * + *
    + *
  • objc_msgSend
  • + *
  • objc_msgSend_stret
  • + *
  • objc_msgSendSuper
  • + *
  • objc_msgSendSuper_stret
  • + *
+ */ +public class ObjCRuntime { + + /** Nil value. */ + public static final long nil = 0x0L; + + /** Boolean values. */ + public static final byte + YES = 1, + NO = 0; + + /** Types. */ + public static final char + _C_ID = '@', + _C_CLASS = '#', + _C_SEL = ':', + _C_CHR = 'c', + _C_UCHR = 'C', + _C_SHT = 's', + _C_USHT = 'S', + _C_INT = 'i', + _C_UINT = 'I', + _C_LNG = 'l', + _C_ULNG = 'L', + _C_LNG_LNG = 'q', + _C_ULNG_LNG = 'Q', + _C_FLT = 'f', + _C_DBL = 'd', + _C_BFLD = 'b', + _C_BOOL = 'B', + _C_VOID = 'v', + _C_UNDEF = '?', + _C_PTR = '^', + _C_CHARPTR = '*', + _C_ATOM = '%', + _C_ARY_B = '[', + _C_ARY_E = ']', + _C_UNION_B = '(', + _C_UNION_E = ')', + _C_STRUCT_B = '{', + _C_STRUCT_E = '}', + _C_VECTOR = '!', + _C_CONST = 'r'; + + /** Policies related to associative references. */ + public static final int + OBJC_ASSOCIATION_ASSIGN = 0, + OBJC_ASSOCIATION_RETAIN_NONATOMIC = 1, + OBJC_ASSOCIATION_COPY_NONATOMIC = 3, + OBJC_ASSOCIATION_RETAIN = 1401, + OBJC_ASSOCIATION_COPY = 1403; + + protected ObjCRuntime() { + throw new UnsupportedOperationException(); + } + + private static final SharedLibrary OBJC = Library.loadNative(ObjCRuntime.class, "org.lwjgl", "objc"); + + /** Contains the function pointers loaded from the objc {@link SharedLibrary}. */ + public static final class Functions { + + private Functions() {} + + /** Function address. */ + public static final long + object_copy = apiGetFunctionAddress(OBJC, "object_copy"), + object_dispose = apiGetFunctionAddress(OBJC, "object_dispose"), + object_getClass = apiGetFunctionAddress(OBJC, "object_getClass"), + object_setClass = apiGetFunctionAddress(OBJC, "object_setClass"), + object_getClassName = apiGetFunctionAddress(OBJC, "object_getClassName"), + object_getIndexedIvars = apiGetFunctionAddress(OBJC, "object_getIndexedIvars"), + object_getIvar = apiGetFunctionAddress(OBJC, "object_getIvar"), + object_setIvar = apiGetFunctionAddress(OBJC, "object_setIvar"), + object_setInstanceVariable = apiGetFunctionAddress(OBJC, "object_setInstanceVariable"), + object_getInstanceVariable = apiGetFunctionAddress(OBJC, "object_getInstanceVariable"), + objc_getClass = apiGetFunctionAddress(OBJC, "objc_getClass"), + objc_getMetaClass = apiGetFunctionAddress(OBJC, "objc_getMetaClass"), + objc_lookUpClass = apiGetFunctionAddress(OBJC, "objc_lookUpClass"), + objc_getRequiredClass = apiGetFunctionAddress(OBJC, "objc_getRequiredClass"), + objc_getClassList = apiGetFunctionAddress(OBJC, "objc_getClassList"), + objc_copyClassList = apiGetFunctionAddress(OBJC, "objc_copyClassList"), + class_getName = apiGetFunctionAddress(OBJC, "class_getName"), + class_isMetaClass = apiGetFunctionAddress(OBJC, "class_isMetaClass"), + class_getSuperclass = apiGetFunctionAddress(OBJC, "class_getSuperclass"), + class_getVersion = apiGetFunctionAddress(OBJC, "class_getVersion"), + class_setVersion = apiGetFunctionAddress(OBJC, "class_setVersion"), + class_getInstanceSize = apiGetFunctionAddress(OBJC, "class_getInstanceSize"), + class_getInstanceVariable = apiGetFunctionAddress(OBJC, "class_getInstanceVariable"), + class_getClassVariable = apiGetFunctionAddress(OBJC, "class_getClassVariable"), + class_copyIvarList = apiGetFunctionAddress(OBJC, "class_copyIvarList"), + class_getInstanceMethod = apiGetFunctionAddress(OBJC, "class_getInstanceMethod"), + class_getClassMethod = apiGetFunctionAddress(OBJC, "class_getClassMethod"), + class_getMethodImplementation = apiGetFunctionAddress(OBJC, "class_getMethodImplementation"), + class_respondsToSelector = apiGetFunctionAddress(OBJC, "class_respondsToSelector"), + class_copyMethodList = apiGetFunctionAddress(OBJC, "class_copyMethodList"), + class_conformsToProtocol = apiGetFunctionAddress(OBJC, "class_conformsToProtocol"), + class_copyProtocolList = apiGetFunctionAddress(OBJC, "class_copyProtocolList"), + class_getProperty = apiGetFunctionAddress(OBJC, "class_getProperty"), + class_copyPropertyList = apiGetFunctionAddress(OBJC, "class_copyPropertyList"), + class_getIvarLayout = apiGetFunctionAddress(OBJC, "class_getIvarLayout"), + class_getWeakIvarLayout = apiGetFunctionAddress(OBJC, "class_getWeakIvarLayout"), + class_addMethod = apiGetFunctionAddress(OBJC, "class_addMethod"), + class_replaceMethod = apiGetFunctionAddress(OBJC, "class_replaceMethod"), + class_addIvar = apiGetFunctionAddress(OBJC, "class_addIvar"), + class_addProtocol = apiGetFunctionAddress(OBJC, "class_addProtocol"), + class_addProperty = apiGetFunctionAddress(OBJC, "class_addProperty"), + class_replaceProperty = apiGetFunctionAddress(OBJC, "class_replaceProperty"), + class_setIvarLayout = apiGetFunctionAddress(OBJC, "class_setIvarLayout"), + class_setWeakIvarLayout = apiGetFunctionAddress(OBJC, "class_setWeakIvarLayout"), + class_createInstance = apiGetFunctionAddress(OBJC, "class_createInstance"), + objc_constructInstance = apiGetFunctionAddress(OBJC, "objc_constructInstance"), + objc_destructInstance = apiGetFunctionAddress(OBJC, "objc_destructInstance"), + objc_allocateClassPair = apiGetFunctionAddress(OBJC, "objc_allocateClassPair"), + objc_registerClassPair = apiGetFunctionAddress(OBJC, "objc_registerClassPair"), + objc_disposeClassPair = apiGetFunctionAddress(OBJC, "objc_disposeClassPair"), + method_getName = apiGetFunctionAddress(OBJC, "method_getName"), + method_getImplementation = apiGetFunctionAddress(OBJC, "method_getImplementation"), + method_getTypeEncoding = apiGetFunctionAddress(OBJC, "method_getTypeEncoding"), + method_getNumberOfArguments = apiGetFunctionAddress(OBJC, "method_getNumberOfArguments"), + method_copyReturnType = apiGetFunctionAddress(OBJC, "method_copyReturnType"), + method_copyArgumentType = apiGetFunctionAddress(OBJC, "method_copyArgumentType"), + method_getReturnType = apiGetFunctionAddress(OBJC, "method_getReturnType"), + method_getArgumentType = apiGetFunctionAddress(OBJC, "method_getArgumentType"), + method_setImplementation = apiGetFunctionAddress(OBJC, "method_setImplementation"), + method_exchangeImplementations = apiGetFunctionAddress(OBJC, "method_exchangeImplementations"), + ivar_getName = apiGetFunctionAddress(OBJC, "ivar_getName"), + ivar_getTypeEncoding = apiGetFunctionAddress(OBJC, "ivar_getTypeEncoding"), + ivar_getOffset = apiGetFunctionAddress(OBJC, "ivar_getOffset"), + property_getName = apiGetFunctionAddress(OBJC, "property_getName"), + property_getAttributes = apiGetFunctionAddress(OBJC, "property_getAttributes"), + property_copyAttributeList = apiGetFunctionAddress(OBJC, "property_copyAttributeList"), + property_copyAttributeValue = apiGetFunctionAddress(OBJC, "property_copyAttributeValue"), + objc_getProtocol = apiGetFunctionAddress(OBJC, "objc_getProtocol"), + objc_copyProtocolList = apiGetFunctionAddress(OBJC, "objc_copyProtocolList"), + protocol_conformsToProtocol = apiGetFunctionAddress(OBJC, "protocol_conformsToProtocol"), + protocol_isEqual = apiGetFunctionAddress(OBJC, "protocol_isEqual"), + protocol_getName = apiGetFunctionAddress(OBJC, "protocol_getName"), + protocol_getMethodDescription = apiGetFunctionAddress(OBJC, "protocol_getMethodDescription"), + protocol_copyMethodDescriptionList = apiGetFunctionAddress(OBJC, "protocol_copyMethodDescriptionList"), + protocol_getProperty = apiGetFunctionAddress(OBJC, "protocol_getProperty"), + protocol_copyPropertyList = apiGetFunctionAddress(OBJC, "protocol_copyPropertyList"), + protocol_copyProtocolList = apiGetFunctionAddress(OBJC, "protocol_copyProtocolList"), + objc_allocateProtocol = apiGetFunctionAddress(OBJC, "objc_allocateProtocol"), + objc_registerProtocol = apiGetFunctionAddress(OBJC, "objc_registerProtocol"), + protocol_addMethodDescription = apiGetFunctionAddress(OBJC, "protocol_addMethodDescription"), + protocol_addProtocol = apiGetFunctionAddress(OBJC, "protocol_addProtocol"), + protocol_addProperty = apiGetFunctionAddress(OBJC, "protocol_addProperty"), + objc_copyImageNames = apiGetFunctionAddress(OBJC, "objc_copyImageNames"), + class_getImageName = apiGetFunctionAddress(OBJC, "class_getImageName"), + objc_copyClassNamesForImage = apiGetFunctionAddress(OBJC, "objc_copyClassNamesForImage"), + sel_getName = apiGetFunctionAddress(OBJC, "sel_getName"), + sel_getUid = apiGetFunctionAddress(OBJC, "sel_getUid"), + sel_registerName = apiGetFunctionAddress(OBJC, "sel_registerName"), + sel_isEqual = apiGetFunctionAddress(OBJC, "sel_isEqual"), + objc_enumerationMutation = apiGetFunctionAddress(OBJC, "objc_enumerationMutation"), + objc_setEnumerationMutationHandler = apiGetFunctionAddress(OBJC, "objc_setEnumerationMutationHandler"), + imp_implementationWithBlock = apiGetFunctionAddress(OBJC, "imp_implementationWithBlock"), + imp_getBlock = apiGetFunctionAddress(OBJC, "imp_getBlock"), + imp_removeBlock = apiGetFunctionAddress(OBJC, "imp_removeBlock"), + objc_loadWeak = apiGetFunctionAddress(OBJC, "objc_loadWeak"), + objc_storeWeak = apiGetFunctionAddress(OBJC, "objc_storeWeak"), + objc_setAssociatedObject = apiGetFunctionAddress(OBJC, "objc_setAssociatedObject"), + objc_getAssociatedObject = apiGetFunctionAddress(OBJC, "objc_getAssociatedObject"), + objc_removeAssociatedObjects = apiGetFunctionAddress(OBJC, "objc_removeAssociatedObjects"); + + } + + /** Returns the objc {@link SharedLibrary}. */ + public static SharedLibrary getLibrary() { + return OBJC; + } + + // --- [ object_copy ] --- + + /** + * Returns a copy of a given object. + * + * @param obj an Objective-C object + * @param size the size of the object {@code obj} + * + * @return a copy of obj + */ + @NativeType("id") + public static long object_copy(@NativeType("id") long obj, @NativeType("size_t") long size) { + long __functionAddress = Functions.object_copy; + if (CHECKS) { + check(obj); + } + return invokePPP(obj, size, __functionAddress); + } + + // --- [ object_dispose ] --- + + /** + * Frees the memory occupied by a given object. + * + * @param obj an Objective-C object + * + * @return {@link #nil} + */ + @NativeType("id") + public static long object_dispose(@NativeType("id") long obj) { + long __functionAddress = Functions.object_dispose; + if (CHECKS) { + check(obj); + } + return invokePP(obj, __functionAddress); + } + + // --- [ object_getClass ] --- + + /** + * Returns the class of an object. + * + * @param obj an Objective-C object + * + * @return the class object of which object is an instance, or Nil if {@code obj} is {@link #nil} + */ + @NativeType("Class") + public static long object_getClass(@NativeType("id") long obj) { + long __functionAddress = Functions.object_getClass; + return invokePP(obj, __functionAddress); + } + + // --- [ object_setClass ] --- + + /** + * Sets the class of an object. + * + * @param obj the object to modify + * @param cls a class object + * + * @return the previous value of object's class, or Nil if {@code obj} is {@link #nil} + */ + @NativeType("Class") + public static long object_setClass(@NativeType("id") long obj, @NativeType("Class") long cls) { + long __functionAddress = Functions.object_setClass; + if (CHECKS) { + check(cls); + } + return invokePPP(obj, cls, __functionAddress); + } + + // --- [ object_getClassName ] --- + + /** Unsafe version of: {@link #object_getClassName} */ + public static long nobject_getClassName(long obj) { + long __functionAddress = Functions.object_getClassName; + return invokePP(obj, __functionAddress); + } + + /** + * Returns the class name of a given object. + * + * @param obj an Objective-C object + * + * @return the name of the class of which {@code obj} is an instance + */ + @Nullable + @NativeType("char const *") + public static String object_getClassName(@NativeType("id") long obj) { + long __result = nobject_getClassName(obj); + return memUTF8Safe(__result); + } + + // --- [ object_getIndexedIvars ] --- + + /** + * This function returns a pointer to any extra bytes allocated with the instance (as specified by {@link #class_createInstance} with extraBytes>0). This + * memory follows the object's ordinary ivars, but may not be adjacent to the last ivar. + * + *

The returned pointer is guaranteed to be pointer-size aligned, even if the area following the object's last ivar is less aligned than that. Alignment + * greater than pointer-size is never guaranteed, even if the area following the object's last ivar is more aligned than that.

+ * + *

In a garbage-collected environment, the memory is scanned conservatively.

+ * + * @param obj an Objective-C object + * + * @return a pointer to any extra bytes allocated with {@code obj}. If {@code obj} was not allocated with any extra bytes, then dereferencing the returned pointer + * is undefined. + */ + @NativeType("void *") + public static long object_getIndexedIvars(@NativeType("id") long obj) { + long __functionAddress = Functions.object_getIndexedIvars; + if (CHECKS) { + check(obj); + } + return invokePP(obj, __functionAddress); + } + + // --- [ object_getIvar ] --- + + /** + * Reads the value of an instance variable in an object. + * + * @param obj the object containing the instance variable whose value you want to read + * @param ivar the Ivar describing the instance variable whose value you want to read + * + * @return the value of the instance variable specified by {@code ivar}, or {@link #nil} if {@code obj} is {@link #nil} + */ + @NativeType("id") + public static long object_getIvar(@NativeType("id") long obj, @NativeType("Ivar") long ivar) { + long __functionAddress = Functions.object_getIvar; + if (CHECKS) { + check(ivar); + } + return invokePPP(obj, ivar, __functionAddress); + } + + // --- [ object_setIvar ] --- + + /** + * Sets the value of an instance variable in an object. + * + *

object_setIvar is faster than {@link #object_setInstanceVariable} if the Ivar for the instance variable is already known.

+ * + * @param obj the object containing the instance variable whose value you want to set + * @param ivar the Ivar describing the instance variable whose value you want to set + * @param value the new value for the instance variable + */ + public static void object_setIvar(@NativeType("id") long obj, @NativeType("Ivar") long ivar, @NativeType("id") long value) { + long __functionAddress = Functions.object_setIvar; + if (CHECKS) { + check(obj); + check(ivar); + check(value); + } + invokePPPV(obj, ivar, value, __functionAddress); + } + + // --- [ object_setInstanceVariable ] --- + + /** Unsafe version of: {@link #object_setInstanceVariable} */ + public static long nobject_setInstanceVariable(long obj, long name, long value) { + long __functionAddress = Functions.object_setInstanceVariable; + if (CHECKS) { + check(obj); + } + return invokePPPP(obj, name, value, __functionAddress); + } + + /** + * Changes the value of an instance variable of a class instance. + * + * @param obj a pointer to an instance of a class. Pass the object containing the instance variable whose value you wish to modify + * @param name a C string. Pass the name of the instance variable whose value you wish to modify + * @param value the new value for the instance variable + * + * @return a pointer to the Ivar data structure that defines the type and name of the instance variable specified by name + */ + @NativeType("Ivar") + public static long object_setInstanceVariable(@NativeType("id") long obj, @NativeType("char const *") ByteBuffer name, @NativeType("void *") ByteBuffer value) { + if (CHECKS) { + checkNT1(name); + } + return nobject_setInstanceVariable(obj, memAddress(name), memAddress(value)); + } + + /** + * Changes the value of an instance variable of a class instance. + * + * @param obj a pointer to an instance of a class. Pass the object containing the instance variable whose value you wish to modify + * @param name a C string. Pass the name of the instance variable whose value you wish to modify + * @param value the new value for the instance variable + * + * @return a pointer to the Ivar data structure that defines the type and name of the instance variable specified by name + */ + @NativeType("Ivar") + public static long object_setInstanceVariable(@NativeType("id") long obj, @NativeType("char const *") CharSequence name, @NativeType("void *") ByteBuffer value) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(name, true); + long nameEncoded = stack.getPointerAddress(); + return nobject_setInstanceVariable(obj, nameEncoded, memAddress(value)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ object_getInstanceVariable ] --- + + /** Unsafe version of: {@link #object_getInstanceVariable} */ + public static long nobject_getInstanceVariable(long obj, long name, long outValue) { + long __functionAddress = Functions.object_getInstanceVariable; + if (CHECKS) { + check(obj); + } + return invokePPPP(obj, name, outValue, __functionAddress); + } + + /** + * Obtains the value of an instance variable of a class instance. + * + * @param obj a pointer to an instance of a class. Pass the object containing the instance variable whose value you wish to obtain + * @param name a C string. Pass the name of the instance variable whose value you wish to obtain + * @param outValue on return, contains a pointer to the value of the instance variable + * + * @return a pointer to the Ivar data structure that defines the type and name of the instance variable specified by name + */ + @NativeType("Ivar") + public static long object_getInstanceVariable(@NativeType("id") long obj, @NativeType("char const *") ByteBuffer name, @NativeType("void **") PointerBuffer outValue) { + if (CHECKS) { + checkNT1(name); + check(outValue, 1); + } + return nobject_getInstanceVariable(obj, memAddress(name), memAddress(outValue)); + } + + /** + * Obtains the value of an instance variable of a class instance. + * + * @param obj a pointer to an instance of a class. Pass the object containing the instance variable whose value you wish to obtain + * @param name a C string. Pass the name of the instance variable whose value you wish to obtain + * @param outValue on return, contains a pointer to the value of the instance variable + * + * @return a pointer to the Ivar data structure that defines the type and name of the instance variable specified by name + */ + @NativeType("Ivar") + public static long object_getInstanceVariable(@NativeType("id") long obj, @NativeType("char const *") CharSequence name, @NativeType("void **") PointerBuffer outValue) { + if (CHECKS) { + check(outValue, 1); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(name, true); + long nameEncoded = stack.getPointerAddress(); + return nobject_getInstanceVariable(obj, nameEncoded, memAddress(outValue)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ objc_getClass ] --- + + /** Unsafe version of: {@link #objc_getClass} */ + public static long nobjc_getClass(long name) { + long __functionAddress = Functions.objc_getClass; + return invokePP(name, __functionAddress); + } + + /** + * Returns the class definition of a specified class. + * + *

objc_getClass is different from {@link #objc_lookUpClass} in that if the class is not registered, objc_getClass calls the class handler callback and then + * checks a second time to see whether the class is registered. objc_lookUpClass does not call the class handler callback.

+ * + * @param name the name of the class to look up + * + * @return the Class object for the named class, or {@link #nil} if the class is not registered with the Objective-C runtime + */ + @NativeType("Class") + public static long objc_getClass(@NativeType("char const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nobjc_getClass(memAddress(name)); + } + + /** + * Returns the class definition of a specified class. + * + *

objc_getClass is different from {@link #objc_lookUpClass} in that if the class is not registered, objc_getClass calls the class handler callback and then + * checks a second time to see whether the class is registered. objc_lookUpClass does not call the class handler callback.

+ * + * @param name the name of the class to look up + * + * @return the Class object for the named class, or {@link #nil} if the class is not registered with the Objective-C runtime + */ + @NativeType("Class") + public static long objc_getClass(@NativeType("char const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(name, true); + long nameEncoded = stack.getPointerAddress(); + return nobjc_getClass(nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ objc_getMetaClass ] --- + + /** Unsafe version of: {@link #objc_getMetaClass} */ + public static long nobjc_getMetaClass(long name) { + long __functionAddress = Functions.objc_getMetaClass; + return invokePP(name, __functionAddress); + } + + /** + * Returns the metaclass definition of a specified class. + * + *

If the definition for the named class is not registered, this function calls the class handler callback and then checks a second time to see if the + * class is registered. However, every class definition must have a valid metaclass definition, and so the metaclass definition is always returned, + * whether it’s valid or not.

+ * + * @param name the name of the class to look up + * + * @return the Class object for the metaclass of the named class, or {@link #nil} if the class is not registered with the Objective-C runtime + */ + @NativeType("Class") + public static long objc_getMetaClass(@NativeType("char const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nobjc_getMetaClass(memAddress(name)); + } + + /** + * Returns the metaclass definition of a specified class. + * + *

If the definition for the named class is not registered, this function calls the class handler callback and then checks a second time to see if the + * class is registered. However, every class definition must have a valid metaclass definition, and so the metaclass definition is always returned, + * whether it’s valid or not.

+ * + * @param name the name of the class to look up + * + * @return the Class object for the metaclass of the named class, or {@link #nil} if the class is not registered with the Objective-C runtime + */ + @NativeType("Class") + public static long objc_getMetaClass(@NativeType("char const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(name, true); + long nameEncoded = stack.getPointerAddress(); + return nobjc_getMetaClass(nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ objc_lookUpClass ] --- + + /** Unsafe version of: {@link #objc_lookUpClass} */ + public static long nobjc_lookUpClass(long name) { + long __functionAddress = Functions.objc_lookUpClass; + return invokePP(name, __functionAddress); + } + + /** + * Returns the class definition of a specified class. + * + *

{@link #objc_getClass} is different from this function in that if the class is not registered, objc_getClass calls the class handler callback and then checks + * a second time to see whether the class is registered. This function does not call the class handler callback.

+ * + * @param name the name of the class to look up + * + * @return the Class object for the named class, or {@link #nil} if the class is not registered with the Objective-C runtime + */ + @NativeType("Class") + public static long objc_lookUpClass(@NativeType("char const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nobjc_lookUpClass(memAddress(name)); + } + + /** + * Returns the class definition of a specified class. + * + *

{@link #objc_getClass} is different from this function in that if the class is not registered, objc_getClass calls the class handler callback and then checks + * a second time to see whether the class is registered. This function does not call the class handler callback.

+ * + * @param name the name of the class to look up + * + * @return the Class object for the named class, or {@link #nil} if the class is not registered with the Objective-C runtime + */ + @NativeType("Class") + public static long objc_lookUpClass(@NativeType("char const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(name, true); + long nameEncoded = stack.getPointerAddress(); + return nobjc_lookUpClass(nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ objc_getRequiredClass ] --- + + /** Unsafe version of: {@link #objc_getRequiredClass} */ + public static long nobjc_getRequiredClass(long name) { + long __functionAddress = Functions.objc_getRequiredClass; + return invokePP(name, __functionAddress); + } + + /** + * Returns the class definition of a specified class. + * + *

This function is the same as {@link #objc_getClass}, but kills the process if the class is not found.

+ * + *

This function is used by ZeroLink, where failing to find a class would be a compile-time link error without ZeroLink.

+ * + * @param name the name of the class to look up + * + * @return the Class object for the named class + */ + @NativeType("Class") + public static long objc_getRequiredClass(@NativeType("char const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nobjc_getRequiredClass(memAddress(name)); + } + + /** + * Returns the class definition of a specified class. + * + *

This function is the same as {@link #objc_getClass}, but kills the process if the class is not found.

+ * + *

This function is used by ZeroLink, where failing to find a class would be a compile-time link error without ZeroLink.

+ * + * @param name the name of the class to look up + * + * @return the Class object for the named class + */ + @NativeType("Class") + public static long objc_getRequiredClass(@NativeType("char const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(name, true); + long nameEncoded = stack.getPointerAddress(); + return nobjc_getRequiredClass(nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ objc_getClassList ] --- + + /** + * Unsafe version of: {@link #objc_getClassList} + * + * @param bufferCount the number of pointers for which you have allocated space in buffer. On return, this function fills in only this number of elements. If this number + * is less than the number of registered classes, this function returns an arbitrary subset of the registered classes. + */ + public static int nobjc_getClassList(long buffer, int bufferCount) { + long __functionAddress = Functions.objc_getClassList; + return invokePI(buffer, bufferCount, __functionAddress); + } + + /** + * Obtains the list of registered class definitions. + * + *

The Objective-C runtime library automatically registers all the classes defined in your source code. You can create class definitions at runtime and + * register them with the {@link #objc_allocateClassPair} and {@link #objc_registerClassPair} functions.

+ * + *
Special Considerations
+ * + *

You cannot assume that class objects you get from this function are classes that inherit from NSObject, so you cannot safely call any methods on such + * classes without detecting that the method is implemented first.

+ * + * @param buffer an array of Class values. On output, each Class value points to one class definition, up to either {@code bufferCount} or the total number of + * registered classes, whichever is less. You can pass {@code NULL} to obtain the total number of registered class definitions without actually retrieving + * any class definitions. + * + * @return an integer value indicating the total number of registered classes + */ + public static int objc_getClassList(@Nullable @NativeType("Class *") PointerBuffer buffer) { + return nobjc_getClassList(memAddressSafe(buffer), remainingSafe(buffer)); + } + + // --- [ objc_copyClassList ] --- + + /** + * Unsafe version of: {@link #objc_copyClassList} + * + * @param outCount an integer pointer used to store the number of classes returned by this function in the list. This parameter may be {@link #nil} + */ + public static long nobjc_copyClassList(long outCount) { + long __functionAddress = Functions.objc_copyClassList; + return invokePP(outCount, __functionAddress); + } + + /** + * Creates and returns a list of pointers to all registered class definitions. + * + * @return a {@link #nil} terminated array of classes. You must free the array with free() + */ + @Nullable + @NativeType("Class *") + public static PointerBuffer objc_copyClassList() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + IntBuffer outCount = stack.callocInt(1); + try { + long __result = nobjc_copyClassList(memAddress(outCount)); + return memPointerBufferSafe(__result, outCount.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ class_getName ] --- + + /** Unsafe version of: {@link #class_getName} */ + public static long nclass_getName(long cls) { + long __functionAddress = Functions.class_getName; + return invokePP(cls, __functionAddress); + } + + /** + * Returns the name of a class. + * + * @param cls a class object + * + * @return the name of the class, or the empty string if cls is Nil + */ + @Nullable + @NativeType("char const *") + public static String class_getName(@NativeType("Class") long cls) { + long __result = nclass_getName(cls); + return memUTF8Safe(__result); + } + + // --- [ class_isMetaClass ] --- + + /** + * Returns a Boolean value that indicates whether a class object is a metaclass. + * + * @param cls a class object + * + * @return {@link #YES} if cls is a metaclass, {@link #NO} if cls is a non-meta class, {@link #NO} if cls is Nil + */ + @NativeType("BOOL") + public static boolean class_isMetaClass(@NativeType("Class") long cls) { + long __functionAddress = Functions.class_isMetaClass; + return invokePZ(cls, __functionAddress); + } + + // --- [ class_getSuperclass ] --- + + /** + * Returns the superclass of a class. + * + * @param cls a class object + * + * @return the superclass of the class, or Nil if cls is a root class, or Nil if cls is Nil + */ + @NativeType("Class") + public static long class_getSuperclass(@NativeType("Class") long cls) { + long __functionAddress = Functions.class_getSuperclass; + return invokePP(cls, __functionAddress); + } + + // --- [ class_getVersion ] --- + + /** + * Returns the version number of a class definition. + * + *

You can use the version number of the class definition to provide versioning of the interface that your class represents to other classes. This is + * especially useful for object serialization (that is, archiving of the object in a flattened form), where it is important to recognize changes to the + * layout of the instance variables in different class-definition versions.

+ * + *

Classes derived from the Foundation framework NSObject class can obtain the class-definition version number using the getVersion class method, which is + * implemented using the class_getVersion function.

+ * + * @param cls a pointer to an Class data structure. Pass the class definition for which you wish to obtain the version + * + * @return an integer indicating the version number of the class definition + */ + public static int class_getVersion(@NativeType("Class") long cls) { + long __functionAddress = Functions.class_getVersion; + if (CHECKS) { + check(cls); + } + return invokePI(cls, __functionAddress); + } + + // --- [ class_setVersion ] --- + + /** + * Sets the version number of a class definition. + * + *

You can use the version number of the class definition to provide versioning of the interface that your class represents to other classes. This is + * especially useful for object serialization (that is, archiving of the object in a flattened form), where it is important to recognize changes to the + * layout of the instance variables in different class-definition versions.

+ * + *

Classes derived from the Foundation framework NSObject class can set the class-definition version number using the setVersion: class method, which is + * implemented using the class_setVersion function.

+ * + * @param cls a pointer to an Class data structure. Pass the class definition for which you wish to set the version + * @param version the new version number of the class definition + */ + public static void class_setVersion(@NativeType("Class") long cls, int version) { + long __functionAddress = Functions.class_setVersion; + if (CHECKS) { + check(cls); + } + invokePV(cls, version, __functionAddress); + } + + // --- [ class_getInstanceSize ] --- + + /** + * Returns the size of instances of a class. + * + * @param cls a class object + * + * @return the size in bytes of instances of the class {@code cls}, or 0 if {@code cls} is Nil + */ + @NativeType("size_t") + public static long class_getInstanceSize(@NativeType("Class") long cls) { + long __functionAddress = Functions.class_getInstanceSize; + return invokePP(cls, __functionAddress); + } + + // --- [ class_getInstanceVariable ] --- + + /** Unsafe version of: {@link #class_getInstanceVariable} */ + public static long nclass_getInstanceVariable(long cls, long name) { + long __functionAddress = Functions.class_getInstanceVariable; + if (CHECKS) { + check(cls); + } + return invokePPP(cls, name, __functionAddress); + } + + /** + * Returns the Ivar for a specified instance variable of a given class. + * + * @param cls the class whose instance variable you wish to obtain + * @param name the name of the instance variable definition to obtain + * + * @return a pointer to an Ivar data structure containing information about the instance variable specified by name + */ + @NativeType("Ivar") + public static long class_getInstanceVariable(@NativeType("Class") long cls, @NativeType("char const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nclass_getInstanceVariable(cls, memAddress(name)); + } + + /** + * Returns the Ivar for a specified instance variable of a given class. + * + * @param cls the class whose instance variable you wish to obtain + * @param name the name of the instance variable definition to obtain + * + * @return a pointer to an Ivar data structure containing information about the instance variable specified by name + */ + @NativeType("Ivar") + public static long class_getInstanceVariable(@NativeType("Class") long cls, @NativeType("char const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(name, true); + long nameEncoded = stack.getPointerAddress(); + return nclass_getInstanceVariable(cls, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ class_getClassVariable ] --- + + /** Unsafe version of: {@link #class_getClassVariable} */ + public static long nclass_getClassVariable(long cls, long name) { + long __functionAddress = Functions.class_getClassVariable; + if (CHECKS) { + check(cls); + } + return invokePPP(cls, name, __functionAddress); + } + + /** + * Returns the Ivar for a specified class variable of a given class. + * + * @param cls the class definition whose class variable you wish to obtain + * @param name the name of the class variable definition to obtain + * + * @return a pointer to an Ivar data structure containing information about the class variable specified by name + */ + @NativeType("Ivar") + public static long class_getClassVariable(@NativeType("Class") long cls, @NativeType("char const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nclass_getClassVariable(cls, memAddress(name)); + } + + /** + * Returns the Ivar for a specified class variable of a given class. + * + * @param cls the class definition whose class variable you wish to obtain + * @param name the name of the class variable definition to obtain + * + * @return a pointer to an Ivar data structure containing information about the class variable specified by name + */ + @NativeType("Ivar") + public static long class_getClassVariable(@NativeType("Class") long cls, @NativeType("char const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(name, true); + long nameEncoded = stack.getPointerAddress(); + return nclass_getClassVariable(cls, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ class_copyIvarList ] --- + + /** + * Unsafe version of: {@link #class_copyIvarList} + * + * @param outCount on return, contains the length of the returned array. If {@code outCount} is {@code NULL}, the length is not returned + */ + public static long nclass_copyIvarList(long cls, long outCount) { + long __functionAddress = Functions.class_copyIvarList; + return invokePPP(cls, outCount, __functionAddress); + } + + /** + * Describes the instance variables declared by a class. + * + * @param cls the class to inspect + * + * @return an array of pointers of type Ivar describing the instance variables declared by the class. Any instance variables declared by superclasses are not + * included. The array contains {@code *outCount} pointers followed by a {@code NULL} terminator. You must free the array with free(). + * + *

If the class declares no instance variables, or {@code cls} is Nil, {@code NULL} is returned and {@code *outCount} is 0.

+ */ + @Nullable + @NativeType("Ivar *") + public static PointerBuffer class_copyIvarList(@NativeType("Class") long cls) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + IntBuffer outCount = stack.callocInt(1); + try { + long __result = nclass_copyIvarList(cls, memAddress(outCount)); + return memPointerBufferSafe(__result, outCount.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ class_getInstanceMethod ] --- + + /** + * Returns a specified instance method for a given class. + * + *

Note that this function searches superclasses for implementations, whereas {@link #class_copyMethodList} does not.

+ * + * @param cls the class you want to inspect + * @param name the selector of the method you want to retrieve + * + * @return the method that corresponds to the implementation of the selector specified by aSelector for the class specified by {@code cls}, or {@code NULL} if the + * specified class or its superclasses do not contain an instance method with the specified selector. + */ + @NativeType("Method") + public static long class_getInstanceMethod(@NativeType("Class") long cls, @NativeType("SEL") long name) { + long __functionAddress = Functions.class_getInstanceMethod; + if (CHECKS) { + check(cls); + check(name); + } + return invokePPP(cls, name, __functionAddress); + } + + // --- [ class_getClassMethod ] --- + + /** + * Returns a pointer to the data structure describing a given class method for a given class. + * + *

Note that this function searches superclasses for implementations, whereas {@link #class_copyMethodList} does not.

+ * + * @param cls a pointer to a class definition. Pass the class that contains the method you want to retrieve + * @param name a pointer of type SEL. Pass the selector of the method you want to retrieve + * + * @return a pointer to the Method data structure that corresponds to the implementation of the selector specified by {@code name} for the class specified by + * {@code cls}, or {@code NULL} if the specified class or its superclasses do not contain a class method with the specified selector. + */ + @NativeType("Method") + public static long class_getClassMethod(@NativeType("Class") long cls, @NativeType("SEL") long name) { + long __functionAddress = Functions.class_getClassMethod; + if (CHECKS) { + check(cls); + check(name); + } + return invokePPP(cls, name, __functionAddress); + } + + // --- [ class_getMethodImplementation ] --- + + /** + * Returns the function pointer that would be called if a particular message were sent to an instance of a class. + * + *

class_getMethodImplementation may be faster than {@code method_getImplementation(class_getInstanceMethod(cls, name))}.

+ * + *

The function pointer returned may be a function internal to the runtime instead of an actual method implementation. For example, if instances of the + * class do not respond to the selector, the function pointer returned will be part of the runtime's message forwarding machinery.

+ * + * @param cls the class you want to inspect + * @param name a selector + * + * @return the function pointer that would be called if {@code [object name]} were called with an instance of the class, or {@code NULL} if {@code cls} is Nil + */ + @NativeType("IMP") + public static long class_getMethodImplementation(@NativeType("Class") long cls, @NativeType("SEL") long name) { + long __functionAddress = Functions.class_getMethodImplementation; + if (CHECKS) { + check(name); + } + return invokePPP(cls, name, __functionAddress); + } + + // --- [ class_respondsToSelector ] --- + + /** + * Returns a Boolean value that indicates whether instances of a class respond to a particular selector. + * + *

You should usually use NSObject's respondsToSelector: or instancesRespondToSelector: methods instead of this function.

+ * + * @param cls the class you want to inspect + * @param name a selector + * + * @return {@link #YES} if instances of the class respond to the selector, otherwise {@link #NO} + */ + @NativeType("BOOL") + public static boolean class_respondsToSelector(@NativeType("Class") long cls, @NativeType("SEL") long name) { + long __functionAddress = Functions.class_respondsToSelector; + if (CHECKS) { + check(cls); + check(name); + } + return invokePPZ(cls, name, __functionAddress); + } + + // --- [ class_copyMethodList ] --- + + /** + * Unsafe version of: {@link #class_copyMethodList} + * + * @param outCount on return, contains the length of the returned array. If {@code outCount} is {@code NULL}, the length is not returned + */ + public static long nclass_copyMethodList(long cls, long outCount) { + long __functionAddress = Functions.class_copyMethodList; + return invokePPP(cls, outCount, __functionAddress); + } + + /** + * Describes the instance methods implemented by a class. + * + * @param cls the class you want to inspect + * + * @return an array of pointers of type Method describing the instance methods implemented by the class—any instance methods implemented by superclasses are not + * included. The array contains {@code *outCount} pointers followed by a {@code NULL} terminator. You must free the array with free(). + * + *

If {@code cls} implements no instance methods, or {@code cls} is Nil, returns {@code NULL} and {@code *outCount} is 0.

+ */ + @Nullable + @NativeType("Method *") + public static PointerBuffer class_copyMethodList(@NativeType("Class") long cls) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + IntBuffer outCount = stack.callocInt(1); + try { + long __result = nclass_copyMethodList(cls, memAddress(outCount)); + return memPointerBufferSafe(__result, outCount.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ class_conformsToProtocol ] --- + + /** + * Returns a Boolean value that indicates whether a class conforms to a given protocol. + * + *

You should usually use NSObject's conformsToProtocol: method instead of this function.

+ * + * @param cls the class you want to inspect + * @param protocol a protocol + * + * @return {@link #YES} if {@code cls} conforms to {@code protocol}, otherwise {@link #NO} + */ + @NativeType("BOOL") + public static boolean class_conformsToProtocol(@NativeType("Class") long cls, @NativeType("Protocol *") long protocol) { + long __functionAddress = Functions.class_conformsToProtocol; + if (CHECKS) { + check(cls); + check(protocol); + } + return invokePPZ(cls, protocol, __functionAddress); + } + + // --- [ class_copyProtocolList ] --- + + /** + * Unsafe version of: {@link #class_copyProtocolList} + * + * @param outCount on return, contains the length of the returned array. If {@code outCount} is {@code NULL}, the length is not returned + */ + public static long nclass_copyProtocolList(long cls, long outCount) { + long __functionAddress = Functions.class_copyProtocolList; + return invokePPP(cls, outCount, __functionAddress); + } + + /** + * Describes the protocols adopted by a class. + * + * @param cls the class you want to inspect + * + * @return an array of pointers of type Protocol* describing the protocols adopted by the class. Any protocols adopted by superclasses or other protocols are not + * included. The array contains {@code *outCount} pointers followed by a {@code NULL} terminator. You must free the array with free(). + * + *

If {@code cls} adopts no protocols, or {@code cls} is Nil, returns {@code NULL} and {@code *outCount} is 0.

+ */ + @Nullable + @NativeType("Protocol **") + public static PointerBuffer class_copyProtocolList(@NativeType("Class") long cls) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + IntBuffer outCount = stack.callocInt(1); + try { + long __result = nclass_copyProtocolList(cls, memAddress(outCount)); + return memPointerBufferSafe(__result, outCount.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ class_getProperty ] --- + + /** Unsafe version of: {@link #class_getProperty} */ + public static long nclass_getProperty(long cls, long name) { + long __functionAddress = Functions.class_getProperty; + return invokePPP(cls, name, __functionAddress); + } + + /** + * Returns a property with a given name of a given class. + * + * @param cls the class you want to inspect + * @param name a C string. Pass the name of the instance variable whose value you wish to modify. + * + * @return a pointer of type {@code objc_property_t} describing the property, or {@code NULL} if the class does not declare a property with that name, or {@code NULL} if + * {@code cls} is Nil. + */ + @NativeType("objc_property_t") + public static long class_getProperty(@NativeType("Class") long cls, @NativeType("char const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nclass_getProperty(cls, memAddress(name)); + } + + /** + * Returns a property with a given name of a given class. + * + * @param cls the class you want to inspect + * @param name a C string. Pass the name of the instance variable whose value you wish to modify. + * + * @return a pointer of type {@code objc_property_t} describing the property, or {@code NULL} if the class does not declare a property with that name, or {@code NULL} if + * {@code cls} is Nil. + */ + @NativeType("objc_property_t") + public static long class_getProperty(@NativeType("Class") long cls, @NativeType("char const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(name, true); + long nameEncoded = stack.getPointerAddress(); + return nclass_getProperty(cls, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ class_copyPropertyList ] --- + + /** + * Unsafe version of: {@link #class_copyPropertyList} + * + * @param outCount on return, contains the length of the returned array. If {@code outCount} is {@code NULL}, the length is not returned + */ + public static long nclass_copyPropertyList(long cls, long outCount) { + long __functionAddress = Functions.class_copyPropertyList; + return invokePPP(cls, outCount, __functionAddress); + } + + /** + * Describes the properties declared by a class. + * + * @param cls the class you want to inspect + * + * @return an array of pointers of type {@code objc_property_t} describing the properties declared by the class. Any properties declared by superclasses are not + * included. The array contains {@code *outCount} pointers followed by a {@code NULL} terminator. You must free the array with free(). + * + *

If {@code cls} declares no properties, or {@code cls} is Nil, returns {@code NULL} and {@code *outCount} is 0.

+ */ + @Nullable + @NativeType("objc_property_t *") + public static PointerBuffer class_copyPropertyList(@NativeType("Class") long cls) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + IntBuffer outCount = stack.callocInt(1); + try { + long __result = nclass_copyPropertyList(cls, memAddress(outCount)); + return memPointerBufferSafe(__result, outCount.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ class_getIvarLayout ] --- + + /** Unsafe version of: {@link #class_getIvarLayout} */ + public static long nclass_getIvarLayout(long cls) { + long __functionAddress = Functions.class_getIvarLayout; + if (CHECKS) { + check(cls); + } + return invokePP(cls, __functionAddress); + } + + /** + * Returns a description of the Ivar layout for a given class. + * + * @param cls the class to inspect + * + * @return a description of the Ivar layout for {@code cls} + */ + @Nullable + @NativeType("uint8_t const *") + public static String class_getIvarLayout(@NativeType("Class") long cls) { + long __result = nclass_getIvarLayout(cls); + return memASCIISafe(__result); + } + + // --- [ class_getWeakIvarLayout ] --- + + /** Unsafe version of: {@link #class_getWeakIvarLayout} */ + public static long nclass_getWeakIvarLayout(long cls) { + long __functionAddress = Functions.class_getWeakIvarLayout; + if (CHECKS) { + check(cls); + } + return invokePP(cls, __functionAddress); + } + + /** + * Returns a description of the layout of weak Ivars for a given class. + * + * @param cls the class to inspect + * + * @return a description of the layout of the weak Ivars for {@code cls} + */ + @Nullable + @NativeType("uint8_t const *") + public static String class_getWeakIvarLayout(@NativeType("Class") long cls) { + long __result = nclass_getWeakIvarLayout(cls); + return memASCIISafe(__result); + } + + // --- [ class_addMethod ] --- + + /** Unsafe version of: {@link #class_addMethod} */ + public static boolean nclass_addMethod(long cls, long name, long imp, long types) { + long __functionAddress = Functions.class_addMethod; + if (CHECKS) { + check(cls); + check(name); + check(imp); + } + return invokePPPPZ(cls, name, imp, types, __functionAddress); + } + + /** + * Adds a new method to a class with a given name and implementation. + * + *
Discussion
+ * + *

class_addMethod will add an override of a superclass's implementation, but will not replace an existing implementation in this class. To change an + * existing implementation, use {@link #method_setImplementation}.

+ * + *

An Objective-C method is simply a C function that takes at least two arguments – {@code self} and {@code _cmd}. For example, given the following + * function:

+ * + *

+     * void myMethodIMP(id self, SEL _cmd)
+     * {
+     *     // implementation ....
+     * }
+ * + *

you can dynamically add it to a class as a method (called {@code resolveThisMethodDynamically}) like this:

+ * + *

+     * class_addMethod([self class], @selector(resolveThisMethodDynamically), (IMP) myMethodIMP, "v@:");
+ * + * @param cls the class to which to add a method + * @param name a selector that specifies the name of the method being added + * @param imp a function which is the implementation of the new method. The function must take at least two arguments – {@code self} and {@code _cmd}. + * @param types an array of characters that describe the types of the arguments to the method. For possible values, see Objective-C Runtime Programming + * Guide > Type Encodings in Objective-C Runtime Programming Guide. Since the function must take at least two arguments – {@code self} + * and {@code _cmd}, the second and third characters must be “@:” (the first character is the return type). + * + * @return {@link #YES} if the method was added successfully, otherwise {@link #NO} (for example, the class already contains a method implementation with that name) + */ + @NativeType("BOOL") + public static boolean class_addMethod(@NativeType("Class") long cls, @NativeType("SEL") long name, @NativeType("IMP") long imp, @NativeType("char const *") ByteBuffer types) { + if (CHECKS) { + checkNT1(types); + } + return nclass_addMethod(cls, name, imp, memAddress(types)); + } + + /** + * Adds a new method to a class with a given name and implementation. + * + *
Discussion
+ * + *

class_addMethod will add an override of a superclass's implementation, but will not replace an existing implementation in this class. To change an + * existing implementation, use {@link #method_setImplementation}.

+ * + *

An Objective-C method is simply a C function that takes at least two arguments – {@code self} and {@code _cmd}. For example, given the following + * function:

+ * + *

+     * void myMethodIMP(id self, SEL _cmd)
+     * {
+     *     // implementation ....
+     * }
+ * + *

you can dynamically add it to a class as a method (called {@code resolveThisMethodDynamically}) like this:

+ * + *

+     * class_addMethod([self class], @selector(resolveThisMethodDynamically), (IMP) myMethodIMP, "v@:");
+ * + * @param cls the class to which to add a method + * @param name a selector that specifies the name of the method being added + * @param imp a function which is the implementation of the new method. The function must take at least two arguments – {@code self} and {@code _cmd}. + * @param types an array of characters that describe the types of the arguments to the method. For possible values, see Objective-C Runtime Programming + * Guide > Type Encodings in Objective-C Runtime Programming Guide. Since the function must take at least two arguments – {@code self} + * and {@code _cmd}, the second and third characters must be “@:” (the first character is the return type). + * + * @return {@link #YES} if the method was added successfully, otherwise {@link #NO} (for example, the class already contains a method implementation with that name) + */ + @NativeType("BOOL") + public static boolean class_addMethod(@NativeType("Class") long cls, @NativeType("SEL") long name, @NativeType("IMP") long imp, @NativeType("char const *") CharSequence types) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(types, true); + long typesEncoded = stack.getPointerAddress(); + return nclass_addMethod(cls, name, imp, typesEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ class_replaceMethod ] --- + + /** Unsafe version of: {@link #class_replaceMethod} */ + public static long nclass_replaceMethod(long cls, long name, long imp, long types) { + long __functionAddress = Functions.class_replaceMethod; + if (CHECKS) { + check(cls); + check(name); + check(imp); + } + return invokePPPPP(cls, name, imp, types, __functionAddress); + } + + /** + * Replaces the implementation of a method for a given class. + * + *
Discussion
+ * + *

This function behaves in two different ways:

+ * + *
    + *
  • If the method identified by name does not yet exist, it is added as if class_addMethod were called. The type encoding specified by types is used as + * given.
  • + *
  • If the method identified by name does exist, its IMP is replaced as if method_setImplementation were called. The type encoding specified by types + * is ignored.
  • + *
+ * + * @param cls the class you want to modify + * @param name a selector that identifies the method whose implementation you want to replace + * @param imp the new implementation for the method identified by {@code name} for the class identified by {@code cls} + * @param types an array of characters that describe the types of the arguments to the method. For possible values, see Objective-C Runtime Programming + * Guide > Type Encodings in Objective-C Runtime Programming Guide. Since the function must take at least two arguments – {@code self} + * and {@code _cmd}, the second and third characters must be “@:” (the first character is the return type). + * + * @return the previous implementation of the method identified by {@code name} for the class identified by {@code cls} + */ + @NativeType("IMP") + public static long class_replaceMethod(@NativeType("Class") long cls, @NativeType("SEL") long name, @NativeType("IMP") long imp, @NativeType("char const *") ByteBuffer types) { + if (CHECKS) { + checkNT1(types); + } + return nclass_replaceMethod(cls, name, imp, memAddress(types)); + } + + /** + * Replaces the implementation of a method for a given class. + * + *
Discussion
+ * + *

This function behaves in two different ways:

+ * + *
    + *
  • If the method identified by name does not yet exist, it is added as if class_addMethod were called. The type encoding specified by types is used as + * given.
  • + *
  • If the method identified by name does exist, its IMP is replaced as if method_setImplementation were called. The type encoding specified by types + * is ignored.
  • + *
+ * + * @param cls the class you want to modify + * @param name a selector that identifies the method whose implementation you want to replace + * @param imp the new implementation for the method identified by {@code name} for the class identified by {@code cls} + * @param types an array of characters that describe the types of the arguments to the method. For possible values, see Objective-C Runtime Programming + * Guide > Type Encodings in Objective-C Runtime Programming Guide. Since the function must take at least two arguments – {@code self} + * and {@code _cmd}, the second and third characters must be “@:” (the first character is the return type). + * + * @return the previous implementation of the method identified by {@code name} for the class identified by {@code cls} + */ + @NativeType("IMP") + public static long class_replaceMethod(@NativeType("Class") long cls, @NativeType("SEL") long name, @NativeType("IMP") long imp, @NativeType("char const *") CharSequence types) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(types, true); + long typesEncoded = stack.getPointerAddress(); + return nclass_replaceMethod(cls, name, imp, typesEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ class_addIvar ] --- + + /** Unsafe version of: {@link #class_addIvar} */ + public static boolean nclass_addIvar(long cls, long name, long size, byte alignment, long types) { + long __functionAddress = Functions.class_addIvar; + if (CHECKS) { + check(cls); + } + return invokePPPPZ(cls, name, size, alignment, types, __functionAddress); + } + + /** + * Adds a new instance variable to a class. + * + *

This function may only be called after {@link #objc_allocateClassPair} and before {@link #objc_registerClassPair}. Adding an instance variable to an existing class + * is not supported.

+ * + *

The class must not be a metaclass. Adding an instance variable to a metaclass is not supported.

+ * + *

The instance variable's minimum alignment in bytes is {@code 1< + * + * @return {@link #YES} if the instance variable was added successfully, otherwise {@link #NO} (for example, the class already contains an instance variable with that name) + */ + @NativeType("BOOL") + public static boolean class_addIvar(@NativeType("Class") long cls, @NativeType("char const *") ByteBuffer name, @NativeType("size_t") long size, @NativeType("uint8_t") byte alignment, @NativeType("char const *") ByteBuffer types) { + if (CHECKS) { + checkNT1(name); + checkNT1(types); + } + return nclass_addIvar(cls, memAddress(name), size, alignment, memAddress(types)); + } + + /** + * Adds a new instance variable to a class. + * + *

This function may only be called after {@link #objc_allocateClassPair} and before {@link #objc_registerClassPair}. Adding an instance variable to an existing class + * is not supported.

+ * + *

The class must not be a metaclass. Adding an instance variable to a metaclass is not supported.

+ * + *

The instance variable's minimum alignment in bytes is {@code 1< + * + * @return {@link #YES} if the instance variable was added successfully, otherwise {@link #NO} (for example, the class already contains an instance variable with that name) + */ + @NativeType("BOOL") + public static boolean class_addIvar(@NativeType("Class") long cls, @NativeType("char const *") CharSequence name, @NativeType("size_t") long size, @NativeType("uint8_t") byte alignment, @NativeType("char const *") CharSequence types) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(name, true); + long nameEncoded = stack.getPointerAddress(); + stack.nUTF8(types, true); + long typesEncoded = stack.getPointerAddress(); + return nclass_addIvar(cls, nameEncoded, size, alignment, typesEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ class_addProtocol ] --- + + /** + * Adds a protocol to a class. + * + * @param cls the class to modify + * @param protocol the protocol to add to {@code cls} + * + * @return {@link #YES} if the protocol was added successfully, otherwise {@link #NO} (for example, the class already conforms to that protocol) + */ + @NativeType("BOOL") + public static boolean class_addProtocol(@NativeType("Class") long cls, @NativeType("Protocol *") long protocol) { + long __functionAddress = Functions.class_addProtocol; + if (CHECKS) { + check(cls); + check(protocol); + } + return invokePPZ(cls, protocol, __functionAddress); + } + + // --- [ class_addProperty ] --- + + /** + * Unsafe version of: {@link #class_addProperty} + * + * @param attributeCount the number of attributes in {@code attributes} + */ + public static boolean nclass_addProperty(long cls, long name, long attributes, int attributeCount) { + long __functionAddress = Functions.class_addProperty; + if (CHECKS) { + check(cls); + ObjCPropertyAttribute.validate(attributes, attributeCount); + } + return invokePPPZ(cls, name, attributes, attributeCount, __functionAddress); + } + + /** + * Adds a property to a class. + * + * @param cls the class to modify + * @param name the name of the property + * @param attributes an array of property attributes + * + * @return {@link #YES} if the property was added successfully; otherwise {@link #NO} (for example, this function returns {@link #NO} if the class already has that property) + */ + @NativeType("BOOL") + public static boolean class_addProperty(@NativeType("Class") long cls, @NativeType("char const *") ByteBuffer name, @NativeType("objc_property_attribute_t const *") ObjCPropertyAttribute.Buffer attributes) { + if (CHECKS) { + checkNT1(name); + } + return nclass_addProperty(cls, memAddress(name), attributes.address(), attributes.remaining()); + } + + /** + * Adds a property to a class. + * + * @param cls the class to modify + * @param name the name of the property + * @param attributes an array of property attributes + * + * @return {@link #YES} if the property was added successfully; otherwise {@link #NO} (for example, this function returns {@link #NO} if the class already has that property) + */ + @NativeType("BOOL") + public static boolean class_addProperty(@NativeType("Class") long cls, @NativeType("char const *") CharSequence name, @NativeType("objc_property_attribute_t const *") ObjCPropertyAttribute.Buffer attributes) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(name, true); + long nameEncoded = stack.getPointerAddress(); + return nclass_addProperty(cls, nameEncoded, attributes.address(), attributes.remaining()); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ class_replaceProperty ] --- + + /** + * Unsafe version of: {@link #class_replaceProperty} + * + * @param attributeCount the number of attributes in {@code attributes} + */ + public static void nclass_replaceProperty(long cls, long name, long attributes, int attributeCount) { + long __functionAddress = Functions.class_replaceProperty; + if (CHECKS) { + check(cls); + ObjCPropertyAttribute.validate(attributes, attributeCount); + } + invokePPPV(cls, name, attributes, attributeCount, __functionAddress); + } + + /** + * Replaces a property of a class. + * + * @param cls the class to modify + * @param name the name of the property + * @param attributes an array of property attributes + */ + public static void class_replaceProperty(@NativeType("Class") long cls, @NativeType("char const *") ByteBuffer name, @NativeType("objc_property_attribute_t const *") ObjCPropertyAttribute.Buffer attributes) { + if (CHECKS) { + checkNT1(name); + } + nclass_replaceProperty(cls, memAddress(name), attributes.address(), attributes.remaining()); + } + + /** + * Replaces a property of a class. + * + * @param cls the class to modify + * @param name the name of the property + * @param attributes an array of property attributes + */ + public static void class_replaceProperty(@NativeType("Class") long cls, @NativeType("char const *") CharSequence name, @NativeType("objc_property_attribute_t const *") ObjCPropertyAttribute.Buffer attributes) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(name, true); + long nameEncoded = stack.getPointerAddress(); + nclass_replaceProperty(cls, nameEncoded, attributes.address(), attributes.remaining()); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ class_setIvarLayout ] --- + + /** Unsafe version of: {@link #class_setIvarLayout} */ + public static void nclass_setIvarLayout(long cls, long layout) { + long __functionAddress = Functions.class_setIvarLayout; + if (CHECKS) { + check(cls); + } + invokePPV(cls, layout, __functionAddress); + } + + /** + * Sets the Ivar layout for a given class. + * + * @param cls the class to modify + * @param layout the layout of the Ivars for {@code cls} + */ + public static void class_setIvarLayout(@NativeType("Class") long cls, @NativeType("uint8_t const *") ByteBuffer layout) { + if (CHECKS) { + checkNT1(layout); + } + nclass_setIvarLayout(cls, memAddress(layout)); + } + + /** + * Sets the Ivar layout for a given class. + * + * @param cls the class to modify + * @param layout the layout of the Ivars for {@code cls} + */ + public static void class_setIvarLayout(@NativeType("Class") long cls, @NativeType("uint8_t const *") CharSequence layout) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(layout, true); + long layoutEncoded = stack.getPointerAddress(); + nclass_setIvarLayout(cls, layoutEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ class_setWeakIvarLayout ] --- + + /** Unsafe version of: {@link #class_setWeakIvarLayout} */ + public static void nclass_setWeakIvarLayout(long cls, long layout) { + long __functionAddress = Functions.class_setWeakIvarLayout; + if (CHECKS) { + check(cls); + } + invokePPV(cls, layout, __functionAddress); + } + + /** + * Sets the layout for weak Ivars for a given class. + * + * @param cls the class to modify + * @param layout the layout of the weak Ivars for {@code cls} + */ + public static void class_setWeakIvarLayout(@NativeType("Class") long cls, @NativeType("uint8_t const *") ByteBuffer layout) { + if (CHECKS) { + checkNT1(layout); + } + nclass_setWeakIvarLayout(cls, memAddress(layout)); + } + + /** + * Sets the layout for weak Ivars for a given class. + * + * @param cls the class to modify + * @param layout the layout of the weak Ivars for {@code cls} + */ + public static void class_setWeakIvarLayout(@NativeType("Class") long cls, @NativeType("uint8_t const *") CharSequence layout) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(layout, true); + long layoutEncoded = stack.getPointerAddress(); + nclass_setWeakIvarLayout(cls, layoutEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ class_createInstance ] --- + + /** + * Creates an instance of a class, allocating memory for the class in the default malloc memory zone. + * + * @param cls the class that you want to allocate an instance of + * @param extraBytes an integer indicating the number of extra bytes to allocate. The additional bytes can be used to store additional instance variables beyond those + * defined in the class definition. + * + * @return an instance of the class {@code cls} + */ + @NativeType("id") + public static long class_createInstance(@NativeType("Class") long cls, @NativeType("size_t") long extraBytes) { + long __functionAddress = Functions.class_createInstance; + if (CHECKS) { + check(cls); + } + return invokePPP(cls, extraBytes, __functionAddress); + } + + // --- [ objc_constructInstance ] --- + + /** Unsafe version of: {@link #objc_constructInstance} */ + public static long nobjc_constructInstance(long cls, long bytes) { + long __functionAddress = Functions.objc_constructInstance; + return invokePPP(cls, bytes, __functionAddress); + } + + /** + * Creates an instance of a class at the specified location. + * + * @param cls the class that you want to allocate an instance of + * @param bytes the location at which to allocate an instance of the {@code cls} class. {@code bytes} must point to at least {@code class_getInstanceSize(cls)} + * bytes of well-aligned, zero-filled memory. + * + * @return an instance of the class {@code cls} at {@code bytes}, if successful; otherwise {@link #nil} (for example, if {@code cls} or {@code bytes} are themselves {@link #nil}) + */ + @NativeType("id") + public static long objc_constructInstance(@NativeType("Class") long cls, @Nullable @NativeType("void *") ByteBuffer bytes) { + if (CHECKS) { + if (DEBUG) { + checkSafe(bytes, class_getInstanceSize(cls)); + } + } + return nobjc_constructInstance(cls, memAddressSafe(bytes)); + } + + // --- [ objc_destructInstance ] --- + + /** + * Destroys an instance of a class without freeing memory and removes any of its associated references. + * + *

This method does nothing if obj is {@link #nil}.

+ * + *
Important
+ * + *

The garbage collector does not call this function. As a result, if you edit this function, you should also edit finalize. That said, Core Foundation + * and other clients do call this function under garbage collection.

+ * + * @param obj the instance to destroy + */ + @NativeType("void *") + public static long objc_destructInstance(@NativeType("id") long obj) { + long __functionAddress = Functions.objc_destructInstance; + if (CHECKS) { + check(obj); + } + return invokePP(obj, __functionAddress); + } + + // --- [ objc_allocateClassPair ] --- + + /** Unsafe version of: {@link #objc_allocateClassPair} */ + public static long nobjc_allocateClassPair(long superclass, long name, long extraBytes) { + long __functionAddress = Functions.objc_allocateClassPair; + return invokePPPP(superclass, name, extraBytes, __functionAddress); + } + + /** + * Creates a new class and metaclass. + * + *

You can get a pointer to the new metaclass by calling {@code object_getClass(newClass)}.

+ * + *

To create a new class, start by calling objc_allocateClassPair. Then set the class's attributes with functions like {@link #class_addMethod} and + * {@link #class_addIvar}. When you are done building the class, call {@link #objc_registerClassPair}. The new class is now ready for use.

+ * + *

Instance methods and instance variables should be added to the class itself. Class methods should be added to the metaclass.

+ * + * @param superclass the class to use as the new class's superclass, or Nil to create a new root class + * @param name the string to use as the new class's name. The string will be copied. + * @param extraBytes the number of bytes to allocate for indexed ivars at the end of the class and metaclass objects. This should usually be 0. + * + * @return the new class, or Nil if the class could not be created (for example, the desired name is already in use) + */ + @NativeType("Class") + public static long objc_allocateClassPair(@NativeType("Class") long superclass, @NativeType("char const *") ByteBuffer name, @NativeType("size_t") long extraBytes) { + if (CHECKS) { + checkNT1(name); + } + return nobjc_allocateClassPair(superclass, memAddress(name), extraBytes); + } + + /** + * Creates a new class and metaclass. + * + *

You can get a pointer to the new metaclass by calling {@code object_getClass(newClass)}.

+ * + *

To create a new class, start by calling objc_allocateClassPair. Then set the class's attributes with functions like {@link #class_addMethod} and + * {@link #class_addIvar}. When you are done building the class, call {@link #objc_registerClassPair}. The new class is now ready for use.

+ * + *

Instance methods and instance variables should be added to the class itself. Class methods should be added to the metaclass.

+ * + * @param superclass the class to use as the new class's superclass, or Nil to create a new root class + * @param name the string to use as the new class's name. The string will be copied. + * @param extraBytes the number of bytes to allocate for indexed ivars at the end of the class and metaclass objects. This should usually be 0. + * + * @return the new class, or Nil if the class could not be created (for example, the desired name is already in use) + */ + @NativeType("Class") + public static long objc_allocateClassPair(@NativeType("Class") long superclass, @NativeType("char const *") CharSequence name, @NativeType("size_t") long extraBytes) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(name, true); + long nameEncoded = stack.getPointerAddress(); + return nobjc_allocateClassPair(superclass, nameEncoded, extraBytes); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ objc_registerClassPair ] --- + + /** + * Registers a class that was allocated using {@link #objc_allocateClassPair}. + * + * @param cls the class you want to register + */ + public static void objc_registerClassPair(@NativeType("Class") long cls) { + long __functionAddress = Functions.objc_registerClassPair; + if (CHECKS) { + check(cls); + } + invokePV(cls, __functionAddress); + } + + // --- [ objc_disposeClassPair ] --- + + /** + * Destroys a class and its associated metaclass. + * + *

Do not call this function if instances of the {@code cls} class or any subclass exist.

+ * + * @param cls the class to be destroyed. This class must have been allocated using {@link #objc_allocateClassPair}. + */ + public static void objc_disposeClassPair(@NativeType("Class") long cls) { + long __functionAddress = Functions.objc_disposeClassPair; + if (CHECKS) { + check(cls); + } + invokePV(cls, __functionAddress); + } + + // --- [ method_getName ] --- + + /** + * Returns the name of a method. + * + *

To get the method name as a C string, call {@code sel_getName(method_getName(method))}.

+ * + * @param m the method to inspect + * + * @return a pointer of type SEL + */ + @NativeType("SEL") + public static long method_getName(@NativeType("Method") long m) { + long __functionAddress = Functions.method_getName; + if (CHECKS) { + check(m); + } + return invokePP(m, __functionAddress); + } + + // --- [ method_getImplementation ] --- + + /** + * Returns the implementation of a method. + * + * @param m the method to inspect + * + * @return a function pointer of type IMP + */ + @NativeType("IMP") + public static long method_getImplementation(@NativeType("Method") long m) { + long __functionAddress = Functions.method_getImplementation; + if (CHECKS) { + check(m); + } + return invokePP(m, __functionAddress); + } + + // --- [ method_getTypeEncoding ] --- + + /** Unsafe version of: {@link #method_getTypeEncoding} */ + public static long nmethod_getTypeEncoding(long m) { + long __functionAddress = Functions.method_getTypeEncoding; + if (CHECKS) { + check(m); + } + return invokePP(m, __functionAddress); + } + + /** + * Returns a string describing a method's parameter and return types. + * + * @param m the method to inspect + * + * @return a C string. The string may be {@code NULL} + */ + @Nullable + @NativeType("char const *") + public static String method_getTypeEncoding(@NativeType("Method") long m) { + long __result = nmethod_getTypeEncoding(m); + return memUTF8Safe(__result); + } + + // --- [ method_getNumberOfArguments ] --- + + /** + * Returns the number of arguments accepted by a method. + * + * @param m a pointer to a Method data structure. Pass the method in question. + * + * @return an integer containing the number of arguments accepted by the given method + */ + @NativeType("unsigned int") + public static int method_getNumberOfArguments(@NativeType("Method") long m) { + long __functionAddress = Functions.method_getNumberOfArguments; + if (CHECKS) { + check(m); + } + return invokePI(m, __functionAddress); + } + + // --- [ method_copyReturnType ] --- + + /** Unsafe version of: {@link #method_copyReturnType} */ + public static long nmethod_copyReturnType(long m) { + long __functionAddress = Functions.method_copyReturnType; + if (CHECKS) { + check(m); + } + return invokePP(m, __functionAddress); + } + + /** + * Returns a string describing a method's return type. + * + * @param m the method to inspect + * + * @return a C string describing the return type. You must free the string with free(). + */ + @Nullable + @NativeType("char *") + public static String method_copyReturnType(@NativeType("Method") long m) { + long __result = nmethod_copyReturnType(m); + return memUTF8Safe(__result); + } + + // --- [ method_copyArgumentType ] --- + + /** Unsafe version of: {@link #method_copyArgumentType} */ + public static long nmethod_copyArgumentType(long m, int index) { + long __functionAddress = Functions.method_copyArgumentType; + if (CHECKS) { + check(m); + } + return invokePP(m, index, __functionAddress); + } + + /** + * Returns a string describing a single parameter type of a method. + * + * @param m the method to inspect + * @param index the index of the parameter to inspect + * + * @return a C string describing the type of the parameter at index {@code index}, or {@code NULL} if method has no parameter index {@code index}. You must free the + * string with free(). + */ + @Nullable + @NativeType("char *") + public static String method_copyArgumentType(@NativeType("Method") long m, @NativeType("unsigned int") int index) { + long __result = nmethod_copyArgumentType(m, index); + return memUTF8Safe(__result); + } + + // --- [ method_getReturnType ] --- + + /** + * Unsafe version of: {@link #method_getReturnType} + * + * @param dst_len the maximum number of characters that can be stored in {@code dst} + */ + public static void nmethod_getReturnType(long m, long dst, long dst_len) { + long __functionAddress = Functions.method_getReturnType; + if (CHECKS) { + check(m); + } + invokePPPV(m, dst, dst_len, __functionAddress); + } + + /** + * Returns by reference a string describing a method's return type. + * + *

The method's return type string is copied to {@code dst}. {@code dst} is filled as if {@code strncpy(dst, parameter_type, dst_len)} were called.

+ * + * @param m the method to inspect + * @param dst the reference string to store the description + */ + public static void method_getReturnType(@NativeType("Method") long m, @NativeType("char *") ByteBuffer dst) { + nmethod_getReturnType(m, memAddress(dst), dst.remaining()); + } + + /** + * Returns by reference a string describing a method's return type. + * + *

The method's return type string is copied to {@code dst}. {@code dst} is filled as if {@code strncpy(dst, parameter_type, dst_len)} were called.

+ * + * @param m the method to inspect + * @param dst_len the maximum number of characters that can be stored in {@code dst} + */ + @NativeType("void") + public static String method_getReturnType(@NativeType("Method") long m, @NativeType("size_t") long dst_len) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + ByteBuffer dst = stack.malloc((int)dst_len); + nmethod_getReturnType(m, memAddress(dst), dst_len); + return memUTF8(memByteBufferNT1(memAddress(dst), (int)dst_len)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ method_getArgumentType ] --- + + /** + * Unsafe version of: {@link #method_getArgumentType} + * + * @param dst_len the maximum number of characters that can be stored in {@code dst} + */ + public static void nmethod_getArgumentType(long m, int index, long dst, long dst_len) { + long __functionAddress = Functions.method_getArgumentType; + if (CHECKS) { + check(m); + } + invokePPPV(m, index, dst, dst_len, __functionAddress); + } + + /** + * Returns by reference a string describing a single parameter type of a method. + * + *

The parameter type string is copied to {@code dst}. {@code dst} is filled as if {@code strncpy(dst, parameter_type, dst_len)} were called. If the + * method contains no parameter with that index, {@code dst} is filled as if {@code strncpy(dst, "", dst_len)} were called.

+ * + * @param m the method you want to inquire about + * @param index the index of the parameter you want to inquire about + * @param dst the reference string to store the description + */ + public static void method_getArgumentType(@NativeType("Method") long m, @NativeType("unsigned int") int index, @NativeType("char *") ByteBuffer dst) { + nmethod_getArgumentType(m, index, memAddress(dst), dst.remaining()); + } + + /** + * Returns by reference a string describing a single parameter type of a method. + * + *

The parameter type string is copied to {@code dst}. {@code dst} is filled as if {@code strncpy(dst, parameter_type, dst_len)} were called. If the + * method contains no parameter with that index, {@code dst} is filled as if {@code strncpy(dst, "", dst_len)} were called.

+ * + * @param m the method you want to inquire about + * @param index the index of the parameter you want to inquire about + * @param dst_len the maximum number of characters that can be stored in {@code dst} + */ + @NativeType("void") + public static String method_getArgumentType(@NativeType("Method") long m, @NativeType("unsigned int") int index, @NativeType("size_t") long dst_len) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + ByteBuffer dst = stack.malloc((int)dst_len); + nmethod_getArgumentType(m, index, memAddress(dst), dst_len); + return memUTF8(memByteBufferNT1(memAddress(dst), (int)dst_len)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ method_setImplementation ] --- + + /** + * Sets the implementation of a method. + * + * @param m the method for which to set an implementation + * @param imp the implemention to set to this method + * + * @return the previous implementation of the method + */ + @NativeType("IMP") + public static long method_setImplementation(@NativeType("Method") long m, @NativeType("IMP") long imp) { + long __functionAddress = Functions.method_setImplementation; + if (CHECKS) { + check(m); + check(imp); + } + return invokePPP(m, imp, __functionAddress); + } + + // --- [ method_exchangeImplementations ] --- + + /** + * Exchanges the implementations of two methods. + * + * @param m1 the method to exchange with second method + * @param m2 the method to exchange with first method + */ + public static void method_exchangeImplementations(@NativeType("Method") long m1, @NativeType("Method") long m2) { + long __functionAddress = Functions.method_exchangeImplementations; + if (CHECKS) { + check(m1); + check(m2); + } + invokePPV(m1, m2, __functionAddress); + } + + // --- [ ivar_getName ] --- + + /** Unsafe version of: {@link #ivar_getName} */ + public static long nivar_getName(long v) { + long __functionAddress = Functions.ivar_getName; + if (CHECKS) { + check(v); + } + return invokePP(v, __functionAddress); + } + + /** + * Returns the name of an instance variable. + * + * @param v the instance variable + * + * @return a C string containing the instance variable's name + */ + @Nullable + @NativeType("char const *") + public static String ivar_getName(@NativeType("Ivar") long v) { + long __result = nivar_getName(v); + return memUTF8Safe(__result); + } + + // --- [ ivar_getTypeEncoding ] --- + + /** Unsafe version of: {@link #ivar_getTypeEncoding} */ + public static long nivar_getTypeEncoding(long v) { + long __functionAddress = Functions.ivar_getTypeEncoding; + if (CHECKS) { + check(v); + } + return invokePP(v, __functionAddress); + } + + /** + * Returns the type string of an instance variable. + * + * @param v the instance variable + * + * @return a C string containing the instance variable's type encoding + */ + @Nullable + @NativeType("char const *") + public static String ivar_getTypeEncoding(@NativeType("Ivar") long v) { + long __result = nivar_getTypeEncoding(v); + return memUTF8Safe(__result); + } + + // --- [ ivar_getOffset ] --- + + /** + * Returns the offset of an instance variable. + * + *

For instance variables of type {@code id} or other object types, call {@link #object_getIvar} and {@link #object_setIvar} instead of using this offset to access + * the instance variable data directly.

+ * + * @param v the instance variable + * + * @return the offset of {@code v} + */ + @NativeType("ptrdiff_t") + public static long ivar_getOffset(@NativeType("Ivar") long v) { + long __functionAddress = Functions.ivar_getOffset; + if (CHECKS) { + check(v); + } + return invokePP(v, __functionAddress); + } + + // --- [ property_getName ] --- + + /** Unsafe version of: {@link #property_getName} */ + public static long nproperty_getName(long property) { + long __functionAddress = Functions.property_getName; + if (CHECKS) { + check(property); + } + return invokePP(property, __functionAddress); + } + + /** + * Returns the name of a property. + * + * @param property the property you want to inquire about + * + * @return a C string containing the property's name + */ + @Nullable + @NativeType("char const *") + public static String property_getName(@NativeType("objc_property_t") long property) { + long __result = nproperty_getName(property); + return memUTF8Safe(__result); + } + + // --- [ property_getAttributes ] --- + + /** Unsafe version of: {@link #property_getAttributes} */ + public static long nproperty_getAttributes(long property) { + long __functionAddress = Functions.property_getAttributes; + if (CHECKS) { + check(property); + } + return invokePP(property, __functionAddress); + } + + /** + * Returns the attribute string of a property. + * + * @param property a property + * + * @return a C string containing the property's attributes + */ + @Nullable + @NativeType("char const *") + public static String property_getAttributes(@NativeType("objc_property_t") long property) { + long __result = nproperty_getAttributes(property); + return memUTF8Safe(__result); + } + + // --- [ property_copyAttributeList ] --- + + /** + * Unsafe version of: {@link #property_copyAttributeList} + * + * @param outCount the number of attributes returned in the array + */ + public static long nproperty_copyAttributeList(long property, long outCount) { + long __functionAddress = Functions.property_copyAttributeList; + if (CHECKS) { + check(property); + } + return invokePPP(property, outCount, __functionAddress); + } + + /** + * Returns an array of property attributes for a given property. + * + * @param property the property whose attributes you want to copy + * + * @return an array of property attributes. You must free the array with free(). + */ + @Nullable + @NativeType("objc_property_attribute_t *") + public static ObjCPropertyAttribute.Buffer property_copyAttributeList(@NativeType("objc_property_t") long property) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + IntBuffer outCount = stack.callocInt(1); + try { + long __result = nproperty_copyAttributeList(property, memAddress(outCount)); + return ObjCPropertyAttribute.createSafe(__result, outCount.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ property_copyAttributeValue ] --- + + /** Unsafe version of: {@link #property_copyAttributeValue} */ + public static long nproperty_copyAttributeValue(long property, long attributeName) { + long __functionAddress = Functions.property_copyAttributeValue; + if (CHECKS) { + check(property); + } + return invokePPP(property, attributeName, __functionAddress); + } + + /** + * Returns the value of a property attribute given the attribute name. + * + * @param property the property whose value you are interested in + * @param attributeName a C string representing the name of the attribute + * + * @return The value string of the {@code attributeName} attribute, if one exists in {@code property}; otherwise, {@link #nil}. You must free the returned value string + * with free(). + */ + @Nullable + @NativeType("char *") + public static String property_copyAttributeValue(@NativeType("objc_property_t") long property, @NativeType("char const *") ByteBuffer attributeName) { + if (CHECKS) { + checkNT1(attributeName); + } + long __result = nproperty_copyAttributeValue(property, memAddress(attributeName)); + return memUTF8Safe(__result); + } + + /** + * Returns the value of a property attribute given the attribute name. + * + * @param property the property whose value you are interested in + * @param attributeName a C string representing the name of the attribute + * + * @return The value string of the {@code attributeName} attribute, if one exists in {@code property}; otherwise, {@link #nil}. You must free the returned value string + * with free(). + */ + @Nullable + @NativeType("char *") + public static String property_copyAttributeValue(@NativeType("objc_property_t") long property, @NativeType("char const *") CharSequence attributeName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(attributeName, true); + long attributeNameEncoded = stack.getPointerAddress(); + long __result = nproperty_copyAttributeValue(property, attributeNameEncoded); + return memUTF8Safe(__result); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ objc_getProtocol ] --- + + /** Unsafe version of: {@link #objc_getProtocol} */ + public static long nobjc_getProtocol(long name) { + long __functionAddress = Functions.objc_getProtocol; + return invokePP(name, __functionAddress); + } + + /** + * Returns a specified protocol. + * + *

This function acquires the runtime lock.

+ * + * @param name the name of a protocol + * + * @return the protocol named {@code name}{, or {@code NULL} if no protocol named name could be found + */ + @NativeType("Protocol *") + public static long objc_getProtocol(@NativeType("char const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nobjc_getProtocol(memAddress(name)); + } + + /** + * Returns a specified protocol. + * + *

This function acquires the runtime lock.

+ * + * @param name the name of a protocol + * + * @return the protocol named {@code name}{, or {@code NULL} if no protocol named name could be found + */ + @NativeType("Protocol *") + public static long objc_getProtocol(@NativeType("char const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(name, true); + long nameEncoded = stack.getPointerAddress(); + return nobjc_getProtocol(nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ objc_copyProtocolList ] --- + + /** + * Unsafe version of: {@link #objc_copyProtocolList} + * + * @param outCount upon return, contains the number of protocols in the returned array + */ + public static long nobjc_copyProtocolList(long outCount) { + long __functionAddress = Functions.objc_copyProtocolList; + return invokePP(outCount, __functionAddress); + } + + /** + * Returns an array of all the protocols known to the runtime. + * + * @return a C array of all the protocols known to the runtime. The array contains {@code *outCount} pointers followed by a {@code NULL} terminator. You must free the + * list with free(). + */ + @Nullable + @NativeType("Protocol **") + public static PointerBuffer objc_copyProtocolList() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + IntBuffer outCount = stack.callocInt(1); + try { + long __result = nobjc_copyProtocolList(memAddress(outCount)); + return memPointerBufferSafe(__result, outCount.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ protocol_conformsToProtocol ] --- + + /** + * Returns a Boolean value that indicates whether one protocol conforms to another protocol. + * + *
Discussion
+ * + *

One protocol can incorporate other protocols using the same syntax that classes use to adopt a protocol:

+ * + *

{@code @protocol ProtocolName < protocol list >}

+ * + *

All the protocols listed between angle brackets are considered part of the {@code ProtocolName} protocol.

+ * + * @param proto a protocol + * @param other a protocol + * + * @return {@link #YES} if {@code proto} conforms to {@code other}, otherwise {@link #NO} + */ + @NativeType("BOOL") + public static boolean protocol_conformsToProtocol(@NativeType("Protocol *") long proto, @NativeType("Protocol *") long other) { + long __functionAddress = Functions.protocol_conformsToProtocol; + if (CHECKS) { + check(proto); + check(other); + } + return invokePPZ(proto, other, __functionAddress); + } + + // --- [ protocol_isEqual ] --- + + /** + * Returns a Boolean value that indicates whether two protocols are equal. + * + * @param proto a protocol + * @param other a protocol + * + * @return {@link #YES} if proto is the same as other, otherwise {@link #NO} + */ + @NativeType("BOOL") + public static boolean protocol_isEqual(@NativeType("Protocol *") long proto, @NativeType("Protocol *") long other) { + long __functionAddress = Functions.protocol_isEqual; + if (CHECKS) { + check(proto); + check(other); + } + return invokePPZ(proto, other, __functionAddress); + } + + // --- [ protocol_getName ] --- + + /** Unsafe version of: {@link #protocol_getName} */ + public static long nprotocol_getName(long p) { + long __functionAddress = Functions.protocol_getName; + if (CHECKS) { + check(p); + } + return invokePP(p, __functionAddress); + } + + /** + * Returns a the name of a protocol. + * + * @param p a protocol + * + * @return the name of the protocol {@code p} as a C string + */ + @Nullable + @NativeType("char const *") + public static String protocol_getName(@NativeType("Protocol *") long p) { + long __result = nprotocol_getName(p); + return memUTF8Safe(__result); + } + + // --- [ protocol_getMethodDescription ] --- + + /** Unsafe version of: {@link #protocol_getMethodDescription} */ + public static native void nprotocol_getMethodDescription(long p, long aSel, boolean isRequiredMethod, boolean isInstanceMethod, long __functionAddress, long __result); + + /** Unsafe version of: {@link #protocol_getMethodDescription} */ + public static void nprotocol_getMethodDescription(long p, long aSel, boolean isRequiredMethod, boolean isInstanceMethod, long __result) { + long __functionAddress = Functions.protocol_getMethodDescription; + if (CHECKS) { + check(p); + check(aSel); + } + nprotocol_getMethodDescription(p, aSel, isRequiredMethod, isInstanceMethod, __functionAddress, __result); + } + + /** + * Returns a method description structure for a specified method of a given protocol. + * + * @param p a protocol + * @param aSel a selector + * @param isRequiredMethod a Boolean value that indicates whether {@code aSel} is a required method + * @param isInstanceMethod a Boolean value that indicates whether {@code aSel} is a instance method + * @param __result an objc_method_description structure that describes the method specified by {@code aSel}, {@code isRequiredMethod}, and {@code isInstanceMethod} for + * the protocol {@code p}. + * + *

If the protocol does not contain the specified method, returns an objc_method_description structure with the value {@code {NULL, NULL}}.

+ */ + @NativeType("struct objc_method_description") + public static ObjCMethodDescription protocol_getMethodDescription(@NativeType("Protocol *") long p, @NativeType("SEL") long aSel, @NativeType("BOOL") boolean isRequiredMethod, @NativeType("BOOL") boolean isInstanceMethod, @NativeType("struct objc_method_description") ObjCMethodDescription __result) { + nprotocol_getMethodDescription(p, aSel, isRequiredMethod, isInstanceMethod, __result.address()); + return __result; + } + + // --- [ protocol_copyMethodDescriptionList ] --- + + /** + * Unsafe version of: {@link #protocol_copyMethodDescriptionList} + * + * @param outCount upon return, contains the number of method description structures in the returned array + */ + public static long nprotocol_copyMethodDescriptionList(long p, boolean isRequiredMethod, boolean isInstanceMethod, long outCount) { + long __functionAddress = Functions.protocol_copyMethodDescriptionList; + if (CHECKS) { + check(p); + } + return invokePPP(p, isRequiredMethod, isInstanceMethod, outCount, __functionAddress); + } + + /** + * Returns an array of method descriptions of methods meeting a given specification for a given protocol. + * + *

Methods in other protocols adopted by this protocol are not included.

+ * + * @param p a protocol + * @param isRequiredMethod a Boolean value that indicates whether returned methods should be required methods (pass {@link #YES} to specify required methods) + * @param isInstanceMethod a Boolean value that indicates whether returned methods should be instance methods (pass {@link #YES} to specify instance methods) + * + * @return a C array of objc_method_description structures containing the names and types of {@code p}'s methods specified by {@code isRequiredMethod} and + * {@code isInstanceMethod}. The array contains {@code *outCount} pointers followed by a {@code NULL} terminator. You must free the list with free(). + * + *

If the protocol declares no methods that meet the specification, {@code NULL} is returned and {@code *outCount} is 0.

+ */ + @Nullable + @NativeType("struct objc_method_description *") + public static ObjCMethodDescription.Buffer protocol_copyMethodDescriptionList(@NativeType("Protocol *") long p, @NativeType("BOOL") boolean isRequiredMethod, @NativeType("BOOL") boolean isInstanceMethod) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + IntBuffer outCount = stack.callocInt(1); + try { + long __result = nprotocol_copyMethodDescriptionList(p, isRequiredMethod, isInstanceMethod, memAddress(outCount)); + return ObjCMethodDescription.createSafe(__result, outCount.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ protocol_getProperty ] --- + + /** Unsafe version of: {@link #protocol_getProperty} */ + public static long nprotocol_getProperty(long proto, long name, boolean isRequiredProperty, boolean isInstanceProperty) { + long __functionAddress = Functions.protocol_getProperty; + if (CHECKS) { + check(proto); + } + return invokePPP(proto, name, isRequiredProperty, isInstanceProperty, __functionAddress); + } + + /** + * Returns the specified property of a given protocol. + * + * @param proto a protocol + * @param name the name of a property + * @param isRequiredProperty a Boolean value that indicates whether {@code name} is a required property + * @param isInstanceProperty a Boolean value that indicates whether {@code name} is a instance property + * + * @return the property specified by {@code name}, {@code isRequiredProperty}, and {@code isInstanceProperty} for {@code proto}, or {@code NULL} if none of + * {@code proto}'s properties meets the specification + */ + @NativeType("objc_property_t") + public static long protocol_getProperty(@NativeType("Protocol *") long proto, @NativeType("char const *") ByteBuffer name, @NativeType("BOOL") boolean isRequiredProperty, @NativeType("BOOL") boolean isInstanceProperty) { + if (CHECKS) { + checkNT1(name); + } + return nprotocol_getProperty(proto, memAddress(name), isRequiredProperty, isInstanceProperty); + } + + /** + * Returns the specified property of a given protocol. + * + * @param proto a protocol + * @param name the name of a property + * @param isRequiredProperty a Boolean value that indicates whether {@code name} is a required property + * @param isInstanceProperty a Boolean value that indicates whether {@code name} is a instance property + * + * @return the property specified by {@code name}, {@code isRequiredProperty}, and {@code isInstanceProperty} for {@code proto}, or {@code NULL} if none of + * {@code proto}'s properties meets the specification + */ + @NativeType("objc_property_t") + public static long protocol_getProperty(@NativeType("Protocol *") long proto, @NativeType("char const *") CharSequence name, @NativeType("BOOL") boolean isRequiredProperty, @NativeType("BOOL") boolean isInstanceProperty) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(name, true); + long nameEncoded = stack.getPointerAddress(); + return nprotocol_getProperty(proto, nameEncoded, isRequiredProperty, isInstanceProperty); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ protocol_copyPropertyList ] --- + + /** + * Unsafe version of: {@link #protocol_copyPropertyList} + * + * @param outCount upon return, contains the number of elements in the returned array + */ + public static long nprotocol_copyPropertyList(long proto, long outCount) { + long __functionAddress = Functions.protocol_copyPropertyList; + if (CHECKS) { + check(proto); + } + return invokePPP(proto, outCount, __functionAddress); + } + + /** + * Returns an array of the properties declared by a protocol. + * + * @param proto a protocol + * + * @return a C array of pointers of type objc_property_t describing the properties declared by {@code proto}. Any properties declared by other protocols adopted + * by this protocol are not included. The array contains {@code *outCount} pointers followed by a {@code NULL} terminator. You must free the array with free(). + * + *

If the protocol declares no properties, {@code NULL} is returned and {@code *outCount} is 0.

+ */ + @Nullable + @NativeType("objc_property_t *") + public static PointerBuffer protocol_copyPropertyList(@NativeType("Protocol *") long proto) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + IntBuffer outCount = stack.callocInt(1); + try { + long __result = nprotocol_copyPropertyList(proto, memAddress(outCount)); + return memPointerBufferSafe(__result, outCount.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ protocol_copyProtocolList ] --- + + /** + * Unsafe version of: {@link #protocol_copyProtocolList} + * + * @param outCount upon return, contains the number of elements in the returned array + */ + public static long nprotocol_copyProtocolList(long proto, long outCount) { + long __functionAddress = Functions.protocol_copyProtocolList; + if (CHECKS) { + check(proto); + } + return invokePPP(proto, outCount, __functionAddress); + } + + /** + * eturns an array of the protocols adopted by a protocol. + * + * @param proto a protocol + * + * @return a C array of protocols adopted by {@code proto}. The array contains {@code *outCount} pointers followed by a {@code NULL} terminator. You must free the array + * with free(). + * + *

If the protocol declares no properties, {@code NULL} is returned and {@code *outCount} is 0.

+ */ + @Nullable + @NativeType("Protocol **") + public static PointerBuffer protocol_copyProtocolList(@NativeType("Protocol *") long proto) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + IntBuffer outCount = stack.callocInt(1); + try { + long __result = nprotocol_copyProtocolList(proto, memAddress(outCount)); + return memPointerBufferSafe(__result, outCount.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ objc_allocateProtocol ] --- + + /** Unsafe version of: {@link #objc_allocateProtocol} */ + public static long nobjc_allocateProtocol(long name) { + long __functionAddress = Functions.objc_allocateProtocol; + return invokePP(name, __functionAddress); + } + + /** + * Creates a new protocol instance. + * + *

You must register the returned protocol instance with the {@link #objc_registerProtocol} function before you can use it.

+ * + *

There is no dispose method associated with this function.

+ * + * @param name the name of the protocol you want to create + * + * @return a new protocol instance or {@link #nil} if a protocol with the same name as {@code name} already exists + */ + @NativeType("Protocol *") + public static long objc_allocateProtocol(@NativeType("char const *") ByteBuffer name) { + if (CHECKS) { + checkNT1(name); + } + return nobjc_allocateProtocol(memAddress(name)); + } + + /** + * Creates a new protocol instance. + * + *

You must register the returned protocol instance with the {@link #objc_registerProtocol} function before you can use it.

+ * + *

There is no dispose method associated with this function.

+ * + * @param name the name of the protocol you want to create + * + * @return a new protocol instance or {@link #nil} if a protocol with the same name as {@code name} already exists + */ + @NativeType("Protocol *") + public static long objc_allocateProtocol(@NativeType("char const *") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(name, true); + long nameEncoded = stack.getPointerAddress(); + return nobjc_allocateProtocol(nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ objc_registerProtocol ] --- + + /** + * Registers a newly created protocol with the Objective-C runtime. + * + *

When you create a new protocol using the {@link #objc_allocateProtocol}, you then register it with the Objective-C runtime by calling this function. After a + * protocol is successfully registered, it is immutable and ready to use.

+ * + * @param proto the protocol you want to register with the Objective-C runtime + */ + public static void objc_registerProtocol(@NativeType("Protocol *") long proto) { + long __functionAddress = Functions.objc_registerProtocol; + if (CHECKS) { + check(proto); + } + invokePV(proto, __functionAddress); + } + + // --- [ protocol_addMethodDescription ] --- + + /** Unsafe version of: {@link #protocol_addMethodDescription} */ + public static void nprotocol_addMethodDescription(long proto, long name, long types, boolean isRequiredMethod, boolean isInstanceMethod) { + long __functionAddress = Functions.protocol_addMethodDescription; + if (CHECKS) { + check(proto); + check(name); + } + invokePPPV(proto, name, types, isRequiredMethod, isInstanceMethod, __functionAddress); + } + + /** + * Adds a method to a protocol. + * + *

To add a method to a protocol using this function, the protocol must be under construction. That is, you must add any methods to proto before you + * register it with the Objective-C runtime (via the {@link #objc_registerProtocol} function).

+ * + * @param proto the protocol you want to add a method to + * @param name the name of the method you want to add + * @param types a C string representing the signature of the method you want to add + * @param isRequiredMethod a Boolean indicating whether the method is a required method of the {@code proto} protocol. If {@link #YES}, the method is a required method; if {@link #NO}, the + * method is an optional method. + * @param isInstanceMethod a Boolean indicating whether the method is an instance method. If {@link #YES}, the method is an instance method; if {@link #NO}, the method is a class method. + */ + public static void protocol_addMethodDescription(@NativeType("Protocol *") long proto, @NativeType("SEL") long name, @NativeType("char const *") ByteBuffer types, @NativeType("BOOL") boolean isRequiredMethod, @NativeType("BOOL") boolean isInstanceMethod) { + if (CHECKS) { + checkNT1(types); + } + nprotocol_addMethodDescription(proto, name, memAddress(types), isRequiredMethod, isInstanceMethod); + } + + /** + * Adds a method to a protocol. + * + *

To add a method to a protocol using this function, the protocol must be under construction. That is, you must add any methods to proto before you + * register it with the Objective-C runtime (via the {@link #objc_registerProtocol} function).

+ * + * @param proto the protocol you want to add a method to + * @param name the name of the method you want to add + * @param types a C string representing the signature of the method you want to add + * @param isRequiredMethod a Boolean indicating whether the method is a required method of the {@code proto} protocol. If {@link #YES}, the method is a required method; if {@link #NO}, the + * method is an optional method. + * @param isInstanceMethod a Boolean indicating whether the method is an instance method. If {@link #YES}, the method is an instance method; if {@link #NO}, the method is a class method. + */ + public static void protocol_addMethodDescription(@NativeType("Protocol *") long proto, @NativeType("SEL") long name, @NativeType("char const *") CharSequence types, @NativeType("BOOL") boolean isRequiredMethod, @NativeType("BOOL") boolean isInstanceMethod) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(types, true); + long typesEncoded = stack.getPointerAddress(); + nprotocol_addMethodDescription(proto, name, typesEncoded, isRequiredMethod, isInstanceMethod); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ protocol_addProtocol ] --- + + /** + * Adds a registered protocol to another protocol that is under construction. + * + *

The protocol you want to add to ({@code proto}) must be under construction – allocated but not yet registered with the Objective-C runtime. The + * protocol you want to add ({@code addition}) must be registered already.

+ * + * @param proto the protocol you want to add the registered protocol to + * @param addition the registered protocol you want to add to {@code proto} + */ + public static void protocol_addProtocol(@NativeType("Protocol *") long proto, @NativeType("Protocol *") long addition) { + long __functionAddress = Functions.protocol_addProtocol; + if (CHECKS) { + check(proto); + check(addition); + } + invokePPV(proto, addition, __functionAddress); + } + + // --- [ protocol_addProperty ] --- + + /** + * Unsafe version of: {@link #protocol_addProperty} + * + * @param attributeCount the number of properties in {@code attributes} + */ + public static void nprotocol_addProperty(long proto, long name, long attributes, int attributeCount, boolean isRequiredProperty, boolean isInstanceProperty) { + long __functionAddress = Functions.protocol_addProperty; + if (CHECKS) { + check(proto); + ObjCPropertyAttribute.validate(attributes, attributeCount); + } + invokePPPV(proto, name, attributes, attributeCount, isRequiredProperty, isInstanceProperty, __functionAddress); + } + + /** + * Adds a property to a protocol that is under construction. + * + *

The protocol you want to add the property to must be under construction – allocated but not yet registered with the Objective-C runtime (via the + * {@link #objc_registerProtocol} function).

+ * + * @param proto the protocol you want to add a property to + * @param name the name of the property you want to add. + * @param attributes an array of property attributes + * @param isRequiredProperty a Boolean indicating whether the property's accessor methods are required methods of the {@code proto} protocol. If {@link #YES}, the property's accessor + * methods are required methods; if {@link #NO}, the property's accessor methods are optional methods. + * @param isInstanceProperty a Boolean indicating whether the property's accessor methods are instance methods. If {@link #YES}, the property's accessor methods are instance methods. + * {@link #YES} is the only value allowed for a property. As a result, if you set this value to {@link #NO}, the property will not be added to the protocol. + */ + public static void protocol_addProperty(@NativeType("Protocol *") long proto, @NativeType("char const *") ByteBuffer name, @NativeType("objc_property_attribute_t const *") ObjCPropertyAttribute.Buffer attributes, @NativeType("BOOL") boolean isRequiredProperty, @NativeType("BOOL") boolean isInstanceProperty) { + if (CHECKS) { + checkNT1(name); + } + nprotocol_addProperty(proto, memAddress(name), attributes.address(), attributes.remaining(), isRequiredProperty, isInstanceProperty); + } + + /** + * Adds a property to a protocol that is under construction. + * + *

The protocol you want to add the property to must be under construction – allocated but not yet registered with the Objective-C runtime (via the + * {@link #objc_registerProtocol} function).

+ * + * @param proto the protocol you want to add a property to + * @param name the name of the property you want to add. + * @param attributes an array of property attributes + * @param isRequiredProperty a Boolean indicating whether the property's accessor methods are required methods of the {@code proto} protocol. If {@link #YES}, the property's accessor + * methods are required methods; if {@link #NO}, the property's accessor methods are optional methods. + * @param isInstanceProperty a Boolean indicating whether the property's accessor methods are instance methods. If {@link #YES}, the property's accessor methods are instance methods. + * {@link #YES} is the only value allowed for a property. As a result, if you set this value to {@link #NO}, the property will not be added to the protocol. + */ + public static void protocol_addProperty(@NativeType("Protocol *") long proto, @NativeType("char const *") CharSequence name, @NativeType("objc_property_attribute_t const *") ObjCPropertyAttribute.Buffer attributes, @NativeType("BOOL") boolean isRequiredProperty, @NativeType("BOOL") boolean isInstanceProperty) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(name, true); + long nameEncoded = stack.getPointerAddress(); + nprotocol_addProperty(proto, nameEncoded, attributes.address(), attributes.remaining(), isRequiredProperty, isInstanceProperty); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ objc_copyImageNames ] --- + + /** + * Unsafe version of: {@link #objc_copyImageNames} + * + * @param outCount the number of names in the returned array + */ + public static long nobjc_copyImageNames(long outCount) { + long __functionAddress = Functions.objc_copyImageNames; + return invokePP(outCount, __functionAddress); + } + + /** + * Returns the names of all the loaded Objective-C frameworks and dynamic libraries. + * + * @return an array of C strings representing the names of all the loaded Objective-C frameworks and dynamic libraries + */ + @Nullable + @NativeType("char const **") + public static PointerBuffer objc_copyImageNames() { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + IntBuffer outCount = stack.callocInt(1); + try { + long __result = nobjc_copyImageNames(memAddress(outCount)); + return memPointerBufferSafe(__result, outCount.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ class_getImageName ] --- + + /** Unsafe version of: {@link #class_getImageName} */ + public static long nclass_getImageName(long cls) { + long __functionAddress = Functions.class_getImageName; + if (CHECKS) { + check(cls); + } + return invokePP(cls, __functionAddress); + } + + /** + * Returns the name of the dynamic library a class originated from. + * + * @param cls the class you are inquiring about + * + * @return a C string representing the name of the library containing the {@code cls} class. + */ + @Nullable + @NativeType("char const *") + public static String class_getImageName(@NativeType("Class") long cls) { + long __result = nclass_getImageName(cls); + return memUTF8Safe(__result); + } + + // --- [ objc_copyClassNamesForImage ] --- + + /** + * Unsafe version of: {@link #objc_copyClassNamesForImage} + * + * @param outCount the number of names in the returned array + */ + public static long nobjc_copyClassNamesForImage(long image, long outCount) { + long __functionAddress = Functions.objc_copyClassNamesForImage; + return invokePPP(image, outCount, __functionAddress); + } + + /** + * Returns the names of all the classes within a specified library or framework. + * + * @param image the library or framework you are inquiring about + * + * @return an array of C strings representing all of the class names within the specified library or framework + */ + @Nullable + @NativeType("char const **") + public static PointerBuffer objc_copyClassNamesForImage(@NativeType("char const *") ByteBuffer image) { + if (CHECKS) { + checkNT1(image); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + IntBuffer outCount = stack.callocInt(1); + try { + long __result = nobjc_copyClassNamesForImage(memAddress(image), memAddress(outCount)); + return memPointerBufferSafe(__result, outCount.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + /** + * Returns the names of all the classes within a specified library or framework. + * + * @param image the library or framework you are inquiring about + * + * @return an array of C strings representing all of the class names within the specified library or framework + */ + @Nullable + @NativeType("char const **") + public static PointerBuffer objc_copyClassNamesForImage(@NativeType("char const *") CharSequence image) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + IntBuffer outCount = stack.callocInt(1); + stack.nUTF8(image, true); + long imageEncoded = stack.getPointerAddress(); + long __result = nobjc_copyClassNamesForImage(imageEncoded, memAddress(outCount)); + return memPointerBufferSafe(__result, outCount.get(0)); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ sel_getName ] --- + + /** Unsafe version of: {@link #sel_getName} */ + public static long nsel_getName(long sel) { + long __functionAddress = Functions.sel_getName; + if (CHECKS) { + check(sel); + } + return invokePP(sel, __functionAddress); + } + + /** + * Returns the name of the method specified by a given selector. + * + * @param sel a pointer of type SEL. Pass the selector whose name you wish to determine. + * + * @return a C string indicating the name of the selector + */ + @Nullable + @NativeType("char const *") + public static String sel_getName(@NativeType("SEL") long sel) { + long __result = nsel_getName(sel); + return memUTF8Safe(__result); + } + + // --- [ sel_getUid ] --- + + /** Unsafe version of: {@link #sel_getUid} */ + public static long nsel_getUid(long str) { + long __functionAddress = Functions.sel_getUid; + return invokePP(str, __functionAddress); + } + + /** + * Registers a method name with the Objective-C runtime system. + * + *

The implementation of this method is identical to the implementation of {@link #sel_registerName}.

+ * + * @param str a pointer to a C string. Pass the name of the method you wish to register + * + * @return a pointer of type SEL specifying the selector for the named method + */ + @NativeType("SEL") + public static long sel_getUid(@NativeType("char const *") ByteBuffer str) { + if (CHECKS) { + checkNT1(str); + } + return nsel_getUid(memAddress(str)); + } + + /** + * Registers a method name with the Objective-C runtime system. + * + *

The implementation of this method is identical to the implementation of {@link #sel_registerName}.

+ * + * @param str a pointer to a C string. Pass the name of the method you wish to register + * + * @return a pointer of type SEL specifying the selector for the named method + */ + @NativeType("SEL") + public static long sel_getUid(@NativeType("char const *") CharSequence str) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(str, true); + long strEncoded = stack.getPointerAddress(); + return nsel_getUid(strEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ sel_registerName ] --- + + /** Unsafe version of: {@link #sel_registerName} */ + public static long nsel_registerName(long str) { + long __functionAddress = Functions.sel_registerName; + return invokePP(str, __functionAddress); + } + + /** + * Registers a method with the Objective-C runtime system, maps the method name to a selector, and returns the selector value. + * + *

You must register a method name with the Objective-C runtime system to obtain the method’s selector before you can add the method to a class + * definition. If the method name has already been registered, this function simply returns the selector.

+ * + * @param str a pointer to a C string. Pass the name of the method you wish to register + * + * @return a pointer of type SEL specifying the selector for the named method + */ + @NativeType("SEL") + public static long sel_registerName(@NativeType("char const *") ByteBuffer str) { + if (CHECKS) { + checkNT1(str); + } + return nsel_registerName(memAddress(str)); + } + + /** + * Registers a method with the Objective-C runtime system, maps the method name to a selector, and returns the selector value. + * + *

You must register a method name with the Objective-C runtime system to obtain the method’s selector before you can add the method to a class + * definition. If the method name has already been registered, this function simply returns the selector.

+ * + * @param str a pointer to a C string. Pass the name of the method you wish to register + * + * @return a pointer of type SEL specifying the selector for the named method + */ + @NativeType("SEL") + public static long sel_registerName(@NativeType("char const *") CharSequence str) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8(str, true); + long strEncoded = stack.getPointerAddress(); + return nsel_registerName(strEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ sel_isEqual ] --- + + /** + * Returns a Boolean value that indicates whether two selectors are equal. + * + *

sel_isEqual is equivalent to {@code ==}.

+ * + * @param lhs the selector to compare with {@code rhs} + * @param rhs the selector to compare with {@code lhs} + * + * @return {@link #YES} if rhs and rhs are equal, otherwise {@link #NO} + */ + @NativeType("BOOL") + public static boolean sel_isEqual(@NativeType("SEL") long lhs, @NativeType("SEL") long rhs) { + long __functionAddress = Functions.sel_isEqual; + if (CHECKS) { + check(lhs); + check(rhs); + } + return invokePPZ(lhs, rhs, __functionAddress); + } + + // --- [ objc_enumerationMutation ] --- + + /** + * Inserted by the compiler when a mutation is detected during a foreach iteration. + * + *

The compiler inserts this function when it detects that an object is mutated during a foreach iteration. The function is called when a mutation occurs, + * and the enumeration mutation handler is enacted if it is set up (via the {@link #objc_setEnumerationMutationHandler} function). If the handler is not set up, + * a fatal error occurs.

+ * + * @param obj the object being mutated + */ + public static void objc_enumerationMutation(@NativeType("id") long obj) { + long __functionAddress = Functions.objc_enumerationMutation; + if (CHECKS) { + check(obj); + } + invokePV(obj, __functionAddress); + } + + // --- [ objc_setEnumerationMutationHandler ] --- + + /** Unsafe version of: {@link #objc_setEnumerationMutationHandler} */ + public static void nobjc_setEnumerationMutationHandler(long handler) { + long __functionAddress = Functions.objc_setEnumerationMutationHandler; + invokePV(handler, __functionAddress); + } + + /** + * Sets the current mutation handler. + * + * @param handler a function pointer to the new mutation handler + */ + public static void objc_setEnumerationMutationHandler(@NativeType("EnumerationMutationHandler") EnumerationMutationHandlerI handler) { + nobjc_setEnumerationMutationHandler(handler.address()); + } + + // --- [ imp_implementationWithBlock ] --- + + /** + * Creates a pointer to a function that calls the specified block when the method is called. + * + * @param block the block that implements this method. The signature of {@code block} should be {@code method_return_type ^(id self, self, method_args …)}. The + * selector of the method is not available to {@code block}. {@code block} is copied with {@code Block_copy()}. + * + * @return the IMP that calls {@code block}. You must dispose of the returned IMP using the function. + */ + @NativeType("IMP") + public static long imp_implementationWithBlock(@NativeType("id") long block) { + long __functionAddress = Functions.imp_implementationWithBlock; + if (CHECKS) { + check(block); + } + return invokePP(block, __functionAddress); + } + + // --- [ imp_getBlock ] --- + + /** + * Returns the block associated with an IMP that was created using {@link #imp_implementationWithBlock}. + * + * @param anImp the IMP that calls this block + * + * @return the block called by {@code anImp} + */ + @NativeType("id") + public static long imp_getBlock(@NativeType("IMP") long anImp) { + long __functionAddress = Functions.imp_getBlock; + if (CHECKS) { + check(anImp); + } + return invokePP(anImp, __functionAddress); + } + + // --- [ imp_removeBlock ] --- + + /** + * Disassociates a block from an IMP that was created using {@link #imp_implementationWithBlock}, and releases the copy of the block that was created. + * + * @param anImp an IMP that was created using the {@link #imp_implementationWithBlock} function. + * + * @return {@link #YES} if the block was released successfully; otherwise, {@link #NO} (for example, the function returns {@link #NO} if the block was not used to create {@code anImp} + * previously). + */ + @NativeType("BOOL") + public static boolean imp_removeBlock(@NativeType("IMP") long anImp) { + long __functionAddress = Functions.imp_removeBlock; + if (CHECKS) { + check(anImp); + } + return invokePZ(anImp, __functionAddress); + } + + // --- [ objc_loadWeak ] --- + + /** Unsafe version of: {@link #objc_loadWeak} */ + public static long nobjc_loadWeak(long location) { + long __functionAddress = Functions.objc_loadWeak; + return invokePP(location, __functionAddress); + } + + /** + * Loads the object referenced by a weak pointer and returns it. + * + *

This function loads the object referenced by a weak pointer and returns it after retaining and autoreleasing the object. As a result, the object stays + * alive long enough for the caller to use it. This function is typically used anywhere a {@code __weak} variable is used in an expression.

+ * + * @param location the address of the weak pointer + * + * @return the object pointed to by location, or {@link #nil} if location is {@link #nil} + */ + @NativeType("id") + public static long objc_loadWeak(@Nullable @NativeType("id *") PointerBuffer location) { + if (CHECKS) { + checkSafe(location, 1); + } + return nobjc_loadWeak(memAddressSafe(location)); + } + + // --- [ objc_storeWeak ] --- + + /** Unsafe version of: {@link #objc_storeWeak} */ + public static long nobjc_storeWeak(long location, long obj) { + long __functionAddress = Functions.objc_storeWeak; + if (CHECKS) { + check(obj); + } + return invokePPP(location, obj, __functionAddress); + } + + /** + * Stores a new value in a {@code __weak} variable. + * + *

This function is typically used anywhere a {@code __weak} variable is the target of an assignment.

+ * + * @param location the address of the weak pointer + * @param obj the new object you want the weak pointer to now point to + * + * @return the value stored in location (that is, {@code obj}) + */ + @NativeType("id") + public static long objc_storeWeak(@NativeType("id *") PointerBuffer location, @NativeType("id") long obj) { + if (CHECKS) { + check(location, 1); + } + return nobjc_storeWeak(memAddress(location), obj); + } + + // --- [ objc_setAssociatedObject ] --- + + /** + * Sets an associated value for a given object using a given key and association policy. + * + * @param object the source object for the association + * @param key the key for the association + * @param value the value to associate with the key {@code key} for {@code object}. Pass {@link #nil} to clear an existing association. + * @param policy the policy for the association. One of:
{@link #OBJC_ASSOCIATION_ASSIGN}{@link #OBJC_ASSOCIATION_RETAIN_NONATOMIC}{@link #OBJC_ASSOCIATION_COPY_NONATOMIC}
{@link #OBJC_ASSOCIATION_RETAIN}{@link #OBJC_ASSOCIATION_COPY}
+ */ + public static void objc_setAssociatedObject(@NativeType("id") long object, @NativeType("void const *") long key, @NativeType("id") long value, @NativeType("objc_AssociationPolicy") long policy) { + long __functionAddress = Functions.objc_setAssociatedObject; + if (CHECKS) { + check(object); + check(key); + check(value); + } + invokePPPPV(object, key, value, policy, __functionAddress); + } + + // --- [ objc_getAssociatedObject ] --- + + /** + * Returns the value associated with a given object for a given key. + * + * @param object the source object for the association + * @param key the key for the association + * + * @return the value associated with the key {@code key} for {@code object}. + */ + @NativeType("id") + public static long objc_getAssociatedObject(@NativeType("id") long object, @NativeType("void const *") long key) { + long __functionAddress = Functions.objc_getAssociatedObject; + if (CHECKS) { + check(object); + check(key); + } + return invokePPP(object, key, __functionAddress); + } + + // --- [ objc_removeAssociatedObjects ] --- + + /** + * Removes all associations for a given object. + * + *

The main purpose of this function is to make it easy to return an object to a "pristine state". You should not use this function for general removal of + * associations from objects, since it also removes associations that other clients may have added to the object. Typically you should use + * {@link #objc_setAssociatedObject} with a {@link #nil} value to clear an association.

+ * + * @param object an object that maintains associated objects + */ + public static void objc_removeAssociatedObjects(@NativeType("id") long object) { + long __functionAddress = Functions.objc_removeAssociatedObjects; + if (CHECKS) { + check(object); + } + invokePV(object, __functionAddress); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/package-info.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/package-info.java new file mode 100644 index 00000000..f2aca617 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/macosx/package-info.java @@ -0,0 +1,10 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ + +/** Contains bindings to native APIs specific to the macOS operating system. */ +@org.lwjgl.system.NonnullDefault +package org.lwjgl.system.macosx; + diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/package-info.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/package-info.java new file mode 100644 index 00000000..1b5bacf7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/package-info.java @@ -0,0 +1,33 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ + +/** + * Contains implementation details and platform-specific functionality required to make LWJGL work. Unlike other packages, this package and its sub-packages + * make no guarantees of forward compatibility. Any public API contained here may change between releases and revisions. + * + *

In more detail, this package contains the following:

+ *
    + *
  • Functionality required for loading native shared libraries (the LWJGL JNI code, as well as 3rd-party libraries) and invoking native functions.
  • + *
  • Functionality required for efficiently accessing and managing off-heap memory.
  • + *
  • Platform and operating system specific API bindings.
  • + *
  • The dyncall bindings, used for implementing native function callbacks via Java code.
  • + *
  • Miscellaneous bindings for advanced users, or bindings that are not proven to be generally useful yet.
  • + *
  • Functionality used internally by API bindings. This functionality is unfortunately public, as it is shared by all bindings.
  • + *
+ * + *

Even though this package is reserved for breaking changes, some of the above functionality may be very useful to advanced users. For this to be practical, + * the API of certain interfaces and classes will remain as stable as possible. This affects the following classes:

+ *
    + *
  • {@link org.lwjgl.system.MemoryUtil MemoryUtil}, used for off-heap data access and memory allocation/deallocation.
  • + *
  • {@link org.lwjgl.system.MemoryStack MemoryStack}, used for emulated off-heap stack allocations.
  • + *
  • {@link org.lwjgl.system.FunctionProvider FunctionProvider}, {@link org.lwjgl.system.Library Library} and + * {@link org.lwjgl.system.SharedLibrary SharedLibrary}, used for loading shared libraries and accessing function pointers.
  • + *
  • {@link org.lwjgl.system.Pointer Pointer}, used as off-heap resource abstractions.
  • + *
  • {@link org.lwjgl.system.Configuration Configuration}, used for programmatic configuration at runtime.
  • + *
  • {@link org.lwjgl.system.Struct Struct} and {@link org.lwjgl.system.StructBuffer StructBuffer}, the base classes for struct types and struct buffers.
  • + *
+ */ +@NonnullDefault +package org.lwjgl.system; diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/DEVMODE.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/DEVMODE.java new file mode 100644 index 00000000..bd9c44e8 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/DEVMODE.java @@ -0,0 +1,828 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.windows; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Contains information about the initialization and environment of a printer or a display device. + * + *

Member documentation

+ * + *
    + *
  • {@code dmDeviceName[32]} – + * A zero-terminated character array that specifies the "friendly" name of the printer or display; for example, "PCL/HP LaserJet" in the case of PCL/HP + * LaserJet. This string is unique among device drivers. Note that this name may be truncated to fit in the {@code dmDeviceName} array.
  • + *
  • {@code dmSpecVersion} – + * the version number of the initialization data specification on which the structure is based. To ensure the correct version is used for any operating + * system, use {@link GDI32#DM_SPECVERSION}.
  • + *
  • {@code dmDriverVersion} – the driver version number assigned by the driver developer
  • + *
  • {@code dmSize} – + * specifies the size, in bytes, of the {@code DEVMODE} structure, not including any private driver-specific data that might follow the structure's + * public members. Set this member to {@link #SIZEOF} to indicate the version of the {@code DEVMODE} structure being used.
  • + *
  • {@code dmDriverExtra} – + * contains the number of bytes of private driver-data that follow this structure. If a device driver does not use device-specific information, set this + * member to zero.
  • + *
  • {@code dmFields} – + * specifies whether certain members of the {@code DEVMODE} structure have been initialized. If a member is initialized, its corresponding bit is set + * otherwise the bit is clear. A driver supports only those {@code DEVMODE} members that are appropriate for the printer or display technology.
  • + *
  • <union> + * + *
      + *
    • <struct> + * + *
        + *
      • {@code dmOrientation} – for printer devices only
      • + *
      • {@code dmPaperSize} – for printer devices only
      • + *
      • {@code dmPaperLength} – for printer devices only
      • + *
      • {@code dmPaperWidth} – for printer devices only
      • + *
      • {@code dmScale} – for printer devices only
      • + *
      • {@code dmCopies} – for printer devices only
      • + *
      • {@code dmDefaultSource} – for printer devices only
      • + *
      • {@code dmPrintQuality} – for printer devices only
      • + *
    • + *
    • <struct> + * + *
        + *
      • {@code dmPosition} – + * for display devices only, a {@link POINTL} structure that indicates the positional coordinates of the display device in reference to the desktop + * area. The primary display device is always located at coordinates (0,0).
      • + *
      • {@code dmDisplayOrientation} – + * for display devices only, the orientation at which images should be presented. If {@link GDI32#DM_DISPLAYORIENTATION} is not set, this member must be + * zero. If {@link GDI32#DM_DISPLAYORIENTATION} is set, this member must be one of the following values:
        {@link GDI32#DMDO_DEFAULT}, {@link GDI32#DMDO_90}, {@link GDI32#DMDO_180}, {@link GDI32#DMDO_270} + * + *

        To determine whether the display orientation is portrait or landscape orientation, check the ratio of {@code dmPelsWidth} to + * {@code dmPelsHeight}.

      • + *
      • {@code dmDisplayFixedOutput} – + * for fixed-resolution display devices only, how the display presents a low-resolution mode on a higher-resolution display. For example, if a + * display device's resolution is fixed at 1024 x 768 pixels but its mode is set to 640 x 480 pixels, the device can either display a 640 x 480 + * image somewhere in the interior of the 1024 x 768 screen space or stretch the 640 x 480 image to fill the larger screen space. If + * {@link GDI32#DM_DISPLAYFIXEDOUTPUT} is not set, this member must be zero. If {@link GDI32#DM_DISPLAYFIXEDOUTPUT} is set, this member must be one of the + * following values:
        {@link GDI32#DMDFO_DEFAULT}, {@link GDI32#DMDFO_CENTER}, {@link GDI32#DMDFO_STRETCH}
      • + *
    • + *
  • + *
  • {@code dmColor} – for printer devices only
  • + *
  • {@code dmDuplex} – for printer devices only
  • + *
  • {@code dmYResolution} – for printer devices only
  • + *
  • {@code dmTTOption} – for printer devices only
  • + *
  • {@code dmCollate} – for printer devices only
  • + *
  • {@code dmFormName[32]} – for printer devices only
  • + *
  • {@code dmLogPixels} – the number of pixels per logical inch
  • + *
  • {@code dmBitsPerPel} – + * specifies the color resolution, in bits per pixel, of the display device (for example: 4 bits for 16 colors, 8 bits for 256 colors, or 16 bits for + * 65,536 colors)
  • + *
  • {@code dmPelsWidth} – specifies the width, in pixels, of the visible device surface
  • + *
  • {@code dmPelsHeight} – specifies the height, in pixels, of the visible device surface
  • + *
  • <union> + * + *
      + *
    • {@code dmDisplayFlags} – specifies the device's display mode, one or more of:
      {@link GDI32#DM_INTERLACED}, {@link GDI32#DMDISPLAYFLAGS_TEXTMODE}
    • + *
    • {@code dmNup} – for printer devices only
    • + *
  • + *
  • {@code dmDisplayFrequency} – + * specifies the frequency, in hertz (cycles per second), of the display device in a particular mode. This value is also known as the display device's + * vertical refresh rate. + * + *

    When you call the {@link User32#EnumDisplaySettingsEx} function, the {@code dmDisplayFrequency} member may return with the value 0 or 1. These values + * represent the display hardware's default refresh rate. This default rate is typically set by switches on a display card or computer motherboard, or by + * a configuration program that does not use display functions such as {@code ChangeDisplaySettingsEx}.

  • + *
  • {@code dmICMMethod} – for printer devices only
  • + *
  • {@code dmICMIntent} – for printer devices only
  • + *
  • {@code dmMediaType} – for printer devices only
  • + *
  • {@code dmDitherType} – for printer devices only
  • + *
  • {@code dmReserved1} – not used; must be zero
  • + *
  • {@code dmReserved2} – not used; must be zero
  • + *
  • {@code dmPanningWidth} – this member must be zero
  • + *
  • {@code dmPanningHeight} – this member must be zero
  • + *
+ * + *

Layout

+ * + *

+ * struct DEVMODE {
+ *     TCHAR dmDeviceName[32];
+ *     WORD dmSpecVersion;
+ *     WORD dmDriverVersion;
+ *     WORD dmSize;
+ *     WORD dmDriverExtra;
+ *     DWORD dmFields;
+ *     union {
+ *         struct {
+ *             short dmOrientation;
+ *             short dmPaperSize;
+ *             short dmPaperLength;
+ *             short dmPaperWidth;
+ *             short dmScale;
+ *             short dmCopies;
+ *             short dmDefaultSource;
+ *             short dmPrintQuality;
+ *         };
+ *         struct {
+ *             {@link POINTL POINTL} dmPosition;
+ *             DWORD dmDisplayOrientation;
+ *             DWORD dmDisplayFixedOutput;
+ *         };
+ *     };
+ *     short dmColor;
+ *     short dmDuplex;
+ *     short dmYResolution;
+ *     short dmTTOption;
+ *     short dmCollate;
+ *     TCHAR dmFormName[32];
+ *     WORD dmLogPixels;
+ *     DWORD dmBitsPerPel;
+ *     DWORD dmPelsWidth;
+ *     DWORD dmPelsHeight;
+ *     union {
+ *         DWORD dmDisplayFlags;
+ *         DWORD dmNup;
+ *     };
+ *     DWORD dmDisplayFrequency;
+ *     DWORD dmICMMethod;
+ *     DWORD dmICMIntent;
+ *     DWORD dmMediaType;
+ *     DWORD dmDitherType;
+ *     DWORD dmReserved1;
+ *     DWORD dmReserved2;
+ *     DWORD dmPanningWidth;
+ *     DWORD dmPanningHeight;
+ * }
+ */ +public class DEVMODE extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + DMDEVICENAME, + DMSPECVERSION, + DMDRIVERVERSION, + DMSIZE, + DMDRIVEREXTRA, + DMFIELDS, + DMORIENTATION, + DMPAPERSIZE, + DMPAPERLENGTH, + DMPAPERWIDTH, + DMSCALE, + DMCOPIES, + DMDEFAULTSOURCE, + DMPRINTQUALITY, + DMPOSITION, + DMDISPLAYORIENTATION, + DMDISPLAYFIXEDOUTPUT, + DMCOLOR, + DMDUPLEX, + DMYRESOLUTION, + DMTTOPTION, + DMCOLLATE, + DMFORMNAME, + DMLOGPIXELS, + DMBITSPERPEL, + DMPELSWIDTH, + DMPELSHEIGHT, + DMDISPLAYFLAGS, + DMNUP, + DMDISPLAYFREQUENCY, + DMICMMETHOD, + DMICMINTENT, + DMMEDIATYPE, + DMDITHERTYPE, + DMRESERVED1, + DMRESERVED2, + DMPANNINGWIDTH, + DMPANNINGHEIGHT; + + static { + Layout layout = __struct( + __array(2, 32), + __member(2), + __member(2), + __member(2), + __member(2), + __member(4), + __union( + __struct( + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2) + ), + __struct( + __member(POINTL.SIZEOF, POINTL.ALIGNOF), + __member(4), + __member(4) + ) + ), + __member(2), + __member(2), + __member(2), + __member(2), + __member(2), + __array(2, 32), + __member(2), + __member(4), + __member(4), + __member(4), + __union( + __member(4), + __member(4) + ), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + DMDEVICENAME = layout.offsetof(0); + DMSPECVERSION = layout.offsetof(1); + DMDRIVERVERSION = layout.offsetof(2); + DMSIZE = layout.offsetof(3); + DMDRIVEREXTRA = layout.offsetof(4); + DMFIELDS = layout.offsetof(5); + DMORIENTATION = layout.offsetof(8); + DMPAPERSIZE = layout.offsetof(9); + DMPAPERLENGTH = layout.offsetof(10); + DMPAPERWIDTH = layout.offsetof(11); + DMSCALE = layout.offsetof(12); + DMCOPIES = layout.offsetof(13); + DMDEFAULTSOURCE = layout.offsetof(14); + DMPRINTQUALITY = layout.offsetof(15); + DMPOSITION = layout.offsetof(17); + DMDISPLAYORIENTATION = layout.offsetof(18); + DMDISPLAYFIXEDOUTPUT = layout.offsetof(19); + DMCOLOR = layout.offsetof(20); + DMDUPLEX = layout.offsetof(21); + DMYRESOLUTION = layout.offsetof(22); + DMTTOPTION = layout.offsetof(23); + DMCOLLATE = layout.offsetof(24); + DMFORMNAME = layout.offsetof(25); + DMLOGPIXELS = layout.offsetof(26); + DMBITSPERPEL = layout.offsetof(27); + DMPELSWIDTH = layout.offsetof(28); + DMPELSHEIGHT = layout.offsetof(29); + DMDISPLAYFLAGS = layout.offsetof(31); + DMNUP = layout.offsetof(32); + DMDISPLAYFREQUENCY = layout.offsetof(33); + DMICMMETHOD = layout.offsetof(34); + DMICMINTENT = layout.offsetof(35); + DMMEDIATYPE = layout.offsetof(36); + DMDITHERTYPE = layout.offsetof(37); + DMRESERVED1 = layout.offsetof(38); + DMRESERVED2 = layout.offsetof(39); + DMPANNINGWIDTH = layout.offsetof(40); + DMPANNINGHEIGHT = layout.offsetof(41); + } + + /** + * Creates a {@code DEVMODE} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public DEVMODE(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns a {@link ByteBuffer} view of the {@code dmDeviceName} field. */ + @NativeType("TCHAR[32]") + public ByteBuffer dmDeviceName() { return ndmDeviceName(address()); } + /** Decodes the null-terminated string stored in the {@code dmDeviceName} field. */ + @NativeType("TCHAR[32]") + public String dmDeviceNameString() { return ndmDeviceNameString(address()); } + /** Returns the value of the {@code dmSpecVersion} field. */ + @NativeType("WORD") + public short dmSpecVersion() { return ndmSpecVersion(address()); } + /** Returns the value of the {@code dmDriverVersion} field. */ + @NativeType("WORD") + public short dmDriverVersion() { return ndmDriverVersion(address()); } + /** Returns the value of the {@code dmSize} field. */ + @NativeType("WORD") + public short dmSize() { return ndmSize(address()); } + /** Returns the value of the {@code dmDriverExtra} field. */ + @NativeType("WORD") + public short dmDriverExtra() { return ndmDriverExtra(address()); } + /** Returns the value of the {@code dmFields} field. */ + @NativeType("DWORD") + public int dmFields() { return ndmFields(address()); } + /** Returns the value of the {@code dmOrientation} field. */ + public short dmOrientation() { return ndmOrientation(address()); } + /** Returns the value of the {@code dmPaperSize} field. */ + public short dmPaperSize() { return ndmPaperSize(address()); } + /** Returns the value of the {@code dmPaperLength} field. */ + public short dmPaperLength() { return ndmPaperLength(address()); } + /** Returns the value of the {@code dmPaperWidth} field. */ + public short dmPaperWidth() { return ndmPaperWidth(address()); } + /** Returns the value of the {@code dmScale} field. */ + public short dmScale() { return ndmScale(address()); } + /** Returns the value of the {@code dmCopies} field. */ + public short dmCopies() { return ndmCopies(address()); } + /** Returns the value of the {@code dmDefaultSource} field. */ + public short dmDefaultSource() { return ndmDefaultSource(address()); } + /** Returns the value of the {@code dmPrintQuality} field. */ + public short dmPrintQuality() { return ndmPrintQuality(address()); } + /** Returns a {@link POINTL} view of the {@code dmPosition} field. */ + public POINTL dmPosition() { return ndmPosition(address()); } + /** Returns the value of the {@code dmDisplayOrientation} field. */ + @NativeType("DWORD") + public int dmDisplayOrientation() { return ndmDisplayOrientation(address()); } + /** Returns the value of the {@code dmDisplayFixedOutput} field. */ + @NativeType("DWORD") + public int dmDisplayFixedOutput() { return ndmDisplayFixedOutput(address()); } + /** Returns the value of the {@code dmColor} field. */ + public short dmColor() { return ndmColor(address()); } + /** Returns the value of the {@code dmDuplex} field. */ + public short dmDuplex() { return ndmDuplex(address()); } + /** Returns the value of the {@code dmYResolution} field. */ + public short dmYResolution() { return ndmYResolution(address()); } + /** Returns the value of the {@code dmTTOption} field. */ + public short dmTTOption() { return ndmTTOption(address()); } + /** Returns the value of the {@code dmCollate} field. */ + public short dmCollate() { return ndmCollate(address()); } + /** Returns a {@link ByteBuffer} view of the {@code dmFormName} field. */ + @NativeType("TCHAR[32]") + public ByteBuffer dmFormName() { return ndmFormName(address()); } + /** Decodes the null-terminated string stored in the {@code dmFormName} field. */ + @NativeType("TCHAR[32]") + public String dmFormNameString() { return ndmFormNameString(address()); } + /** Returns the value of the {@code dmLogPixels} field. */ + @NativeType("WORD") + public short dmLogPixels() { return ndmLogPixels(address()); } + /** Returns the value of the {@code dmBitsPerPel} field. */ + @NativeType("DWORD") + public int dmBitsPerPel() { return ndmBitsPerPel(address()); } + /** Returns the value of the {@code dmPelsWidth} field. */ + @NativeType("DWORD") + public int dmPelsWidth() { return ndmPelsWidth(address()); } + /** Returns the value of the {@code dmPelsHeight} field. */ + @NativeType("DWORD") + public int dmPelsHeight() { return ndmPelsHeight(address()); } + /** Returns the value of the {@code dmDisplayFlags} field. */ + @NativeType("DWORD") + public int dmDisplayFlags() { return ndmDisplayFlags(address()); } + /** Returns the value of the {@code dmNup} field. */ + @NativeType("DWORD") + public int dmNup() { return ndmNup(address()); } + /** Returns the value of the {@code dmDisplayFrequency} field. */ + @NativeType("DWORD") + public int dmDisplayFrequency() { return ndmDisplayFrequency(address()); } + /** Returns the value of the {@code dmICMMethod} field. */ + @NativeType("DWORD") + public int dmICMMethod() { return ndmICMMethod(address()); } + /** Returns the value of the {@code dmICMIntent} field. */ + @NativeType("DWORD") + public int dmICMIntent() { return ndmICMIntent(address()); } + /** Returns the value of the {@code dmMediaType} field. */ + @NativeType("DWORD") + public int dmMediaType() { return ndmMediaType(address()); } + /** Returns the value of the {@code dmDitherType} field. */ + @NativeType("DWORD") + public int dmDitherType() { return ndmDitherType(address()); } + /** Returns the value of the {@code dmReserved1} field. */ + @NativeType("DWORD") + public int dmReserved1() { return ndmReserved1(address()); } + /** Returns the value of the {@code dmReserved2} field. */ + @NativeType("DWORD") + public int dmReserved2() { return ndmReserved2(address()); } + /** Returns the value of the {@code dmPanningWidth} field. */ + @NativeType("DWORD") + public int dmPanningWidth() { return ndmPanningWidth(address()); } + /** Returns the value of the {@code dmPanningHeight} field. */ + @NativeType("DWORD") + public int dmPanningHeight() { return ndmPanningHeight(address()); } + + /** Sets the specified value to the {@code dmSpecVersion} field. */ + public DEVMODE dmSpecVersion(@NativeType("WORD") short value) { ndmSpecVersion(address(), value); return this; } + /** Sets the specified value to the {@code dmSize} field. */ + public DEVMODE dmSize(@NativeType("WORD") short value) { ndmSize(address(), value); return this; } + /** Sets the specified value to the {@code dmDriverExtra} field. */ + public DEVMODE dmDriverExtra(@NativeType("WORD") short value) { ndmDriverExtra(address(), value); return this; } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public DEVMODE set(DEVMODE src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code DEVMODE} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static DEVMODE malloc() { + return wrap(DEVMODE.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code DEVMODE} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static DEVMODE calloc() { + return wrap(DEVMODE.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code DEVMODE} instance allocated with {@link BufferUtils}. */ + public static DEVMODE create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(DEVMODE.class, memAddress(container), container); + } + + /** Returns a new {@code DEVMODE} instance for the specified memory address. */ + public static DEVMODE create(long address) { + return wrap(DEVMODE.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static DEVMODE createSafe(long address) { + return address == NULL ? null : wrap(DEVMODE.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code DEVMODE} instance allocated on the thread-local {@link MemoryStack}. */ + public static DEVMODE mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code DEVMODE} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static DEVMODE callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code DEVMODE} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static DEVMODE mallocStack(MemoryStack stack) { + return wrap(DEVMODE.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code DEVMODE} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static DEVMODE callocStack(MemoryStack stack) { + return wrap(DEVMODE.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #dmDeviceName}. */ + public static ByteBuffer ndmDeviceName(long struct) { return memByteBuffer(struct + DEVMODE.DMDEVICENAME, 32 * 2); } + /** Unsafe version of {@link #dmDeviceNameString}. */ + public static String ndmDeviceNameString(long struct) { return memUTF16(struct + DEVMODE.DMDEVICENAME); } + /** Unsafe version of {@link #dmSpecVersion}. */ + public static short ndmSpecVersion(long struct) { return UNSAFE.getShort(null, struct + DEVMODE.DMSPECVERSION); } + /** Unsafe version of {@link #dmDriverVersion}. */ + public static short ndmDriverVersion(long struct) { return UNSAFE.getShort(null, struct + DEVMODE.DMDRIVERVERSION); } + /** Unsafe version of {@link #dmSize}. */ + public static short ndmSize(long struct) { return UNSAFE.getShort(null, struct + DEVMODE.DMSIZE); } + /** Unsafe version of {@link #dmDriverExtra}. */ + public static short ndmDriverExtra(long struct) { return UNSAFE.getShort(null, struct + DEVMODE.DMDRIVEREXTRA); } + /** Unsafe version of {@link #dmFields}. */ + public static int ndmFields(long struct) { return UNSAFE.getInt(null, struct + DEVMODE.DMFIELDS); } + /** Unsafe version of {@link #dmOrientation}. */ + public static short ndmOrientation(long struct) { return UNSAFE.getShort(null, struct + DEVMODE.DMORIENTATION); } + /** Unsafe version of {@link #dmPaperSize}. */ + public static short ndmPaperSize(long struct) { return UNSAFE.getShort(null, struct + DEVMODE.DMPAPERSIZE); } + /** Unsafe version of {@link #dmPaperLength}. */ + public static short ndmPaperLength(long struct) { return UNSAFE.getShort(null, struct + DEVMODE.DMPAPERLENGTH); } + /** Unsafe version of {@link #dmPaperWidth}. */ + public static short ndmPaperWidth(long struct) { return UNSAFE.getShort(null, struct + DEVMODE.DMPAPERWIDTH); } + /** Unsafe version of {@link #dmScale}. */ + public static short ndmScale(long struct) { return UNSAFE.getShort(null, struct + DEVMODE.DMSCALE); } + /** Unsafe version of {@link #dmCopies}. */ + public static short ndmCopies(long struct) { return UNSAFE.getShort(null, struct + DEVMODE.DMCOPIES); } + /** Unsafe version of {@link #dmDefaultSource}. */ + public static short ndmDefaultSource(long struct) { return UNSAFE.getShort(null, struct + DEVMODE.DMDEFAULTSOURCE); } + /** Unsafe version of {@link #dmPrintQuality}. */ + public static short ndmPrintQuality(long struct) { return UNSAFE.getShort(null, struct + DEVMODE.DMPRINTQUALITY); } + /** Unsafe version of {@link #dmPosition}. */ + public static POINTL ndmPosition(long struct) { return POINTL.create(struct + DEVMODE.DMPOSITION); } + /** Unsafe version of {@link #dmDisplayOrientation}. */ + public static int ndmDisplayOrientation(long struct) { return UNSAFE.getInt(null, struct + DEVMODE.DMDISPLAYORIENTATION); } + /** Unsafe version of {@link #dmDisplayFixedOutput}. */ + public static int ndmDisplayFixedOutput(long struct) { return UNSAFE.getInt(null, struct + DEVMODE.DMDISPLAYFIXEDOUTPUT); } + /** Unsafe version of {@link #dmColor}. */ + public static short ndmColor(long struct) { return UNSAFE.getShort(null, struct + DEVMODE.DMCOLOR); } + /** Unsafe version of {@link #dmDuplex}. */ + public static short ndmDuplex(long struct) { return UNSAFE.getShort(null, struct + DEVMODE.DMDUPLEX); } + /** Unsafe version of {@link #dmYResolution}. */ + public static short ndmYResolution(long struct) { return UNSAFE.getShort(null, struct + DEVMODE.DMYRESOLUTION); } + /** Unsafe version of {@link #dmTTOption}. */ + public static short ndmTTOption(long struct) { return UNSAFE.getShort(null, struct + DEVMODE.DMTTOPTION); } + /** Unsafe version of {@link #dmCollate}. */ + public static short ndmCollate(long struct) { return UNSAFE.getShort(null, struct + DEVMODE.DMCOLLATE); } + /** Unsafe version of {@link #dmFormName}. */ + public static ByteBuffer ndmFormName(long struct) { return memByteBuffer(struct + DEVMODE.DMFORMNAME, 32 * 2); } + /** Unsafe version of {@link #dmFormNameString}. */ + public static String ndmFormNameString(long struct) { return memUTF16(struct + DEVMODE.DMFORMNAME); } + /** Unsafe version of {@link #dmLogPixels}. */ + public static short ndmLogPixels(long struct) { return UNSAFE.getShort(null, struct + DEVMODE.DMLOGPIXELS); } + /** Unsafe version of {@link #dmBitsPerPel}. */ + public static int ndmBitsPerPel(long struct) { return UNSAFE.getInt(null, struct + DEVMODE.DMBITSPERPEL); } + /** Unsafe version of {@link #dmPelsWidth}. */ + public static int ndmPelsWidth(long struct) { return UNSAFE.getInt(null, struct + DEVMODE.DMPELSWIDTH); } + /** Unsafe version of {@link #dmPelsHeight}. */ + public static int ndmPelsHeight(long struct) { return UNSAFE.getInt(null, struct + DEVMODE.DMPELSHEIGHT); } + /** Unsafe version of {@link #dmDisplayFlags}. */ + public static int ndmDisplayFlags(long struct) { return UNSAFE.getInt(null, struct + DEVMODE.DMDISPLAYFLAGS); } + /** Unsafe version of {@link #dmNup}. */ + public static int ndmNup(long struct) { return UNSAFE.getInt(null, struct + DEVMODE.DMNUP); } + /** Unsafe version of {@link #dmDisplayFrequency}. */ + public static int ndmDisplayFrequency(long struct) { return UNSAFE.getInt(null, struct + DEVMODE.DMDISPLAYFREQUENCY); } + /** Unsafe version of {@link #dmICMMethod}. */ + public static int ndmICMMethod(long struct) { return UNSAFE.getInt(null, struct + DEVMODE.DMICMMETHOD); } + /** Unsafe version of {@link #dmICMIntent}. */ + public static int ndmICMIntent(long struct) { return UNSAFE.getInt(null, struct + DEVMODE.DMICMINTENT); } + /** Unsafe version of {@link #dmMediaType}. */ + public static int ndmMediaType(long struct) { return UNSAFE.getInt(null, struct + DEVMODE.DMMEDIATYPE); } + /** Unsafe version of {@link #dmDitherType}. */ + public static int ndmDitherType(long struct) { return UNSAFE.getInt(null, struct + DEVMODE.DMDITHERTYPE); } + /** Unsafe version of {@link #dmReserved1}. */ + public static int ndmReserved1(long struct) { return UNSAFE.getInt(null, struct + DEVMODE.DMRESERVED1); } + /** Unsafe version of {@link #dmReserved2}. */ + public static int ndmReserved2(long struct) { return UNSAFE.getInt(null, struct + DEVMODE.DMRESERVED2); } + /** Unsafe version of {@link #dmPanningWidth}. */ + public static int ndmPanningWidth(long struct) { return UNSAFE.getInt(null, struct + DEVMODE.DMPANNINGWIDTH); } + /** Unsafe version of {@link #dmPanningHeight}. */ + public static int ndmPanningHeight(long struct) { return UNSAFE.getInt(null, struct + DEVMODE.DMPANNINGHEIGHT); } + + /** Unsafe version of {@link #dmSpecVersion(short) dmSpecVersion}. */ + public static void ndmSpecVersion(long struct, short value) { UNSAFE.putShort(null, struct + DEVMODE.DMSPECVERSION, value); } + /** Unsafe version of {@link #dmSize(short) dmSize}. */ + public static void ndmSize(long struct, short value) { UNSAFE.putShort(null, struct + DEVMODE.DMSIZE, value); } + /** Unsafe version of {@link #dmDriverExtra(short) dmDriverExtra}. */ + public static void ndmDriverExtra(long struct, short value) { UNSAFE.putShort(null, struct + DEVMODE.DMDRIVEREXTRA, value); } + + // ----------------------------------- + + /** An array of {@link DEVMODE} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final DEVMODE ELEMENT_FACTORY = DEVMODE.create(-1L); + + /** + * Creates a new {@code DEVMODE.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link DEVMODE#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected DEVMODE getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns a {@link ByteBuffer} view of the {@code dmDeviceName} field. */ + @NativeType("TCHAR[32]") + public ByteBuffer dmDeviceName() { return DEVMODE.ndmDeviceName(address()); } + /** Decodes the null-terminated string stored in the {@code dmDeviceName} field. */ + @NativeType("TCHAR[32]") + public String dmDeviceNameString() { return DEVMODE.ndmDeviceNameString(address()); } + /** Returns the value of the {@code dmSpecVersion} field. */ + @NativeType("WORD") + public short dmSpecVersion() { return DEVMODE.ndmSpecVersion(address()); } + /** Returns the value of the {@code dmDriverVersion} field. */ + @NativeType("WORD") + public short dmDriverVersion() { return DEVMODE.ndmDriverVersion(address()); } + /** Returns the value of the {@code dmSize} field. */ + @NativeType("WORD") + public short dmSize() { return DEVMODE.ndmSize(address()); } + /** Returns the value of the {@code dmDriverExtra} field. */ + @NativeType("WORD") + public short dmDriverExtra() { return DEVMODE.ndmDriverExtra(address()); } + /** Returns the value of the {@code dmFields} field. */ + @NativeType("DWORD") + public int dmFields() { return DEVMODE.ndmFields(address()); } + /** Returns the value of the {@code dmOrientation} field. */ + public short dmOrientation() { return DEVMODE.ndmOrientation(address()); } + /** Returns the value of the {@code dmPaperSize} field. */ + public short dmPaperSize() { return DEVMODE.ndmPaperSize(address()); } + /** Returns the value of the {@code dmPaperLength} field. */ + public short dmPaperLength() { return DEVMODE.ndmPaperLength(address()); } + /** Returns the value of the {@code dmPaperWidth} field. */ + public short dmPaperWidth() { return DEVMODE.ndmPaperWidth(address()); } + /** Returns the value of the {@code dmScale} field. */ + public short dmScale() { return DEVMODE.ndmScale(address()); } + /** Returns the value of the {@code dmCopies} field. */ + public short dmCopies() { return DEVMODE.ndmCopies(address()); } + /** Returns the value of the {@code dmDefaultSource} field. */ + public short dmDefaultSource() { return DEVMODE.ndmDefaultSource(address()); } + /** Returns the value of the {@code dmPrintQuality} field. */ + public short dmPrintQuality() { return DEVMODE.ndmPrintQuality(address()); } + /** Returns a {@link POINTL} view of the {@code dmPosition} field. */ + public POINTL dmPosition() { return DEVMODE.ndmPosition(address()); } + /** Returns the value of the {@code dmDisplayOrientation} field. */ + @NativeType("DWORD") + public int dmDisplayOrientation() { return DEVMODE.ndmDisplayOrientation(address()); } + /** Returns the value of the {@code dmDisplayFixedOutput} field. */ + @NativeType("DWORD") + public int dmDisplayFixedOutput() { return DEVMODE.ndmDisplayFixedOutput(address()); } + /** Returns the value of the {@code dmColor} field. */ + public short dmColor() { return DEVMODE.ndmColor(address()); } + /** Returns the value of the {@code dmDuplex} field. */ + public short dmDuplex() { return DEVMODE.ndmDuplex(address()); } + /** Returns the value of the {@code dmYResolution} field. */ + public short dmYResolution() { return DEVMODE.ndmYResolution(address()); } + /** Returns the value of the {@code dmTTOption} field. */ + public short dmTTOption() { return DEVMODE.ndmTTOption(address()); } + /** Returns the value of the {@code dmCollate} field. */ + public short dmCollate() { return DEVMODE.ndmCollate(address()); } + /** Returns a {@link ByteBuffer} view of the {@code dmFormName} field. */ + @NativeType("TCHAR[32]") + public ByteBuffer dmFormName() { return DEVMODE.ndmFormName(address()); } + /** Decodes the null-terminated string stored in the {@code dmFormName} field. */ + @NativeType("TCHAR[32]") + public String dmFormNameString() { return DEVMODE.ndmFormNameString(address()); } + /** Returns the value of the {@code dmLogPixels} field. */ + @NativeType("WORD") + public short dmLogPixels() { return DEVMODE.ndmLogPixels(address()); } + /** Returns the value of the {@code dmBitsPerPel} field. */ + @NativeType("DWORD") + public int dmBitsPerPel() { return DEVMODE.ndmBitsPerPel(address()); } + /** Returns the value of the {@code dmPelsWidth} field. */ + @NativeType("DWORD") + public int dmPelsWidth() { return DEVMODE.ndmPelsWidth(address()); } + /** Returns the value of the {@code dmPelsHeight} field. */ + @NativeType("DWORD") + public int dmPelsHeight() { return DEVMODE.ndmPelsHeight(address()); } + /** Returns the value of the {@code dmDisplayFlags} field. */ + @NativeType("DWORD") + public int dmDisplayFlags() { return DEVMODE.ndmDisplayFlags(address()); } + /** Returns the value of the {@code dmNup} field. */ + @NativeType("DWORD") + public int dmNup() { return DEVMODE.ndmNup(address()); } + /** Returns the value of the {@code dmDisplayFrequency} field. */ + @NativeType("DWORD") + public int dmDisplayFrequency() { return DEVMODE.ndmDisplayFrequency(address()); } + /** Returns the value of the {@code dmICMMethod} field. */ + @NativeType("DWORD") + public int dmICMMethod() { return DEVMODE.ndmICMMethod(address()); } + /** Returns the value of the {@code dmICMIntent} field. */ + @NativeType("DWORD") + public int dmICMIntent() { return DEVMODE.ndmICMIntent(address()); } + /** Returns the value of the {@code dmMediaType} field. */ + @NativeType("DWORD") + public int dmMediaType() { return DEVMODE.ndmMediaType(address()); } + /** Returns the value of the {@code dmDitherType} field. */ + @NativeType("DWORD") + public int dmDitherType() { return DEVMODE.ndmDitherType(address()); } + /** Returns the value of the {@code dmReserved1} field. */ + @NativeType("DWORD") + public int dmReserved1() { return DEVMODE.ndmReserved1(address()); } + /** Returns the value of the {@code dmReserved2} field. */ + @NativeType("DWORD") + public int dmReserved2() { return DEVMODE.ndmReserved2(address()); } + /** Returns the value of the {@code dmPanningWidth} field. */ + @NativeType("DWORD") + public int dmPanningWidth() { return DEVMODE.ndmPanningWidth(address()); } + /** Returns the value of the {@code dmPanningHeight} field. */ + @NativeType("DWORD") + public int dmPanningHeight() { return DEVMODE.ndmPanningHeight(address()); } + + /** Sets the specified value to the {@code dmSpecVersion} field. */ + public Buffer dmSpecVersion(@NativeType("WORD") short value) { DEVMODE.ndmSpecVersion(address(), value); return this; } + /** Sets the specified value to the {@code dmSize} field. */ + public Buffer dmSize(@NativeType("WORD") short value) { DEVMODE.ndmSize(address(), value); return this; } + /** Sets the specified value to the {@code dmDriverExtra} field. */ + public Buffer dmDriverExtra(@NativeType("WORD") short value) { DEVMODE.ndmDriverExtra(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/DISPLAY_DEVICE.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/DISPLAY_DEVICE.java new file mode 100644 index 00000000..94eda1cd --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/DISPLAY_DEVICE.java @@ -0,0 +1,386 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.windows; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Receives information about the display device specified by the {@code iDevNum} parameter of the {@link User32#EnumDisplayDevices} function. + * + *

The four string members are set based on the parameters passed to {@code EnumDisplayDevices}. If the {@code lpDevice} param is {@code NULL}, then + * {@code DISPLAY_DEVICE} is filled in with information about the display adapter(s). If it is a valid device name, then it is filled in with information + * about the monitor(s) for that device.

+ * + *

Member documentation

+ * + *
    + *
  • {@code cb} – size, in bytes, of the {@code DISPLAY_DEVICE} structure. This must be initialized prior to calling {@link User32#EnumDisplayDevices}.
  • + *
  • {@code DeviceName[32]} – an array of characters identifying the device name. This is either the adapter device or the monitor device.
  • + *
  • {@code DeviceString[128]} – an array of characters containing the device context string. This is either a description of the display adapter or of the display monitor.
  • + *
  • {@code StateFlags} – device state flags
  • + *
  • {@code DeviceID[128]} – not used
  • + *
  • {@code DeviceKey[128]} – reserved
  • + *
+ * + *

Layout

+ * + *

+ * struct DISPLAY_DEVICE {
+ *     DWORD cb;
+ *     TCHAR DeviceName[32];
+ *     TCHAR DeviceString[128];
+ *     DWORD StateFlags;
+ *     TCHAR DeviceID[128];
+ *     TCHAR DeviceKey[128];
+ * }
+ */ +public class DISPLAY_DEVICE extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + CB, + DEVICENAME, + DEVICESTRING, + STATEFLAGS, + DEVICEID, + DEVICEKEY; + + static { + Layout layout = __struct( + __member(4), + __array(2, 32), + __array(2, 128), + __member(4), + __array(2, 128), + __array(2, 128) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + CB = layout.offsetof(0); + DEVICENAME = layout.offsetof(1); + DEVICESTRING = layout.offsetof(2); + STATEFLAGS = layout.offsetof(3); + DEVICEID = layout.offsetof(4); + DEVICEKEY = layout.offsetof(5); + } + + /** + * Creates a {@code DISPLAY_DEVICE} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public DISPLAY_DEVICE(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code cb} field. */ + @NativeType("DWORD") + public int cb() { return ncb(address()); } + /** Returns a {@link ByteBuffer} view of the {@code DeviceName} field. */ + @NativeType("TCHAR[32]") + public ByteBuffer DeviceName() { return nDeviceName(address()); } + /** Decodes the null-terminated string stored in the {@code DeviceName} field. */ + @NativeType("TCHAR[32]") + public String DeviceNameString() { return nDeviceNameString(address()); } + /** Returns a {@link ByteBuffer} view of the {@code DeviceString} field. */ + @NativeType("TCHAR[128]") + public ByteBuffer DeviceString() { return nDeviceString(address()); } + /** Decodes the null-terminated string stored in the {@code DeviceString} field. */ + @NativeType("TCHAR[128]") + public String DeviceStringString() { return nDeviceStringString(address()); } + /** Returns the value of the {@code StateFlags} field. */ + @NativeType("DWORD") + public int StateFlags() { return nStateFlags(address()); } + /** Returns a {@link ByteBuffer} view of the {@code DeviceID} field. */ + @NativeType("TCHAR[128]") + public ByteBuffer DeviceID() { return nDeviceID(address()); } + /** Decodes the null-terminated string stored in the {@code DeviceID} field. */ + @NativeType("TCHAR[128]") + public String DeviceIDString() { return nDeviceIDString(address()); } + /** Returns a {@link ByteBuffer} view of the {@code DeviceKey} field. */ + @NativeType("TCHAR[128]") + public ByteBuffer DeviceKey() { return nDeviceKey(address()); } + /** Decodes the null-terminated string stored in the {@code DeviceKey} field. */ + @NativeType("TCHAR[128]") + public String DeviceKeyString() { return nDeviceKeyString(address()); } + + /** Sets the specified value to the {@code cb} field. */ + public DISPLAY_DEVICE cb(@NativeType("DWORD") int value) { ncb(address(), value); return this; } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public DISPLAY_DEVICE set(DISPLAY_DEVICE src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code DISPLAY_DEVICE} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static DISPLAY_DEVICE malloc() { + return wrap(DISPLAY_DEVICE.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code DISPLAY_DEVICE} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static DISPLAY_DEVICE calloc() { + return wrap(DISPLAY_DEVICE.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code DISPLAY_DEVICE} instance allocated with {@link BufferUtils}. */ + public static DISPLAY_DEVICE create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(DISPLAY_DEVICE.class, memAddress(container), container); + } + + /** Returns a new {@code DISPLAY_DEVICE} instance for the specified memory address. */ + public static DISPLAY_DEVICE create(long address) { + return wrap(DISPLAY_DEVICE.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static DISPLAY_DEVICE createSafe(long address) { + return address == NULL ? null : wrap(DISPLAY_DEVICE.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code DISPLAY_DEVICE} instance allocated on the thread-local {@link MemoryStack}. */ + public static DISPLAY_DEVICE mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code DISPLAY_DEVICE} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static DISPLAY_DEVICE callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code DISPLAY_DEVICE} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static DISPLAY_DEVICE mallocStack(MemoryStack stack) { + return wrap(DISPLAY_DEVICE.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code DISPLAY_DEVICE} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static DISPLAY_DEVICE callocStack(MemoryStack stack) { + return wrap(DISPLAY_DEVICE.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #cb}. */ + public static int ncb(long struct) { return UNSAFE.getInt(null, struct + DISPLAY_DEVICE.CB); } + /** Unsafe version of {@link #DeviceName}. */ + public static ByteBuffer nDeviceName(long struct) { return memByteBuffer(struct + DISPLAY_DEVICE.DEVICENAME, 32 * 2); } + /** Unsafe version of {@link #DeviceNameString}. */ + public static String nDeviceNameString(long struct) { return memUTF16(struct + DISPLAY_DEVICE.DEVICENAME); } + /** Unsafe version of {@link #DeviceString}. */ + public static ByteBuffer nDeviceString(long struct) { return memByteBuffer(struct + DISPLAY_DEVICE.DEVICESTRING, 128 * 2); } + /** Unsafe version of {@link #DeviceStringString}. */ + public static String nDeviceStringString(long struct) { return memUTF16(struct + DISPLAY_DEVICE.DEVICESTRING); } + /** Unsafe version of {@link #StateFlags}. */ + public static int nStateFlags(long struct) { return UNSAFE.getInt(null, struct + DISPLAY_DEVICE.STATEFLAGS); } + /** Unsafe version of {@link #DeviceID}. */ + public static ByteBuffer nDeviceID(long struct) { return memByteBuffer(struct + DISPLAY_DEVICE.DEVICEID, 128 * 2); } + /** Unsafe version of {@link #DeviceIDString}. */ + public static String nDeviceIDString(long struct) { return memUTF16(struct + DISPLAY_DEVICE.DEVICEID); } + /** Unsafe version of {@link #DeviceKey}. */ + public static ByteBuffer nDeviceKey(long struct) { return memByteBuffer(struct + DISPLAY_DEVICE.DEVICEKEY, 128 * 2); } + /** Unsafe version of {@link #DeviceKeyString}. */ + public static String nDeviceKeyString(long struct) { return memUTF16(struct + DISPLAY_DEVICE.DEVICEKEY); } + + /** Unsafe version of {@link #cb(int) cb}. */ + public static void ncb(long struct, int value) { UNSAFE.putInt(null, struct + DISPLAY_DEVICE.CB, value); } + + // ----------------------------------- + + /** An array of {@link DISPLAY_DEVICE} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final DISPLAY_DEVICE ELEMENT_FACTORY = DISPLAY_DEVICE.create(-1L); + + /** + * Creates a new {@code DISPLAY_DEVICE.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link DISPLAY_DEVICE#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected DISPLAY_DEVICE getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code cb} field. */ + @NativeType("DWORD") + public int cb() { return DISPLAY_DEVICE.ncb(address()); } + /** Returns a {@link ByteBuffer} view of the {@code DeviceName} field. */ + @NativeType("TCHAR[32]") + public ByteBuffer DeviceName() { return DISPLAY_DEVICE.nDeviceName(address()); } + /** Decodes the null-terminated string stored in the {@code DeviceName} field. */ + @NativeType("TCHAR[32]") + public String DeviceNameString() { return DISPLAY_DEVICE.nDeviceNameString(address()); } + /** Returns a {@link ByteBuffer} view of the {@code DeviceString} field. */ + @NativeType("TCHAR[128]") + public ByteBuffer DeviceString() { return DISPLAY_DEVICE.nDeviceString(address()); } + /** Decodes the null-terminated string stored in the {@code DeviceString} field. */ + @NativeType("TCHAR[128]") + public String DeviceStringString() { return DISPLAY_DEVICE.nDeviceStringString(address()); } + /** Returns the value of the {@code StateFlags} field. */ + @NativeType("DWORD") + public int StateFlags() { return DISPLAY_DEVICE.nStateFlags(address()); } + /** Returns a {@link ByteBuffer} view of the {@code DeviceID} field. */ + @NativeType("TCHAR[128]") + public ByteBuffer DeviceID() { return DISPLAY_DEVICE.nDeviceID(address()); } + /** Decodes the null-terminated string stored in the {@code DeviceID} field. */ + @NativeType("TCHAR[128]") + public String DeviceIDString() { return DISPLAY_DEVICE.nDeviceIDString(address()); } + /** Returns a {@link ByteBuffer} view of the {@code DeviceKey} field. */ + @NativeType("TCHAR[128]") + public ByteBuffer DeviceKey() { return DISPLAY_DEVICE.nDeviceKey(address()); } + /** Decodes the null-terminated string stored in the {@code DeviceKey} field. */ + @NativeType("TCHAR[128]") + public String DeviceKeyString() { return DISPLAY_DEVICE.nDeviceKeyString(address()); } + + /** Sets the specified value to the {@code cb} field. */ + public Buffer cb(@NativeType("DWORD") int value) { DISPLAY_DEVICE.ncb(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/GDI32.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/GDI32.java new file mode 100644 index 00000000..0e74f24e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/GDI32.java @@ -0,0 +1,286 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.windows; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to wingdi.h and gdi32.dll. */ +public class GDI32 { + + /** Display device state flags. */ + public static final int + DISPLAY_DEVICE_ATTACHED_TO_DESKTOP = 0x1, + DISPLAY_DEVICE_MULTI_DRIVER = 0x2, + DISPLAY_DEVICE_PRIMARY_DEVICE = 0x4, + DISPLAY_DEVICE_MIRRORING_DRIVER = 0x8, + DISPLAY_DEVICE_VGA_COMPATIBLE = 0x10, + DISPLAY_DEVICE_REMOVABLE = 0x20, + DISPLAY_DEVICE_MODESPRUNED = 0x8000000, + DISPLAY_DEVICE_REMOTE = 0x4000000, + DISPLAY_DEVICE_DISCONNECT = 0x2000000, + DISPLAY_DEVICE_TS_COMPATIBLE = 0x200000, + DISPLAY_DEVICE_UNSAFE_MODES_ON = 0x80000; + + /** Child display device state flags. */ + public static final int + DISPLAY_DEVICE_ACTIVE = 0x1, + DISPLAY_DEVICE_ATTACHED = 0x2; + + /** {@link DEVMODE} specification version. */ + public static final int DM_SPECVERSION = 0x401; + + /** {@link DEVMODE} field selection bits. */ + public static final int + DM_ORIENTATION = 0x1, + DM_PAPERSIZE = 0x2, + DM_PAPERLENGTH = 0x4, + DM_PAPERWIDTH = 0x8, + DM_SCALE = 0x10, + DM_POSITION = 0x20, + DM_NUP = 0x40, + DM_DISPLAYORIENTATION = 0x80, + DM_COPIES = 0x100, + DM_DEFAULTSOURCE = 0x200, + DM_PRINTQUALITY = 0x400, + DM_COLOR = 0x800, + DM_DUPLEX = 0x1000, + DM_YRESOLUTION = 0x2000, + DM_TTOPTION = 0x4000, + DM_COLLATE = 0x8000, + DM_FORMNAME = 0x10000, + DM_LOGPIXELS = 0x20000, + DM_BITSPERPEL = 0x40000, + DM_PELSWIDTH = 0x80000, + DM_PELSHEIGHT = 0x100000, + DM_DISPLAYFLAGS = 0x200000, + DM_DISPLAYFREQUENCY = 0x400000, + DM_ICMMETHOD = 0x800000, + DM_ICMINTENT = 0x1000000, + DM_MEDIATYPE = 0x2000000, + DM_DITHERTYPE = 0x4000000, + DM_PANNINGWIDTH = 0x8000000, + DM_PANNINGHEIGHT = 0x10000000, + DM_DISPLAYFIXEDOUTPUT = 0x20000000; + + /** {@link DEVMODE} {@code dmDisplayOrientation} specifications. */ + public static final int + DMDO_DEFAULT = 0, + DMDO_90 = 1, + DMDO_180 = 2, + DMDO_270 = 3; + + /** {@link DEVMODE} {@code dmDisplayFixedOutput} specifications. */ + public static final int + DMDFO_DEFAULT = 0, + DMDFO_STRETCH = 1, + DMDFO_CENTER = 2; + + /** {@link DEVMODE} {@code dmDisplayFlags} flags. */ + public static final int + DM_INTERLACED = 0x2, + DMDISPLAYFLAGS_TEXTMODE = 0x4; + + /** {@link PIXELFORMATDESCRIPTOR} flags. */ + public static final int + PFD_DOUBLEBUFFER = 0x1, + PFD_STEREO = 0x2, + PFD_DRAW_TO_WINDOW = 0x4, + PFD_DRAW_TO_BITMAP = 0x8, + PFD_SUPPORT_GDI = 0x10, + PFD_SUPPORT_OPENGL = 0x20, + PFD_GENERIC_FORMAT = 0x40, + PFD_NEED_PALETTE = 0x80, + PFD_NEED_SYSTEM_PALETTE = 0x100, + PFD_SWAP_EXCHANGE = 0x200, + PFD_SWAP_COPY = 0x400, + PFD_SWAP_LAYER_BUFFERS = 0x800, + PFD_GENERIC_ACCELERATED = 0x1000, + PFD_SUPPORT_DIRECTDRAW = 0x2000, + PFD_DIRECT3D_ACCELERATED = 0x4000, + PFD_SUPPORT_COMPOSITION = 0x8000, + PFD_DEPTH_DONTCARE = 0x20000000, + PFD_DOUBLEBUFFER_DONTCARE = 0x40000000, + PFD_STEREO_DONTCARE = 0x80000000; + + /** {@link PIXELFORMATDESCRIPTOR} pixel types. */ + public static final byte + PFD_TYPE_RGBA = 0, + PFD_TYPE_COLORINDEX = 1; + + /** {@link PIXELFORMATDESCRIPTOR} layer types. */ + public static final byte + PFD_MAIN_PLANE = 0, + PFD_OVERLAY_PLANE = 1, + PFD_UNDERLAY_PLANE = (byte)-1; + + protected GDI32() { + throw new UnsupportedOperationException(); + } + + private static final SharedLibrary GDI32 = Library.loadNative(GDI32.class, "org.lwjgl", "gdi32"); + + /** Contains the function pointers loaded from the gdi32 {@link SharedLibrary}. */ + public static final class Functions { + + private Functions() {} + + /** Function address. */ + public static final long + ChoosePixelFormat = apiGetFunctionAddress(GDI32, "ChoosePixelFormat"), + DescribePixelFormat = apiGetFunctionAddress(GDI32, "DescribePixelFormat"), + GetPixelFormat = apiGetFunctionAddress(GDI32, "GetPixelFormat"), + SetPixelFormat = apiGetFunctionAddress(GDI32, "SetPixelFormat"), + SwapBuffers = apiGetFunctionAddress(GDI32, "SwapBuffers"); + + } + + /** Returns the gdi32 {@link SharedLibrary}. */ + public static SharedLibrary getLibrary() { + return GDI32; + } + + // --- [ ChoosePixelFormat ] --- + + /** Unsafe version of: {@link #ChoosePixelFormat} */ + public static native int nChoosePixelFormat(long hdc, long pixelFormatDescriptor, long __functionAddress); + + /** Unsafe version of: {@link #ChoosePixelFormat} */ + public static int nChoosePixelFormat(long hdc, long pixelFormatDescriptor) { + long __functionAddress = Functions.ChoosePixelFormat; + if (CHECKS) { + check(hdc); + } + return nChoosePixelFormat(hdc, pixelFormatDescriptor, __functionAddress); + } + + /** + * Attempts to match an appropriate pixel format supported by a device context to a given pixel format specification. + * + * @param hdc the device context that the function examines to determine the best match for the pixel format descriptor pointed to by {@code pixelFormatDescriptor} + * @param pixelFormatDescriptor a {@link PIXELFORMATDESCRIPTOR} structure that specifies the requested pixel format + */ + public static int ChoosePixelFormat(@NativeType("HDC") long hdc, @NativeType("PIXELFORMATDESCRIPTOR const *") PIXELFORMATDESCRIPTOR pixelFormatDescriptor) { + return nChoosePixelFormat(hdc, pixelFormatDescriptor.address()); + } + + // --- [ DescribePixelFormat ] --- + + /** Unsafe version of: {@link #DescribePixelFormat} */ + public static native int nDescribePixelFormat(long hdc, int pixelFormat, int bytes, long pixelFormatDescriptor, long __functionAddress); + + /** Unsafe version of: {@link #DescribePixelFormat} */ + public static int nDescribePixelFormat(long hdc, int pixelFormat, int bytes, long pixelFormatDescriptor) { + long __functionAddress = Functions.DescribePixelFormat; + if (CHECKS) { + check(hdc); + } + return nDescribePixelFormat(hdc, pixelFormat, bytes, pixelFormatDescriptor, __functionAddress); + } + + /** + * Obtains information about the pixel format identified by pixelFormat of the device associated with dc. The function sets the members of the + * {@link PIXELFORMATDESCRIPTOR} structure pointed to by pixelFormatDescriptor with that pixel format data. The return value is the maximum pixel format + * index of the device context. + * + * @param hdc the device context + * @param pixelFormat index that specifies the pixel format. The pixel formats that a device context supports are identified by positive one-based integer indexes. + * @param bytes the size, in bytes, of the structure pointed to by {@code pixelFormatDescriptor}. The {@code wglDescribePixelFormat} function stores no more than + * {@code bytes} bytes of data to that structure. Set this value to {@link PIXELFORMATDESCRIPTOR#SIZEOF}. + * @param pixelFormatDescriptor a {@link PIXELFORMATDESCRIPTOR} structure whose members the function sets with pixel format data. The function stores the number of bytes copied to + * the structure in the structure's {@code size} member. If, upon entry, {@code pixelFormatDescriptor} is {@code NULL}, the function writes no data to the + * structure. This is useful when you only want to obtain the maximum pixel format index of a device context. + */ + public static int DescribePixelFormat(@NativeType("HDC") long hdc, int pixelFormat, @NativeType("UINT") int bytes, @Nullable @NativeType("LPPIXELFORMATDESCRIPTOR") PIXELFORMATDESCRIPTOR pixelFormatDescriptor) { + return nDescribePixelFormat(hdc, pixelFormat, bytes, memAddressSafe(pixelFormatDescriptor)); + } + + /** + * Obtains information about the pixel format identified by pixelFormat of the device associated with dc. The function sets the members of the + * {@link PIXELFORMATDESCRIPTOR} structure pointed to by pixelFormatDescriptor with that pixel format data. The return value is the maximum pixel format + * index of the device context. + * + * @param hdc the device context + * @param pixelFormat index that specifies the pixel format. The pixel formats that a device context supports are identified by positive one-based integer indexes. + * @param pixelFormatDescriptor a {@link PIXELFORMATDESCRIPTOR} structure whose members the function sets with pixel format data. The function stores the number of bytes copied to + * the structure in the structure's {@code size} member. If, upon entry, {@code pixelFormatDescriptor} is {@code NULL}, the function writes no data to the + * structure. This is useful when you only want to obtain the maximum pixel format index of a device context. + */ + public static int DescribePixelFormat(@NativeType("HDC") long hdc, int pixelFormat, @Nullable @NativeType("LPPIXELFORMATDESCRIPTOR") PIXELFORMATDESCRIPTOR pixelFormatDescriptor) { + return nDescribePixelFormat(hdc, pixelFormat, PIXELFORMATDESCRIPTOR.SIZEOF, memAddressSafe(pixelFormatDescriptor)); + } + + // --- [ GetPixelFormat ] --- + + /** Unsafe version of: {@link #GetPixelFormat} */ + public static native int nGetPixelFormat(long hdc, long __functionAddress); + + /** + * Obtains the index of the currently selected pixel format of the specified device context. + * + * @param hdc the device context of the currently selected pixel format index returned by the function + */ + public static int GetPixelFormat(@NativeType("HDC") long hdc) { + long __functionAddress = Functions.GetPixelFormat; + if (CHECKS) { + check(hdc); + } + return nGetPixelFormat(hdc, __functionAddress); + } + + // --- [ SetPixelFormat ] --- + + /** Unsafe version of: {@link #SetPixelFormat} */ + public static native int nSetPixelFormat(long hdc, int pixelFormat, long pixelFormatDescriptor, long __functionAddress); + + /** Unsafe version of: {@link #SetPixelFormat} */ + public static int nSetPixelFormat(long hdc, int pixelFormat, long pixelFormatDescriptor) { + long __functionAddress = Functions.SetPixelFormat; + if (CHECKS) { + check(hdc); + } + return nSetPixelFormat(hdc, pixelFormat, pixelFormatDescriptor, __functionAddress); + } + + /** + * Sets the pixel format of the specified device context to the format specified by the pixelFormat index. + * + * @param hdc the device context whose pixel format the function attempts to set + * @param pixelFormat index that identifies the pixel format to set. The various pixel formats supported by a device context are identified by one-based indexes. + * @param pixelFormatDescriptor a {@link PIXELFORMATDESCRIPTOR} structure that contains the logical pixel format specification. The system's metafile component uses this structure + * to record the logical pixel format specification. The structure has no other effect upon the behavior of the SetPixelFormat function. + */ + @NativeType("BOOL") + public static boolean SetPixelFormat(@NativeType("HDC") long hdc, int pixelFormat, @Nullable @NativeType("PIXELFORMATDESCRIPTOR const *") PIXELFORMATDESCRIPTOR pixelFormatDescriptor) { + return nSetPixelFormat(hdc, pixelFormat, memAddressSafe(pixelFormatDescriptor)) != 0; + } + + // --- [ SwapBuffers ] --- + + /** Unsafe version of: {@link #SwapBuffers} */ + public static native int nSwapBuffers(long dc, long __functionAddress); + + /** + * Exchanges the front and back buffers if the current pixel format for the window referenced by the specified device context includes a back buffer. + * + * @param dc a device context. If the current pixel format for the window referenced by this device context includes a back buffer, the function exchanges the + * front and back buffers. + */ + @NativeType("BOOL") + public static boolean SwapBuffers(@NativeType("HDC") long dc) { + long __functionAddress = Functions.SwapBuffers; + if (CHECKS) { + check(dc); + } + return nSwapBuffers(dc, __functionAddress) != 0; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/HARDWAREINPUT.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/HARDWAREINPUT.java new file mode 100644 index 00000000..669e8bb1 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/HARDWAREINPUT.java @@ -0,0 +1,336 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.windows; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Contains information about a simulated message generated by an input device other than a keyboard or mouse. + * + *

Member documentation

+ * + *
    + *
  • {@code uMsg} – the message generated by the input hardware
  • + *
  • {@code wParamL} – the low-order word of the {@code lParam} parameter for {@code uMsg}
  • + *
  • {@code wParamH} – the high-order word of the {@code lParam} parameter for {@code uMsg}
  • + *
+ * + *

Layout

+ * + *

+ * struct HARDWAREINPUT {
+ *     DWORD uMsg;
+ *     WORD wParamL;
+ *     WORD wParamH;
+ * }
+ */ +public class HARDWAREINPUT extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + UMSG, + WPARAML, + WPARAMH; + + static { + Layout layout = __struct( + __member(4), + __member(2), + __member(2) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + UMSG = layout.offsetof(0); + WPARAML = layout.offsetof(1); + WPARAMH = layout.offsetof(2); + } + + /** + * Creates a {@code HARDWAREINPUT} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public HARDWAREINPUT(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code uMsg} field. */ + @NativeType("DWORD") + public int uMsg() { return nuMsg(address()); } + /** Returns the value of the {@code wParamL} field. */ + @NativeType("WORD") + public short wParamL() { return nwParamL(address()); } + /** Returns the value of the {@code wParamH} field. */ + @NativeType("WORD") + public short wParamH() { return nwParamH(address()); } + + /** Sets the specified value to the {@code uMsg} field. */ + public HARDWAREINPUT uMsg(@NativeType("DWORD") int value) { nuMsg(address(), value); return this; } + /** Sets the specified value to the {@code wParamL} field. */ + public HARDWAREINPUT wParamL(@NativeType("WORD") short value) { nwParamL(address(), value); return this; } + /** Sets the specified value to the {@code wParamH} field. */ + public HARDWAREINPUT wParamH(@NativeType("WORD") short value) { nwParamH(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public HARDWAREINPUT set( + int uMsg, + short wParamL, + short wParamH + ) { + uMsg(uMsg); + wParamL(wParamL); + wParamH(wParamH); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public HARDWAREINPUT set(HARDWAREINPUT src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code HARDWAREINPUT} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static HARDWAREINPUT malloc() { + return wrap(HARDWAREINPUT.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code HARDWAREINPUT} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static HARDWAREINPUT calloc() { + return wrap(HARDWAREINPUT.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code HARDWAREINPUT} instance allocated with {@link BufferUtils}. */ + public static HARDWAREINPUT create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(HARDWAREINPUT.class, memAddress(container), container); + } + + /** Returns a new {@code HARDWAREINPUT} instance for the specified memory address. */ + public static HARDWAREINPUT create(long address) { + return wrap(HARDWAREINPUT.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static HARDWAREINPUT createSafe(long address) { + return address == NULL ? null : wrap(HARDWAREINPUT.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code HARDWAREINPUT} instance allocated on the thread-local {@link MemoryStack}. */ + public static HARDWAREINPUT mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code HARDWAREINPUT} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static HARDWAREINPUT callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code HARDWAREINPUT} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static HARDWAREINPUT mallocStack(MemoryStack stack) { + return wrap(HARDWAREINPUT.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code HARDWAREINPUT} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static HARDWAREINPUT callocStack(MemoryStack stack) { + return wrap(HARDWAREINPUT.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #uMsg}. */ + public static int nuMsg(long struct) { return UNSAFE.getInt(null, struct + HARDWAREINPUT.UMSG); } + /** Unsafe version of {@link #wParamL}. */ + public static short nwParamL(long struct) { return UNSAFE.getShort(null, struct + HARDWAREINPUT.WPARAML); } + /** Unsafe version of {@link #wParamH}. */ + public static short nwParamH(long struct) { return UNSAFE.getShort(null, struct + HARDWAREINPUT.WPARAMH); } + + /** Unsafe version of {@link #uMsg(int) uMsg}. */ + public static void nuMsg(long struct, int value) { UNSAFE.putInt(null, struct + HARDWAREINPUT.UMSG, value); } + /** Unsafe version of {@link #wParamL(short) wParamL}. */ + public static void nwParamL(long struct, short value) { UNSAFE.putShort(null, struct + HARDWAREINPUT.WPARAML, value); } + /** Unsafe version of {@link #wParamH(short) wParamH}. */ + public static void nwParamH(long struct, short value) { UNSAFE.putShort(null, struct + HARDWAREINPUT.WPARAMH, value); } + + // ----------------------------------- + + /** An array of {@link HARDWAREINPUT} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final HARDWAREINPUT ELEMENT_FACTORY = HARDWAREINPUT.create(-1L); + + /** + * Creates a new {@code HARDWAREINPUT.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link HARDWAREINPUT#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected HARDWAREINPUT getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code uMsg} field. */ + @NativeType("DWORD") + public int uMsg() { return HARDWAREINPUT.nuMsg(address()); } + /** Returns the value of the {@code wParamL} field. */ + @NativeType("WORD") + public short wParamL() { return HARDWAREINPUT.nwParamL(address()); } + /** Returns the value of the {@code wParamH} field. */ + @NativeType("WORD") + public short wParamH() { return HARDWAREINPUT.nwParamH(address()); } + + /** Sets the specified value to the {@code uMsg} field. */ + public Buffer uMsg(@NativeType("DWORD") int value) { HARDWAREINPUT.nuMsg(address(), value); return this; } + /** Sets the specified value to the {@code wParamL} field. */ + public Buffer wParamL(@NativeType("WORD") short value) { HARDWAREINPUT.nwParamL(address(), value); return this; } + /** Sets the specified value to the {@code wParamH} field. */ + public Buffer wParamH(@NativeType("WORD") short value) { HARDWAREINPUT.nwParamH(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/INPUT.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/INPUT.java new file mode 100644 index 00000000..73901d69 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/INPUT.java @@ -0,0 +1,358 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.windows; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Used by {@link User32#SendInput} to store information for synthesizing input events such as keystrokes, mouse movement, and mouse clicks. + * + *

Member documentation

+ * + *
    + *
  • {@code type} – the type of the input event. One of:
    {@link User32#INPUT_MOUSE}{@link User32#INPUT_KEYBOARD}{@link User32#INPUT_HARDWARE}
  • + *
  • {@code DUMMYUNIONNAME} + * + *
      + *
    • {@code DUMMYUNIONNAME.mi} – the information about a simulated mouse event
    • + *
    • {@code DUMMYUNIONNAME.ki} – the information about a simulated keyboard event
    • + *
    • {@code DUMMYUNIONNAME.hi} – the information about a simulated hardware event
    • + *
  • + *
+ * + *

Layout

+ * + *

+ * struct INPUT {
+ *     DWORD type;
+ *     union {
+ *         {@link MOUSEINPUT MOUSEINPUT} mi;
+ *         {@link KEYBDINPUT KEYBDINPUT} ki;
+ *         {@link HARDWAREINPUT HARDWAREINPUT} hi;
+ *     } DUMMYUNIONNAME;
+ * }
+ */ +public class INPUT extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + TYPE, + DUMMYUNIONNAME, + DUMMYUNIONNAME_MI, + DUMMYUNIONNAME_KI, + DUMMYUNIONNAME_HI; + + static { + Layout layout = __struct( + __member(4), + __union( + __member(MOUSEINPUT.SIZEOF, MOUSEINPUT.ALIGNOF), + __member(KEYBDINPUT.SIZEOF, KEYBDINPUT.ALIGNOF), + __member(HARDWAREINPUT.SIZEOF, HARDWAREINPUT.ALIGNOF) + ) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + TYPE = layout.offsetof(0); + DUMMYUNIONNAME = layout.offsetof(1); + DUMMYUNIONNAME_MI = layout.offsetof(2); + DUMMYUNIONNAME_KI = layout.offsetof(3); + DUMMYUNIONNAME_HI = layout.offsetof(4); + } + + /** + * Creates a {@code INPUT} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public INPUT(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code type} field. */ + @NativeType("DWORD") + public int type() { return ntype(address()); } + /** Returns a {@link MOUSEINPUT} view of the {@code DUMMYUNIONNAME.mi} field. */ + public MOUSEINPUT DUMMYUNIONNAME_mi() { return nDUMMYUNIONNAME_mi(address()); } + /** Returns a {@link KEYBDINPUT} view of the {@code DUMMYUNIONNAME.ki} field. */ + public KEYBDINPUT DUMMYUNIONNAME_ki() { return nDUMMYUNIONNAME_ki(address()); } + /** Returns a {@link HARDWAREINPUT} view of the {@code DUMMYUNIONNAME.hi} field. */ + public HARDWAREINPUT DUMMYUNIONNAME_hi() { return nDUMMYUNIONNAME_hi(address()); } + + /** Sets the specified value to the {@code type} field. */ + public INPUT type(@NativeType("DWORD") int value) { ntype(address(), value); return this; } + /** Copies the specified {@link MOUSEINPUT} to the {@code DUMMYUNIONNAME.mi} field. */ + public INPUT DUMMYUNIONNAME_mi(MOUSEINPUT value) { nDUMMYUNIONNAME_mi(address(), value); return this; } + /** Passes the {@code DUMMYUNIONNAME.mi} field to the specified {@link java.util.function.Consumer Consumer}. */ + public INPUT DUMMYUNIONNAME_mi(java.util.function.Consumer consumer) { consumer.accept(DUMMYUNIONNAME_mi()); return this; } + /** Copies the specified {@link KEYBDINPUT} to the {@code DUMMYUNIONNAME.ki} field. */ + public INPUT DUMMYUNIONNAME_ki(KEYBDINPUT value) { nDUMMYUNIONNAME_ki(address(), value); return this; } + /** Passes the {@code DUMMYUNIONNAME.ki} field to the specified {@link java.util.function.Consumer Consumer}. */ + public INPUT DUMMYUNIONNAME_ki(java.util.function.Consumer consumer) { consumer.accept(DUMMYUNIONNAME_ki()); return this; } + /** Copies the specified {@link HARDWAREINPUT} to the {@code DUMMYUNIONNAME.hi} field. */ + public INPUT DUMMYUNIONNAME_hi(HARDWAREINPUT value) { nDUMMYUNIONNAME_hi(address(), value); return this; } + /** Passes the {@code DUMMYUNIONNAME.hi} field to the specified {@link java.util.function.Consumer Consumer}. */ + public INPUT DUMMYUNIONNAME_hi(java.util.function.Consumer consumer) { consumer.accept(DUMMYUNIONNAME_hi()); return this; } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public INPUT set(INPUT src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code INPUT} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static INPUT malloc() { + return wrap(INPUT.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code INPUT} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static INPUT calloc() { + return wrap(INPUT.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code INPUT} instance allocated with {@link BufferUtils}. */ + public static INPUT create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(INPUT.class, memAddress(container), container); + } + + /** Returns a new {@code INPUT} instance for the specified memory address. */ + public static INPUT create(long address) { + return wrap(INPUT.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static INPUT createSafe(long address) { + return address == NULL ? null : wrap(INPUT.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code INPUT} instance allocated on the thread-local {@link MemoryStack}. */ + public static INPUT mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code INPUT} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static INPUT callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code INPUT} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static INPUT mallocStack(MemoryStack stack) { + return wrap(INPUT.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code INPUT} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static INPUT callocStack(MemoryStack stack) { + return wrap(INPUT.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #type}. */ + public static int ntype(long struct) { return UNSAFE.getInt(null, struct + INPUT.TYPE); } + /** Unsafe version of {@link #DUMMYUNIONNAME_mi}. */ + public static MOUSEINPUT nDUMMYUNIONNAME_mi(long struct) { return MOUSEINPUT.create(struct + INPUT.DUMMYUNIONNAME_MI); } + /** Unsafe version of {@link #DUMMYUNIONNAME_ki}. */ + public static KEYBDINPUT nDUMMYUNIONNAME_ki(long struct) { return KEYBDINPUT.create(struct + INPUT.DUMMYUNIONNAME_KI); } + /** Unsafe version of {@link #DUMMYUNIONNAME_hi}. */ + public static HARDWAREINPUT nDUMMYUNIONNAME_hi(long struct) { return HARDWAREINPUT.create(struct + INPUT.DUMMYUNIONNAME_HI); } + + /** Unsafe version of {@link #type(int) type}. */ + public static void ntype(long struct, int value) { UNSAFE.putInt(null, struct + INPUT.TYPE, value); } + /** Unsafe version of {@link #DUMMYUNIONNAME_mi(MOUSEINPUT) DUMMYUNIONNAME_mi}. */ + public static void nDUMMYUNIONNAME_mi(long struct, MOUSEINPUT value) { memCopy(value.address(), struct + INPUT.DUMMYUNIONNAME_MI, MOUSEINPUT.SIZEOF); } + /** Unsafe version of {@link #DUMMYUNIONNAME_ki(KEYBDINPUT) DUMMYUNIONNAME_ki}. */ + public static void nDUMMYUNIONNAME_ki(long struct, KEYBDINPUT value) { memCopy(value.address(), struct + INPUT.DUMMYUNIONNAME_KI, KEYBDINPUT.SIZEOF); } + /** Unsafe version of {@link #DUMMYUNIONNAME_hi(HARDWAREINPUT) DUMMYUNIONNAME_hi}. */ + public static void nDUMMYUNIONNAME_hi(long struct, HARDWAREINPUT value) { memCopy(value.address(), struct + INPUT.DUMMYUNIONNAME_HI, HARDWAREINPUT.SIZEOF); } + + // ----------------------------------- + + /** An array of {@link INPUT} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final INPUT ELEMENT_FACTORY = INPUT.create(-1L); + + /** + * Creates a new {@code INPUT.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link INPUT#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected INPUT getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code type} field. */ + @NativeType("DWORD") + public int type() { return INPUT.ntype(address()); } + /** Returns a {@link MOUSEINPUT} view of the {@code DUMMYUNIONNAME.mi} field. */ + public MOUSEINPUT DUMMYUNIONNAME_mi() { return INPUT.nDUMMYUNIONNAME_mi(address()); } + /** Returns a {@link KEYBDINPUT} view of the {@code DUMMYUNIONNAME.ki} field. */ + public KEYBDINPUT DUMMYUNIONNAME_ki() { return INPUT.nDUMMYUNIONNAME_ki(address()); } + /** Returns a {@link HARDWAREINPUT} view of the {@code DUMMYUNIONNAME.hi} field. */ + public HARDWAREINPUT DUMMYUNIONNAME_hi() { return INPUT.nDUMMYUNIONNAME_hi(address()); } + + /** Sets the specified value to the {@code type} field. */ + public Buffer type(@NativeType("DWORD") int value) { INPUT.ntype(address(), value); return this; } + /** Copies the specified {@link MOUSEINPUT} to the {@code DUMMYUNIONNAME.mi} field. */ + public Buffer DUMMYUNIONNAME_mi(MOUSEINPUT value) { INPUT.nDUMMYUNIONNAME_mi(address(), value); return this; } + /** Passes the {@code DUMMYUNIONNAME.mi} field to the specified {@link java.util.function.Consumer Consumer}. */ + public Buffer DUMMYUNIONNAME_mi(java.util.function.Consumer consumer) { consumer.accept(DUMMYUNIONNAME_mi()); return this; } + /** Copies the specified {@link KEYBDINPUT} to the {@code DUMMYUNIONNAME.ki} field. */ + public Buffer DUMMYUNIONNAME_ki(KEYBDINPUT value) { INPUT.nDUMMYUNIONNAME_ki(address(), value); return this; } + /** Passes the {@code DUMMYUNIONNAME.ki} field to the specified {@link java.util.function.Consumer Consumer}. */ + public Buffer DUMMYUNIONNAME_ki(java.util.function.Consumer consumer) { consumer.accept(DUMMYUNIONNAME_ki()); return this; } + /** Copies the specified {@link HARDWAREINPUT} to the {@code DUMMYUNIONNAME.hi} field. */ + public Buffer DUMMYUNIONNAME_hi(HARDWAREINPUT value) { INPUT.nDUMMYUNIONNAME_hi(address(), value); return this; } + /** Passes the {@code DUMMYUNIONNAME.hi} field to the specified {@link java.util.function.Consumer Consumer}. */ + public Buffer DUMMYUNIONNAME_hi(java.util.function.Consumer consumer) { consumer.accept(DUMMYUNIONNAME_hi()); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/KEYBDINPUT.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/KEYBDINPUT.java new file mode 100644 index 00000000..4a05e34a --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/KEYBDINPUT.java @@ -0,0 +1,384 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.windows; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Contains information about a simulated keyboard event. + * + *

Member documentation

+ * + *
    + *
  • {@code wVk} – + * A virtual-key code. + * + *

    The code must be a value in the range 1 to 254. If the {@code dwFlags} member specifies {@link User32#KEYEVENTF_UNICODE}, {@code wVk} must be 0.

  • + *
  • {@code wScan} – + * A hardware scan code for the key. + * + *

    If {@code dwFlags} specifies {@link User32#KEYEVENTF_UNICODE}, {@code wScan} specifies a Unicode character which is to be sent to the foreground application.

  • + *
  • {@code dwFlags} – specifies various aspects of a keystroke. One of:
    {@link User32#KEYEVENTF_EXTENDEDKEY}{@link User32#KEYEVENTF_KEYUP}{@link User32#KEYEVENTF_SCANCODE}{@link User32#KEYEVENTF_UNICODE}
  • + *
  • {@code time} – the time stamp for the event, in milliseconds. If this parameter is zero, the system will provide its own time stamp.
  • + *
  • {@code dwExtraInfo} – an additional value associated with the keystroke. Use the {@link User32#GetMessageExtraInfo} function to obtain this information.
  • + *
+ * + *

Layout

+ * + *

+ * struct KEYBDINPUT {
+ *     WORD wVk;
+ *     WORD wScan;
+ *     DWORD dwFlags;
+ *     DWORD time;
+ *     ULONG_PTR dwExtraInfo;
+ * }
+ */ +public class KEYBDINPUT extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + WVK, + WSCAN, + DWFLAGS, + TIME, + DWEXTRAINFO; + + static { + Layout layout = __struct( + __member(2), + __member(2), + __member(4), + __member(4), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + WVK = layout.offsetof(0); + WSCAN = layout.offsetof(1); + DWFLAGS = layout.offsetof(2); + TIME = layout.offsetof(3); + DWEXTRAINFO = layout.offsetof(4); + } + + /** + * Creates a {@code KEYBDINPUT} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public KEYBDINPUT(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code wVk} field. */ + @NativeType("WORD") + public short wVk() { return nwVk(address()); } + /** Returns the value of the {@code wScan} field. */ + @NativeType("WORD") + public short wScan() { return nwScan(address()); } + /** Returns the value of the {@code dwFlags} field. */ + @NativeType("DWORD") + public int dwFlags() { return ndwFlags(address()); } + /** Returns the value of the {@code time} field. */ + @NativeType("DWORD") + public int time() { return ntime(address()); } + /** Returns the value of the {@code dwExtraInfo} field. */ + @NativeType("ULONG_PTR") + public long dwExtraInfo() { return ndwExtraInfo(address()); } + + /** Sets the specified value to the {@code wVk} field. */ + public KEYBDINPUT wVk(@NativeType("WORD") short value) { nwVk(address(), value); return this; } + /** Sets the specified value to the {@code wScan} field. */ + public KEYBDINPUT wScan(@NativeType("WORD") short value) { nwScan(address(), value); return this; } + /** Sets the specified value to the {@code dwFlags} field. */ + public KEYBDINPUT dwFlags(@NativeType("DWORD") int value) { ndwFlags(address(), value); return this; } + /** Sets the specified value to the {@code time} field. */ + public KEYBDINPUT time(@NativeType("DWORD") int value) { ntime(address(), value); return this; } + /** Sets the specified value to the {@code dwExtraInfo} field. */ + public KEYBDINPUT dwExtraInfo(@NativeType("ULONG_PTR") long value) { ndwExtraInfo(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public KEYBDINPUT set( + short wVk, + short wScan, + int dwFlags, + int time, + long dwExtraInfo + ) { + wVk(wVk); + wScan(wScan); + dwFlags(dwFlags); + time(time); + dwExtraInfo(dwExtraInfo); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public KEYBDINPUT set(KEYBDINPUT src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code KEYBDINPUT} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static KEYBDINPUT malloc() { + return wrap(KEYBDINPUT.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code KEYBDINPUT} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static KEYBDINPUT calloc() { + return wrap(KEYBDINPUT.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code KEYBDINPUT} instance allocated with {@link BufferUtils}. */ + public static KEYBDINPUT create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(KEYBDINPUT.class, memAddress(container), container); + } + + /** Returns a new {@code KEYBDINPUT} instance for the specified memory address. */ + public static KEYBDINPUT create(long address) { + return wrap(KEYBDINPUT.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static KEYBDINPUT createSafe(long address) { + return address == NULL ? null : wrap(KEYBDINPUT.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code KEYBDINPUT} instance allocated on the thread-local {@link MemoryStack}. */ + public static KEYBDINPUT mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code KEYBDINPUT} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static KEYBDINPUT callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code KEYBDINPUT} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static KEYBDINPUT mallocStack(MemoryStack stack) { + return wrap(KEYBDINPUT.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code KEYBDINPUT} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static KEYBDINPUT callocStack(MemoryStack stack) { + return wrap(KEYBDINPUT.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #wVk}. */ + public static short nwVk(long struct) { return UNSAFE.getShort(null, struct + KEYBDINPUT.WVK); } + /** Unsafe version of {@link #wScan}. */ + public static short nwScan(long struct) { return UNSAFE.getShort(null, struct + KEYBDINPUT.WSCAN); } + /** Unsafe version of {@link #dwFlags}. */ + public static int ndwFlags(long struct) { return UNSAFE.getInt(null, struct + KEYBDINPUT.DWFLAGS); } + /** Unsafe version of {@link #time}. */ + public static int ntime(long struct) { return UNSAFE.getInt(null, struct + KEYBDINPUT.TIME); } + /** Unsafe version of {@link #dwExtraInfo}. */ + public static long ndwExtraInfo(long struct) { return memGetAddress(struct + KEYBDINPUT.DWEXTRAINFO); } + + /** Unsafe version of {@link #wVk(short) wVk}. */ + public static void nwVk(long struct, short value) { UNSAFE.putShort(null, struct + KEYBDINPUT.WVK, value); } + /** Unsafe version of {@link #wScan(short) wScan}. */ + public static void nwScan(long struct, short value) { UNSAFE.putShort(null, struct + KEYBDINPUT.WSCAN, value); } + /** Unsafe version of {@link #dwFlags(int) dwFlags}. */ + public static void ndwFlags(long struct, int value) { UNSAFE.putInt(null, struct + KEYBDINPUT.DWFLAGS, value); } + /** Unsafe version of {@link #time(int) time}. */ + public static void ntime(long struct, int value) { UNSAFE.putInt(null, struct + KEYBDINPUT.TIME, value); } + /** Unsafe version of {@link #dwExtraInfo(long) dwExtraInfo}. */ + public static void ndwExtraInfo(long struct, long value) { memPutAddress(struct + KEYBDINPUT.DWEXTRAINFO, value); } + + // ----------------------------------- + + /** An array of {@link KEYBDINPUT} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final KEYBDINPUT ELEMENT_FACTORY = KEYBDINPUT.create(-1L); + + /** + * Creates a new {@code KEYBDINPUT.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link KEYBDINPUT#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected KEYBDINPUT getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code wVk} field. */ + @NativeType("WORD") + public short wVk() { return KEYBDINPUT.nwVk(address()); } + /** Returns the value of the {@code wScan} field. */ + @NativeType("WORD") + public short wScan() { return KEYBDINPUT.nwScan(address()); } + /** Returns the value of the {@code dwFlags} field. */ + @NativeType("DWORD") + public int dwFlags() { return KEYBDINPUT.ndwFlags(address()); } + /** Returns the value of the {@code time} field. */ + @NativeType("DWORD") + public int time() { return KEYBDINPUT.ntime(address()); } + /** Returns the value of the {@code dwExtraInfo} field. */ + @NativeType("ULONG_PTR") + public long dwExtraInfo() { return KEYBDINPUT.ndwExtraInfo(address()); } + + /** Sets the specified value to the {@code wVk} field. */ + public Buffer wVk(@NativeType("WORD") short value) { KEYBDINPUT.nwVk(address(), value); return this; } + /** Sets the specified value to the {@code wScan} field. */ + public Buffer wScan(@NativeType("WORD") short value) { KEYBDINPUT.nwScan(address(), value); return this; } + /** Sets the specified value to the {@code dwFlags} field. */ + public Buffer dwFlags(@NativeType("DWORD") int value) { KEYBDINPUT.ndwFlags(address(), value); return this; } + /** Sets the specified value to the {@code time} field. */ + public Buffer time(@NativeType("DWORD") int value) { KEYBDINPUT.ntime(address(), value); return this; } + /** Sets the specified value to the {@code dwExtraInfo} field. */ + public Buffer dwExtraInfo(@NativeType("ULONG_PTR") long value) { KEYBDINPUT.ndwExtraInfo(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/MONITORINFOEX.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/MONITORINFOEX.java new file mode 100644 index 00000000..58826e11 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/MONITORINFOEX.java @@ -0,0 +1,351 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.windows; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Contains information about a display monitor. + * + *

Member documentation

+ * + *
    + *
  • {@code cbSize} – + * the size, in bytes, of the structure. + * + *

    Set this member to {@link #SIZEOF} before calling the {@link User32#GetMonitorInfo} function. Doing so lets the function determine the type of structure you + * are passing to it.

  • + *
  • {@code rcMonitor} – + * a {@link RECT} structure that specifies the display monitor rectangle, expressed in virtual-screen coordinates. Note that if the monitor is not the primary + * display monitor, some of the rectangle's coordinates may be negative values.
  • + *
  • {@code rcWork} – + * a {@link RECT} structure that specifies the work area rectangle of the display monitor that can be used by applications, expressed in virtual-screen + * coordinates. Windows uses this rectangle to maximize an application on the monitor. The rest of the area in {@code rcMonitor} contains system windows + * such as the task bar and side bars. Note that if the monitor is not the primary display monitor, some of the rectangle's coordinates may be negative + * values.
  • + *
  • {@code dwFlags} – the attributes of the display monitor. May be:
    {@link User32#MONITORINFOF_PRIMARY}
  • + *
  • {@code szDevice[32]} – a string that specifies the device name of the monitor being used
  • + *
+ * + *

Layout

+ * + *

+ * struct MONITORINFOEX {
+ *     DWORD cbSize;
+ *     {@link RECT RECT} rcMonitor;
+ *     {@link RECT RECT} rcWork;
+ *     DWORD dwFlags;
+ *     TCHAR szDevice[32];
+ * }
+ */ +public class MONITORINFOEX extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + CBSIZE, + RCMONITOR, + RCWORK, + DWFLAGS, + SZDEVICE; + + static { + Layout layout = __struct( + __member(4), + __member(RECT.SIZEOF, RECT.ALIGNOF), + __member(RECT.SIZEOF, RECT.ALIGNOF), + __member(4), + __array(2, 32) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + CBSIZE = layout.offsetof(0); + RCMONITOR = layout.offsetof(1); + RCWORK = layout.offsetof(2); + DWFLAGS = layout.offsetof(3); + SZDEVICE = layout.offsetof(4); + } + + /** + * Creates a {@code MONITORINFOEX} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public MONITORINFOEX(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code cbSize} field. */ + @NativeType("DWORD") + public int cbSize() { return ncbSize(address()); } + /** Returns a {@link RECT} view of the {@code rcMonitor} field. */ + public RECT rcMonitor() { return nrcMonitor(address()); } + /** Returns a {@link RECT} view of the {@code rcWork} field. */ + public RECT rcWork() { return nrcWork(address()); } + /** Returns the value of the {@code dwFlags} field. */ + @NativeType("DWORD") + public int dwFlags() { return ndwFlags(address()); } + /** Returns a {@link ByteBuffer} view of the {@code szDevice} field. */ + @NativeType("TCHAR[32]") + public ByteBuffer szDevice() { return nszDevice(address()); } + /** Decodes the null-terminated string stored in the {@code szDevice} field. */ + @NativeType("TCHAR[32]") + public String szDeviceString() { return nszDeviceString(address()); } + + /** Sets the specified value to the {@code cbSize} field. */ + public MONITORINFOEX cbSize(@NativeType("DWORD") int value) { ncbSize(address(), value); return this; } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public MONITORINFOEX set(MONITORINFOEX src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code MONITORINFOEX} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static MONITORINFOEX malloc() { + return wrap(MONITORINFOEX.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code MONITORINFOEX} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static MONITORINFOEX calloc() { + return wrap(MONITORINFOEX.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code MONITORINFOEX} instance allocated with {@link BufferUtils}. */ + public static MONITORINFOEX create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(MONITORINFOEX.class, memAddress(container), container); + } + + /** Returns a new {@code MONITORINFOEX} instance for the specified memory address. */ + public static MONITORINFOEX create(long address) { + return wrap(MONITORINFOEX.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static MONITORINFOEX createSafe(long address) { + return address == NULL ? null : wrap(MONITORINFOEX.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code MONITORINFOEX} instance allocated on the thread-local {@link MemoryStack}. */ + public static MONITORINFOEX mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code MONITORINFOEX} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static MONITORINFOEX callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code MONITORINFOEX} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static MONITORINFOEX mallocStack(MemoryStack stack) { + return wrap(MONITORINFOEX.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code MONITORINFOEX} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static MONITORINFOEX callocStack(MemoryStack stack) { + return wrap(MONITORINFOEX.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #cbSize}. */ + public static int ncbSize(long struct) { return UNSAFE.getInt(null, struct + MONITORINFOEX.CBSIZE); } + /** Unsafe version of {@link #rcMonitor}. */ + public static RECT nrcMonitor(long struct) { return RECT.create(struct + MONITORINFOEX.RCMONITOR); } + /** Unsafe version of {@link #rcWork}. */ + public static RECT nrcWork(long struct) { return RECT.create(struct + MONITORINFOEX.RCWORK); } + /** Unsafe version of {@link #dwFlags}. */ + public static int ndwFlags(long struct) { return UNSAFE.getInt(null, struct + MONITORINFOEX.DWFLAGS); } + /** Unsafe version of {@link #szDevice}. */ + public static ByteBuffer nszDevice(long struct) { return memByteBuffer(struct + MONITORINFOEX.SZDEVICE, 32 * 2); } + /** Unsafe version of {@link #szDeviceString}. */ + public static String nszDeviceString(long struct) { return memUTF16(struct + MONITORINFOEX.SZDEVICE); } + + /** Unsafe version of {@link #cbSize(int) cbSize}. */ + public static void ncbSize(long struct, int value) { UNSAFE.putInt(null, struct + MONITORINFOEX.CBSIZE, value); } + + // ----------------------------------- + + /** An array of {@link MONITORINFOEX} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final MONITORINFOEX ELEMENT_FACTORY = MONITORINFOEX.create(-1L); + + /** + * Creates a new {@code MONITORINFOEX.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link MONITORINFOEX#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected MONITORINFOEX getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code cbSize} field. */ + @NativeType("DWORD") + public int cbSize() { return MONITORINFOEX.ncbSize(address()); } + /** Returns a {@link RECT} view of the {@code rcMonitor} field. */ + public RECT rcMonitor() { return MONITORINFOEX.nrcMonitor(address()); } + /** Returns a {@link RECT} view of the {@code rcWork} field. */ + public RECT rcWork() { return MONITORINFOEX.nrcWork(address()); } + /** Returns the value of the {@code dwFlags} field. */ + @NativeType("DWORD") + public int dwFlags() { return MONITORINFOEX.ndwFlags(address()); } + /** Returns a {@link ByteBuffer} view of the {@code szDevice} field. */ + @NativeType("TCHAR[32]") + public ByteBuffer szDevice() { return MONITORINFOEX.nszDevice(address()); } + /** Decodes the null-terminated string stored in the {@code szDevice} field. */ + @NativeType("TCHAR[32]") + public String szDeviceString() { return MONITORINFOEX.nszDeviceString(address()); } + + /** Sets the specified value to the {@code cbSize} field. */ + public Buffer cbSize(@NativeType("DWORD") int value) { MONITORINFOEX.ncbSize(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/MOUSEINPUT.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/MOUSEINPUT.java new file mode 100644 index 00000000..7855f71b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/MOUSEINPUT.java @@ -0,0 +1,425 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.windows; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Contains information about a simulated mouse event. + * + *

Member documentation

+ * + *
    + *
  • {@code dx} – + * the absolute position of the mouse, or the amount of motion since the last mouse event was generated, depending on the value of the {@code dwFlags} + * member. + * + *

    Absolute data is specified as the x coordinate of the mouse; relative data is specified as the number of pixels moved.

  • + *
  • {@code dy} – + * the absolute position of the mouse, or the amount of motion since the last mouse event was generated, depending on the value of the {@code dwFlags} + * member. + * + *

    Absolute data is specified as the y coordinate of the mouse; relative data is specified as the number of pixels moved.

  • + *
  • {@code mouseData} – If {@code dwFlags} contains {@link User32#MOUSEEVENTF_WHEEL}, then {@code mouseData} specifies the amount of wheel movement. A positive value indicates that the + * wheel was rotated forward, away from the user; a negative value indicates that the wheel was rotated backward, toward the user. One wheel click is + * defined as {@link User32#WHEEL_DELTA}, which is 120. + * + *

    Windows Vista: If {@code dwFlags} contains {@link User32#MOUSEEVENTF_HWHEEL}, then {@code dwData} specifies the amount of wheel movement. A positive value indicates + * that the wheel was rotated to the right; a negative value indicates that the wheel was rotated to the left. One wheel click is defined as + * {@code WHEEL_DELTA}, which is 120.

    + * + *

    If {@code dwFlags} does not contain {@link User32#MOUSEEVENTF_WHEEL}, {@link User32#MOUSEEVENTF_XDOWN}, or {@link User32#MOUSEEVENTF_XUP}, then {@code mouseData} should be zero.

    + * + *

    If {@code dwFlags} contains {@link User32#MOUSEEVENTF_XDOWN} or {@link User32#MOUSEEVENTF_XUP}, then {@code mouseData} specifies which X buttons were pressed or released. This + * value may be any combination of the following flags: {@link User32#XBUTTON1}, {@link User32#XBUTTON2}. One of:

    {@link User32#XBUTTON1}{@link User32#XBUTTON2}
  • + *
  • {@code dwFlags} – A set of bit flags that specify various aspects of mouse motion and button clicks. + * + *

    The bit flags that specify mouse button status are set to indicate changes in status, not ongoing conditions. For example, if the left mouse button is + * pressed and held down, {@link User32#MOUSEEVENTF_LEFTDOWN} is set when the left button is first pressed, but not for subsequent motions. Similarly, + * {@link User32#MOUSEEVENTF_LEFTUP} is set only when the button is first released.

    + * + *

    You cannot specify both the {@link User32#MOUSEEVENTF_WHEEL} flag and either {@link User32#MOUSEEVENTF_XDOWN} or {@link User32#MOUSEEVENTF_XUP} flags simultaneously in the {@code dwFlags} + * parameter, because they both require use of the {@code mouseData} field. One of:

    {@link User32#MOUSEEVENTF_ABSOLUTE}{@link User32#MOUSEEVENTF_HWHEEL}{@link User32#MOUSEEVENTF_MOVE}{@link User32#MOUSEEVENTF_MOVE_NOCOALESCE}
    {@link User32#MOUSEEVENTF_LEFTDOWN}{@link User32#MOUSEEVENTF_LEFTUP}{@link User32#MOUSEEVENTF_RIGHTDOWN}{@link User32#MOUSEEVENTF_RIGHTUP}
    {@link User32#MOUSEEVENTF_MIDDLEDOWN}{@link User32#MOUSEEVENTF_MIDDLEUP}{@link User32#MOUSEEVENTF_VIRTUALDESK}{@link User32#MOUSEEVENTF_WHEEL}
    {@link User32#MOUSEEVENTF_XDOWN}{@link User32#MOUSEEVENTF_XUP}
  • + *
  • {@code time} – the time stamp for the event, in milliseconds. If this parameter is 0, the system will provide its own time stamp.
  • + *
  • {@code dwExtraInfo} – an additional value associated with the mouse event. An application calls {@link User32#GetMessageExtraInfo} to obtain this extra information.
  • + *
+ * + *

Layout

+ * + *

+ * struct MOUSEINPUT {
+ *     LONG dx;
+ *     LONG dy;
+ *     DWORD mouseData;
+ *     DWORD dwFlags;
+ *     DWORD time;
+ *     ULONG_PTR dwExtraInfo;
+ * }
+ */ +public class MOUSEINPUT extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + DX, + DY, + MOUSEDATA, + DWFLAGS, + TIME, + DWEXTRAINFO; + + static { + Layout layout = __struct( + __member(4), + __member(4), + __member(4), + __member(4), + __member(4), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + DX = layout.offsetof(0); + DY = layout.offsetof(1); + MOUSEDATA = layout.offsetof(2); + DWFLAGS = layout.offsetof(3); + TIME = layout.offsetof(4); + DWEXTRAINFO = layout.offsetof(5); + } + + /** + * Creates a {@code MOUSEINPUT} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public MOUSEINPUT(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code dx} field. */ + @NativeType("LONG") + public int dx() { return ndx(address()); } + /** Returns the value of the {@code dy} field. */ + @NativeType("LONG") + public int dy() { return ndy(address()); } + /** Returns the value of the {@code mouseData} field. */ + @NativeType("DWORD") + public int mouseData() { return nmouseData(address()); } + /** Returns the value of the {@code dwFlags} field. */ + @NativeType("DWORD") + public int dwFlags() { return ndwFlags(address()); } + /** Returns the value of the {@code time} field. */ + @NativeType("DWORD") + public int time() { return ntime(address()); } + /** Returns the value of the {@code dwExtraInfo} field. */ + @NativeType("ULONG_PTR") + public long dwExtraInfo() { return ndwExtraInfo(address()); } + + /** Sets the specified value to the {@code dx} field. */ + public MOUSEINPUT dx(@NativeType("LONG") int value) { ndx(address(), value); return this; } + /** Sets the specified value to the {@code dy} field. */ + public MOUSEINPUT dy(@NativeType("LONG") int value) { ndy(address(), value); return this; } + /** Sets the specified value to the {@code mouseData} field. */ + public MOUSEINPUT mouseData(@NativeType("DWORD") int value) { nmouseData(address(), value); return this; } + /** Sets the specified value to the {@code dwFlags} field. */ + public MOUSEINPUT dwFlags(@NativeType("DWORD") int value) { ndwFlags(address(), value); return this; } + /** Sets the specified value to the {@code time} field. */ + public MOUSEINPUT time(@NativeType("DWORD") int value) { ntime(address(), value); return this; } + /** Sets the specified value to the {@code dwExtraInfo} field. */ + public MOUSEINPUT dwExtraInfo(@NativeType("ULONG_PTR") long value) { ndwExtraInfo(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public MOUSEINPUT set( + int dx, + int dy, + int mouseData, + int dwFlags, + int time, + long dwExtraInfo + ) { + dx(dx); + dy(dy); + mouseData(mouseData); + dwFlags(dwFlags); + time(time); + dwExtraInfo(dwExtraInfo); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public MOUSEINPUT set(MOUSEINPUT src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code MOUSEINPUT} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static MOUSEINPUT malloc() { + return wrap(MOUSEINPUT.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code MOUSEINPUT} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static MOUSEINPUT calloc() { + return wrap(MOUSEINPUT.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code MOUSEINPUT} instance allocated with {@link BufferUtils}. */ + public static MOUSEINPUT create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(MOUSEINPUT.class, memAddress(container), container); + } + + /** Returns a new {@code MOUSEINPUT} instance for the specified memory address. */ + public static MOUSEINPUT create(long address) { + return wrap(MOUSEINPUT.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static MOUSEINPUT createSafe(long address) { + return address == NULL ? null : wrap(MOUSEINPUT.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code MOUSEINPUT} instance allocated on the thread-local {@link MemoryStack}. */ + public static MOUSEINPUT mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code MOUSEINPUT} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static MOUSEINPUT callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code MOUSEINPUT} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static MOUSEINPUT mallocStack(MemoryStack stack) { + return wrap(MOUSEINPUT.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code MOUSEINPUT} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static MOUSEINPUT callocStack(MemoryStack stack) { + return wrap(MOUSEINPUT.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #dx}. */ + public static int ndx(long struct) { return UNSAFE.getInt(null, struct + MOUSEINPUT.DX); } + /** Unsafe version of {@link #dy}. */ + public static int ndy(long struct) { return UNSAFE.getInt(null, struct + MOUSEINPUT.DY); } + /** Unsafe version of {@link #mouseData}. */ + public static int nmouseData(long struct) { return UNSAFE.getInt(null, struct + MOUSEINPUT.MOUSEDATA); } + /** Unsafe version of {@link #dwFlags}. */ + public static int ndwFlags(long struct) { return UNSAFE.getInt(null, struct + MOUSEINPUT.DWFLAGS); } + /** Unsafe version of {@link #time}. */ + public static int ntime(long struct) { return UNSAFE.getInt(null, struct + MOUSEINPUT.TIME); } + /** Unsafe version of {@link #dwExtraInfo}. */ + public static long ndwExtraInfo(long struct) { return memGetAddress(struct + MOUSEINPUT.DWEXTRAINFO); } + + /** Unsafe version of {@link #dx(int) dx}. */ + public static void ndx(long struct, int value) { UNSAFE.putInt(null, struct + MOUSEINPUT.DX, value); } + /** Unsafe version of {@link #dy(int) dy}. */ + public static void ndy(long struct, int value) { UNSAFE.putInt(null, struct + MOUSEINPUT.DY, value); } + /** Unsafe version of {@link #mouseData(int) mouseData}. */ + public static void nmouseData(long struct, int value) { UNSAFE.putInt(null, struct + MOUSEINPUT.MOUSEDATA, value); } + /** Unsafe version of {@link #dwFlags(int) dwFlags}. */ + public static void ndwFlags(long struct, int value) { UNSAFE.putInt(null, struct + MOUSEINPUT.DWFLAGS, value); } + /** Unsafe version of {@link #time(int) time}. */ + public static void ntime(long struct, int value) { UNSAFE.putInt(null, struct + MOUSEINPUT.TIME, value); } + /** Unsafe version of {@link #dwExtraInfo(long) dwExtraInfo}. */ + public static void ndwExtraInfo(long struct, long value) { memPutAddress(struct + MOUSEINPUT.DWEXTRAINFO, value); } + + // ----------------------------------- + + /** An array of {@link MOUSEINPUT} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final MOUSEINPUT ELEMENT_FACTORY = MOUSEINPUT.create(-1L); + + /** + * Creates a new {@code MOUSEINPUT.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link MOUSEINPUT#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected MOUSEINPUT getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code dx} field. */ + @NativeType("LONG") + public int dx() { return MOUSEINPUT.ndx(address()); } + /** Returns the value of the {@code dy} field. */ + @NativeType("LONG") + public int dy() { return MOUSEINPUT.ndy(address()); } + /** Returns the value of the {@code mouseData} field. */ + @NativeType("DWORD") + public int mouseData() { return MOUSEINPUT.nmouseData(address()); } + /** Returns the value of the {@code dwFlags} field. */ + @NativeType("DWORD") + public int dwFlags() { return MOUSEINPUT.ndwFlags(address()); } + /** Returns the value of the {@code time} field. */ + @NativeType("DWORD") + public int time() { return MOUSEINPUT.ntime(address()); } + /** Returns the value of the {@code dwExtraInfo} field. */ + @NativeType("ULONG_PTR") + public long dwExtraInfo() { return MOUSEINPUT.ndwExtraInfo(address()); } + + /** Sets the specified value to the {@code dx} field. */ + public Buffer dx(@NativeType("LONG") int value) { MOUSEINPUT.ndx(address(), value); return this; } + /** Sets the specified value to the {@code dy} field. */ + public Buffer dy(@NativeType("LONG") int value) { MOUSEINPUT.ndy(address(), value); return this; } + /** Sets the specified value to the {@code mouseData} field. */ + public Buffer mouseData(@NativeType("DWORD") int value) { MOUSEINPUT.nmouseData(address(), value); return this; } + /** Sets the specified value to the {@code dwFlags} field. */ + public Buffer dwFlags(@NativeType("DWORD") int value) { MOUSEINPUT.ndwFlags(address(), value); return this; } + /** Sets the specified value to the {@code time} field. */ + public Buffer time(@NativeType("DWORD") int value) { MOUSEINPUT.ntime(address(), value); return this; } + /** Sets the specified value to the {@code dwExtraInfo} field. */ + public Buffer dwExtraInfo(@NativeType("ULONG_PTR") long value) { MOUSEINPUT.ndwExtraInfo(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/MSG.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/MSG.java new file mode 100644 index 00000000..29dc4630 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/MSG.java @@ -0,0 +1,401 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.windows; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Contains message information from a thread's message queue. + * + *

Member documentation

+ * + *
    + *
  • {@code hwnd} – a handle to the window whose window procedure receives the message. This member is {@code NULL} when the message is a thread message.
  • + *
  • {@code message} – the message identifier. Applications can only use the low word; the high word is reserved by the system.
  • + *
  • {@code wParam} – additional information about the message. The exact meaning depends on the value of the message member.
  • + *
  • {@code lParam} – additional information about the message. The exact meaning depends on the value of the message member.
  • + *
  • {@code time} – the time at which the message was posted
  • + *
  • {@code pt} – the cursor position, in screen coordinates, when the message was posted.
  • + *
+ * + *

Layout

+ * + *

+ * struct MSG {
+ *     HWND hwnd;
+ *     UINT message;
+ *     WPARAM wParam;
+ *     LPARAM lParam;
+ *     DWORD time;
+ *     {@link POINT POINT} pt;
+ * }
+ */ +public class MSG extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + HWND, + MESSAGE, + WPARAM, + LPARAM, + TIME, + PT; + + static { + Layout layout = __struct( + __member(POINTER_SIZE), + __member(4), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(4), + __member(POINT.SIZEOF, POINT.ALIGNOF) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + HWND = layout.offsetof(0); + MESSAGE = layout.offsetof(1); + WPARAM = layout.offsetof(2); + LPARAM = layout.offsetof(3); + TIME = layout.offsetof(4); + PT = layout.offsetof(5); + } + + /** + * Creates a {@code MSG} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public MSG(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code hwnd} field. */ + @NativeType("HWND") + public long hwnd() { return nhwnd(address()); } + /** Returns the value of the {@code message} field. */ + @NativeType("UINT") + public int message() { return nmessage(address()); } + /** Returns the value of the {@code wParam} field. */ + @NativeType("WPARAM") + public long wParam() { return nwParam(address()); } + /** Returns the value of the {@code lParam} field. */ + @NativeType("LPARAM") + public long lParam() { return nlParam(address()); } + /** Returns the value of the {@code time} field. */ + @NativeType("DWORD") + public int time() { return ntime(address()); } + /** Returns a {@link POINT} view of the {@code pt} field. */ + public POINT pt() { return npt(address()); } + + /** Sets the specified value to the {@code hwnd} field. */ + public MSG hwnd(@NativeType("HWND") long value) { nhwnd(address(), value); return this; } + /** Sets the specified value to the {@code message} field. */ + public MSG message(@NativeType("UINT") int value) { nmessage(address(), value); return this; } + /** Sets the specified value to the {@code wParam} field. */ + public MSG wParam(@NativeType("WPARAM") long value) { nwParam(address(), value); return this; } + /** Sets the specified value to the {@code lParam} field. */ + public MSG lParam(@NativeType("LPARAM") long value) { nlParam(address(), value); return this; } + /** Sets the specified value to the {@code time} field. */ + public MSG time(@NativeType("DWORD") int value) { ntime(address(), value); return this; } + /** Copies the specified {@link POINT} to the {@code pt} field. */ + public MSG pt(POINT value) { npt(address(), value); return this; } + /** Passes the {@code pt} field to the specified {@link java.util.function.Consumer Consumer}. */ + public MSG pt(java.util.function.Consumer consumer) { consumer.accept(pt()); return this; } + + /** Initializes this struct with the specified values. */ + public MSG set( + long hwnd, + int message, + long wParam, + long lParam, + int time, + POINT pt + ) { + hwnd(hwnd); + message(message); + wParam(wParam); + lParam(lParam); + time(time); + pt(pt); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public MSG set(MSG src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code MSG} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static MSG malloc() { + return wrap(MSG.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code MSG} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static MSG calloc() { + return wrap(MSG.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code MSG} instance allocated with {@link BufferUtils}. */ + public static MSG create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(MSG.class, memAddress(container), container); + } + + /** Returns a new {@code MSG} instance for the specified memory address. */ + public static MSG create(long address) { + return wrap(MSG.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static MSG createSafe(long address) { + return address == NULL ? null : wrap(MSG.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code MSG} instance allocated on the thread-local {@link MemoryStack}. */ + public static MSG mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code MSG} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static MSG callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code MSG} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static MSG mallocStack(MemoryStack stack) { + return wrap(MSG.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code MSG} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static MSG callocStack(MemoryStack stack) { + return wrap(MSG.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #hwnd}. */ + public static long nhwnd(long struct) { return memGetAddress(struct + MSG.HWND); } + /** Unsafe version of {@link #message}. */ + public static int nmessage(long struct) { return UNSAFE.getInt(null, struct + MSG.MESSAGE); } + /** Unsafe version of {@link #wParam}. */ + public static long nwParam(long struct) { return memGetAddress(struct + MSG.WPARAM); } + /** Unsafe version of {@link #lParam}. */ + public static long nlParam(long struct) { return memGetAddress(struct + MSG.LPARAM); } + /** Unsafe version of {@link #time}. */ + public static int ntime(long struct) { return UNSAFE.getInt(null, struct + MSG.TIME); } + /** Unsafe version of {@link #pt}. */ + public static POINT npt(long struct) { return POINT.create(struct + MSG.PT); } + + /** Unsafe version of {@link #hwnd(long) hwnd}. */ + public static void nhwnd(long struct, long value) { memPutAddress(struct + MSG.HWND, value); } + /** Unsafe version of {@link #message(int) message}. */ + public static void nmessage(long struct, int value) { UNSAFE.putInt(null, struct + MSG.MESSAGE, value); } + /** Unsafe version of {@link #wParam(long) wParam}. */ + public static void nwParam(long struct, long value) { memPutAddress(struct + MSG.WPARAM, value); } + /** Unsafe version of {@link #lParam(long) lParam}. */ + public static void nlParam(long struct, long value) { memPutAddress(struct + MSG.LPARAM, value); } + /** Unsafe version of {@link #time(int) time}. */ + public static void ntime(long struct, int value) { UNSAFE.putInt(null, struct + MSG.TIME, value); } + /** Unsafe version of {@link #pt(POINT) pt}. */ + public static void npt(long struct, POINT value) { memCopy(value.address(), struct + MSG.PT, POINT.SIZEOF); } + + // ----------------------------------- + + /** An array of {@link MSG} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final MSG ELEMENT_FACTORY = MSG.create(-1L); + + /** + * Creates a new {@code MSG.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link MSG#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected MSG getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code hwnd} field. */ + @NativeType("HWND") + public long hwnd() { return MSG.nhwnd(address()); } + /** Returns the value of the {@code message} field. */ + @NativeType("UINT") + public int message() { return MSG.nmessage(address()); } + /** Returns the value of the {@code wParam} field. */ + @NativeType("WPARAM") + public long wParam() { return MSG.nwParam(address()); } + /** Returns the value of the {@code lParam} field. */ + @NativeType("LPARAM") + public long lParam() { return MSG.nlParam(address()); } + /** Returns the value of the {@code time} field. */ + @NativeType("DWORD") + public int time() { return MSG.ntime(address()); } + /** Returns a {@link POINT} view of the {@code pt} field. */ + public POINT pt() { return MSG.npt(address()); } + + /** Sets the specified value to the {@code hwnd} field. */ + public Buffer hwnd(@NativeType("HWND") long value) { MSG.nhwnd(address(), value); return this; } + /** Sets the specified value to the {@code message} field. */ + public Buffer message(@NativeType("UINT") int value) { MSG.nmessage(address(), value); return this; } + /** Sets the specified value to the {@code wParam} field. */ + public Buffer wParam(@NativeType("WPARAM") long value) { MSG.nwParam(address(), value); return this; } + /** Sets the specified value to the {@code lParam} field. */ + public Buffer lParam(@NativeType("LPARAM") long value) { MSG.nlParam(address(), value); return this; } + /** Sets the specified value to the {@code time} field. */ + public Buffer time(@NativeType("DWORD") int value) { MSG.ntime(address(), value); return this; } + /** Copies the specified {@link POINT} to the {@code pt} field. */ + public Buffer pt(POINT value) { MSG.npt(address(), value); return this; } + /** Passes the {@code pt} field to the specified {@link java.util.function.Consumer Consumer}. */ + public Buffer pt(java.util.function.Consumer consumer) { consumer.accept(pt()); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/PIXELFORMATDESCRIPTOR.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/PIXELFORMATDESCRIPTOR.java new file mode 100644 index 00000000..586b0fe6 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/PIXELFORMATDESCRIPTOR.java @@ -0,0 +1,825 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.windows; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Describes the pixel format of a drawing surface. + * + *

Member documentation

+ * + *
    + *
  • {@code nSize} – specifies the size of this data structure. This value should be set to {@link #SIZEOF}.
  • + *
  • {@code nVersion} – specifies the version of this data structure. This value should be set to 1
  • + *
  • {@code dwFlags} – a set of bit flags that specify properties of the pixel buffer
  • + *
  • {@code iPixelType} – specifies the type of pixel data
  • + *
  • {@code cColorBits} – + * specifies the number of color bitplanes in each color buffer. For RGBA pixel types, it is the size of the color buffer, excluding the alpha bitplanes. + * For color-index pixels, it is the size of the color-index buffer.
  • + *
  • {@code cRedBits} – specifies the number of red bitplanes in each RGBA color buffer
  • + *
  • {@code cRedShift} – specifies the shift count for red bitplanes in each RGBA color buffer
  • + *
  • {@code cGreenBits} – specifies the number of green bitplanes in each RGBA color buffer
  • + *
  • {@code cGreenShift} – specifies the shift count for green bitplanes in each RGBA color buffer
  • + *
  • {@code cBlueBits} – specifies the number of blue bitplanes in each RGBA color buffer
  • + *
  • {@code cBlueShift} – specifies the shift count for blue bitplanes in each RGBA color buffer
  • + *
  • {@code cAlphaBits} – specifies the number of alpha bitplanes in each RGBA color buffer. Alpha bitplanes are not supported
  • + *
  • {@code cAlphaShift} – specifies the shift count for alpha bitplanes in each RGBA color buffer. Alpha bitplanes are not supported
  • + *
  • {@code cAccumBits} – specifies the total number of bitplanes in the accumulation buffer
  • + *
  • {@code cAccumRedBits} – specifies the number of red bitplanes in the accumulation buffer
  • + *
  • {@code cAccumGreenBits} – specifies the number of green bitplanes in the accumulation buffer
  • + *
  • {@code cAccumBlueBits} – specifies the number of blue bitplanes in the accumulation buffer
  • + *
  • {@code cAccumAlphaBits} – specifies the number of alpha bitplanes in the accumulation buffer
  • + *
  • {@code cDepthBits} – specifies the depth of the depth (z-axis) buffer
  • + *
  • {@code cStencilBits} – specifies the depth of the stencil buffer
  • + *
  • {@code cAuxBuffers} – specifies the number of auxiliary buffers. Auxiliary buffers are not supported
  • + *
  • {@code iLayerType} – Ignored. Earlier implementations of OpenGL used this member, but it is no longer used.
  • + *
  • {@code bReserved} – + * specifies the number of overlay and underlay planes. Bits 0 through 3 specify up to 15 overlay planes and bits 4 through 7 specify up to 15 underlay + * planes
  • + *
  • {@code dwLayerMask} – Ignored. Earlier implementations of OpenGL used this member, but it is no longer used.
  • + *
  • {@code dwVisibleMask} – + * specifies the transparent color or index of an underlay plane. When the pixel type is RGBA, {@code dwVisibleMask} is a transparent RGB color value. + * When the pixel type is color index, it is a transparent index value.
  • + *
  • {@code dwDamageMask} – Ignored. Earlier implementations of OpenGL used this member, but it is no longer used.
  • + *
+ * + *

Layout

+ * + *

+ * struct PIXELFORMATDESCRIPTOR {
+ *     WORD nSize;
+ *     WORD nVersion;
+ *     DWORD dwFlags;
+ *     BYTE iPixelType;
+ *     BYTE cColorBits;
+ *     BYTE cRedBits;
+ *     BYTE cRedShift;
+ *     BYTE cGreenBits;
+ *     BYTE cGreenShift;
+ *     BYTE cBlueBits;
+ *     BYTE cBlueShift;
+ *     BYTE cAlphaBits;
+ *     BYTE cAlphaShift;
+ *     BYTE cAccumBits;
+ *     BYTE cAccumRedBits;
+ *     BYTE cAccumGreenBits;
+ *     BYTE cAccumBlueBits;
+ *     BYTE cAccumAlphaBits;
+ *     BYTE cDepthBits;
+ *     BYTE cStencilBits;
+ *     BYTE cAuxBuffers;
+ *     BYTE iLayerType;
+ *     BYTE bReserved;
+ *     DWORD dwLayerMask;
+ *     DWORD dwVisibleMask;
+ *     DWORD dwDamageMask;
+ * }
+ */ +public class PIXELFORMATDESCRIPTOR extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + NSIZE, + NVERSION, + DWFLAGS, + IPIXELTYPE, + CCOLORBITS, + CREDBITS, + CREDSHIFT, + CGREENBITS, + CGREENSHIFT, + CBLUEBITS, + CBLUESHIFT, + CALPHABITS, + CALPHASHIFT, + CACCUMBITS, + CACCUMREDBITS, + CACCUMGREENBITS, + CACCUMBLUEBITS, + CACCUMALPHABITS, + CDEPTHBITS, + CSTENCILBITS, + CAUXBUFFERS, + ILAYERTYPE, + BRESERVED, + DWLAYERMASK, + DWVISIBLEMASK, + DWDAMAGEMASK; + + static { + Layout layout = __struct( + __member(2), + __member(2), + __member(4), + __member(1), + __member(1), + __member(1), + __member(1), + __member(1), + __member(1), + __member(1), + __member(1), + __member(1), + __member(1), + __member(1), + __member(1), + __member(1), + __member(1), + __member(1), + __member(1), + __member(1), + __member(1), + __member(1), + __member(1), + __member(4), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + NSIZE = layout.offsetof(0); + NVERSION = layout.offsetof(1); + DWFLAGS = layout.offsetof(2); + IPIXELTYPE = layout.offsetof(3); + CCOLORBITS = layout.offsetof(4); + CREDBITS = layout.offsetof(5); + CREDSHIFT = layout.offsetof(6); + CGREENBITS = layout.offsetof(7); + CGREENSHIFT = layout.offsetof(8); + CBLUEBITS = layout.offsetof(9); + CBLUESHIFT = layout.offsetof(10); + CALPHABITS = layout.offsetof(11); + CALPHASHIFT = layout.offsetof(12); + CACCUMBITS = layout.offsetof(13); + CACCUMREDBITS = layout.offsetof(14); + CACCUMGREENBITS = layout.offsetof(15); + CACCUMBLUEBITS = layout.offsetof(16); + CACCUMALPHABITS = layout.offsetof(17); + CDEPTHBITS = layout.offsetof(18); + CSTENCILBITS = layout.offsetof(19); + CAUXBUFFERS = layout.offsetof(20); + ILAYERTYPE = layout.offsetof(21); + BRESERVED = layout.offsetof(22); + DWLAYERMASK = layout.offsetof(23); + DWVISIBLEMASK = layout.offsetof(24); + DWDAMAGEMASK = layout.offsetof(25); + } + + /** + * Creates a {@code PIXELFORMATDESCRIPTOR} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public PIXELFORMATDESCRIPTOR(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code nSize} field. */ + @NativeType("WORD") + public short nSize() { return nnSize(address()); } + /** Returns the value of the {@code nVersion} field. */ + @NativeType("WORD") + public short nVersion() { return nnVersion(address()); } + /** Returns the value of the {@code dwFlags} field. */ + @NativeType("DWORD") + public int dwFlags() { return ndwFlags(address()); } + /** Returns the value of the {@code iPixelType} field. */ + @NativeType("BYTE") + public byte iPixelType() { return niPixelType(address()); } + /** Returns the value of the {@code cColorBits} field. */ + @NativeType("BYTE") + public byte cColorBits() { return ncColorBits(address()); } + /** Returns the value of the {@code cRedBits} field. */ + @NativeType("BYTE") + public byte cRedBits() { return ncRedBits(address()); } + /** Returns the value of the {@code cRedShift} field. */ + @NativeType("BYTE") + public byte cRedShift() { return ncRedShift(address()); } + /** Returns the value of the {@code cGreenBits} field. */ + @NativeType("BYTE") + public byte cGreenBits() { return ncGreenBits(address()); } + /** Returns the value of the {@code cGreenShift} field. */ + @NativeType("BYTE") + public byte cGreenShift() { return ncGreenShift(address()); } + /** Returns the value of the {@code cBlueBits} field. */ + @NativeType("BYTE") + public byte cBlueBits() { return ncBlueBits(address()); } + /** Returns the value of the {@code cBlueShift} field. */ + @NativeType("BYTE") + public byte cBlueShift() { return ncBlueShift(address()); } + /** Returns the value of the {@code cAlphaBits} field. */ + @NativeType("BYTE") + public byte cAlphaBits() { return ncAlphaBits(address()); } + /** Returns the value of the {@code cAlphaShift} field. */ + @NativeType("BYTE") + public byte cAlphaShift() { return ncAlphaShift(address()); } + /** Returns the value of the {@code cAccumBits} field. */ + @NativeType("BYTE") + public byte cAccumBits() { return ncAccumBits(address()); } + /** Returns the value of the {@code cAccumRedBits} field. */ + @NativeType("BYTE") + public byte cAccumRedBits() { return ncAccumRedBits(address()); } + /** Returns the value of the {@code cAccumGreenBits} field. */ + @NativeType("BYTE") + public byte cAccumGreenBits() { return ncAccumGreenBits(address()); } + /** Returns the value of the {@code cAccumBlueBits} field. */ + @NativeType("BYTE") + public byte cAccumBlueBits() { return ncAccumBlueBits(address()); } + /** Returns the value of the {@code cAccumAlphaBits} field. */ + @NativeType("BYTE") + public byte cAccumAlphaBits() { return ncAccumAlphaBits(address()); } + /** Returns the value of the {@code cDepthBits} field. */ + @NativeType("BYTE") + public byte cDepthBits() { return ncDepthBits(address()); } + /** Returns the value of the {@code cStencilBits} field. */ + @NativeType("BYTE") + public byte cStencilBits() { return ncStencilBits(address()); } + /** Returns the value of the {@code cAuxBuffers} field. */ + @NativeType("BYTE") + public byte cAuxBuffers() { return ncAuxBuffers(address()); } + /** Returns the value of the {@code iLayerType} field. */ + @NativeType("BYTE") + public byte iLayerType() { return niLayerType(address()); } + /** Returns the value of the {@code bReserved} field. */ + @NativeType("BYTE") + public byte bReserved() { return nbReserved(address()); } + /** Returns the value of the {@code dwLayerMask} field. */ + @NativeType("DWORD") + public int dwLayerMask() { return ndwLayerMask(address()); } + /** Returns the value of the {@code dwVisibleMask} field. */ + @NativeType("DWORD") + public int dwVisibleMask() { return ndwVisibleMask(address()); } + /** Returns the value of the {@code dwDamageMask} field. */ + @NativeType("DWORD") + public int dwDamageMask() { return ndwDamageMask(address()); } + + /** Sets the specified value to the {@code nSize} field. */ + public PIXELFORMATDESCRIPTOR nSize(@NativeType("WORD") short value) { nnSize(address(), value); return this; } + /** Sets the specified value to the {@code nVersion} field. */ + public PIXELFORMATDESCRIPTOR nVersion(@NativeType("WORD") short value) { nnVersion(address(), value); return this; } + /** Sets the specified value to the {@code dwFlags} field. */ + public PIXELFORMATDESCRIPTOR dwFlags(@NativeType("DWORD") int value) { ndwFlags(address(), value); return this; } + /** Sets the specified value to the {@code iPixelType} field. */ + public PIXELFORMATDESCRIPTOR iPixelType(@NativeType("BYTE") byte value) { niPixelType(address(), value); return this; } + /** Sets the specified value to the {@code cColorBits} field. */ + public PIXELFORMATDESCRIPTOR cColorBits(@NativeType("BYTE") byte value) { ncColorBits(address(), value); return this; } + /** Sets the specified value to the {@code cRedBits} field. */ + public PIXELFORMATDESCRIPTOR cRedBits(@NativeType("BYTE") byte value) { ncRedBits(address(), value); return this; } + /** Sets the specified value to the {@code cRedShift} field. */ + public PIXELFORMATDESCRIPTOR cRedShift(@NativeType("BYTE") byte value) { ncRedShift(address(), value); return this; } + /** Sets the specified value to the {@code cGreenBits} field. */ + public PIXELFORMATDESCRIPTOR cGreenBits(@NativeType("BYTE") byte value) { ncGreenBits(address(), value); return this; } + /** Sets the specified value to the {@code cGreenShift} field. */ + public PIXELFORMATDESCRIPTOR cGreenShift(@NativeType("BYTE") byte value) { ncGreenShift(address(), value); return this; } + /** Sets the specified value to the {@code cBlueBits} field. */ + public PIXELFORMATDESCRIPTOR cBlueBits(@NativeType("BYTE") byte value) { ncBlueBits(address(), value); return this; } + /** Sets the specified value to the {@code cBlueShift} field. */ + public PIXELFORMATDESCRIPTOR cBlueShift(@NativeType("BYTE") byte value) { ncBlueShift(address(), value); return this; } + /** Sets the specified value to the {@code cAlphaBits} field. */ + public PIXELFORMATDESCRIPTOR cAlphaBits(@NativeType("BYTE") byte value) { ncAlphaBits(address(), value); return this; } + /** Sets the specified value to the {@code cAlphaShift} field. */ + public PIXELFORMATDESCRIPTOR cAlphaShift(@NativeType("BYTE") byte value) { ncAlphaShift(address(), value); return this; } + /** Sets the specified value to the {@code cAccumBits} field. */ + public PIXELFORMATDESCRIPTOR cAccumBits(@NativeType("BYTE") byte value) { ncAccumBits(address(), value); return this; } + /** Sets the specified value to the {@code cAccumRedBits} field. */ + public PIXELFORMATDESCRIPTOR cAccumRedBits(@NativeType("BYTE") byte value) { ncAccumRedBits(address(), value); return this; } + /** Sets the specified value to the {@code cAccumGreenBits} field. */ + public PIXELFORMATDESCRIPTOR cAccumGreenBits(@NativeType("BYTE") byte value) { ncAccumGreenBits(address(), value); return this; } + /** Sets the specified value to the {@code cAccumBlueBits} field. */ + public PIXELFORMATDESCRIPTOR cAccumBlueBits(@NativeType("BYTE") byte value) { ncAccumBlueBits(address(), value); return this; } + /** Sets the specified value to the {@code cAccumAlphaBits} field. */ + public PIXELFORMATDESCRIPTOR cAccumAlphaBits(@NativeType("BYTE") byte value) { ncAccumAlphaBits(address(), value); return this; } + /** Sets the specified value to the {@code cDepthBits} field. */ + public PIXELFORMATDESCRIPTOR cDepthBits(@NativeType("BYTE") byte value) { ncDepthBits(address(), value); return this; } + /** Sets the specified value to the {@code cStencilBits} field. */ + public PIXELFORMATDESCRIPTOR cStencilBits(@NativeType("BYTE") byte value) { ncStencilBits(address(), value); return this; } + /** Sets the specified value to the {@code cAuxBuffers} field. */ + public PIXELFORMATDESCRIPTOR cAuxBuffers(@NativeType("BYTE") byte value) { ncAuxBuffers(address(), value); return this; } + /** Sets the specified value to the {@code iLayerType} field. */ + public PIXELFORMATDESCRIPTOR iLayerType(@NativeType("BYTE") byte value) { niLayerType(address(), value); return this; } + /** Sets the specified value to the {@code bReserved} field. */ + public PIXELFORMATDESCRIPTOR bReserved(@NativeType("BYTE") byte value) { nbReserved(address(), value); return this; } + /** Sets the specified value to the {@code dwLayerMask} field. */ + public PIXELFORMATDESCRIPTOR dwLayerMask(@NativeType("DWORD") int value) { ndwLayerMask(address(), value); return this; } + /** Sets the specified value to the {@code dwVisibleMask} field. */ + public PIXELFORMATDESCRIPTOR dwVisibleMask(@NativeType("DWORD") int value) { ndwVisibleMask(address(), value); return this; } + /** Sets the specified value to the {@code dwDamageMask} field. */ + public PIXELFORMATDESCRIPTOR dwDamageMask(@NativeType("DWORD") int value) { ndwDamageMask(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public PIXELFORMATDESCRIPTOR set( + short nSize, + short nVersion, + int dwFlags, + byte iPixelType, + byte cColorBits, + byte cRedBits, + byte cRedShift, + byte cGreenBits, + byte cGreenShift, + byte cBlueBits, + byte cBlueShift, + byte cAlphaBits, + byte cAlphaShift, + byte cAccumBits, + byte cAccumRedBits, + byte cAccumGreenBits, + byte cAccumBlueBits, + byte cAccumAlphaBits, + byte cDepthBits, + byte cStencilBits, + byte cAuxBuffers, + byte iLayerType, + byte bReserved, + int dwLayerMask, + int dwVisibleMask, + int dwDamageMask + ) { + nSize(nSize); + nVersion(nVersion); + dwFlags(dwFlags); + iPixelType(iPixelType); + cColorBits(cColorBits); + cRedBits(cRedBits); + cRedShift(cRedShift); + cGreenBits(cGreenBits); + cGreenShift(cGreenShift); + cBlueBits(cBlueBits); + cBlueShift(cBlueShift); + cAlphaBits(cAlphaBits); + cAlphaShift(cAlphaShift); + cAccumBits(cAccumBits); + cAccumRedBits(cAccumRedBits); + cAccumGreenBits(cAccumGreenBits); + cAccumBlueBits(cAccumBlueBits); + cAccumAlphaBits(cAccumAlphaBits); + cDepthBits(cDepthBits); + cStencilBits(cStencilBits); + cAuxBuffers(cAuxBuffers); + iLayerType(iLayerType); + bReserved(bReserved); + dwLayerMask(dwLayerMask); + dwVisibleMask(dwVisibleMask); + dwDamageMask(dwDamageMask); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public PIXELFORMATDESCRIPTOR set(PIXELFORMATDESCRIPTOR src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code PIXELFORMATDESCRIPTOR} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static PIXELFORMATDESCRIPTOR malloc() { + return wrap(PIXELFORMATDESCRIPTOR.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code PIXELFORMATDESCRIPTOR} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static PIXELFORMATDESCRIPTOR calloc() { + return wrap(PIXELFORMATDESCRIPTOR.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code PIXELFORMATDESCRIPTOR} instance allocated with {@link BufferUtils}. */ + public static PIXELFORMATDESCRIPTOR create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(PIXELFORMATDESCRIPTOR.class, memAddress(container), container); + } + + /** Returns a new {@code PIXELFORMATDESCRIPTOR} instance for the specified memory address. */ + public static PIXELFORMATDESCRIPTOR create(long address) { + return wrap(PIXELFORMATDESCRIPTOR.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static PIXELFORMATDESCRIPTOR createSafe(long address) { + return address == NULL ? null : wrap(PIXELFORMATDESCRIPTOR.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code PIXELFORMATDESCRIPTOR} instance allocated on the thread-local {@link MemoryStack}. */ + public static PIXELFORMATDESCRIPTOR mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code PIXELFORMATDESCRIPTOR} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static PIXELFORMATDESCRIPTOR callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code PIXELFORMATDESCRIPTOR} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static PIXELFORMATDESCRIPTOR mallocStack(MemoryStack stack) { + return wrap(PIXELFORMATDESCRIPTOR.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code PIXELFORMATDESCRIPTOR} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static PIXELFORMATDESCRIPTOR callocStack(MemoryStack stack) { + return wrap(PIXELFORMATDESCRIPTOR.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #nSize}. */ + public static short nnSize(long struct) { return UNSAFE.getShort(null, struct + PIXELFORMATDESCRIPTOR.NSIZE); } + /** Unsafe version of {@link #nVersion}. */ + public static short nnVersion(long struct) { return UNSAFE.getShort(null, struct + PIXELFORMATDESCRIPTOR.NVERSION); } + /** Unsafe version of {@link #dwFlags}. */ + public static int ndwFlags(long struct) { return UNSAFE.getInt(null, struct + PIXELFORMATDESCRIPTOR.DWFLAGS); } + /** Unsafe version of {@link #iPixelType}. */ + public static byte niPixelType(long struct) { return UNSAFE.getByte(null, struct + PIXELFORMATDESCRIPTOR.IPIXELTYPE); } + /** Unsafe version of {@link #cColorBits}. */ + public static byte ncColorBits(long struct) { return UNSAFE.getByte(null, struct + PIXELFORMATDESCRIPTOR.CCOLORBITS); } + /** Unsafe version of {@link #cRedBits}. */ + public static byte ncRedBits(long struct) { return UNSAFE.getByte(null, struct + PIXELFORMATDESCRIPTOR.CREDBITS); } + /** Unsafe version of {@link #cRedShift}. */ + public static byte ncRedShift(long struct) { return UNSAFE.getByte(null, struct + PIXELFORMATDESCRIPTOR.CREDSHIFT); } + /** Unsafe version of {@link #cGreenBits}. */ + public static byte ncGreenBits(long struct) { return UNSAFE.getByte(null, struct + PIXELFORMATDESCRIPTOR.CGREENBITS); } + /** Unsafe version of {@link #cGreenShift}. */ + public static byte ncGreenShift(long struct) { return UNSAFE.getByte(null, struct + PIXELFORMATDESCRIPTOR.CGREENSHIFT); } + /** Unsafe version of {@link #cBlueBits}. */ + public static byte ncBlueBits(long struct) { return UNSAFE.getByte(null, struct + PIXELFORMATDESCRIPTOR.CBLUEBITS); } + /** Unsafe version of {@link #cBlueShift}. */ + public static byte ncBlueShift(long struct) { return UNSAFE.getByte(null, struct + PIXELFORMATDESCRIPTOR.CBLUESHIFT); } + /** Unsafe version of {@link #cAlphaBits}. */ + public static byte ncAlphaBits(long struct) { return UNSAFE.getByte(null, struct + PIXELFORMATDESCRIPTOR.CALPHABITS); } + /** Unsafe version of {@link #cAlphaShift}. */ + public static byte ncAlphaShift(long struct) { return UNSAFE.getByte(null, struct + PIXELFORMATDESCRIPTOR.CALPHASHIFT); } + /** Unsafe version of {@link #cAccumBits}. */ + public static byte ncAccumBits(long struct) { return UNSAFE.getByte(null, struct + PIXELFORMATDESCRIPTOR.CACCUMBITS); } + /** Unsafe version of {@link #cAccumRedBits}. */ + public static byte ncAccumRedBits(long struct) { return UNSAFE.getByte(null, struct + PIXELFORMATDESCRIPTOR.CACCUMREDBITS); } + /** Unsafe version of {@link #cAccumGreenBits}. */ + public static byte ncAccumGreenBits(long struct) { return UNSAFE.getByte(null, struct + PIXELFORMATDESCRIPTOR.CACCUMGREENBITS); } + /** Unsafe version of {@link #cAccumBlueBits}. */ + public static byte ncAccumBlueBits(long struct) { return UNSAFE.getByte(null, struct + PIXELFORMATDESCRIPTOR.CACCUMBLUEBITS); } + /** Unsafe version of {@link #cAccumAlphaBits}. */ + public static byte ncAccumAlphaBits(long struct) { return UNSAFE.getByte(null, struct + PIXELFORMATDESCRIPTOR.CACCUMALPHABITS); } + /** Unsafe version of {@link #cDepthBits}. */ + public static byte ncDepthBits(long struct) { return UNSAFE.getByte(null, struct + PIXELFORMATDESCRIPTOR.CDEPTHBITS); } + /** Unsafe version of {@link #cStencilBits}. */ + public static byte ncStencilBits(long struct) { return UNSAFE.getByte(null, struct + PIXELFORMATDESCRIPTOR.CSTENCILBITS); } + /** Unsafe version of {@link #cAuxBuffers}. */ + public static byte ncAuxBuffers(long struct) { return UNSAFE.getByte(null, struct + PIXELFORMATDESCRIPTOR.CAUXBUFFERS); } + /** Unsafe version of {@link #iLayerType}. */ + public static byte niLayerType(long struct) { return UNSAFE.getByte(null, struct + PIXELFORMATDESCRIPTOR.ILAYERTYPE); } + /** Unsafe version of {@link #bReserved}. */ + public static byte nbReserved(long struct) { return UNSAFE.getByte(null, struct + PIXELFORMATDESCRIPTOR.BRESERVED); } + /** Unsafe version of {@link #dwLayerMask}. */ + public static int ndwLayerMask(long struct) { return UNSAFE.getInt(null, struct + PIXELFORMATDESCRIPTOR.DWLAYERMASK); } + /** Unsafe version of {@link #dwVisibleMask}. */ + public static int ndwVisibleMask(long struct) { return UNSAFE.getInt(null, struct + PIXELFORMATDESCRIPTOR.DWVISIBLEMASK); } + /** Unsafe version of {@link #dwDamageMask}. */ + public static int ndwDamageMask(long struct) { return UNSAFE.getInt(null, struct + PIXELFORMATDESCRIPTOR.DWDAMAGEMASK); } + + /** Unsafe version of {@link #nSize(short) nSize}. */ + public static void nnSize(long struct, short value) { UNSAFE.putShort(null, struct + PIXELFORMATDESCRIPTOR.NSIZE, value); } + /** Unsafe version of {@link #nVersion(short) nVersion}. */ + public static void nnVersion(long struct, short value) { UNSAFE.putShort(null, struct + PIXELFORMATDESCRIPTOR.NVERSION, value); } + /** Unsafe version of {@link #dwFlags(int) dwFlags}. */ + public static void ndwFlags(long struct, int value) { UNSAFE.putInt(null, struct + PIXELFORMATDESCRIPTOR.DWFLAGS, value); } + /** Unsafe version of {@link #iPixelType(byte) iPixelType}. */ + public static void niPixelType(long struct, byte value) { UNSAFE.putByte(null, struct + PIXELFORMATDESCRIPTOR.IPIXELTYPE, value); } + /** Unsafe version of {@link #cColorBits(byte) cColorBits}. */ + public static void ncColorBits(long struct, byte value) { UNSAFE.putByte(null, struct + PIXELFORMATDESCRIPTOR.CCOLORBITS, value); } + /** Unsafe version of {@link #cRedBits(byte) cRedBits}. */ + public static void ncRedBits(long struct, byte value) { UNSAFE.putByte(null, struct + PIXELFORMATDESCRIPTOR.CREDBITS, value); } + /** Unsafe version of {@link #cRedShift(byte) cRedShift}. */ + public static void ncRedShift(long struct, byte value) { UNSAFE.putByte(null, struct + PIXELFORMATDESCRIPTOR.CREDSHIFT, value); } + /** Unsafe version of {@link #cGreenBits(byte) cGreenBits}. */ + public static void ncGreenBits(long struct, byte value) { UNSAFE.putByte(null, struct + PIXELFORMATDESCRIPTOR.CGREENBITS, value); } + /** Unsafe version of {@link #cGreenShift(byte) cGreenShift}. */ + public static void ncGreenShift(long struct, byte value) { UNSAFE.putByte(null, struct + PIXELFORMATDESCRIPTOR.CGREENSHIFT, value); } + /** Unsafe version of {@link #cBlueBits(byte) cBlueBits}. */ + public static void ncBlueBits(long struct, byte value) { UNSAFE.putByte(null, struct + PIXELFORMATDESCRIPTOR.CBLUEBITS, value); } + /** Unsafe version of {@link #cBlueShift(byte) cBlueShift}. */ + public static void ncBlueShift(long struct, byte value) { UNSAFE.putByte(null, struct + PIXELFORMATDESCRIPTOR.CBLUESHIFT, value); } + /** Unsafe version of {@link #cAlphaBits(byte) cAlphaBits}. */ + public static void ncAlphaBits(long struct, byte value) { UNSAFE.putByte(null, struct + PIXELFORMATDESCRIPTOR.CALPHABITS, value); } + /** Unsafe version of {@link #cAlphaShift(byte) cAlphaShift}. */ + public static void ncAlphaShift(long struct, byte value) { UNSAFE.putByte(null, struct + PIXELFORMATDESCRIPTOR.CALPHASHIFT, value); } + /** Unsafe version of {@link #cAccumBits(byte) cAccumBits}. */ + public static void ncAccumBits(long struct, byte value) { UNSAFE.putByte(null, struct + PIXELFORMATDESCRIPTOR.CACCUMBITS, value); } + /** Unsafe version of {@link #cAccumRedBits(byte) cAccumRedBits}. */ + public static void ncAccumRedBits(long struct, byte value) { UNSAFE.putByte(null, struct + PIXELFORMATDESCRIPTOR.CACCUMREDBITS, value); } + /** Unsafe version of {@link #cAccumGreenBits(byte) cAccumGreenBits}. */ + public static void ncAccumGreenBits(long struct, byte value) { UNSAFE.putByte(null, struct + PIXELFORMATDESCRIPTOR.CACCUMGREENBITS, value); } + /** Unsafe version of {@link #cAccumBlueBits(byte) cAccumBlueBits}. */ + public static void ncAccumBlueBits(long struct, byte value) { UNSAFE.putByte(null, struct + PIXELFORMATDESCRIPTOR.CACCUMBLUEBITS, value); } + /** Unsafe version of {@link #cAccumAlphaBits(byte) cAccumAlphaBits}. */ + public static void ncAccumAlphaBits(long struct, byte value) { UNSAFE.putByte(null, struct + PIXELFORMATDESCRIPTOR.CACCUMALPHABITS, value); } + /** Unsafe version of {@link #cDepthBits(byte) cDepthBits}. */ + public static void ncDepthBits(long struct, byte value) { UNSAFE.putByte(null, struct + PIXELFORMATDESCRIPTOR.CDEPTHBITS, value); } + /** Unsafe version of {@link #cStencilBits(byte) cStencilBits}. */ + public static void ncStencilBits(long struct, byte value) { UNSAFE.putByte(null, struct + PIXELFORMATDESCRIPTOR.CSTENCILBITS, value); } + /** Unsafe version of {@link #cAuxBuffers(byte) cAuxBuffers}. */ + public static void ncAuxBuffers(long struct, byte value) { UNSAFE.putByte(null, struct + PIXELFORMATDESCRIPTOR.CAUXBUFFERS, value); } + /** Unsafe version of {@link #iLayerType(byte) iLayerType}. */ + public static void niLayerType(long struct, byte value) { UNSAFE.putByte(null, struct + PIXELFORMATDESCRIPTOR.ILAYERTYPE, value); } + /** Unsafe version of {@link #bReserved(byte) bReserved}. */ + public static void nbReserved(long struct, byte value) { UNSAFE.putByte(null, struct + PIXELFORMATDESCRIPTOR.BRESERVED, value); } + /** Unsafe version of {@link #dwLayerMask(int) dwLayerMask}. */ + public static void ndwLayerMask(long struct, int value) { UNSAFE.putInt(null, struct + PIXELFORMATDESCRIPTOR.DWLAYERMASK, value); } + /** Unsafe version of {@link #dwVisibleMask(int) dwVisibleMask}. */ + public static void ndwVisibleMask(long struct, int value) { UNSAFE.putInt(null, struct + PIXELFORMATDESCRIPTOR.DWVISIBLEMASK, value); } + /** Unsafe version of {@link #dwDamageMask(int) dwDamageMask}. */ + public static void ndwDamageMask(long struct, int value) { UNSAFE.putInt(null, struct + PIXELFORMATDESCRIPTOR.DWDAMAGEMASK, value); } + + // ----------------------------------- + + /** An array of {@link PIXELFORMATDESCRIPTOR} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final PIXELFORMATDESCRIPTOR ELEMENT_FACTORY = PIXELFORMATDESCRIPTOR.create(-1L); + + /** + * Creates a new {@code PIXELFORMATDESCRIPTOR.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link PIXELFORMATDESCRIPTOR#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected PIXELFORMATDESCRIPTOR getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code nSize} field. */ + @NativeType("WORD") + public short nSize() { return PIXELFORMATDESCRIPTOR.nnSize(address()); } + /** Returns the value of the {@code nVersion} field. */ + @NativeType("WORD") + public short nVersion() { return PIXELFORMATDESCRIPTOR.nnVersion(address()); } + /** Returns the value of the {@code dwFlags} field. */ + @NativeType("DWORD") + public int dwFlags() { return PIXELFORMATDESCRIPTOR.ndwFlags(address()); } + /** Returns the value of the {@code iPixelType} field. */ + @NativeType("BYTE") + public byte iPixelType() { return PIXELFORMATDESCRIPTOR.niPixelType(address()); } + /** Returns the value of the {@code cColorBits} field. */ + @NativeType("BYTE") + public byte cColorBits() { return PIXELFORMATDESCRIPTOR.ncColorBits(address()); } + /** Returns the value of the {@code cRedBits} field. */ + @NativeType("BYTE") + public byte cRedBits() { return PIXELFORMATDESCRIPTOR.ncRedBits(address()); } + /** Returns the value of the {@code cRedShift} field. */ + @NativeType("BYTE") + public byte cRedShift() { return PIXELFORMATDESCRIPTOR.ncRedShift(address()); } + /** Returns the value of the {@code cGreenBits} field. */ + @NativeType("BYTE") + public byte cGreenBits() { return PIXELFORMATDESCRIPTOR.ncGreenBits(address()); } + /** Returns the value of the {@code cGreenShift} field. */ + @NativeType("BYTE") + public byte cGreenShift() { return PIXELFORMATDESCRIPTOR.ncGreenShift(address()); } + /** Returns the value of the {@code cBlueBits} field. */ + @NativeType("BYTE") + public byte cBlueBits() { return PIXELFORMATDESCRIPTOR.ncBlueBits(address()); } + /** Returns the value of the {@code cBlueShift} field. */ + @NativeType("BYTE") + public byte cBlueShift() { return PIXELFORMATDESCRIPTOR.ncBlueShift(address()); } + /** Returns the value of the {@code cAlphaBits} field. */ + @NativeType("BYTE") + public byte cAlphaBits() { return PIXELFORMATDESCRIPTOR.ncAlphaBits(address()); } + /** Returns the value of the {@code cAlphaShift} field. */ + @NativeType("BYTE") + public byte cAlphaShift() { return PIXELFORMATDESCRIPTOR.ncAlphaShift(address()); } + /** Returns the value of the {@code cAccumBits} field. */ + @NativeType("BYTE") + public byte cAccumBits() { return PIXELFORMATDESCRIPTOR.ncAccumBits(address()); } + /** Returns the value of the {@code cAccumRedBits} field. */ + @NativeType("BYTE") + public byte cAccumRedBits() { return PIXELFORMATDESCRIPTOR.ncAccumRedBits(address()); } + /** Returns the value of the {@code cAccumGreenBits} field. */ + @NativeType("BYTE") + public byte cAccumGreenBits() { return PIXELFORMATDESCRIPTOR.ncAccumGreenBits(address()); } + /** Returns the value of the {@code cAccumBlueBits} field. */ + @NativeType("BYTE") + public byte cAccumBlueBits() { return PIXELFORMATDESCRIPTOR.ncAccumBlueBits(address()); } + /** Returns the value of the {@code cAccumAlphaBits} field. */ + @NativeType("BYTE") + public byte cAccumAlphaBits() { return PIXELFORMATDESCRIPTOR.ncAccumAlphaBits(address()); } + /** Returns the value of the {@code cDepthBits} field. */ + @NativeType("BYTE") + public byte cDepthBits() { return PIXELFORMATDESCRIPTOR.ncDepthBits(address()); } + /** Returns the value of the {@code cStencilBits} field. */ + @NativeType("BYTE") + public byte cStencilBits() { return PIXELFORMATDESCRIPTOR.ncStencilBits(address()); } + /** Returns the value of the {@code cAuxBuffers} field. */ + @NativeType("BYTE") + public byte cAuxBuffers() { return PIXELFORMATDESCRIPTOR.ncAuxBuffers(address()); } + /** Returns the value of the {@code iLayerType} field. */ + @NativeType("BYTE") + public byte iLayerType() { return PIXELFORMATDESCRIPTOR.niLayerType(address()); } + /** Returns the value of the {@code bReserved} field. */ + @NativeType("BYTE") + public byte bReserved() { return PIXELFORMATDESCRIPTOR.nbReserved(address()); } + /** Returns the value of the {@code dwLayerMask} field. */ + @NativeType("DWORD") + public int dwLayerMask() { return PIXELFORMATDESCRIPTOR.ndwLayerMask(address()); } + /** Returns the value of the {@code dwVisibleMask} field. */ + @NativeType("DWORD") + public int dwVisibleMask() { return PIXELFORMATDESCRIPTOR.ndwVisibleMask(address()); } + /** Returns the value of the {@code dwDamageMask} field. */ + @NativeType("DWORD") + public int dwDamageMask() { return PIXELFORMATDESCRIPTOR.ndwDamageMask(address()); } + + /** Sets the specified value to the {@code nSize} field. */ + public Buffer nSize(@NativeType("WORD") short value) { PIXELFORMATDESCRIPTOR.nnSize(address(), value); return this; } + /** Sets the specified value to the {@code nVersion} field. */ + public Buffer nVersion(@NativeType("WORD") short value) { PIXELFORMATDESCRIPTOR.nnVersion(address(), value); return this; } + /** Sets the specified value to the {@code dwFlags} field. */ + public Buffer dwFlags(@NativeType("DWORD") int value) { PIXELFORMATDESCRIPTOR.ndwFlags(address(), value); return this; } + /** Sets the specified value to the {@code iPixelType} field. */ + public Buffer iPixelType(@NativeType("BYTE") byte value) { PIXELFORMATDESCRIPTOR.niPixelType(address(), value); return this; } + /** Sets the specified value to the {@code cColorBits} field. */ + public Buffer cColorBits(@NativeType("BYTE") byte value) { PIXELFORMATDESCRIPTOR.ncColorBits(address(), value); return this; } + /** Sets the specified value to the {@code cRedBits} field. */ + public Buffer cRedBits(@NativeType("BYTE") byte value) { PIXELFORMATDESCRIPTOR.ncRedBits(address(), value); return this; } + /** Sets the specified value to the {@code cRedShift} field. */ + public Buffer cRedShift(@NativeType("BYTE") byte value) { PIXELFORMATDESCRIPTOR.ncRedShift(address(), value); return this; } + /** Sets the specified value to the {@code cGreenBits} field. */ + public Buffer cGreenBits(@NativeType("BYTE") byte value) { PIXELFORMATDESCRIPTOR.ncGreenBits(address(), value); return this; } + /** Sets the specified value to the {@code cGreenShift} field. */ + public Buffer cGreenShift(@NativeType("BYTE") byte value) { PIXELFORMATDESCRIPTOR.ncGreenShift(address(), value); return this; } + /** Sets the specified value to the {@code cBlueBits} field. */ + public Buffer cBlueBits(@NativeType("BYTE") byte value) { PIXELFORMATDESCRIPTOR.ncBlueBits(address(), value); return this; } + /** Sets the specified value to the {@code cBlueShift} field. */ + public Buffer cBlueShift(@NativeType("BYTE") byte value) { PIXELFORMATDESCRIPTOR.ncBlueShift(address(), value); return this; } + /** Sets the specified value to the {@code cAlphaBits} field. */ + public Buffer cAlphaBits(@NativeType("BYTE") byte value) { PIXELFORMATDESCRIPTOR.ncAlphaBits(address(), value); return this; } + /** Sets the specified value to the {@code cAlphaShift} field. */ + public Buffer cAlphaShift(@NativeType("BYTE") byte value) { PIXELFORMATDESCRIPTOR.ncAlphaShift(address(), value); return this; } + /** Sets the specified value to the {@code cAccumBits} field. */ + public Buffer cAccumBits(@NativeType("BYTE") byte value) { PIXELFORMATDESCRIPTOR.ncAccumBits(address(), value); return this; } + /** Sets the specified value to the {@code cAccumRedBits} field. */ + public Buffer cAccumRedBits(@NativeType("BYTE") byte value) { PIXELFORMATDESCRIPTOR.ncAccumRedBits(address(), value); return this; } + /** Sets the specified value to the {@code cAccumGreenBits} field. */ + public Buffer cAccumGreenBits(@NativeType("BYTE") byte value) { PIXELFORMATDESCRIPTOR.ncAccumGreenBits(address(), value); return this; } + /** Sets the specified value to the {@code cAccumBlueBits} field. */ + public Buffer cAccumBlueBits(@NativeType("BYTE") byte value) { PIXELFORMATDESCRIPTOR.ncAccumBlueBits(address(), value); return this; } + /** Sets the specified value to the {@code cAccumAlphaBits} field. */ + public Buffer cAccumAlphaBits(@NativeType("BYTE") byte value) { PIXELFORMATDESCRIPTOR.ncAccumAlphaBits(address(), value); return this; } + /** Sets the specified value to the {@code cDepthBits} field. */ + public Buffer cDepthBits(@NativeType("BYTE") byte value) { PIXELFORMATDESCRIPTOR.ncDepthBits(address(), value); return this; } + /** Sets the specified value to the {@code cStencilBits} field. */ + public Buffer cStencilBits(@NativeType("BYTE") byte value) { PIXELFORMATDESCRIPTOR.ncStencilBits(address(), value); return this; } + /** Sets the specified value to the {@code cAuxBuffers} field. */ + public Buffer cAuxBuffers(@NativeType("BYTE") byte value) { PIXELFORMATDESCRIPTOR.ncAuxBuffers(address(), value); return this; } + /** Sets the specified value to the {@code iLayerType} field. */ + public Buffer iLayerType(@NativeType("BYTE") byte value) { PIXELFORMATDESCRIPTOR.niLayerType(address(), value); return this; } + /** Sets the specified value to the {@code bReserved} field. */ + public Buffer bReserved(@NativeType("BYTE") byte value) { PIXELFORMATDESCRIPTOR.nbReserved(address(), value); return this; } + /** Sets the specified value to the {@code dwLayerMask} field. */ + public Buffer dwLayerMask(@NativeType("DWORD") int value) { PIXELFORMATDESCRIPTOR.ndwLayerMask(address(), value); return this; } + /** Sets the specified value to the {@code dwVisibleMask} field. */ + public Buffer dwVisibleMask(@NativeType("DWORD") int value) { PIXELFORMATDESCRIPTOR.ndwVisibleMask(address(), value); return this; } + /** Sets the specified value to the {@code dwDamageMask} field. */ + public Buffer dwDamageMask(@NativeType("DWORD") int value) { PIXELFORMATDESCRIPTOR.ndwDamageMask(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/POINT.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/POINT.java new file mode 100644 index 00000000..2ab88c2d --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/POINT.java @@ -0,0 +1,315 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.windows; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Defines the x- and y- coordinates of a point. + * + *

Member documentation

+ * + *
    + *
  • {@code x} – the x-coordinate of the point
  • + *
  • {@code y} – the y-coordinate of the point
  • + *
+ * + *

Layout

+ * + *

+ * struct POINT {
+ *     LONG x;
+ *     LONG y;
+ * }
+ */ +public class POINT extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + X, + Y; + + static { + Layout layout = __struct( + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + X = layout.offsetof(0); + Y = layout.offsetof(1); + } + + /** + * Creates a {@code POINT} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public POINT(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code x} field. */ + @NativeType("LONG") + public int x() { return nx(address()); } + /** Returns the value of the {@code y} field. */ + @NativeType("LONG") + public int y() { return ny(address()); } + + /** Sets the specified value to the {@code x} field. */ + public POINT x(@NativeType("LONG") int value) { nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public POINT y(@NativeType("LONG") int value) { ny(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public POINT set( + int x, + int y + ) { + x(x); + y(y); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public POINT set(POINT src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code POINT} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static POINT malloc() { + return wrap(POINT.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code POINT} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static POINT calloc() { + return wrap(POINT.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code POINT} instance allocated with {@link BufferUtils}. */ + public static POINT create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(POINT.class, memAddress(container), container); + } + + /** Returns a new {@code POINT} instance for the specified memory address. */ + public static POINT create(long address) { + return wrap(POINT.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static POINT createSafe(long address) { + return address == NULL ? null : wrap(POINT.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code POINT} instance allocated on the thread-local {@link MemoryStack}. */ + public static POINT mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code POINT} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static POINT callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code POINT} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static POINT mallocStack(MemoryStack stack) { + return wrap(POINT.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code POINT} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static POINT callocStack(MemoryStack stack) { + return wrap(POINT.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #x}. */ + public static int nx(long struct) { return UNSAFE.getInt(null, struct + POINT.X); } + /** Unsafe version of {@link #y}. */ + public static int ny(long struct) { return UNSAFE.getInt(null, struct + POINT.Y); } + + /** Unsafe version of {@link #x(int) x}. */ + public static void nx(long struct, int value) { UNSAFE.putInt(null, struct + POINT.X, value); } + /** Unsafe version of {@link #y(int) y}. */ + public static void ny(long struct, int value) { UNSAFE.putInt(null, struct + POINT.Y, value); } + + // ----------------------------------- + + /** An array of {@link POINT} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final POINT ELEMENT_FACTORY = POINT.create(-1L); + + /** + * Creates a new {@code POINT.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link POINT#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected POINT getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code x} field. */ + @NativeType("LONG") + public int x() { return POINT.nx(address()); } + /** Returns the value of the {@code y} field. */ + @NativeType("LONG") + public int y() { return POINT.ny(address()); } + + /** Sets the specified value to the {@code x} field. */ + public Buffer x(@NativeType("LONG") int value) { POINT.nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public Buffer y(@NativeType("LONG") int value) { POINT.ny(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/POINTL.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/POINTL.java new file mode 100644 index 00000000..41b332f6 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/POINTL.java @@ -0,0 +1,315 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.windows; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Contains the coordinates of a point. + * + *

Member documentation

+ * + *
    + *
  • {@code x} – the horizontal (x) coordinate of the point
  • + *
  • {@code y} – the vertical (y) coordinate of the point.
  • + *
+ * + *

Layout

+ * + *

+ * struct POINTL {
+ *     LONG x;
+ *     LONG y;
+ * }
+ */ +public class POINTL extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + X, + Y; + + static { + Layout layout = __struct( + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + X = layout.offsetof(0); + Y = layout.offsetof(1); + } + + /** + * Creates a {@code POINTL} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public POINTL(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code x} field. */ + @NativeType("LONG") + public int x() { return nx(address()); } + /** Returns the value of the {@code y} field. */ + @NativeType("LONG") + public int y() { return ny(address()); } + + /** Sets the specified value to the {@code x} field. */ + public POINTL x(@NativeType("LONG") int value) { nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public POINTL y(@NativeType("LONG") int value) { ny(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public POINTL set( + int x, + int y + ) { + x(x); + y(y); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public POINTL set(POINTL src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code POINTL} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static POINTL malloc() { + return wrap(POINTL.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code POINTL} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static POINTL calloc() { + return wrap(POINTL.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code POINTL} instance allocated with {@link BufferUtils}. */ + public static POINTL create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(POINTL.class, memAddress(container), container); + } + + /** Returns a new {@code POINTL} instance for the specified memory address. */ + public static POINTL create(long address) { + return wrap(POINTL.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static POINTL createSafe(long address) { + return address == NULL ? null : wrap(POINTL.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code POINTL} instance allocated on the thread-local {@link MemoryStack}. */ + public static POINTL mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code POINTL} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static POINTL callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code POINTL} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static POINTL mallocStack(MemoryStack stack) { + return wrap(POINTL.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code POINTL} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static POINTL callocStack(MemoryStack stack) { + return wrap(POINTL.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #x}. */ + public static int nx(long struct) { return UNSAFE.getInt(null, struct + POINTL.X); } + /** Unsafe version of {@link #y}. */ + public static int ny(long struct) { return UNSAFE.getInt(null, struct + POINTL.Y); } + + /** Unsafe version of {@link #x(int) x}. */ + public static void nx(long struct, int value) { UNSAFE.putInt(null, struct + POINTL.X, value); } + /** Unsafe version of {@link #y(int) y}. */ + public static void ny(long struct, int value) { UNSAFE.putInt(null, struct + POINTL.Y, value); } + + // ----------------------------------- + + /** An array of {@link POINTL} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final POINTL ELEMENT_FACTORY = POINTL.create(-1L); + + /** + * Creates a new {@code POINTL.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link POINTL#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected POINTL getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code x} field. */ + @NativeType("LONG") + public int x() { return POINTL.nx(address()); } + /** Returns the value of the {@code y} field. */ + @NativeType("LONG") + public int y() { return POINTL.ny(address()); } + + /** Sets the specified value to the {@code x} field. */ + public Buffer x(@NativeType("LONG") int value) { POINTL.nx(address(), value); return this; } + /** Sets the specified value to the {@code y} field. */ + public Buffer y(@NativeType("LONG") int value) { POINTL.ny(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/RECT.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/RECT.java new file mode 100644 index 00000000..98d9bbbb --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/RECT.java @@ -0,0 +1,357 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.windows; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Defines the coordinates of the upper-left and lower-right corners of a rectangle. + * + *

Member documentation

+ * + *
    + *
  • {@code left} – the x-coordinate of the upper-left corner of the rectangle
  • + *
  • {@code top} – the y-coordinate of the upper-left corner of the rectangle
  • + *
  • {@code right} – the x-coordinate of the lower-right corner of the rectangle
  • + *
  • {@code bottom} – the y-coordinate of the lower-right corner of the rectangle
  • + *
+ * + *

Layout

+ * + *

+ * struct RECT {
+ *     LONG left;
+ *     LONG top;
+ *     LONG right;
+ *     LONG bottom;
+ * }
+ */ +public class RECT extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + LEFT, + TOP, + RIGHT, + BOTTOM; + + static { + Layout layout = __struct( + __member(4), + __member(4), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + LEFT = layout.offsetof(0); + TOP = layout.offsetof(1); + RIGHT = layout.offsetof(2); + BOTTOM = layout.offsetof(3); + } + + /** + * Creates a {@code RECT} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public RECT(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code left} field. */ + @NativeType("LONG") + public int left() { return nleft(address()); } + /** Returns the value of the {@code top} field. */ + @NativeType("LONG") + public int top() { return ntop(address()); } + /** Returns the value of the {@code right} field. */ + @NativeType("LONG") + public int right() { return nright(address()); } + /** Returns the value of the {@code bottom} field. */ + @NativeType("LONG") + public int bottom() { return nbottom(address()); } + + /** Sets the specified value to the {@code left} field. */ + public RECT left(@NativeType("LONG") int value) { nleft(address(), value); return this; } + /** Sets the specified value to the {@code top} field. */ + public RECT top(@NativeType("LONG") int value) { ntop(address(), value); return this; } + /** Sets the specified value to the {@code right} field. */ + public RECT right(@NativeType("LONG") int value) { nright(address(), value); return this; } + /** Sets the specified value to the {@code bottom} field. */ + public RECT bottom(@NativeType("LONG") int value) { nbottom(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public RECT set( + int left, + int top, + int right, + int bottom + ) { + left(left); + top(top); + right(right); + bottom(bottom); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public RECT set(RECT src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code RECT} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static RECT malloc() { + return wrap(RECT.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code RECT} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static RECT calloc() { + return wrap(RECT.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code RECT} instance allocated with {@link BufferUtils}. */ + public static RECT create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(RECT.class, memAddress(container), container); + } + + /** Returns a new {@code RECT} instance for the specified memory address. */ + public static RECT create(long address) { + return wrap(RECT.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static RECT createSafe(long address) { + return address == NULL ? null : wrap(RECT.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code RECT} instance allocated on the thread-local {@link MemoryStack}. */ + public static RECT mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code RECT} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static RECT callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code RECT} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static RECT mallocStack(MemoryStack stack) { + return wrap(RECT.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code RECT} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static RECT callocStack(MemoryStack stack) { + return wrap(RECT.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #left}. */ + public static int nleft(long struct) { return UNSAFE.getInt(null, struct + RECT.LEFT); } + /** Unsafe version of {@link #top}. */ + public static int ntop(long struct) { return UNSAFE.getInt(null, struct + RECT.TOP); } + /** Unsafe version of {@link #right}. */ + public static int nright(long struct) { return UNSAFE.getInt(null, struct + RECT.RIGHT); } + /** Unsafe version of {@link #bottom}. */ + public static int nbottom(long struct) { return UNSAFE.getInt(null, struct + RECT.BOTTOM); } + + /** Unsafe version of {@link #left(int) left}. */ + public static void nleft(long struct, int value) { UNSAFE.putInt(null, struct + RECT.LEFT, value); } + /** Unsafe version of {@link #top(int) top}. */ + public static void ntop(long struct, int value) { UNSAFE.putInt(null, struct + RECT.TOP, value); } + /** Unsafe version of {@link #right(int) right}. */ + public static void nright(long struct, int value) { UNSAFE.putInt(null, struct + RECT.RIGHT, value); } + /** Unsafe version of {@link #bottom(int) bottom}. */ + public static void nbottom(long struct, int value) { UNSAFE.putInt(null, struct + RECT.BOTTOM, value); } + + // ----------------------------------- + + /** An array of {@link RECT} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final RECT ELEMENT_FACTORY = RECT.create(-1L); + + /** + * Creates a new {@code RECT.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link RECT#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected RECT getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code left} field. */ + @NativeType("LONG") + public int left() { return RECT.nleft(address()); } + /** Returns the value of the {@code top} field. */ + @NativeType("LONG") + public int top() { return RECT.ntop(address()); } + /** Returns the value of the {@code right} field. */ + @NativeType("LONG") + public int right() { return RECT.nright(address()); } + /** Returns the value of the {@code bottom} field. */ + @NativeType("LONG") + public int bottom() { return RECT.nbottom(address()); } + + /** Sets the specified value to the {@code left} field. */ + public Buffer left(@NativeType("LONG") int value) { RECT.nleft(address(), value); return this; } + /** Sets the specified value to the {@code top} field. */ + public Buffer top(@NativeType("LONG") int value) { RECT.ntop(address(), value); return this; } + /** Sets the specified value to the {@code right} field. */ + public Buffer right(@NativeType("LONG") int value) { RECT.nright(address(), value); return this; } + /** Sets the specified value to the {@code bottom} field. */ + public Buffer bottom(@NativeType("LONG") int value) { RECT.nbottom(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/SECURITY_ATTRIBUTES.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/SECURITY_ATTRIBUTES.java new file mode 100644 index 00000000..aa9d4557 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/SECURITY_ATTRIBUTES.java @@ -0,0 +1,364 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.windows; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Contains the security descriptor for an object and specifies whether the handle retrieved by specifying this structure is inheritable. This structure + * provides security settings for objects created by various functions, such as {@code CreateFile}, {@code CreatePipe}, {@code CreateProcess}, + * {@code RegCreateKeyEx}, or {@code RegSaveKeyEx}. + * + *

Member documentation

+ * + *
    + *
  • {@code nLength} – the size, in bytes, of this structure. Set this value to {@link #SIZEOF}.
  • + *
  • {@code lpSecurityDescriptor} – + * a pointer to a {@code SECURITY_DESCRIPTOR} structure that controls access to the object. If the value of this member is {@code NULL}, the object is assigned + * the default security descriptor associated with the access token of the calling process. This is not the same as granting access to everyone by + * assigning a {@code NULL} discretionary access control list (DACL). By default, the default DACL in the access token of a process allows access only to the + * user represented by the access token.
  • + *
  • {@code bInheritHandle} – specifies whether the returned handle is inherited when a new process is created. If this member is {@code TRUE}, the new process inherits the handle.
  • + *
+ * + *

Layout

+ * + *

+ * struct SECURITY_ATTRIBUTES {
+ *     DWORD nLength;
+ *     LPVOID lpSecurityDescriptor;
+ *     BOOL bInheritHandle;
+ * }
+ */ +public class SECURITY_ATTRIBUTES extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + NLENGTH, + LPSECURITYDESCRIPTOR, + BINHERITHANDLE; + + static { + Layout layout = __struct( + __member(4), + __member(POINTER_SIZE), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + NLENGTH = layout.offsetof(0); + LPSECURITYDESCRIPTOR = layout.offsetof(1); + BINHERITHANDLE = layout.offsetof(2); + } + + /** + * Creates a {@code SECURITY_ATTRIBUTES} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public SECURITY_ATTRIBUTES(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code nLength} field. */ + @NativeType("DWORD") + public int nLength() { return nnLength(address()); } + /** Returns the value of the {@code lpSecurityDescriptor} field. */ + @NativeType("LPVOID") + public long lpSecurityDescriptor() { return nlpSecurityDescriptor(address()); } + /** Returns the value of the {@code bInheritHandle} field. */ + @NativeType("BOOL") + public boolean bInheritHandle() { return nbInheritHandle(address()) != 0; } + + /** Sets the specified value to the {@code nLength} field. */ + public SECURITY_ATTRIBUTES nLength(@NativeType("DWORD") int value) { nnLength(address(), value); return this; } + /** Sets the specified value to the {@code lpSecurityDescriptor} field. */ + public SECURITY_ATTRIBUTES lpSecurityDescriptor(@NativeType("LPVOID") long value) { nlpSecurityDescriptor(address(), value); return this; } + /** Sets the specified value to the {@code bInheritHandle} field. */ + public SECURITY_ATTRIBUTES bInheritHandle(@NativeType("BOOL") boolean value) { nbInheritHandle(address(), value ? 1 : 0); return this; } + + /** Initializes this struct with the specified values. */ + public SECURITY_ATTRIBUTES set( + int nLength, + long lpSecurityDescriptor, + boolean bInheritHandle + ) { + nLength(nLength); + lpSecurityDescriptor(lpSecurityDescriptor); + bInheritHandle(bInheritHandle); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public SECURITY_ATTRIBUTES set(SECURITY_ATTRIBUTES src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code SECURITY_ATTRIBUTES} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static SECURITY_ATTRIBUTES malloc() { + return wrap(SECURITY_ATTRIBUTES.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code SECURITY_ATTRIBUTES} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static SECURITY_ATTRIBUTES calloc() { + return wrap(SECURITY_ATTRIBUTES.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code SECURITY_ATTRIBUTES} instance allocated with {@link BufferUtils}. */ + public static SECURITY_ATTRIBUTES create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(SECURITY_ATTRIBUTES.class, memAddress(container), container); + } + + /** Returns a new {@code SECURITY_ATTRIBUTES} instance for the specified memory address. */ + public static SECURITY_ATTRIBUTES create(long address) { + return wrap(SECURITY_ATTRIBUTES.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static SECURITY_ATTRIBUTES createSafe(long address) { + return address == NULL ? null : wrap(SECURITY_ATTRIBUTES.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code SECURITY_ATTRIBUTES} instance allocated on the thread-local {@link MemoryStack}. */ + public static SECURITY_ATTRIBUTES mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code SECURITY_ATTRIBUTES} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static SECURITY_ATTRIBUTES callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code SECURITY_ATTRIBUTES} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static SECURITY_ATTRIBUTES mallocStack(MemoryStack stack) { + return wrap(SECURITY_ATTRIBUTES.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code SECURITY_ATTRIBUTES} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static SECURITY_ATTRIBUTES callocStack(MemoryStack stack) { + return wrap(SECURITY_ATTRIBUTES.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #nLength}. */ + public static int nnLength(long struct) { return UNSAFE.getInt(null, struct + SECURITY_ATTRIBUTES.NLENGTH); } + /** Unsafe version of {@link #lpSecurityDescriptor}. */ + public static long nlpSecurityDescriptor(long struct) { return memGetAddress(struct + SECURITY_ATTRIBUTES.LPSECURITYDESCRIPTOR); } + /** Unsafe version of {@link #bInheritHandle}. */ + public static int nbInheritHandle(long struct) { return UNSAFE.getInt(null, struct + SECURITY_ATTRIBUTES.BINHERITHANDLE); } + + /** Unsafe version of {@link #nLength(int) nLength}. */ + public static void nnLength(long struct, int value) { UNSAFE.putInt(null, struct + SECURITY_ATTRIBUTES.NLENGTH, value); } + /** Unsafe version of {@link #lpSecurityDescriptor(long) lpSecurityDescriptor}. */ + public static void nlpSecurityDescriptor(long struct, long value) { memPutAddress(struct + SECURITY_ATTRIBUTES.LPSECURITYDESCRIPTOR, check(value)); } + /** Unsafe version of {@link #bInheritHandle(boolean) bInheritHandle}. */ + public static void nbInheritHandle(long struct, int value) { UNSAFE.putInt(null, struct + SECURITY_ATTRIBUTES.BINHERITHANDLE, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + SECURITY_ATTRIBUTES.LPSECURITYDESCRIPTOR)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link SECURITY_ATTRIBUTES} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final SECURITY_ATTRIBUTES ELEMENT_FACTORY = SECURITY_ATTRIBUTES.create(-1L); + + /** + * Creates a new {@code SECURITY_ATTRIBUTES.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link SECURITY_ATTRIBUTES#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected SECURITY_ATTRIBUTES getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code nLength} field. */ + @NativeType("DWORD") + public int nLength() { return SECURITY_ATTRIBUTES.nnLength(address()); } + /** Returns the value of the {@code lpSecurityDescriptor} field. */ + @NativeType("LPVOID") + public long lpSecurityDescriptor() { return SECURITY_ATTRIBUTES.nlpSecurityDescriptor(address()); } + /** Returns the value of the {@code bInheritHandle} field. */ + @NativeType("BOOL") + public boolean bInheritHandle() { return SECURITY_ATTRIBUTES.nbInheritHandle(address()) != 0; } + + /** Sets the specified value to the {@code nLength} field. */ + public Buffer nLength(@NativeType("DWORD") int value) { SECURITY_ATTRIBUTES.nnLength(address(), value); return this; } + /** Sets the specified value to the {@code lpSecurityDescriptor} field. */ + public Buffer lpSecurityDescriptor(@NativeType("LPVOID") long value) { SECURITY_ATTRIBUTES.nlpSecurityDescriptor(address(), value); return this; } + /** Sets the specified value to the {@code bInheritHandle} field. */ + public Buffer bInheritHandle(@NativeType("BOOL") boolean value) { SECURITY_ATTRIBUTES.nbInheritHandle(address(), value ? 1 : 0); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/TOUCHINPUT.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/TOUCHINPUT.java new file mode 100644 index 00000000..7730265f --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/TOUCHINPUT.java @@ -0,0 +1,395 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.windows; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Encapsulates data for touch input. + * + *

Member documentation

+ * + *
    + *
  • {@code x} – the x-coordinate (horizontal point) of the touch input. This member is indicated in hundredths of a pixel of physical screen coordinates.
  • + *
  • {@code y} – the y-coordinate (vertical point) of the touch input. This member is indicated in hundredths of a pixel of physical screen coordinates.
  • + *
  • {@code hSource} – a device handle for the source input device. Each device is given a unique provider at run time by the touch input provider.
  • + *
  • {@code dwID} – + * a touch point identifier that distinguishes a particular touch input. This value stays consistent in a touch contact sequence from the point a contact + * comes down until it comes back up. An ID may be reused later for subsequent contacts.
  • + *
  • {@code dwFlags} – + * a set of bit flags that specify various aspects of touch point press, release, and motion. The bits in this member can be any reasonable combination of + * the values in the Remarks section.
  • + *
  • {@code dwMask} – + * a set of bit flags that specify which of the optional fields in the structure contain valid values. The availability of valid information in the + * optional fields is device-specific. Applications should use an optional field value only when the corresponding bit is set in {@code dwMask}. This + * field may contain a combination of the {@code dwMask} flags mentioned in the Remarks section.
  • + *
  • {@code dwTime} – + * the time stamp for the event, in milliseconds. The consuming application should note that the system performs no validation on this field; when the + * {@link User32#TOUCHINPUTMASKF_TIMEFROMSYSTEM} flag is not set, the accuracy and sequencing of values in this field are completely dependent on the touch input + * provider.
  • + *
  • {@code dwExtraInfo} – an additional value associated with the touch event.
  • + *
  • {@code cxContact} – + * the width of the touch contact area in hundredths of a pixel in physical screen coordinates. This value is only valid if the {@code dwMask} member has + * the {@link User32#TOUCHINPUTMASKF_CONTACTAREA} flag set.
  • + *
  • {@code cyContact} – + * the height of the touch contact area in hundredths of a pixel in physical screen coordinates. This value is only valid if the {@code dwMask} member has + * the {@link User32#TOUCHINPUTMASKF_CONTACTAREA} flag set.
  • + *
+ * + *

Layout

+ * + *

+ * struct TOUCHINPUT {
+ *     LONG x;
+ *     LONG y;
+ *     HANDLE hSource;
+ *     DWORD dwID;
+ *     DWORD dwFlags;
+ *     DWORD dwMask;
+ *     DWORD dwTime;
+ *     ULONG_PTR dwExtraInfo;
+ *     DWORD cxContact;
+ *     DWORD cyContact;
+ * }
+ */ +public class TOUCHINPUT extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + X, + Y, + HSOURCE, + DWID, + DWFLAGS, + DWMASK, + DWTIME, + DWEXTRAINFO, + CXCONTACT, + CYCONTACT; + + static { + Layout layout = __struct( + __member(4), + __member(4), + __member(POINTER_SIZE), + __member(4), + __member(4), + __member(4), + __member(4), + __member(POINTER_SIZE), + __member(4), + __member(4) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + X = layout.offsetof(0); + Y = layout.offsetof(1); + HSOURCE = layout.offsetof(2); + DWID = layout.offsetof(3); + DWFLAGS = layout.offsetof(4); + DWMASK = layout.offsetof(5); + DWTIME = layout.offsetof(6); + DWEXTRAINFO = layout.offsetof(7); + CXCONTACT = layout.offsetof(8); + CYCONTACT = layout.offsetof(9); + } + + /** + * Creates a {@code TOUCHINPUT} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public TOUCHINPUT(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code x} field. */ + @NativeType("LONG") + public int x() { return nx(address()); } + /** Returns the value of the {@code y} field. */ + @NativeType("LONG") + public int y() { return ny(address()); } + /** Returns the value of the {@code hSource} field. */ + @NativeType("HANDLE") + public long hSource() { return nhSource(address()); } + /** Returns the value of the {@code dwID} field. */ + @NativeType("DWORD") + public int dwID() { return ndwID(address()); } + /** Returns the value of the {@code dwFlags} field. */ + @NativeType("DWORD") + public int dwFlags() { return ndwFlags(address()); } + /** Returns the value of the {@code dwMask} field. */ + @NativeType("DWORD") + public int dwMask() { return ndwMask(address()); } + /** Returns the value of the {@code dwTime} field. */ + @NativeType("DWORD") + public int dwTime() { return ndwTime(address()); } + /** Returns the value of the {@code dwExtraInfo} field. */ + @NativeType("ULONG_PTR") + public long dwExtraInfo() { return ndwExtraInfo(address()); } + /** Returns the value of the {@code cxContact} field. */ + @NativeType("DWORD") + public int cxContact() { return ncxContact(address()); } + /** Returns the value of the {@code cyContact} field. */ + @NativeType("DWORD") + public int cyContact() { return ncyContact(address()); } + + // ----------------------------------- + + /** Returns a new {@code TOUCHINPUT} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static TOUCHINPUT malloc() { + return wrap(TOUCHINPUT.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code TOUCHINPUT} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static TOUCHINPUT calloc() { + return wrap(TOUCHINPUT.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code TOUCHINPUT} instance allocated with {@link BufferUtils}. */ + public static TOUCHINPUT create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(TOUCHINPUT.class, memAddress(container), container); + } + + /** Returns a new {@code TOUCHINPUT} instance for the specified memory address. */ + public static TOUCHINPUT create(long address) { + return wrap(TOUCHINPUT.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static TOUCHINPUT createSafe(long address) { + return address == NULL ? null : wrap(TOUCHINPUT.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code TOUCHINPUT} instance allocated on the thread-local {@link MemoryStack}. */ + public static TOUCHINPUT mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code TOUCHINPUT} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static TOUCHINPUT callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code TOUCHINPUT} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static TOUCHINPUT mallocStack(MemoryStack stack) { + return wrap(TOUCHINPUT.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code TOUCHINPUT} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static TOUCHINPUT callocStack(MemoryStack stack) { + return wrap(TOUCHINPUT.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #x}. */ + public static int nx(long struct) { return UNSAFE.getInt(null, struct + TOUCHINPUT.X); } + /** Unsafe version of {@link #y}. */ + public static int ny(long struct) { return UNSAFE.getInt(null, struct + TOUCHINPUT.Y); } + /** Unsafe version of {@link #hSource}. */ + public static long nhSource(long struct) { return memGetAddress(struct + TOUCHINPUT.HSOURCE); } + /** Unsafe version of {@link #dwID}. */ + public static int ndwID(long struct) { return UNSAFE.getInt(null, struct + TOUCHINPUT.DWID); } + /** Unsafe version of {@link #dwFlags}. */ + public static int ndwFlags(long struct) { return UNSAFE.getInt(null, struct + TOUCHINPUT.DWFLAGS); } + /** Unsafe version of {@link #dwMask}. */ + public static int ndwMask(long struct) { return UNSAFE.getInt(null, struct + TOUCHINPUT.DWMASK); } + /** Unsafe version of {@link #dwTime}. */ + public static int ndwTime(long struct) { return UNSAFE.getInt(null, struct + TOUCHINPUT.DWTIME); } + /** Unsafe version of {@link #dwExtraInfo}. */ + public static long ndwExtraInfo(long struct) { return memGetAddress(struct + TOUCHINPUT.DWEXTRAINFO); } + /** Unsafe version of {@link #cxContact}. */ + public static int ncxContact(long struct) { return UNSAFE.getInt(null, struct + TOUCHINPUT.CXCONTACT); } + /** Unsafe version of {@link #cyContact}. */ + public static int ncyContact(long struct) { return UNSAFE.getInt(null, struct + TOUCHINPUT.CYCONTACT); } + + // ----------------------------------- + + /** An array of {@link TOUCHINPUT} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final TOUCHINPUT ELEMENT_FACTORY = TOUCHINPUT.create(-1L); + + /** + * Creates a new {@code TOUCHINPUT.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link TOUCHINPUT#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected TOUCHINPUT getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code x} field. */ + @NativeType("LONG") + public int x() { return TOUCHINPUT.nx(address()); } + /** Returns the value of the {@code y} field. */ + @NativeType("LONG") + public int y() { return TOUCHINPUT.ny(address()); } + /** Returns the value of the {@code hSource} field. */ + @NativeType("HANDLE") + public long hSource() { return TOUCHINPUT.nhSource(address()); } + /** Returns the value of the {@code dwID} field. */ + @NativeType("DWORD") + public int dwID() { return TOUCHINPUT.ndwID(address()); } + /** Returns the value of the {@code dwFlags} field. */ + @NativeType("DWORD") + public int dwFlags() { return TOUCHINPUT.ndwFlags(address()); } + /** Returns the value of the {@code dwMask} field. */ + @NativeType("DWORD") + public int dwMask() { return TOUCHINPUT.ndwMask(address()); } + /** Returns the value of the {@code dwTime} field. */ + @NativeType("DWORD") + public int dwTime() { return TOUCHINPUT.ndwTime(address()); } + /** Returns the value of the {@code dwExtraInfo} field. */ + @NativeType("ULONG_PTR") + public long dwExtraInfo() { return TOUCHINPUT.ndwExtraInfo(address()); } + /** Returns the value of the {@code cxContact} field. */ + @NativeType("DWORD") + public int cxContact() { return TOUCHINPUT.ncxContact(address()); } + /** Returns the value of the {@code cyContact} field. */ + @NativeType("DWORD") + public int cyContact() { return TOUCHINPUT.ncyContact(address()); } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/User32.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/User32.java new file mode 100644 index 00000000..874fc6ee --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/User32.java @@ -0,0 +1,2842 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.windows; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.APIUtil.*; +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.JNI.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to WinUser.h and user32.dll. */ +public class User32 { + + /** Window Styles */ + public static final int + WS_OVERLAPPED = 0x0, + WS_POPUP = 0x80000000, + WS_CHILD = 0x40000000, + WS_MINIMIZE = 0x20000000, + WS_VISIBLE = 0x10000000, + WS_DISABLED = 0x8000000, + WS_CLIPSIBLINGS = 0x4000000, + WS_CLIPCHILDREN = 0x2000000, + WS_MAXIMIZE = 0x1000000, + WS_CAPTION = 0xC00000, + WS_BORDER = 0x800000, + WS_DLGFRAME = 0x400000, + WS_VSCROLL = 0x200000, + WS_HSCROLL = 0x100000, + WS_SYSMENU = 0x80000, + WS_THICKFRAME = 0x40000, + WS_GROUP = 0x20000, + WS_TABSTOP = 0x10000, + WS_MINIMIZEBOX = 0x20000, + WS_MAXIMIZEBOX = 0x10000, + WS_OVERLAPPEDWINDOW = WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME | WS_MINIMIZEBOX | WS_MAXIMIZEBOX, + WS_POPUPWINDOW = WS_POPUP | WS_BORDER | WS_SYSMENU, + WS_CHILDWINDOW = WS_CHILD, + WS_TILED = WS_OVERLAPPED, + WS_ICONIC = WS_MINIMIZE, + WS_SIZEBOX = WS_THICKFRAME, + WS_TILEDWINDOW = WS_OVERLAPPEDWINDOW; + + /** Extended Window Styles */ + public static final int + WS_EX_DLGMODALFRAME = 0x1, + WS_EX_NOPARENTNOTIFY = 0x4, + WS_EX_TOPMOST = 0x8, + WS_EX_ACCEPTFILES = 0x10, + WS_EX_TRANSPARENT = 0x20, + WS_EX_MDICHILD = 0x40, + WS_EX_TOOLWINDOW = 0x80, + WS_EX_WINDOWEDGE = 0x100, + WS_EX_CLIENTEDGE = 0x200, + WS_EX_CONTEXTHELP = 0x400, + WS_EX_RIGHT = 0x1000, + WS_EX_LEFT = 0x0, + WS_EX_RTLREADING = 0x2000, + WS_EX_LTRREADING = 0x0, + WS_EX_LEFTSCROLLBAR = 0x4000, + WS_EX_RIGHTSCROLLBAR = 0x0, + WS_EX_CONTROLPARENT = 0x10000, + WS_EX_STATICEDGE = 0x20000, + WS_EX_APPWINDOW = 0x40000, + WS_EX_OVERLAPPEDWINDOW = WS_EX_WINDOWEDGE | WS_EX_CLIENTEDGE, + WS_EX_PALETTEWINDOW = WS_EX_WINDOWEDGE | WS_EX_TOOLWINDOW | WS_EX_TOPMOST, + WS_EX_LAYERED = 0x80000, + WS_EX_NOINHERITLAYOUT = 0x100000, + WS_EX_LAYOUTRTL = 0x400000, + WS_EX_COMPOSITED = 0x2000000, + WS_EX_NOACTIVATE = 0x8000000; + + /** May be used in {@link #CreateWindowEx} for the x, y, width, height parameters. */ + public static final int CW_USEDEFAULT = 0x80000000; + + /** Class styles */ + public static final int + CS_VREDRAW = 0x1, + CS_HREDRAW = 0x2, + CS_DBLCLKS = 0x8, + CS_OWNDC = 0x20, + CS_CLASSDC = 0x40, + CS_PARENTDC = 0x80, + CS_NOCLOSE = 0x200, + CS_SAVEBITS = 0x800, + CS_BYTEALIGNCLIENT = 0x1000, + CS_BYTEALIGNWINDOW = 0x2000, + CS_GLOBALCLASS = 0x4000, + CS_IME = 0x10000, + CS_DROPSHADOW = 0x20000; + + /** Windows messages. */ + public static final int + WM_NULL = 0x0, + WM_CREATE = 0x1, + WM_DESTROY = 0x2, + WM_MOVE = 0x3, + WM_SIZE = 0x5, + WM_ACTIVATE = 0x6, + WM_SETFOCUS = 0x7, + WM_KILLFOCUS = 0x8, + WM_ENABLE = 0xA, + WM_SETREDRAW = 0xB, + WM_SETTEXT = 0xC, + WM_GETTEXT = 0xD, + WM_GETTEXTLENGTH = 0xE, + WM_PAINT = 0xF, + WM_CLOSE = 0x10, + WM_QUERYENDSESSION = 0x11, + WM_QUERYOPEN = 0x13, + WM_ENDSESSION = 0x16, + WM_QUIT = 0x12, + WM_ERASEBKGND = 0x14, + WM_SYSCOLORCHANGE = 0x15, + WM_SHOWWINDOW = 0x18, + WM_WININICHANGE = 0x1A, + WM_SETTINGCHANGE = WM_WININICHANGE, + WM_DEVMODECHANGE = 0x1B, + WM_ACTIVATEAPP = 0x1C, + WM_FONTCHANGE = 0x1D, + WM_TIMECHANGE = 0x1E, + WM_CANCELMODE = 0x1F, + WM_SETCURSOR = 0x20, + WM_MOUSEACTIVATE = 0x21, + WM_CHILDACTIVATE = 0x22, + WM_QUEUESYNC = 0x23, + WM_GETMINMAXINFO = 0x24, + WM_PAINTICON = 0x26, + WM_ICONERASEBKGND = 0x27, + WM_NEXTDLGCTL = 0x28, + WM_SPOOLERSTATUS = 0x2A, + WM_DRAWITEM = 0x2B, + WM_MEASUREITEM = 0x2C, + WM_DELETEITEM = 0x2D, + WM_VKEYTOITEM = 0x2E, + WM_CHARTOITEM = 0x2F, + WM_SETFONT = 0x30, + WM_GETFONT = 0x31, + WM_SETHOTKEY = 0x32, + WM_GETHOTKEY = 0x33, + WM_QUERYDRAGICON = 0x37, + WM_COMPAREITEM = 0x39, + WM_GETOBJECT = 0x3D, + WM_COMPACTING = 0x41, + WM_COMMNOTIFY = 0x44, + WM_WINDOWPOSCHANGING = 0x46, + WM_WINDOWPOSCHANGED = 0x47, + WM_POWER = 0x48, + WM_COPYDATA = 0x4A, + WM_CANCELJOURNAL = 0x4B, + WM_NOTIFY = 0x4E, + WM_INPUTLANGCHANGEREQUEST = 0x50, + WM_INPUTLANGCHANGE = 0x51, + WM_TCARD = 0x52, + WM_HELP = 0x53, + WM_USERCHANGED = 0x54, + WM_NOTIFYFORMAT = 0x55, + WM_CONTEXTMENU = 0x7B, + WM_STYLECHANGING = 0x7C, + WM_STYLECHANGED = 0x7D, + WM_DISPLAYCHANGE = 0x7E, + WM_GETICON = 0x7F, + WM_SETICON = 0x80, + WM_NCCREATE = 0x81, + WM_NCDESTROY = 0x82, + WM_NCCALCSIZE = 0x83, + WM_NCHITTEST = 0x84, + WM_NCPAINT = 0x85, + WM_NCACTIVATE = 0x86, + WM_GETDLGCODE = 0x87, + WM_SYNCPAINT = 0x88, + WM_NCMOUSEMOVE = 0xA0, + WM_NCLBUTTONDOWN = 0xA1, + WM_NCLBUTTONUP = 0xA2, + WM_NCLBUTTONDBLCLK = 0xA3, + WM_NCRBUTTONDOWN = 0xA4, + WM_NCRBUTTONUP = 0xA5, + WM_NCRBUTTONDBLCLK = 0xA6, + WM_NCMBUTTONDOWN = 0xA7, + WM_NCMBUTTONUP = 0xA8, + WM_NCMBUTTONDBLCLK = 0xA9, + WM_NCXBUTTONDOWN = 0xAB, + WM_NCXBUTTONUP = 0xAC, + WM_NCXBUTTONDBLCLK = 0xAD, + WM_INPUT_DEVICE_CHANGE = 0xFE, + WM_INPUT = 0xFF, + WM_KEYFIRST = 0x100, + WM_KEYDOWN = 0x100, + WM_KEYUP = 0x101, + WM_CHAR = 0x102, + WM_DEADCHAR = 0x103, + WM_SYSKEYDOWN = 0x104, + WM_SYSKEYUP = 0x105, + WM_SYSCHAR = 0x106, + WM_SYSDEADCHAR = 0x107, + WM_UNICHAR = 0x109, + UNICODE_NOCHAR = 0xFFFF, + WM_IME_STARTCOMPOSITION = 0x10D, + WM_IME_ENDCOMPOSITION = 0x10E, + WM_IME_COMPOSITION = 0x10F, + WM_IME_KEYLAST = 0x10F, + WM_INITDIALOG = 0x110, + WM_COMMAND = 0x111, + WM_SYSCOMMAND = 0x112, + WM_TIMER = 0x113, + WM_HSCROLL = 0x114, + WM_VSCROLL = 0x115, + WM_INITMENU = 0x116, + WM_INITMENUPOPUP = 0x117, + WM_GESTURE = 0x119, + WM_GESTURENOTIFY = 0x11A, + WM_MENUSELECT = 0x11F, + WM_MENUCHAR = 0x120, + WM_ENTERIDLE = 0x121, + WM_MENURBUTTONUP = 0x122, + WM_MENUDRAG = 0x123, + WM_MENUGETOBJECT = 0x124, + WM_UNINITMENUPOPUP = 0x125, + WM_MENUCOMMAND = 0x126, + WM_CHANGEUISTATE = 0x127, + WM_UPDATEUISTATE = 0x128, + WM_QUERYUISTATE = 0x129, + WM_CTLCOLORMSGBOX = 0x132, + WM_CTLCOLOREDIT = 0x133, + WM_CTLCOLORLISTBOX = 0x134, + WM_CTLCOLORBTN = 0x135, + WM_CTLCOLORDLG = 0x136, + WM_CTLCOLORSCROLLBAR = 0x137, + WM_CTLCOLORSTATIC = 0x138, + MN_GETHMENU = 0x1E1, + WM_MOUSEFIRST = 0x200, + WM_MOUSEMOVE = 0x200, + WM_LBUTTONDOWN = 0x201, + WM_LBUTTONUP = 0x202, + WM_LBUTTONDBLCLK = 0x203, + WM_RBUTTONDOWN = 0x204, + WM_RBUTTONUP = 0x205, + WM_RBUTTONDBLCLK = 0x206, + WM_MBUTTONDOWN = 0x207, + WM_MBUTTONUP = 0x208, + WM_MBUTTONDBLCLK = 0x209, + WM_MOUSEWHEEL = 0x20A, + WM_XBUTTONDOWN = 0x20B, + WM_XBUTTONUP = 0x20C, + WM_XBUTTONDBLCLK = 0x20D, + WM_MOUSEHWHEEL = 0x20E, + WM_PARENTNOTIFY = 0x210, + WM_ENTERMENULOOP = 0x211, + WM_EXITMENULOOP = 0x212, + WM_NEXTMENU = 0x213, + WM_SIZING = 0x214, + WM_CAPTURECHANGED = 0x215, + WM_MOVING = 0x216, + WM_POWERBROADCAST = 0x218, + WM_DEVICECHANGE = 0x219, + WM_MDICREATE = 0x220, + WM_MDIDESTROY = 0x221, + WM_MDIACTIVATE = 0x222, + WM_MDIRESTORE = 0x223, + WM_MDINEXT = 0x224, + WM_MDIMAXIMIZE = 0x225, + WM_MDITILE = 0x226, + WM_MDICASCADE = 0x227, + WM_MDIICONARRANGE = 0x228, + WM_MDIGETACTIVE = 0x229, + WM_MDISETMENU = 0x230, + WM_ENTERSIZEMOVE = 0x231, + WM_EXITSIZEMOVE = 0x232, + WM_DROPFILES = 0x233, + WM_MDIREFRESHMENU = 0x234, + WM_TOUCH = 0x240, + WM_IME_SETCONTEXT = 0x281, + WM_IME_NOTIFY = 0x282, + WM_IME_CONTROL = 0x283, + WM_IME_COMPOSITIONFULL = 0x284, + WM_IME_SELECT = 0x285, + WM_IME_CHAR = 0x286, + WM_IME_REQUEST = 0x288, + WM_IME_KEYDOWN = 0x290, + WM_IME_KEYUP = 0x291, + WM_MOUSEHOVER = 0x2A1, + WM_MOUSELEAVE = 0x2A3, + WM_NCMOUSEHOVER = 0x2A0, + WM_NCMOUSELEAVE = 0x2A2, + WM_WTSSESSION_CHANGE = 0x2B1, + WM_TABLET_FIRST = 0x2C0, + WM_TABLET_LAST = 0x2DF, + WM_CUT = 0x300, + WM_COPY = 0x301, + WM_PASTE = 0x302, + WM_CLEAR = 0x303, + WM_UNDO = 0x304, + WM_RENDERFORMAT = 0x305, + WM_RENDERALLFORMATS = 0x306, + WM_DESTROYCLIPBOARD = 0x307, + WM_DRAWCLIPBOARD = 0x308, + WM_PAINTCLIPBOARD = 0x309, + WM_VSCROLLCLIPBOARD = 0x30A, + WM_SIZECLIPBOARD = 0x30B, + WM_ASKCBFORMATNAME = 0x30C, + WM_CHANGECBCHAIN = 0x30D, + WM_HSCROLLCLIPBOARD = 0x30E, + WM_QUERYNEWPALETTE = 0x30F, + WM_PALETTEISCHANGING = 0x310, + WM_PALETTECHANGED = 0x311, + WM_HOTKEY = 0x312, + WM_PRINT = 0x317, + WM_PRINTCLIENT = 0x318, + WM_APPCOMMAND = 0x319, + WM_THEMECHANGED = 0x31A, + WM_CLIPBOARDUPDATE = 0x31D, + WM_DWMCOMPOSITIONCHANGED = 0x31E, + WM_DWMNCRENDERINGCHANGED = 0x31F, + WM_DWMCOLORIZATIONCOLORCHANGED = 0x320, + WM_DWMWINDOWMAXIMIZEDCHANGE = 0x321, + WM_DWMSENDICONICTHUMBNAIL = 0x323, + WM_DWMSENDICONICLIVEPREVIEWBITMAP = 0x326, + WM_GETTITLEBARINFOEX = 0x33F, + WM_HANDHELDFIRST = 0x358, + WM_HANDHELDLAST = 0x35F, + WM_AFXFIRST = 0x360, + WM_AFXLAST = 0x37F, + WM_PENWINFIRST = 0x380, + WM_PENWINLAST = 0x38F, + WM_APP = 0x8000, + WM_USER = 0x400; + + /** {@link #WM_ACTIVATE} message {@code wParam} values. */ + public static final int + WA_ACTIVE = 1, + WA_CLICKACTIVE = 2, + WA_INACTIVE = 0; + + /** {@link #WM_SIZE} message {@code wParam} values. */ + public static final int + SIZE_RESTORED = 0, + SIZE_MINIMIZED = 1, + SIZE_MAXIMIZED = 2, + SIZE_MAXSHOW = 3, + SIZE_MAXHIDE = 4; + + /** {@link #WM_DEVICECHANGE} message {@code wParam} params. */ + public static final int + DBT_APPYBEGIN = 0x0, + DBT_APPYEND = 0x1, + DBT_DEVNODES_CHANGED = 0x7, + DBT_QUERYCHANGECONFIG = 0x17, + DBT_CONFIGCHANGED = 0x18, + DBT_CONFIGCHANGECANCELED = 0x19, + DBT_MONITORCHANGE = 0x1B; + + /** System menu command values. */ + public static final int + SC_SIZE = 0xF000, + SC_MOVE = 0xF010, + SC_MINIMIZE = 0xF020, + SC_MAXIMIZE = 0xF030, + SC_NEXTWINDOW = 0xF040, + SC_PREVWINDOW = 0xF050, + SC_CLOSE = 0xF060, + SC_VSCROLL = 0xF070, + SC_HSCROLL = 0xF080, + SC_MOUSEMENU = 0xF090, + SC_KEYMENU = 0xF100, + SC_ARRANGE = 0xF110, + SC_RESTORE = 0xF120, + SC_TASKLIST = 0xF130, + SC_SCREENSAVE = 0xF140, + SC_HOTKEY = 0xF150, + SC_DEFAULT = 0xF160, + SC_MONITORPOWER = 0xF170, + SC_CONTEXTHELP = 0xF180, + SC_SEPARATOR = 0xF00F; + + /** Key state masks for mouse messages. */ + public static final int + MK_LBUTTON = 0x1, + MK_RBUTTON = 0x2, + MK_SHIFT = 0x4, + MK_CONTROL = 0x8, + MK_MBUTTON = 0x10, + MK_XBUTTON1 = 0x20, + MK_XBUTTON2 = 0x40; + + /** Mouse position codes. */ + public static final int + HTERROR = -2, + HTTRANSPARENT = -1, + HTNOWHERE = 0, + HTCLIENT = 1, + HTCAPTION = 2, + HTSYSMENU = 3, + HTGROWBOX = 4, + HTSIZE = HTGROWBOX, + HTMENU = 5, + HTHSCROLL = 6, + HTVSCROLL = 7, + HTMINBUTTON = 8, + HTMAXBUTTON = 9, + HTLEFT = 10, + HTRIGHT = 11, + HTTOP = 12, + HTTOPLEFT = 13, + HTTOPRIGHT = 14, + HTBOTTOM = 15, + HTBOTTOMLEFT = 16, + HTBOTTOMRIGHT = 17, + HTBORDER = 18, + HTREDUCE = HTMINBUTTON, + HTZOOM = HTMAXBUTTON, + HTSIZEFIRST = HTLEFT, + HTSIZELAST = HTBOTTOMRIGHT, + HTOBJECT = 19, + HTCLOSE = 20, + HTHELP = 21; + + /** Window field offsets for {@link #GetWindowLongPtr}. */ + public static final int + GWL_WNDPROC = -4, + GWL_HINSTANCE = -6, + GWL_HWNDPARENT = -8, + GWL_STYLE = -16, + GWL_EXSTYLE = -20, + GWL_USERDATA = -21, + GWL_ID = -12; + + /** {@link #ShowWindow} commands. */ + public static final int + SW_HIDE = 0, + SW_SHOWNORMAL = 1, + SW_NORMAL = 1, + SW_SHOWMINIMIZED = 2, + SW_SHOWMAXIMIZED = 3, + SW_MAXIMIZE = 3, + SW_SHOWNOACTIVATE = 4, + SW_SHOW = 5, + SW_MINIMIZE = 6, + SW_SHOWMINNOACTIVE = 7, + SW_SHOWNA = 8, + SW_RESTORE = 9, + SW_SHOWDEFAULT = 10, + SW_FORCEMINIMIZE = 11, + SW_MAX = 11; + + /** Virtual window handles used by the {@link #SetWindowPos} insertAfter argument. */ + public static final long + HWND_TOP = 0x0L, + HWND_BOTTOM = 0x1L, + HWND_TOPMOST = 0xFFFFFFFFFFFFFFFFL, + HWND_NOTOPMOST = 0xFFFFFFFFFFFFFFFEL; + + /** + * Virtual window handle used by {@link #PostMessage} that matches all top-level windows in the system, including disabled or invisible unowned windows, + * overlapped windows, and pop-up windows. + */ + public static final long HWND_BROADCAST = 0xFFFFL; + + /** Window sizing and positiong flags used by the {@link #SetWindowPos} flags argument. */ + public static final int + SWP_NOSIZE = 0x1, + SWP_NOMOVE = 0x2, + SWP_NOZORDER = 0x4, + SWP_NOREDRAW = 0x8, + SWP_NOACTIVATE = 0x10, + SWP_FRAMECHANGED = 0x20, + SWP_SHOWWINDOW = 0x40, + SWP_HIDEWINDOW = 0x80, + SWP_NOCOPYBITS = 0x100, + SWP_NOOWNERZORDER = 0x200, + SWP_NOSENDCHANGING = 0x400, + SWP_DRAWFRAME = SWP_FRAMECHANGED, + SWP_NOREPOSITION = SWP_NOOWNERZORDER, + SWP_DEFERERASE = 0x2000, + SWP_ASYNCWINDOWPOS = 0x4000; + + /** Standard Icon IDs. Use with {@link #LoadIcon}. */ + public static final int + IDI_APPLICATION = 32512, + IDI_HAND = 32513, + IDI_QUESTION = 32514, + IDI_EXCLAMATION = 32515, + IDI_ASTERISK = 32516, + IDI_WINLOGO = 32517, + IDI_SHIELD = 32518, + IDI_WARNING = IDI_EXCLAMATION, + IDI_ERROR = IDI_HAND, + IDI_INFORMATION = IDI_ASTERISK; + + /** Standard Cursor IDs. Use with {@link #LoadCursor}. */ + public static final int + IDC_ARROW = 32512, + IDC_IBEAM = 32513, + IDC_WAIT = 32514, + IDC_CROSS = 32515, + IDC_UPARROW = 32516, + IDC_SIZE = 32640, + IDC_ICON = 32641, + IDC_SIZENWSE = 32642, + IDC_SIZENESW = 32643, + IDC_SIZEWE = 32644, + IDC_SIZENS = 32645, + IDC_SIZEALL = 32646, + IDC_NO = 32648, + IDC_HAND = 32649, + IDC_APPSTARTING = 32650, + IDC_HELP = 32651; + + /** Class field offsets for {@link #GetClassLongPtr}. */ + public static final int + GCL_MENUNAME = -8, + GCL_HBRBACKGROUND = -10, + GCL_HCURSOR = -12, + GCL_HICON = -14, + GCL_HMODULE = -16, + GCL_CBWNDEXTRA = -18, + GCL_CBCLSEXTRA = -20, + GCL_WNDPROC = -24, + GCL_STYLE = -26, + GCW_ATOM = -32, + GCL_HICONSM = -34; + + /** Queue status flags for {@code GetQueueStatus} and {@code MsgWaitForMultipleObjects} */ + public static final int + QS_KEY = 0x1, + QS_MOUSEMOVE = 0x2, + QS_MOUSEBUTTON = 0x4, + QS_POSTMESSAGE = 0x8, + QS_TIMER = 0x10, + QS_PAINT = 0x20, + QS_SENDMESSAGE = 0x40, + QS_HOTKEY = 0x80, + QS_ALLPOSTMESSAGE = 0x100, + QS_RAWINPUT = 0x400, + QS_MOUSE = QS_MOUSEMOVE | QS_MOUSEBUTTON, + QS_INPUT = QS_MOUSE | QS_KEY, + QS_ALLEVENTS = QS_INPUT | QS_POSTMESSAGE | QS_TIMER | QS_PAINT | QS_HOTKEY, + QS_ALLINPUT = QS_INPUT | QS_POSTMESSAGE | QS_TIMER | QS_PAINT | QS_HOTKEY | QS_SENDMESSAGE; + + /** Remove message flags for {@link #PeekMessage}. */ + public static final int + PM_NOREMOVE = 0x0, + PM_REMOVE = 0x1, + PM_NOYIELD = 0x2, + PM_QS_INPUT = QS_INPUT << 16, + PM_QS_POSTMESSAGE = (QS_POSTMESSAGE | QS_HOTKEY | QS_TIMER) << 16, + PM_QS_PAINT = QS_PAINT << 16, + PM_QS_SENDMESSAGE = QS_SENDMESSAGE << 16; + + /** Virtual Keys. */ + public static final int + VK_LBUTTON = 0x1, + VK_RBUTTON = 0x2, + VK_CANCEL = 0x3, + VK_MBUTTON = 0x4, + VK_XBUTTON1 = 0x5, + VK_XBUTTON2 = 0x6, + VK_BACK = 0x8, + VK_TAB = 0x9, + VK_CLEAR = 0xC, + VK_RETURN = 0xD, + VK_SHIFT = 0x10, + VK_CONTROL = 0x11, + VK_MENU = 0x12, + VK_PAUSE = 0x13, + VK_CAPITAL = 0x14, + VK_KANA = 0x15, + VK_HANGEUL = 0x15, + VK_HANGUL = 0x15, + VK_JUNJA = 0x17, + VK_FINAL = 0x18, + VK_HANJA = 0x19, + VK_KANJI = 0x19, + VK_ESCAPE = 0x1B, + VK_CONVERT = 0x1C, + VK_NONCONVERT = 0x1D, + VK_ACCEPT = 0x1E, + VK_MODECHANGE = 0x1F, + VK_SPACE = 0x20, + VK_PRIOR = 0x21, + VK_NEXT = 0x22, + VK_END = 0x23, + VK_HOME = 0x24, + VK_LEFT = 0x25, + VK_UP = 0x26, + VK_RIGHT = 0x27, + VK_DOWN = 0x28, + VK_SELECT = 0x29, + VK_PRINT = 0x2A, + VK_EXECUTE = 0x2B, + VK_SNAPSHOT = 0x2C, + VK_INSERT = 0x2D, + VK_DELETE = 0x2E, + VK_HELP = 0x2F, + VK_LWIN = 0x5B, + VK_RWIN = 0x5C, + VK_APPS = 0x5D, + VK_SLEEP = 0x5F, + VK_NUMPAD0 = 0x60, + VK_NUMPAD1 = 0x61, + VK_NUMPAD2 = 0x62, + VK_NUMPAD3 = 0x63, + VK_NUMPAD4 = 0x64, + VK_NUMPAD5 = 0x65, + VK_NUMPAD6 = 0x66, + VK_NUMPAD7 = 0x67, + VK_NUMPAD8 = 0x68, + VK_NUMPAD9 = 0x69, + VK_MULTIPLY = 0x6A, + VK_ADD = 0x6B, + VK_SEPARATOR = 0x6C, + VK_SUBTRACT = 0x6D, + VK_DECIMAL = 0x6E, + VK_DIVIDE = 0x6F, + VK_F1 = 0x70, + VK_F2 = 0x71, + VK_F3 = 0x72, + VK_F4 = 0x73, + VK_F5 = 0x74, + VK_F6 = 0x75, + VK_F7 = 0x76, + VK_F8 = 0x77, + VK_F9 = 0x78, + VK_F10 = 0x79, + VK_F11 = 0x7A, + VK_F12 = 0x7B, + VK_F13 = 0x7C, + VK_F14 = 0x7D, + VK_F15 = 0x7E, + VK_F16 = 0x7F, + VK_F17 = 0x80, + VK_F18 = 0x81, + VK_F19 = 0x82, + VK_F20 = 0x83, + VK_F21 = 0x84, + VK_F22 = 0x85, + VK_F23 = 0x86, + VK_F24 = 0x87, + VK_NUMLOCK = 0x90, + VK_SCROLL = 0x91, + VK_OEM_NEC_EQUAL = 0x92, + VK_OEM_FJ_JISHO = 0x92, + VK_OEM_FJ_MASSHOU = 0x93, + VK_OEM_FJ_TOUROKU = 0x94, + VK_OEM_FJ_LOYA = 0x95, + VK_OEM_FJ_ROYA = 0x96, + VK_LSHIFT = 0xA0, + VK_RSHIFT = 0xA1, + VK_LCONTROL = 0xA2, + VK_RCONTROL = 0xA3, + VK_LMENU = 0xA4, + VK_RMENU = 0xA5, + VK_BROWSER_BACK = 0xA6, + VK_BROWSER_FORWARD = 0xA7, + VK_BROWSER_REFRESH = 0xA8, + VK_BROWSER_STOP = 0xA9, + VK_BROWSER_SEARCH = 0xAA, + VK_BROWSER_FAVORITES = 0xAB, + VK_BROWSER_HOME = 0xAC, + VK_VOLUME_MUTE = 0xAD, + VK_VOLUME_DOWN = 0xAE, + VK_VOLUME_UP = 0xAF, + VK_MEDIA_NEXT_TRACK = 0xB0, + VK_MEDIA_PREV_TRACK = 0xB1, + VK_MEDIA_STOP = 0xB2, + VK_MEDIA_PLAY_PAUSE = 0xB3, + VK_LAUNCH_MAIL = 0xB4, + VK_LAUNCH_MEDIA_SELECT = 0xB5, + VK_LAUNCH_APP1 = 0xB6, + VK_LAUNCH_APP2 = 0xB7, + VK_OEM_1 = 0xBA, + VK_OEM_PLUS = 0xBB, + VK_OEM_COMMA = 0xBC, + VK_OEM_MINUS = 0xBD, + VK_OEM_PERIOD = 0xBE, + VK_OEM_2 = 0xBF, + VK_OEM_3 = 0xC0, + VK_OEM_4 = 0xDB, + VK_OEM_5 = 0xDC, + VK_OEM_6 = 0xDD, + VK_OEM_7 = 0xDE, + VK_OEM_8 = 0xDF, + VK_OEM_AX = 0xE1, + VK_OEM_102 = 0xE2, + VK_ICO_HELP = 0xE3, + VK_ICO_00 = 0xE4, + VK_PROCESSKEY = 0xE5, + VK_ICO_CLEAR = 0xE6, + VK_PACKET = 0xE7, + VK_OEM_RESET = 0xE9, + VK_OEM_JUMP = 0xEA, + VK_OEM_PA1 = 0xEB, + VK_OEM_PA2 = 0xEC, + VK_OEM_PA3 = 0xED, + VK_OEM_WSCTRL = 0xEE, + VK_OEM_CUSEL = 0xEF, + VK_OEM_ATTN = 0xF0, + VK_OEM_FINISH = 0xF1, + VK_OEM_COPY = 0xF2, + VK_OEM_AUTO = 0xF3, + VK_OEM_ENLW = 0xF4, + VK_OEM_BACKTAB = 0xF5, + VK_ATTN = 0xF6, + VK_CRSEL = 0xF7, + VK_EXSEL = 0xF8, + VK_EREOF = 0xF9, + VK_PLAY = 0xFA, + VK_ZOOM = 0xFB, + VK_NONAME = 0xFC, + VK_PA1 = 0xFD, + VK_OEM_CLEAR = 0xFE; + + /** XButton values. */ + public static final int + XBUTTON1 = 0x1, + XBUTTON2 = 0x2; + + /** Value for rolling one detent. */ + public static final int WHEEL_DELTA = 120; + + /** + * Identifies the dots per inch (dpi) setting for a thread, process, or window. ({@code DPI_AWARENESS}) + * + *
Enum values:
+ * + *
    + *
  • {@link #DPI_AWARENESS_INVALID DPI_AWARENESS_INVALID} - + * Invalid DPI awareness. + * + *

    This is an invalid DPI awareness value.

    + *
  • + *
  • {@link #DPI_AWARENESS_UNAWARE DPI_AWARENESS_UNAWARE} - + * DPI unaware. + * + *

    This process does not scale for DPI changes and is always assumed to have a scale factor of 100% (96 DPI). It will be automatically scaled by the + * system on any other DPI setting.

    + *
  • + *
  • {@link #DPI_AWARENESS_SYSTEM_AWARE DPI_AWARENESS_SYSTEM_AWARE} - + * System DPI aware. + * + *

    This process does not scale for DPI changes. It will query for the DPI once and use that value for the lifetime of the process. If the DPI changes, + * the process will not adjust to the new DPI value. It will be automatically scaled up or down by the system when the DPI changes from the system + * value.

    + *
  • + *
  • {@link #DPI_AWARENESS_PER_MONITOR_AWARE DPI_AWARENESS_PER_MONITOR_AWARE} - + * Per monitor DPI aware. + * + *

    This process checks for the DPI when it is created and adjusts the scale factor whenever the DPI changes. These processes are not automatically + * scaled by the system.

    + *
  • + *
+ */ + public static final int + DPI_AWARENESS_INVALID = -1, + DPI_AWARENESS_UNAWARE = 0, + DPI_AWARENESS_SYSTEM_AWARE = 1, + DPI_AWARENESS_PER_MONITOR_AWARE = 2; + + /** + * DPI unaware. + * + *

This window does not scale for DPI changes and is always assumed to have a scale factor of 100% (96 DPI). It will be automatically scaled by the system + * on any other DPI setting.

+ */ + public static final long DPI_AWARENESS_CONTEXT_UNAWARE = -1L; + + /** + * System DPI aware. + * + *

This window does not scale for DPI changes. It will query for the DPI once and use that value for the lifetime of the process. If the DPI changes, the + * process will not adjust to the new DPI value. It will be automatically scaled up or down by the system when the DPI changes from the system value.

+ */ + public static final long DPI_AWARENESS_CONTEXT_SYSTEM_AWARE = -2L; + + /** + * Per monitor DPI aware. + * + *

This window checks for the DPI when it is created and adjusts the scale factor whenever the DPI changes. These processes are not automatically scaled + * by the system.

+ */ + public static final long DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE = -3L; + + /** + * Also known as Per Monitor v2. + * + *

An advancement over the original per-monitor DPI awareness mode, which enables applications to access new DPI-related scaling behaviors on a per + * top-level window basis.

+ * + *

Per Monitor v2 was made available in the Creators Update of Windows 10, and is not available on earlier versions of the operating system.

+ * + *

The additional behaviors introduced are as follows:

+ * + *
    + *
  • Child window DPI change notifications - In Per Monitor v2 contexts, the entire window tree is notified of any DPI changes that occur.
  • + *
  • Scaling of non-client area - All windows will automatically have their non-client area drawn in a DPI sensitive fashion. Calls to + * {@code EnableNonClientDpiScaling} are unnecessary.
  • + *
  • Scaling of Win32 menus - All {@code NTUSER} menus created in Per Monitor v2 contexts will be scaling in a per-monitor fashion.
  • + *
  • Dialog Scaling - Win32 dialogs created in Per Monitor v2 contexts will automatically respond to DPI changes.
  • + *
  • Improved scaling of {@code comctl32} controls - Various {@code comctl32} controls have improved DPI scaling behavior in Per Monitor v2 contexts.
  • + *
  • Improved theming behavior - {@code UxTheme} handles opened in the context of a Per Monitor v2 window will operate in terms of the DPI associated + * with that window.
  • + *
+ */ + public static final long DPI_AWARENESS_CONTEXT_PER_MONITOR_AWARE_V2 = -4L; + + /** {@link WINDOWPLACEMENT} flags. */ + public static final int + WPF_SETMINPOSITION = 0x1, + WPF_RESTORETOMAXIMIZED = 0x2, + WPF_ASYNCWINDOWPLACEMENT = 0x4; + + /** Actions for {@link #SetLayeredWindowAttributes}. */ + public static final int + LWA_COLORKEY = 0x1, + LWA_ALPHA = 0x2; + + /** {@link #GetSystemMetrics} codes. */ + public static final int + SM_CXSCREEN = 0, + SM_CYSCREEN = 1, + SM_CXVSCROLL = 2, + SM_CYHSCROLL = 3, + SM_CYCAPTION = 4, + SM_CXBORDER = 5, + SM_CYBORDER = 6, + SM_CXDLGFRAME = 7, + SM_CYDLGFRAME = 8, + SM_CYVTHUMB = 9, + SM_CXHTHUMB = 10, + SM_CXICON = 11, + SM_CYICON = 12, + SM_CXCURSOR = 13, + SM_CYCURSOR = 14, + SM_CYMENU = 15, + SM_CXFULLSCREEN = 16, + SM_CYFULLSCREEN = 17, + SM_CYKANJIWINDOW = 18, + SM_MOUSEPRESENT = 19, + SM_CYVSCROLL = 20, + SM_CXHSCROLL = 21, + SM_DEBUG = 22, + SM_SWAPBUTTON = 23, + SM_RESERVED1 = 24, + SM_RESERVED2 = 25, + SM_RESERVED3 = 26, + SM_RESERVED4 = 27, + SM_CXMIN = 28, + SM_CYMIN = 29, + SM_CXSIZE = 30, + SM_CYSIZE = 31, + SM_CXFRAME = 32, + SM_CYFRAME = 33, + SM_CXMINTRACK = 34, + SM_CYMINTRACK = 35, + SM_CXDOUBLECLK = 36, + SM_CYDOUBLECLK = 37, + SM_CXICONSPACING = 38, + SM_CYICONSPACING = 39, + SM_MENUDROPALIGNMENT = 40, + SM_PENWINDOWS = 41, + SM_DBCSENABLED = 42, + SM_CMOUSEBUTTONS = 43, + SM_CXFIXEDFRAME = SM_CXDLGFRAME, + SM_CYFIXEDFRAME = SM_CYDLGFRAME, + SM_CXSIZEFRAME = SM_CXFRAME, + SM_CYSIZEFRAME = SM_CYFRAME, + SM_SECURE = 44, + SM_CXEDGE = 45, + SM_CYEDGE = 46, + SM_CXMINSPACING = 47, + SM_CYMINSPACING = 48, + SM_CXSMICON = 49, + SM_CYSMICON = 50, + SM_CYSMCAPTION = 51, + SM_CXSMSIZE = 52, + SM_CYSMSIZE = 53, + SM_CXMENUSIZE = 54, + SM_CYMENUSIZE = 55, + SM_ARRANGE = 56, + SM_CXMINIMIZED = 57, + SM_CYMINIMIZED = 58, + SM_CXMAXTRACK = 59, + SM_CYMAXTRACK = 60, + SM_CXMAXIMIZED = 61, + SM_CYMAXIMIZED = 62, + SM_NETWORK = 63, + SM_CLEANBOOT = 67, + SM_CXDRAG = 68, + SM_CYDRAG = 69, + SM_SHOWSOUNDS = 70, + SM_CXMENUCHECK = 71, + SM_CYMENUCHECK = 72, + SM_SLOWMACHINE = 73, + SM_MIDEASTENABLED = 74, + SM_MOUSEWHEELPRESENT = 75, + SM_XVIRTUALSCREEN = 76, + SM_YVIRTUALSCREEN = 77, + SM_CXVIRTUALSCREEN = 78, + SM_CYVIRTUALSCREEN = 79, + SM_CMONITORS = 80, + SM_SAMEDISPLAYFORMAT = 81, + SM_IMMENABLED = 82, + SM_REMOTESESSION = 0x1000, + SM_SHUTTINGDOWN = 0x2000, + SM_REMOTECONTROL = 0x2001, + SM_CARETBLINKINGENABLED = 0x2002, + SM_CXFOCUSBORDER = 83, + SM_CYFOCUSBORDER = 84, + SM_TABLETPC = 86, + SM_MEDIACENTER = 87, + SM_STARTER = 88, + SM_SERVERR2 = 89, + SM_MOUSEHORIZONTALWHEELPRESENT = 91, + SM_CXPADDEDBORDER = 92, + SM_DIGITIZER = 94, + SM_MAXIMUMTOUCHES = 95; + + /** {@link #RegisterTouchWindow} flags. */ + public static final int + TWF_FINETOUCH = 0x1, + TWF_WANTPALM = 0x2; + + /** Touch input flag values ({@link TOUCHINPUT#dwFlags}). */ + public static final int + TOUCHEVENTF_MOVE = 0x1, + TOUCHEVENTF_DOWN = 0x2, + TOUCHEVENTF_UP = 0x4, + TOUCHEVENTF_INRANGE = 0x8, + TOUCHEVENTF_PRIMARY = 0x10, + TOUCHEVENTF_NOCOALESCE = 0x20, + TOUCHEVENTF_PEN = 0x40, + TOUCHEVENTF_PALM = 0x80; + + /** Touch input mask values ({@link TOUCHINPUT#dwMask}). */ + public static final int + TOUCHINPUTMASKF_TIMEFROMSYSTEM = 0x1, + TOUCHINPUTMASKF_EXTRAINFO = 0x2, + TOUCHINPUTMASKF_CONTACTAREA = 0x4; + + /** {@link #MonitorFromWindow} flags. */ + public static final int + MONITOR_DEFAULTTONULL = 0x0, + MONITOR_DEFAULTTOPRIMARY = 0x1, + MONITOR_DEFAULTTONEAREST = 0x2; + + /** {@link MONITORINFOEX} flags. */ + public static final int MONITORINFOF_PRIMARY = 0x1; + + /** Flag for {@link #EnumDisplayDevices}. */ + public static final int EDD_GET_DEVICE_INTERFACE_NAME = 0x1; + + /** {@link #EnumDisplaySettingsEx} mode. */ + public static final int + ENUM_CURRENT_SETTINGS = -1, + ENUM_REGISTRY_SETTINGS = -2; + + /** Flags for {@link #EnumDisplaySettingsEx}. */ + public static final int + EDS_RAWMODE = 0x2, + EDS_ROTATEDMODE = 0x4; + + /** Flags for {@link #ChangeDisplaySettingsEx}. */ + public static final int + CDS_UPDATEREGISTRY = 0x1, + CDS_TEST = 0x2, + CDS_FULLSCREEN = 0x4, + CDS_GLOBAL = 0x8, + CDS_SET_PRIMARY = 0x10, + CDS_VIDEOPARAMETERS = 0x20, + CDS_ENABLE_UNSAFE_MODES = 0x100, + CDS_DISABLE_UNSAFE_MODES = 0x200, + CDS_RESET = 0x40000000, + CDS_RESET_EX = 0x20000000, + CDS_NORESET = 0x10000000; + + /** Return values for {@link #ChangeDisplaySettingsEx}. */ + public static final int + DISP_CHANGE_SUCCESSFUL = 0, + DISP_CHANGE_RESTART = 1, + DISP_CHANGE_FAILED = -1, + DISP_CHANGE_BADMODE = -2, + DISP_CHANGE_NOTUPDATED = -3, + DISP_CHANGE_BADFLAGS = -4, + DISP_CHANGE_BADPARAM = -5, + DISP_CHANGE_BADDUALVIEW = -6; + + /** The type of input event. */ + public static final int + INPUT_MOUSE = 0, + INPUT_KEYBOARD = 1, + INPUT_HARDWARE = 2; + + /** {@link MOUSEINPUT} flags. */ + public static final int + MOUSEEVENTF_ABSOLUTE = 0x8000, + MOUSEEVENTF_HWHEEL = 0x1000, + MOUSEEVENTF_MOVE = 0x1, + MOUSEEVENTF_MOVE_NOCOALESCE = 0x2000, + MOUSEEVENTF_LEFTDOWN = 0x2, + MOUSEEVENTF_LEFTUP = 0x4, + MOUSEEVENTF_RIGHTDOWN = 0x8, + MOUSEEVENTF_RIGHTUP = 0x10, + MOUSEEVENTF_MIDDLEDOWN = 0x20, + MOUSEEVENTF_MIDDLEUP = 0x40, + MOUSEEVENTF_VIRTUALDESK = 0x4000, + MOUSEEVENTF_WHEEL = 0x800, + MOUSEEVENTF_XDOWN = 0x80, + MOUSEEVENTF_XUP = 0x100; + + /** {@link KEYBDINPUT} flags. */ + public static final int + KEYEVENTF_EXTENDEDKEY = 0x1, + KEYEVENTF_KEYUP = 0x2, + KEYEVENTF_SCANCODE = 0x8, + KEYEVENTF_UNICODE = 0x4; + + protected User32() { + throw new UnsupportedOperationException(); + } + + private static final SharedLibrary USER32 = Library.loadNative(User32.class, "org.lwjgl", "user32"); + + /** Contains the function pointers loaded from the user32 {@link SharedLibrary}. */ + public static final class Functions { + + private Functions() {} + + /** Function address. */ + public static final long + RegisterClassEx = apiGetFunctionAddress(USER32, "RegisterClassExW"), + UnregisterClass = apiGetFunctionAddress(USER32, "UnregisterClassW"), + CreateWindowEx = apiGetFunctionAddress(USER32, "CreateWindowExW"), + DestroyWindow = apiGetFunctionAddress(USER32, "DestroyWindow"), + DefWindowProc = apiGetFunctionAddress(USER32, "DefWindowProcW"), + CallWindowProc = apiGetFunctionAddress(USER32, "CallWindowProcW"), + ShowWindow = apiGetFunctionAddress(USER32, "ShowWindow"), + UpdateWindow = apiGetFunctionAddress(USER32, "UpdateWindow"), + SetWindowPos = apiGetFunctionAddress(USER32, "SetWindowPos"), + SetWindowText = apiGetFunctionAddress(USER32, "SetWindowTextW"), + GetMessage = apiGetFunctionAddress(USER32, "GetMessageW"), + PeekMessage = apiGetFunctionAddress(USER32, "PeekMessageW"), + TranslateMessage = apiGetFunctionAddress(USER32, "TranslateMessage"), + WaitMessage = apiGetFunctionAddress(USER32, "WaitMessage"), + DispatchMessage = apiGetFunctionAddress(USER32, "DispatchMessageW"), + PostMessage = apiGetFunctionAddress(USER32, "PostMessageW"), + SendMessage = apiGetFunctionAddress(USER32, "SendMessageW"), + AdjustWindowRectEx = apiGetFunctionAddress(USER32, "AdjustWindowRectEx"), + GetWindowRect = apiGetFunctionAddress(USER32, "GetWindowRect"), + MoveWindow = apiGetFunctionAddress(USER32, "MoveWindow"), + GetWindowPlacement = apiGetFunctionAddress(USER32, "GetWindowPlacement"), + SetWindowPlacement = apiGetFunctionAddress(USER32, "SetWindowPlacement"), + IsWindowVisible = apiGetFunctionAddress(USER32, "IsWindowVisible"), + IsIconic = apiGetFunctionAddress(USER32, "IsIconic"), + IsZoomed = apiGetFunctionAddress(USER32, "IsZoomed"), + BringWindowToTop = apiGetFunctionAddress(USER32, "BringWindowToTop"), + SetWindowLongPtr = apiGetFunctionAddress(USER32, Pointer.BITS64 ? "SetWindowLongPtrW" : "SetWindowLongW"), + GetWindowLongPtr = apiGetFunctionAddress(USER32, Pointer.BITS64 ? "GetWindowLongPtrW" : "GetWindowLongW"), + SetClassLongPtr = apiGetFunctionAddress(USER32, Pointer.BITS64 ? "SetClassLongPtrW" : "SetClassLongW"), + GetClassLongPtr = apiGetFunctionAddress(USER32, Pointer.BITS64 ? "GetClassLongPtrW" : "GetClassLongW"), + SetLayeredWindowAttributes = apiGetFunctionAddress(USER32, "SetLayeredWindowAttributes"), + LoadIcon = apiGetFunctionAddress(USER32, "LoadIconW"), + LoadCursor = apiGetFunctionAddress(USER32, "LoadCursorW"), + GetDC = apiGetFunctionAddress(USER32, "GetDC"), + ReleaseDC = apiGetFunctionAddress(USER32, "ReleaseDC"), + GetSystemMetrics = apiGetFunctionAddress(USER32, "GetSystemMetrics"), + RegisterTouchWindow = USER32.getFunctionAddress("RegisterTouchWindow"), + UnregisterTouchWindow = USER32.getFunctionAddress("UnregisterTouchWindow"), + IsTouchWindow = USER32.getFunctionAddress("IsTouchWindow"), + GetTouchInputInfo = USER32.getFunctionAddress("GetTouchInputInfo"), + CloseTouchInputHandle = USER32.getFunctionAddress("CloseTouchInputHandle"), + MonitorFromWindow = apiGetFunctionAddress(USER32, "MonitorFromWindow"), + GetMonitorInfo = apiGetFunctionAddress(USER32, "GetMonitorInfoW"), + EnumDisplayDevices = apiGetFunctionAddress(USER32, "EnumDisplayDevicesW"), + EnumDisplaySettingsEx = apiGetFunctionAddress(USER32, "EnumDisplaySettingsExW"), + ChangeDisplaySettingsEx = apiGetFunctionAddress(USER32, "ChangeDisplaySettingsExW"), + GetCursorPos = apiGetFunctionAddress(USER32, "GetCursorPos"), + SetCursorPos = apiGetFunctionAddress(USER32, "SetCursorPos"), + ClipCursor = apiGetFunctionAddress(USER32, "ClipCursor"), + ShowCursor = apiGetFunctionAddress(USER32, "ShowCursor"), + SetCursor = apiGetFunctionAddress(USER32, "SetCursor"), + ClientToScreen = apiGetFunctionAddress(USER32, "ClientToScreen"), + GetAsyncKeyState = apiGetFunctionAddress(USER32, "GetAsyncKeyState"), + GetMessageExtraInfo = apiGetFunctionAddress(USER32, "GetMessageExtraInfo"), + SendInput = apiGetFunctionAddress(USER32, "SendInput"), + GetDpiForSystem = USER32.getFunctionAddress("GetDpiForSystem"), + GetDpiForWindow = USER32.getFunctionAddress("GetDpiForWindow"), + GetAwarenessFromDpiAwarenessContext = USER32.getFunctionAddress("GetAwarenessFromDpiAwarenessContext"), + GetThreadDpiAwarenessContext = USER32.getFunctionAddress("GetThreadDpiAwarenessContext"), + GetWindowDpiAwarenessContext = USER32.getFunctionAddress("GetWindowDpiAwarenessContext"), + IsValidDpiAwarenessContext = USER32.getFunctionAddress("IsValidDpiAwarenessContext"), + SetThreadDpiAwarenessContext = USER32.getFunctionAddress("SetThreadDpiAwarenessContext"); + + } + + /** Returns the user32 {@link SharedLibrary}. */ + public static SharedLibrary getLibrary() { + return USER32; + } + + // --- [ RegisterClassEx ] --- + + /** Unsafe version of: {@link #RegisterClassEx} */ + public static native short nRegisterClassEx(long lpwcx, long __functionAddress); + + /** Unsafe version of: {@link #RegisterClassEx} */ + public static short nRegisterClassEx(long lpwcx) { + long __functionAddress = Functions.RegisterClassEx; + if (CHECKS) { + WNDCLASSEX.validate(lpwcx); + } + return nRegisterClassEx(lpwcx, __functionAddress); + } + + /** + * Registers a window class for subsequent use in calls to the {@link #CreateWindowEx} function. + * + * @param lpwcx a {@link WNDCLASSEX} structure. You must fill the structure with the appropriate class attributes before passing it to the function. + */ + @NativeType("ATOM") + public static short RegisterClassEx(@NativeType("WNDCLASSEX const *") WNDCLASSEX lpwcx) { + return nRegisterClassEx(lpwcx.address()); + } + + // --- [ UnregisterClass ] --- + + /** Unsafe version of: {@link #UnregisterClass} */ + public static native int nUnregisterClass(long lpClassName, long hInstance, long __functionAddress); + + /** Unsafe version of: {@link #UnregisterClass} */ + public static int nUnregisterClass(long lpClassName, long hInstance) { + long __functionAddress = Functions.UnregisterClass; + return nUnregisterClass(lpClassName, hInstance, __functionAddress); + } + + /** + * Unregisters a window class, freeing the memory required for the class. + * + * @param lpClassName a null-terminated string or a class atom. If {@code lpClassName} is a string, it specifies the window class name. This class name must have been + * registered by a previous call to the {@link #RegisterClassEx} function. System classes, such as dialog box controls, cannot be unregistered. If this + * parameter is an atom, it must be a class atom created by a previous call to the {@link #RegisterClassEx} function. The atom must be in the low-order + * word of {@code lpClassName}; the high-order word must be zero. + * @param hInstance a handle to the instance of the module that created the class + */ + @NativeType("BOOL") + public static boolean UnregisterClass(@NativeType("LPCTSTR") ByteBuffer lpClassName, @NativeType("HINSTANCE") long hInstance) { + if (CHECKS) { + checkNT2(lpClassName); + } + return nUnregisterClass(memAddress(lpClassName), hInstance) != 0; + } + + /** + * Unregisters a window class, freeing the memory required for the class. + * + * @param lpClassName a null-terminated string or a class atom. If {@code lpClassName} is a string, it specifies the window class name. This class name must have been + * registered by a previous call to the {@link #RegisterClassEx} function. System classes, such as dialog box controls, cannot be unregistered. If this + * parameter is an atom, it must be a class atom created by a previous call to the {@link #RegisterClassEx} function. The atom must be in the low-order + * word of {@code lpClassName}; the high-order word must be zero. + * @param hInstance a handle to the instance of the module that created the class + */ + @NativeType("BOOL") + public static boolean UnregisterClass(@NativeType("LPCTSTR") CharSequence lpClassName, @NativeType("HINSTANCE") long hInstance) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF16(lpClassName, true); + long lpClassNameEncoded = stack.getPointerAddress(); + return nUnregisterClass(lpClassNameEncoded, hInstance) != 0; + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ CreateWindowEx ] --- + + /** Unsafe version of: {@link #CreateWindowEx} */ + public static native long nCreateWindowEx(int dwExStyle, long lpClassName, long lpWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, long hWndParent, long hMenu, long hInstance, long lpParam, long __functionAddress); + + /** Unsafe version of: {@link #CreateWindowEx} */ + public static long nCreateWindowEx(int dwExStyle, long lpClassName, long lpWindowName, int dwStyle, int x, int y, int nWidth, int nHeight, long hWndParent, long hMenu, long hInstance, long lpParam) { + long __functionAddress = Functions.CreateWindowEx; + return nCreateWindowEx(dwExStyle, lpClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam, __functionAddress); + } + + /** + * Creates an overlapped, pop-up, or child window with an extended window style; otherwise, this function is identical to the CreateWindow function. + * + * @param dwExStyle the extended window style of the window being created + * @param lpClassName a null-terminated string or a class atom created by a previous call to the {@link #RegisterClassEx(WNDCLASSEX)} function. + * @param lpWindowName the window name. If the window style specifies a title bar, the window title pointed to by {@code lpWindowName} is displayed in the title bar. + * @param dwStyle the style of the window being created + * @param x the initial horizontal position of the window + * @param y the initial vertical position of the window + * @param nWidth the width, in device units, of the window + * @param nHeight the height, in device units, of the window + * @param hWndParent a handle to the parent or owner window of the window being created. To create a child window or an owned window, supply a valid window handle. + * @param hMenu a handle to a menu, or specifies a child-window identifier, depending on the window style + * @param hInstance a handle to the instance of the module to be associated with the window + * @param lpParam a value to be passed to the window through the {@code CREATESTRUCT} structure ({@code createParams} member) pointed to by the {@code lParam} param + * of the {@link #WM_CREATE} message. + */ + @NativeType("HWND") + public static long CreateWindowEx(@NativeType("DWORD") int dwExStyle, @Nullable @NativeType("LPCTSTR") ByteBuffer lpClassName, @Nullable @NativeType("LPCTSTR") ByteBuffer lpWindowName, @NativeType("DWORD") int dwStyle, int x, int y, int nWidth, int nHeight, @NativeType("HWND") long hWndParent, @NativeType("HMENU") long hMenu, @NativeType("HINSTANCE") long hInstance, @NativeType("LPVOID") long lpParam) { + if (CHECKS) { + checkNT2Safe(lpClassName); + checkNT2Safe(lpWindowName); + } + return nCreateWindowEx(dwExStyle, memAddressSafe(lpClassName), memAddressSafe(lpWindowName), dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam); + } + + /** + * Creates an overlapped, pop-up, or child window with an extended window style; otherwise, this function is identical to the CreateWindow function. + * + * @param dwExStyle the extended window style of the window being created + * @param lpClassName a null-terminated string or a class atom created by a previous call to the {@link #RegisterClassEx(WNDCLASSEX)} function. + * @param lpWindowName the window name. If the window style specifies a title bar, the window title pointed to by {@code lpWindowName} is displayed in the title bar. + * @param dwStyle the style of the window being created + * @param x the initial horizontal position of the window + * @param y the initial vertical position of the window + * @param nWidth the width, in device units, of the window + * @param nHeight the height, in device units, of the window + * @param hWndParent a handle to the parent or owner window of the window being created. To create a child window or an owned window, supply a valid window handle. + * @param hMenu a handle to a menu, or specifies a child-window identifier, depending on the window style + * @param hInstance a handle to the instance of the module to be associated with the window + * @param lpParam a value to be passed to the window through the {@code CREATESTRUCT} structure ({@code createParams} member) pointed to by the {@code lParam} param + * of the {@link #WM_CREATE} message. + */ + @NativeType("HWND") + public static long CreateWindowEx(@NativeType("DWORD") int dwExStyle, @Nullable @NativeType("LPCTSTR") CharSequence lpClassName, @Nullable @NativeType("LPCTSTR") CharSequence lpWindowName, @NativeType("DWORD") int dwStyle, int x, int y, int nWidth, int nHeight, @NativeType("HWND") long hWndParent, @NativeType("HMENU") long hMenu, @NativeType("HINSTANCE") long hInstance, @NativeType("LPVOID") long lpParam) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF16Safe(lpClassName, true); + long lpClassNameEncoded = lpClassName == null ? NULL : stack.getPointerAddress(); + stack.nUTF16Safe(lpWindowName, true); + long lpWindowNameEncoded = lpWindowName == null ? NULL : stack.getPointerAddress(); + return nCreateWindowEx(dwExStyle, lpClassNameEncoded, lpWindowNameEncoded, dwStyle, x, y, nWidth, nHeight, hWndParent, hMenu, hInstance, lpParam); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ DestroyWindow ] --- + + /** Unsafe version of: {@link #DestroyWindow} */ + public static native int nDestroyWindow(long hWnd, long __functionAddress); + + /** + * Destroys the specified window. The function sends {@link #WM_DESTROY} and {@link #WM_NCDESTROY} messages to the window to deactivate it and remove the keyboard focus + * from it. The function also destroys the window's menu, flushes the thread message queue, destroys timers, removes clipboard ownership, and breaks the + * clipboard viewer chain (if the window is at the top of the viewer chain). + * + *

If the specified window is a parent or owner window, DestroyWindow automatically destroys the associated child or owned windows when it destroys the + * parent or owner window. The function first destroys child or owned windows, and then it destroys the parent or owner window.

+ * + * @param hWnd a handle to the window to be destroyed + */ + @NativeType("BOOL") + public static boolean DestroyWindow(@NativeType("HWND") long hWnd) { + long __functionAddress = Functions.DestroyWindow; + if (CHECKS) { + check(hWnd); + } + return nDestroyWindow(hWnd, __functionAddress) != 0; + } + + // --- [ DefWindowProc ] --- + + /** + * Calls the default window procedure to provide default processing for any window messages that an application does not process. This function ensures + * that every message is processed. DefWindowProc is called with the same parameters received by the window procedure. + * + * @param hWnd a handle to the window that received the message + * @param Msg the message + * @param wParam additional message information. The content of this parameter depends on the value of the {@code Msg} parameter. + * @param lParam additional message information. The content of this parameter depends on the value of the {@code Msg} parameter. + */ + @NativeType("LRESULT") + public static long DefWindowProc(@NativeType("HWND") long hWnd, @NativeType("UINT") int Msg, @NativeType("WPARAM") long wParam, @NativeType("LPARAM") long lParam) { + long __functionAddress = Functions.DefWindowProc; + if (CHECKS) { + check(hWnd); + } + return callPPPP(hWnd, Msg, wParam, lParam, __functionAddress); + } + + // --- [ CallWindowProc ] --- + + /** Unsafe version of: {@link #CallWindowProc} */ + public static long nCallWindowProc(long lpPrevWndFunc, long hWnd, int Msg, long wParam, long lParam) { + long __functionAddress = Functions.CallWindowProc; + if (CHECKS) { + check(hWnd); + } + return callPPPPP(lpPrevWndFunc, hWnd, Msg, wParam, lParam, __functionAddress); + } + + /** + * Passes message information to the specified window procedure. + * + * @param lpPrevWndFunc the previous window procedure. + * + *

If this value is obtained by calling the {@link #GetWindowLongPtr} function with the {@code nIndex} parameter set to {@link #GWL_WNDPROC} or {@code DWL_DLGPROC}, + * it is actually either the address of a window or dialog box procedure, or a special internal value meaningful only to {@code CallWindowProc}.

+ * @param hWnd a handle to the window procedure to receive the message + * @param Msg the message + * @param wParam additional message information. The content of this parameter depends on the value of the {@code Msg} parameter. + * @param lParam additional message information. The content of this parameter depends on the value of the {@code Msg} parameter. + */ + @NativeType("LRESULT") + public static long CallWindowProc(@NativeType("WNDPROC") WindowProcI lpPrevWndFunc, @NativeType("HWND") long hWnd, @NativeType("UINT") int Msg, @NativeType("WPARAM") long wParam, @NativeType("LPARAM") long lParam) { + return nCallWindowProc(lpPrevWndFunc.address(), hWnd, Msg, wParam, lParam); + } + + // --- [ ShowWindow ] --- + + /** + * Sets the specified window's show state. + * + * @param hWnd a handle to the window + * @param nCmdShow controls how the window is to be shown. This parameter is ignored the first time an application calls {@code ShowWindow}, if the program that + * launched the application provides a {@code STARTUPINFO} structure. Otherwise, the first time {@code ShowWindow} is called, the value should be the + * value obtained by the {@code WinMain} function in its {@code nCmdShow} parameter. In subsequent calls, this parameter can be one of:
{@link #SW_HIDE}{@link #SW_SHOWNORMAL}{@link #SW_NORMAL}{@link #SW_SHOWMINIMIZED}{@link #SW_SHOWMAXIMIZED}{@link #SW_MAXIMIZE}
{@link #SW_SHOWNOACTIVATE}{@link #SW_SHOW}{@link #SW_MINIMIZE}{@link #SW_SHOWMINNOACTIVE}{@link #SW_SHOWNA}{@link #SW_RESTORE}
{@link #SW_SHOWDEFAULT}{@link #SW_FORCEMINIMIZE}{@link #SW_MAX}
+ */ + @NativeType("BOOL") + public static boolean ShowWindow(@NativeType("HWND") long hWnd, int nCmdShow) { + long __functionAddress = Functions.ShowWindow; + if (CHECKS) { + check(hWnd); + } + return callPI(hWnd, nCmdShow, __functionAddress) != 0; + } + + // --- [ UpdateWindow ] --- + + /** + * Updates the client area of the specified window by sending a {@link #WM_PAINT} message to the window if the window's update region is not empty. The function + * sends a {@link #WM_PAINT} message directly to the window procedure of the specified window, bypassing the application queue. If the update region is empty, no + * message is sent. + * + * @param hWnd handle to the window to be updated + */ + @NativeType("BOOL") + public static boolean UpdateWindow(@NativeType("HWND") long hWnd) { + long __functionAddress = Functions.UpdateWindow; + if (CHECKS) { + check(hWnd); + } + return callPI(hWnd, __functionAddress) != 0; + } + + // --- [ SetWindowPos ] --- + + /** Unsafe version of: {@link #SetWindowPos} */ + public static native int nSetWindowPos(long hWnd, long hWndInsertAfter, int X, int Y, int cx, int cy, int uFlags, long __functionAddress); + + /** + * Changes the size, position, and Z order of a child, pop-up, or top-level window. These windows are ordered according to their appearance on the screen. + * The topmost window receives the highest rank and is the first window in the Z order. + * + * @param hWnd a handle to the window + * @param hWndInsertAfter a handle to the window to precede the positioned window in the Z order. This parameter must be a window handle or one of:
{@link #HWND_TOP}{@link #HWND_BOTTOM}{@link #HWND_TOPMOST}{@link #HWND_NOTOPMOST}
+ * @param X the new position of the left side of the window, in client coordinates + * @param Y the new position of the top of the window, in client coordinates + * @param cx the new width of the window, in pixels + * @param cy the new height of the window, in pixels + * @param uFlags the window sizing and positioning flags. One or more of:
{@link #SWP_NOSIZE}{@link #SWP_NOMOVE}{@link #SWP_NOZORDER}{@link #SWP_NOREDRAW}{@link #SWP_NOACTIVATE}
{@link #SWP_FRAMECHANGED}{@link #SWP_SHOWWINDOW}{@link #SWP_HIDEWINDOW}{@link #SWP_NOCOPYBITS}{@link #SWP_NOOWNERZORDER}
{@link #SWP_NOSENDCHANGING}{@link #SWP_DRAWFRAME}{@link #SWP_NOREPOSITION}{@link #SWP_DEFERERASE}{@link #SWP_ASYNCWINDOWPOS}
+ */ + @NativeType("BOOL") + public static boolean SetWindowPos(@NativeType("HWND") long hWnd, @NativeType("HWND") long hWndInsertAfter, int X, int Y, int cx, int cy, @NativeType("UINT") int uFlags) { + long __functionAddress = Functions.SetWindowPos; + if (CHECKS) { + check(hWnd); + } + return nSetWindowPos(hWnd, hWndInsertAfter, X, Y, cx, cy, uFlags, __functionAddress) != 0; + } + + // --- [ SetWindowText ] --- + + /** Unsafe version of: {@link #SetWindowText} */ + public static native int nSetWindowText(long hWnd, long lpString, long __functionAddress); + + /** Unsafe version of: {@link #SetWindowText} */ + public static int nSetWindowText(long hWnd, long lpString) { + long __functionAddress = Functions.SetWindowText; + if (CHECKS) { + check(hWnd); + } + return nSetWindowText(hWnd, lpString, __functionAddress); + } + + /** + * Changes the text of the specified window's title bar (if it has one). If the specified window is a control, the text of the control is changed. + * However, {@code SetWindowText} cannot change the text of a control in another application. + * + * @param hWnd a handle to the window or control whose text is to be changed + * @param lpString the new title or control text + */ + @NativeType("BOOL") + public static boolean SetWindowText(@NativeType("HWND") long hWnd, @NativeType("LPCTSTR") ByteBuffer lpString) { + if (CHECKS) { + checkNT2(lpString); + } + return nSetWindowText(hWnd, memAddress(lpString)) != 0; + } + + /** + * Changes the text of the specified window's title bar (if it has one). If the specified window is a control, the text of the control is changed. + * However, {@code SetWindowText} cannot change the text of a control in another application. + * + * @param hWnd a handle to the window or control whose text is to be changed + * @param lpString the new title or control text + */ + @NativeType("BOOL") + public static boolean SetWindowText(@NativeType("HWND") long hWnd, @NativeType("LPCTSTR") CharSequence lpString) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF16(lpString, true); + long lpStringEncoded = stack.getPointerAddress(); + return nSetWindowText(hWnd, lpStringEncoded) != 0; + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ GetMessage ] --- + + /** Unsafe version of: {@link #GetMessage} */ + public static native int nGetMessage(long lpMsg, long hWnd, int wMsgFilterMin, int wMsgFilterMax, long __functionAddress); + + /** Unsafe version of: {@link #GetMessage} */ + public static int nGetMessage(long lpMsg, long hWnd, int wMsgFilterMin, int wMsgFilterMax) { + long __functionAddress = Functions.GetMessage; + return nGetMessage(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, __functionAddress); + } + + /** + * Retrieves a message from the calling thread's message queue. The function dispatches incoming sent messages until a posted message is available for + * retrieval. Unlike GetMessage, the {@link #PeekMessage} function does not wait for a message to be posted before returning. + * + * @param lpMsg a pointer to an {@link MSG} structure that receives message information from the thread's message queue + * @param hWnd a handle to the window whose messages are to be retrieved. The window must belong to the current thread. + * + *

If {@code hWnd} is {@code NULL}, {@code GetMessage} retrieves messages for any window that belongs to the current thread, and any messages on the current + * thread's message queue whose {@code hwnd} value is {@code NULL} (see the {@link MSG} structure). Therefore if {@code hWnd} is {@code NULL}, both window messages and + * thread messages are processed.

+ * + *

If {@code hWnd} is -1, {@code GetMessage} retrieves only messages on the current thread's message queue whose {@code hwnd} value is {@code NULL}, that is, + * thread messages as posted by {@link #PostMessage} (when the {@code hWnd} parameter is {@code NULL}) or {@code PostThreadMessage}.

+ * @param wMsgFilterMin the integer value of the lowest message value to be retrieved + * @param wMsgFilterMax the integer value of the highest message value to be retrieved + */ + @NativeType("BOOL") + public static boolean GetMessage(@NativeType("LPMSG") MSG lpMsg, @NativeType("HWND") long hWnd, @NativeType("UINT") int wMsgFilterMin, @NativeType("UINT") int wMsgFilterMax) { + return nGetMessage(lpMsg.address(), hWnd, wMsgFilterMin, wMsgFilterMax) != 0; + } + + // --- [ PeekMessage ] --- + + /** Unsafe version of: {@link #PeekMessage} */ + public static int nPeekMessage(long lpMsg, long hWnd, int wMsgFilterMin, int wMsgFilterMax, int wRemoveMsg) { + long __functionAddress = Functions.PeekMessage; + return callPPI(lpMsg, hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg, __functionAddress); + } + + /** + * Dispatches incoming sent messages, checks the thread message queue for a posted message, and retrieves the message (if any exist). + * + * @param lpMsg a pointer to an {@link MSG} structure that receives message information + * @param hWnd a handle to the window whose messages are to be retrieved. The window must belong to the current thread. + * + *

If {@code hWnd} is {@code NULL}, {@code GetMessage} retrieves messages for any window that belongs to the current thread, and any messages on the current + * thread's message queue whose {@code hwnd} value is {@code NULL} (see the {@link MSG} structure). Therefore if {@code hWnd} is {@code NULL}, both window messages and + * thread messages are processed.

+ * + *

If {@code hWnd} is -1, {@code GetMessage} retrieves only messages on the current thread's message queue whose {@code hwnd} value is {@code NULL}, that is, + * thread messages as posted by {@link #PostMessage} (when the {@code hWnd} parameter is {@code NULL}) or {@code PostThreadMessage}.

+ * @param wMsgFilterMin the integer value of the lowest message value to be retrieved + * @param wMsgFilterMax the integer value of the highest message value to be retrieved + * @param wRemoveMsg specifies how messages are to be handled. One of:
{@link #PM_NOREMOVE}{@link #PM_REMOVE}{@link #PM_NOYIELD}
+ */ + @NativeType("BOOL") + public static boolean PeekMessage(@NativeType("LPMSG") MSG lpMsg, @NativeType("HWND") long hWnd, @NativeType("UINT") int wMsgFilterMin, @NativeType("UINT") int wMsgFilterMax, @NativeType("UINT") int wRemoveMsg) { + return nPeekMessage(lpMsg.address(), hWnd, wMsgFilterMin, wMsgFilterMax, wRemoveMsg) != 0; + } + + // --- [ TranslateMessage ] --- + + /** Unsafe version of: {@link #TranslateMessage} */ + public static int nTranslateMessage(long lpMsg) { + long __functionAddress = Functions.TranslateMessage; + return callPI(lpMsg, __functionAddress); + } + + /** + * Translates virtual-key messages into character messages. The character messages are posted to the calling thread's message queue, to be read the next + * time the thread calls the {@link #GetMessage} or {@link #PeekMessage} function. + * + * @param lpMsg an {@link MSG} structure that contains message information retrieved from the calling thread's message queue by using the {@link #GetMessage} or {@link #PeekMessage} + * function. + */ + @NativeType("BOOL") + public static boolean TranslateMessage(@NativeType("MSG const *") MSG lpMsg) { + return nTranslateMessage(lpMsg.address()) != 0; + } + + // --- [ WaitMessage ] --- + + /** Unsafe version of: {@link #WaitMessage} */ + public static native int nWaitMessage(long __functionAddress); + + /** + * Yields control to other threads when a thread has no other messages in its message queue. The WaitMessage function suspends the thread and does not + * return until a new message is placed in the thread's message queue. + */ + @NativeType("BOOL") + public static boolean WaitMessage() { + long __functionAddress = Functions.WaitMessage; + return nWaitMessage(__functionAddress) != 0; + } + + // --- [ DispatchMessage ] --- + + /** Unsafe version of: {@link #DispatchMessage} */ + public static long nDispatchMessage(long lpmsg) { + long __functionAddress = Functions.DispatchMessage; + return callPP(lpmsg, __functionAddress); + } + + /** + * Dispatches a message to a window procedure. It is typically used to dispatch a message retrieved by the {@link #GetMessage} function. + * + * @param lpmsg a pointer to a structure that contains the message. + */ + @NativeType("LRESULT") + public static long DispatchMessage(@NativeType("MSG const *") MSG lpmsg) { + return nDispatchMessage(lpmsg.address()); + } + + // --- [ PostMessage ] --- + + /** Unsafe version of: {@link #PostMessage} */ + public static native int nPostMessage(long hWnd, int Msg, long wParam, long lParam, long __functionAddress); + + /** + * Places (posts) a message in the message queue associated with the thread that created the specified window and returns without waiting for the thread + * to process the message. + * + * @param hWnd a handle to the window whose window procedure is to receive the message. The following values have special meanings: + * + *
    + *
  • {@link #HWND_BROADCAST} - The message is posted to all top-level windows in the system, including disabled or invisible unowned windows, overlapped + * windows, and pop-up windows. The message is not posted to child windows.
  • + *
  • {@code NULL} - The function behaves like a call to PostThreadMessage with the dwThreadId parameter set to the identifier of the current thread.
  • + *
+ * @param Msg the message to be posted + * @param wParam additional message-specific information + * @param lParam additional message-specific information + */ + @NativeType("BOOL") + public static boolean PostMessage(@NativeType("HWND") long hWnd, @NativeType("UINT") int Msg, @NativeType("WPARAM") long wParam, @NativeType("LPARAM") long lParam) { + long __functionAddress = Functions.PostMessage; + return nPostMessage(hWnd, Msg, wParam, lParam, __functionAddress) != 0; + } + + // --- [ SendMessage ] --- + + /** Unsafe version of: {@link #SendMessage} */ + public static native int nSendMessage(long hWnd, int Msg, long wParam, long lParam, long __functionAddress); + + /** + * Sends the specified message to a window or windows. The {@code SendMessage} function calls the window procedure for the specified window and does not + * return until the window procedure has processed the message. + * + * @param hWnd a handle to the window whose window procedure will receive the message. If this parameter is {@link #HWND_BROADCAST}, the message is sent to all top-level + * windows in the system, including disabled or invisible unowned windows, overlapped windows, and pop-up windows; but the message is not sent to + * child windows. + * + *

Message sending is subject to UIPI. The thread of a process can send messages only to message queues of threads in processes of lesser or equal + * integrity level.

+ * @param Msg the message to be sent + * @param wParam additional message-specific information + * @param lParam additional message-specific information + */ + @NativeType("BOOL") + public static boolean SendMessage(@NativeType("HWND") long hWnd, @NativeType("UINT") int Msg, @NativeType("WPARAM") long wParam, @NativeType("LPARAM") long lParam) { + long __functionAddress = Functions.SendMessage; + if (CHECKS) { + check(hWnd); + } + return nSendMessage(hWnd, Msg, wParam, lParam, __functionAddress) != 0; + } + + // --- [ AdjustWindowRectEx ] --- + + /** Unsafe version of: {@link #AdjustWindowRectEx} */ + public static native int nAdjustWindowRectEx(long lpRect, int dwStyle, int bMenu, int dwExStyle, long __functionAddress); + + /** Unsafe version of: {@link #AdjustWindowRectEx} */ + public static int nAdjustWindowRectEx(long lpRect, int dwStyle, int bMenu, int dwExStyle) { + long __functionAddress = Functions.AdjustWindowRectEx; + return nAdjustWindowRectEx(lpRect, dwStyle, bMenu, dwExStyle, __functionAddress); + } + + /** + * Calculates the required size of the window rectangle, based on the desired size of the client rectangle. The window rectangle can then be passed to the + * {@link #CreateWindowEx} function to create a window whose client area is the desired size. + * + * @param lpRect a pointer to a {@link RECT} structure that contains the coordinates of the top-left and bottom-right corners of the desired client area. When the + * function returns, the structure contains the coordinates of the top-left and bottom-right corners of the window to accommodate the desired client + * area. + * @param dwStyle the window style of the window whose required size is to be calculated. Note that you cannot specify the {@link #WS_OVERLAPPED} style. + * @param bMenu indicates whether the window has a menu + * @param dwExStyle the extended window style of the window whose required size is to be calculated + */ + @NativeType("BOOL") + public static boolean AdjustWindowRectEx(@NativeType("LPRECT") RECT lpRect, @NativeType("DWORD") int dwStyle, @NativeType("BOOL") boolean bMenu, @NativeType("DWORD") int dwExStyle) { + return nAdjustWindowRectEx(lpRect.address(), dwStyle, bMenu ? 1 : 0, dwExStyle) != 0; + } + + // --- [ GetWindowRect ] --- + + /** Unsafe version of: {@link #GetWindowRect} */ + public static native int nGetWindowRect(long hWnd, long lpRect, long __functionAddress); + + /** Unsafe version of: {@link #GetWindowRect} */ + public static int nGetWindowRect(long hWnd, long lpRect) { + long __functionAddress = Functions.GetWindowRect; + if (CHECKS) { + check(hWnd); + } + return nGetWindowRect(hWnd, lpRect, __functionAddress); + } + + /** + * Retrieves the dimensions of the bounding rectangle of the specified window. The dimensions are given in screen coordinates that are relative to the + * upper-left corner of the screen. + * + * @param hWnd a handle to the window + * @param lpRect a pointer to a {@link RECT} structure that receives the screen coordinates of the upper-left and lower-right corners of the window + */ + @NativeType("BOOL") + public static boolean GetWindowRect(@NativeType("HWND") long hWnd, @NativeType("LPRECT") RECT lpRect) { + return nGetWindowRect(hWnd, lpRect.address()) != 0; + } + + // --- [ MoveWindow ] --- + + /** Unsafe version of: {@link #MoveWindow} */ + public static native int nMoveWindow(long hWnd, int X, int Y, int nWidth, int nHeight, int bRepaint, long __functionAddress); + + /** + * Changes the position and dimensions of the specified window. For a top-level window, the position and dimensions are relative to the upper-left corner + * of the screen. For a child window, they are relative to the upper-left corner of the parent window's client area. + * + * @param hWnd a handle to the window + * @param X the new position of the left side of the window + * @param Y the new position of the top of the window + * @param nWidth the new width of the window + * @param nHeight the new height of the window + * @param bRepaint indicates whether the window is to be repainted. If this parameter is TRUE, the window receives a message. If the parameter is FALSE, no repainting + * of any kind occurs. This applies to the client area, the nonclient area (including the title bar and scroll bars), and any part of the parent + * window uncovered as a result of moving a child window. + */ + @NativeType("BOOL") + public static boolean MoveWindow(@NativeType("HWND") long hWnd, int X, int Y, int nWidth, int nHeight, @NativeType("BOOL") boolean bRepaint) { + long __functionAddress = Functions.MoveWindow; + if (CHECKS) { + check(hWnd); + } + return nMoveWindow(hWnd, X, Y, nWidth, nHeight, bRepaint ? 1 : 0, __functionAddress) != 0; + } + + // --- [ GetWindowPlacement ] --- + + /** Unsafe version of: {@link #GetWindowPlacement} */ + public static native int nGetWindowPlacement(long hWnd, long lpwndpl, long __functionAddress); + + /** Unsafe version of: {@link #GetWindowPlacement} */ + public static int nGetWindowPlacement(long hWnd, long lpwndpl) { + long __functionAddress = Functions.GetWindowPlacement; + if (CHECKS) { + check(hWnd); + } + return nGetWindowPlacement(hWnd, lpwndpl, __functionAddress); + } + + /** + * Retrieves the show state and the restored, minimized, and maximized positions of the specified window. + * + * @param hWnd a handle to the window + * @param lpwndpl a pointer to the {@link WINDOWPLACEMENT} structure that receives the show state and position information. + * + *

Before calling {@code GetWindowPlacement}, set the length member to {@link WINDOWPLACEMENT#SIZEOF}. {@code GetWindowPlacement} fails if + * {@code lpwndpl->length} is not set correctly.

+ */ + @NativeType("BOOL") + public static boolean GetWindowPlacement(@NativeType("HWND") long hWnd, @NativeType("WINDOWPLACEMENT *") WINDOWPLACEMENT lpwndpl) { + return nGetWindowPlacement(hWnd, lpwndpl.address()) != 0; + } + + // --- [ SetWindowPlacement ] --- + + /** Unsafe version of: {@link #SetWindowPlacement} */ + public static native int nSetWindowPlacement(long hWnd, long lpwndpl, long __functionAddress); + + /** Unsafe version of: {@link #SetWindowPlacement} */ + public static int nSetWindowPlacement(long hWnd, long lpwndpl) { + long __functionAddress = Functions.SetWindowPlacement; + if (CHECKS) { + check(hWnd); + } + return nSetWindowPlacement(hWnd, lpwndpl, __functionAddress); + } + + /** + * Sets the show state and the restored, minimized, and maximized positions of the specified window. + * + * @param hWnd a handle to the window + * @param lpwndpl a pointer to the {@link WINDOWPLACEMENT} structure that specifies the new show state and window positions. + * + *

Before calling {@code SetWindowPlacement}, set the {@code length} member of the {@code WINDOWPLACEMENT} structure to {@link WINDOWPLACEMENT#SIZEOF}. + * {@code SetWindowPlacement} fails if the length member is not set correctly.

+ */ + @NativeType("BOOL") + public static boolean SetWindowPlacement(@NativeType("HWND") long hWnd, @NativeType("WINDOWPLACEMENT const *") WINDOWPLACEMENT lpwndpl) { + return nSetWindowPlacement(hWnd, lpwndpl.address()) != 0; + } + + // --- [ IsWindowVisible ] --- + + /** + * Determines the visibility state of the specified window. + * + * @param hWnd a handle to the window to be tested + */ + @NativeType("BOOL") + public static boolean IsWindowVisible(@NativeType("HWND") long hWnd) { + long __functionAddress = Functions.IsWindowVisible; + if (CHECKS) { + check(hWnd); + } + return callPI(hWnd, __functionAddress) != 0; + } + + // --- [ IsIconic ] --- + + /** + * Determines whether the specified window is minimized (iconic). + * + * @param hWnd a handle to the window to be tested + */ + @NativeType("BOOL") + public static boolean IsIconic(@NativeType("HWND") long hWnd) { + long __functionAddress = Functions.IsIconic; + if (CHECKS) { + check(hWnd); + } + return callPI(hWnd, __functionAddress) != 0; + } + + // --- [ IsZoomed ] --- + + /** + * Determines whether a window is maximized. + * + * @param hWnd a handle to the window to be tested + */ + @NativeType("BOOL") + public static boolean IsZoomed(@NativeType("HWND") long hWnd) { + long __functionAddress = Functions.IsZoomed; + if (CHECKS) { + check(hWnd); + } + return callPI(hWnd, __functionAddress) != 0; + } + + // --- [ BringWindowToTop ] --- + + /** + * Brings the specified window to the top of the Z order. If the window is a top-level window, it is activated. If the window is a child window, the + * top-level parent window associated with the child window is activated. + * + * @param hWnd a handle to the window to bring to the top of the Z order + */ + @NativeType("BOOL") + public static boolean BringWindowToTop(@NativeType("HWND") long hWnd) { + long __functionAddress = Functions.BringWindowToTop; + if (CHECKS) { + check(hWnd); + } + return callPI(hWnd, __functionAddress) != 0; + } + + // --- [ SetWindowLongPtr ] --- + + /** Unsafe version of: {@link #SetWindowLongPtr} */ + public static native long nSetWindowLongPtr(long hWnd, int nIndex, long dwNewLong, long __functionAddress); + + /** + * Changes an attribute of the specified window. The function also sets a value at the specified offset in the extra window memory. + * + * @param hWnd a handle to the window and, indirectly, the class to which the window belongs + * @param nIndex the zero-based offset to the value to be set. Valid values are in the range zero through the number of bytes of extra window memory, minus the size + * of an integer. To set any other value, specify one of:
{@link #GWL_WNDPROC}{@link #GWL_HINSTANCE}{@link #GWL_HWNDPARENT}{@link #GWL_STYLE}{@link #GWL_EXSTYLE}{@link #GWL_USERDATA}{@link #GWL_ID}
+ * @param dwNewLong the replacement value + * + * @return the previous value at the given {@code index} + */ + @NativeType("LONG_PTR") + public static long SetWindowLongPtr(@NativeType("HWND") long hWnd, int nIndex, @NativeType("LONG_PTR") long dwNewLong) { + long __functionAddress = Functions.SetWindowLongPtr; + if (CHECKS) { + check(hWnd); + } + return nSetWindowLongPtr(hWnd, nIndex, dwNewLong, __functionAddress); + } + + // --- [ GetWindowLongPtr ] --- + + /** Unsafe version of: {@link #GetWindowLongPtr} */ + public static native long nGetWindowLongPtr(long hWnd, int nIndex, long __functionAddress); + + /** + * Retrieves information about the specified window. The function also retrieves the value at a specified offset into the extra window memory. + * + * @param hWnd a handle to the window and, indirectly, the class to which the window belongs + * @param nIndex the zero-based offset to the value to be set. Valid values are in the range zero through the number of bytes of extra window memory, minus the size + * of an integer. To set any other value, specify one of:
{@link #GWL_WNDPROC}{@link #GWL_HINSTANCE}{@link #GWL_HWNDPARENT}{@link #GWL_STYLE}{@link #GWL_EXSTYLE}{@link #GWL_USERDATA}{@link #GWL_ID}
+ */ + @NativeType("LONG_PTR") + public static long GetWindowLongPtr(@NativeType("HWND") long hWnd, int nIndex) { + long __functionAddress = Functions.GetWindowLongPtr; + if (CHECKS) { + check(hWnd); + } + return nGetWindowLongPtr(hWnd, nIndex, __functionAddress); + } + + // --- [ SetClassLongPtr ] --- + + /** Unsafe version of: {@link #SetClassLongPtr} */ + public static native long nSetClassLongPtr(long hWnd, int nIndex, long dwNewLong, long __functionAddress); + + /** + * Replaces the specified value at the specified offset in the extra class memory or the {@link WNDCLASSEX} structure for the class to which the specified + * window belongs. + * + * @param hWnd a handle to the window and, indirectly, the class to which the window belongs + * @param nIndex the value to be replaced. To set a value in the extra class memory, specify the positive, zero-based byte offset of the value to be set. Valid + * values are in the range zero through the number of bytes of extra class memory, minus eight; for example, if you specified 24 or more bytes of + * extra class memory, a value of 16 would be an index to the third integer. To set a value other than the {@link WNDCLASSEX} structure, specify one of:
{@link #GCL_MENUNAME}{@link #GCL_HBRBACKGROUND}{@link #GCL_HCURSOR}{@link #GCL_HICON}{@link #GCL_HMODULE}{@link #GCL_CBWNDEXTRA}
{@link #GCL_CBCLSEXTRA}{@link #GCL_WNDPROC}{@link #GCL_STYLE}{@link #GCW_ATOM}{@link #GCL_HICONSM}
+ * @param dwNewLong the replacement value + * + * @return if the function succeeds, the return value is the previous value of the specified offset. If this was not previously set, the return value is zero. + * + *

If the function fails, the return value is zero. To get extended error information, call {@link WinBase#getLastError}.

+ */ + @NativeType("LONG_PTR") + public static long SetClassLongPtr(@NativeType("HWND") long hWnd, int nIndex, @NativeType("LONG_PTR") long dwNewLong) { + long __functionAddress = Functions.SetClassLongPtr; + if (CHECKS) { + check(hWnd); + } + return nSetClassLongPtr(hWnd, nIndex, dwNewLong, __functionAddress); + } + + // --- [ GetClassLongPtr ] --- + + /** Unsafe version of: {@link #GetClassLongPtr} */ + public static native long nGetClassLongPtr(long hWnd, int nIndex, long __functionAddress); + + /** + * Retrieves the specified value from the {@link WNDCLASSEX} structure associated with the specified window. + * + * @param hWnd a handle to the window and, indirectly, the class to which the window belongs + * @param nIndex the value to be retrieved. To retrieve a value from the extra class memory, specify the positive, zero-based byte offset of the value to be + * retrieved. Valid values are in the range zero through the number of bytes of extra class memory, minus eight; for example, if you specified 24 or + * more bytes of extra class memory, a value of 16 would be an index to the third integer. To retrieve any other value from the {@link WNDCLASSEX} + * structure, specify one of:
{@link #GCL_MENUNAME}{@link #GCL_HBRBACKGROUND}{@link #GCL_HCURSOR}{@link #GCL_HICON}{@link #GCL_HMODULE}{@link #GCL_CBWNDEXTRA}
{@link #GCL_CBCLSEXTRA}{@link #GCL_WNDPROC}{@link #GCL_STYLE}{@link #GCW_ATOM}{@link #GCL_HICONSM}
+ */ + @NativeType("LONG_PTR") + public static long GetClassLongPtr(@NativeType("HWND") long hWnd, int nIndex) { + long __functionAddress = Functions.GetClassLongPtr; + if (CHECKS) { + check(hWnd); + } + return nGetClassLongPtr(hWnd, nIndex, __functionAddress); + } + + // --- [ SetLayeredWindowAttributes ] --- + + /** Unsafe version of: {@link #SetLayeredWindowAttributes} */ + public static native int nSetLayeredWindowAttributes(long hwnd, int crKey, byte bAlpha, int dwFlags, long __functionAddress); + + /** + * @param hwnd a handle to the layered window. A layered window is created by specifying {@link #WS_EX_LAYERED} when creating the window with the {@link #CreateWindowEx} + * function or by setting {@link #WS_EX_LAYERED} via {@link #SetWindowLongPtr} after the window has been created. + * @param crKey the transparency color key (0x00bbggrr) to be used when composing the layered window. All pixels painted by the window in this color will be + * transparent. + * @param bAlpha the alpha value used to describe the opacity of the layered window. When {@code bAlpha} is 0, the window is completely transparent. When + * {@code bAlpha} is 255, the window is opaque. + * @param dwFlags an action to be taken. One or more of:
{@link #LWA_COLORKEY}{@link #LWA_ALPHA}
+ */ + @NativeType("BOOL") + public static boolean SetLayeredWindowAttributes(@NativeType("HWND") long hwnd, @NativeType("COLORREF") int crKey, @NativeType("BYTE") byte bAlpha, @NativeType("DWORD") int dwFlags) { + long __functionAddress = Functions.SetLayeredWindowAttributes; + if (CHECKS) { + check(hwnd); + } + return nSetLayeredWindowAttributes(hwnd, crKey, bAlpha, dwFlags, __functionAddress) != 0; + } + + // --- [ LoadIcon ] --- + + /** Unsafe version of: {@link #LoadIcon} */ + public static native long nLoadIcon(long instance, long iconName, long __functionAddress); + + /** Unsafe version of: {@link #LoadIcon} */ + public static long nLoadIcon(long instance, long iconName) { + long __functionAddress = Functions.LoadIcon; + return nLoadIcon(instance, iconName, __functionAddress); + } + + /** + * Loads the specified icon resource from the executable (.exe) file associated with an application instance. + * + * @param instance a handle to an instance of the module whose executable file contains the icon to be loaded. This parameter must be {@code NULL} when a standard icon is + * being loaded. + * @param iconName the name of the icon resource to be loaded or one of:
{@link #IDI_APPLICATION}{@link #IDI_HAND}{@link #IDI_QUESTION}{@link #IDI_EXCLAMATION}{@link #IDI_ASTERISK}{@link #IDI_WINLOGO}
{@link #IDI_SHIELD}{@link #IDI_WARNING}{@link #IDI_ERROR}{@link #IDI_INFORMATION}
+ */ + @NativeType("HICON") + public static long LoadIcon(@NativeType("HINSTANCE") long instance, @NativeType("LPCTSTR") ByteBuffer iconName) { + if (CHECKS) { + checkNT2(iconName); + } + return nLoadIcon(instance, memAddress(iconName)); + } + + /** + * Loads the specified icon resource from the executable (.exe) file associated with an application instance. + * + * @param instance a handle to an instance of the module whose executable file contains the icon to be loaded. This parameter must be {@code NULL} when a standard icon is + * being loaded. + * @param iconName the name of the icon resource to be loaded or one of:
{@link #IDI_APPLICATION}{@link #IDI_HAND}{@link #IDI_QUESTION}{@link #IDI_EXCLAMATION}{@link #IDI_ASTERISK}{@link #IDI_WINLOGO}
{@link #IDI_SHIELD}{@link #IDI_WARNING}{@link #IDI_ERROR}{@link #IDI_INFORMATION}
+ */ + @NativeType("HICON") + public static long LoadIcon(@NativeType("HINSTANCE") long instance, @NativeType("LPCTSTR") CharSequence iconName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF16(iconName, true); + long iconNameEncoded = stack.getPointerAddress(); + return nLoadIcon(instance, iconNameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ LoadCursor ] --- + + /** Unsafe version of: {@link #LoadCursor} */ + public static native long nLoadCursor(long instance, long cursorName, long __functionAddress); + + /** Unsafe version of: {@link #LoadCursor} */ + public static long nLoadCursor(long instance, long cursorName) { + long __functionAddress = Functions.LoadCursor; + return nLoadCursor(instance, cursorName, __functionAddress); + } + + /** + * Loads the specified cursor resource from the executable (.EXE) file associated with an application instance. + * + * @param instance a handle to an instance of the module whose executable file contains the cursor to be loaded. + * @param cursorName the name of the cursor resource to be loaded or one of:
{@link #IDC_ARROW}{@link #IDC_IBEAM}{@link #IDC_WAIT}{@link #IDC_CROSS}{@link #IDC_UPARROW}{@link #IDC_SIZE}{@link #IDC_ICON}{@link #IDC_SIZENWSE}
{@link #IDC_SIZENESW}{@link #IDC_SIZEWE}{@link #IDC_SIZENS}{@link #IDC_SIZEALL}{@link #IDC_NO}{@link #IDC_HAND}{@link #IDC_APPSTARTING}{@link #IDC_HELP}
+ */ + @NativeType("HCURSOR") + public static long LoadCursor(@NativeType("HINSTANCE") long instance, @NativeType("LPCTSTR") ByteBuffer cursorName) { + if (CHECKS) { + checkNT2(cursorName); + } + return nLoadCursor(instance, memAddress(cursorName)); + } + + /** + * Loads the specified cursor resource from the executable (.EXE) file associated with an application instance. + * + * @param instance a handle to an instance of the module whose executable file contains the cursor to be loaded. + * @param cursorName the name of the cursor resource to be loaded or one of:
{@link #IDC_ARROW}{@link #IDC_IBEAM}{@link #IDC_WAIT}{@link #IDC_CROSS}{@link #IDC_UPARROW}{@link #IDC_SIZE}{@link #IDC_ICON}{@link #IDC_SIZENWSE}
{@link #IDC_SIZENESW}{@link #IDC_SIZEWE}{@link #IDC_SIZENS}{@link #IDC_SIZEALL}{@link #IDC_NO}{@link #IDC_HAND}{@link #IDC_APPSTARTING}{@link #IDC_HELP}
+ */ + @NativeType("HCURSOR") + public static long LoadCursor(@NativeType("HINSTANCE") long instance, @NativeType("LPCTSTR") CharSequence cursorName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF16(cursorName, true); + long cursorNameEncoded = stack.getPointerAddress(); + return nLoadCursor(instance, cursorNameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ GetDC ] --- + + /** + * Retrieves a handle to a device context (DC) for the client area of a specified window or for the entire screen. You can use the returned handle in + * subsequent GDI functions to draw in the DC. The device context is an opaque data structure, whose values are used internally by GDI. + * + * @param hWnd a handle to the window whose DC is to be retrieved. If this value is {@code NULL}, GetDC retrieves the DC for the entire screen. + */ + @NativeType("HDC") + public static long GetDC(@NativeType("HWND") long hWnd) { + long __functionAddress = Functions.GetDC; + return callPP(hWnd, __functionAddress); + } + + // --- [ ReleaseDC ] --- + + /** + * Releases a device context (DC), freeing it for use by other applications. The effect of the ReleaseDC function depends on the type of DC. It frees only + * common and window DCs. It has no effect on class or private DCs. + * + * @param hWnd a handle to the window whose DC is to be released + * @param hDC a handle to the DC to be released + */ + @NativeType("BOOL") + public static boolean ReleaseDC(@NativeType("HWND") long hWnd, @NativeType("HDC") long hDC) { + long __functionAddress = Functions.ReleaseDC; + if (CHECKS) { + check(hWnd); + check(hDC); + } + return callPPI(hWnd, hDC, __functionAddress) != 0; + } + + // --- [ GetSystemMetrics ] --- + + /** + * Retrieves the specified system metric or system configuration setting. + * + * @param index the system metric or configuration setting to be retrieved. One of:
{@link #SM_CXSCREEN}{@link #SM_CYSCREEN}{@link #SM_CXVSCROLL}{@link #SM_CYHSCROLL}{@link #SM_CYCAPTION}{@link #SM_CXBORDER}
{@link #SM_CYBORDER}{@link #SM_CXDLGFRAME}{@link #SM_CYDLGFRAME}{@link #SM_CYVTHUMB}{@link #SM_CXHTHUMB}{@link #SM_CXICON}
{@link #SM_CYICON}{@link #SM_CXCURSOR}{@link #SM_CYCURSOR}{@link #SM_CYMENU}{@link #SM_CXFULLSCREEN}{@link #SM_CYFULLSCREEN}
{@link #SM_CYKANJIWINDOW}{@link #SM_MOUSEPRESENT}{@link #SM_CYVSCROLL}{@link #SM_CXHSCROLL}{@link #SM_DEBUG}{@link #SM_SWAPBUTTON}
{@link #SM_RESERVED1}{@link #SM_RESERVED2}{@link #SM_RESERVED3}{@link #SM_RESERVED4}{@link #SM_CXMIN}{@link #SM_CYMIN}
{@link #SM_CXSIZE}{@link #SM_CYSIZE}{@link #SM_CXFRAME}{@link #SM_CYFRAME}{@link #SM_CXMINTRACK}{@link #SM_CYMINTRACK}
{@link #SM_CXDOUBLECLK}{@link #SM_CYDOUBLECLK}{@link #SM_CXICONSPACING}{@link #SM_CYICONSPACING}{@link #SM_MENUDROPALIGNMENT}{@link #SM_PENWINDOWS}
{@link #SM_DBCSENABLED}{@link #SM_CMOUSEBUTTONS}{@link #SM_CXFIXEDFRAME}{@link #SM_CYFIXEDFRAME}{@link #SM_CXSIZEFRAME}{@link #SM_CYSIZEFRAME}
{@link #SM_SECURE}{@link #SM_CXEDGE}{@link #SM_CYEDGE}{@link #SM_CXMINSPACING}{@link #SM_CYMINSPACING}{@link #SM_CXSMICON}
{@link #SM_CYSMICON}{@link #SM_CYSMCAPTION}{@link #SM_CXSMSIZE}{@link #SM_CYSMSIZE}{@link #SM_CXMENUSIZE}{@link #SM_CYMENUSIZE}
{@link #SM_ARRANGE}{@link #SM_CXMINIMIZED}{@link #SM_CYMINIMIZED}{@link #SM_CXMAXTRACK}{@link #SM_CYMAXTRACK}{@link #SM_CXMAXIMIZED}
{@link #SM_CYMAXIMIZED}{@link #SM_NETWORK}{@link #SM_CLEANBOOT}{@link #SM_CXDRAG}{@link #SM_CYDRAG}{@link #SM_SHOWSOUNDS}
{@link #SM_CXMENUCHECK}{@link #SM_CYMENUCHECK}{@link #SM_SLOWMACHINE}{@link #SM_MIDEASTENABLED}{@link #SM_MOUSEWHEELPRESENT}{@link #SM_XVIRTUALSCREEN}
{@link #SM_YVIRTUALSCREEN}{@link #SM_CXVIRTUALSCREEN}{@link #SM_CYVIRTUALSCREEN}{@link #SM_CMONITORS}{@link #SM_SAMEDISPLAYFORMAT}{@link #SM_IMMENABLED}
{@link #SM_REMOTESESSION}{@link #SM_SHUTTINGDOWN}{@link #SM_REMOTECONTROL}{@link #SM_CARETBLINKINGENABLED}{@link #SM_CXFOCUSBORDER}{@link #SM_CYFOCUSBORDER}
{@link #SM_TABLETPC}{@link #SM_MEDIACENTER}{@link #SM_STARTER}{@link #SM_SERVERR2}{@link #SM_MOUSEHORIZONTALWHEELPRESENT}{@link #SM_CXPADDEDBORDER}
{@link #SM_DIGITIZER}{@link #SM_MAXIMUMTOUCHES}
+ */ + public static int GetSystemMetrics(int index) { + long __functionAddress = Functions.GetSystemMetrics; + return callI(index, __functionAddress); + } + + // --- [ RegisterTouchWindow ] --- + + /** Unsafe version of: {@link #RegisterTouchWindow} */ + public static native int nRegisterTouchWindow(long hWnd, int ulFlags, long __functionAddress); + + /** + * Registers a window as being touch-capable. + * + *

{@code RegisterTouchWindow} must be called on every window that will be used for touch input. This means that if you have an application that has + * multiple windows within it, {@code RegisterTouchWindow} must be called on every window in that application that uses touch features. Also, an + * application can call {@code RegisterTouchWindow} any number of times for the same window if it desires to change the modifier flags. A window can be + * marked as no longer requiring touch input using the {@link #UnregisterTouchWindow} function.

+ * + * @param hWnd the handle of the window being registered. The function fails with {@code ERROR_ACCESS_DENIED} if the calling thread does not own the specified + * window. + * @param ulFlags a set of bit flags that specify optional modifications. This field may contain 0 or one or more of:
{@link #TWF_FINETOUCH}{@link #TWF_WANTPALM}
+ * + * @since Windows 7 (desktop apps only) + */ + @NativeType("BOOL") + public static boolean RegisterTouchWindow(@NativeType("HWND") long hWnd, @NativeType("ULONG") int ulFlags) { + long __functionAddress = Functions.RegisterTouchWindow; + if (CHECKS) { + check(__functionAddress); + check(hWnd); + } + return nRegisterTouchWindow(hWnd, ulFlags, __functionAddress) != 0; + } + + // --- [ UnregisterTouchWindow ] --- + + /** Unsafe version of: {@link #UnregisterTouchWindow} */ + public static native int nUnregisterTouchWindow(long hWnd, long __functionAddress); + + /** + * Registers a window as no longer being touch-capable. + * + * @param hWnd the handle of the window. The function fails with {@code ERROR_ACCESS_DENIED} if the calling thread does not own the specified window. + * + * @since Windows 7 (desktop apps only) + */ + @NativeType("BOOL") + public static boolean UnregisterTouchWindow(@NativeType("HWND") long hWnd) { + long __functionAddress = Functions.UnregisterTouchWindow; + if (CHECKS) { + check(__functionAddress); + check(hWnd); + } + return nUnregisterTouchWindow(hWnd, __functionAddress) != 0; + } + + // --- [ IsTouchWindow ] --- + + /** Unsafe version of: {@link #IsTouchWindow} */ + public static int nIsTouchWindow(long hWnd, long pulFlags) { + long __functionAddress = Functions.IsTouchWindow; + if (CHECKS) { + check(__functionAddress); + check(hWnd); + } + return callPPI(hWnd, pulFlags, __functionAddress); + } + + /** + * Checks whether a specified window is touch-capable and, optionally, retrieves the modifier flags set for the window's touch capability. + * + * @param hWnd the handle of the window. The function fails with {@code ERROR_ACCESS_DENIED} if the calling thread is not on the same desktop as the specified + * window. + * @param pulFlags an optional address of the {@code ULONG} variable to receive the modifier flags for the specified window's touch capability. + * + * @since Windows 7 (desktop apps only) + */ + @NativeType("BOOL") + public static boolean IsTouchWindow(@NativeType("HWND") long hWnd, @Nullable @NativeType("PULONG") IntBuffer pulFlags) { + if (CHECKS) { + checkSafe(pulFlags, 1); + } + return nIsTouchWindow(hWnd, memAddressSafe(pulFlags)) != 0; + } + + // --- [ GetTouchInputInfo ] --- + + /** + * Unsafe version of: {@link #GetTouchInputInfo} + * + * @param cInputs The number of structures in the {@code pInputs} array. This should ideally be at least equal to the number of touch points associated with the + * message as indicated in the message {@code WPARAM}. If {@code cInputs} is less than the number of touch points, the function will still succeed and + * populate the {@code pInputs} buffer with information about {@code cInputs} touch points. + */ + public static native int nGetTouchInputInfo(long hTouchInput, int cInputs, long pInputs, int cbSize, long __functionAddress); + + /** + * Unsafe version of: {@link #GetTouchInputInfo} + * + * @param cInputs The number of structures in the {@code pInputs} array. This should ideally be at least equal to the number of touch points associated with the + * message as indicated in the message {@code WPARAM}. If {@code cInputs} is less than the number of touch points, the function will still succeed and + * populate the {@code pInputs} buffer with information about {@code cInputs} touch points. + */ + public static int nGetTouchInputInfo(long hTouchInput, int cInputs, long pInputs, int cbSize) { + long __functionAddress = Functions.GetTouchInputInfo; + if (CHECKS) { + check(__functionAddress); + check(hTouchInput); + } + return nGetTouchInputInfo(hTouchInput, cInputs, pInputs, cbSize, __functionAddress); + } + + /** + * Retrieves detailed information about touch inputs associated with a particular touch input handle. + * + * @param hTouchInput the touch input handle received in the {@code LPARAM} of a touch message. The function fails with {@code ERROR_INVALID_HANDLE} if this handle is + * not valid. Note that the handle is not valid after it has been used in a successful call to {@link #CloseTouchInputHandle} or after it has been passed to + * {@link #DefWindowProc}, {@link #PostMessage}, {@link #SendMessage} or one of their variants. + * @param pInputs a pointer to an array of {@link TOUCHINPUT} structures to receive information about the touch points associated with the specified touch input handle + * @param cbSize the size, in bytes, of a single {@link TOUCHINPUT} structure. If {@code cbSize} is not the size of a single {@code TOUCHINPUT} structure, the function + * fails with {@code ERROR_INVALID_PARAMETER}. + * + * @since Windows 7 (desktop apps only) + */ + @NativeType("BOOL") + public static boolean GetTouchInputInfo(@NativeType("HTOUCHINPUT") long hTouchInput, @NativeType("PTOUCHINPUT") TOUCHINPUT.Buffer pInputs, int cbSize) { + return nGetTouchInputInfo(hTouchInput, pInputs.remaining(), pInputs.address(), cbSize) != 0; + } + + // --- [ CloseTouchInputHandle ] --- + + /** Unsafe version of: {@link #CloseTouchInputHandle} */ + public static native int nCloseTouchInputHandle(long hTouchInput, long __functionAddress); + + /** + * Closes a touch input handle, frees process memory associated with it, and invalidates the handle. + * + * @param hTouchInput the touch input handle received in the {@code LPARAM} of a touch message. The function fails with {@code ERROR_INVALID_HANDLE} if this handle is + * not valid. Note that the handle is not valid after it has been used in a successful call to {@link #CloseTouchInputHandle} or after it has been passed to + * {@link #DefWindowProc}, {@link #PostMessage}, {@link #SendMessage} or one of their variants. + * + * @since Windows 7 (desktop apps only) + */ + @NativeType("BOOL") + public static boolean CloseTouchInputHandle(@NativeType("HTOUCHINPUT") long hTouchInput) { + long __functionAddress = Functions.CloseTouchInputHandle; + if (CHECKS) { + check(__functionAddress); + check(hTouchInput); + } + return nCloseTouchInputHandle(hTouchInput, __functionAddress) != 0; + } + + // --- [ MonitorFromWindow ] --- + + /** + * Retrieves a handle to the display monitor that has the largest area of intersection with the bounding rectangle of a specified window. + * + * @param hWnd a handle to the window of interest + * @param dwFlags determines the function's return value if the window does not intersect any display monitor. One of:
{@link #MONITOR_DEFAULTTONULL}{@link #MONITOR_DEFAULTTOPRIMARY}{@link #MONITOR_DEFAULTTONEAREST}
+ */ + @NativeType("HMONITOR") + public static long MonitorFromWindow(@NativeType("HWND") long hWnd, @NativeType("DWORD") int dwFlags) { + long __functionAddress = Functions.MonitorFromWindow; + if (CHECKS) { + check(hWnd); + } + return callPP(hWnd, dwFlags, __functionAddress); + } + + // --- [ GetMonitorInfo ] --- + + /** Unsafe version of: {@link #GetMonitorInfo} */ + public static int nGetMonitorInfo(long hMonitor, long lpmi) { + long __functionAddress = Functions.GetMonitorInfo; + if (CHECKS) { + check(hMonitor); + } + return callPPI(hMonitor, lpmi, __functionAddress); + } + + /** + * Retrieves information about a display monitor. + * + * @param hMonitor a handle to the display monitor of interest + * @param lpmi a pointer to a {@link MONITORINFOEX} structure that receives information about the specified display monitor. + * + *

You must set the {@code cbSize} member of the structure to {@link MONITORINFOEX#SIZEOF} before calling the {@code GetMonitorInfo} function. Doing so lets + * the function determine the type of structure you are passing to it.

+ */ + @NativeType("BOOL") + public static boolean GetMonitorInfo(@NativeType("HMONITOR") long hMonitor, @NativeType("LPMONITORINFOEX") MONITORINFOEX lpmi) { + return nGetMonitorInfo(hMonitor, lpmi.address()) != 0; + } + + // --- [ EnumDisplayDevices ] --- + + /** Unsafe version of: {@link #EnumDisplayDevices} */ + public static int nEnumDisplayDevices(long lpDevice, int iDevNum, long lpDisplayDevice, int dwFlags) { + long __functionAddress = Functions.EnumDisplayDevices; + return callPPI(lpDevice, iDevNum, lpDisplayDevice, dwFlags, __functionAddress); + } + + /** + * Obtains information about the display devices in the current session. + * + * @param lpDevice the device name. If {@code NULL}, function returns information for the display adapter(s) on the machine, based on {@code devNum}. + * @param iDevNum an index value that specifies the display device of interest. + * + *

The operating system identifies each display device in the current session with an index value. The index values are consecutive integers, starting + * at 0. If the current session has three display devices, for example, they are specified by the index values 0, 1, and 2.

+ * @param lpDisplayDevice a pointer to a {@link DISPLAY_DEVICE} structure that receives information about the display device specified by {@code iDevNum}. + * + *

Before calling {@code EnumDisplayDevices}, you must initialize the {@code cb} member of {@code DISPLAY_DEVICE} to the size, in bytes, of + * {@code DISPLAY_DEVICE}.

+ * @param dwFlags set this flag to {@link #EDD_GET_DEVICE_INTERFACE_NAME} to retrieve the device interface name for {@code GUID_DEVINTERFACE_MONITOR}, which is registered by + * the operating system on a per monitor basis. The value is placed in the {@code DeviceID} member of the {@link DISPLAY_DEVICE} structure returned in + * {@code lpDisplayDevice}. The resulting device interface name can be used with SetupAPI functions and serves as a link between GDI monitor devices + * and SetupAPI monitor devices. + */ + @NativeType("BOOL") + public static boolean EnumDisplayDevices(@Nullable @NativeType("LPCTSTR") ByteBuffer lpDevice, @NativeType("DWORD") int iDevNum, @NativeType("PDISPLAY_DEVICE") DISPLAY_DEVICE lpDisplayDevice, @NativeType("DWORD") int dwFlags) { + if (CHECKS) { + checkNT2Safe(lpDevice); + } + return nEnumDisplayDevices(memAddressSafe(lpDevice), iDevNum, lpDisplayDevice.address(), dwFlags) != 0; + } + + /** + * Obtains information about the display devices in the current session. + * + * @param lpDevice the device name. If {@code NULL}, function returns information for the display adapter(s) on the machine, based on {@code devNum}. + * @param iDevNum an index value that specifies the display device of interest. + * + *

The operating system identifies each display device in the current session with an index value. The index values are consecutive integers, starting + * at 0. If the current session has three display devices, for example, they are specified by the index values 0, 1, and 2.

+ * @param lpDisplayDevice a pointer to a {@link DISPLAY_DEVICE} structure that receives information about the display device specified by {@code iDevNum}. + * + *

Before calling {@code EnumDisplayDevices}, you must initialize the {@code cb} member of {@code DISPLAY_DEVICE} to the size, in bytes, of + * {@code DISPLAY_DEVICE}.

+ * @param dwFlags set this flag to {@link #EDD_GET_DEVICE_INTERFACE_NAME} to retrieve the device interface name for {@code GUID_DEVINTERFACE_MONITOR}, which is registered by + * the operating system on a per monitor basis. The value is placed in the {@code DeviceID} member of the {@link DISPLAY_DEVICE} structure returned in + * {@code lpDisplayDevice}. The resulting device interface name can be used with SetupAPI functions and serves as a link between GDI monitor devices + * and SetupAPI monitor devices. + */ + @NativeType("BOOL") + public static boolean EnumDisplayDevices(@Nullable @NativeType("LPCTSTR") CharSequence lpDevice, @NativeType("DWORD") int iDevNum, @NativeType("PDISPLAY_DEVICE") DISPLAY_DEVICE lpDisplayDevice, @NativeType("DWORD") int dwFlags) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF16Safe(lpDevice, true); + long lpDeviceEncoded = lpDevice == null ? NULL : stack.getPointerAddress(); + return nEnumDisplayDevices(lpDeviceEncoded, iDevNum, lpDisplayDevice.address(), dwFlags) != 0; + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ EnumDisplaySettingsEx ] --- + + /** Unsafe version of: {@link #EnumDisplaySettingsEx} */ + public static int nEnumDisplaySettingsEx(long lpszDeviceName, int iModeNum, long lpDevMode, int dwFlags) { + long __functionAddress = Functions.EnumDisplaySettingsEx; + return callPPI(lpszDeviceName, iModeNum, lpDevMode, dwFlags, __functionAddress); + } + + /** + * Retrieves information about one of the graphics modes for a display device. To retrieve information for all the graphics modes for a display device, + * make a series of calls to this function. + * + * @param lpszDeviceName a pointer to a null-terminated string that specifies the display device about which graphics mode the function will obtain information. + * + *

This parameter is either {@code NULL} or a {@link DISPLAY_DEVICE#DeviceName} returned from {@link #EnumDisplayDevices}. A {@code NULL} value specifies the current display + * device on the computer that the calling thread is running on.

+ * @param iModeNum indicates the type of information to be retrieved. + * + *

Graphics mode indexes start at zero. To obtain information for all of a display device's graphics modes, make a series of calls to + * {@code EnumDisplaySettingsEx}, as follows: Set {@code iModeNum} to zero for the first call, and increment {@code iModeNum} by one for each + * subsequent call. Continue calling the function until the return value is zero.

+ * + *

When you call {@code EnumDisplaySettingsEx} with {@code iModeNum} set to zero, the operating system initializes and caches information about the + * display device. When you call {@code EnumDisplaySettingsEx} with {@code iModeNum} set to a nonzero value, the function returns the information that + * was cached the last time the function was called with {@code iModeNum} set to zero.

+ * + *

This value can be a graphics mode index or one of:

{@link #ENUM_CURRENT_SETTINGS}{@link #ENUM_REGISTRY_SETTINGS}
+ * @param lpDevMode a pointer to a {@link DEVMODE} structure into which the function stores information about the specified graphics mode. Before calling + * {@code EnumDisplaySettingsEx}, set the {@code dmSize} member to {@link DEVMODE#SIZEOF}, and set the {@code dmDriverExtra} member to indicate the size, in + * bytes, of the additional space available to receive private driver data. + * + *

The {@code EnumDisplaySettingsEx} function will populate the {@code dmFields} member of the {@code lpDevMode} and one or more other members of the + * {@code DEVMODE} structure. To determine which members were set by the call to {@code EnumDisplaySettingsEx}, inspect the {@code dmFields} bitmask.

+ * @param dwFlags this parameter can be one of:
{@link #EDS_RAWMODE}{@link #EDS_ROTATEDMODE}
+ */ + @NativeType("BOOL") + public static boolean EnumDisplaySettingsEx(@Nullable @NativeType("LPCTSTR") ByteBuffer lpszDeviceName, @NativeType("DWORD") int iModeNum, @NativeType("DEVMODE *") DEVMODE lpDevMode, @NativeType("DWORD") int dwFlags) { + if (CHECKS) { + checkNT2Safe(lpszDeviceName); + } + return nEnumDisplaySettingsEx(memAddressSafe(lpszDeviceName), iModeNum, lpDevMode.address(), dwFlags) != 0; + } + + /** + * Retrieves information about one of the graphics modes for a display device. To retrieve information for all the graphics modes for a display device, + * make a series of calls to this function. + * + * @param lpszDeviceName a pointer to a null-terminated string that specifies the display device about which graphics mode the function will obtain information. + * + *

This parameter is either {@code NULL} or a {@link DISPLAY_DEVICE#DeviceName} returned from {@link #EnumDisplayDevices}. A {@code NULL} value specifies the current display + * device on the computer that the calling thread is running on.

+ * @param iModeNum indicates the type of information to be retrieved. + * + *

Graphics mode indexes start at zero. To obtain information for all of a display device's graphics modes, make a series of calls to + * {@code EnumDisplaySettingsEx}, as follows: Set {@code iModeNum} to zero for the first call, and increment {@code iModeNum} by one for each + * subsequent call. Continue calling the function until the return value is zero.

+ * + *

When you call {@code EnumDisplaySettingsEx} with {@code iModeNum} set to zero, the operating system initializes and caches information about the + * display device. When you call {@code EnumDisplaySettingsEx} with {@code iModeNum} set to a nonzero value, the function returns the information that + * was cached the last time the function was called with {@code iModeNum} set to zero.

+ * + *

This value can be a graphics mode index or one of:

{@link #ENUM_CURRENT_SETTINGS}{@link #ENUM_REGISTRY_SETTINGS}
+ * @param lpDevMode a pointer to a {@link DEVMODE} structure into which the function stores information about the specified graphics mode. Before calling + * {@code EnumDisplaySettingsEx}, set the {@code dmSize} member to {@link DEVMODE#SIZEOF}, and set the {@code dmDriverExtra} member to indicate the size, in + * bytes, of the additional space available to receive private driver data. + * + *

The {@code EnumDisplaySettingsEx} function will populate the {@code dmFields} member of the {@code lpDevMode} and one or more other members of the + * {@code DEVMODE} structure. To determine which members were set by the call to {@code EnumDisplaySettingsEx}, inspect the {@code dmFields} bitmask.

+ * @param dwFlags this parameter can be one of:
{@link #EDS_RAWMODE}{@link #EDS_ROTATEDMODE}
+ */ + @NativeType("BOOL") + public static boolean EnumDisplaySettingsEx(@Nullable @NativeType("LPCTSTR") CharSequence lpszDeviceName, @NativeType("DWORD") int iModeNum, @NativeType("DEVMODE *") DEVMODE lpDevMode, @NativeType("DWORD") int dwFlags) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF16Safe(lpszDeviceName, true); + long lpszDeviceNameEncoded = lpszDeviceName == null ? NULL : stack.getPointerAddress(); + return nEnumDisplaySettingsEx(lpszDeviceNameEncoded, iModeNum, lpDevMode.address(), dwFlags) != 0; + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ ChangeDisplaySettingsEx ] --- + + /** Unsafe version of: {@link #ChangeDisplaySettingsEx} */ + public static int nChangeDisplaySettingsEx(long lpszDeviceName, long lpDevMode, long hwnd, int dwflags, long lParam) { + long __functionAddress = Functions.ChangeDisplaySettingsEx; + return callPPPPI(lpszDeviceName, lpDevMode, hwnd, dwflags, lParam, __functionAddress); + } + + /** + * Changes the settings of the specified display device to the specified graphics mode. + * + * @param lpszDeviceName a pointer to a null-terminated string that specifies the display device whose graphics mode will change. Only display device names as returned by + * {@link #EnumDisplayDevices} are valid. + * + *

The {@code lpszDeviceName} parameter can be {@code NULL}. A {@code NULL} value specifies the default display device. The default device can be determined by + * calling {@code EnumDisplayDevices} and checking for the {@link GDI32#DISPLAY_DEVICE_PRIMARY_DEVICE} flag.

+ * @param lpDevMode a pointer to a {@link DEVMODE} structure that describes the new graphics mode. If {@code lpDevMode} is {@code NULL}, all the values currently in the registry + * will be used for the display setting. Passing {@code NULL} for the {@code lpDevMode} parameter and 0 for the {@code dwFlags} parameter is the easiest way + * to return to the default mode after a dynamic mode change. + * + *

The {@code dmSize} member must be initialized to the size, in bytes, of the {@code DEVMODE} structure. The {@code dmDriverExtra} member must be + * initialized to indicate the number of bytes of private driver data following the {@code DEVMODE} structure.

+ * @param hwnd reserved; must be {@code NULL} + * @param dwflags indicates how the graphics mode should be changed. One of:
{@link #CDS_UPDATEREGISTRY}{@link #CDS_TEST}{@link #CDS_FULLSCREEN}{@link #CDS_GLOBAL}{@link #CDS_SET_PRIMARY}
{@link #CDS_VIDEOPARAMETERS}{@link #CDS_ENABLE_UNSAFE_MODES}{@link #CDS_DISABLE_UNSAFE_MODES}{@link #CDS_RESET}{@link #CDS_RESET_EX}
{@link #CDS_NORESET}
+ * @param lParam if {@code flags} is {@link #CDS_VIDEOPARAMETERS}, {@code lParam} is a pointer to a {@code VIDEOPARAMETERS} structure. Otherwise {@code lParam} must be {@code NULL}. + * + * @return one of the following values: {@link #DISP_CHANGE_SUCCESSFUL} {@link #DISP_CHANGE_RESTART} {@link #DISP_CHANGE_FAILED} {@link #DISP_CHANGE_BADMODE} {@link #DISP_CHANGE_NOTUPDATED} {@link #DISP_CHANGE_BADFLAGS} {@link #DISP_CHANGE_BADPARAM} {@link #DISP_CHANGE_BADDUALVIEW} + */ + @NativeType("LONG") + public static int ChangeDisplaySettingsEx(@Nullable @NativeType("LPCTSTR") ByteBuffer lpszDeviceName, @Nullable @NativeType("DEVMODE *") DEVMODE lpDevMode, @NativeType("HWND") long hwnd, @NativeType("DWORD") int dwflags, @NativeType("LPVOID") long lParam) { + if (CHECKS) { + checkNT2Safe(lpszDeviceName); + } + return nChangeDisplaySettingsEx(memAddressSafe(lpszDeviceName), memAddressSafe(lpDevMode), hwnd, dwflags, lParam); + } + + /** + * Changes the settings of the specified display device to the specified graphics mode. + * + * @param lpszDeviceName a pointer to a null-terminated string that specifies the display device whose graphics mode will change. Only display device names as returned by + * {@link #EnumDisplayDevices} are valid. + * + *

The {@code lpszDeviceName} parameter can be {@code NULL}. A {@code NULL} value specifies the default display device. The default device can be determined by + * calling {@code EnumDisplayDevices} and checking for the {@link GDI32#DISPLAY_DEVICE_PRIMARY_DEVICE} flag.

+ * @param lpDevMode a pointer to a {@link DEVMODE} structure that describes the new graphics mode. If {@code lpDevMode} is {@code NULL}, all the values currently in the registry + * will be used for the display setting. Passing {@code NULL} for the {@code lpDevMode} parameter and 0 for the {@code dwFlags} parameter is the easiest way + * to return to the default mode after a dynamic mode change. + * + *

The {@code dmSize} member must be initialized to the size, in bytes, of the {@code DEVMODE} structure. The {@code dmDriverExtra} member must be + * initialized to indicate the number of bytes of private driver data following the {@code DEVMODE} structure.

+ * @param hwnd reserved; must be {@code NULL} + * @param dwflags indicates how the graphics mode should be changed. One of:
{@link #CDS_UPDATEREGISTRY}{@link #CDS_TEST}{@link #CDS_FULLSCREEN}{@link #CDS_GLOBAL}{@link #CDS_SET_PRIMARY}
{@link #CDS_VIDEOPARAMETERS}{@link #CDS_ENABLE_UNSAFE_MODES}{@link #CDS_DISABLE_UNSAFE_MODES}{@link #CDS_RESET}{@link #CDS_RESET_EX}
{@link #CDS_NORESET}
+ * @param lParam if {@code flags} is {@link #CDS_VIDEOPARAMETERS}, {@code lParam} is a pointer to a {@code VIDEOPARAMETERS} structure. Otherwise {@code lParam} must be {@code NULL}. + * + * @return one of the following values: {@link #DISP_CHANGE_SUCCESSFUL} {@link #DISP_CHANGE_RESTART} {@link #DISP_CHANGE_FAILED} {@link #DISP_CHANGE_BADMODE} {@link #DISP_CHANGE_NOTUPDATED} {@link #DISP_CHANGE_BADFLAGS} {@link #DISP_CHANGE_BADPARAM} {@link #DISP_CHANGE_BADDUALVIEW} + */ + @NativeType("LONG") + public static int ChangeDisplaySettingsEx(@Nullable @NativeType("LPCTSTR") CharSequence lpszDeviceName, @Nullable @NativeType("DEVMODE *") DEVMODE lpDevMode, @NativeType("HWND") long hwnd, @NativeType("DWORD") int dwflags, @NativeType("LPVOID") long lParam) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF16Safe(lpszDeviceName, true); + long lpszDeviceNameEncoded = lpszDeviceName == null ? NULL : stack.getPointerAddress(); + return nChangeDisplaySettingsEx(lpszDeviceNameEncoded, memAddressSafe(lpDevMode), hwnd, dwflags, lParam); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ GetCursorPos ] --- + + /** Unsafe version of: {@link #GetCursorPos} */ + public static int nGetCursorPos(long point) { + long __functionAddress = Functions.GetCursorPos; + return callPI(point, __functionAddress); + } + + /** + * Retrieves the position of the mouse cursor, in screen coordinates. + * + * @param point a pointer to a {@link POINT} structure that receives the screen coordinates of the cursor + */ + @NativeType("BOOL") + public static boolean GetCursorPos(@NativeType("LPPOINT") POINT point) { + return nGetCursorPos(point.address()) != 0; + } + + // --- [ SetCursorPos ] --- + + /** + * Moves the cursor to the specified screen coordinates. If the new coordinates are not within the screen rectangle set by the most recent {@link #ClipCursor} + * function call, the system automatically adjusts the coordinates so that the cursor stays within the rectangle. + * + * @param X the new x-coordinate of the cursor, in screen coordinates. + * @param Y the new y-coordinate of the cursor, in screen coordinates. + */ + @NativeType("BOOL") + public static boolean SetCursorPos(int X, int Y) { + long __functionAddress = Functions.SetCursorPos; + return callI(X, Y, __functionAddress) != 0; + } + + // --- [ ClipCursor ] --- + + /** Unsafe version of: {@link #ClipCursor} */ + public static int nClipCursor(long rect) { + long __functionAddress = Functions.ClipCursor; + return callPI(rect, __functionAddress); + } + + /** + * Confines the cursor to a rectangular area on the screen. If a subsequent cursor position (set by the {@link #SetCursorPos} function or the mouse) lies + * outside the rectangle, the system automatically adjusts the position to keep the cursor inside the rectangular area. + * + * @param rect a pointer to the structure that contains the screen coordinates of the upper-left and lower-right corners of the confining rectangle. If this + * parameter is {@code NULL}, the cursor is free to move anywhere on the screen. + */ + @NativeType("BOOL") + public static boolean ClipCursor(@Nullable @NativeType("RECT const *") RECT rect) { + return nClipCursor(memAddressSafe(rect)) != 0; + } + + // --- [ ShowCursor ] --- + + /** + * Displays or hides the cursor. + * + *

This function sets an internal display counter that determines whether the cursor should be displayed. The cursor is displayed only if the display + * count is greater than or equal to 0. If a mouse is installed, the initial display count is 0. If no mouse is installed, the display count is –1.

+ * + * @param show If {@code show} is {@link WinBase#TRUE}, the display count is incremented by one. If {@code show} is {@link WinBase#FALSE}, the display count is decremented by one. + * + * @return the new display counter + */ + public static int ShowCursor(@NativeType("BOOL") boolean show) { + long __functionAddress = Functions.ShowCursor; + return callI(show ? 1 : 0, __functionAddress); + } + + // --- [ SetCursor ] --- + + /** + * Sets the cursor shape. + * + *

The cursor is set only if the new cursor is different from the previous cursor; otherwise, the function returns immediately.

+ * + *

The cursor is a shared resource. A window should set the cursor shape only when the cursor is in its client area or when the window is capturing mouse + * input. In systems without a mouse, the window should restore the previous cursor before the cursor leaves the client area or before it relinquishes + * control to another window.

+ * + *

If your application must set the cursor while it is in a window, make sure the class cursor for the specified window's class is set to {@code NULL}. If the + * class cursor is not {@code NULL}, the system restores the class cursor each time the mouse is moved.

+ * + *

The cursor is not shown on the screen if the internal cursor display count is less than zero. This occurs if the application uses the {@link #ShowCursor} + * function to hide the cursor more times than to show the cursor.

+ * + * @param hCursor a handle to the cursor. The cursor must have been created by the {@code CreateCursor} function or loaded by the {@link #LoadCursor} or {@code LoadImage} + * function. If this parameter is {@code NULL}, the cursor is removed from the screen. + * + * @return the handle to the previous cursor, if there was one + */ + @NativeType("HCURSOR") + public static long SetCursor(@NativeType("HCURSOR") long hCursor) { + long __functionAddress = Functions.SetCursor; + return callPP(hCursor, __functionAddress); + } + + // --- [ ClientToScreen ] --- + + /** Unsafe version of: {@link #ClientToScreen} */ + public static int nClientToScreen(long hWnd, long lpPoint) { + long __functionAddress = Functions.ClientToScreen; + if (CHECKS) { + check(hWnd); + } + return callPPI(hWnd, lpPoint, __functionAddress); + } + + /** + * Converts the client-area coordinates of a specified point to screen coordinates. + * + *

The {@code ClientToScreen} function replaces the client-area coordinates in the {@link POINT} structure with the screen coordinates. The screen coordinates + * are relative to the upper-left corner of the screen. Note, a screen-coordinate point that is above the window's client area has a negative + * y-coordinate. Similarly, a screen coordinate to the left of a client area has a negative x-coordinate.

+ * + *

All coordinates are device coordinates.

+ * + * @param hWnd a handle to the window whose client area is used for the conversion + * @param lpPoint a pointer to a {@code POINT} structure that contains the client coordinates to be converted. The new screen coordinates are copied into this + * structure if the function succeeds. + */ + @NativeType("BOOL") + public static boolean ClientToScreen(@NativeType("HWND") long hWnd, @NativeType("LPPOINT") POINT lpPoint) { + return nClientToScreen(hWnd, lpPoint.address()) != 0; + } + + // --- [ GetAsyncKeyState ] --- + + /** + * Determines whether a key is up or down at the time the function is called, and whether the key was pressed after a previous call to + * {@code GetAsyncKeyState}. + * + *

The {@code GetAsyncKeyState} function works with mouse buttons. However, it checks on the state of the physical mouse buttons, not on the logical mouse + * buttons that the physical buttons are mapped to. For example, the call {@code GetAsyncKeyState(VK_LBUTTON)} always returns the state of the left + * physical mouse button, regardless of whether it is mapped to the left or right logical mouse button. You can determine the system's current mapping of + * physical mouse buttons to logical mouse buttons by calling {@code GetSystemMetrics(SM_SWAPBUTTON)} which returns {@link WinBase#TRUE} if the mouse buttons have been + * swapped.

+ * + *

Although the least significant bit of the return value indicates whether the key has been pressed since the last query, due to the pre-emptive + * multitasking nature of Windows, another application can call {@code GetAsyncKeyState} and receive the "recently pressed" bit instead of your + * application. The behavior of the least significant bit of the return value is retained strictly for compatibility with 16-bit Windows applications + * (which are non-preemptive) and should not be relied upon.

+ * + *

You can use the virtual-key code constants {@link #VK_SHIFT}, {@link #VK_CONTROL}, and {@link #VK_MENU} as values for the {@code vKey} parameter. This gives the state of the + * SHIFT, CTRL, or ALT keys without distinguishing between left and right.

+ * + * @param vKey the virtual-key code. You can use left- and right-distinguishing constants to specify certain keys. + * + * @return if the function succeeds, the return value specifies whether the key was pressed since the last call to {@code GetAsyncKeyState}, and whether the key + * is currently up or down. If the most significant bit is set, the key is down, and if the least significant bit is set, the key was pressed after the + * previous call to {@code GetAsyncKeyState}. However, you should not rely on this last behavior; for more information, see the Remarks. + * + *

The return value is zero for the following cases:

+ * + *
    + *
  • The current desktop is not the active desktop
  • + *
  • The foreground thread belongs to another process and the desktop does not allow the hook or the journal record.
  • + *
+ */ + @NativeType("SHORT") + public static short GetAsyncKeyState(int vKey) { + long __functionAddress = Functions.GetAsyncKeyState; + return callS(vKey, __functionAddress); + } + + // --- [ GetMessageExtraInfo ] --- + + /** + * Retrieves the extra message information for the current thread. + * + *

Extra message information is an application- or driver-defined value associated with the current thread's message queue.

+ * + * @return the extra information. The meaning of the extra information is device specific. + */ + @NativeType("LPARAM") + public static long GetMessageExtraInfo() { + long __functionAddress = Functions.GetMessageExtraInfo; + return callP(__functionAddress); + } + + // --- [ SendInput ] --- + + /** + * Unsafe version of: {@link #SendInput} + * + * @param cInputs the number of structures in the {@code pInputs} array + */ + public static int nSendInput(int cInputs, long pInputs, int cbSize) { + long __functionAddress = Functions.SendInput; + return callPI(cInputs, pInputs, cbSize, __functionAddress); + } + + /** + * Synthesizes keystrokes, mouse motions, and button clicks. + * + *

This function is subject to UIPI. Applications are permitted to inject input only into applications that are at an equal or lesser integrity level.

+ * + *

The {@code SendInput} function inserts the events in the {@link INPUT} structures serially into the keyboard or mouse input stream. These events are not + * interspersed with other keyboard or mouse input events inserted either by the user (with the keyboard or mouse) or by calls to {@code keybd_event}, + * {@code mouse_event}, or other calls to {@code SendInput}.

+ * + *

This function does not reset the keyboard's current state. Any keys that are already pressed when the function is called might interfere with the + * events that this function generates. To avoid this problem, check the keyboard's state with the {@link #GetAsyncKeyState} function and correct as necessary.

+ * + *

Because the touch keyboard uses the surrogate macros defined in {@code winnls.h} to send input to the system, a listener on the keyboard event hook + * must decode input originating from the touch keyboard.

+ * + *

An accessibility application can use {@code SendInput} to inject keystrokes corresponding to application launch shortcut keys that are handled by the + * shell. This functionality is not guaranteed to work for other types of applications.

+ * + * @param pInputs an array of {@code INPUT} structures. Each structure represents an event to be inserted into the keyboard or mouse input stream. + * @param cbSize the size, in bytes, of an {@code INPUT} structure. If {@code cbSiz}e is not the size of an {@code INPUT} structure, the function fails. + * + * @return the number of events that it successfully inserted into the keyboard or mouse input stream. If the function returns zero, the input was already blocked + * by another thread. To get extended error information, call {@link WinBase#GetLastError}. + * + *

This function fails when it is blocked by UIPI. Note that neither GetLastError nor the return value will indicate the failure was caused by UIPI + * blocking.

+ */ + @NativeType("UINT") + public static int SendInput(@NativeType("PINPUT") INPUT.Buffer pInputs, int cbSize) { + return nSendInput(pInputs.remaining(), pInputs.address(), cbSize); + } + + // --- [ GetDpiForSystem ] --- + + /** + * Returns the system DPI. + * + *

The return value will be dependent based upon the calling context. If the current thread has a {@code DPI_AWARENESS} value of {@link #DPI_AWARENESS_UNAWARE}, + * the return value will be 96. That is because the current context always assumes a DPI of 96. For any other {@code DPI_AWARENESS} value, the return + * value will be the actual system DPI.

+ * + *

You should not cache the system DPI, but should use {@code GetDpiForSystem} whenever you need the system DPI value.

+ * + * @return the system DPI value + * + * @since Windows 10 + */ + @NativeType("UINT") + public static int GetDpiForSystem() { + long __functionAddress = Functions.GetDpiForSystem; + if (CHECKS) { + check(__functionAddress); + } + return callI(__functionAddress); + } + + // --- [ GetDpiForWindow ] --- + + /** + * Returns the dots per inch (dpi) value for the associated window. + * + * @param hwnd the window you want to get information about + * + * @return the DPI for the window which depends on the {@code DPI_AWARENESS} of the window. An invalid {@code hwnd} value will result in a return value of 0. + * + * @since Windows 10 + */ + @NativeType("UINT") + public static int GetDpiForWindow(@NativeType("HWND") long hwnd) { + long __functionAddress = Functions.GetDpiForWindow; + if (CHECKS) { + check(__functionAddress); + check(hwnd); + } + return callPI(hwnd, __functionAddress); + } + + // --- [ GetAwarenessFromDpiAwarenessContext ] --- + + /** + * Retrieves the {@code DPI_AWARENESS} value from a {@code DPI_AWARENESS_CONTEXT}. + * + * @param value the {@code DPI_AWARENESS_CONTEXT} you want to examine + * + * @return the {@code DPI_AWARENESS}. If the provided value is null or invalid, this method will return {@link #DPI_AWARENESS_INVALID}. + * + * @since Windows 10 + */ + @NativeType("DPI_AWARENESS") + public static int GetAwarenessFromDpiAwarenessContext(@NativeType("DPI_AWARENESS_CONTEXT") long value) { + long __functionAddress = Functions.GetAwarenessFromDpiAwarenessContext; + if (CHECKS) { + check(__functionAddress); + check(value); + } + return callPI(value, __functionAddress); + } + + // --- [ GetThreadDpiAwarenessContext ] --- + + /** + * Gets the {@code DPI_AWARENESS_CONTEXT} for the current thread. + * + *

If {@link #SetThreadDpiAwarenessContext} was never called for this thread, then the return value will equal the default {@code DPI_AWARENESS_CONTEXT} for the + * process.

+ * + * @return the current {@code DPI_AWARENESS_CONTEXT} for the thread. + * + * @since Windows 10 + */ + @NativeType("DPI_AWARENESS_CONTEXT") + public static long GetThreadDpiAwarenessContext() { + long __functionAddress = Functions.GetThreadDpiAwarenessContext; + if (CHECKS) { + check(__functionAddress); + } + return callP(__functionAddress); + } + + // --- [ GetWindowDpiAwarenessContext ] --- + + /** + * Returns the {@code DPI_AWARENESS_CONTEXT} associated with a window. + * + * @param hwnd the window to query + * + * @return the {@code DPI_AWARENESS_CONTEXT} for the provided window. If the window is not valid, the return value is {@code NULL}. + * + * @since Windows 10 + */ + @NativeType("DPI_AWARENESS_CONTEXT") + public static long GetWindowDpiAwarenessContext(@NativeType("HWND") long hwnd) { + long __functionAddress = Functions.GetWindowDpiAwarenessContext; + if (CHECKS) { + check(__functionAddress); + check(hwnd); + } + return callPP(hwnd, __functionAddress); + } + + // --- [ IsValidDpiAwarenessContext ] --- + + /** + * Determines if a specified {@code DPI_AWARENESS_CONTEXT} is valid and supported by the current system. + * + * @param value the context that you want to determine if it is supported + * + * @return {@link WinBase#TRUE} if the provided context is supported, otherwise {@link WinBase#FALSE} + * + * @since Windows 10 + */ + @NativeType("BOOL") + public static boolean IsValidDpiAwarenessContext(@NativeType("DPI_AWARENESS_CONTEXT") long value) { + long __functionAddress = Functions.IsValidDpiAwarenessContext; + if (CHECKS) { + check(__functionAddress); + } + return callPI(value, __functionAddress) != 0; + } + + // --- [ SetThreadDpiAwarenessContext ] --- + + /** + * Set the DPI awareness for the current thread to the provided value. + * + * @param dpiContext the DPI awareness value to set + * + * @return The old {@code DPI_AWARENESS_CONTEXT} for the thread. If the {@code dpiContext} is invalid, the thread will not be updated and the return value will be + * {@code NULL}. You can use this value to restore the old {@code DPI_AWARENESS_CONTEXT} after overriding it with a predefined value. + * + * @since Windows 10 + */ + @NativeType("DPI_AWARENESS_CONTEXT") + public static long SetThreadDpiAwarenessContext(@NativeType("DPI_AWARENESS_CONTEXT") long dpiContext) { + long __functionAddress = Functions.SetThreadDpiAwarenessContext; + if (CHECKS) { + check(__functionAddress); + check(dpiContext); + } + return callPP(dpiContext, __functionAddress); + } + + /** Array version of: {@link #IsTouchWindow} */ + @NativeType("BOOL") + public static boolean IsTouchWindow(@NativeType("HWND") long hWnd, @Nullable @NativeType("PULONG") int[] pulFlags) { + long __functionAddress = Functions.IsTouchWindow; + if (CHECKS) { + check(__functionAddress); + check(hWnd); + checkSafe(pulFlags, 1); + } + return callPPI(hWnd, pulFlags, __functionAddress) != 0; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WINDOWPLACEMENT.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WINDOWPLACEMENT.java new file mode 100644 index 00000000..c81ebc7e --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WINDOWPLACEMENT.java @@ -0,0 +1,407 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.windows; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Contains information about the placement of a window on the screen. + * + *

Member documentation

+ * + *
    + *
  • {@code length} – + * the length of the structure, in bytes. Before calling the {@link User32#GetWindowPlacement} or {@link User32#SetWindowPlacement} functions, set this member to + * {@link #SIZEOF}.
  • + *
  • {@code flags} – the flags that control the position of the minimized window and the method by which the window is restored. This member can be one or more of thefollowing values:
    {@link User32#WPF_SETMINPOSITION} {@link User32#WPF_RESTORETOMAXIMIZED} {@link User32#WPF_ASYNCWINDOWPLACEMENT}
  • + *
  • {@code showCmd} – the current show state of the window
  • + *
  • {@code ptMinPosition} – the coordinates of the window's upper-left corner when the window is minimized
  • + *
  • {@code ptMaxPosition} – the coordinates of the window's upper-left corner when the window is maximized
  • + *
  • {@code rcNormalPosition} – the window's coordinates when the window is in the restored position
  • + *
+ * + *

Layout

+ * + *

+ * struct WINDOWPLACEMENT {
+ *     UINT length;
+ *     UINT flags;
+ *     UINT showCmd;
+ *     {@link POINT POINT} ptMinPosition;
+ *     {@link POINT POINT} ptMaxPosition;
+ *     {@link RECT RECT} rcNormalPosition;
+ * }
+ */ +public class WINDOWPLACEMENT extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + LENGTH, + FLAGS, + SHOWCMD, + PTMINPOSITION, + PTMAXPOSITION, + RCNORMALPOSITION; + + static { + Layout layout = __struct( + __member(4), + __member(4), + __member(4), + __member(POINT.SIZEOF, POINT.ALIGNOF), + __member(POINT.SIZEOF, POINT.ALIGNOF), + __member(RECT.SIZEOF, RECT.ALIGNOF) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + LENGTH = layout.offsetof(0); + FLAGS = layout.offsetof(1); + SHOWCMD = layout.offsetof(2); + PTMINPOSITION = layout.offsetof(3); + PTMAXPOSITION = layout.offsetof(4); + RCNORMALPOSITION = layout.offsetof(5); + } + + /** + * Creates a {@code WINDOWPLACEMENT} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public WINDOWPLACEMENT(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code length} field. */ + @NativeType("UINT") + public int length() { return nlength(address()); } + /** Returns the value of the {@code flags} field. */ + @NativeType("UINT") + public int flags() { return nflags(address()); } + /** Returns the value of the {@code showCmd} field. */ + @NativeType("UINT") + public int showCmd() { return nshowCmd(address()); } + /** Returns a {@link POINT} view of the {@code ptMinPosition} field. */ + public POINT ptMinPosition() { return nptMinPosition(address()); } + /** Returns a {@link POINT} view of the {@code ptMaxPosition} field. */ + public POINT ptMaxPosition() { return nptMaxPosition(address()); } + /** Returns a {@link RECT} view of the {@code rcNormalPosition} field. */ + public RECT rcNormalPosition() { return nrcNormalPosition(address()); } + + /** Sets the specified value to the {@code length} field. */ + public WINDOWPLACEMENT length(@NativeType("UINT") int value) { nlength(address(), value); return this; } + /** Sets the specified value to the {@code flags} field. */ + public WINDOWPLACEMENT flags(@NativeType("UINT") int value) { nflags(address(), value); return this; } + /** Sets the specified value to the {@code showCmd} field. */ + public WINDOWPLACEMENT showCmd(@NativeType("UINT") int value) { nshowCmd(address(), value); return this; } + /** Copies the specified {@link POINT} to the {@code ptMinPosition} field. */ + public WINDOWPLACEMENT ptMinPosition(POINT value) { nptMinPosition(address(), value); return this; } + /** Passes the {@code ptMinPosition} field to the specified {@link java.util.function.Consumer Consumer}. */ + public WINDOWPLACEMENT ptMinPosition(java.util.function.Consumer consumer) { consumer.accept(ptMinPosition()); return this; } + /** Copies the specified {@link POINT} to the {@code ptMaxPosition} field. */ + public WINDOWPLACEMENT ptMaxPosition(POINT value) { nptMaxPosition(address(), value); return this; } + /** Passes the {@code ptMaxPosition} field to the specified {@link java.util.function.Consumer Consumer}. */ + public WINDOWPLACEMENT ptMaxPosition(java.util.function.Consumer consumer) { consumer.accept(ptMaxPosition()); return this; } + /** Copies the specified {@link RECT} to the {@code rcNormalPosition} field. */ + public WINDOWPLACEMENT rcNormalPosition(RECT value) { nrcNormalPosition(address(), value); return this; } + /** Passes the {@code rcNormalPosition} field to the specified {@link java.util.function.Consumer Consumer}. */ + public WINDOWPLACEMENT rcNormalPosition(java.util.function.Consumer consumer) { consumer.accept(rcNormalPosition()); return this; } + + /** Initializes this struct with the specified values. */ + public WINDOWPLACEMENT set( + int length, + int flags, + int showCmd, + POINT ptMinPosition, + POINT ptMaxPosition, + RECT rcNormalPosition + ) { + length(length); + flags(flags); + showCmd(showCmd); + ptMinPosition(ptMinPosition); + ptMaxPosition(ptMaxPosition); + rcNormalPosition(rcNormalPosition); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public WINDOWPLACEMENT set(WINDOWPLACEMENT src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code WINDOWPLACEMENT} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static WINDOWPLACEMENT malloc() { + return wrap(WINDOWPLACEMENT.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code WINDOWPLACEMENT} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static WINDOWPLACEMENT calloc() { + return wrap(WINDOWPLACEMENT.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code WINDOWPLACEMENT} instance allocated with {@link BufferUtils}. */ + public static WINDOWPLACEMENT create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(WINDOWPLACEMENT.class, memAddress(container), container); + } + + /** Returns a new {@code WINDOWPLACEMENT} instance for the specified memory address. */ + public static WINDOWPLACEMENT create(long address) { + return wrap(WINDOWPLACEMENT.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static WINDOWPLACEMENT createSafe(long address) { + return address == NULL ? null : wrap(WINDOWPLACEMENT.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code WINDOWPLACEMENT} instance allocated on the thread-local {@link MemoryStack}. */ + public static WINDOWPLACEMENT mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code WINDOWPLACEMENT} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static WINDOWPLACEMENT callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code WINDOWPLACEMENT} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static WINDOWPLACEMENT mallocStack(MemoryStack stack) { + return wrap(WINDOWPLACEMENT.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code WINDOWPLACEMENT} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static WINDOWPLACEMENT callocStack(MemoryStack stack) { + return wrap(WINDOWPLACEMENT.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #length}. */ + public static int nlength(long struct) { return UNSAFE.getInt(null, struct + WINDOWPLACEMENT.LENGTH); } + /** Unsafe version of {@link #flags}. */ + public static int nflags(long struct) { return UNSAFE.getInt(null, struct + WINDOWPLACEMENT.FLAGS); } + /** Unsafe version of {@link #showCmd}. */ + public static int nshowCmd(long struct) { return UNSAFE.getInt(null, struct + WINDOWPLACEMENT.SHOWCMD); } + /** Unsafe version of {@link #ptMinPosition}. */ + public static POINT nptMinPosition(long struct) { return POINT.create(struct + WINDOWPLACEMENT.PTMINPOSITION); } + /** Unsafe version of {@link #ptMaxPosition}. */ + public static POINT nptMaxPosition(long struct) { return POINT.create(struct + WINDOWPLACEMENT.PTMAXPOSITION); } + /** Unsafe version of {@link #rcNormalPosition}. */ + public static RECT nrcNormalPosition(long struct) { return RECT.create(struct + WINDOWPLACEMENT.RCNORMALPOSITION); } + + /** Unsafe version of {@link #length(int) length}. */ + public static void nlength(long struct, int value) { UNSAFE.putInt(null, struct + WINDOWPLACEMENT.LENGTH, value); } + /** Unsafe version of {@link #flags(int) flags}. */ + public static void nflags(long struct, int value) { UNSAFE.putInt(null, struct + WINDOWPLACEMENT.FLAGS, value); } + /** Unsafe version of {@link #showCmd(int) showCmd}. */ + public static void nshowCmd(long struct, int value) { UNSAFE.putInt(null, struct + WINDOWPLACEMENT.SHOWCMD, value); } + /** Unsafe version of {@link #ptMinPosition(POINT) ptMinPosition}. */ + public static void nptMinPosition(long struct, POINT value) { memCopy(value.address(), struct + WINDOWPLACEMENT.PTMINPOSITION, POINT.SIZEOF); } + /** Unsafe version of {@link #ptMaxPosition(POINT) ptMaxPosition}. */ + public static void nptMaxPosition(long struct, POINT value) { memCopy(value.address(), struct + WINDOWPLACEMENT.PTMAXPOSITION, POINT.SIZEOF); } + /** Unsafe version of {@link #rcNormalPosition(RECT) rcNormalPosition}. */ + public static void nrcNormalPosition(long struct, RECT value) { memCopy(value.address(), struct + WINDOWPLACEMENT.RCNORMALPOSITION, RECT.SIZEOF); } + + // ----------------------------------- + + /** An array of {@link WINDOWPLACEMENT} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final WINDOWPLACEMENT ELEMENT_FACTORY = WINDOWPLACEMENT.create(-1L); + + /** + * Creates a new {@code WINDOWPLACEMENT.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link WINDOWPLACEMENT#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected WINDOWPLACEMENT getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code length} field. */ + @NativeType("UINT") + public int length() { return WINDOWPLACEMENT.nlength(address()); } + /** Returns the value of the {@code flags} field. */ + @NativeType("UINT") + public int flags() { return WINDOWPLACEMENT.nflags(address()); } + /** Returns the value of the {@code showCmd} field. */ + @NativeType("UINT") + public int showCmd() { return WINDOWPLACEMENT.nshowCmd(address()); } + /** Returns a {@link POINT} view of the {@code ptMinPosition} field. */ + public POINT ptMinPosition() { return WINDOWPLACEMENT.nptMinPosition(address()); } + /** Returns a {@link POINT} view of the {@code ptMaxPosition} field. */ + public POINT ptMaxPosition() { return WINDOWPLACEMENT.nptMaxPosition(address()); } + /** Returns a {@link RECT} view of the {@code rcNormalPosition} field. */ + public RECT rcNormalPosition() { return WINDOWPLACEMENT.nrcNormalPosition(address()); } + + /** Sets the specified value to the {@code length} field. */ + public Buffer length(@NativeType("UINT") int value) { WINDOWPLACEMENT.nlength(address(), value); return this; } + /** Sets the specified value to the {@code flags} field. */ + public Buffer flags(@NativeType("UINT") int value) { WINDOWPLACEMENT.nflags(address(), value); return this; } + /** Sets the specified value to the {@code showCmd} field. */ + public Buffer showCmd(@NativeType("UINT") int value) { WINDOWPLACEMENT.nshowCmd(address(), value); return this; } + /** Copies the specified {@link POINT} to the {@code ptMinPosition} field. */ + public Buffer ptMinPosition(POINT value) { WINDOWPLACEMENT.nptMinPosition(address(), value); return this; } + /** Passes the {@code ptMinPosition} field to the specified {@link java.util.function.Consumer Consumer}. */ + public Buffer ptMinPosition(java.util.function.Consumer consumer) { consumer.accept(ptMinPosition()); return this; } + /** Copies the specified {@link POINT} to the {@code ptMaxPosition} field. */ + public Buffer ptMaxPosition(POINT value) { WINDOWPLACEMENT.nptMaxPosition(address(), value); return this; } + /** Passes the {@code ptMaxPosition} field to the specified {@link java.util.function.Consumer Consumer}. */ + public Buffer ptMaxPosition(java.util.function.Consumer consumer) { consumer.accept(ptMaxPosition()); return this; } + /** Copies the specified {@link RECT} to the {@code rcNormalPosition} field. */ + public Buffer rcNormalPosition(RECT value) { WINDOWPLACEMENT.nrcNormalPosition(address(), value); return this; } + /** Passes the {@code rcNormalPosition} field to the specified {@link java.util.function.Consumer Consumer}. */ + public Buffer rcNormalPosition(java.util.function.Consumer consumer) { consumer.accept(rcNormalPosition()); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WNDCLASSEX.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WNDCLASSEX.java new file mode 100644 index 00000000..d1ee1bb5 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WNDCLASSEX.java @@ -0,0 +1,579 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.windows; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.MemoryStack.*; + +/** + * Contains the window class attributes that are registered by the {@link User32#RegisterClassEx} function. + * + *

Member documentation

+ * + *
    + *
  • {@code cbSize} – the size, in bytes, of this structure
  • + *
  • {@code style} – the class style(s)
  • + *
  • {@code lpfnWndProc} – a pointer to the window procedure
  • + *
  • {@code cbClsExtra} – the number of extra bytes to allocate following the window-class structure. The system initializes the bytes to zero.
  • + *
  • {@code cbWndExtra} – the number of extra bytes to allocate following the window instance. The system initializes the bytes to zero.
  • + *
  • {@code hInstance} – a handle to the instance that contains the window procedure for the class
  • + *
  • {@code hIcon} – a handle to the class icon. This member must be a handle to an icon resource. If this member is {@code NULL}, the system provides a default icon.
  • + *
  • {@code hCursor} – + * a handle to the class cursor. This member must be a handle to a cursor resource. If this member is {@code NULL}, an application must explicitly set the cursor + * shape whenever the mouse moves into the application's window.
  • + *
  • {@code hbrBackground} – + * a handle to the class background brush. This member can be a handle to the brush to be used for painting the background, or it can be a color value. + * When this member is {@code NULL}, an application must paint its own background whenever it is requested to paint in its client area.
  • + *
  • {@code lpszMenuName} – + * pointer to a null-terminated character string that specifies the resource name of the class menu, as the name appears in the resource file. If this + * member is {@code NULL}, windows belonging to this class have no default menu.
  • + *
  • {@code lpszClassName} – a pointer to a null-terminated string or is an atom
  • + *
  • {@code hIconSm} – + * a handle to a small icon that is associated with the window class. If this member is {@code NULL}, the system searches the icon resource specified by the + * {@code hIcon} member for an icon of the appropriate size to use as the small icon.
  • + *
+ * + *

Layout

+ * + *

+ * struct WNDCLASSEX {
+ *     UINT cbSize;
+ *     UINT style;
+ *     {@link WindowProcI WNDPROC} lpfnWndProc;
+ *     int cbClsExtra;
+ *     int cbWndExtra;
+ *     HINSTANCE hInstance;
+ *     HICON hIcon;
+ *     HCURSOR hCursor;
+ *     HBRUSH hbrBackground;
+ *     LPCTSTR lpszMenuName;
+ *     LPCTSTR lpszClassName;
+ *     HICON hIconSm;
+ * }
+ */ +public class WNDCLASSEX extends Struct implements NativeResource { + + /** The struct size in bytes. */ + public static final int SIZEOF; + + /** The struct alignment in bytes. */ + public static final int ALIGNOF; + + /** The struct member offsets. */ + public static final int + CBSIZE, + STYLE, + LPFNWNDPROC, + CBCLSEXTRA, + CBWNDEXTRA, + HINSTANCE, + HICON, + HCURSOR, + HBRBACKGROUND, + LPSZMENUNAME, + LPSZCLASSNAME, + HICONSM; + + static { + Layout layout = __struct( + __member(4), + __member(4), + __member(POINTER_SIZE), + __member(4), + __member(4), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE), + __member(POINTER_SIZE) + ); + + SIZEOF = layout.getSize(); + ALIGNOF = layout.getAlignment(); + + CBSIZE = layout.offsetof(0); + STYLE = layout.offsetof(1); + LPFNWNDPROC = layout.offsetof(2); + CBCLSEXTRA = layout.offsetof(3); + CBWNDEXTRA = layout.offsetof(4); + HINSTANCE = layout.offsetof(5); + HICON = layout.offsetof(6); + HCURSOR = layout.offsetof(7); + HBRBACKGROUND = layout.offsetof(8); + LPSZMENUNAME = layout.offsetof(9); + LPSZCLASSNAME = layout.offsetof(10); + HICONSM = layout.offsetof(11); + } + + /** + * Creates a {@code WNDCLASSEX} instance at the current position of the specified {@link ByteBuffer} container. Changes to the buffer's content will be + * visible to the struct instance and vice versa. + * + *

The created instance holds a strong reference to the container object.

+ */ + public WNDCLASSEX(ByteBuffer container) { + super(memAddress(container), __checkContainer(container, SIZEOF)); + } + + @Override + public int sizeof() { return SIZEOF; } + + /** Returns the value of the {@code cbSize} field. */ + @NativeType("UINT") + public int cbSize() { return ncbSize(address()); } + /** Returns the value of the {@code style} field. */ + @NativeType("UINT") + public int style() { return nstyle(address()); } + /** Returns the value of the {@code lpfnWndProc} field. */ + @NativeType("WNDPROC") + public WindowProc lpfnWndProc() { return nlpfnWndProc(address()); } + /** Returns the value of the {@code cbClsExtra} field. */ + public int cbClsExtra() { return ncbClsExtra(address()); } + /** Returns the value of the {@code cbWndExtra} field. */ + public int cbWndExtra() { return ncbWndExtra(address()); } + /** Returns the value of the {@code hInstance} field. */ + @NativeType("HINSTANCE") + public long hInstance() { return nhInstance(address()); } + /** Returns the value of the {@code hIcon} field. */ + @NativeType("HICON") + public long hIcon() { return nhIcon(address()); } + /** Returns the value of the {@code hCursor} field. */ + @NativeType("HCURSOR") + public long hCursor() { return nhCursor(address()); } + /** Returns the value of the {@code hbrBackground} field. */ + @NativeType("HBRUSH") + public long hbrBackground() { return nhbrBackground(address()); } + /** Returns a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code lpszMenuName} field. */ + @Nullable + @NativeType("LPCTSTR") + public ByteBuffer lpszMenuName() { return nlpszMenuName(address()); } + /** Decodes the null-terminated string pointed to by the {@code lpszMenuName} field. */ + @Nullable + @NativeType("LPCTSTR") + public String lpszMenuNameString() { return nlpszMenuNameString(address()); } + /** Returns a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code lpszClassName} field. */ + @NativeType("LPCTSTR") + public ByteBuffer lpszClassName() { return nlpszClassName(address()); } + /** Decodes the null-terminated string pointed to by the {@code lpszClassName} field. */ + @NativeType("LPCTSTR") + public String lpszClassNameString() { return nlpszClassNameString(address()); } + /** Returns the value of the {@code hIconSm} field. */ + @NativeType("HICON") + public long hIconSm() { return nhIconSm(address()); } + + /** Sets the specified value to the {@code cbSize} field. */ + public WNDCLASSEX cbSize(@NativeType("UINT") int value) { ncbSize(address(), value); return this; } + /** Sets the specified value to the {@code style} field. */ + public WNDCLASSEX style(@NativeType("UINT") int value) { nstyle(address(), value); return this; } + /** Sets the specified value to the {@code lpfnWndProc} field. */ + public WNDCLASSEX lpfnWndProc(@NativeType("WNDPROC") WindowProcI value) { nlpfnWndProc(address(), value); return this; } + /** Sets the specified value to the {@code cbClsExtra} field. */ + public WNDCLASSEX cbClsExtra(int value) { ncbClsExtra(address(), value); return this; } + /** Sets the specified value to the {@code cbWndExtra} field. */ + public WNDCLASSEX cbWndExtra(int value) { ncbWndExtra(address(), value); return this; } + /** Sets the specified value to the {@code hInstance} field. */ + public WNDCLASSEX hInstance(@NativeType("HINSTANCE") long value) { nhInstance(address(), value); return this; } + /** Sets the specified value to the {@code hIcon} field. */ + public WNDCLASSEX hIcon(@NativeType("HICON") long value) { nhIcon(address(), value); return this; } + /** Sets the specified value to the {@code hCursor} field. */ + public WNDCLASSEX hCursor(@NativeType("HCURSOR") long value) { nhCursor(address(), value); return this; } + /** Sets the specified value to the {@code hbrBackground} field. */ + public WNDCLASSEX hbrBackground(@NativeType("HBRUSH") long value) { nhbrBackground(address(), value); return this; } + /** Sets the address of the specified encoded string to the {@code lpszMenuName} field. */ + public WNDCLASSEX lpszMenuName(@Nullable @NativeType("LPCTSTR") ByteBuffer value) { nlpszMenuName(address(), value); return this; } + /** Sets the address of the specified encoded string to the {@code lpszClassName} field. */ + public WNDCLASSEX lpszClassName(@NativeType("LPCTSTR") ByteBuffer value) { nlpszClassName(address(), value); return this; } + /** Sets the specified value to the {@code hIconSm} field. */ + public WNDCLASSEX hIconSm(@NativeType("HICON") long value) { nhIconSm(address(), value); return this; } + + /** Initializes this struct with the specified values. */ + public WNDCLASSEX set( + int cbSize, + int style, + WindowProcI lpfnWndProc, + int cbClsExtra, + int cbWndExtra, + long hInstance, + long hIcon, + long hCursor, + long hbrBackground, + @Nullable ByteBuffer lpszMenuName, + ByteBuffer lpszClassName, + long hIconSm + ) { + cbSize(cbSize); + style(style); + lpfnWndProc(lpfnWndProc); + cbClsExtra(cbClsExtra); + cbWndExtra(cbWndExtra); + hInstance(hInstance); + hIcon(hIcon); + hCursor(hCursor); + hbrBackground(hbrBackground); + lpszMenuName(lpszMenuName); + lpszClassName(lpszClassName); + hIconSm(hIconSm); + + return this; + } + + /** + * Copies the specified struct data to this struct. + * + * @param src the source struct + * + * @return this struct + */ + public WNDCLASSEX set(WNDCLASSEX src) { + memCopy(src.address(), address(), SIZEOF); + return this; + } + + // ----------------------------------- + + /** Returns a new {@code WNDCLASSEX} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. */ + public static WNDCLASSEX malloc() { + return wrap(WNDCLASSEX.class, nmemAllocChecked(SIZEOF)); + } + + /** Returns a new {@code WNDCLASSEX} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. */ + public static WNDCLASSEX calloc() { + return wrap(WNDCLASSEX.class, nmemCallocChecked(1, SIZEOF)); + } + + /** Returns a new {@code WNDCLASSEX} instance allocated with {@link BufferUtils}. */ + public static WNDCLASSEX create() { + ByteBuffer container = BufferUtils.createByteBuffer(SIZEOF); + return wrap(WNDCLASSEX.class, memAddress(container), container); + } + + /** Returns a new {@code WNDCLASSEX} instance for the specified memory address. */ + public static WNDCLASSEX create(long address) { + return wrap(WNDCLASSEX.class, address); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static WNDCLASSEX createSafe(long address) { + return address == NULL ? null : wrap(WNDCLASSEX.class, address); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memAlloc memAlloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer malloc(int capacity) { + return wrap(Buffer.class, nmemAllocChecked(__checkMalloc(capacity, SIZEOF)), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link MemoryUtil#memCalloc memCalloc}. The instance must be explicitly freed. + * + * @param capacity the buffer capacity + */ + public static Buffer calloc(int capacity) { + return wrap(Buffer.class, nmemCallocChecked(capacity, SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated with {@link BufferUtils}. + * + * @param capacity the buffer capacity + */ + public static Buffer create(int capacity) { + ByteBuffer container = __create(capacity, SIZEOF); + return wrap(Buffer.class, memAddress(container), capacity, container); + } + + /** + * Create a {@link Buffer} instance at the specified memory. + * + * @param address the memory address + * @param capacity the buffer capacity + */ + public static Buffer create(long address, int capacity) { + return wrap(Buffer.class, address, capacity); + } + + /** Like {@link #create(long, int) create}, but returns {@code null} if {@code address} is {@code NULL}. */ + @Nullable + public static Buffer createSafe(long address, int capacity) { + return address == NULL ? null : wrap(Buffer.class, address, capacity); + } + + // ----------------------------------- + + /** Returns a new {@code WNDCLASSEX} instance allocated on the thread-local {@link MemoryStack}. */ + public static WNDCLASSEX mallocStack() { + return mallocStack(stackGet()); + } + + /** Returns a new {@code WNDCLASSEX} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. */ + public static WNDCLASSEX callocStack() { + return callocStack(stackGet()); + } + + /** + * Returns a new {@code WNDCLASSEX} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + */ + public static WNDCLASSEX mallocStack(MemoryStack stack) { + return wrap(WNDCLASSEX.class, stack.nmalloc(ALIGNOF, SIZEOF)); + } + + /** + * Returns a new {@code WNDCLASSEX} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + */ + public static WNDCLASSEX callocStack(MemoryStack stack) { + return wrap(WNDCLASSEX.class, stack.ncalloc(ALIGNOF, 1, SIZEOF)); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack}. + * + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity) { + return mallocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the thread-local {@link MemoryStack} and initializes all its bits to zero. + * + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity) { + return callocStack(capacity, stackGet()); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack}. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer mallocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.nmalloc(ALIGNOF, capacity * SIZEOF), capacity); + } + + /** + * Returns a new {@link Buffer} instance allocated on the specified {@link MemoryStack} and initializes all its bits to zero. + * + * @param stack the stack from which to allocate + * @param capacity the buffer capacity + */ + public static Buffer callocStack(int capacity, MemoryStack stack) { + return wrap(Buffer.class, stack.ncalloc(ALIGNOF, capacity, SIZEOF), capacity); + } + + // ----------------------------------- + + /** Unsafe version of {@link #cbSize}. */ + public static int ncbSize(long struct) { return UNSAFE.getInt(null, struct + WNDCLASSEX.CBSIZE); } + /** Unsafe version of {@link #style}. */ + public static int nstyle(long struct) { return UNSAFE.getInt(null, struct + WNDCLASSEX.STYLE); } + /** Unsafe version of {@link #lpfnWndProc}. */ + public static WindowProc nlpfnWndProc(long struct) { return WindowProc.create(memGetAddress(struct + WNDCLASSEX.LPFNWNDPROC)); } + /** Unsafe version of {@link #cbClsExtra}. */ + public static int ncbClsExtra(long struct) { return UNSAFE.getInt(null, struct + WNDCLASSEX.CBCLSEXTRA); } + /** Unsafe version of {@link #cbWndExtra}. */ + public static int ncbWndExtra(long struct) { return UNSAFE.getInt(null, struct + WNDCLASSEX.CBWNDEXTRA); } + /** Unsafe version of {@link #hInstance}. */ + public static long nhInstance(long struct) { return memGetAddress(struct + WNDCLASSEX.HINSTANCE); } + /** Unsafe version of {@link #hIcon}. */ + public static long nhIcon(long struct) { return memGetAddress(struct + WNDCLASSEX.HICON); } + /** Unsafe version of {@link #hCursor}. */ + public static long nhCursor(long struct) { return memGetAddress(struct + WNDCLASSEX.HCURSOR); } + /** Unsafe version of {@link #hbrBackground}. */ + public static long nhbrBackground(long struct) { return memGetAddress(struct + WNDCLASSEX.HBRBACKGROUND); } + /** Unsafe version of {@link #lpszMenuName}. */ + @Nullable public static ByteBuffer nlpszMenuName(long struct) { return memByteBufferNT2Safe(memGetAddress(struct + WNDCLASSEX.LPSZMENUNAME)); } + /** Unsafe version of {@link #lpszMenuNameString}. */ + @Nullable public static String nlpszMenuNameString(long struct) { return memUTF16Safe(memGetAddress(struct + WNDCLASSEX.LPSZMENUNAME)); } + /** Unsafe version of {@link #lpszClassName}. */ + public static ByteBuffer nlpszClassName(long struct) { return memByteBufferNT2(memGetAddress(struct + WNDCLASSEX.LPSZCLASSNAME)); } + /** Unsafe version of {@link #lpszClassNameString}. */ + public static String nlpszClassNameString(long struct) { return memUTF16(memGetAddress(struct + WNDCLASSEX.LPSZCLASSNAME)); } + /** Unsafe version of {@link #hIconSm}. */ + public static long nhIconSm(long struct) { return memGetAddress(struct + WNDCLASSEX.HICONSM); } + + /** Unsafe version of {@link #cbSize(int) cbSize}. */ + public static void ncbSize(long struct, int value) { UNSAFE.putInt(null, struct + WNDCLASSEX.CBSIZE, value); } + /** Unsafe version of {@link #style(int) style}. */ + public static void nstyle(long struct, int value) { UNSAFE.putInt(null, struct + WNDCLASSEX.STYLE, value); } + /** Unsafe version of {@link #lpfnWndProc(WindowProcI) lpfnWndProc}. */ + public static void nlpfnWndProc(long struct, WindowProcI value) { memPutAddress(struct + WNDCLASSEX.LPFNWNDPROC, value.address()); } + /** Unsafe version of {@link #cbClsExtra(int) cbClsExtra}. */ + public static void ncbClsExtra(long struct, int value) { UNSAFE.putInt(null, struct + WNDCLASSEX.CBCLSEXTRA, value); } + /** Unsafe version of {@link #cbWndExtra(int) cbWndExtra}. */ + public static void ncbWndExtra(long struct, int value) { UNSAFE.putInt(null, struct + WNDCLASSEX.CBWNDEXTRA, value); } + /** Unsafe version of {@link #hInstance(long) hInstance}. */ + public static void nhInstance(long struct, long value) { memPutAddress(struct + WNDCLASSEX.HINSTANCE, check(value)); } + /** Unsafe version of {@link #hIcon(long) hIcon}. */ + public static void nhIcon(long struct, long value) { memPutAddress(struct + WNDCLASSEX.HICON, value); } + /** Unsafe version of {@link #hCursor(long) hCursor}. */ + public static void nhCursor(long struct, long value) { memPutAddress(struct + WNDCLASSEX.HCURSOR, value); } + /** Unsafe version of {@link #hbrBackground(long) hbrBackground}. */ + public static void nhbrBackground(long struct, long value) { memPutAddress(struct + WNDCLASSEX.HBRBACKGROUND, value); } + /** Unsafe version of {@link #lpszMenuName(ByteBuffer) lpszMenuName}. */ + public static void nlpszMenuName(long struct, @Nullable ByteBuffer value) { + if (CHECKS) { checkNT2Safe(value); } + memPutAddress(struct + WNDCLASSEX.LPSZMENUNAME, memAddressSafe(value)); + } + /** Unsafe version of {@link #lpszClassName(ByteBuffer) lpszClassName}. */ + public static void nlpszClassName(long struct, ByteBuffer value) { + if (CHECKS) { checkNT2(value); } + memPutAddress(struct + WNDCLASSEX.LPSZCLASSNAME, memAddress(value)); + } + /** Unsafe version of {@link #hIconSm(long) hIconSm}. */ + public static void nhIconSm(long struct, long value) { memPutAddress(struct + WNDCLASSEX.HICONSM, value); } + + /** + * Validates pointer members that should not be {@code NULL}. + * + * @param struct the struct to validate + */ + public static void validate(long struct) { + check(memGetAddress(struct + WNDCLASSEX.LPFNWNDPROC)); + check(memGetAddress(struct + WNDCLASSEX.HINSTANCE)); + check(memGetAddress(struct + WNDCLASSEX.LPSZCLASSNAME)); + } + + /** + * Calls {@link #validate(long)} for each struct contained in the specified struct array. + * + * @param array the struct array to validate + * @param count the number of structs in {@code array} + */ + public static void validate(long array, int count) { + for (int i = 0; i < count; i++) { + validate(array + Integer.toUnsignedLong(i) * SIZEOF); + } + } + + // ----------------------------------- + + /** An array of {@link WNDCLASSEX} structs. */ + public static class Buffer extends StructBuffer implements NativeResource { + + private static final WNDCLASSEX ELEMENT_FACTORY = WNDCLASSEX.create(-1L); + + /** + * Creates a new {@code WNDCLASSEX.Buffer} instance backed by the specified container. + * + * Changes to the container's content will be visible to the struct buffer instance and vice versa. The two buffers' position, limit, and mark values + * will be independent. The new buffer's position will be zero, its capacity and its limit will be the number of bytes remaining in this buffer divided + * by {@link WNDCLASSEX#SIZEOF}, and its mark will be undefined. + * + *

The created buffer instance holds a strong reference to the container object.

+ */ + public Buffer(ByteBuffer container) { + super(container, container.remaining() / SIZEOF); + } + + public Buffer(long address, int cap) { + super(address, null, -1, 0, cap, cap); + } + + Buffer(long address, @Nullable ByteBuffer container, int mark, int pos, int lim, int cap) { + super(address, container, mark, pos, lim, cap); + } + + @Override + protected Buffer self() { + return this; + } + + @Override + protected WNDCLASSEX getElementFactory() { + return ELEMENT_FACTORY; + } + + /** Returns the value of the {@code cbSize} field. */ + @NativeType("UINT") + public int cbSize() { return WNDCLASSEX.ncbSize(address()); } + /** Returns the value of the {@code style} field. */ + @NativeType("UINT") + public int style() { return WNDCLASSEX.nstyle(address()); } + /** Returns the value of the {@code lpfnWndProc} field. */ + @NativeType("WNDPROC") + public WindowProc lpfnWndProc() { return WNDCLASSEX.nlpfnWndProc(address()); } + /** Returns the value of the {@code cbClsExtra} field. */ + public int cbClsExtra() { return WNDCLASSEX.ncbClsExtra(address()); } + /** Returns the value of the {@code cbWndExtra} field. */ + public int cbWndExtra() { return WNDCLASSEX.ncbWndExtra(address()); } + /** Returns the value of the {@code hInstance} field. */ + @NativeType("HINSTANCE") + public long hInstance() { return WNDCLASSEX.nhInstance(address()); } + /** Returns the value of the {@code hIcon} field. */ + @NativeType("HICON") + public long hIcon() { return WNDCLASSEX.nhIcon(address()); } + /** Returns the value of the {@code hCursor} field. */ + @NativeType("HCURSOR") + public long hCursor() { return WNDCLASSEX.nhCursor(address()); } + /** Returns the value of the {@code hbrBackground} field. */ + @NativeType("HBRUSH") + public long hbrBackground() { return WNDCLASSEX.nhbrBackground(address()); } + /** Returns a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code lpszMenuName} field. */ + @Nullable + @NativeType("LPCTSTR") + public ByteBuffer lpszMenuName() { return WNDCLASSEX.nlpszMenuName(address()); } + /** Decodes the null-terminated string pointed to by the {@code lpszMenuName} field. */ + @Nullable + @NativeType("LPCTSTR") + public String lpszMenuNameString() { return WNDCLASSEX.nlpszMenuNameString(address()); } + /** Returns a {@link ByteBuffer} view of the null-terminated string pointed to by the {@code lpszClassName} field. */ + @NativeType("LPCTSTR") + public ByteBuffer lpszClassName() { return WNDCLASSEX.nlpszClassName(address()); } + /** Decodes the null-terminated string pointed to by the {@code lpszClassName} field. */ + @NativeType("LPCTSTR") + public String lpszClassNameString() { return WNDCLASSEX.nlpszClassNameString(address()); } + /** Returns the value of the {@code hIconSm} field. */ + @NativeType("HICON") + public long hIconSm() { return WNDCLASSEX.nhIconSm(address()); } + + /** Sets the specified value to the {@code cbSize} field. */ + public Buffer cbSize(@NativeType("UINT") int value) { WNDCLASSEX.ncbSize(address(), value); return this; } + /** Sets the specified value to the {@code style} field. */ + public Buffer style(@NativeType("UINT") int value) { WNDCLASSEX.nstyle(address(), value); return this; } + /** Sets the specified value to the {@code lpfnWndProc} field. */ + public Buffer lpfnWndProc(@NativeType("WNDPROC") WindowProcI value) { WNDCLASSEX.nlpfnWndProc(address(), value); return this; } + /** Sets the specified value to the {@code cbClsExtra} field. */ + public Buffer cbClsExtra(int value) { WNDCLASSEX.ncbClsExtra(address(), value); return this; } + /** Sets the specified value to the {@code cbWndExtra} field. */ + public Buffer cbWndExtra(int value) { WNDCLASSEX.ncbWndExtra(address(), value); return this; } + /** Sets the specified value to the {@code hInstance} field. */ + public Buffer hInstance(@NativeType("HINSTANCE") long value) { WNDCLASSEX.nhInstance(address(), value); return this; } + /** Sets the specified value to the {@code hIcon} field. */ + public Buffer hIcon(@NativeType("HICON") long value) { WNDCLASSEX.nhIcon(address(), value); return this; } + /** Sets the specified value to the {@code hCursor} field. */ + public Buffer hCursor(@NativeType("HCURSOR") long value) { WNDCLASSEX.nhCursor(address(), value); return this; } + /** Sets the specified value to the {@code hbrBackground} field. */ + public Buffer hbrBackground(@NativeType("HBRUSH") long value) { WNDCLASSEX.nhbrBackground(address(), value); return this; } + /** Sets the address of the specified encoded string to the {@code lpszMenuName} field. */ + public Buffer lpszMenuName(@Nullable @NativeType("LPCTSTR") ByteBuffer value) { WNDCLASSEX.nlpszMenuName(address(), value); return this; } + /** Sets the address of the specified encoded string to the {@code lpszClassName} field. */ + public Buffer lpszClassName(@NativeType("LPCTSTR") ByteBuffer value) { WNDCLASSEX.nlpszClassName(address(), value); return this; } + /** Sets the specified value to the {@code hIconSm} field. */ + public Buffer hIconSm(@NativeType("HICON") long value) { WNDCLASSEX.nhIconSm(address(), value); return this; } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WinBase.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WinBase.java new file mode 100644 index 00000000..380253aa --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WinBase.java @@ -0,0 +1,222 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.windows; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** Native bindings to WinBase.h. */ +public class WinBase { + + /** BOOL return values. */ + public static final int + FALSE = 0, + TRUE = 1; + + static { Library.initialize(); } + + protected WinBase() { + throw new UnsupportedOperationException(); + } + + // --- [ GetLastError ] --- + + /** + * Retrieves the calling thread's last-error code value. The last-error code is maintained on a per-thread basis. Multiple threads do not overwrite each + * other's last-error code. + * + *

LWJGL note: This function cannot be used after another JNI call to a Windows function, because the last error resets before that call returns. + * For this reason, LWJGL stores the last error in thread-local storage, you can use {@link #getLastError} to access it.

+ */ + @NativeType("DWORD") + public static native int GetLastError(); + + // --- [ getLastError ] --- + + /** + * Retrieves the calling thread's last-error code value. The last-error code is maintained on a per-thread basis. Multiple threads do not overwrite each + * other's last-error code. + * + *

LWJGL note: This method has a meaningful value only after another LWJGL JNI call. It does not call {@code GetLastError()} from WinBase.h, it + * returns the thread-local error code stored by a previous JNI call.

+ */ + @NativeType("DWORD") + public static native int getLastError(); + + // --- [ GetModuleHandle ] --- + + /** Unsafe version of: {@link #GetModuleHandle} */ + public static native long nGetModuleHandle(long moduleName); + + /** + * Retrieves a module handle for the specified module. The module must have been loaded by the calling process. + * + * @param moduleName the name of the loaded module (either a .dll or .exe file). If the file name extension is omitted, the default library extension .dll is appended. + * The file name string can include a trailing point character (.) to indicate that the module name has no extension. The string does not have to + * specify a path. When specifying a path, be sure to use backslashes (\), not forward slashes (/). The name is compared (case independently) to the + * names of modules currently mapped into the address space of the calling process. + * + *

If this parameter is {@code NULL}, {@code GetModuleHandle} returns a handle to the file used to create the calling process (.exe file).

+ */ + @NativeType("HMODULE") + public static long GetModuleHandle(@Nullable @NativeType("LPCTSTR") ByteBuffer moduleName) { + if (CHECKS) { + checkNT2Safe(moduleName); + } + return nGetModuleHandle(memAddressSafe(moduleName)); + } + + /** + * Retrieves a module handle for the specified module. The module must have been loaded by the calling process. + * + * @param moduleName the name of the loaded module (either a .dll or .exe file). If the file name extension is omitted, the default library extension .dll is appended. + * The file name string can include a trailing point character (.) to indicate that the module name has no extension. The string does not have to + * specify a path. When specifying a path, be sure to use backslashes (\), not forward slashes (/). The name is compared (case independently) to the + * names of modules currently mapped into the address space of the calling process. + * + *

If this parameter is {@code NULL}, {@code GetModuleHandle} returns a handle to the file used to create the calling process (.exe file).

+ */ + @NativeType("HMODULE") + public static long GetModuleHandle(@Nullable @NativeType("LPCTSTR") CharSequence moduleName) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF16Safe(moduleName, true); + long moduleNameEncoded = moduleName == null ? NULL : stack.getPointerAddress(); + return nGetModuleHandle(moduleNameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ LoadLibrary ] --- + + /** Unsafe version of: {@link #LoadLibrary} */ + public static native long nLoadLibrary(long name); + + /** + * Loads the specified module into the address space of the calling process. The specified module may cause other modules to be loaded. + * + * @param name the name of the module. This can be either a library module (a .dll file) or an executable module (an .exe file). The name specified is the file + * name of the module and is not related to the name stored in the library module itself, as specified by the LIBRARY keyword in the module-definition + * (.def) file. + * + *

If the string specifies a full path, the function searches only that path for the module.

+ * + *

If the string specifies a relative path or a module name without a path, the function uses a standard search strategy to find the module.

+ * + *

If the function cannot find the module, the function fails. When specifying a path, be sure to use backslashes (\), not forward slashes (/).

+ * + *

If the string specifies a module name without a path and the file name extension is omitted, the function appends the default library extension + * .dll to the module name. To prevent the function from appending .dll to the module name, include a trailing point character (.) in the module name + * string.

+ */ + @NativeType("HMODULE") + public static long LoadLibrary(@NativeType("LPCTSTR") ByteBuffer name) { + if (CHECKS) { + checkNT2(name); + } + return nLoadLibrary(memAddress(name)); + } + + /** + * Loads the specified module into the address space of the calling process. The specified module may cause other modules to be loaded. + * + * @param name the name of the module. This can be either a library module (a .dll file) or an executable module (an .exe file). The name specified is the file + * name of the module and is not related to the name stored in the library module itself, as specified by the LIBRARY keyword in the module-definition + * (.def) file. + * + *

If the string specifies a full path, the function searches only that path for the module.

+ * + *

If the string specifies a relative path or a module name without a path, the function uses a standard search strategy to find the module.

+ * + *

If the function cannot find the module, the function fails. When specifying a path, be sure to use backslashes (\), not forward slashes (/).

+ * + *

If the string specifies a module name without a path and the file name extension is omitted, the function appends the default library extension + * .dll to the module name. To prevent the function from appending .dll to the module name, include a trailing point character (.) in the module name + * string.

+ */ + @NativeType("HMODULE") + public static long LoadLibrary(@NativeType("LPCTSTR") CharSequence name) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF16(name, true); + long nameEncoded = stack.getPointerAddress(); + return nLoadLibrary(nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ GetProcAddress ] --- + + /** Unsafe version of: {@link #GetProcAddress} */ + public static native long nGetProcAddress(long handle, long name); + + /** + * Retrieves the address of an exported function or variable from the specified dynamic-link library (DLL). + * + * @param handle a handle to the DLL module that contains the function or variable + * @param name the function or variable name, or the function's ordinal value. If this parameter is an ordinal value, it must be in the low-order word; the + * high-order word must be zero. + */ + @NativeType("FARPROC") + public static long GetProcAddress(@NativeType("HMODULE") long handle, @NativeType("LPCSTR") ByteBuffer name) { + if (CHECKS) { + check(handle); + checkNT1(name); + } + return nGetProcAddress(handle, memAddress(name)); + } + + /** + * Retrieves the address of an exported function or variable from the specified dynamic-link library (DLL). + * + * @param handle a handle to the DLL module that contains the function or variable + * @param name the function or variable name, or the function's ordinal value. If this parameter is an ordinal value, it must be in the low-order word; the + * high-order word must be zero. + */ + @NativeType("FARPROC") + public static long GetProcAddress(@NativeType("HMODULE") long handle, @NativeType("LPCSTR") CharSequence name) { + if (CHECKS) { + check(handle); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nASCII(name, true); + long nameEncoded = stack.getPointerAddress(); + return nGetProcAddress(handle, nameEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ FreeLibrary ] --- + + /** Unsafe version of: {@link #FreeLibrary} */ + public static native int nFreeLibrary(long handle); + + /** + * Frees the loaded dynamic-link library (DLL) module and, if necessary, decrements its reference count. When the reference count reaches zero, the module + * is unloaded from the address space of the calling process and the handle is no longer valid. + * + * @param handle a handle to the loaded library module + */ + @NativeType("BOOL") + public static boolean FreeLibrary(@NativeType("HMODULE") long handle) { + if (CHECKS) { + check(handle); + } + return nFreeLibrary(handle) != 0; + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WindowProc.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WindowProc.java new file mode 100644 index 00000000..c5a5e075 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WindowProc.java @@ -0,0 +1,78 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.windows; + +import javax.annotation.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.MemoryUtil.*; + +/** + * An application-defined function that processes messages sent to a window. + * + *

Type

+ * + *

+ * LRESULT (*) (
+ *     HWND hwnd,
+ *     UINT uMsg,
+ *     WPARAM wParam,
+ *     LPARAM lParam
+ * )
+ */ +public abstract class WindowProc extends Callback implements WindowProcI { + + /** + * Creates a {@code WindowProc} instance from the specified function pointer. + * + * @return the new {@code WindowProc} + */ + public static WindowProc create(long functionPointer) { + WindowProcI instance = Callback.get(functionPointer); + return instance instanceof WindowProc + ? (WindowProc)instance + : new Container(functionPointer, instance); + } + + /** Like {@link #create(long) create}, but returns {@code null} if {@code functionPointer} is {@code NULL}. */ + @Nullable + public static WindowProc createSafe(long functionPointer) { + return functionPointer == NULL ? null : create(functionPointer); + } + + /** Creates a {@code WindowProc} instance that delegates to the specified {@code WindowProcI} instance. */ + public static WindowProc create(WindowProcI instance) { + return instance instanceof WindowProc + ? (WindowProc)instance + : new Container(instance.address(), instance); + } + + protected WindowProc() { + super(SIGNATURE); + } + + WindowProc(long functionPointer) { + super(functionPointer); + } + + private static final class Container extends WindowProc { + + private final WindowProcI delegate; + + Container(long functionPointer, WindowProcI delegate) { + super(functionPointer); + this.delegate = delegate; + } + + @Override + public long invoke(long hwnd, int uMsg, long wParam, long lParam) { + return delegate.invoke(hwnd, uMsg, wParam, lParam); + } + + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WindowProcI.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WindowProcI.java new file mode 100644 index 00000000..97a3f2bf --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WindowProcI.java @@ -0,0 +1,54 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.system.windows; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.dyncall.DynCallback.*; + +/** + * An application-defined function that processes messages sent to a window. + * + *

Type

+ * + *

+ * LRESULT (*) (
+ *     HWND hwnd,
+ *     UINT uMsg,
+ *     WPARAM wParam,
+ *     LPARAM lParam
+ * )
+ */ +@FunctionalInterface +@NativeType("WNDPROC") +public interface WindowProcI extends CallbackI.P { + + String SIGNATURE = Callback.__stdcall("(pipp)p"); + + @Override + default String getSignature() { return SIGNATURE; } + + @Override + default long callback(long args) { + return invoke( + dcbArgPointer(args), + dcbArgInt(args), + dcbArgPointer(args), + dcbArgPointer(args) + ); + } + + /** + * Will be called for each message sent to the window. + * + * @param hwnd a handle to the window procedure that received the message + * @param uMsg the message + * @param wParam additional message information. The content of this parameter depends on the value of the {@code uMsg} parameter. + * @param lParam additional message information. The content of this parameter depends on the value of the {@code uMsg} parameter. + */ + @NativeType("LRESULT") long invoke(@NativeType("HWND") long hwnd, @NativeType("UINT") int uMsg, @NativeType("WPARAM") long wParam, @NativeType("LPARAM") long lParam); + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WindowsLibrary.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WindowsLibrary.java new file mode 100644 index 00000000..c01cfbab --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WindowsLibrary.java @@ -0,0 +1,62 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system.windows; + +import org.lwjgl.system.*; + +import java.nio.*; + +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; +import static org.lwjgl.system.windows.WinBase.*; +import static org.lwjgl.system.windows.WindowsUtil.*; + +/** Implements a {@link SharedLibrary} on the Windows OS. */ +public class WindowsLibrary extends SharedLibrary.Default { + + /** The LWJGL dll handle. */ + public static final long HINSTANCE; + + static { + try (MemoryStack stack = stackPush()) { + HINSTANCE = GetModuleHandle(stack.UTF16(Library.JNI_LIBRARY_NAME)); + if (HINSTANCE == NULL) { + throw new RuntimeException("Failed to retrieve LWJGL module handle."); + } + } + } + + public WindowsLibrary(String name) { + this(name, loadLibrary(name)); + } + + public WindowsLibrary(String name, long handle) { + super(name, handle); + } + + private static long loadLibrary(String name) { + long handle; + try (MemoryStack stack = stackPush()) { + handle = LoadLibrary(stack.UTF16(name)); + } + if (handle == NULL) { + throw new UnsatisfiedLinkError("Failed to load library: " + name + " (error code = " + getLastError() + ")"); + } + return handle; + } + + @Override + public long getFunctionAddress(ByteBuffer functionName) { + return GetProcAddress(address(), functionName); + } + + @Override + public void free() { + if (!FreeLibrary(address())) { + windowsThrowException("Failed to unload library: " + getName()); + } + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WindowsUtil.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WindowsUtil.java new file mode 100644 index 00000000..e61aa0c1 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/WindowsUtil.java @@ -0,0 +1,18 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + */ +package org.lwjgl.system.windows; + +import static org.lwjgl.system.windows.WinBase.*; + +public final class WindowsUtil { + + private WindowsUtil() { + } + + public static void windowsThrowException(String msg) { + throw new RuntimeException(msg + " (error code = " + getLastError() + ")"); + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/package-info.java b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/package-info.java new file mode 100644 index 00000000..87816092 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/system/windows/package-info.java @@ -0,0 +1,10 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ + +/** Contains bindings to native APIs specific to the Windows operating system. */ +@org.lwjgl.system.NonnullDefault +package org.lwjgl.system.windows; + diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/util/tinyfd/TinyFileDialogs.java b/lwjgl3-fcl/src/main/java/org/lwjgl/util/tinyfd/TinyFileDialogs.java new file mode 100644 index 00000000..8820097b --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/util/tinyfd/TinyFileDialogs.java @@ -0,0 +1,526 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ +package org.lwjgl.util.tinyfd; + +import javax.annotation.*; + +import java.nio.*; + +import org.lwjgl.*; + +import org.lwjgl.system.*; + +import static org.lwjgl.system.Checks.*; +import static org.lwjgl.system.MemoryStack.*; +import static org.lwjgl.system.MemoryUtil.*; + +/** + * Bindings to tiny file dialogs, a native dialog library with support for: + * + *
    + *
  • message / question
  • + *
  • input / password
  • + *
  • save file
  • + *
  • open file & multiple files
  • + *
  • select folder
  • + *
  • color picker
  • + *
+ * + *

The dialogs can be forced into console mode.

+ */ +public class TinyFileDialogs { + + static { + Library.loadSystem(System::load, System::loadLibrary, TinyFileDialogs.class, "org.lwjgl.tinyfd", Platform.mapLibraryNameBundled("lwjgl")); + tinyfd_winUtf8().put(0, 1); + } + + protected TinyFileDialogs() { + throw new UnsupportedOperationException(); + } + + // --- [ tinyfd_version ] --- + + private static native long ntinyfd_version(); + + @NativeType("char *") + private static String tinyfd_version() { + long __result = ntinyfd_version(); + return memASCII(__result); + } + + /** Contains tinyfd current version number. */ + public static final String tinyfd_version = tinyfd_version(); + + // --- [ tinyfd_needs ] --- + + private static native long ntinyfd_needs(); + + @NativeType("char *") + private static String tinyfd_needs() { + long __result = ntinyfd_needs(); + return memASCII(__result); + } + + /** Contains info about requirements. */ + public static final String tinyfd_needs = tinyfd_needs(); + + // --- [ tinyfd_verbose ] --- + + private static native long ntinyfd_verbose(); + + @NativeType("int *") + private static IntBuffer tinyfd_verbose() { + long __result = ntinyfd_verbose(); + return memIntBuffer(__result, 1); + } + + /** 0 (default) or 1 : on unix, prints the command line calls. */ + public static final IntBuffer tinyfd_verbose = tinyfd_verbose(); + + // --- [ tinyfd_silent ] --- + + private static native long ntinyfd_silent(); + + @NativeType("int *") + private static IntBuffer tinyfd_silent() { + long __result = ntinyfd_silent(); + return memIntBuffer(__result, 1); + } + + /** 1 (default) or 0 : on unix, hide errors and warnings from called dialog. */ + public static final IntBuffer tinyfd_silent = tinyfd_silent(); + + // --- [ tinyfd_winUtf8 ] --- + + private static native long ntinyfd_winUtf8(); + + @NativeType("int *") + private static IntBuffer tinyfd_winUtf8() { + long __result = ntinyfd_winUtf8(); + return memIntBuffer(__result, 1); + } + + // --- [ tinyfd_forceConsole ] --- + + private static native long ntinyfd_forceConsole(); + + @NativeType("int *") + private static IntBuffer tinyfd_forceConsole() { + long __result = ntinyfd_forceConsole(); + return memIntBuffer(__result, 1); + } + + /** + * Can be modified at run time. + * + *

For unix & windows: 0 (graphic mode) or 1 (console mode).

+ * + *

0: try to use a graphic solution, if it fails then it uses console mode. + * 1: forces all dialogs into console mode even when the X server is present. It will use the package dialog or dialog.exe if installed. On windows it + * only makes sense for console applications.

+ */ + public static final IntBuffer tinyfd_forceConsole = tinyfd_forceConsole(); + + // --- [ tinyfd_response ] --- + + /** Unsafe version of: {@link #tinyfd_response response} */ + public static native long ntinyfd_response(); + + /** + * If you pass "tinyfd_query" as {@code aTitle}, the functions will not display the dialogs but will fill {@code tinyfd_response} with the retain solution + * and return: + * + *

Possible values for {@code tinyfd_response} are (all lowercase) for the graphic mode: windows applescript zenity zenity3 matedialog kdialog xdialog + * tkinter gdialog gxmessage xmessage

+ * + *

For the console mode: dialog whiptail basicinput

+ */ + @NativeType("char *") + public static String tinyfd_response() { + long __result = ntinyfd_response(); + return memUTF8(__result); + } + + // --- [ tinyfd_beep ] --- + + public static native void tinyfd_beep(); + + // --- [ tinyfd_notifyPopup ] --- + + /** Unsafe version of: {@link #tinyfd_notifyPopup notifyPopup} */ + public static native int ntinyfd_notifyPopup(long aTitle, long aMessage, long aIconType); + + /** + * Displays a notification popup. + * + * @param aTitle the dialog title or {@code NULL} + * @param aMessage the message or {@code NULL}. It may contain \n and \t characters. + * @param aIconType the icon type. One of:
"info""warning""error"
+ */ + public static int tinyfd_notifyPopup(@Nullable @NativeType("char const *") ByteBuffer aTitle, @Nullable @NativeType("char const *") ByteBuffer aMessage, @NativeType("char const *") ByteBuffer aIconType) { + if (CHECKS) { + checkNT1Safe(aTitle); + checkNT1Safe(aMessage); + checkNT1(aIconType); + } + return ntinyfd_notifyPopup(memAddressSafe(aTitle), memAddressSafe(aMessage), memAddress(aIconType)); + } + + /** + * Displays a notification popup. + * + * @param aTitle the dialog title or {@code NULL} + * @param aMessage the message or {@code NULL}. It may contain \n and \t characters. + * @param aIconType the icon type. One of:
"info""warning""error"
+ */ + public static int tinyfd_notifyPopup(@Nullable @NativeType("char const *") CharSequence aTitle, @Nullable @NativeType("char const *") CharSequence aMessage, @NativeType("char const *") CharSequence aIconType) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8Safe(aTitle, true); + long aTitleEncoded = aTitle == null ? NULL : stack.getPointerAddress(); + stack.nUTF8Safe(aMessage, true); + long aMessageEncoded = aMessage == null ? NULL : stack.getPointerAddress(); + stack.nASCII(aIconType, true); + long aIconTypeEncoded = stack.getPointerAddress(); + return ntinyfd_notifyPopup(aTitleEncoded, aMessageEncoded, aIconTypeEncoded); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ tinyfd_messageBox ] --- + + /** Unsafe version of: {@link #tinyfd_messageBox messageBox} */ + public static native int ntinyfd_messageBox(long aTitle, long aMessage, long aDialogType, long aIconType, int aDefaultButton); + + /** + * Displays a message dialog. + * + * @param aTitle the dialog title or {@code NULL} + * @param aMessage the message or {@code NULL}. It may contain \n and \t characters. + * @param aDialogType the dialog type. One of:
"ok""okcancel""yesno""yesnocancel"
+ * @param aIconType the icon type. One of:
"info""warning""error""question"
+ * @param aDefaultButton 0 for cancel/no, 1 for ok/yes + * + * @return 0 for cancel/no, 1 for ok/yes, 2 for no in yesnocancel + */ + @NativeType("int") + public static boolean tinyfd_messageBox(@Nullable @NativeType("char const *") ByteBuffer aTitle, @Nullable @NativeType("char const *") ByteBuffer aMessage, @NativeType("char const *") ByteBuffer aDialogType, @NativeType("char const *") ByteBuffer aIconType, @NativeType("int") boolean aDefaultButton) { + if (CHECKS) { + checkNT1Safe(aTitle); + checkNT1Safe(aMessage); + checkNT1(aDialogType); + checkNT1(aIconType); + } + return ntinyfd_messageBox(memAddressSafe(aTitle), memAddressSafe(aMessage), memAddress(aDialogType), memAddress(aIconType), aDefaultButton ? 1 : 0) != 0; + } + + /** + * Displays a message dialog. + * + * @param aTitle the dialog title or {@code NULL} + * @param aMessage the message or {@code NULL}. It may contain \n and \t characters. + * @param aDialogType the dialog type. One of:
"ok""okcancel""yesno""yesnocancel"
+ * @param aIconType the icon type. One of:
"info""warning""error""question"
+ * @param aDefaultButton 0 for cancel/no, 1 for ok/yes + * + * @return 0 for cancel/no, 1 for ok/yes, 2 for no in yesnocancel + */ + @NativeType("int") + public static boolean tinyfd_messageBox(@Nullable @NativeType("char const *") CharSequence aTitle, @Nullable @NativeType("char const *") CharSequence aMessage, @NativeType("char const *") CharSequence aDialogType, @NativeType("char const *") CharSequence aIconType, @NativeType("int") boolean aDefaultButton) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8Safe(aTitle, true); + long aTitleEncoded = aTitle == null ? NULL : stack.getPointerAddress(); + stack.nUTF8Safe(aMessage, true); + long aMessageEncoded = aMessage == null ? NULL : stack.getPointerAddress(); + stack.nASCII(aDialogType, true); + long aDialogTypeEncoded = stack.getPointerAddress(); + stack.nASCII(aIconType, true); + long aIconTypeEncoded = stack.getPointerAddress(); + return ntinyfd_messageBox(aTitleEncoded, aMessageEncoded, aDialogTypeEncoded, aIconTypeEncoded, aDefaultButton ? 1 : 0) != 0; + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ tinyfd_inputBox ] --- + + /** Unsafe version of: {@link #tinyfd_inputBox inputBox} */ + public static native long ntinyfd_inputBox(long aTitle, long aMessage, long aDefaultInput); + + /** + * Displays an input dialog. + * + * @param aTitle the dialog title or {@code NULL} + * @param aMessage the message or {@code NULL}. May NOT contain \n and \t characters on Windows. + * @param aDefaultInput if {@code NULL} it's a password box + * + * @return the input value or {@code NULL} on cancel + */ + @Nullable + @NativeType("char const *") + public static String tinyfd_inputBox(@Nullable @NativeType("char const *") ByteBuffer aTitle, @Nullable @NativeType("char const *") ByteBuffer aMessage, @Nullable @NativeType("char const *") ByteBuffer aDefaultInput) { + if (CHECKS) { + checkNT1Safe(aTitle); + checkNT1Safe(aMessage); + checkNT1Safe(aDefaultInput); + } + long __result = ntinyfd_inputBox(memAddressSafe(aTitle), memAddressSafe(aMessage), memAddressSafe(aDefaultInput)); + return memUTF8Safe(__result); + } + + /** + * Displays an input dialog. + * + * @param aTitle the dialog title or {@code NULL} + * @param aMessage the message or {@code NULL}. May NOT contain \n and \t characters on Windows. + * @param aDefaultInput if {@code NULL} it's a password box + * + * @return the input value or {@code NULL} on cancel + */ + @Nullable + @NativeType("char const *") + public static String tinyfd_inputBox(@Nullable @NativeType("char const *") CharSequence aTitle, @Nullable @NativeType("char const *") CharSequence aMessage, @Nullable @NativeType("char const *") CharSequence aDefaultInput) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8Safe(aTitle, true); + long aTitleEncoded = aTitle == null ? NULL : stack.getPointerAddress(); + stack.nUTF8Safe(aMessage, true); + long aMessageEncoded = aMessage == null ? NULL : stack.getPointerAddress(); + stack.nUTF8Safe(aDefaultInput, true); + long aDefaultInputEncoded = aDefaultInput == null ? NULL : stack.getPointerAddress(); + long __result = ntinyfd_inputBox(aTitleEncoded, aMessageEncoded, aDefaultInputEncoded); + return memUTF8Safe(__result); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ tinyfd_saveFileDialog ] --- + + /** + * Unsafe version of: {@link #tinyfd_saveFileDialog saveFileDialog} + * + * @param aNumOfFilterPatterns the number of patterns in {@code aFilterPatterns} + */ + public static native long ntinyfd_saveFileDialog(long aTitle, long aDefaultPathAndFile, int aNumOfFilterPatterns, long aFilterPatterns, long aSingleFilterDescription); + + /** + * Displays a file save dialog. + * + * @param aTitle the dialog title or {@code NULL} + * @param aDefaultPathAndFile the default path and/or file or {@code NULL} + * @param aFilterPatterns an array of file type patterns ({@code NULL} or {"*.jpg","*.png"} + * @param aSingleFilterDescription {@code NULL} or "image files" + * + * @return the selected file path or {@code NULL} on cancel + */ + @Nullable + @NativeType("char const *") + public static String tinyfd_saveFileDialog(@Nullable @NativeType("char const *") ByteBuffer aTitle, @Nullable @NativeType("char const *") ByteBuffer aDefaultPathAndFile, @Nullable @NativeType("char const * const *") PointerBuffer aFilterPatterns, @Nullable @NativeType("char const *") ByteBuffer aSingleFilterDescription) { + if (CHECKS) { + checkNT1Safe(aTitle); + checkNT1Safe(aDefaultPathAndFile); + checkNT1Safe(aSingleFilterDescription); + } + long __result = ntinyfd_saveFileDialog(memAddressSafe(aTitle), memAddressSafe(aDefaultPathAndFile), remainingSafe(aFilterPatterns), memAddressSafe(aFilterPatterns), memAddressSafe(aSingleFilterDescription)); + return memUTF8Safe(__result); + } + + /** + * Displays a file save dialog. + * + * @param aTitle the dialog title or {@code NULL} + * @param aDefaultPathAndFile the default path and/or file or {@code NULL} + * @param aFilterPatterns an array of file type patterns ({@code NULL} or {"*.jpg","*.png"} + * @param aSingleFilterDescription {@code NULL} or "image files" + * + * @return the selected file path or {@code NULL} on cancel + */ + @Nullable + @NativeType("char const *") + public static String tinyfd_saveFileDialog(@Nullable @NativeType("char const *") CharSequence aTitle, @Nullable @NativeType("char const *") CharSequence aDefaultPathAndFile, @Nullable @NativeType("char const * const *") PointerBuffer aFilterPatterns, @Nullable @NativeType("char const *") CharSequence aSingleFilterDescription) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8Safe(aTitle, true); + long aTitleEncoded = aTitle == null ? NULL : stack.getPointerAddress(); + stack.nUTF8Safe(aDefaultPathAndFile, true); + long aDefaultPathAndFileEncoded = aDefaultPathAndFile == null ? NULL : stack.getPointerAddress(); + stack.nUTF8Safe(aSingleFilterDescription, true); + long aSingleFilterDescriptionEncoded = aSingleFilterDescription == null ? NULL : stack.getPointerAddress(); + long __result = ntinyfd_saveFileDialog(aTitleEncoded, aDefaultPathAndFileEncoded, remainingSafe(aFilterPatterns), memAddressSafe(aFilterPatterns), aSingleFilterDescriptionEncoded); + return memUTF8Safe(__result); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ tinyfd_openFileDialog ] --- + + /** + * Unsafe version of: {@link #tinyfd_openFileDialog openFileDialog} + * + * @param aNumOfFilterPatterns the number of patterns in {@code aFilterPatterns} + */ + public static native long ntinyfd_openFileDialog(long aTitle, long aDefaultPathAndFile, int aNumOfFilterPatterns, long aFilterPatterns, long aSingleFilterDescription, int aAllowMultipleSelects); + + /** + * Displays a file open dialog. + * + * @param aTitle the dialog title or {@code NULL} + * @param aDefaultPathAndFile the default path and/or file or {@code NULL} + * @param aFilterPatterns an array of file type patterns ({@code NULL} or {"*.jpg","*.png"} + * @param aSingleFilterDescription {@code NULL} or "image files" + * @param aAllowMultipleSelects if true, multiple selections are allowed + * + * @return the file(s) selected or {@code NULL} on cancel. In case of multiple files, the separator is '|'. + */ + @Nullable + @NativeType("char const *") + public static String tinyfd_openFileDialog(@Nullable @NativeType("char const *") ByteBuffer aTitle, @Nullable @NativeType("char const *") ByteBuffer aDefaultPathAndFile, @Nullable @NativeType("char const * const *") PointerBuffer aFilterPatterns, @Nullable @NativeType("char const *") ByteBuffer aSingleFilterDescription, @NativeType("int") boolean aAllowMultipleSelects) { + if (CHECKS) { + checkNT1Safe(aTitle); + checkNT1Safe(aDefaultPathAndFile); + checkNT1Safe(aSingleFilterDescription); + } + long __result = ntinyfd_openFileDialog(memAddressSafe(aTitle), memAddressSafe(aDefaultPathAndFile), remainingSafe(aFilterPatterns), memAddressSafe(aFilterPatterns), memAddressSafe(aSingleFilterDescription), aAllowMultipleSelects ? 1 : 0); + return memUTF8Safe(__result); + } + + /** + * Displays a file open dialog. + * + * @param aTitle the dialog title or {@code NULL} + * @param aDefaultPathAndFile the default path and/or file or {@code NULL} + * @param aFilterPatterns an array of file type patterns ({@code NULL} or {"*.jpg","*.png"} + * @param aSingleFilterDescription {@code NULL} or "image files" + * @param aAllowMultipleSelects if true, multiple selections are allowed + * + * @return the file(s) selected or {@code NULL} on cancel. In case of multiple files, the separator is '|'. + */ + @Nullable + @NativeType("char const *") + public static String tinyfd_openFileDialog(@Nullable @NativeType("char const *") CharSequence aTitle, @Nullable @NativeType("char const *") CharSequence aDefaultPathAndFile, @Nullable @NativeType("char const * const *") PointerBuffer aFilterPatterns, @Nullable @NativeType("char const *") CharSequence aSingleFilterDescription, @NativeType("int") boolean aAllowMultipleSelects) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8Safe(aTitle, true); + long aTitleEncoded = aTitle == null ? NULL : stack.getPointerAddress(); + stack.nUTF8Safe(aDefaultPathAndFile, true); + long aDefaultPathAndFileEncoded = aDefaultPathAndFile == null ? NULL : stack.getPointerAddress(); + stack.nUTF8Safe(aSingleFilterDescription, true); + long aSingleFilterDescriptionEncoded = aSingleFilterDescription == null ? NULL : stack.getPointerAddress(); + long __result = ntinyfd_openFileDialog(aTitleEncoded, aDefaultPathAndFileEncoded, remainingSafe(aFilterPatterns), memAddressSafe(aFilterPatterns), aSingleFilterDescriptionEncoded, aAllowMultipleSelects ? 1 : 0); + return memUTF8Safe(__result); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ tinyfd_selectFolderDialog ] --- + + /** Unsafe version of: {@link #tinyfd_selectFolderDialog selectFolderDialog} */ + public static native long ntinyfd_selectFolderDialog(long aTitle, long aDefaultPath); + + /** + * Displays a folder selection dialog. + * + * @param aTitle the dialog title or {@code NULL} + * @param aDefaultPath the default path or {@code NULL} + */ + @Nullable + @NativeType("char const *") + public static String tinyfd_selectFolderDialog(@Nullable @NativeType("char const *") ByteBuffer aTitle, @NativeType("char const *") ByteBuffer aDefaultPath) { + if (CHECKS) { + checkNT1Safe(aTitle); + checkNT1(aDefaultPath); + } + long __result = ntinyfd_selectFolderDialog(memAddressSafe(aTitle), memAddress(aDefaultPath)); + return memUTF8Safe(__result); + } + + /** + * Displays a folder selection dialog. + * + * @param aTitle the dialog title or {@code NULL} + * @param aDefaultPath the default path or {@code NULL} + */ + @Nullable + @NativeType("char const *") + public static String tinyfd_selectFolderDialog(@Nullable @NativeType("char const *") CharSequence aTitle, @NativeType("char const *") CharSequence aDefaultPath) { + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8Safe(aTitle, true); + long aTitleEncoded = aTitle == null ? NULL : stack.getPointerAddress(); + stack.nUTF8(aDefaultPath, true); + long aDefaultPathEncoded = stack.getPointerAddress(); + long __result = ntinyfd_selectFolderDialog(aTitleEncoded, aDefaultPathEncoded); + return memUTF8Safe(__result); + } finally { + stack.setPointer(stackPointer); + } + } + + // --- [ tinyfd_colorChooser ] --- + + /** Unsafe version of: {@link #tinyfd_colorChooser colorChooser} */ + public static native long ntinyfd_colorChooser(long aTitle, long aDefaultHexRGB, long aDefaultRGB, long aoResultRGB); + + /** + * Displays a color chooser dialog. + * + * @param aTitle the dialog title or {@code NULL} + * @param aDefaultHexRGB {@code NULL} or "#FF0000" + * @param aDefaultRGB { 0 , 255 , 255 }. Used only if {@code aDefaultHexRGB} is {@code NULL}. + * @param aoResultRGB returns the selected color. {@code aDefaultRGB} and {@code aoResultRGB} can be the same array. + * + * @return the selected hexcolor as a string "#FF0000" or {@code NULL} on cancel + */ + @Nullable + @NativeType("char const *") + public static String tinyfd_colorChooser(@Nullable @NativeType("char const *") ByteBuffer aTitle, @Nullable @NativeType("char const *") ByteBuffer aDefaultHexRGB, @Nullable @NativeType("unsigned char *") ByteBuffer aDefaultRGB, @NativeType("unsigned char *") ByteBuffer aoResultRGB) { + if (CHECKS) { + checkNT1Safe(aTitle); + checkNT1Safe(aDefaultHexRGB); + checkSafe(aDefaultRGB, 3); + check(aoResultRGB, 3); + } + long __result = ntinyfd_colorChooser(memAddressSafe(aTitle), memAddressSafe(aDefaultHexRGB), memAddressSafe(aDefaultRGB), memAddress(aoResultRGB)); + return memUTF8Safe(__result); + } + + /** + * Displays a color chooser dialog. + * + * @param aTitle the dialog title or {@code NULL} + * @param aDefaultHexRGB {@code NULL} or "#FF0000" + * @param aDefaultRGB { 0 , 255 , 255 }. Used only if {@code aDefaultHexRGB} is {@code NULL}. + * @param aoResultRGB returns the selected color. {@code aDefaultRGB} and {@code aoResultRGB} can be the same array. + * + * @return the selected hexcolor as a string "#FF0000" or {@code NULL} on cancel + */ + @Nullable + @NativeType("char const *") + public static String tinyfd_colorChooser(@Nullable @NativeType("char const *") CharSequence aTitle, @Nullable @NativeType("char const *") CharSequence aDefaultHexRGB, @Nullable @NativeType("unsigned char *") ByteBuffer aDefaultRGB, @NativeType("unsigned char *") ByteBuffer aoResultRGB) { + if (CHECKS) { + checkSafe(aDefaultRGB, 3); + check(aoResultRGB, 3); + } + MemoryStack stack = stackGet(); int stackPointer = stack.getPointer(); + try { + stack.nUTF8Safe(aTitle, true); + long aTitleEncoded = aTitle == null ? NULL : stack.getPointerAddress(); + stack.nASCIISafe(aDefaultHexRGB, true); + long aDefaultHexRGBEncoded = aDefaultHexRGB == null ? NULL : stack.getPointerAddress(); + long __result = ntinyfd_colorChooser(aTitleEncoded, aDefaultHexRGBEncoded, memAddressSafe(aDefaultRGB), memAddress(aoResultRGB)); + return memUTF8Safe(__result); + } finally { + stack.setPointer(stackPointer); + } + } + +} \ No newline at end of file diff --git a/lwjgl3-fcl/src/main/java/org/lwjgl/util/tinyfd/package-info.java b/lwjgl3-fcl/src/main/java/org/lwjgl/util/tinyfd/package-info.java new file mode 100644 index 00000000..34b37ec7 --- /dev/null +++ b/lwjgl3-fcl/src/main/java/org/lwjgl/util/tinyfd/package-info.java @@ -0,0 +1,10 @@ +/* + * Copyright LWJGL. All rights reserved. + * License terms: https://www.lwjgl.org/license + * MACHINE GENERATED FILE, DO NOT EDIT + */ + +/** Contains bindings to tiny file dialogs. */ +@org.lwjgl.system.NonnullDefault +package org.lwjgl.util.tinyfd; + diff --git a/settings.gradle b/settings.gradle index 25c9616b..12be5ac5 100644 --- a/settings.gradle +++ b/settings.gradle @@ -22,3 +22,4 @@ include ':FCLauncher' include ':FCLLibrary' include ':MioCustom' include ':lwjgl-fcl' +include ':lwjgl3-fcl'